General

General Introduction Content

  • Getting Started
  • Licenses


Getting started with Eiffel

 Eiffel Home Page Eiffel Home Page

Getting started with Eiffel:
Language and Environment

This introductory documentation will let you become familiar with the essentials of the Eiffel language and method, and the EiffelStudio environment.

The online documents listed here are available as part of the delivery. If you are reading this page as part of an Eiffel installation or on a CD, the links below will take you to the local versions of the documents. You can also find all these documents on the Eiffel site at http://www.eiffel.com/doc/online/eiffel50/intro/.

1 Learning the Eiffel method and language

Two introductory documents are available here, one short and one longer:

    + Invitation to Eiffel: a general introduction.

    + An Eiffel Tutorial: a more extensive presentation.

Once you know the basics, it's always useful to take a look at the EiffelBase classes for examples and guidance. You will find them in the delivery at $ISE_EIFFEL/library/base. You might start with the list classes at $ISE_EIFFEL/library/base/structures/list.

To become truly proficient in the method, read the book Object-Oriented Software Construction, 2nd edition; for a full description of the language, get the book Eiffel: The Language. (These two links require Web access.)

2 Learning to use the EiffelStudio environment

Eiffel is not only a method and a language, it's also a great development environment, EiffelStudio, helping you throughout the entire software lifecycle, from thinking about your system, modeling it, designing it, implementing it, debugging it, measuring it, maintaining it. For an overview, read the

    + Guided Tour of EiffelStudio.

which will introduce you to the essential properties of EiffelStudio, enough to get started with your own projects.

3 General information

The following two documents present a general overview of the arguments for Eiffel:

    + Why your next project should use Eiffel

    + For the truly hurried: Eiffel: the 1-minute summary


EiffelStudio: A Guided Tour

Interactive Software Engineering

MANUAL IDENTIFICATION AND COPYRIGHT

EiffelStudio: A Guided Tour

    This document is available both locally, as part of the ISE Eiffel delivery, and on the http://docs.eiffel.com Web site. See the list of introductory documents .

    This is not an introduction to the Eiffel method and language. Follow the preceding link for Invitation to Eiffel and a longer tutorial.

1 OVERVIEW AND PREREQUISITES

2 COPYING THE EXAMPLE FILES

3 STARTING EIFFELSTUDIO AND OPENING A PROJECT

4 COMPILING AND EXECUTING A SYSTEM

5 A LOOK AT THE PROJECT DIRECTORY

6 STARTING TO BROWSE

7 CLASS VIEWS

8 PRODUCING AND EXPORTING DOCUMENTATION

9 BROWSING FEATURES

10 RETARGETING THROUGH PICK-AND-DROP

11 RECOMPILING AND EDITING

12 HANDLING SYNTAX AND VALIDITY ERRORS

13 DEBUGGING AND RUN-TIME MONITORING

14 COMPUTING PROJECT METRICS

15 GRAPHICS-BASED DESIGN

16 HOW EIFFELSTUDIO COMPILES

17 THE COMMAND-LINE COMPILER

18 EXECUTING A SYSTEM WITHIN AND WITHOUT EIFFELSTUDIO

19 APPENDIX: WRITING DOCUMENTATION FILTERS WITH EFF, THE EIFFEL FILTER FORMAT

Getting Started with Eiffel Getting Started with Eiffel

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


Getting started with the Eiffel method and language

Two introductory documents are available, one short and one longer:

    + Invitation to Eiffel: a general introduction

    + An Eiffel Tutorial, providing a more extensive presentation

Once you know the basics, it's always useful to take a look at the EiffelBase classes for examples and guidance. You will find them in the delivery at $ISE_EIFFEL/library/base where $ISE_EIFFEL is the directory (folder) where you have installed ISE Eiffel. You might start with the list classes at $ISE_EIFFEL/library/base/structures/list.

To become truly proficient in the method, read the book Object-Oriented Software Construction, 2nd edition; for a full description of the language, get the book Eiffel: The Language. (These two links require Web access.)

Other introductory documentation

See the list of introductory documents covering not only the language but also the environment and general presentations of Eiffel.


----- Invitation to Eiffel -----

Getting Started with Eiffel Getting Started with Eiffel

Invitation to Eiffel

Interactive Software Engineering

MANUAL IDENTIFICATION AND COPYRIGHT

Invitation to Eiffel

    This document is available both locally, as part of the ISE Eiffel delivery, and on the http://docs.eiffel.com Web site. See the list of introductory documents .

    This is not an introduction to the EiffelStudio development environment. Follow the preceding link for a Guided Tour of EiffelStudio.

    You will also find there a detailed Eiffel Tutorial.

1 WHAT MUST I KNOW FIRST?

2 DESIGN PRINCIPLES

3 OBJECT-ORIENTED DESIGN

4 CLASSES

5 TYPES

6 DESIGN BY CONTRACT AND ASSERTIONS

7 EXCEPTIONS

8 EVENT-DRIVEN PROGRAMMING AND AGENTS

9 GENERICITY

10 INHERITANCE

11 POLYMORPHISM AND DYNAMIC BINDING

12 COMBINING GENERICITY AND INHERITANCE

13 DEFERRED CLASSES AND SEAMLESS DEVELOPMENT

14 PUTTING A SYSTEM TOGETHER

Getting Started with Eiffel Getting Started with Eiffel

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


1 WHAT MUST I KNOW FIRST?

This Invitation assumes that you have some experience of software development, but that's all. Previous exposure to object technology is not required. If you've had it, it will help; but if it has all been to notations like UML or programming languages like C++ and Java, you should not let it guide your study of this Invitation. Although Eiffel shares a number of properties with these other approaches, it takes a fresh path to object technology, based on a small number of simple, far-reaching concepts.

Once you are familiar with the basic ideas you may want to try them with EiffelStudio, which provides a direct implementation of the Eiffel concepts, available in a completely portable way across Windows, Linux, many versions of Unix and VMS.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


2 DESIGN PRINCIPLES

The aim of Eiffel is to help specify, design, implement and modify quality software. This goal of quality in software is a combination of many factors; the language design concentrated on the three factors which, in the current state of the industry, are in direct need of improvements: reusability , extendibility and reliability . Also important were other factors such as efficiency , openness and portability .

Reusability is the ability to produce components that may serve in many different applications. Central to the Eiffel approach is the presence of predefined libraries such as EiffelBase, and the language's support for the production of new libraries.

Extendibility is the ability to produce easily modifiable software. "Soft" as software is supposed to be, it is notoriously hard to modify software systems, especially large ones.

Among quality factors, reusability and extendibility play a special role: satisfying them means having less software to write -- and hence more time to devote to other important goals such as efficiency, ease of use or integrity.

The third fundamental factor is reliability, the ability to produce software that is correct and robust -- that is to say, bug-free. Eiffel techniques such as static typing, assertions, disciplined exception handling and automatic garbage collection are essential here.

Three other factors are also part of Eiffel's principal goals:

    + The language enables implementors to produce high efficiency compilers, so that systems developed with Professional Eiffel may run under speed and space conditions similar to those of programs written in lower-level languages.

    + Ensuring openness , so that Eiffel software may cooperate with programs written in other languages.

    + Guaranteeing portability by a platform-independent language definition, so that the same semantics may be supported on many different platforms.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


3 OBJECT-ORIENTED DESIGN

To achieve reusability, extendibility and reliability, the principles of object-oriented design provide the best known technical answer.

An in-depth discussion of these principles falls beyond the scope of this introduction but here is a short definition:

    Object-oriented design is the construction of software systems as structured collections of abstract data type implementations, or "classes".

The following points are worth noting in this definition:

    + The emphasis is on structuring a system around the types of objects it manipulates (not the functions it performs on them) and on reusing whole data structures together with the associated operations (not isolated routines).

    + Objects are described as instances of abstract data types -- that is to say, data structures known from an official interface rather than through their representation.

    + The basic modular unit, called the class, describes one implementation of an abstract data type (or, in the case of "deferred" classes, as studied below, a set of possible implementations of the same abstract data type).

    + The word collection reflects how classes should be designed: as units which are interesting and useful on their own, independently of the systems to which they belong, and may be reused by many different systems. Software construction is viewed as the assembly of existing classes, not as a top-down process starting from scratch.

    + Finally, the word structured reflects the existence of two important relations between classes: the client and inheritance relations.

Eiffel makes these techniques available to developers in a simple and practical way.

As a language, Eiffel includes more than presented in this introduction, but not much more; it is a small language, not much bigger (by such a measure as the number of keywords) than Pascal. It was meant to be a member of the class of languages which programmers can master entirely -- as opposed to languages of which most programmers know only a subset. Yet it is appropriate for the development of industrial software systems, as has by now been shown by many full-scale projects, some in the thousands of classes and hundreds of thousands of lines, in companies around the world.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


4 CLASSES

A class, it was said above, is an implementation of an abstract data type. This means that it describes a set of run-time objects, characterized by the features (operations) applicable to them, and by the formal properties of these features.

Such objects are called the direct instances of the class. Classes and objects should not be confused: "class" is a compile-time notion, whereas objects only exist at run time. This is similar to the difference that exists in classical programming between a program and one execution of that program, or between a type and a run-time value of that type.

"Object-Oriented" is a misnomer; "Class-Oriented Analysis, Design and Programming" would be a more accurate description of the method.

To see what a class looks like, let us look at a simple example, ACCOUNT , which describes bank accounts. But before exploring the class itself it is useful to study how it may be used by other classes, called its clients .

A class X may become a client of ACCOUNT by declaring one or more entities of type ACCOUNT . Such a declaration is of the form:

    acc: ACCOUNT

The term "entity" generalizes the more common notion of "variable". An entity declared of a reference type, such as acc , may at any time during execution become " attached to " an object; the type rules imply that this object must be a direct instance of ACCOUNT -- or, as seen below, of a "descendant" of that class.

An entity is said to be void if it is not attached to any object. By default, entities are void at initialization. To obtain objects at run-time, a routine r appearing in the client class X may use a creation instruction of the form

    create acc

which creates a new direct instance of ACCOUNT , attaches acc to that instance, and initializes all its fields to default values. A variant of this notation, studied below, makes it possible to override the default initializations.

Once the client has attached acc to an object, it may call on this object the features defined in class ACCOUNT . Here is an extract with some feature calls using acc as their target:

    acc . open ("Jill")

    acc . deposit (5000)

    if acc . may_withdraw (3000) then

    acc . withdraw (3000); print (acc . balance)

    end

These feature calls use dot notation, of the form target . feature_name , possibly followed by a list of arguments in parentheses. Features are of two kinds:

    + Routines , such as open , deposit , may_withdraw , withdraw , represent computations applicable to instances of the class.

    + Attributes represent data items associated with these instances.

Routines are further divided into procedures (commands, which do not return a value) and functions (queries, returning a value). Here may_withdraw is a function returning a boolean; the other three-routines called are procedures.

A note on syntax: you may separate instructions by semicolons, and indeed you should when, as on the next-to-last line of the example, two or more instructions appear on a line. But the language's syntax has been designed so that the semicolon is almost always optional , regardless of the layout. Indeed the practice is to omit it between instructions or declarations on separate lines, as this results in lighter, clearer software texts.

In class ACCOUNT , is feature balance an attribute, or is it a function with no argument? The above extract of the client class X doesn't say, and this ambiguity is intentional. A client of ACCOUNT must not need to know how class ACCOUNT delivers an account's balance when requested: by looking up a field present in each account object, or by calling a function that computes the balance from other fields. Choosing between these techniques is the business of class ACCOUNT , not anybody else's. Because such implementation choices are often changed over the lifetime of a project, it is essential to protect clients against their effects. This is known as the Uniform Access Principle , stating that the choice between representing a property through memory (an attribute) or through an algorithm (function) shall not affect how clients use it.

So much for how client classes will typically use ACCOUNT. Below is a first sketch of how class ACCOUNT itself might look. Line segments beginning with -- are comments. The class includes two feature clauses, introducing its features. The first begins with just the keyword feature , without further qualification; this means that the features declared in this clause are available (or "exported") to all clients of the class. The second clause is introduced by feature { NONE } to indicate that the feature that follows, called add , is available to no client. What appears between the braces is a list of client classes to which the corresponding features are available; NONE is a special class of the Kernel Library, which has no instances, so that add is in effect a secret feature, available only locally to the other routines of class ACCOUNT . So in a client class such as X , the call acc . add ( -3000 ) would be invalid.

    class ACCOUNT feature

    balance: INTEGER

    owner: PERSON

    minimum_balance: INTEGER is 1000

    open (who: PERSON) is

    -- Assign the account to owner who.

    do

    owner := who

    end

    deposit (sum: INTEGER) is

    -- Deposit sum into the account.

    do

    add (sum)

    end

    withdraw (sum: INTEGER) is

    -- Withdraw sum from the account.

    do

    add (-sum)

    end

    may_withdraw (sum: INTEGER): BOOLEAN is

    -- Is there enough money to withdraw sum?

    do

    Result := (balance >= sum + minimum_balance)

    end

    feature {NONE}

    add (sum: INTEGER) is

    -- Add sum to the balance.

    do

    balance := balance + sum

    end

    end -- class ACCOUNT

Let us examine the features in sequence. The is ... do ... end distinguishes routines from attributes. So here the class has implemented balance as an attribute, although, as noted, a function would also have been acceptable. Feature owner is also an attribute.

The language definition guarantees automatic initialization, so that the initial balance of an account object will be zero after a creation instruction. Each type has a default initial value: zero for INTEGER and REAL , false for BOOLEAN , null character for CHARACTER , and a void reference for reference types. The class designer may also provide clients with different initialization options, as will be seen below in a revised version of this example.

The other public features, open, deposit, withdraw and may_withdraw are straightforward routines. The special entity Result , used in may_withdraw , denotes the function result; it is initialized on function entry to the default value of the function's result type. You may only use Result in functions.

The secret procedure add serves for the implementation of the public procedures deposit and withdraw ; the designer of ACCOUNT judged it too general to be exported by itself. The clause is 1000 introduces minimum_balance as a constant attribute, which will not occupy any space in instances of the class; in contrast, every instance has a field for every non-constant attribute such as balance .

In Eiffel's object-oriented programming style any operation is relative to a certain object. A client invoking the operation specifies this object by writing the corresponding entity on the left of the dot, as acc in acc . open ( "Jill" ). Within the class, however, the "current" instance to which operations apply usually remains implicit, so that unqualified feature names, such as owner in procedure open or add in deposit , mean "the owner attribute or add routine relative to the current instance".

If you need to denote the current object explicitly, you may use the special entity Current . For example the unqualified occurrences of add appearing in the class text above are equivalent to Current . add .

In some cases, infix or prefix notation will be more convenient than dot notation. For example, if a class VECTOR offers an addition routine, most people will feel more comfortable with calls of the form v + w than with the dot-notation call v . plus ( w ). To make this possible it suffices to give the routine a name of the form infix "+" rather than plus ; internally, however, the operation is still a normal routine call. Prefix operators are similarly available.

The above simple example has shown the basic structuring mechanism of the language: the class. A class describes objects accessible to clients through an official interface comprising some of the class features. Features are implemented as attributes or routines; the implementation of exported features may rely on other, secret ones.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


5 TYPES

Eiffel is strongly typed for readability and reliability. Every entity is declared of a certain type, which may be either a reference type or an expanded type.

Any type T is based on a class, which defines the operations that will be applicable to instances of T . The difference between the two categories of type affects the semantics of an entity x declared of type T : for a reference type, the most common case, possible values for x are references to objects; for an expanded type, the values are objects. In both cases, the type rules guarantee that the objects will be instances of T .

A non-expanded class such as ACCOUNT yields a reference type. As a result, an entity of type ACCOUNT , such as acc in the earlier client example (see the declaration of acc and the accompanying picture as given on page 6 ), denotes possible run-time references to objects of type ACCOUNT.

In contrast, the value of an entity acc declared of type expanded ACCOUNT is an object such as the one shown on the figure below, with no reference. The only difference with the earlier figure is that the value of acc is now an ACCOUNT object, not a reference to such an object. No creation instruction is needed in this case. (The figure does not show the PERSON object to which the owner field of the ACCOUNT object -- itself a reference -- is attached.)

An important group of expanded types, based on library classes, includes the basic types INTEGER, REAL, DOUBLE, CHARACTER and BOOLEAN . Clearly, the value of an entity declared of type INTEGER should be an integer, not a reference to an object containing an integer value. Operations on these types are defined by prefix and infix operators such as "+" and "<".

As a result of these conventions, the type system is uniform and consistent: all types, including the basic types, are defined from classes, either as reference types or as expanded types.

In the case of basic types, for obvious reasons of efficiency, the ISE Eiffel compilation mechanism implements the standard arithmetic and boolean operations directly through the corresponding machine operations, not through routine calls. But this is only a compiler optimization, which does not hamper the conceptual homogeneity of the type edifice.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


6 DESIGN BY CONTRACT AND ASSERTIONS

If classes are to deserve their definition as abstract data type implementations, they must be known not just by the available operations, but also by the formal properties of these operations, which did not yet appear in the preceding example.

The role of assertions

Eiffel encourages software developers to express formal properties of classes by writing assertions , which may in particular appear in the following roles:

    + Routine preconditions express the requirements that clients must satisfy whenever they call a routine. For example the designer of ACCOUNT may wish to permit a withdrawal operation only if it keeps the account's balance at or above the minimum. Preconditions are introduced by the keyword require .

    + Routine postconditions , introduced by the keyword ensure , express conditions that the routine (the supplier) guarantees on return, if the precondition was satisfied on entry.

    + A class invariant must be satisfied by every instance of the class whenever the instance is externally accessible: after creation, and after any call to an exported routine of the class. The invariant appears in a clause introduced by the keyword invariant , and represents a general consistency constraint imposed on all routines of the class.

With appropriate assertions, the class ACCOUNT becomes:

    class ACCOUNT create

    make

    feature

    ... Attributes as before:
    balance , minimum_balance , owner , open ...

    deposit (sum: INTEGER) is

    -- Deposit sum into the account.

    require

    sum >= 0

    do

    add (sum)

    ensure

    balance = old balance + sum

    end

    withdraw (sum: INTEGER) is

    -- Withdraw sum from the account.

    require

    sum >= 0

    sum <= balance - minimum_balance

    do

    add (-sum)

    ensure

    balance = old balance - sum

    end

    may_withdraw ... -- As before

    feature {NONE}

    add ... -- As before

    make (initial: INTEGER) is

    -- Initialize account with balance initial.

    require

    initial >= minimum_balance

    do

    balance := initial

    end

    invariant

    balance >= minimum_balance

    end -- class ACCOUNT

The notation old expression is only valid in a routine postcondition. It denotes the value the expression had on routine entry.

Creation procedures

In its last version above, the class now includes a creation procedure, make . With the first version , clients used creation instructions such as create acc1 to create accounts; but then the default initialization, setting balance to zero, violated the invariant. By having one or more creation procedures, listed in the create clause at the beginning of the class text, a class offers a way to override the default initializations. The effect of

    create acc1 . make ( 5_500 )

is to allocate the object (as with the default creation) and to call procedure make on this object, with the argument given. This call is correct since it satisfies the precondition; it will ensure the invariant.

The underscore _ in the integer constant 5_500 has no semantic effect. The general rule is that you can group digits by sets of three from the right to improve the readability of integer constants.

Note that the same keyword, create , serves both to introduce creation instructions and the creation clause listing creation procedures at the beginning of the class.

A procedure listed in the creation clause, such as make , otherwise enjoys the same properties as other routines, especially for calls. Here the procedure make is secret since it appears in a clause starting with feature { NONE } ; so it would be invalid for a client to include a call such as

    acc . make ( 8_000 )

To make such a call valid, it would suffice to move the declaration of make to the first feature clause of class ACCOUNT , which carries no export restriction. Such a call does not create any new object, but simply resets the balance of a previously created account.

Design by Contract

Syntactically, assertions are boolean expressions, with a few extensions such as the old notation. Also, you may split an assertion into two or more clauses, as here with the precondition of withdraw ; this is as if you had separated the clauses with an and , but makes the assertion clearer, especially if it includes many conditions.

Assertions play a central part in the Eiffel method for building reliable object-oriented software. They serve to make explicit the assumptions on which programmers rely when they write software elements that they believe are correct. Writing assertions amounts to spelling out the terms of the contract which governs the relationship between a routine and its callers. The precondition binds the callers; the postcondition binds the routine.

The underlying theory of Design by Contract TM , the centerpiece of the Eiffel method, views software construction as based on contracts between clients (callers) and suppliers (routines), relying on mutual obligations and benefits made explicit by the assertions.

The Contract Form

Assertions are also an indispensable tool for the documentation of reusable software components: one cannot expect large-scale reuse without a precise documentation of what every component expects (precondition), what it guarantees in return (postcondition) and what general conditions it maintains (invariant).

Documentation tools in EiffelStudio use assertions to produce information for client programmers, describing classes in terms of observable behavior, not implementation. In particular the Contract Form of a class, also called its " short form ", which serves as its interface documentation, is obtained from the full text by removing all non-exported features and all implementation information such as do clauses of routines, but keeping interface information and in particular assertions. Here is the Contract Form of the above class:

    class interface ACCOUNT create

    make

    feature

    balance: INTEGER

    ...

    deposit (sum: INTEGER) is

    -- Deposit sum into the account.

    require

    sum >= 0

    ensure

    balance = old balance + sum

    withdraw (sum: INTEGER) is

    -- Withdraw sum from the account.

    require

    sum >= 0

    sum <= balance - minimum_balance

    ensure

    balance = old balance - sum

    may_withdraw ...

    end -- class ACCOUNT

This is not actual Eiffel, only documentation of Eiffel classes, hence the use of slightly different syntax to avoid any confusion ( class interface rather than class ). In accordance with the Uniform Access Principle (page 7 ), the output for balance would be the same if this feature were a function rather than an attribute.

You will find in ISE's EiffelStudio automatic tools to produce the Contract Form of a class. You can also get the Flat Contract form, based on the same ideas but including inherited features along with those introduced in the class itself. EiffelStudio can produce these forms, and other documentation views of a class, in a variety of output formats including HTML, so that collaborative projects can automatically post the latest versions of their class interfaces on the Internet or an Intranet.

Contracts for testing and debugging

Under EiffelStudio you may also set up compilation options, for the whole system or specific classes only, to evaluate assertions at run time, to uncover potential errors ("bugs"). EiffelStudio provides several levels of assertion monitoring: preconditions only, postconditions etc. When monitoring is on, an assertion which evaluates to true has no further effect on the execution. An assertion that evaluates to false will trigger an exception, as described next; unless you have written an appropriate exception handler, the exception will cause an error message and termination with a precise message and a call trace.

This ability to check assertions provides a powerful testing and debugging mechanism, in particular because the classes of the EiffelBase Libraries, widely used in Eiffel software development, are protected by carefully written assertions.

Run-time monitoring, however, is only one application of assertions, whose role as design and documentation aids, as part of the theory of Design by Contract, exerts a pervasive influence on the Eiffel style of software development.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


7 EXCEPTIONS

Whenever there is a contract, the risk exists that someone will break it. This is where exceptions come in.

Exceptions -- contract violations -- may arise from several causes. One is an assertion violation, if you've selected run-time assertion monitoring. Another is a signal triggered by the hardware or operating system to indicate an abnormal condition such as arithmetic overflow, or an attempt to create a new object when there's not enough memory available.

Unless a routine has made specific provision to handle exceptions, it will fail if an exception arises during its execution. This in turn provides one more source of exceptions: a routine that fails triggers an exception in its caller.

A routine may, however, handle an exception through a rescue clause. This optional clause attempts to "patch things up" by bringing the current object to a stable state (one satisfying the class invariant). Then it can terminate in either of two ways:

    + The rescue clause may execute a retry instruction, which causes the routine to restart its execution from the beginning, attempting again to fulfil its contract, usually through another strategy. This assumes that the instructions of the rescue clause, before the retry , have attempted to correct the cause of the exception.

    + If the rescue clause does not end with retry , then the routine fails: it returns to its caller, immediately triggering an exception. (The caller's rescue clause will be executed according to the same rules.)

The principle is that a routine must either succeed or fail : it either fulfills its contract, or not; in the latter case it must notify its caller by triggering an exception.

Usually, only a few routines of a system will explicitly include a rescue clause. A routine that doesn't have an explicit rescue is considered to have an implicit one, which calls a routine default_rescue that by default does nothing, so that an exception will cause the routine to fail immediately, propagating the exception to the caller.

An example using the exception mechanism is a routine attempt_transmission that tries to transmit a message over a phone line. The actual transmission is performed by an external, low-level routine transmit ; once started, however, transmit may abruptly fail, triggering an exception, if the line is disconnected. Routine attempt_transmission tries the transmission at most 50 times; before returning to its caller, it sets a boolean attribute successful to True or False depending on the outcome. Here is the text of the routine:

    attempt_transmission (message: STRING) is

    -- Try to transmit message , at most 50 times.

    -- Set successful accordingly.

    local

    failures: INTEGER

    do

    if failures < 50 then

    transmit (message); successful := True

    else

    successful := False

    end

    rescue

    failures := failures + 1; retry

    end

Initialization rules ensure that failures , a local entity, is set to zero on entry.

This example illustrates the simplicity of the mechanism: the rescue clause never attempts to achieve the routine's original intent; this is the sole responsibility of the body (the do clause). The only role of the rescue clause is to clean up the objects involved, and then either to fail or to retry.

This disciplined exception mechanism is essential for software developers, who need protection against unexpected events, but cannot be expected to sacrifice safety and simplicity to pay for this protection.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


8 EVENT-DRIVEN PROGRAMMING AND AGENTS

The division of roles in object technology is clear: of the two principal constituents of a system, object types and operations , the first dominates. Classes, representing object types, determines the structure of the software; every routine, representing an operations, belongs to a class.

In some circumstances it is useful to define an object that denotes an operation . This is especially useful if you want to build an object structure that refers to operations, so that you can later traverse the structure and execute the operations encountered. A typical application is event-driven programming for Graphical User Interfaces (GUI), including Web programming. In GUI programming you will want to record properties of the form

    "When the user clicks this OK button, the system must update the file"

each involves a control (here the OK button), an event (mouse click) and an operation (update the file). This can be programmed by having an "event loop", triggered for each event, which performs massive decision-making ( if "The latest event was `left mouse click on button 23" then "Appropriate instructions" else if … and so on with many branches); but this leads to bulky software architectures where introducing any new control or event requires updating a central part of the code. It's preferable to let any element of the system that encounters a new control-event-operation association

    [ control, event, operation ]

store it as a triple of objects into an object structure, such as an array or a list. Triples in that structure may come from different parts of the system; there is no central know-it-all structure. The only central element is a simple mechanism which can explore the object structure to execute each operation associated with a certain control and a certain event . The mechanism is not just simple; it's also independent of your application, since it doesn't need to know about any particular control, event or operation (it will find them in the object structure). So it can be programmed once and for all, as part of a library such as ISE's EiffelVision 2 for platform-independent graphics.

To build an object structure, we need objects. A control , an event are indeed objects. But an operation is not: it's program code -- a routine of a certain class.

Agents address this issue. An agent is an object that represents a routine , which can then be kept in an object structure. The simplest form of agent is written agent r , where r is a routine. This denotes an object. If your_agent is such an agent object, the call

    your_agent . call ([ a, b ])

where a and b are valid arguments for r , will have the same effect as a direct call to r with arguments a and b . Of course, if you know that you want to call r with those arguments, you don't need any agents; just use the direct call r ( a, b ) . The benefit of using an agent is that you can store it into an object structure to be called later , for example when an event-driven mechanism finds the agent in the object structure, associated with a certain control and a certain event. For this reason agents are also called delayed calls .

The notation [ a, b ] denotes a sequence of elements, or tuple . The reason call needs a tuple as argument, whereas the direct call r ( a, b ) doesn't, is that call is a general routine (from the EiffelBase class ROUTINE , representing agents) applicable to any agent, whereas the direct call refers explicitly to r and hence requires arguments a and b of specific types. The agent mechanism, however, is statically typed like the rest of the language; when you call call , the type checking mechanism ensures that the tuple you pass as argument contains elements a and b of the appropriate types.

A typical use of agents with EiffelVision 2 is

    ok_button . select_actions . extend ( agent your_routine )

which says: "add your_routine to the list of operations to be performed whenever a select event (left click) happens on ok_button ". ok_button . select_actions is the list of agents associated with the button and the event; in list classes, procedure extend adds an item at the end of a list. Here, the object to be added is the agent.

This enables the EiffelVision event-handling mechanism to find the appropriate agent when it processes an event, and call call on that agent to trigger the appropriate routine. EiffelVision doesn't know that it's your_routine ; in fact, it doesn't know anything about your application. It simply finds an agent in the list, and calls call on it. For your part, as the author of a graphical application, you don't need to know how EiffelVision handles events; you simply associate the desired agents with the desired controls and events, and let EiffelVision 2 do the rest.

Agents extend to many areas beyond GUIs. In numerical computation , you may use an agent to pass to an "integrator" object a numerical function to be integrated over a certain interval. In yet another area, you can use agents (as in the iteration library of EiffelBase) to program iterators : mechanisms that repetitively apply an arbitrary operation -- represented by an agent -- to every element of a list, tree or other object structure. More generally, agent embody properties of the associated routines, opening the way to mechanism for reflection , also called "introspection": the ability, during software execution, to discover properties of the software itself.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


9 GENERICITY

Building software components (classes) as implementations of abstract data types yields systems with a solid architecture but does not in itself ensure reusability and extendibility. Two key techniques address the problem: genericity (unconstrained or constrained) and inheritance. Let us look first at the unconstrained form.

To make a class generic is to give it formal generic parameters representing as unknown types, as in these examples from ISE's EiffelBase, an open-source library covering basic data structures and algorithms:

    ARRAY [G]

    LIST [G]

    LINKED_LIST [G]

These classes describe data structures -- arrays, lists without commitment to a specific representation, lists in linked representation -- containing objects of a certain type. The formal generic parameter G denotes this type.

A class such as these doesn't quite yet describe a type, but a type template, since G itself denotes an unknown type. To derive a directly usable list or array type, you must provide a type corresponding to G , called an actual generic parameter ; this may be either an expanded type, including basic types such as INTEGER , or a reference type. Here are some possible generic derivations:

    il : LIST [ INTEGER ]

    aa : ARRAY [ ACCOUNT ]

    aal : LIST [ ARRAY [ ACCOUNT ]]

As the last example indicates, an actual generic parameter may itself be generically derived.

It would not be possible, without genericity, to have static type checking in a realistic object-oriented language.

A variant of this mechanism, constrained genericity, will enable a class to place specific requirements on possible actual generic parameters. Constrained genericity will be described after inheritance.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


10 INHERITANCE

Inheritance, the other fundamental generalization mechanism, makes it possible to define a new class by combination and specialization of existing classes rather than from scratch.

The following simple example, from the Data Structure Library in EiffelBase, is typical. LIST , as noted, describes lists in any representation. One such representation if the lists have a fixed number of elements uses an array. We may define the corresponding class by combination of LIST and ARRAY , as follows:

    class ARRAYED_LIST [G] inherit

    LIST [G]

    ARRAY [G]

    export ... See below ... end

    feature

    ... Specific features of fixed-size lists ...

    end -- class ARRAYED_LIST

The inherit ... clause lists all the "parents" of the new class, which is said to be their "heir". (The "ancestors" of a class include the class itself, its parents, grandparents etc.; the reverse term is "descendant".) Declaring ARRAYED_LIST as shown ensures that all the features and properties of lists and arrays are applicable to arrayed lists as well. Since the class has more than one parent, this is a case of multiple inheritance.

Standard graphical conventions -- drawn from the Business Object Notation or BON, a graphical object-oriented notation based on concepts close to those of Eiffel, and directly supported by EiffelStudio -- illustrate such inheritance structures:

An heir class such as ARRAYED_LIST needs the ability to define its own export policy. By default, inherited features keep their export status (publicly available, secret, available to selected classes only); but this may be changed in the heir. Here, for example, ARRAYED_LIST will export only the exported features of LIST , making those of ARRAY unavailable directly to ARRAYED_LIST 's clients. The syntax to achieve this is straightforward:

    class ARRAYED_LIST [G] inherit

    LIST [G]

    ARRAY [G]

    export {NONE} all end

    ... The rest as above ...

Another example of multiple inheritance comes from a windowing system based on a class WINDOW , close to actual classes in EiffelVision 2. Windows have graphical features: a height, a width, a position, routines to scale windows, move them, and other graphical operations. The system permits windows to be nested, so that a window also has hierarchical features: access to subwindows and the parent window, adding a subwindow, deleting a subwindow, attaching to another parent and so on. Rather than writing a complex class that would contain specific implementations for all of these features, it is preferable to inherit all hierarchical features from TREE (a class in EiffelBase describing trees), and all graphical features from a class RECTANGLE .

Inheritance complements the "client" relation by providing another form of reuse that yields remarkable economies of effort -- for analysis, design, implementation, evolution -- and has a profound effect on the entire software development process.

The very power of inheritance demands adequate means to keep it under control. Multiple inheritance, in particular, raises the question of name conflicts between features inherited from different parents; this case will inevitably arise in practice, especially for classes contributed by independent developers. You may remove such a name conflict through renaming , as in

    class C inherit

    A rename x as x1, y as y1 end

    B rename x as x2, y as y2 end

    feature ...

Here, if both A and B have features named x and y , class C would be invalid without the renaming.

Renaming also serves to provide more appropriate feature names in descendants. For example, class WINDOW may inherit a routine insert_subtree from TREE . For clients of WINDOW , however, such a routine name is no longer appropriate. An application that uses this class needs coherent window terminology, and should have to concern itself with the inheritance structure that led to the class. So you may wish to rename insert_subtree as add_subwindow in the inheritance clause of WINDOW .

As a further protection against misusing multiple inheritance, the invariants of all parent classes automatically apply to a newly defined class. So classes may not be combined if their invariants are incompatible.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


11 POLYMORPHISM AND DYNAMIC BINDING

Inheritance is not just a module combination and enrichment mechanism. It also enables the definition of flexible entities that may become attached to objects of various forms at run time, a property known as polymorphism.

This remarkable facility must be reconciled with static typing. The language convention is simple: an assignment of the form a := b is permitted not only if a and b are of the same type, but more generally if a and b are of reference types A and B , based on classes A and B such that B is a descendant of A .

This corresponds to the intuitive idea that a value of a more specialized type may be assigned to an entity of a less specialized type -- but not the reverse. (As an analogy, consider that if you request vegetables, getting green vegetables is fine, but if you ask for green vegetables, receiving a dish labeled just "vegetables" is not acceptable, as it could include, say, carrots.)

What makes this possibility particularly powerful is the complementary facility: feature redefinition . A class may redefine some or all of the features which it inherits from its parents. For an attribute or function, the redefinition may affect the type, replacing the original by a descendant; for a routine it may also affect the implementation, replacing the original's routine body by a new one.

Assume for example a class POLYGON , describing polygons, whose features include an array of points representing the vertices and a function perimeter which computes a polygon's perimeter by summing the successive distances between adjacent vertices. An heir of POLYGON may begin as:

    class RECTANGLE inherit

    POLYGON redefine perimeter end

    feature -- Specific features of rectangles, such as:

    side1: REAL; side2: REAL

    perimeter: REAL is

    -- Rectangle-specific version

    do Result := 2 * (side1 + side2) end

    ... Other RECTANGLE features ...

Here it is appropriate to redefine perimeter for rectangles as there is a simpler and more efficient algorithm. Note the explicit redefine subclause (which would come after the rename if present).

Other descendants of POLYGON may also have their own redefinitions of perimeter . The version to use in any call is determined by the run-time form of the target. Consider the following class fragment:

    p: POLYGON; r: RECTANGLE

    ... create p; create r; ...

    if c then

    p := r

    end

    print (p . perimeter)

The polymorphic assignment p := r is valid because of the above rule. If condition c is false, p will be attached to an object of type POLYGON for the computation of p . perimeter , which will thus use the polygon algorithm. In the opposite case, however, p will be attached to a rectangle; then the computation will use the version redefined for RECTANGLE . This is known as dynamic binding .

Dynamic binding provides a high degree of flexibility. The advantage for clients is the ability to request an operation (such as perimeter computation) without explicitly selecting one of its variants; the choice only occurs at run-time. This is essential in large systems, where many variants may be available; dynamic binding protects each component against changes in other components.

This technique is particularly attractive when compared to its closest equivalent in traditional approaches, where you would need records with variant components, or union types (C), together with case (switch) instructions to discriminate between variants. This means that every client must know about every possible case, and that any extension may invalidate a large body of existing software.

The combination of inheritance, feature redefinition, polymorphism and dynamic binding supports a development mode in which every module is open and incremental. When you want to reuse an existing class but need to adapt it to a new context, you can define a new descendant of that class (with new features, redefined ones, or both) without any change to the original. This facility is of great importance in software development, an activity that -- by design or circumstance -- is invariably incremental.

The power of these techniques demands adequate controls. First, feature redefinition, as seen above, is explicit. Second, because the language is typed, a compiler can check statically whether a feature application a . f is correct. In contrast, dynamically typed object-oriented languages defer checks until run-time and hope for the best: if an object "sends a message" to another (that is to say, calls one of its routines) one just expects that the corresponding class, or one of its ancestors, will happen to include an appropriate routine; if not, a run-time error will occur. Such errors will not happen during the execution of a type-checked Eiffel system.

In other words, the language reconciles dynamic binding with static typing . Dynamic binding guarantees that whenever more than one version of a routine is applicable the right version (the one most directly adapted to the target object) will be selected. Static typing means that the compiler makes sure there is at least one such version.

This policy also yields an important performance benefit: in contrast with the costly run-time searches that may be needed with dynamic typing (since a requested routine may not be defined in the class of the target object but inherited from a possibly remote ancestor), the EiffelStudio implementation always finds the appropriate routine in constant-bounded time.

Assertions provide a further mechanism for controlling the power of redefinition. In the absence of specific precautions, redefinition may be dangerous: how can a client be sure that evaluation of p . perimeter will not in some cases return, say, the area? Preconditions and postconditions provide the answer by limiting the amount of freedom granted to eventual redefiners. The rule is that any redefined version must satisfy a weaker or equal precondition and ensure a stronger or equal postcondition than in the original. This means that it must stay within the semantic boundaries set by the original assertions.

The rules on redefinition and assertions are part of the Design by Contract theory, where redefinition and dynamic binding introduce subcontracting . POLYGON , for example, subcontracts the implementation of perimeter to RECTANGLE when applied to any entity that is attached at run-time to a rectangle object. An honest subcontractor is bound to honor the contract accepted by the prime contractor. This means that it may not impose stronger requirements on the clients, but may accept more general requests: weaker precondition; and that it must achieve at least as much as promised by the prime contractor, but may achieve more: stronger postcondition.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


12 COMBINING GENERICITY AND INHERITANCE

Genericity and inheritance, the two fundamental mechanisms for generalizing classes, may be combined in two fruitful ways.

The first technique yields polymorphic data structures . Assume that in the generic class LIST [ G ] the insertion procedure put has a formal argument of type G , representing the element to be inserted. Then with a declaration such as

    pl : LIST [POLYGON]

the type rules imply that in a call pl . pu t (" p ") the permitted types for the argument p include not just POLYGON , but also RECTANGLE (an heir of POLYGON ) or any other type conforming to POLYGON through inheritance.

The basic conformance requirement used here is the inheritance-based type compatibility rule: V conforms to T if V is a descendant of T .

Structures such as pl may contain objects of different types, hence the name "polymorphic data structure". Such polymorphism is, again, made safe by the type rules: by choosing an actual generic parameter ( POLYGON in the example) based higher or lower in the inheritance graph, you extend or restrict the permissible types of objects in pl . A fully general list would be declared as

    LIST [ ANY ]

where ANY , a Kernel Library class, is automatically an ancestor of any class that you may write.

The other mechanism for combining genericity and inheritance is constrained genericity . By indicating a class name after a formal generic parameter, as in

    VECTOR [ T -> NUMERIC ]

you express that only descendants of that class (here NUMERIC ) may be used as the corresponding actual generic parameters. This makes it possible to use the corresponding operations. Here, for example, class VECTOR may define a routine infix "+" for adding vectors, based on the corresponding routine from NUMERIC for adding vector elements. Then by making VECTOR itself inherit from NUMERIC , you ensure that it satisfies its own generic constraint and enable the definition of types such as VECTOR [ VECTOR [ T ]] .

As you have perhaps guessed, unconstrained genericity, as in LIST [ G ], may be viewed as an abbreviation for genericity constrained by ANY , as in

    LIST [G -> ANY].

Something else you may have guessed: if ANY , introduced in this session, is the top of the inheritance structure -- providing all classes with universal features such as equal to compare arbitrary objects and clone to duplicate objects -- then NONE , seen earlier in the notation feature { NONE } , is its bottom. NONE indeed conceptually inherits from all other classes. NONE is, among other things, the type of Void , the void reference.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


13 DEFERRED CLASSES AND SEAMLESS DEVELOPMENT

The inheritance mechanism includes one more major notion: deferred features and classes.

Declaring a feature f as deferred in a class C expresses that there is no default implementation of f in C ; such implementations will appear in eventual descendants of C . A class that has one or more deferred routines is itself said to be deferred. A non-deferred routine or class -- like all those seen until now -- is said to be effective .

For example, a system used by a Department of Motor Vehicles to register vehicles might include a class of the form

    deferred class VEHICLE feature

    dues_paid (year: INTEGER): BOOLEAN is

    do ... end

    valid_plate (year: INTEGER): BOOLEAN is

    do ... end

    register (year: INTEGER) is

    -- Register vehicle for year.

    require

    dues_paid (year)

    deferred

    ensure

    valid_plate (year)

    end

    ... Other features, deferred or effective...

    end -- class VEHICLE

This example assumes that no single registration algorithm applies to all kinds of vehicle; passenger cars, motorcycles, trucks etc. are all registered differently. But the same precondition and postcondition apply in all cases. The solution is to treat register as a deferred routine, making VEHICLE a deferred class. Descendants of class VEHICLE , such as CAR or TRUCK , effect this routine, that is to say, give effective versions. An effecting is similar to a redefinition; only here there is no effective definition in the original class, just a specification in the form of a deferred routine. The term redeclaration covers both redefinition and effecting.

Whereas an effective class described an implementation of an abstract data types, a deferred class describes a set of possible implementations. You may not instantiate a deferred class: create v is invalid if v is declared of type VEHICLE . But you may assign to v a reference to an instance of an effective descendant of VEHICLE . For example, assuming CAR and TRUCK provide effective definitions for all deferred routines of VEHICLE , the following will be valid:

    v : VEHICLE ; c : CAR ; t : TRUCK

    ...

    create c ... ; create t ... ; ...

    if "Some test" then v := c else v := t end

    v . register ( 2003 )

This example fully exploits polymorphism: depending on the outcome of "Some test", v will be treated as a car or a truck, and the appropriate registration algorithm will be applied. Also, "Some test" may depend on some event whose outcome is impossible to predict until run-time, for example the user clicking with the mouse to select one among several vehicle icons displayed on the screen.

Deferred classes are particularly useful at the design stage. The first version of a module may be a deferred class, which will later be refined into one or more effective classes. Eiffel's Design by Contract mechanisms are essential here: you may a precondition and a postcondition with a routine even though it is a deferred routine (as with register above), and an invariant with a class even though it is a deferred class. This enables you, as a designer, to attach precise semantics to a module at the design stage long before you will make any implementation choices.

Beyond design and implementation, these techniques extend to the earliest stage of development, analysis . Deferred classes written at that stage describe not software objects, but objects from the external world being modelled -- documents, airplanes, investments. Here again the presence of contracts to express constraints, and the language's other structuring facilities, provide an attractive combination.

Eiffel appears here in its full role of a lifecycle approach, covering areas traditionally considered separate: program implementation, the traditional province of development environments; system modeling and architecture, the traditional province of CASE tools based on UML or similar notations disconnected from the rest of the lifecycle. Eiffel instead emphasizes the fundamental unity of the software process and the usefulness of a single set of notations, concepts and tools applicable throughout. Such a seamless approach is indispensable to support the inevitable reversals that occur during the process of building software, such as detecting at implementation time a problem that leads to a change in the system's functionality, set at analysis time. The use of separate tools and notations, such as UML on one side and a programming language on the other, makes such round-trips difficult at best and often leads to monolithic, hard-to-change software. Eiffel lets you focus on the issues, without interposing artificial barriers between different software development activities. You'll use the fundamental problem-solving techniques -- data abstraction through classes, precise specification through contracts, modularity through information hiding, rational organization through inheritance, decentralized architecture through dynamic binding, parameterization of the solution through genericity, reusability through all these techniques -- all along; only the level of abstraction changes.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


14 PUTTING A SYSTEM TOGETHER

We have now studied the constituents of Eiffel software. It remains to see how you can combine these elements into executable systems -- the Eiffel concept closest to the traditional notion of program -- and libraries.

How do you get an executable system? All you need is to

    + Provide a set of classes, called a universe .

    + Designate of these classes as the root class .

    + Designate one of its creation procedures as the root procedure .

This defines what it means to execute the system: create one direct instance of the root class (the execution's root object ); and call the root procedure on it. That's all.

In any practical case, the root procedure will create other objects, call other routines on them, leading to further creations and calls.

For the system to be valid, it must include all the classes which the root needs directly or indirectly; a class "needs" another if it is one of its heirs or clients.

We can generalize these notions to encompass a library rather than an executable system, by accepting NONE as root class. Since NONE inherits from all other classes, it needs all the classes in the universe; compiling with NONE as root will compile all classes. In this case you don't specify a root procedure, and the result is not executable.

The Eiffel method suggests grouping related classes -- typically 5 to 40 classes -- into collections called clusters . A universe is then a set of clusters. For example the EiffelBase library is divided into clusters corresponding each to a major category of data structure: lists , tables , iteration and so on. You can nest clusters, using for example EiffelBase, with its own subclusters as listed, as a cluster of your system.

How will you specify a universe? Any Eiffel implementation can use its own conventions. EiffelStudio applies a simple policy:

    + Store each class in a single file, called its class file, with a name of the form name . e . For clarity, name should be the lower-case version of the class name, although this is a style rule, not a requirement.

    + Put all the class files of a cluster into a single directory (folder on Windows), called its cluster directory.

It is desirable for clarity, as a style rule, to separate clusters that directly contain classes ("terminal clusters") from those that have subclusters. Cluster directories will then contain class files or cluster subdirectories, but not both.

    + To specify a system, it suffices to provide a list of cluster directories, along with the name of the root class and root procedure. The universe consists of the classes contained in all the class files in the listed cluster directories.

Here is an example of such a system specification. It's not written in Eiffel, although it definitely has an Eiffel-like flavor. It is called an Ace (Assembly of Classes in Eiffel) and written in the Eiffel-like Lace notation (Language for the Assembly of Classes in Eiffel). The backward slash \ is the Windows path separator; Unix uses a forward slash / for the same purpose (EiffelStudio will accept both on Windows).

    system

    example

    root

    CALCULATOR (my_cluster1): "make"

    default

    assertion ( ensure )

    precompiled

    (" $ ISE_EIFFEL \ precomp\ spec\ $ PLATFORM\ base")

    cluster

    my_cluster1: "mydir\ project1\ subdir"

    her_cluster2: "herdir \project2\ subdir1\ subdir2"

    end

With EiffelStudio you don't have to write the Ace yourself; just specify the information interactively through the Preferences dialog and EiffelStudio will generate the Ace. You can also reuse and adapt one of the many example Aces in the delivery.

So you don't need to learn the syntax of Lace, although as the example shows it is straightforward. The Ace first gives the system a name, example , which will also serve as the name of the generated executable. It then specifies the root class, its cluster (optional), and the root procedure. Next, in the default clause, come compilation options; you can specify assertion monitoring, with choices that include none , require (preconditions only, the default), ensure (preconditions and postconditions, as here) and invariant (the previous two plus class invariants). You can also specify various levels of assertion monitoring separately for a cluster, or for a specific class. The precompiled option specifies use of a precompiled library, EiffelBase, at the path given. The Ace ends with a list of clusters, other than those of EiffelBase, specifying for a cluster name, such as my_cluster1 , and the directory where it resides.

The path names in this example use the Windows path separator, a backward slash \ . Unix uses a forward slash / (also acceptable on Windows) for the same purpose.

This Ace is from an example in the delivery. If you compile and execute it, it will create an instance of class CALCULATOR and call its make procedure. This starts a small interactive calculator, illustrating some of the simple mechanisms of EiffelBase.

Previous sectionUp

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


MANUAL IDENTIFICATION AND COPYRIGHT

Title: Invitation to Eiffel , ISE Technical Report TR-EI-67/IV.

Publication history

First published 1987. Some revisions (in particular Web versions) have used the title " Eiffel in a Nutshell "
This version: July 2001. Introduces coverage of agents; several other improvements. Corresponds to release 5.0 of the ISE Eiffel environment.

Author

Bertrand Meyer.

Software credits

See acknowledgments in book Eiffel: The Language .

Cover design

Rich Ayling.

Copyright notice and proprietary information

Copyright © Interactive Software Engineering Inc. (ISE), 2001. May not be reproduced in any form (including electronic storage) without the written permission of ISE. "Eiffel Power" and the Eiffel Power logo are trademarks of ISE.

All uses of the product documented here are subject to the terms and conditions of the ISE Eiffel user license. Any other use or duplication is a violation of the applicable laws on copyright, trade secrets and intellectual property.

Special duplication permission for educational institutions

Degree-granting educational institutions using ISE Eiffel for teaching purposes as part of the Eiffel University Partnership Program may be permitted under certain conditions to copy specific parts of this book. Contact ISE for details.

    About ISE

    ISE (Interactive Software Engineering) helps you produce software better, faster and cheaper.

    ISE provides a wide range of products and services based on object technology, including ISE Eiffel, a complete development environment for the full system lifecycle. ISE's training courses, available worldwide, cover key management and technical topics. ISE's consultants are available to address your project needs at all levels.

    ISE's TOOLS (Technology of Object-Oriented Languages and Systems) conferences, http://www.tools-conferences.com , are the meeting point for anyone interested in the software technologies of the future.

    ISE originated one of the earliest .NET products and offers a full range of .NET services and training at http://www.dotnetexperts.com .

    For more information

    Interactive Software Engineering Inc.
    ISE Building, 360 Storke Road
    Goleta, CA 93117 USA
    Telephone 805-685-1006, Fax 805-685-6869

    Internet and e-mail

    ISE maintains a rich source of information at http://eiffel.com , with more than 1200 Web pages including online documentation, downloadable files, product descriptions, links to ISE partners, University Partnership program, mailing list archives, announcements, press coverage, Frequently Asked Questions, Support pages, and much more.

    Visit http://contact.eiffel.com to request information about products and services. To subscribe to the ISE Eiffel user list, go to www.talkitover.com/eiffel/users .

    Support programs

    ISE offers a variety of support options tailored to the diverse needs of its customers. See http://support.eiffel.com for details.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


----- An Eiffel Tutorial -----

Getting Started with Eiffel Getting Started with Eiffel

An Eiffel Tutorial

Interactive Software Engineering

MANUAL IDENTIFICATION AND COPYRIGHT

An Eiffel tutorial

    This document is available both locally, as part of the ISE Eiffel delivery, and on the http://docs.eiffel.com Web site. See the list of introductory documents .

    This is not an introduction to the EiffelStudio development environment. Follow the preceding link for a Guided Tour of EiffelStudio.

    You will also find there a shorter introduction: "Invitation to Eiffel".

1 OVERVIEW

2 GENERAL PROPERTIES

3 THE SOFTWARE PROCESS IN EIFFEL

4 HELLO WORLD

5 THE STATIC PICTURE: SYSTEM ORGANIZATION

6 THE DYNAMIC STRUCTURE: EXECUTION MODEL

7 GENERICITY AND ARRAYS

8 DESIGN BY CONTRACT TM , ASSERTIONS, EXCEPTIONS

9 INHERITANCE

10 OTHER MECHANISMS

11 AGENTS

12 LEXICAL CONVENTIONS AND STYLE RULES

13 TO LEARN MORE

Getting Started with Eiffel Getting Started with Eiffel

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


1 OVERVIEW

Eiffel is a method and language for the efficient description and development of quality systems.

As a language, Eiffel is more than a programming language. It covers not just programming in the restricted sense of implementation but the whole spectrum of software development:

    + Analysis , modeling and specification , where Eiffel can be used as a purely descriptive tool to analyze and document the structure and properties of complex systems (even non-software systems).

    + Design and architecture , where Eiffel can be used to build solid, flexible system structures.

    + Implementation , where Eiffel provides practical software solutions with an efficiency comparable to solutions based on such traditional approaches as C and Fortran.

    + Maintenance , where Eiffel helps thanks to the architectural flexibility of the resulting systems.

    + Documentation , where Eiffel permits automatic generation of documentation, textual and graphical, from the software itself, as a partial substitute for separately developed and maintained software documentation.

Although the language is the most visible part, Eiffel is best viewed as a method , which guides system analysts and developers through the process of software construction. The Eiffel method is focused on both productivity (the ability to produce systems on time and within budget) and quality, with particular emphasis on the following quality factors:

    + Reliability : producing bug-free systems, which perform as expected.

    + Reusability : making it possible to develop systems from prepackaged, high-quality components, and to transform software elements into such reusable components for future reuse.

    + Extendibility : developing software that is truly soft -- easy to adapt to the inevitable and frequent changes of requirements and other constraints.

    + Portability : freeing developers from machine and operating system peculiarities, and enabling them to produce software that will run on many different platforms.

    + Maintainability : yielding software that is clear, readable, well structured, and easy to continue enhancing and adapting.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


2 GENERAL PROPERTIES

Here is an overview of the facilities supported by Eiffel:

    + Completely object-oriented approach. Eiffel is a full-fledged application of object technology, not a "hybrid" of O-O and traditional concepts.

    + External interfaces . Eiffel is a software composition tool and is easily interfaced with software written in such languages as C, C++, Java and C#.

    + Full lifecycle support . Eiffel is applicable throughout the development process, including analysis, design, implementation and maintenance.

    + Classes as the basic structuring tool. A class is the description of a set of run-time objects, specified through the applicable operations and abstract properties. An Eiffel system is made entirely of classes, serving as the only module mechanism.

    + Consistent type system . Every type is based on a class, including basic types such as integer, boolean, real, character, string, array.

    + Design by Contract. Every system component can be accompanied by a precise specification of its abstract properties, governing its internal operation and its interaction with other components.

    + Assertions . The method and notation support writing the logical properties of object states, to express the terms of the contracts. These properties, known as assertions, can be monitored at run-time for testing and quality assurance. They also serve as documentation mechanism. Assertions include preconditions, postconditions, class invariants, loop invariants, and also appear in "check" instructions.

    + Exception handling . You can set up your software to detect abnormal conditions, such as unexpected operating system signals and contract violations, correct them, and recover

    + Information hiding . Each class author decides, for each feature, whether it is available to all client classes, to specific clients only, or just for internal purposes.

    + Self-documentation . The notation is designed to enable environment tools to produce abstract views of classes and systems, textual or graphical, and suitable for reusers, maintainers and client authors.

    + Inheritance . You can define a class as extension or specialization of others.

    + Redefinition . An inherited feature (operation) can be given a different implementation or signature.

    + Explicit redefinition . Any feature redefinition must be explicitly stated.

    + Subcontracting . Redefinition rules require new assertions to be compatible with inherited ones.

    + Deferred features and classes . It is possible for a feature, and the enclosing class, to be specified -- including with assertions -- but not implemented. Deferred classes are also known as abstract classes.

    + Polymorphism . An entity (variable, argument etc.) can become attached to objects of many different types.

    + Dynamic binding . Calling a feature on an object always triggers the version of the feature specifically adapted to that object, even in the presence of polymorphism and redefinition.

    + Static typing . A compiler can check statically that all type combinations will be valid, so that no run-time situation will occur in which an attempt will be made to apply an inexistent feature to an object.

    + Assignment attempt ("type narrowing"). It is possible to check at run time whether the type of an object conforms to a certain expectation, for example if the object comes from a database or a network.

    + Multiple inheritance . A class can inherit from any number of others.

    + Feature renaming . To remove name clashes under multiple inheritance, or to give locally better names, a class can give a new name to an inherited feature.

    + Repeated inheritance : sharing and replication . If, as a result of multiple inheritance, a class inherits from another through two or more paths, the class author can specify, for each repeatedly inherited feature, that it yields either one feature (sharing) or two (replication).

    + No ambiguity under repeated inheritance . Conflicting redefinitions under repeated inheritance are resolved through a "selection" mechanism.

    + Unconstrained genericity . A class can be parameterized, or "generic", to describe containers of objects of an arbitrary type.

    + Constrained genericity . A generic class can be declared with a generic constraint, to indicate that the corresponding types must satisfy some properties, such as the presence of a particular operation.

    + Garbage collection . The dynamic model is designed so that memory reclamation, in a supporting environment, can be automatic rather than programmer-controlled.

    + No-leak modular structure . All software is built out of classes, with only two inter-class relations, client and inheritance.

    + Once routines . A feature can be declared as "once", so that it is executed only for its first call, subsequently returning always the same result (if required). This serves as a convenient initialization mechanism, and for shared objects.

    + Standardized library . The Kernel Library, providing essential abstractions, is standardized across implementations.

    + Other libraries . Eiffel development is largely based on high-quality libraries covering many common needs of software development, from general algorithms and data structures to networking and databases.

It is also useful, as in any design, to list some of what is not present in Eiffel. The approach is indeed based on a small number of coherent concepts so as to remain easy to master. Eiffel typically takes a few hours to a few days to learn, and users seldom need to return to the reference manual once they have understood the basic concepts. Part of this simplicity results from the explicit decision to exclude a number of possible facilities:

    + No global variables , which would break the modularity of systems and hamper extendibility, reusability and reliability.

    + No union types (or record type with variants), which force the explicit enumeration of all variants; in contrast, inheritance is an open mechanism which permits the addition of variants at any time without changing existing code.

    + No in-class overloading which, by assigning the same name to different features within a single context, causes confusions, errors, and conflicts with object-oriented mechanisms such as dynamic binding. (Dynamic binding itself is a powerful form of inter-class overloading, without any of these dangers.)

    + No goto instructions or similar control structures (break, exit, multiple-exit loops) which break the simplicity of the control flow and make it harder or impossible to reason about the software (in particular through loop invariants and variants).

    + No exceptions to the type rules . To be credible, a type system must not allow unchecked "casts" converting from a type to another. (Safe cast-like operations are available through assignment attempt.)

    + No side-effect expression operators confusing computation and modification.

    + No low-level pointers, no pointer arithmetic , a well-known source of bugs. (There is however a type POINTER , used for interfacing Eiffel with C and other languages.)

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


3 THE SOFTWARE PROCESS IN EIFFEL

Eiffel, as noted, supports the entire lifecycle. The underlying view of the system development lifecycle is radically different not only from the traditional "Waterfall" model (implying a sequence of discrete steps, such as analysis, global design, detailed design, implementation, separated by major changes of method and notation) but also from its more recent variants such as the spiral model or "rapid prototyping", which remain predicated on a synchronous, full-product process, and retain the gaps between successive steps.

Clearly, not everyone using Eiffel will follow to the letter the principles outlined below; in fact, some highly competent and successful Eiffel developers may disagree with some of them and use a different process model. In the author's mind, however, these principles fit best with the language and the rest of the method, even if practical developments may fall short of applying their ideal form.

Clusters and the cluster model

Unlike earlier approaches, the Eiffel model assumes that the system is divided into a number of subsystems or clusters . It keeps from the Waterfall a sequential approach to the development of each cluster (without the gaps), but promotes concurrent engineering for the overall process, as suggested by the following picture:.

The Eiffel techniques developed below, in particular information hiding and Design by Contract, make the concurrent engineering process possible by letting the clusters rely on each other through clearly defined interfaces, strictly limiting the amount of knowledge that one must acquire to use the cluster, and permitting separate testing. When the inevitable surprises of a project happen, the project leader can take advantage of the model's flexibility, advancing or delaying various clusters and steps through dynamic reallocation of resources.

Each of the individual cluster lifecycles is based on a continuous progression of activities, from the more abstract to the more implementation-oriented:

You may view this picture as describing a process of accretion (as with a stalactite), where each steps enriches the results of the previous one. Unlike traditional views, which emphasize the multiplicity of software products -- analysis document, global and detailed design documents, program, maintenance reports … --, the principle is here to treat the software as a single product which will be repeatedly refined, extended and improved. The Eiffel language supports this view by providing high-level notations that can be used throughout the lifecycle, from the most general and software-independent activities of system modeling to the most exacting details of implementation tuned for optimal run-time performance.

These properties make Eiffel span the scope of both "object-oriented methods", with their associated notations such as UML and supporting CASE tools (whereas most such solutions do not yield an executable result), and "programming languages" (whereas most such languages are not suitable for design and analysis).

Seamlessness and reversibility

The preceding ideas define the seamless approach embodied by Eiffel. With seamlessness goes reversibility : the ability to go back, even late in the process, to earlier stages. Because the developers work on a single product, they can take advantages of bouts of late wisdom -- such as a great idea for adding a new function, discovered only at implementation time -- and integrate them in the product. Traditional approaches tend to discourage reversibility because it is difficult to guarantee that the analysis and design will be updated with the late changes. With the single-product principle, this is much easier to achieve.

Seamlessness and reversibility enhance extendibility by providing a direct mapping from the structure of the solution to the structure of the problem description, making it easier to take care of customers' change requests quickly and efficiently. They promote reliability, by avoiding possible misunderstandings between customers' and developers' views. They are a boost to maintainability. More generally, they yield a smooth, consistent software process that helps both quality and productivity.

Generalization and reuse

The last step of the cluster lifecycles, Generalization, is unheard of in traditional models. Its task is to prepare the results of a cluster for reuse across projects by looking for elements of general applicability, and transform them for inclusion in libraries.

Recent object-oriented literature has used the term "refactoring" to describe a process of continuous improvement of released software. Generalization includes refactoring, but also pursues a more ambitious goal: helping turn program elements (software modules useful only as part of a certain program) into software components -- reusable parts with a value of their own, ready to be used by diverse programs that can benefit from their capabilities.

Of course not all companies using the method will be ready to include a Generalization phase in their lifecycles. But those which do will see the reusability of their software greatly improved.

Constant availability

Complementing the preceding principles is the idea that, in the cluster lifecycle, the development team (under the responsibility of the project leader) should at all times maintain a current working demo which, although covering only a part of the final system, works well, and can be demonstrated or -- starting at a suitable time -- shipped as an early release. It is not a "prototype" in the sense of a mockup meant to be thrown away, but an initial iteration towards the final product; the successive iterations will progress continuously towards until they become that final product.

Compilation technology

The preceding goals benefit from the ability to check frequently that the current iteration is correct and robust. Eiffel supports efficient compilation mechanisms through such mechanisms as the Melting Ice Technology in ISE's EiffelStudio. The Melting Ice achieves immediate recompilation after a change, guaranteeing a recompilation time that's a function of the size of the changes , not of the system's overall size. Even for a system of several thousand classes and several hundred thousand lines, the time to get restarted after a change to a few classes is, on a typical modern computer, a few seconds.

Such a "melt" (recompilation) will immediately catch (along with any syntax errors) the type errors -- often the symptoms of conceptual errors that, if left undetected, could cause grave damage later in the process or even during operation. Once the type errors have been corrected, the developers should start testing the new functionalities, relying on the power of assertions -- explained in "DESIGN BY CONTRACTTM, ASSERTIONS, EXCEPTIONS", page 38 -- to kill the bugs while they are still larvae. Such extensive unit and system testing, constantly interleaved with development, plays an important part in making sure that the "current demo" is trustworthy and will eventually yield a correct and robust product.

Quality and functionality

Throughout the process, the method suggests maintaining a constant quality level: apply all the style rules, put in all the assertions, handle erroneous cases (rather than the all too common practice of thinking that one will "make the product robust" later on), enforce the proper architecture. This applies to all the quality factors except possibly reusability (since one may not know ahead of time how best to generalize a component, and trying to make everything fully general may conflict with solving the specific problem at hand quickly). All that varies is functionality : as the project progresses and clusters come into place, more and more of the final product's intended coverage becomes available. The project's most common question , "Can we ship something yet?", translates into "Do we cover enough?", not "Is it good enough?" (as in "Will it not crash?").

Of course not everyone using Eiffel can, any more than in another approach, guarantee that the ideal just presented will always hold. But it is the theoretical scheme to which the method tends. It explains Eiffel's emphasis on getting everything right: the grandiose and the mundane, the structure and the details. Regarding the details, the Eiffel books cited in the bibliography include many rules, some petty at first sight, about such low-level aspects as the choice of names for classes and features (including their grammatical categories), the indentation of software texts, the style for comments (including the presence or absence of a final period), the use of spaces. Applying these rules does not, of course, guarantee quality; but they are part of a quality-oriented process, along with the more ambitious principles of design. In addition they are particularly important for the construction of quality libraries, one of the central goals of Eiffel.

Whenever they are compatible with the space constraints, the present chapter and the rest of this book apply these rules to their Eiffel examples.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


4 HELLO WORLD

When discovering any approach to software construction, however ambitious its goals, it is reassuring to see first a small example of the big picture -- a complete program to print the famous "Hello World" string. Here is how to perform this fascinating task in the Eiffel notation.

You write a class HELLO with a single procedure, say make , also serving as creation procedure. If you like short texts, here is a minimal version:

    class HELLO create make feature

    make is

    do print (" Hello World%N ") end

    end

In practice, however, the Eiffel style rules suggest a better documented version:

    indexing

    description: "Root for trivial system printing a message"

    author : " Elizabeth W. Brown "

    class HELLO create

    make

    feature

    make is

    -- Print a simple message.

    do

    io . put_string (" Hello World ")

    io . put_new_line

    end

    end - - class HELLO

The two versions perform identically; the following comments will cover the more complete second one.

Note the absence of semicolons and other syntactic clatter or clutter. You may in fact use semicolons to separate instructions and declarations. But the language's syntax is designed to make the semicolon optional (regardless of text layout) and it's best for readability to omit it, except in the special case of successive elements on a single line.

The indexing clause does not affect execution semantics; you may use it to associate documentation with the class, so that browsers and other indexing and retrieval tools can help users in search of reusable components satisfying certain properties. Here we see two indexing entries, labeled description and author .

The name of the class is HELLO . Any class may contain "features"; HELLO has just one, called make . The create clause indicates that make is a "creation procedure", that is to say an operation to be executed at class instantiation time. The class could have any number of creation procedures.

The definition of make appears in a feature clause. There may be any number of such clauses (to separate features into logical categories), and each may contain any number of feature declarations. Here we have only one.

The line starting with -- (two hyphen signs) is a comment; more precisely it is a "header comment", which style rules invite software developers to write for every such feature, just after the is . As will be seen in "The contract form of a class", page 44 , the tools of EiffelStudio know about this convention and use it to include the header comment in the automatically generated class documentation.

The body of the feature is introduced by the do keyword and terminated by end . It consists of two output instructions. They both use io , a generally available reference to an object that provides access to standard input and output mechanisms; the notation io . f , for some feature f of the corresponding library class ( STD_FILES ), means "apply f to io ". Here we use two such features:

    + put_string outputs a string, passed as argument, here " Hello World " .

    + put_new_line terminates the line.

Rather than using a call to put_new_line , the first version of the class simply includes a new-line character, denoted as %N , at the end of the string. Either technique is acceptable.

To build the system and execute it:

    + Start EiffelStudio

    + When prompted, ask EiffelStudio to build a system for you; specify HELLO as the "root class" and make as the "root procedure".

    + You can either use EiffelStudio to type in the above class text, or you may use any text editor and store the result into a file hello.e in the current directory.

    + Click the "Compile" icon.

    + Click the "Run" icon.

Execution starts and outputs Hello World on the appropriate medium: under Windows, a Console; under Unix or VMS, the windows from which you started EiffelStudio.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


5 THE STATIC PICTURE: SYSTEM ORGANIZATION

We now look at the overall organization of Eiffel software.

References to ISE-originated libraries appearing in subsequent examples include: EiffelBase , the fundamental open-source library covering data structures and algorithms; the kernel library , a subset of EiffelBase covering the most basic notions such as arrays and strings; and EiffelVision 2 , an advanced graphics and GUI library providing full compatibility across platforms (Unix, Windows, VMS) with native look-and-feel on each.

Systems

An Eiffel system is a collection of classes, one of which is designated as the root class. One of the features of the root class, which must be one of its creation procedures, is designated as the root procedure.

To execute such a system is to create an instance of the root class (an object created according to the class description) and to execute the root procedure. In anything more significant than "Hello World" systems, this will create new objects and apply features to them, in turn triggering further creations and feature calls.

For the system to make sense, it must contains all the classes on which the root depends directly or indirectly. A class B depends on a class A if it is either a client of A , that is to say uses objects of type A , or an heir of A , that is to say extends or specializes A . (These two relations, client and inheritance, are covered below.)

Classes

The notion of class is central to the Eiffel approach. A class is the description of a type of run-time data structures ( objects ), characterized by common operations ( features ) and properties. Examples of classes include:

    + In a banking system, a class ACCOUNT may have features such as deposit , adding a certain amount to an account, all_deposits , yielding the list of deposits since the account's opening, and balance , yielding the current balance, with properties stating that deposit must add an element to the all_deposits list and update balance by adding the sum deposited, and that the current value of balance must be consistent with the lists of deposits and withdrawals.

    + A class COMMAND in an interactive system of any kind may have features such as execute and undo , as well as a feature undoable which indicates whether a command can be undone, with the property that undo is only applicable if undoable yields the value true.

    + A class LINKED_LIST may have features such as put , which adds an element to a list, and count , yielding the number of elements in the list, with properties stating that put increases count by one and that count is always non-negative.

We may characterize the first of these examples as an analysis class, directly modeling objects from the application domain; the second one as a design class, describing a high-level solution; and the third as an implementation class, reused whenever possible from a library such as EiffelBase. In Eiffel, however, there is no strict distinction between these categories; it is part of the approach's seamlessness that the same notion of class, and the associated concepts, may be used at all levels of the software development process.

Class relations

Two relations may exist between classes:

    + You can define a class C as a client of a class A to enable the features of C to rely on objects of type A .

    + You may define a class B as an heir of a class A to provide B with all the features and properties of A , letting B add its own features and properties and modify some of the inherited features if appropriate.

If C is a client of A , A is a supplier of C . If B is an heir of A , A is a parent of B . A descendant of A is either A itself or, recursively, a descendant of an heir of A ; in more informal terms a descendant is a direct or indirect heir, or the class itself. To exclude A itself we talk of proper descendant . In the reverse direction the terms are ancestor and proper ancestor .

The client relation can be cyclic; an example involving a cycle would be classes PERSON and HOUSE , modeling the corresponding informal everyday "object" types and expressing the properties that every person has a home and every home has an architect. The inheritance (heir) relation may not include any cycle.

In modeling terms, client roughly represents the relation "has" and heir roughly represents "is". For example we may use Eiffel classes to model a certain system and express that every child has a birth date (client relation) and is a person (inheritance).

Distinctive of Eiffel is the rule that classes can only be connected through these two relations. This excludes the behind-the-scenes dependencies often found in other approaches, such as the use of global variables, which jeopardize the modularity of a system. Only through a strict policy of limited and explicit inter-class relations can we achieve the goals of reusability and extendibility.

The global inheritance structure

An Eiffel class that you write does not come into a vacuum but fits in a preordained structure, shown in the figure and involving two library classes: ANY and NONE .

Any class that does not explicitly inherit from another is considered to inherit from ANY , so that every class is a descendant, direct or indirect, of ANY . ANY introduces a number of general-purpose features useful everywhere, such as copying, cloning and equality testing operations (page 28 ) and default input-output. The procedure print used in the first version of our "Hello World" (page 11 ) comes from ANY .

NONE inherits from any class that has no explicit heir. Since inheritance has no cycles, NONE cannot have proper descendants. This makes it useful, as we will see, to specify non-exported features, and to denote the type of void values. Unlike ANY , class NONE doesn't have an actual class text; instead, it's a convenient fiction.

Clusters

Classes are the only form of module in Eiffel. As will be explained in more detail, they also provide the basis for the only form of type. This module-type identification is at the heart of object technology and of the fundamental simplicity of the Eiffel method.

Above classes, you will find the concept of cluster. A cluster is a group of related classes. Clusters are a property of the method, enabling managers to organize the development into teams. As we have already seen (section 3 ) they also play a central role in the lifecycle model. Clusters are an organizational concept, not a form of module, and do not require an Eiffel language construct.

External software

The subsequent sections will show how to write Eiffel classes with their features. In an Eiffel system, however, not everything has to be written in Eiffel: some features may be external , coming from languages such as C, C++, Java, C# Fortran and others. For example a feature declaration may appear (in lieu of the forms seen later) as

    file_status ( filedesc: INTEGER): INTEGER is

    -- Status indicator for filedesc

    external

    " C " alias " _fstat "

    end

to indicate that it is actually an encapsulation of a C function whose original name is _ fstat . The alias clause is optional, but here it is needed because the C name, starting with an underscore, is not valid as an Eiffel identifier.

Similar syntax exists to interface with C++ classes. ISE Eiffel includes a tool called Legacy++ which will automatically produce, from a C++ class, an Eiffel class that encapsulates its facilities, making them available to the rest of the Eiffel software as bona fide Eiffel features.

These mechanisms illustrate one of the roles of Eiffel: as an system architecturing and software composition tool, used at the highest level to produce systems with robust, flexible structures ready for extendibility, reusability and maintainability. In these structures not everything must be written in the Eiffel language: existing software elements and library components can play their part, with the structuring capabilities of Eiffel (classes, information hiding, inheritance, clusters, contracts and other techniques seen in this presentation) serving as the overall wrapping mechanism.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


6 THE DYNAMIC STRUCTURE: EXECUTION MODEL

A system with a certain static structure describes a set of possible executions. The run-time model governs the structure of the data ( objects ) created during such executions.

The properties of the run-time model are not just of interest to implementers; they also involve concepts directly relevant to the needs of system modelers and analysts at the most abstract levels.

Objects, fields, values and references

A class was defined as the static description of a a type of run-time data structures. The data structures described by a class are called instances of the class, which in turn is called their generating class (or just " generator "). An instance of ACCOUNT is a data structure representing a bank account; an instance of LINKED_LIST is a data structure representing a linked list.

An object , as may be created during the execution of a system, is an instance of some class of the system.

Classes and objects belong to different worlds: a class is an element of the software text; an object is a data structure created during execution. Although is possible to define a class whose instances represent classes (as class E_CLASS in the ISE libraries, used to access properties of classes at run time), this does not eliminate the distinction between a static, compile-time notion, class, and a dynamic, run-time notion, object.

An object is either an atomic object (integer, real, boolean, double) or a composite object made of a number of fields , represented by adjacent rectangles on the conventional run-time diagrams:

Each field is a value . A value can be either an object or an object reference:

    + When a field is an object, it will in most cases be an atomic object, as on the figure where the first field from the top is an integer and the third a character. But a field can also be a composite object, in which case it is called a subobject .

    + A reference is either void or uniquely identifies an object, to which it is said to be attached . In the preceding figure the second field from the top is a reference -- attached in this case, as represented by the arrow, to the enclosing object itself. The bottom field is a void reference.

Features

A feature, as noted, is an operation available on instances of a class. A feature can be either an attribute or a routine . This classification, which you can follow by starting from the right on the figure above, is based on implementation considerations:

    + An attribute is a feature implemented through memory: it describes a field that will be found in all instances of the class. For example class ACCOUNT may have an attribute balance ; then all instances of the class will have a corresponding field containing each account's current balance.

    + A routine describes a computation applicable to all instances of the class. ACCOUNT may have a routine withdraw .

    + Routines are further classified into functions , which will return a result, and procedures , which will not. Routine withdraw will be a procedure; an example of function may be highest_deposit , which returns the highest deposit made so far to the account.

If we instead take the viewpoint of the clients of a class (the classes relying on its feature), you can see the relevant classification by starting from the left on the figure:

    + Commands have no result, and may modify an object. They may only be procedures.

    + Queries have a result: they return information about an object. You may implement a query as either an attribute (by reserving space for the corresponding information in each instance of the class, a memory-based solution) or a function (a computation-based solution). An attribute is only possible for a query without argument, such as balance ; a query with arguments, such as balance_on ( d ), returning the balance at date d , can only be a function.

From the outside, there is no difference between a query implemented as an attribute and one implemented as a function: to obtain the balance of an account a , you will always write a . balance . In the implementation suggested above, a is an attribute, so that the notation denotes an access to the corresponding object field. But it is also possible to implement a as a function, whose algorithm will explore the lists of deposits and withdrawals and compute their accumulated value. To the clients of the class, and in the official class documentation as produced by the environment tools, the difference is not visible.

This principle of Uniform Access is central to Eiffel's goals of extendibility, reusability and maintainability: you can change the implementation without affecting clients; and you can reuse a class without having to know the details of its features' implementations. Most object-oriented languages force clients to use a different notation for a function call and an attribute access. This violates Uniform Access and is an impediment to software evolution, turning internal representation changes into interface changes that may disrupt large parts of a system.

A simple class

The following simple class text illustrates the preceding concepts

    indexing

    description: "Simple bank accounts"

    class

    ACCOUNT

    feature -- Access

    balance: INTEGER

    -- Current balance

    deposit_count: INTEGER is

    -- Number of deposits made since opening

    do

    if all_deposits /= Void then

    Result := all_deposits . count

    end

    end

    feature -- Element change

    deposit (sum: INTEGER) is

    -- Add sum to account.

    do

    if all_deposits= Void then

    create all_deposits

    end

    all_deposits . extend (sum)

    balance := balance + sum

    end

    feature { NONE } -- Implementation

    all_deposits: DEPOSIT_LIST

    -- List of deposits since account's opening.

    invariant

    consistent_balance:

    (all_deposits /= Void) implies (balance = all_deposits . total)
    zero_if_no_deposits:

    (all_deposits = Void) implies (balance = 0)

    end -- class ACCOUNT

(The { NONE } qualifier and the invariant clause, used here to make the example closer to a real class, will be explained shortly. DEPOSIT_LIST refers to another class, which can be written separately using library classes.)

It's easy to deduce, from a feature's syntactic appearance, the category to which it belongs. Here:

    + Only deposit and deposit_count , which include a do … clause, are routines.

    + balance and all_deposits , which are simply declared with a type, are attributes. Note that even for attributes it is recommended to have a header comment.

    + Routine deposit_count is declared as returning a result (of type INTEGER ); so it is a function. Routine deposit has no such result and hence is a procedure.

Creating and initializing objects

Classes, as noted, are a static notion. Objects appear at run time; they are created explicitly. Here is the basic instruction to create an object of type ACCOUNT and attach it to x :

    create x

assuming that x has been declared of type ACCOUNT . Such an instruction must be in a routine of some class -- the only place where instructions can appear -- and its effect at run time will be threefold: create a new object of type ACCOUNT ; initialize its fields to default values; and attach the value of x to it. Here the object will have two fields corresponding to the two attributes of the generating class: an integer for balance , which will be initialized to 0, and a reference for all_deposits , which will be initialized to a void reference:

The language specifies default initialization values for all possible types:

    Type | Default value
INTEGER , REAL , DOUBLE | Zero
BOOLEAN | False
CHARACTER | Null
Reference types (such as ACCOUNT and DEPOSIT_LIST ) | Void reference
Composite expanded types (see next) | Same rules, applied recursively to all fields

It is possible to override the initialization values by providing -- as in the earlier example of class HELLO -- one or more creation procedures. For example we might change ACCOUNT to make sure that every account is created with an initial deposit:

    indexing

    description : " Simple bank accounts, initialized with a first deposit "

    class

    ACCOUNT1

    create

    make

    feature -- Initialization

    make ( sum : INTEGER ) is

    -- Initialize account with sum .

    do

    deposit ( sum )

    end

    … The rest of the class as for ACCOUNT …

    end -- class ACCOUNT1

A create clause may list zero or more (here just one) procedures of the class.

Note the use of the same keyword, create , for both a creation clause, as here, and creation instructions such as creat x .

In this case the original form of creation instruction, create x , is not valid any more for creating an instance of ACCOUNT1 ; you must use the form

    create x . make ( 2000 )

known as a creation call. Such a creation call will have the same effect as the original form -- creation, initialization, attachment to x -- followed by the effect of calling the selected creation procedure, which here will call deposit with the given argument.

Note that in this example all that make does is to call deposit . So an alternative to introducing a new procedure make would have been simply to introduce a creation clause of the form create deposit , elevating deposit to the status of creation procedure. Then a creation call would be of the form create x . deposit ( 2000 ) .

Some variants of the basic creation instruction will be reviewed later: instruction with an explicit type; creation expressions. See "Creation variants", page 89 .

Entities

The example assumed x declared of type ACCOUNT (or ACCOUNT1 ). Such an x is an example of entity , a notion generalizing the well-known concept of variable. An entity is a name that appears in a class text to represent possible run-time values (a value being, as defined earlier, an object or a reference). An entity is one of the following:

    + An attribute of the enclosing class, such as balance and all_deposits .

    + A formal argument of a routine, such as sum for deposit and make .

    + A local entity declared for the internal needs of a routine.

    + The special entity Result in a function.

The third case, local entities, arises when a routine needs some auxiliary values for its computation. Here is an example of the syntax:

    deposit ( sum : INTEGER ) is

    -- Add sum to account.

    local

    new : AMOUNT

    do

    create new . make ( sum )

    all_deposits . extend ( new )

    balance := balance + sum

    end

This example is a variant of deposit for which we assume that the elements of a DEPOSIT_LIST such as all_deposits are no longer just integers, but objects, instances of a new class, AMOUNT . Such an object will contain an integer value, but possibly other information as well. So for the purpose of procedure deposit we create an instance of AMOUNT and insert it, using procedure extend , into the list all_deposits . The object is identified through the local entity new , which is only needed within each execution of the routine (as opposed to an attribute, which yields an object field that will remain in existence for as long as the object).

The last case of entity, Result , serves to denote, within the body of a function, the final result to be returned by that function. This was illustrated by the function deposits_count , which read

    deposit_count : INTEGER is

    -- Number of deposits made since opening (provisional version)

    if all_deposits /= Void then

    Result := all_deposits . count

    end

The value returned by any call will be the value of the expression all_deposits . count (to be explained in detail shortly) for that call, unless all_deposits has value Void , denoting a void reference ( /= is "not equal").

The default initialization rules seen earlier for attributes (see the table on page 21 ) also serve to initialize local entities and Result on routine entry. So in the last example, if all_deposits is void (as in the case on initialization with the class as given so far), Result keeps its default value of 0, which will be returned as the result of the function.

Calls

Apart from object creation, the basic computational mechanism, in the object-oriented style of computation represented by Eiffel, is feature call. In its basic form, it appears as

    target . feature ( argument1 , …)

where target is an entity or more generally an expression, feature is a feature name, and there may be zero or more argument expressions. In the absence of any argument the part in parentheses should be removed.

We have already seen such calls. If the feature denotes a procedure, the call is an instruction, as in

    all_deposits . extend ( new )

If feature denotes a query (function or attribute), the call is an expression, as in the right-hand side of

    Result := all_deposits . count

Following the principle of Uniform Access (page 19 ), this form is the same for calls to attributes and to functions without arguments. In this example, feature count from class DEPOSIT_LIST may indeed be implemented in either of these two ways: we can keep a count field in each list, updating it for each insertion and removal; or we can compute count , whenever requested, by traversing the list and counting the number of items.

In the case of a routine with arguments -- procedure or function -- the routine will be declared, in its class, as

    feature ( formal1 : TYPE1 ; …) is

    do … end

meaning that, at the time of each call, the value of each formal will be set to the corresponding actual ( formal1 to argument1 and so on).

In the routine body, it is not permitted to change the value of a formal argument, although it is possible to change the value of an attached object through a procedure call such as formal1 . some_ procedure (…).

Infix and prefix notation

Basic types such as INTEGER are, as noted, full-status citizens of Eiffel's type system, and so are declared as classes (part of the Kernel Library). INTEGER , for example, is characterized by the features describing integer operations: plus, minus, times, division, less than, and so on.

With the dot notation seen so far, this would imply that simple arithmetic operations would have to be written with a syntax such as i . plus ( j ) instead of the usual i + j . This would be awkward. Infix and prefix features solve the problem, reconciling the object-oriented view of computation with common notational practices of mathematics. The addition function is declared in class INTEGER as

    infix " + " ( other : INTEGER ): INTEGER is

    do … end

Such a feature has all the properties and prerogatives of a normal "identifier" feature, except for the form of the calls, which is infix, as in i + j , rather than using dot notation. An infix feature must be a function, and take exactly one argument. Similarly, a function can be declared as prefix "-" , with no argument, permitting calls of the form -3 rather than ( 3 ) . negated .

Predefined library classes covering basic types such as INTEGER , CHARACTER , BOOLEAN , REAL , DOUBLE are known to the Eiffel compiler, so that a call of the form i + j , although conceptually equivalent to a routine call, can be processed just as efficiently as the corresponding arithmetic expression in an ordinary programming language. This brings the best of both worlds: conceptual simplicity, enabling Eiffel developers, when they want to, to think of integers and the like as objects; and efficiency as good as in lower-level approaches.

Infix and prefix features are available to any class, not just the basic types' predefined classes. For example a graphics class could use the name infix "|-|" for a function computing the distance between two points, to be used in expressions such as point1 |-| point2 .

Type declaration

Every entity appearing in an Eiffel text is declared as being of a certain type, using the syntax already encountered in the above examples:

    entity_name : TYPE_NAME

This applies to attributes, formal arguments of routines and local entities. You will also declare the result type for a function, as in the earlier example

    deposit_count : INTEGER is …

Specifying such a function result type also declares, implicitly, the type for Result as used in the function's body.

What is a type? With the elements seen so far, every type is a class . INTEGER , used in the declaration of deposits_count , is, as we have seen, a library class; and the declaration all_deposits : DEPOSIT_LIST assumes the existence of a class DEPOSIT_LIST .

Three mechanisms introduced below -- expanded types (page 26 ), genericity (page 36 ) and anchored declarations (page 79 )-- will generalize the notion of type slightly. But they do not change the fundamental property that every type is based on a class , called the type's base class . In the examples seen so far, each type is a class, serving as its own base class.

An instance of a class C is also called "an object of type C ".

Type categories

It was noted above that a value is either an object or a reference. This corresponds to two kinds of type: reference types and expanded types.

If a class is declared as just

    class CLASS_NAME …

it defines a reference type. The entities declared of that type will denote references. So in the declaration

    x : ACCOUNT

the possible run-time values for x are references, which will be either void or attached to instances of class ACCOUNT .

Instead of class , however, you may use the double keyword expanded class , as in the EiffelBase class definition

    indexing

    description : " Integer values "

    expanded class

    INTEGER

    feature -- Basic operations

    infix " + " ( other : INTEGER ): INTEGER is

    do … end

    … Other feature declarations …

    end -- class INTEGER

In this case the value of an entity declared as n : INTEGER is not a reference to an object, but the object itself -- in this case an atomic object, an integer value.

It is also possible, for some non-expanded class C, to declare an entity as

    x : expanded C

so that the values for x will be objects of type C , rather than references to such objects. This is our first example of a type -- expanded C -- that is not directly a class, although it is based on a class, C . The base type of such a type is C .

Note that the value of an entity of an expanded type can never be void; only a reference can. Extending the earlier terminology, an expanded entity is always attached to an object, atomic (as in the case of n : INTEGER ) or composite (as in x : expanded ACCOUNT ).

Expanded declarations make it possible to construct composite objects with subobjects, as in the following abbreviated class declaration (indexing clause and routines omitted):

    class CAR feature

    engine : expanded ENGINE

    originating_plant : PLANT

    end -- class CAR

Here is an illustration of the structure of a typical instance of CAR :

This example also illustrates that the distinction between expanded and reference types is important not just for system implementation purposes but for high-level system modeling as well. Consider the example of a class covering the notion of car. Many cars share the same originating_plant , but an engine belongs to just one car. References represent the modeling relation "knows about"; subobjects, as permitted by expanded types, represent the relation "has part", also known as aggregation. The key difference is that sharing is possible in the former case but not in the latter.

Basic operations

To assign, copy and compare values, you can rely on a number of mechanisms. Two of them, assignment and equality testing, are language constructs; the others are library features, coming from the top-level class ANY seen earlier (page 15 ).

Assignment uses the symbol := . The assignment instruction

    x := y

updates the value of x to be the same as that of y . This means that:

    + For entities of reference types, the value of x will be a void reference if the value of y is void, and otherwise x will be attached to the same object OBJ2 as y :

    + For entities of expanded types, the values are objects; the object attached to x will be overwritten with the contents of the object attached to y . In the case of atomic objects, as in n := 3 with the declaration n : INTEGER , this has the expected effect of assigning to n the integer value 3 ; in the case of composite objects, this overwrites the fields for x , one by one, with the corresponding y fields.

To copy an object, use x . copy ( y ) which assumes that both x and y are non-void, and copies the contents of y 's attached object onto those of x 's. For expanded entities the effect is the same as that the of the assignment x := y .

A variant of the copy operation is clone . The expression clone ( y ) produces a newly created object, initialized with a copy of the object attached to y, or a void value if y itself is void. For a reference type (the only interesting case) the returned result for non-void y is a reference to the new object. This means we may view clone as a function that performs

    create Result

    Result . copy ( y )

So in the assignment x := clone ( y ) , assuming both entities of reference types and y not void, will attach x to a new object identical to y 's attached object, as opposed to the assignment x := y which attaches x to the same object as y .

To determine whether two values are equal, use the expression x = y . For references, this comparison will yield true if the values are either both void or both attached to the same object; this is the case in the last figure in the state after the assignment, but not before. The symbol for not equal is /= , as in x /= y .

As with assignment, there is also a form that works on objects rather than references: x . is_equal ( y ) will return true when x and y are both non-void and attached to field-by-field identical objects. This can be true even when x = y is not, for example, in the figure, before the assignment, if the two objects shown are field-by-field equal.

A more general variant of is_equal is used under the form equal ( x , y ). This is always defined, even if x is void, returning true whenever is_equal would but also if x and y are both void. (In contrast, x . is_equal ( y ) is not defined for void x and would, if evaluated, yield an exception as explained in "Exception handling", page 46 below.)

Void denotes a void reference. So you can make x void through the assignment x := Void , and test whether it is void through if x = Void then …

Where assignment := and the equality operators = and /= were language constructres, copy , clone , is_equal , equal and Void are library features coming from class ANY . The type of Void , as declared in ANY , is NONE , the "bottom" type.

Using the redefinition mechanisms to be seen in the discussion of inheritance, a class can redefine copy and is_equal to cover specific notions of copy and equality. The assertions will ensure that the two remain compatible: after x . copy ( y ), the property x . is_equal ( y ) must always be true. The effect of clone will automatically follow a redefinition of copy , and equal will follow is_equal .

To guarantee the original, non-redefined semantics you may use the variants standard_copy , standard_clone , standard_equal , all defined in ANY as "frozen", that is to say non-redefinable.

Deep operations and persistence

Feature clone only duplicates one object. If some of the object's fields are references to other objects, the references themselves will be copied, not those other objects.

It is useful, in some cases, to duplicate not just one object but an entire object structure. The expression deep_clone ( y ) achieves this goal: assuming non-void y , it will produce a duplicate not just of the object attached to y but of the entire object structure starting at that object. The mechanism respects all the possible details of that structure, such as cyclic reference chains. Like the preceding features, deep_clone comes from class ANY .

A related mechanism provides a powerful persistence facility. A call of the form

    x . store ( Some_file_or_network_connection )

will store a copy of the entire object structure starting at x , under a suitable representation. Like deep_clone , procedure store will follow all references to the end and maintain the properties of the structure. The function retrieved can then be used -- in the same system, or another -- to recreate the structure from the stored version.

As the name suggests, Some_file_or_network_connection can be an external medium of various possible kinds, not just a file but possibly a database or network. ISE's EiffelNet client-server library indeed uses the store - retrieved mechanism to exchange object structures over a network, between compatible or different machine architectures, for example a Windows client and a Unix server.

Memory management

Reference reattachments x := y of the form illustrated by the figure on page 28 can cause objects to become unreachable. This is the case for the object identified as OBJ2 on that figure (the object to which x was attached before the assignment) if no other reference was attached to it.

In all but toy systems, it is essential to reclaim the memory that has been allocated for such objects; otherwise memory usage could grow forever, as a result of creation instructions create x … and calls to clone and the like, leading to thrashing and eventually to catastrophic termination.

Tthe Eiffel method suggests that the task of detecting and reclaiming such unused object space should be handled by an automatic mechanism (part of the Eiffel run-time environment), not manually by developers (through calls to procedures such as Pascal's dispose and C/C++'s free ). The arguments for this view are:

    + Simplicity : handling memory reclamation manually can add enormous complication to the software, especially when -- as is often the case in object-oriented development -- the system manipulates complex run-time data structures with many links and cycles.

    + Reliability : memory management errors, such as the incorrect reclamation of an object that is still referenced by a distant part of the structure, are a notorious source of dangerous and hard-to-correct bugs.

ISE Eiffel provides a sophisticated garbage collector which efficiently handles the automatic reclamation process, while causing no visible degradation of a system's performance and response time.

Information hiding and the call rule

The basic form of computation, it has been noted, is a call of the form target . feature ( … ) . This is only meaningful if feature denotes a feature of the generating class of the object to which target (assumed to be non-void) is attached. The precise rule is the following:

    Feature Call rule

    A call of the form target . feature ( … ) appearing in a class C is only valid if feature is a feature of the base class of target 's type, and is available to C .

The first condition simply expresses that if target has been declared as target : A then feature must be the name of one of the features of A . The second condition reflects Eiffel's application of the principles of information hiding. A feature clause, introducing one or more feature declarations, may appear not only as

    feature -- Comment identifying the feature category

    … Feature declaration …

    … Feature declaration …

    …

but may also include a list of classes in braces, feature { A , B , … } , as was illustrated for ACCOUNT :

    feature { NONE } -- Implementation

    all_deposits : DEPOSIT_LIST

    -- List of deposits since account's opening.

This form indicates that the features appearing in that clause are only available -- in the sense of available for calls, as used in the Feature Call rule -- to the classes listed. In the example feature all_deposits is only available to NONE . Because of the global inheritance structure (page 15 ) this means it is in fact available to no useful client at all, and is equivalent in practice to feature { } with an empty class list, although the form listing NONE explicitly is more visible and hence preferred.

With this specification a class text including the declaration acc : ACCOUNT and a call of the form

    acc . all_deposits

violates the Feature Call rule and will be rejected by the EiffelStudio compiler.

Besides fully exported features (introduced by feature … without further qualification) and fully secret ones ( feature { } or feature { NONE } ), it is possible to export features selectively to some specified classes, using the specification

    feature { A , B , … }

for arbitrary classes A , B , … This enables a group of related classes to provide each other with privileged access, without requiring the introduction of a special module category above the class level (see "Clusters", page 15 ).

Exporting features selectively to a set of classes A , B , … also makes them available to the descendants of these classes. So a feature clause beginning with just feature is equivalent to one starting with feature { ANY } .

These rules enable successive feature clauses to specify exports to different clients. In addition, the recommended style, illustrated in the examples of this chapter, suggests writing separate feature clauses -- regardless of their use for specifying export privileges -- to group features into separate categories. The standard style rules define a number of fundamental categories and the order in which they should appear; they include: Initialization for creation procedures, Access for general queries, Status report for boolean-valued queries, Status setting , Element change , Implementation (for selectively exported or secret features. Every feature in the EiffelBase library classes belongs to one of the predefined categories.

The Feature Call rule is the first of the rules that make Eiffel a statically typed approach, where the applicability of operations to objects is verified at compile time rather than during execution. Static typing is one of the principal components of Eiffel's support for reliability in software development.

Execution scenario

The preceding elements make it possible to understand the overall scheme of an Eiffel system's execution.

At any time during the execution of a system, one object is the current object of the execution, and one of the routines of the system, the current routine , is being executed, with the current object as its target. (We will see below how the current object and current routine are determined.) The text of a class, in particular its routines, make constant implicit references to the current object. For example in the instruction

    balance := balance + sum

appearing in the body of procedure deposit of class ACCOUNT , the name of the attribute balance , in both occurrences, denotes the balance field of the current object, assumed to be an instance of ACCOUNT . In the same way, the procedure body that we used for the creation procedure make in the ACCOUNT1 variant

    make ( sum : INTEGER ) is

    -- Initialize account with sum .

    do

    deposit ( sum )

    end

contains a call to the procedure deposit . Contrary to earlier calls written in dot notation as target . feature ( … ) , the call to deposit has no explicit target; this means its target is the current object, an instance of ACCOUNT1 . Such a call is said to be unqualified ; those using dot notations are qualified calls.

Although most uses of the current object are implicit, a class may need to name it explicitly. The predefined expression Current is available for that purpose. A typical use, in a routine merge ( other : ACCOUNT ) of class ACCOUNT , would be a test of the form

    if other = Current then

    report_error (" Error: trying to merge an account with itself !")

    else

    … Normal processing (merging two different accounts) …

    end

With these notions it is not hard to define precisely the overall scenario of a system execution by defining which object and routine will, at each instant, be the current object and the current routine:

    + Starting a system execution, as we have seen, consists in creating an instance of the root class, the root object, and executing a designated creation procedure, the root procedure, with the root object as its target. The root object is the initial current object, and the root procedure is the initial current procedure.

    + From then on only two events can change the current object and current procedure: a qualified routine call; and the termination of a routine.

    + In a call of the form target . routine ( … ) , target denotes a certain object TC. (If not, that is to say, if the value of target is void, attempting to execute the call will trigger an exception, as studied below.) The generating class of TC must, as per the Feature Call rule, contain a routine of name routine . As the call starts, TC becomes the new current object and routine becomes the new current routine.

    + When a routine execution terminates, the target object and routine of the most recent non-terminated call -- which, just before just before the terminated call, were the current object and the current routine -- assume again the role of current object and current routine.

    + The only exception to the last rule is termination of the original root procedure call; in this case the entire execution terminates.

Abstraction

The description of assignments stated that in x := y the target x must be an entity. More precisely it must be a writable entity. This notion excludes formal routine arguments: as noted, a routine r ( arg : SOME_TYPE ) may assign to arg (reattaching it to a different object), although it can change the attached objects through calls of the form arg . procedure ( … ) .

Restricting assignment targets to entities precludes assignments of the form obj . some_attribute := some_value , since the left-hand side obj . some_attribute is an expression (a feature call), not an entity: you may no more assign to obj . some_attribute than to, say, a + b -- another expression that is also, formally, a feature call.

To obtain the intended effect of such an assignment you may use a procedure call of the form obj . set_attribute ( some_value ), where the base class of obj 's type has defined the procedure

    set_attribute (v: VALUE_TYPE) is

    -- Set value of attribute to v .

    do

    attribute := v

    end

This rule is essential to enforcing the method. Permitting direct assignments to an object's fields -- as in C++ and Java -- would violate all the tenets of information hiding by letting clients circumvent the interface carefully crafted by the author of a supplier class. It is the responsibility of each class author to define the exact privileges that the class gives to each of its clients, in particular field modification rights. Building a class is like building a machine: you design the internals, to give yourself the appropriate mechanisms; and you design the control panel, letting users (clients) access the desired subset of these mechanisms, safely and conveniently.

The levels of privilege available to the class author include, for any field:

    + Hide the field completely from clients, by exporting the corresponding attribute to NONE .

    + Export it, but in read-only mode, by not exporting any procedure that modifies it.

    + Export it for free read and write by any client, by also exporting a procedure of the set_attribute kind.

    + Export it in restricted-write mode, by exporting a procedure such as deposit of class ACCOUNT , which adds a specified amount to the balance field, rather than directly setting the balance.

The last case is particularly interesting is that it allows the class designer to set the precise way in which clients will manipulate the class instances, respecting the properties of the class and its integrity. The exported routines may, through the Design by Contract mechanism reviewed later ( 8 ), place some further restrictions on the permitted modifications, for example by requiring the withdrawn amount to be positive.

These rules follow directly from the more general goals (reusability, extendibility, reliability) and principles (Uniform Access, information hiding) underlying Eiffel software design. They reflect a view that each class must denote a well-understood abstraction, defined by a set of exported features chosen by the class designer -- the "control panel".

The class documentation (the contract form , see page 44 ) makes this view clear to client authors; no violation of that interface is permitted. This approach also paves the way for future generalization -- the final step of the cluster lifecycle, seen earlier on page 9 -- of the most promising components, and their inclusion into reusable libraries.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


7 GENERICITY AND ARRAYS

Some of the classes that we will need, particularly in libraries, are container classes, describing data structures made of a number of objects of the same or similar types. Examples of containers include arrays, stacks and lists. The class DEPOSIT_LIST posited in earlier examples describes containers.

It is not hard, with the mechanisms seen so far, to write the class DEPOSIT_LIST , which would include such features as count (query returning the number of deposit objects in the list) and put (command to insert a new deposit object).

Most of the operations, however, would be the same for lists of objects other than deposits. To avoid undue replication of efforts and promote reuse, we need a way to describe generic container classes, which we can use to describe containers containing elements of many different types.

Making a class generic

The notation

    class C [ G ] … The rest as for any other class declaration …

introduces a generic class. A name such as G appearing in brackets after the class name is known as a formal generic parameter ; it represents an arbitrary type.

Within the class text, feature declarations can freely use G even though it is not known what type G stands for. Class LIST of EiffelBase, for example, includes features

    first: G

    -- Value of first list item

    extend (val: G) is

    -- Add a new item of value val at end of list

    …

The operations available on an entity such as first and val , whose type is a formal generic parameter, are the operations available on all types: use as source y of an assignment x := y , use as target x of such an assignment (although not for val , which as a formal routine argument is not writable), use in equality comparisons x = y or x /= y , and application of universal features from ANY such as clone , equal and copy .

To use a generic class such as list, a client will provide a type name as actual generic parameter . So instead of relying on a special purpose class DEPOSIT_LIST , the class ACCOUNT could include the declaration

    all_deposits : LIST [ DEPOSIT ]

using LIST as a generic class and DEPOSIT as the actual generic parameter. Then all features declared in LIST as working on values of type G will work, when called on the target all_deposits , on values of type DEPOSIT . With the target

    all_accounts : LIST [ ACCOUNT ]

these features would work on values of type ACCOUNT .

A note of terminology: to avoid confusion, Eiffel always uses the word argument for routine arguments, reserving parameter for the generic parameters of classes.

Genericity reconciles extendibility and reusability with the static type checking demanded by reliability. A typical error, such as confusing an account and a deposit, will be detected immediately at compile time, since the call all_accounts . extend ( dep ) is invalid for dep declared of type DEPOSIT . What is valid is something like all_accounts . extend ( acc ) for acc of type ACCOUNT . In other approaches, the same effect might require costly run-time checks (as in Java, C# or Smalltalk), with the risk of run-time errors.

This form of genericity is known as unconstrained because the formal generic parameter, G in the example, represents an arbitrary type. You may also want to use types that are guaranteed to have certai operations available. This is known as constrained genericity and will be studied with inheritance.

Arrays

An example of generic class from the Kernel Library is ARRAY [ G ] , which describes direct-access arrays. Features include:

    + put to replace an element's value, as in my_array . put ( val , 25 ) which replaces by val the value of the array entry at index 25.

    + item to access an entry, as in my_array . item ( 25 ) yielding the entry at index 25. A synonym is infix "@" , so that you may also write more tersely, for the same result, my_array @ 25 .

    + lower , upper and count : queries yielding the bounds and the number of entries.

    + The creation procedure make , as in create my_array . make ( 1, 50 ) which creates an array with the given index bounds. It is also possible to resize an array through resize , retaining the old elements. In general, the Eiffel method abhors built-in limits, favoring instead structures that resize themselves when needed, either from explicit client request or automatically.

The comment made about INTEGER and other basic classes applies to ARRAY too: Eiffel compilers know about this class, and will be able to process expressions of the form my_array . put ( val , 25 ) and my_array @ 25 in essentially the same way as a C or Fortran array access -- my_array [ 25 ] in C. But it is consistent and practical to let developers treat ARRAY as a class and arrays as objects; many library classes in EiffelBase, for example, inherit from ARRAY . Once again the idea is to get the best of both worlds: the convenience and uniformity of the object-oriented way of thinking; and the efficiency of traditional approaches.

A similar technique applies to another Kernel Library class, that one not generic: STRING , describing character strings with a rich set of string manipulation features.

Generic derivation

The introduction of genericity brings up a small difference between classes and types. A generic class C is not directly a type since you cannot declare an entity as being of type C : you must use some actual generic parameter T -- itself a type. C [ T ] is indeed a type, but class C by itself is only a type template.

The process of obtaining a type C [ T ] from a general class C is known as a generic derivation ; C [ T ] is a generically derived type . Type T itself is, recursively, either a non-generic class or again a generically derived type D [ U ] for some D and U , as in LIST [ ARRAY [ INTEGER ]] .)

It remains true, however, that every type is based on a class. The base class of a generically derived type C [ T ] is C .

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


8 DESIGN BY CONTRACTTM, ASSERTIONS, EXCEPTIONS

Previous, Up, Next Previous sectionUpNext section

8 DESIGN BY CONTRACT TM , ASSERTIONS, EXCEPTIONS

Eiffel directly implements the ideas of Design by Contract TM , which enhance software reliability and provide a sound basis for software specification, documentation and testing, as well as exception handling and the proper use of inheritance.

Design by Contract basics

A system -- a software system in particular, but the ideas are more general -- is made of a number of cooperating components. Design by Contract states that their cooperation should be based on precise specifications -- contracts -- describing each party's expectations and guarantees.

An Eiffel contract is similar to a real-life contract between two people or two companies, which it is convenient to express in the form of tables listing the expectations and guarantees. Here for example is how we could sketch the contract between a homeowner and the telephone company:

    provide_service | OBLIGATIONS | BENEFITS
Client | (Satisfy precondition:) Pay bill | (From postcondition:) Get telephone service
Supplier | (Satisfy postcondition:) Provide telephone service | (From precondition:) No need to provide anything if bill not paid

Note how the obligation for each of the parties maps onto a benefit for the other. This will be a general pattern.

The client's obligation, which protects the supplier, is called a precondition . It states what the client must satisfy before requesting a certain service. The client's benefit, which describes what the supplier must do (assuming the precondition was satisfied), is called a postcondition .

In addition to preconditions and postconditions, contract clauses include class invariants , which apply to a class as a whole. More precisely a class invariant must be ensured by every creation procedure (or by the default initialization if there is no creation procedure), and maintained by every exported routine of the class.

Expressing assertions

Eiffel provides syntax for expressing preconditions ( require ), postconditions ( ensure ) and class invariants ( invariant ), as well as other assertion constructs studied later (see "Instructions", page 84 ): loop invariants and variants, check instructions.

Here is a partial update of class ACCOUNT with more assertions:

    indexing

    description: "Simple bank accounts"

    class

    ACCOUNT

    feature -- Access

    balance: INTEGER

    -- Current balance

    deposit_count: INTEGER is

    -- Number of deposits made since opening

    do

    … As before …

    end

    feature -- Element change

    deposit (sum: INTEGER) is

    -- Add sum to account.

    require

    non_negative: sum >= 0

    do

    … As before …

    ensure

    one_more_deposit:
    deposit_count = old deposit_count + 1

    updated: balance = old balance + sum

    end

    feature { NONE } -- Implementation

    all_deposits: DEPOSIT_LIST

    -- List of deposits since account's opening.

    invariant

    consistent_balance: (all_deposits /= Void) implies
     (balance = all_deposits . total)

    zero_if_no_deposits: (all_deposits = Void) implies
     (balance = 0)

    end -- class ACCOUNT

Each assertion is made of one or more subclauses, each of them a boolean expression (with the additional possibility of the old construct). The effect of including more than one subclause, as in the postcondition of deposit and in the invariant, is the same as connecting them through an and . Each clause may be preceded by a label, such as consistent_balance in the invariant, and a colon; the label is optional and does not affect the assertion's semantics, except for error reporting as explained in the next section, but including it systematically is part of the recommended style. The value of the boolean expression a implies b is true except if a is true and b false.

Because assertions benefit from the full power of boolean expressions, they may include function calls. This makes it possible to express sophisticated consistency conditions, such as " the graph contains no cycle ", which would not be otherwise expressible through simple expressions, or even through first-order predicate calculus, but which are easy to implement as Eiffel functions returning boolean results.

The precondition of a routine expresses conditions that the routine is imposing on its clients. Here a call to deposit is correct if and only if the value of the argument is non-negative. The routine does not guarantee anything for a call that does not satisfy the precondition. It is in fact part of the Eiffel method that a routine body should never test for the precondition, since it is the client's responsibility to ensure it. (An apparent paradox of Design by Contract, which is reflected in the bottom-right entries of the preceding and follwing contract tables, and should not be a paradox any more at the end of this discussion, is that one can get more reliable software by having fewer explicit checks in the software text.)

The postcondition of a routine expresses what the routine guaranteed to its clients for calls satisfying the precondition. The notation old expression , valid in postconditions ( ensure clauses) only, denotes the value that expression had on entry to the routine.

The precondition and postcondition state the terms of the contract between the routine and its clients, similar to the earlier example of a human contract:

    deposit | OBLIGATIONS | BENEFITS
Client | (Satisfy precondition:) Use a non-negative argument. | (From postcondition:) Get deposits list and balance updated.
Supplier | (Satisfy postcondition:) Update deposits list and balance. | (From precondition:) No need to handle negative arguments.

The class invariant, as noted, applies to all features. It must be satisfied on exit by any creation procedure, and is implicitly added to both the precondition and postcondition of every exported routine. In this respect it is both good news and bad news for the routine implementer: good news because it guarantees that the object will initially be in a stable state, averting the need in the example to check that the total of all_deposits is compatible with the balance ; bad news because, in addition to its official contract as expressed by its specific postcondition, every routine must take care of restoring the invariant on exit.

A requirement on meaningful contracts is that they should be in good faith: satisfiable by an honest partner. This implies a consistency rule: if a routine is exported to a client (either generally or selectively), any feature appearing in its precondition must also be available to that client. Otherwise -- for example if the precondition included require n > 0 , where n is a secret attribute -- the supplier would be making demands that a good-faith client cannot possibly check for.

Note in this respect that guaranteeing a precondition does not necessarily mean, for the client, testing for it. Assuming n is exported, a call may test for the precondition

    if x . n > 0 then x . r end

possibly with an else part. But if the context of the call, in the client's code, implies that n is positive -- perhaps because some preceding call set it to the sum of two squares -- then there is no need for an if or similar construct.

In such a case, a check instruction as introduced later ( "Instructions", page 84 ) is recommended if the reason for omitting the test is non-trivial.

Using contracts for built-in reliability

What are contracts good for? Their first use is purely methodological. By applying a discipline of expressing, as precisely as possible, the logical assumptions behind software elements, you can write software whose reliability is built-in: software that is developed hand-in-hand with the rationale for its correctness.

This simple observation -- usually not clear to people until they have practiced Design by Contract thoroughly on a large-scale project -- brings as much change to software practices and quality as the rest of object technology.

Run-time assertion monitoring

Contracts in Eiffel are not just wishful thinking. They can be monitored at run time under the control of compilation options.

It should be clear from the preceding discussion that contracts are not a mechanism to test for special conditions, for example erroneous user input. For that purpose, the usual control structures ( if deposit_sum >= 0 then …) are available, complemented in applicable cases by the exception handling mechanism reviewed next. An assertion is instead a correctness condition governing the relationship between two software modules (not a software module and a human, or a software module and an external device). If sum is negative on entry to deposit , violating the precondition, the culprit is some other software element, whose author was not careful enough to observe the terms of the deal. Bluntly:

    Assertion Violation rule

    A run-time assertion violation is the manifestation of a bug.

To be more precise:

    + A precondition violation signals a bug in the client, which did not observe its part of the deal.

    + A postcondition (or invariant) violation signals a bug in the supplier -- the routine -- which did not do its job.

That violations indicate bugs explains why it is legitimate to enable or disable assertion monitoring through mere compilation options: for a correct system -- one without bugs -- assertions will always hold, so the compilation option makes no difference to the semantics of the system.

But of course for an incorrect system the best way to find out where the bug is -- or just that there is a bug -- is often to monitor the assertions during development and testing. Hence the presence of the compilation options, which ISE's EiffelStudio lets you set separately for each class, with defaults at the system and cluster levels:

    + no : assertions have no run-time effect.

    + require : monitor preconditions only, on routine entry.

    + ensure : preconditions on entry, postconditions on exit.

    + invariant : like ensure , plus class invariant on both entry and exit for qualified calls.

    + all : like invariant , plus check instructions, loop invariants and loop variants ( "Instructions", page 84 ).

An assertion violation, if detected at run time under one of these options other than the first, will cause an exception ( "Exception handling", page 46 ). Unless the software has an explicit "retry" plan as explained in the discussion of exceptions, the violation will cause produce an exception trace and cause termination (or, in EiffelStudio, a return to the environment's browsing and debugging facilities at the point of failure). If present, the label of the violated subclause will be displayed, to help identify the problem.

The default is require . This is particularly interesting in connection with the Eiffel method's insistence on reuse: with libraries such as EiffelBase, richly equipped with preconditions expressing terms of use, an error in the client software will often lead, for example through an incorrect argument, to violating one of these preconditions. A somewhat paradoxical consequence is that even an application developer who does not apply the method too well (out of carelessness, haste, indifference or ignorance) will still benefit from the presence of contracts in someone else 's library code.

During development and testing, assertion monitoring should be turned on at the highest possible level. Combined with static typing and the immediate feedback of compilation techniques such as the Melting Ice Technology, this permits the development process mentioned in the section "Quality and functionality", page 10 , where errors are exterminated at birth. No one who has not practiced the method in a real project can imagine how many mistakes are found in this way; surprisingly often, a violation will turn out to affect an assertion that was just included for goodness' sake, the developer being convinced that it could never "possibly" fail to be satisfied.

By providing a precise reference (the description of what the software is supposed to do) against which to assess the reality (what the software actually does), Design by Contract profoundly transforms the activities of debugging, testing and quality assurance.

When releasing the final version of a system, it is usually appropriate to turn off assertion monitoring, or bring it down to the require level. The exact policy depends on the circumstances; it is a tradeoff between efficiency considerations, the potential cost of mistakes, and how much the developers and quality assurance team trust the product. When developing the software, however, you should always assume -- to avoid loosening your guard -- that in the end monitoring will be turned off.

The contract form of a class

Another application of assertions governs documentation. Environment mechanisms, such as clicking the Contract Form icon in EifffelStudio, will produce, from a class text, an abstracted version which only includes the information relevant for client authors. Here is the contract form of class ACCOUNT in the latest version given:

    indexing

    description: "Simple bank accounts"

    class interface

    ACCOUNT

    feature -- Access

    balance: INTEGER

    -- Current balance

    deposit_count: INTEGER

    -- Number of deposits made since opening

    feature -- Element change

    deposit (sum: INTEGER)

    -- Add sum to account.

    require

    non_negative: sum >= 0

    ensure

    one_more_deposit: deposit_count = old deposit_count + 1

    updated: balance = old balance + sum

    invariant

    consistent_balance: balance = all_deposits . total

    end -- class interface ACCOUNT

The words class interface are used instead of just class to avoid any confusion with actual Eiffel text, since this is documentation, not executable software. (It is in fact possible to generate a compilable variant of the Contract Form in the form of a deferred class, a notion defined later.)

Compared to the full text, the Contract Form of a class (also called its " short form ") retains all its interface properties, relevant to client authors:

    + Names and signatures (argument and result type information) for exported features.

    + Header comments of these features, which carry informal descriptions of their purpose. (Hence the importance, mentioned in section 4 , of always including such comments and writing them carefully.)

    + Preconditions and postconditions of these features (at least the subclauses involving only exported features).

    + Class invariant (same observation).

The following elements, however, are not in the Contract Form: any information about non-exported features; all the routine bodies ( do clauses, or the external and once variants seen in "External software", page 16 above and "Once routines and shared objects", page 82 below); assertion subclauses involving non-exported features; and some keywords not useful in the documentation, such as is for a routine.

In accordance with the Uniform Access principle (page 19 ), the Contract Form does not distinguish between attributes and argument-less queries. In the above example, balance could be one or the other, as it makes no difference to clients, except possibly for performance.

The Contract Form is the fundamental tool for using supplier classes in the Eiffel method. It enables client authors to reuse software elements without having to read their source code. This is a crucial requirement in large-scale industrial developments.

The Contract Form satisfies two key requirements of good software documentation:

    + It is truly abstract, free from the implementation details of what it describes and concentrating instead on its functionality.

    + Rather than being developed separately -- an unrealistic requirement, hard to impose on developers initially and becoming impossible in practice if we expect the documentation to remain up to date as the software evolves -- the documentation is extracted from the software itself. It is not a separate product but a different view of the same product. This prolongs the Single Product principle that lies at the basis of Eiffel's seamless development model (section 3 ).

The Contract Form is only one of the relevant views. EiffelStudio, for example, generates graphical representations of system structures, to show classes and their relations -- client, inheritance -- according to the conventions of BON (the Business Object Notation). In accordance with the principles of seamlessness and reversibility, EiffelStudio lets you both work on the text, producing the graphics on the fly, or work on the graphics, updating the text on the fly; you can alternate as you wish between these two modes. The resulting process is quite different from more traditional approaches based on separate tools: an analysis and CASE workbench, often based on UML, to deal with an initial "bubble-and-arrow" description; and a separate programming environment, to deal with implementation aspects only. In Eiffel the environment provides consistent, seamless support from beginning to end.

The Contract Form -- or its variant the Flat-Contract Form, which takes account of inheritance ( "Flat and Flat-Contract Forms", page 72 ) are the standard form of library documentation, used extensively, for example, in the book Reusable Software (see bibliography). Assertions play a central role in such documentation by expressing the terms of the contract. As demonstrated a contrario by the widely publicized $500-million crash of the Ariane-5 rocket launcher in June of 1996, due to the incorrect reuse of a software module from the Ariane-4 project, reuse without a contract documentation is the path to disaster. Non-reuse would, in fact, be preferable.

Exception handling

Another application of Design by Contract governs the handling of unexpected cases. The vagueness of many discussions of this topic follows from the lack of a precise definition of terms such as "exception". With Design by Contract we are in a position to be specific:

    + Any routine has a contract to achieve.

    + Its body defines a strategy to achieve it -- a sequence of operations, or some other control structure involving operations. Some of these operations are calls to routines, with their own contracts; but even an atomic operation, such as the computation of an arithmetic operation, has an implicit contract, stating that the result will be representable.

    + Any one of these operations may fail , that is to say be unable to meet its contract; for example an arithmetic operation may produce an overflow (a non-representable result).

    + The failure of an operation is an exception for the routine that needed the operation.

    + As a result the routine may fail too -- causing an exception in its own caller.

Note the precise definitions of the two key concepts, failure and exception. Although failure is the more basic one -- since it is defined for atomic, non-routine operations -- the definitions are mutually recursive, since an exception may cause a failure of the recipient routine, and a routine's failure causes an exception in its own caller.

Why state that an exception "may" cause a failure? It is indeed possible to "rescue" a routine from failure in the case of an exception, by equipping it with a clause labeled rescue , as in:

    read_next_character (f: FILE) is

    -- Make next character available in last_character ;

    -- if impossible, set failed to True.

    require

    readable: file . readable

    local

    impossible: BOOLEAN

    do

    if impossible then

    failed := True

    else

    last_character := low_level_read_function ( f )

    end

    rescue

    impossible := True

    retry

    end

This example includes the only two constructs needed for exception handling: rescue and retry . A retry instruction is only permitted in a rescue clause; its effect is to start again the execution of the routine, without repeating the initialization of local entities (such as impossible in the example, which was initialized to False on first entry). Features failed and last_character are assumed to be attributes of the enclosing class.

This example is typical of the use of exceptions: as a last resort, for situations that should not occur. The routine has a precondition, file . readable , which ascertains that the file exists and is accessible for reading characters. So clients should check that everything is fine before calling the routine. Although this check is almost always a guarantee of success, a rare combination of circumstances could cause a change of file status (because a user or some other system is manipulating the file) between the check for readable and the call to low_level_read_function . If we assume this latter function will fail if the file is not readable, we must catch the exception.

A variant would be

    local

    attempts: INTEGER

    do

    if attempts < Max_attempts then

    last_character := low_level_read_function (f)

    else

    failed := True

    end

    rescue

    attempts := attempts + 1

    retry

    end

which would try again up to Max_attempts times before giving up.

The above routine, in either variant, never fails: it always fulfills its contract, which states that it should either read a character or set failed to record its inability to do so. In contrast, consider the new variant

    local

    attempts: INTEGER

    do

    last_character := low_level_read_function (f)

    rescue

    attempts := attempts + 1

    if attempts < Max_attempts then

    retry

    end

    end

with no more role for failed . In this case, after Max_attempts unsuccessful attempts, the routine will execute its rescue clause to the end, with no retry (the if having no else clause). This is how a routine fails . It will, as noted, pass on the exception to its caller.

Such a rescue clause should, before terminating, restore the invariant of the class so that the caller and possible subsequent retry attempts from higher up find the objects in a consistent state. As a result, the rule for an absent rescue clause -- the case for the vast majority of routines in most systems -- is that it is equivalent to

    rescue

    default_rescue

where procedure default_rescue comes from ANY , where it is defined to do nothing; in a system built for robustness, classes subject to non-explicitly- rescue d exceptions should redefine default_rescue (perhaps using a creation procedure, which is bound by the same formal requirement) so that it will always restore the invariant.

Behind Eiffel's exception handling scheme lies the principle -- at first an apparent platitude, but violated by many existing mechanisms -- that a routine should either succeed or fail . This is in turn a consequence of Design by Contract principles: succeeding means being able to fulfill the contract, possibly after one or more retry ; failure is the other case, which must always trigger an exception in the caller. Otherwise it would be possible for a routine to miss its contract and yet return to its caller in a seemingly normal state. That is the worst possible way to handle an exception.

Concretely, exceptions may result from the following events:

    + A routine failure ( rescue clause executed to the end with no retry ), as just seen.

    + Assertion violation, if for a system that runs with assertion monitoring on.

    + Attempt to call a feature on a void reference: x . f ( … ) , the fundamental computational mechanism, can only work if x is attached to an object, and will cause an exception otherwise.

    + Developer exception, as seen next.

    + Operating system signal:arithmetic overfolow; no memory available for a requested creation or clone -- even after garbage collection has rummaged everything to find some space. (But no C/C++-like "wrong pointer address", which cannot occur thanks to the statically typed nature of Eiffel.)

It is sometimes useful, when handling exceptions in rescue clauses, to ascertain the exact nature of the exception that got the execution there. For this it is suffices to inherit from the Kernel Library class EXCEPTIONS , which provides queries such as exception , giving the code for the last exception, and symbolic names ( "Constant and unique attributes", page 83 ) for all such codes, such as No_more_memory . You can then process different exceptions differently by testing exception against various possibilities. The method strongly suggests, however, that exception handling code should remain simple; a complicated algorithm in a rescue clause is usually a sign that the mechanism is being misused.

Class EXCEPTIONS also provides various facilities for fine-tuning the exception facilities, such as a procedure raise that will explicitly trigger a "developer exception" with a code than can then be detected and processed.

Exception handling helps produce Eiffel software that is not just correct but robust, by planning for cases that should not normally arise, but might out of Murphy's law, and ensuring they do not affect the software's basic safety and simplicity.

Other applications of Design by Contract

The Design by Contract ideas pervade the Eiffel method. In addition to the applications just mentioned, they have two particularly important consequences:

    + They make it possible to use Eiffel for analysis and design. At a high level of abstraction, it is necessary to be precise too. With the exception of BON, object-oriented analysis and design methods tend to favor abstraction over precision. Thanks to assertions, it is possible to express precise properties of a system (" At what speed should the alarm start sounding? ") without making any commitment to implementation. The discussion of deferred classes ( "Applications of deferred classes", page 60 ) will show how to write a purely descriptive, non-software model in Eiffel, using contracts to describe the essential properties of a system without any computer or software aspect.

    + Assertions also serve to control the power of inheritance-related mechanisms -- redeclaration, polymorphism, dynamic binding -- and channel them to correct uses by assigning the proper semantic limits. See "Inheritance and contracts", page 66 .

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


9 INHERITANCE

Inheritance is a powerful and attractive technique. A look at either the practice or literature shows, however, that it is not always well applied. Eiffel has made a particular effort to tame inheritance for the benefit of modelers and software developers. Many of the techniques are original with Eiffel. Paul Dubois has written ( comp.lang.python Usenet newsgroup, 23 March 1997): there are two things that [Eiffel] got right that nobody else got right anywhere else: support for design by contract, and multiple inheritance. Everyone should understand these "correct answers" if only to understand how to work around the limitations in other languages .

Basic inheritance structure

To make a class inherit from another, simply use an inherit clause:

    indexing … class D creation … inherit

    A

    B

    …

    feature

    …

This makes D an heir of A , B and any other class listed. Eiffel supports multiple inheritance: a class may have as many parents as it needs. Later sections ( "Multiple inheritance and renaming", page 64 and "Repeated inheritance and selection", page 73 ) will explain how to handle possible conflicts between parent features.

This discussion will rely on the terminology introduced on page 14 : descendants of a class are the class itself, its heirs, the heirs of its heirs and so on. Proper descendants exclude the class itself. The reverse notions are ancestors and proper ancestors .

By default D will simply include all the original features of A , B , …, to which it may add its own through its feature clauses if any. But the inheritance mechanism is more flexible, allowing D to adapt the inherited features in many ways. Each parent name -- A , B , … in the example -- can be followed by a Feature Adaptation clause, with subclauses, all optional, introduced by keywords rename , export , undefine , redefine and select , enabling the author of A to make the best use of the inheritance mechanism by tuning the inherited features to the precise needs of D . This makes inheritance a principal tool in the Eiffel process, mentioned earlier, of carefully crafting each individual class, like a machine, for the benefit of its clients. The next sections review the various Feature Adaptation subclauses.

Redefinition

The first form of feature adaptation is the ability to change the implementation of an inherited feature.

Assume a class SAVINGS_ACCOUNT that specializes the notion of account. It is probably appropriate to define it as an heir to class ACCOUNT , to benefit from all the features of ACCOUNT still applicable to savings accounts, and to reflect the conceptual relationship between the two types: every savings account, apart from its own specific properties, also "is" an account. But we may need to produce a different effect for procedure deposit which, besides recording the deposit and updating the balance, may also need, for example, to update the interest.

This example is typical of the form of reuse promoted by inheritance and crucial to effective reusability in software: the case of reuse with adaptation . Traditional forms of reuse are all-or-nothing: either you take a component exactly as it is, or you build your own. Inheritance will get us out of this "reuse or redo" dilemma by allowing us to reuse and redo. The mechanism is feature redefinition:

    indexing

    description: "Savings accounts"

    class

    SAVINGS_ACCOUNT

    inherit

    ACCOUNT

    redefine deposit end

    feature -- Element change

    deposit ( sum : INTEGER ) is

    -- Add sum to account.

    do

    … New implementation (see below) …

    end

    … Other features …

    end -- class SAVINGS_ACCOUNT

Without the redefine subclause, the declaration of deposit would be invalid, yielding two features of the same name, the inherited one and the new one. The subclause makes this valid by specifying that the new declaration will override the old one.

In a redefinition, the original version -- such as the ACCOUNT implementation of deposit in this example -- is called the precursor of the new version. It is common for a redefinition to rely on the precursor's algorithm and add some other actions; the reserved word Precursor helps achieve this goal simply. Permitted only in a routine redefinition, it denotes the parent routine being redefined. So here he body of the new deposit (called " New implementation " above) could be of the form

    Precursor (sum) -- Apply ACCOUNT's version of deposit

    … Instructions to update the interest …

Besides changing the implementation of a routine, a redefinition can turn an argument-less function into an attribute; for example a proper descendant of ACCOUNT could redefine deposits_count , originally a function, as an attribute. The Uniform Access Principle (page 19 ) guarantees that the redefinition makes no change for clients, which will continue to use the feature under the form acc . deposits_count .

Polymorphism

The inheritance mechanism is relevant to both roles of classes: module and type. Its application as a mechanism to reuse, adapt and extend features from one class to another, as just seen, covers its role as a module extension mechanism. But it's also a subtyping mechanism. To say that D is an heir of A , or more generally a descendant of A , is to expresses that instances of D can be viewed as instances of A .

Polymorphic assignment supports this second role. In an assignment x := y , the types of x and y do not have, with inheritance, to be identical; the rule is that the type of y must simply conform to the type of x . A class D conforms to a class A if and only if it is a descendant of A (which includes the case in which A and D are the same class); if these classes are generic, conformance of D [ U ] to C [ T ] requires in addition that type U conform to type T (through the recursive application of the same rules).

In addition, it follows from the earlier discussion of tuples ( "Tuple types", page 90 ), that TUPLE [ X ] conforms to TUPLE, TUPLE [ X, Y, ] to TUPLE [ X ] and so on.

So with the inheritance structure that we have seen, the declarations

    acc : ACCOUNT ; sav : SAVINGS_ACCOUNT

make it valid to write the assignment

    acc := sav

which will assign to acc a reference attached (if not void) to a direct instance of type SAVINGS_ACCOUNT , not ACCOUNT .

Such an assignment, where the source and target types are different, is said to be polymorphic. An entity such as acc , which as a result of such assignments may become attached at run time to objects of types other than the one declared for it, is itself called a polymorphic entity.

For polymorphism to respect the reliability requirements of Eiffel, it must be controlled by the type system and enable static type checking. We certainly do not want an entity of type ACCOUNT to become attached to an object of type DEPOSIT . Hence the second typing rule:

    Type Conformance rule

    An assignment x := y , or the use of y as actual argument corresponding to the formal argument x in a routine call, is only valid if the type of y conforms to the the type of x .

The second case listed in the rule is a call such as target . routine ( …, y , … ) where the routine declaration is of the form routine ( …, x : SOME_TYPE , … ) . The relationship between y , the actual argument in the call, and the corresponding formal argument x , is exactly the same as in an assignment x := y : not just the type rule, as expressed by Type Conformance (the type of y must conform to SOME_TYPE ), but also the actual run-time effect which, as for assignments, will be either a reference attachment or, for expanded types, a copy.

The ability to accept the assignment x := Void for x of any reference type ( "Basic operations", page 28 ) is a consequence of the Type Conformance rule, since Void is of type NONE which by construction ( "The global inheritance structure", page 15 ) conforms to all types.

Polymorphism also yields a more precise definition of "instance". A direct instance of a type A is an object created from the exact pattern defined by the declaration of A 's base class, with one field for each of the class attributes; you will obtain it through a creation instruction of the form create x …, for x of type A , or by cloning an existing direct instance. An instance of A is a direct instance of any type conforming to A : A itself, but also any type based on descendant classes. So an instance of SAVINGS_ACCOUNT is also an instance, although not a direct instance, of ACCOUNT .

A consequence of polymorphism is the ability to define polymorphic data structures . With a declaration such as

accounts : LIST [ ACCOUNT ]

the procedure call accounts . extend ( acc ), because it uses a procedure extend which in this case expects an argument of any type conforming to ACCOUNT , will be valid not only if acc is of type ACCOUNT but also if it is of a descendant type such as SAVINGS_ACCOUNT . Successive calls of this kind make it possible to construct a data structure that, at run-time, might contain objects of several types, all conforming to ACCOUNT :

Such polymorphic data structures combine the flexibility and safety of genericity and inheritance. You can make them more or less general by choosing for the actual generic parameter, here ACCOUNT , a type higher or lower in the inheritance hierarchy. Static typing is again essential here, prohibiting for example a mistaken insertion of the form accounts . extend ( dep ) where dep is of type DEPOSIT , which does not conform to ACCOUNT .

At the higher (most abstract) end of the spectrum, you can produce an unrestrictedly polymorphic data structure general_list : LIST [ ANY ] which makes the call general_list . extend ( x ) valid for any x . The price to pay is that retrieving an element from such a structure will yield an object on which the only known applicable operations are the most general ones, valid for all types: assignment, copy, clone, equality comparison and others from ANY . Assignment attempt, studied below, will make it possible to apply more specific operations after checking dynamically that a retrieved object is of the appropriate type.

Dynamic binding

The complement of polymorphism is dynamic binding, the answer to the question "What version of a feature will be applied in a call whose target is polymorphic?".

Consider acc is of type ACCOUNT . Thanks to polymorphism, an object attached to acc may be a direct instance not just of ACCOUNT but also of SAVINGS_ACCOUNT or other descendants. Some of these descendants, indeed SAVINGS_ACCOUNT among them, redefine features such as deposit . Then we have to ask what the effect will be for a call of the form

    acc . deposit ( some_value )

Dynamic binding is the clearly correct answer: the call will execute the version of deposit from the generating class of the object attached to acc at run time. If acc is attached to a direct instance of ACCOUNT , execution will use the original ACCOUNT version; if acc is attached to a direct instance of SAVINGS_ACCOUNT , the call will execute the version redefined in that class.

This is a clear correctness requirement. A policy of static binding (as available for example in C++ or Delphi, for non-virtual functions) would take the declaration of acc as an ACCOUNT literally. But that declaration is only meant to ensure generality, to enable the use of a single entity acc in many different cases: what counts at execution time is the object that acc represents. Applying the ACCOUNT version to a SAVINGS_ACCOUNT object would be wrong, possibly leading in particular to objects that violate the invariant of their own generating class (since there is no reason a routine of ACCOUNT will preserve the specific invariant of a proper descendant such as SAVINGS_ACCOUNT , which it does not even know about).

In some cases, the choice between static and dynamic binding does not matter: this is the case for example if a call's target is not polymorphic, or if the feature of the call is redefined nowhere in the system. In such cases the use of static binding permits slightly faster calls (since the feature is known at compile time). This application of static binding should, however, be treated as a compiler optimization . The EiffelStudio compiler, under its "finalization" mode, which performs extensive optimization, will detect some of these cases and process them accordingly -- unlike approaches that make developers responsible for specifying what should be static and what dynamic (a tedious and error-prone task, especially delicate because a minute change in the software can make a static call, in a far-away module of a large system, suddenly become dynamic). Eiffel programmers don't need to worry about such aspects; they can rely on the semantics of dynamic binding in all cases, with the knowledge that the compiler will apply static binding when safe and desirable.

Even in cases that require dynamic binding, the design of Eiffel, in particular the typing rules, enable compilers to make the penalty over the static-binding calls of traditional approaches very small and, most importantly, constant-bounded : it does not grow with the depth or complexity of the inheritance structure. The discovery in 1985 of a technique for constant-time dynamic binding calls, even in the presence of multiple and repeated inheritance, was the event that gave the green light to the development of Eiffel.

Dynamic binding is particularly interesting for polymorphic data structures. If you iterate over the list of accounts of various kinds, accounts : LIST [ ACCOUNT ] , illustrated in the last figure, and at each step let acc represent the current list element, you can repeatedly apply

    acc . deposit (…)

to have the appropriate variant of the deposit operation triggered for each element.

The benefit of such techniques appears clearly if we compare them with the traditional way to address such needs: using multi-branch discriminating instructions of the form if " Account is a savings account " then … elseif " It is a money market account " then … and so on, or the corresponding case … of …, switch or inspect instructions. Apart from their heaviness and complexity, such solutions cause many components of a software system to rely on the knowledge of the exact set of variants available for a certain notion, such as bank account. Then any addition, change or removal of variants can cause a ripple of changes throughout the architecture. This is one of the majors obstacles to extendibility and reusability in traditional approaches. In contrast, using the combination of inheritance, redefinition, polymorphism and dynamic binding makes it possible to have a point of single choice -- a unique location in the system which knows the exhaustive list of variants. Every client then manipulates entities of the most general type, ACCOUNT , through dynamically bound calls of the form acc . some_account_ feature (…).

These observations make dynamic binding appear for what it is: not an implementation mechanism, but an architectural technique that plays a key role (along with information hiding, which it extends, and Design by Contract, to which it is linked through the assertion redefinition rules seen below) in providing the modular system architectures of Eiffel, the basis for the method's approach to reusability and extendibility. These properties apply as early as analysis and modeling, and continue to be useful throughout the subsequent steps.

Deferred features and classes

The examples of dynamic binding seen so far assumed that all classes were fully implemented, and dynamically bound features had a version in every relevant class, including the most general ones such as ACCOUNT .

It is also useful to define classes that leave the implementation of some of their features entirely to proper descendants. Such an abstract class is known as deferred ; so are its unimplemented features. The reverse of deferred is effective , meaning fully implemented.

LIST is a typical example of deferred class. As it describes the general notion of list, it should not favor any particular implementation; that will be the task of its effective descendants, such as LINKED_LIST (linked implementation), TWO_WAY_LIST (linked both ways) , ARRAYED_LIST (implementation by an array), all effective, and all indeed to be found in EiffelBase.

At the level of the deferred class LIST , some features such as extend (add an item at the end of the list) will have no implementation and hence will be declared as deferred. Here is the corresponding form, illustrating the syntax for both deferred classes and their deferred features:

    indexing

    description: "Sequential finite lists, without a commitment%[

    to a representation%]"

    deferred class

    LIST [ G ]

    feature -- Access

    count: INTEGER is

    -- Number of items in list

    do

    … See below; this feature can be effective …

    end

    feature -- Element change

    extend (x: G) is

    -- Add x at end of list.

    require

    space_available: not full

    deferred

    ensure

    one_more: count = old count + 1

    end

    … Other feature declarations and invariant …

    end -- class LIST

A deferred feature (considered to be a routine, although it can yield an attribute in a proper descendant) has the single keyword deferred in lieu of the do Instructions clause of an effective routine. A deferred class -- defined as a class that has at least one deferred feature -- must be introduced by deferred class instead of just class .

As the example of extend shows, a deferred feature, although it has no implementation, can be equipped with assertions. They will be binding on implementations in descendants, in a way to be explained below.

Deferred classes do not have to be fully deferred. They may contain some effective features along with their deferred ones. Here, for example, we may express count as a function:

    count: INTEGER is

    -- Number of items in list

    do

    from start until after loop

    Result := Result + 1; forth

    end

    end

This implementation relies on the loop construct described below ( from introduces the loop initialization) and on a set of deferred features of the class which allow traversal of a list based on moving a fictitious cursor: start to bring the cursor to the first element if any, after to find out whether all relevant elements have been seen, and forth (with precondition not after ) to advance the cursor to the next element. Procedure forth itself appears as

    forth is

    -- Advance cursor by one position

    require

    not_after: not after

    deferred

    ensure

    moved_right: index = old index + 1

    end

where index -- another deferred feature -- is the integer position of the cursor.

Although the above version of feature count is time-consuming -- it implies a whole traversal just for the purpose of determining the number of elements -- it has the advantage of being applicable to all variants, without any commitment to a choice of implementation, as would follow for example if we decided to treat count as an attribute. Proper descendants can always redefine count for more efficiency.

Function count illustrates one of the most important contributions of the method to reusability: the ability to define behavior classes that capture common behaviors (such as count) while leaving the details of the behaviors (such as start , after , forth ) open to many variants. As noted earlier, traditional approaches to reusability provide closed reusable components. A component such as LIST , although equipped with directly usable behaviors such as count, is open to many variations, to be provided by proper descendants.

Some O-O languages support only the two extremes: fully effective classes, and fully deferred "interfaces", but not classes with a mix of effective and deferred features. This is an unacceptable limitation, negating the object-oriented method's support for a seamless, continuous spectrum from the most abstract to the most concrete.

A class B inheriting from a deferred class A may provide implementations -- effective declarations -- for the features inherited in deferred form. In this case there is no need for a redefine subclause; the effective versions simply replace the inherited versions. The class is said to effect the corresponding features. If after this process there remain any deferred features, B is still considered deferred, even if it introduces no deferred features of its own, and must be declared as deferred class .

In the example, classes such as LINKED_LIST and ARRAYED_LIST will effect all the deferred features they inherit from LIST -- extend , start etc. -- and hence will be effective.

Except in some applications restricted to pure system modeling -- as discussed next -- the main benefit of deferred classes and features comes from polymorphism and dynamic binding. Because extend has no implementation in class LIST , a call of the form my_list . extend ( … ) with my_list of type LIST [T] for some T can only be executed if my_list is attached to a direct instance of an effective proper descendant of LIST , such as LINKED_LIST ; then it will use the corresponding version of extend . Static binding would not even make sense here.

Even an effective feature of LIST such as count may depend on deferred features (start and so on), so that a call of the form my_list . count can only be executed in the context of an effective descendant.

All this indicates that a deferred class must have no direct instance . (It will have instances, the direct instances of its effective descendants.) If it had any, we could call deferred features on them, leading to execution-time impossibility. The rule that achieves this goal is simple: if the base type of x is a deferred class, no creation instruction of target x , of the form create x …, is permitted.

Applications of deferred classes

Deferred classes cover abstract notions with many possible variants. They are widely used in Eiffel where they cover various needs:

    + Capturing high-level classes, with common behaviors.

    + Defining the higher levels of a general taxonomy, especially in the inheritance structure of a library.

    + Defining the components of an architecture during system design, without commitment to a final implementation.

    + Describing domain-specific concepts in analysis and modeling.

These applications make deferred classes a central tool of the Eiffel method's support for seamlessness and reversibility. The last one in particular uses deferred classes and features to model objects from an application domain, without any commitment to implementation, design, or even software (and computers). Deferred classes are the ideal tool here: they express the properties of the domain's abstractions, without any temptation of implementation bias, yet with the precision afforded by type declarations, inheritance structures (to record classifications of the domain concepts), and contracts to express the abstract properties of the objects being described.

Rather than using a separate method and notation for analysis and design, this apprroach integrates seamlessly with the subsequent phases (assuming the decision is indeed taken to develop a software system): it suffices to refine the deferred classes progressively by introducing effective elements, either by modifying the classes themselves, or by introducing design- and implementation-oriented descendants. In the resulting system, the classes that played an important role for analysis, and are the most meaningful for customers, will remain important; as we have seen ( "Seamlessness and reversibility", page 9 ) this direct mapping property is a great help for extendibility.

The following sketch (from the book Object-Oriented Software Construction ) illustrates these ideas on the example of scheduling the programs of a TV station. This is pure modeling of an application domain; no computers or software are involved yet. The class describes the notion of program segment.

Note the use of assertions to define semantic properties of the class, its instances and its features. Although often presented as high-level, most object-oriented analysis methods (with the exception of Waldén's and Nerson's Business Object Notation) have no support for the expression of such properties, limiting themselves instead to the description of broad structural relationships.

    indexing

    description: "Individual fragments of a broadcasting schedule"

    deferred class

    SEGMENT

    feature -- Access

    schedule: SCHEDULE is deferred end
     -- Schedule to which segment belongs

    index: INTEGER is deferred end
     -- Position of segment in its schedule

    starting_time, ending_time: INTEGER is deferred end
     -- Beginning and end of scheduled air time

    next: SEGMENT is deferred end
     -- Segment to be played next, if any

    sponsor: COMPANY is deferred end
     -- Segment's principal sponsor

    rating: INTEGER is deferred end
     -- Segment's rating (for children's viewing etc.)

    Minimum_duration: INTEGER is 30
     -- Minimum length of segments, in seconds

    Maximum_interval: INTEGER is 2
     -- Maximum time (seconds) between successive segments

    feature -- Element change

    set_sponsor (s: SPONSOR) is

    require

    not_void: s /= Void

    deferred

    ensure

    sponsor_set: sponsor = s

    end

    … change_next, set_rating omitted …

    invariant

    in_list: (1 <= index) and (index <= schedule . segments . count)

    in_schedule: schedule . segments . item (index) = Current

    next_in_list: (next /= Void) implies
     ( schedule . segments . item (index + 1) = next)

    no_next_iff_last: (next = Void) =
    (index = schedule . segments . count)

    non_negative_rating: rating >= 0

    positive times: (starting_time > 0) and (ending_time > 0)

    sufficient_duration: ending_time - starting_time >=
    Minimum_duration

    decent_interval: (next . starting_time) - ending_time <=
    Maximum_interval

    end

Structural property classes

Some deferred classes describe a structural property, useful to the description of many other classes. Typical examples are classes of the Kernel Library in EiffelBase:

    + NUMERIC describes objects on which arithmetic operations +, -, ∗, / are available, with the properties of a ring (associativity, distributivity, zero elements etc.). Kernel Library classes such as INTEGER and REAL -- but not, for example, STRING -- are descendants of NUMERIC . An application that defines a class MATRIX may also make it a descendant of NUMERIC .

    + COMPARABLE describes objects on which comparison operations <, <=, >, >= are available, with the properties of a total preorder (transitivity, irreflexivity). Kernel Library classes such as CHARACTER , STRING and INTEGER -- but not out MATRIX example -- are descendants of NUMERIC .

For such classes it is again essential to permit effective features in a deferred class, and to include assertions. For example class COMPARABLE declares infix "<" as deferred, and expresses > , >= and <= effectively in terms of it.

The type like Current will be explained in "Covariance and anchored declarations", page 79 ; you may understand it, in the following class, as equivalent to COMPARABLE .

    indexing

    description: "Objects that can be compared according to a total preorder relation"

    deferred class

    COMPARABLE

    feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
     -- Is current object less than other ?

    require

    other_exists: other /= Void

    deferred

    ensure

    asymmetric: Result implies not (other < Current)

    end

    infix "<=" (other: like Current): BOOLEAN is
     -- Is current object less than or equal to other ?

    require

    other_exists: other /= Void

    do

    Result := (Current < other) or is_equal (other)

    ensure

    definition: Result = (Current < other) or
     is_equal (other)

    end

    … Other features: infix ">", min, max, …

    invariant

    irreflexive: not (Current < Current)

    end -- class COMPARABLE

Multiple inheritance and renaming

It is often necessary to define a new class in terms of several existing ones. For example:

    + The Kernel Library classes INTEGER and REAL must inherit from both NUMERIC and COMPARABLE .

    + A class TENNIS_PLAYER , in a system for keeping track of player ranking, will inherit from COMPARABLE , as well as from other domain-specific classes.

    + A class COMPANY_PLANE may inherit from both PLANE and ASSET .

    + Class ARRAYED_LIST , describing an implementation of lists through arrays, may inherit from both LIST and ARRAY .

In all such cases multiple inheritance provides the answer.

Multiple inheritance can cause name clashes : two parents may include a feature with the same name. This would conflict with the ban on name overloading within a class -- the rule that no two features of a class may have the same name. Eiffel provides a simple way to remove the name clash at the point of inheritance through the rename subclause, as in

    indexing

    description: "Sequential finite lists implemented as arrays"

    class

    ARRAYED_LIST [ G ]

    inherit

    LIST [ G ]

    ARRAY [ G ]

    rename

    count as capacity, item as array_item

    end

    feature

    …

    end -- clas s ARRAYED_LIST

Here both LIST and ARRAY have features called count and item . To make the new class valid, we give new names to the features inherited from ARRAY , which will be known within ARRAYED_LIST as capacity and array_item . Of course we could have renamed the LIST versions instead, or renamed along both inheritance branches.

Every feature of a class has a final name : for a feature introduced in the class itself ("immediate" feature) it is the name appearing in the declaration; for an inherited feature that is not renamed, it is the feature's name in the parent; for a renamed feature, it is the name resulting from the renaming. This definition yields a precise statement of the rule against in-class overloading:

    Final Name rule

    Two different features of a class may not have the same final name.

It is interesting to compare renaming and redefinition. The principal distinction is between features and feature names. Renaming keeps a feature, but changes its name. Redefinition keeps the name, but changes the feature. In some cases, it is of course appropriate to do both.

Renaming is interesting even in the absence of name clashes. A class may inherit from a parent a feature which it finds useful for its purposes, but whose name, appropriate for the context of the parent, is not consistent with the context of the heir. This is the case with ARRAY 's feature count in the last example: the feature that defines the number of items in an array -- the total number of available entries -- becomes, for an arrayed list, the maximum number of list items; the truly interesting indication of the number of items is the count of how many items have been inserted in the list, as given by feature count from LIST . But even if we did not have a name clash because of the two inherited count features we should rename ARRAY 's count as capacity to maintain the consistency of the local feature terminology.

The rename subclause appears before all the other feature adaptation subclauses -- redefine already seen, and the remaining ones export , undefine and select -- since an inherited feature that has been renamed sheds its earlier identity once and for all: within the class, and to its own clients and descendants, it will be known solely through the new name. The original name has simply disappeared from the name space. This is essential to the view of classes presented earlier: self-contained, consistent abstractions prepared carefully for the greatest enjoyment of clients and descendants.

Inheritance and contracts

A proper understanding of inheritance requires looking at the mechanism in the framework of Design by Contract, where it will appear as a form of subcontracting .

The first rule is that invariants accumulate down an inheritance structure:

    Invariant Accumulation rule

    The invariants of all the parents of a class apply to the class itself.

The invariant of a class is automatically considered to include -- in the sense of logical "and" -- the invariants of all its parents. This is a consequence of the view of inheritance as an "is" relation: if we may consider every instance of B as an instance of A , then every consistency constraint on instances of A must also apply to instances of B .

Next we consider routine preconditions and postconditions. The rule here will follow from an examination of what contracts mean in the presence of polymorphism and dynamic binding.

Consider a parent A and a proper descendant B (a direct heir on the following figure), which redefines a routine r inherited from A .

As a result of dynamic binding, a call a1 . r from a client C may be serviced not by A 's version of r but by B 's version if a1 , although declared of type A , becomes at run time attached to an instance of B . This shows the combination of inheritance, redefinition, polymorphism and dynamic binding as providing a form of subcontracting; A subcontracts certain calls to B .

The problem is to keep subcontractors honest. Assuming preconditions and postconditions as shown on the last figure, a call in C of the form

    if a1 . pre then a1 . r end

or just a1 . q ; a1 . r where the postcondition of q implies the precondition pre of r , satisfies the terms of the contract and hence is entitled to being handled correctly -- to terminate in a state satisfying a1 . post . But if we let the subcontractor B redefine the assertions to arbitrary pre ' and post' , this is not necessarily the case: pre' could be stronger than pre , enabling B not to process correctly certain calls that are correct from A 's perspective; and post' could be weaker than post , enabling B to do less of a job than advertized for r in the Contract Form of A , the only official reference for authors of client classes such as C . (An assertion p is stronger than or equal to an assertion q if p implies q in the sense of boolean implication.)

The rule, then, is that for the redefinition to be correct the new precondition pre' must be weaker than or equal to the original pre , and the new postcondition post' must be stronger than or equal to the original post' .

Because it is impossible to check simply that an assertion is weaker or stronger than another, the language rule relies on different forms of the assertion constructs, require else and ensure then , for redeclared routines. They rely on the mathematical property that, for any assertions p and q , p implies ( p or q ) , and ( p and q ) implies p . For a precondition, using require else with a new assertion will perform an or , which can only weaken the original; for a postcondition, ensure then will perform an and , which can only strengthen the original. Hence the rule:

    Assertion Redeclaration rule

    In the redeclared version of a routine, it is not permitted to use a require or ensure clause. Instead you may:

      + Introduce a new condition with require else , for or-ing with the original precondition.

      + Introduce a new condition with ensure then , for and-ing with the original postcondition.

    In the absence of such a clause, the original assertions are retained.

The last case -- retaining the original -- is frequent but by no means universal.

The Assertion Redeclaration rule applies to redeclarations . This terms covers not just redefinition but also effecting (the implementation, by a class, of a feature that it inherits deferred). The rules -- not just for assertions but also, as reviewed below, for typing -- are indeed the same in both cases. Without the Assertion Redeclaration rule, assertions on deferred features, such as those on extend , count and forth in "Deferred features and classes", page 57 , would be almost useless -- wishful thinking; the rule makes them binding on all effectings in descendants.

From the Assertion Redeclaration rule follows an interesting technique: abstract preconditions . What needs to be weakened for a precondition (or strengthened for a postcondition) is not the assertion's concrete semantics but its abstract specification as seen by the client. A descendant can change the implementation of that specification as it pleases, even to the effect of strengthening the concrete precondition, as long as the abstract form is kept or weakened. The precondition of procedure extend in the deferred class LIST provided an example. We wrote the routine (page 58 ) as

    extend (x: G) is

    -- Add x at end of list.

    require

    space_available: not full

    deferred

    ensure

    one_more: count = old count + 1

    end

The precondition expresses that it is only possible to add an item to a list if the representation is not full. We may well consider -- in line with the Eiffel principle that whenever possible structures should be of unbounded capacity -- that LIST should by default make full always return false:

    full: BOOLEAN is

    -- Is representation full?

    -- (Default: no)

    do

    Result := False

    end

Now a class BOUNDED_LIST that implements bounded-size lists (inheriting, like the earlier ARRAYED_LIST , from both LIST and ARRAY ) may redefine full :

    full: BOOLEAN is

    -- Is representation full?

    -- (Answer: if and only if number of items is capacity )

    do

    Result := ( count = capacity )

    end

Procedure extend remains applicable as before; any client that used it properly with LIST can rely polymorphically on the FIXED_LIST implementation. The abstract precondition of extend has not changed, even though the concrete implementation of that precondition has in fact been strengthened.

Note that a class such as BOUNDED_LIST , the likes of which indeed appear in EiffelBase, is not a violation of the Eiffel advice to stay away from fixed-size structures. The corresponding structures are bounded, but the bounds are changeable. Although extend requires not full , another feature, called force in all applicable classes, will add an element at the appropriate position by resizing and reallocating the structure if necessary. Even arrays in Eiffel are not fixed-size, and have a procedure force with no precondition, accepting any index position.

The Assertion Redeclaration rule, together with the Invariant Accumulation rule, provides the right methodological perspective for understanding inheritance and the associated mechanisms. Defining a class as inheriting from another is a strong commitment; it means inheriting not only the features but the logical constraints. Redeclaring a routine is bound by a similar committment: to provide a new implementation (or, for an effecting, a first implementation) of a previously defined semantics, as expressed by the original contract. Usually you have a wide margin for choosing your implementation, since the contract only defines a range of possible behaviors (rather than just one behavior), but you must remain within that range. Otherwise you would be perverting the goals of redeclaration, using this mechanism as a sort of late-stage hacking to override bugs in ancestor classes.

Join and uneffecting

It is not an error to inherit two deferred features from different parents under the same name, provided they have the same signature (number and types of arguments and result). In that case a process of feature join takes place: the features are merged into just one -- with their preconditions and postconditions, if any, respectively or-ed and and-ed.

More generally, it is permitted to have any number of deferred features and at most one effective feature that share the same name: the effective version, if present will effect all the others.

All this is not a violation of the Final Name rule (page 65 ), since the name clashes prohibited by the rule involve two different features having the same final name; here the result is just one feature, resulting from the join of all the inherited versions.

Sometimes we may want to join effective features inherited from different parents, assuming again the features have compatible signatures. One way is to redefine them all into a new version; then they again become one feature, with no name clash in the sense of the Final Name rule. But in other cases we may simply want one of the inherited implementations to take over the others. The solution is to revert to the preceding case by uneffecting the other features; uneffecting an inherited effective feature makes it deferred (this is the reverse of effecting, which turns an inherited deferred feature into an effective one). The syntax uses the undefine subclause:

    class D inherit

    A

    rename

    g as f -- g was effective in A

    undefine

    f

    end

    B

    undefine f end -- f was effective in B

    C

    -- C also has an effective feature f , which will serve as

    -- implementation for the result of the join.

    feature

    …

Again what counts, to determine if there is an invalid name clash, is the final name of the features. In this example to of the joined features were originally called f ; the one from A was called g , but in D it is renamed as f , so without the undefinition it would cause an invalid name clash.

Feature joining is the most common application of uneffecting. In some non-joining cases, however, it may be useful to forget the original implementation of a feature and let it start a new life devoid of any burden from the past.

Changing the export status

Another Feature Adaptation subclause, export , makes it possible to change the export status of an inherited feature. By default -- covering the behavior desired in the vast majority of practical cases -- an inherited feature keeps its original export status (exported, secret, selectively exported). In some cases, however, this is not appropriate:

    + A feature may have played a purely implementation-oriented role in the parent, but become interesting to clients of the heir. Its status will change from secret to exported.

    + In implementation inheritance (for example ARRAYED_LIST inheriting from ARRAY ) an exported feature of the parent may not be suitable for direct use by clients of the heir. The change of status in this case is from exported to secret.

You can achieve either of these goals by writing

    class D inherit

    A

    export {X, Y, …} feature1, feature2, … end

    …

This gives a new export status to the features listed (under their final names since, as noted, export like all other subclauses comes after rename if present): they become exported to the classes listed. In most cases this list of classes, X , Y , …, consists of just ANY , to re-export a previously secret feature, or NONE , to hide a previously exported feature. It is also possible, in lieu of the feature list, to use the keyword all to apply the new status to all features inherited from the listed parent. Then there can be more than one class-feature list, as in

    class ARRAYED_LIST [ G ] inherit

    ARRAY [ G ]

    rename

    count as capacity, item as array_item, put as array_put

    export

    {NONE} all

    {ANY} capacity

    end

    …

where any explicit listing of a feature, such as capacity , takes precedence over the export status specified for all . Here most features of ARRAY are secret in ARRAYED_LIST , because the clients should not permitted to manipulate array entries directly: they will manipulate them indirectly through list features such as extend and item , whose implementation relies on array_item and array_put . But ARRAY 's feature count remains useful, under the name capacity , to the clients of ARRAYED_LIST .

Flat and Flat-Contract Forms

Thanks to inheritance, a concise class text may achieve a lot, relying on all the features inherited from direct and indirect ancestors.

This is part of the power of the object-oriented form of reuse, but can create a comprehension and documentation problem when the inheritance structures become deep: how does one understand such a class, either as client author or as maintainer? For clients, the Contract Form, entirely deduced from the class text, does not tell the full story about available features; and maintainers must look to proper ancestors for much of the relevant information.

These observations suggest ways to produce, from a class text, a version that is equivalent feature-wise and assertion-wise, but has no inheritance dependency. This is called the Flat Form of the class. It is a class text that has no inheritance clause and includes all the features of the class, immediate (declared in the class itself) as well as inherited. For the inherited features, the flat form must of course take account of all the feature adaptation mechanisms: renaming (each feature must appear under its final name), redefinition, effecting, uneffecting and export status change. For redeclared features, require else clauses are or-ed with the precursors' preconditions, and ensure then clauses are and-ed with precursors' postconditions. For invariants, all the ancestors' clauses are concatenated. As a result, the flat form yields a view of the class, its features and its assertions that conforms exactly to the view offered to clients and (except for polymorphic uses) heirs.

As with the Contract Form ( "The contract form of a class", page 44 ), producing the Flat Form is the responsibility of tools in the development environment. In EiffelStudio, you will just click the "Flat" icon.

The Contract Form of the Flat Form of a class is known as its F lat-Contract Form . It gives the complete interface specification, documenting all exported features and assertions -- immediate or inherited -- and hiding implementation aspects. It is the appropriate documentation for a class.

Repeated inheritance and selection

An inheritance mechanism, following from multiple inheritance, remains to be seen. Through multiple inheritance, a class can be a proper descendant of another through more than one path. This is called repeated inheritance and can be indirect, as in the following figure, or even direct, when a class D lists a class A twice in its inherit clause.

The figure's particular example is in fact often used by introductory presentations of multiple inheritance, which is a pedagogical mistake: simple multiple inheritance examples (such as INTEGER inheriting from NUMERIC and COMPARABLE , or COMPANY_PLANE from ASSET and PLANE ) should involve the combination of separate abstractions . Repeated inheritance is an advanced technique; although invaluable, it does not arise in elementary uses and requires a little more care.

In fact there is only one non-trivial issue in repeated inheritance: what does a feature of the repeated ancestor, such as change_address and computer_account , mean for the repeated descendant, here TEACHING_ASSISTANT ? (The example features chosen involve a routine and an attribute; the basic rules will be the same.)

There are two possibilities: sharing (the repeatedly inherited feature yields just one feature in the repeated descendant) and duplication (it yields two). Examination of various cases shows quickly that a fixed policy, or one that would apply to all the features of a class, would be inappropriate.

    + Feature change_address calls for sharing: as a teaching assistant, you may be both teacher and student, but you are just one person, with just one official domicile.

    + If there are separate accounts for students' course work and for faculty, you may need one of each kind, suggesting that computer_account calls for duplication.

The Eiffel rule enables, once again, the software developer to craft the resulting class so as to tune it to the exact requirements. Not surprisingly, it is based on names, in accordance with the Final Name rule (no in-class overloading):

    Repeated Inheritance rule

      + A feature inherited multiply under one name will be shared: it is considered to be just one feature in the repeated descendant.

      + A feature inherited multiply under different names will be replicated, yielding as many variants as names.

So to tune the repeated descendant, feature by feature, for sharing and replication it suffices to use renaming.

    + Doing nothing will cause sharing, which is indeedthe desired policy in most cases (especially those cases of unintended repeated inheritance: making D inherit from A even though it also inherits from B , which you forgot is already a descendant of A ).

    + If you use renaming somewhere along the way, so that the final names are different, you will obtain two separate features. It does not matter where the renaming occurs; all that counts is whether in the common descendant, TEACHING_ASSISTANT in the last figure, the names are the same or different. So you can use renaming at that last stage to cause replication; but if the features have been renamed higher you can also use last-minute renaming to avoid replication, by bringing them back to a single name.

The Repeated Inheritance rule gives the desired flexibility to disambiguate the meaning of repeatedly inherited features. There remains a problem in case of redeclaration and polymorphism. Assume that somewhere along the inheritance paths one or both of two replicated versions of a feature f , such as computer_account in the example, has been redeclared; we need to define the effect of a call a . f ( a . computer_account in the example) if a is of the repeated ancestor type, here UNIVERSITY_PERSON , and has become attached as a result of polymorphism to an instance of the repeated descendant, here TEACHING_ASSISTANT . If one or more of the intermediate ancestors has redefined its version of the feature, the dynamically-bound call has two or more versions to choose from.

A select clause will resolve the ambiguity, as in

    class TEACHING_ASSISTANT inherit

    TEACHER

    rename

    computer_account as faculty_account

    select

    faculty_account

    end

    STUDENT

    rename

    computer_account as student_account

    end

    …

We assume here that that no other renaming has occurred -- TEACHING_ASSISTANT takes care of the renaming to ensure replication -- but that one of the two parents has redefined computer_account , for example TEACHER to express the special privileges of faculty accounts. In such a case the rule is that one (and exactly one) of the two parent clauses in TEACHING_ASSISTANT must select the corresponding version. Note that no problem arises for an entity declared as

    ta: TEACHING_ASSISTANT

since the valid calls are of the form ta . faculty_account and ta . student_account , neither of them ambiguous; the call ta . computer_account would be invalid, since after the renamings class TEACHING_ASSISTANT has no feature of that name. The select only applies to a call

    up . computer_account

with up of type UNIVERSITY_PERSON , dynamically attached to an instance of TEACHING_ASSISTANT ; then the select resolves the ambiguity by causing the call to use the version from TEACHER .

So if you traverse a list computer_users : LIST [ UNIVERSITY_PERSON ] to print some information about the computer account of each list element, the account used for a teaching assistant is the faculty account, not the student account.

You may, if desired, redefine faculty_account in class TEACHING_ASSISTANT , using student_account if necessary, to take into consideration the existence of another account. But in all cases we need a precise disambiguation of what computer_account means for a TEACHING_ASSISTANT object known only through a UNIVERSITY_PERSON entity.

The select is only needed in case of replication. If the Repeated Inheritance rule would imply sharing, as with change_address, and one or both of the shared versions has been redeclared, the Final Name rule makes the class invalid, since it now has two different features with the same name. (This is only a problem if both versions are effective; if one or both are deferred there is no conflict but a mere case of feature joining as explained in "Join and uneffecting", page 70 .) The two possible solutions follow from the previous discussions:

    + If you do want sharing, one of the two versions must take precedence over the other. It suffices to undefine the other, and everything gets back to order. Alternatively, you can redefine both into a new version, which takes precedence over both.

    + If you want to keep both versions, switch from sharing to replication: rename one or both of the features so that they will have different names; then you must select one of them.

Constrained genericity

Eiffel's inheritance mechanism has an important application to extending the flexibility of the genericity mechanism. In a class SOME_CONTAINER [ G ] , as noted (section 7 ), the only operations available on entities of type G , the formal generic parameter, are those applicable to entities of all types. A generic class may, however, need to assume more about the generic parameter, as with a class SORTABLE_ARRAY [ G … ] which will have a procedure sort that needs, at some stage, to perform tests of the form

    if item ( i ) < item ( j ) then …

where item ( i ) and item ( j ) are of type G . But this requires the availability of a feature infix "<" in all types that may serve as actual generic parameters corresponding to G . Using the type SORTABLE_ARRAY [ INTEGER ] should be permitted, because INTEGER has such a feature; but not SORTABLE_ARRAY [ COMPLEX ] if there is no total order relation on COMPLEX .

To cover such cases, declare the class as

    class SORTABLE_ARRAY [ G -> COMPARABLE ]

making it constrained generic . The symbol -> recalls the arrow of inheritance diagrams; what follows it is a type, known as the generic constraint. Such a declaration means that:

    + Within the class, you may apply the features of the generic constraint -- here the features of COMPARABLE : infix "<" , infix "<=" etc. -- to expressions of type G .

    + A generic derivation is only valid if the chosen actual generic parameter conforms to the constraint. Here you can use SORTABLE_ARRAY [ INTEGER ] since INTEGER inherits from COMPARABLE , but not SORTABLE_ARRAY [ COMPLEX ] if COMPLEX is not a descendant of COMPARABLE .

A class can have a mix of constrained and unconstrained generic parameters, as in the EiffelBase class HASH_TABLE [ G , H -> HASHABLE ] whose first parameter represents the types of objects stored in a hash table, the second representing the types of the keys used to store them, which must be HASHABLE . As these examples suggest, structural property classes such as COMPARABLE , NUMERIC and HASHABLE are the most common choice for generic constraints.

Unconstrained genericity, as in C [ G ] , is defined as equivalent to C [ G -> ANY ] .

Assignment attempt

The Type Conformance rule ( "Polymorphism", page 53 ) ensures type safety by requiring all assignments to be from a more specific source to a more general target.

Sometimes you can't be sure of the source object's type. This happens for example when the object comes from the outside -- a file, a database, a network. The persistence storage mechanism( "Deep operations and persistence", page 30 ) includes, along with the procedure store seen there, the reverse operation, a function retrieved which yields an object structure retrieved from a file or network, to which it was sent using store . But retrieved as declared in the corresponding class STORABLE of EiffelBase can only return the most general type, ANY ; it is not possible to know its exact type until execution time, since the corresponding objects are not under the control of the retrieving system, and might even have been corrupted by some external agent.

In such cases you cannot trust the declared type but must check it against the type of an actual run-time object. Eiffel introduces for this purpose the assignment attempt operation, written

    x ?= y

with the following effect (only applicable if x is a writable entity of reference type):

    + If y is attached, at the time of the instruction's execution to an object whose type conforms to the type of x , perform a normal reference assignment.

    + Otherwise (if y is void, or attached to a non-conforming object), make x void.

Using this mechanism, a typical object structure retrieval will be of the form

    x ?= retrieved

    if x = Void then

    "We did not get what we expected"

    else

    "Proceed with normal computation, which will typically involve
    calls of the form x . some_feature "

    end

As another application, assume we have a LIST [ ACCOUNT ] and class SAVINGS_ACCOUNT , a descendant of ACCOUNT , has a feature interest_rate which was not in ACCOUNT . We want to find the maximum interest rate for savings accounts in the list. Assignment attempt easily solves the problem:

    local

    s: SAVINGS_ACCOUNT

    do

    from account_list . start until account_list . after loop

    s ?= acc_list . item

    -- item from LIST yields the element at
    -- cursor position

    if s /= Void and then s . interest_rate > Result then

    -- Using and then (rather than and ) guarantees

    -- that s . interest_rate is not evaluated
    -- if s = Void is true.

    Result := s . interest_rate

    end

    account_list . forth

    end

    end

Note that if there is no savings account at all in the list the assignment attempt will always yield void, so that the result of the function will be 0, the default initialization.

Assignment attempt is useful in the cases cited -- access to external objects beyond the software's own control, and access to specific properties in a polymorphic data structure. The form of the instruction precisely serves these purposes; not being a general type comparison, but only a verification of a specific expected type, it does not carry the risk of encouraging developers to revert to multi-branch instruction structures, for which Eiffel provides the far preferable alternative of polymorphic, dynamically-bound feature calls.

Covariance and anchored declarations

The final property of Eiffel inheritance involves the rules for adapting not only the implementation of inherited features (through redeclaration of either kind, redeclaration and redefinition, as seen so far) and their contracts (through the Assertion Redeclaration rule), but also their types. More general than type is the notion of a feature's signature , defined by the number of its arguments, their types, the indication of whether it has a result (that is to say, is a function or attribute rather than a procedure) and, if so, the type of the result.

In many cases the signature of a redeclared feature remains the same as the original's. But in some cases you may want to adapt it to the new class. Assume for example that class ACCOUNT has features

    owner: HOLDER

    set_owner (h: HOLDER) is

    -- Make h the account owner.

    require

    not_void: h /= Void

    do

    owner := h

    end

We introduce an heir BUSINESS_ACCOUNT of ACCOUNT to represent special business accounts, corresponding to class BUSINESS inheriting from HOLDER:

Clearly, we must redefine owner in class BUSINESS_ACCOUNT to yield a result of type BUSINESS ; the same signature redefinition must be applied to the argument of set_owner . This case is typical of the general scheme of signature redefinition: in a descendant, you may need to redefine both results and arguments to types conforming to the originals. This is reflected by a language rule:

    Covariance rule

    In a feature redeclaration, both the result type if the feature is a query (attribute or function) and the type of any argument if it is a routine (procedure or function) must conform to the original type as declared in the precursor version.

The term "covariance" reflects the property that all types -- those of arguments and those of results -- vary together in the same direction as the inheritance structure.

If a feature such as set_owner has to be redefined for more than its signature -- to update its implementation or assertions -- the signature redefinition will be explicit. For example set_owner could do more for business owners than it does for ordinary owners. Then the redefinition will be of the form

    set_owner (b: BUSINESS) is

    -- Make b the account owner.

    … New routine body …

    end

In other cases, however, the body will be exactly the same as in the precursor. Then explicit redefinition would be tedious, implying much text duplication. The mechanism of anchored redeclaration solves this problem. The original declaration of set_owner in ACCOUNT should be of the form

    set_owner (h: like Current) is

    -- Make h the account owner.

    -- The rest as before:

    require

    not_void: h /= Void

    do

    owner := h

    end

A like anchor type, known as an anchored type, may appear in any context in which anchor has a well-defined type; anchor can be an attribute or function of the enclosing class, or an argument of the enclosing routine. Then, assuming T is the type of anchor , the type like anchor means the following:

    + In the class in which it appears, like anchor means the same as T . Ffor example, in set_owner above, the declaration of h has the same effect as if h had been declared of type HOLDER , the type of the anchor owner in class ACCOUNT .

    + The difference comes in proper descendants: if a type redefinition changes the type of anchor , any entity declared like anchor will be considered to have been redefined too.

This means that anchored declaration are a form of of implicit covariant redeclaration.

In the example, class BUSINESS_ACCOUNT only needs to redefine the type of owner (to BUSINESS ). It doesn't have to redefine set_owner except if it needs to change its implementation or assertions.

It is possible to use Current as anchor; the declaration like Current denotes a type based on the current class (with the same generic parameters if any). This is in fact a common case; we saw in "Structural property classes", page 62 , that it applies in class COMPARABLE to features such as

    infix "<" ( other : like Current ): BOOLEAN is …

since we only want to compare two comparable elements of compatible types -- but not, for example, integer and strings, even if both types conform to COMPARABLE . (A "balancing rule" makes it possible, however, to mix the various arithmetic types, consistently with mathematical traditions, in arithmetic expressions such as 3 + 45.82 or boolean expressions such as 3 < 45.82 .)

Similarly, class ANY declares procedure copy as

    copy ( other : like Current ) is …

with the argument anchored to the current object. Function clone , for its part, has signature clone ( other : ANY ): like other , with both argument and result anchored to the argument, so that for any x the type of clone ( x ) is the same as the type of x .

A final, more application-oriented example of anchoring to Current is the feature merge posited in an earlier example (page 33 ) with the signature merge ( other : ACCOUNT ). By using instead merge ( other : like Current ) we can ensure that in any descendant class -- BUSINESS_ACCOUNT , SAVINGS_ACCOUNT , MINOR_ACCOUNT … -- an account will only be mergeable with another of a compatible type.

Covariance makes static type checking more delicate; mechanisms of "system validity" and "catcalls" address the problem, discussed in detail in the book Object-Oriented Software Construction (see the bibliography).

.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


10 OTHER MECHANISMS

We now examine a few important mechanisms that complement the preceding picture: shared objects; constants; instructions; and lexical conventions.

Once routines and shared objects

The Eiffel's method obsession with extendibility, reusability and maintainability yields, as has been seen, modular and decentralized architectures, where inter-module coupling is limited to the strictly necessary, interfaces are clearly delimited, and all the temptations to introduce obscure dependencies, in particular global variables, have been removed. There is a need, however, to let various components of a system access common objects, without requiring their routines to pass these objects around as arguments (which would only be slightly better than global variables). For example various classes may need to perform output to a common "console window", represented by a shared object.

Eiffel addresses this need through an original mechanism that also takes care of another important issue, poorly addressed by many design and programming approaches: initialization. The idea is simple: if instead of do the implementation of an effective routine starts with the keyword once , it will only be executed the first time the routine is called during a system execution (or, in a multithreaded environment, the first time in each thread), regardless of what the caller was. Subsequent calls from the same caller or others will have no effect; if the routine is a function, it will always return the result computed by the first call -- object if an expanded type, reference otherwise.

In the case of procedures, this provides a convenient initialization mechanism. A delicate problem in the absence of a once mechanism is how to provide the users of a library with a set of routines which they can call in any order, but which all need, to function properly, the guarantee that some context had been properly set up. Asking the library clients to precede the first call with a call to an initialization procedure setup is not only user-unfriendly but silly: in a well-engineered system we will want to check proper set-up in every of the routines, and report an error if necessary; but then if we were able to detect improper set-up we might as well shut up and set up ourselves (by calling setup ). This is not easy, however, since the object on which we call setup must itself be properly initialized, so we are only pushing the problem further. Making setup a once procedure solves it: we can simply include a call

    setup

at the beginning of each affected routine; the first one to come in will perform the needed initializations; subsequent calls will have, as desired, no effect.

Once functions will give us shared objects. A common scheme is

    console: WINDOW is

    -- Shared console window

    once

    create Result . make (…)

    end

Whatever client first calls this function will create the appropriate window and return a reference to it. Subsequent calls, from anywhere in the system, will return that same reference. The simplest way to make this function available to a set of classes is to include it in a class SHARED_STRUCTURES which the classes needing a set of related shared objects will simply inherit.

For the classes using it, console , although a function, looks very much as if it were an attribute -- only one referring to a shared object.

The "Hello World" system at the beginning of this discussion (section 4 ) used an output instruction of the form io . put_string (" Some string " ) . This is another example of the general scheme illustrated by console . Feature io , declared in ANY and hence usable by all classes, is a once function that returns an object of type STANDARD_FILES (another Kernel Library class) providing access to basic input and output features, one of which is procedure put_string . Because basic input and output must all work on the same files, io should clearly be a once function, shared by all classes that need these mechanisms.

Constant and unique attributes

The attributes studied earlier were variable: each represents a field present in each instance of the class and changeable by its routines.

It is also possible to declare constant attributes, as in

    Solar_system_planet_count : INTEGER is 9

These will have the same value for every instance and hence do not need to occupy any space in objects at execution time. (In other approaches similar needs would be addressed by symbolic constants, as in Pascal or Ada, or macros, as in C.)

What comes after the is is a manifest constant: a self-denoting value of the appropriate type. Manifest constants are available for integers, reals (also used for doubles), booleans ( True and False ), characters (in single quotes, as ' A ' , with special characters expressed using a percent sign as in '% N ' for new line, '% B ' for backspace and '% U ' for null).

For integer constants, it is also possible to avoid specifying the values. A declaration of the form

    a , b , c , … n : INTEGER is unique

introduces a , b , c , … n as constant integer attributes, whose value are assigned by the Eiffel compiler rather than explicitly by the programmer. The values are different for all unique attributes in a system; they are all positive, and, in a single declaration such as the above, guaranteed to be consecutive (so that you may use an invariant property of the form code >= a and code <= n to express that code should be one of the values). This mechanism replaces the "enumerated types" found in many anguages, without suffering from the same problems. (Enumerated types have an ill-defined place in the type system; and it is not clear what operations are permitted.)

You may use Unique values in conjunction with the inspect multi-branch instruction studied in the next section. They are only appropriate for codes that can take on a fixed number of well-defined values -- not as a way to program operations with many variants, a need better addressed by the object-oriented technique studied earlier and relying on inheritance, polymorphism, redeclaration and dynamic binding.

Manifest constants are also available for strings, using double quotes as in

    User_friendly_error_message : STRING is " Go get a life !"

with special characters again using the % codes. It is also possible to declare manifest arrays using double angle brackets:

    << 1 , 2 , 3 , 5 , 7 , 11 , 13 , 17 , 19 >>

which is an expression of type ARRAY [ INTEGER ] . Manifest arrays and strings are not atomic, but denote instances of the Kernel Library classes STRING and ARRAY , as can be produced by once functions.

Instructions

Eiffel has a remarkably small set of instructions. The basic computational instructions have been seen: creation, assignment, assignment attempt, procedure call, retry . They are complemented by control structures: conditional, multi-branch, loop, as well as debug and check .

A conditional instruction has the form if … then … elseif … then … else … end . The elseif … then … part (of which there may be more than one) and the else … part are optional. After if and elseif comes a boolean expression; after then , elseif and else come zero or more instructions.

A multi-branch instruction has the form

    inspect

    exp

    when v 1 then

    inst 1

    when v 2 then

    inst 2

    …

    else

    inst 0

    end

where the else inst 0 part is optional, exp is a character or integer expression, v 1 , v 2 , … are constant values of the same type as exp , all different, and inst 0 , inst 1 , inst 2 , … are sequences of zero or more instructions. In the integer case, it is often convenient to use unique values ( "Constant and unique attributes", page 83 ) for the v i .

The effect of such a multi-branch instruction, if the value of exp is one of the v i , is to execute the corresponding inst i . If none of the v i matches, the instruction executes inst 0 , unless there is no else part, in which case it triggers an exception.

Raising an exception is the proper behavior, since the absence of an else indicates that the author asserts that one of the values will match. If you want an instruction that does nothing in this case, rather than cause an exception, use an else part with an empty inst 0 . In contrast, if c then inst end with no else part does nothing in the absence of an else part, since in this case there is no implied claim that c must hold.)

The loop construct has the form

    from

    initialization

    until

    exit

    invariant

    inv

    variant

    var

    loop

    body

    end

where the invariant inv and variant var parts are optional, the others required. initialization and body are sequences of zero or more instructions; exit and inv are boolean expressions (more precisely, inv is an assertion); var is an integer expression.

The effect is to execute initialization , then, zero or more times until exit is satisfied, to execute body . (If after initialization the value of exit is already true, body will not be executed at all.) Note that the syntax of loops always includes an initialization, as most loops require some preparation. If not, just leave initialization empty, while including the from since it is a required component.

The assertion inv , if present, expresses a loop invariant (not to be confused with class invariants). For the loop to be correct, initialization must ensure inv , and then every iteration of body executed when exit is false must preserve the invariant; so the effect of the loop is to yield a state in which both inv and exit are true. The loop must terminate after a finite number of iterations, of course; this can be guaranteed by using a loop variant var . It must be an integer expression whose value is non-negative after execution of initialization , and decreased by at least one, while remain non-negative, by any execution of body when exit is false; since a non-negative integer cannot be decreased forever, this ensures termination. The assertion monitoring mode, if turned on at the highest level, will check these properties of the invariant and variant after initialization and after each loop iteration, triggering an exception if the invariant does not hold or the variant is negative or does not decrease.

An occasionally useful instruction is debug ( Debug_key, … ) instructions end where instructions is a sequence of zero or more instructions and the part in parentheses is optional, containing if present one or more strings, called debug keys. The EiffelStudio compiler lets you specify the corresponding debug compilation option: yes , no , or an explicit debug key. The instructions will be executed if and only if the corresponding option is on. The obvious use is for instructions that should be part of the system but executed only in some circumstances, for example to provide extra debugging information.

The final instruction is connected with Design by Contract. The instruction check Assertions end , where Assertions is a sequence of zero or more assertions, will have no effect unless assertion monitoring is turned on at the Check level or higher. If so it will evaluate all the assertions listed, having no further effect if they are all satisfied; if any one of them does not hold, the instruction will trigger an exception.

This instruction serves to state properties that are expected to be satisfied at some stages of the computation -- other than the specific stages, such as routine entry and exit, already covered by the other assertion mechanisms such as preconditions, postconditions and invariants. A recommended use of check involves calling a routine with a precondition, where the call, for good reason, does not explicitly test for the precondition. Consider a routine of the form

    r (ref: SOME_REFERENCE_TYPE) is

    require

    not_void: r /= Void

    do

    r . some_feature

    …

    end

Because of the call to some_feature , the routine will only work if its precondition is satisfied on entry. To guarantee this precondition, the caller may protect it by the corresponding test, as in

    if x /= Void then a . r ( x ) end

but this is not the only possible scheme; for example if an create x appears shortly before the call we know x is not void and do not need the protection. It is a good idea in such cases to use a check instruction to document this property, if only to make sure that a reader of the code will realize that the omission of an explicit test (justified or not) was not a mistake. This is particularly appropriate if the justification for not testing the precondition is less obvious. For example x could have been obtained, somewhere else in the algorithm, as clone ( y ) for some y that you know is not void. You should document this knowledge by writing the call as

    check

    x_not_void: x /= Void end

    -- Because x was obtained as a clone of y ,
    -- and y is not void because [ etc. ]

    end

    a . r (x)

Note the recommended convention: extra indentation of the check part to separate it from the algorithm proper; and inclusion of a comment listing the rationale behind the developer's decision not to check explicitly for the precondition.

In production mode with assertion monitoring turned off, this instruction will have no effect. But it will be precious for a maintainer of the software who is trying to figure out what it does, and in the process to reconstruct the original developer's reasoning. (The maintainer might of course be the same person as the developer, six months later.) And if the rationale is wrong somewhere, turning assertion checking on will immediately uncover the bug.

Obsolete features and classes

One of the conditions for producing truly great reusable software is to recognize that although you should try to get everything right the first time around you won't always succeed. But if "good enough" may be good enough for application software, it's not good enough, in the long term, for reusable software. The aim is to get ever closer to the asymptote of perfection. If you find a better way, you must implement it. The activity of generalization , discussed as part of the lifecycle, doesn't stop at the first release of a reusable library.

This raises the issue of backward compability: how to move forward with a better design, without compromising existing applications that used the previous version?

The notion of obsolete class and feature helps address this issue. By declaring a feature as obsolete , using the syntax

    enter ( i : INTEGER ; x: G) is

    obsolete

    " Use ` put ( x, i )' instead "

    require

    …

    do

    put (x, i)

    end

you state that you are now advising against using it, and suggest a replacement through the message that follows the keyword obsolete , a mere string. The obsolete feature is still there, however; using it will cause no other harm than a warning message when someone compiles a system that includes a call to it. Indeed, you don't want to hold a gun to your client authors' forehead (" Upgrade now or die !'); but you do want to let them know that there is a new version and that they should upgrade at their leisure.

Besides routines, you may also mark classes as obsolete.

The example above is a historical one, involving an early change of interface for the EiffelBase library class ARRAY ; the change affected both the feature's name, with a new name ensuring better consistency with other classes, and the order of arguments, again for consistency. It shows the recommended style for using obsolete :

    + In the message following the keyword, explain the recommended replacement. This message will be part of the warning produced by the compiler for a system that includes the obsolete element.

    + In the body of the routine, it is usually appropriate, as here, to replace the original implementation by a call to the new version. This may imply a small performance overhead, but simplifies maintenance and avoids errors.

It is good discipline not to let obsolete elements linger around for too long. The next major new release, after a suitable grace period, should remove them.

The design flexibility afforded by the obsolete keyword is critical to ensure the harmonious long-term development of ambitious reusable software.

Creation variants

The basic forms of creation instruction, and the one most commonly used, are the two illustrated earlier ( "Creating and initializing objects", page 20 ):

    create x . make ( 2000 )

    create x

the first one if the corresponding class has a create clause, the second one if not. In either form you may include a type name in braces, as in

    create { SAVINGS_ACCOUNT } x . make ( 2000 )

which is valid only if the type listed, here SAVINGS_ACCOUNT , conforms to the type of x , assumed here to be ACCOUNT . This avoids introducing a local entity, as in

    local

    sx : SAVINGS_ACCOUNT

    do

    create xs . make ( 2000 )

    x := xs

    …

and has exactly the same effect. Another variant is the creation expression , which always lists the type, but returns a value instead of being an instruction. It is useful in the followingcontext:

    some_routine ( create { ACCOUNT } . make ( 2000 ))

which you may again view as an abbreviation for a more verbose form that would need a local entity, using a creation instruction:

    local

    x : ACCOUNT

    do

    create x . make ( 2000 )

    some_routine ( x )

    …

Unlike creation instructions, creation expressions must always list the type explicitly, { ACCOUNT } in the example. They are useful in the case shown: creating an object that only serves as an argument to be passed to a routine. If you need to retain access to the object through an entity, the instruction create x … is the appropriate construct.

The creation mechanism gets an extra degree of flexibility through the notion of default_create . The simplest form of creation instruction, create x without an explicit creation procedure, is actually an abbreviation for create x . default_create , where default_create is a procedure defined in class ANY to do nothing. By redefining default_create in one of your classes, you can ensure that create x will take care of non-default initialization (and ensure the invariant if needed). When a class has no create clause, it's considered to have one that lists only default_create . If you want to allow create x as well as the use of some explicit creation procedures, simply list default_create along with these procedures in the create clause. To disallow creation altogether, include an empty create clause, although this technique is seldom needed since most non-creatable classes are deferred, and one can't instantiate a deferred class.

One final twistis the mechanism for creating instances of formal generic parameters. For x of type G in a class C [ G ] , it wouldn't be safe to allow create x , since G stands for many possible types, all of which may have their own creation procedures. To allow such creation instructions, we rely on constrained genericity. You may declare a class as

    [G -> T create cp end ]

to make G constrained by T , as we learned before, and specify that any actual generic parameter must have cp among its creation procedures. Then it's permitted to use create x . cp , with arguments if required by cp , since it is guaranteed to be safe. The mechanism is very general since you may use ANY for T and default_create for cp . The only requirement on cp is that it must be a procedure of T , not necessarily a creation procedure; this permits using the mechanism even if T is deferred, a common occurrence. It's only descendants of T that must make cp a creation procedure, by listing it in the create clause, if they want to serve as actual generic parameters for C .

Tuple types

The study of genericity described arrays. Another common kind of container objects bears some resemblance to arrays: sequences, or "tuples", of elements of specified types. The difference is that all elements of an array were of the same type, or a conforming one, whereas for tuples you will specify the types we want for each relevant element. A typical tuple type is of the form

    TUPLE [ X, Y, Z ]

denoting a tuple of least three elements, such that the type of the first conforms to X , the second to Y , and the third to Z .

You may list any number of types in brackets, including none at all: TUPLE , with no types in brackets, denotes tuples of arbitrary length.

The syntax, with brackets, is intentionally reminiscent of generic classes, but TUPLE is a reserved word, not the name of a class; making it a class would not work since a generic class has a fixed number of generic parameters. You may indeed use TUPLE to obtain the effect of a generic class with a variable number of parameters.

To write the tuples themselves -- the sequences of elements, instances of a tuple type -- you will also use square brackets; for example

    [ x1 , y1 , z1 ]

with x1 of type X and so on is a tuple of type TUPLE [ X , Y , Z ] .

The definition of tuple types states that TUPLE [ X1 , … , Xn ] denotes sequences of at least n elements, of which the first n have types respectively conforming to X1 , … , Xn . Such a sequence may have more than n elements.

Features available on tuple types include count : INTEGER , yielding the number of elements in a tuple, item ( i: INTEGER ): ANY which returns the i -th element, and put which replaces an element.

Tuples are appropriate when these are the only operations you need, that is to say, you are using sequences with no further structure or properties. Tuples give you "anonymous classes" with predefined features count , item and put . A typical example is a general-purpose output procedure that takes an arbitrary sequence of values, of arbitrary types, and prints them. It may simply take an argument of type TUPLE , so that clients can call it under the form

    write ([ your_integer , your_real , your_account ])

As soon as you need a type with more specific features, you should define a class.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


11 AGENTS

Our last mechanism, agents, adds one final level of expressive power to the framework describe so far. Agents apply object-oriented concepts to the modeling of operations .

Objects for operations

Operations are not objects; in fact, object technology starts from the decision to separate these two aspects, and to choose object types, rather than the operations, as the basis for modular organization of a system, attaching each operation to the resulting modules -- the classes.

In a number of applications, however, we may need objects that represent operations, so that we can include them in object structures that some other piece of the software will later traverse to uncover the operations and, usually, execute them. Such "operation wrapper" objects, called agents, are useful in a number of application areas such as:

    + GUI (Graphical User Interface) programming, where we may associate an agent with a certain event of the interface, such as a mouse click at a certain place on the screen, to prescribe that if the event occurs -- a user clicks there -- it must cause execution of the agent's associated operation.

    + Iteration on data structures, where we may define a general-purpose routine that can apply an arbitrary operation to all the elements of a structure such as a list; to specify a particular operation to iterate, we will pass to the iteration mechanism an agent representing that operation.

    + Numerical computation, where we may define a routine that computes the integral of any applicable function on any applicable interval; to represent that function and pass its representation to the integration routine, we will use an agent.

Operations in Eiffel are expressed as routines, and indeed every agent will have an associated routine. Remember, however, that the fundamental distinction between objects and operations remains: an agent is an object, and it is not a routine; it represents a routine. As further evidence that this is a proper data abstraction, note that the procedure call , available on all agents to call the associated routine, is only one of the features of agents. Other features may denote properties such as the class to which the routine belongs, its precondition and postcondition, the result of the last call for a function, the number of arguments.

Building an agent

In the simplest form, also one of the most common, you obtain an agent just by writing

    agent r

where r is the name of a routine of the enclosing class. This is an expression, which you may assign to a writable entity, or pass as argument to a routine. Here for example is how you will specify event handling in the style of the EiffelVision 2 GUI library:

    your_icon . click_actions . extend ( agent your_routine )

This adds to the end of my_icon . click_actions -- the list of agents associated with the "click" event for my_icon , denoting an icon in the application's user interface -- an agent representing your_routine . Then when a user clicks on the associated icon at execution, the EiffelVision 2 mechanisms will call the procedure call on every agent of the list, which for this agent will execute your_routine . This is a simple way to associate elements of your application, more precisely its "business model" (the processing that you have defined, directly connected to the application's business domain), with elements of its GUI.

Similarly although in a completely different area, you may request the integration of a function your_function over the interval 0 .. 1 through a call such as

    your_integrator . integral ( agent your_function , 0 , 1 )

In the third example area cited above, you may call an iterator of EiffelBase through

    your_list . do_all ( agent your_proc )

with your_list of a type such as LIST [ YOUR_TYPE ] . This will apply your_proc to every element of the list in turn.

The agent mechanism is type-checked like the rest of Eiffel; so the last example is valid if and only if your_proc is a procedure with one argument of type YOUR_TYPE .

Operations on agents

An agent agent r built from a procedure r is of type PROCEDURE [ T, ARGS ] where T represents the class to which r belongs and ARGS the type of its arguments. If r is a function of result type RES , the type is FUNCTION [ T, ARGS , RES ] . Classes PROCEDURE and FUNCTION are from the Kernel Library of EiffelBase, both inheriting from ROUTINE [ T, ARGS ] .

Among the features of ROUTINE and its descendants the most important are call , already noted, which calls the associated routine, and item , appearing only in FUNCTION and yielding the result of the associated function, which it obtains by calling call .

As an example of using these mechanisms, here is how the function integral could look like in our INTEGRATOR example class. The details of the integration algorithm (straightforward, and making no claims to numerical sophistication) do not matter, but you see, in the highlighted line, the place were we evaluate the mathematical function associated with f , by calling item on f :

    integral

    ( f: FUNCTION [ANY, TUPLE [REAL], REAL];

    low, high: REAL): REAL is

    -- Integral of f over the interval [ low , high ]

    require

    meaningful_interval: low <= high

    local

    x: REAL

    do

    from

    x := low

    invariant

    x >= low ; x <= high + step

    -- Result approximates the integral over

    -- the interval [ low , low . max ( x - step )]

    until x > high loop

    Result := Result + step ∗

    x := x + step

    end

    end

Function integral takes three arguments: the agent f representing the function to be integrated, and the two interval bounds. When we need to evaluate that function for the value x , in the line

    Result := Result + step ∗

we don't directly pass x to item ; instead, we pass a one-element tuple [ x ] , using the syntax for manifest tuples introduced in "Tuple types", page 90 . You will always use tuples for the argument to call and item , because these features must be applicable to any routine, and so cannot rely on a fixed number of arguments. Instead they take a single tuple intended to contain all the arguments. This property is reflected in the type of the second actual generic parameter to f , corresponding to ARGS (the formal generic parameter of FUNCTION ): here it's TUPLE [REAL] to require an argument such as [ x ] , where x is of type REAL .

Similarly, consider the agent that the call seen above:

    your_icon . click_actions . extend ( agent your_routine )

added to an EiffelVision list. When the EiffelVision mechanism detects a mouse click event, it will apply to each element item of the list of agents, your_icon . click_actions, an instruction such as

    item . call ([ x, y ])

where x and y are the coordinates of the mouse clicking position. If item denotes the list element agent your_routine, inserted by the above call to extend , the effect will be the same as that of calling

    your_routine ( x, y )

assuming that your_routine indeed takes arguments of the appropriate type, here INTEGER representing a coordinate in pixels. (Otherwise type checking would have rejected the call to extend .)

Open and closed arguments

In the examples so far, execution of the agent's associated routine, through item or call , passed exactly the arguments that a direct call to the routine would expect. You can have more flexibility. In particular, you may build an agent from a routine with more arguments than expected in the final call, and you may set the values of some arguments at the time you define the agent.

Assume for example that a cartographical application lets a user record the location of a city by clicking on the corresponding position on the map. The application may do this through a procedure

    record_city ( cn : STRING ; pop : INTEGER; x, y : INTEGER )

    -- Record that the city of name name is at coordinates

    -- x and y with population pop .

Then you can associate it with the GUI through a call such as

    map . click_actions . extend ( agent record_city ( name , population , ? , ? ))

assuming that the information on the name and the population has already been determined. What the agent denotes is the same as agent your_routine as given before, where your_routine would be a fictitious two-argument routine obtained from record_city -- a four-argument routine -- by setting the first two arguments once and for all to the values given, name and population .

In the agent agent record_city ( name , population , ? , ? ) , we say that these first two arguments, with their set values, are closed ; the last two are open . The question mark syntax introduced by this example may only appear in agent expressions; it denotes open arguments. This means, by the way, that you may view the basic form used in the preceding examples, agent your_routine, as an abbreviation -- assuming your_routine has two arguments -- for agent your_routine ( ? , ? ) . It is indeed permitted, to define an agent with all arguments open, to omit the argument list altogether; no ambiguity may result.

For type checking, agent record_city ( name , population , ? , ? ) and agent your_routine are acceptable in exactly the same situations, since both represent routines with two arguments. The type of both is

    PROCEDURE [ ANY, TUPLE [ INTEGER, INTEGER ]]

where the tuple type specifies the open operands.

A completely closed agent, such as agent your_routine ( 25 , 32 ) or agent record_city ( name , population , 25 , 32 ) , has the type TUPLE , with no parameters; you will call it with call ([ ]) , using an empty tuple as argument.

The freedom to start from a routine with an arbitrary number of arguments, and choose which ones you want to close and which ones to leave open, provides a good part of the attraction of the agent mechanism. It means in particular that in GUI applications you can limit to the strict minimum the "glue" code (sometimes called the controller in the so-called MVC, Model-View Controller, scheme of GUI design) between the user interface and "business model" parts of a system. A routine such as record_city is a typical example of an element of the business model, uninfluenced -- as it should be -- by considerations of user interface design. Yet by passing it in the form of an agent with partially open and partially closed arguments, you may be able to use it directly in the GUI, as shown above, without any "controller" code.

As another example of the mechanism's versatility, we saw above an integral function that could integrate a function of one variable over an interval, as in

    your_integrator . integral ( agent your_function (0 , 1) )

Now assume that function3 takes three arguments. To integrate function3 with two arguments fixed, you don't need a new integral function; just use the same integral as before, judiciously selecting what to close and what to leave open:

    your_integrator . integral ( agent function3 ( 3.5 , ? , 6.0 ), 0 , 1 )

Open targets

All the agent examples seen so far were based on routines of the enclosing class. This is not required. Feature calls, as you remember, were either unqualified, as in f ( x, y ) , or qualified, as in a . g ( x, y ) . Agents, too, have a qualified variant as in

    agent a . g

which is closed on its target a and open on the arguments. Variants such as agent a . g ( x, y ) , all closed, and agent a . g ( ? , y ) , open on one argument, are all valid.

You may also want to make the target open. The question mark syntax could not work here, since it wouldn't tell us the class to which feature g belongs, known in the preceding examples from the type of a . As in creation expressions, we must list the type explicitly; the convention is the same: write the types in braces, as in

    agent { SOME_TYPE } . g

    agent { SOME_TYPE } . g ( ? , ? )

    agent { SOME_TYPE } . g ( ? , y )

The first two of these examples are open on the target and both operands; they mean the same. The third is closed on one argument, open on the other and on the target.

These possibilities give even more flexibility to the mechanism because they mean that an operation that needs agents with certain arguments open doesn't care whether they come from an argument or an operand of the original routine. This is particularly useful for iterators and means that if you have two lists

    your_account_list : LIST [ ACCOUNT ]

    your_integer_list : LIST [ INTEGER ]

you may write both

    your_ acccount_list . do_all ( agent deposit_one_grand )

    your_ integer_list . do_all ( agent add_to_n )

even though the two procedures used in the agents have quite different forms. We are assuming here that the first one, in class ACCOUNT , is something like

    deposit_one_grand is

    -- Add one thousand dollars to balance of account.

    do balance := balance + 1000 end

so that it doesn't take an argument: it is normally called on its target, as in my_account . deposit_one_grand. In contrast, the other routine has an argument:

    add_to_n ( x: INTEGER ) is

    -- Add x to the value of total .

    do total := total + x end

where total is an integer attribute of the enclosing class. Without the versatility of playing with open and closed arguments for both the original arguments and target, you would have to write separate iteration mechanisms for these two cases. Here you can use a single iteration routine of LIST and similar classes of EiffelBase, do_all , for both purposes:

    + Depositing money on every account in a list of accounts.

    + Adding all the integers in a list of integers.

Agents provide a welcome complement to the other mechanisms of Eiffel. They do not conflict with them but, when appropriate -- as in the examples sketched in this section -- provide clear and expressive programming schemes, superior to the alternatives.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


12 LEXICAL CONVENTIONS AND STYLE RULES

Eiffel software texts are free-format: distribution into lines is not semantically significant, and any number of successive space and line-return characters is equivalent to just one space. The style rules suggest indenting software texts as illustrated by the examples in this chapter.

Successive declarations or instructions may be separated by semicolons. Eiffel's syntax has been so designed, however, that (except in rare cases) the semicolon is optional . Omitting semicolons for elements appearing on separate lines lightens text and is the recommended practice since semicolons, as used by most programming languages, just obscure the text by distracting attention from the actual contents. Do use semicolons if you occasionally include successive elements on a single line.

63 names -- all unabbreviated single English words, except for elseif which is made of two words -- are reserved, meaning that you cannot use them to declare new entities. Here is the list:

    agent | alias | all | and | as | assign | check
class | convert | create | Current | debug | deferred | do
else | elseif | end | ensure | expanded | export | external
False | feature | from | frozen | if | implies | indexing
infix | inherit | inspect | invariant | is | like | local
loop | not | obsolete | old | once | or | prefix
Precursor | pure | redefine | reference | rename | require | rescue
Result | retry | separate | then | True | TUPLE | undefine

Since this tutorial has covered all the essential mechanisms, you may ignore the keywords not encountered; they are reserved for future use.

Most of the reserved words are keywords, serving only as syntactic markers, and written in boldface in typeset texts such as the present one: class , feature , inherit . The others, such as Current , directly carry a semantic denotation; they start with an upper-case letter and are typeset in boldface.

These conventions about letter case are only style rules. Eiffel is case-insensitive, since it is foolish to assume that two identifiers denote two different things just on the basis of a letter written in lower or upper case. The obvious exception is manifest character constants (appearing in single quotes, such as ' A ' ) and manifest character strings (appearing in double quotes, such as " lower and UPPER " ).

The style rules, however, are precise, and any serious Eiffel project will enforce them; the tools of EiffelStudio also observe them in the texts they output (although they will not mess up with your source text unless you ask them to reformat it). Here are the conventions, illustrated by the examples of this tutorial:

    + Class names in upper case, as ACCOUNT .

    + Non-constant feature names and keywords in lower case, as balance and class .

    + Constant features and predefined entities and expressions with an initial upper case, as Avogadro and Result .

In typeset documents including Eiffel texts, the standard for font styles is also precise. You should use boldface for keywords and italics for all other Eiffel elements. Comments, however, are typeset in roman . This lets a software element, such as an identifier, stand out clearly in what is otherwise a comment text expressed in English or another human langage, as in the earlier example

    -- Add sum to account.

which makes clear that sum is a software element, not the English word.

There is also an Eiffel style to the choice of identifiers. For features, stay away from abbreviations and use full words. In multi-word identifiers, separate the constituents by underscores, as in LINKED_LIST and set_owner . The competing style of no separation but mid-identifier upper-case, as in linkedList or setOwner , is less readable and not in line with standard Eiffel practices.

Features of reusable classes should use consistent names. A set of standard names -- put for the basic command to add or replace an element, count for the query that returns the number of element in a structure, item to access an element -- is part of the style rules, and used systematically in EiffelBase. Use them in your classes too.

For local entities and formal arguments of routines, it is all right to use abbreviated names, since these identifiers only have a local scope, and choosing a loud name would give them too much pretense, leading to potential conflicts with features.

The complete set of style rules applied by ISE is available on the web in both HTML and PDF forms. These rules are an integral part of the Eiffel method; in quality software, there is no such thing as a detail. Applying them systematically promotes consistency between projects in the Eiffel world, enhances reusability, and facilitates everyone's work.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


13 TO LEARN MORE

Beyond this introduction, you will find the following two books essential to a mastery of the method and language:

    + Object-Oriented Software Construction , Bertrand Meyer, Prentice Hall, 2nd edition 1997. (Make sure to get the second edition.) About object technology in general; presents the method behind Eiffel.

    + Eiffel: The Language , Bertrand Meyer, Prentice Hall, 1992. Language manual and reference.

Numerous other books are available on Eiffel and Eiffel-related topics. See an extensive list at http://www.eiffel.com/doc/documentation.html , from which you can order most of the titles listed. They include university textbooks, general introductions, presentations of Eiffel projects, descriptions of libraries and other applications, books on BON and object-oriented methodology.

Previous sectionUp

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


MANUAL IDENTIFICATION AND COPYRIGHT

Title: An Eiffel Tutorial , ISE Technical Report TR-EI-66/TU.

Publication history

First published July 2001. Corresponds to release 5.0 of the ISE Eiffel environment.

Author

Bertrand Meyer.

Software credits

See acknowledgments in book Eiffel: The Language .

Cover design

Rich Ayling.

Copyright notice and proprietary information

Copyright © Interactive Software Engineering Inc. (ISE), 2001. May not be reproduced in any form (including electronic storage) without the written permission of ISE. "Eiffel Power" and the Eiffel Power logo are trademarks of ISE.

All uses of the product documented here are subject to the terms and conditions of the ISE Eiffel user license. Any other use or duplication is a violation of the applicable laws on copyright, trade secrets and intellectual property.

Special duplication permission for educational institutions

Degree-granting educational institutions using ISE Eiffel for teaching purposes as part of the Eiffel University Partnership Program may be permitted under certain conditions to copy specific parts of this book. Contact ISE for details.

    About ISE

    ISE (Interactive Software Engineering) helps you produce software better, faster and cheaper.

    ISE provides a wide range of products and services based on object technology, including ISE Eiffel, a complete development environment for the full system lifecycle. ISE's training courses, available worldwide, cover key management and technical topics. ISE's consultants are available to address your project needs at all levels.

    ISE's TOOLS (Technology of Object-Oriented Languages and Systems) conferences, http://www.tools-conferences.com , are the meeting point for anyone interested in the software technologies of the future.

    ISE originated one of the earliest .NET products and offers a full range of .NET services and training at http://www.dotnetexperts.com .

    For more information

    Interactive Software Engineering Inc.
    ISE Building, 360 Storke Road
    Goleta, CA 93117 USA
    Telephone 805-685-1006, Fax 805-685-6869

    Internet and e-mail

    ISE maintains a rich source of information at http://eiffel.com , with more than 1200 Web pages including online documentation, downloadable files, product descriptions, links to ISE partners, University Partnership program, mailing list archives, announcements, press coverage, Frequently Asked Questions, Support pages, and much more.

    Visit http://contact.eiffel.com to request information about products and services. To subscribe to the ISE Eiffel user list, go to www.talkitover.com/eiffel/users .

    Support programs

    ISE offers a variety of support options tailored to the diverse needs of its customers. See http://support.eiffel.com for details.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


Eiffel overview documents

The following two documents present a general overview of the arguments for Eiffel:

    + Why your next project should use Eiffel

    + For the truly hurried: Eiffel: the 1-minute summary

Other introductory documentation

See the list of introductory documents covering not only the language but also the environment and general presentations of Eiffel.


Eiffel: The One-Minute Summary

Eiffel Home Page (Web) Eiffel Home Page Eiffel Home Page

Eiffel: The One-Minute Summary

For the truly hurried here is a capsule overview of ISE Eiffel:

    A comprehensive approach to the construction of successful software.

    The goal: cheaper (spend less on development, debugging, maintenance); better (get the bugs before they get you;); faster (bring your products out before anyone else); and easier to maintain, reuse and extend.

    The only approach that covers analysis, design, implementation and maintenance in a single framework.

    Includes a language, a methodology, and a complete graphical development environment.

    Language: widely recognized as the best and simplest implementation of object-oriented concepts. Clean, simple, readable, powerful, easy to learn.

    Methodology: based on Design by Contract -- building reliable software by defining precise contracts between its various components, and making sure the software construction process enforces these contracts.

    Powerful graphical environment supporting lightning-fast compilation (Melting Ice Technology) and unique facilities for analysis (CASE), documentation, exploration ("browsing"), documentation, HTML, XML and UML generation

    Complete portability across major industry platforms: Windows 98/Me/XP/NT/2000, major Unix versions, Linux, even VMS. Portable graphics with native look-and-feel on each platform.

    One of the very first commercial environments to be available on the .NET framework, as a result of a partnership with Microsoft.

    Sophisticated mechanisms for contract monitoring, inheritance (single, multiple and repeated), exception handling, genericity.

    Generation of C code for portability and efficiency; speed of executables rivals native C.

    Rich set of libraries covering graphics, the Web, networking, fundamental algorithms and data structures, lexical analysis, parsing, etc.

    Proven track record of successful projects, including some of the largest successful O-O projects ever built anywhere: finance, telecommunications, CAD-CAM, CASE, education etc.

    The most effective solution available today for the professional software developer

For a more detailed overview see An Invitation to Eiffel.

Eiffel Home Page (Web)

Copyright Interactive Software Engineering, 2001


Why your next project should use Eiffel

Eiffel Home Page (Web) Eiffel Home Page Eiffel Home Page

Why your next project should use Eiffel

(After an article in the special Eiffel issue of the Journal of Object-Oriented Programming, May 1996.)

O ver its ten-year life Eiffel has evolved into one of the most usable software development environments available today. Other articles discuss its theoretical contributions. This one addresses a more mundane subject: how practical software projects can benefit, today, from the power of Eiffel. In so doing it will largely rely on published assessments from both Eiffel users and book authors. In fact a quotation from one of the best-known books in the object-oriented field -- Object-Oriented Modeling and Design by James Rumbaugh and his colleagues, the text that introduced the OMT O-O analysis method -- provides a good start:

Eiffel is arguably the best commercial object-oriented language available today.
[Jim Rumbaugh et al. in Object-Oriented Modeling and Design, Prentice Hall 1988].

What is Eiffel?

First we should define what the word "Eiffel" means. If you are thinking "a programming language" you are not wrong (and the preceding quotation shows that you are in good company). The programming language is indeed the most visible part, but it is only a reflection of something broader: a comprehensive approach to the production of quality software. As Richard Wiener wrote:

Eiffel is more than a language; it is a framework for thinking about, designing and implementing object-oriented software.
[Richard Wiener in Software Development using Eiffel: There is life other than C++, Prentice Hall, 1995.]

The Eiffel approach includes a method (a "methodology", as it is sometimes called) based on a number of pervasive ideas such as Design by ContractTM, seamlessness, reversibility, rigorous architectural rules, systematic use of single and multiple inheritance, static type checking and several others. Besides a method and a language Eiffel also means powerful graphical development environments, such as ISE Eiffel, available across a wide number of industry-standard platforms and supporting analysis and design as well as implementation, maintenance and evolution.

The language itself, indeed (which Wiener calls "an elegant and powerful language for object-oriented problem solving") is not just a programming language but extends to the phases of system construction that both precede and follow implementation. This is sometimes hard to accept if you have been raised in the view that software development must involve a sequence of separate steps; that one should initially use an analysis method and then at some point switch to a programming language, with perhaps a design method in-between. This view is detrimental to the software process and to the quality of the resulting product, as it does not support the inevitable back-and-forth hesitations that characterize real software development.

Wisdom sometimes blooms late in the season. However careful you may have been at the analysis stage, some great ideas will hit you - or your implementers - past the point at which you thought you had all the specifications right. Why renounce the benefit of such belated but valuable ideas? Eiffel and the associated Business Object Notation approach to analysis and design accommodate them naturally, by providing a single conceptual framework from the beginning to the end of the process.

Here Eiffel does not have much competition. The most bright-eyed Smalltalk or C++ enthusiast would not seriously claim that one can do design, let alone analysis, in his language of choice. And users of any of the popular O-O analysis notations know that at some stage they must stop working on their model and move on to the implementation in some programming language. Eiffel is unique in helping you for all of these tasks, without ever introducing the impedance mismatches that characterize other approaches.

As a reviewer wrote:

As a design language, Eiffel continues to be a better model for object- oriented programming than Ada. It is even better than the new Ada 9X standard.
[Richard Riehle in HP Professional, October 1994, A Tour of Eiffel.]

The commercial and political context

The next few sections give a glimpse of the technical contributions of Eiffel, or more precisely of what other people have written about them. But of course the best technology in the world requires infrastructure and support to succeed.

Eiffel has plenty of these. It has been around for more than a decade. Eiffel is available from several commercial and open-source providers. The number of licenses sold is in the tens of thousands. Reusable library classes are in the thousands.

The platforms covered range from Unix (all of Unix, the famous and the arcane) and Linux to VMS, OS/2, Windows 3.1, Windows NT, Windows 95/98.

Particularly impressive is the growth of Eiffel usage in education. Eiffel is quickly becoming the language of choice for teaching modern software technology, including, increasingly, introductory programming. A dozen of excellent textbooks are now available from Prentice Hall, Addison-Wesley, Macmillan and others, with about as many announced just for the coming months.

It is not just the professors who like the approach. Here is just one typical comment on student reaction, from an institution (Rochester Institute of Technology) having adopted Eiffel as its first-year introductory language on a massive scale:

We were pleased to discover many of our more skeptical students turning around and admitting that Eiffel was a "fun" language in which to work.
[Jim Heliotis in the Proceedings of OOPSLA 95, Experiences teaching objects: A new curriculum for computer science students.]

A ComputerWorld article confirmed the need for Eiffel in training the high-powered software professionals of tomorrow. Quoting Amy Cody-Quinn from Management Recruiters International, the journalist writes

There is a big problem with people who say they know C++ - but they don't really know how to do objects. If they have Eiffel on their résumé, then we know they really have the proper understanding of what they are doing.
[Leslie Goff in ComputerWorld, Object Edge, December 18, 1995.]

But it would be a mistake to think of Eiffel as an academic tool. A little-known fact is that some of the biggest object-oriented projects ever undertaken (at least the successful ones - other O-O languages have had their share of large-scale failures) are being done in Eiffel. The hot areas at the moment are banking and the financial industry (in particular some very large derivative trading and investment management systems), telecommunications, health care. These are all areas in which all that counts in the end is quality and time to market, so that projects need to select the best technology available. Quoting from an article by Philippe Stephan, the system architect of such a project (Rainbow, a major derivative trading system built with ISE Eiffel):

We evaluated three major object-oriented languages for the project - Smalltalk, C++ and Eiffel - and chose Eiffel. [...] Rainbow currently comprises over 400,000 lines of code, for about 3000 classes. [Current figures are way over these mid-1995 counts.] The developers feel very productive. This was confirmed when Rainbow's financial backers brought in object professionals to audit the project. The auditors evaluated the project during July 1994 and were impressed with the productivity of the Rainbow development group.
[Philippe Stephan in Object Magazine, July-August 1995, Building financial software with object technology.]

The development group in question is remarkable for being made only for a third of software professionals. The others are professionals from other disciplines (such as trading and financial analysis), who, Stephan writes,

can express business concepts in Eiffel because they can focus on design and implementation, rather than struggling with memory management problems and debugging.

The result has received lavish praise from such publications as ComputerWorld and analysts:

Industry experts briefed on Rainbow said they were impressed with the results. CALFP is "progressive" in [...] committing the organization's mission-critical systems development efforts to this architecture, said Richard Crone, senior manager of financial services at KPMG Peat Marwick in Los Angeles. "What's unique here is that [CALFP is] delivering this system end-to-end using object-oriented technologies", said Henry Morris, a research analyst at International Data Corporation (IDC) in Framingham, Mass.
[Thomas Hoffmann in ComputerWorld, May 8, 1995, Object- Oriented financial package tames transactions.]

Along with these Eiffel mega-projects, you will also find myriad smaller endeavors. Many consultants, in particular, have found for themselves the key competitive advantage that they can gain from Eiffel's excellence. In ensuring this spread of Eiffel throughout the industry, the benefit of cheap yet complete environments such as ISE Eiffel for Linux has been immeasurable.

Also crucial to the development of Eiffel has been the neutral status of its definition, now controlled by a consortium of vendors and users, NICE (the Nonprofit International Consortium for Eiffel). NICE has already produced a library standard and expects to produce soon the language standard that should shortly thereafter enjoy a smooth ride through ANSI and other international standards bodies.

The pace of Eiffel history has been accelerating in the past few months. This has been picked up by many journalists. As Dan Wilder wrote:

With an open specification for both the language and the kernel libraries, and support from multiple vendors, Eiffel now stands poised to take off.
[Dan Wilder in Linux Journal, June 1995, Introduction to Eiffel.]

The criteria

Eiffel - the method, the language, the environment - is based on a small set of goals, addressing the crucial needs of software quality and productivity. Quoting from an article in Byte magazine:

Developers who want an object-oriented language that adheres to the keystone principles of software engineering need look no further than Eiffel.
[Peter Varhol in Byte Magazine, February 1996.]
or, as Steve Bilow wrote in a review of ISE's Melting Ice compiling technology (which he calls "an outstanding marriage between portability and development speed"):
Eiffel was designed precisely for the purpose of enabling software developers to deliver high quality, reliable, efficient, reusable code.
[Steve Bilow in The X Journal, The Eiffel alternative, July-August 1995.]

Reliability

The first goal is reliability. No other approach available today has made the effort to give developers all the tools that they need to produce bug-free software - software that will run without bugs the first time around. Crucial in this effort is the presence of static typing (real static typing, not "a little bit typed" as in those languages that still keep C-like type conversions); assertions and the whole mechanism of Design by Contract, on which more than one Eiffel developer has said "this has changed my life" by enabling him or her to specify precisely what the software should do, and to track at run time that it does it; disciplined exception handling; automatic garbage collection, which eliminates a source of horrendous bugs in C++-based environments (and a large part of the code, tedious and error-prone); a clean approach to inheritance; the use of dynamic binding as the default policy, meaning the guarantee that all calls will use the right version of each operation; and the simplicity of the language design, which enables Eiffel developers to know all of Eiffel and feel in control.

The role of assertions and Design by Contract is particularly important here. According to the Journal of Object-Oriented Programming:

The contribution of Eiffel is significant: it shows how invariants, preconditions, and postconditions can be incorporated into a practical developer's view of a class. Wider use of Eiffel [...] will encourage a greater use of simple but powerful mathematics during development.
[Richard Mitchell et al. in Journal of Object-Oriented Programming, July-August 1995, As-a: a relationship to support code reuse.]

Reusability

The second goal is reusability. This has become a catchword, but Eiffel is the only approach that has taken this requirement and its consequences all the way to the end. Quoting Roland Racko:

Everything about [Eiffel] is single-mindedly, unambiguously, gloriously focused on reusability - right down to the choice of reserved words and punctuation and right up to the compile time environment.
[Roland Racko in Software Development, December 1994, In praise of Eiffel.]

Eiffel benefits here from being a simple ("but not simplistic", writes Racko) and consistent design, not a transposition from older, unrelated technology. Beyond the language and the environment facilities (such as precompilation), the crucial help to reusability is of course the presence of thousands of high-quality library classes, such as, in ISE Eiffel: EiffelBase (a "Linnaean approach to the reconstruction of software fundamentals"), EiffelNet for client-server communication, EiffelStore for relational and O-O database manipulations, EiffelLex and EiffelParse for lexical analysis and parsing, EiffelMath for object-oriented numerical computation, EiffelVision for portable graphics, WEL (the Windows Eiffel Library) for Windows-specific graphics, EiffelWeb to process forms from the Web, and many others. Not even mentioning quality, the result is probably the biggest repository of object-oriented components available elsewhere. The care that has been applied to the production of these libraries also has considerable pedagogical benefits: the way people learn Eiffel is by learning the libraries - first to use them, then to adapt them if necessary, then to write their own software.

Part of the single-mindedness mentioned by Racko is the emphasis on abstraction. In contrast with, say, Smalltalk, you do not read the source code of a class when you want to use it. This may be fine for a couple dozen classes, but not for a large, powerful library. Eiffel introduces the notion of short form: an abstract version of the class, keeping only the interface information including assertions. This is an ideal tool for documenting classes but also for discussing designs and presenting them to outsiders - managers or customers - who need to know what is going on without getting bogged down in the details.

Let me mention just one of the unique reusability-supporting features of Eiffel, without which it is, in my experience, impossible to have a long-term reuse effort. Racko again:

The language's designer [...] recognized that no reusable library is ever perfect and, thus, that libraries are always in flux. So he built a kind of version-control system into the language. Specifically, there are language elements to demarcate obsolete code that is, however, still being supported. When these elements are referenced by someone unaware of such code's obsolescence, the compiler will issue a warning at compile time about the impending doom that awaits persons who continue the referencing.

It is this kind of detail that can make or break the success of reuse in a company.

Extendibility

Next comes extendibility. With Eiffel, modifying software is part of the normal process. As Philippe Stephan writes of the external audit of his project:

The auditors rated the responsiveness of the development team as very high.

Chief among the method's support for extendibility is the careful design of the inheritance mechanism. Unlike Smalltalk, which is fatally limited by the absence of multiple inheritance, the Eiffel approach fundamentally relies on multiple inheritance to combine various abstractions into one. As Dan Wilder notes:

Most object-oriented languages do not attempt multiple-inheritance. The literature is full of elaborate explanations why. This is sad. Eiffel demonstrates that multiple inheritance need not be difficult or complex, and it can also yield some quite practical results.

The approach also enforces a strict form of information hiding, which means that a module (a client in Eiffel Design by Contract terminology) that uses another's facilities (its supplier) is protected against many of the changes that can be made later on to these facilities. This is essential in preserving the coherent evolution of a large system - and the sanity of its developers.

Efficiency

Performance is almost as much an obsession in Eiffel as reusability. The software field is still, and will remain for a long time, largely driven by performance considerations. (Do not believe anyone who says that speed does not matter. If we get faster computers, it is to do things faster and especially to do more things - not to use more CPU cycles to run the same old applications at the same old visible speed.)

There is no reason whatsoever to leave the mantle of efficiency to the proponents of machine-oriented languages such as C/C++, or to follow the path of Smalltalk which sacrifices performance to object orientation. With Eiffel you can have the best of both worlds. Thanks to a performance-obsessed language design and ten years of research and competition on compiling algorithms, the speed of Eiffel-generated code (in such modes as what is known as "finalization" in ISE Eiffel) is as good as that of hand-produced C code, or better.

Software producers should stand up to their ideas. That is what we do at ISE: apart from the run-time engine (a few thousand lines of C), all of our software - thousands of classes, hundreds of thousands of lines - is written in Eiffel, and it runs fast. Typical of the situation is a recent incident with the EiffelLex library: it still had a few C elements, remnants of an earlier design. We rewrote them in Eiffel - for a 30% performance gain.

Why these gains? The answer is simple. The C/C++ approach of doing everything by hand, under tight programmer control, works well for small programs. Similarly, a good secretary has no equivalent for keeping one person's records. But in the same way that no humans can match the performance of a computer for managing, say, the records of a bank or a city, no programmer can beat a sophisticated Eiffel compiler for optimizing a large program. Against the automatic application of inlining, static binding, memory management and other optimizations, the human does not stand a chance.

To have one's cake and eat it also means not to have to choose between run-time and compilation-time performance. For programmers used to the contrast between a Smalltalk-like style of rapid turnaround and the interminable edit-compile-link cycle of most compiled environment, the following comments by Dan Wilder (in a separate article) will be a shock:

ISE Ebench uses "melting ice technology", which allows incremental changes to run in an interpreted mode. Only modified classes are recompiled. Changing one class and clicking the Melt button caused only a few seconds of compilation. [...] My test application took 20 seconds to compile from scratch in "melt" mode.
[Dan Wilder in Linux Journal, September 1995, Two Eiffel implementations.]
Steve Bilow provides further explanations:
Based on the observation that software development is an iterative process which is usually focused on constructing systems from code modifications, the folks at ISE have developed something that they call "Melting Ice Technology". Essentially, this means that when you make a [change] and you want to try it out, you simply "melt" it into the system. You don't need to regenerate a bunch of C code, so your changes are integrated into the system proportionally to the amount of code changed. Even in C and C++, `make' still has to relink.

What this also indicates in passing is the technology choice made by ISE Eiffel and all current implementations: using C as the portable implementation vehicle. By going through C, the compilers gain efficiency and portability. This also makes Eiffel one of the most open environments around; in contrast to the self-centered view that predominates in Smalltalk, Eiffel software is born with a sociable attitude, ready to interface with all kinds of other software written in C or other languages. This, needless to say, is a key to the success of realistic applications.

With us, everything's the face

A good way to think about Eiffel - the seamlessness of it, the insistency on getting everything right, the conviction that software should be beautiful in and out, specification and implementation - is this little anecdote stolen from Roman Jakobson's Essays on General Linguistics:

In a far-away country, a missionary was scolding the natives."You should not go around naked, showing your body like this!". One day a young girl spoke back, pointing at him: "But you, Father, you are also showing a part of your body!". "But of course", the missionary said in a dignified tone; "That is my face". The girl replied: "So you see, Father, it is really the same thing. Only, with us, everything is the face".

So it is with Eiffel too. Everything is the face.

Hundreds of thousands of people have now been exposed to Eiffel through books, through courses, through hearing about other people's successes, and most importantly (for the most fortunate among them) through using it to complete a project on time, within budget, and to the satisfaction of their customers. Shouldn't your next project use Eiffel too?

Eiffel Home Page (Web)

Copyright Interactive Software Engineering, 2001
"Design by Contract" is a trademark of ISE.


1 OVERVIEW AND PREREQUISITES

Help reading this manual

EiffelStudio is the central tool of ISE Eiffel, letting you design, develop, debug, document, measure, maintain, revise and expand systems using the full power of object technology and Design by Contract TM .

This presentation introduces the essential properties of EiffelStudio. It will take you through a tour of the environment, using a pre-existing example system.

What will I achieve?

Although it skips many specific or advanced facilities, this Tour will help you quickly become familiar with the way you can use the environment for your work. After reading it you will know the basics of working with EiffelStudio:

    + Starting a project and retrieving an existing project.

    + Entering new software elements -- clusters, classes and features.

    + Compiling your software.

    + Making changes and having them immediately recompiled using the Melting Ice Technology TM .

    + Displaying a graphical representation of your software elements, and modifying the software through the graphical views (as well as through its text).

    + Producing extensive documentation of your system, textual or graphical, under many different formats such as HTML, RTF, Postscript, XMI (for e.g. Rational Rose) and others.

    + Browsing through simple or complex software systems, to find out their various components, properties and relationships.

    + Measuring quantitative properties of the software, by applying metrics predefined in EiffelStudio as well as new ones that you define.

    + Executing a compiled system, and controlling its execution through the debugging mechanisms of EiffelStudio.

About the scope of EiffelStudio

The most important property to keep in mind as you are discovering EiffelStudio is that it is neither just a "programming environment" nor just a "CASE tool" (Computer-Aided Software Engineering) for analysis and design. It encompasses both of these functions and many others. Most system builders today are used to a dichotomy between the high end and the low end:

    + At the analysis and design levels, graphical tools help you clarify your thinking about the system, interacting with customers and end users, and devise high-level system architectures, usually in diagrammatic form.

    + At the low end, programming tools help you edit, compile and debug your programs.

Keeping these tools separate is, however, detrimental to the quality of the software process and the resulting products. If they are in the hands of different teams, communication problems may arise, leading to discrepancies between need and realization; this can be a source of bugs or even project failure. If it's the same people using tools of both kinds, they have to keep switching notations, tools and modes of thinking. The use of different frameworks at both ends makes it difficult to keep the high-level model and the implementation consistent; too often, a change decided at the implementation level is not reflected back in the higher model. After a while, the system gets into the state of disorder and inconsistency that good tools are precisely meant to avoid.

EiffelStudio, in line with the principles of seamless development and reversibility of the Eiffel method, removes the gap by providing a single set of tools that accompany you throughout a project, from the most high-level initial stages to the most low-level aspects of implementation and maintenance.

This generality is reflected throughout the environment by, for example, the dual use of text and graphics. As another example, you should think of the EiffelStudio compiler , not just as a tool for executing Eiffel software in its final form, but also, thanks to its extensive validity checking facilities, as a design consistency tool that performs many verifications commonly associated with CASE tools.

Depending on your project needs, you may take advantage of EiffelStudio's versatility to address specific purposes:

    + You may use EiffelStudio as a programming environment, with advanced tools for compiling, browsing and debugging.

    + Some people use EiffelStudio as a modeling tool only, building system descriptions consisting only of deferred (abstract) classes with no implementation, and relying on the Diagram Tool to build, present and discuss these descriptions through graphical views.

    + You may use EiffelStudio in both capacities, taking advantage of the seamlessness between all the affected phases.

Learning by doing

If you have access to EiffelStudio as you read this Tour, the most effective technique is to execute all the suggested operations as you read about them.

Please execute user actions, such as clicking, only when asked to do so.

What should I already know?

This Tour assumes very little about what you know and what you don't.

It does assume that you can do simple manipulations on your platform of choice, such as: on Windows, finding and drag-and-dropping folders and files in the Windows Explorer; on Unix, changing to a certain directory ( cd ) and listing the files of a directory ( ls ).

The more you already know about object technology and object-oriented environments, the better. But remember, if you have used other environments before, keep a fresh outlook; EiffelStudio is different, and it may take a while before you fully understand why it does some things in a certain way.

A note on platform differences

ISE Eiffel is one of the most portable environments in the industry, running in an almost identical fashion on Windows, on the new Microsoft .NET environment, on many variants of Unix, on Linux, on VMS.

Once an EiffelStudio session has been started, you can largely forget about the operating system. But a few operations -- mostly at the beginning, to launch EiffelStudio -- require platform-dependent mechanisms: starting a program, traversing the file structure, selecting a file. These cases will be marked accordingly below.

Windows users should particularly note the following two conventions of terminology:

    + Operating systems store files into hierarchically nested structures called folders or directories . Although "folder" is the more common term for Windows, we will mostly speak of "directories". It's exactly the same thing.

    + A file has a full path name , used to describe how to reach it from the root of its file system, as in c:\d1\d2\f . This example uses the Windows notation, which separates successive components of a path name by a backward slash character \ . On Unix and Linux, the separator is a forward slash / , as in /d1/d2/f ; this is also the convention on the Internet for denoting addresses (URLs). Most file names in this manual appear in this Unix/Internet style. On Windows you will normally have to use the backslash convention, although EiffelStudio also accepts forward slashes. In any case you must be consistent: don't mix backward and forward slashes in the same path name. Also note that some names, such as those of object files to be linked with your system, will be passed to outside tools -- C compilers, loaders -- that may not accept the forward slash.

VMS users may similarly use either the Unix convention or the specific VMS path naming convention.

If you are a one-platform person, just ignore, for the next few pages, all references to any platform other than your heart's favorite. They will quickly go away.

What should I have done first?

To run the example you must have installed ISE Eiffel and set up the environment. Check in particular the following:

    + On Windows, you must have run the installation procedure; it will have put EiffelStudio in the Programs section of the start menu, subsection "ISE Eiffel version", where version is the version number, e.g. 5.0.

    + The environment variable ISE_EIFFEL must be set to the installation directory, and the environment variable PLATFORM to the platform. On Windows this is taken care of automatically by the installation procedure, but on Unix/Linux and VMS you must update your path and environment manually. Throughout this discussion the notations $ISE_EIFFEL and $PLATFORM will refer to the values of these variables -- the installation directory, and the platform. (The Windows notation would be %ISE_EIFFEL% and %PLATFORM% .)

    + On Unix/Linux and VMS, your "path" must include the place where EiffelStudio executables reside. (On Windows the installation procedure takes care of this.)

    + Also, the discussion assumes that as part of the installation you have included the EiffelBase library, in precompiled form. EiffelBase is automatically included if you have installed another precompiled library, such as WEL, the Windows Eiffel Library. The installation procedure takes care of precompiling EiffelBase.

Locating the example

Please take a moment to locate the example files on your installation. They all appear in the following directory, part of the Eiffel delivery:

    $ISE_EIFFEL/examples/studio/tour

(Windows users: remember that instead of the slash / your platform uses a backslash \ . VMS users: this is to be replaced by the VMS path naming conventions.)

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


2 COPYING THE EXAMPLE FILES

Help reading this manual

    If you are using Eiffel on a personal computer under Windows, you can work directly on the installation directory and don't need to make copies of files as per the present section. Skip directly to the next section, 3 .

    Do read the present section and apply its instructions if you work under Unix, or may have to share the Eiffel installation with other users, do not have write permissions on the installation, or want to keep the installation unchanged.

If you are going to work on a copy, choose or create a directory of your own; let's call it YOURDIR for the rest of the discussion.

To copy all the files of the example to YOURDIR :

    + On Windows, open a Windows Explorer, go to $ISE_EIFFEL\examples\studio\tour , select all the files in that directory, and drag-and-drop them to YOURDIR .

    + On Unix execute the shell command

      cp $ISE_EIFFEL/examples/studio/tour/* YOURDIR

    + On VMS execute the command

      copy $ISE_EIFFEL:[examples.studio.tour]*.* YOURDIR

Once you have compiled the example under EiffelStudio, relying on the precompiled EiffelBase library (the default), and without optimization, the contents of YOURDIR will take up less than one megabyte, including information on diagrams and metrics.

The final executable generated through " finalization " (optimized compilation) will take only about 300 kilobytes.

Without precompiled EiffelBase you would need about 3.5 megabytes, plus about 25 megabytes of generated C code and auxiliary files. The executable in that case will take up about 250 kilobytes,

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


3 STARTING EIFFELSTUDIO AND OPENING A PROJECT

Help reading this manual

In the rest of this Tour YOURDIR denotes the directory where the example resides (the original, $ISE_EIFFEL/examples/studio/tour , or a copy). Launching will use the operating system's mechanism for starting a program, so we look separately at Windows and at Unix/VMS.

Launching EiffelStudio under Windows

On Windows, you can launch EiffelStudio from the Start Menu under

    Programs --> ISE Eiffel Version --> EiffelStudio

where Version is the version number, e.g. 5.0. Alternatively, you can double-click the icon that the installation procedure will have added to your desktop (if you have selected that option during installation).

If this is the first time you are using EiffelStudio, you may get a dialog asking for an unlock code or inviting you to register the product. Please contact ISE for registration and purchase information.

Launching EiffelStudio under Unix or VMS

To launch EiffelStudio on Unix or VMS, change directory to YOURDIR and, from the command line, type

    estudio

In general you can start EiffelStudio from any directory, but to make things simple for this Tour please make sure indeed to execute the estudio command from YOURDIR . (This will allow us to use relative rather than absolute names for some of the files involved.)

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


4 COMPILING AND EXECUTING A SYSTEM

Help reading this manual

EiffelStudio first comes up with a window and a dialog on top of it; the dialog looks like this (from here on the look-and-feel will be different on non-Windows platform, but the contents will be the same):

As this is our first project we want to Create a new project. The three possibilities are:

    + " Create a new project ", which would let you select one among the common schemes -- basic application, graphical Windows application, graphical multi-platform application, Microsoft .NET application -- and set up everything for you.

    + " Open existing Ace (control file) ", which finds the setup in a control file, called an Assembly of Classes in Eiffel or Ace.

    + " Open compiled project ", which will work once you have compiled a project.

In future sessions you'll probably use the first option for a new project, as it takes care of generating everything for you, and the third option for an existing project. Right now, though, we want you (like an expert EiffelStudio user!) to use an existing Ace that exists precisely for the purpose of this Tour. So please select the second option

    Open existing Ace (control file)

and click Next . This brings up a File Explorer inviting you to select an Ace file. The file you want is, depending on your platform, one of

    $ISE_EIFFEL\examples\studio\tour\Ace.mswin.ace

    $ISE_EIFFEL/examples/studio/tour/Ace.unix.ace

(the first one for Windows, the second for Unix; remember that $ISE_EIFFEL stands for the location of the Eiffel installation, such as C:\Eiffel50 ; Ace files are normally marked by the .ace file extension). For VMS, select the Unix variant.

Use the File Explorer to go to the directory $ISE_EIFFEL/examples/studio/tour/ and select the appropriate file, mswin.ace or unix.ace , for your platform. A confirmation window comes up:

Click OK to confirm. This selects the Ace file and starts compilation of your project.

During Eiffel compilation, a progress bar displays the successive compilation steps, or "degrees". The bulk of our little project is the EiffelBase library, which the EiffelStudio installation procedure has precompiled; so just now there's only a few extra classes to compile, and the process is almost instantaneous on a state-of-the-art computer. Even if you had to compile the EiffelBase classes, EiffelStudio compilation is so fast that you would hardly have the time to read the "degree" messages; you can see them later in compilations of bigger classes and systems.

On an IBM Thinkpad, Pentium III 850 MHz, 256 MB, running Windows 2000 Professional, Eiffel compilation takes about 9 seconds for the entire Guided Tour system including non-precompiled EiffelBase.

After Eiffel compilation completes you will see the message

    System had to be frozen to include new externals.

    Eiffel compilation system recompiled.

    Background C compilation launched

At this stage you can start using EiffelStudio, e.g. for browsing, but since C compilation won't take long either (about 15 seconds on our test machine), it's just as well to let it finish. C compilation messages will appear:

    + On Windows, in a new console.

    + On Unix, in the window from which you launched EiffelStudio.

Why C compilation? ISE Eiffel under some circumstances uses C as intermediate code for its compiler's generated code, and relies on a C compiler to process the result. On Windows you will by default use the command-line Borland compiler (included with the ISE Eiffel delivery); you may replace it by another, such as Visual C/C++ from Microsoft (available directly from ISE) if you wish. On Unix you will use the resident C compiler.

EiffelStudio reports that the C compilation has terminated:

Congratulations! You have successfully compiled your first Eiffel project. More precisely it's been both "melted" and "frozen". Strange terminology, you may think; in a little while we'll see why these compilation steps are called that way.

Executing the system

The system doesn't do anything exciting, but let's execute it anyway. Find the execution icon ("Run with breakpoints") at the top of the EiffelStudio window:

It would be OK too to use the neighboring icon to the left, "Run without breakpoints", since we haven't set any breakpoints. Click either icon to execute the system.

This little application doesn't use graphics or anything fancy but simply creates some objects and displays some information. Output done using the default EIffel I/O (from the EiffelBase classes ANY and STANDARD_FILES ) goes to a console. On Unix/Linux and VMS it's the window from which you started EiffelStudio. On Windows it's by default a new console window that comes up when and if the system does its first output operation, and stays up:

The message " Press Return to finish the execution " would not appear if you executed the system from outside of EiffelStudio, for example from a command line. Its purpose within EiffelStudio is clear: to let you see the console output; without it, the console would go away at the end of execution. (None of this applies to Unix/Linux/VMS since there is no new console window to get rid of.)

If before closing the console window you look at the main EiffelStudio window (by moving away the console window) you will notice that it looks different from before, since it now shows the fields useful in monitoring execution and debugging. But we'll look at this later. For the moment just dismiss the console by following the advice to " Press Return ": hit the Return or Enter key.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


5 A LOOK AT THE PROJECT DIRECTORY

Help reading this manual

Before we proceed with the facilities of the environment, let's take a look at the way EiffelStudio organizes project files.

With EiffelStudio, you build projects. Most projects yield an executable system, although you can also build a project just to define a library for use by such systems.

Every session is relative to a project; you can start a new project from within EiffelStudio by going to the File --> New Project menu, but please don't select that menu entry now as we have many more things to do with our current project first.

Every project has a project directory which will contain the files generated and managed by EiffelStudio. The project directory may also host some of the source files containing your Eiffel classes, the Ace (control file), and external software written in other languages, but that is not required; the source files may reside anywhere. Some users, in fact, like to put nothing else than the EiffelStudio-generated files in the project directory; this separates user-managed and system-managed files, and can facilitate configuration management, backups and porting.

In this simple Tour, things have been set up so that all the files of interest, source texts as well as generated ones, will appear in the project directory YOURDIR (either $ISE_EIFFEL\examples\studio\tour or the copy that you have made). Go to that project directory using the Windows explorer or a cd command, and look at its contents (using ls on Unix/Linux):

The contents of this YOURDIR directory include the following:

    + First you see a number of files with the extension . e , for "Eiffel": heir.e , invalid.e and others. These are the Eiffel source files, each containing one class. The recommended convention is to store a class of name CLASS_NAME into a file of name class_name .e , where class_name is the lower-case version of CLASS_NAME ; here, file heir.e contains the class HEIR and so on. As you may remember, Eiffel is case-insensitive, but the standard convention for class names is to write them in all upper case. Calling the file class_name .e is only a recommendation, not an obligation; but you are required to store one class per file. This keeps things simple and facilitates project and configuration management.

    + You also notice two files with an ace extension. These are the compilation control files. The reason there are two is that this example has a Windows version and a Unix/Linux version. As you remember, the Ace files for this example were available as part of the delivery; we used them to compile the project. In most practical cases, however, you won't need to build an Ace; if you use the " Create a new project " option of EiffelStudio (remember the first screen on page 10 ), EiffelStudio will build the Ace for you; if you change the Preferences during a session, EiffelStudio will update the Ace. When you become an experienced Eiffel developer you can also edit the Ace file directly; Aces are written in a simple Eiffel-like notation called Lace (Language for Assembling Classes in Eiffel). If you like you can take a peek at Lace by opening the relevant .ace file with a text viewer or editor now (but don't make any change); it shouldn't be hard to understand what it's all about. But that's not really necessary at this stage.

    + Next you see a file called simple.epr . This is the Eiffel Project Repository, hence the extension. Any successful compilation of a project will produce a project of this kind, system_name .epr . To open an existing project when you start EiffelStudio (this was the option " Open compiled project " in the initial screen on page 10 ), you will just select the corresponding .epr file.

    + Finally you will notice a subdirectory called EIFGEN , for " EIF fel GEN eration". EIFGEN is created and maintained by the compiler to store information about your project, including generated code for execution. EiffelStudio manages your project in such a way that EIFGEN can always be re-generated if need be; this means in particular that if things go wrong for any reason and you want to make a fresh start you can always delete this directory and the .epr file and recompile your system, recreating a new EIFGEN in the process. This also means that you should not add any files into this directory, or modify any of its files, since a later compilation is free to change or regenerate whatever it chooses in EIFGEN .

Later on, we will see that EiffelStudio may generate three more subdirectories of the project directory: Diagrams , if you produce graphical system diagrams; Documentation , if you request system documentation, for example HTML; and Metrics , if you perform measurements on your system. Other than these directories, EIFGEN , and system_name .epr , EiffelStudio will not touch anything in the project directory, so you may safely add and change whatever files and subdirectories you like.

You seldom need to look into EIFGEN , although you should know that it's there. Right now if you check the contents of the project directory YOURDIR (using the Windows Explorer on Windows, the ls command on Unix, or some equivalent mechanism), you will see that EIFGEN has been created, itself with some subdirectories, including W_Code which contains the generated code ( W for "Workbench" -- we'll see the reason later). Feel free to browse through it if you like, but don't change anything.

By the way, we are now done with any platform-specific instructions. Everything in the rest of this Tour, other than the graphical look-and-feel, will work the same across all EiffelStudio platforms.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


6 STARTING TO BROWSE

Help reading this manual

It was important to take a look at how EiffelStudio stores your project, but unless your idea of fun is to poke around directories to look at compiler-generated files that's not really the exciting part yet. Among the most innovative aspects of EiffelStudio is a unique set of facilities to browse through a software system.

Browsing styles

Browsing -- traversing the structure -- is particularly important in object-oriented development and especially in Eiffel because of the speed at which you can construct sophisticated class structures, making use of inheritance, genericity, the client relation and information hiding, and subjecting features to all kinds of adaptations -- renaming, redefinition, undefinition, effecting -- that are key to the expressive power of the software, but call for smart tools to keep track of what's going on. EiffelStudio's tools are second to none. Among their key properties:

    + You can choose many different ways of browsing: sometimes you know the name of a class or feature, and will get to it just by typing it; sometimes you want to traverse the system through its cluster-subcluster structure ; often, you see a reference to element (class or feature) in the text of another element, and just want to get to it by following that reference, like a hyperlink . You'll be able to use all these techniques, and alternate freely between them.

    + The browsing facilities are always available. There is no "browser" in EiffelStudio; you just browse when you want to, by looking at the information you need. You can do this while editing, debugging, or performing any other of the analysis, design, implementation, extension and maintenance tasks of system construction.

    + Although classes are stored in files and clusters in directories, you can for the most part forget about the file system. Unlike most environments, which let you manipulate files containing software texts, EiffelStudio lets you concentrate on your development objects -- the units that make sense for you: features, classes, clusters, systems. You think in terms of those conceptual units, and don't have to worry about where they are stored. Most of the time, you'll just forget about files and directories.

    + You can produce many views of the development objects. For a class, you may see the full text, the interface only, the inheritance structure, the clients, the features, and many other views. You can even display graphical views along with textual ones. All these are fully browsable; you can go from one to the other as you please.

A Development Window

Let's see how this works. First, take a look at the EiffelStudio window:

If some parts are too small, just resize the window to arrive at something like what's on the figure. When it first comes up, EiffelStudio initially uses a fairly small window, because it's designed to run on a 800x600 display, although of course a bigger display is recommended. But as soon as you have resized it, EiffelStudio will come up, in the next session, with the size you've set.

You can see four panes, marked on the figure: Features , Class , Clusters , Context . There will be others, such as Search , and you can remove any of them, except Class , at any time to make room for the others.

So far we have talked about " the EiffelStudio window", but in fact that's not correct. What you see is one " Development Window ", of which you can have as many as you wish. Some people prefer to use a single development tool, avoiding screen clutter; others don't think twice about having lots of windows, taking the "desktop metaphor" to its full conclusion (some non-computer desktops are quite cluttered). There are many ways to start a new Development Window; for example if you look at the entries in the File menu at the top left -- don't select any of these entries yet, just look -- you'll see, among others, New window , which would create a new Development Window.

Whether you have one Development Window or many, each may have as its target an element of the system: system, cluster, class (the most common case), feature, run-time object. This simply means that the tool displays information about that element.

Retargeting by name

Our first example screen was targeted to the whole system. To retarget it to a particular class, you can just type the class name -- if you know it -- into the Class Field at the top left:

Let's use one of the most basic classes, STRING from the Kernel Library of EiffelBase. Bring the cursor to the Class Field, click to make it active, type string (or STRING ) and the Enter key. As shown on the next figure, this retargets the tool to class STRING . Note that you didn't have to worry about where the class resides in the files of your computer. Also, the Class Field will now show the target's class name, STRING , in upper case, since that is the standard Eiffel convention for class names. It doesn't matter, when you enter the name into the field, whether you use lower or upper case, or some mix; EiffelStudio will show the name back in all upper case.

The Development Window is now targeted to class STRING . Each of the four panes contains a tool:

    + Features Tree, top-left: a tree view of all the features of the class, grouped by the feature categories ( Initialization , Access , … ) as they appear in the class.

    + Editing Tool, top-right: the source text of the class, editable. For the moment the pane is too small to display much of interest -- it only shows the very first few lines -- but we'll enlarge it when we need to modify class texts. (Not STRING , though, as it's not the kind of class you want to change during your first session with EiffelStudio, so just wait a bit.)

    + Cluster Tree, bottom-left: a tree view of the clusters of the system.

    + Context Tool, bottom right: a bag full of neat tricks. At the moment it just shows some general information about the system (where it resides, the name of its root class TESTROOT ), but more generally it's there to give you all kinds of interesting views of the system, through the various tabs at the bottom: Output , Diagram , Class , Features , Metrics .

A peek at diagrams

There's indeed a lot in the Context Tool, too much to see right now, but to feed our curiosity let's just take a peek at the Diagram View. Click the Diagram Tab at the bottom:

This displays a class diagram in the Context Tool:

If nothing appears in the Context Tool when you click the Diagram Tab, that's because you are using an installation that has already been modified from the default settings. Select the menu entry View --> Merge Context Tool ; this will display the diagram as shown. We'll see the explanation for this behavior in "Isolating the context", page 68 .

The diagram is cropped to the available area; to get the whole picture, resize the window from the bottom-right corner. You can now see the inheritance structure:

The red arrows show inheritance relations: STRING inherits from INDEXABLE and so on. We'll see later how to display the other key inter-class relation, client , but it's not particularly interesting for STRING . The default placement of the classes is quite good in this case, but if you don't like it you can change it; your changes will be retained the next time you bring up this diagram, in this session or a later one. (That's part of the information the Diagram directory keeps.) It will also be used in Web diagrams if you choose to generate an HTML form. To move a class bubble, just use standard drag-and-drop. For example you may move everything to the left and make the figure more compact:

Later on you will learn how to use the Diagram View not just to display system structures graphically but also to build and modify systems. EiffelStudio indeed integrates the functionality of a CASE (Computer-Aided Software Engineering) workbench, seamlessly integrated with the programming facilities. But for the moment this peek at the Diagram View is enough, so let's get back to browsing.

Retargeting from the Cluster Tree

Your first browsing action used a class of which you knew the name, STRING . What if you don't know what's in the system and want to explore it? Among other techniques, you can let the Cluster Tree, in the Cluster Tool at the bottom left of the Development Window, guide you through the system's structure:

An Eiffel system, as you know, is organized into clusters, which you can structure hierarchically into subclusters. Here we see the top two clusters: base , containing the EiffelBase library; and root , containing the few classes specific to our Guided Tour system. Let's go into base , ISE's open-source library of fundamental reusable mechanisms. Click the little + sign to the left of its name; this expands the first level of the base cluster, to show its four subclusters: event for event handling, kernel for the Kernel Library, structures for the Data Structure Library, and support for additional supporting mechanisms.

The most extensive of these EiffelBase libraries is structure , which contains implementations of major data structures and algorithms of computing science. Click the + next to structure to see its own subclusters:

If you initially don't see as many details as shown on this figure, you may get them by resizing the window, moving the vertical pane boundary, and possibly scrolling.

The EiffelBase Data Structure library and its subclusters are described in the book Reusable Software . Let's go to one of the most frequently used subclusters, list , containing implementations of list structures. Click the + next to list . This time, since list is a terminal cluster, it's not subclusters you'll see, but classes , identified by small ellipses:

The ellipse, or "bubble", is indeed throughout EiffelStudio, as in the Business Object Notation (BON, the underlying graphical convention), the distinctive symbol for classes; remember the larger bubbles showing classes in the Diagram View a few moments ago.

Our second technique for retargeting a Development Window to a class (other than typing the class name as we did before) is to click the class in the Cluster Tree. Do this now: click LIST in the tree. It doesn't matter whether you click on the class name or the adjacent bubble. This retargets the tool to class LIST . Because the Context Tool is still in Diagram view, it will display the inheritance structure for the new target class:

While this view is being produced you may see (or just get a glimpse of, if your machine is fast) messages indicating that it's producing the diagram for LIST . In a moment we'll switch views in the Context Tool as we won't need the diagrams.

As the tool is now targeted to LIST , the Class Field at the top left now shows the name of that class, exactly as if we had typed that name, the way we did with STRING in the previous method of retargeting.

Moving back and forth

Here now is a third way to retarget. Towards the top-left part of the Development Window there are Back and Forth buttons, which will enable you to revisit classes already seen during the current session:

Click the Back button. This retargets the tool to the class you visited previously: STRING . The Forth button, immediately to the right of Back , becomes active. Click it to retarget back to LIST .

Note that all buttons of the interface have a "tooltip": if you move the cursor on a button, without clicking , and wait a second or so, a small message comes up, explaining the purpose of the button. You may try this now on the Back and Forth buttons.

The Target History

As a fourth way to retarget -- there are more, and after this one we'll stop counting -- you can also use the Target History menu, which you can bring up through the little arrow to the right of the Class Field:

If you click this arrow -- the little black triangle -- you will see a menu of all your recent targets. Doing this now will only show the two classes visited so far, STRING and LIST , but later on there will be more entries. By default EiffelStudio remembers 10 classes; this is one of the settings you can change later if you wish, through the menu Tools --> Preferences . (There's no point in doing this now.)

Adding to Favorites

If you find yourself often needing to examine a particular class, you can add it to your "Favorites", similar to the favorites, also called bookmarks , which you use to retain interesting pages in a Web browser.

It's easy to add the current target -- currently, LIST -- to your Favorites. Do it now: go to the Favorites menu and select Add to favorites . Now display the favorites; one way is to go back to that same Favorites menu and select Show favorites . The Favorites Tool appears below the Cluster Tree:

This also means one more way to retarget a Development Window: click a class in the Favorites Tool. Two ways actually, since even if you don't see the Favorites Tool the class will appear in the Favorites menu and you can select it there.

Right now we don't need the Favorites Tool, so you can get rid of it by either selecting Hide favorites in the Favorites menu or clicking the little Close icon at the top right of the Favorites Tool:

Starting a new tool

With all the techniques seen so far, you were able to retarget the current Development Window to a new class. As noted, you may also wish to have two or more Development Windows targeted to different classes; this is useful to keep track of several things at one. A simple way to start a new tool on a class is to find the class somewhere in the interface and control-right-click it.

Here, for example, the diagram in the Context Tool shows, at the top, a yellow bubble for the class CHAIN , a parent of LIST. (You can see it for example on the next-to-last figure.) Go to that bubble and control-right-click it, that is to say, click with the rightmost button of the mouse while holding the CONTROL key on the keyboard. This starts a new Development Window, targeted to the chosen class, CHAIN :

The place where we found the class CHAIN in the original tool (the one targeted to LIST ) was the bubble representing the class in the Diagram View. But that's just one possibility. A general principle of EiffelStudio is semantic consistency : when you want to work with a development object -- a class, a feature, a cluster -- you can grab it wherever it appears in the interface, and in whatever format it is displayed: you might have spotted it be in the Diagram View, in the text of a class in the Editing Tool, in the Cluster or Feature Tree, or in any of the class documentation formats that we will soon see; and the form under which you found it may be text -- the name of the class in a text document -- or some graphical representation, such as a class bubble in a diagram. These variants don't matter: if the class or other development object catches your fancy, you can do whatever operations make sense for it, such as Control-right-click to start a new development object targeted to it, or any of the other operations we'll see next.

While you are at it, try a couple of other ways to create a new Development Window. Go to File --> New window ; this creates a new tool, untargeted. The title bar says " Empty development tool #1 ". You can get the same effect by clicking the Create New Window icon, leftmost on the top row of buttons, just below " File ". The corresponding keyboard accelerator is CTRL- N .

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


7 CLASS VIEWS

Help reading this manual

We haven't even looked at a class text yet, but it's important anyway to see how EiffelStudio provides you with numerous, complementary views of your software. The Context Tool is the primary place to look for such views.

We'll need just one Development Window for the moment, the one that was targeted to LIST . You can get rid of the others by closing their windows (through the top right cross mark on Windows and the equivalent in other window managers), or through File --> Close -- but don't select "Exit" which would take you out of EiffelStudio altogether!

If you don't see a tool targeted to LIST , just retarget one, as you know how to do this now, for example by typing the name followed by Enter in the Class Field at the top left.

First let's give ourselves more space. Right now we don't need the Cluster Tree and Feature Tree panes. Get rid of them by clicking the corresponding buttons on the top toolbar:

You can get these panes back later by clicking the same buttons again.

Another way to hide a pane is to click its Close icon, the little cross mark highlighted (for the Features Tree pane) on the left in the last figure.

Two panes remain, showing the Editing Tool and the Context Tool.

Make sure the Context Tool pane is large enough; you can resize the window and, if necessary, narrow down the Editing Tool pane since we don't need it for the moment. Don't worry, though, if the Context Tool shows only part of the diagram, as it does on the last figure, since we will now use the Context Tool to display information other than the diagram, by selecting the corresponding tabs.

The Class Tab

The first tab we'll look at is the Class Tab. You'll find it at the bottom of the Context Tool:

This gives you access to many forms of information about the current class -- the target of the Development Window. A set of buttons at the top of the Context Tool enables you to display a number of views of the class. The currently highlighted button indicates the default view: Ancestors . You can see the others' names by moving the cursor over the various view icons, without clicking , and reading the tooltips.

The view currently displayed, Ancestors , shows the inheritance structure that leads to the current target, LIST :

This shows that LIST is an heir of CHAIN which itself, as an example of multiple inheritance, is an heir of CURSOR_STRUCTURE , INDEXABLE , and -- twice, as an example of repeated inheritance -- SEQUENCE . If, because of direct or indirect repeated inheritance, a class appears more than once, the display doesn't repeat its ancestry the second and subsequent times; the omitted repetition appears as just three dots, … , as illustrated here for the second occurrences of BAG , ACTIVE and others.

As you may have guessed, all the class names that appear on this display, by default in blue, can function as hyperlinks: you can use any one of them to retarget the Development Window to the corresponding class. This will be another major retargeting mechanism. But let's not pursue it for the moment and instead continue looking at the documentation views.

Next to Ancestors is Descendants , which will give you the descendants of a class in a similar format:

The progeny of LIST , as you can see, is just as impressive as its ancestry.

Let's now look at the other formats, starting from the left. The first button, Clickable , gives the class text. It's essentially the same information as appears in the top Editing Tool (whose pane was reduced to its bare minimum in the last few pictures, showing only the first three lines or so), but with some differences:

    + The top Text view is editable. In fact it's EiffelStudio's primary tool for entering software texts. The bottom Clickable view is just a view; you can't change it.

    + The Text view retains the formatting of the class text the way it was typed in; the Clickable view is automatically formatted -- "pretty-printed" -- according to the standard Eiffel layout rules.

    + The Clickable view does not include comments inside routine implementations ( do and once clauses), although it does retain features' header comments.

    + As part of the pretty-printing, the Clickable view uses colors and fonts to distinguish keywords, identifiers, comments and other syntactical elements. You can change the fonts and colors, like many other elements of the interface, through Tools --> Preferences . (Now's not the time.)

This view is called "clickable" because, as we'll see later, every syntactical element on it is a hyperlink, which you can use for browsing. Here is the beginning of the LIST class text in Clickable view:

After Clickable comes the Flat view button. The layout of the result is similar:

The flat form of a class is the reconstructed class text including not only what's declared in the class itself but also everything that it inherits from its ancestors, direct or indirect. This applies to the flat form's features, which include ancestor features, but also to contracts: the flat form's invariant includes all clauses from ancestors' invariants, and the preconditions are expanded to take require else and ensure then clauses into consideration. (The Eiffel Tutorial explains these notions in detail.)

As a result, the Flat view shows the class text as it might have come out had inheritance (what a horrible thought even to contemplate!) not been available to write it.

The first two features appearing in the above display, cursor and first , are indeed inherited from ancestors, rather than declared in LIST itself. Note how EiffelStudio, when producing the flat form, adds a line of the form

    -- (From CLASS_OF_ORIGIN )

to the header comments of inherited routines, to document where they come from.

The flat form is an important notion of object technology, making it possible to understand a class by itself, regardless of the possibly rich inheritance structure that led to it. Looking at the Flat view of LIST , you may note how few of its properties come from the class itself; most of the interesting work has been done in ancestors, and LIST just adds a few details.

If at any time you want to search for a certain pattern in the views displayed, click the Search button at the top of the window, or type CTRL- F . A self-explanatory Search Tool will come up, with various options such as Match case and Whole word .

Next come two essential documentation views: Contract and Flat Contract . Based on Eiffel's principles of Design by Contract, they document the interface properties of a class. Unlike the previous two, they do not show actual Eiffel texts, but information useful for client classes.

Here is the beginning of the Contract view for our example class LIST :

The contract form (also known as the short form of a class) is the class text deprived of any internal detail to retain interface information only. It discards any feature that's not exported (available to all clients); for the retained features, it discards the implementation -- do or once clause -- but retains the header (feature name, arguments, results), the header comment, and the contracts (precondition, postcondition, invariant) minus any contract clause that refers to a non-exported feature and hence would be useless to clients.

As you will know, particularly if you have read the book Object-Oriented Software Construction , the contract form is the preferred way of documenting software elements, especially reusable components, as it provides clients with just the right level of abstraction: precise enough thanks to the type signature and the contracts; clear enough thanks to the header comments; and general enough since it omits implementation details that are irrelevant to client programmers (and might lead them to write client code that won't work any more if the implementation changes).

In practice you will often want to use, instead of the Contract view, the next one, Flat Contract , also known as "flat-short form" and "interface form", which applies the same rules to the flat form rather than to the original class. This means it shows information on all the features of the class, immediate (defined in the class itself) as well as inherited, whereas the short form, non-flat, only considers immediate features. The Flat Contract view provides the complete interface information for the class. Try it now on class LIST .

The next two buttons are for the Ancestors and Descendants views, which we have already seen, showing classes connected with the target through one of the two inter-class relations, inheritance. After them come Clients and Suppliers , to list the classes connected through the other relation, client. Clicking the Clients button shows the (empty) list of clients of LIST :

No class of this system directly uses LIST as client, although some use its descendant ARRAYED_LIST . Now click the next button to see the Suppliers of LIST :

The only two classes that LIST needs for its own algorithms are basic types from the Kernel Library, BOOLEAN and INTEGER . In Eiffel, as you may remember, all types are defined by classes, even those describing such elementary values as integers and booleans.

Feature information in the Class View

Let's resist the natural urge to go see now what the classes INTEGER and BOOLEAN look like, and instead continue our survey of views. The remaining views will all display information about the features of the class. The first of them, Attributes , lists the attributes. It's not very interesting for LIST , a deferred class with only one attribute -- you can check this for yourself by clicking the Attributes button -- so let's look at the next one. Click the Routines button now to display information about the routines of class LIST :

The sections of this display group routines according to the ancestors of LIST -- including LIST itself -- that first introduced them; for example (second and third sections) extendible originally comes from COLLECTION and extend from BAG . Much of the benefit of this display comes from its support for browsing: all the colored elements, representing classes and features, will be "clickable" hyperlinks.

The remaining Class View buttons all display information in the same format. Each selects a specific subset of the target class's features. The last two selected attributes and routines. You can now try any of the others by clicking the corresponding button:

    + Deferred features: abstract features which don't have an implementation in the current class, only in eventual descendants. Try this for LIST ; you'll see that this deferred class indeed has a number of deferred features.

    + Once and constants : constant attributes, "once functions" which provide shared objects (close to the "singleton" pattern), and once procedures which provide a convenient initialization mechanism. LIST hasn't any.

    + External features, implemented as calls to routines, macros or other elements implemented in other languages. LIST hasn't any.

    + Exported features: those available to all clients. LIST has quite a few.

All the views you have now learned to produce were about classes . It's also very useful to obtain information about what happens to your features throughout the classes where they appear. This will be the purpose of the Features Tab of the Context Tool. But before we look at it let's see how to do more with the Class View facilities just seen, by exporting them to the outside world: to the Web, to a text processing tool, or in fact any other tool.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


8 PRODUCING AND EXPORTING DOCUMENTATION

Help reading this manual

Software development is, most of the time, cooperative work. You must tell the rest of the team what you're up to, and find out what they can offer you. Bring in distributed development -- increasingly common these days, with some people working at headquarters, others at home, others traveling, an offshore team half a world away … -- and the problem becomes even more critical.

EiffelStudio provides unique facilities to make such distributed development possible in a safe, effective, harmonious way. Some of the key criteria are:

    + You must be able to export the information easily to the World-Wide Web, the most general and widely available interaction mechanism.

    + The documentation must be faithful to the software. Because of the ever-changing nature of software, this goal is impossible to satisfy unless the documentation is extracted from the software -- as opposed to the traditional approach, still perpetuated by many CASE tools, of treating the two as separate.

    + The task of updating the documentation after a software change must be straightforward and automatic.

    + It's not enough to support HTML; many other formats are useful too.

    + Users must have the ability to adapt the mechanism to support new formats.

    + For existing formats, they must have a way to tune the output easily to any specific style standards, company policies, local variants.

EiffelStudio's documentation generation satisfies all these requirements.

Documentation filters

Let's see how documentation works by starting to generate it for our Guided Tour system -- which really means for EiffelBase, since that's what it mostly consists of. The HTML result is available as part of the present documentation (we'll tell you where in just a minute), so you don't have to regenerate it unless you want to. Indeed we'll show you when to click Cancel if you are happy with the pre-generated version. But let's get started anyway to understand the principles and possibilities.

Click the following menu entry, used to generate documentation:

    Project --> Documentation

This is the next-to-last entry in the Project menu. The last one, by the way, Export XMI … , is directly relevant too: it will make it possible to export information in the standard XML representation for UML, for consumption by third-party products such as Rational's Rose. But for the moment we choose the Documentation entry to start the Eiffel Documentation Wizard.

The Wizard starts with a list of available output formats, also called filters :

The filter names correspond to major documentation formats which EiffelStudio supports by default. Among the most important, listed here in rough order of appearance in the list:

    + ASCII : plain text, no formatting codes.

    + eiffel : essentially the same as ASCII; useful if you want EiffelStudio to pretty-print your class texts and replace the originals, as explained below.

    + MML : internal format for Adobe FrameMaker.

    + Postscript : to generate Adobe Postscript output, suitable for printing on a Postscript printer, display on a Postscript previewer such as Ghostscript, or distilling to Adobe PDF.

    + COM : to generate class specifications in the form of an Interface Description Language (IDL) interface for Microsoft's COM component model.

    + RTF : Microsoft's Rich Text Format, used in particular for Windows "Help" files.

    + TeX1 , TeX2 : two variants for Donald Knuth's TEX processing format.

    + COM : to generate class specifications in the form of an Interface Description Language (IDL) interface for Microsoft's COM component model.

    + troff : if you already know what this is, congratulations (or condolences), you've been around the industry for a while. This is a traditional text-processing format available on Unix systems. Also works for the gtroff variant.

    + html-classic : HTML, no style sheets. The next variant, with style sheets, is strongly recommended unless your colleagues will be reading your documentation with Mosaic 1, vintage 1993, or Netscape 2, Vintage 1995.

    + html-stylesheet : HTML with style sheets. This is particularly attractive for Web publishing not only because the output makes full use of style sheet capabilities (fonts, colors, layout, formatting) but also because it becomes trivial to change the look-and-feel to support any style you or your users like, even after generation, simply by editing the style sheet file.

Not only do these predefined filters provide support for a number of important industry formats; better yet, if you want another format not represented on the list, or would like to adapt an existing format to your own style preferences, it's easy to define a new filter. The list that EiffelStudio displays comes from the files with a . fil extension that it finds in a subdirectory of the installation:

    $ISE_EIFFEL/examples/studio/filters

To define a new filter, simply add a file to this directory. Filters are expressed in a simple notation called EFF ( Eiffel Filter Format ), general enough to support a wide variety of tools for text processing, project management, Web publishing etc. The best way to define a new filter is usually to start from an existing one and adapt it. You will find the specification of EFF at the end of this manual, in "APPENDIX: WRITING DOCUMENTATION FILTERS WITH EFF, THE EIFFEL FILTER FORMAT", 19, page 144 .

Generating an HTML record of your project

Let's select the most obviously attractive of the predefined filters: HTML with stylesheets. Click the line html-stylesheet in the list to make it active, then click Next at the bottom of the Documentation Wizard window. The next window appears:

This is to let you decide which clusters of your system the documentation will include. Initially all clusters -- down to the level of nested subclusters, for example base.structures.list -- appear in the Include list on the right; but you might want to exclude some standard libraries or other clusters from the documentation.

To move a cluster from the right column to the left one, click it to select it, and click the left arrow button; for the reverse, use the right arrow.

You can play with moving a couple of clusters back and forth, but for this Tour we'll want to generate everything, including EiffelBase, so make sure that in the end all clusters appear in the right column, as on the last figure. Then click Next .

Generating Metatags from Indexing entries

The next step of the documentation wizard asks you to select indexing entries:

Eiffel classes, as you know, may start with an Indexing entry that enables class authors to include documentary information in any category they like. It is standard (and part of the official style guidelines) to include a the very least an entry of the form description: Descriptive text in every class. The earlier displays of class LIST showed that entry, which read " Sequential lists, without commitment to a particular representation ".

You may have noted that the purpose of Eiffel's Indexing clauses is, conceptually, similar to that of metatags in HTML. Metatags carry information which Web page visitors do not normally see in the browser; this information is available, however, to search engines and other tools that explore and classify Web pages. So it seems quite appropriate to generate metatags from Indexing entries.

The dialog illustrated in the last figure lets you select the entries you wish to transform into metatags. It appears only if you have selected an HTML filter. It lists all the Indexing tags found anywhere in the system; those on the right will be retained for metatags. Initially the Exclude list on the left contains three tags conventionally used -- at ISE and other Eiffel sites -- for interfacing with configuration management tools, and hence of internal interest only.

There is no need to change the default selection, so just click Next .

Choosing a level of detail

The next step of the Documentation Wizard lets you specify what kinds of documents you want to generate:

This is a very important facility since it gives you control over how much you want to publish about the properties of the software:

    + You may want to publish everything , source included, for example on your Intranet for a group of developers working closely together on the same classes, or on the Internet for open-source software.

    + You may want to publish only the interfaces (Contract or Flat-Contract views). This is not necessarily to protect proprietary information; even if you don't care about showing your source code, it is usually too detailed for client programmers, especially in the case of libraries. If various teams work on separate parts of a project, what each releases to the other should usually be the specification, not the implementation.

    + You may of course want to publish both the text and the interface, and let the recipients use the version that best suits their needs for each use.

    + You may want to publish the diagrams , showing the structure in graphical form. Note the warning -- which we are about to ignore -- telling us this may take a while.

    + The class list, cluster list, cluster hierarchy view, cluster chart (following the conventions of BON) are also optional.

The dialog shown on the last figure lets you specify the exact combination you wish. The figure indicates the default options.

This time, if we generate anything, we'll generate everything. Please check all the boxes (the generation won't occur until the last step) and click Next to move to the next dialog of the Documentation Wizard.

Specifying cluster views

The next dialog only appears when you have asked to generate diagrams:

Although we didn't use this possibility yet, the Diagram view lets you define different subviews of any cluster. One view might show inheritance only, the other client links only; one might include all classes, the other hide some library classes. The last dialog shown will allow you, for any cluster, to select a subview other than the default for the generated diagram.

Here we only have the default view, so just click Next .

Generating

The last dialog simply asks you where you want to generate the result:

By default, as shown, EiffelStudio will produce the documentation in a subdirectory -- created for the occasion, if it doesn't exist yet -- of the project directory:

    Project_directory /Documentation

You may, however, select any other location you like. In the case of HTML generation, as here, EiffelStudio takes great care to use only relative hyperlinks so that you can move the Documentation directory around, for use either on a file system or on your Web site, with the guarantee that the hyperlinks will work -- as long as you move the entire directory together.

To continue the Guided Tour, you do not need to complete the generation now unless you want to. The generated HTML is available in a subdirectory index-09A of the directory where you are reading this document (if electronically from the ISE Eiffel delivery), and also in the corresponding directory on the Eiffel site, at http://www.eiffel.com/doc/manuals/intro/environment/index-09A/.

The name index-09A for the needs of this manual. The default name is, as noted, Documentation.

If you are happy with looking up one of these pre-generated directories rather than producing your own, click Cancel on the last dialog.

If you prefer to produce your own, click "Finish". For our example system the process takes 7 minutes on the Thinkpad configuration mentioned earlier, and generates a 48 megabyte documentation directory.

Browsing generated documentation

Let's take a peek at the generated documentation. If you are reading this electronically you can see the generated documentation in the index-09A subdirectory of the documentation. Since you can browse the HTML files of that subdirectory at your leisure we'll just take a quick look to get familiar with the basics. Next to every figure you'll find a link labeled Browser link enabling you to see the corresponding page directly in your browser. The link will open in a new browser page.

Make sure you have a browser with full support for style sheets, such as Internet Explorer 4 or later, Netscape 4 or later.

We start with the root of the generated documentation, index-09A/index.html :

Browser link

This root page shows overall information about the system. The top set of links, repeated at the bottom, enables you to browse the system from its list of classes, its list of clusters, or the cluster hierarchy; note the box labeled Go to , which provides a built-in search engine, enabling you to type any class list and go directly to the corresponding page. Let's look at the class list: click the box Classes at the top left.

Browser link

This shows the beginning of the list of classes, alphabetically sorted. You could click any class to get the corresponding information, but wait; we'll look at individual classes in a moment. Instead, click Cluster hierarchy to see the overall organization of the system into clusters:

Browser link

Note the convention for denoting nested clusters: BASE , BASE.STRUCTURES , BASE.STRUCTURES.LIST . Click BASE.STRUCTURES.LIST to see details of the List cluster of EiffelBase where (under EiffelStudio) we had found the class LIST used as example in the preceding sections:

Browser link

This indicates the relations of the cluster to others in the hierarchy, and its list of classes. Again you could click any class name but instead note the mention (diagram) next to the cluster name near the top. Remember that when generating the documentation we elected ( "Choosing a level of detail", page 45) to generate everything, diagrams included. Hadn't we checked the corresponding check box, the (diagram) link wouldn't be there. Click it now to get the generated diagrams:

Browser link

The output is a diagram showing graphically the classes of the cluster and their inheritance relations. All EiffelStudio-generated HTML diagrams use the PNG graphics format ( Portable Network Graphics ), supported by all recent browsers.

The class bubbles in a diagram are all hyperlinks. To see the HTML documentation for our old friend the class LIST -- which you could also obtain by clicking its name on one of the preceding diagrams, or typing it in the Go to field -- just click its bubble (left on the figure, third from the top):

Browser link

The display shows key information on the class, in a form called the "Chart format" listing the ancestors and then the features, divided into Queries (shown in part on the figure) and Commands . Note that all class names and feature names are hyperlinks, which would lead you to the appropriate place in a class text.

The top row of hyperlinks now includes class formats corresponding to those we discovered under EiffelStudio ( "CLASS VIEWS", 7, page 30 ): Relations (covering ancestors, descendants, clients, suppliers,), full Text , Contracts , Flat contracts . Click Flat contracts to see the full interface of the class:

Browser link

We'll stop this brief review here but you may continue browsing through the HTML pages if you like. Note how closely the appearance of the class texts, flat forms, contract forms, diagrams and other forms of documentation matches the corresponding formats under EiffelStudio.

Although we suggest staying with the standard, you can easily change any convention that doesn't match your own preferences:

    + For the EiffelStudio appearance, use Tools --> Preferences .

    + For the HTML appearance, if you know about Cascading Style Sheets (CSS) for HTML, edit the style sheet default.css . You will find this file in the generated documentation directory; alternatively, to ensure the changes are applicable to the generated documentation of all future projects, edit defaults.css in the directory
    after backing it up. For more profound changes in the structure of the generated HTML, you may also backup and edit the Eiffel Filter Format file html-stylesheet.fil in the same directory. EFF is described in an appendix ( 19, page 144 ).

      $ISE_EIFFEL/examples/studio/filters

The documentation generation mechanisms, using HTML or other formats, let you publish your designs, at the level of detail you desire, on an Intranet, the Internet, or as part of documents you release. They are an important part of the power of ISE Eiffel for quality software development.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


simple documentation

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

System
    name:     simple
    location: C:\apps\Eiffel50\examples\studio\tour
    ace file: C:\apps\Eiffel50\examples\studio\tour\Ace.mswin.ace

Root class
    TESTROOT (root_cluster): make

Top-level clusters
    base
    root_cluster

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base	(diagram)

indexing
    description: "EiffelBase: Library of reusable components for Eiffel"
    copyright: "Copyright (C) 1986-2000 Interactive Software Engineering, Inc. (ISE)"
    notice: "[
        For ISE customers the original versions are an ISE product
        covered by the ISE Eiffel license and support agreements.
        EiffelBase may now be used by anyone as FREE SOFTWARE to
        develop any product, public-domain or commercial, without
        payment to ISE, under the terms of the ISE Free Eiffel Library
        License (IFELL) at http://eiffel.com/products/base/license.html
    ]"
    information: "[
        Interactive Software Engineering Inc.
        ISE Building, 2nd floor
        270 Storke Road, Goleta, CA 93117 USA
        Telephone 805-685-1006, Fax 805-685-6869
        Electronic mail <info@eiffel.com>%N
        Customer support e-mail <support@eiffel.com>%N
        For latest info see award-winning pages: http://eiffel.com
    ]"

Subclusters
    base.desc
    base.event
    base.kernel
    base.structures
    base.support

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.desc

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.desc	(diagram)

Supercluster
    base

Subclusters
    base.desc.general
    base.desc.spec

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.desc

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


cluster base.desc.general

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.desc.general	(diagram)

Supercluster
    base.desc

Classes
    SHARED_LIBRARY
    SHARED_LIBRARY_CONSTANTS
    SHARED_LIBRARY_ROUTINE

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.desc.general

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


SHARED_LIBRARY Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class
    SHARED_LIBRARY

inherit
    SHARED_LIBRARY_CONSTANTS

feature {NONE} -- Initialization

    make (lib_name: STRING) is
            -- Load shared library lib_name
        require
            non_void: lib_name /= void
            non_empty: not lib_name.is_empty
        deferred
        ensure
            consistent: lib_name.is_equal (library_name)
        end

feature -- Access

    library_name: STRING is
            -- Name of shared library
        deferred
        end

feature -- Status report

    error_code: INTEGER is
            -- Current status of the library
        deferred
        end

    meaningful: BOOLEAN is
            -- Is the library currently loaded?
        do
            Result := error_code = no_error
        end

invariant

    meaningful_definition: meaningful = (error_code = no_error)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SHARED_LIBRARY

General
    cluster: base.desc.general
    description: "Platform independent abstraction of a shared library"

Ancestors
    SHARED_LIBRARY_CONSTANTS

Queries
    error_code: INTEGER
    Library_freed: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER

Constraints
    meaningful definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_CONSTANTS Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Constants used by DESC (Dynamic External Shared Call) mechanism"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    SHARED_LIBRARY_CONSTANTS

feature -- Access

    T_array: INTEGER is 0

    T_boolean: INTEGER is 1

    T_character: INTEGER is 2

    T_double: INTEGER is 3

    T_integer: INTEGER is 4

    T_no_type: INTEGER is 10

    T_pointer: INTEGER is 5

    T_real: INTEGER is 6

    T_reference: INTEGER is 7

    T_short_integer: INTEGER is 8

    T_string: INTEGER is 9

feature -- Status report

    Library_freed: INTEGER is 3

    No_error: INTEGER is 0

    No_library: INTEGER is 1

    No_routine: INTEGER is 2

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_CONSTANTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_CONSTANTS Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SHARED_LIBRARY_CONSTANTS

General
    cluster: base.desc.general
    description: "Constants used by DESC (Dynamic External Shared Call) mechanism"

Ancestors
    ANY

Queries
    Library_freed: INTEGER
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_CONSTANTS Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Constants used by DESC (Dynamic External Shared Call) mechanism"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    SHARED_LIBRARY_CONSTANTS

feature -- Access

    T_array: INTEGER is 0

    T_boolean: INTEGER is 1

    T_character: INTEGER is 2

    T_double: INTEGER is 3

    T_integer: INTEGER is 4

    T_no_type: INTEGER is 10

    T_pointer: INTEGER is 5

    T_real: INTEGER is 6

    T_reference: INTEGER is 7

    T_short_integer: INTEGER is 8

    T_string: INTEGER is 9

feature -- Status report

    Library_freed: INTEGER is 3

    No_error: INTEGER is 0

    No_library: INTEGER is 1

    No_routine: INTEGER is 2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_CONSTANTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_CONSTANTS Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Constants used by DESC (Dynamic External Shared Call) mechanism"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class interface
    SHARED_LIBRARY_CONSTANTS

feature -- Access

    T_array: INTEGER is 0

    T_boolean: INTEGER is 1

    T_character: INTEGER is 2

    T_double: INTEGER is 3

    T_integer: INTEGER is 4

    T_no_type: INTEGER is 10

    T_pointer: INTEGER is 5

    T_real: INTEGER is 6

    T_reference: INTEGER is 7

    T_short_integer: INTEGER is 8

    T_string: INTEGER is 9

feature -- Status report

    Library_freed: INTEGER is 3

    No_error: INTEGER is 0

    No_library: INTEGER is 1

    No_routine: INTEGER is 2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_CONSTANTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_CONSTANTS Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SHARED_LIBRARY_CONSTANTS

Ancestors
    ANY

Descendants
    SHARED_LIBRARY
    SHARED_LIBRARY_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_CONSTANTS Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Constants used by DESC (Dynamic External Shared Call) mechanism"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class interface
    SHARED_LIBRARY_CONSTANTS

feature -- Access

    T_array: INTEGER is 0

    T_boolean: INTEGER is 1

    T_character: INTEGER is 2

    T_double: INTEGER is 3

    T_integer: INTEGER is 4

    T_no_type: INTEGER is 10

    T_pointer: INTEGER is 5

    T_real: INTEGER is 6

    T_reference: INTEGER is 7

    T_short_integer: INTEGER is 8

    T_string: INTEGER is 9

feature -- Status report

    Library_freed: INTEGER is 3

    No_error: INTEGER is 0

    No_library: INTEGER is 1

    No_routine: INTEGER is 2

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_CONSTANTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class
    SHARED_LIBRARY

feature {NONE} -- Initialization

    make (lib_name: STRING) is
            -- Load shared library lib_name
        require
            non_void: lib_name /= void
            non_empty: not lib_name.is_empty
        deferred
        ensure
            consistent: lib_name.is_equal (library_name)
        end

feature -- Access

    library_name: STRING is
            -- Name of shared library
        deferred
        end

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    error_code: INTEGER is
            -- Current status of the library
        deferred
        end

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN is
            -- Is the library currently loaded?
        do
            Result := error_code = no_error
        end

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

invariant

    meaningful_definition: meaningful = (error_code = no_error)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SHARED_LIBRARY

feature -- Access

    library_name: STRING
            -- Name of shared library

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the library currently loaded?

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

invariant

    meaningful_definition: meaningful = (error_code = no_error)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SHARED_LIBRARY

Ancestors
    SHARED_LIBRARY_CONSTANTS

Descendants
    DLL_32

Clients
    SHARED_LIBRARY
    SHARED_LIBRARY_ROUTINE

Suppliers
    BOOLEAN
    SHARED_LIBRARY
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_ROUTINE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library routine"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class
    SHARED_LIBRARY_ROUTINE

inherit
    SHARED_LIBRARY_CONSTANTS

feature -- Initialization

    make_by_name (lib: SHARED_LIBRARY; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER) is
            -- Connect to the routine f_name in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        deferred
        ensure
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called
        end

feature -- Basic operations

    call (args: ARRAY [ANY]) is
            -- Call the routine with actual arguments args
        require
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        deferred
        ensure
            routine_called: routine_called
        end

feature -- Status report

    argument_count: INTEGER is
            -- Number of arguments required
        do
            Result := argument_types.count
        end

    boolean_result: BOOLEAN is
            -- Value when the routine returns a boolean
        require
            routine_called: routine_called
            valid_return_type: return_type = t_boolean
        deferred
        end

    character_result: CHARACTER is
            -- Value when the routine returns a character
        require
            routine_called: routine_called
            valid_return_type: return_type = t_character
        deferred
        end

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN is
            -- Do the actual arguments arguments conform to the signature?
        require
            valid_array: arguments /= void
        local
            i, j, nb: INTEGER
            arg: ANY
            boolean_ref: BOOLEAN_REF
            character_ref: CHARACTER_REF
            double_ref: DOUBLE_REF
            integer_ref: INTEGER_REF
            real_ref: REAL_REF
            pointer_ref: POINTER_REF
            s: STRING
            s1: ARRAY [INTEGER]
            s2: ARRAY [REAL]
            s3: ARRAY [DOUBLE]
            s4: ARRAY [BOOLEAN]
            s5: ARRAY [CHARACTER]
            s6: ARRAY [POINTER]
            s7: ARRAY [ANY]
        do
            from
                Result := arguments.count = argument_count
                i := arguments.lower
                j := argument_types.lower
                nb := arguments.count
            until
                i > nb or not Result
            loop
                arg := arguments @ i
                inspect argument_types @ j
                when t_array then
                    Result := True;
                    s1 ?= arg;
                    if s1 = void then
                        s2 ?= arg;
                        if s2 = void then
                            s3 ?= arg;
                            if s3 = void then
                                s4 ?= arg;
                                if s4 = void then
                                    s5 ?= arg;
                                    if s5 = void then
                                        s6 ?= arg;
                                        if s6 = void then
                                            s7 ?= arg;
                                            if s7 = void then
                                                Result := False
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                when t_boolean then
                    boolean_ref ?= arg;
                    Result := boolean_ref /= void
                when t_character then
                    character_ref ?= arg;
                    Result := character_ref /= void
                when t_double then
                    double_ref ?= arg;
                    Result := double_ref /= void
                when t_integer,t_short_integer then
                    integer_ref ?= arg;
                    Result := integer_ref /= void
                when t_real then
                    real_ref ?= arg;
                    Result := real_ref /= void
                when t_pointer then
                    pointer_ref ?= arg;
                    Result := pointer_ref /= void
                when t_no_type then
                    Result := False
                when t_reference then
                when t_string then
                    create s.make (0);
                    Result := arg.conforms_to (s)
                end
                i := i + 1
                j := j + 1
            end
        end

    double_result: DOUBLE is
            -- Value when the routine returns a double
        require
            routine_called: routine_called
            valid_return_type: return_type = t_double
        deferred
        end

    error_code: INTEGER
            -- Current status of the routine

    integer_result: INTEGER is
            -- Value when the routine returns an integer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer
        deferred
        end

    meaningful: BOOLEAN is
            -- Is the routine currently callable?
        do
            Result := shared_library.meaningful and (error_code = no_error)
        end

    pointer_result: POINTER is
            -- Value when the routine returns a pointer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_pointer
        deferred
        end

    routine_called: BOOLEAN
            -- Has the routine already been called?

    real_result: REAL is
            -- Value when the routine returns a real
        require
            routine_called: routine_called
            valid_return_type: return_type = t_real
        deferred
        end

    reference_result: ANY is
            -- Value when the routine returns a reference
        require
            routine_called: routine_called
            valid_return_type: return_type = t_reference
        deferred
        end

    string_result: STRING is
            -- Value when the routine returns a string
        require
            routine_called: routine_called
            valid_return_type: return_type = t_string
        deferred
        end

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN is
            -- Are all the argument types in args valid?
        local
            i, nb: INTEGER
            arg_type: INTEGER
        do
            from
                Result := True
                i := args.lower
                nb := args.count
            until
                i > nb or else not Result
            loop
                arg_type := args @ i
                Result := arg_type >= 0 and arg_type < t_no_type
                i := i + 1
            end
        end

    valid_return_type (ret_type: INTEGER): BOOLEAN is
            -- Is ret_type valid as a return type?
        do
            Result := (ret_type > t_array) and then (ret_type <= t_no_type)
        end

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments

    function_name: STRING
            -- Name of the routine in the library

    library_name: STRING is
            -- Name of the associated library for the routine
        do
            Result := shared_library.library_name
        end

    return_type: INTEGER
            -- Expected return type

    shared_library: SHARED_LIBRARY
            -- Associated library for the routine

invariant

    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_ROUTINE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SHARED_LIBRARY_ROUTINE

General
    cluster: base.desc.general
    description: "Platform independent abstraction of a shared library routine"

Ancestors
    SHARED_LIBRARY_CONSTANTS

Queries
    argument_count: INTEGER
    argument_types: ARRAY [INTEGER]
    boolean_result: BOOLEAN
    character_result: CHARACTER
    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
    double_result: DOUBLE
    error_code: INTEGER
    function_name: STRING
    integer_result: INTEGER
    Library_freed: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    pointer_result: POINTER
    real_result: REAL
    reference_result: ANY
    return_type: INTEGER
    routine_called: BOOLEAN
    shared_library: SHARED_LIBRARY
    string_result: STRING
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER
    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
    valid_return_type (ret_type: INTEGER): BOOLEAN

Commands
    call (args: ARRAY [ANY])
    make_by_name (lib: SHARED_LIBRARY; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)

Constraints
    library exists
    meaningful only if no error
    meaningful library

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_ROUTINE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library routine"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class
    SHARED_LIBRARY_ROUTINE

feature -- Initialization

    make_by_name (lib: SHARED_LIBRARY; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER) is
            -- Connect to the routine f_name in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        deferred
        ensure
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called
        end

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments

    function_name: STRING
            -- Name of the routine in the library

    library_name: STRING is
            -- Name of the associated library for the routine
        do
            Result := shared_library.library_name
        end

    return_type: INTEGER
            -- Expected return type

    shared_library: SHARED_LIBRARY
            -- Associated library for the routine

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    argument_count: INTEGER is
            -- Number of arguments required
        do
            Result := argument_types.count
        end

    boolean_result: BOOLEAN is
            -- Value when the routine returns a boolean
        require
            routine_called: routine_called
            valid_return_type: return_type = t_boolean
        deferred
        end

    character_result: CHARACTER is
            -- Value when the routine returns a character
        require
            routine_called: routine_called
            valid_return_type: return_type = t_character
        deferred
        end

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN is
            -- Do the actual arguments arguments conform to the signature?
        require
            valid_array: arguments /= void
        local
            i, j, nb: INTEGER
            arg: ANY
            boolean_ref: BOOLEAN_REF
            character_ref: CHARACTER_REF
            double_ref: DOUBLE_REF
            integer_ref: INTEGER_REF
            real_ref: REAL_REF
            pointer_ref: POINTER_REF
            s: STRING
            s1: ARRAY [INTEGER]
            s2: ARRAY [REAL]
            s3: ARRAY [DOUBLE]
            s4: ARRAY [BOOLEAN]
            s5: ARRAY [CHARACTER]
            s6: ARRAY [POINTER]
            s7: ARRAY [ANY]
        do
            from
                Result := arguments.count = argument_count
                i := arguments.lower
                j := argument_types.lower
                nb := arguments.count
            until
                i > nb or not Result
            loop
                arg := arguments @ i
                inspect argument_types @ j
                when t_array then
                    Result := True;
                    s1 ?= arg;
                    if s1 = void then
                        s2 ?= arg;
                        if s2 = void then
                            s3 ?= arg;
                            if s3 = void then
                                s4 ?= arg;
                                if s4 = void then
                                    s5 ?= arg;
                                    if s5 = void then
                                        s6 ?= arg;
                                        if s6 = void then
                                            s7 ?= arg;
                                            if s7 = void then
                                                Result := False
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                when t_boolean then
                    boolean_ref ?= arg;
                    Result := boolean_ref /= void
                when t_character then
                    character_ref ?= arg;
                    Result := character_ref /= void
                when t_double then
                    double_ref ?= arg;
                    Result := double_ref /= void
                when t_integer,t_short_integer then
                    integer_ref ?= arg;
                    Result := integer_ref /= void
                when t_real then
                    real_ref ?= arg;
                    Result := real_ref /= void
                when t_pointer then
                    pointer_ref ?= arg;
                    Result := pointer_ref /= void
                when t_no_type then
                    Result := False
                when t_reference then
                when t_string then
                    create s.make (0);
                    Result := arg.conforms_to (s)
                end
                i := i + 1
                j := j + 1
            end
        end

    double_result: DOUBLE is
            -- Value when the routine returns a double
        require
            routine_called: routine_called
            valid_return_type: return_type = t_double
        deferred
        end

    error_code: INTEGER
            -- Current status of the routine

    integer_result: INTEGER is
            -- Value when the routine returns an integer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer
        deferred
        end

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN is
            -- Is the routine currently callable?
        do
            Result := shared_library.meaningful and (error_code = no_error)
        end

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    pointer_result: POINTER is
            -- Value when the routine returns a pointer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_pointer
        deferred
        end

    real_result: REAL is
            -- Value when the routine returns a real
        require
            routine_called: routine_called
            valid_return_type: return_type = t_real
        deferred
        end

    reference_result: ANY is
            -- Value when the routine returns a reference
        require
            routine_called: routine_called
            valid_return_type: return_type = t_reference
        deferred
        end

    routine_called: BOOLEAN
            -- Has the routine already been called?

    string_result: STRING is
            -- Value when the routine returns a string
        require
            routine_called: routine_called
            valid_return_type: return_type = t_string
        deferred
        end

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN is
            -- Are all the argument types in args valid?
        local
            i, nb: INTEGER
            arg_type: INTEGER
        do
            from
                Result := True
                i := args.lower
                nb := args.count
            until
                i > nb or else not Result
            loop
                arg_type := args @ i
                Result := arg_type >= 0 and arg_type < t_no_type
                i := i + 1
            end
        end

    valid_return_type (ret_type: INTEGER): BOOLEAN is
            -- Is ret_type valid as a return type?
        do
            Result := (ret_type > t_array) and then (ret_type <= t_no_type)
        end

feature -- Basic operations

    call (args: ARRAY [ANY]) is
            -- Call the routine with actual arguments args
        require
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        deferred
        ensure
            routine_called: routine_called
        end

invariant

    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_ROUTINE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library routine"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SHARED_LIBRARY_ROUTINE

feature -- Initialization

    make_by_name (lib: SHARED_LIBRARY; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments

    function_name: STRING
            -- Name of the routine in the library

    library_name: STRING
            -- Name of the associated library for the routine

    return_type: INTEGER
            -- Expected return type

    shared_library: SHARED_LIBRARY
            -- Associated library for the routine

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    argument_count: INTEGER
            -- Number of arguments required

    boolean_result: BOOLEAN
            -- Value when the routine returns a boolean
        require
            routine_called: routine_called
            valid_return_type: return_type = t_boolean

    character_result: CHARACTER
            -- Value when the routine returns a character
        require
            routine_called: routine_called
            valid_return_type: return_type = t_character

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
            -- Do the actual arguments arguments conform to the signature?
        require
            valid_array: arguments /= void

    double_result: DOUBLE
            -- Value when the routine returns a double
        require
            routine_called: routine_called
            valid_return_type: return_type = t_double

    error_code: INTEGER
            -- Current status of the routine

    integer_result: INTEGER
            -- Value when the routine returns an integer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the routine currently callable?

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    pointer_result: POINTER
            -- Value when the routine returns a pointer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_pointer

    real_result: REAL
            -- Value when the routine returns a real
        require
            routine_called: routine_called
            valid_return_type: return_type = t_real

    reference_result: ANY
            -- Value when the routine returns a reference
        require
            routine_called: routine_called
            valid_return_type: return_type = t_reference

    routine_called: BOOLEAN
            -- Has the routine already been called?

    string_result: STRING
            -- Value when the routine returns a string
        require
            routine_called: routine_called
            valid_return_type: return_type = t_string

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
            -- Are all the argument types in args valid?

    valid_return_type (ret_type: INTEGER): BOOLEAN
            -- Is ret_type valid as a return type?

feature -- Basic operations

    call (args: ARRAY [ANY])
            -- Call the routine with actual arguments args
        require
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        ensure
            routine_called: routine_called

invariant

    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_ROUTINE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SHARED_LIBRARY_ROUTINE

Ancestors
    SHARED_LIBRARY_CONSTANTS

Descendants
    DLL_32_ROUTINE

Clients
    SHARED_LIBRARY_ROUTINE

Suppliers
    ANY
    ARRAY [G]
    BOOLEAN
    INTEGER
    SHARED_LIBRARY
    SHARED_LIBRARY_ROUTINE
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY_ROUTINE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library routine"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SHARED_LIBRARY_ROUTINE

feature -- Initialization

    make_by_name (lib: SHARED_LIBRARY; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

feature -- Basic operations

    call (args: ARRAY [ANY])
            -- Call the routine with actual arguments args
        require
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        ensure
            routine_called: routine_called

feature -- Status report

    argument_count: INTEGER
            -- Number of arguments required

    boolean_result: BOOLEAN
            -- Value when the routine returns a boolean
        require
            routine_called: routine_called
            valid_return_type: return_type = t_boolean

    character_result: CHARACTER
            -- Value when the routine returns a character
        require
            routine_called: routine_called
            valid_return_type: return_type = t_character

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
            -- Do the actual arguments arguments conform to the signature?
        require
            valid_array: arguments /= void

    double_result: DOUBLE
            -- Value when the routine returns a double
        require
            routine_called: routine_called
            valid_return_type: return_type = t_double

    error_code: INTEGER
            -- Current status of the routine

    integer_result: INTEGER
            -- Value when the routine returns an integer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer

    meaningful: BOOLEAN
            -- Is the routine currently callable?

    pointer_result: POINTER
            -- Value when the routine returns a pointer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_pointer

    routine_called: BOOLEAN
            -- Has the routine already been called?

    real_result: REAL
            -- Value when the routine returns a real
        require
            routine_called: routine_called
            valid_return_type: return_type = t_real

    reference_result: ANY
            -- Value when the routine returns a reference
        require
            routine_called: routine_called
            valid_return_type: return_type = t_reference

    string_result: STRING
            -- Value when the routine returns a string
        require
            routine_called: routine_called
            valid_return_type: return_type = t_string

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
            -- Are all the argument types in args valid?

    valid_return_type (ret_type: INTEGER): BOOLEAN
            -- Is ret_type valid as a return type?

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments

    function_name: STRING
            -- Name of the routine in the library

    library_name: STRING
            -- Name of the associated library for the routine

    return_type: INTEGER
            -- Expected return type

    shared_library: SHARED_LIBRARY
            -- Associated library for the routine

invariant

    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SHARED_LIBRARY Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Platform independent abstraction of a shared library"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SHARED_LIBRARY

feature -- Access

    library_name: STRING
            -- Name of shared library

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

    meaningful: BOOLEAN
            -- Is the library currently loaded?

invariant

    meaningful_definition: meaningful = (error_code = no_error)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.desc.spec

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.desc.spec	(diagram)

Supercluster
    base.desc

Subclusters
    base.desc.spec.win32

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.desc.spec

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


cluster base.desc.spec.win32

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.desc.spec.win32	(diagram)

Supercluster
    base.desc.spec

Classes
    DLL_32
    DLL_32_ROUTINE

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.desc.spec.win32

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


DLL_32 Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "DLL for Win32"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    DLL_32

inherit
    SHARED_LIBRARY

    MEMORY
        rename
            free as memory_free
        export
            {NONE} all
        redefine
            dispose
        end

create
    make

feature {NONE} -- Initialization

    make (lib_name: STRING) is
            -- Load DLL lib_name
        local
            c_lib_name: ANY
        do
            library_name := lib_name
            c_lib_name := lib_name.to_c
            module_handle := win_load_library ($c_lib_name)
            if module_handle = default_pointer then
                error_code := no_library
            else
                error_code := no_error
            end
        end

feature -- Access

    library_name: STRING
            -- Name of shared library

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

feature -- Removal

    free is
            -- Release the library
        require
            meaningful: meaningful
        do
            win_free_library (module_handle)
            module_handle := default_pointer
            error_code := library_freed
        ensure
            not_meaningful: not meaningful
        end

feature {NONE} -- Removal

    dispose is
            -- Release the library at time of collection if not already done
        do
            if module_handle /= default_pointer then
                win_free_library (module_handle)
            end
        end

feature {DLL_32_ROUTINE} -- Implementation

    module_handle: POINTER
            -- Pointer to the external library

feature {NONE} -- Externals

    win_free_library (p: POINTER) is
            -- Free library
        external
            "C [macro <windows.h>] (HINSTANCE)"
        alias
            "FreeLibrary"
        end

    win_load_library (p: POINTER): POINTER is
            -- Load library
        external
            "C [macro <windows.h>] (LPCTSTR): EIF_POINTER"
        alias
            "LoadLibrary"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32 Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DLL_32

General
    cluster: base.desc.spec.win32
    description: "DLL for Win32"
    create: make

Ancestors
    MEMORY
    SHARED_LIBRARY

Queries
    error_code: INTEGER
    Library_freed: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER

Commands
    free

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32 Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "DLL for Win32"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    DLL_32

create
    make

feature {NONE} -- Initialization

    make (lib_name: STRING) is
            -- Load DLL lib_name
        require -- from SHARED_LIBRARY
            non_void: lib_name /= void
            non_empty: not lib_name.is_empty
        local
            c_lib_name: ANY
        do
            library_name := lib_name
            c_lib_name := lib_name.to_c
            module_handle := win_load_library ($c_lib_name)
            if module_handle = default_pointer then
                error_code := no_library
            else
                error_code := no_error
            end
        ensure -- from SHARED_LIBRARY
            consistent: lib_name.is_equal (library_name)
        end

feature -- Access

    library_name: STRING
            -- Name of shared library

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN is
            -- Is the library currently loaded?
            -- (from SHARED_LIBRARY)
        do
            Result := error_code = no_error
        end

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Removal

    free is
            -- Release the library
        require
            meaningful: meaningful
        do
            win_free_library (module_handle)
            module_handle := default_pointer
            error_code := library_freed
        ensure
            not_meaningful: not meaningful
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    dispose is
            -- Release the library at time of collection if not already done
        do
            if module_handle /= default_pointer then
                win_free_library (module_handle)
            end
        end

    memory_free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature {DLL_32_ROUTINE} -- Implementation

    module_handle: POINTER
            -- Pointer to the external library

feature {NONE} -- Implementation

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

feature {NONE} -- Externals

    win_free_library (p: POINTER) is
            -- Free library
        external
            "C [macro <windows.h>] (HINSTANCE)"
        alias
            "FreeLibrary"
        end

    win_load_library (p: POINTER): POINTER is
            -- Load library
        external
            "C [macro <windows.h>] (LPCTSTR): EIF_POINTER"
        alias
            "LoadLibrary"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from SHARED_LIBRARY
    meaningful_definition: meaningful = (error_code = no_error)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32 Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "DLL for Win32"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class interface
    DLL_32

create

    make (lib_name: STRING)
            -- Load DLL lib_name
        require -- from SHARED_LIBRARY
            non_void: lib_name /= void
            non_empty: not lib_name.is_empty
        ensure -- from SHARED_LIBRARY
            consistent: lib_name.is_equal (library_name)

feature -- Access

    library_name: STRING
            -- Name of shared library

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the library currently loaded?
            -- (from SHARED_LIBRARY)

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Removal

    free
            -- Release the library
        require
            meaningful: meaningful
        ensure
            not_meaningful: not meaningful

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from SHARED_LIBRARY
    meaningful_definition: meaningful = (error_code = no_error)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32 Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DLL_32

Ancestors
    MEMORY
    SHARED_LIBRARY

Clients
    DLL_32
    DLL_32_ROUTINE

Suppliers
    BOOLEAN
    DLL_32
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32_ROUTINE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "32 bit DLL routine for Windows"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    DLL_32_ROUTINE

inherit
    SHARED_LIBRARY_ROUTINE
        redefine
            shared_library
        end

create
    make_by_name,
    make_by_index

feature

    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER) is
            -- Connect to the routine of index r_index in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            valid_index: r_index > 0
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        do
            shared_library := lib
            library_index := r_index
            function_handle := desc_get_function_index_pointer (lib.module_handle, r_index)
            if function_handle /= default_pointer then
                error_code := no_error
            else
                error_code := no_routine
            end
            argument_types := arg_types
            return_type := ret_type
            make_argument_array
            routine_called := False
        ensure
            consistent_index: library_index = r_index
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called
        end

    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER) is
            -- Connect to the routine f_name in library lib
        local
            c_func_name: ANY
        do
            shared_library := lib
            function_name := f_name
            c_func_name := f_name.to_c
            function_handle := win_get_proc_address (lib.module_handle, $c_func_name)
            if function_handle /= default_pointer then
                error_code := no_error
            else
                error_code := no_routine
            end
            argument_types := arg_types
            return_type := ret_type
            make_argument_array
            routine_called := False
        end

feature -- Basic operations

    call (args: ARRAY [ANY]) is
            -- Call the routine with actual arguments args
        local
            formal_args: ANY
            actual_args: ANY
        do
            fill_argument_array (args)
            actual_args := argument_array.area
            formal_args := argument_types.area
            inspect return_type
            when t_boolean then
                imp_boolean_result := desc_call_dll32_boolean (function_handle, arguments_size, $actual_args)
            when t_character then
                imp_character_result := desc_call_dll32_character (function_handle, arguments_size, $actual_args)
            when t_double then
                imp_double_result := desc_call_dll32_double (function_handle, arguments_size, $actual_args)
            when t_integer then
                imp_integer_result := desc_call_dll32_integer (function_handle, arguments_size, $actual_args)
            when t_real then
                imp_real_result := desc_call_dll32_real (function_handle, arguments_size, $actual_args)
            when t_pointer then
                imp_pointer_result := desc_call_dll32_pointer (function_handle, arguments_size, $actual_args)
            when t_reference then
                imp_reference_result := desc_call_dll32_reference (function_handle, arguments_size, $actual_args)
            when t_short_integer then
                imp_integer_result := desc_call_dll32_short_integer (function_handle, arguments_size, $actual_args)
            when t_string then
                imp_string_result := desc_rtms (desc_call_dll32_string (function_handle, arguments_size, $actual_args))
            when t_no_type then
                desc_call_dll32_procedure (function_handle, arguments_size, $actual_args)
            end
            routine_called := True
        end

feature -- Status report

    boolean_result: BOOLEAN is
            -- Value when the routine returns a boolean
        do
            Result := imp_boolean_result
        end

    character_result: CHARACTER is
            -- Value when the routine returns a character
        do
            Result := imp_character_result
        end

    double_result: DOUBLE is
            -- Value when the routine returns a double
        do
            Result := imp_double_result
        end

    integer_result: INTEGER is
            -- Value when the routine returns an integer
        do
            Result := imp_integer_result
        end

    pointer_result: POINTER is
            -- Value when the routine returns a pointer
        do
            Result := imp_pointer_result
        end

    real_result: REAL is
            -- Value when the routine returns a real
        do
            Result := imp_real_result
        end

    reference_result: ANY is
            -- Value when the routine returns a reference
        do
            Result := imp_reference_result
        end

    string_result: STRING is
            -- Value when the routine returns a string
        do
            Result := imp_string_result
        end

feature -- Access

    library_index: INTEGER
            -- Index of the routine in shared_library

    shared_library: DLL_32
            -- Associated library for the routine

feature {NONE} -- Implementation

    argument_array: ARRAY [INTEGER]
            -- Values to be pushed on the C stack

    arguments_size: INTEGER

    fill_argument_array (args: ARRAY [ANY]) is
            -- Fill area for stack pushing operation
        local
            i, j, nb: INTEGER
            area: ANY
            position: INTEGER
            arg_type, arg_size: INTEGER
            b_ref: BOOLEAN_REF
            c_ref: CHARACTER_REF
            d_ref: DOUBLE_REF
            i_ref: INTEGER_REF
            r_ref: REAL_REF
            p_ref: POINTER_REF
            b: BOOLEAN
            c: CHARACTER
            d: DOUBLE
            int: INTEGER
            r: REAL
            p: POINTER
            a: ANY
            s: STRING
            s1: ARRAY [INTEGER]
            s2: ARRAY [REAL]
            s3: ARRAY [DOUBLE]
            s4: ARRAY [BOOLEAN]
            s5: ARRAY [CHARACTER]
            s6: ARRAY [POINTER]
            s7: ARRAY [ANY]
            array_area: ANY
        do
            from
                i := args.lower
                j := argument_types.lower
                nb := argument_count
                area := argument_array.area
            until
                i > nb
            loop
                arg_type := argument_types @ j
                arg_size := desc_get_size (arg_type)
                inspect arg_type
                when t_array then
                    s1 ?= args @ i;
                    if s1 = void then
                        s2 ?= args @ i;
                        if s2 = void then
                            s3 ?= args @ i;
                            if s3 = void then
                                s4 ?= args @ i;
                                if s4 = void then
                                    s5 ?= args @ i;
                                    if s5 = void then
                                        s6 ?= args @ i;
                                        if s6 = void then
                                            s7 ?= args @ i;
                                            array_area := s7.area
                                        else
                                            array_area := s6.area
                                        end
                                    else
                                        array_area := s5.area
                                    end
                                else
                                    array_area := s4.area
                                end
                            else
                                array_area := s3.area
                            end
                        else
                            array_area := s2.area
                        end
                    else
                        array_area := s1.area
                    end;
                    desc_copy_arg ($area, $array_area, position * 4, arg_size)
                when t_boolean then
                    b_ref ?= args @ i;
                    b := b_ref.item;
                    if b then
                        argument_array.put (1, position + 1)
                    else
                        argument_array.put (0, position + 1)
                    end
                when t_character then
                    c_ref ?= args @ i;
                    c := c_ref.item;
                    argument_array.put (c_ref.code, position + 1)
                when t_double then
                    d_ref ?= args @ i;
                    d := d_ref.item;
                    desc_copy_arg ($area, $d, position * 4, arg_size);
                    position := position + 1
                when t_integer,t_short_integer then
                    i_ref ?= args @ i;
                    int := i_ref.item;
                    argument_array.put (int, position + 1)
                when t_real then
                    r_ref ?= args @ i;
                    r := r_ref.item;
                    desc_copy_arg ($area, $r, position * 4, arg_size)
                when t_pointer then
                    p_ref ?= args @ i;
                    p := p_ref.item;
                    desc_copy_arg ($area, p, position * 4, arg_size)
                when t_reference then
                    a := args @ i;
                    desc_copy_arg ($area, $a, position * 4, arg_size)
                when t_string then
                    s ?= args @ i;
                    a := s.to_c;
                    desc_copy_arg ($area, $a, position * 4, arg_size)
                end
                i := i + 1
                j := j + 1
                position := position + 1
            end
        end

    function_handle: POINTER
            -- Pointer to the external routine

    imp_boolean_result: BOOLEAN
            -- Value when the routine returns a boolean

    imp_character_result: CHARACTER
            -- Value when the routine returns a character

    imp_double_result: DOUBLE
            -- Value when the routine returns a double

    imp_integer_result: INTEGER
            -- Value when the routine returns an integer

    imp_pointer_result: POINTER
            -- Value when the routine returns a pointer

    imp_real_result: REAL
            -- Value when the routine returns a real

    imp_reference_result: ANY
            -- Value when the routine returns a reference

    imp_string_result: STRING
            -- Value when the routine returns a string

    make_argument_array is
            -- Allocates area for stack pushing operation
        local
            i, nb: INTEGER
            size: INTEGER
        do
            from
                i := argument_types.lower
                nb := argument_types.upper
            until
                i > nb
            loop
                size := size + desc_get_size (argument_types @ i)
                i := i + 1
            end
            create argument_array.make (1, size // 4)
            arguments_size := size // 4
        end

feature {NONE} -- Externals

    desc_call_dll32_boolean (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): BOOLEAN is
            -- Call to function returning a boolean
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_BOOLEAN"
        end

    desc_call_dll32_character (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): CHARACTER is
            -- Call to function returning a character
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_CHARACTER"
        end

    desc_call_dll32_double (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): DOUBLE is
            -- Call to function returning a double
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_DOUBLE"
        end

    desc_call_dll32_integer (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): INTEGER is
            -- Call to function returning an integer
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_INTEGER"
        end

    desc_call_dll32_pointer (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): POINTER is
            -- Call to function returning a pointer
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_POINTER"
        end

    desc_call_dll32_real (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): REAL is
            -- Call to function returning a real
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_REAL"
        end

    desc_call_dll32_reference (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): ANY is
            -- Call to function returning a reference
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_REFERENCE"
        end

    desc_call_dll32_procedure (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER) is
            -- Call to procedure
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *)"
        end

    desc_call_dll32_short_integer (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): INTEGER is
            -- Call to function returning a short integer
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): short int"
        end

    desc_call_dll32_string (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): POINTER is
            -- Call to function returning a string
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_POINTER"
        end

    desc_copy_arg (target, source: POINTER; offset, size: INTEGER) is
            -- Copy size characters from source
            -- to target + offset
        external
            "C [macro %"eif_desc.h%"]"
        alias
            "DESC_BCOPY"
        end

    desc_get_function_index_pointer (m_p: POINTER; r_index: INTEGER): POINTER is
            -- Get function handle (by index)
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD): EIF_POINTER"
        end

    desc_get_size (type: INTEGER): INTEGER is
            -- Get size of type type
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD): short int"
        end

    desc_rtms (str: POINTER): STRING is
            -- Creates an Eiffel string from a
            -- C manifest string str
        external
            "C [macro %"eif_macros.h%"] (char *): EIF_REFERENCE"
        alias
            "RTMS"
        end

    win_get_proc_address (m_p, fn: POINTER): POINTER is
            -- Get function handle
        external
            "C [macro <windows.h>] (HINSTANCE, LPCSTR): EIF_POINTER"
        alias
            "GetProcAddress"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32_ROUTINE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DLL_32_ROUTINE

General
    cluster: base.desc.spec.win32
    description: "32 bit DLL routine for Windows"
    create: make_by_name, make_by_index

Ancestors
    SHARED_LIBRARY_ROUTINE

Queries
    argument_count: INTEGER
    argument_types: ARRAY [INTEGER]
    boolean_result: BOOLEAN
    character_result: CHARACTER
    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
    double_result: DOUBLE
    error_code: INTEGER
    function_name: STRING
    integer_result: INTEGER
    Library_freed: INTEGER
    library_index: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    pointer_result: POINTER
    real_result: REAL
    reference_result: ANY
    return_type: INTEGER
    routine_called: BOOLEAN
    shared_library: DLL_32
    string_result: STRING
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER
    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
    valid_return_type (ret_type: INTEGER): BOOLEAN

Commands
    call (args: ARRAY [ANY])
    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32_ROUTINE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "32 bit DLL routine for Windows"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    DLL_32_ROUTINE

create
    make_by_name,
    make_by_index

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments
            -- (from SHARED_LIBRARY_ROUTINE)

    function_name: STRING
            -- Name of the routine in the library
            -- (from SHARED_LIBRARY_ROUTINE)

    library_index: INTEGER
            -- Index of the routine in shared_library

    library_name: STRING is
            -- Name of the associated library for the routine
            -- (from SHARED_LIBRARY_ROUTINE)
        do
            Result := shared_library.library_name
        end

    return_type: INTEGER
            -- Expected return type
            -- (from SHARED_LIBRARY_ROUTINE)

    shared_library: DLL_32
            -- Associated library for the routine

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    argument_count: INTEGER is
            -- Number of arguments required
            -- (from SHARED_LIBRARY_ROUTINE)
        do
            Result := argument_types.count
        end

    boolean_result: BOOLEAN is
            -- Value when the routine returns a boolean
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_boolean
        do
            Result := imp_boolean_result
        end

    character_result: CHARACTER is
            -- Value when the routine returns a character
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_character
        do
            Result := imp_character_result
        end

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN is
            -- Do the actual arguments arguments conform to the signature?
            -- (from SHARED_LIBRARY_ROUTINE)
        require -- from SHARED_LIBRARY_ROUTINE
            valid_array: arguments /= void
        local
            i, j, nb: INTEGER
            arg: ANY
            boolean_ref: BOOLEAN_REF
            character_ref: CHARACTER_REF
            double_ref: DOUBLE_REF
            integer_ref: INTEGER_REF
            real_ref: REAL_REF
            pointer_ref: POINTER_REF
            s: STRING
            s1: ARRAY [INTEGER]
            s2: ARRAY [REAL]
            s3: ARRAY [DOUBLE]
            s4: ARRAY [BOOLEAN]
            s5: ARRAY [CHARACTER]
            s6: ARRAY [POINTER]
            s7: ARRAY [ANY]
        do
            from
                Result := arguments.count = argument_count
                i := arguments.lower
                j := argument_types.lower
                nb := arguments.count
            until
                i > nb or not Result
            loop
                arg := arguments @ i
                inspect argument_types @ j
                when t_array then
                    Result := True;
                    s1 ?= arg;
                    if s1 = void then
                        s2 ?= arg;
                        if s2 = void then
                            s3 ?= arg;
                            if s3 = void then
                                s4 ?= arg;
                                if s4 = void then
                                    s5 ?= arg;
                                    if s5 = void then
                                        s6 ?= arg;
                                        if s6 = void then
                                            s7 ?= arg;
                                            if s7 = void then
                                                Result := False
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                when t_boolean then
                    boolean_ref ?= arg;
                    Result := boolean_ref /= void
                when t_character then
                    character_ref ?= arg;
                    Result := character_ref /= void
                when t_double then
                    double_ref ?= arg;
                    Result := double_ref /= void
                when t_integer,t_short_integer then
                    integer_ref ?= arg;
                    Result := integer_ref /= void
                when t_real then
                    real_ref ?= arg;
                    Result := real_ref /= void
                when t_pointer then
                    pointer_ref ?= arg;
                    Result := pointer_ref /= void
                when t_no_type then
                    Result := False
                when t_reference then
                when t_string then
                    create s.make (0);
                    Result := arg.conforms_to (s)
                end
                i := i + 1
                j := j + 1
            end
        end

    double_result: DOUBLE is
            -- Value when the routine returns a double
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_double
        do
            Result := imp_double_result
        end

    error_code: INTEGER
            -- Current status of the routine
            -- (from SHARED_LIBRARY_ROUTINE)

    integer_result: INTEGER is
            -- Value when the routine returns an integer
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer
        do
            Result := imp_integer_result
        end

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN is
            -- Is the routine currently callable?
            -- (from SHARED_LIBRARY_ROUTINE)
        do
            Result := shared_library.meaningful and (error_code = no_error)
        end

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    pointer_result: POINTER is
            -- Value when the routine returns a pointer
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_pointer
        do
            Result := imp_pointer_result
        end

    real_result: REAL is
            -- Value when the routine returns a real
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_real
        do
            Result := imp_real_result
        end

    reference_result: ANY is
            -- Value when the routine returns a reference
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_reference
        do
            Result := imp_reference_result
        end

    routine_called: BOOLEAN
            -- Has the routine already been called?
            -- (from SHARED_LIBRARY_ROUTINE)

    string_result: STRING is
            -- Value when the routine returns a string
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_string
        do
            Result := imp_string_result
        end

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN is
            -- Are all the argument types in args valid?
            -- (from SHARED_LIBRARY_ROUTINE)
        local
            i, nb: INTEGER
            arg_type: INTEGER
        do
            from
                Result := True
                i := args.lower
                nb := args.count
            until
                i > nb or else not Result
            loop
                arg_type := args @ i
                Result := arg_type >= 0 and arg_type < t_no_type
                i := i + 1
            end
        end

    valid_return_type (ret_type: INTEGER): BOOLEAN is
            -- Is ret_type valid as a return type?
            -- (from SHARED_LIBRARY_ROUTINE)
        do
            Result := (ret_type > t_array) and then (ret_type <= t_no_type)
        end

feature -- Basic operations

    call (args: ARRAY [ANY]) is
            -- Call the routine with actual arguments args
        require -- from SHARED_LIBRARY_ROUTINE
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        local
            formal_args: ANY
            actual_args: ANY
        do
            fill_argument_array (args)
            actual_args := argument_array.area
            formal_args := argument_types.area
            inspect return_type
            when t_boolean then
                imp_boolean_result := desc_call_dll32_boolean (function_handle, arguments_size, $actual_args)
            when t_character then
                imp_character_result := desc_call_dll32_character (function_handle, arguments_size, $actual_args)
            when t_double then
                imp_double_result := desc_call_dll32_double (function_handle, arguments_size, $actual_args)
            when t_integer then
                imp_integer_result := desc_call_dll32_integer (function_handle, arguments_size, $actual_args)
            when t_real then
                imp_real_result := desc_call_dll32_real (function_handle, arguments_size, $actual_args)
            when t_pointer then
                imp_pointer_result := desc_call_dll32_pointer (function_handle, arguments_size, $actual_args)
            when t_reference then
                imp_reference_result := desc_call_dll32_reference (function_handle, arguments_size, $actual_args)
            when t_short_integer then
                imp_integer_result := desc_call_dll32_short_integer (function_handle, arguments_size, $actual_args)
            when t_string then
                imp_string_result := desc_rtms (desc_call_dll32_string (function_handle, arguments_size, $actual_args))
            when t_no_type then
                desc_call_dll32_procedure (function_handle, arguments_size, $actual_args)
            end
            routine_called := True
        ensure -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
        end

feature {NONE} -- Implementation

    argument_array: ARRAY [INTEGER]
            -- Values to be pushed on the C stack

    arguments_size: INTEGER

    fill_argument_array (args: ARRAY [ANY]) is
            -- Fill area for stack pushing operation
        local
            i, j, nb: INTEGER
            area: ANY
            position: INTEGER
            arg_type, arg_size: INTEGER
            b_ref: BOOLEAN_REF
            c_ref: CHARACTER_REF
            d_ref: DOUBLE_REF
            i_ref: INTEGER_REF
            r_ref: REAL_REF
            p_ref: POINTER_REF
            b: BOOLEAN
            c: CHARACTER
            d: DOUBLE
            int: INTEGER
            r: REAL
            p: POINTER
            a: ANY
            s: STRING
            s1: ARRAY [INTEGER]
            s2: ARRAY [REAL]
            s3: ARRAY [DOUBLE]
            s4: ARRAY [BOOLEAN]
            s5: ARRAY [CHARACTER]
            s6: ARRAY [POINTER]
            s7: ARRAY [ANY]
            array_area: ANY
        do
            from
                i := args.lower
                j := argument_types.lower
                nb := argument_count
                area := argument_array.area
            until
                i > nb
            loop
                arg_type := argument_types @ j
                arg_size := desc_get_size (arg_type)
                inspect arg_type
                when t_array then
                    s1 ?= args @ i;
                    if s1 = void then
                        s2 ?= args @ i;
                        if s2 = void then
                            s3 ?= args @ i;
                            if s3 = void then
                                s4 ?= args @ i;
                                if s4 = void then
                                    s5 ?= args @ i;
                                    if s5 = void then
                                        s6 ?= args @ i;
                                        if s6 = void then
                                            s7 ?= args @ i;
                                            array_area := s7.area
                                        else
                                            array_area := s6.area
                                        end
                                    else
                                        array_area := s5.area
                                    end
                                else
                                    array_area := s4.area
                                end
                            else
                                array_area := s3.area
                            end
                        else
                            array_area := s2.area
                        end
                    else
                        array_area := s1.area
                    end;
                    desc_copy_arg ($area, $array_area, position * 4, arg_size)
                when t_boolean then
                    b_ref ?= args @ i;
                    b := b_ref.item;
                    if b then
                        argument_array.put (1, position + 1)
                    else
                        argument_array.put (0, position + 1)
                    end
                when t_character then
                    c_ref ?= args @ i;
                    c := c_ref.item;
                    argument_array.put (c_ref.code, position + 1)
                when t_double then
                    d_ref ?= args @ i;
                    d := d_ref.item;
                    desc_copy_arg ($area, $d, position * 4, arg_size);
                    position := position + 1
                when t_integer,t_short_integer then
                    i_ref ?= args @ i;
                    int := i_ref.item;
                    argument_array.put (int, position + 1)
                when t_real then
                    r_ref ?= args @ i;
                    r := r_ref.item;
                    desc_copy_arg ($area, $r, position * 4, arg_size)
                when t_pointer then
                    p_ref ?= args @ i;
                    p := p_ref.item;
                    desc_copy_arg ($area, p, position * 4, arg_size)
                when t_reference then
                    a := args @ i;
                    desc_copy_arg ($area, $a, position * 4, arg_size)
                when t_string then
                    s ?= args @ i;
                    a := s.to_c;
                    desc_copy_arg ($area, $a, position * 4, arg_size)
                end
                i := i + 1
                j := j + 1
                position := position + 1
            end
        end

    function_handle: POINTER
            -- Pointer to the external routine

    imp_boolean_result: BOOLEAN
            -- Value when the routine returns a boolean

    imp_character_result: CHARACTER
            -- Value when the routine returns a character

    imp_double_result: DOUBLE
            -- Value when the routine returns a double

    imp_integer_result: INTEGER
            -- Value when the routine returns an integer

    imp_pointer_result: POINTER
            -- Value when the routine returns a pointer

    imp_real_result: REAL
            -- Value when the routine returns a real

    imp_reference_result: ANY
            -- Value when the routine returns a reference

    imp_string_result: STRING
            -- Value when the routine returns a string

    make_argument_array is
            -- Allocates area for stack pushing operation
        local
            i, nb: INTEGER
            size: INTEGER
        do
            from
                i := argument_types.lower
                nb := argument_types.upper
            until
                i > nb
            loop
                size := size + desc_get_size (argument_types @ i)
                i := i + 1
            end
            create argument_array.make (1, size // 4)
            arguments_size := size // 4
        end

feature

    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER) is
            -- Connect to the routine of index r_index in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            valid_index: r_index > 0
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        do
            shared_library := lib
            library_index := r_index
            function_handle := desc_get_function_index_pointer (lib.module_handle, r_index)
            if function_handle /= default_pointer then
                error_code := no_error
            else
                error_code := no_routine
            end
            argument_types := arg_types
            return_type := ret_type
            make_argument_array
            routine_called := False
        ensure
            consistent_index: library_index = r_index
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called
        end

    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER) is
            -- Connect to the routine f_name in library lib
        require -- from SHARED_LIBRARY_ROUTINE
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        local
            c_func_name: ANY
        do
            shared_library := lib
            function_name := f_name
            c_func_name := f_name.to_c
            function_handle := win_get_proc_address (lib.module_handle, $c_func_name)
            if function_handle /= default_pointer then
                error_code := no_error
            else
                error_code := no_routine
            end
            argument_types := arg_types
            return_type := ret_type
            make_argument_array
            routine_called := False
        ensure -- from SHARED_LIBRARY_ROUTINE
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called
        end

feature {NONE} -- Externals

    desc_call_dll32_boolean (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): BOOLEAN is
            -- Call to function returning a boolean
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_BOOLEAN"
        end

    desc_call_dll32_character (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): CHARACTER is
            -- Call to function returning a character
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_CHARACTER"
        end

    desc_call_dll32_double (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): DOUBLE is
            -- Call to function returning a double
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_DOUBLE"
        end

    desc_call_dll32_integer (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): INTEGER is
            -- Call to function returning an integer
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_INTEGER"
        end

    desc_call_dll32_pointer (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): POINTER is
            -- Call to function returning a pointer
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_POINTER"
        end

    desc_call_dll32_procedure (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER) is
            -- Call to procedure
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *)"
        end

    desc_call_dll32_real (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): REAL is
            -- Call to function returning a real
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_REAL"
        end

    desc_call_dll32_reference (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): ANY is
            -- Call to function returning a reference
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_REFERENCE"
        end

    desc_call_dll32_short_integer (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): INTEGER is
            -- Call to function returning a short integer
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): short int"
        end

    desc_call_dll32_string (f_ptr: POINTER; arg_count: INTEGER; actual_args: POINTER): POINTER is
            -- Call to function returning a string
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD, char *): EIF_POINTER"
        end

    desc_copy_arg (target, source: POINTER; offset, size: INTEGER) is
            -- Copy size characters from source
            -- to target + offset
        external
            "C [macro %"eif_desc.h%"]"
        alias
            "DESC_BCOPY"
        end

    desc_get_function_index_pointer (m_p: POINTER; r_index: INTEGER): POINTER is
            -- Get function handle (by index)
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD, DWORD): EIF_POINTER"
        end

    desc_get_size (type: INTEGER): INTEGER is
            -- Get size of type type
        external
            "C [dll32 %"ise_desc.dll%"] (DWORD): short int"
        end

    desc_rtms (str: POINTER): STRING is
            -- Creates an Eiffel string from a
            -- C manifest string str
        external
            "C [macro %"eif_macros.h%"] (char *): EIF_REFERENCE"
        alias
            "RTMS"
        end

    win_get_proc_address (m_p, fn: POINTER): POINTER is
            -- Get function handle
        external
            "C [macro <windows.h>] (HINSTANCE, LPCSTR): EIF_POINTER"
        alias
            "GetProcAddress"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from SHARED_LIBRARY_ROUTINE
    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32_ROUTINE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "32 bit DLL routine for Windows"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class interface
    DLL_32_ROUTINE

create

    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib
        require -- from SHARED_LIBRARY_ROUTINE
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure -- from SHARED_LIBRARY_ROUTINE
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine of index r_index in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            valid_index: r_index > 0
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_index: library_index = r_index
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments
            -- (from SHARED_LIBRARY_ROUTINE)

    function_name: STRING
            -- Name of the routine in the library
            -- (from SHARED_LIBRARY_ROUTINE)

    library_index: INTEGER
            -- Index of the routine in shared_library

    library_name: STRING
            -- Name of the associated library for the routine
            -- (from SHARED_LIBRARY_ROUTINE)

    return_type: INTEGER
            -- Expected return type
            -- (from SHARED_LIBRARY_ROUTINE)

    shared_library: DLL_32
            -- Associated library for the routine

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    argument_count: INTEGER
            -- Number of arguments required
            -- (from SHARED_LIBRARY_ROUTINE)

    boolean_result: BOOLEAN
            -- Value when the routine returns a boolean
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_boolean

    character_result: CHARACTER
            -- Value when the routine returns a character
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_character

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
            -- Do the actual arguments arguments conform to the signature?
            -- (from SHARED_LIBRARY_ROUTINE)
        require -- from SHARED_LIBRARY_ROUTINE
            valid_array: arguments /= void

    double_result: DOUBLE
            -- Value when the routine returns a double
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_double

    error_code: INTEGER
            -- Current status of the routine
            -- (from SHARED_LIBRARY_ROUTINE)

    integer_result: INTEGER
            -- Value when the routine returns an integer
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the routine currently callable?
            -- (from SHARED_LIBRARY_ROUTINE)

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    pointer_result: POINTER
            -- Value when the routine returns a pointer
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_pointer

    real_result: REAL
            -- Value when the routine returns a real
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_real

    reference_result: ANY
            -- Value when the routine returns a reference
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_reference

    routine_called: BOOLEAN
            -- Has the routine already been called?
            -- (from SHARED_LIBRARY_ROUTINE)

    string_result: STRING
            -- Value when the routine returns a string
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_string

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
            -- Are all the argument types in args valid?
            -- (from SHARED_LIBRARY_ROUTINE)

    valid_return_type (ret_type: INTEGER): BOOLEAN
            -- Is ret_type valid as a return type?
            -- (from SHARED_LIBRARY_ROUTINE)

feature -- Basic operations

    call (args: ARRAY [ANY])
            -- Call the routine with actual arguments args
        require -- from SHARED_LIBRARY_ROUTINE
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        ensure -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called

feature

    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine of index r_index in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            valid_index: r_index > 0
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_index: library_index = r_index
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib
        require -- from SHARED_LIBRARY_ROUTINE
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure -- from SHARED_LIBRARY_ROUTINE
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from SHARED_LIBRARY_ROUTINE
    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32_ROUTINE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DLL_32_ROUTINE

Ancestors
    SHARED_LIBRARY_ROUTINE

Clients
    DLL_32_ROUTINE

Suppliers
    ARRAY [G]
    BOOLEAN
    BOOLEAN_REF
    CHARACTER_REF
    DLL_32
    DLL_32_ROUTINE
    DOUBLE_REF
    INTEGER
    INTEGER_REF
    POINTER_REF
    REAL_REF
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32_ROUTINE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "32 bit DLL routine for Windows"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class interface
    DLL_32_ROUTINE

create
    make_by_name,
    make_by_index

feature

    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine of index r_index in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            valid_index: r_index > 0
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_index: library_index = r_index
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib

feature -- Basic operations

    call (args: ARRAY [ANY])
            -- Call the routine with actual arguments args

feature -- Status report

    boolean_result: BOOLEAN
            -- Value when the routine returns a boolean

    character_result: CHARACTER
            -- Value when the routine returns a character

    double_result: DOUBLE
            -- Value when the routine returns a double

    integer_result: INTEGER
            -- Value when the routine returns an integer

    pointer_result: POINTER
            -- Value when the routine returns a pointer

    real_result: REAL
            -- Value when the routine returns a real

    reference_result: ANY
            -- Value when the routine returns a reference

    string_result: STRING
            -- Value when the routine returns a string

feature -- Access

    library_index: INTEGER
            -- Index of the routine in shared_library

    shared_library: DLL_32
            -- Associated library for the routine

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32_ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DLL_32 Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "DLL for Win32"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class interface
    DLL_32

create
    make

feature -- Access

    library_name: STRING
            -- Name of shared library

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

feature -- Removal

    free
            -- Release the library
        require
            meaningful: meaningful
        ensure
            not_meaningful: not meaningful

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


cluster base.event

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.event	(diagram)

Supercluster
    base

Classes
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ACTIVE_INTEGER_INTERVAL
    ACTIVE_LIST [G]
    INTERACTIVE_LIST [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTION_SEQUENCE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "A sequence of actions to be performed on `call'"
    instructions: "[
        Use features inherited from LIST to add/remove actions.
        An action is a procedure of ANY class that takes EVENT_DATA.
        When `call' is called the actions in the list will be executed
        in order stating at `first'.
        An action may call `abort' which will cause `call' to stop executing
        actions in the sequence. (Until the next call to `call').
        Descendants may redefine `initialize' to arrange for `call' to
        be called by an event source.
        Use `block', `pause', `flush' and `resume' to change the behavior
        of `call'.
        eg.
         birthday_data: TUPLE [INTEGER, STRING] -- (age, name)
         birthday_actions: ACTIONS_SEQUENCE [like birthday_data]
         create birthday_actions.make ("birthday", <<"age","name">>)
         send_card (age: INTEGER, name, from: STRING) is ...
         buy_gift (age: INTEGER, name, gift, from: STRING) is ...
         birthday_actions.extend (~send_card (?, ?, "Sam")
         birthday_actions.extend (~buy_gift (?, ?, "Wine", "Sam")
         birthday_actions.call ([35, "Julia"])
         causes call to: send_card (35, "Julia", "Sam")
                         buy_gift (35, "Julia", "Wine", "Sam")
    ]"
    status: "See notice at end of class"
    keywords: "event, action"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

inherit
    LINKED_LIST [PROCEDURE [ANY, EVENT_DATA]]
        rename
            make as linked_list_make
        redefine
            new_cell,
            merge_left,
            merge_right,
            cleanup_after_remove,
            wipe_out,
            default_create
        end

create
    default_create,
    make

feature {NONE} -- Initialization

    make is
        obsolete "use default_create"
        do
            default_create
        end

    default_create is
            -- Begin in Normal_state.
        do
            linked_list_make
            create is_aborted_stack.make
            create call_buffer.make
            state := normal_state
            create not_empty_actions.make
            create empty_actions.make
        end

feature -- Basic operations

    call (event_data: EVENT_DATA) is
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
        local
            snapshot: LINKED_LIST [PROCEDURE [ANY, EVENT_DATA]]
        do
            create snapshot.make
            snapshot.fill (Current)
            if kamikazes /= void then
                call_action_list (kamikazes)
                kamikazes := void
            end
            inspect state
            when normal_state then
                from
                    is_aborted_stack.extend (False)
                    snapshot.start
                variant
                    snapshot.count + 1 - snapshot.index
                until
                    snapshot.after or is_aborted_stack.item
                loop
                    snapshot.item.call (event_data)
                    snapshot.forth
                end;
                is_aborted_stack.remove
            when paused_state then
                call_buffer.extend (event_data)
            when blocked_state then
            end
        ensure
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)
        end

feature -- Access

    name: STRING is
            -- Textual description.
        do
            Result := clone (name_internal)
        ensure
            equal_to_name_internal: Result.is_equal (name_internal)
        end

    dummy_event_data: EVENT_DATA is
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
        do
            if dummy_event_data_internal = void then
                create dummy_event_data_internal.make
            end
            Result := dummy_event_data_internal
        end

    event_data_names: ARRAY [STRING] is
            -- Textual description of each event datum.
        do
            Result := deep_clone (event_data_names_internal)
        ensure
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)
        end

feature -- Status setting

    abort is
            -- Abort the current call.
            -- (The current item.call will be completed.)
        require
            call_is_underway: call_is_underway
        do
            is_aborted_stack.replace (True)
        ensure
            is_aborted_set: is_aborted_stack.item
        end

    block is
            -- Ignore subsequent calls.
        do
            state := blocked_state
        ensure
            blocked_state: state = blocked_state
        end

    pause is
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
        do
            state := paused_state
        ensure
            paused_state: state = paused_state
        end

    resume is
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
        do
            state := normal_state
            from
            until
                call_buffer.is_empty
            loop
                call (call_buffer.item)
                call_buffer.remove
            end
        ensure
            normal_state: state = normal_state
        end

    flush is
            -- Discard any buffered calls.
        do
            call_buffer.wipe_out
        ensure
            call_buffer_empty: call_buffer.is_empty
        end

feature -- Status report

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state

    Normal_state: INTEGER is 1

    Paused_state: INTEGER is 2

    Blocked_state: INTEGER is 3

    call_is_underway: BOOLEAN is
            -- Is call currently being executed?
        do
            Result := not is_aborted_stack.is_empty
        ensure
            Result = not is_aborted_stack.is_empty
        end

feature -- Element Change

    prune_when_called (an_action: like item) is
            -- Remove an_action after the next time it is called.
        require
            has (an_action)
        do
            if kamikazes = void then
                create kamikazes.make
            end
            kamikazes.extend (agent prune_all (an_action))
        end

    merge_left (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
        do
            if count = 0 then
                Precursor  (other)
                if count > 0 then
                    call_action_list (not_empty_actions)
                end
            else
                Precursor  (other)
            end
        end

    merge_right (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
        do
            if count = 0 then
                Precursor  (other)
                if count > 0 then
                    call_action_list (not_empty_actions)
                end
            else
                Precursor  (other)
            end
        end

    wipe_out is
            -- Remove all items.
        do
            Precursor
            call_action_list (empty_actions)
        end

    set_source_connection_agent (a_source_connection_agent: PROCEDURE [ANY, TUPLE]) is
        obsolete "use not_empty_actions"
            -- Set a_source_connection_agent that will connect sequence to an
            -- actual event source. The agent will be called when the first action is
            -- added to the sequence. If there are already actions in the
            -- sequence the agent is called immediately.
        do
            not_empty_actions.extend (a_source_connection_agent)
            if not is_empty then
                a_source_connection_agent.call ([])
            end
        end

feature -- Event handling

    not_empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.

    empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.

feature {LINKED_LIST} -- Implementation

    new_cell (v: like item): like first_element is
            -- Create new cell with v.
        do
            if count = 0 then
                Result := Precursor  (v)
                call_action_list (not_empty_actions)
            else
                Result := Precursor  (v)
            end
        end

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
        do
            Precursor  (v)
            if count = 0 then
                call_action_list (empty_actions)
            end
        end

feature {NONE} -- Implementation

    call_action_list (actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]) is
            -- Call each action in actions.
        require
            actions_not_void: actions /= void
        local
            snapshot: like actions
        do
            create snapshot.make
            snapshot.fill (actions)
            from
                snapshot.start
            until
                snapshot.after
            loop
                snapshot.item.call ([])
                snapshot.forth
            end
        end

    source_connection_agent: PROCEDURE [ANY, TUPLE]

    is_aborted_stack: LINKED_STACK [BOOLEAN]
            -- item holds abort status of
            -- innermost of possibly recursive calls.

    call_buffer: LINKED_QUEUE [EVENT_DATA]
            -- Holds calls made while is_paused
            -- to be executed on resume.

    name_internal: STRING
            -- See name.

    event_data_names_internal: ARRAY [STRING]
            -- See event_data_names.

    dummy_event_data_internal: EVENT_DATA
            -- See dummy_event_data.

    kamikazes: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Used by prune_when_called.

invariant

    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTION_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTION_SEQUENCE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

General
    cluster: base.event
    description: "A sequence of actions to be performed on `call'"
    keywords: "event, action"
    create: make, default_create

Ancestors
    LINKED_LIST [G]

Action sequences
    duplicate (n: INTEGER): [like Current] ACTION_SEQUENCE [EVENT_DATA]

Queries
    infix "@" (i: INTEGER): [like item] PROCEDURE [ANY, EVENT_DATA]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: EVENT_DATA
    empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] PROCEDURE [ANY, EVENT_DATA]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
    i_th (i: INTEGER): [like item] PROCEDURE [ANY, EVENT_DATA]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, EVENT_DATA]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ACTION_SEQUENCE [EVENT_DATA]): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: PROCEDURE [ANY, EVENT_DATA]
    last: [like item] PROCEDURE [ANY, EVENT_DATA]
    linear_representation: LINEAR [PROCEDURE [ANY, EVENT_DATA]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, EVENT_DATA]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, EVENT_DATA]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, EVENT_DATA]])
    back
    block
    call (event_data: EVENT_DATA)
    compare_objects
    compare_references
    copy (other: [like Current] ACTION_SEQUENCE [EVENT_DATA])
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    fill (other: CONTAINER [PROCEDURE [ANY, EVENT_DATA]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    linked_list_make
    merge_left (other: [like Current] ACTION_SEQUENCE [EVENT_DATA])
    merge_right (other: [like Current] ACTION_SEQUENCE [EVENT_DATA])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    prune_all (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, EVENT_DATA])
    put (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_front (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_i_th (v: [like item] PROCEDURE [ANY, EVENT_DATA]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_right (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    remove
    remove_left
    remove_right
    replace (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    resume
    search (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    is aborted stack not void
    call buffer not void
    not has void
    valid state
    call buffer consistent
    not empty actions not void
    empty actions not void

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTION_SEQUENCE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "A sequence of actions to be performed on `call'"
    instructions: "[
        Use features inherited from LIST to add/remove actions.
        An action is a procedure of ANY class that takes EVENT_DATA.
        When `call' is called the actions in the list will be executed
        in order stating at `first'.
        An action may call `abort' which will cause `call' to stop executing
        actions in the sequence. (Until the next call to `call').
        Descendants may redefine `initialize' to arrange for `call' to
        be called by an event source.
        Use `block', `pause', `flush' and `resume' to change the behavior
        of `call'.
        eg.
         birthday_data: TUPLE [INTEGER, STRING] -- (age, name)
         birthday_actions: ACTIONS_SEQUENCE [like birthday_data]
         create birthday_actions.make ("birthday", <<"age","name">>)
         send_card (age: INTEGER, name, from: STRING) is ...
         buy_gift (age: INTEGER, name, gift, from: STRING) is ...
         birthday_actions.extend (~send_card (?, ?, "Sam")
         birthday_actions.extend (~buy_gift (?, ?, "Wine", "Sam")
         birthday_actions.call ([35, "Julia"])
         causes call to: send_card (35, "Julia", "Sam")
                         buy_gift (35, "Julia", "Wine", "Sam")
    ]"
    status: "See notice at end of class"
    keywords: "event, action"
    date: "$Date: 2001/07/15 05:36:25 $"
    revision: "$Revision: 1.2 $"

class
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

create
    default_create,
    make

feature {NONE} -- Initialization

    default_create is
            -- Begin in Normal_state.
        do
            linked_list_make
            create is_aborted_stack.make
            create call_buffer.make
            state := normal_state
            create not_empty_actions.make
            create empty_actions.make
        end

    make is
        obsolete "use default_create"
        do
            default_create
        end

feature -- Initialization

    linked_list_make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [PROCEDURE [ANY, EVENT_DATA]]} Result.make (active, after, before)
        end

    dummy_event_data: EVENT_DATA is
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
        do
            if dummy_event_data_internal = void then
                create dummy_event_data_internal.make
            end
            Result := dummy_event_data_internal
        end

    event_data_names: ARRAY [STRING] is
            -- Textual description of each event datum.
        do
            Result := deep_clone (event_data_names_internal)
        ensure
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [PROCEDURE [ANY, EVENT_DATA]]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: PROCEDURE [ANY, EVENT_DATA] is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    name: STRING is
            -- Textual description.
        do
            Result := clone (name_internal)
        ensure
            equal_to_name_internal: Result.is_equal (name_internal)
        end

    sequential_occurrences (v: PROCEDURE [ANY, EVENT_DATA]): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    Blocked_state: INTEGER is 3

    call_is_underway: BOOLEAN is
            -- Is call currently being executed?
        do
            Result := not is_aborted_stack.is_empty
        ensure
            Result = not is_aborted_stack.is_empty
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)
        do
            check
                put_constraint: (v /= last_element.item) implies not off
            end
            Result := (v = last_element.item) or else (v = item)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    Normal_state: INTEGER is 1

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    Paused_state: INTEGER is 2

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [PROCEDURE [ANY, EVENT_DATA]]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    abort is
            -- Abort the current call.
            -- (The current item.call will be completed.)
        require
            call_is_underway: call_is_underway
        do
            is_aborted_stack.replace (True)
        ensure
            is_aborted_set: is_aborted_stack.item
        end

    block is
            -- Ignore subsequent calls.
        do
            state := blocked_state
        ensure
            blocked_state: state = blocked_state
        end

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

    flush is
            -- Discard any buffered calls.
        do
            call_buffer.wipe_out
        ensure
            call_buffer_empty: call_buffer.is_empty
        end

    pause is
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
        do
            state := paused_state
        ensure
            paused_state: state = paused_state
        end

    resume is
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
        do
            state := normal_state
            from
            until
                call_buffer.is_empty
            loop
                call (call_buffer.item)
                call_buffer.remove
            end
        ensure
            normal_state: state = normal_state
        end

feature -- Cursor movement

    back is
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [PROCEDURE [ANY, EVENT_DATA]]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, EVENT_DATA]]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            extendible: extendible
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                active := p
            else
                last_element.put_right (p)
                if after then
                    active := p
                end
            end
            count := count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [PROCEDURE [ANY, EVENT_DATA]]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [PROCEDURE [ANY, EVENT_DATA]]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                p := new_cell (active.item)
                p.put_right (active.right)
                active.put (v)
                active.put_right (p)
                active := p
                count := count + 1
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            removed, succ: like first_element
        do
            removed := active
            if isfirst then
                first_element := first_element.right
                active.forget_right
                active := first_element
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                end
            elseif islast then
                active := previous;
                if active /= void then
                    active.forget_right
                end;
                after := True
            else
                succ := active.right
                previous.put_right (succ)
                active.forget_right
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            move (- 2)
            remove_right
            forth
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        local
            removed, succ: like first_element
        do
            if before then
                removed := first_element
                first_element := first_element.right
                active.forget_right
                active := first_element
            else
                succ := active.right
                removed := succ
                active.put_right (succ.right)
                succ.forget_right
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

feature {NONE} -- Removal

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, EVENT_DATA]] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [PROCEDURE [ANY, EVENT_DATA]]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.linked_list_make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature -- Basic operations

    call (event_data: EVENT_DATA) is
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
        local
            snapshot: LINKED_LIST [PROCEDURE [ANY, EVENT_DATA]]
        do
            create snapshot.make
            snapshot.fill (Current)
            if kamikazes /= void then
                call_action_list (kamikazes)
                kamikazes := void
            end
            inspect state
            when normal_state then
                from
                    is_aborted_stack.extend (False)
                    snapshot.start
                variant
                    snapshot.count + 1 - snapshot.index
                until
                    snapshot.after or is_aborted_stack.item
                loop
                    snapshot.item.call (event_data)
                    snapshot.forth
                end;
                is_aborted_stack.remove
            when paused_state then
                call_buffer.extend (event_data)
            when blocked_state then
            end
        ensure
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)
        end

feature {NONE} -- Inapplicable

    bag_put (v: PROCEDURE [ANY, EVENT_DATA]) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {LINKED_LIST} -- Implementation

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
            Precursor  (v)
            if count = 0 then
                call_action_list (empty_actions)
            end
        end

    new_cell (v: like item): like first_element is
            -- Create new cell with v.
        do
            if count = 0 then
                Result := Precursor  (v)
                call_action_list (not_empty_actions)
            else
                Result := Precursor  (v)
            end
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

feature {NONE} -- Implementation

    call_action_list (actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]) is
            -- Call each action in actions.
        require
            actions_not_void: actions /= void
        local
            snapshot: like actions
        do
            create snapshot.make
            snapshot.fill (actions)
            from
                snapshot.start
            until
                snapshot.after
            loop
                snapshot.item.call ([])
                snapshot.forth
            end
        end

    call_buffer: LINKED_QUEUE [EVENT_DATA]
            -- Holds calls made while is_paused
            -- to be executed on resume.

    dummy_event_data_internal: EVENT_DATA
            -- See dummy_event_data.

    event_data_names_internal: ARRAY [STRING]
            -- See event_data_names.

    is_aborted_stack: LINKED_STACK [BOOLEAN]
            -- item holds abort status of
            -- innermost of possibly recursive calls.

    kamikazes: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Used by prune_when_called.

    name_internal: STRING
            -- See name.

    source_connection_agent: PROCEDURE [ANY, TUPLE]

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    first_element: LINKABLE [PROCEDURE [ANY, EVENT_DATA]]
            -- Head of list
            -- (from LINKED_LIST)

    last_element: like first_element is
            -- Tail of list
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result.linked_list_make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

feature -- Element Change

    merge_left (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            if count = 0 then
                Precursor  (other)
                if count > 0 then
                    call_action_list (not_empty_actions)
                end
            else
                Precursor  (other)
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if count = 0 then
                Precursor  (other)
                if count > 0 then
                    call_action_list (not_empty_actions)
                end
            else
                Precursor  (other)
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    prune_when_called (an_action: like item) is
            -- Remove an_action after the next time it is called.
        require
            has (an_action)
        do
            if kamikazes = void then
                create kamikazes.make
            end
            kamikazes.extend (agent prune_all (an_action))
        end

    set_source_connection_agent (a_source_connection_agent: PROCEDURE [ANY, TUPLE]) is
        obsolete "use not_empty_actions"
            -- Set a_source_connection_agent that will connect sequence to an
            -- actual event source. The agent will be called when the first action is
            -- added to the sequence. If there are already actions in the
            -- sequence the agent is called immediately.
        do
            not_empty_actions.extend (a_source_connection_agent)
            if not is_empty then
                a_source_connection_agent.call ([])
            end
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            Precursor
            call_action_list (empty_actions)
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature -- Event handling

    empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.

    not_empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [PROCEDURE [ANY, EVENT_DATA]]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [PROCEDURE [ANY, EVENT_DATA]]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [PROCEDURE [ANY, EVENT_DATA]]
            c: CURSOR
            t: TUPLE [PROCEDURE [ANY, EVENT_DATA]]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [PROCEDURE [ANY, EVENT_DATA]]
            c: CURSOR
            t: TUPLE [PROCEDURE [ANY, EVENT_DATA]]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTION_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTION_SEQUENCE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "A sequence of actions to be performed on `call'"
    instructions: "[
        Use features inherited from LIST to add/remove actions.
        An action is a procedure of ANY class that takes EVENT_DATA.
        When `call' is called the actions in the list will be executed
        in order stating at `first'.
        An action may call `abort' which will cause `call' to stop executing
        actions in the sequence. (Until the next call to `call').
        Descendants may redefine `initialize' to arrange for `call' to
        be called by an event source.
        Use `block', `pause', `flush' and `resume' to change the behavior
        of `call'.
        eg.
         birthday_data: TUPLE [INTEGER, STRING] -- (age, name)
         birthday_actions: ACTIONS_SEQUENCE [like birthday_data]
         create birthday_actions.make ("birthday", <<"age","name">>)
         send_card (age: INTEGER, name, from: STRING) is ...
         buy_gift (age: INTEGER, name, gift, from: STRING) is ...
         birthday_actions.extend (~send_card (?, ?, "Sam")
         birthday_actions.extend (~buy_gift (?, ?, "Wine", "Sam")
         birthday_actions.call ([35, "Julia"])
         causes call to: send_card (35, "Julia", "Sam")
                         buy_gift (35, "Julia", "Wine", "Sam")
    ]"
    status: "See notice at end of class"
    keywords: "event, action"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

create

    default_create
            -- Begin in Normal_state.

    make

feature -- Initialization

    linked_list_make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    dummy_event_data: EVENT_DATA
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
        ensure
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: PROCEDURE [ANY, EVENT_DATA]
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
        ensure
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, EVENT_DATA]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    Blocked_state: INTEGER is 3

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
        ensure
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    Paused_state: INTEGER is 2

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
        require
            call_is_underway: call_is_underway
        ensure
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
        ensure
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
        ensure
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
        ensure
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
        ensure
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, EVENT_DATA]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [PROCEDURE [ANY, EVENT_DATA]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, EVENT_DATA]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: EVENT_DATA)
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
        ensure
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
        require
            has (an_action)

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Event handling

    empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.

    not_empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTION_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTION_SEQUENCE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Ancestors
    LINKED_LIST [G]

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ACTIVE_INTEGER_INTERVAL
    ACTIVE_LIST [G]

Suppliers
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    BOOLEAN
    INTEGER
    LINKED_LIST [G]
    LINKED_QUEUE [G]
    LINKED_STACK [G]
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    STRING
    TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTION_SEQUENCE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "A sequence of actions to be performed on `call'"
    instructions: "[
        Use features inherited from LIST to add/remove actions.
        An action is a procedure of ANY class that takes EVENT_DATA.
        When `call' is called the actions in the list will be executed
        in order stating at `first'.
        An action may call `abort' which will cause `call' to stop executing
        actions in the sequence. (Until the next call to `call').
        Descendants may redefine `initialize' to arrange for `call' to
        be called by an event source.
        Use `block', `pause', `flush' and `resume' to change the behavior
        of `call'.
        eg.
         birthday_data: TUPLE [INTEGER, STRING] -- (age, name)
         birthday_actions: ACTIONS_SEQUENCE [like birthday_data]
         create birthday_actions.make ("birthday", <<"age","name">>)
         send_card (age: INTEGER, name, from: STRING) is ...
         buy_gift (age: INTEGER, name, gift, from: STRING) is ...
         birthday_actions.extend (~send_card (?, ?, "Sam")
         birthday_actions.extend (~buy_gift (?, ?, "Wine", "Sam")
         birthday_actions.call ([35, "Julia"])
         causes call to: send_card (35, "Julia", "Sam")
                         buy_gift (35, "Julia", "Wine", "Sam")
    ]"
    status: "See notice at end of class"
    keywords: "event, action"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

create
    default_create,
    make

feature -- Basic operations

    call (event_data: EVENT_DATA)
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
        ensure
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Access

    name: STRING
            -- Textual description.
        ensure
            equal_to_name_internal: Result.is_equal (name_internal)

    dummy_event_data: EVENT_DATA
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
        ensure
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
        require
            call_is_underway: call_is_underway
        ensure
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
        ensure
            blocked_state: state = blocked_state

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
        ensure
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
        ensure
            normal_state: state = normal_state

    flush
            -- Discard any buffered calls.
        ensure
            call_buffer_empty: call_buffer.is_empty

feature -- Status report

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state

    Normal_state: INTEGER is 1

    Paused_state: INTEGER is 2

    Blocked_state: INTEGER is 3

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
        ensure
            Result = not is_aborted_stack.is_empty

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
        require
            has (an_action)

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other

    wipe_out
            -- Remove all items.

feature -- Event handling

    not_empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.

    empty_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.

invariant

    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTION_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_INTEGER_INTERVAL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Contiguous integer interval that calls an action sequence
        when it changes.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ACTIVE_INTEGER_INTERVAL

inherit
    INTEGER_INTERVAL
        redefine
            extend,
            put,
            resize,
            resize_exactly,
            copy,
            adapt
        end

create
    make

feature -- Initialization

    adapt (other: INTEGER_INTERVAL) is
            -- Reset to be the same interval as other.
        do
            Precursor {INTEGER_INTERVAL}  (other)
            on_change
        end

feature -- Element change

    extend (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
        do
            Precursor {INTEGER_INTERVAL}  (v)
            on_change
        end

    put (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
        do
            Precursor {INTEGER_INTERVAL}  (v)
            on_change
        end

feature -- Resizing

    resize (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.
        do
            Precursor {INTEGER_INTERVAL}  (min_index, max_index)
            on_change
        end

    resize_exactly (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from
            -- min_index to max_index.
        do
            Precursor {INTEGER_INTERVAL}  (min_index, max_index)
            on_change
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reset to be the same interval as other.
        do
            Precursor {INTEGER_INTERVAL}  (other)
            on_change
        end

feature -- Event handling

    change_actions: ACTION_SEQUENCE [TUPLE] is
            -- Actions performed when interval changes.
        do
            if opo_change_actions = void then
                create opo_change_actions
            end
            Result := opo_change_actions
        ensure
            not_void: Result /= void
        end

feature {NONE} -- Implementation

    on_change is
            -- Called when interval changes.
        do
            if opo_change_actions /= void then
                opo_change_actions.call (void)
            end
        end

    opo_change_actions: ACTION_SEQUENCE [TUPLE]
            -- Once per object implementation for change_actions

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_INTEGER_INTERVAL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ACTIVE_INTEGER_INTERVAL

General
    cluster: base.event
    description:
        "Contiguous integer interval that calls an action sequence
        when it changes."
    keywords: "event, action, linked, list"
    create: make

Ancestors
    INTEGER_INTERVAL

Action sequences
    change_actions: ACTION_SEQUENCE [TUPLE]

Queries
    infix "@" (i: INTEGER): INTEGER
    additional_space: INTEGER
    all_cleared: BOOLEAN
    as_array: ARRAY [INTEGER]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    extendible: BOOLEAN
    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: INTEGER): BOOLEAN
    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ACTIVE_INTEGER_INTERVAL): BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item (i: INTEGER): INTEGER
    linear_representation: LINEAR [INTEGER]
    lower: INTEGER
    lower_defined: BOOLEAN
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    subinterval (start_pos, end_pos: INTEGER): [like Current] ACTIVE_INTEGER_INTERVAL
    to_c: ANY
    upper: INTEGER
    upper_defined: BOOLEAN
    valid_index (v: INTEGER): BOOLEAN

Commands
    adapt (other: INTEGER_INTERVAL)
    automatic_grow
    compare_objects
    compare_references
    copy (other: [like Current] ACTIVE_INTEGER_INTERVAL)
    extend (v: INTEGER)
    fill (other: CONTAINER [INTEGER])
    grow (i: INTEGER)
    prune_all (v: INTEGER)
    put (v: INTEGER)
    resize (min_index, max_index: INTEGER)
    resize_exactly (min_index, max_index: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_INTEGER_INTERVAL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Contiguous integer interval that calls an action sequence
        when it changes.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ACTIVE_INTEGER_INTERVAL

create
    make

feature -- Initialization

    adapt (other: INTEGER_INTERVAL) is
            -- Reset to be the same interval as other.
        require -- from INTEGER_INTERVAL
            other_not_void: other /= void
        do
            Precursor {INTEGER_INTERVAL}  (other)
            on_change
        ensure -- from INTEGER_INTERVAL
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined
        end

feature {NONE} -- Initialization

    make (min_index, max_index: INTEGER) is
            -- Set up interval to have bounds min_index and
            -- max_index (empty if min_index > max_index)
            -- (from INTEGER_INTERVAL)
        do
            lower_defined := True
            upper_defined := True
            if min_index <= max_index then
                lower_internal := min_index
                upper_internal := max_index
            else
                lower_internal := 1
                upper_internal := 0
            end
        ensure -- from INTEGER_INTERVAL
            lower_defined: lower_defined
            upper_defined: upper_defined
            set_if_non_empty: (min_index <= max_index) implies ((lower = min_index) and (upper = max_index))
            empty_if_not_in_order: (min_index > max_index) implies is_empty
        end

feature -- Access

    has (v: INTEGER): BOOLEAN is
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
            -- (from INTEGER_INTERVAL)
        do
            Result := (upper_defined implies v <= upper) and (lower_defined implies v >= lower)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then -- from INTEGER_INTERVAL
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))
        end

    item (i: INTEGER): INTEGER is
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.
            -- (from INTEGER_INTERVAL)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := i
        end

    lower: INTEGER is
            -- Smallest value in interval
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            lower_defined: lower_defined
        do
            Result := lower_internal
        end

    lower_defined: BOOLEAN
            -- Is there a lower bound?
            -- (from INTEGER_INTERVAL)

    upper: INTEGER is
            -- Largest value in interval
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            upper_defined: upper_defined
        do
            Result := upper_internal
        end

    upper_defined: BOOLEAN
            -- Is there an upper bound?
            -- (from INTEGER_INTERVAL)

    valid_index (v: INTEGER): BOOLEAN is
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
            -- (from INTEGER_INTERVAL)
        do
            Result := (upper_defined implies v <= upper) and (lower_defined implies v >= lower)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from INTEGER_INTERVAL
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))
        end

    infix "@" (i: INTEGER): INTEGER is
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.
            -- (from INTEGER_INTERVAL)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := i
        end

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Maximum number of items in interval
            -- (here the same thing as count)
            -- (from INTEGER_INTERVAL)
        do
            check
                terminal: upper_defined and lower_defined
            end
            Result := count
        end

    count: INTEGER is
            -- Number of items in interval
            -- (from INTEGER_INTERVAL)
        do
            check
                finite: upper_defined and lower_defined
            end
            if upper_defined and lower_defined then
                Result := upper - lower + 1
            end
        ensure then -- from INTEGER_INTERVAL
            definition: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (here: the interval itself)
            -- (from INTEGER_INTERVAL)
        do
            Result := Current
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from INTEGER_INTERVAL
            index_set_is_range: equal (Result, Current)
        end

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: INTEGER): INTEGER is
            -- Number of times v appears in structure
            -- (from INTEGER_INTERVAL)
        do
            if has (v) then
                Result := 1
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        ensure then -- from INTEGER_INTERVAL
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
            -- (from INTEGER_INTERVAL)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := (lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper))
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from INTEGER_INTERVAL
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))
        end

feature -- Status report

    all_cleared: BOOLEAN is
            -- Are all items set to default values?
            -- (from INTEGER_INTERVAL)
        do
            Result := ((lower = 0) and (upper = 0))
        ensure then -- from INTEGER_INTERVAL
            iff_at_zero: Result = ((lower = 0) and (upper = 0))
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- Answer: yes
            -- (from INTEGER_INTERVAL)
        do
            Result := True
        end

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: INTEGER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May individual items be removed?
            -- Answer: no
            -- (from INTEGER_INTERVAL)
        do
            Result := False
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
        require -- from COLLECTION
            extendible: extendible
        do
            Precursor {INTEGER_INTERVAL}  (v)
            on_change
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from INTEGER_INTERVAL
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)
        end

    fill (other: CONTAINER [INTEGER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [INTEGER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
        require -- from  INTEGER_INTERVAL
            True
        require -- from COLLECTION
            extendible: extendible
        do
            Precursor {INTEGER_INTERVAL}  (v)
            on_change
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from INTEGER_INTERVAL
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune_all (v: INTEGER) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from INTEGER_INTERVAL)
        require -- from COLLECTION
            prunable
        do
            lower_defined := True
            upper_defined := True
            lower_internal := 1
            upper_internal := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Ensure that capacity is at least i.
            -- (from INTEGER_INTERVAL)
        do
            if capacity < i then
                resize (lower, lower + i - 1)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        ensure then -- from INTEGER_INTERVAL
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.
        do
            Precursor {INTEGER_INTERVAL}  (min_index, max_index)
            on_change
        end

    resize_exactly (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from
            -- min_index to max_index.
        do
            Precursor {INTEGER_INTERVAL}  (min_index, max_index)
            on_change
        end

feature -- Conversion

    as_array: ARRAY [INTEGER] is
            -- Plain array containing interval's items
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            create Result.make (lower, upper)
            from
                i := lower
            until
                i > upper
            loop
                Result.put (i, i)
                i := i + 1
            end
        ensure -- from INTEGER_INTERVAL
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper
        end

    linear_representation: LINEAR [INTEGER] is
            -- Representation as a linear structure
            -- (from INTEGER_INTERVAL)
        do
            check
                terminal: upper_defined and lower_defined
            end
            Result := as_array.linear_representation
        end

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        do
            Result := as_array.to_c
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reset to be the same interval as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            Precursor {INTEGER_INTERVAL}  (other)
            on_change
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from INTEGER_INTERVAL
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined
        end

    subinterval (start_pos, end_pos: INTEGER): like Current is
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from INTEGER_INTERVAL)
        do
            create Result.make (start_pos, end_pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: INTEGER) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    indexable_put (v: INTEGER; k: INTEGER) is
            -- Associate value v with key k.
            -- Not applicable here.
            -- (from INTEGER_INTERVAL)
        require -- from TABLE
            valid_key: valid_index (k)
        do
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    prune (v: INTEGER) is
            -- Remove one occurrence of v if any.
            -- Not applicable here.
            -- (from INTEGER_INTERVAL)
        require -- from COLLECTION
            prunable: prunable
        do
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

feature {NONE} -- Implementation

    on_change is
            -- Called when interval changes.
        do
            if opo_change_actions /= void then
                opo_change_actions.call (void)
            end
        end

    opo_change_actions: ACTION_SEQUENCE [TUPLE]
            -- Once per object implementation for change_actions

feature {INTEGER_INTERVAL} -- Implementation

    lower_internal: INTEGER
            -- See `lower`.
            -- (from INTEGER_INTERVAL)

    upper_internal: INTEGER
            -- See `upper`.
            -- (from INTEGER_INTERVAL)

feature -- Event handling

    change_actions: ACTION_SEQUENCE [TUPLE] is
            -- Actions performed when interval changes.
        do
            if opo_change_actions = void then
                create opo_change_actions
            end
            Result := opo_change_actions
        ensure
            not_void: Result /= void
        end

feature -- Iteration

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Does at least one of  interval's values
            -- satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                i := lower
            until
                i > upper or else condition.item ([i])
            loop
                i := i + 1
            end
            Result := (i <= upper)
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) > 0)
        end

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Does exactly one of  interval's values
            -- satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        do
            Result := (hold_count (condition) = 1)
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) = 1)
        end

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Do all interval's values satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                Result := True
                i := lower
            until
                (i > upper) or else (not condition.item ([i]))
            loop
                i := i + 1
            end
            Result := (i > upper)
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) = count)
        end

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER is
            -- Number of  interval's values that
            -- satisfy condition
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                i := lower
            until
                i > upper
            loop
                if condition.item ([i]) then
                    Result := Result + 1
                end
                i := i + 1
            end
        ensure -- from INTEGER_INTERVAL
            non_negative: Result >= 0
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_INTERVAL
    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_INTEGER_INTERVAL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Contiguous integer interval that calls an action sequence
        when it changes.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ACTIVE_INTEGER_INTERVAL

create

    make (min_index, max_index: INTEGER)
            -- Set up interval to have bounds min_index and
            -- max_index (empty if min_index > max_index)
            -- (from INTEGER_INTERVAL)
        ensure -- from INTEGER_INTERVAL
            lower_defined: lower_defined
            upper_defined: upper_defined
            set_if_non_empty: (min_index <= max_index) implies ((lower = min_index) and (upper = max_index))
            empty_if_not_in_order: (min_index > max_index) implies is_empty

feature -- Initialization

    adapt (other: INTEGER_INTERVAL)
            -- Reset to be the same interval as other.
        require -- from INTEGER_INTERVAL
            other_not_void: other /= void
        ensure -- from INTEGER_INTERVAL
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

feature -- Access

    has (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
            -- (from INTEGER_INTERVAL)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then -- from INTEGER_INTERVAL
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    item (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.
            -- (from INTEGER_INTERVAL)
        require -- from TABLE
            valid_key: valid_index (k)

    lower: INTEGER
            -- Smallest value in interval
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            lower_defined: lower_defined

    lower_defined: BOOLEAN
            -- Is there a lower bound?
            -- (from INTEGER_INTERVAL)

    upper: INTEGER
            -- Largest value in interval
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            upper_defined: upper_defined

    upper_defined: BOOLEAN
            -- Is there an upper bound?
            -- (from INTEGER_INTERVAL)

    valid_index (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
            -- (from INTEGER_INTERVAL)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from INTEGER_INTERVAL
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    infix "@" (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.
            -- (from INTEGER_INTERVAL)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Maximum number of items in interval
            -- (here the same thing as count)
            -- (from INTEGER_INTERVAL)

    count: INTEGER
            -- Number of items in interval
            -- (from INTEGER_INTERVAL)
        ensure then -- from INTEGER_INTERVAL
            definition: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (here: the interval itself)
            -- (from INTEGER_INTERVAL)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from INTEGER_INTERVAL
            index_set_is_range: equal (Result, Current)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears in structure
            -- (from INTEGER_INTERVAL)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        ensure then -- from INTEGER_INTERVAL
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from INTEGER_INTERVAL)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from INTEGER_INTERVAL
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))

feature -- Status report

    all_cleared: BOOLEAN
            -- Are all items set to default values?
            -- (from INTEGER_INTERVAL)
        ensure then -- from INTEGER_INTERVAL
            iff_at_zero: Result = ((lower = 0) and (upper = 0))

    extendible: BOOLEAN
            -- May new items be added?
            -- Answer: yes
            -- (from INTEGER_INTERVAL)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May individual items be removed?
            -- Answer: no
            -- (from INTEGER_INTERVAL)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from INTEGER_INTERVAL
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

    fill (other: CONTAINER [INTEGER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
        require -- from  INTEGER_INTERVAL
            True
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from INTEGER_INTERVAL
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune_all (v: INTEGER)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from INTEGER_INTERVAL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
            -- (from INTEGER_INTERVAL)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        ensure then -- from INTEGER_INTERVAL
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper

    resize (min_index, max_index: INTEGER)
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.

    resize_exactly (min_index, max_index: INTEGER)
            -- Rearrange interval to go from
            -- min_index to max_index.

feature -- Conversion

    as_array: ARRAY [INTEGER]
            -- Plain array containing interval's items
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper

    linear_representation: LINEAR [INTEGER]
            -- Representation as a linear structure
            -- (from INTEGER_INTERVAL)

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined

feature -- Duplication

    copy (other: like Current)
            -- Reset to be the same interval as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from INTEGER_INTERVAL
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

    subinterval (start_pos, end_pos: INTEGER): like Current
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from INTEGER_INTERVAL)

feature -- Event handling

    change_actions: ACTION_SEQUENCE [TUPLE]
            -- Actions performed when interval changes.
        ensure
            not_void: Result /= void

feature -- Iteration

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does at least one of  interval's values
            -- satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) > 0)

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does exactly one of  interval's values
            -- satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) = 1)

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Do all interval's values satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) = count)

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
            -- Number of  interval's values that
            -- satisfy condition
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            non_negative: Result >= 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_INTERVAL
    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_INTEGER_INTERVAL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ACTIVE_INTEGER_INTERVAL

Ancestors
    INTEGER_INTERVAL

Clients
    ACTIVE_INTEGER_INTERVAL

Suppliers
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ACTIVE_INTEGER_INTERVAL
    INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_INTEGER_INTERVAL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Contiguous integer interval that calls an action sequence
        when it changes.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ACTIVE_INTEGER_INTERVAL

create
    make

feature -- Initialization

    adapt (other: INTEGER_INTERVAL)
            -- Reset to be the same interval as other.

feature -- Element change

    extend (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).

    put (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).

feature -- Resizing

    resize (min_index, max_index: INTEGER)
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.

    resize_exactly (min_index, max_index: INTEGER)
            -- Rearrange interval to go from
            -- min_index to max_index.

feature -- Duplication

    copy (other: like Current)
            -- Reset to be the same interval as other.

feature -- Event handling

    change_actions: ACTION_SEQUENCE [TUPLE]
            -- Actions performed when interval changes.
        ensure
            not_void: Result /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call an action
        sequence when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ACTIVE_LIST [G]

inherit
    INTERACTIVE_LIST [G]
        redefine
            default_create,
            on_item_added,
            on_item_removed
        end

create
    default_create

feature {NONE} -- Initialization

    default_create is
            -- Initialize
        do
            Precursor {INTERACTIVE_LIST}
            create add_actions
            create remove_actions
        end

feature -- Access

    add_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been added.

    remove_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been removed.

feature -- Miscellaneous

    on_item_added (an_item: G) is
            -- an_item has just been added.
        do
            add_actions.call ([an_item])
        end

    on_item_removed (an_item: G) is
            -- an_item has just been removed.
        do
            remove_actions.call ([an_item])
        end

invariant

    add_actions_not_void: add_actions /= void
    remove_actions_not_void: remove_actions /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ACTIVE_LIST [G]

General
    cluster: base.event
    description:
        "Sequential, one-way linked lists that call an action
        sequence when an item is removed or added."
    keywords: "event, action, linked, list"
    create: default_create

Ancestors
    INTERACTIVE_LIST [G]

Action sequences
    add_actions: ACTION_SEQUENCE [TUPLE [G]]
    remove_actions: ACTION_SEQUENCE [TUPLE [G]]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] ACTIVE_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ACTIVE_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] ACTIVE_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] ACTIVE_LIST [G])
    merge_right (other: [like Current] ACTIVE_LIST [G])
    move (i: INTEGER)
    on_item_added (an_item: G)
    on_item_removed (an_item: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    add actions not void
    remove actions not void

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call an action
        sequence when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ACTIVE_LIST [G]

create
    default_create

feature {NONE} -- Initialization

    default_create is
            -- Initialize
        do
            Precursor {INTERACTIVE_LIST}
            create add_actions
            create remove_actions
        end

feature -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    add_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been added.

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    remove_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been removed.

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)
        do
            check
                put_constraint: (v /= last_element.item) implies not off
            end
            Result := (v = last_element.item) or else (v = item)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            move (- 2)
            remove_right
            forth
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    wipe_out is
            -- Remove all items.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            prunable
        local
            l: like Current
        do
            l := standard_clone (Current)
            Precursor {LINKED_LIST}
            from
                l.start
            until
                l.after
            loop
                consistency_count := consistency_count - 1
                on_item_removed (l.item)
                l.forth
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature -- Miscellaneous

    on_item_added (an_item: G) is
            -- an_item has just been added.
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void
        do
            add_actions.call ([an_item])
        end

    on_item_removed (an_item: G) is
            -- an_item has just been removed.
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void
        do
            remove_actions.call ([an_item])
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {LINKED_LIST} -- Implementation

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from INTERACTIVE_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
            consistency_count := consistency_count - 1
        end

    new_cell (v: like item): like first_element is
            -- Create new cell with v.
            -- (from INTERACTIVE_LIST)
        do
            consistency_count := consistency_count + 1
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

feature {NONE} -- Implementation

    add_all (other: like Current) is
            -- Call on_item_added for all elements in other.
            -- (from INTERACTIVE_LIST)
        local
            cur: CURSOR
        do
            cur := other.cursor
            from
                other.start
            until
                other.after
            loop
                consistency_count := consistency_count + 1
                added_item (other.item)
                other.forth
            end
            other.go_to (cur)
        end

    added_item (an_item: G) is
            -- an_item is has been added.
            -- (from INTERACTIVE_LIST)
        do
            if not in_operation then
                on_item_added (an_item)
            end
        end

    in_operation: BOOLEAN
            -- Are we executing an operation from LINKED_LIST?
            -- (from INTERACTIVE_LIST)

    remove_all (other: like Current) is
            -- Call on_item_removed for all elements in other.
            -- (from INTERACTIVE_LIST)
        do
            from
                other.start
            until
                other.after
            loop
                consistency_count := consistency_count - 1
                removed_item (other.item)
                other.forth
            end
        end

    removed_item (an_item: G) is
            -- an_item has been removed.
            -- (from INTERACTIVE_LIST)
        do
            if not in_operation then
                on_item_removed (an_item)
            end
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    first_element: LINKABLE [G]
            -- Head of list
            -- (from LINKED_LIST)

    last_element: like first_element is
            -- Tail of list
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

feature {NONE} -- Contract support

    consistency_count: INTEGER
            -- Number of items in the list.
            -- (from INTERACTIVE_LIST)

feature -- Element Change

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            extendible: extendible
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    merge_left (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            in_operation := True
            Precursor {LINKED_LIST}  (other)
            in_operation := False
            add_all (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            in_operation := True
            Precursor {LINKED_LIST}  (other)
            in_operation := False
            add_all (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            active_item: like item
        do
            active_item := active.item
            in_operation := True
            Precursor {LINKED_LIST}
            in_operation := False
            removed_item (active_item)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        local
            item_removed: like item
        do
            if before then
                item_removed := first_element.item
            else
                item_removed := active.right.item
            end
            in_operation := True
            Precursor {LINKED_LIST}
            in_operation := False
            removed_item (item_removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            writable: writable
        local
            active_item: like item
        do
            active_item := active.item
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            removed_item (active_item)
            added_item (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    add_actions_not_void: add_actions /= void
    remove_actions_not_void: remove_actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTERACTIVE_LIST
    consistency_count_equal_to_count: consistency_count = count
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call an action
        sequence when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ACTIVE_LIST [G]

create

    default_create
            -- Initialize

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    add_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been added.

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    remove_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been removed.

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Miscellaneous

    on_item_added (an_item: G)
            -- an_item has just been added.
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void

    on_item_removed (an_item: G)
            -- an_item has just been removed.
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void

feature -- Element Change

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    add_actions_not_void: add_actions /= void
    remove_actions_not_void: remove_actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTERACTIVE_LIST
    consistency_count_equal_to_count: consistency_count = count
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ACTIVE_LIST [G]

Ancestors
    INTERACTIVE_LIST [G]

Clients
    ACTIVE_LIST [G]

Suppliers
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ACTIVE_LIST [G]
    INTERACTIVE_LIST [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call an action
        sequence when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ACTIVE_LIST [G]

create
    default_create

feature -- Access

    add_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been added.

    remove_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been removed.

feature -- Miscellaneous

    on_item_added (an_item: G)
            -- an_item has just been added.

    on_item_removed (an_item: G)
            -- an_item has just been removed.

invariant

    add_actions_not_void: add_actions /= void
    remove_actions_not_void: remove_actions /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.event

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


INTERACTIVE_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call add/remove features
        when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class
    INTERACTIVE_LIST [G]

inherit
    LINKED_LIST [G]
        redefine
            default_create,
            new_cell,
            cleanup_after_remove,
            merge_left,
            merge_right,
            wipe_out,
            put_front,
            put_left,
            put_right,
            remove_right,
            replace,
            remove,
            extend
        end

feature {NONE} -- Initialization

    default_create is
            -- Initialize linked list.
        do
            make
        end

feature -- Miscellaneous

    on_item_added (an_item: G) is
            -- an_item has just been added.
        require
            an_item_not_void: an_item /= void
        do
        end

    on_item_removed (an_item: G) is
            -- an_item has been removed.
        require
            an_item_not_void: an_item /= void
        do
        end

feature -- Element Change

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        end

    replace (v: like item) is
            -- Replace current item by v.
        local
            active_item: like item
        do
            active_item := active.item
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            removed_item (active_item)
            added_item (v)
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        local
            active_item: like item
        do
            active_item := active.item
            in_operation := True
            Precursor {LINKED_LIST}
            in_operation := False
            removed_item (active_item)
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        local
            item_removed: like item
        do
            if before then
                item_removed := first_element.item
            else
                item_removed := active.right.item
            end
            in_operation := True
            Precursor {LINKED_LIST}
            in_operation := False
            removed_item (item_removed)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
        do
            in_operation := True
            Precursor {LINKED_LIST}  (other)
            in_operation := False
            add_all (other)
        end

    merge_right (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
        do
            in_operation := True
            Precursor {LINKED_LIST}  (other)
            in_operation := False
            add_all (other)
        end

feature -- Removal

    wipe_out is
            -- Remove all items.
        local
            l: like Current
        do
            l := standard_clone (Current)
            Precursor {LINKED_LIST}
            from
                l.start
            until
                l.after
            loop
                consistency_count := consistency_count - 1
                on_item_removed (l.item)
                l.forth
            end
        end

feature {LINKED_LIST} -- Implementation

    new_cell (v: like item): like first_element is
            -- Create new cell with v.
        do
            consistency_count := consistency_count + 1
            create Result
            Result.put (v)
        end

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
        do
            consistency_count := consistency_count - 1
        end

feature {NONE} -- Implementation

    add_all (other: like Current) is
            -- Call on_item_added for all elements in other.
        local
            cur: CURSOR
        do
            cur := other.cursor
            from
                other.start
            until
                other.after
            loop
                consistency_count := consistency_count + 1
                added_item (other.item)
                other.forth
            end
            other.go_to (cur)
        end

    remove_all (other: like Current) is
            -- Call on_item_removed for all elements in other.
        do
            from
                other.start
            until
                other.after
            loop
                consistency_count := consistency_count - 1
                removed_item (other.item)
                other.forth
            end
        end

feature {NONE} -- Implementation

    added_item (an_item: G) is
            -- an_item is has been added.
        do
            if not in_operation then
                on_item_added (an_item)
            end
        end

    removed_item (an_item: G) is
            -- an_item has been removed.
        do
            if not in_operation then
                on_item_removed (an_item)
            end
        end

    in_operation: BOOLEAN
            -- Are we executing an operation from LINKED_LIST?

feature {NONE} -- Contract support

    consistency_count: INTEGER
            -- Number of items in the list.

invariant

    consistency_count_equal_to_count: consistency_count = count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERACTIVE_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    INTERACTIVE_LIST [G]

General
    cluster: base.event
    description:
        "Sequential, one-way linked lists that call add/remove features
        when an item is removed or added."
    keywords: "event, linked, list"

Ancestors
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] INTERACTIVE_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] INTERACTIVE_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] INTERACTIVE_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] INTERACTIVE_LIST [G])
    merge_right (other: [like Current] INTERACTIVE_LIST [G])
    move (i: INTEGER)
    on_item_added (an_item: G)
    on_item_removed (an_item: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    consistency count equal to count

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERACTIVE_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call add/remove features
        when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class
    INTERACTIVE_LIST [G]

feature {NONE} -- Initialization

    default_create is
            -- Initialize linked list.
        do
            make
        end

feature -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)
        do
            check
                put_constraint: (v /= last_element.item) implies not off
            end
            Result := (v = last_element.item) or else (v = item)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            move (- 2)
            remove_right
            forth
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        local
            l: like Current
        do
            l := standard_clone (Current)
            Precursor {LINKED_LIST}
            from
                l.start
            until
                l.after
            loop
                consistency_count := consistency_count - 1
                on_item_removed (l.item)
                l.forth
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature -- Miscellaneous

    on_item_added (an_item: G) is
            -- an_item has just been added.
        require
            an_item_not_void: an_item /= void
        do
        end

    on_item_removed (an_item: G) is
            -- an_item has been removed.
        require
            an_item_not_void: an_item /= void
        do
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {LINKED_LIST} -- Implementation

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
            consistency_count := consistency_count - 1
        end

    new_cell (v: like item): like first_element is
            -- Create new cell with v.
        do
            consistency_count := consistency_count + 1
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

feature {NONE} -- Implementation

    add_all (other: like Current) is
            -- Call on_item_added for all elements in other.
        local
            cur: CURSOR
        do
            cur := other.cursor
            from
                other.start
            until
                other.after
            loop
                consistency_count := consistency_count + 1
                added_item (other.item)
                other.forth
            end
            other.go_to (cur)
        end

    added_item (an_item: G) is
            -- an_item is has been added.
        do
            if not in_operation then
                on_item_added (an_item)
            end
        end

    in_operation: BOOLEAN
            -- Are we executing an operation from LINKED_LIST?

    remove_all (other: like Current) is
            -- Call on_item_removed for all elements in other.
        do
            from
                other.start
            until
                other.after
            loop
                consistency_count := consistency_count - 1
                removed_item (other.item)
                other.forth
            end
        end

    removed_item (an_item: G) is
            -- an_item has been removed.
        do
            if not in_operation then
                on_item_removed (an_item)
            end
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    first_element: LINKABLE [G]
            -- Head of list
            -- (from LINKED_LIST)

    last_element: like first_element is
            -- Tail of list
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

feature {NONE} -- Contract support

    consistency_count: INTEGER
            -- Number of items in the list.

feature -- Element Change

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    merge_left (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            in_operation := True
            Precursor {LINKED_LIST}  (other)
            in_operation := False
            add_all (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            in_operation := True
            Precursor {LINKED_LIST}  (other)
            in_operation := False
            add_all (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            added_item (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            active_item: like item
        do
            active_item := active.item
            in_operation := True
            Precursor {LINKED_LIST}
            in_operation := False
            removed_item (active_item)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        local
            item_removed: like item
        do
            if before then
                item_removed := first_element.item
            else
                item_removed := active.right.item
            end
            in_operation := True
            Precursor {LINKED_LIST}
            in_operation := False
            removed_item (item_removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    replace (v: like item) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        local
            active_item: like item
        do
            active_item := active.item
            in_operation := True
            Precursor {LINKED_LIST}  (v)
            in_operation := False
            removed_item (active_item)
            added_item (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    consistency_count_equal_to_count: consistency_count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERACTIVE_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call add/remove features
        when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    INTERACTIVE_LIST [G]

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Miscellaneous

    on_item_added (an_item: G)
            -- an_item has just been added.
        require
            an_item_not_void: an_item /= void

    on_item_removed (an_item: G)
            -- an_item has been removed.
        require
            an_item_not_void: an_item /= void

feature -- Element Change

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    consistency_count_equal_to_count: consistency_count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERACTIVE_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    INTERACTIVE_LIST [G]

Ancestors
    LINKED_LIST [G]

Descendants
    ACTIVE_LIST [G]

Clients
    ACTIVE_LIST [G]
    INTERACTIVE_LIST [G]

Suppliers
    BOOLEAN
    INTEGER
    INTERACTIVE_LIST [G]
    LINKABLE [G]
    LINKED_LIST [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERACTIVE_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, one-way linked lists that call add/remove features
        when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, linked, list"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    INTERACTIVE_LIST [G]

feature -- Miscellaneous

    on_item_added (an_item: G)
            -- an_item has just been added.
        require
            an_item_not_void: an_item /= void

    on_item_removed (an_item: G)
            -- an_item has been removed.
        require
            an_item_not_void: an_item /= void

feature -- Element Change

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.

    replace (v: like item)
            -- Replace current item by v.

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other

feature -- Removal

    wipe_out
            -- Remove all items.

invariant

    consistency_count_equal_to_count: consistency_count = count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERACTIVE_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.kernel

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.kernel	(diagram)

Supercluster
    base

Classes
    ANY
    ARGUMENTS
    ARRAY [G]
    BASIC_ROUTINES
    BIT_REF
    BOOLEAN
    BOOLEAN_REF
    CHARACTER
    CHARACTER_REF
    COMPARABLE
    CONSOLE
    DECLARATOR
    DIRECTORY
    DIRECTORY_NAME
    DOUBLE
    DOUBLE_REF
    EXCEP_CONST
    EXCEPTIONS
    FILE
    FILE_NAME
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    GC_INFO
    HASHABLE
    INTEGER
    INTEGER_16
    INTEGER_16_REF
    INTEGER_64
    INTEGER_64_REF
    INTEGER_8
    INTEGER_8_REF
    INTEGER_INTERVAL
    INTEGER_REF
    IO_MEDIUM
    MEM_CONST
    MEM_INFO
    MEMORY
    NUMERIC
    PART_COMPARABLE
    PATH_NAME
    PLAIN_TEXT_FILE
    PLATFORM
    POINTER
    POINTER_REF
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    RAW_FILE
    REAL
    REAL_REF
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    SEQ_STRING
    SPECIAL [T]
    STD_FILES
    STORABLE
    STREAM
    STRING
    STRING_HANDLER
    TO_SPECIAL [T]
    TUPLE
    UNIX_FILE_INFO
    UNIX_SIGNALS
    WIDE_CHARACTER
    WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ANY Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Project-wide universal properties.
        This class is an ancestor to all developer-written classes.
        ANY may be customized for individual projects or teams.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ANY

feature -- Access

    generator: STRING is
            -- Name of current object's generating class
            -- (base class of the type of which it is a direct instance)
        do
            Result := c_generator ($Current)
        end

    generating_type: STRING is
            -- Name of current object's generating type
            -- (type of which it is a direct instance)
        do
            Result := c_generating_type ($Current)
        end

feature -- Status report

    conforms_to (other: ANY): BOOLEAN is
            -- Does type of current object conform to type
            -- of other (as per Eiffel: The Language, chapter 13)?
        require
            other_not_void: other /= void
        do
            Result := c_conforms_to ($other, $Current)
        end

    same_type (other: ANY): BOOLEAN is
            -- Is type of current object identical to type of other?
        require
            other_not_void: other /= void
        do
            Result := c_same_type ($other, $Current)
        ensure
            definition: Result = (conforms_to (other) and other.conforms_to (Current))
        end

    consistent (other: like Current): BOOLEAN is
        obsolete "Not used anymore, please remove it from your inheritance clauses if it appears."
            -- Is current object in a consistent state so that other
            -- may be copied onto it? (Default answer: yes).
        do
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object considered
            -- equal to current object?
        require
            other_not_void: other /= void
        do
            Result := c_standard_is_equal ($Current, $other)
        ensure
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

    frozen standard_is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object, and field-by-field identical to it?
        require
            other_not_void: other /= void
        do
            Result := c_standard_is_equal ($Current, $other)
        ensure
            same_type: Result implies same_type (other)
            symmetric: Result implies other.standard_is_equal (Current)
        end

    frozen equal (some: ANY; other: like some): BOOLEAN is
            -- Are some and other either both void or attached
            -- to objects considered equal?
        do
            if some = void then
                Result := other = void
            else
                Result := other /= void and then some.is_equal (other)
            end
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.is_equal (other))
        end

    frozen standard_equal (some: ANY; other: like some): BOOLEAN is
            -- Are some and other either both void or attached to
            -- field-by-field identical objects of the same type?
            -- Always uses default object comparison criterion.
        do
            if some = void then
                Result := other = void
            else
                Result := other /= void and then some.standard_is_equal (other)
            end
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.standard_is_equal (other))
        end

    frozen deep_equal (some: ANY; other: like some): BOOLEAN is
            -- Are some and other either both void
            -- or attached to isomorphic object structures?
        do
            if some = void then
                Result := other = void
            else
                Result := other /= void and then c_deep_equal ($some, $other)
            end
        ensure
            shallow_implies_deep: standard_equal (some, other) implies Result
            both_or_none_void: (some = void) implies (Result = (other = void))
            same_type: (Result and (some /= void)) implies some.same_type (other)
            symmetric: Result implies deep_equal (other, some)
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            c_standard_copy ($other, $Current)
        ensure
            is_equal: is_equal (other)
        end

    frozen standard_copy (other: like Current) is
            -- Copy every field of other onto corresponding field
            -- of current object.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            c_standard_copy ($other, $Current)
        ensure
            is_standard_equal: standard_is_equal (other)
        end

    frozen clone (other: ANY): like other is
            -- Void if other is void; otherwise new object
            -- equal to other
            --
            -- For non-void other, clone calls copy;
            -- to change copying/cloning semantics, redefine copy.
        local
            temp: BOOLEAN
        do
            if other /= void then
                temp := c_check_assert (False)
                Result := c_standard_clone ($other)
                Result.copy (other)
                temp := c_check_assert (temp)
            end
        ensure
            equal: equal (Result, other)
        end

    frozen standard_clone (other: ANY): like other is
            -- Void if other is void; otherwise new object
            -- field-by-field identical to other.
            -- Always uses default copying semantics.
        local
            temp: BOOLEAN
        do
            if other /= void then
                temp := c_check_assert (False)
                Result := c_standard_clone ($other)
                Result.standard_copy (other)
                temp := c_check_assert (temp)
            end
        ensure
            equal: standard_equal (Result, other)
        end

    frozen deep_clone (other: ANY): like other is
            -- Void if other is void: otherwise, new object structure
            -- recursively duplicated from the one attached to other
        do
            if other /= void then
                Result := c_deep_clone ($other)
            end
        ensure
            deep_equal: deep_equal (other, Result)
        end

    frozen deep_copy (other: like Current) is
            -- Effect equivalent to that of:
            -- 		temp := deep_clone (other);
            --		copy (temp)
        require
            other_not_void: other /= void
        local
            temp: like Current
        do
            temp := deep_clone (other)
            copy (temp)
        ensure
            deep_equal: deep_equal (Current, other)
        end

    setup (other: like Current) is
        obsolete "Not used anymore by `clone', please remove it from your inheritance clauses%Nif it appears."
            -- Assuming current object has just been created, perform
            -- actions necessary to ensure that contents of other
            -- can be safely copied onto it.
        do
        end

feature -- Output

    io: STD_FILES is
            -- Handle to standard file setup
        once
            create Result
            Result.set_output_default
        end

    out: STRING is
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of tagged_out.
        do
            Result := c_tagged_out (Current)
        end

    frozen tagged_out: STRING is
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of out.
        do
            Result := c_tagged_out (Current)
        end

    print (some: ANY) is
            -- Write terse external representation of some
            -- on standard output.
        do
            if some /= void then
                io.put_string (some.out)
            end
        end

feature -- Platform

    operating_environment: OPERATING_ENVIRONMENT is
            -- Objects available from the operating system
        once
            create Result
        end

feature -- Basic operations

    default_rescue is
            -- Process exception for routines with no Rescue clause.
            -- (Default: do nothing.)
        do
        end

    default_create is
            -- Process instances of classes with no creation clause.
            -- (Default: do nothing.)
        do
        end

    frozen do_nothing is
            -- Execute a null action.
        do
        end

    frozen default: like Current is
            -- Default value of object's type
        do
        end

    frozen default_pointer: POINTER is
            -- Default value of type POINTER
            -- (Avoid the need to write p.default for
            -- some p of type POINTER.)
        do
        end

    frozen void: NONE
            -- Void reference

feature {NONE} -- Implementation

    frozen c_standard_clone (other: POINTER): ANY is
            -- New object of same dynamic type as other
        external
            "C | %"eif_copy.h%""
        alias
            "eclone"
        end

    frozen c_conforms_to (obj1, obj2: POINTER): BOOLEAN is
            -- Does dynamic type of object attached to obj1 conform to
            -- dynamic type of object attached to obj2?
        external
            "C [macro %"eif_plug.h%"]"
        alias
            "econfg"
        end

    frozen c_same_type (obj1, obj2: POINTER): BOOLEAN is
            -- Are dynamic type of object attached to obj1 and
            -- dynamic type of object attached to obj2 the same?
        external
            "C [macro %"eif_plug.h%"]"
        alias
            "estypeg"
        end

    frozen c_standard_is_equal (target, source: POINTER): BOOLEAN is
            -- C external performing standard equality
        external
            "C | %"eif_equal.h%""
        alias
            "eequal"
        end

    frozen c_standard_copy (source, target: POINTER) is
            -- C external performing standard copy
        external
            "C | %"eif_copy.h%""
        alias
            "ecopy"
        end

    frozen c_deep_clone (other: POINTER): ANY is
            -- New object structure recursively duplicated from the one
            -- attached to other
        external
            "C | %"eif_copy.h%""
        alias
            "edclone"
        end

    frozen c_deep_equal (some: POINTER; other: like some): BOOLEAN is
            -- Are some and other attached to recursively isomorphic
            -- object structures?
        external
            "C | %"eif_equal.h%""
        alias
            "ediso"
        end

    frozen c_tagged_out (some: ANY): STRING is
            -- Printable representation of current object
        external
            "C | %"eif_out.h%""
        end

    frozen c_generator (some: POINTER): STRING is
            -- Name of the generating class of current object
        external
            "C | %"eif_out.h%""
        end

    frozen c_check_assert (b: BOOLEAN): BOOLEAN is
        external
            "C | %"eif_copy.h%""
        end

    frozen c_generating_type (obj: POINTER): STRING is
        external
            "C | %"eif_gen_conf.h%""
        alias
            "eif_gen_typename"
        end

invariant

    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ANY Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ANY

General
    cluster: base.kernel
    description:
        "Project-wide universal properties.
        This class is an ancestor to all developer-written classes.
        ANY may be customized for individual projects or teams."

Queries
    clone (other: ANY): [like other] ANY
    conforms_to (other: ANY): BOOLEAN
    deep_clone (other: ANY): [like other] ANY
    deep_equal (some: ANY; other: [like some] ANY): BOOLEAN
    default: [like Current] ANY
    default_pointer: POINTER
    equal (some: ANY; other: [like some] ANY): BOOLEAN
    generating_type: STRING
    generator: STRING
    Io: STD_FILES
    is_equal (other: [like Current] ANY): BOOLEAN
    Operating_environment: OPERATING_ENVIRONMENT
    out: STRING
    same_type (other: ANY): BOOLEAN
    standard_clone (other: ANY): [like other] ANY
    standard_equal (some: ANY; other: [like some] ANY): BOOLEAN
    standard_is_equal (other: [like Current] ANY): BOOLEAN
    tagged_out: STRING
    void: NONE

Commands
    copy (other: [like Current] ANY)
    deep_copy (other: [like Current] ANY)
    default_create
    default_rescue
    do_nothing
    print (some: ANY)
    standard_copy (other: [like Current] ANY)

Constraints
    reflexive equality
    reflexive conformance

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ANY Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Project-wide universal properties.
        This class is an ancestor to all developer-written classes.
        ANY may be customized for individual projects or teams.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ANY

feature -- Access

    generating_type: STRING is
            -- Name of current object's generating type
            -- (type of which it is a direct instance)
        do
            Result := c_generating_type ($Current)
        end

    generator: STRING is
            -- Name of current object's generating class
            -- (base class of the type of which it is a direct instance)
        do
            Result := c_generator ($Current)
        end

feature -- Comparison

    frozen deep_equal (some: ANY; other: like some): BOOLEAN is
            -- Are some and other either both void
            -- or attached to isomorphic object structures?
        do
            if some = void then
                Result := other = void
            else
                Result := other /= void and then c_deep_equal ($some, $other)
            end
        ensure
            shallow_implies_deep: standard_equal (some, other) implies Result
            both_or_none_void: (some = void) implies (Result = (other = void))
            same_type: (Result and (some /= void)) implies some.same_type (other)
            symmetric: Result implies deep_equal (other, some)
        end

    frozen equal (some: ANY; other: like some): BOOLEAN is
            -- Are some and other either both void or attached
            -- to objects considered equal?
        do
            if some = void then
                Result := other = void
            else
                Result := other /= void and then some.is_equal (other)
            end
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.is_equal (other))
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object considered
            -- equal to current object?
        require
            other_not_void: other /= void
        do
            Result := c_standard_is_equal ($Current, $other)
        ensure
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

    frozen standard_equal (some: ANY; other: like some): BOOLEAN is
            -- Are some and other either both void or attached to
            -- field-by-field identical objects of the same type?
            -- Always uses default object comparison criterion.
        do
            if some = void then
                Result := other = void
            else
                Result := other /= void and then some.standard_is_equal (other)
            end
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.standard_is_equal (other))
        end

    frozen standard_is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object, and field-by-field identical to it?
        require
            other_not_void: other /= void
        do
            Result := c_standard_is_equal ($Current, $other)
        ensure
            same_type: Result implies same_type (other)
            symmetric: Result implies other.standard_is_equal (Current)
        end

feature -- Status report

    conforms_to (other: ANY): BOOLEAN is
            -- Does type of current object conform to type
            -- of other (as per Eiffel: The Language, chapter 13)?
        require
            other_not_void: other /= void
        do
            Result := c_conforms_to ($other, $Current)
        end

    consistent (other: like Current): BOOLEAN is
        obsolete "Not used anymore, please remove it from your inheritance clauses if it appears."
            -- Is current object in a consistent state so that other
            -- may be copied onto it? (Default answer: yes).
        do
        end

    same_type (other: ANY): BOOLEAN is
            -- Is type of current object identical to type of other?
        require
            other_not_void: other /= void
        do
            Result := c_same_type ($other, $Current)
        ensure
            definition: Result = (conforms_to (other) and other.conforms_to (Current))
        end

feature -- Duplication

    frozen clone (other: ANY): like other is
            -- Void if other is void; otherwise new object
            -- equal to other
            --
            -- For non-void other, clone calls copy;
            -- to change copying/cloning semantics, redefine copy.
        local
            temp: BOOLEAN
        do
            if other /= void then
                temp := c_check_assert (False)
                Result := c_standard_clone ($other)
                Result.copy (other)
                temp := c_check_assert (temp)
            end
        ensure
            equal: equal (Result, other)
        end

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            c_standard_copy ($other, $Current)
        ensure
            is_equal: is_equal (other)
        end

    frozen deep_clone (other: ANY): like other is
            -- Void if other is void: otherwise, new object structure
            -- recursively duplicated from the one attached to other
        do
            if other /= void then
                Result := c_deep_clone ($other)
            end
        ensure
            deep_equal: deep_equal (other, Result)
        end

    frozen deep_copy (other: like Current) is
            -- Effect equivalent to that of:
            -- 		temp := deep_clone (other);
            --		copy (temp)
        require
            other_not_void: other /= void
        local
            temp: like Current
        do
            temp := deep_clone (other)
            copy (temp)
        ensure
            deep_equal: deep_equal (Current, other)
        end

    setup (other: like Current) is
        obsolete "Not used anymore by `clone', please remove it from your inheritance clauses%Nif it appears."
            -- Assuming current object has just been created, perform
            -- actions necessary to ensure that contents of other
            -- can be safely copied onto it.
        do
        end

    frozen standard_clone (other: ANY): like other is
            -- Void if other is void; otherwise new object
            -- field-by-field identical to other.
            -- Always uses default copying semantics.
        local
            temp: BOOLEAN
        do
            if other /= void then
                temp := c_check_assert (False)
                Result := c_standard_clone ($other)
                Result.standard_copy (other)
                temp := c_check_assert (temp)
            end
        ensure
            equal: standard_equal (Result, other)
        end

    frozen standard_copy (other: like Current) is
            -- Copy every field of other onto corresponding field
            -- of current object.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            c_standard_copy ($other, $Current)
        ensure
            is_standard_equal: standard_is_equal (other)
        end

feature -- Basic operations

    frozen default: like Current is
            -- Default value of object's type
        do
        end

    default_create is
            -- Process instances of classes with no creation clause.
            -- (Default: do nothing.)
        do
        end

    frozen default_pointer: POINTER is
            -- Default value of type POINTER
            -- (Avoid the need to write p.default for
            -- some p of type POINTER.)
        do
        end

    default_rescue is
            -- Process exception for routines with no Rescue clause.
            -- (Default: do nothing.)
        do
        end

    frozen do_nothing is
            -- Execute a null action.
        do
        end

    frozen void: NONE
            -- Void reference

feature {NONE} -- Implementation

    frozen c_check_assert (b: BOOLEAN): BOOLEAN is
        external
            "C | %"eif_copy.h%""
        end

    frozen c_conforms_to (obj1, obj2: POINTER): BOOLEAN is
            -- Does dynamic type of object attached to obj1 conform to
            -- dynamic type of object attached to obj2?
        external
            "C [macro %"eif_plug.h%"]"
        alias
            "econfg"
        end

    frozen c_deep_clone (other: POINTER): ANY is
            -- New object structure recursively duplicated from the one
            -- attached to other
        external
            "C | %"eif_copy.h%""
        alias
            "edclone"
        end

    frozen c_deep_equal (some: POINTER; other: like some): BOOLEAN is
            -- Are some and other attached to recursively isomorphic
            -- object structures?
        external
            "C | %"eif_equal.h%""
        alias
            "ediso"
        end

    frozen c_generating_type (obj: POINTER): STRING is
        external
            "C | %"eif_gen_conf.h%""
        alias
            "eif_gen_typename"
        end

    frozen c_generator (some: POINTER): STRING is
            -- Name of the generating class of current object
        external
            "C | %"eif_out.h%""
        end

    frozen c_same_type (obj1, obj2: POINTER): BOOLEAN is
            -- Are dynamic type of object attached to obj1 and
            -- dynamic type of object attached to obj2 the same?
        external
            "C [macro %"eif_plug.h%"]"
        alias
            "estypeg"
        end

    frozen c_standard_clone (other: POINTER): ANY is
            -- New object of same dynamic type as other
        external
            "C | %"eif_copy.h%""
        alias
            "eclone"
        end

    frozen c_standard_copy (source, target: POINTER) is
            -- C external performing standard copy
        external
            "C | %"eif_copy.h%""
        alias
            "ecopy"
        end

    frozen c_standard_is_equal (target, source: POINTER): BOOLEAN is
            -- C external performing standard equality
        external
            "C | %"eif_equal.h%""
        alias
            "eequal"
        end

    frozen c_tagged_out (some: ANY): STRING is
            -- Printable representation of current object
        external
            "C | %"eif_out.h%""
        end

feature -- Output

    io: STD_FILES is
            -- Handle to standard file setup
        once
            create Result
            Result.set_output_default
        end

    out: STRING is
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of tagged_out.
        do
            Result := c_tagged_out (Current)
        end

    print (some: ANY) is
            -- Write terse external representation of some
            -- on standard output.
        do
            if some /= void then
                io.put_string (some.out)
            end
        end

    frozen tagged_out: STRING is
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of out.
        do
            Result := c_tagged_out (Current)
        end

feature -- Platform

    operating_environment: OPERATING_ENVIRONMENT is
            -- Objects available from the operating system
        once
            create Result
        end

invariant

    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ANY Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Project-wide universal properties.
        This class is an ancestor to all developer-written classes.
        ANY may be customized for individual projects or teams.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ANY

feature -- Access

    generating_type: STRING
            -- Name of current object's generating type
            -- (type of which it is a direct instance)

    generator: STRING
            -- Name of current object's generating class
            -- (base class of the type of which it is a direct instance)

feature -- Comparison

    frozen deep_equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void
            -- or attached to isomorphic object structures?
        ensure
            shallow_implies_deep: standard_equal (some, other) implies Result
            both_or_none_void: (some = void) implies (Result = (other = void))
            same_type: (Result and (some /= void)) implies some.same_type (other)
            symmetric: Result implies deep_equal (other, some)

    frozen equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void or attached
            -- to objects considered equal?
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.is_equal (other))

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object considered
            -- equal to current object?
        require
            other_not_void: other /= void
        ensure
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    frozen standard_equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void or attached to
            -- field-by-field identical objects of the same type?
            -- Always uses default object comparison criterion.
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.standard_is_equal (other))

    frozen standard_is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object, and field-by-field identical to it?
        require
            other_not_void: other /= void
        ensure
            same_type: Result implies same_type (other)
            symmetric: Result implies other.standard_is_equal (Current)

feature -- Status report

    conforms_to (other: ANY): BOOLEAN
            -- Does type of current object conform to type
            -- of other (as per Eiffel: The Language, chapter 13)?
        require
            other_not_void: other /= void

    same_type (other: ANY): BOOLEAN
            -- Is type of current object identical to type of other?
        require
            other_not_void: other /= void
        ensure
            definition: Result = (conforms_to (other) and other.conforms_to (Current))

feature -- Duplication

    frozen clone (other: ANY): like other
            -- Void if other is void; otherwise new object
            -- equal to other
            --
            -- For non-void other, clone calls copy;
            -- to change copying/cloning semantics, redefine copy.
        ensure
            equal: equal (Result, other)

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure
            is_equal: is_equal (other)

    frozen deep_clone (other: ANY): like other
            -- Void if other is void: otherwise, new object structure
            -- recursively duplicated from the one attached to other
        ensure
            deep_equal: deep_equal (other, Result)

    frozen deep_copy (other: like Current)
            -- Effect equivalent to that of:
            -- 		temp := deep_clone (other);
            --		copy (temp)
        require
            other_not_void: other /= void
        ensure
            deep_equal: deep_equal (Current, other)

    frozen standard_clone (other: ANY): like other
            -- Void if other is void; otherwise new object
            -- field-by-field identical to other.
            -- Always uses default copying semantics.
        ensure
            equal: standard_equal (Result, other)

    frozen standard_copy (other: like Current)
            -- Copy every field of other onto corresponding field
            -- of current object.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure
            is_standard_equal: standard_is_equal (other)

feature -- Basic operations

    frozen default: like Current
            -- Default value of object's type

    default_create
            -- Process instances of classes with no creation clause.
            -- (Default: do nothing.)

    frozen default_pointer: POINTER
            -- Default value of type POINTER
            -- (Avoid the need to write p.default for
            -- some p of type POINTER.)

    default_rescue
            -- Process exception for routines with no Rescue clause.
            -- (Default: do nothing.)

    frozen do_nothing
            -- Execute a null action.

    frozen void: NONE
            -- Void reference

feature -- Output

    io: STD_FILES
            -- Handle to standard file setup

    out: STRING
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of tagged_out.

    print (some: ANY)
            -- Write terse external representation of some
            -- on standard output.

    frozen tagged_out: STRING
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of out.

feature -- Platform

    operating_environment: OPERATING_ENVIRONMENT
            -- Objects available from the operating system

invariant

    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ANY Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ANY

Descendants
    ARGUMENTS
    ASCII
    BASIC_ROUTINES
    BIT_REF
    CELL [G]
    CONTAINER [G]
    CURSOR
    DECLARATOR
    EXCEP_CONST
    EXECUTION_ENVIRONMENT
    FORMAT_INTEGER
    HASHABLE
    IDENTIFIED
    IDENTIFIED_CONTROLLER
    INTERNAL
    ITERATOR [G]
    MATH_CONST
    MEM_CONST
    NUMERIC
    OPERATING_ENVIRONMENT
    PARENT
    PART_COMPARABLE
    PLATFORM
    PROFILING_SETTING
    SHARED_LIBRARY_CONSTANTS
    SPECIAL [T]
    STD_FILES
    STRING_HANDLER
    SUBSET_STRATEGY [G]
    TESTROOT
    TO_SPECIAL [T]
    UNIX_SIGNALS

Clients
    ANY
    ARRAY [G]
    ARRAYED_LIST [G]
    ARRAYED_QUEUE [G]
    BOUNDED_QUEUE [G]
    INTERNAL
    LINEAR [G]
    SHARED_LIBRARY_ROUTINE
    TREE [G]

Suppliers
    ANY
    BOOLEAN
    OPERATING_ENVIRONMENT
    STD_FILES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ANY Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Project-wide universal properties.
        This class is an ancestor to all developer-written classes.
        ANY may be customized for individual projects or teams.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ANY

feature -- Access

    generator: STRING
            -- Name of current object's generating class
            -- (base class of the type of which it is a direct instance)

    generating_type: STRING
            -- Name of current object's generating type
            -- (type of which it is a direct instance)

feature -- Status report

    conforms_to (other: ANY): BOOLEAN
            -- Does type of current object conform to type
            -- of other (as per Eiffel: The Language, chapter 13)?
        require
            other_not_void: other /= void

    same_type (other: ANY): BOOLEAN
            -- Is type of current object identical to type of other?
        require
            other_not_void: other /= void
        ensure
            definition: Result = (conforms_to (other) and other.conforms_to (Current))

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object considered
            -- equal to current object?
        require
            other_not_void: other /= void
        ensure
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    frozen standard_is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object, and field-by-field identical to it?
        require
            other_not_void: other /= void
        ensure
            same_type: Result implies same_type (other)
            symmetric: Result implies other.standard_is_equal (Current)

    frozen equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void or attached
            -- to objects considered equal?
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.is_equal (other))

    frozen standard_equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void or attached to
            -- field-by-field identical objects of the same type?
            -- Always uses default object comparison criterion.
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.standard_is_equal (other))

    frozen deep_equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void
            -- or attached to isomorphic object structures?
        ensure
            shallow_implies_deep: standard_equal (some, other) implies Result
            both_or_none_void: (some = void) implies (Result = (other = void))
            same_type: (Result and (some /= void)) implies some.same_type (other)
            symmetric: Result implies deep_equal (other, some)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure
            is_equal: is_equal (other)

    frozen standard_copy (other: like Current)
            -- Copy every field of other onto corresponding field
            -- of current object.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure
            is_standard_equal: standard_is_equal (other)

    frozen clone (other: ANY): like other
            -- Void if other is void; otherwise new object
            -- equal to other
            --
            -- For non-void other, clone calls copy;
            -- to change copying/cloning semantics, redefine copy.
        ensure
            equal: equal (Result, other)

    frozen standard_clone (other: ANY): like other
            -- Void if other is void; otherwise new object
            -- field-by-field identical to other.
            -- Always uses default copying semantics.
        ensure
            equal: standard_equal (Result, other)

    frozen deep_clone (other: ANY): like other
            -- Void if other is void: otherwise, new object structure
            -- recursively duplicated from the one attached to other
        ensure
            deep_equal: deep_equal (other, Result)

    frozen deep_copy (other: like Current)
            -- Effect equivalent to that of:
            -- 		temp := deep_clone (other);
            --		copy (temp)
        require
            other_not_void: other /= void
        ensure
            deep_equal: deep_equal (Current, other)

feature -- Output

    io: STD_FILES
            -- Handle to standard file setup

    out: STRING
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of tagged_out.

    frozen tagged_out: STRING
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of out.

    print (some: ANY)
            -- Write terse external representation of some
            -- on standard output.

feature -- Platform

    operating_environment: OPERATING_ENVIRONMENT
            -- Objects available from the operating system

feature -- Basic operations

    default_rescue
            -- Process exception for routines with no Rescue clause.
            -- (Default: do nothing.)

    default_create
            -- Process instances of classes with no creation clause.
            -- (Default: do nothing.)

    frozen do_nothing
            -- Execute a null action.

    frozen default: like Current
            -- Default value of object's type

    frozen default_pointer: POINTER
            -- Default value of type POINTER
            -- (Avoid the need to write p.default for
            -- some p of type POINTER.)

    frozen void: NONE
            -- Void reference

invariant

    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARGUMENTS Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to command-line arguments. This class
        may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ARGUMENTS

feature -- Access

    argument (i: INTEGER): STRING is
            -- i-th argument of command that started system execution
            -- (the command name if i = 0)
        require
            index_large_enough: i >= 0
            index_small_enough: i <= argument_count
        do
            Result := arg_option (i)
        end

    argument_array: ARRAY [STRING] is
            -- Array containing command name (position 0) and arguments
        local
            i: INTEGER
        once
            create Result.make (0, argument_count)
            from
            until
                i > argument_count
            loop
                Result.put (arg_option (i), i)
                i := i + 1
            end
        end

    command_line: STRING is
            -- Total command line
        local
            i: INTEGER
        once
            create Result.make (command_name.count)
            from
            until
                i > argument_count
            loop
                Result.append (" ")
                Result.append (arg_option (i))
                i := i + 1
            end
        ensure
            Result.count >= command_name.count
        end

    command_name: STRING is
            -- Name of command that started system execution
        once
            Result := arg_option (0)
        ensure
            definition: Result.is_equal (argument (0))
        end

feature -- Status report

    has_word_option (opt: STRING): INTEGER is
        obsolete "Use index_of_word_option instead."
        do
            Result := index_of_word_option (opt)
        end

    index_of_word_option (opt: STRING): INTEGER is
            -- Does command line specify word option opt and, if so,
            -- at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xopt, where X is the current option_sign,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            i: INTEGER
        do
            from
                i := 1
            until
                i > argument_count or else option_word_equal (argument_array.item (i), opt)
            loop
                i := i + 1
            end
            if i <= argument_count then
                Result := i
            end
        end

    index_of_beginning_with_word_option (opt: STRING): INTEGER is
            -- Does command line specify argument beginning with word
            -- option opt and, if so, at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xoptxx, where X is the current option_sign, 'xx'
            -- is arbitrary, possibly empty sequence of characters,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            i: INTEGER
        do
            from
                i := 1
            until
                i > argument_count or else option_word_begins_with (argument_array.item (i), opt)
            loop
                i := i + 1
            end
            if i <= argument_count then
                Result := i
            end
        end

    has_character_option (o: CHARACTER): INTEGER is
        obsolete "Use index_of_character_option instead."
        do
            Result := index_of_character_option (o)
        end

    index_of_character_option (o: CHARACTER): INTEGER is
            -- Does command line specify character option o and, if so,
            -- at what position?
            -- If one of the space-separated arguments is of the form Xxxoyy,
            -- where X is the current option_sign, xx and yy
            -- are arbitrary, possibly empty sequences of characters,
            -- then index of this argument in list of arguments;
            -- else 0.
        require
            o_non_null: o /= '%U'
        local
            i: INTEGER
        do
            from
                i := 1
            until
                i > argument_count or else option_character_equal (argument_array.item (i), o)
            loop
                i := i + 1
            end
            if i <= argument_count then
                Result := i
            end
        end

    separate_character_option_value (o: CHARACTER): STRING is
            -- The value, if any, specified after character option o on
            -- the command line.
            -- This is one of the following (where X is the current
            -- option_sign, xx and 'yy' are arbitrary, possibly empty
            -- sequences of characters):
            --   val if command line includes two consecutive arguments
            --	   of the form Xxxoyy and val respectively.
            --   Empty string if command line includes argument Xxxoyy, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if there is no argument of the form Xxxoyy.
        require
            o_non_null: o /= '%U'
        local
            p: INTEGER
        do
            p := index_of_character_option (o)
            if p /= 0 then
                if p = argument_count or else argument_array.item (p + 1).item (1) = option_sign then
                    Result := ""
                else
                    Result := argument_array.item (p + 1)
                end
            end
        end

    separate_word_option_value (opt: STRING): STRING is
            -- The value, if any, specified after word option opt on the
            -- command line.
            -- This is one of the following (where X is the current option_sign):
            --   val if command line includes two consecutive arguments
            --	   of the form Xopt and val respectively.
            --   Empty string if command line includes argument Xopt, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if no Xopt argument.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            p: INTEGER
        do
            p := index_of_word_option (opt)
            if p /= 0 then
                if p = argument_count or else argument_array.item (p + 1).item (1) = option_sign then
                    Result := ""
                else
                    Result := argument_array.item (p + 1)
                end
            end
        end

    coalesced_option_character_value (o: CHARACTER): STRING is
        obsolete "Use coalesced_character_option_value instead."
        do
            Result := coalesced_character_option_value (o)
        end

    coalesced_character_option_value (o: CHARACTER): STRING is
            -- The value, if any, specified for character option o on
            -- the command line.
            -- Defined as follows (where 'X' is the current 'option_sign' and
            -- 'xx' is an arbitrary, possibly empty sequence of characters):
            --   val if command line includes an argument of the form Xxxoval
            --	   (this may be an empty string if argument is just Xxxo).
            --   Void otherwise.
        require
            o_non_null: o /= '%U'
        local
            p: INTEGER
            l: STRING
        do
            p := index_of_character_option (o)
            if p /= 0 then
                l := clone (argument_array.item (p))
                if option_sign /= '%U' then
                    l.remove (1)
                end
                Result := l.substring (l.index_of (o, 1) + 1, l.count)
            end
        end

    coalesced_option_word_value (opt: STRING): STRING is
        obsolete "Use coalesced_word_option_value instead."
        do
            Result := coalesced_word_option_value (opt)
        end

    coalesced_word_option_value (opt: STRING): STRING is
            -- The value, if any, specified for word option opt on the
            -- command line.
            -- Defined as follows (where X is the current option_sign):
            --   val if command line includes an argument of the form Xoptval
            --	   (this may be an empty string if argument is just Xopt).
            --   Void otherwise.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            p: INTEGER
            l: STRING
        do
            p := index_of_beginning_with_word_option (opt)
            if p /= 0 then
                l := clone (argument_array.item (p))
                if option_sign /= '%U' then
                    l.remove (1)
                end
                Result := l.substring (opt.count + 1, l.count)
            end
        end

    option_sign: CHARACTER_REF is
            -- The character used to signal options on the command line.
            -- This can be '%U' if no sign is necesary for the argument
            -- to be an option
            -- Default is '-'
        once
            create Result
            Result.set_item ('-')
        end

feature -- Status setting

    set_option_sign (c: CHARACTER) is
            -- Make c the option sign.
            -- Use'%U' if no sign is necesary for the argument to
            -- be an option
        do
            option_sign.set_item (c)
        end

feature -- Measurement

    argument_count: INTEGER is
            -- Number of arguments given to command that started
            -- system execution (command name does not count)
        once
            Result := arg_number - 1
        ensure
            Result >= 0
        end

feature {NONE} -- Implementation

    arg_number: INTEGER is
        external
            "C | %"eif_argv.h%""
        end

    arg_option (i: INTEGER): STRING is
        external
            "C | %"eif_argv.h%""
        end

    option_word_equal (arg, w: STRING): BOOLEAN is
            -- Is arg equal to the word option w?
        do
            if option_sign = '%U' then
                Result := arg.is_equal (w)
            elseif arg.item (1) = option_sign then
                Result := arg.substring (2, arg.count).is_equal (w)
            end
        end

    option_word_begins_with (arg, w: STRING): BOOLEAN is
            -- Does arg begin with the word option w?
        do
            if option_sign = '%U' and then arg.count >= w.count then
                Result := arg.substring (1, w.count).is_equal (w)
            elseif arg.item (1) = option_sign and then arg.count > w.count then
                Result := arg.substring (2, w.count + 1).is_equal (w)
            end
        end

    option_character_equal (arg: STRING; c: CHARACTER): BOOLEAN is
            -- Does arg contain the character option c?
        do
            if option_sign = '%U' then
                Result := arg.has (c)
            elseif arg.item (1) = option_sign then
                Result := arg.substring (2, arg.count).has (c)
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARGUMENTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARGUMENTS Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARGUMENTS

General
    cluster: base.kernel
    description:
        "Access to command-line arguments. This class
        may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    argument (i: INTEGER): STRING
    Argument_array: ARRAY [STRING]
    Argument_count: INTEGER
    coalesced_character_option_value (o: CHARACTER): STRING
    coalesced_word_option_value (opt: STRING): STRING
    Command_line: STRING
    Command_name: STRING
    index_of_beginning_with_word_option (opt: STRING): INTEGER
    index_of_character_option (o: CHARACTER): INTEGER
    index_of_word_option (opt: STRING): INTEGER
    Option_sign: CHARACTER_REF
    separate_character_option_value (o: CHARACTER): STRING
    separate_word_option_value (opt: STRING): STRING

Commands
    set_option_sign (c: CHARACTER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARGUMENTS Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to command-line arguments. This class
        may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ARGUMENTS

feature -- Access

    argument (i: INTEGER): STRING is
            -- i-th argument of command that started system execution
            -- (the command name if i = 0)
        require
            index_large_enough: i >= 0
            index_small_enough: i <= argument_count
        do
            Result := arg_option (i)
        end

    argument_array: ARRAY [STRING] is
            -- Array containing command name (position 0) and arguments
        local
            i: INTEGER
        once
            create Result.make (0, argument_count)
            from
            until
                i > argument_count
            loop
                Result.put (arg_option (i), i)
                i := i + 1
            end
        end

    command_line: STRING is
            -- Total command line
        local
            i: INTEGER
        once
            create Result.make (command_name.count)
            from
            until
                i > argument_count
            loop
                Result.append (" ")
                Result.append (arg_option (i))
                i := i + 1
            end
        ensure
            Result.count >= command_name.count
        end

    command_name: STRING is
            -- Name of command that started system execution
        once
            Result := arg_option (0)
        ensure
            definition: Result.is_equal (argument (0))
        end

feature -- Measurement

    argument_count: INTEGER is
            -- Number of arguments given to command that started
            -- system execution (command name does not count)
        once
            Result := arg_number - 1
        ensure
            Result >= 0
        end

feature -- Status report

    coalesced_character_option_value (o: CHARACTER): STRING is
            -- The value, if any, specified for character option o on
            -- the command line.
            -- Defined as follows (where 'X' is the current 'option_sign' and
            -- 'xx' is an arbitrary, possibly empty sequence of characters):
            --   val if command line includes an argument of the form Xxxoval
            --	   (this may be an empty string if argument is just Xxxo).
            --   Void otherwise.
        require
            o_non_null: o /= '%U'
        local
            p: INTEGER
            l: STRING
        do
            p := index_of_character_option (o)
            if p /= 0 then
                l := clone (argument_array.item (p))
                if option_sign /= '%U' then
                    l.remove (1)
                end
                Result := l.substring (l.index_of (o, 1) + 1, l.count)
            end
        end

    coalesced_option_character_value (o: CHARACTER): STRING is
        obsolete "Use coalesced_character_option_value instead."
        do
            Result := coalesced_character_option_value (o)
        end

    coalesced_option_word_value (opt: STRING): STRING is
        obsolete "Use coalesced_word_option_value instead."
        do
            Result := coalesced_word_option_value (opt)
        end

    coalesced_word_option_value (opt: STRING): STRING is
            -- The value, if any, specified for word option opt on the
            -- command line.
            -- Defined as follows (where X is the current option_sign):
            --   val if command line includes an argument of the form Xoptval
            --	   (this may be an empty string if argument is just Xopt).
            --   Void otherwise.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            p: INTEGER
            l: STRING
        do
            p := index_of_beginning_with_word_option (opt)
            if p /= 0 then
                l := clone (argument_array.item (p))
                if option_sign /= '%U' then
                    l.remove (1)
                end
                Result := l.substring (opt.count + 1, l.count)
            end
        end

    has_character_option (o: CHARACTER): INTEGER is
        obsolete "Use index_of_character_option instead."
        do
            Result := index_of_character_option (o)
        end

    has_word_option (opt: STRING): INTEGER is
        obsolete "Use index_of_word_option instead."
        do
            Result := index_of_word_option (opt)
        end

    index_of_beginning_with_word_option (opt: STRING): INTEGER is
            -- Does command line specify argument beginning with word
            -- option opt and, if so, at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xoptxx, where X is the current option_sign, 'xx'
            -- is arbitrary, possibly empty sequence of characters,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            i: INTEGER
        do
            from
                i := 1
            until
                i > argument_count or else option_word_begins_with (argument_array.item (i), opt)
            loop
                i := i + 1
            end
            if i <= argument_count then
                Result := i
            end
        end

    index_of_character_option (o: CHARACTER): INTEGER is
            -- Does command line specify character option o and, if so,
            -- at what position?
            -- If one of the space-separated arguments is of the form Xxxoyy,
            -- where X is the current option_sign, xx and yy
            -- are arbitrary, possibly empty sequences of characters,
            -- then index of this argument in list of arguments;
            -- else 0.
        require
            o_non_null: o /= '%U'
        local
            i: INTEGER
        do
            from
                i := 1
            until
                i > argument_count or else option_character_equal (argument_array.item (i), o)
            loop
                i := i + 1
            end
            if i <= argument_count then
                Result := i
            end
        end

    index_of_word_option (opt: STRING): INTEGER is
            -- Does command line specify word option opt and, if so,
            -- at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xopt, where X is the current option_sign,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            i: INTEGER
        do
            from
                i := 1
            until
                i > argument_count or else option_word_equal (argument_array.item (i), opt)
            loop
                i := i + 1
            end
            if i <= argument_count then
                Result := i
            end
        end

    option_sign: CHARACTER_REF is
            -- The character used to signal options on the command line.
            -- This can be '%U' if no sign is necesary for the argument
            -- to be an option
            -- Default is '-'
        once
            create Result
            Result.set_item ('-')
        end

    separate_character_option_value (o: CHARACTER): STRING is
            -- The value, if any, specified after character option o on
            -- the command line.
            -- This is one of the following (where X is the current
            -- option_sign, xx and 'yy' are arbitrary, possibly empty
            -- sequences of characters):
            --   val if command line includes two consecutive arguments
            --	   of the form Xxxoyy and val respectively.
            --   Empty string if command line includes argument Xxxoyy, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if there is no argument of the form Xxxoyy.
        require
            o_non_null: o /= '%U'
        local
            p: INTEGER
        do
            p := index_of_character_option (o)
            if p /= 0 then
                if p = argument_count or else argument_array.item (p + 1).item (1) = option_sign then
                    Result := ""
                else
                    Result := argument_array.item (p + 1)
                end
            end
        end

    separate_word_option_value (opt: STRING): STRING is
            -- The value, if any, specified after word option opt on the
            -- command line.
            -- This is one of the following (where X is the current option_sign):
            --   val if command line includes two consecutive arguments
            --	   of the form Xopt and val respectively.
            --   Empty string if command line includes argument Xopt, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if no Xopt argument.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty
        local
            p: INTEGER
        do
            p := index_of_word_option (opt)
            if p /= 0 then
                if p = argument_count or else argument_array.item (p + 1).item (1) = option_sign then
                    Result := ""
                else
                    Result := argument_array.item (p + 1)
                end
            end
        end

feature -- Status setting

    set_option_sign (c: CHARACTER) is
            -- Make c the option sign.
            -- Use'%U' if no sign is necesary for the argument to
            -- be an option
        do
            option_sign.set_item (c)
        end

feature {NONE} -- Implementation

    arg_number: INTEGER is
        external
            "C | %"eif_argv.h%""
        end

    arg_option (i: INTEGER): STRING is
        external
            "C | %"eif_argv.h%""
        end

    option_character_equal (arg: STRING; c: CHARACTER): BOOLEAN is
            -- Does arg contain the character option c?
        do
            if option_sign = '%U' then
                Result := arg.has (c)
            elseif arg.item (1) = option_sign then
                Result := arg.substring (2, arg.count).has (c)
            end
        end

    option_word_begins_with (arg, w: STRING): BOOLEAN is
            -- Does arg begin with the word option w?
        do
            if option_sign = '%U' and then arg.count >= w.count then
                Result := arg.substring (1, w.count).is_equal (w)
            elseif arg.item (1) = option_sign and then arg.count > w.count then
                Result := arg.substring (2, w.count + 1).is_equal (w)
            end
        end

    option_word_equal (arg, w: STRING): BOOLEAN is
            -- Is arg equal to the word option w?
        do
            if option_sign = '%U' then
                Result := arg.is_equal (w)
            elseif arg.item (1) = option_sign then
                Result := arg.substring (2, arg.count).is_equal (w)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARGUMENTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARGUMENTS Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to command-line arguments. This class
        may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ARGUMENTS

feature -- Access

    argument (i: INTEGER): STRING
            -- i-th argument of command that started system execution
            -- (the command name if i = 0)
        require
            index_large_enough: i >= 0
            index_small_enough: i <= argument_count

    argument_array: ARRAY [STRING]
            -- Array containing command name (position 0) and arguments

    command_line: STRING
            -- Total command line
        ensure
            Result.count >= command_name.count

    command_name: STRING
            -- Name of command that started system execution
        ensure
            definition: Result.is_equal (argument (0))

feature -- Measurement

    argument_count: INTEGER
            -- Number of arguments given to command that started
            -- system execution (command name does not count)
        ensure
            Result >= 0

feature -- Status report

    coalesced_character_option_value (o: CHARACTER): STRING
            -- The value, if any, specified for character option o on
            -- the command line.
            -- Defined as follows (where 'X' is the current 'option_sign' and
            -- 'xx' is an arbitrary, possibly empty sequence of characters):
            --   val if command line includes an argument of the form Xxxoval
            --	   (this may be an empty string if argument is just Xxxo).
            --   Void otherwise.
        require
            o_non_null: o /= '%U'

    coalesced_word_option_value (opt: STRING): STRING
            -- The value, if any, specified for word option opt on the
            -- command line.
            -- Defined as follows (where X is the current option_sign):
            --   val if command line includes an argument of the form Xoptval
            --	   (this may be an empty string if argument is just Xopt).
            --   Void otherwise.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    index_of_beginning_with_word_option (opt: STRING): INTEGER
            -- Does command line specify argument beginning with word
            -- option opt and, if so, at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xoptxx, where X is the current option_sign, 'xx'
            -- is arbitrary, possibly empty sequence of characters,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    index_of_character_option (o: CHARACTER): INTEGER
            -- Does command line specify character option o and, if so,
            -- at what position?
            -- If one of the space-separated arguments is of the form Xxxoyy,
            -- where X is the current option_sign, xx and yy
            -- are arbitrary, possibly empty sequences of characters,
            -- then index of this argument in list of arguments;
            -- else 0.
        require
            o_non_null: o /= '%U'

    index_of_word_option (opt: STRING): INTEGER
            -- Does command line specify word option opt and, if so,
            -- at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xopt, where X is the current option_sign,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    option_sign: CHARACTER_REF
            -- The character used to signal options on the command line.
            -- This can be '%U' if no sign is necesary for the argument
            -- to be an option
            -- Default is '-'

    separate_character_option_value (o: CHARACTER): STRING
            -- The value, if any, specified after character option o on
            -- the command line.
            -- This is one of the following (where X is the current
            -- option_sign, xx and 'yy' are arbitrary, possibly empty
            -- sequences of characters):
            --   val if command line includes two consecutive arguments
            --	   of the form Xxxoyy and val respectively.
            --   Empty string if command line includes argument Xxxoyy, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if there is no argument of the form Xxxoyy.
        require
            o_non_null: o /= '%U'

    separate_word_option_value (opt: STRING): STRING
            -- The value, if any, specified after word option opt on the
            -- command line.
            -- This is one of the following (where X is the current option_sign):
            --   val if command line includes two consecutive arguments
            --	   of the form Xopt and val respectively.
            --   Empty string if command line includes argument Xopt, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if no Xopt argument.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

feature -- Status setting

    set_option_sign (c: CHARACTER)
            -- Make c the option sign.
            -- Use'%U' if no sign is necesary for the argument to
            -- be an option

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARGUMENTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARGUMENTS Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARGUMENTS

Ancestors
    ANY

Clients
    ARGUMENTS
    EXECUTION_ENVIRONMENT

Suppliers
    ARGUMENTS
    ARRAY [G]
    BOOLEAN
    CHARACTER_REF
    INTEGER
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARGUMENTS Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to command-line arguments. This class
        may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ARGUMENTS

feature -- Access

    argument (i: INTEGER): STRING
            -- i-th argument of command that started system execution
            -- (the command name if i = 0)
        require
            index_large_enough: i >= 0
            index_small_enough: i <= argument_count

    argument_array: ARRAY [STRING]
            -- Array containing command name (position 0) and arguments

    command_line: STRING
            -- Total command line
        ensure
            Result.count >= command_name.count

    command_name: STRING
            -- Name of command that started system execution
        ensure
            definition: Result.is_equal (argument (0))

feature -- Status report

    index_of_word_option (opt: STRING): INTEGER
            -- Does command line specify word option opt and, if so,
            -- at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xopt, where X is the current option_sign,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    index_of_beginning_with_word_option (opt: STRING): INTEGER
            -- Does command line specify argument beginning with word
            -- option opt and, if so, at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xoptxx, where X is the current option_sign, 'xx'
            -- is arbitrary, possibly empty sequence of characters,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    index_of_character_option (o: CHARACTER): INTEGER
            -- Does command line specify character option o and, if so,
            -- at what position?
            -- If one of the space-separated arguments is of the form Xxxoyy,
            -- where X is the current option_sign, xx and yy
            -- are arbitrary, possibly empty sequences of characters,
            -- then index of this argument in list of arguments;
            -- else 0.
        require
            o_non_null: o /= '%U'

    separate_character_option_value (o: CHARACTER): STRING
            -- The value, if any, specified after character option o on
            -- the command line.
            -- This is one of the following (where X is the current
            -- option_sign, xx and 'yy' are arbitrary, possibly empty
            -- sequences of characters):
            --   val if command line includes two consecutive arguments
            --	   of the form Xxxoyy and val respectively.
            --   Empty string if command line includes argument Xxxoyy, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if there is no argument of the form Xxxoyy.
        require
            o_non_null: o /= '%U'

    separate_word_option_value (opt: STRING): STRING
            -- The value, if any, specified after word option opt on the
            -- command line.
            -- This is one of the following (where X is the current option_sign):
            --   val if command line includes two consecutive arguments
            --	   of the form Xopt and val respectively.
            --   Empty string if command line includes argument Xopt, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if no Xopt argument.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    coalesced_character_option_value (o: CHARACTER): STRING
            -- The value, if any, specified for character option o on
            -- the command line.
            -- Defined as follows (where 'X' is the current 'option_sign' and
            -- 'xx' is an arbitrary, possibly empty sequence of characters):
            --   val if command line includes an argument of the form Xxxoval
            --	   (this may be an empty string if argument is just Xxxo).
            --   Void otherwise.
        require
            o_non_null: o /= '%U'

    coalesced_word_option_value (opt: STRING): STRING
            -- The value, if any, specified for word option opt on the
            -- command line.
            -- Defined as follows (where X is the current option_sign):
            --   val if command line includes an argument of the form Xoptval
            --	   (this may be an empty string if argument is just Xopt).
            --   Void otherwise.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    option_sign: CHARACTER_REF
            -- The character used to signal options on the command line.
            -- This can be '%U' if no sign is necesary for the argument
            -- to be an option
            -- Default is '-'

feature -- Status setting

    set_option_sign (c: CHARACTER)
            -- Make c the option sign.
            -- Use'%U' if no sign is necesary for the argument to
            -- be an option

feature -- Measurement

    argument_count: INTEGER
            -- Number of arguments given to command that started
            -- system execution (command name does not count)
        ensure
            Result >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARGUMENTS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of values, all of the same type or of a conforming one,
        accessible through integer indices in a contiguous interval.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ARRAY [G]

inherit
    RESIZABLE [G]
        redefine
            full,
            copy,
            is_equal
        end

    INDEXABLE [G, INTEGER]
        redefine
            copy,
            is_equal
        end

    TO_SPECIAL [G]
        export
            {ARRAY} set_area
        redefine
            copy,
            is_equal
        end

create
    make,
    make_from_array

feature -- Initialization

    make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
        require
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_from_array (a: ARRAY [G]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
        require
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature -- Access

    item (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
        do
            Result := area.item (i - lower)
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
        do
            Result := area.item (i - lower)
        end

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
        require
            valid_key: valid_index (i)
        do
            Result := item (i)
        end

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (item (i) /= void and then item (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (item (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        end

feature -- Measurement

    lower: INTEGER
            -- Minimum index

    upper: INTEGER
            -- Maximum index

    count: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
        do
            Result := upper - lower + 1
        ensure then
            consistent_with_bounds: Result = upper - lower + 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
        do
            Result := upper - lower + 1
        ensure then
            consistent_with_bounds: Result = upper - lower + 1
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if item (i) /= void and then v.is_equal (item (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if item (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (lower, upper)
        ensure then
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
        local
            i: INTEGER
        do
            if lower = other.lower and then upper = other.upper and then object_comparison = other.object_comparison then
                if object_comparison then
                    from
                        Result := True
                        i := lower
                    until
                        not Result or i > upper
                    loop
                        Result := equal (item (i), other.item (i))
                        i := i + 1
                    end
                else
                    Result := area.same_items (other.area, upper - lower)
                end
            end
        end

feature -- Status report

    all_default: BOOLEAN is
            -- Are all items set to default values?
        do
            Result := area.all_default (upper - lower)
        ensure
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))
        end

    full: BOOLEAN is
            -- Is structure filled to capacity? (Answer: yes)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
        require
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
        do
            Result := all_default
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
        do
            Result := (lower <= i) and then (i <= upper)
        end

    extendible: BOOLEAN is
            -- May items be added?
            -- (Answer: no, although array may be resized.)
        do
            Result := False
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: no.)
        do
            Result := False
        end

    valid_index_set: BOOLEAN is
        do
            Result := index_set.count = count
        end

feature -- Element change

    put (v: like item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
        do
            area.put (v, i - lower)
        end

    enter (v: like item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
        require
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    force (v: like item; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put (v, i)
        ensure
            inserted: item (i) = v
            higher_count: count >= old count
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    wipe_out is
        obsolete "Not applicable since not `prunable'. Use `discard_items' instead."
            -- Make array empty.
        do
            discard_items
        end

    discard_items is
            -- Reset all items to default values with reallocation.
        do
            make_area (capacity)
        ensure
            default_items: all_default
        end

    clear_all is
            -- Reset all items to default values.
        do
            area.clear_all
        ensure
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

feature -- Resizing

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
        require
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
        do
            Result := area
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        local
            temp: ARRAYED_LIST [G]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := lower
            until
                i > upper
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure then
            equal_areas: area.is_equal (other.area)
        end

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
        require
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
        do
        end

    extend (v: G) is
            -- Add v to structure.
            -- (Precondition is False.)
        do
        end

feature {ARRAY} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
        external
            "C | %"eif_misc.h%""
        end

feature {NONE} -- Implementation

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
        require
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
        do
            Result := (area.count = 0)
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
        external
            "C | %"eif_copy.h%""
        end

invariant

    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAY [G]

General
    cluster: base.kernel
    description:
        "Sequences of values, all of the same type or of a conforming one,
        accessible through integer indices in a contiguous interval."
    create: make_from_array, make

Ancestors
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    TO_SPECIAL [T]

Queries
    infix "@" (i: INTEGER): G
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): G
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAY [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (i: INTEGER): G
    linear_representation: LINEAR [G]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] ARRAY [G]): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] ARRAY [G]
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] ARRAY [G])
    discard_items
    enter (v: [like item] G; i: INTEGER)
    fill (other: CONTAINER [G])
    force (v: [like item] G; i: INTEGER)
    grow (i: INTEGER)
    make (min_index, max_index: INTEGER)
    make_from_array (a: ARRAY [G])
    prune_all (v: G)
    put (v: [like item] G; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    subcopy (other: [like Current] ARRAY [G]; start_pos, end_pos, index_pos: INTEGER)

Constraints
    area exists
    consistent size
    non negative count
    index set has same count
    index set has same bounds

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of values, all of the same type or of a conforming one,
        accessible through integer indices in a contiguous interval.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    ARRAY [G]

create
    make,
    make_from_array

feature -- Initialization

    make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
        require
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_from_array (a: ARRAY [G]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
        require
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature {NONE} -- Initialization

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
        require
            valid_key: valid_index (i)
        do
            Result := item (i)
        end

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (item (i) /= void and then item (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (item (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
        do
            Result := upper - lower + 1
        ensure then
            consistent_with_bounds: Result = upper - lower + 1
        end

    count: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
        do
            Result := upper - lower + 1
        ensure then
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    lower: INTEGER
            -- Minimum index

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if item (i) /= void and then v.is_equal (item (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if item (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    upper: INTEGER
            -- Maximum index

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
        require -- from ANY
            other_not_void: other /= void
        local
            i: INTEGER
        do
            if lower = other.lower and then upper = other.upper and then object_comparison = other.object_comparison then
                if object_comparison then
                    from
                        Result := True
                        i := lower
                    until
                        not Result or i > upper
                    loop
                        Result := equal (item (i), other.item (i))
                        i := i + 1
                    end
                else
                    Result := area.same_items (other.area, upper - lower)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
        do
            Result := area.all_default (upper - lower)
        ensure
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May items be added?
            -- (Answer: no, although array may be resized.)
        do
            Result := False
        end

    full: BOOLEAN is
            -- Is structure filled to capacity? (Answer: yes)
        do
            Result := True
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: no.)
        do
            Result := False
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
        require
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
        do
            Result := index_set.count = count
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    enter (v: like item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
        require
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put (v, i)
        ensure
            inserted: item (i) = v
            higher_count: count >= old count
        end

    put (v: like item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature {ARRAY} -- Element change

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature -- Removal

    clear_all is
            -- Reset all items to default values.
        do
            area.clear_all
        ensure
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
        do
            make_area (capacity)
        ensure
            default_items: all_default
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
        obsolete "Not applicable since not `prunable'. Use `discard_items' instead."
            -- Make array empty.
        require -- from COLLECTION
            prunable
        do
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
        require
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        local
            temp: ARRAYED_LIST [G]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := lower
            until
                i > upper
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
        do
            Result := area
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            equal_areas: area.is_equal (other.area)
        end

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
        require
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    extend (v: G) is
            -- Add v to structure.
            -- (Precondition is False.)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    prune (v: G) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {ARRAY} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
        external
            "C | %"eif_misc.h%""
        end

feature {NONE} -- Implementation

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
        require
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
        do
            Result := (area.count = 0)
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
        external
            "C | %"eif_copy.h%""
        end

invariant

    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of values, all of the same type or of a conforming one,
        accessible through integer indices in a contiguous interval.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAY [G]

create

    make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
        require
            valid_bounds: min_index <= max_index + 1
        ensure
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [G])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
        require
            array_exists: a /= void

feature -- Initialization

    make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
        require
            valid_bounds: min_index <= max_index + 1
        ensure
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [G])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
        require
            array_exists: a /= void

feature -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): G
            -- Entry at index i, if in index interval
        require
            valid_key: valid_index (i)

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
        ensure then
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
        ensure then
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
        ensure
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
        require
            other_not_void: other /= void
        ensure
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
        require
            valid_key: valid_index (i)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
        ensure
            inserted: item (i) = v
            higher_count: count >= old count

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
        ensure
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
        ensure
            default_items: all_default

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
        require
            good_indices: min_index <= max_index
        ensure
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
        require
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAY [G]

Ancestors
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    TO_SPECIAL [T]

Descendants
    ARRAY2 [G]
    ARRAYED_LIST [G]
    ARRAYED_QUEUE [G]
    FIXED_LIST [G]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    TUPLE

Clients
    ARGUMENTS
    ARRAY [G]
    ARRAYED_LIST [G]
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BOUNDED_QUEUE [G]
    BOUNDED_STACK [G]
    COMPACT_CURSOR_TREE [G]
    DLL_32_ROUTINE
    FIBONACCI
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    HASH_TABLE [G, H -> HASHABLE]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    INTEGER_INTERVAL
    MEMORY
    PATH_NAME
    PRIMES
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    SHARED_LIBRARY_ROUTINE
    TUPLE

Suppliers
    ANY
    ARRAY [G]
    ARRAYED_LIST [G]
    BOOLEAN
    INTEGER
    INTEGER_INTERVAL
    SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of values, all of the same type or of a conforming one,
        accessible through integer indices in a contiguous interval.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAY [G]

create
    make,
    make_from_array

feature -- Initialization

    make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
        require
            valid_bounds: min_index <= max_index + 1
        ensure
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [G])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
        require
            array_exists: a /= void

feature -- Access

    item (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.

    entry (i: INTEGER): G
            -- Entry at index i, if in index interval
        require
            valid_key: valid_index (i)

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)

feature -- Measurement

    lower: INTEGER
            -- Minimum index

    upper: INTEGER
            -- Maximum index

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
        ensure then
            consistent_with_bounds: Result = upper - lower + 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
        ensure then
            consistent_with_bounds: Result = upper - lower + 1

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure then
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
        ensure
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
        require
            other_not_void: other /= void
        ensure
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)

    valid_index_set: BOOLEAN

feature -- Element change

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
        require
            valid_key: valid_index (i)

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
        ensure
            inserted: item (i) = v
            higher_count: count >= old count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    discard_items
            -- Reset all items to default values with reallocation.
        ensure
            default_items: all_default

    clear_all
            -- Reset all items to default values.
        ensure
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

feature -- Resizing

    grow (i: INTEGER)
            -- Change the capacity to at least i.

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
        require
            good_indices: min_index <= max_index
        ensure
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
        ensure then
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
        require
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BASIC_ROUTINES Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Some useful facilities on objects of basic types"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    BASIC_ROUTINES

feature -- Conversion

    charconv (i: INTEGER): CHARACTER is
            -- Character corresponding to ascii code i
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

feature -- Basic operations

    abs (n: INTEGER): INTEGER is
            -- Absolute value of n
        do
            if n < 0 then
                Result := - n
            else
                Result := n
            end
        ensure
            non_negative_result: Result >= 0
        end

    sign (n: INTEGER): INTEGER is
            -- Sign of n:
            -- -1 if n < 0
            --  0 if n = 0
            -- +1 if n > 0
        do
            if n < 0 then
                Result := - 1
            elseif n > 0 then
                Result := + 1
            end
        ensure
            correct_negative: (n < 0) = (Result = - 1)
            correct_zero: (n = 0) = (Result = 0)
            correct_positive: (n > 0) = (Result = + 1)
        end

    rsign (r: REAL): INTEGER is
            -- Sign of r:
            -- -1 if r < 0
            --  0 if r = 0
            -- +1 if r > 0
        do
            if r < 0 then
                Result := - 1
            elseif r > 0 then
                Result := + 1
            end
        ensure
            correct_negative: (r < 0) = (Result = - 1)
            correct_zero: (r = 0) = (Result = 0)
            correct_positive: (r > 0) = (Result = + 1)
        end

    bottom_int_div (n1, n2: INTEGER): INTEGER is
            -- Greatest lower bound of the integer division of n1 by n2
        external
            "C | %"eif_misc.h%""
        alias
            "bointdiv"
        end

    up_int_div (n1, n2: INTEGER): INTEGER is
            -- Least upper bound of the integer division
            -- of n1 by n2
        external
            "C | %"eif_misc.h%""
        alias
            "upintdiv"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BASIC_ROUTINES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BASIC_ROUTINES Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BASIC_ROUTINES

General
    cluster: base.kernel
    description: "Some useful facilities on objects of basic types"

Ancestors
    ANY

Queries
    abs (n: INTEGER): INTEGER
    bottom_int_div (n1, n2: INTEGER): INTEGER
    charconv (i: INTEGER): CHARACTER
    rsign (r: REAL): INTEGER
    sign (n: INTEGER): INTEGER
    up_int_div (n1, n2: INTEGER): INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BASIC_ROUTINES Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Some useful facilities on objects of basic types"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    BASIC_ROUTINES

feature -- Conversion

    charconv (i: INTEGER): CHARACTER is
            -- Character corresponding to ascii code i
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

feature -- Basic operations

    abs (n: INTEGER): INTEGER is
            -- Absolute value of n
        do
            if n < 0 then
                Result := - n
            else
                Result := n
            end
        ensure
            non_negative_result: Result >= 0
        end

    bottom_int_div (n1, n2: INTEGER): INTEGER is
            -- Greatest lower bound of the integer division of n1 by n2
        external
            "C | %"eif_misc.h%""
        alias
            "bointdiv"
        end

    rsign (r: REAL): INTEGER is
            -- Sign of r:
            -- -1 if r < 0
            --  0 if r = 0
            -- +1 if r > 0
        do
            if r < 0 then
                Result := - 1
            elseif r > 0 then
                Result := + 1
            end
        ensure
            correct_negative: (r < 0) = (Result = - 1)
            correct_zero: (r = 0) = (Result = 0)
            correct_positive: (r > 0) = (Result = + 1)
        end

    sign (n: INTEGER): INTEGER is
            -- Sign of n:
            -- -1 if n < 0
            --  0 if n = 0
            -- +1 if n > 0
        do
            if n < 0 then
                Result := - 1
            elseif n > 0 then
                Result := + 1
            end
        ensure
            correct_negative: (n < 0) = (Result = - 1)
            correct_zero: (n = 0) = (Result = 0)
            correct_positive: (n > 0) = (Result = + 1)
        end

    up_int_div (n1, n2: INTEGER): INTEGER is
            -- Least upper bound of the integer division
            -- of n1 by n2
        external
            "C | %"eif_misc.h%""
        alias
            "upintdiv"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BASIC_ROUTINES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BASIC_ROUTINES Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Some useful facilities on objects of basic types"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    BASIC_ROUTINES

feature -- Conversion

    charconv (i: INTEGER): CHARACTER
            -- Character corresponding to ascii code i

feature -- Basic operations

    abs (n: INTEGER): INTEGER
            -- Absolute value of n
        ensure
            non_negative_result: Result >= 0

    bottom_int_div (n1, n2: INTEGER): INTEGER
            -- Greatest lower bound of the integer division of n1 by n2

    rsign (r: REAL): INTEGER
            -- Sign of r:
            -- -1 if r < 0
            --  0 if r = 0
            -- +1 if r > 0
        ensure
            correct_negative: (r < 0) = (Result = - 1)
            correct_zero: (r = 0) = (Result = 0)
            correct_positive: (r > 0) = (Result = + 1)

    sign (n: INTEGER): INTEGER
            -- Sign of n:
            -- -1 if n < 0
            --  0 if n = 0
            -- +1 if n > 0
        ensure
            correct_negative: (n < 0) = (Result = - 1)
            correct_zero: (n = 0) = (Result = 0)
            correct_positive: (n > 0) = (Result = + 1)

    up_int_div (n1, n2: INTEGER): INTEGER
            -- Least upper bound of the integer division
            -- of n1 by n2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BASIC_ROUTINES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BASIC_ROUTINES Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BASIC_ROUTINES

Ancestors
    ANY

Clients
    BASIC_ROUTINES

Suppliers
    BASIC_ROUTINES
    INTEGER
    REAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BASIC_ROUTINES Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Some useful facilities on objects of basic types"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    BASIC_ROUTINES

feature -- Conversion

    charconv (i: INTEGER): CHARACTER
            -- Character corresponding to ascii code i

feature -- Basic operations

    abs (n: INTEGER): INTEGER
            -- Absolute value of n
        ensure
            non_negative_result: Result >= 0

    sign (n: INTEGER): INTEGER
            -- Sign of n:
            -- -1 if n < 0
            --  0 if n = 0
            -- +1 if n > 0
        ensure
            correct_negative: (n < 0) = (Result = - 1)
            correct_zero: (n = 0) = (Result = 0)
            correct_positive: (n > 0) = (Result = + 1)

    rsign (r: REAL): INTEGER
            -- Sign of r:
            -- -1 if r < 0
            --  0 if r = 0
            -- +1 if r > 0
        ensure
            correct_negative: (r < 0) = (Result = - 1)
            correct_zero: (r = 0) = (Result = 0)
            correct_positive: (r > 0) = (Result = + 1)

    bottom_int_div (n1, n2: INTEGER): INTEGER
            -- Greatest lower bound of the integer division of n1 by n2

    up_int_div (n1, n2: INTEGER): INTEGER
            -- Least upper bound of the integer division
            -- of n1 by n2

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BASIC_ROUTINES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BIT_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bit sequences of length `count', with binary operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    BIT_REF

inherit
    ANY
        redefine
            out,
            generator,
            conforms_to
        end

feature -- Access

    item (i: INTEGER): BOOLEAN is
            -- i-th bit
            -- Was declared in BIT_REF as synonym of @.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        do
            Result := b_item ($Current, i)
        end

    infix "@" (i: INTEGER): BOOLEAN is
            -- i-th bit
            -- Was declared in BIT_REF as synonym of item.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        do
            Result := b_item ($Current, i)
        end

    generator: STRING is
            -- Name of the current object's generating class.
        do
            create Result.make (10)
            Result.append ("BIT ")
            Result.append_integer (count)
        end

    conforms_to (other: BIT_REF): BOOLEAN is
            -- Is dynamic type of current object a descendant of
            -- dynamic type of other?
        do
            Result := count <= other.count
        end

feature -- Measurement

    count: INTEGER is
            -- Size of the current bit object
        do
            Result := b_count ($Current)
        end

feature -- Element change

    put (value: BOOLEAN; i: INTEGER) is
            -- Set the i-th bit to 1 if value is True, 0 if False
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        do
            b_put ($Current, value, i)
        ensure
            value_inserted: item (i) = value
        end

feature -- Basic operations

    infix "^" (s: INTEGER): like Current is
            -- Result of shifting bit sequence by s positions
            -- (Positive s shifts right, negative s shifts left;
            -- bits falling off the sequence's bounds are lost.)
        do
            Result := b_shift ($Current, s)
        end

    infix "#" (s: INTEGER): like Current is
            -- Result of rotating bit sequence by s positions
            -- (Positive s rotates right, negative s rotates left.)
        do
            Result := b_rotate ($Current, s)
        end

    infix "and" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit boolean conjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_and ($Current, $other)
        end

    infix "implies" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit boolean implication of other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_implies ($Current, $other)
        end

    infix "or" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit boolean disjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_or ($Current, $other)
        end

    infix "xor" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit exclusive or with other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_xor ($Current, $other)
        end

    prefix "not": like Current is
            -- Bit-by-bit negation
        do
            Result := b_not ($Current)
        end

feature -- Output

    out: STRING is
            -- Tagged printable representation.
        do
            Result := c_out ($Current)
        end

feature {NONE} -- Implementation

    b_item (a_bit: POINTER; index: INTEGER): BOOLEAN is
            -- Boolean item at position i in a_bit
        external
            "C | %"eif_bits.h%""
        end

    b_count (a_bit: POINTER): INTEGER is
            -- Size of a_bit
        external
            "C | %"eif_bits.h%""
        end

    b_shift (a_bit: POINTER; s: INTEGER): BIT_REF is
            -- Result of shifting a_bit by s positions
        external
            "C | %"eif_bits.h%""
        end

    b_rotate (a_bit: POINTER; s: INTEGER): BIT_REF is
            -- Result of rotating a_bit by s positions
        external
            "C | %"eif_bits.h%""
        end

    b_and (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Conjunction of a_bit1 with a_bit2
        external
            "C | %"eif_bits.h%""
        end

    b_implies (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Implication for a_bit1 of a_bit2
        external
            "C | %"eif_bits.h%""
        end

    b_or (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Disjunction of a_bit1 with a_bit2
        external
            "C | %"eif_bits.h%""
        end

    b_xor (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Exclusive or of a_bit1 with a_bit2
        external
            "C | %"eif_bits.h%""
        end

    b_not (a_bit: POINTER): BIT_REF is
            -- Negation of a_bit
        external
            "C | %"eif_bits.h%""
        end

    b_put (a_bit: POINTER; val: BOOLEAN; index: INTEGER) is
            -- Put val in a_bit at position index.
        external
            "C | %"eif_bits.h%""
        end

    c_out (b: POINTER): STRING is
            -- Out representation of Current
        external
            "C | %"eif_bits.h%""
        alias
            "b_eout"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BIT_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BIT_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BIT_REF

General
    cluster: base.kernel
    description: "Bit sequences of length `count', with binary operations"

Ancestors
    ANY

Queries
    infix "#" (s: INTEGER): [like Current] BIT_REF
    infix "@" (i: INTEGER): BOOLEAN
    infix "and" (other: BIT_REF): BIT_REF
    infix "implies" (other: BIT_REF): BIT_REF
    infix "or" (other: BIT_REF): BIT_REF
    infix "^" (s: INTEGER): [like Current] BIT_REF
    infix "xor" (other: BIT_REF): BIT_REF
    prefix "not": [like Current] BIT_REF
    conforms_to (other: BIT_REF): BOOLEAN
    count: INTEGER
    generator: STRING
    item (i: INTEGER): BOOLEAN
    out: STRING

Commands
    put (value: BOOLEAN; i: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BIT_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bit sequences of length `count', with binary operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    BIT_REF

feature -- Access

    conforms_to (other: BIT_REF): BOOLEAN is
            -- Is dynamic type of current object a descendant of
            -- dynamic type of other?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := count <= other.count
        end

    generator: STRING is
            -- Name of the current object's generating class.
        do
            create Result.make (10)
            Result.append ("BIT ")
            Result.append_integer (count)
        end

    item (i: INTEGER): BOOLEAN is
            -- i-th bit
            -- Was declared in BIT_REF as synonym of @.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        do
            Result := b_item ($Current, i)
        end

    infix "@" (i: INTEGER): BOOLEAN is
            -- i-th bit
            -- Was declared in BIT_REF as synonym of item.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        do
            Result := b_item ($Current, i)
        end

feature -- Measurement

    count: INTEGER is
            -- Size of the current bit object
        do
            Result := b_count ($Current)
        end

feature -- Element change

    put (value: BOOLEAN; i: INTEGER) is
            -- Set the i-th bit to 1 if value is True, 0 if False
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        do
            b_put ($Current, value, i)
        ensure
            value_inserted: item (i) = value
        end

feature -- Basic operations

    infix "#" (s: INTEGER): like Current is
            -- Result of rotating bit sequence by s positions
            -- (Positive s rotates right, negative s rotates left.)
        do
            Result := b_rotate ($Current, s)
        end

    infix "^" (s: INTEGER): like Current is
            -- Result of shifting bit sequence by s positions
            -- (Positive s shifts right, negative s shifts left;
            -- bits falling off the sequence's bounds are lost.)
        do
            Result := b_shift ($Current, s)
        end

    infix "and" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit boolean conjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_and ($Current, $other)
        end

    infix "implies" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit boolean implication of other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_implies ($Current, $other)
        end

    prefix "not": like Current is
            -- Bit-by-bit negation
        do
            Result := b_not ($Current)
        end

    infix "or" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit boolean disjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_or ($Current, $other)
        end

    infix "xor" (other: BIT_REF): BIT_REF is
            -- Bit-by-bit exclusive or with other
        require
            other_exists: other /= void
            conformance: other.count <= count
        do
            Result := b_xor ($Current, $other)
        end

feature {NONE} -- Implementation

    b_and (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Conjunction of a_bit1 with a_bit2
        external
            "C | %"eif_bits.h%""
        end

    b_count (a_bit: POINTER): INTEGER is
            -- Size of a_bit
        external
            "C | %"eif_bits.h%""
        end

    b_implies (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Implication for a_bit1 of a_bit2
        external
            "C | %"eif_bits.h%""
        end

    b_item (a_bit: POINTER; index: INTEGER): BOOLEAN is
            -- Boolean item at position i in a_bit
        external
            "C | %"eif_bits.h%""
        end

    b_not (a_bit: POINTER): BIT_REF is
            -- Negation of a_bit
        external
            "C | %"eif_bits.h%""
        end

    b_or (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Disjunction of a_bit1 with a_bit2
        external
            "C | %"eif_bits.h%""
        end

    b_put (a_bit: POINTER; val: BOOLEAN; index: INTEGER) is
            -- Put val in a_bit at position index.
        external
            "C | %"eif_bits.h%""
        end

    b_rotate (a_bit: POINTER; s: INTEGER): BIT_REF is
            -- Result of rotating a_bit by s positions
        external
            "C | %"eif_bits.h%""
        end

    b_shift (a_bit: POINTER; s: INTEGER): BIT_REF is
            -- Result of shifting a_bit by s positions
        external
            "C | %"eif_bits.h%""
        end

    b_xor (a_bit1, a_bit2: POINTER): BIT_REF is
            -- Exclusive or of a_bit1 with a_bit2
        external
            "C | %"eif_bits.h%""
        end

    c_out (b: POINTER): STRING is
            -- Out representation of Current
        external
            "C | %"eif_bits.h%""
        alias
            "b_eout"
        end

feature -- Output

    out: STRING is
            -- Tagged printable representation.
        do
            Result := c_out ($Current)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BIT_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BIT_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bit sequences of length `count', with binary operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    BIT_REF

feature -- Access

    conforms_to (other: BIT_REF): BOOLEAN
            -- Is dynamic type of current object a descendant of
            -- dynamic type of other?
        require -- from ANY
            other_not_void: other /= void

    generator: STRING
            -- Name of the current object's generating class.

    item (i: INTEGER): BOOLEAN
            -- i-th bit
            -- Was declared in BIT_REF as synonym of @.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count

    infix "@" (i: INTEGER): BOOLEAN
            -- i-th bit
            -- Was declared in BIT_REF as synonym of item.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count

feature -- Measurement

    count: INTEGER
            -- Size of the current bit object

feature -- Element change

    put (value: BOOLEAN; i: INTEGER)
            -- Set the i-th bit to 1 if value is True, 0 if False
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        ensure
            value_inserted: item (i) = value

feature -- Basic operations

    infix "#" (s: INTEGER): like Current
            -- Result of rotating bit sequence by s positions
            -- (Positive s rotates right, negative s rotates left.)

    infix "^" (s: INTEGER): like Current
            -- Result of shifting bit sequence by s positions
            -- (Positive s shifts right, negative s shifts left;
            -- bits falling off the sequence's bounds are lost.)

    infix "and" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean conjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "implies" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean implication of other
        require
            other_exists: other /= void
            conformance: other.count <= count

    prefix "not": like Current
            -- Bit-by-bit negation

    infix "or" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean disjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "xor" (other: BIT_REF): BIT_REF
            -- Bit-by-bit exclusive or with other
        require
            other_exists: other /= void
            conformance: other.count <= count

feature -- Output

    out: STRING
            -- Tagged printable representation.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BIT_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BIT_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BIT_REF

Ancestors
    ANY

Clients
    BIT_REF

Suppliers
    BIT_REF
    INTEGER
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BIT_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bit sequences of length `count', with binary operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    BIT_REF

feature -- Access

    item (i: INTEGER): BOOLEAN
            -- i-th bit
            -- Was declared in BIT_REF as synonym of @.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count

    infix "@" (i: INTEGER): BOOLEAN
            -- i-th bit
            -- Was declared in BIT_REF as synonym of item.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count

    generator: STRING
            -- Name of the current object's generating class.

    conforms_to (other: BIT_REF): BOOLEAN
            -- Is dynamic type of current object a descendant of
            -- dynamic type of other?

feature -- Measurement

    count: INTEGER
            -- Size of the current bit object

feature -- Element change

    put (value: BOOLEAN; i: INTEGER)
            -- Set the i-th bit to 1 if value is True, 0 if False
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        ensure
            value_inserted: item (i) = value

feature -- Basic operations

    infix "^" (s: INTEGER): like Current
            -- Result of shifting bit sequence by s positions
            -- (Positive s shifts right, negative s shifts left;
            -- bits falling off the sequence's bounds are lost.)

    infix "#" (s: INTEGER): like Current
            -- Result of rotating bit sequence by s positions
            -- (Positive s rotates right, negative s rotates left.)

    infix "and" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean conjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "implies" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean implication of other
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "or" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean disjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "xor" (other: BIT_REF): BIT_REF
            -- Bit-by-bit exclusive or with other
        require
            other_exists: other /= void
            conformance: other.count <= count

    prefix "not": like Current
            -- Bit-by-bit negation

feature -- Output

    out: STRING
            -- Tagged printable representation.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BIT_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Truth values, with the boolean operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class
    BOOLEAN

inherit
    BOOLEAN_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    BOOLEAN

General
    cluster: base.kernel
    description: "Truth values, with the boolean operations"

Ancestors
    BOOLEAN_REF

Queries
    infix "and" (other: [like Current] BOOLEAN): BOOLEAN
    infix "and then" (other: [like Current] BOOLEAN): BOOLEAN
    infix "implies" (other: [like Current] BOOLEAN): BOOLEAN
    infix "or" (other: [like Current] BOOLEAN): BOOLEAN
    infix "or else" (other: [like Current] BOOLEAN): BOOLEAN
    infix "xor" (other: [like Current] BOOLEAN): BOOLEAN
    prefix "not": [like Current] BOOLEAN
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: BOOLEAN
    out: STRING
    to_integer: INTEGER

Commands
    set_item (b: BOOLEAN)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Truth values, with the boolean operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class
    BOOLEAN

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
            -- (from BOOLEAN_REF)
        do
            Result := 1
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: BOOLEAN
            -- Boolean value
            -- (from BOOLEAN_REF)

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from BOOLEAN_REF)
        do
            Result := item
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (b: BOOLEAN) is
            -- Make b the item value.
            -- (from BOOLEAN_REF)
        do
            item := b
        end

feature -- Conversion

    to_integer: INTEGER is
            -- 1 if True
            -- 0 if False
            -- (from BOOLEAN_REF)
        do
            if item then
                Result := 1
            end
        ensure -- from BOOLEAN_REF
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1
        end

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN is
            -- Boolean conjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        do
            Result := item and other.item
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)
        end

    infix "and then" (other: like Current): BOOLEAN is
            -- Boolean semi-strict conjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        do
            Result := item and then other.item
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current or else not other)
        end

    infix "implies" (other: like Current): BOOLEAN is
            -- Boolean implication of other
            -- (semi-strict)
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        do
            Result := item implies other.item
        ensure -- from BOOLEAN_REF
            definition: Result = (not Current or else other)
        end

    prefix "not": like Current is
            -- Negation
            -- (from BOOLEAN_REF)
        do
            create Result
            Result.set_item (not item)
        end

    infix "or" (other: like Current): BOOLEAN is
            -- Boolean disjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        do
            Result := item or other.item
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)
        end

    infix "or else" (other: like Current): BOOLEAN is
            -- Boolean semi-strict disjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        do
            Result := item or else other.item
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current and then not other)
        end

    infix "xor" (other: like Current): BOOLEAN is
            -- Boolean exclusive or with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        do
            Result := item xor other.item
        ensure -- from BOOLEAN_REF
            definition: Result = ((Current or other) and not (Current and other))
        end

feature -- Output

    out: STRING is
            -- Printable representation of boolean
            -- (from BOOLEAN_REF)
        do
            if item then
                Result := "True"
            else
                Result := "False"
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOOLEAN_REF
    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Truth values, with the boolean operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    BOOLEAN

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from BOOLEAN_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: BOOLEAN
            -- Boolean value
            -- (from BOOLEAN_REF)

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from BOOLEAN_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (b: BOOLEAN)
            -- Make b the item value.
            -- (from BOOLEAN_REF)

feature -- Conversion

    to_integer: INTEGER
            -- 1 if True
            -- 0 if False
            -- (from BOOLEAN_REF)
        ensure -- from BOOLEAN_REF
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN
            -- Boolean conjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)

    infix "and then" (other: like Current): BOOLEAN
            -- Boolean semi-strict conjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current or else not other)

    infix "implies" (other: like Current): BOOLEAN
            -- Boolean implication of other
            -- (semi-strict)
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            definition: Result = (not Current or else other)

    prefix "not": like Current
            -- Negation
            -- (from BOOLEAN_REF)

    infix "or" (other: like Current): BOOLEAN
            -- Boolean disjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)

    infix "or else" (other: like Current): BOOLEAN
            -- Boolean semi-strict disjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current and then not other)

    infix "xor" (other: like Current): BOOLEAN
            -- Boolean exclusive or with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            definition: Result = ((Current or other) and not (Current and other))

feature -- Output

    out: STRING
            -- Printable representation of boolean
            -- (from BOOLEAN_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOOLEAN_REF
    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    BOOLEAN

Ancestors
    BOOLEAN_REF

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ACTIVE [G]
    ANY
    ARGUMENTS
    ARRAY [G]
    ARRAY2 [G]
    ARRAYED_CIRCULAR [G]
    ARRAYED_LIST [G]
    ARRAYED_QUEUE [G]
    ARRAYED_SET [G]
    ARRAYED_TREE [G]
    BI_LINKABLE [G]
    BILINEAR [G]
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    BINARY_TREE [G]
    BOOLEAN_REF
    BOUNDED_QUEUE [G]
    BOUNDED_STACK [G]
    CHAIN [G]
    CIRCULAR [G]
    COLLECTION [G]
    COMPACT_CURSOR_TREE [G]
    COMPARABLE
    COMPARABLE_SET [G -> COMPARABLE]
    COMPARABLE_STRUCT [G -> COMPARABLE]
    CONTAINER [G]
    CURSOR_TREE [G]
    DIRECTORY
    DISPENSER [G]
    DLL_32
    DLL_32_ROUTINE
    DOUBLE_REF
    DYNAMIC_CHAIN [G]
    DYNAMIC_LIST [G]
    DYNAMIC_TREE [G]
    EXCEPTIONS
    EXECUTION_ENVIRONMENT
    FILE
    FILE_NAME
    FIXED [G]
    FIXED_LIST [G]
    FIXED_TREE [G]
    FORMAT_DOUBLE
    FORMAT_INTEGER
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    HASH_TABLE [G, H -> HASHABLE]
    HASHABLE
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    HIERARCHICAL [G]
    IDENTIFIED
    INDEXABLE [G, H -> INTEGER]
    INFINITE [G]
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_INTERVAL
    INTEGER_REF
    INTERACTIVE_LIST [G]
    INTERNAL
    IO_MEDIUM
    LINEAR [G]
    LINEAR_ITERATOR [G]
    LINEAR_SUBSET [G]
    LINKED_CIRCULAR [G]
    LINKED_CURSOR_TREE [G]
    LINKED_LIST [G]
    LINKED_LIST_CURSOR [G]
    LINKED_QUEUE [G]
    LINKED_SET [G]
    LINKED_STACK [G]
    LINKED_TREE [G]
    LIST [G]
    MEMORY
    MULTI_ARRAY_LIST [G]
    PART_COMPARABLE
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    PART_SORTED_SET [G -> PART_COMPARABLE]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
    PATH_NAME
    PRIMES
    RANDOM
    RAW_FILE
    REAL_REF
    RECURSIVE_CURSOR_TREE [G]
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    SEQ_STRING
    SEQUENCE [G]
    SET [G]
    SHARED_LIBRARY
    SHARED_LIBRARY_ROUTINE
    SORTED_LIST [G -> COMPARABLE]
    SORTED_STRUCT [G -> COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
    SPECIAL [T]
    STACK [G]
    STORABLE
    STRING
    SUBSET [G]
    SUBSET_STRATEGY [G]
    SUBSET_STRATEGY_GENERIC [G]
    SUBSET_STRATEGY_HASHABLE [G]
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]
    TO_SPECIAL [T]
    TRAVERSABLE [G]
    TRAVERSABLE_SUBSET [G]
    TREE [G]
    TUPLE
    TWO_WAY_CURSOR_TREE [G]
    TWO_WAY_LIST [G]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]
    TWO_WAY_TREE [G]
    UNIX_SIGNALS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a boolean value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    BOOLEAN_REF

inherit
    HASHABLE
        redefine
            is_hashable,
            out
        end

feature -- Access

    item: BOOLEAN
            -- Boolean value

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := 1
        end

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item
        end

feature -- Conversion

    to_integer: INTEGER is
            -- 1 if True
            -- 0 if False
        do
            if item then
                Result := 1
            end
        ensure
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1
        end

feature -- Element change

    set_item (b: BOOLEAN) is
            -- Make b the item value.
        do
            item := b
        end

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN is
            -- Boolean conjunction with other
        require
            other_exists: other /= void
        do
            Result := item and other.item
        ensure
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)
        end

    infix "and then" (other: like Current): BOOLEAN is
            -- Boolean semi-strict conjunction with other
        require
            other_exists: other /= void
        do
            Result := item and then other.item
        ensure
            de_morgan: Result = not (not Current or else not other)
        end

    infix "implies" (other: like Current): BOOLEAN is
            -- Boolean implication of other
            -- (semi-strict)
        require
            other_exists: other /= void
        do
            Result := item implies other.item
        ensure
            definition: Result = (not Current or else other)
        end

    prefix "not": like Current is
            -- Negation
        do
            create Result
            Result.set_item (not item)
        end

    infix "or" (other: like Current): BOOLEAN is
            -- Boolean disjunction with other
        require
            other_exists: other /= void
        do
            Result := item or other.item
        ensure
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)
        end

    infix "or else" (other: like Current): BOOLEAN is
            -- Boolean semi-strict disjunction with other
        require
            other_exists: other /= void
        do
            Result := item or else other.item
        ensure
            de_morgan: Result = not (not Current and then not other)
        end

    infix "xor" (other: like Current): BOOLEAN is
            -- Boolean exclusive or with other
        require
            other_exists: other /= void
        do
            Result := item xor other.item
        ensure
            definition: Result = ((Current or other) and not (Current and other))
        end

feature -- Output

    out: STRING is
            -- Printable representation of boolean
        do
            if item then
                Result := "True"
            else
                Result := "False"
            end
        end

invariant

    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOOLEAN_REF

General
    cluster: base.kernel
    description: "References to objects containing a boolean value"

Ancestors
    HASHABLE

Queries
    infix "and" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "and then" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "implies" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "or" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "or else" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "xor" (other: [like Current] BOOLEAN_REF): BOOLEAN
    prefix "not": [like Current] BOOLEAN_REF
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: BOOLEAN
    out: STRING
    to_integer: INTEGER

Commands
    set_item (b: BOOLEAN)

Constraints
    involutive negation
    non contradiction
    completeness

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a boolean value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    BOOLEAN_REF

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := 1
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: BOOLEAN
            -- Boolean value

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (b: BOOLEAN) is
            -- Make b the item value.
        do
            item := b
        end

feature -- Conversion

    to_integer: INTEGER is
            -- 1 if True
            -- 0 if False
        do
            if item then
                Result := 1
            end
        ensure
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1
        end

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN is
            -- Boolean conjunction with other
        require
            other_exists: other /= void
        do
            Result := item and other.item
        ensure
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)
        end

    infix "and then" (other: like Current): BOOLEAN is
            -- Boolean semi-strict conjunction with other
        require
            other_exists: other /= void
        do
            Result := item and then other.item
        ensure
            de_morgan: Result = not (not Current or else not other)
        end

    infix "implies" (other: like Current): BOOLEAN is
            -- Boolean implication of other
            -- (semi-strict)
        require
            other_exists: other /= void
        do
            Result := item implies other.item
        ensure
            definition: Result = (not Current or else other)
        end

    prefix "not": like Current is
            -- Negation
        do
            create Result
            Result.set_item (not item)
        end

    infix "or" (other: like Current): BOOLEAN is
            -- Boolean disjunction with other
        require
            other_exists: other /= void
        do
            Result := item or other.item
        ensure
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)
        end

    infix "or else" (other: like Current): BOOLEAN is
            -- Boolean semi-strict disjunction with other
        require
            other_exists: other /= void
        do
            Result := item or else other.item
        ensure
            de_morgan: Result = not (not Current and then not other)
        end

    infix "xor" (other: like Current): BOOLEAN is
            -- Boolean exclusive or with other
        require
            other_exists: other /= void
        do
            Result := item xor other.item
        ensure
            definition: Result = ((Current or other) and not (Current and other))
        end

feature -- Output

    out: STRING is
            -- Printable representation of boolean
        do
            if item then
                Result := "True"
            else
                Result := "False"
            end
        end

invariant

    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a boolean value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    BOOLEAN_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: BOOLEAN
            -- Boolean value

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (b: BOOLEAN)
            -- Make b the item value.

feature -- Conversion

    to_integer: INTEGER
            -- 1 if True
            -- 0 if False
        ensure
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN
            -- Boolean conjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)

    infix "and then" (other: like Current): BOOLEAN
            -- Boolean semi-strict conjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current or else not other)

    infix "implies" (other: like Current): BOOLEAN
            -- Boolean implication of other
            -- (semi-strict)
        require
            other_exists: other /= void
        ensure
            definition: Result = (not Current or else other)

    prefix "not": like Current
            -- Negation

    infix "or" (other: like Current): BOOLEAN
            -- Boolean disjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)

    infix "or else" (other: like Current): BOOLEAN
            -- Boolean semi-strict disjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current and then not other)

    infix "xor" (other: like Current): BOOLEAN
            -- Boolean exclusive or with other
        require
            other_exists: other /= void
        ensure
            definition: Result = ((Current or other) and not (Current and other))

feature -- Output

    out: STRING
            -- Printable representation of boolean

invariant

    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOOLEAN_REF

Ancestors
    HASHABLE

Descendants
    BOOLEAN

Clients
    BOOLEAN_REF
    DLL_32_ROUTINE
    TUPLE

Suppliers
    BOOLEAN
    BOOLEAN_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a boolean value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    BOOLEAN_REF

feature -- Access

    item: BOOLEAN
            -- Boolean value

    hash_code: INTEGER
            -- Hash code value

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Conversion

    to_integer: INTEGER
            -- 1 if True
            -- 0 if False
        ensure
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1

feature -- Element change

    set_item (b: BOOLEAN)
            -- Make b the item value.

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN
            -- Boolean conjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)

    infix "and then" (other: like Current): BOOLEAN
            -- Boolean semi-strict conjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current or else not other)

    infix "implies" (other: like Current): BOOLEAN
            -- Boolean implication of other
            -- (semi-strict)
        require
            other_exists: other /= void
        ensure
            definition: Result = (not Current or else other)

    prefix "not": like Current
            -- Negation

    infix "or" (other: like Current): BOOLEAN
            -- Boolean disjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)

    infix "or else" (other: like Current): BOOLEAN
            -- Boolean semi-strict disjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current and then not other)

    infix "xor" (other: like Current): BOOLEAN
            -- Boolean exclusive or with other
        require
            other_exists: other /= void
        ensure
            definition: Result = ((Current or other) and not (Current and other))

feature -- Output

    out: STRING
            -- Printable representation of boolean

invariant

    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOLEAN Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Truth values, with the boolean operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    BOOLEAN

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Characters, with comparison operations and an ASCII code"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class
    CHARACTER

inherit
    CHARACTER_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    CHARACTER

General
    cluster: base.kernel
    description: "Characters, with comparison operations and an ASCII code"

Ancestors
    CHARACTER_REF

Queries
    infix ">=" (other: [like Current] CHARACTER): BOOLEAN
    infix ">" (other: [like Current] CHARACTER): BOOLEAN
    infix "<=" (other: [like Current] CHARACTER): BOOLEAN
    infix "<" (other: [like Current] CHARACTER): BOOLEAN
    infix "-" (decr: INTEGER): CHARACTER
    infix "+" (incr: INTEGER): CHARACTER
    infix "|-|" (other: CHARACTER): INTEGER
    code: INTEGER
    hash_code: INTEGER
    is_alpha: BOOLEAN
    is_digit: BOOLEAN
    is_equal (other: [like Current] CHARACTER): BOOLEAN
    is_hashable: BOOLEAN
    is_lower: BOOLEAN
    is_upper: BOOLEAN
    item: CHARACTER
    lower: CHARACTER
    max (other: [like Current] CHARACTER): [like Current] CHARACTER
    min (other: [like Current] CHARACTER): [like Current] CHARACTER
    next: CHARACTER
    out: STRING
    previous: CHARACTER
    three_way_comparison (other: CHARACTER_REF): INTEGER
    upper: CHARACTER

Commands
    set_item (c: CHARACTER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Characters, with comparison operations and an ASCII code"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class
    CHARACTER

feature -- Access

    code: INTEGER is
            -- Associated integer value
            -- (from CHARACTER_REF)
        do
            Result := chcode (item)
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from CHARACTER_REF)
        do
            Result := code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: CHARACTER
            -- Character value
            -- (from CHARACTER_REF)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from CHARACTER_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: CHARACTER_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from CHARACTER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current character?
            -- (from CHARACTER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        ensure then -- from CHARACTER_REF
            definition: Result = (code < other.code)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    is_alpha: BOOLEAN is
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower
            -- (from CHARACTER_REF)
        do
            Result := chis_alpha (item)
        end

    is_digit: BOOLEAN is
            -- Is item a digit?
            -- A digit is one of 0123456789
            -- (from CHARACTER_REF)
        do
            Result := chis_digit (item)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from CHARACTER_REF)
        do
            Result := item /= '%U'
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    is_lower: BOOLEAN is
            -- Is item lowercase?
            -- (from CHARACTER_REF)
        do
            Result := chis_lower (item)
        end

    is_upper: BOOLEAN is
            -- Is item uppercase?
            -- (from CHARACTER_REF)
        do
            Result := chis_upper (item)
        end

feature -- Element change

    set_item (c: CHARACTER) is
            -- Make c the item value.
            -- (from CHARACTER_REF)
        do
            item := c
        end

feature -- Conversion

    lower: CHARACTER is
            -- Lowercase value of item
            -- Returns item if not is_upper
            -- (from CHARACTER_REF)
        do
            Result := chlower (item)
        end

    upper: CHARACTER is
            -- Uppercase value of item
            -- Returns item if not is_lower
            -- (from CHARACTER_REF)
        do
            Result := chupper (item)
        end

feature {NONE} -- Implementation

    c_outc (c: CHARACTER): STRING is
            -- Printable representation of character
            -- (from CHARACTER_REF)
        external
            "C | %"eif_out.h%""
        end

    chcode (c: like item): INTEGER is
            -- Associated integer value
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    chconv (i: INTEGER): CHARACTER is
            -- Character associated with integer value i
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_alpha (c: CHARACTER): BOOLEAN is
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_digit (c: CHARACTER): BOOLEAN is
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_lower (c: CHARACTER): BOOLEAN is
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_upper (c: CHARACTER): BOOLEAN is
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    chlower (c: CHARACTER): CHARACTER is
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    chupper (c: CHARACTER): CHARACTER is
            -- (from CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Basic routines

    next: CHARACTER is
            -- Next character
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_character: item /= 'ÿ'
        do
            Result := item + 1
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = 1
        end

    previous: CHARACTER is
            -- Previous character
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_character: item /= '%U'
        do
            Result := item - 1
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = - 1
        end

    infix "+" (incr: INTEGER): CHARACTER is
            -- Add incr to the code of item
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_upper_increment: item.code + incr <= 255
            valid_lower_increment: item.code + incr >= 0
        do
            Result := chconv (chcode (item) + incr)
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = incr
        end

    infix "-" (decr: INTEGER): CHARACTER is
            -- Subtract decr to the code of item
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_upper_decrement: item.code - decr <= 255
            valid_lower_decrement: item.code - decr >= 0
        do
            Result := chconv (chcode (item) - decr)
        ensure -- from CHARACTER_REF
            valid_result: item |-| Result = decr
        end

    infix "|-|" (other: CHARACTER): INTEGER is
            -- Difference between the codes of item and other
            -- (from CHARACTER_REF)
        do
            Result := chcode (item) - chcode (other)
        ensure -- from CHARACTER_REF
            valid_result: other + Result = item
        end

feature -- Output

    out: STRING is
            -- Printable representation of character
            -- (from CHARACTER_REF)
        do
            Result := c_outc (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Characters, with comparison operations and an ASCII code"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    CHARACTER

feature -- Access

    code: INTEGER
            -- Associated integer value
            -- (from CHARACTER_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from CHARACTER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: CHARACTER
            -- Character value
            -- (from CHARACTER_REF)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from CHARACTER_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from CHARACTER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
            -- (from CHARACTER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        ensure then -- from CHARACTER_REF
            definition: Result = (code < other.code)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    is_alpha: BOOLEAN
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower
            -- (from CHARACTER_REF)

    is_digit: BOOLEAN
            -- Is item a digit?
            -- A digit is one of 0123456789
            -- (from CHARACTER_REF)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from CHARACTER_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_lower: BOOLEAN
            -- Is item lowercase?
            -- (from CHARACTER_REF)

    is_upper: BOOLEAN
            -- Is item uppercase?
            -- (from CHARACTER_REF)

feature -- Element change

    set_item (c: CHARACTER)
            -- Make c the item value.
            -- (from CHARACTER_REF)

feature -- Conversion

    lower: CHARACTER
            -- Lowercase value of item
            -- Returns item if not is_upper
            -- (from CHARACTER_REF)

    upper: CHARACTER
            -- Uppercase value of item
            -- Returns item if not is_lower
            -- (from CHARACTER_REF)

feature -- Basic routines

    next: CHARACTER
            -- Next character
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_character: item /= 'ÿ'
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = 1

    previous: CHARACTER
            -- Previous character
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_character: item /= '%U'
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = - 1

    infix "+" (incr: INTEGER): CHARACTER
            -- Add incr to the code of item
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_upper_increment: item.code + incr <= 255
            valid_lower_increment: item.code + incr >= 0
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = incr

    infix "-" (decr: INTEGER): CHARACTER
            -- Subtract decr to the code of item
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_upper_decrement: item.code - decr <= 255
            valid_lower_decrement: item.code - decr >= 0
        ensure -- from CHARACTER_REF
            valid_result: item |-| Result = decr

    infix "|-|" (other: CHARACTER): INTEGER
            -- Difference between the codes of item and other
            -- (from CHARACTER_REF)
        ensure -- from CHARACTER_REF
            valid_result: other + Result = item

feature -- Output

    out: STRING
            -- Printable representation of character
            -- (from CHARACTER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    CHARACTER

Ancestors
    CHARACTER_REF

Clients
    CHARACTER_REF
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    CHARACTER_REF

inherit
    COMPARABLE
        redefine
            out,
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            out,
            is_equal
        end

feature -- Access

    item: CHARACTER
            -- Character value

    code: INTEGER is
            -- Associated integer value
        do
            Result := chcode (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := code
        end

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= '%U'
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current character?
        do
            Result := item < other.item
        ensure then
            definition: Result = (code < other.code)
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: CHARACTER_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Basic routines

    infix "+" (incr: INTEGER): CHARACTER is
            -- Add incr to the code of item
        require
            valid_upper_increment: item.code + incr <= 255
            valid_lower_increment: item.code + incr >= 0
        do
            Result := chconv (chcode (item) + incr)
        ensure
            valid_result: Result |-| item = incr
        end

    infix "-" (decr: INTEGER): CHARACTER is
            -- Subtract decr to the code of item
        require
            valid_upper_decrement: item.code - decr <= 255
            valid_lower_decrement: item.code - decr >= 0
        do
            Result := chconv (chcode (item) - decr)
        ensure
            valid_result: item |-| Result = decr
        end

    infix "|-|" (other: CHARACTER): INTEGER is
            -- Difference between the codes of item and other
        do
            Result := chcode (item) - chcode (other)
        ensure
            valid_result: other + Result = item
        end

    next: CHARACTER is
            -- Next character
        require
            valid_character: item /= 'ÿ'
        do
            Result := item + 1
        ensure
            valid_result: Result |-| item = 1
        end

    previous: CHARACTER is
            -- Previous character
        require
            valid_character: item /= '%U'
        do
            Result := item - 1
        ensure
            valid_result: Result |-| item = - 1
        end

feature -- Element change

    set_item (c: CHARACTER) is
            -- Make c the item value.
        do
            item := c
        end

feature -- Output

    out: STRING is
            -- Printable representation of character
        do
            Result := c_outc (item)
        end

feature -- Conversion

    upper: CHARACTER is
            -- Uppercase value of item
            -- Returns item if not is_lower
        do
            Result := chupper (item)
        end

    lower: CHARACTER is
            -- Lowercase value of item
            -- Returns item if not is_upper
        do
            Result := chlower (item)
        end

feature -- Status report

    is_lower: BOOLEAN is
            -- Is item lowercase?
        do
            Result := chis_lower (item)
        end

    is_upper: BOOLEAN is
            -- Is item uppercase?
        do
            Result := chis_upper (item)
        end

    is_digit: BOOLEAN is
            -- Is item a digit?
            -- A digit is one of 0123456789
        do
            Result := chis_digit (item)
        end

    is_alpha: BOOLEAN is
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower
        do
            Result := chis_alpha (item)
        end

feature {NONE} -- Implementation

    chcode (c: like item): INTEGER is
            -- Associated integer value
        external
            "C [macro %"eif_misc.h%"]"
        end

    chconv (i: INTEGER): CHARACTER is
            -- Character associated with integer value i
        external
            "C [macro %"eif_misc.h%"]"
        end

    c_outc (c: CHARACTER): STRING is
            -- Printable representation of character
        external
            "C | %"eif_out.h%""
        end

    chupper (c: CHARACTER): CHARACTER is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chlower (c: CHARACTER): CHARACTER is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_lower (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_upper (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_digit (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_alpha (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CHARACTER_REF

General
    cluster: base.kernel
    description: "References to objects containing a character value"

Ancestors
    COMPARABLE
    HASHABLE

Queries
    infix ">=" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix ">" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix "<=" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix "<" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix "-" (decr: INTEGER): CHARACTER
    infix "+" (incr: INTEGER): CHARACTER
    infix "|-|" (other: CHARACTER): INTEGER
    code: INTEGER
    hash_code: INTEGER
    is_alpha: BOOLEAN
    is_digit: BOOLEAN
    is_equal (other: [like Current] CHARACTER_REF): BOOLEAN
    is_hashable: BOOLEAN
    is_lower: BOOLEAN
    is_upper: BOOLEAN
    item: CHARACTER
    lower: CHARACTER
    max (other: [like Current] CHARACTER_REF): [like Current] CHARACTER_REF
    min (other: [like Current] CHARACTER_REF): [like Current] CHARACTER_REF
    next: CHARACTER
    out: STRING
    previous: CHARACTER
    three_way_comparison (other: CHARACTER_REF): INTEGER
    upper: CHARACTER

Commands
    set_item (c: CHARACTER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    CHARACTER_REF

feature -- Access

    code: INTEGER is
            -- Associated integer value
        do
            Result := chcode (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: CHARACTER
            -- Character value

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: CHARACTER_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current character?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        ensure then
            definition: Result = (code < other.code)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    is_alpha: BOOLEAN is
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower
        do
            Result := chis_alpha (item)
        end

    is_digit: BOOLEAN is
            -- Is item a digit?
            -- A digit is one of 0123456789
        do
            Result := chis_digit (item)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= '%U'
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    is_lower: BOOLEAN is
            -- Is item lowercase?
        do
            Result := chis_lower (item)
        end

    is_upper: BOOLEAN is
            -- Is item uppercase?
        do
            Result := chis_upper (item)
        end

feature -- Element change

    set_item (c: CHARACTER) is
            -- Make c the item value.
        do
            item := c
        end

feature -- Conversion

    lower: CHARACTER is
            -- Lowercase value of item
            -- Returns item if not is_upper
        do
            Result := chlower (item)
        end

    upper: CHARACTER is
            -- Uppercase value of item
            -- Returns item if not is_lower
        do
            Result := chupper (item)
        end

feature {NONE} -- Implementation

    c_outc (c: CHARACTER): STRING is
            -- Printable representation of character
        external
            "C | %"eif_out.h%""
        end

    chcode (c: like item): INTEGER is
            -- Associated integer value
        external
            "C [macro %"eif_misc.h%"]"
        end

    chconv (i: INTEGER): CHARACTER is
            -- Character associated with integer value i
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_alpha (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_digit (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_lower (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chis_upper (c: CHARACTER): BOOLEAN is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chlower (c: CHARACTER): CHARACTER is
        external
            "C [macro %"eif_misc.h%"]"
        end

    chupper (c: CHARACTER): CHARACTER is
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Basic routines

    next: CHARACTER is
            -- Next character
        require
            valid_character: item /= 'ÿ'
        do
            Result := item + 1
        ensure
            valid_result: Result |-| item = 1
        end

    previous: CHARACTER is
            -- Previous character
        require
            valid_character: item /= '%U'
        do
            Result := item - 1
        ensure
            valid_result: Result |-| item = - 1
        end

    infix "+" (incr: INTEGER): CHARACTER is
            -- Add incr to the code of item
        require
            valid_upper_increment: item.code + incr <= 255
            valid_lower_increment: item.code + incr >= 0
        do
            Result := chconv (chcode (item) + incr)
        ensure
            valid_result: Result |-| item = incr
        end

    infix "-" (decr: INTEGER): CHARACTER is
            -- Subtract decr to the code of item
        require
            valid_upper_decrement: item.code - decr <= 255
            valid_lower_decrement: item.code - decr >= 0
        do
            Result := chconv (chcode (item) - decr)
        ensure
            valid_result: item |-| Result = decr
        end

    infix "|-|" (other: CHARACTER): INTEGER is
            -- Difference between the codes of item and other
        do
            Result := chcode (item) - chcode (other)
        ensure
            valid_result: other + Result = item
        end

feature -- Output

    out: STRING is
            -- Printable representation of character
        do
            Result := c_outc (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    CHARACTER_REF

feature -- Access

    code: INTEGER
            -- Associated integer value

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: CHARACTER
            -- Character value

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        ensure then
            definition: Result = (code < other.code)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    is_alpha: BOOLEAN
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower

    is_digit: BOOLEAN
            -- Is item a digit?
            -- A digit is one of 0123456789

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_lower: BOOLEAN
            -- Is item lowercase?

    is_upper: BOOLEAN
            -- Is item uppercase?

feature -- Element change

    set_item (c: CHARACTER)
            -- Make c the item value.

feature -- Conversion

    lower: CHARACTER
            -- Lowercase value of item
            -- Returns item if not is_upper

    upper: CHARACTER
            -- Uppercase value of item
            -- Returns item if not is_lower

feature -- Basic routines

    next: CHARACTER
            -- Next character
        require
            valid_character: item /= 'ÿ'
        ensure
            valid_result: Result |-| item = 1

    previous: CHARACTER
            -- Previous character
        require
            valid_character: item /= '%U'
        ensure
            valid_result: Result |-| item = - 1

    infix "+" (incr: INTEGER): CHARACTER
            -- Add incr to the code of item
        require
            valid_upper_increment: item.code + incr <= 255
            valid_lower_increment: item.code + incr >= 0
        ensure
            valid_result: Result |-| item = incr

    infix "-" (decr: INTEGER): CHARACTER
            -- Subtract decr to the code of item
        require
            valid_upper_decrement: item.code - decr <= 255
            valid_lower_decrement: item.code - decr >= 0
        ensure
            valid_result: item |-| Result = decr

    infix "|-|" (other: CHARACTER): INTEGER
            -- Difference between the codes of item and other
        ensure
            valid_result: other + Result = item

feature -- Output

    out: STRING
            -- Printable representation of character

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CHARACTER_REF

Ancestors
    COMPARABLE
    HASHABLE

Descendants
    CHARACTER

Clients
    ARGUMENTS
    CHARACTER_REF
    DLL_32_ROUTINE
    TUPLE

Suppliers
    CHARACTER
    CHARACTER_REF
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    CHARACTER_REF

feature -- Access

    item: CHARACTER
            -- Character value

    code: INTEGER
            -- Associated integer value

    hash_code: INTEGER
            -- Hash code value

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
        ensure then
            definition: Result = (code < other.code)

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1

feature -- Basic routines

    infix "+" (incr: INTEGER): CHARACTER
            -- Add incr to the code of item
        require
            valid_upper_increment: item.code + incr <= 255
            valid_lower_increment: item.code + incr >= 0
        ensure
            valid_result: Result |-| item = incr

    infix "-" (decr: INTEGER): CHARACTER
            -- Subtract decr to the code of item
        require
            valid_upper_decrement: item.code - decr <= 255
            valid_lower_decrement: item.code - decr >= 0
        ensure
            valid_result: item |-| Result = decr

    infix "|-|" (other: CHARACTER): INTEGER
            -- Difference between the codes of item and other
        ensure
            valid_result: other + Result = item

    next: CHARACTER
            -- Next character
        require
            valid_character: item /= 'ÿ'
        ensure
            valid_result: Result |-| item = 1

    previous: CHARACTER
            -- Previous character
        require
            valid_character: item /= '%U'
        ensure
            valid_result: Result |-| item = - 1

feature -- Element change

    set_item (c: CHARACTER)
            -- Make c the item value.

feature -- Output

    out: STRING
            -- Printable representation of character

feature -- Conversion

    upper: CHARACTER
            -- Uppercase value of item
            -- Returns item if not is_lower

    lower: CHARACTER
            -- Lowercase value of item
            -- Returns item if not is_upper

feature -- Status report

    is_lower: BOOLEAN
            -- Is item lowercase?

    is_upper: BOOLEAN
            -- Is item uppercase?

    is_digit: BOOLEAN
            -- Is item a digit?
            -- A digit is one of 0123456789

    is_alpha: BOOLEAN
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHARACTER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Characters, with comparison operations and an ASCII code"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    CHARACTER

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a total order relation"
    note: "The basic operation is `<' (less than); others are defined in terms of this operation and `is_equal'."
    status: "See notice at end of class"
    names: comparable, comparison
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class
    COMPARABLE

inherit
    PART_COMPARABLE
        redefine
            infix "<",
            infix "<=",
            infix ">",
            infix ">=",
            is_equal
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current object less than other?
        deferred
        ensure then
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
        do
            Result := not (other < Current)
        ensure then
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
        do
            Result := other < Current
        ensure then
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
        do
            Result := not (Current < other)
        ensure then
            definition: Result = (other <= Current)
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := (not (Current < other) and not (other < Current))
        ensure then
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    three_way_comparison (other: like Current): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require
            other_exists: other /= void
        do
            if Current < other then
                Result := - 1
            elseif other < Current then
                Result := 1
            end
        ensure
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
        require
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
        require
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

invariant

    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COMPARABLE

General
    cluster: base.kernel
    description: "Objects that may be compared according to a total order relation"

Ancestors
    PART_COMPARABLE

Queries
    infix ">=" (other: [like Current] COMPARABLE): BOOLEAN
    infix ">" (other: [like Current] COMPARABLE): BOOLEAN
    infix "<=" (other: [like Current] COMPARABLE): BOOLEAN
    infix "<" (other: [like Current] COMPARABLE): BOOLEAN
    is_equal (other: [like Current] COMPARABLE): BOOLEAN
    max (other: [like Current] COMPARABLE): [like Current] COMPARABLE
    min (other: [like Current] COMPARABLE): [like Current] COMPARABLE
    three_way_comparison (other: [like Current] COMPARABLE): INTEGER

Constraints
    irreflexive comparison

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a total order relation"
    note: "The basic operation is `<' (less than); others are defined in terms of this operation and `is_equal'."
    status: "See notice at end of class"
    names: comparable, comparison
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class
    COMPARABLE

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := (not (Current < other) and not (other < Current))
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
        require
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
        require
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: like Current): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require
            other_exists: other /= void
        do
            if Current < other then
                Result := - 1
            elseif other < Current then
                Result := 1
            end
        ensure
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current object less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        deferred
        ensure then
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then
            definition: Result = (other <= Current)
        end

invariant

    irreflexive_comparison: not (Current < Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a total order relation"
    note: "The basic operation is `<' (less than); others are defined in terms of this operation and `is_equal'."
    status: "See notice at end of class"
    names: comparable, comparison
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COMPARABLE

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
        require
            other_exists: other /= void
        ensure
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
        require
            other_exists: other /= void
        ensure
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require
            other_exists: other /= void
        ensure
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current object less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            definition: Result = (other <= Current)

invariant

    irreflexive_comparison: not (Current < Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COMPARABLE

Ancestors
    PART_COMPARABLE

Descendants
    CHARACTER_REF
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    REAL_REF
    STRING
    WIDE_CHARACTER_REF

Clients
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    COMPARABLE
    COMPARABLE_STRUCT [G -> COMPARABLE]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    SORTED_STRUCT [G -> COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Suppliers
    BOOLEAN
    COMPARABLE
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a total order relation"
    note: "The basic operation is `<' (less than); others are defined in terms of this operation and `is_equal'."
    status: "See notice at end of class"
    names: comparable, comparison
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COMPARABLE

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current object less than other?
        ensure then
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
        ensure then
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
        ensure then
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
        ensure then
            definition: Result = (other <= Current)

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        ensure then
            trichotomy: Result = (not (Current < other) and not (other < Current))

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require
            other_exists: other /= void
        ensure
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    max (other: like Current): like Current
            -- The greater of current object and other
        require
            other_exists: other /= void
        ensure
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
        require
            other_exists: other /= void
        ensure
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

invariant

    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONSOLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used console input and output mechanisms.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    CONSOLE

inherit
    PLAIN_TEXT_FILE
        rename
            make_open_read as make_open_stdin,
            make_open_write as make_open_stdout
        export
            {NONE} all,
            {ANY} separator, append, file_pointer, last_character, last_integer, last_real, last_string, last_double, file_readable, lastchar, lastint, lastreal, laststring, lastdouble
        redefine
            make_open_stdin,
            make_open_stdout,
            count,
            is_empty,
            exists,
            read_integer,
            read_real,
            read_double,
            read_character,
            read_line,
            read_stream,
            read_word,
            next_line,
            put_integer,
            put_boolean,
            put_real,
            put_double,
            put_string,
            put_character,
            put_new_line,
            new_line,
            end_of_file,
            file_close,
            readint,
            readreal,
            readdouble,
            readchar,
            readline,
            readstream,
            readword,
            putint,
            putbool,
            putreal,
            putdouble,
            putstring,
            putchar,
            dispose
        end

create {STD_FILES}
    make_open_stdin,
    make_open_stdout,
    make_open_stderr

feature -- Initialization

    make_open_stdin (fn: STRING) is
            -- Create an unix standard input file.
        do
            make (fn)
            file_pointer := console_def (0)
            set_read_mode
            create last_string.make (256)
        end

    make_open_stdout (fn: STRING) is
            -- Create an unix standard output file.
        do
            make (fn)
            file_pointer := console_def (1)
            set_write_mode
        end

    make_open_stderr (fn: STRING) is
            -- Create an unix standard error file.
        do
            make (fn)
            file_pointer := console_def (2)
            set_write_mode
        end

feature -- Status report

    end_of_file: BOOLEAN is
            -- Have we reached the end of file?
        do
            Result := console_eof (file_pointer)
        end

    exists: BOOLEAN is
            -- Does file exist?
        do
            Result := True
        end

feature -- Removal

    dispose is
            -- This is closed by the operating system at completion.
        do
        end

feature -- Input

    read_integer is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of readint.
        do
            last_integer := console_readint (file_pointer)
        end

    readint is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of read_integer.
        do
            last_integer := console_readint (file_pointer)
        end

    read_real is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of readreal.
        do
            last_real := console_readreal (file_pointer)
        end

    readreal is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of read_real.
        do
            last_real := console_readreal (file_pointer)
        end

    read_double is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of readdouble.
        do
            last_double := console_readdouble (file_pointer)
        end

    readdouble is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of read_double.
        do
            last_double := console_readdouble (file_pointer)
        end

    read_line is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of readline.
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readline (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
        end

    readline is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of read_line.
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readline (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readstream.
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.resize (nb_char)
            str_area := last_string.area
            new_count := console_readstream (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_stream.
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.resize (nb_char)
            str_area := last_string.area
            new_count := console_readstream (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    read_word is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readword.
        local
            str_area: ANY
            str_cap: INTEGER
            done: BOOLEAN
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readword (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
            separator := console_separator (file_pointer)
        end

    readword is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_word.
        local
            str_area: ANY
            str_cap: INTEGER
            done: BOOLEAN
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readword (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
            separator := console_separator (file_pointer)
        end

    read_character is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of readchar.
        do
            last_character := console_readchar (file_pointer)
        end

    readchar is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of read_character.
        do
            last_character := console_readchar (file_pointer)
        end

    next_line is
            -- Move to next input line on standard input.
        do
            console_next_line (file_pointer)
        end

feature -- Output

    put_character (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of putchar.
        do
            console_pc (file_pointer, c)
        end

    putchar (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of put_character.
        do
            console_pc (file_pointer, c)
        end

    put_string (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of putstring.
        local
            external_s: ANY
        do
            if s.count /= 0 then
                external_s := s.area
                console_ps (file_pointer, $external_s, s.count)
            end
        end

    putstring (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of put_string.
        local
            external_s: ANY
        do
            if s.count /= 0 then
                external_s := s.area
                console_ps (file_pointer, $external_s, s.count)
            end
        end

    put_real (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of putreal.
        do
            console_pr (file_pointer, r)
        end

    putreal (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of put_real.
        do
            console_pr (file_pointer, r)
        end

    put_double (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of putdouble.
        do
            console_pd (file_pointer, d)
        end

    putdouble (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of put_double.
        do
            console_pd (file_pointer, d)
        end

    put_integer (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of putint.
        do
            console_pi (file_pointer, i)
        end

    putint (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of put_integer.
        do
            console_pi (file_pointer, i)
        end

    put_boolean (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of putbool.
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    putbool (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of put_boolean.
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    put_new_line is
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of new_line.
        do
            console_tnwl (file_pointer)
        end

    new_line is
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of put_new_line.
        do
            console_tnwl (file_pointer)
        end

feature {NONE} -- Inapplicable

    Count: INTEGER is 1
            -- Useless for CONSOLE class.

    Is_empty: BOOLEAN is False
            -- Useless for CONSOLE class.

feature {NONE} -- Implementation

    console_def (number: INTEGER): POINTER is
            -- Convert number to the corresponding
            -- file descriptor.
        external
            "C | %"eif_console.h%""
        end

    console_eof (file: POINTER): BOOLEAN is
        external
            "C (FILE *): EIF_BOOLEAN | %"eif_console.h%""
        end

    console_separator (file: POINTER): CHARACTER is
            -- ASCII code of character following last word read
        external
            "C (FILE *): EIF_CHARACTER | %"eif_console.h%""
        end

    console_ps (file: POINTER; s_name: POINTER; length: INTEGER) is
            -- Write string s at end of file
        external
            "C (FILE *, char *, EIF_INTEGER) | %"eif_console.h%""
        end

    console_pr (file: POINTER; r: REAL) is
            -- Write real r at end of file
        external
            "C (FILE *, EIF_REAL) | %"eif_console.h%""
        end

    console_pc (file: POINTER; c: CHARACTER) is
            -- Write character c at end of file
        external
            "C (FILE *, EIF_CHARACTER) | %"eif_console.h%""
        end

    console_pd (file: POINTER; d: DOUBLE) is
            -- Write double d at end of file
        external
            "C (FILE *, EIF_DOUBLE) | %"eif_console.h%""
        end

    console_pi (file: POINTER; i: INTEGER) is
            -- Write integer i at end of file
        external
            "C (FILE *, EIF_INTEGER) | %"eif_console.h%""
        end

    console_tnwl (file: POINTER) is
            -- Write a new_line to file
        external
            "C (FILE *) | %"eif_console.h%""
        end

    console_readreal (file: POINTER): REAL is
            -- Read a real number from the console
        external
            "C (FILE *): EIF_REAL | %"eif_console.h%""
        end

    console_readchar (file: POINTER): CHARACTER is
            -- Read a character from the console
        external
            "C (FILE *): EIF_CHARACTER | %"eif_console.h%""
        end

    console_readint (file: POINTER): INTEGER is
            -- Read an integer from the console
        external
            "C (FILE *): EIF_INTEGER | %"eif_console.h%""
        end

    console_readdouble (file: POINTER): DOUBLE is
            -- Read a double from the console
        external
            "C (FILE *): EIF_DOUBLE | %"eif_console.h%""
        end

    console_readword (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a string excluding white space and stripping
            -- leading white space from file into a_string.
            -- White space characters are: blank, new_line,
            -- tab, vertical tab, formfeed or end of file.
            -- If it does not fit, result is length - begin + 1,
            -- otherwise result is number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_console.h%""
        end

    console_readline (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a stream from the console
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_console.h%""
        end

    console_next_line (file: POINTER) is
            -- Move to next input line on standard input.
        external
            "C (FILE *) | %"eif_console.h%""
        end

    console_readstream (file: POINTER; a_string: POINTER; length: INTEGER): INTEGER is
            -- Read a stream from the console
        external
            "C (FILE *, char *, EIF_INTEGER): EIF_INTEGER | %"eif_console.h%""
        end

    file_close (file: POINTER) is
            -- Close file
        external
            "C (FILE *) | %"eif_console.h%""
        alias
            "console_file_close"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONSOLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONSOLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CONSOLE

General
    cluster: base.kernel
    description:
        "Commonly used console input and output mechanisms.
        This class may be used as ancestor by classes needing its facilities."
    create: make_open_stdin, make_open_stdout, make_open_stderr

Ancestors
    PLAIN_TEXT_FILE

Queries
    end_of_file: BOOLEAN
    exists: BOOLEAN
    file_pointer: POINTER
    file_readable: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    separator: CHARACTER

Commands
    append (f: [like Current] CONSOLE)
    dispose
    make_open_stderr (fn: STRING)
    make_open_stdin (fn: STRING)
    make_open_stdout (fn: STRING)
    new_line
    next_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONSOLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used console input and output mechanisms.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class
    CONSOLE

create {STD_FILES}
    make_open_stdin,
    make_open_stdout,
    make_open_stderr

feature -- Initialization

    make_open_stderr (fn: STRING) is
            -- Create an unix standard error file.
        do
            make (fn)
            file_pointer := console_def (2)
            set_write_mode
        end

    make_open_stdin (fn: STRING) is
            -- Create an unix standard input file.
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            file_pointer := console_def (0)
            set_read_mode
            create last_string.make (256)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    make_open_stdout (fn: STRING) is
            -- Create an unix standard output file.
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            file_pointer := console_def (1)
            set_write_mode
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

feature {NONE} -- Initialization

    make (fn: STRING) is
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            name := fn
            mode := closed_file
            create last_string.make (256)
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed
        end

    make_create_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            create_read_write
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_append
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    make_open_read_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_append
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    make_open_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_write
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

feature {NONE} -- Access

    access_date: INTEGER is
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.access_date
        end

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    date: INTEGER is
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.date
        end

    descriptor: INTEGER is
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed
        do
            Result := file_fd (file_pointer)
            descriptor_available := True
        end

    descriptor_available: BOOLEAN
            -- (from FILE)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    file_info: UNIX_FILE_INFO is
            -- Collected information about the file.
            -- (from FILE)
        do
            set_buffer
            Result := clone (buffered_file_info)
        end

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    group_id: INTEGER is
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.group_id
        end

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    inode: INTEGER is
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.inode
        end

    item: CHARACTER is
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            read_character
            Result := last_character
            back
        end

    links: INTEGER is
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.links
        end

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    owner_name: STRING is
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.owner_name
        end

    position: INTEGER is
            -- Current cursor position.
            -- (from FILE)
        do
            if not is_closed then
                Result := file_tell (file_pointer)
            end
        end

    protection: INTEGER is
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.protection
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        do
            Result := c_retrieved (descriptor)
        ensure -- from IO_MEDIUM
            result_exists: Result /= void
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    user_id: INTEGER is
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.user_id
        end

feature  -- Access

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    end_of_file: BOOLEAN is
            -- Have we reached the end of file?
        require -- from FILE
            opened: not is_closed
        do
            Result := console_eof (file_pointer)
        end

    exists: BOOLEAN is
            -- Does file exist?
        do
            Result := True
        ensure then -- from FILE
            unchanged_mode: mode = old mode
        end

feature {NONE} -- Status report

    access_exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_access ($external_name, 0)
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)
        do
            Result := not is_closed and then (end_of_file or count = 0)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)
        do
            Result := is_closed
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from FILE)
        do
            Result := mode >= write_file
        end

    file_prunable: BOOLEAN is
            -- May items be removed?
            -- (from FILE)
        do
            Result := mode >= write_file and prunable
        end

    file_writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from FILE)
        do
            Result := mode >= write_file
        end

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    is_access_executable: BOOLEAN is
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_executable
        end

    is_access_owner: BOOLEAN is
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_owner
        end

    is_access_readable: BOOLEAN is
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_readable
        end

    is_access_writable: BOOLEAN is
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_writable
        end

    is_block: BOOLEAN is
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_block
        end

    is_character: BOOLEAN is
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_character
        end

    is_closed: BOOLEAN is
            -- Is file closed?
            -- (from FILE)
        do
            Result := mode = closed_file
        end

    is_creatable: BOOLEAN is
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_creatable ($external_name)
        end

    is_device: BOOLEAN is
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_device
        end

    is_directory: BOOLEAN is
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_directory
        end

    is_executable: BOOLEAN is
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_executable
        end

    is_fifo: BOOLEAN is
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_fifo
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_open_append: BOOLEAN is
            -- Is file open for appending?
            -- (from FILE)
        do
            Result := mode = append_file or else mode = append_read_file
        end

    is_open_read: BOOLEAN is
            -- Is file open for reading?
            -- (from FILE)
        do
            Result := mode = read_file or else mode = read_write_file or else mode = append_read_file
        end

    is_open_write: BOOLEAN is
            -- Is file open for writing?
            -- (from FILE)
        do
            Result := mode = write_file or else mode = read_write_file or else mode = append_read_file or else mode = append_file
        end

    is_owner: BOOLEAN is
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_owner
        end

    is_plain: BOOLEAN is
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_plain
        end

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)? (Yes)
            -- (from PLAIN_TEXT_FILE)
        do
            Result := True
        end

    is_readable: BOOLEAN is
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_readable
        end

    is_setgid: BOOLEAN is
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setgid
        end

    is_setuid: BOOLEAN is
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setuid
        end

    is_socket: BOOLEAN is
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_socket
        end

    is_sticky: BOOLEAN is
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_sticky
        end

    is_symlink: BOOLEAN is
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_symlink
        end

    is_writable: BOOLEAN is
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_writable
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no item?
            -- (from FILE)
        do
            Result := (count = 0) or else is_closed or else end_of_file
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            Result := not off
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?
            -- (from PLAIN_TEXT_FILE)

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature  -- Status report

    file_readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from FILE)
        do
            Result := (mode >= read_write_file or mode = read_file) and readable
        end

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    close is
            -- Close file.
            -- (from FILE)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        do
            file_close (file_pointer)
            mode := closed_file
            descriptor_available := False
        ensure then -- from FILE
            is_closed: is_closed
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

    create_read_write is
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 4)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    fd_open_append (fd: INTEGER) is
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 2)
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    fd_open_read (fd: INTEGER) is
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 0)
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    fd_open_read_append (fd: INTEGER) is
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_dopen (fd, 5)
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    fd_open_read_write (fd: INTEGER) is
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 3)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_write (fd: INTEGER) is
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 1)
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

    open_append is
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 2)
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    open_read is
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 0)
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    open_read_append is
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 5)
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    open_read_write is
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 3)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    open_write is
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 1)
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

    recreate_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 4, file_pointer)
            name := fname
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_append (fname: STRING) is
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 2, file_pointer)
            name := fname
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    reopen_read (fname: STRING) is
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := fname.to_c
            file_pointer := file_reopen ($external_name, 0, file_pointer)
            name := fname
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    reopen_read_append (fname: STRING) is
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 5, file_pointer)
            name := fname
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    reopen_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 3, file_pointer)
            name := fname
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_write (fname: STRING) is
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 1, file_pointer)
            name := fname
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature {NONE} -- Cursor movement

    back is
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before
        do
            file_move (file_pointer, - 1)
        end

    finish is
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed
        do
            file_recede (file_pointer, 0)
        end

    forth is
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed
        do
            file_move (file_pointer, 1)
        end

    go (abs_position: INTEGER) is
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_go (file_pointer, abs_position)
        end

    move (offset: INTEGER) is
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
        do
            file_move (file_pointer, offset)
        end

    recede (abs_position: INTEGER) is
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_recede (file_pointer, abs_position)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed
        do
            file_go (file_pointer, 0)
        end

feature {NONE} -- Element change

    add_permission (who, what: STRING) is
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 1)
        end

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_basic_store (descriptor, $object)
        end

    change_date: INTEGER is
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.change_date
        end

    change_group (new_group_id: INTEGER) is
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chgrp ($external_name, new_group_id)
        end

    change_mode (mask: INTEGER) is
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chmod ($external_name, mask)
        end

    change_name (new_name: STRING) is
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        local
            ext_old_name, ext_new_name: ANY
        do
            ext_old_name := name.to_c
            ext_new_name := new_name.to_c
            file_rename ($ext_old_name, $ext_new_name)
            name := new_name
        ensure -- from FILE
            name_changed: name.is_equal (new_name)
        end

    change_owner (new_owner_id: INTEGER) is
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chown ($external_name, new_owner_id)
        end

    extend (v: CHARACTER) is
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        do
            put_character (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    flush is
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
        do
            file_flush (file_pointer)
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_general_store (descriptor, $object)
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_independent_store (descriptor, $object)
        end

    link (fn: STRING) is
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
            fn_name: ANY
        do
            external_name := name.to_c
            fn_name := fn.to_c
            file_link ($external_name, $fn_name)
        end

    put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    remove_permission (who, what: STRING) is
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 0)
        end

    set_access (time: INTEGER) is
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 0)
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date
        end

    set_date (time: INTEGER) is
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 1)
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time
        end

    stamp (time: INTEGER) is
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 2)
        ensure -- from FILE
            date_updated: date = time
        end

    touch is
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_touch ($external_name)
        ensure -- from FILE
            date_changed: date /= old date
        end

feature  -- Element change

    append (f: like Current) is
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        do
            open_append
            f.open_read
            file_append (file_pointer, f.file_pointer, f.count)
            close
            f.close
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed
        end

feature -- Removal

    dispose is
            -- This is closed by the operating system at completion.
        do
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    delete is
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_unlink ($external_name)
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    reset (fn: STRING) is
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        do
            name := fn
            if mode /= closed_file then
                close
            end
            last_integer := 0
            if last_string /= void then
                last_string.wipe_out
            end
            last_real := 0.0
            last_character := '%U'
            last_double := 0.0
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed
        end

    wipe_out is
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        do
            open_write
            close
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Conversion

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature  -- Obsolete

    lastchar: CHARACTER is
            -- Last character read by read_character
            -- (from IO_MEDIUM)
        do
            Result := last_character
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
            -- (from IO_MEDIUM)
        do
            Result := last_double
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)
        do
            Result := last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
            -- (from IO_MEDIUM)
        do
            Result := last_real
        end

    laststring: STRING is
            -- Last string read
            -- (from IO_MEDIUM)
        do
            Result := last_string
        end

feature {NONE} -- Inapplicable

    Count: INTEGER is 1
            -- Useless for CONSOLE class.

    go_to (r: CURSOR) is
            -- Move to position marked r.
            -- (from FILE)
        do
        end

    Is_empty: BOOLEAN is False
            -- Useless for CONSOLE class.

    prunable: BOOLEAN is
            -- Is there an item to be removed?
            -- (from FILE)
        do
        end

    prune (v: like item) is
            -- Remove an occurrence of v if any.
            -- (from FILE)
        require -- from COLLECTION
            prunable: prunable
        require else -- from FILE
            prunable: file_prunable
        do
        ensure then -- from FILE
            count <= old count
        end

    remove is
            -- Remove current item.
            -- (from FILE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else -- from FILE
            file_prunable: file_prunable
        do
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from FILE)
        require -- from ACTIVE
            writable: writable
        require else -- from FILE
            is_writable: file_writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        ensure then -- from FILE
            item = v
            count = old count
        end

feature {NONE} -- Implementation

    Append_file: INTEGER is 3
            -- (from FILE)

    Append_read_file: INTEGER is 5
            -- (from FILE)

    buffered_file_info: UNIX_FILE_INFO is
            -- Information about the file.
            -- (from FILE)
        once
            create Result.make
        end

    c_basic_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "estore"
        end

    c_general_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "eestore"
        end

    c_independent_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "sstore"
        end

    c_retrieved (file_handle: INTEGER): ANY is
            -- Object structured retrieved from file of pointer
            -- file_ptr
            -- (from FILE)
        external
            "C | %"eif_retrieve.h%""
        alias
            "eretrieve"
        end

    Closed_file: INTEGER is 0
            -- (from FILE)

    console_def (number: INTEGER): POINTER is
            -- Convert number to the corresponding
            -- file descriptor.
        external
            "C | %"eif_console.h%""
        end

    console_eof (file: POINTER): BOOLEAN is
        external
            "C (FILE *): EIF_BOOLEAN | %"eif_console.h%""
        end

    console_next_line (file: POINTER) is
            -- Move to next input line on standard input.
        external
            "C (FILE *) | %"eif_console.h%""
        end

    console_pc (file: POINTER; c: CHARACTER) is
            -- Write character c at end of file
        external
            "C (FILE *, EIF_CHARACTER) | %"eif_console.h%""
        end

    console_pd (file: POINTER; d: DOUBLE) is
            -- Write double d at end of file
        external
            "C (FILE *, EIF_DOUBLE) | %"eif_console.h%""
        end

    console_pi (file: POINTER; i: INTEGER) is
            -- Write integer i at end of file
        external
            "C (FILE *, EIF_INTEGER) | %"eif_console.h%""
        end

    console_pr (file: POINTER; r: REAL) is
            -- Write real r at end of file
        external
            "C (FILE *, EIF_REAL) | %"eif_console.h%""
        end

    console_ps (file: POINTER; s_name: POINTER; length: INTEGER) is
            -- Write string s at end of file
        external
            "C (FILE *, char *, EIF_INTEGER) | %"eif_console.h%""
        end

    console_readchar (file: POINTER): CHARACTER is
            -- Read a character from the console
        external
            "C (FILE *): EIF_CHARACTER | %"eif_console.h%""
        end

    console_readdouble (file: POINTER): DOUBLE is
            -- Read a double from the console
        external
            "C (FILE *): EIF_DOUBLE | %"eif_console.h%""
        end

    console_readint (file: POINTER): INTEGER is
            -- Read an integer from the console
        external
            "C (FILE *): EIF_INTEGER | %"eif_console.h%""
        end

    console_readline (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a stream from the console
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_console.h%""
        end

    console_readreal (file: POINTER): REAL is
            -- Read a real number from the console
        external
            "C (FILE *): EIF_REAL | %"eif_console.h%""
        end

    console_readstream (file: POINTER; a_string: POINTER; length: INTEGER): INTEGER is
            -- Read a stream from the console
        external
            "C (FILE *, char *, EIF_INTEGER): EIF_INTEGER | %"eif_console.h%""
        end

    console_readword (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a string excluding white space and stripping
            -- leading white space from file into a_string.
            -- White space characters are: blank, new_line,
            -- tab, vertical tab, formfeed or end of file.
            -- If it does not fit, result is length - begin + 1,
            -- otherwise result is number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_console.h%""
        end

    console_separator (file: POINTER): CHARACTER is
            -- ASCII code of character following last word read
        external
            "C (FILE *): EIF_CHARACTER | %"eif_console.h%""
        end

    console_tnwl (file: POINTER) is
            -- Write a new_line to file
        external
            "C (FILE *) | %"eif_console.h%""
        end

    false_string: STRING is
            -- Character string "false"
            -- (from FILE)
        once
            Result := "False"
        end

    file_access (f_name: POINTER; which: INTEGER): BOOLEAN is
            -- Perform access test which on f_name using real UID.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_append (file, from_file: POINTER; length: INTEGER) is
            -- Append a copy of from_file to file
            -- (from FILE)
        external
            "C (FILE *, FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_chgrp (f_name: POINTER; new_group: INTEGER) is
            -- Change group of f_name to new_group
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_chmod (f_name: POINTER; mask: INTEGER) is
            -- Change mode of f_name to mask.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_chown (f_name: POINTER; new_owner: INTEGER) is
            -- Change owner of f_name to new_owner
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_close (file: POINTER) is
            -- Close file
        external
            "C (FILE *) | %"eif_console.h%""
        alias
            "console_file_close"
        end

    file_creatable (f_name: POINTER): BOOLEAN is
            -- Is f_name creatable.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_dopen (fd, how: INTEGER): POINTER is
            -- File pointer for file of descriptor fd in mode how
            -- (which must fit the way fd was obtained).
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_exists (f_name: POINTER): BOOLEAN is
            -- Does f_name exist.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_fd (file: POINTER): INTEGER is
            -- Operating system's file descriptor
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_feof (file: POINTER): BOOLEAN is
            -- End of file?
            -- (from FILE)
        external
            "C (FILE *): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_flush (file: POINTER) is
            -- Flush file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_gc (file: POINTER): CHARACTER is
            -- Access the next character
            -- (from FILE)
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_gd (file: POINTER): DOUBLE is
            -- Read a double from file
            -- (from PLAIN_TEXT_FILE)
        external
            "C (FILE *): EIF_DOUBLE | %"eif_file.h%""
        end

    file_gi (file: POINTER): INTEGER is
            -- Get an integer from file
            -- (from PLAIN_TEXT_FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_go (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from start.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_gr (file: POINTER): REAL is
            -- Read a real from file
            -- (from PLAIN_TEXT_FILE)
        external
            "C (FILE *): EIF_REAL | %"eif_file.h%""
        end

    file_gs (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- a_string updated with characters read from file
            -- until new line, with begin characters already read.
            -- If it does not fit, result is length - begin + 1.
            -- If it fits, result is number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gss (file: POINTER; a_string: POINTER; length: INTEGER): INTEGER is
            -- Read min (length, remaining bytes in file) characters
            -- into a_string. If it does not fit, result is length + 1.
            -- Otherwise, result is the number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gw (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a string excluding white space and stripping
            -- leading white space from file into a_string.
            -- White space characters are: blank, new_line,
            -- tab, vertical tab, formfeed or end of file.
            -- If it does not fit, result is length - begin + 1,
            -- otherwise result is number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_lh (file: POINTER): CHARACTER is
            -- Look ahead in file and find out the value of the next
            -- character. Do not read over character.
            -- (from FILE)
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_link (from_name, to_name: POINTER) is
            -- Link to_name to from_name
            -- (from FILE)
        external
            "C (char *, char *) | %"eif_file.h%""
        end

    file_move (file: POINTER; offset: INTEGER) is
            -- Move file pointer by offset.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_open (f_name: POINTER; how: INTEGER): POINTER is
            -- File pointer for file f_name, in mode how.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_pc (file: POINTER; c: CHARACTER) is
            -- Put c to end of file.
            -- (from FILE)
        external
            "C (FILE *, EIF_CHARACTER) | %"eif_file.h%""
        end

    file_pd (file: POINTER; d: DOUBLE) is
            -- Put d to end of file.
            -- (from PLAIN_TEXT_FILE)
        external
            "C (FILE *, EIF_DOUBLE) | %"eif_file.h%""
        end

    file_perm (f_name, who, what: POINTER; flag: INTEGER) is
            -- Change permissions for f_name to who and what.
            -- flag = 1 -> add permissions,
            -- flag = 0 -> remove permissions.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_pi (file: POINTER; n: INTEGER) is
            -- Put n to end of file.
            -- (from PLAIN_TEXT_FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_pr (file: POINTER; r: REAL) is
            -- Put r to end of file.
            -- (from PLAIN_TEXT_FILE)
        external
            "C (FILE *, EIF_REAL) | %"eif_file.h%""
        end

    file_ps (file: POINTER; a_string: POINTER; length: INTEGER) is
            -- Print a_string to file.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_recede (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from end.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_rename (old_name, new_name: POINTER) is
            -- Change file name from old_name to new_name.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_reopen (f_name: POINTER; how: INTEGER; file: POINTER): POINTER is
            -- File pointer to file, reopened to have new name f_name
            -- in a mode specified by how.
            -- (from FILE)
        external
            "C (char *, EIF_INTEGER, FILE *): EIF_POINTER | %"eif_file.h%""
        end

    file_size (file: POINTER): INTEGER is
            -- Size of file
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tell (file: POINTER): INTEGER is
            -- Current cursor position in file.
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tnil (file: POINTER) is
            -- Read upto next input line.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_tnwl (file: POINTER) is
            -- Print a new-line to file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_touch (f_name: POINTER) is
            -- Touch file f_name.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_unlink (fname: POINTER) is
            -- Delete file fname.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_utime (f_name: POINTER; time, how: INTEGER) is
            -- Set access, modification time or both (how = 0,1,2) on
            -- f_name, using time as time stamp.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    mode: INTEGER
            -- Input-output mode
            -- (from FILE)

    Read_file: INTEGER is 1
            -- (from FILE)

    Read_write_file: INTEGER is 4
            -- (from FILE)

    set_buffer is
            -- Resynchronizes information on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            buffered_file_info.update (name)
        end

    set_read_mode is
            -- Define file mode as read.
            -- (from FILE)
        do
            mode := read_file
        end

    set_write_mode is
            -- Define file mode as write.
            -- (from FILE)
        do
            mode := write_file
        end

    true_string: STRING is
            -- Character string "true"
            -- (from FILE)
        once
            Result := "True"
        end

    Write_file: INTEGER is 2
            -- (from FILE)

feature {NONE} -- Convenience

    copy_to (file: like Current) is
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read
        do
            read_stream (count)
            file.put_string (last_string)
            create last_string.make (256)
        end

feature -- Input

    next_line is
            -- Move to next input line on standard input.
        require -- from FILE
            is_readable: file_readable
        do
            console_next_line (file_pointer)
        end

    read_character is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_character := console_readchar (file_pointer)
        end

    read_double is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_double := console_readdouble (file_pointer)
        end

    read_integer is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_integer := console_readint (file_pointer)
        end

    read_line is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readline (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
        end

    read_real is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_real := console_readreal (file_pointer)
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.resize (nb_char)
            str_area := last_string.area
            new_count := console_readstream (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    read_word is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readword.
        require -- from FILE
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            done: BOOLEAN
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readword (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
            separator := console_separator (file_pointer)
        end

    readchar is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_character := console_readchar (file_pointer)
        end

    readdouble is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_double := console_readdouble (file_pointer)
        end

    readint is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_integer := console_readint (file_pointer)
        end

    readline is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readline (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
        end

    readreal is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_real := console_readreal (file_pointer)
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.resize (nb_char)
            str_area := last_string.area
            new_count := console_readstream (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    readword is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_word.
        require -- from FILE
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            done: BOOLEAN
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + console_readword (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    done := True
                end
            end
            if read < 1024 then
                last_string.resize (read)
            end
            separator := console_separator (file_pointer)
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature -- Output

    new_line is
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_tnwl (file_pointer)
        end

    put_boolean (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    put_character (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pc (file_pointer, c)
        end

    put_double (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pd (file_pointer, d)
        end

    put_integer (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pi (file_pointer, i)
        end

    put_new_line is
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_tnwl (file_pointer)
        end

    put_real (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pr (file_pointer, r)
        end

    put_string (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            external_s: ANY
        do
            if s.count /= 0 then
                external_s := s.area
                console_ps (file_pointer, $external_s, s.count)
            end
        end

    putbool (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    putchar (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pc (file_pointer, c)
        end

    putdouble (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pd (file_pointer, d)
        end

    putint (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pi (file_pointer, i)
        end

    putreal (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            console_pr (file_pointer, r)
        end

    putstring (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            external_s: ANY
        do
            if s.count /= 0 then
                external_s := s.area
                console_ps (file_pointer, $external_s, s.count)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from PLAIN_TEXT_FILE
    plain_text: is_plain_text
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONSOLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONSOLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used console input and output mechanisms.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    CONSOLE

create

feature -- Initialization

    make_open_stderr (fn: STRING)
            -- Create an unix standard error file.

    make_open_stdin (fn: STRING)
            -- Create an unix standard input file.
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_stdout (fn: STRING)
            -- Create an unix standard output file.
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature  -- Access

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

feature -- Status report

    end_of_file: BOOLEAN
            -- Have we reached the end of file?
        require -- from FILE
            opened: not is_closed

    exists: BOOLEAN
            -- Does file exist?
        ensure then -- from FILE
            unchanged_mode: mode = old mode

feature  -- Status report

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature  -- Element change

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

feature -- Removal

    dispose
            -- This is closed by the operating system at completion.

feature  -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Input

    next_line
            -- Move to next input line on standard input.
        require -- from FILE
            is_readable: file_readable

    read_character
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        require else
            is_readable: file_readable

    read_real
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readword.
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        require else
            is_readable: file_readable

    readreal
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_word.
        require -- from FILE
            is_readable: file_readable

feature -- Output

    new_line
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put_boolean (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from PLAIN_TEXT_FILE
    plain_text: is_plain_text
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONSOLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONSOLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CONSOLE

Ancestors
    PLAIN_TEXT_FILE

Clients
    CONSOLE
    STD_FILES

Suppliers
    CONSOLE
    INTEGER
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONSOLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used console input and output mechanisms.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:26 $"
    revision: "$Revision: 1.2 $"

class interface
    CONSOLE

create

feature -- Initialization

    make_open_stdin (fn: STRING)
            -- Create an unix standard input file.

    make_open_stdout (fn: STRING)
            -- Create an unix standard output file.

    make_open_stderr (fn: STRING)
            -- Create an unix standard error file.

feature -- Status report

    end_of_file: BOOLEAN
            -- Have we reached the end of file?

    exists: BOOLEAN
            -- Does file exist?

feature -- Removal

    dispose
            -- This is closed by the operating system at completion.

feature -- Input

    read_integer
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of readint.

    readint
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of read_integer.

    read_real
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of readreal.

    readreal
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of read_real.

    read_double
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of readdouble.

    readdouble
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of read_double.

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of readline.
        require else
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of read_line.
        require else
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readstream.

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_stream.

    read_word
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readword.

    readword
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_word.

    read_character
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of readchar.

    readchar
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of read_character.

    next_line
            -- Move to next input line on standard input.

feature -- Output

    put_character (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of putchar.

    putchar (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of put_character.

    put_string (s: STRING)
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of putstring.

    putstring (s: STRING)
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of put_string.

    put_real (r: REAL)
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of putreal.

    putreal (r: REAL)
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of put_real.

    put_double (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of putdouble.

    putdouble (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of put_double.

    put_integer (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of putint.

    putint (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of put_integer.

    put_boolean (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of putbool.

    putbool (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of put_boolean.

    put_new_line
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of new_line.

    new_line
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of put_new_line.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONSOLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DECLARATOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    warning: "[
        If you are precompiling a subset of EiffelBase, it is
        preferable NOT to remove this class from the subset.
        If you remove it you may see EiffelStudio perform
        apparently unnecessary recompilations after changes.
    ]"
    description: "[
        Class used to ensure proper precompilation of EiffelBase.
        Not to be used otherwise."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/12/07 22:06:30 $"
    revision: "$Revision: 1.3 $"

class
    DECLARATOR

feature {NONE} -- Implementation

    s1: ARRAY [INTEGER]

    s1_2: ARRAY [INTEGER_8]

    s1_3: ARRAY [INTEGER_16]

    s1_4: ARRAY [INTEGER_64]

    s2: ARRAY [REAL]

    s3: ARRAY [DOUBLE]

    s4: ARRAY [BOOLEAN]

    s5: ARRAY [CHARACTER]

    s5_1: ARRAY [WIDE_CHARACTER]

    s6: ARRAY [POINTER]

    s7: ARRAY [ANY]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DECLARATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DECLARATOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DECLARATOR

General
    cluster: base.kernel
    description:
        "Class used to ensure proper precompilation of EiffelBase.
        Not to be used otherwise.%""

Ancestors
    ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DECLARATOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    warning: "[
        If you are precompiling a subset of EiffelBase, it is
        preferable NOT to remove this class from the subset.
        If you remove it you may see EiffelStudio perform
        apparently unnecessary recompilations after changes.
    ]"
    description: "[
        Class used to ensure proper precompilation of EiffelBase.
        Not to be used otherwise."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/12/07 22:06:30 $"
    revision: "$Revision: 1.3 $"

class
    DECLARATOR

feature {NONE} -- Implementation

    s1: ARRAY [INTEGER]

    s1_2: ARRAY [INTEGER_8]

    s1_3: ARRAY [INTEGER_16]

    s1_4: ARRAY [INTEGER_64]

    s2: ARRAY [REAL]

    s3: ARRAY [DOUBLE]

    s4: ARRAY [BOOLEAN]

    s5: ARRAY [CHARACTER]

    s5_1: ARRAY [WIDE_CHARACTER]

    s6: ARRAY [POINTER]

    s7: ARRAY [ANY]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DECLARATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DECLARATOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    warning: "[
        If you are precompiling a subset of EiffelBase, it is
        preferable NOT to remove this class from the subset.
        If you remove it you may see EiffelStudio perform
        apparently unnecessary recompilations after changes.
    ]"
    description: "[
        Class used to ensure proper precompilation of EiffelBase.
        Not to be used otherwise."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/12/07 22:06:30 $"
    revision: "$Revision: 1.3 $"

class interface
    DECLARATOR

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DECLARATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DECLARATOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DECLARATOR

Ancestors
    ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DECLARATOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    warning: "[
        If you are precompiling a subset of EiffelBase, it is
        preferable NOT to remove this class from the subset.
        If you remove it you may see EiffelStudio perform
        apparently unnecessary recompilations after changes.
    ]"
    description: "[
        Class used to ensure proper precompilation of EiffelBase.
        Not to be used otherwise."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/12/07 22:06:30 $"
    revision: "$Revision: 1.3 $"

class interface
    DECLARATOR

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DECLARATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.kernel

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


DIRECTORY Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directories, in the Unix sense, with creation and exploration features"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    DIRECTORY

inherit
    MEMORY
        export
            {NONE} all
        redefine
            dispose
        end

create
    make,
    make_open_read

feature -- Initialization

    make (dn: STRING) is
            -- Create directory object for the directory
            -- of name dn.
        require
            string_exists: dn /= void
        do
            name := dn
            mode := close_directory
        end

    make_open_read (dn: STRING) is
            -- Create directory object for the directory
            -- of name dn and open it for reading.
        require
            string_exists: dn /= void
        do
            make (dn)
            open_read
        end

    create_dir is
            -- Create a physical directory.
        require
            physical_not_exists: not exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_mkdir ($external_name)
        end

feature -- Access

    readentry is
            -- Read next directory entry
            -- make result available in lastentry.
            -- Make result void if all entries have been read.
        require
            is_opened: not is_closed
        do
            lastentry := dir_next (directory_pointer)
        end

    name: STRING
            -- Directory name

    has_entry (entry_name: STRING): BOOLEAN is
            -- Has directory the entry entry_name?
            -- The use of dir_temp is required not
            -- to change the position in the current
            -- directory entries list.
        require
            string_exists: entry_name /= void
        local
            ext_entry_name: ANY
            dir_temp: DIRECTORY
        do
            create dir_temp.make_open_read (name)
            ext_entry_name := entry_name.to_c
            Result := dir_temp.dir_search (dir_temp.directory_pointer, $ext_entry_name) /= default_pointer
            dir_temp.close
        end

    open_read is
            -- Open directory name for reading.
        local
            external_name: ANY
        do
            external_name := name.to_c
            directory_pointer := dir_open ($external_name)
            mode := read_directory
        end

    close is
            -- Close directory.
        require
            is_open: not is_closed
        do
            dir_close (directory_pointer)
            mode := close_directory
        end

    start is
            -- Go to first entry of directory.
        require
            is_opened: not is_closed
        do
            dir_rewind (directory_pointer)
        end

    change_name (new_name: STRING) is
            -- Change file name to new_name
        require
            not_new_name_void: new_name /= void
            file_exists: exists
        local
            ext_old_name, ext_new_name: ANY
        do
            ext_old_name := name.to_c
            ext_new_name := new_name.to_c
            eif_dir_rename ($ext_old_name, $ext_new_name)
            name := new_name
        ensure
            name_changed: name.is_equal (new_name)
        end

feature -- Measurement

    count: INTEGER is
            -- Number of entries in directory.
        require
            directory_exists: exists
        local
            dir_temp: DIRECTORY
            counter: INTEGER
        do
            create dir_temp.make_open_read (name)
            from
                dir_temp.start
                dir_temp.readentry
            until
                dir_temp.lastentry = void
            loop
                counter := counter + 1
                dir_temp.readentry
            end
            Result := counter
            dir_temp.close
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [STRING] is
            -- The entries, in sequential format.
        local
            dir_temp: DIRECTORY
        do
            create dir_temp.make_open_read (name)
            create Result.make (count)
            from
                dir_temp.start
                dir_temp.readentry
            until
                dir_temp.lastentry = void
            loop
                Result.extend (dir_temp.lastentry)
                dir_temp.readentry
            end
            dir_temp.close
        end

feature -- Status report

    lastentry: STRING
            -- Last entry read by readentry

    is_closed: BOOLEAN is
            -- Is current directory closed?
        do
            Result := mode = close_directory
        end

    is_empty: BOOLEAN is
            -- Is directory empty?
        require
            directory_exists: exists
        do
            Result := (count = 2)
        end

    empty: BOOLEAN is
        obsolete "Use `is_empty' instead"
            -- Is directory empty?
        do
            Result := is_empty
        end

    exists: BOOLEAN is
            -- Does the directory exist?
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_exists ($external_name)
        end

    is_readable: BOOLEAN is
            -- Is the directory readable?
        require
            directory_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_is_readable ($external_name)
        end

    is_executable: BOOLEAN is
            -- Is the directory executable?
        require
            directory_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_is_executable ($external_name)
        end

    is_writable: BOOLEAN is
            -- Is the directory writable?
        require
            directory_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_is_writable ($external_name)
        end

feature -- Removal

    delete is
            -- Delete directory if empty
        require
            directory_exists: exists
            empty_directory: is_empty
        local
            external_name: ANY
        do
            external_name := name.to_c
            eif_dir_delete ($external_name)
        end

    delete_content is
            -- Delete all files located in current directory and its
            -- subdirectories.
        require
            directory_exists: exists
        local
            l: LINEAR [STRING]
            file_name: FILE_NAME
            file: RAW_FILE
            dir: DIRECTORY
        do
            l := linear_representation
            from
                l.start
            until
                l.after
            loop
                if not l.item.is_equal (".") and not l.item.is_equal ("..") then
                    create file_name.make_from_string (name)
                    file_name.set_file_name (l.item)
                    create file.make (file_name)
                    if file.exists and then not file.is_symlink and then file.is_directory then
                        create dir.make (file_name)
                        dir.recursive_delete
                    else
                        if file.exists and then file.is_writable then
                            file.delete
                        end
                    end
                end
                l.forth
            end
        end

    recursive_delete is
            -- Delete directory, its files and its subdirectories.
        require
            directory_exists: exists
        do
            delete_content
            delete
        end

    delete_content_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER) is
            -- Delete all files located in current directory and its
            -- subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
            -- action may be set to Void if you don't need it.
            --
            -- Same for is_cancel_requested.
            -- Make it return True to cancel the operation.
            -- is_cancel_requested may be set to Void if you don't need it.
        require
            directory_exists: exists
            valid_file_number: file_number > 0
        local
            l: LINEAR [STRING]
            file_name: FILE_NAME
            file: RAW_FILE
            dir: DIRECTORY
            file_count: INTEGER
            deleted_files: ARRAYED_LIST [STRING]
            deleted_files_tuple: TUPLE [ARRAYED_LIST [STRING]]
            current_directory: STRING
            parent_directory: STRING
            requested_cancel: BOOLEAN
        do
            file_count := 1
            create deleted_files.make (file_number)
            create deleted_files_tuple.make
            l := linear_representation
            current_directory := "."
            parent_directory := ".."
            from
                l.start
            until
                l.after or requested_cancel
            loop
                if not l.item.is_equal (current_directory) and not l.item.is_equal (parent_directory) then
                    create file_name.make_from_string (name)
                    file_name.set_file_name (l.item)
                    create file.make (file_name)
                    if file.exists and then not file.is_symlink and then file.is_directory then
                        create dir.make (file_name)
                        dir.recursive_delete_with_action (action, is_cancel_requested, file_number)
                    else
                        if file.exists and then file.is_writable then
                            file.delete
                        end
                    end
                    deleted_files.extend (file_name)
                    file_count := file_count + 1
                    if file_count > file_number then
                        if action /= void then
                            deleted_files_tuple.put (deleted_files, 1)
                            action.call (deleted_files_tuple)
                        end
                        if is_cancel_requested /= void then
                            requested_cancel := is_cancel_requested.item ([])
                        end
                        deleted_files.wipe_out
                        file_count := 1
                    end
                end
                l.forth
            end
            if file_count > 1 then
                if action /= void then
                    deleted_files_tuple.put (deleted_files, 1)
                    action.call (deleted_files_tuple)
                end
                deleted_files.wipe_out
                file_count := 1
            end
        end

    recursive_delete_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER) is
            -- Delete directory, its files and its subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
        require
            directory_exists: exists
        local
            deleted_files: ARRAYED_LIST [STRING]
        do
            delete_content_with_action (action, is_cancel_requested, file_number)
            if (is_cancel_requested = void) or else (not is_cancel_requested.item ([])) then
                delete
                if action /= void then
                    create deleted_files.make (1)
                    deleted_files.extend (name)
                    action.call ([deleted_files])
                end
            end
        end

    dispose is
            -- Ensure this medium is closed when garbage collected.
        do
            if not is_closed then
                close
            end
        end

feature {DIRECTORY} -- Implementation

    directory_pointer: POINTER
            -- Directory pointer as required in C

    dir_search (dir_ptr: POINTER; entry: POINTER): POINTER is
            -- Return the DIRENTRY structure corresponding
            -- to the name entry of directory dir_ptr.
        external
            "C | %"eif_dir.h%""
        end

feature {NONE} -- Implementation

    mode: INTEGER
            -- Status mode of the directory.
            -- Possible values are the following:

    Close_directory: INTEGER is unique

    Read_directory: INTEGER is unique

    file_mkdir (dir_name: POINTER) is
            -- Make directory dir_name.
        external
            "C | %"eif_file.h%""
        end

    dir_open (dir_name: POINTER): POINTER is
            -- Open the directory dir_name.
        external
            "C | %"eif_dir.h%""
        end

    dir_rewind (dir_ptr: POINTER) is
            -- Rewind the directory dir_ptr.
        external
            "C | %"eif_dir.h%""
        end

    dir_close (dir_ptr: POINTER) is
            -- Close the directory dir_ptr.
        external
            "C | %"eif_dir.h%""
        end

    dir_next (dir_ptr: POINTER): STRING is
            -- Return the next entry for directory 'dir_ptr'.
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_delete (dir_name: POINTER) is
            -- Delete the directory dir_name.
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_exists (dir_name: POINTER): BOOLEAN is
            -- Does the directory dir_name exist?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_is_readable (dir_name: POINTER): BOOLEAN is
            -- Is dir_name readable?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_is_executable (dir_name: POINTER): BOOLEAN is
            -- Is dir_name executable?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_is_writable (dir_name: POINTER): BOOLEAN is
            -- Is dir_name writable?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_rename (old_name, new_name: POINTER) is
            -- Change directory name from old_name to new_name.
        external
            "C | %"eif_file.h%""
        alias
            "file_rename"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DIRECTORY

General
    cluster: base.kernel
    description: "Directories, in the Unix sense, with creation and exploration features"
    create: make_open_read, make

Ancestors
    MEMORY

Queries
    count: INTEGER
    exists: BOOLEAN
    has_entry (entry_name: STRING): BOOLEAN
    is_closed: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_readable: BOOLEAN
    is_writable: BOOLEAN
    lastentry: STRING
    linear_representation: ARRAYED_LIST [STRING]
    name: STRING

Commands
    change_name (new_name: STRING)
    close
    create_dir
    delete
    delete_content
    delete_content_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
    dispose
    make (dn: STRING)
    make_open_read (dn: STRING)
    open_read
    readentry
    recursive_delete
    recursive_delete_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
    start

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directories, in the Unix sense, with creation and exploration features"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    DIRECTORY

create
    make,
    make_open_read

feature -- Initialization

    create_dir is
            -- Create a physical directory.
        require
            physical_not_exists: not exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_mkdir ($external_name)
        end

    make (dn: STRING) is
            -- Create directory object for the directory
            -- of name dn.
        require
            string_exists: dn /= void
        do
            name := dn
            mode := close_directory
        end

    make_open_read (dn: STRING) is
            -- Create directory object for the directory
            -- of name dn and open it for reading.
        require
            string_exists: dn /= void
        do
            make (dn)
            open_read
        end

feature -- Access

    change_name (new_name: STRING) is
            -- Change file name to new_name
        require
            not_new_name_void: new_name /= void
            file_exists: exists
        local
            ext_old_name, ext_new_name: ANY
        do
            ext_old_name := name.to_c
            ext_new_name := new_name.to_c
            eif_dir_rename ($ext_old_name, $ext_new_name)
            name := new_name
        ensure
            name_changed: name.is_equal (new_name)
        end

    close is
            -- Close directory.
        require
            is_open: not is_closed
        do
            dir_close (directory_pointer)
            mode := close_directory
        end

    has_entry (entry_name: STRING): BOOLEAN is
            -- Has directory the entry entry_name?
            -- The use of dir_temp is required not
            -- to change the position in the current
            -- directory entries list.
        require
            string_exists: entry_name /= void
        local
            ext_entry_name: ANY
            dir_temp: DIRECTORY
        do
            create dir_temp.make_open_read (name)
            ext_entry_name := entry_name.to_c
            Result := dir_temp.dir_search (dir_temp.directory_pointer, $ext_entry_name) /= default_pointer
            dir_temp.close
        end

    name: STRING
            -- Directory name

    open_read is
            -- Open directory name for reading.
        local
            external_name: ANY
        do
            external_name := name.to_c
            directory_pointer := dir_open ($external_name)
            mode := read_directory
        end

    readentry is
            -- Read next directory entry
            -- make result available in lastentry.
            -- Make result void if all entries have been read.
        require
            is_opened: not is_closed
        do
            lastentry := dir_next (directory_pointer)
        end

    start is
            -- Go to first entry of directory.
        require
            is_opened: not is_closed
        do
            dir_rewind (directory_pointer)
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    count: INTEGER is
            -- Number of entries in directory.
        require
            directory_exists: exists
        local
            dir_temp: DIRECTORY
            counter: INTEGER
        do
            create dir_temp.make_open_read (name)
            from
                dir_temp.start
                dir_temp.readentry
            until
                dir_temp.lastentry = void
            loop
                counter := counter + 1
                dir_temp.readentry
            end
            Result := counter
            dir_temp.close
        end

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    empty: BOOLEAN is
        obsolete "Use `is_empty' instead"
            -- Is directory empty?
        do
            Result := is_empty
        end

    exists: BOOLEAN is
            -- Does the directory exist?
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_exists ($external_name)
        end

    is_closed: BOOLEAN is
            -- Is current directory closed?
        do
            Result := mode = close_directory
        end

    is_empty: BOOLEAN is
            -- Is directory empty?
        require
            directory_exists: exists
        do
            Result := (count = 2)
        end

    is_executable: BOOLEAN is
            -- Is the directory executable?
        require
            directory_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_is_executable ($external_name)
        end

    is_readable: BOOLEAN is
            -- Is the directory readable?
        require
            directory_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_is_readable ($external_name)
        end

    is_writable: BOOLEAN is
            -- Is the directory writable?
        require
            directory_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := eif_dir_is_writable ($external_name)
        end

    lastentry: STRING
            -- Last entry read by readentry

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Removal

    delete is
            -- Delete directory if empty
        require
            directory_exists: exists
            empty_directory: is_empty
        local
            external_name: ANY
        do
            external_name := name.to_c
            eif_dir_delete ($external_name)
        end

    delete_content is
            -- Delete all files located in current directory and its
            -- subdirectories.
        require
            directory_exists: exists
        local
            l: LINEAR [STRING]
            file_name: FILE_NAME
            file: RAW_FILE
            dir: DIRECTORY
        do
            l := linear_representation
            from
                l.start
            until
                l.after
            loop
                if not l.item.is_equal (".") and not l.item.is_equal ("..") then
                    create file_name.make_from_string (name)
                    file_name.set_file_name (l.item)
                    create file.make (file_name)
                    if file.exists and then not file.is_symlink and then file.is_directory then
                        create dir.make (file_name)
                        dir.recursive_delete
                    else
                        if file.exists and then file.is_writable then
                            file.delete
                        end
                    end
                end
                l.forth
            end
        end

    delete_content_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER) is
            -- Delete all files located in current directory and its
            -- subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
            -- action may be set to Void if you don't need it.
            --
            -- Same for is_cancel_requested.
            -- Make it return True to cancel the operation.
            -- is_cancel_requested may be set to Void if you don't need it.
        require
            directory_exists: exists
            valid_file_number: file_number > 0
        local
            l: LINEAR [STRING]
            file_name: FILE_NAME
            file: RAW_FILE
            dir: DIRECTORY
            file_count: INTEGER
            deleted_files: ARRAYED_LIST [STRING]
            deleted_files_tuple: TUPLE [ARRAYED_LIST [STRING]]
            current_directory: STRING
            parent_directory: STRING
            requested_cancel: BOOLEAN
        do
            file_count := 1
            create deleted_files.make (file_number)
            create deleted_files_tuple.make
            l := linear_representation
            current_directory := "."
            parent_directory := ".."
            from
                l.start
            until
                l.after or requested_cancel
            loop
                if not l.item.is_equal (current_directory) and not l.item.is_equal (parent_directory) then
                    create file_name.make_from_string (name)
                    file_name.set_file_name (l.item)
                    create file.make (file_name)
                    if file.exists and then not file.is_symlink and then file.is_directory then
                        create dir.make (file_name)
                        dir.recursive_delete_with_action (action, is_cancel_requested, file_number)
                    else
                        if file.exists and then file.is_writable then
                            file.delete
                        end
                    end
                    deleted_files.extend (file_name)
                    file_count := file_count + 1
                    if file_count > file_number then
                        if action /= void then
                            deleted_files_tuple.put (deleted_files, 1)
                            action.call (deleted_files_tuple)
                        end
                        if is_cancel_requested /= void then
                            requested_cancel := is_cancel_requested.item ([])
                        end
                        deleted_files.wipe_out
                        file_count := 1
                    end
                end
                l.forth
            end
            if file_count > 1 then
                if action /= void then
                    deleted_files_tuple.put (deleted_files, 1)
                    action.call (deleted_files_tuple)
                end
                deleted_files.wipe_out
                file_count := 1
            end
        end

    dispose is
            -- Ensure this medium is closed when garbage collected.
        do
            if not is_closed then
                close
            end
        end

    recursive_delete is
            -- Delete directory, its files and its subdirectories.
        require
            directory_exists: exists
        do
            delete_content
            delete
        end

    recursive_delete_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER) is
            -- Delete directory, its files and its subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
        require
            directory_exists: exists
        local
            deleted_files: ARRAYED_LIST [STRING]
        do
            delete_content_with_action (action, is_cancel_requested, file_number)
            if (is_cancel_requested = void) or else (not is_cancel_requested.item ([])) then
                delete
                if action /= void then
                    create deleted_files.make (1)
                    deleted_files.extend (name)
                    action.call ([deleted_files])
                end
            end
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [STRING] is
            -- The entries, in sequential format.
        local
            dir_temp: DIRECTORY
        do
            create dir_temp.make_open_read (name)
            create Result.make (count)
            from
                dir_temp.start
                dir_temp.readentry
            until
                dir_temp.lastentry = void
            loop
                Result.extend (dir_temp.lastentry)
                dir_temp.readentry
            end
            dir_temp.close
        end

feature {DIRECTORY} -- Implementation

    dir_search (dir_ptr: POINTER; entry: POINTER): POINTER is
            -- Return the DIRENTRY structure corresponding
            -- to the name entry of directory dir_ptr.
        external
            "C | %"eif_dir.h%""
        end

    directory_pointer: POINTER
            -- Directory pointer as required in C

feature {NONE} -- Implementation

    Close_directory: INTEGER is unique

    dir_close (dir_ptr: POINTER) is
            -- Close the directory dir_ptr.
        external
            "C | %"eif_dir.h%""
        end

    dir_next (dir_ptr: POINTER): STRING is
            -- Return the next entry for directory 'dir_ptr'.
        external
            "C | %"eif_dir.h%""
        end

    dir_open (dir_name: POINTER): POINTER is
            -- Open the directory dir_name.
        external
            "C | %"eif_dir.h%""
        end

    dir_rewind (dir_ptr: POINTER) is
            -- Rewind the directory dir_ptr.
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_delete (dir_name: POINTER) is
            -- Delete the directory dir_name.
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_exists (dir_name: POINTER): BOOLEAN is
            -- Does the directory dir_name exist?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_is_executable (dir_name: POINTER): BOOLEAN is
            -- Is dir_name executable?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_is_readable (dir_name: POINTER): BOOLEAN is
            -- Is dir_name readable?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_is_writable (dir_name: POINTER): BOOLEAN is
            -- Is dir_name writable?
        external
            "C | %"eif_dir.h%""
        end

    eif_dir_rename (old_name, new_name: POINTER) is
            -- Change directory name from old_name to new_name.
        external
            "C | %"eif_file.h%""
        alias
            "file_rename"
        end

    file_mkdir (dir_name: POINTER) is
            -- Make directory dir_name.
        external
            "C | %"eif_file.h%""
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    mode: INTEGER
            -- Status mode of the directory.
            -- Possible values are the following:

    Read_directory: INTEGER is unique

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directories, in the Unix sense, with creation and exploration features"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    DIRECTORY

create

    make (dn: STRING)
            -- Create directory object for the directory
            -- of name dn.
        require
            string_exists: dn /= void

    make_open_read (dn: STRING)
            -- Create directory object for the directory
            -- of name dn and open it for reading.
        require
            string_exists: dn /= void

feature -- Initialization

    create_dir
            -- Create a physical directory.
        require
            physical_not_exists: not exists

    make (dn: STRING)
            -- Create directory object for the directory
            -- of name dn.
        require
            string_exists: dn /= void

    make_open_read (dn: STRING)
            -- Create directory object for the directory
            -- of name dn and open it for reading.
        require
            string_exists: dn /= void

feature -- Access

    change_name (new_name: STRING)
            -- Change file name to new_name
        require
            not_new_name_void: new_name /= void
            file_exists: exists
        ensure
            name_changed: name.is_equal (new_name)

    close
            -- Close directory.
        require
            is_open: not is_closed

    has_entry (entry_name: STRING): BOOLEAN
            -- Has directory the entry entry_name?
            -- The use of dir_temp is required not
            -- to change the position in the current
            -- directory entries list.
        require
            string_exists: entry_name /= void

    name: STRING
            -- Directory name

    open_read
            -- Open directory name for reading.

    readentry
            -- Read next directory entry
            -- make result available in lastentry.
            -- Make result void if all entries have been read.
        require
            is_opened: not is_closed

    start
            -- Go to first entry of directory.
        require
            is_opened: not is_closed

feature -- Measurement

    count: INTEGER
            -- Number of entries in directory.
        require
            directory_exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the directory exist?

    is_closed: BOOLEAN
            -- Is current directory closed?

    is_empty: BOOLEAN
            -- Is directory empty?
        require
            directory_exists: exists

    is_executable: BOOLEAN
            -- Is the directory executable?
        require
            directory_exists: exists

    is_readable: BOOLEAN
            -- Is the directory readable?
        require
            directory_exists: exists

    is_writable: BOOLEAN
            -- Is the directory writable?
        require
            directory_exists: exists

    lastentry: STRING
            -- Last entry read by readentry

feature -- Removal

    delete
            -- Delete directory if empty
        require
            directory_exists: exists
            empty_directory: is_empty

    delete_content
            -- Delete all files located in current directory and its
            -- subdirectories.
        require
            directory_exists: exists

    delete_content_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
            -- Delete all files located in current directory and its
            -- subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
            -- action may be set to Void if you don't need it.
            --
            -- Same for is_cancel_requested.
            -- Make it return True to cancel the operation.
            -- is_cancel_requested may be set to Void if you don't need it.
        require
            directory_exists: exists
            valid_file_number: file_number > 0

    dispose
            -- Ensure this medium is closed when garbage collected.

    recursive_delete
            -- Delete directory, its files and its subdirectories.
        require
            directory_exists: exists

    recursive_delete_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
            -- Delete directory, its files and its subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
        require
            directory_exists: exists

feature -- Conversion

    linear_representation: ARRAYED_LIST [STRING]
            -- The entries, in sequential format.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DIRECTORY

Ancestors
    MEMORY

Clients
    DIRECTORY

Suppliers
    ARRAYED_LIST [G]
    BOOLEAN
    DIRECTORY
    FILE_NAME
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    INTEGER
    LINEAR [G]
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    RAW_FILE
    STRING
    TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY_NAME Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directory name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    DIRECTORY_NAME

inherit
    PATH_NAME

create
    make,
    make_from_string

feature

    is_valid: BOOLEAN is
            -- Is the directory name valid?
        local
            any: ANY
        do
            any := to_c
            Result := eif_is_directory_valid ($any)
        end

feature {NONE} -- Externals

    eif_is_directory_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY_NAME Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DIRECTORY_NAME

General
    cluster: base.kernel
    description: "Directory name abstraction"
    create: make_from_string, make

Ancestors
    PATH_NAME

Queries
    is_directory_name_valid (dir_name: STRING): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] DIRECTORY_NAME): BOOLEAN
    is_valid: BOOLEAN
    is_volume_name_valid (vol_name: STRING): BOOLEAN
    to_c: ANY

Commands
    extend (directory_name: STRING)
    extend_from_array (directories: ARRAY [STRING])
    make
    make_from_string (p: STRING)
    set_directory (directory_name: STRING)
    set_subdirectory (directory_name: STRING)
    set_volume (volume_name: STRING)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY_NAME Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directory name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    DIRECTORY_NAME

create
    make,
    make_from_string

feature -- Initialization

    make is
            -- Create path name object.
            -- (from PATH_NAME)
        do
            string_make (0)
        end

    make_from_string (p: STRING) is
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        do
            count := 0
            string_make (0)
            append (p)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

feature {NONE} -- Initialization

    adapt (s: STRING): like Current is
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)
        do
            create Result.string_make (0)
            Result.share (s)
        end

    from_c (c_string: POINTER) is
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string, length)
            count := length
        ensure -- from STRING
            no_zero_byte: not has ('%U')
        end

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER) is
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        local
            length: INTEGER
        do
            length := end_pos - start_pos + 1
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string + (start_pos - 1), (end_pos - start_pos + 1))
            count := length
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1
        end

    string_make (n: INTEGER) is
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            if n = 0 then
                area := empty_area
            else
                make_area (n + 1)
            end
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_from_c (c_string: POINTER) is
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            make_area (length + 1);
            ($area).memory_copy (c_string, length)
            count := length
        end

    string_make_from_string (s: STRING) is
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        do
            area := s.area
            count := s.count
        ensure -- from STRING
            shared_implementation: shared_with (s)
        end

    remake (n: INTEGER) is
        obsolete "Use `make' instead"
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            string_make (n)
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

feature {NONE} -- Access

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, fuzz)
        end

    has (c: CHARACTER): BOOLEAN is
            -- Does string include c?
            -- (from STRING)
        local
            counter: INTEGER
        do
            if not is_empty then
                from
                    counter := 1
                until
                    counter > count or else (item (counter) = c)
                loop
                    counter := counter + 1
                end
                Result := (counter <= count)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from STRING)
        do
            Result := hashcode ($area, count)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    index_of (c: CHARACTER; start: INTEGER): INTEGER is
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        local
            a: like area
            i, nb: INTEGER
        do
            nb := count
            if start <= nb then
                from
                    i := start - 1
                    nb := nb - 1
                    a := area
                until
                    i > nb or else a.item (i) = c
                loop
                    i := i + 1
                end
                if i <= nb then
                    Result := i + 1
                end
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    item (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

    item_code (i: INTEGER): INTEGER is
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            Result := area.item (i - 1).code
        end

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER is
            -- Position of last occurence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        local
            a: like area
            i: INTEGER
        do
            from
                i := start_index_from_end - 1
                a := area
            until
                i < 0 or else a.item (i) = c
            loop
                i := i - 1
            end
            if i >= 0 then
                Result := i + 1
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    shared_with (other: like Current): BOOLEAN is
            -- Does string share the text of other?
            -- (from STRING)
        do
            Result := (other /= void) and then (area = other.area)
        end

    substring_index (other: STRING; start: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, 0)
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)
        end

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

feature {PATH_NAME} -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Allocated space
            -- (from STRING)
        do
            Result := area.count - 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from STRING)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count
        end

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER is
            -- Number of times c appears in the string
            -- (from STRING)
        local
            counter, nb: INTEGER
            a: SPECIAL [CHARACTER]
        do
            from
                counter := 0
                nb := count - 1
                a := area
            until
                counter > nb
            loop
                if a.item (counter) = c then
                    Result := Result + 1
                end
                counter := counter + 1
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {PATH_NAME} -- Measurement

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is the path name equal to other?
            -- (from PATH_NAME)
        require -- from ANY
            other_not_void: other /= void
        local
            o_area: like area
        do
            if other = Current then
                Result := True
            elseif other.count = count then
                o_area := other.area;
                Result := eif_path_name_compare ($area, $o_area, count)
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

feature {NONE} -- Comparison

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: like Current): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current < other then
                Result := - 1
            elseif other < Current then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        local
            other_area: like area
            other_count: INTEGER
            current_count: INTEGER
        do
            other_area := other.area
            other_count := other.count
            current_count := count
            if other_count = current_count then
                Result := str_strict_cmp ($other_area, $area, other_count) > 0
            else
                if current_count < other_count then
                    Result := str_strict_cmp ($other_area, $area, current_count) >= 0
                else
                    Result := str_strict_cmp ($other_area, $area, other_count) > 0
                end
            end
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN is
            -- Is dir_name a valid subdirectory part for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: dir_name /= void
        local
            any: ANY
        do
            any := dir_name.to_c
            Result := eif_is_directory_name_valid ($any)
        end

    is_volume_name_valid (vol_name: STRING): BOOLEAN is
            -- Is vol_name a valid volume name for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: vol_name /= void
        local
            any: ANY
        do
            any := vol_name.to_c
            Result := eif_is_volume_name_valid ($any)
        end

feature {NONE} -- Status report

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_boolean: BOOLEAN is
            -- Does Current represent a BOOLEAN?
            -- (from STRING)
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant) or else s.is_equal (false_constant)
        end

    is_double: BOOLEAN is
            -- Does Current represent a DOUBLE?
            -- (from STRING)
        do
            Result := str_isd ($area, count)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_integer: BOOLEAN is
            -- Does Current represent an INTEGER?
            -- (from STRING)
        do
            Result := str_isi ($area, count)
        end

    is_real: BOOLEAN is
            -- Does Current represent a REAL?
            -- (from STRING)
        do
            Result := str_isr ($area, count)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from STRING)
        do
            Result := True
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the string?
            -- (from STRING)
        do
            Result := (i > 0) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature  -- Status report

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

feature -- Status setting

    extend (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    extend_from_array (directories: ARRAY [STRING]) is
            -- Append the subdirectories from directories to the path name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            array_exists: directories /= void and then not (directories.is_empty)
        local
            i, nb: INTEGER
        do
            from
                i := directories.lower
                nb := directories.upper
            until
                i > nb
            loop
                extend (directories.item (i))
                i := i + 1
            end
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    set_directory (directory_name: STRING) is
            -- Set the absolute directory part of the path name to directory_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_set_directory ($Current, $str1, $str2)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    set_subdirectory (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    set_volume (volume_name: STRING) is
            -- Set the volume part of the path name to volume_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        do
            append (volume_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

feature {NONE} -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Element change

    append (s: STRING) is
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area;
            ($area + count).memory_copy ($s_area, s.count)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + old s.count
        end

    append_boolean (b: BOOLEAN) is
            -- Append the string representation of b at end.
            -- (from STRING)
        do
            append (b.out)
        end

    append_character (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    append_double (d: DOUBLE) is
            -- Append the string representation of d at end.
            -- (from STRING)
        do
            append (d.out)
        end

    append_integer (i: INTEGER) is
            -- Append the string representation of i at end.
            -- (from STRING)
        do
            append (i.out)
        end

    append_real (r: REAL) is
            -- Append the string representation of r at end.
            -- (from STRING)
        do
            append (r.out)
        end

    append_string (s: STRING) is
            -- Append a copy of s, if not void, at end.
            -- (from STRING)
        do
            if s /= void then
                append (s)
            end
        end

    copy (other: like Current) is
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            old_area: like area
        do
            if other /= Current then
                old_area := area
                standard_copy (other)
                if old_area = void or else old_area.count < area.count then
                    area := standard_clone (area)
                else
                    ($old_area).memory_copy ($area, count)
                    area := old_area
                end
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count
        end

    string_extend (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                string_extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_blank is
            -- Fill with capacity blank characters.
            -- (from STRING)
        do
            fill_character (' ')
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    fill_character (c: CHARACTER) is
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, capacity)
            count := capacity
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    head (n: INTEGER) is
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        do
            if n < count then
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    insert (s: STRING; i: INTEGER) is
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, i)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    left_adjust is
            -- Remove leading whitespace.
            -- (from STRING)
        do
            count := str_left ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))
        end

    precede (c: CHARACTER) is
            -- Add c at front.
            -- (from STRING)
        do
            if count = capacity then
                resize (count + additional_space)
            end
            str_cprepend ($area, c, count)
            count := count + 1
        ensure -- from STRING
            new_count: count = old count + 1
        end

    prepend (s: STRING) is
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := count + s.count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, 1)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    prepend_boolean (b: BOOLEAN) is
            -- Prepend the string representation of b at front.
            -- (from STRING)
        do
            prepend (b.out)
        end

    prepend_character (c: CHARACTER) is
            -- Prepend the string representation of c at front.
            -- (from STRING)
        do
            prepend (c.out)
        end

    prepend_double (d: DOUBLE) is
            -- Prepend the string representation of d at front.
            -- (from STRING)
        do
            prepend (d.out)
        end

    prepend_integer (i: INTEGER) is
            -- Prepend the string representation of i at front.
            -- (from STRING)
        do
            prepend (i.out)
        end

    prepend_real (r: REAL) is
            -- Prepend the string representation of r at front.
            -- (from STRING)
        do
            prepend (r.out)
        end

    prepend_string (s: STRING) is
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)
        do
            if s /= void then
                prepend (s)
            end
        end

    put (c: CHARACTER; i: INTEGER) is
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (c, i - 1)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    replace_blank is
            -- Replace all current characters with blanks.
            -- (from STRING)
        do
            replace_character (' ')
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_character (c: CHARACTER) is
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, count)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_substring (s: like Current; start_pos, end_pos: INTEGER) is
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        local
            new_size, substring_size: INTEGER
            s_area: like area
        do
            substring_size := end_pos - start_pos + 1
            new_size := s.count + count - substring_size
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_replace ($area, $s_area, count, s.count, start_pos, end_pos)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1
        end

    replace_substring_all (original, new: like Current) is
            -- Replace every occurence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty
        local
            change_pos: INTEGER
        do
            if not is_empty then
                from
                    change_pos := substring_index (original, 1)
                until
                    change_pos = 0
                loop
                    replace_substring (new, change_pos, change_pos + original.count - 1)
                    if change_pos + new.count <= count then
                        change_pos := substring_index (original, change_pos + new.count)
                    else
                        change_pos := 0
                    end
                end
            end
        end

    right_adjust is
            -- Remove trailing whitespace.
            -- (from STRING)
        do
            count := str_right ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))
        end

    set (t: like Current; n1, n2: INTEGER) is
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        local
            s: STRING
        do
            s := t.substring (n1, n2)
            area := s.area
            count := s.count
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    share (other: like Current) is
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        do
            area := other.area
            count := other.count
        ensure -- from STRING
            shared_count: other.count = count
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            start0 := start_pos - 1
            end0 := end_pos - 1
            index0 := index_pos - 1
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

    tail (n: INTEGER) is
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        local
            i, j: INTEGER
        do
            if n < count then
                from
                    j := (count - n)
                    i := 0
                until
                    i = n
                loop
                    area.put (area.item (j), i)
                    i := i + 1
                    j := j + 1
                end
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    infix "+" (s: STRING): STRING is
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        do
            create Result.make (count + s.count)
            Result.append_string (Current)
            Result.append_string (s)
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all characters.
            -- (from STRING)
        do
            count := 0
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity
        end

    prune (c: CHARACTER) is
            -- Remove first occurrence of c, if any.
            -- (from STRING)
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True
        local
            counter: INTEGER
        do
            from
                counter := 1
            until
                counter > count or else (item (counter) = c)
            loop
                counter := counter + 1
            end
            if counter <= count then
                remove (counter)
            end
        end

    prune_all (c: CHARACTER) is
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        do
            count := str_rmall ($area, c, count)
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))
        end

    prune_all_leading (c: CHARACTER) is
            -- Remove all leading occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (1) /= c
            loop
                remove (1)
            end
        end

    prune_all_trailing (c: CHARACTER) is
            -- Remove all trailing occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (count) /= c
            loop
                remove (count)
            end
        end

    remove (i: INTEGER) is
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            str_rmchar ($area, count, i)
            count := count - 1
        ensure -- from STRING
            new_count: count = old count - 1
        end

feature  -- Removal

    wipe_out is
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        do
            area := empty_area
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0
        end

feature {NONE} -- Resizing

    adapt_size is
            -- Adapt the size to accommodate count characters.
            -- (from STRING)
        do
            resize (count)
        end

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (newsize: INTEGER) is
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        do
            if newsize > capacity then
                resize (newsize)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (newsize: INTEGER) is
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0
        local
            area_count: INTEGER
        do
            area_count := area.count
            if newsize >= area_count then
                if area_count = 1 then
                    make_area (newsize + 1)
                else
                    area := str_resize ($area, newsize + 1)
                end
            end
        end

feature {NONE} -- Conversion

    center_justify is
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_cjustify ($area, count, capacity)
        end

    character_justify (pivot: CHARACTER; position: INTEGER) is
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty
        do
            if index_of (pivot, 1) < position then
                from
                    precede (' ')
                until
                    index_of (pivot, 1) = position
                loop
                    precede (' ')
                end
            elseif index_of (pivot, 1) > position then
                from
                    remove (1)
                until
                    index_of (pivot, 1) = position
                loop
                    remove (1)
                end
            end
            from
            until
                count = capacity
            loop
                string_extend (' ')
            end
        end

    left_justify is
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_ljustify ($area, count, capacity)
        end

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from STRING)
        local
            temp: ARRAYED_LIST [CHARACTER]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := 1
            until
                i > count
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

    mirror is
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        local
            a: like area
            c: CHARACTER
            i, j: INTEGER
        do
            if count > 0 then
                from
                    i := count - 1
                    a := area
                until
                    i <= j
                loop
                    c := a.item (i)
                    a.put (a.item (j), i)
                    a.put (c, j)
                    i := i - 1
                    j := j + 1
                end
            end
        ensure -- from STRING
            same_count: count = old count
        end

    mirrored: like Current is
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        do
            Result := clone (Current)
            if count > 0 then
                Result.mirror
            end
        ensure -- from STRING
            same_count: Result.count = count
        end

    right_justify is
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_rjustify ($area, count, capacity)
        end

    split (a_separator: CHARACTER): LINEAR [STRING] is
            -- Split on a_separator.
            -- Ignore separators in quotes.
            -- (from STRING)
        local
            al: ARRAYED_LIST [STRING]
            part: STRING
            i, j, c: INTEGER
            q: BOOLEAN
            p: CHARACTER
        do
            from
                c := count
                create al.make (c)
                i := 1
                j := 0
            until
                i > c
            loop
                j := index_of (a_separator, i)
                if j = 0 then
                    j := c + 1
                end
                part := substring (i, j - 1)
                if part.has ('"') then
                    from
                        j := i - 1
                        p := '%U'
                    until
                        j >= c or p = a_separator
                    loop
                        j := j + 1
                        p := item (j)
                        if p = '"' and not (j > 1 and then item (j - 1) = '%%') then
                            q := not q
                        end
                        if q and p = a_separator then
                            p := '%U'
                        end
                    end
                    part := substring (i, j - 1)
                    part.replace_substring_all ("%%%%", "_#___PERCENT___#_")
                    part.replace_substring_all ("%%%"", "_#___QUOTE___#_")
                    part.replace_substring_all ("%"", "")
                    part.replace_substring_all ("_#___PERCENT___#_", "%%")
                    part.replace_substring_all ("_#___QUOTE___#_", "%"")
                    part.prepend ("%"")
                    part.append ("%"")
                end
                al.extend (part)
                i := j + 1
            end
            Result := al
            check
                al.count = occurrences (a_separator)
            end
        ensure -- from STRING
            Result /= void
        end

    to_boolean: BOOLEAN is
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant)
        end

    to_double: DOUBLE is
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double
        do
            Result := str_atod ($area, count)
        end

    to_integer: INTEGER is
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer
        do
            Result := str_atoi ($area, count)
        end

    to_lower is
            -- Convert to lower case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).lower, i)
                i := i - 1
            end
        end

    to_real: REAL is
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real
        do
            Result := str_ator ($area, count)
        end

    to_upper is
            -- Convert to upper case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).upper, i)
                i := i - 1
            end
        end

feature  -- Conversion

    frozen to_c: ANY is
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)
        do
            area.put ('%U', count)
            Result := area
        end

feature {NONE} -- Duplication

    multiply (n: INTEGER) is
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1
        local
            s: STRING
            i: INTEGER
        do
            s := clone (Current)
            grow (n * count)
            from
                i := n
            until
                i = 1
            loop
                append (s)
                i := i - 1
            end
        end

    substring (n1, n2: INTEGER): like Current is
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        local
            other_area: like area
        do
            if (1 <= n1) and (n1 <= n2) and (n2 <= count) then
                create Result.string_make (n2 - n1 + 1)
                other_area := Result.area
                ($other_area).memory_copy ($area + (n1 - 1), n2 - n1 + 1)
                Result.set_count (n2 - n1 + 1)
            else
                create Result.string_make (0)
            end
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0
        end

feature {NONE} -- Inapplicable

    bag_put (v: CHARACTER) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    c_p_i: INTEGER is
        obsolete "You now have to implement it yourself by inheriting from PLATFORM."
            -- Number of characters per INTEGER
            -- (from STRING)
        do
        end

    hashcode (c_string: POINTER; len: INTEGER): INTEGER is
            -- Hash code value of c_string
            -- (from STRING)
        external
            "C use %"eif_tools.h%""
        end

    frozen set_count (number: INTEGER) is
            -- Set count to number of characters.
            -- (from STRING)
        require -- from STRING
            valid_count: 0 <= number and number <= capacity
        do
            count := number
        ensure -- from STRING
            new_count: count = number
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy characters of source within bounds s
            -- and e to target starting at index i.
            -- (from STRING)
        external
            "C use %"eif_copy.h%""
        end

    str_atod (c_string: POINTER; length: INTEGER): DOUBLE is
            -- Value of double in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_DOUBLE use %"eif_str.h%""
        end

    str_atoi (c_string: POINTER; length: INTEGER): INTEGER is
            -- Value of integer in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_ator (c_string: POINTER; length: INTEGER): REAL is
            -- Value of real in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_REAL use %"eif_str.h%""
        end

    str_cjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Center justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_cprepend (c_string: POINTER; c: CHARACTER; length: INTEGER) is
            -- Prepend c to c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_insert (c_string, other_string: POINTER; c_length, other_length, position: INTEGER) is
            -- Insert other_string into c_string at position.
            -- Insertion occurs at the left of position.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_isd (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a double?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isi (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is an integer?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isr (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a real?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_left (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all leading whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_len (c_string: POINTER): INTEGER is
            -- Length of the C string: c_string
            -- (from STRING)
        external
            "C signature (char *): EIF_INTEGER use %"eif_str.h%""
        alias
            "strlen"
        end

    str_ljustify (c_string: POINTER; length, cap: INTEGER) is
            -- Left justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_replace (c_string, other_string: POINTER; c_length, other_length, star_post, end_pos: INTEGER) is
            -- Replace substring (start_pos, end_pos) from c_string
            -- by other_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_resize (a: POINTER; newsize: INTEGER): like area is
            -- Area which can accomodate
            -- at least newsize characters
            -- (from STRING)
        external
            "C use %"eif_malloc.h%""
        alias
            "sprealloc"
        end

    str_right (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all trailing whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Right justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rmall (c_string: POINTER; c: CHARACTER; length: INTEGER): INTEGER is
            -- Remove all occurrences of c in c_string.
            -- Return new number of character making up c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rmchar (c_string: POINTER; length, i: INTEGER) is
            -- Remove i-th character from c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_str (c_str, o_str: POINTER; clen, olen, i, fuzzy: INTEGER): INTEGER is
            -- Forward search of o_str within c_str starting at i.
            -- Return the index within c_str where the pattern was
            -- located, 0 if not found.
            -- The 'fuzzy' parameter is the maximum allowed number of
            -- mismatches within the pattern. A 0 means an exact match.
            -- (from STRING)
        external
            "C use %"eif_eiffel.h%""
        end

    str_strict_cmp (this, other: POINTER; len: INTEGER): INTEGER is
            -- Compare this and other C strings
            -- for the first len characters.
            -- 0 if equal, < 0 if this < other,
            -- > 0 if this > other
            -- (from STRING)
        external
            "C signature (char *, char *, size_t): EIF_INTEGER use <string.h>"
        alias
            "strncmp"
        end

feature

    is_valid: BOOLEAN is
            -- Is the directory name valid?
        local
            any: ANY
        do
            any := to_c
            Result := eif_is_directory_valid ($any)
        end

feature {NONE} -- Empty string implementation

    empty_area: SPECIAL [CHARACTER] is
            -- Empty area used when calling `make (0)'.
            -- (from STRING)
        local
            old_area: like area
        once
            old_area := area
            make_area (1)
            Result := area
            area := old_area
        end

feature {NONE} -- Externals

    eif_append_directory (s, p, v: POINTER) is
            -- (from PATH_NAME)
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_extracted_paths (s: POINTER): ARRAY [STRING] is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

    eif_is_directory_name_valid (p: POINTER): BOOLEAN is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_directory_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_volume_name_valid (p: POINTER): BOOLEAN is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_path_name_compare (s, t: POINTER; length: INTEGER): BOOLEAN is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_set_directory (s, p, v: POINTER) is
            -- (from PATH_NAME)
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_volume_name (s: POINTER): STRING is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

feature {NONE} -- Output

    out: like Current is
            -- Printable representation
            -- (from STRING)
        do
            Result := clone (Current)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY_NAME Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directory name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    DIRECTORY_NAME

create

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature -- Initialization

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the path name equal to other?
            -- (from PATH_NAME)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN
            -- Is dir_name a valid subdirectory part for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: dir_name /= void

    is_volume_name_valid (vol_name: STRING): BOOLEAN
            -- Is vol_name a valid volume name for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: vol_name /= void

feature  -- Status report

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

feature -- Status setting

    extend (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    extend_from_array (directories: ARRAY [STRING])
            -- Append the subdirectories from directories to the path name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            array_exists: directories /= void and then not (directories.is_empty)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_directory (directory_name: STRING)
            -- Set the absolute directory part of the path name to directory_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_subdirectory (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_volume (volume_name: STRING)
            -- Set the volume part of the path name to volume_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature  -- Removal

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature  -- Conversion

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

feature

    is_valid: BOOLEAN
            -- Is the directory name valid?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY_NAME Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DIRECTORY_NAME

Ancestors
    PATH_NAME

Clients
    DIRECTORY_NAME

Suppliers
    DIRECTORY_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY_NAME Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directory name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    DIRECTORY_NAME

create
    make,
    make_from_string

feature

    is_valid: BOOLEAN
            -- Is the directory name valid?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DIRECTORY Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Directories, in the Unix sense, with creation and exploration features"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    DIRECTORY

create
    make,
    make_open_read

feature -- Initialization

    make (dn: STRING)
            -- Create directory object for the directory
            -- of name dn.
        require
            string_exists: dn /= void

    make_open_read (dn: STRING)
            -- Create directory object for the directory
            -- of name dn and open it for reading.
        require
            string_exists: dn /= void

    create_dir
            -- Create a physical directory.
        require
            physical_not_exists: not exists

feature -- Access

    readentry
            -- Read next directory entry
            -- make result available in lastentry.
            -- Make result void if all entries have been read.
        require
            is_opened: not is_closed

    name: STRING
            -- Directory name

    has_entry (entry_name: STRING): BOOLEAN
            -- Has directory the entry entry_name?
            -- The use of dir_temp is required not
            -- to change the position in the current
            -- directory entries list.
        require
            string_exists: entry_name /= void

    open_read
            -- Open directory name for reading.

    close
            -- Close directory.
        require
            is_open: not is_closed

    start
            -- Go to first entry of directory.
        require
            is_opened: not is_closed

    change_name (new_name: STRING)
            -- Change file name to new_name
        require
            not_new_name_void: new_name /= void
            file_exists: exists
        ensure
            name_changed: name.is_equal (new_name)

feature -- Measurement

    count: INTEGER
            -- Number of entries in directory.
        require
            directory_exists: exists

feature -- Conversion

    linear_representation: ARRAYED_LIST [STRING]
            -- The entries, in sequential format.

feature -- Status report

    lastentry: STRING
            -- Last entry read by readentry

    is_closed: BOOLEAN
            -- Is current directory closed?

    is_empty: BOOLEAN
            -- Is directory empty?
        require
            directory_exists: exists

    exists: BOOLEAN
            -- Does the directory exist?

    is_readable: BOOLEAN
            -- Is the directory readable?
        require
            directory_exists: exists

    is_executable: BOOLEAN
            -- Is the directory executable?
        require
            directory_exists: exists

    is_writable: BOOLEAN
            -- Is the directory writable?
        require
            directory_exists: exists

feature -- Removal

    delete
            -- Delete directory if empty
        require
            directory_exists: exists
            empty_directory: is_empty

    delete_content
            -- Delete all files located in current directory and its
            -- subdirectories.
        require
            directory_exists: exists

    recursive_delete
            -- Delete directory, its files and its subdirectories.
        require
            directory_exists: exists

    delete_content_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
            -- Delete all files located in current directory and its
            -- subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
            -- action may be set to Void if you don't need it.
            --
            -- Same for is_cancel_requested.
            -- Make it return True to cancel the operation.
            -- is_cancel_requested may be set to Void if you don't need it.
        require
            directory_exists: exists
            valid_file_number: file_number > 0

    recursive_delete_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
            -- Delete directory, its files and its subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
        require
            directory_exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, double precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class
    DOUBLE

inherit
    DOUBLE_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    DOUBLE

General
    cluster: base.kernel
    description: "Real values, double precision"

Ancestors
    DOUBLE_REF

Queries
    infix ">=" (other: [like Current] DOUBLE): BOOLEAN
    infix ">" (other: [like Current] DOUBLE): BOOLEAN
    infix "<=" (other: [like Current] DOUBLE): BOOLEAN
    infix "<" (other: [like Current] DOUBLE): BOOLEAN
    infix "-" (other: [like Current] DOUBLE): [like Current] DOUBLE
    infix "+" (other: [like Current] DOUBLE): [like Current] DOUBLE
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] DOUBLE): [like Current] DOUBLE
    infix "*" (other: [like Current] DOUBLE): [like Current] DOUBLE
    prefix "-": [like Current] DOUBLE
    prefix "+": [like Current] DOUBLE
    abs: DOUBLE
    ceiling: INTEGER
    divisible (other: DOUBLE_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] DOUBLE): BOOLEAN
    is_hashable: BOOLEAN
    item: DOUBLE
    max (other: [like Current] DOUBLE): [like Current] DOUBLE
    min (other: [like Current] DOUBLE): [like Current] DOUBLE
    one: [like Current] DOUBLE
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: DOUBLE_REF): INTEGER
    truncated_to_integer: INTEGER
    truncated_to_real: REAL
    zero: [like Current] DOUBLE

Commands
    set_item (d: DOUBLE)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, double precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class
    DOUBLE

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
            -- (from DOUBLE_REF)
        do
            Result := truncated_to_integer.hash_code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: DOUBLE
            -- Numeric double value
            -- (from DOUBLE_REF)

    one: like Current is
            -- Neutral element for "*" and "/"
            -- (from DOUBLE_REF)
        do
            create Result
            Result.set_item (1.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
            -- (from DOUBLE_REF)
        do
            if item > 0.0 then
                Result := 1
            elseif item < 0.0 then
                Result := - 1
            end
        ensure -- from DOUBLE_REF
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
            -- (from DOUBLE_REF)
        do
            create Result
            Result.set_item (0.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from DOUBLE_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: DOUBLE_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from DOUBLE_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current double?
            -- (from DOUBLE_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN is
            -- May current object be divided by other?
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0.0
        ensure then -- from DOUBLE_REF
            not_exact_zero: Result implies (other.item /= 0.0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0.0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0.0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0.0
            end
        ensure then -- from DOUBLE_REF
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from DOUBLE_REF)
        do
            Result := item /= 0.0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (d: DOUBLE) is
            -- Make d the item value.
            -- (from DOUBLE_REF)
        do
            item := d
        end

feature -- Conversion

    ceiling: INTEGER is
            -- Smallest integral value no smaller than current object
            -- (from DOUBLE_REF)
        do
            Result := c_ceiling (item).truncated_to_integer
        ensure -- from DOUBLE_REF
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one
        end

    floor: INTEGER is
            -- Greatest integral value no greater than current object
            -- (from DOUBLE_REF)
        do
            Result := c_floor (item).truncated_to_integer
        ensure -- from DOUBLE_REF
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one
        end

    rounded: INTEGER is
            -- Rounded integral value
            -- (from DOUBLE_REF)
        do
            Result := sign * (c_floor (abs_ref.item + 0.5).truncated_to_integer)
        ensure -- from DOUBLE_REF
            definition: Result = sign * ((abs + 0.5).floor)
        end

    truncated_to_integer: INTEGER is
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)
            -- (from DOUBLE_REF)
        do
            Result := c_truncated_to_integer (item)
        end

    truncated_to_real: REAL is
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)
            -- (from DOUBLE_REF)
        do
            Result := c_truncated_to_real (item)
        end

feature -- Basic operations

    abs: DOUBLE is
            -- Absolute value
            -- (from DOUBLE_REF)
        do
            Result := abs_ref.item
        ensure -- from DOUBLE_REF
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product with other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
            -- (from DOUBLE_REF)
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
            -- (from DOUBLE_REF)
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item / other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Current double to the power other
            -- (from DOUBLE_REF)
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

feature {NONE} -- Implementation

    abs_ref: DOUBLE_REF is
            -- Absolute value
            -- (from DOUBLE_REF)
        do
            if item >= 0.0 then
                Result := Current
            else
                Result := - Current
            end
        ensure -- from DOUBLE_REF
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ceiling (d: DOUBLE): DOUBLE is
            -- Smallest integral value no smaller than d
            -- (from DOUBLE_REF)
        external
            "C | <math.h>"
        alias
            "ceil"
        end

    c_floor (d: DOUBLE): DOUBLE is
            -- Greatest integral value no greater than d
            -- (from DOUBLE_REF)
        external
            "C | <math.h>"
        alias
            "floor"
        end

    c_outd (d: DOUBLE): STRING is
            -- Printable representation of double value
            -- (from DOUBLE_REF)
        external
            "C | %"eif_out.h%""
        end

    c_truncated_to_integer (d: DOUBLE): INTEGER is
            -- Integer part of d (same sign, largest absolute
            -- value no greater than d's)
            -- (from DOUBLE_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_di"
        end

    c_truncated_to_real (d: DOUBLE): REAL is
            -- Real part of d (same sign, largest absolute
            -- value no greater than d's)
            -- (from DOUBLE_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_dr"
        end

feature -- Output

    out: STRING is
            -- Printable representation of double value
            -- (from DOUBLE_REF)
        do
            Result := c_outd (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DOUBLE_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, double precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    DOUBLE

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from DOUBLE_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: DOUBLE
            -- Numeric double value
            -- (from DOUBLE_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from DOUBLE_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: DOUBLE_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from DOUBLE_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current double?
            -- (from DOUBLE_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from DOUBLE_REF
            not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from DOUBLE_REF
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from DOUBLE_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (d: DOUBLE)
            -- Make d the item value.
            -- (from DOUBLE_REF)

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)
            -- (from DOUBLE_REF)

    truncated_to_real: REAL
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)
            -- (from DOUBLE_REF)

feature -- Basic operations

    abs: DOUBLE
            -- Absolute value
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product with other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current double to the power other
            -- (from DOUBLE_REF)

feature -- Output

    out: STRING
            -- Printable representation of double value
            -- (from DOUBLE_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DOUBLE_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    DOUBLE

Ancestors
    DOUBLE_REF

Clients
    DOUBLE_MATH
    DOUBLE_REF
    FORMAT_DOUBLE
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    RANDOM
    REAL_REF
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a double-precision real number"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    DOUBLE_REF

inherit
    NUMERIC
        redefine
            out,
            is_equal
        end

    COMPARABLE
        redefine
            out,
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            out,
            is_equal
        end

feature -- Access

    item: DOUBLE
            -- Numeric double value

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := truncated_to_integer.hash_code
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0.0 then
                Result := 1
            elseif item < 0.0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1.0)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0.0)
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current double?
        do
            Result := item < other.item
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: DOUBLE_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Element change

    set_item (d: DOUBLE) is
            -- Make d the item value.
        do
            item := d
        end

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN is
            -- May current object be divided by other?
        do
            Result := other.item /= 0.0
        ensure then
            not_exact_zero: Result implies (other.item /= 0.0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0.0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0.0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0.0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0.0
        end

feature -- Conversion

    truncated_to_integer: INTEGER is
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)
        do
            Result := c_truncated_to_integer (item)
        end

    truncated_to_real: REAL is
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)
        do
            Result := c_truncated_to_real (item)
        end

    ceiling: INTEGER is
            -- Smallest integral value no smaller than current object
        do
            Result := c_ceiling (item).truncated_to_integer
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one
        end

    floor: INTEGER is
            -- Greatest integral value no greater than current object
        do
            Result := c_floor (item).truncated_to_integer
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one
        end

    rounded: INTEGER is
            -- Rounded integral value
        do
            Result := sign * (c_floor (abs_ref.item + 0.5).truncated_to_integer)
        ensure
            definition: Result = sign * ((abs + 0.5).floor)
        end

feature -- Basic operations

    abs: DOUBLE is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        do
            create Result
            Result.set_item (item + other.item)
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        do
            create Result
            Result.set_item (item - other.item)
        end

    infix "*" (other: like Current): like Current is
            -- Product with other
        do
            create Result
            Result.set_item (item * other.item)
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
        do
            create Result
            Result.set_item (item / other.item)
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Current double to the power other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        end

feature -- Output

    out: STRING is
            -- Printable representation of double value
        do
            Result := c_outd (item)
        end

feature {NONE} -- Implementation

    abs_ref: DOUBLE_REF is
            -- Absolute value
        do
            if item >= 0.0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_outd (d: DOUBLE): STRING is
            -- Printable representation of double value
        external
            "C | %"eif_out.h%""
        end

    c_truncated_to_integer (d: DOUBLE): INTEGER is
            -- Integer part of d (same sign, largest absolute
            -- value no greater than d's)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_di"
        end

    c_truncated_to_real (d: DOUBLE): REAL is
            -- Real part of d (same sign, largest absolute
            -- value no greater than d's)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_dr"
        end

    c_ceiling (d: DOUBLE): DOUBLE is
            -- Smallest integral value no smaller than d
        external
            "C | <math.h>"
        alias
            "ceil"
        end

    c_floor (d: DOUBLE): DOUBLE is
            -- Greatest integral value no greater than d
        external
            "C | <math.h>"
        alias
            "floor"
        end

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DOUBLE_REF

General
    cluster: base.kernel
    description: "References to objects containing a double-precision real number"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix ">=" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix ">" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix "<=" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix "<" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix "-" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    infix "+" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    infix "*" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    prefix "-": [like Current] DOUBLE_REF
    prefix "+": [like Current] DOUBLE_REF
    abs: DOUBLE
    ceiling: INTEGER
    divisible (other: DOUBLE_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] DOUBLE_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: DOUBLE
    max (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    min (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    one: [like Current] DOUBLE_REF
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: DOUBLE_REF): INTEGER
    truncated_to_integer: INTEGER
    truncated_to_real: REAL
    zero: [like Current] DOUBLE_REF

Commands
    set_item (d: DOUBLE)

Constraints
    sign times abs

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a double-precision real number"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    DOUBLE_REF

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := truncated_to_integer.hash_code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: DOUBLE
            -- Numeric double value

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0.0 then
                Result := 1
            elseif item < 0.0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: DOUBLE_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current double?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN is
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0.0
        ensure then
            not_exact_zero: Result implies (other.item /= 0.0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0.0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0.0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0.0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0.0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (d: DOUBLE) is
            -- Make d the item value.
        do
            item := d
        end

feature -- Conversion

    ceiling: INTEGER is
            -- Smallest integral value no smaller than current object
        do
            Result := c_ceiling (item).truncated_to_integer
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one
        end

    floor: INTEGER is
            -- Greatest integral value no greater than current object
        do
            Result := c_floor (item).truncated_to_integer
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one
        end

    rounded: INTEGER is
            -- Rounded integral value
        do
            Result := sign * (c_floor (abs_ref.item + 0.5).truncated_to_integer)
        ensure
            definition: Result = sign * ((abs + 0.5).floor)
        end

    truncated_to_integer: INTEGER is
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)
        do
            Result := c_truncated_to_integer (item)
        end

    truncated_to_real: REAL is
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)
        do
            Result := c_truncated_to_real (item)
        end

feature -- Basic operations

    abs: DOUBLE is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product with other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item / other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Current double to the power other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

feature {NONE} -- Implementation

    abs_ref: DOUBLE_REF is
            -- Absolute value
        do
            if item >= 0.0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ceiling (d: DOUBLE): DOUBLE is
            -- Smallest integral value no smaller than d
        external
            "C | <math.h>"
        alias
            "ceil"
        end

    c_floor (d: DOUBLE): DOUBLE is
            -- Greatest integral value no greater than d
        external
            "C | <math.h>"
        alias
            "floor"
        end

    c_outd (d: DOUBLE): STRING is
            -- Printable representation of double value
        external
            "C | %"eif_out.h%""
        end

    c_truncated_to_integer (d: DOUBLE): INTEGER is
            -- Integer part of d (same sign, largest absolute
            -- value no greater than d's)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_di"
        end

    c_truncated_to_real (d: DOUBLE): REAL is
            -- Real part of d (same sign, largest absolute
            -- value no greater than d's)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_dr"
        end

feature -- Output

    out: STRING is
            -- Printable representation of double value
        do
            Result := c_outd (item)
        end

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a double-precision real number"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    DOUBLE_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: DOUBLE
            -- Numeric double value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: DOUBLE_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current double?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (d: DOUBLE)
            -- Make d the item value.

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
        ensure
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)

    truncated_to_real: REAL
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)

feature -- Basic operations

    abs: DOUBLE
            -- Absolute value
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current double to the power other

feature -- Output

    out: STRING
            -- Printable representation of double value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DOUBLE_REF

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Descendants
    DOUBLE

Clients
    DLL_32_ROUTINE
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    REAL_REF
    TUPLE

Suppliers
    BOOLEAN
    DOUBLE
    DOUBLE_REF
    INTEGER
    INTEGER_REF
    NUMERIC
    REAL
    REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a double-precision real number"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    DOUBLE_REF

feature -- Access

    item: DOUBLE
            -- Numeric double value

    hash_code: INTEGER
            -- Hash code value

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    one: like Current
            -- Neutral element for "*" and "/"

    zero: like Current
            -- Neutral element for "+" and "-"

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current double?

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: DOUBLE_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1

feature -- Element change

    set_item (d: DOUBLE)
            -- Make d the item value.

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN
            -- May current object be divided by other?
        ensure then
            not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Conversion

    truncated_to_integer: INTEGER
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)

    truncated_to_real: REAL
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
        ensure
            definition: Result = sign * ((abs + 0.5).floor)

feature -- Basic operations

    abs: DOUBLE
            -- Absolute value
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "+" (other: like Current): like Current
            -- Sum with other

    infix "-" (other: like Current): like Current
            -- Result of subtracting other

    infix "*" (other: like Current): like Current
            -- Product with other

    infix "/" (other: like Current): like Current
            -- Division by other

    infix "^" (other: NUMERIC): DOUBLE
            -- Current double to the power other

    prefix "+": like Current
            -- Unary plus

    prefix "-": like Current
            -- Unary minus

feature -- Output

    out: STRING
            -- Printable representation of double value

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, double precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    DOUBLE

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEPTIONS Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for adapting the exception handling mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    EXCEPTIONS

inherit
    EXCEP_CONST

feature -- Status report

    meaning (except: INTEGER): STRING is
            -- A message in English describing what except is
        external
            "C | %"eif_except.h%""
        alias
            "eename"
        end

    assertion_violation: BOOLEAN is
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
        do
            Result := (original_exception = check_instruction) or else (original_exception = class_invariant) or else (original_exception = loop_invariant) or else (original_exception = loop_variant) or else (original_exception = postcondition) or else (original_exception = precondition)
        end

    is_developer_exception: BOOLEAN is
            -- Is the last exception originally due to
            -- a developer exception?
        do
            Result := (original_exception = developer_exception)
        end

    is_developer_exception_of_name (name: STRING): BOOLEAN is
            -- Is the last exception originally due to a developer
            -- exception of name name?
        do
            Result := is_developer_exception and then equal (name, developer_exception_name)
        end

    developer_exception_name: STRING is
            -- Name of last developer-raised exception
        require
            applicable: is_developer_exception
        do
            Result := original_tag_name
        end

    is_signal: BOOLEAN is
            -- Is last exception originally due to an external
            -- event (operating system signal)?
        do
            Result := (original_exception = signal_exception)
        end

    is_system_exception: BOOLEAN is
            -- Is last exception originally due to an
            -- external event (operating system error)?
        do
            Result := (original_exception = external_exception) or else (original_exception = operating_system_exception)
        end

    tag_name: STRING is
            -- Tag of last violated assertion clause
        external
            "C | %"eif_except.h%""
        alias
            "eeltag"
        end

    recipient_name: STRING is
            -- Name of the routine whose execution was
            -- interrupted by last exception
        external
            "C | %"eif_except.h%""
        alias
            "eelrout"
        end

    class_name: STRING is
            -- Name of the class that includes the recipient
            -- of original form of last exception
        external
            "C | %"eif_except.h%""
        alias
            "eelclass"
        end

    exception: INTEGER is
            -- Code of last exception that occurred
        external
            "C | %"eif_except.h%""
        alias
            "eelcode"
        end

    exception_trace: STRING is
            -- String representation of the exception trace
        external
            "C | %"eif_except.h%""
        alias
            "stack_trace_string"
        end

    original_tag_name: STRING is
            -- Assertion tag for original form of last
            -- assertion violation.
        external
            "C | %"eif_except.h%""
        alias
            "eeotag"
        end

    original_exception: INTEGER is
            -- Original code of last exception that triggered
            -- current exception
        external
            "C | %"eif_except.h%""
        alias
            "eeocode"
        end

    original_recipient_name: STRING is
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
        external
            "C | %"eif_except.h%""
        alias
            "eeorout"
        end

    original_class_name: STRING is
            -- Name of the class that includes the recipient
            -- of original form of last exception
        external
            "C | %"eif_except.h%""
        alias
            "eeoclass"
        end

feature -- Status setting

    catch (code: INTEGER) is
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
        external
            "C | %"eif_except.h%""
        alias
            "eecatch"
        end

    ignore (code: INTEGER) is
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
        external
            "C | %"eif_except.h%""
        alias
            "eeignore"
        end

    raise (name: STRING) is
            -- Raise a developer exception of name name.
        local
            str: ANY
        do
            if name /= void then
                str := name.to_c
            end
            exclear
            eraise ($str, developer_exception)
        end

    die (code: INTEGER) is
            -- Terminate execution with exit status code,
            -- without triggering an exception.
        external
            "C | %"eif_except.h%""
        alias
            "esdie"
        end

    new_die (code: INTEGER) is
        obsolete "Use ``die''"
        external
            "C | %"eif_except.h%""
        alias
            "esdie"
        end

    message_on_failure is
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
        do
            c_trace_exception (True)
        end

    no_message_on_failure is
            -- Do not print an exception history table
            -- in case of failure.
        do
            c_trace_exception (False)
        end

feature {NONE} -- Implementation

    exclear is
        external
            "C | %"eif_except.h%""
        end

    eraise (str: POINTER; code: INTEGER) is
            -- Raise an exception
        external
            "C | %"eif_except.h%""
        end

    c_trace_exception (b: BOOLEAN) is
        external
            "C | %"eif_except.h%""
        alias
            "eetrace"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEPTIONS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEPTIONS Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    EXCEPTIONS

General
    cluster: base.kernel
    description:
        "Facilities for adapting the exception handling mechanism.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    EXCEP_CONST

Queries
    assertion_violation: BOOLEAN
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    Postcondition: INTEGER
    Precondition: INTEGER
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    tag_name: STRING
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Commands
    catch (code: INTEGER)
    die (code: INTEGER)
    ignore (code: INTEGER)
    message_on_failure
    no_message_on_failure
    raise (name: STRING)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEPTIONS Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for adapting the exception handling mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    EXCEPTIONS

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN is
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
        do
            Result := (original_exception = check_instruction) or else (original_exception = class_invariant) or else (original_exception = loop_invariant) or else (original_exception = loop_variant) or else (original_exception = postcondition) or else (original_exception = precondition)
        end

    class_name: STRING is
            -- Name of the class that includes the recipient
            -- of original form of last exception
        external
            "C | %"eif_except.h%""
        alias
            "eelclass"
        end

    developer_exception_name: STRING is
            -- Name of last developer-raised exception
        require
            applicable: is_developer_exception
        do
            Result := original_tag_name
        end

    exception: INTEGER is
            -- Code of last exception that occurred
        external
            "C | %"eif_except.h%""
        alias
            "eelcode"
        end

    exception_trace: STRING is
            -- String representation of the exception trace
        external
            "C | %"eif_except.h%""
        alias
            "stack_trace_string"
        end

    is_developer_exception: BOOLEAN is
            -- Is the last exception originally due to
            -- a developer exception?
        do
            Result := (original_exception = developer_exception)
        end

    is_developer_exception_of_name (name: STRING): BOOLEAN is
            -- Is the last exception originally due to a developer
            -- exception of name name?
        do
            Result := is_developer_exception and then equal (name, developer_exception_name)
        end

    is_signal: BOOLEAN is
            -- Is last exception originally due to an external
            -- event (operating system signal)?
        do
            Result := (original_exception = signal_exception)
        end

    is_system_exception: BOOLEAN is
            -- Is last exception originally due to an
            -- external event (operating system error)?
        do
            Result := (original_exception = external_exception) or else (original_exception = operating_system_exception)
        end

    meaning (except: INTEGER): STRING is
            -- A message in English describing what except is
        external
            "C | %"eif_except.h%""
        alias
            "eename"
        end

    original_class_name: STRING is
            -- Name of the class that includes the recipient
            -- of original form of last exception
        external
            "C | %"eif_except.h%""
        alias
            "eeoclass"
        end

    original_exception: INTEGER is
            -- Original code of last exception that triggered
            -- current exception
        external
            "C | %"eif_except.h%""
        alias
            "eeocode"
        end

    original_recipient_name: STRING is
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
        external
            "C | %"eif_except.h%""
        alias
            "eeorout"
        end

    original_tag_name: STRING is
            -- Assertion tag for original form of last
            -- assertion violation.
        external
            "C | %"eif_except.h%""
        alias
            "eeotag"
        end

    recipient_name: STRING is
            -- Name of the routine whose execution was
            -- interrupted by last exception
        external
            "C | %"eif_except.h%""
        alias
            "eelrout"
        end

    tag_name: STRING is
            -- Tag of last violated assertion clause
        external
            "C | %"eif_except.h%""
        alias
            "eeltag"
        end

feature -- Status setting

    catch (code: INTEGER) is
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
        external
            "C | %"eif_except.h%""
        alias
            "eecatch"
        end

    die (code: INTEGER) is
            -- Terminate execution with exit status code,
            -- without triggering an exception.
        external
            "C | %"eif_except.h%""
        alias
            "esdie"
        end

    ignore (code: INTEGER) is
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
        external
            "C | %"eif_except.h%""
        alias
            "eeignore"
        end

    message_on_failure is
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
        do
            c_trace_exception (True)
        end

    new_die (code: INTEGER) is
        obsolete "Use ``die''"
        external
            "C | %"eif_except.h%""
        alias
            "esdie"
        end

    no_message_on_failure is
            -- Do not print an exception history table
            -- in case of failure.
        do
            c_trace_exception (False)
        end

    raise (name: STRING) is
            -- Raise a developer exception of name name.
        local
            str: ANY
        do
            if name /= void then
                str := name.to_c
            end
            exclear
            eraise ($str, developer_exception)
        end

feature {NONE} -- Implementation

    c_trace_exception (b: BOOLEAN) is
        external
            "C | %"eif_except.h%""
        alias
            "eetrace"
        end

    eraise (str: POINTER; code: INTEGER) is
            -- Raise an exception
        external
            "C | %"eif_except.h%""
        end

    exclear is
        external
            "C | %"eif_except.h%""
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEPTIONS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEPTIONS Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for adapting the exception handling mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    EXCEPTIONS

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception

    developer_exception_name: STRING
            -- Name of last developer-raised exception
        require
            applicable: is_developer_exception

    exception: INTEGER
            -- Code of last exception that occurred

    exception_trace: STRING
            -- String representation of the exception trace

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception

    tag_name: STRING
            -- Tag of last violated assertion clause

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.

    raise (name: STRING)
            -- Raise a developer exception of name name.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEPTIONS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEPTIONS Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    EXCEPTIONS

Ancestors
    EXCEP_CONST

Descendants
    STORABLE

Clients
    EXCEPTIONS

Suppliers
    BOOLEAN
    EXCEPTIONS
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEPTIONS Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for adapting the exception handling mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    EXCEPTIONS

feature -- Status report

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?

    developer_exception_name: STRING
            -- Name of last developer-raised exception
        require
            applicable: is_developer_exception

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?

    tag_name: STRING
            -- Tag of last violated assertion clause

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception

    exception: INTEGER
            -- Code of last exception that occurred

    exception_trace: STRING
            -- String representation of the exception trace

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.

    raise (name: STRING)
            -- Raise a developer exception of name name.

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEPTIONS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEP_CONST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for exception handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    EXCEP_CONST

feature -- Access

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation

    Precondition: INTEGER is 3
            -- Exception code for violated precondition

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant

    Check_instruction: INTEGER is 7
            -- Exception code for violated check

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity

    Io_exception: INTEGER is 21
            -- Exception code for I/O error

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEP_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEP_CONST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    EXCEP_CONST

General
    cluster: base.kernel
    description:
        "Constants used for exception handling.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    Com_exception: INTEGER
    Developer_exception: INTEGER
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    Postcondition: INTEGER
    Precondition: INTEGER
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEP_CONST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for exception handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    EXCEP_CONST

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part

    Io_exception: INTEGER is 21
            -- Exception code for I/O error

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition

    Precondition: INTEGER is 3
            -- Exception code for violated precondition

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEP_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEP_CONST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for exception handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    EXCEP_CONST

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part

    Io_exception: INTEGER is 21
            -- Exception code for I/O error

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition

    Precondition: INTEGER is 3
            -- Exception code for violated precondition

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEP_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEP_CONST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    EXCEP_CONST

Ancestors
    ANY

Descendants
    EXCEPTIONS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXCEP_CONST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for exception handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    EXCEP_CONST

feature -- Access

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation

    Precondition: INTEGER is 3
            -- Exception code for violated precondition

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant

    Check_instruction: INTEGER is 7
            -- Exception code for violated check

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity

    Io_exception: INTEGER is 21
            -- Exception code for I/O error

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEP_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential files, viewed as persistent sequences of characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class
    FILE

inherit
    UNBOUNDED [CHARACTER]

    SEQUENCE [CHARACTER]
        undefine
            prune
        redefine
            off,
            append
        end

    IO_MEDIUM
        rename
            handle as descriptor,
            handle_available as descriptor_available
        end

feature -- Initialization

    make (fn: STRING) is
            -- Create file object with fn as file name.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            name := fn
            mode := closed_file
            create last_string.make (256)
        ensure
            file_named: name.is_equal (fn)
            file_closed: is_closed
        end

    make_open_read (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in read mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read
        ensure
            exists: exists
            open_read: is_open_read
        end

    make_open_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_write
        ensure
            exists: exists
            open_write: is_open_write
        end

    make_open_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in append-only mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_append
        ensure
            exists: exists
            open_append: is_open_append
        end

    make_open_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_write
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_create_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            create_read_write
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_read_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_append
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

feature -- Access

    name: STRING
            -- File name

    item: CHARACTER is
            -- Current item
        do
            read_character
            Result := last_character
            back
        end

    position: INTEGER is
            -- Current cursor position.
        do
            if not is_closed then
                Result := file_tell (file_pointer)
            end
        end

    descriptor: INTEGER is
            -- File descriptor as used by the operating system.
        require else
            file_opened: not is_closed
        do
            Result := file_fd (file_pointer)
            descriptor_available := True
        end

    descriptor_available: BOOLEAN

    separator: CHARACTER
            -- ASCII code of character following last word read

    file_pointer: POINTER
            -- File pointer as required in C

    file_info: UNIX_FILE_INFO is
            -- Collected information about the file.
        do
            set_buffer
            Result := clone (buffered_file_info)
        end

    inode: INTEGER is
            -- I-node number
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.inode
        end

    links: INTEGER is
            -- Number of links on file
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.links
        end

    user_id: INTEGER is
            -- User identification of owner
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.user_id
        end

    group_id: INTEGER is
            -- Group identification of owner
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.group_id
        end

    protection: INTEGER is
            -- Protection mode, in decimal value
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.protection
        end

    owner_name: STRING is
            -- Name of owner
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.owner_name
        end

    date: INTEGER is
            -- Time stamp (time of last modification)
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.date
        end

    access_date: INTEGER is
            -- Time stamp of last access made to the inode.
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.access_date
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        do
            Result := c_retrieved (descriptor)
        end

feature -- Measurement

    count: INTEGER is
            -- Size in bytes (0 if no associated physical file)
        do
            if exists then
                if not is_open_write then
                    set_buffer
                    Result := buffered_file_info.size
                else
                    Result := file_size (file_pointer)
                end
            end
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor position?
        do
            Result := not is_closed and then (end_of_file or count = 0)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor position?
        do
            Result := is_closed
        end

    off: BOOLEAN is
            -- Is there no item?
        do
            Result := (count = 0) or else is_closed or else end_of_file
        end

    end_of_file: BOOLEAN is
            -- Has an EOF been detected?
        require
            opened: not is_closed
        do
            Result := file_feof (file_pointer)
        end

    exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses effective UID.)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_exists ($external_name)
        ensure then
            unchanged_mode: mode = old mode
        end

    access_exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses real UID.)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_access ($external_name, 0)
        end

    is_readable: BOOLEAN is
            -- Is file readable?
            -- (Checks permission for effective UID.)
        do
            set_buffer
            Result := buffered_file_info.is_readable
        end

    is_writable: BOOLEAN is
            -- Is file writable?
            -- (Checks write permission for effective UID.)
        do
            set_buffer
            Result := buffered_file_info.is_writable
        end

    is_executable: BOOLEAN is
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
        do
            set_buffer
            Result := buffered_file_info.is_executable
        end

    is_creatable: BOOLEAN is
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_creatable ($external_name)
        end

    is_plain: BOOLEAN is
            -- Is file a plain file?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_plain
        end

    is_device: BOOLEAN is
            -- Is file a device?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_device
        end

    is_directory: BOOLEAN is
            -- Is file a directory?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_directory
        end

    is_symlink: BOOLEAN is
            -- Is file a symbolic link?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_symlink
        end

    is_fifo: BOOLEAN is
            -- Is file a named pipe?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_fifo
        end

    is_socket: BOOLEAN is
            -- Is file a named socket?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_socket
        end

    is_block: BOOLEAN is
            -- Is file a block special file?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_block
        end

    is_character: BOOLEAN is
            -- Is file a character special file?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_character
        end

    is_setuid: BOOLEAN is
            -- Is file setuid?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setuid
        end

    is_setgid: BOOLEAN is
            -- Is file setgid?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setgid
        end

    is_sticky: BOOLEAN is
            -- Is file sticky (for memory swaps)?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_sticky
        end

    is_owner: BOOLEAN is
            -- Is file owned by effective UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_owner
        end

    is_access_readable: BOOLEAN is
            -- Is file readable by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_readable
        end

    is_access_writable: BOOLEAN is
            -- Is file writable by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_writable
        end

    is_access_executable: BOOLEAN is
            -- Is file executable by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_executable
        end

    is_access_owner: BOOLEAN is
            -- Is file owned by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_owner
        end

    file_readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := (mode >= read_write_file or mode = read_file) and readable
        end

    is_closed: BOOLEAN is
            -- Is file closed?
        do
            Result := mode = closed_file
        end

    is_open_read: BOOLEAN is
            -- Is file open for reading?
        do
            Result := mode = read_file or else mode = read_write_file or else mode = append_read_file
        end

    is_open_write: BOOLEAN is
            -- Is file open for writing?
        do
            Result := mode = write_file or else mode = read_write_file or else mode = append_read_file or else mode = append_file
        end

    is_open_append: BOOLEAN is
            -- Is file open for appending?
        do
            Result := mode = append_file or else mode = append_read_file
        end

    file_writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := mode >= write_file
        end

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := mode >= write_file
        end

    file_prunable: BOOLEAN is
            -- May items be removed?
        do
            Result := mode >= write_file and prunable
        end

    Full: BOOLEAN is False
            -- Is structure filled to capacity?

feature -- Status setting

    open_read is
            -- Open file in read-only mode.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 0)
            mode := read_file
        ensure
            exists: exists
            open_read: is_open_read
        end

    open_write is
            -- Open file in write-only mode;
            -- create it if it does not exist.
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 1)
            mode := write_file
        ensure
            exists: exists
            open_write: is_open_write
        end

    open_append is
            -- Open file in append-only mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 2)
            mode := append_file
        ensure
            exists: exists
            open_append: is_open_append
        end

    open_read_write is
            -- Open file in read and write mode.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 3)
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    create_read_write is
            -- Open file in read and write mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 4)
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    open_read_append is
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 5)
            mode := append_read_file
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    fd_open_read (fd: INTEGER) is
            -- Open file of descriptor fd in read-only mode.
        do
            file_pointer := file_dopen (fd, 0)
            mode := read_file
        ensure
            exists: exists
            open_read: is_open_read
        end

    fd_open_write (fd: INTEGER) is
            -- Open file of descriptor fd in write mode.
        do
            file_pointer := file_dopen (fd, 1)
            mode := write_file
        ensure
            exists: exists
            open_write: is_open_write
        end

    fd_open_append (fd: INTEGER) is
            -- Open file of descriptor fd in append mode.
        do
            file_pointer := file_dopen (fd, 2)
            mode := append_file
        ensure
            exists: exists
            open_append: is_open_append
        end

    fd_open_read_write (fd: INTEGER) is
            -- Open file of descriptor fd in read-write mode.
        do
            file_pointer := file_dopen (fd, 3)
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_read_append (fd: INTEGER) is
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_dopen (fd, 5)
            mode := append_read_file
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    reopen_read (fname: STRING) is
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := fname.to_c
            file_pointer := file_reopen ($external_name, 0, file_pointer)
            name := fname
            mode := read_file
        ensure
            exists: exists
            open_read: is_open_read
        end

    reopen_write (fname: STRING) is
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 1, file_pointer)
            name := fname
            mode := write_file
        ensure
            exists: exists
            open_write: is_open_write
        end

    reopen_append (fname: STRING) is
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 2, file_pointer)
            name := fname
            mode := append_file
        ensure
            exists: exists
            open_append: is_open_append
        end

    reopen_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 3, file_pointer)
            name := fname
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    recreate_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 4, file_pointer)
            name := fname
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_read_append (fname: STRING) is
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 5, file_pointer)
            name := fname
            mode := append_read_file
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    close is
            -- Close file.
        do
            file_close (file_pointer)
            mode := closed_file
            descriptor_available := False
        ensure then
            is_closed: is_closed
        end

feature -- Cursor movement

    start is
            -- Go to first position.
        require else
            file_opened: not is_closed
        do
            file_go (file_pointer, 0)
        end

    finish is
            -- Go to last position.
        require else
            file_opened: not is_closed
        do
            file_recede (file_pointer, 0)
        end

    forth is
            -- Go to next position.
        require else
            file_opened: not is_closed
        do
            file_move (file_pointer, 1)
        end

    back is
            -- Go back one position.
        do
            file_move (file_pointer, - 1)
        end

    move (offset: INTEGER) is
            -- Advance by offset from current location.
        require
            file_opened: not is_closed
        do
            file_move (file_pointer, offset)
        end

    go (abs_position: INTEGER) is
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_go (file_pointer, abs_position)
        end

    recede (abs_position: INTEGER) is
            -- Go to the absolute position backwards,
            -- starting from end of file.
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_recede (file_pointer, abs_position)
        end

    next_line is
            -- Move to next input line.
        require
            is_readable: file_readable
        do
            file_tnil (file_pointer)
        end

feature -- Element change

    extend (v: CHARACTER) is
            -- Include v at end.
        do
            put_character (v)
        end

    flush is
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
        require
            is_open: not is_closed
        do
            file_flush (file_pointer)
        end

    link (fn: STRING) is
            -- Link current file to fn.
            -- fn must not already exist.
        require
            file_exists: exists
        local
            external_name: ANY
            fn_name: ANY
        do
            external_name := name.to_c
            fn_name := fn.to_c
            file_link ($external_name, $fn_name)
        end

    append (f: like Current) is
            -- Append a copy of the contents of f.
        require else
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        do
            open_append
            f.open_read
            file_append (file_pointer, f.file_pointer, f.count)
            close
            f.close
        ensure then
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed
        end

    put_integer (i: INTEGER) is
            -- Write i at current position.
            -- Was declared in FILE as synonym of putint.
        deferred
        end

    putint (i: INTEGER) is
            -- Write i at current position.
            -- Was declared in FILE as synonym of put_integer.
        deferred
        end

    put_boolean (b: BOOLEAN) is
            -- Write b at current position.
            -- Was declared in FILE as synonym of putbool.
        deferred
        end

    putbool (b: BOOLEAN) is
            -- Write b at current position.
            -- Was declared in FILE as synonym of put_boolean.
        deferred
        end

    put_real (r: REAL) is
            -- Write r at current position.
            -- Was declared in FILE as synonym of putreal.
        deferred
        end

    putreal (r: REAL) is
            -- Write r at current position.
            -- Was declared in FILE as synonym of put_real.
        deferred
        end

    put_double (d: DOUBLE) is
            -- Write d at current position.
            -- Was declared in FILE as synonym of putdouble.
        deferred
        end

    putdouble (d: DOUBLE) is
            -- Write d at current position.
            -- Was declared in FILE as synonym of put_double.
        deferred
        end

    put_string (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    putstring (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    put_character (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
        do
            file_pc (file_pointer, c)
        end

    putchar (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
        do
            file_pc (file_pointer, c)
        end

    put_new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
        do
            file_tnwl (file_pointer)
        end

    new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
        do
            file_tnwl (file_pointer)
        end

    stamp (time: INTEGER) is
            -- Stamp with time (for both access and modification).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 2)
        ensure
            date_updated: date = time
        end

    set_access (time: INTEGER) is
            -- Stamp with time (access only).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 0)
        ensure
            acess_date_updated: access_date = time
            date_unchanged: date = old date
        end

    set_date (time: INTEGER) is
            -- Stamp with time (modification time only).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 1)
        ensure
            access_date_unchanged: access_date = old access_date
            date_updated: date = time
        end

    change_name (new_name: STRING) is
            -- Change file name to new_name
        require
            new_name_not_void: new_name /= void
            file_exists: exists
        local
            ext_old_name, ext_new_name: ANY
        do
            ext_old_name := name.to_c
            ext_new_name := new_name.to_c
            file_rename ($ext_old_name, $ext_new_name)
            name := new_name
        ensure
            name_changed: name.is_equal (new_name)
        end

    add_permission (who, what: STRING) is
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 1)
        end

    remove_permission (who, what: STRING) is
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 0)
        end

    change_mode (mask: INTEGER) is
            -- Replace mode by mask.
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chmod ($external_name, mask)
        end

    change_owner (new_owner_id: INTEGER) is
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chown ($external_name, new_owner_id)
        end

    change_group (new_group_id: INTEGER) is
            -- Change group of file to new_group_id found in
            -- system password file.
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chgrp ($external_name, new_group_id)
        end

    change_date: INTEGER is
            -- Time stamp of last change.
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.change_date
        end

    touch is
            -- Update time stamp (for both access and modification).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_touch ($external_name)
        ensure
            date_changed: date /= old date
        end

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        do
            c_basic_store (descriptor, $object)
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        do
            c_general_store (descriptor, $object)
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        do
            c_independent_store (descriptor, $object)
        end

feature -- Removal

    wipe_out is
            -- Remove all items.
        require else
            is_closed: is_closed
        do
            open_write
            close
        end

    delete is
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
        require
            exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_unlink ($external_name)
        end

    reset (fn: STRING) is
            -- Change file name to fn and reset
            -- file descriptor and all information.
        require
            valid_file_name: fn /= void
        do
            name := fn
            if mode /= closed_file then
                close
            end
            last_integer := 0
            if last_string /= void then
                last_string.wipe_out
            end
            last_real := 0.0
            last_character := '%U'
            last_double := 0.0
        ensure
            file_renamed: name = fn
            file_closed: is_closed
        end

feature -- Input

    read_real is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of readreal.
        require else
            is_readable: file_readable
        deferred
        end

    readreal is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of read_real.
        require else
            is_readable: file_readable
        deferred
        end

    read_double is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of readdouble.
        require else
            is_readable: file_readable
        deferred
        end

    readdouble is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of read_double.
        require else
            is_readable: file_readable
        deferred
        end

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
        require else
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
        require else
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    read_integer is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of readint.
        require else
            is_readable: file_readable
        deferred
        end

    readint is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of read_integer.
        require else
            is_readable: file_readable
        deferred
        end

    read_line is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    readline is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
        require else
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
        require else
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    read_word is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
        require
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

    readword is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
        require
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

feature -- Convenience

    copy_to (file: like Current) is
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
        require
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read
        do
            read_stream (count)
            file.put_string (last_string)
            create last_string.make (256)
        end

feature {NONE} -- Implementation

    true_string: STRING is
            -- Character string "true"
        once
            Result := "True"
        end

    false_string: STRING is
            -- Character string "false"
        once
            Result := "False"
        end

    buffered_file_info: UNIX_FILE_INFO is
            -- Information about the file.
        once
            create Result.make
        end

    set_buffer is
            -- Resynchronizes information on file
        require
            file_exists: exists
        do
            buffered_file_info.update (name)
        end

    file_link (from_name, to_name: POINTER) is
            -- Link to_name to from_name
        external
            "C (char *, char *) | %"eif_file.h%""
        end

    file_unlink (fname: POINTER) is
            -- Delete file fname.
        external
            "C | %"eif_file.h%""
        end

    file_open (f_name: POINTER; how: INTEGER): POINTER is
            -- File pointer for file f_name, in mode how.
        external
            "C | %"eif_file.h%""
        end

    file_dopen (fd, how: INTEGER): POINTER is
            -- File pointer for file of descriptor fd in mode how
            -- (which must fit the way fd was obtained).
        external
            "C | %"eif_file.h%""
        end

    file_reopen (f_name: POINTER; how: INTEGER; file: POINTER): POINTER is
            -- File pointer to file, reopened to have new name f_name
            -- in a mode specified by how.
        external
            "C (char *, EIF_INTEGER, FILE *): EIF_POINTER | %"eif_file.h%""
        end

    file_close (file: POINTER) is
            -- Close file.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_flush (file: POINTER) is
            -- Flush file.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_fd (file: POINTER): INTEGER is
            -- Operating system's file descriptor
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_gc (file: POINTER): CHARACTER is
            -- Access the next character
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_gs (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- a_string updated with characters read from file
            -- until new line, with begin characters already read.
            -- If it does not fit, result is length - begin + 1.
            -- If it fits, result is number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gss (file: POINTER; a_string: POINTER; length: INTEGER): INTEGER is
            -- Read min (length, remaining bytes in file) characters
            -- into a_string. If it does not fit, result is length + 1.
            -- Otherwise, result is the number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gw (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a string excluding white space and stripping
            -- leading white space from file into a_string.
            -- White space characters are: blank, new_line,
            -- tab, vertical tab, formfeed or end of file.
            -- If it does not fit, result is length - begin + 1,
            -- otherwise result is number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_lh (file: POINTER): CHARACTER is
            -- Look ahead in file and find out the value of the next
            -- character. Do not read over character.
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_size (file: POINTER): INTEGER is
            -- Size of file
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tnil (file: POINTER) is
            -- Read upto next input line.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_tell (file: POINTER): INTEGER is
            -- Current cursor position in file.
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_touch (f_name: POINTER) is
            -- Touch file f_name.
        external
            "C | %"eif_file.h%""
        end

    file_rename (old_name, new_name: POINTER) is
            -- Change file name from old_name to new_name.
        external
            "C | %"eif_file.h%""
        end

    file_perm (f_name, who, what: POINTER; flag: INTEGER) is
            -- Change permissions for f_name to who and what.
            -- flag = 1 -> add permissions,
            -- flag = 0 -> remove permissions.
        external
            "C | %"eif_file.h%""
        end

    file_chmod (f_name: POINTER; mask: INTEGER) is
            -- Change mode of f_name to mask.
        external
            "C | %"eif_file.h%""
        end

    file_chown (f_name: POINTER; new_owner: INTEGER) is
            -- Change owner of f_name to new_owner
        external
            "C | %"eif_file.h%""
        end

    file_chgrp (f_name: POINTER; new_group: INTEGER) is
            -- Change group of f_name to new_group
        external
            "C | %"eif_file.h%""
        end

    file_utime (f_name: POINTER; time, how: INTEGER) is
            -- Set access, modification time or both (how = 0,1,2) on
            -- f_name, using time as time stamp.
        external
            "C | %"eif_file.h%""
        end

    file_tnwl (file: POINTER) is
            -- Print a new-line to file.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_append (file, from_file: POINTER; length: INTEGER) is
            -- Append a copy of from_file to file
        external
            "C (FILE *, FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_ps (file: POINTER; a_string: POINTER; length: INTEGER) is
            -- Print a_string to file.
        external
            "C (FILE *, char *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_pc (file: POINTER; c: CHARACTER) is
            -- Put c to end of file.
        external
            "C (FILE *, EIF_CHARACTER) | %"eif_file.h%""
        end

    file_go (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from start.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_recede (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from end.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_move (file: POINTER; offset: INTEGER) is
            -- Move file pointer by offset.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_feof (file: POINTER): BOOLEAN is
            -- End of file?
        external
            "C (FILE *): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_exists (f_name: POINTER): BOOLEAN is
            -- Does f_name exist.
        external
            "C | %"eif_file.h%""
        end

    file_access (f_name: POINTER; which: INTEGER): BOOLEAN is
            -- Perform access test which on f_name using real UID.
        external
            "C | %"eif_file.h%""
        end

    file_creatable (f_name: POINTER): BOOLEAN is
            -- Is f_name creatable.
        external
            "C | %"eif_file.h%""
        end

    c_retrieved (file_handle: INTEGER): ANY is
            -- Object structured retrieved from file of pointer
            -- file_ptr
        external
            "C | %"eif_retrieve.h%""
        alias
            "eretrieve"
        end

    c_basic_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
        external
            "C | %"eif_store.h%""
        alias
            "estore"
        end

    c_general_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
        external
            "C | %"eif_store.h%""
        alias
            "eestore"
        end

    c_independent_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
        external
            "C | %"eif_store.h%""
        alias
            "sstore"
        end

feature {NONE} -- Inapplicable

    go_to (r: CURSOR) is
            -- Move to position marked r.
        do
        end

    replace (v: like item) is
            -- Replace current item by v.
        require else
            is_writable: file_writable
        do
        ensure then
            item = v
            count = old count
        end

    prunable: BOOLEAN is
            -- Is there an item to be removed?
        do
        end

    remove is
            -- Remove current item.
        require else
            file_prunable: file_prunable
        do
        end

    prune (v: like item) is
            -- Remove an occurrence of v if any.
        require else
            prunable: file_prunable
        do
        ensure then
            count <= old count
        end

feature {FILE} -- Implementation

    mode: INTEGER
            -- Input-output mode

    Closed_file: INTEGER is 0

    Read_file: INTEGER is 1

    Write_file: INTEGER is 2

    Append_file: INTEGER is 3

    Read_write_file: INTEGER is 4

    Append_read_file: INTEGER is 5

    set_read_mode is
            -- Define file mode as read.
        do
            mode := read_file
        end

    set_write_mode is
            -- Define file mode as write.
        do
            mode := write_file
        end

invariant

    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    FILE

General
    cluster: base.kernel
    description: "Sequential files, viewed as persistent sequences of characters"

Ancestors
    IO_MEDIUM
    SEQUENCE [G]
    UNBOUNDED [G]

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index: INTEGER
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] FILE)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] FILE)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make (fn: STRING)
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out

Constraints
    valid mode
    name exists
    name not empty

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential files, viewed as persistent sequences of characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class
    FILE

feature -- Initialization

    make (fn: STRING) is
            -- Create file object with fn as file name.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            name := fn
            mode := closed_file
            create last_string.make (256)
        ensure
            file_named: name.is_equal (fn)
            file_closed: is_closed
        end

    make_create_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            create_read_write
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in append-only mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_append
        ensure
            exists: exists
            open_append: is_open_append
        end

    make_open_read (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in read mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read
        ensure
            exists: exists
            open_read: is_open_read
        end

    make_open_read_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_append
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    make_open_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_write
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_write
        ensure
            exists: exists
            open_write: is_open_write
        end

feature -- Access

    access_date: INTEGER is
            -- Time stamp of last access made to the inode.
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.access_date
        end

    date: INTEGER is
            -- Time stamp (time of last modification)
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.date
        end

    descriptor: INTEGER is
            -- File descriptor as used by the operating system.
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else
            file_opened: not is_closed
        do
            Result := file_fd (file_pointer)
            descriptor_available := True
        end

    descriptor_available: BOOLEAN

    file_info: UNIX_FILE_INFO is
            -- Collected information about the file.
        do
            set_buffer
            Result := clone (buffered_file_info)
        end

    file_pointer: POINTER
            -- File pointer as required in C

    group_id: INTEGER is
            -- Group identification of owner
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.group_id
        end

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINEAR)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    inode: INTEGER is
            -- I-node number
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.inode
        end

    item: CHARACTER is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            read_character
            Result := last_character
            back
        end

    links: INTEGER is
            -- Number of links on file
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.links
        end

    name: STRING
            -- File name

    occurrences (v: CHARACTER): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    owner_name: STRING is
            -- Name of owner
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.owner_name
        end

    position: INTEGER is
            -- Current cursor position.
        do
            if not is_closed then
                Result := file_tell (file_pointer)
            end
        end

    protection: INTEGER is
            -- Protection mode, in decimal value
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.protection
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        do
            Result := c_retrieved (descriptor)
        ensure -- from IO_MEDIUM
            result_exists: Result /= void
        end

    separator: CHARACTER
            -- ASCII code of character following last word read

    user_id: INTEGER is
            -- User identification of owner
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.user_id
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    count: INTEGER is
            -- Size in bytes (0 if no associated physical file)
        do
            if exists then
                if not is_open_write then
                    set_buffer
                    Result := buffered_file_info.size
                else
                    Result := file_size (file_pointer)
                end
            end
        end

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    access_exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses real UID.)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_access ($external_name, 0)
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor position?
        do
            Result := not is_closed and then (end_of_file or count = 0)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor position?
        do
            Result := is_closed
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    end_of_file: BOOLEAN is
            -- Has an EOF been detected?
        require
            opened: not is_closed
        do
            Result := file_feof (file_pointer)
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses effective UID.)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_exists ($external_name)
        ensure then
            unchanged_mode: mode = old mode
        end

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := mode >= write_file
        end

    file_prunable: BOOLEAN is
            -- May items be removed?
        do
            Result := mode >= write_file and prunable
        end

    file_readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := (mode >= read_write_file or mode = read_file) and readable
        end

    file_writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := mode >= write_file
        end

    Full: BOOLEAN is False
            -- Is structure filled to capacity?

    is_access_executable: BOOLEAN is
            -- Is file executable by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_executable
        end

    is_access_owner: BOOLEAN is
            -- Is file owned by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_owner
        end

    is_access_readable: BOOLEAN is
            -- Is file readable by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_readable
        end

    is_access_writable: BOOLEAN is
            -- Is file writable by real UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_writable
        end

    is_block: BOOLEAN is
            -- Is file a block special file?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_block
        end

    is_character: BOOLEAN is
            -- Is file a character special file?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_character
        end

    is_closed: BOOLEAN is
            -- Is file closed?
        do
            Result := mode = closed_file
        end

    is_creatable: BOOLEAN is
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_creatable ($external_name)
        end

    is_device: BOOLEAN is
            -- Is file a device?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_device
        end

    is_directory: BOOLEAN is
            -- Is file a directory?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_directory
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_executable: BOOLEAN is
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_executable
        end

    is_fifo: BOOLEAN is
            -- Is file a named pipe?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_fifo
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_open_append: BOOLEAN is
            -- Is file open for appending?
        do
            Result := mode = append_file or else mode = append_read_file
        end

    is_open_read: BOOLEAN is
            -- Is file open for reading?
        do
            Result := mode = read_file or else mode = read_write_file or else mode = append_read_file
        end

    is_open_write: BOOLEAN is
            -- Is file open for writing?
        do
            Result := mode = write_file or else mode = read_write_file or else mode = append_read_file or else mode = append_file
        end

    is_owner: BOOLEAN is
            -- Is file owned by effective UID?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_owner
        end

    is_plain: BOOLEAN is
            -- Is file a plain file?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_plain
        end

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)
        do
        end

    is_readable: BOOLEAN is
            -- Is file readable?
            -- (Checks permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_readable
        end

    is_setgid: BOOLEAN is
            -- Is file setgid?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setgid
        end

    is_setuid: BOOLEAN is
            -- Is file setuid?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setuid
        end

    is_socket: BOOLEAN is
            -- Is file a named socket?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_socket
        end

    is_sticky: BOOLEAN is
            -- Is file sticky (for memory swaps)?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_sticky
        end

    is_symlink: BOOLEAN is
            -- Is file a symbolic link?
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_symlink
        end

    is_writable: BOOLEAN is
            -- Is file writable?
            -- (Checks write permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_writable
        end

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no item?
        do
            Result := (count = 0) or else is_closed or else end_of_file
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            Result := not off
        end

    support_storable: BOOLEAN is
            -- Can medium be used to store an Eiffel object?
            -- (from IO_MEDIUM)
        deferred
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature -- Status setting

    close is
            -- Close file.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        do
            file_close (file_pointer)
            mode := closed_file
            descriptor_available := False
        ensure then
            is_closed: is_closed
        end

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

    create_read_write is
            -- Open file in read and write mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 4)
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_append (fd: INTEGER) is
            -- Open file of descriptor fd in append mode.
        do
            file_pointer := file_dopen (fd, 2)
            mode := append_file
        ensure
            exists: exists
            open_append: is_open_append
        end

    fd_open_read (fd: INTEGER) is
            -- Open file of descriptor fd in read-only mode.
        do
            file_pointer := file_dopen (fd, 0)
            mode := read_file
        ensure
            exists: exists
            open_read: is_open_read
        end

    fd_open_read_append (fd: INTEGER) is
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_dopen (fd, 5)
            mode := append_read_file
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    fd_open_read_write (fd: INTEGER) is
            -- Open file of descriptor fd in read-write mode.
        do
            file_pointer := file_dopen (fd, 3)
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_write (fd: INTEGER) is
            -- Open file of descriptor fd in write mode.
        do
            file_pointer := file_dopen (fd, 1)
            mode := write_file
        ensure
            exists: exists
            open_write: is_open_write
        end

    open_append is
            -- Open file in append-only mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 2)
            mode := append_file
        ensure
            exists: exists
            open_append: is_open_append
        end

    open_read is
            -- Open file in read-only mode.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 0)
            mode := read_file
        ensure
            exists: exists
            open_read: is_open_read
        end

    open_read_append is
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 5)
            mode := append_read_file
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    open_read_write is
            -- Open file in read and write mode.
        require
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 3)
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    open_write is
            -- Open file in write-only mode;
            -- create it if it does not exist.
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 1)
            mode := write_file
        ensure
            exists: exists
            open_write: is_open_write
        end

    recreate_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 4, file_pointer)
            name := fname
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_append (fname: STRING) is
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 2, file_pointer)
            name := fname
            mode := append_file
        ensure
            exists: exists
            open_append: is_open_append
        end

    reopen_read (fname: STRING) is
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := fname.to_c
            file_pointer := file_reopen ($external_name, 0, file_pointer)
            name := fname
            mode := read_file
        ensure
            exists: exists
            open_read: is_open_read
        end

    reopen_read_append (fname: STRING) is
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 5, file_pointer)
            name := fname
            mode := append_read_file
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    reopen_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 3, file_pointer)
            name := fname
            mode := read_write_file
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_write (fname: STRING) is
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 1, file_pointer)
            name := fname
            mode := write_file
        ensure
            exists: exists
            open_write: is_open_write
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Cursor movement

    back is
            -- Go back one position.
        require -- from BILINEAR
            not_before: not before
        do
            file_move (file_pointer, - 1)
        end

    finish is
            -- Go to last position.
        require -- from  LINEAR
            True
        require else
            file_opened: not is_closed
        do
            file_recede (file_pointer, 0)
        end

    forth is
            -- Go to next position.
        require -- from LINEAR
            not_after: not after
        require else
            file_opened: not is_closed
        do
            file_move (file_pointer, 1)
        end

    go (abs_position: INTEGER) is
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_go (file_pointer, abs_position)
        end

    move (offset: INTEGER) is
            -- Advance by offset from current location.
        require
            file_opened: not is_closed
        do
            file_move (file_pointer, offset)
        end

    next_line is
            -- Move to next input line.
        require
            is_readable: file_readable
        do
            file_tnil (file_pointer)
        end

    recede (abs_position: INTEGER) is
            -- Go to the absolute position backwards,
            -- starting from end of file.
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_recede (file_pointer, abs_position)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Go to first position.
        require -- from  TRAVERSABLE
            True
        require else
            file_opened: not is_closed
        do
            file_go (file_pointer, 0)
        end

feature -- Element change

    add_permission (who, what: STRING) is
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 1)
        end

    append (f: like Current) is
            -- Append a copy of the contents of f.
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        do
            open_append
            f.open_read
            file_append (file_pointer, f.file_pointer, f.count)
            close
            f.close
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed
        end

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_basic_store (descriptor, $object)
        end

    change_date: INTEGER is
            -- Time stamp of last change.
        require
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.change_date
        end

    change_group (new_group_id: INTEGER) is
            -- Change group of file to new_group_id found in
            -- system password file.
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chgrp ($external_name, new_group_id)
        end

    change_mode (mask: INTEGER) is
            -- Replace mode by mask.
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chmod ($external_name, mask)
        end

    change_name (new_name: STRING) is
            -- Change file name to new_name
        require
            new_name_not_void: new_name /= void
            file_exists: exists
        local
            ext_old_name, ext_new_name: ANY
        do
            ext_old_name := name.to_c
            ext_new_name := new_name.to_c
            file_rename ($ext_old_name, $ext_new_name)
            name := new_name
        ensure
            name_changed: name.is_equal (new_name)
        end

    change_owner (new_owner_id: INTEGER) is
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chown ($external_name, new_owner_id)
        end

    extend (v: CHARACTER) is
            -- Include v at end.
        require -- from COLLECTION
            extendible: extendible
        do
            put_character (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    flush is
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
        require
            is_open: not is_closed
        do
            file_flush (file_pointer)
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_general_store (descriptor, $object)
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_independent_store (descriptor, $object)
        end

    link (fn: STRING) is
            -- Link current file to fn.
            -- fn must not already exist.
        require
            file_exists: exists
        local
            external_name: ANY
            fn_name: ANY
        do
            external_name := name.to_c
            fn_name := fn.to_c
            file_link ($external_name, $fn_name)
        end

    new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_tnwl (file_pointer)
        end

    put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_boolean (b: BOOLEAN) is
            -- Write b at current position.
            -- Was declared in FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    put_character (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pc (file_pointer, c)
        end

    put_double (d: DOUBLE) is
            -- Write d at current position.
            -- Was declared in FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    put_integer (i: INTEGER) is
            -- Write i at current position.
            -- Was declared in FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    put_new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_tnwl (file_pointer)
        end

    put_real (r: REAL) is
            -- Write r at current position.
            -- Was declared in FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    put_string (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    putbool (b: BOOLEAN) is
            -- Write b at current position.
            -- Was declared in FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    putchar (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pc (file_pointer, c)
        end

    putdouble (d: DOUBLE) is
            -- Write d at current position.
            -- Was declared in FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    putint (i: INTEGER) is
            -- Write i at current position.
            -- Was declared in FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    putreal (r: REAL) is
            -- Write r at current position.
            -- Was declared in FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible
        deferred
        end

    putstring (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    remove_permission (who, what: STRING) is
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 0)
        end

    set_access (time: INTEGER) is
            -- Stamp with time (access only).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 0)
        ensure
            acess_date_updated: access_date = time
            date_unchanged: date = old date
        end

    set_date (time: INTEGER) is
            -- Stamp with time (modification time only).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 1)
        ensure
            access_date_unchanged: access_date = old access_date
            date_updated: date = time
        end

    stamp (time: INTEGER) is
            -- Stamp with time (for both access and modification).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 2)
        ensure
            date_updated: date = time
        end

    touch is
            -- Update time stamp (for both access and modification).
        require
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_touch ($external_name)
        ensure
            date_changed: date /= old date
        end

feature -- Removal

    delete is
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
        require
            exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_unlink ($external_name)
        end

    dispose is
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)
        do
            if not is_closed then
                close
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    reset (fn: STRING) is
            -- Change file name to fn and reset
            -- file descriptor and all information.
        require
            valid_file_name: fn /= void
        do
            name := fn
            if mode /= closed_file then
                close
            end
            last_integer := 0
            if last_string /= void then
                last_string.wipe_out
            end
            last_real := 0.0
            last_character := '%U'
            last_double := 0.0
        ensure
            file_renamed: name = fn
            file_closed: is_closed
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        require else
            is_closed: is_closed
        do
            open_write
            close
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Conversion

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Obsolete

    lastchar: CHARACTER is
            -- Last character read by read_character
            -- (from IO_MEDIUM)
        do
            Result := last_character
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
            -- (from IO_MEDIUM)
        do
            Result := last_double
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)
        do
            Result := last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
            -- (from IO_MEDIUM)
        do
            Result := last_real
        end

    laststring: STRING is
            -- Last string read
            -- (from IO_MEDIUM)
        do
            Result := last_string
        end

feature {NONE} -- Inapplicable

    go_to (r: CURSOR) is
            -- Move to position marked r.
        do
        end

    prunable: BOOLEAN is
            -- Is there an item to be removed?
        do
        end

    prune (v: like item) is
            -- Remove an occurrence of v if any.
        require -- from COLLECTION
            prunable: prunable
        require else
            prunable: file_prunable
        do
        ensure then
            count <= old count
        end

    remove is
            -- Remove current item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else
            file_prunable: file_prunable
        do
        end

    replace (v: like item) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        require else
            is_writable: file_writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        ensure then
            item = v
            count = old count
        end

feature {NONE} -- Implementation

    buffered_file_info: UNIX_FILE_INFO is
            -- Information about the file.
        once
            create Result.make
        end

    c_basic_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
        external
            "C | %"eif_store.h%""
        alias
            "estore"
        end

    c_general_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
        external
            "C | %"eif_store.h%""
        alias
            "eestore"
        end

    c_independent_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
        external
            "C | %"eif_store.h%""
        alias
            "sstore"
        end

    c_retrieved (file_handle: INTEGER): ANY is
            -- Object structured retrieved from file of pointer
            -- file_ptr
        external
            "C | %"eif_retrieve.h%""
        alias
            "eretrieve"
        end

    false_string: STRING is
            -- Character string "false"
        once
            Result := "False"
        end

    file_access (f_name: POINTER; which: INTEGER): BOOLEAN is
            -- Perform access test which on f_name using real UID.
        external
            "C | %"eif_file.h%""
        end

    file_append (file, from_file: POINTER; length: INTEGER) is
            -- Append a copy of from_file to file
        external
            "C (FILE *, FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_chgrp (f_name: POINTER; new_group: INTEGER) is
            -- Change group of f_name to new_group
        external
            "C | %"eif_file.h%""
        end

    file_chmod (f_name: POINTER; mask: INTEGER) is
            -- Change mode of f_name to mask.
        external
            "C | %"eif_file.h%""
        end

    file_chown (f_name: POINTER; new_owner: INTEGER) is
            -- Change owner of f_name to new_owner
        external
            "C | %"eif_file.h%""
        end

    file_close (file: POINTER) is
            -- Close file.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_creatable (f_name: POINTER): BOOLEAN is
            -- Is f_name creatable.
        external
            "C | %"eif_file.h%""
        end

    file_dopen (fd, how: INTEGER): POINTER is
            -- File pointer for file of descriptor fd in mode how
            -- (which must fit the way fd was obtained).
        external
            "C | %"eif_file.h%""
        end

    file_exists (f_name: POINTER): BOOLEAN is
            -- Does f_name exist.
        external
            "C | %"eif_file.h%""
        end

    file_fd (file: POINTER): INTEGER is
            -- Operating system's file descriptor
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_feof (file: POINTER): BOOLEAN is
            -- End of file?
        external
            "C (FILE *): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_flush (file: POINTER) is
            -- Flush file.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_gc (file: POINTER): CHARACTER is
            -- Access the next character
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_go (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from start.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_gs (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- a_string updated with characters read from file
            -- until new line, with begin characters already read.
            -- If it does not fit, result is length - begin + 1.
            -- If it fits, result is number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gss (file: POINTER; a_string: POINTER; length: INTEGER): INTEGER is
            -- Read min (length, remaining bytes in file) characters
            -- into a_string. If it does not fit, result is length + 1.
            -- Otherwise, result is the number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gw (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a string excluding white space and stripping
            -- leading white space from file into a_string.
            -- White space characters are: blank, new_line,
            -- tab, vertical tab, formfeed or end of file.
            -- If it does not fit, result is length - begin + 1,
            -- otherwise result is number of characters read.
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_lh (file: POINTER): CHARACTER is
            -- Look ahead in file and find out the value of the next
            -- character. Do not read over character.
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_link (from_name, to_name: POINTER) is
            -- Link to_name to from_name
        external
            "C (char *, char *) | %"eif_file.h%""
        end

    file_move (file: POINTER; offset: INTEGER) is
            -- Move file pointer by offset.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_open (f_name: POINTER; how: INTEGER): POINTER is
            -- File pointer for file f_name, in mode how.
        external
            "C | %"eif_file.h%""
        end

    file_pc (file: POINTER; c: CHARACTER) is
            -- Put c to end of file.
        external
            "C (FILE *, EIF_CHARACTER) | %"eif_file.h%""
        end

    file_perm (f_name, who, what: POINTER; flag: INTEGER) is
            -- Change permissions for f_name to who and what.
            -- flag = 1 -> add permissions,
            -- flag = 0 -> remove permissions.
        external
            "C | %"eif_file.h%""
        end

    file_ps (file: POINTER; a_string: POINTER; length: INTEGER) is
            -- Print a_string to file.
        external
            "C (FILE *, char *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_recede (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from end.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_rename (old_name, new_name: POINTER) is
            -- Change file name from old_name to new_name.
        external
            "C | %"eif_file.h%""
        end

    file_reopen (f_name: POINTER; how: INTEGER; file: POINTER): POINTER is
            -- File pointer to file, reopened to have new name f_name
            -- in a mode specified by how.
        external
            "C (char *, EIF_INTEGER, FILE *): EIF_POINTER | %"eif_file.h%""
        end

    file_size (file: POINTER): INTEGER is
            -- Size of file
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tell (file: POINTER): INTEGER is
            -- Current cursor position in file.
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tnil (file: POINTER) is
            -- Read upto next input line.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_tnwl (file: POINTER) is
            -- Print a new-line to file.
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_touch (f_name: POINTER) is
            -- Touch file f_name.
        external
            "C | %"eif_file.h%""
        end

    file_unlink (fname: POINTER) is
            -- Delete file fname.
        external
            "C | %"eif_file.h%""
        end

    file_utime (f_name: POINTER; time, how: INTEGER) is
            -- Set access, modification time or both (how = 0,1,2) on
            -- f_name, using time as time stamp.
        external
            "C | %"eif_file.h%""
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    set_buffer is
            -- Resynchronizes information on file
        require
            file_exists: exists
        do
            buffered_file_info.update (name)
        end

    true_string: STRING is
            -- Character string "true"
        once
            Result := "True"
        end

feature {FILE} -- Implementation

    Append_file: INTEGER is 3

    Append_read_file: INTEGER is 5

    Closed_file: INTEGER is 0

    mode: INTEGER
            -- Input-output mode

    Read_file: INTEGER is 1

    Read_write_file: INTEGER is 4

    set_read_mode is
            -- Define file mode as read.
        do
            mode := read_file
        end

    set_write_mode is
            -- Define file mode as write.
        do
            mode := write_file
        end

    Write_file: INTEGER is 2

feature -- Convenience

    copy_to (file: like Current) is
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
        require
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read
        do
            read_stream (count)
            file.put_string (last_string)
            create last_string.make (256)
        end

feature -- Input

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    read_double is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        deferred
        end

    read_integer is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        deferred
        end

    read_line is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    read_real is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        deferred
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    read_word is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
        require
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    readdouble is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        deferred
        end

    readint is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        deferred
        end

    readline is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    readreal is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        deferred
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    readword is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
        require
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential files, viewed as persistent sequences of characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    FILE

feature -- Initialization

    make (fn: STRING)
            -- Create file object with fn as file name.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
        require
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
        require
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else
            file_opened: not is_closed

    descriptor_available: BOOLEAN

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.

    file_pointer: POINTER
            -- File pointer as required in C

    group_id: INTEGER
            -- Group identification of owner
        require
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
        require
            file_exists: exists

    item: CHARACTER
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
        require
            file_exists: exists

    name: STRING
            -- File name

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
        require
            file_exists: exists

    position: INTEGER
            -- Current cursor position.

    protection: INTEGER
            -- Protection mode, in decimal value
        require
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read

    user_id: INTEGER
            -- User identification of owner
        require
            file_exists: exists

feature -- Measurement

    count: INTEGER
            -- Size in bytes (0 if no associated physical file)

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
        require
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
        ensure then
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?

    file_prunable: BOOLEAN
            -- May items be removed?

    file_readable: BOOLEAN
            -- Is there a current item that may be read?

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?

    Full: BOOLEAN is False
            -- Is structure filled to capacity?

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
        require
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
        require
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
        require
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
        require
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
        require
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
        require
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)

    is_device: BOOLEAN
            -- Is file a device?
        require
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
        require
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
        require
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?

    is_open_read: BOOLEAN
            -- Is file open for reading?

    is_open_write: BOOLEAN
            -- Is file open for writing?

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
        require
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
        require
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
        require
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
        require
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
        require
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
        require
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
        require
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel object?
            -- (from IO_MEDIUM)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
        ensure
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
        ensure
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
        ensure
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
        ensure
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
        require -- from  LINEAR
            True
        require else
            file_opened: not is_closed

    forth
            -- Go to next position.
        require -- from LINEAR
            not_after: not after
        require else
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
        require
            file_opened: not is_closed

    next_line
            -- Move to next input line.
        require
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
        require -- from  TRAVERSABLE
            True
        require else
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
        require
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
        require
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
        require
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
        require
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
        require
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
        require
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
        require
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_boolean (b: BOOLEAN)
            -- Write b at current position.
            -- Was declared in FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d at current position.
            -- Was declared in FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i at current position.
            -- Was declared in FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write r at current position.
            -- Was declared in FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b at current position.
            -- Was declared in FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d at current position.
            -- Was declared in FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write i at current position.
            -- Was declared in FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write r at current position.
            -- Was declared in FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
        require
            file_exists: exists
        ensure
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
        require
            file_exists: exists
        ensure
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
        require
            file_exists: exists
        ensure
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
        require
            file_exists: exists
        ensure
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
        require
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
        require
            valid_file_name: fn /= void
        ensure
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        require else
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
        require
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
        require
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
        require
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    FILE

Ancestors
    IO_MEDIUM
    SEQUENCE [G]
    UNBOUNDED [G]

Descendants
    PLAIN_TEXT_FILE
    RAW_FILE

Clients
    FILE

Suppliers
    BOOLEAN
    FILE
    INTEGER
    STRING
    UNIX_FILE_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE_NAME Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "File name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    FILE_NAME

inherit
    PATH_NAME

create
    make,
    make_from_string

feature -- Status report

    is_valid: BOOLEAN is
            -- Is the file name valid for the operating system?
        local
            any: ANY
        do
            any := to_c
            Result := eif_is_file_valid ($any)
        end

    is_file_name_valid (f_name: STRING): BOOLEAN is
            -- Is f_name a valid file name part for the operating system?
        local
            any: ANY
        do
            any := f_name.to_c
            Result := eif_is_file_name_valid ($any)
        end

    is_extension_valid (ext: STRING): BOOLEAN is
            -- Is ext a valid extension for the operating system?
        local
            any: ANY
        do
            any := ext.to_c
            Result := eif_is_extension_valid ($any)
        end

feature -- Status setting

    set_file_name (file_name: STRING) is
            -- Set the value of the file name part.
        require
            string_exists: file_name /= void
            valid_file_name: is_file_name_valid (file_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + file_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := file_name.to_c
            eif_append_file_name ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    add_extension (ext: STRING) is
            -- Append the extension ext to the file name
        require
            string_exists: ext /= void
            non_empty_extension: not ext.is_empty
            valid_extension: is_extension_valid (ext)
        do
            append_character ('.')
            append (ext)
        end

feature {NONE} -- Externals

    eif_append_file_name (s, p, v: POINTER) is
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_is_file_name_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_extension_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_file_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE_NAME Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FILE_NAME

General
    cluster: base.kernel
    description: "File name abstraction"
    create: make_from_string, make

Ancestors
    PATH_NAME

Queries
    is_directory_name_valid (dir_name: STRING): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] FILE_NAME): BOOLEAN
    is_extension_valid (ext: STRING): BOOLEAN
    is_file_name_valid (f_name: STRING): BOOLEAN
    is_valid: BOOLEAN
    is_volume_name_valid (vol_name: STRING): BOOLEAN
    to_c: ANY

Commands
    add_extension (ext: STRING)
    extend (directory_name: STRING)
    extend_from_array (directories: ARRAY [STRING])
    make
    make_from_string (p: STRING)
    set_directory (directory_name: STRING)
    set_file_name (file_name: STRING)
    set_subdirectory (directory_name: STRING)
    set_volume (volume_name: STRING)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE_NAME Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "File name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    FILE_NAME

create
    make,
    make_from_string

feature -- Initialization

    make is
            -- Create path name object.
            -- (from PATH_NAME)
        do
            string_make (0)
        end

    make_from_string (p: STRING) is
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        do
            count := 0
            string_make (0)
            append (p)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

feature {NONE} -- Initialization

    adapt (s: STRING): like Current is
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)
        do
            create Result.string_make (0)
            Result.share (s)
        end

    from_c (c_string: POINTER) is
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string, length)
            count := length
        ensure -- from STRING
            no_zero_byte: not has ('%U')
        end

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER) is
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        local
            length: INTEGER
        do
            length := end_pos - start_pos + 1
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string + (start_pos - 1), (end_pos - start_pos + 1))
            count := length
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1
        end

    string_make (n: INTEGER) is
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            if n = 0 then
                area := empty_area
            else
                make_area (n + 1)
            end
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_from_c (c_string: POINTER) is
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            make_area (length + 1);
            ($area).memory_copy (c_string, length)
            count := length
        end

    string_make_from_string (s: STRING) is
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        do
            area := s.area
            count := s.count
        ensure -- from STRING
            shared_implementation: shared_with (s)
        end

    remake (n: INTEGER) is
        obsolete "Use `make' instead"
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            string_make (n)
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

feature {NONE} -- Access

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, fuzz)
        end

    has (c: CHARACTER): BOOLEAN is
            -- Does string include c?
            -- (from STRING)
        local
            counter: INTEGER
        do
            if not is_empty then
                from
                    counter := 1
                until
                    counter > count or else (item (counter) = c)
                loop
                    counter := counter + 1
                end
                Result := (counter <= count)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from STRING)
        do
            Result := hashcode ($area, count)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    index_of (c: CHARACTER; start: INTEGER): INTEGER is
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        local
            a: like area
            i, nb: INTEGER
        do
            nb := count
            if start <= nb then
                from
                    i := start - 1
                    nb := nb - 1
                    a := area
                until
                    i > nb or else a.item (i) = c
                loop
                    i := i + 1
                end
                if i <= nb then
                    Result := i + 1
                end
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    item (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

    item_code (i: INTEGER): INTEGER is
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            Result := area.item (i - 1).code
        end

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER is
            -- Position of last occurence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        local
            a: like area
            i: INTEGER
        do
            from
                i := start_index_from_end - 1
                a := area
            until
                i < 0 or else a.item (i) = c
            loop
                i := i - 1
            end
            if i >= 0 then
                Result := i + 1
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    shared_with (other: like Current): BOOLEAN is
            -- Does string share the text of other?
            -- (from STRING)
        do
            Result := (other /= void) and then (area = other.area)
        end

    substring_index (other: STRING; start: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, 0)
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)
        end

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

feature {PATH_NAME} -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Allocated space
            -- (from STRING)
        do
            Result := area.count - 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from STRING)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count
        end

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER is
            -- Number of times c appears in the string
            -- (from STRING)
        local
            counter, nb: INTEGER
            a: SPECIAL [CHARACTER]
        do
            from
                counter := 0
                nb := count - 1
                a := area
            until
                counter > nb
            loop
                if a.item (counter) = c then
                    Result := Result + 1
                end
                counter := counter + 1
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {PATH_NAME} -- Measurement

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is the path name equal to other?
            -- (from PATH_NAME)
        require -- from ANY
            other_not_void: other /= void
        local
            o_area: like area
        do
            if other = Current then
                Result := True
            elseif other.count = count then
                o_area := other.area;
                Result := eif_path_name_compare ($area, $o_area, count)
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

feature {NONE} -- Comparison

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: like Current): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current < other then
                Result := - 1
            elseif other < Current then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        local
            other_area: like area
            other_count: INTEGER
            current_count: INTEGER
        do
            other_area := other.area
            other_count := other.count
            current_count := count
            if other_count = current_count then
                Result := str_strict_cmp ($other_area, $area, other_count) > 0
            else
                if current_count < other_count then
                    Result := str_strict_cmp ($other_area, $area, current_count) >= 0
                else
                    Result := str_strict_cmp ($other_area, $area, other_count) > 0
                end
            end
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN is
            -- Is dir_name a valid subdirectory part for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: dir_name /= void
        local
            any: ANY
        do
            any := dir_name.to_c
            Result := eif_is_directory_name_valid ($any)
        end

    is_extension_valid (ext: STRING): BOOLEAN is
            -- Is ext a valid extension for the operating system?
        local
            any: ANY
        do
            any := ext.to_c
            Result := eif_is_extension_valid ($any)
        end

    is_file_name_valid (f_name: STRING): BOOLEAN is
            -- Is f_name a valid file name part for the operating system?
        local
            any: ANY
        do
            any := f_name.to_c
            Result := eif_is_file_name_valid ($any)
        end

    is_valid: BOOLEAN is
            -- Is the file name valid for the operating system?
        local
            any: ANY
        do
            any := to_c
            Result := eif_is_file_valid ($any)
        end

    is_volume_name_valid (vol_name: STRING): BOOLEAN is
            -- Is vol_name a valid volume name for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: vol_name /= void
        local
            any: ANY
        do
            any := vol_name.to_c
            Result := eif_is_volume_name_valid ($any)
        end

feature {NONE} -- Status report

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_boolean: BOOLEAN is
            -- Does Current represent a BOOLEAN?
            -- (from STRING)
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant) or else s.is_equal (false_constant)
        end

    is_double: BOOLEAN is
            -- Does Current represent a DOUBLE?
            -- (from STRING)
        do
            Result := str_isd ($area, count)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_integer: BOOLEAN is
            -- Does Current represent an INTEGER?
            -- (from STRING)
        do
            Result := str_isi ($area, count)
        end

    is_real: BOOLEAN is
            -- Does Current represent a REAL?
            -- (from STRING)
        do
            Result := str_isr ($area, count)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from STRING)
        do
            Result := True
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the string?
            -- (from STRING)
        do
            Result := (i > 0) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature  -- Status report

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

feature -- Status setting

    add_extension (ext: STRING) is
            -- Append the extension ext to the file name
        require
            string_exists: ext /= void
            non_empty_extension: not ext.is_empty
            valid_extension: is_extension_valid (ext)
        do
            append_character ('.')
            append (ext)
        end

    extend (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    extend_from_array (directories: ARRAY [STRING]) is
            -- Append the subdirectories from directories to the path name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            array_exists: directories /= void and then not (directories.is_empty)
        local
            i, nb: INTEGER
        do
            from
                i := directories.lower
                nb := directories.upper
            until
                i > nb
            loop
                extend (directories.item (i))
                i := i + 1
            end
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    set_directory (directory_name: STRING) is
            -- Set the absolute directory part of the path name to directory_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_set_directory ($Current, $str1, $str2)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    set_file_name (file_name: STRING) is
            -- Set the value of the file name part.
        require
            string_exists: file_name /= void
            valid_file_name: is_file_name_valid (file_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + file_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := file_name.to_c
            eif_append_file_name ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    set_subdirectory (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

    set_volume (volume_name: STRING) is
            -- Set the volume part of the path name to volume_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        do
            append (volume_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid
        end

feature {NONE} -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Element change

    append (s: STRING) is
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area;
            ($area + count).memory_copy ($s_area, s.count)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + old s.count
        end

    append_boolean (b: BOOLEAN) is
            -- Append the string representation of b at end.
            -- (from STRING)
        do
            append (b.out)
        end

    append_character (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    append_double (d: DOUBLE) is
            -- Append the string representation of d at end.
            -- (from STRING)
        do
            append (d.out)
        end

    append_integer (i: INTEGER) is
            -- Append the string representation of i at end.
            -- (from STRING)
        do
            append (i.out)
        end

    append_real (r: REAL) is
            -- Append the string representation of r at end.
            -- (from STRING)
        do
            append (r.out)
        end

    append_string (s: STRING) is
            -- Append a copy of s, if not void, at end.
            -- (from STRING)
        do
            if s /= void then
                append (s)
            end
        end

    copy (other: like Current) is
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            old_area: like area
        do
            if other /= Current then
                old_area := area
                standard_copy (other)
                if old_area = void or else old_area.count < area.count then
                    area := standard_clone (area)
                else
                    ($old_area).memory_copy ($area, count)
                    area := old_area
                end
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count
        end

    string_extend (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                string_extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_blank is
            -- Fill with capacity blank characters.
            -- (from STRING)
        do
            fill_character (' ')
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    fill_character (c: CHARACTER) is
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, capacity)
            count := capacity
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    head (n: INTEGER) is
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        do
            if n < count then
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    insert (s: STRING; i: INTEGER) is
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, i)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    left_adjust is
            -- Remove leading whitespace.
            -- (from STRING)
        do
            count := str_left ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))
        end

    precede (c: CHARACTER) is
            -- Add c at front.
            -- (from STRING)
        do
            if count = capacity then
                resize (count + additional_space)
            end
            str_cprepend ($area, c, count)
            count := count + 1
        ensure -- from STRING
            new_count: count = old count + 1
        end

    prepend (s: STRING) is
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := count + s.count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, 1)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    prepend_boolean (b: BOOLEAN) is
            -- Prepend the string representation of b at front.
            -- (from STRING)
        do
            prepend (b.out)
        end

    prepend_character (c: CHARACTER) is
            -- Prepend the string representation of c at front.
            -- (from STRING)
        do
            prepend (c.out)
        end

    prepend_double (d: DOUBLE) is
            -- Prepend the string representation of d at front.
            -- (from STRING)
        do
            prepend (d.out)
        end

    prepend_integer (i: INTEGER) is
            -- Prepend the string representation of i at front.
            -- (from STRING)
        do
            prepend (i.out)
        end

    prepend_real (r: REAL) is
            -- Prepend the string representation of r at front.
            -- (from STRING)
        do
            prepend (r.out)
        end

    prepend_string (s: STRING) is
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)
        do
            if s /= void then
                prepend (s)
            end
        end

    put (c: CHARACTER; i: INTEGER) is
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (c, i - 1)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    replace_blank is
            -- Replace all current characters with blanks.
            -- (from STRING)
        do
            replace_character (' ')
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_character (c: CHARACTER) is
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, count)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_substring (s: like Current; start_pos, end_pos: INTEGER) is
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        local
            new_size, substring_size: INTEGER
            s_area: like area
        do
            substring_size := end_pos - start_pos + 1
            new_size := s.count + count - substring_size
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_replace ($area, $s_area, count, s.count, start_pos, end_pos)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1
        end

    replace_substring_all (original, new: like Current) is
            -- Replace every occurence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty
        local
            change_pos: INTEGER
        do
            if not is_empty then
                from
                    change_pos := substring_index (original, 1)
                until
                    change_pos = 0
                loop
                    replace_substring (new, change_pos, change_pos + original.count - 1)
                    if change_pos + new.count <= count then
                        change_pos := substring_index (original, change_pos + new.count)
                    else
                        change_pos := 0
                    end
                end
            end
        end

    right_adjust is
            -- Remove trailing whitespace.
            -- (from STRING)
        do
            count := str_right ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))
        end

    set (t: like Current; n1, n2: INTEGER) is
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        local
            s: STRING
        do
            s := t.substring (n1, n2)
            area := s.area
            count := s.count
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    share (other: like Current) is
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        do
            area := other.area
            count := other.count
        ensure -- from STRING
            shared_count: other.count = count
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            start0 := start_pos - 1
            end0 := end_pos - 1
            index0 := index_pos - 1
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

    tail (n: INTEGER) is
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        local
            i, j: INTEGER
        do
            if n < count then
                from
                    j := (count - n)
                    i := 0
                until
                    i = n
                loop
                    area.put (area.item (j), i)
                    i := i + 1
                    j := j + 1
                end
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    infix "+" (s: STRING): STRING is
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        do
            create Result.make (count + s.count)
            Result.append_string (Current)
            Result.append_string (s)
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all characters.
            -- (from STRING)
        do
            count := 0
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity
        end

    prune (c: CHARACTER) is
            -- Remove first occurrence of c, if any.
            -- (from STRING)
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True
        local
            counter: INTEGER
        do
            from
                counter := 1
            until
                counter > count or else (item (counter) = c)
            loop
                counter := counter + 1
            end
            if counter <= count then
                remove (counter)
            end
        end

    prune_all (c: CHARACTER) is
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        do
            count := str_rmall ($area, c, count)
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))
        end

    prune_all_leading (c: CHARACTER) is
            -- Remove all leading occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (1) /= c
            loop
                remove (1)
            end
        end

    prune_all_trailing (c: CHARACTER) is
            -- Remove all trailing occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (count) /= c
            loop
                remove (count)
            end
        end

    remove (i: INTEGER) is
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            str_rmchar ($area, count, i)
            count := count - 1
        ensure -- from STRING
            new_count: count = old count - 1
        end

feature  -- Removal

    wipe_out is
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        do
            area := empty_area
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0
        end

feature {NONE} -- Resizing

    adapt_size is
            -- Adapt the size to accommodate count characters.
            -- (from STRING)
        do
            resize (count)
        end

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (newsize: INTEGER) is
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        do
            if newsize > capacity then
                resize (newsize)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (newsize: INTEGER) is
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0
        local
            area_count: INTEGER
        do
            area_count := area.count
            if newsize >= area_count then
                if area_count = 1 then
                    make_area (newsize + 1)
                else
                    area := str_resize ($area, newsize + 1)
                end
            end
        end

feature {NONE} -- Conversion

    center_justify is
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_cjustify ($area, count, capacity)
        end

    character_justify (pivot: CHARACTER; position: INTEGER) is
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty
        do
            if index_of (pivot, 1) < position then
                from
                    precede (' ')
                until
                    index_of (pivot, 1) = position
                loop
                    precede (' ')
                end
            elseif index_of (pivot, 1) > position then
                from
                    remove (1)
                until
                    index_of (pivot, 1) = position
                loop
                    remove (1)
                end
            end
            from
            until
                count = capacity
            loop
                string_extend (' ')
            end
        end

    left_justify is
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_ljustify ($area, count, capacity)
        end

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from STRING)
        local
            temp: ARRAYED_LIST [CHARACTER]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := 1
            until
                i > count
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

    mirror is
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        local
            a: like area
            c: CHARACTER
            i, j: INTEGER
        do
            if count > 0 then
                from
                    i := count - 1
                    a := area
                until
                    i <= j
                loop
                    c := a.item (i)
                    a.put (a.item (j), i)
                    a.put (c, j)
                    i := i - 1
                    j := j + 1
                end
            end
        ensure -- from STRING
            same_count: count = old count
        end

    mirrored: like Current is
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        do
            Result := clone (Current)
            if count > 0 then
                Result.mirror
            end
        ensure -- from STRING
            same_count: Result.count = count
        end

    right_justify is
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_rjustify ($area, count, capacity)
        end

    split (a_separator: CHARACTER): LINEAR [STRING] is
            -- Split on a_separator.
            -- Ignore separators in quotes.
            -- (from STRING)
        local
            al: ARRAYED_LIST [STRING]
            part: STRING
            i, j, c: INTEGER
            q: BOOLEAN
            p: CHARACTER
        do
            from
                c := count
                create al.make (c)
                i := 1
                j := 0
            until
                i > c
            loop
                j := index_of (a_separator, i)
                if j = 0 then
                    j := c + 1
                end
                part := substring (i, j - 1)
                if part.has ('"') then
                    from
                        j := i - 1
                        p := '%U'
                    until
                        j >= c or p = a_separator
                    loop
                        j := j + 1
                        p := item (j)
                        if p = '"' and not (j > 1 and then item (j - 1) = '%%') then
                            q := not q
                        end
                        if q and p = a_separator then
                            p := '%U'
                        end
                    end
                    part := substring (i, j - 1)
                    part.replace_substring_all ("%%%%", "_#___PERCENT___#_")
                    part.replace_substring_all ("%%%"", "_#___QUOTE___#_")
                    part.replace_substring_all ("%"", "")
                    part.replace_substring_all ("_#___PERCENT___#_", "%%")
                    part.replace_substring_all ("_#___QUOTE___#_", "%"")
                    part.prepend ("%"")
                    part.append ("%"")
                end
                al.extend (part)
                i := j + 1
            end
            Result := al
            check
                al.count = occurrences (a_separator)
            end
        ensure -- from STRING
            Result /= void
        end

    to_boolean: BOOLEAN is
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant)
        end

    to_double: DOUBLE is
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double
        do
            Result := str_atod ($area, count)
        end

    to_integer: INTEGER is
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer
        do
            Result := str_atoi ($area, count)
        end

    to_lower is
            -- Convert to lower case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).lower, i)
                i := i - 1
            end
        end

    to_real: REAL is
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real
        do
            Result := str_ator ($area, count)
        end

    to_upper is
            -- Convert to upper case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).upper, i)
                i := i - 1
            end
        end

feature  -- Conversion

    frozen to_c: ANY is
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)
        do
            area.put ('%U', count)
            Result := area
        end

feature {NONE} -- Duplication

    multiply (n: INTEGER) is
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1
        local
            s: STRING
            i: INTEGER
        do
            s := clone (Current)
            grow (n * count)
            from
                i := n
            until
                i = 1
            loop
                append (s)
                i := i - 1
            end
        end

    substring (n1, n2: INTEGER): like Current is
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        local
            other_area: like area
        do
            if (1 <= n1) and (n1 <= n2) and (n2 <= count) then
                create Result.string_make (n2 - n1 + 1)
                other_area := Result.area
                ($other_area).memory_copy ($area + (n1 - 1), n2 - n1 + 1)
                Result.set_count (n2 - n1 + 1)
            else
                create Result.string_make (0)
            end
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0
        end

feature {NONE} -- Inapplicable

    bag_put (v: CHARACTER) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    c_p_i: INTEGER is
        obsolete "You now have to implement it yourself by inheriting from PLATFORM."
            -- Number of characters per INTEGER
            -- (from STRING)
        do
        end

    hashcode (c_string: POINTER; len: INTEGER): INTEGER is
            -- Hash code value of c_string
            -- (from STRING)
        external
            "C use %"eif_tools.h%""
        end

    frozen set_count (number: INTEGER) is
            -- Set count to number of characters.
            -- (from STRING)
        require -- from STRING
            valid_count: 0 <= number and number <= capacity
        do
            count := number
        ensure -- from STRING
            new_count: count = number
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy characters of source within bounds s
            -- and e to target starting at index i.
            -- (from STRING)
        external
            "C use %"eif_copy.h%""
        end

    str_atod (c_string: POINTER; length: INTEGER): DOUBLE is
            -- Value of double in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_DOUBLE use %"eif_str.h%""
        end

    str_atoi (c_string: POINTER; length: INTEGER): INTEGER is
            -- Value of integer in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_ator (c_string: POINTER; length: INTEGER): REAL is
            -- Value of real in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_REAL use %"eif_str.h%""
        end

    str_cjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Center justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_cprepend (c_string: POINTER; c: CHARACTER; length: INTEGER) is
            -- Prepend c to c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_insert (c_string, other_string: POINTER; c_length, other_length, position: INTEGER) is
            -- Insert other_string into c_string at position.
            -- Insertion occurs at the left of position.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_isd (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a double?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isi (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is an integer?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isr (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a real?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_left (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all leading whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_len (c_string: POINTER): INTEGER is
            -- Length of the C string: c_string
            -- (from STRING)
        external
            "C signature (char *): EIF_INTEGER use %"eif_str.h%""
        alias
            "strlen"
        end

    str_ljustify (c_string: POINTER; length, cap: INTEGER) is
            -- Left justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_replace (c_string, other_string: POINTER; c_length, other_length, star_post, end_pos: INTEGER) is
            -- Replace substring (start_pos, end_pos) from c_string
            -- by other_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_resize (a: POINTER; newsize: INTEGER): like area is
            -- Area which can accomodate
            -- at least newsize characters
            -- (from STRING)
        external
            "C use %"eif_malloc.h%""
        alias
            "sprealloc"
        end

    str_right (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all trailing whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Right justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rmall (c_string: POINTER; c: CHARACTER; length: INTEGER): INTEGER is
            -- Remove all occurrences of c in c_string.
            -- Return new number of character making up c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rmchar (c_string: POINTER; length, i: INTEGER) is
            -- Remove i-th character from c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_str (c_str, o_str: POINTER; clen, olen, i, fuzzy: INTEGER): INTEGER is
            -- Forward search of o_str within c_str starting at i.
            -- Return the index within c_str where the pattern was
            -- located, 0 if not found.
            -- The 'fuzzy' parameter is the maximum allowed number of
            -- mismatches within the pattern. A 0 means an exact match.
            -- (from STRING)
        external
            "C use %"eif_eiffel.h%""
        end

    str_strict_cmp (this, other: POINTER; len: INTEGER): INTEGER is
            -- Compare this and other C strings
            -- for the first len characters.
            -- 0 if equal, < 0 if this < other,
            -- > 0 if this > other
            -- (from STRING)
        external
            "C signature (char *, char *, size_t): EIF_INTEGER use <string.h>"
        alias
            "strncmp"
        end

feature {NONE} -- Empty string implementation

    empty_area: SPECIAL [CHARACTER] is
            -- Empty area used when calling `make (0)'.
            -- (from STRING)
        local
            old_area: like area
        once
            old_area := area
            make_area (1)
            Result := area
            area := old_area
        end

feature {NONE} -- Externals

    eif_append_directory (s, p, v: POINTER) is
            -- (from PATH_NAME)
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_append_file_name (s, p, v: POINTER) is
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_extracted_paths (s: POINTER): ARRAY [STRING] is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

    eif_is_directory_name_valid (p: POINTER): BOOLEAN is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_extension_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_file_name_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_file_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_volume_name_valid (p: POINTER): BOOLEAN is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_path_name_compare (s, t: POINTER; length: INTEGER): BOOLEAN is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_set_directory (s, p, v: POINTER) is
            -- (from PATH_NAME)
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_volume_name (s: POINTER): STRING is
            -- (from PATH_NAME)
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

feature {NONE} -- Output

    out: like Current is
            -- Printable representation
            -- (from STRING)
        do
            Result := clone (Current)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE_NAME Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "File name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    FILE_NAME

create

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature -- Initialization

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the path name equal to other?
            -- (from PATH_NAME)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN
            -- Is dir_name a valid subdirectory part for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: dir_name /= void

    is_extension_valid (ext: STRING): BOOLEAN
            -- Is ext a valid extension for the operating system?

    is_file_name_valid (f_name: STRING): BOOLEAN
            -- Is f_name a valid file name part for the operating system?

    is_valid: BOOLEAN
            -- Is the file name valid for the operating system?

    is_volume_name_valid (vol_name: STRING): BOOLEAN
            -- Is vol_name a valid volume name for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: vol_name /= void

feature  -- Status report

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

feature -- Status setting

    add_extension (ext: STRING)
            -- Append the extension ext to the file name
        require
            string_exists: ext /= void
            non_empty_extension: not ext.is_empty
            valid_extension: is_extension_valid (ext)

    extend (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    extend_from_array (directories: ARRAY [STRING])
            -- Append the subdirectories from directories to the path name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            array_exists: directories /= void and then not (directories.is_empty)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_directory (directory_name: STRING)
            -- Set the absolute directory part of the path name to directory_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_file_name (file_name: STRING)
            -- Set the value of the file name part.
        require
            string_exists: file_name /= void
            valid_file_name: is_file_name_valid (file_name)
        ensure
            valid_file_name: is_valid

    set_subdirectory (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_volume (volume_name: STRING)
            -- Set the volume part of the path name to volume_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature  -- Removal

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature  -- Conversion

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE_NAME Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FILE_NAME

Ancestors
    PATH_NAME

Clients
    DIRECTORY
    FILE_NAME

Suppliers
    BOOLEAN
    FILE_NAME
    INTEGER
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE_NAME Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "File name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    FILE_NAME

create
    make,
    make_from_string

feature -- Status report

    is_valid: BOOLEAN
            -- Is the file name valid for the operating system?

    is_file_name_valid (f_name: STRING): BOOLEAN
            -- Is f_name a valid file name part for the operating system?

    is_extension_valid (ext: STRING): BOOLEAN
            -- Is ext a valid extension for the operating system?

feature -- Status setting

    set_file_name (file_name: STRING)
            -- Set the value of the file name part.
        require
            string_exists: file_name /= void
            valid_file_name: is_file_name_valid (file_name)
        ensure
            valid_file_name: is_valid

    add_extension (ext: STRING)
            -- Append the extension ext to the file name
        require
            string_exists: ext /= void
            non_empty_extension: not ext.is_empty
            valid_extension: is_extension_valid (ext)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FILE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential files, viewed as persistent sequences of characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    FILE

feature -- Initialization

    make (fn: STRING)
            -- Create file object with fn as file name.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

feature -- Access

    name: STRING
            -- File name

    item: CHARACTER
            -- Current item

    position: INTEGER
            -- Current cursor position.

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
        require else
            file_opened: not is_closed

    descriptor_available: BOOLEAN

    separator: CHARACTER
            -- ASCII code of character following last word read

    file_pointer: POINTER
            -- File pointer as required in C

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.

    inode: INTEGER
            -- I-node number
        require
            file_exists: exists

    links: INTEGER
            -- Number of links on file
        require
            file_exists: exists

    user_id: INTEGER
            -- User identification of owner
        require
            file_exists: exists

    group_id: INTEGER
            -- Group identification of owner
        require
            file_exists: exists

    protection: INTEGER
            -- Protection mode, in decimal value
        require
            file_exists: exists

    owner_name: STRING
            -- Name of owner
        require
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
        require
            file_exists: exists

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
        require
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.

feature -- Measurement

    count: INTEGER
            -- Size in bytes (0 if no associated physical file)

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?

    off: BOOLEAN
            -- Is there no item?

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
        require
            opened: not is_closed

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
        ensure then
            unchanged_mode: mode = old mode

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)

    is_plain: BOOLEAN
            -- Is file a plain file?
        require
            file_exists: exists

    is_device: BOOLEAN
            -- Is file a device?
        require
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
        require
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
        require
            file_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
        require
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
        require
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
        require
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
        require
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
        require
            file_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
        require
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
        require
            file_exists: exists

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
        require
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
        require
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
        require
            file_exists: exists

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
        require
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
        require
            file_exists: exists

    file_readable: BOOLEAN
            -- Is there a current item that may be read?

    is_closed: BOOLEAN
            -- Is file closed?

    is_open_read: BOOLEAN
            -- Is file open for reading?

    is_open_write: BOOLEAN
            -- Is file open for writing?

    is_open_append: BOOLEAN
            -- Is file open for appending?

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?

    extendible: BOOLEAN
            -- May new items be added?

    file_prunable: BOOLEAN
            -- May items be removed?

    Full: BOOLEAN is False
            -- Is structure filled to capacity?

feature -- Status setting

    open_read
            -- Open file in read-only mode.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
        ensure
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
        ensure
            exists: exists
            open_read: is_open_read

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
        ensure
            exists: exists
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
        ensure
            exists: exists
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    close
            -- Close file.
        ensure then
            is_closed: is_closed

feature -- Cursor movement

    start
            -- Go to first position.
        require else
            file_opened: not is_closed

    finish
            -- Go to last position.
        require else
            file_opened: not is_closed

    forth
            -- Go to next position.
        require else
            file_opened: not is_closed

    back
            -- Go back one position.

    move (offset: INTEGER)
            -- Advance by offset from current location.
        require
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    next_line
            -- Move to next input line.
        require
            is_readable: file_readable

feature -- Element change

    extend (v: CHARACTER)
            -- Include v at end.

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
        require
            is_open: not is_closed

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
        require
            file_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
        require else
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure then
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    put_integer (i: INTEGER)
            -- Write i at current position.
            -- Was declared in FILE as synonym of putint.

    putint (i: INTEGER)
            -- Write i at current position.
            -- Was declared in FILE as synonym of put_integer.

    put_boolean (b: BOOLEAN)
            -- Write b at current position.
            -- Was declared in FILE as synonym of putbool.

    putbool (b: BOOLEAN)
            -- Write b at current position.
            -- Was declared in FILE as synonym of put_boolean.

    put_real (r: REAL)
            -- Write r at current position.
            -- Was declared in FILE as synonym of putreal.

    putreal (r: REAL)
            -- Write r at current position.
            -- Was declared in FILE as synonym of put_real.

    put_double (d: DOUBLE)
            -- Write d at current position.
            -- Was declared in FILE as synonym of putdouble.

    putdouble (d: DOUBLE)
            -- Write d at current position.
            -- Was declared in FILE as synonym of put_double.

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
        require
            file_exists: exists
        ensure
            date_updated: date = time

    set_access (time: INTEGER)
            -- Stamp with time (access only).
        require
            file_exists: exists
        ensure
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
        require
            file_exists: exists
        ensure
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    change_name (new_name: STRING)
            -- Change file name to new_name
        require
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure
            name_changed: name.is_equal (new_name)

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
        require
            file_exists: exists

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
        require
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
        require
            file_exists: exists

    change_date: INTEGER
            -- Time stamp of last change.
        require
            file_exists: exists

    touch
            -- Update time stamp (for both access and modification).
        require
            file_exists: exists
        ensure
            date_changed: date /= old date

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).

feature -- Removal

    wipe_out
            -- Remove all items.
        require else
            is_closed: is_closed

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
        require
            exists: exists

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
        require
            valid_file_name: fn /= void
        ensure
            file_renamed: name = fn
            file_closed: is_closed

feature -- Input

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of readreal.
        require else
            is_readable: file_readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of read_real.
        require else
            is_readable: file_readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of readdouble.
        require else
            is_readable: file_readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of read_double.
        require else
            is_readable: file_readable

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
        require else
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
        require else
            is_readable: file_readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of readint.
        require else
            is_readable: file_readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of read_integer.
        require else
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
        require else
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
        require else
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
        require else
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
        require else
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
        require
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
        require
            is_readable: file_readable

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
        require
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

invariant

    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FUNCTION Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a function,
        with some arguments possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and the addition
        of `last_result' and `item'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

inherit
    ROUTINE [BASE_TYPE, OPEN_ARGS]
        redefine
            is_equal,
            copy
        end

feature -- Access

    last_result: RESULT_TYPE is
            -- Result of last call, if any.
        do
            if result_array /= void then
                Result := result_array.item (1)
            end
        end

    item (args: OPEN_ARGS): RESULT_TYPE is
            -- Result of calling function with args as operands.
        require
            valid_operands: valid_operands (args)
            callable: callable
        do
            operands := args
            apply
            Result := last_result
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is associated function the same as the one
            -- associated with other?
        do
            Result := Precursor  (other) and then equal (last_result, other.last_result)
        end

feature -- Duplication

    copy (other: like Current) is
            -- Use same function as other.
        do
            Precursor  (other)
            if result_array = void then
                create result_array.make (1, 1)
            end
            result_array.put (other.last_result, 1)
        end

feature -- Basic operations

    apply is
            -- Call function with operands as last set.
        do
            if result_array = void then
                create result_array.make (1, 1)
            end
            rout_set_cargs
            rout_obj_call_function ($result_array, rout_disp, rout_cargs)
        end

feature -- Obsolete

    eval (args: OPEN_ARGS): RESULT_TYPE is
        obsolete "Please use `item' instead"
            -- Result of evaluating function for args.
        require
            valid_operands: valid_operands (args)
            callable: callable
        do
            Result := item (args)
        end

feature {NONE} -- Implementation

    result_array: ARRAY [RESULT_TYPE]
            -- Array used to return result.

    rout_obj_call_function (res, rout, args: POINTER) is
            -- Perform call to rout on cur object with args
            -- as operands and return res.
        external
            "C | %"eif_rout_obj.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FUNCTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FUNCTION Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

General
    cluster: base.kernel
    description:
        "Objects representing delayed calls to a function,
        with some arguments possibly still open."

Ancestors
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Queries
    callable: BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] FUNCTION [BASE_TYPE, OPEN_ARGS, RESULT_TYPE]): BOOLEAN
    is_hashable: BOOLEAN
    item (args: OPEN_ARGS): RESULT_TYPE
    last_result: RESULT_TYPE
    open_count: INTEGER
    open_operand_type (i: INTEGER): INTEGER
    operands: OPEN_ARGS
    postcondition (args: [like operands] OPEN_ARGS): BOOLEAN
    precondition (args: [like operands] OPEN_ARGS): BOOLEAN
    target: ANY
    valid_operands (args: OPEN_ARGS): BOOLEAN

Commands
    adapt (other: ROUTINE [ANY, OPEN_ARGS])
    apply
    call (args: OPEN_ARGS)
    copy (other: [like Current] FUNCTION [BASE_TYPE, OPEN_ARGS, RESULT_TYPE])
    set_operands (args: OPEN_ARGS)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FUNCTION Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a function,
        with some arguments possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and the addition
        of `last_result' and `item'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS]) is
            -- Initialize from other.
            -- Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
            operands := other.operands
            operands_set_by_user := other.operands_set_by_user
            closed_operands := other.closed_operands
            open_map := other.open_map
            closed_map := other.closed_map
            rout_disp := other.rout_disp
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable
        end

feature -- Access

    hash_code: INTEGER is
            -- Hash code value.
            -- (from ROUTINE)
        do
            Result := rout_disp.hash_code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item (args: OPEN_ARGS): RESULT_TYPE is
            -- Result of calling function with args as operands.
        require
            valid_operands: valid_operands (args)
            callable: callable
        do
            operands := args
            apply
            Result := last_result
        end

    last_result: RESULT_TYPE is
            -- Result of last call, if any.
        do
            if result_array /= void then
                Result := result_array.item (1)
            end
        end

    open_operand_type (i: INTEGER): INTEGER is
            -- Type of ith open operand.
            -- (from ROUTINE)
        require -- from ROUTINE
            positive: i >= 1
            within_bounds: i <= open_count
        do
            if open_types = void then
                create open_types.make (1, open_map.count)
            end
            Result := open_types.item (i)
            if Result = 0 then
                Result := eif_gen_param_id (- 1, eif_gen_create ($Current, 2), i)
                open_types.force (Result, i)
            end
        end

    operands: OPEN_ARGS
            -- Open operands.
            -- (from ROUTINE)

    postcondition (args: like operands): BOOLEAN is
            -- Does current state satisfy routine's
            -- postcondition for args?
            -- (from ROUTINE)
        do
            Result := True
        end

    precondition (args: like operands): BOOLEAN is
            -- Do args satisfy routine's precondition
            -- in current state?
            -- (from ROUTINE)
        do
            Result := True
        end

    target: ANY is
            -- Target of call.
            -- (from ROUTINE)
        do
            if closed_map.count > 0 and then closed_map.item (closed_map.lower) = 0 then
                Result := closed_operands.item (closed_operands.lower)
            elseif operands /= void and then operands.count > 0 then
                Result := operands.item (operands.lower)
            end
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    open_count: INTEGER is
            -- Number of open operands.
            -- (from ROUTINE)
        do
            if open_map /= void then
                Result := open_map.count
            end
        end

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is associated function the same as the one
            -- associated with other?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := Precursor  (other) and then equal (last_result, other.last_result)
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    callable: BOOLEAN is
            -- Can routine be called on current object?
            -- (from ROUTINE)
        local
            null_ptr: POINTER
        do
            Result := (rout_disp /= null_ptr)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    valid_operands (args: OPEN_ARGS): BOOLEAN is
            -- Are args valid operands for this routine?
            -- (from ROUTINE)
        local
            i: INTEGER
            mismatch: BOOLEAN
            arg: ANY
            arg_type_code: CHARACTER
            open_arg_type_code: CHARACTER
            a_boolean_ref: BOOLEAN_REF
            a_character_ref: CHARACTER_REF
            a_double_ref: DOUBLE_REF
            an_integer_ref: INTEGER_REF
            a_pointer_ref: POINTER_REF
            a_real_ref: REAL_REF
            int: INTERNAL
        do
            if args = void or open_map = void then
                Result := (open_map = void)
            elseif open_map /= void and then args.count >= open_map.count then
                from
                    create int
                    i := 1
                until
                    i > open_map.count or mismatch
                loop
                    arg := args.item (i)
                    arg_type_code := args.arg_item_code (i)
                    open_arg_type_code := open_type_codes.item (i + 1)
                    if arg_type_code = 'r' then
                        inspect open_arg_type_code
                        when 'b' then
                            a_boolean_ref ?= arg;
                            mismatch := a_boolean_ref = void
                        when 'c' then
                            a_character_ref ?= arg;
                            mismatch := a_character_ref = void
                        when 'd' then
                            a_double_ref ?= arg;
                            mismatch := a_double_ref = void
                        when 'i' then
                            an_integer_ref ?= arg;
                            mismatch := an_integer_ref = void
                        when 'p' then
                            a_pointer_ref ?= arg;
                            mismatch := a_pointer_ref = void
                        when 'f' then
                            a_real_ref ?= arg;
                            mismatch := a_real_ref = void
                        when 'r' then
                            if arg /= void and then not eif_gen_conf (int.dynamic_type (arg), open_operand_type (i)) then
                                mismatch := True
                            end
                        end
                    else
                        if arg_type_code /= open_arg_type_code and (open_arg_type_code = 'r' implies open_operand_type (i) > 0) then
                            mismatch := True
                        end
                    end
                    i := i + 1
                end;
                Result := not mismatch
            end
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Element change

    set_operands (args: OPEN_ARGS) is
            -- Use args as operands for next call.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
        do
            operands := args
            operands_set_by_user := True
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Duplication

    copy (other: like Current) is
            -- Use same function as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            Precursor  (other)
            if result_array = void then
                create result_array.make (1, 1)
            end
            result_array.put (other.last_result, 1)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ROUTINE
            same_call_status: other.callable implies callable
        end

feature -- Basic operations

    apply is
            -- Call function with operands as last set.
        require -- from ROUTINE
            valid_operands: valid_operands (operands)
            callable: callable
        do
            if result_array = void then
                create result_array.make (1, 1)
            end
            rout_set_cargs
            rout_obj_call_function ($result_array, rout_disp, rout_cargs)
        end

    call (args: OPEN_ARGS) is
            -- Call routine with operands args.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
            callable: callable
        do
            operands := args
            apply
            if not operands_set_by_user then
                operands := void
            end
        end

feature -- Obsolete

    adapt_from (other: like Current) is
        obsolete "Please use `adapt' instead (it's also a creation procedure)"
            -- Adapt from other. Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        do
            adapt (other)
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable
        end

    arguments: OPEN_ARGS is
        obsolete "use operands"
            -- (from ROUTINE)
        do
            Result := operands
        end

    eval (args: OPEN_ARGS): RESULT_TYPE is
        obsolete "Please use `item' instead"
            -- Result of evaluating function for args.
        require
            valid_operands: valid_operands (args)
            callable: callable
        do
            Result := item (args)
        end

    set_arguments (args: OPEN_ARGS) is
        obsolete "use set_operands"
            -- (from ROUTINE)
        do
            set_operands (args)
        end

    valid_arguments (args: OPEN_ARGS): BOOLEAN is
        obsolete "use valid_operands"
            -- (from ROUTINE)
        do
            Result := valid_operands (args)
        end

feature {NONE} -- Implementation

    dispose is
            -- Free routine argument union structure
            -- (from ROUTINE)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    frozen internal_closed_type_codes: STRING
            -- (from ROUTINE)

    frozen internal_open_type_codes: STRING
            -- (from ROUTINE)

    result_array: ARRAY [RESULT_TYPE]
            -- Array used to return result.

    frozen rout_cargs: POINTER
            -- Routine operands
            -- (from ROUTINE)

    rout_obj_call_function (res, rout, args: POINTER) is
            -- Perform call to rout on cur object with args
            -- as operands and return res.
        external
            "C | %"eif_rout_obj.h%""
        end

    frozen rout_set_cargs is
            -- Allocate and fill argument structure
            -- (from ROUTINE)
        local
            new_args: POINTER
            i, j, ocnt, ccnt: INTEGER
            code: CHARACTER
            ref_arg: ANY
            null_ptr: POINTER
            was_on: BOOLEAN
            loc_open_map: like open_map
            loc_closed_map: like closed_map
            loc_operands: like operands
            loc_closed_operands: like closed_operands
            loc_open_type_codes: like open_type_codes
            loc_closed_type_codes: like closed_type_codes
        do
            was_on := collecting
            collection_off
            loc_open_map := open_map
            if loc_open_map /= void then
                ocnt := loc_open_map.count
                loc_open_type_codes := open_type_codes
                loc_operands := operands
            end
            loc_closed_map := closed_map
            if loc_closed_map /= void then
                ccnt := loc_closed_map.count
                loc_closed_type_codes := closed_type_codes
                loc_closed_operands := closed_operands
            end
            if rout_cargs = null_ptr then
                new_args := rout_obj_new_args (ocnt + ccnt + 1)
                rout_cargs := new_args
            else
                new_args := rout_cargs
            end
            from
                i := 1
            until
                i > ocnt
            loop
                code := loc_open_type_codes.item (i + 1)
                check
                    loc_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_operands.real_item (i)
                else
                    ref_arg := loc_operands.item (i)
                end
                j := loc_open_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            from
                i := 1
            until
                i > ccnt
            loop
                code := loc_closed_type_codes.item (i)
                check
                    loc_closed_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_closed_operands.real_item (i)
                else
                    ref_arg := loc_closed_operands.item (i)
                end
                j := loc_closed_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            if was_on then
                collection_on
            end
        rescue
            if was_on then
                collection_on
            end
        end

feature {ROUTINE, E_FEATURE} -- Implementation

    frozen closed_map: ARRAY [INTEGER]
            -- Index map for closed arguments
            -- (from ROUTINE)

    frozen closed_operands: TUPLE
            -- Closed arguments provided at creation time
            -- (from ROUTINE)

    closed_type_codes: STRING is
            -- Type codes for closed arguments
            -- (from ROUTINE)
        do
            if closed_operands /= void and internal_closed_type_codes = void then
                internal_closed_type_codes := eif_gen_tuple_typecode_str ($closed_operands)
            end
            Result := internal_closed_type_codes
        end

    frozen eiffel_rout_disp: POINTER
            -- Eiffel routine dispatcher
            -- (from ROUTINE)

    frozen open_map: ARRAY [INTEGER]
            -- Index map for open arguments
            -- (from ROUTINE)

    open_type_codes: STRING is
            -- Type codes for open arguments
            -- (from ROUTINE)
        do
            if internal_open_type_codes = void then
                internal_open_type_codes := eif_gen_typecode_str ($Current)
            end
            Result := internal_open_type_codes
        end

    frozen open_types: ARRAY [INTEGER]
            -- Types of open operands
            -- (from ROUTINE)

    frozen operands_set_by_user: BOOLEAN
            -- Are operands set throug call to set_operands.
            -- If not, we can delete them after routine call for
            -- later collection.
            -- (from ROUTINE)

    frozen rout_disp: POINTER
            -- Routine dispatcher
            -- (from ROUTINE)

    frozen set_rout_args (closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
            -- (from ROUTINE)
        require -- from ROUTINE
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

    frozen set_rout_disp (p: POINTER; tp: POINTER; closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
            -- (from ROUTINE)
        require -- from ROUTINE
            p_not_void: p /= default_pointer
            tp_not_void: tp /= default_pointer
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            rout_disp := p
            eiffel_rout_disp := tp
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

feature {NONE} -- Externals

    eif_gen_conf (type1, type2: INTEGER): BOOLEAN is
            -- Does type1 conform to type2?
            -- (from ROUTINE)
        external
            "C (int16, int16): EIF_BOOLEAN | %"eif_gen_conf.h%""
        end

    eif_gen_create (obj: POINTER; pos: INTEGER): POINTER is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_param_id (stype: INTEGER; obj: POINTER; pos: INTEGER): INTEGER is
            -- Type of generic parameter in obj at position pos.
            -- (from ROUTINE)
        external
            "C (int16, EIF_REFERENCE, int): EIF_INTEGER | %"eif_gen_conf.h%""
        end

    eif_gen_tuple_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode (obj: POINTER; pos: INTEGER): CHARACTER is
            -- Code for generic parameter pos in obj.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    rout_obj_free_args (args: POINTER) is
            -- Free args.
            -- (from ROUTINE)
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_new_args (cnt: INTEGER): POINTER is
            -- Initialize for new operands.
            -- (from ROUTINE)
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_putb (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putd (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putf (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti16 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti32 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti64 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti8 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putp (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putr (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putwc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

feature {NONE} -- Runtime constants

    Eif_boolean_code: CHARACTER is 'b'
            -- (from ROUTINE)

    Eif_character_code: CHARACTER is 'c'
            -- (from ROUTINE)

    Eif_double_code: CHARACTER is 'd'
            -- (from ROUTINE)

    Eif_integer_16_code: CHARACTER is 'k'
            -- (from ROUTINE)

    Eif_integer_64_code: CHARACTER is 'l'
            -- (from ROUTINE)

    Eif_integer_8_code: CHARACTER is 'j'
            -- (from ROUTINE)

    Eif_integer_code: CHARACTER is 'i'
            -- (from ROUTINE)

    Eif_pointer_code: CHARACTER is 'p'
            -- (from ROUTINE)

    Eif_real_code: CHARACTER is 'f'
            -- (from ROUTINE)

    Eif_reference_code: CHARACTER is 'r'
            -- (from ROUTINE)

    Eif_wide_char_code: CHARACTER is 'u'
            -- Type constants used by runtime to recognize types
            -- needed to perform call
            -- (from ROUTINE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FUNCTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FUNCTION Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a function,
        with some arguments possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and the addition
        of `last_result' and `item'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS])
            -- Initialize from other.
            -- Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Access

    hash_code: INTEGER
            -- Hash code value.
            -- (from ROUTINE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item (args: OPEN_ARGS): RESULT_TYPE
            -- Result of calling function with args as operands.
        require
            valid_operands: valid_operands (args)
            callable: callable

    last_result: RESULT_TYPE
            -- Result of last call, if any.

    open_operand_type (i: INTEGER): INTEGER
            -- Type of ith open operand.
            -- (from ROUTINE)
        require -- from ROUTINE
            positive: i >= 1
            within_bounds: i <= open_count

    operands: OPEN_ARGS
            -- Open operands.
            -- (from ROUTINE)

    postcondition (args: like operands): BOOLEAN
            -- Does current state satisfy routine's
            -- postcondition for args?
            -- (from ROUTINE)

    precondition (args: like operands): BOOLEAN
            -- Do args satisfy routine's precondition
            -- in current state?
            -- (from ROUTINE)

    target: ANY
            -- Target of call.
            -- (from ROUTINE)

feature -- Measurement

    open_count: INTEGER
            -- Number of open operands.
            -- (from ROUTINE)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is associated function the same as the one
            -- associated with other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    callable: BOOLEAN
            -- Can routine be called on current object?
            -- (from ROUTINE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    valid_operands (args: OPEN_ARGS): BOOLEAN
            -- Are args valid operands for this routine?
            -- (from ROUTINE)

feature -- Element change

    set_operands (args: OPEN_ARGS)
            -- Use args as operands for next call.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)

feature -- Duplication

    copy (other: like Current)
            -- Use same function as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Basic operations

    apply
            -- Call function with operands as last set.
        require -- from ROUTINE
            valid_operands: valid_operands (operands)
            callable: callable

    call (args: OPEN_ARGS)
            -- Call routine with operands args.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
            callable: callable

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FUNCTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FUNCTION Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

Ancestors
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Clients
    DIRECTORY
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    INTEGER_INTERVAL
    LINEAR [G]
    LINEAR_ITERATOR [G]

Suppliers
    ARRAY [G]
    BOOLEAN
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FUNCTION Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a function,
        with some arguments possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and the addition
        of `last_result' and `item'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

feature -- Access

    last_result: RESULT_TYPE
            -- Result of last call, if any.

    item (args: OPEN_ARGS): RESULT_TYPE
            -- Result of calling function with args as operands.
        require
            valid_operands: valid_operands (args)
            callable: callable

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is associated function the same as the one
            -- associated with other?

feature -- Duplication

    copy (other: like Current)
            -- Use same function as other.

feature -- Basic operations

    apply
            -- Call function with operands as last set.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FUNCTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


GC_INFO Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Garbage collector statistics.
            This class may be used as ancestor by classes needing its facilities.
            Time accounting is relevant only if `enable_time_accounting'
            (from MEMORY) has been called.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    GC_INFO

inherit
    MEM_CONST

create
    make

feature -- Initialization

    make (memory: INTEGER) is
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of update.
        do
            gc_stat (memory)
            cycle_count := gc_info (0)
            memory_used := gc_info (1)
            collected := gc_info (2)
            collected_average := gc_info (3)
            real_time := gc_info (4)
            real_time_average := gc_info (5)
            real_interval_time := gc_info (6)
            real_interval_time_average := gc_info (7)
            cpu_time := gc_infod (8)
            cpu_time_average := gc_infod (9)
            cpu_interval_time := gc_infod (10)
            cpu_interval_time_average := gc_infod (11)
            sys_time := gc_infod (12)
            sys_time_average := gc_infod (13)
            sys_interval_time := gc_infod (14)
            sys_interval_time_average := gc_infod (15)
        end

    update (memory: INTEGER) is
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of make.
        do
            gc_stat (memory)
            cycle_count := gc_info (0)
            memory_used := gc_info (1)
            collected := gc_info (2)
            collected_average := gc_info (3)
            real_time := gc_info (4)
            real_time_average := gc_info (5)
            real_interval_time := gc_info (6)
            real_interval_time_average := gc_info (7)
            cpu_time := gc_infod (8)
            cpu_time_average := gc_infod (9)
            cpu_interval_time := gc_infod (10)
            cpu_interval_time_average := gc_infod (11)
            sys_time := gc_infod (12)
            sys_time_average := gc_infod (13)
            sys_interval_time := gc_infod (14)
            sys_interval_time_average := gc_infod (15)
        end

feature -- Access

    type: INTEGER
            -- Collector type (Full, Collect),
            -- for type before last call to update

    cycle_count: INTEGER
            -- Number of collection cycles for type
            -- before last call to update

    memory_used: INTEGER
            -- Total number of bytes used (counting overhead)
            -- after last cycle for type before last
            -- call to update

    collected: INTEGER
            -- Number of bytes collected by the last cycle,
            -- for type before last call to update

    collected_average: INTEGER
            -- Average number of bytes collected by a cycle,
            -- for type before last call to update

    real_time: INTEGER
            -- Real time in centi-seconds used by last cycle
            -- for type, before last call to update;
            -- this may not be accurate on systems which do not
            -- provide a sub-second accuracy clock (typically
            -- provided on BSD).

    real_time_average: INTEGER
            -- Average amount of real time, in centi-seconds,
            -- spent in collection cycle,
            -- for type before last call to update

    real_interval_time: INTEGER
            -- Real interval time (as opposed to CPU time) between
            -- two automatically raised cycles, in centi-seconds,
            -- for type before last call to update

    real_interval_time_average: INTEGER
            -- Average real interval time between two automatic
            -- cycles, in centi-seconds,
            -- for type before last call to update

    cpu_time: DOUBLE
            -- Amount of CPU time, in seconds, spent in cycle,
            -- for type before last call to update

    cpu_time_average: DOUBLE
            -- Average amount of CPU time spent in cycle,
            -- in seconds, for type before last call to update

    cpu_interval_time: DOUBLE
            -- Amount of CPU time elapsed since between last
            -- and penultimate cycles for type before
            -- last call to update

    cpu_interval_time_average: DOUBLE
            -- Average amount of CPU time between two cycles,
            -- for type before last call to update

    sys_time: DOUBLE
            -- Amount of kernel time, in seconds, spent in cycle,
            -- for type before last call to update

    sys_time_average: DOUBLE
            -- Average amount of kernel time spent in cycle,
            -- for type before last call to update

    sys_interval_time: DOUBLE
            -- Amount of kernel time elapsed since between
            -- the last and the penultimate cycle,
            -- for type before last call to update

    sys_interval_time_average: DOUBLE
            -- Average amount of kernel time between two cycles,
            -- for type before last call to update

feature {NONE} -- Implementation

    gc_stat (mem: INTEGER) is
            -- Initialize run-time buffer used by gc_info to retrieve the
            -- statistics frozen at the time of this call.
        external
            "C | %"eif_memory.h%""
        end

    gc_info (field: INTEGER): INTEGER is
            -- Read GC accounting structure, field by field.
        external
            "C | %"eif_memory.h%""
        end

    gc_infod (field: INTEGER): DOUBLE is
            -- Read GC accounting structure, field by field.
        external
            "C | %"eif_memory.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class GC_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


GC_INFO Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    GC_INFO

General
    cluster: base.kernel
    description:
        "Garbage collector statistics.
        This class may be used as ancestor by classes needing its facilities.
        Time accounting is relevant only if `enable_time_accounting'
        (from MEMORY) has been called."
    create: make

Ancestors
    MEM_CONST

Queries
    C_memory: INTEGER
    collected: INTEGER
    collected_average: INTEGER
    cpu_interval_time: DOUBLE
    cpu_interval_time_average: DOUBLE
    cpu_time: DOUBLE
    cpu_time_average: DOUBLE
    cycle_count: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    Incremental_collector: INTEGER
    memory_used: INTEGER
    real_interval_time: INTEGER
    real_interval_time_average: INTEGER
    real_time: INTEGER
    real_time_average: INTEGER
    sys_interval_time: DOUBLE
    sys_interval_time_average: DOUBLE
    sys_time: DOUBLE
    sys_time_average: DOUBLE
    Total_memory: INTEGER
    type: INTEGER

Commands
    make (memory: INTEGER)
    update (memory: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


GC_INFO Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Garbage collector statistics.
            This class may be used as ancestor by classes needing its facilities.
            Time accounting is relevant only if `enable_time_accounting'
            (from MEMORY) has been called.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    GC_INFO

create
    make

feature -- Initialization

    make (memory: INTEGER) is
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of update.
        do
            gc_stat (memory)
            cycle_count := gc_info (0)
            memory_used := gc_info (1)
            collected := gc_info (2)
            collected_average := gc_info (3)
            real_time := gc_info (4)
            real_time_average := gc_info (5)
            real_interval_time := gc_info (6)
            real_interval_time_average := gc_info (7)
            cpu_time := gc_infod (8)
            cpu_time_average := gc_infod (9)
            cpu_interval_time := gc_infod (10)
            cpu_interval_time_average := gc_infod (11)
            sys_time := gc_infod (12)
            sys_time_average := gc_infod (13)
            sys_interval_time := gc_infod (14)
            sys_interval_time_average := gc_infod (15)
        end

    update (memory: INTEGER) is
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of make.
        do
            gc_stat (memory)
            cycle_count := gc_info (0)
            memory_used := gc_info (1)
            collected := gc_info (2)
            collected_average := gc_info (3)
            real_time := gc_info (4)
            real_time_average := gc_info (5)
            real_interval_time := gc_info (6)
            real_interval_time_average := gc_info (7)
            cpu_time := gc_infod (8)
            cpu_time_average := gc_infod (9)
            cpu_interval_time := gc_infod (10)
            cpu_interval_time_average := gc_infod (11)
            sys_time := gc_infod (12)
            sys_time_average := gc_infod (13)
            sys_interval_time := gc_infod (14)
            sys_interval_time_average := gc_infod (15)
        end

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    collected: INTEGER
            -- Number of bytes collected by the last cycle,
            -- for type before last call to update

    collected_average: INTEGER
            -- Average number of bytes collected by a cycle,
            -- for type before last call to update

    cpu_interval_time: DOUBLE
            -- Amount of CPU time elapsed since between last
            -- and penultimate cycles for type before
            -- last call to update

    cpu_interval_time_average: DOUBLE
            -- Average amount of CPU time between two cycles,
            -- for type before last call to update

    cpu_time: DOUBLE
            -- Amount of CPU time, in seconds, spent in cycle,
            -- for type before last call to update

    cpu_time_average: DOUBLE
            -- Average amount of CPU time spent in cycle,
            -- in seconds, for type before last call to update

    cycle_count: INTEGER
            -- Number of collection cycles for type
            -- before last call to update

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    memory_used: INTEGER
            -- Total number of bytes used (counting overhead)
            -- after last cycle for type before last
            -- call to update

    real_interval_time: INTEGER
            -- Real interval time (as opposed to CPU time) between
            -- two automatically raised cycles, in centi-seconds,
            -- for type before last call to update

    real_interval_time_average: INTEGER
            -- Average real interval time between two automatic
            -- cycles, in centi-seconds,
            -- for type before last call to update

    real_time: INTEGER
            -- Real time in centi-seconds used by last cycle
            -- for type, before last call to update;
            -- this may not be accurate on systems which do not
            -- provide a sub-second accuracy clock (typically
            -- provided on BSD).

    real_time_average: INTEGER
            -- Average amount of real time, in centi-seconds,
            -- spent in collection cycle,
            -- for type before last call to update

    sys_interval_time: DOUBLE
            -- Amount of kernel time elapsed since between
            -- the last and the penultimate cycle,
            -- for type before last call to update

    sys_interval_time_average: DOUBLE
            -- Average amount of kernel time between two cycles,
            -- for type before last call to update

    sys_time: DOUBLE
            -- Amount of kernel time, in seconds, spent in cycle,
            -- for type before last call to update

    sys_time_average: DOUBLE
            -- Average amount of kernel time spent in cycle,
            -- for type before last call to update

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    type: INTEGER
            -- Collector type (Full, Collect),
            -- for type before last call to update

feature {NONE} -- Implementation

    gc_info (field: INTEGER): INTEGER is
            -- Read GC accounting structure, field by field.
        external
            "C | %"eif_memory.h%""
        end

    gc_infod (field: INTEGER): DOUBLE is
            -- Read GC accounting structure, field by field.
        external
            "C | %"eif_memory.h%""
        end

    gc_stat (mem: INTEGER) is
            -- Initialize run-time buffer used by gc_info to retrieve the
            -- statistics frozen at the time of this call.
        external
            "C | %"eif_memory.h%""
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class GC_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


GC_INFO Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Garbage collector statistics.
            This class may be used as ancestor by classes needing its facilities.
            Time accounting is relevant only if `enable_time_accounting'
            (from MEMORY) has been called.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    GC_INFO

create

    make (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of update.

feature -- Initialization

    make (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of update.

    update (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of make.

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    collected: INTEGER
            -- Number of bytes collected by the last cycle,
            -- for type before last call to update

    collected_average: INTEGER
            -- Average number of bytes collected by a cycle,
            -- for type before last call to update

    cpu_interval_time: DOUBLE
            -- Amount of CPU time elapsed since between last
            -- and penultimate cycles for type before
            -- last call to update

    cpu_interval_time_average: DOUBLE
            -- Average amount of CPU time between two cycles,
            -- for type before last call to update

    cpu_time: DOUBLE
            -- Amount of CPU time, in seconds, spent in cycle,
            -- for type before last call to update

    cpu_time_average: DOUBLE
            -- Average amount of CPU time spent in cycle,
            -- in seconds, for type before last call to update

    cycle_count: INTEGER
            -- Number of collection cycles for type
            -- before last call to update

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    memory_used: INTEGER
            -- Total number of bytes used (counting overhead)
            -- after last cycle for type before last
            -- call to update

    real_interval_time: INTEGER
            -- Real interval time (as opposed to CPU time) between
            -- two automatically raised cycles, in centi-seconds,
            -- for type before last call to update

    real_interval_time_average: INTEGER
            -- Average real interval time between two automatic
            -- cycles, in centi-seconds,
            -- for type before last call to update

    real_time: INTEGER
            -- Real time in centi-seconds used by last cycle
            -- for type, before last call to update;
            -- this may not be accurate on systems which do not
            -- provide a sub-second accuracy clock (typically
            -- provided on BSD).

    real_time_average: INTEGER
            -- Average amount of real time, in centi-seconds,
            -- spent in collection cycle,
            -- for type before last call to update

    sys_interval_time: DOUBLE
            -- Amount of kernel time elapsed since between
            -- the last and the penultimate cycle,
            -- for type before last call to update

    sys_interval_time_average: DOUBLE
            -- Average amount of kernel time between two cycles,
            -- for type before last call to update

    sys_time: DOUBLE
            -- Amount of kernel time, in seconds, spent in cycle,
            -- for type before last call to update

    sys_time_average: DOUBLE
            -- Average amount of kernel time spent in cycle,
            -- for type before last call to update

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    type: INTEGER
            -- Collector type (Full, Collect),
            -- for type before last call to update

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class GC_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


GC_INFO Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    GC_INFO

Ancestors
    MEM_CONST

Clients
    GC_INFO
    MEMORY

Suppliers
    GC_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


GC_INFO Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Garbage collector statistics.
            This class may be used as ancestor by classes needing its facilities.
            Time accounting is relevant only if `enable_time_accounting'
            (from MEMORY) has been called.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    GC_INFO

create
    make

feature -- Initialization

    make (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of update.

    update (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of make.

feature -- Access

    type: INTEGER
            -- Collector type (Full, Collect),
            -- for type before last call to update

    cycle_count: INTEGER
            -- Number of collection cycles for type
            -- before last call to update

    memory_used: INTEGER
            -- Total number of bytes used (counting overhead)
            -- after last cycle for type before last
            -- call to update

    collected: INTEGER
            -- Number of bytes collected by the last cycle,
            -- for type before last call to update

    collected_average: INTEGER
            -- Average number of bytes collected by a cycle,
            -- for type before last call to update

    real_time: INTEGER
            -- Real time in centi-seconds used by last cycle
            -- for type, before last call to update;
            -- this may not be accurate on systems which do not
            -- provide a sub-second accuracy clock (typically
            -- provided on BSD).

    real_time_average: INTEGER
            -- Average amount of real time, in centi-seconds,
            -- spent in collection cycle,
            -- for type before last call to update

    real_interval_time: INTEGER
            -- Real interval time (as opposed to CPU time) between
            -- two automatically raised cycles, in centi-seconds,
            -- for type before last call to update

    real_interval_time_average: INTEGER
            -- Average real interval time between two automatic
            -- cycles, in centi-seconds,
            -- for type before last call to update

    cpu_time: DOUBLE
            -- Amount of CPU time, in seconds, spent in cycle,
            -- for type before last call to update

    cpu_time_average: DOUBLE
            -- Average amount of CPU time spent in cycle,
            -- in seconds, for type before last call to update

    cpu_interval_time: DOUBLE
            -- Amount of CPU time elapsed since between last
            -- and penultimate cycles for type before
            -- last call to update

    cpu_interval_time_average: DOUBLE
            -- Average amount of CPU time between two cycles,
            -- for type before last call to update

    sys_time: DOUBLE
            -- Amount of kernel time, in seconds, spent in cycle,
            -- for type before last call to update

    sys_time_average: DOUBLE
            -- Average amount of kernel time spent in cycle,
            -- for type before last call to update

    sys_interval_time: DOUBLE
            -- Amount of kernel time elapsed since between
            -- the last and the penultimate cycle,
            -- for type before last call to update

    sys_interval_time_average: DOUBLE
            -- Average amount of kernel time between two cycles,
            -- for type before last call to update

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class GC_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASHABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Values that may be hashed into an integer index,
        for use as keys in hash tables
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class
    HASHABLE

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
        deferred
        ensure
            good_hash_value: Result >= 0
        end

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := (Current /= default)
        ensure
            ok_if_not_default: Result implies (Current /= default)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASHABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    HASHABLE

General
    cluster: base.kernel
    description:
        "Values that may be hashed into an integer index,
        for use as keys in hash tables"

Ancestors
    ANY

Queries
    hash_code: INTEGER
    is_hashable: BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASHABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Values that may be hashed into an integer index,
        for use as keys in hash tables
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class
    HASHABLE

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
        deferred
        ensure
            good_hash_value: Result >= 0
        end

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := (Current /= default)
        ensure
            ok_if_not_default: Result implies (Current /= default)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASHABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Values that may be hashed into an integer index,
        for use as keys in hash tables
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    HASHABLE

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure
            good_hash_value: Result >= 0

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure
            ok_if_not_default: Result implies (Current /= default)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASHABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    HASHABLE

Ancestors
    ANY

Descendants
    BOOLEAN_REF
    CHARACTER_REF
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    POINTER_REF
    REAL_REF
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    STRING
    WIDE_CHARACTER_REF

Clients
    HASH_TABLE [G, H -> HASHABLE]
    HASHABLE
    SUBSET_STRATEGY_HASHABLE [G]

Suppliers
    BOOLEAN
    HASHABLE
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASHABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Values that may be hashed into an integer index,
        for use as keys in hash tables
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    HASHABLE

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure
            good_hash_value: Result >= 0

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure
            ok_if_not_default: Result implies (Current /= default)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER

inherit
    INTEGER_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16 Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER_16

inherit
    INTEGER_16_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16 Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER_16

General
    cluster: base.kernel
    description: "Integer values coded on 16 bits"

Ancestors
    INTEGER_16_REF

Queries
    infix "&" (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "//" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix ">=" (other: [like Current] INTEGER_16): BOOLEAN
    infix ">" (other: [like Current] INTEGER_16): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_16): BOOLEAN
    infix "<" (other: [like Current] INTEGER_16): BOOLEAN
    infix "-" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "\\" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "+" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_16): DOUBLE
    infix "*" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "|" (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_16
    infix "|>>" (n: INTEGER): [like Current] INTEGER_16
    prefix "-": [like Current] INTEGER_16
    prefix "+": [like Current] INTEGER_16
    abs: INTEGER_16
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    bit_not: [like Current] INTEGER_16
    bit_or (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    bit_shift (n: INTEGER): [like Current] INTEGER_16
    bit_shift_left (n: INTEGER): [like Current] INTEGER_16
    bit_shift_right (n: INTEGER): [like Current] INTEGER_16
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    divisible (other: INTEGER_16_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_16): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_16
    max (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    min (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    one: [like Current] INTEGER_16
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_16_REF): INTEGER
    to_integer: INTEGER
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_16

Commands
    set_item (i: INTEGER_16)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16 Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER_16

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_16_REF)
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from INTEGER_16_REF)
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER_16
            -- Integer value
            -- (from INTEGER_16_REF)

    one: like Current is
            -- Neutral element for "*" and "/"
            -- (from INTEGER_16_REF)
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_16_REF)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure -- from INTEGER_16_REF
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
            -- (from INTEGER_16_REF)
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_16_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_16_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_16_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
            -- (from INTEGER_16_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN is
            -- May current object be divided by other?
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then -- from INTEGER_16_REF
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then -- from INTEGER_16_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_16_REF)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER_16) is
            -- Make i the item value.
            -- (from INTEGER_16_REF)
        do
            item := i
        end

feature -- Conversion

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_16_REF)
        do
            Result := item.to_integer
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_16_REF)
        do
            Result := item.to_integer_64
        end

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

feature -- Basic operations

    abs: INTEGER_16 is
            -- Absolute value
            -- (from INTEGER_16_REF)
        do
            Result := abs_ref.item
        ensure -- from INTEGER_16_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure -- from INTEGER_16_REF
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
            -- (from INTEGER_16_REF)
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_16_REF)
        do
            create Result.make (item, other)
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_16_REF is
            -- Absolute value
            -- (from INTEGER_16_REF)
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure -- from INTEGER_16_REF
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER_16): CHARACTER is
            -- Character associated to integer value
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER_16): STRING is
            -- Printable representation of integer value
            -- (from INTEGER_16_REF)
        external
            "C (EIF_INTEGER): EIF_REFERENCE | %"eif_out.h%""
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_than_16: n < 16
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.
            -- (from INTEGER_16_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise and between i and j.
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_16): INTEGER_16 is
            -- One's complement of i.
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise or between i and j.
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_16; n: INTEGER): INTEGER_16 is
            -- Shift i from n position to left.
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_16; n: INTEGER): INTEGER_16 is
            -- Shift i from n position to right.
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_16; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise xor between i and j.
            -- (from INTEGER_16_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
            -- (from INTEGER_16_REF)
        do
            Result := c_outi (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_16_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16 Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER_16

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_16_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_16_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_16
            -- Integer value
            -- (from INTEGER_16_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_16_REF)
        ensure -- from INTEGER_16_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_16_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_16_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_16_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_16_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_16_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_16_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_16_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_16)
            -- Make i the item value.
            -- (from INTEGER_16_REF)

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_16_REF)

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_16_REF)

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_16
            -- Absolute value
            -- (from INTEGER_16_REF)
        ensure -- from INTEGER_16_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_16_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_16_REF)

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_16_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.
            -- (from INTEGER_16_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_16_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.
            -- (from INTEGER_16_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_than_16: n < 16

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_16_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.
            -- (from INTEGER_16_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.
            -- (from INTEGER_16_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_16_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_16_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16 Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER_16

Ancestors
    INTEGER_16_REF

Clients
    INTEGER_16_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_16_REF

inherit
    NUMERIC
        rename
            infix "/" as infix "//"
        redefine
            out,
            is_equal
        end

    COMPARABLE
        redefine
            out,
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            out,
            is_equal
        end

feature -- Access

    item: INTEGER_16
            -- Integer value

    hash_code: INTEGER is
            -- Hash code value
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
        end

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        do
            Result := item < other.item
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: INTEGER_16_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Element change

    set_item (i: INTEGER_16) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN is
            -- May current object be divided by other?
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        end

feature -- Basic operations

    abs: INTEGER_16 is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        do
            create Result
            Result.set_item (item + other.item)
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        do
            create Result
            Result.set_item (item - other.item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        do
            create Result
            Result.set_item (item * other.item)
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        do
            create Result
            Result.set_item (item // other.item)
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
        do
            create Result.make (item, other)
        end

feature -- Conversion

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
        do
            Result := item.to_integer
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
        do
            Result := item.to_integer_64
        end

feature -- Bit operations

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_16: n < 16
        do
            Result := eif_bit_test (item, n)
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

feature {NONE} -- Implementation

    c_outi (i: INTEGER_16): STRING is
            -- Printable representation of integer value
        external
            "C (EIF_INTEGER): EIF_REFERENCE | %"eif_out.h%""
        end

    c_ascii_char (code: INTEGER_16): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    abs_ref: INTEGER_16_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_16): INTEGER_16 is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_16; n: INTEGER): INTEGER_16 is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_16; n: INTEGER): INTEGER_16 is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_16; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_16_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value coded on 16 bits"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "//" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix ">=" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "\\" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "+" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_16_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "|" (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_16_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_16_REF
    prefix "-": [like Current] INTEGER_16_REF
    prefix "+": [like Current] INTEGER_16_REF
    abs: INTEGER_16
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    bit_not: [like Current] INTEGER_16_REF
    bit_or (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_16_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_16_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_16_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    divisible (other: INTEGER_16_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_16_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_16
    max (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    min (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    one: [like Current] INTEGER_16_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_16_REF): INTEGER
    to_integer: INTEGER
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_16_REF

Commands
    set_item (i: INTEGER_16)

Constraints
    sign times abs

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_16_REF

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER_16
            -- Integer value

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_16_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN is
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER_16) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Conversion

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
        do
            Result := item.to_integer
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
        do
            Result := item.to_integer_64
        end

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

feature -- Basic operations

    abs: INTEGER_16 is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
        do
            create Result.make (item, other)
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_16_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER_16): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER_16): STRING is
            -- Printable representation of integer value
        external
            "C (EIF_INTEGER): EIF_REFERENCE | %"eif_out.h%""
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_16: n < 16
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_16): INTEGER_16 is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_16; n: INTEGER): INTEGER_16 is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_16; n: INTEGER): INTEGER_16 is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_16; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_16): INTEGER_16 is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_16_REF

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_16
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_16_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_16)
            -- Make i the item value.

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_16
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_16: n < 16

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_16_REF

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Descendants
    INTEGER_16

Clients
    INTEGER_16_REF

Suppliers
    BOOLEAN
    DOUBLE
    DOUBLE_REF
    INTEGER
    INTEGER_16
    INTEGER_16_REF
    INTEGER_INTERVAL
    INTEGER_REF
    NUMERIC
    REAL
    REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_16_REF

feature -- Access

    item: INTEGER_16
            -- Integer value

    hash_code: INTEGER
            -- Hash code value

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    one: like Current
            -- Neutral element for "*" and "/"

    zero: like Current
            -- Neutral element for "+" and "-"

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: INTEGER_16_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1

feature -- Element change

    set_item (i: INTEGER_16)
            -- Make i the item value.

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN
            -- May current object be divided by other?
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Basic operations

    abs: INTEGER_16
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "+" (other: like Current): like Current
            -- Sum with other

    infix "-" (other: like Current): like Current
            -- Result of subtracting other

    infix "*" (other: like Current): like Current
            -- Product by other

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    prefix "+": like Current
            -- Unary plus

    prefix "-": like Current
            -- Unary minus

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Conversion

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

feature -- Bit operations

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    bit_not: like Current
            -- One's complement of Current.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_16: n < 16

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_16 Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER_16

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64 Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER_64

inherit
    INTEGER_64_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64 Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER_64

General
    cluster: base.kernel
    description: "Integer values coded on 64 bits"

Ancestors
    INTEGER_64_REF

Queries
    infix "&" (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "//" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix ">=" (other: [like Current] INTEGER_64): BOOLEAN
    infix ">" (other: [like Current] INTEGER_64): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_64): BOOLEAN
    infix "<" (other: [like Current] INTEGER_64): BOOLEAN
    infix "-" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "\\" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "+" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_64): DOUBLE
    infix "*" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "|" (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "|<<" (n: INTEGER): [like Current] INTEGER_64
    infix "|>>" (n: INTEGER): [like Current] INTEGER_64
    prefix "-": [like Current] INTEGER_64
    prefix "+": [like Current] INTEGER_64
    abs: INTEGER_64
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    bit_not: [like Current] INTEGER_64
    bit_or (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    bit_shift (n: INTEGER): [like Current] INTEGER_64
    bit_shift_left (n: INTEGER): [like Current] INTEGER_64
    bit_shift_right (n: INTEGER): [like Current] INTEGER_64
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    divisible (other: INTEGER_64_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_64): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_64
    max (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    min (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    one: [like Current] INTEGER_64
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_64_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_64

Commands
    set_item (i: INTEGER_64)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64 Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER_64

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_64_REF)
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from INTEGER_64_REF)
        do
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER_64
            -- Integer value
            -- (from INTEGER_64_REF)

    one: like Current is
            -- Neutral element for "*" and "/"
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (1)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_64_REF)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure -- from INTEGER_64_REF
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_64_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_64_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_64_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
            -- (from INTEGER_64_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN is
            -- May current object be divided by other?
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then -- from INTEGER_64_REF
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then -- from INTEGER_64_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_64_REF)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER_64) is
            -- Make i the item value.
            -- (from INTEGER_64_REF)
        do
            item := i
        end

feature -- Conversion

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647
        do
            Result := item.to_integer
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - 32768
            not_too_big: item <= 32767
        do
            Result := item.to_integer_16
        end

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

feature -- Basic operations

    abs: INTEGER_64 is
            -- Absolute value
            -- (from INTEGER_64_REF)
        do
            Result := abs_ref.item
        ensure -- from INTEGER_64_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure -- from INTEGER_64_REF
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
            -- (from INTEGER_64_REF)
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_64_REF is
            -- Absolute value
            -- (from INTEGER_64_REF)
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure -- from INTEGER_64_REF
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER_64): CHARACTER is
            -- Character associated to integer value
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER_64): STRING is
            -- Printable representation of integer value
            -- (from INTEGER_64_REF)
        external
            "C | %"eif_out.h%""
        alias
            "c_outi64"
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_than_64: n < 64
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.
            -- (from INTEGER_64_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise and between i and j.
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_64): INTEGER_64 is
            -- One's complement of i.
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise or between i and j.
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_64; n: INTEGER): INTEGER_64 is
            -- Shift i from n position to left.
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_64; n: INTEGER): INTEGER_64 is
            -- Shift i from n position to right.
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_64; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise xor between i and j.
            -- (from INTEGER_64_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
            -- (from INTEGER_64_REF)
        do
            Result := c_outi (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_64_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64 Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER_64

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_64_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_64_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_64
            -- Integer value
            -- (from INTEGER_64_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_64_REF)
        ensure -- from INTEGER_64_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_64_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_64_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_64_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_64_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_64_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_64_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_64_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_64)
            -- Make i the item value.
            -- (from INTEGER_64_REF)

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_64
            -- Absolute value
            -- (from INTEGER_64_REF)
        ensure -- from INTEGER_64_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_64_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_64_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.
            -- (from INTEGER_64_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_64_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.
            -- (from INTEGER_64_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_than_64: n < 64

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_64_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.
            -- (from INTEGER_64_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.
            -- (from INTEGER_64_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_64_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_64_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64 Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER_64

Ancestors
    INTEGER_64_REF

Clients
    INTEGER_64_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_64_REF

inherit
    NUMERIC
        rename
            infix "/" as infix "//"
        redefine
            out,
            is_equal
        end

    COMPARABLE
        redefine
            out,
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            out,
            is_equal
        end

feature -- Access

    item: INTEGER_64
            -- Integer value

    hash_code: INTEGER is
            -- Hash code value
        do
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0)
        end

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        do
            Result := item < other.item
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: INTEGER_64_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Element change

    set_item (i: INTEGER_64) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN is
            -- May current object be divided by other?
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        end

feature -- Basic operations

    abs: INTEGER_64 is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        do
            create Result
            Result.set_item (item + other.item)
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        do
            create Result
            Result.set_item (item - other.item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        do
            create Result
            Result.set_item (item * other.item)
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        do
            create Result
            Result.set_item (item // other.item)
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

feature -- Conversion

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767
        do
            Result := item.to_integer_16
        end

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
        require
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647
        do
            Result := item.to_integer
        end

feature -- Bit operations

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_64: n < 64
        do
            Result := eif_bit_test (item, n)
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

feature {NONE} -- Implementation

    c_outi (i: INTEGER_64): STRING is
            -- Printable representation of integer value
        external
            "C | %"eif_out.h%""
        alias
            "c_outi64"
        end

    c_ascii_char (code: INTEGER_64): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    abs_ref: INTEGER_64_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_64): INTEGER_64 is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_64; n: INTEGER): INTEGER_64 is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_64; n: INTEGER): INTEGER_64 is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_64; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_64_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value coded on 64 bits"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "//" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix ">=" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "\\" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "+" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_64_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "|" (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "|<<" (n: INTEGER): [like Current] INTEGER_64_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_64_REF
    prefix "-": [like Current] INTEGER_64_REF
    prefix "+": [like Current] INTEGER_64_REF
    abs: INTEGER_64
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    bit_not: [like Current] INTEGER_64_REF
    bit_or (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_64_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_64_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_64_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    divisible (other: INTEGER_64_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_64_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_64
    max (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    min (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    one: [like Current] INTEGER_64_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_64_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_64_REF

Commands
    set_item (i: INTEGER_64)

Constraints
    sign times abs

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:27 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_64_REF

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER_64
            -- Integer value

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_64_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN is
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER_64) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Conversion

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
        require
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647
        do
            Result := item.to_integer
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767
        do
            Result := item.to_integer_16
        end

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

feature -- Basic operations

    abs: INTEGER_64 is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_64_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER_64): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER_64): STRING is
            -- Printable representation of integer value
        external
            "C | %"eif_out.h%""
        alias
            "c_outi64"
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_64: n < 64
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_64): INTEGER_64 is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_64; n: INTEGER): INTEGER_64 is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_64; n: INTEGER): INTEGER_64 is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_64; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_64): INTEGER_64 is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_64_REF

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_64
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_64_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_64)
            -- Make i the item value.

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
        require
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_64
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_64: n < 64

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_64_REF

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Descendants
    INTEGER_64

Clients
    INTEGER_64_REF

Suppliers
    BOOLEAN
    DOUBLE
    DOUBLE_REF
    INTEGER
    INTEGER_64
    INTEGER_64_REF
    INTEGER_REF
    NUMERIC
    REAL
    REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_64_REF

feature -- Access

    item: INTEGER_64
            -- Integer value

    hash_code: INTEGER
            -- Hash code value

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    one: like Current
            -- Neutral element for "*" and "/"

    zero: like Current
            -- Neutral element for "+" and "-"

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: INTEGER_64_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1

feature -- Element change

    set_item (i: INTEGER_64)
            -- Make i the item value.

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN
            -- May current object be divided by other?
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Basic operations

    abs: INTEGER_64
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "+" (other: like Current): like Current
            -- Sum with other

    infix "-" (other: like Current): like Current
            -- Result of subtracting other

    infix "*" (other: like Current): like Current
            -- Product by other

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    prefix "+": like Current
            -- Unary plus

    prefix "-": like Current
            -- Unary minus

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

feature -- Conversion

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
        require
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647

feature -- Bit operations

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    bit_not: like Current
            -- One's complement of Current.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_64: n < 64

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_64 Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER_64

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8 Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER_8

inherit
    INTEGER_8_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8 Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER_8

General
    cluster: base.kernel
    description: "Integer values coded on 8 bits"

Ancestors
    INTEGER_8_REF

Queries
    infix "&" (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "//" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix ">=" (other: [like Current] INTEGER_8): BOOLEAN
    infix ">" (other: [like Current] INTEGER_8): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_8): BOOLEAN
    infix "<" (other: [like Current] INTEGER_8): BOOLEAN
    infix "-" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "\\" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "+" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_8): DOUBLE
    infix "*" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "|" (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_8
    infix "|>>" (n: INTEGER): [like Current] INTEGER_8
    prefix "-": [like Current] INTEGER_8
    prefix "+": [like Current] INTEGER_8
    abs: INTEGER_8
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    bit_not: [like Current] INTEGER_8
    bit_or (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    bit_shift (n: INTEGER): [like Current] INTEGER_8
    bit_shift_left (n: INTEGER): [like Current] INTEGER_8
    bit_shift_right (n: INTEGER): [like Current] INTEGER_8
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    divisible (other: INTEGER_8_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_8): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_8
    max (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    min (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    one: [like Current] INTEGER_8
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_8_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    zero: [like Current] INTEGER_8

Commands
    set_item (i: INTEGER_8)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8 Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER_8

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_8_REF)
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from INTEGER_8_REF)
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER_8
            -- Integer value
            -- (from INTEGER_8_REF)

    one: like Current is
            -- Neutral element for "*" and "/"
            -- (from INTEGER_8_REF)
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_8_REF)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure -- from INTEGER_8_REF
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
            -- (from INTEGER_8_REF)
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_8_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_8_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_8_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
            -- (from INTEGER_8_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN is
            -- May current object be divided by other?
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then -- from INTEGER_8_REF
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then -- from INTEGER_8_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_8_REF)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER_8) is
            -- Make i the item value.
            -- (from INTEGER_8_REF)
        do
            item := i
        end

feature -- Conversion

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_8_REF)
        do
            Result := item.to_integer
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_8_REF)
        do
            Result := item.to_integer_16
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_8_REF)
        do
            Result := item.to_integer_64
        end

feature -- Basic operations

    abs: INTEGER_8 is
            -- Absolute value
            -- (from INTEGER_8_REF)
        do
            Result := abs_ref.item
        ensure -- from INTEGER_8_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure -- from INTEGER_8_REF
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
            -- (from INTEGER_8_REF)
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_8_REF)
        do
            create Result.make (item, other)
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_8_REF is
            -- Absolute value
            -- (from INTEGER_8_REF)
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure -- from INTEGER_8_REF
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER_8): CHARACTER is
            -- Character associated to integer value
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER_8): STRING is
            -- Printable representation of integer value
            -- (from INTEGER_8_REF)
        external
            "C (EIF_INTEGER): EIF_REFERENCE | %"eif_out.h%""
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_than_8: n < 8
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.
            -- (from INTEGER_8_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise and between i and j.
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_8): INTEGER_8 is
            -- One's complement of i.
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise or between i and j.
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_8; n: INTEGER): INTEGER_8 is
            -- Shift i from n position to left.
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_8; n: INTEGER): INTEGER_8 is
            -- Shift i from n position to right.
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_8; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise xor between i and j.
            -- (from INTEGER_8_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
            -- (from INTEGER_8_REF)
        do
            Result := c_outi (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_8_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8 Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER_8

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_8_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_8_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_8
            -- Integer value
            -- (from INTEGER_8_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_8_REF)
        ensure -- from INTEGER_8_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_8_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_8_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_8_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_8_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_8_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_8_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_8_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_8)
            -- Make i the item value.
            -- (from INTEGER_8_REF)

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_8_REF)

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_8_REF)

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_8_REF)

feature -- Basic operations

    abs: INTEGER_8
            -- Absolute value
            -- (from INTEGER_8_REF)
        ensure -- from INTEGER_8_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_8_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_8_REF)

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_8_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.
            -- (from INTEGER_8_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_8_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.
            -- (from INTEGER_8_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_than_8: n < 8

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_8_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.
            -- (from INTEGER_8_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.
            -- (from INTEGER_8_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_8_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_8_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8 Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER_8

Ancestors
    INTEGER_8_REF

Clients
    INTEGER_8_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_8_REF

inherit
    NUMERIC
        rename
            infix "/" as infix "//"
        redefine
            out,
            is_equal
        end

    COMPARABLE
        redefine
            out,
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            out,
            is_equal
        end

feature -- Access

    item: INTEGER_8
            -- Integer value

    hash_code: INTEGER is
            -- Hash code value
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
        end

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        do
            Result := item < other.item
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: INTEGER_8_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Element change

    set_item (i: INTEGER_8) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN is
            -- May current object be divided by other?
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        end

feature -- Basic operations

    abs: INTEGER_8 is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        do
            create Result
            Result.set_item (item + other.item)
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        do
            create Result
            Result.set_item (item - other.item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        do
            create Result
            Result.set_item (item * other.item)
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        do
            create Result
            Result.set_item (item // other.item)
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
        do
            create Result.make (item, other)
        end

feature -- Conversion

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
        do
            Result := item.to_integer_16
        end

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
        do
            Result := item.to_integer
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
        do
            Result := item.to_integer_64
        end

feature -- Bit operations

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_8: n < 8
        do
            Result := eif_bit_test (item, n)
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

feature {NONE} -- Implementation

    c_outi (i: INTEGER_8): STRING is
            -- Printable representation of integer value
        external
            "C (EIF_INTEGER): EIF_REFERENCE | %"eif_out.h%""
        end

    c_ascii_char (code: INTEGER_8): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    abs_ref: INTEGER_8_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_8): INTEGER_8 is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_8; n: INTEGER): INTEGER_8 is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_8; n: INTEGER): INTEGER_8 is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_8; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_8_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value coded on 8 bits"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "//" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix ">=" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "\\" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "+" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_8_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "|" (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_8_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_8_REF
    prefix "-": [like Current] INTEGER_8_REF
    prefix "+": [like Current] INTEGER_8_REF
    abs: INTEGER_8
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    bit_not: [like Current] INTEGER_8_REF
    bit_or (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_8_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_8_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_8_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    divisible (other: INTEGER_8_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_8_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_8
    max (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    min (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    one: [like Current] INTEGER_8_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_8_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    zero: [like Current] INTEGER_8_REF

Commands
    set_item (i: INTEGER_8)

Constraints
    sign times abs

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_8_REF

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER_8
            -- Integer value

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_8_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN is
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER_8) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Conversion

    to_integer: INTEGER is
            -- Convert item into an INTEGER_32 value.
        do
            Result := item.to_integer
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
        do
            Result := item.to_integer_16
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
        do
            Result := item.to_integer_64
        end

feature -- Basic operations

    abs: INTEGER_8 is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
        do
            create Result.make (item, other)
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_8_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER_8): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER_8): STRING is
            -- Printable representation of integer value
        external
            "C (EIF_INTEGER): EIF_REFERENCE | %"eif_out.h%""
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_8: n < 8
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER_8): INTEGER_8 is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i: INTEGER_8; n: INTEGER): INTEGER_8 is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i: INTEGER_8; n: INTEGER): INTEGER_8 is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i: INTEGER_8; n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER_8): INTEGER_8 is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_8_REF

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_8
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_8_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_8)
            -- Make i the item value.

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

feature -- Basic operations

    abs: INTEGER_8
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_8: n < 8

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_8_REF

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Descendants
    INTEGER_8

Clients
    INTEGER_8_REF

Suppliers
    BOOLEAN
    DOUBLE
    DOUBLE_REF
    INTEGER
    INTEGER_8
    INTEGER_8_REF
    INTEGER_INTERVAL
    INTEGER_REF
    NUMERIC
    REAL
    REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_8_REF

feature -- Access

    item: INTEGER_8
            -- Integer value

    hash_code: INTEGER
            -- Hash code value

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    one: like Current
            -- Neutral element for "*" and "/"

    zero: like Current
            -- Neutral element for "+" and "-"

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: INTEGER_8_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1

feature -- Element change

    set_item (i: INTEGER_8)
            -- Make i the item value.

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN
            -- May current object be divided by other?
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Basic operations

    abs: INTEGER_8
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "+" (other: like Current): like Current
            -- Sum with other

    infix "-" (other: like Current): like Current
            -- Result of subtracting other

    infix "*" (other: like Current): like Current
            -- Product by other

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    prefix "+": like Current
            -- Unary plus

    prefix "-": like Current
            -- Unary minus

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Conversion

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

feature -- Bit operations

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    bit_not: like Current
            -- One's complement of Current.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_8: n < 8

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_8 Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER_8

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER

General
    cluster: base.kernel
    description: "Integer values"

Ancestors
    INTEGER_REF

Queries
    infix "&" (i: [like Current] INTEGER): [like Current] INTEGER
    infix "//" (other: [like Current] INTEGER): [like Current] INTEGER
    infix ">=" (other: [like Current] INTEGER): BOOLEAN
    infix ">" (other: [like Current] INTEGER): BOOLEAN
    infix "<=" (other: [like Current] INTEGER): BOOLEAN
    infix "<" (other: [like Current] INTEGER): BOOLEAN
    infix "-" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "\\" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "+" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER): DOUBLE
    infix "*" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "|" (i: [like Current] INTEGER): [like Current] INTEGER
    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER
    infix "|>>" (n: INTEGER): [like Current] INTEGER
    prefix "-": [like Current] INTEGER
    prefix "+": [like Current] INTEGER
    abs: INTEGER
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER): [like Current] INTEGER
    bit_not: [like Current] INTEGER
    bit_or (i: [like Current] INTEGER): [like Current] INTEGER
    bit_shift (n: INTEGER): [like Current] INTEGER
    bit_shift_left (n: INTEGER): [like Current] INTEGER
    bit_shift_right (n: INTEGER): [like Current] INTEGER
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER): [like Current] INTEGER
    divisible (other: INTEGER_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER
    max (other: [like Current] INTEGER): [like Current] INTEGER
    min (other: [like Current] INTEGER): [like Current] INTEGER
    one: [like Current] INTEGER
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_REF): INTEGER
    to_boolean: BOOLEAN
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER

Commands
    set_item (i: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class
    INTEGER

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_REF)
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from INTEGER_REF)
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER
            -- Integer value
            -- (from INTEGER_REF)

    one: like Current is
            -- Neutral element for "*" and "/"
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (1)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_REF)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure -- from INTEGER_REF
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
            -- (from INTEGER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN is
            -- May current object be divided by other?
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then -- from INTEGER_REF
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then -- from INTEGER_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_REF)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER) is
            -- Make i the item value.
            -- (from INTEGER_REF)
        do
            item := i
        end

feature -- Conversion

    to_boolean: BOOLEAN is
            -- True if not zero.
            -- (from INTEGER_REF)
        do
            Result := item /= 0
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            not_too_small: item >= - 32768
            not_too_big: item <= 32767
        do
            Result := item.to_integer_16
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_REF)
        do
            Result := item.to_integer_64
        end

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

feature -- Basic operations

    abs: INTEGER is
            -- Absolute value
            -- (from INTEGER_REF)
        do
            Result := abs_ref.item
        ensure -- from INTEGER_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure -- from INTEGER_REF
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
            -- (from INTEGER_REF)
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_REF)
        do
            create Result.make (item, other)
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_REF is
            -- Absolute value
            -- (from INTEGER_REF)
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure -- from INTEGER_REF
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER): CHARACTER is
            -- Character associated to integer value
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER): STRING is
            -- Printable representation of integer value
            -- (from INTEGER_REF)
        external
            "C | %"eif_out.h%""
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_than_32: n < 32
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.
            -- (from INTEGER_REF)
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER): INTEGER is
            -- Bitwise and between i and j.
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER): INTEGER is
            -- One's complement of i.
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER): INTEGER is
            -- Bitwise or between i and j.
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i, n: INTEGER): INTEGER is
            -- Shift i from n position to left.
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i, n: INTEGER): INTEGER is
            -- Shift i from n position to right.
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i, n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER): INTEGER is
            -- Bitwise xor between i and j.
            -- (from INTEGER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
            -- (from INTEGER_REF)
        do
            Result := c_outi (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER
            -- Integer value
            -- (from INTEGER_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_REF)
        ensure -- from INTEGER_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER)
            -- Make i the item value.
            -- (from INTEGER_REF)

feature -- Conversion

    to_boolean: BOOLEAN
            -- True if not zero.
            -- (from INTEGER_REF)

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_REF)

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER
            -- Absolute value
            -- (from INTEGER_REF)
        ensure -- from INTEGER_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_REF)

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.
            -- (from INTEGER_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.
            -- (from INTEGER_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_than_32: n < 32

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.
            -- (from INTEGER_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.
            -- (from INTEGER_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_INTERVAL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Contiguous integer intervals"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_INTERVAL

inherit
    RESIZABLE [INTEGER]
        undefine
            changeable_comparison_criterion
        redefine
            copy,
            is_equal
        end

    INDEXABLE [INTEGER, INTEGER]
        rename
            put as indexable_put
        undefine
            changeable_comparison_criterion
        redefine
            copy,
            is_equal
        select
            bag_put
        end

    SET [INTEGER]
        redefine
            copy,
            is_equal
        end

create
    make

feature {NONE} -- Initialization

    make (min_index, max_index: INTEGER) is
            -- Set up interval to have bounds min_index and
            -- max_index (empty if min_index > max_index)
        do
            lower_defined := True
            upper_defined := True
            if min_index <= max_index then
                lower_internal := min_index
                upper_internal := max_index
            else
                lower_internal := 1
                upper_internal := 0
            end
        ensure
            lower_defined: lower_defined
            upper_defined: upper_defined
            set_if_non_empty: (min_index <= max_index) implies ((lower = min_index) and (upper = max_index))
            empty_if_not_in_order: (min_index > max_index) implies is_empty
        end

feature -- Initialization

    adapt (other: INTEGER_INTERVAL) is
            -- Reset to be the same interval as other.
        require
            other_not_void: other /= void
        do
            lower_internal := other.lower_internal
            upper_internal := other.upper_internal
            lower_defined := other.lower_defined
            upper_defined := other.upper_defined
        ensure
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined
        end

feature -- Access

    lower_defined: BOOLEAN
            -- Is there a lower bound?

    lower: INTEGER is
            -- Smallest value in interval
        require
            lower_defined: lower_defined
        do
            Result := lower_internal
        end

    upper_defined: BOOLEAN
            -- Is there an upper bound?

    upper: INTEGER is
            -- Largest value in interval
        require
            upper_defined: upper_defined
        do
            Result := upper_internal
        end

    item (i: INTEGER): INTEGER is
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.
        do
            Result := i
        end

    infix "@" (i: INTEGER): INTEGER is
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.
        do
            Result := i
        end

    has (v: INTEGER): BOOLEAN is
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
        do
            Result := (upper_defined implies v <= upper) and (lower_defined implies v >= lower)
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))
        end

    valid_index (v: INTEGER): BOOLEAN is
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
        do
            Result := (upper_defined implies v <= upper) and (lower_defined implies v >= lower)
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))
        end

feature -- Measurement

    occurrences (v: INTEGER): INTEGER is
            -- Number of times v appears in structure
        do
            if has (v) then
                Result := 1
            end
        ensure then
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0
        end

    capacity: INTEGER is
            -- Maximum number of items in interval
            -- (here the same thing as count)
        do
            check
                terminal: upper_defined and lower_defined
            end
            Result := count
        end

    count: INTEGER is
            -- Number of items in interval
        do
            check
                finite: upper_defined and lower_defined
            end
            if upper_defined and lower_defined then
                Result := upper - lower + 1
            end
        ensure then
            definition: Result = upper - lower + 1
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (here: the interval itself)
        do
            Result := Current
        ensure then
            index_set_is_range: equal (Result, Current)
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
        do
            Result := (lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper))
        ensure then
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))
        end

feature -- Status report

    all_cleared: BOOLEAN is
            -- Are all items set to default values?
        do
            Result := ((lower = 0) and (upper = 0))
        ensure then
            iff_at_zero: Result = ((lower = 0) and (upper = 0))
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- Answer: yes
        do
            Result := True
        end

    prunable: BOOLEAN is
            -- May individual items be removed?
            -- Answer: no
        do
            Result := False
        end

feature -- Element change

    extend (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of put.
        do
            if v < lower then
                lower_internal := v
            elseif v > upper then
                upper_internal := v
            end
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)
        end

    put (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of extend.
        do
            if v < lower then
                lower_internal := v
            elseif v > upper then
                upper_internal := v
            end
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)
        end

feature -- Resizing

    resize (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.
        do
            lower_internal := min_index.min (lower)
            upper_internal := max_index.max (upper)
        end

    resize_exactly (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from
            -- min_index to max_index.
        do
            lower_internal := min_index
            upper_internal := max_index
        end

    grow (i: INTEGER) is
            -- Ensure that capacity is at least i.
        do
            if capacity < i then
                resize (lower, lower + i - 1)
            end
        ensure then
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper
        end

feature -- Removal

    wipe_out is
            -- Remove all items.
        do
            lower_defined := True
            upper_defined := True
            lower_internal := 1
            upper_internal := 0
        end

feature -- Conversion

    as_array: ARRAY [INTEGER] is
            -- Plain array containing interval's items
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            create Result.make (lower, upper)
            from
                i := lower
            until
                i > upper
            loop
                Result.put (i, i)
                i := i + 1
            end
        ensure
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper
        end

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
        require
            finite: upper_defined and lower_defined
        do
            Result := as_array.to_c
        end

    linear_representation: LINEAR [INTEGER] is
            -- Representation as a linear structure
        do
            check
                terminal: upper_defined and lower_defined
            end
            Result := as_array.linear_representation
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reset to be the same interval as other.
        do
            lower_internal := other.lower_internal
            upper_internal := other.upper_internal
            lower_defined := other.lower_defined
            upper_defined := other.upper_defined
        ensure then
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined
        end

    subinterval (start_pos, end_pos: INTEGER): like Current is
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.
        do
            create Result.make (start_pos, end_pos)
        end

feature -- Iteration

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Do all interval's values satisfy condition?
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                Result := True
                i := lower
            until
                (i > upper) or else (not condition.item ([i]))
            loop
                i := i + 1
            end
            Result := (i > upper)
        ensure
            consistent_with_count: Result = (hold_count (condition) = count)
        end

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Does at least one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                i := lower
            until
                i > upper or else condition.item ([i])
            loop
                i := i + 1
            end
            Result := (i <= upper)
        ensure
            consistent_with_count: Result = (hold_count (condition) > 0)
        end

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Does exactly one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        do
            Result := (hold_count (condition) = 1)
        ensure
            consistent_with_count: Result = (hold_count (condition) = 1)
        end

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER is
            -- Number of  interval's values that
            -- satisfy condition
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                i := lower
            until
                i > upper
            loop
                if condition.item ([i]) then
                    Result := Result + 1
                end
                i := i + 1
            end
        ensure
            non_negative: Result >= 0
        end

feature {INTEGER_INTERVAL} -- Implementation

    upper_internal: INTEGER
            -- See `upper`.

    lower_internal: INTEGER
            -- See `lower`.

feature {NONE} -- Inapplicable

    prune (v: INTEGER) is
            -- Remove one occurrence of v if any.
            -- Not applicable here.
        do
        end

    indexable_put (v: INTEGER; k: INTEGER) is
            -- Associate value v with key k.
            -- Not applicable here.
        do
        end

invariant

    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_INTERVAL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_INTERVAL

General
    cluster: base.kernel
    description: "Contiguous integer intervals"
    create: make

Ancestors
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    SET [G]

Queries
    infix "@" (i: INTEGER): INTEGER
    additional_space: INTEGER
    all_cleared: BOOLEAN
    as_array: ARRAY [INTEGER]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    extendible: BOOLEAN
    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: INTEGER): BOOLEAN
    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] INTEGER_INTERVAL): BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item (i: INTEGER): INTEGER
    linear_representation: LINEAR [INTEGER]
    lower: INTEGER
    lower_defined: BOOLEAN
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    subinterval (start_pos, end_pos: INTEGER): [like Current] INTEGER_INTERVAL
    to_c: ANY
    upper: INTEGER
    upper_defined: BOOLEAN
    valid_index (v: INTEGER): BOOLEAN

Commands
    adapt (other: INTEGER_INTERVAL)
    automatic_grow
    compare_objects
    compare_references
    copy (other: [like Current] INTEGER_INTERVAL)
    extend (v: INTEGER)
    fill (other: CONTAINER [INTEGER])
    grow (i: INTEGER)
    prune_all (v: INTEGER)
    put (v: INTEGER)
    resize (min_index, max_index: INTEGER)
    resize_exactly (min_index, max_index: INTEGER)
    wipe_out

Constraints
    count definition
    index set is range
    not infinite

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_INTERVAL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Contiguous integer intervals"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_INTERVAL

create
    make

feature {NONE} -- Initialization

    make (min_index, max_index: INTEGER) is
            -- Set up interval to have bounds min_index and
            -- max_index (empty if min_index > max_index)
        do
            lower_defined := True
            upper_defined := True
            if min_index <= max_index then
                lower_internal := min_index
                upper_internal := max_index
            else
                lower_internal := 1
                upper_internal := 0
            end
        ensure
            lower_defined: lower_defined
            upper_defined: upper_defined
            set_if_non_empty: (min_index <= max_index) implies ((lower = min_index) and (upper = max_index))
            empty_if_not_in_order: (min_index > max_index) implies is_empty
        end

feature -- Initialization

    adapt (other: INTEGER_INTERVAL) is
            -- Reset to be the same interval as other.
        require
            other_not_void: other /= void
        do
            lower_internal := other.lower_internal
            upper_internal := other.upper_internal
            lower_defined := other.lower_defined
            upper_defined := other.upper_defined
        ensure
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined
        end

feature -- Access

    has (v: INTEGER): BOOLEAN is
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
        do
            Result := (upper_defined implies v <= upper) and (lower_defined implies v >= lower)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))
        end

    item (i: INTEGER): INTEGER is
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := i
        end

    lower: INTEGER is
            -- Smallest value in interval
        require
            lower_defined: lower_defined
        do
            Result := lower_internal
        end

    lower_defined: BOOLEAN
            -- Is there a lower bound?

    upper: INTEGER is
            -- Largest value in interval
        require
            upper_defined: upper_defined
        do
            Result := upper_internal
        end

    upper_defined: BOOLEAN
            -- Is there an upper bound?

    valid_index (v: INTEGER): BOOLEAN is
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
        do
            Result := (upper_defined implies v <= upper) and (lower_defined implies v >= lower)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))
        end

    infix "@" (i: INTEGER): INTEGER is
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := i
        end

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Maximum number of items in interval
            -- (here the same thing as count)
        do
            check
                terminal: upper_defined and lower_defined
            end
            Result := count
        end

    count: INTEGER is
            -- Number of items in interval
        do
            check
                finite: upper_defined and lower_defined
            end
            if upper_defined and lower_defined then
                Result := upper - lower + 1
            end
        ensure then
            definition: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (here: the interval itself)
        do
            Result := Current
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            index_set_is_range: equal (Result, Current)
        end

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: INTEGER): INTEGER is
            -- Number of times v appears in structure
        do
            if has (v) then
                Result := 1
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        ensure then
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := (lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper))
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))
        end

feature -- Status report

    all_cleared: BOOLEAN is
            -- Are all items set to default values?
        do
            Result := ((lower = 0) and (upper = 0))
        ensure then
            iff_at_zero: Result = ((lower = 0) and (upper = 0))
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- Answer: yes
        do
            Result := True
        end

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: INTEGER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May individual items be removed?
            -- Answer: no
        do
            Result := False
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        do
            if v < lower then
                lower_internal := v
            elseif v > upper then
                upper_internal := v
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)
        end

    fill (other: CONTAINER [INTEGER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [INTEGER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: INTEGER) is
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        do
            if v < lower then
                lower_internal := v
            elseif v > upper then
                upper_internal := v
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune_all (v: INTEGER) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            lower_defined := True
            upper_defined := True
            lower_internal := 1
            upper_internal := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Ensure that capacity is at least i.
        do
            if capacity < i then
                resize (lower, lower + i - 1)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        ensure then
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.
        do
            lower_internal := min_index.min (lower)
            upper_internal := max_index.max (upper)
        end

    resize_exactly (min_index, max_index: INTEGER) is
            -- Rearrange interval to go from
            -- min_index to max_index.
        do
            lower_internal := min_index
            upper_internal := max_index
        end

feature -- Conversion

    as_array: ARRAY [INTEGER] is
            -- Plain array containing interval's items
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            create Result.make (lower, upper)
            from
                i := lower
            until
                i > upper
            loop
                Result.put (i, i)
                i := i + 1
            end
        ensure
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper
        end

    linear_representation: LINEAR [INTEGER] is
            -- Representation as a linear structure
        do
            check
                terminal: upper_defined and lower_defined
            end
            Result := as_array.linear_representation
        end

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
        require
            finite: upper_defined and lower_defined
        do
            Result := as_array.to_c
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reset to be the same interval as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            lower_internal := other.lower_internal
            upper_internal := other.upper_internal
            lower_defined := other.lower_defined
            upper_defined := other.upper_defined
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined
        end

    subinterval (start_pos, end_pos: INTEGER): like Current is
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.
        do
            create Result.make (start_pos, end_pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: INTEGER) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    indexable_put (v: INTEGER; k: INTEGER) is
            -- Associate value v with key k.
            -- Not applicable here.
        require -- from TABLE
            valid_key: valid_index (k)
        do
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    prune (v: INTEGER) is
            -- Remove one occurrence of v if any.
            -- Not applicable here.
        require -- from COLLECTION
            prunable: prunable
        do
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

feature {INTEGER_INTERVAL} -- Implementation

    lower_internal: INTEGER
            -- See `lower`.

    upper_internal: INTEGER
            -- See `upper`.

feature -- Iteration

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Does at least one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                i := lower
            until
                i > upper or else condition.item ([i])
            loop
                i := i + 1
            end
            Result := (i <= upper)
        ensure
            consistent_with_count: Result = (hold_count (condition) > 0)
        end

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Does exactly one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        do
            Result := (hold_count (condition) = 1)
        ensure
            consistent_with_count: Result = (hold_count (condition) = 1)
        end

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Do all interval's values satisfy condition?
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                Result := True
                i := lower
            until
                (i > upper) or else (not condition.item ([i]))
            loop
                i := i + 1
            end
            Result := (i > upper)
        ensure
            consistent_with_count: Result = (hold_count (condition) = count)
        end

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER is
            -- Number of  interval's values that
            -- satisfy condition
        require
            finite: upper_defined and lower_defined
        local
            i: INTEGER
        do
            from
                i := lower
            until
                i > upper
            loop
                if condition.item ([i]) then
                    Result := Result + 1
                end
                i := i + 1
            end
        ensure
            non_negative: Result >= 0
        end

invariant

    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_INTERVAL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Contiguous integer intervals"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_INTERVAL

create

    make (min_index, max_index: INTEGER)
            -- Set up interval to have bounds min_index and
            -- max_index (empty if min_index > max_index)
        ensure
            lower_defined: lower_defined
            upper_defined: upper_defined
            set_if_non_empty: (min_index <= max_index) implies ((lower = min_index) and (upper = max_index))
            empty_if_not_in_order: (min_index > max_index) implies is_empty

feature -- Initialization

    adapt (other: INTEGER_INTERVAL)
            -- Reset to be the same interval as other.
        require
            other_not_void: other /= void
        ensure
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

feature -- Access

    has (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    item (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    lower: INTEGER
            -- Smallest value in interval
        require
            lower_defined: lower_defined

    lower_defined: BOOLEAN
            -- Is there a lower bound?

    upper: INTEGER
            -- Largest value in interval
        require
            upper_defined: upper_defined

    upper_defined: BOOLEAN
            -- Is there an upper bound?

    valid_index (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    infix "@" (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Maximum number of items in interval
            -- (here the same thing as count)

    count: INTEGER
            -- Number of items in interval
        ensure then
            definition: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (here: the interval itself)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            index_set_is_range: equal (Result, Current)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears in structure
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        ensure then
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))

feature -- Status report

    all_cleared: BOOLEAN
            -- Are all items set to default values?
        ensure then
            iff_at_zero: Result = ((lower = 0) and (upper = 0))

    extendible: BOOLEAN
            -- May new items be added?
            -- Answer: yes

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May individual items be removed?
            -- Answer: no

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

    fill (other: CONTAINER [INTEGER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune_all (v: INTEGER)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        ensure then
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper

    resize (min_index, max_index: INTEGER)
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.

    resize_exactly (min_index, max_index: INTEGER)
            -- Rearrange interval to go from
            -- min_index to max_index.

feature -- Conversion

    as_array: ARRAY [INTEGER]
            -- Plain array containing interval's items
        require
            finite: upper_defined and lower_defined
        ensure
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper

    linear_representation: LINEAR [INTEGER]
            -- Representation as a linear structure

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
        require
            finite: upper_defined and lower_defined

feature -- Duplication

    copy (other: like Current)
            -- Reset to be the same interval as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

    subinterval (start_pos, end_pos: INTEGER): like Current
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.

feature -- Iteration

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does at least one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) > 0)

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does exactly one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) = 1)

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Do all interval's values satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) = count)

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
            -- Number of  interval's values that
            -- satisfy condition
        require
            finite: upper_defined and lower_defined
        ensure
            non_negative: Result >= 0

invariant

    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_INTERVAL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_INTERVAL

Ancestors
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    SET [G]

Descendants
    ACTIVE_INTEGER_INTERVAL

Clients
    ACTIVE_INTEGER_INTERVAL
    ARRAY [G]
    ARRAYED_QUEUE [G]
    CHAIN [G]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    INDEXABLE [G, H -> INTEGER]
    INTEGER_16_REF
    INTEGER_8_REF
    INTEGER_INTERVAL
    INTEGER_REF
    STRING

Suppliers
    ARRAY [G]
    BOOLEAN
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    INTEGER
    INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_INTERVAL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Contiguous integer intervals"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_INTERVAL

create
    make

feature -- Initialization

    adapt (other: INTEGER_INTERVAL)
            -- Reset to be the same interval as other.
        require
            other_not_void: other /= void
        ensure
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

feature -- Access

    lower_defined: BOOLEAN
            -- Is there a lower bound?

    lower: INTEGER
            -- Smallest value in interval
        require
            lower_defined: lower_defined

    upper_defined: BOOLEAN
            -- Is there an upper bound?

    upper: INTEGER
            -- Largest value in interval
        require
            upper_defined: upper_defined

    item (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.

    infix "@" (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.

    has (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    valid_index (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

feature -- Measurement

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears in structure
        ensure then
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0

    capacity: INTEGER
            -- Maximum number of items in interval
            -- (here the same thing as count)

    count: INTEGER
            -- Number of items in interval
        ensure then
            definition: Result = upper - lower + 1

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (here: the interval itself)
        ensure then
            index_set_is_range: equal (Result, Current)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
        ensure then
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))

feature -- Status report

    all_cleared: BOOLEAN
            -- Are all items set to default values?
        ensure then
            iff_at_zero: Result = ((lower = 0) and (upper = 0))

    extendible: BOOLEAN
            -- May new items be added?
            -- Answer: yes

    prunable: BOOLEAN
            -- May individual items be removed?
            -- Answer: no

feature -- Element change

    extend (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of put.
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

    put (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of extend.
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

feature -- Resizing

    resize (min_index, max_index: INTEGER)
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.

    resize_exactly (min_index, max_index: INTEGER)
            -- Rearrange interval to go from
            -- min_index to max_index.

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
        ensure then
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper

feature -- Removal

    wipe_out
            -- Remove all items.

feature -- Conversion

    as_array: ARRAY [INTEGER]
            -- Plain array containing interval's items
        require
            finite: upper_defined and lower_defined
        ensure
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
        require
            finite: upper_defined and lower_defined

    linear_representation: LINEAR [INTEGER]
            -- Representation as a linear structure

feature -- Duplication

    copy (other: like Current)
            -- Reset to be the same interval as other.
        ensure then
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

    subinterval (start_pos, end_pos: INTEGER): like Current
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.

feature -- Iteration

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Do all interval's values satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) = count)

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does at least one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) > 0)

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does exactly one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) = 1)

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
            -- Number of  interval's values that
            -- satisfy condition
        require
            finite: upper_defined and lower_defined
        ensure
            non_negative: Result >= 0

invariant

    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    INTEGER

Ancestors
    INTEGER_REF

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ARGUMENTS
    ARRAY [G]
    ARRAY2 [G]
    ARRAYED_CIRCULAR [G]
    ARRAYED_LIST [G]
    ARRAYED_QUEUE [G]
    ARRAYED_STACK [G]
    ARRAYED_TREE [G]
    BAG [G]
    BASIC_ROUTINES
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BINARY_TREE [G]
    BIT_REF
    BOOL_STRING
    BOUNDED [G]
    BOUNDED_QUEUE [G]
    BOUNDED_STACK [G]
    CHAIN [G]
    CHARACTER_REF
    CIRCULAR [G]
    COMPACT_CURSOR_TREE [G]
    COMPARABLE
    CONSOLE
    COUNTABLE [G]
    COUNTABLE_SEQUENCE [G]
    CURSOR_TREE [G]
    DIRECTORY
    DLL_32_ROUTINE
    DOUBLE_REF
    DYNAMIC_CHAIN [G]
    DYNAMIC_CIRCULAR [G]
    DYNAMIC_TREE [G]
    EXECUTION_ENVIRONMENT
    FIBONACCI
    FILE
    FILE_NAME
    FINITE [G]
    FIXED_LIST [G]
    FIXED_TREE [G]
    FORMAT_DOUBLE
    FORMAT_INTEGER
    HASH_TABLE [G, H -> HASHABLE]
    HASHABLE
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    HIERARCHICAL [G]
    IDENTIFIED_CONTROLLER
    INDEXABLE [G, H -> INTEGER]
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_INTERVAL
    INTEGER_REF
    INTERACTIVE_LIST [G]
    INTERNAL
    LINEAR [G]
    LINEAR_ITERATOR [G]
    LINEAR_SUBSET [G]
    LINKED_CIRCULAR [G]
    LINKED_LIST [G]
    LINKED_STACK [G]
    LINKED_TREE [G]
    LIST [G]
    MEM_INFO
    MEMORY
    MULTI_ARRAY_LIST [G]
    PART_SORTED_SET [G -> PART_COMPARABLE]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
    PATH_NAME
    POINTER_REF
    PRIMES
    PROFILING_SETTING
    RANDOM
    REAL_REF
    RECURSIVE_CURSOR_TREE [G]
    RESIZABLE [G]
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    SEQ_STRING
    SEQUENCE [G]
    SET [G]
    SHARED_LIBRARY_ROUTINE
    SORTED_LIST [G -> COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
    SPECIAL [T]
    STRING
    SUBSET [G]
    SUBSET_STRATEGY_HASHABLE [G]
    TO_SPECIAL [T]
    TRAVERSABLE_SUBSET [G]
    TREE [G]
    TUPLE
    TWO_WAY_LIST [G]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]
    TWO_WAY_TREE [G]
    WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_REF

inherit
    NUMERIC
        rename
            infix "/" as infix "//"
        redefine
            out,
            is_equal
        end

    COMPARABLE
        redefine
            out,
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            out,
            is_equal
        end

feature -- Access

    item: INTEGER
            -- Integer value

    hash_code: INTEGER is
            -- Hash code value
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0)
        end

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        do
            Result := item < other.item
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: INTEGER_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Element change

    set_item (i: INTEGER) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN is
            -- May current object be divided by other?
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        end

feature -- Conversion

    to_boolean: BOOLEAN is
            -- True if not zero.
        do
            Result := item /= 0
        end

feature -- Basic operations

    abs: INTEGER is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        do
            create Result
            Result.set_item (item + other.item)
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        do
            create Result
            Result.set_item (item - other.item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        do
            create Result
            Result.set_item (item * other.item)
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        do
            create Result
            Result.set_item (item // other.item)
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
        do
            create Result.make (item, other)
        end

feature -- Conversion

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767
        do
            Result := item.to_integer_16
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
        do
            Result := item.to_integer_64
        end

feature -- Bit operations

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_32: n < 32
        do
            Result := eif_bit_test (item, n)
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

feature {NONE} -- Implementation

    c_outi (i: INTEGER): STRING is
            -- Printable representation of integer value
        external
            "C | %"eif_out.h%""
        end

    c_ascii_char (code: INTEGER): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    abs_ref: INTEGER_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER): INTEGER is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER): INTEGER is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER): INTEGER is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER): INTEGER is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i, n: INTEGER): INTEGER is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i, n: INTEGER): INTEGER is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i, n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "//" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix ">=" (other: [like Current] INTEGER_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "\\" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "+" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "|" (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_REF
    prefix "-": [like Current] INTEGER_REF
    prefix "+": [like Current] INTEGER_REF
    abs: INTEGER
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    bit_not: [like Current] INTEGER_REF
    bit_or (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    divisible (other: INTEGER_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER
    max (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    min (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    one: [like Current] INTEGER_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_REF): INTEGER
    to_boolean: BOOLEAN
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_REF

Commands
    set_item (i: INTEGER)

Constraints
    sign times abs

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    INTEGER_REF

feature -- Access

    ascii_char: CHARACTER is
            -- Returns corresponding ASCII character to item value.
        do
            Result := c_ascii_char (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            if item >= 0 then
                Result := item
            else
                Result := - (item + 1)
            end
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: INTEGER
            -- Integer value

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0 then
                Result := 1
            elseif item < 0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: INTEGER_REF): INTEGER is
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN is
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0
        ensure then
            value: Result = (other.item /= 0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (i: INTEGER) is
            -- Make i the item value.
        do
            item := i
        end

feature -- Conversion

    to_boolean: BOOLEAN is
            -- True if not zero.
        do
            Result := item /= 0
        end

    to_integer_16: INTEGER_16 is
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767
        do
            Result := item.to_integer_16
        end

    to_integer_64: INTEGER_64 is
            -- Convert item into an INTEGER_64 value.
        do
            Result := item.to_integer_64
        end

    to_integer_8: INTEGER_8 is
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127
        do
            Result := item.to_integer_8
        end

feature -- Basic operations

    abs: INTEGER is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): DOUBLE is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            Result := item / other.item
        end

    infix "//" (other: like Current): like Current is
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item // other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "\\" (other: like Current): like Current is
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item \\ other.item)
        ensure
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Integer power of Current by other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL is
            -- Interval from current element to other
            -- (empty if other less than current integer)
        do
            create Result.make (item, other)
        end

feature {NONE} -- Implementation

    abs_ref: INTEGER_REF is
            -- Absolute value
        do
            if item >= 0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ascii_char (code: INTEGER): CHARACTER is
            -- Character associated to integer value
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "chconv"
        end

    c_outi (i: INTEGER): STRING is
            -- Printable representation of integer value
        external
            "C | %"eif_out.h%""
        end

feature -- Bit operations

    bit_and (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    bit_not: like Current is
            -- One's complement of Current.
        do
            create Result
            Result.set_item (eif_bit_not (item))
        end

    bit_or (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    bit_shift (n: INTEGER): like Current is
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32
        do
            if n > 0 then
                Result := bit_shift_right (n)
            else
                Result := bit_shift_left (- n)
            end
        end

    bit_shift_left (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    bit_shift_right (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

    bit_test (n: INTEGER): BOOLEAN is
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_32: n < 32
        do
            Result := eif_bit_test (item, n)
        end

    bit_xor (i: like Current): like Current is
            -- Bitwise xor between Current' and i.
        do
            create Result
            Result.set_item (eif_bit_xor (item, i.item))
        end

    infix "&" (i: like Current): like Current is
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.
        do
            create Result
            Result.set_item (eif_bit_and (item, i.item))
        end

    infix "|" (i: like Current): like Current is
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.
        do
            create Result
            Result.set_item (eif_bit_or (item, i.item))
        end

    infix "|<<" (n: INTEGER): like Current is
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_left (item, n))
        end

    infix "|>>" (n: INTEGER): like Current is
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32
        do
            create Result
            Result.set_item (eif_bit_shift_right (item, n))
        end

feature {NONE} -- Bit operations implementation

    eif_bit_and (i, j: INTEGER): INTEGER is
            -- Bitwise and between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_not (i: INTEGER): INTEGER is
            -- One's complement of i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_or (i, j: INTEGER): INTEGER is
            -- Bitwise or between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_left (i, n: INTEGER): INTEGER is
            -- Shift i from n position to left.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_shift_right (i, n: INTEGER): INTEGER is
            -- Shift i from n position to right.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_test (i, n: INTEGER): BOOLEAN is
            -- Test n-th bit from i.
        external
            "C [macro %"eif_misc.h%"]"
        end

    eif_bit_xor (i, j: INTEGER): INTEGER is
            -- Bitwise xor between i and j.
        external
            "C [macro %"eif_misc.h%"]"
        end

feature -- Output

    out: STRING is
            -- Printable representation of integer value
        do
            Result := c_outi (item)
        end

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_REF

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER)
            -- Make i the item value.

feature -- Conversion

    to_boolean: BOOLEAN
            -- True if not zero.

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_32: n < 32

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTEGER_REF

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Descendants
    INTEGER

Clients
    DLL_32_ROUTINE
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    REAL_REF
    TUPLE

Suppliers
    BOOLEAN
    DOUBLE
    DOUBLE_REF
    INTEGER
    INTEGER_INTERVAL
    INTEGER_REF
    NUMERIC
    REAL
    REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing an integer value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    INTEGER_REF

feature -- Access

    item: INTEGER
            -- Integer value

    hash_code: INTEGER
            -- Hash code value

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    one: like Current
            -- Neutral element for "*" and "/"

    zero: like Current
            -- Neutral element for "+" and "-"

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: INTEGER_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1

feature -- Element change

    set_item (i: INTEGER)
            -- Make i the item value.

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN
            -- May current object be divided by other?
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Conversion

    to_boolean: BOOLEAN
            -- True if not zero.

feature -- Basic operations

    abs: INTEGER
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "+" (other: like Current): like Current
            -- Sum with other

    infix "-" (other: like Current): like Current
            -- Result of subtracting other

    infix "*" (other: like Current): like Current
            -- Product by other

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    prefix "+": like Current
            -- Unary plus

    prefix "-": like Current
            -- Unary minus

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Conversion

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

feature -- Bit operations

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    bit_not: like Current
            -- One's complement of Current.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_32: n < 32

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTEGER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Integer values"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    INTEGER

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IO_MEDIUM Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Any medium that can perform input and/or output"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

deferred class
    IO_MEDIUM

inherit
    MEMORY
        export
            {NONE} all
        redefine
            dispose
        end

    STRING_HANDLER

feature -- Access

    name: STRING is
            -- Medium name
        deferred
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        deferred
        ensure
            result_exists: Result /= void
        end

feature -- Element change

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        deferred
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        deferred
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        deferred
        end

feature -- Status report

    handle: INTEGER is
            -- Handle to medium
        require
            valid_handle: handle_available
        deferred
        end

    handle_available: BOOLEAN is
            -- Is the handle available after class has been
            -- created?
        deferred
        end

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)?
        do
        end

    last_character: CHARACTER
            -- Last character read by read_character

    last_string: STRING
            -- Last string read

    last_integer: INTEGER
            -- Last integer read by read_integer

    last_real: REAL
            -- Last real read by read_real

    last_double: DOUBLE
            -- Last double read by read_double

    exists: BOOLEAN is
            -- Does medium exist?
        deferred
        end

    is_open_read: BOOLEAN is
            -- Is this medium opened for input
        deferred
        end

    is_open_write: BOOLEAN is
            -- Is this medium opened for output
        deferred
        end

    is_readable: BOOLEAN is
            -- Is medium readable?
        require
            handle_exists: exists
        deferred
        end

    is_executable: BOOLEAN is
            -- Is medium executable?
        require
            handle_exists: exists
        deferred
        end

    is_writable: BOOLEAN is
            -- Is medium writable?
        require
            handle_exists: exists
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        require
            handle_exists: exists
        deferred
        end

    extendible: BOOLEAN is
            -- May new items be added?
        deferred
        end

    is_closed: BOOLEAN is
            -- Is the I/O medium open
        deferred
        end

    support_storable: BOOLEAN is
            -- Can medium be used to store an Eiffel object?
        deferred
        end

feature -- Status setting

    close is
            -- Close medium.
        require
            medium_is_open: not is_closed
        deferred
        end

feature -- Removal

    dispose is
            -- Ensure this medium is closed when garbage collected.
        do
            if not is_closed then
                close
            end
        end

feature -- Output

    put_new_line is
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of new_line.
        require
            extendible: extendible
        deferred
        end

    new_line is
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of put_new_line.
        require
            extendible: extendible
        deferred
        end

    put_string (s: STRING) is
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of putstring.
        require
            extendible: extendible
            non_void: s /= void
        deferred
        end

    putstring (s: STRING) is
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of put_string.
        require
            extendible: extendible
            non_void: s /= void
        deferred
        end

    put_character (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of putchar.
        require
            extendible: extendible
        deferred
        end

    putchar (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of put_character.
        require
            extendible: extendible
        deferred
        end

    put_real (r: REAL) is
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of putreal.
        require
            extendible: extendible
        deferred
        end

    putreal (r: REAL) is
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of put_real.
        require
            extendible: extendible
        deferred
        end

    put_integer (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of putint.
        require
            extendible: extendible
        deferred
        end

    putint (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of put_integer.
        require
            extendible: extendible
        deferred
        end

    put_boolean (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of putbool.
        require
            extendible: extendible
        deferred
        end

    putbool (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of put_boolean.
        require
            extendible: extendible
        deferred
        end

    put_double (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of putdouble.
        require
            extendible: extendible
        deferred
        end

    putdouble (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of put_double.
        require
            extendible: extendible
        deferred
        end

feature -- Input

    read_real is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of readreal.
        require
            is_readable: readable
        deferred
        end

    readreal is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of read_real.
        require
            is_readable: readable
        deferred
        end

    read_double is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of readdouble.
        require
            is_readable: readable
        deferred
        end

    readdouble is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of read_double.
        require
            is_readable: readable
        deferred
        end

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of readchar.
        require
            is_readable: readable
        deferred
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of read_character.
        require
            is_readable: readable
        deferred
        end

    read_integer is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of readint.
        require
            is_readable: readable
        deferred
        end

    readint is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of read_integer.
        require
            is_readable: readable
        deferred
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readstream.
        require
            is_readable: readable
        deferred
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_stream.
        require
            is_readable: readable
        deferred
        end

    read_line is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readline.
        require
            is_readable: readable
        deferred
        end

    readline is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_line.
        require
            is_readable: readable
        deferred
        end

feature -- Obsolete

    lastchar: CHARACTER is
            -- Last character read by read_character
        do
            Result := last_character
        end

    laststring: STRING is
            -- Last string read
        do
            Result := last_string
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
        do
            Result := last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
        do
            Result := last_real
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
        do
            Result := last_double
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IO_MEDIUM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IO_MEDIUM Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    IO_MEDIUM

General
    cluster: base.kernel
    description: "Any medium that can perform input and/or output"

Ancestors
    MEMORY
    STRING_HANDLER

Queries
    exists: BOOLEAN
    extendible: BOOLEAN
    handle: INTEGER
    handle_available: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_writable: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    readable: BOOLEAN
    retrieved: ANY
    support_storable: BOOLEAN

Commands
    basic_store (object: ANY)
    close
    dispose
    general_store (object: ANY)
    independent_store (object: ANY)
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IO_MEDIUM Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Any medium that can perform input and/or output"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

deferred class
    IO_MEDIUM

feature -- Access

    name: STRING is
            -- Medium name
        deferred
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        deferred
        ensure
            result_exists: Result /= void
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    exists: BOOLEAN is
            -- Does medium exist?
        deferred
        end

    extendible: BOOLEAN is
            -- May new items be added?
        deferred
        end

    handle: INTEGER is
            -- Handle to medium
        require
            valid_handle: handle_available
        deferred
        end

    handle_available: BOOLEAN is
            -- Is the handle available after class has been
            -- created?
        deferred
        end

    is_closed: BOOLEAN is
            -- Is the I/O medium open
        deferred
        end

    is_executable: BOOLEAN is
            -- Is medium executable?
        require
            handle_exists: exists
        deferred
        end

    is_open_read: BOOLEAN is
            -- Is this medium opened for input
        deferred
        end

    is_open_write: BOOLEAN is
            -- Is this medium opened for output
        deferred
        end

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)?
        do
        end

    is_readable: BOOLEAN is
            -- Is medium readable?
        require
            handle_exists: exists
        deferred
        end

    is_writable: BOOLEAN is
            -- Is medium writable?
        require
            handle_exists: exists
        deferred
        end

    last_character: CHARACTER
            -- Last character read by read_character

    last_double: DOUBLE
            -- Last double read by read_double

    last_integer: INTEGER
            -- Last integer read by read_integer

    last_real: REAL
            -- Last real read by read_real

    last_string: STRING
            -- Last string read

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        require
            handle_exists: exists
        deferred
        end

    support_storable: BOOLEAN is
            -- Can medium be used to store an Eiffel object?
        deferred
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature -- Status setting

    close is
            -- Close medium.
        require
            medium_is_open: not is_closed
        deferred
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Element change

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        deferred
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        deferred
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        deferred
        end

feature -- Removal

    dispose is
            -- Ensure this medium is closed when garbage collected.
        do
            if not is_closed then
                close
            end
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Obsolete

    lastchar: CHARACTER is
            -- Last character read by read_character
        do
            Result := last_character
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
        do
            Result := last_double
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
        do
            Result := last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
        do
            Result := last_real
        end

    laststring: STRING is
            -- Last string read
        do
            Result := last_string
        end

feature {NONE} -- Implementation

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

feature -- Input

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of readchar.
        require
            is_readable: readable
        deferred
        end

    read_double is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of readdouble.
        require
            is_readable: readable
        deferred
        end

    read_integer is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of readint.
        require
            is_readable: readable
        deferred
        end

    read_line is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readline.
        require
            is_readable: readable
        deferred
        end

    read_real is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of readreal.
        require
            is_readable: readable
        deferred
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readstream.
        require
            is_readable: readable
        deferred
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of read_character.
        require
            is_readable: readable
        deferred
        end

    readdouble is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of read_double.
        require
            is_readable: readable
        deferred
        end

    readint is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of read_integer.
        require
            is_readable: readable
        deferred
        end

    readline is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_line.
        require
            is_readable: readable
        deferred
        end

    readreal is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of read_real.
        require
            is_readable: readable
        deferred
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_stream.
        require
            is_readable: readable
        deferred
        end

feature -- Output

    new_line is
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of put_new_line.
        require
            extendible: extendible
        deferred
        end

    put_boolean (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of putbool.
        require
            extendible: extendible
        deferred
        end

    put_character (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of putchar.
        require
            extendible: extendible
        deferred
        end

    put_double (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of putdouble.
        require
            extendible: extendible
        deferred
        end

    put_integer (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of putint.
        require
            extendible: extendible
        deferred
        end

    put_new_line is
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of new_line.
        require
            extendible: extendible
        deferred
        end

    put_real (r: REAL) is
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of putreal.
        require
            extendible: extendible
        deferred
        end

    put_string (s: STRING) is
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of putstring.
        require
            extendible: extendible
            non_void: s /= void
        deferred
        end

    putbool (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of put_boolean.
        require
            extendible: extendible
        deferred
        end

    putchar (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of put_character.
        require
            extendible: extendible
        deferred
        end

    putdouble (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of put_double.
        require
            extendible: extendible
        deferred
        end

    putint (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of put_integer.
        require
            extendible: extendible
        deferred
        end

    putreal (r: REAL) is
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of put_real.
        require
            extendible: extendible
        deferred
        end

    putstring (s: STRING) is
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of put_string.
        require
            extendible: extendible
            non_void: s /= void
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IO_MEDIUM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IO_MEDIUM Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Any medium that can perform input and/or output"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    IO_MEDIUM

feature -- Access

    name: STRING
            -- Medium name

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure
            result_exists: Result /= void

feature -- Status report

    exists: BOOLEAN
            -- Does medium exist?

    extendible: BOOLEAN
            -- May new items be added?

    handle: INTEGER
            -- Handle to medium
        require
            valid_handle: handle_available

    handle_available: BOOLEAN
            -- Is the handle available after class has been
            -- created?

    is_closed: BOOLEAN
            -- Is the I/O medium open

    is_executable: BOOLEAN
            -- Is medium executable?
        require
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is this medium opened for input

    is_open_write: BOOLEAN
            -- Is this medium opened for output

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?

    is_readable: BOOLEAN
            -- Is medium readable?
        require
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is medium writable?
        require
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character

    last_double: DOUBLE
            -- Last double read by read_double

    last_integer: INTEGER
            -- Last integer read by read_integer

    last_real: REAL
            -- Last real read by read_real

    last_string: STRING
            -- Last string read

    readable: BOOLEAN
            -- Is there a current item that may be read?
        require
            handle_exists: exists

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel object?

feature -- Status setting

    close
            -- Close medium.
        require
            medium_is_open: not is_closed

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character

    lastdouble: DOUBLE
            -- Last double read by read_double

    lastint: INTEGER
            -- Last integer read by read_integer

    lastreal: REAL
            -- Last real read by read_real

    laststring: STRING
            -- Last string read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of readchar.
        require
            is_readable: readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of readdouble.
        require
            is_readable: readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of readint.
        require
            is_readable: readable

    read_line
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readline.
        require
            is_readable: readable

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of readreal.
        require
            is_readable: readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readstream.
        require
            is_readable: readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of read_character.
        require
            is_readable: readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of read_double.
        require
            is_readable: readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of read_integer.
        require
            is_readable: readable

    readline
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_line.
        require
            is_readable: readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of read_real.
        require
            is_readable: readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_stream.
        require
            is_readable: readable

feature -- Output

    new_line
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of put_new_line.
        require
            extendible: extendible

    put_boolean (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of putbool.
        require
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of putchar.
        require
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of putdouble.
        require
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of putint.
        require
            extendible: extendible

    put_new_line
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of new_line.
        require
            extendible: extendible

    put_real (r: REAL)
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of putreal.
        require
            extendible: extendible

    put_string (s: STRING)
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of putstring.
        require
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of put_boolean.
        require
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of put_character.
        require
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of put_double.
        require
            extendible: extendible

    putint (i: INTEGER)
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of put_integer.
        require
            extendible: extendible

    putreal (r: REAL)
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of put_real.
        require
            extendible: extendible

    putstring (s: STRING)
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of put_string.
        require
            extendible: extendible
            non_void: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IO_MEDIUM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IO_MEDIUM Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    IO_MEDIUM

Ancestors
    MEMORY
    STRING_HANDLER

Descendants
    FILE
    STREAM

Clients
    IO_MEDIUM
    STORABLE

Suppliers
    BOOLEAN
    IO_MEDIUM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IO_MEDIUM Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Any medium that can perform input and/or output"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    IO_MEDIUM

feature -- Access

    name: STRING
            -- Medium name

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure
            result_exists: Result /= void

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Status report

    handle: INTEGER
            -- Handle to medium
        require
            valid_handle: handle_available

    handle_available: BOOLEAN
            -- Is the handle available after class has been
            -- created?

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?

    last_character: CHARACTER
            -- Last character read by read_character

    last_string: STRING
            -- Last string read

    last_integer: INTEGER
            -- Last integer read by read_integer

    last_real: REAL
            -- Last real read by read_real

    last_double: DOUBLE
            -- Last double read by read_double

    exists: BOOLEAN
            -- Does medium exist?

    is_open_read: BOOLEAN
            -- Is this medium opened for input

    is_open_write: BOOLEAN
            -- Is this medium opened for output

    is_readable: BOOLEAN
            -- Is medium readable?
        require
            handle_exists: exists

    is_executable: BOOLEAN
            -- Is medium executable?
        require
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is medium writable?
        require
            handle_exists: exists

    readable: BOOLEAN
            -- Is there a current item that may be read?
        require
            handle_exists: exists

    extendible: BOOLEAN
            -- May new items be added?

    is_closed: BOOLEAN
            -- Is the I/O medium open

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel object?

feature -- Status setting

    close
            -- Close medium.
        require
            medium_is_open: not is_closed

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.

feature -- Output

    put_new_line
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of new_line.
        require
            extendible: extendible

    new_line
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of put_new_line.
        require
            extendible: extendible

    put_string (s: STRING)
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of putstring.
        require
            extendible: extendible
            non_void: s /= void

    putstring (s: STRING)
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of put_string.
        require
            extendible: extendible
            non_void: s /= void

    put_character (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of putchar.
        require
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of put_character.
        require
            extendible: extendible

    put_real (r: REAL)
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of putreal.
        require
            extendible: extendible

    putreal (r: REAL)
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of put_real.
        require
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of putint.
        require
            extendible: extendible

    putint (i: INTEGER)
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of put_integer.
        require
            extendible: extendible

    put_boolean (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of putbool.
        require
            extendible: extendible

    putbool (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of put_boolean.
        require
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of putdouble.
        require
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of put_double.
        require
            extendible: extendible

feature -- Input

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of readreal.
        require
            is_readable: readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of read_real.
        require
            is_readable: readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of readdouble.
        require
            is_readable: readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of read_double.
        require
            is_readable: readable

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of readchar.
        require
            is_readable: readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of read_character.
        require
            is_readable: readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of readint.
        require
            is_readable: readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of read_integer.
        require
            is_readable: readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readstream.
        require
            is_readable: readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_stream.
        require
            is_readable: readable

    read_line
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readline.
        require
            is_readable: readable

    readline
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_line.
        require
            is_readable: readable

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character

    laststring: STRING
            -- Last string read

    lastint: INTEGER
            -- Last integer read by read_integer

    lastreal: REAL
            -- Last real read by read_real

    lastdouble: DOUBLE
            -- Last double read by read_double

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IO_MEDIUM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEMORY Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for tuning up the garbage collection mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    MEMORY

inherit
    MEM_CONST

feature -- Measurement

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
        require
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
        require
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

feature -- Status report

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

feature -- Status report

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

feature -- Status setting

    collection_off is
            -- Disable garbage collection.
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
        do
            gc_monitoring (True)
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
        do
            gc_monitoring (False)
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
        require
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
        require
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
        require
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
        require
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

feature -- Removal

    dispose is
            -- Action to be executed just before garbage collection
            -- reclaims an object.
            -- Default version does nothing; redefine in descendants
            -- to perform specific dispose actions. Those actions
            -- should only take care of freeing external resources;
            -- they should not perform remote calls on other objects
            -- since these may also be dead and reclaimed.
        do
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
        do
            mem_free ($object)
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
        external
            "C | %"eif_memory.h%""
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
        external
            "C | %"eif_eiffel.h%""
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

feature {NONE} -- Implementation

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
        external
            "C | %"eif_traverse.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEMORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEMORY Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MEMORY

General
    cluster: base.kernel
    description:
        "Facilities for tuning up the garbage collection mechanism.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    MEM_CONST

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    Incremental_collector: INTEGER
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    Total_memory: INTEGER

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    disable_time_accounting
    dispose
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    mem_free (addr: POINTER)
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEMORY Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for tuning up the garbage collection mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    MEMORY

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
        require
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
        require
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
        require
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
        require
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
        require
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
        require
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
        external
            "C | %"eif_eiffel.h%""
        end

    dispose is
            -- Action to be executed just before garbage collection
            -- reclaims an object.
            -- Default version does nothing; redefine in descendants
            -- to perform specific dispose actions. Those actions
            -- should only take care of freeing external resources;
            -- they should not perform remote calls on other objects
            -- since these may also be dead and reclaimed.
        do
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
        external
            "C | %"eif_memory.h%""
        end

feature {NONE} -- Implementation

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEMORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEMORY Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for tuning up the garbage collection mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    MEMORY

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
        require
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
        require
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.

    collecting: BOOLEAN
            -- Is garbage collection enabled?

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.

    collection_off
            -- Disable garbage collection.

    collection_on
            -- Enable garbage collection.

    disable_time_accounting
            -- Disable GC time accounting (default).

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
        require
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
        require
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
        require
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
        require
            positive_value: value > 0

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.

    dispose
            -- Action to be executed just before garbage collection
            -- reclaims an object.
            -- Default version does nothing; redefine in descendants
            -- to perform specific dispose actions. Those actions
            -- should only take care of freeing external resources;
            -- they should not perform remote calls on other objects
            -- since these may also be dead and reclaimed.

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEMORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEMORY Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MEMORY

Ancestors
    MEM_CONST

Descendants
    DIRECTORY
    DLL_32
    IDENTIFIED
    IO_MEDIUM
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Clients
    MEMORY

Suppliers
    ARRAY [G]
    BOOLEAN
    GC_INFO
    INTEGER
    MEM_INFO
    MEMORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEMORY Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Facilities for tuning up the garbage collection mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    MEMORY

feature -- Measurement

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
        require
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
        require
            type_ok: collector_type = full_collector or collector_type = incremental_collector

feature -- Status report

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.

    collecting: BOOLEAN
            -- Is garbage collection enabled?

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.

feature -- Status report

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.

feature -- Status setting

    collection_off
            -- Disable garbage collection.

    collection_on
            -- Enable garbage collection.

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.

    disable_time_accounting
            -- Disable GC time accounting (default).

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
        require
            positive_value: value > 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
        require
            positive_value: value >= 0

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
        require
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
        require
            positive_value: value > 0

feature -- Removal

    dispose
            -- Action to be executed just before garbage collection
            -- reclaims an object.
            -- Default version does nothing; redefine in descendants
            -- to perform specific dispose actions. Those actions
            -- should only take care of freeing external resources;
            -- they should not perform remote calls on other objects
            -- since these may also be dead and reclaimed.

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEMORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_CONST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used by memory management.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    MEM_CONST

feature -- Access

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector

    Full_collector: INTEGER is 0
            -- Statistics for full collections

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_CONST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MEM_CONST

General
    cluster: base.kernel
    description:
        "Constants used by memory management.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    C_memory: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    Incremental_collector: INTEGER
    Total_memory: INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_CONST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used by memory management.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    MEM_CONST

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector

    Full_collector: INTEGER is 0
            -- Statistics for full collections

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_CONST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used by memory management.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    MEM_CONST

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector

    Full_collector: INTEGER is 0
            -- Statistics for full collections

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_CONST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MEM_CONST

Ancestors
    ANY

Descendants
    GC_INFO
    MEM_INFO
    MEMORY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_CONST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used by memory management.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    MEM_CONST

feature -- Access

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector

    Full_collector: INTEGER is 0
            -- Statistics for full collections

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_INFO Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Properties of the memory management mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    MEM_INFO

inherit
    MEM_CONST

create
    make

feature -- Initialization

    make (memory: INTEGER) is
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of update.
        do
            mem_stat (memory)
            type := memory
            total := mem_info (1)
            used := mem_info (2)
            overhead := mem_info (3)
        ensure
            type_updated: type = memory
        end

    update (memory: INTEGER) is
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of make.
        do
            mem_stat (memory)
            type := memory
            total := mem_info (1)
            used := mem_info (2)
            overhead := mem_info (3)
        ensure
            type_updated: type = memory
        end

feature -- Access

    type: INTEGER
            -- Memory type (Total, Eiffel, C)

feature -- Measurement

    total: INTEGER
            -- Total number of bytes allocated for type
            -- before last call to update

    used: INTEGER
            -- Number of bytes used for type
            -- before last call to update

    free: INTEGER is
            -- Number of bytes still free for type
            -- before last call to update
        do
            Result := total - used - overhead
        ensure
            computed: Result = total - used - overhead
        end

    overhead: INTEGER
            -- Number of bytes used by memory management
            -- scheme for type before last call to update

feature {NONE} -- Implementation

    mem_stat (mem: INTEGER) is
            -- Initialize run-time buffer used by mem_info to retrieve the
            -- statistics frozen at the time of this call.
        external
            "C | %"eif_memory.h%""
        end

    mem_info (field: INTEGER): INTEGER is
            -- Read memory accounting structure, field by field.
        external
            "C | %"eif_memory.h%""
        end

invariant

    consistent_memory: total = free + used + overhead

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_INFO Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MEM_INFO

General
    cluster: base.kernel
    description:
        "Properties of the memory management mechanism.
        This class may be used as ancestor by classes needing its facilities."
    create: make

Ancestors
    MEM_CONST

Queries
    C_memory: INTEGER
    Eiffel_memory: INTEGER
    free: INTEGER
    Full_collector: INTEGER
    Incremental_collector: INTEGER
    overhead: INTEGER
    total: INTEGER
    Total_memory: INTEGER
    type: INTEGER
    used: INTEGER

Commands
    make (memory: INTEGER)
    update (memory: INTEGER)

Constraints
    consistent memory

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_INFO Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Properties of the memory management mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class
    MEM_INFO

create
    make

feature -- Initialization

    make (memory: INTEGER) is
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of update.
        do
            mem_stat (memory)
            type := memory
            total := mem_info (1)
            used := mem_info (2)
            overhead := mem_info (3)
        ensure
            type_updated: type = memory
        end

    update (memory: INTEGER) is
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of make.
        do
            mem_stat (memory)
            type := memory
            total := mem_info (1)
            used := mem_info (2)
            overhead := mem_info (3)
        ensure
            type_updated: type = memory
        end

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    type: INTEGER
            -- Memory type (Total, Eiffel, C)

feature -- Measurement

    free: INTEGER is
            -- Number of bytes still free for type
            -- before last call to update
        do
            Result := total - used - overhead
        ensure
            computed: Result = total - used - overhead
        end

    overhead: INTEGER
            -- Number of bytes used by memory management
            -- scheme for type before last call to update

    total: INTEGER
            -- Total number of bytes allocated for type
            -- before last call to update

    used: INTEGER
            -- Number of bytes used for type
            -- before last call to update

feature {NONE} -- Implementation

    mem_info (field: INTEGER): INTEGER is
            -- Read memory accounting structure, field by field.
        external
            "C | %"eif_memory.h%""
        end

    mem_stat (mem: INTEGER) is
            -- Initialize run-time buffer used by mem_info to retrieve the
            -- statistics frozen at the time of this call.
        external
            "C | %"eif_memory.h%""
        end

invariant

    consistent_memory: total = free + used + overhead
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_INFO Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Properties of the memory management mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    MEM_INFO

create

    make (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of update.
        ensure
            type_updated: type = memory

feature -- Initialization

    make (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of update.
        ensure
            type_updated: type = memory

    update (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of make.
        ensure
            type_updated: type = memory

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    type: INTEGER
            -- Memory type (Total, Eiffel, C)

feature -- Measurement

    free: INTEGER
            -- Number of bytes still free for type
            -- before last call to update
        ensure
            computed: Result = total - used - overhead

    overhead: INTEGER
            -- Number of bytes used by memory management
            -- scheme for type before last call to update

    total: INTEGER
            -- Total number of bytes allocated for type
            -- before last call to update

    used: INTEGER
            -- Number of bytes used for type
            -- before last call to update

invariant

    consistent_memory: total = free + used + overhead
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_INFO Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MEM_INFO

Ancestors
    MEM_CONST

Clients
    MEM_INFO
    MEMORY

Suppliers
    INTEGER
    MEM_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MEM_INFO Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Properties of the memory management mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:28 $"
    revision: "$Revision: 1.2 $"

class interface
    MEM_INFO

create
    make

feature -- Initialization

    make (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of update.
        ensure
            type_updated: type = memory

    update (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of make.
        ensure
            type_updated: type = memory

feature -- Access

    type: INTEGER
            -- Memory type (Total, Eiffel, C)

feature -- Measurement

    total: INTEGER
            -- Total number of bytes allocated for type
            -- before last call to update

    used: INTEGER
            -- Number of bytes used for type
            -- before last call to update

    free: INTEGER
            -- Number of bytes still free for type
            -- before last call to update
        ensure
            computed: Result = total - used - overhead

    overhead: INTEGER
            -- Number of bytes used by memory management
            -- scheme for type before last call to update

invariant

    consistent_memory: total = free + used + overhead

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


NUMERIC Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects to which numerical operations are applicable"
    note: "The model is that of a commutative ring."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    NUMERIC

feature -- Access

    one: like Current is
            -- Neutral element for "*" and "/"
        deferred
        ensure
            result_exists: Result /= void
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        deferred
        ensure
            result_exists: Result /= void
        end

feature -- Status report

    divisible (other: like Current): BOOLEAN is
            -- May current object be divided by other?
        require
            other_exists: other /= void
        deferred
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require
            other_exists: other /= void
        deferred
        end

feature -- Basic operations

    infix "+" (other: like Current): like Current is
            -- Sum with other (commutative).
        require
            other_exists: other /= void
        deferred
        ensure
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require
            other_exists: other /= void
        deferred
        ensure
            result_exists: Result /= void
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        require
            other_exists: other /= void
        deferred
        ensure
            result_exists: Result /= void
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        deferred
        ensure
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        deferred
        ensure
            result_exists: Result /= void
        end

    prefix "-": like Current is
            -- Unary minus
        deferred
        ensure
            result_exists: Result /= void
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class NUMERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


NUMERIC Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    NUMERIC

General
    cluster: base.kernel
    description: "Objects to which numerical operations are applicable"

Ancestors
    ANY

Queries
    infix "-" (other: [like Current] NUMERIC): [like Current] NUMERIC
    infix "+" (other: [like Current] NUMERIC): [like Current] NUMERIC
    infix "/" (other: [like Current] NUMERIC): [like Current] NUMERIC
    infix "*" (other: [like Current] NUMERIC): [like Current] NUMERIC
    prefix "-": [like Current] NUMERIC
    prefix "+": [like Current] NUMERIC
    divisible (other: [like Current] NUMERIC): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    one: [like Current] NUMERIC
    zero: [like Current] NUMERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


NUMERIC Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects to which numerical operations are applicable"
    note: "The model is that of a commutative ring."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    NUMERIC

feature -- Access

    one: like Current is
            -- Neutral element for "*" and "/"
        deferred
        ensure
            result_exists: Result /= void
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        deferred
        ensure
            result_exists: Result /= void
        end

feature -- Status report

    divisible (other: like Current): BOOLEAN is
            -- May current object be divided by other?
        require
            other_exists: other /= void
        deferred
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require
            other_exists: other /= void
        deferred
        end

feature -- Basic operations

    infix "*" (other: like Current): like Current is
            -- Product by other
        require
            other_exists: other /= void
        deferred
        ensure
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        deferred
        ensure
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other (commutative).
        require
            other_exists: other /= void
        deferred
        ensure
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
        deferred
        ensure
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require
            other_exists: other /= void
        deferred
        ensure
            result_exists: Result /= void
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        deferred
        ensure
            result_exists: Result /= void
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class NUMERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


NUMERIC Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects to which numerical operations are applicable"
    note: "The model is that of a commutative ring."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    NUMERIC

feature -- Access

    one: like Current
            -- Neutral element for "*" and "/"
        ensure
            result_exists: Result /= void

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure
            result_exists: Result /= void

feature -- Status report

    divisible (other: like Current): BOOLEAN
            -- May current object be divided by other?
        require
            other_exists: other /= void

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require
            other_exists: other /= void

feature -- Basic operations

    infix "*" (other: like Current): like Current
            -- Product by other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other (commutative).
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class NUMERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


NUMERIC Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    NUMERIC

Ancestors
    ANY

Descendants
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    REAL_REF

Clients
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    NUMERIC
    REAL_REF

Suppliers
    NUMERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


NUMERIC Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects to which numerical operations are applicable"
    note: "The model is that of a commutative ring."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    NUMERIC

feature -- Access

    one: like Current
            -- Neutral element for "*" and "/"
        ensure
            result_exists: Result /= void

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure
            result_exists: Result /= void

feature -- Status report

    divisible (other: like Current): BOOLEAN
            -- May current object be divided by other?
        require
            other_exists: other /= void

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require
            other_exists: other /= void

feature -- Basic operations

    infix "+" (other: like Current): like Current
            -- Sum with other (commutative).
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    infix "*" (other: like Current): like Current
            -- Product by other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure
            result_exists: Result /= void

    prefix "-": like Current
            -- Unary minus
        ensure
            result_exists: Result /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class NUMERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_COMPARABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a partial order relation"
    status: "See notice at end of class"
    names: part_comparable, comparison
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    PART_COMPARABLE

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current object less than other?
        require
            other_exists: other /= void
        deferred
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
        require
            other_exists: other /= void
        do
            Result := (Current < other) or is_equal (other)
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
        require
            other_exists: other /= void
        do
            Result := other < Current
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
        require
            other_exists: other /= void
        do
            Result := (other < Current) or is_equal (other)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_COMPARABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PART_COMPARABLE

General
    cluster: base.kernel
    description: "Objects that may be compared according to a partial order relation"

Ancestors
    ANY

Queries
    infix ">=" (other: [like Current] PART_COMPARABLE): BOOLEAN
    infix ">" (other: [like Current] PART_COMPARABLE): BOOLEAN
    infix "<=" (other: [like Current] PART_COMPARABLE): BOOLEAN
    infix "<" (other: [like Current] PART_COMPARABLE): BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_COMPARABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a partial order relation"
    status: "See notice at end of class"
    names: part_comparable, comparison
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    PART_COMPARABLE

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current object less than other?
        require
            other_exists: other /= void
        deferred
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
        require
            other_exists: other /= void
        do
            Result := (Current < other) or is_equal (other)
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
        require
            other_exists: other /= void
        do
            Result := other < Current
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
        require
            other_exists: other /= void
        do
            Result := (other < Current) or is_equal (other)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_COMPARABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a partial order relation"
    status: "See notice at end of class"
    names: part_comparable, comparison
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PART_COMPARABLE

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current object less than other?
        require
            other_exists: other /= void

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
        require
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
        require
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
        require
            other_exists: other /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_COMPARABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PART_COMPARABLE

Ancestors
    ANY

Descendants
    COMPARABLE

Clients
    PART_COMPARABLE
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    PART_SORTED_SET [G -> PART_COMPARABLE]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

Suppliers
    BOOLEAN
    PART_COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_COMPARABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that may be compared according to a partial order relation"
    status: "See notice at end of class"
    names: part_comparable, comparison
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PART_COMPARABLE

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current object less than other?
        require
            other_exists: other /= void

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
        require
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
        require
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
        require
            other_exists: other /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_COMPARABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PATH_NAME Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Path name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    PATH_NAME

inherit
    STRING
        rename
            make as string_make,
            make_from_string as string_make_from_string,
            extend as string_extend
        export
            {NONE} all,
            {ANY} is_empty, empty, to_c, wipe_out,
            {PATH_NAME} count, area
        redefine
            is_equal
        end

feature -- Initialization

    make is
            -- Create path name object.
        do
            string_make (0)
        end

    make_from_string (p: STRING) is
            -- Create path name object and initialize it with the
            -- path name p
        do
            count := 0
            string_make (0)
            append (p)
        ensure
            valid_file_name: is_valid
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is the path name equal to other?
        local
            o_area: like area
        do
            if other = Current then
                Result := True
            elseif other.count = count then
                o_area := other.area;
                Result := eif_path_name_compare ($area, $o_area, count)
            end
        end

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN is
            -- Is dir_name a valid subdirectory part for the operating system?
        require
            exists: dir_name /= void
        local
            any: ANY
        do
            any := dir_name.to_c
            Result := eif_is_directory_name_valid ($any)
        end

    is_volume_name_valid (vol_name: STRING): BOOLEAN is
            -- Is vol_name a valid volume name for the operating system?
        require
            exists: vol_name /= void
        local
            any: ANY
        do
            any := vol_name.to_c
            Result := eif_is_volume_name_valid ($any)
        end

    is_valid: BOOLEAN is
            -- Is the path name valid for the operating system?
        deferred
        end

feature -- Status setting

    set_volume (volume_name: STRING) is
            -- Set the volume part of the path name to volume_name.
        require
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        do
            append (volume_name)
        ensure
            valid_file_name: is_valid
        end

    extend (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    set_subdirectory (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    set_directory (directory_name: STRING) is
            -- Set the absolute directory part of the path name to directory_name.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_set_directory ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    extend_from_array (directories: ARRAY [STRING]) is
            -- Append the subdirectories from directories to the path name.
        require
            array_exists: directories /= void and then not (directories.is_empty)
        local
            i, nb: INTEGER
        do
            from
                i := directories.lower
                nb := directories.upper
            until
                i > nb
            loop
                extend (directories.item (i))
                i := i + 1
            end
        ensure
            valid_file_name: is_valid
        end

feature {NONE} -- Externals

    eif_is_volume_name_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_directory_name_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_append_directory (s, p, v: POINTER) is
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_set_directory (s, p, v: POINTER) is
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_path_name_compare (s, t: POINTER; length: INTEGER): BOOLEAN is
        external
            "C (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_volume_name (s: POINTER): STRING is
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

    eif_extracted_paths (s: POINTER): ARRAY [STRING] is
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PATH_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PATH_NAME Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PATH_NAME

General
    cluster: base.kernel
    description: "Path name abstraction"

Ancestors
    STRING

Queries
    is_directory_name_valid (dir_name: STRING): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] PATH_NAME): BOOLEAN
    is_valid: BOOLEAN
    is_volume_name_valid (vol_name: STRING): BOOLEAN
    to_c: ANY

Commands
    extend (directory_name: STRING)
    extend_from_array (directories: ARRAY [STRING])
    make
    make_from_string (p: STRING)
    set_directory (directory_name: STRING)
    set_subdirectory (directory_name: STRING)
    set_volume (volume_name: STRING)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PATH_NAME Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Path name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    PATH_NAME

feature -- Initialization

    make is
            -- Create path name object.
        do
            string_make (0)
        end

    make_from_string (p: STRING) is
            -- Create path name object and initialize it with the
            -- path name p
        do
            count := 0
            string_make (0)
            append (p)
        ensure
            valid_file_name: is_valid
        end

feature {NONE} -- Initialization

    adapt (s: STRING): like Current is
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)
        do
            create Result.string_make (0)
            Result.share (s)
        end

    from_c (c_string: POINTER) is
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string, length)
            count := length
        ensure -- from STRING
            no_zero_byte: not has ('%U')
        end

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER) is
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        local
            length: INTEGER
        do
            length := end_pos - start_pos + 1
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string + (start_pos - 1), (end_pos - start_pos + 1))
            count := length
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1
        end

    string_make (n: INTEGER) is
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            if n = 0 then
                area := empty_area
            else
                make_area (n + 1)
            end
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_from_c (c_string: POINTER) is
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            make_area (length + 1);
            ($area).memory_copy (c_string, length)
            count := length
        end

    string_make_from_string (s: STRING) is
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        do
            area := s.area
            count := s.count
        ensure -- from STRING
            shared_implementation: shared_with (s)
        end

    remake (n: INTEGER) is
        obsolete "Use `make' instead"
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            string_make (n)
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

feature {NONE} -- Access

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, fuzz)
        end

    has (c: CHARACTER): BOOLEAN is
            -- Does string include c?
            -- (from STRING)
        local
            counter: INTEGER
        do
            if not is_empty then
                from
                    counter := 1
                until
                    counter > count or else (item (counter) = c)
                loop
                    counter := counter + 1
                end
                Result := (counter <= count)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from STRING)
        do
            Result := hashcode ($area, count)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    index_of (c: CHARACTER; start: INTEGER): INTEGER is
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        local
            a: like area
            i, nb: INTEGER
        do
            nb := count
            if start <= nb then
                from
                    i := start - 1
                    nb := nb - 1
                    a := area
                until
                    i > nb or else a.item (i) = c
                loop
                    i := i + 1
                end
                if i <= nb then
                    Result := i + 1
                end
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    item (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

    item_code (i: INTEGER): INTEGER is
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            Result := area.item (i - 1).code
        end

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER is
            -- Position of last occurence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        local
            a: like area
            i: INTEGER
        do
            from
                i := start_index_from_end - 1
                a := area
            until
                i < 0 or else a.item (i) = c
            loop
                i := i - 1
            end
            if i >= 0 then
                Result := i + 1
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    shared_with (other: like Current): BOOLEAN is
            -- Does string share the text of other?
            -- (from STRING)
        do
            Result := (other /= void) and then (area = other.area)
        end

    substring_index (other: STRING; start: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, 0)
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)
        end

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

feature {PATH_NAME} -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Allocated space
            -- (from STRING)
        do
            Result := area.count - 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from STRING)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count
        end

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER is
            -- Number of times c appears in the string
            -- (from STRING)
        local
            counter, nb: INTEGER
            a: SPECIAL [CHARACTER]
        do
            from
                counter := 0
                nb := count - 1
                a := area
            until
                counter > nb
            loop
                if a.item (counter) = c then
                    Result := Result + 1
                end
                counter := counter + 1
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {PATH_NAME} -- Measurement

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is the path name equal to other?
        require -- from ANY
            other_not_void: other /= void
        local
            o_area: like area
        do
            if other = Current then
                Result := True
            elseif other.count = count then
                o_area := other.area;
                Result := eif_path_name_compare ($area, $o_area, count)
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

feature {NONE} -- Comparison

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: like Current): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current < other then
                Result := - 1
            elseif other < Current then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        local
            other_area: like area
            other_count: INTEGER
            current_count: INTEGER
        do
            other_area := other.area
            other_count := other.count
            current_count := count
            if other_count = current_count then
                Result := str_strict_cmp ($other_area, $area, other_count) > 0
            else
                if current_count < other_count then
                    Result := str_strict_cmp ($other_area, $area, current_count) >= 0
                else
                    Result := str_strict_cmp ($other_area, $area, other_count) > 0
                end
            end
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN is
            -- Is dir_name a valid subdirectory part for the operating system?
        require
            exists: dir_name /= void
        local
            any: ANY
        do
            any := dir_name.to_c
            Result := eif_is_directory_name_valid ($any)
        end

    is_valid: BOOLEAN is
            -- Is the path name valid for the operating system?
        deferred
        end

    is_volume_name_valid (vol_name: STRING): BOOLEAN is
            -- Is vol_name a valid volume name for the operating system?
        require
            exists: vol_name /= void
        local
            any: ANY
        do
            any := vol_name.to_c
            Result := eif_is_volume_name_valid ($any)
        end

feature {NONE} -- Status report

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_boolean: BOOLEAN is
            -- Does Current represent a BOOLEAN?
            -- (from STRING)
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant) or else s.is_equal (false_constant)
        end

    is_double: BOOLEAN is
            -- Does Current represent a DOUBLE?
            -- (from STRING)
        do
            Result := str_isd ($area, count)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_integer: BOOLEAN is
            -- Does Current represent an INTEGER?
            -- (from STRING)
        do
            Result := str_isi ($area, count)
        end

    is_real: BOOLEAN is
            -- Does Current represent a REAL?
            -- (from STRING)
        do
            Result := str_isr ($area, count)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from STRING)
        do
            Result := True
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the string?
            -- (from STRING)
        do
            Result := (i > 0) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature  -- Status report

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

feature -- Status setting

    extend (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    extend_from_array (directories: ARRAY [STRING]) is
            -- Append the subdirectories from directories to the path name.
        require
            array_exists: directories /= void and then not (directories.is_empty)
        local
            i, nb: INTEGER
        do
            from
                i := directories.lower
                nb := directories.upper
            until
                i > nb
            loop
                extend (directories.item (i))
                i := i + 1
            end
        ensure
            valid_file_name: is_valid
        end

    set_directory (directory_name: STRING) is
            -- Set the absolute directory part of the path name to directory_name.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_set_directory ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    set_subdirectory (directory_name: STRING) is
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        local
            new_size: INTEGER
            str1, str2: ANY
        do
            new_size := count + directory_name.count + 5
            if capacity < new_size then
                resize (new_size)
            end
            str1 := to_c
            str2 := directory_name.to_c
            eif_append_directory ($Current, $str1, $str2)
        ensure
            valid_file_name: is_valid
        end

    set_volume (volume_name: STRING) is
            -- Set the volume part of the path name to volume_name.
        require
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        do
            append (volume_name)
        ensure
            valid_file_name: is_valid
        end

feature {NONE} -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Element change

    append (s: STRING) is
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area;
            ($area + count).memory_copy ($s_area, s.count)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + old s.count
        end

    append_boolean (b: BOOLEAN) is
            -- Append the string representation of b at end.
            -- (from STRING)
        do
            append (b.out)
        end

    append_character (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    append_double (d: DOUBLE) is
            -- Append the string representation of d at end.
            -- (from STRING)
        do
            append (d.out)
        end

    append_integer (i: INTEGER) is
            -- Append the string representation of i at end.
            -- (from STRING)
        do
            append (i.out)
        end

    append_real (r: REAL) is
            -- Append the string representation of r at end.
            -- (from STRING)
        do
            append (r.out)
        end

    append_string (s: STRING) is
            -- Append a copy of s, if not void, at end.
            -- (from STRING)
        do
            if s /= void then
                append (s)
            end
        end

    copy (other: like Current) is
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            old_area: like area
        do
            if other /= Current then
                old_area := area
                standard_copy (other)
                if old_area = void or else old_area.count < area.count then
                    area := standard_clone (area)
                else
                    ($old_area).memory_copy ($area, count)
                    area := old_area
                end
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count
        end

    string_extend (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                string_extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_blank is
            -- Fill with capacity blank characters.
            -- (from STRING)
        do
            fill_character (' ')
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    fill_character (c: CHARACTER) is
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, capacity)
            count := capacity
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    head (n: INTEGER) is
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        do
            if n < count then
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    insert (s: STRING; i: INTEGER) is
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, i)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    left_adjust is
            -- Remove leading whitespace.
            -- (from STRING)
        do
            count := str_left ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))
        end

    precede (c: CHARACTER) is
            -- Add c at front.
            -- (from STRING)
        do
            if count = capacity then
                resize (count + additional_space)
            end
            str_cprepend ($area, c, count)
            count := count + 1
        ensure -- from STRING
            new_count: count = old count + 1
        end

    prepend (s: STRING) is
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := count + s.count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, 1)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    prepend_boolean (b: BOOLEAN) is
            -- Prepend the string representation of b at front.
            -- (from STRING)
        do
            prepend (b.out)
        end

    prepend_character (c: CHARACTER) is
            -- Prepend the string representation of c at front.
            -- (from STRING)
        do
            prepend (c.out)
        end

    prepend_double (d: DOUBLE) is
            -- Prepend the string representation of d at front.
            -- (from STRING)
        do
            prepend (d.out)
        end

    prepend_integer (i: INTEGER) is
            -- Prepend the string representation of i at front.
            -- (from STRING)
        do
            prepend (i.out)
        end

    prepend_real (r: REAL) is
            -- Prepend the string representation of r at front.
            -- (from STRING)
        do
            prepend (r.out)
        end

    prepend_string (s: STRING) is
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)
        do
            if s /= void then
                prepend (s)
            end
        end

    put (c: CHARACTER; i: INTEGER) is
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (c, i - 1)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    replace_blank is
            -- Replace all current characters with blanks.
            -- (from STRING)
        do
            replace_character (' ')
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_character (c: CHARACTER) is
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, count)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_substring (s: like Current; start_pos, end_pos: INTEGER) is
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        local
            new_size, substring_size: INTEGER
            s_area: like area
        do
            substring_size := end_pos - start_pos + 1
            new_size := s.count + count - substring_size
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_replace ($area, $s_area, count, s.count, start_pos, end_pos)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1
        end

    replace_substring_all (original, new: like Current) is
            -- Replace every occurence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty
        local
            change_pos: INTEGER
        do
            if not is_empty then
                from
                    change_pos := substring_index (original, 1)
                until
                    change_pos = 0
                loop
                    replace_substring (new, change_pos, change_pos + original.count - 1)
                    if change_pos + new.count <= count then
                        change_pos := substring_index (original, change_pos + new.count)
                    else
                        change_pos := 0
                    end
                end
            end
        end

    right_adjust is
            -- Remove trailing whitespace.
            -- (from STRING)
        do
            count := str_right ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))
        end

    set (t: like Current; n1, n2: INTEGER) is
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        local
            s: STRING
        do
            s := t.substring (n1, n2)
            area := s.area
            count := s.count
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    share (other: like Current) is
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        do
            area := other.area
            count := other.count
        ensure -- from STRING
            shared_count: other.count = count
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            start0 := start_pos - 1
            end0 := end_pos - 1
            index0 := index_pos - 1
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

    tail (n: INTEGER) is
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        local
            i, j: INTEGER
        do
            if n < count then
                from
                    j := (count - n)
                    i := 0
                until
                    i = n
                loop
                    area.put (area.item (j), i)
                    i := i + 1
                    j := j + 1
                end
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    infix "+" (s: STRING): STRING is
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        do
            create Result.make (count + s.count)
            Result.append_string (Current)
            Result.append_string (s)
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all characters.
            -- (from STRING)
        do
            count := 0
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity
        end

    prune (c: CHARACTER) is
            -- Remove first occurrence of c, if any.
            -- (from STRING)
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True
        local
            counter: INTEGER
        do
            from
                counter := 1
            until
                counter > count or else (item (counter) = c)
            loop
                counter := counter + 1
            end
            if counter <= count then
                remove (counter)
            end
        end

    prune_all (c: CHARACTER) is
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        do
            count := str_rmall ($area, c, count)
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))
        end

    prune_all_leading (c: CHARACTER) is
            -- Remove all leading occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (1) /= c
            loop
                remove (1)
            end
        end

    prune_all_trailing (c: CHARACTER) is
            -- Remove all trailing occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (count) /= c
            loop
                remove (count)
            end
        end

    remove (i: INTEGER) is
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            str_rmchar ($area, count, i)
            count := count - 1
        ensure -- from STRING
            new_count: count = old count - 1
        end

feature  -- Removal

    wipe_out is
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        do
            area := empty_area
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0
        end

feature {NONE} -- Resizing

    adapt_size is
            -- Adapt the size to accommodate count characters.
            -- (from STRING)
        do
            resize (count)
        end

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (newsize: INTEGER) is
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        do
            if newsize > capacity then
                resize (newsize)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (newsize: INTEGER) is
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0
        local
            area_count: INTEGER
        do
            area_count := area.count
            if newsize >= area_count then
                if area_count = 1 then
                    make_area (newsize + 1)
                else
                    area := str_resize ($area, newsize + 1)
                end
            end
        end

feature {NONE} -- Conversion

    center_justify is
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_cjustify ($area, count, capacity)
        end

    character_justify (pivot: CHARACTER; position: INTEGER) is
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty
        do
            if index_of (pivot, 1) < position then
                from
                    precede (' ')
                until
                    index_of (pivot, 1) = position
                loop
                    precede (' ')
                end
            elseif index_of (pivot, 1) > position then
                from
                    remove (1)
                until
                    index_of (pivot, 1) = position
                loop
                    remove (1)
                end
            end
            from
            until
                count = capacity
            loop
                string_extend (' ')
            end
        end

    left_justify is
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_ljustify ($area, count, capacity)
        end

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from STRING)
        local
            temp: ARRAYED_LIST [CHARACTER]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := 1
            until
                i > count
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

    mirror is
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        local
            a: like area
            c: CHARACTER
            i, j: INTEGER
        do
            if count > 0 then
                from
                    i := count - 1
                    a := area
                until
                    i <= j
                loop
                    c := a.item (i)
                    a.put (a.item (j), i)
                    a.put (c, j)
                    i := i - 1
                    j := j + 1
                end
            end
        ensure -- from STRING
            same_count: count = old count
        end

    mirrored: like Current is
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        do
            Result := clone (Current)
            if count > 0 then
                Result.mirror
            end
        ensure -- from STRING
            same_count: Result.count = count
        end

    right_justify is
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_rjustify ($area, count, capacity)
        end

    split (a_separator: CHARACTER): LINEAR [STRING] is
            -- Split on a_separator.
            -- Ignore separators in quotes.
            -- (from STRING)
        local
            al: ARRAYED_LIST [STRING]
            part: STRING
            i, j, c: INTEGER
            q: BOOLEAN
            p: CHARACTER
        do
            from
                c := count
                create al.make (c)
                i := 1
                j := 0
            until
                i > c
            loop
                j := index_of (a_separator, i)
                if j = 0 then
                    j := c + 1
                end
                part := substring (i, j - 1)
                if part.has ('"') then
                    from
                        j := i - 1
                        p := '%U'
                    until
                        j >= c or p = a_separator
                    loop
                        j := j + 1
                        p := item (j)
                        if p = '"' and not (j > 1 and then item (j - 1) = '%%') then
                            q := not q
                        end
                        if q and p = a_separator then
                            p := '%U'
                        end
                    end
                    part := substring (i, j - 1)
                    part.replace_substring_all ("%%%%", "_#___PERCENT___#_")
                    part.replace_substring_all ("%%%"", "_#___QUOTE___#_")
                    part.replace_substring_all ("%"", "")
                    part.replace_substring_all ("_#___PERCENT___#_", "%%")
                    part.replace_substring_all ("_#___QUOTE___#_", "%"")
                    part.prepend ("%"")
                    part.append ("%"")
                end
                al.extend (part)
                i := j + 1
            end
            Result := al
            check
                al.count = occurrences (a_separator)
            end
        ensure -- from STRING
            Result /= void
        end

    to_boolean: BOOLEAN is
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant)
        end

    to_double: DOUBLE is
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double
        do
            Result := str_atod ($area, count)
        end

    to_integer: INTEGER is
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer
        do
            Result := str_atoi ($area, count)
        end

    to_lower is
            -- Convert to lower case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).lower, i)
                i := i - 1
            end
        end

    to_real: REAL is
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real
        do
            Result := str_ator ($area, count)
        end

    to_upper is
            -- Convert to upper case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).upper, i)
                i := i - 1
            end
        end

feature  -- Conversion

    frozen to_c: ANY is
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)
        do
            area.put ('%U', count)
            Result := area
        end

feature {NONE} -- Duplication

    multiply (n: INTEGER) is
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1
        local
            s: STRING
            i: INTEGER
        do
            s := clone (Current)
            grow (n * count)
            from
                i := n
            until
                i = 1
            loop
                append (s)
                i := i - 1
            end
        end

    substring (n1, n2: INTEGER): like Current is
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        local
            other_area: like area
        do
            if (1 <= n1) and (n1 <= n2) and (n2 <= count) then
                create Result.string_make (n2 - n1 + 1)
                other_area := Result.area
                ($other_area).memory_copy ($area + (n1 - 1), n2 - n1 + 1)
                Result.set_count (n2 - n1 + 1)
            else
                create Result.string_make (0)
            end
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0
        end

feature {NONE} -- Inapplicable

    bag_put (v: CHARACTER) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    c_p_i: INTEGER is
        obsolete "You now have to implement it yourself by inheriting from PLATFORM."
            -- Number of characters per INTEGER
            -- (from STRING)
        do
        end

    hashcode (c_string: POINTER; len: INTEGER): INTEGER is
            -- Hash code value of c_string
            -- (from STRING)
        external
            "C use %"eif_tools.h%""
        end

    frozen set_count (number: INTEGER) is
            -- Set count to number of characters.
            -- (from STRING)
        require -- from STRING
            valid_count: 0 <= number and number <= capacity
        do
            count := number
        ensure -- from STRING
            new_count: count = number
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy characters of source within bounds s
            -- and e to target starting at index i.
            -- (from STRING)
        external
            "C use %"eif_copy.h%""
        end

    str_atod (c_string: POINTER; length: INTEGER): DOUBLE is
            -- Value of double in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_DOUBLE use %"eif_str.h%""
        end

    str_atoi (c_string: POINTER; length: INTEGER): INTEGER is
            -- Value of integer in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_ator (c_string: POINTER; length: INTEGER): REAL is
            -- Value of real in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_REAL use %"eif_str.h%""
        end

    str_cjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Center justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_cprepend (c_string: POINTER; c: CHARACTER; length: INTEGER) is
            -- Prepend c to c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_insert (c_string, other_string: POINTER; c_length, other_length, position: INTEGER) is
            -- Insert other_string into c_string at position.
            -- Insertion occurs at the left of position.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_isd (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a double?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isi (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is an integer?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isr (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a real?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_left (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all leading whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_len (c_string: POINTER): INTEGER is
            -- Length of the C string: c_string
            -- (from STRING)
        external
            "C signature (char *): EIF_INTEGER use %"eif_str.h%""
        alias
            "strlen"
        end

    str_ljustify (c_string: POINTER; length, cap: INTEGER) is
            -- Left justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_replace (c_string, other_string: POINTER; c_length, other_length, star_post, end_pos: INTEGER) is
            -- Replace substring (start_pos, end_pos) from c_string
            -- by other_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_resize (a: POINTER; newsize: INTEGER): like area is
            -- Area which can accomodate
            -- at least newsize characters
            -- (from STRING)
        external
            "C use %"eif_malloc.h%""
        alias
            "sprealloc"
        end

    str_right (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all trailing whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Right justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rmall (c_string: POINTER; c: CHARACTER; length: INTEGER): INTEGER is
            -- Remove all occurrences of c in c_string.
            -- Return new number of character making up c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rmchar (c_string: POINTER; length, i: INTEGER) is
            -- Remove i-th character from c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_str (c_str, o_str: POINTER; clen, olen, i, fuzzy: INTEGER): INTEGER is
            -- Forward search of o_str within c_str starting at i.
            -- Return the index within c_str where the pattern was
            -- located, 0 if not found.
            -- The 'fuzzy' parameter is the maximum allowed number of
            -- mismatches within the pattern. A 0 means an exact match.
            -- (from STRING)
        external
            "C use %"eif_eiffel.h%""
        end

    str_strict_cmp (this, other: POINTER; len: INTEGER): INTEGER is
            -- Compare this and other C strings
            -- for the first len characters.
            -- 0 if equal, < 0 if this < other,
            -- > 0 if this > other
            -- (from STRING)
        external
            "C signature (char *, char *, size_t): EIF_INTEGER use <string.h>"
        alias
            "strncmp"
        end

feature {NONE} -- Empty string implementation

    empty_area: SPECIAL [CHARACTER] is
            -- Empty area used when calling `make (0)'.
            -- (from STRING)
        local
            old_area: like area
        once
            old_area := area
            make_area (1)
            Result := area
            area := old_area
        end

feature {NONE} -- Externals

    eif_append_directory (s, p, v: POINTER) is
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_extracted_paths (s: POINTER): ARRAY [STRING] is
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

    eif_is_directory_name_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_is_volume_name_valid (p: POINTER): BOOLEAN is
        external
            "C (EIF_CHARACTER *): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_path_name_compare (s, t: POINTER; length: INTEGER): BOOLEAN is
        external
            "C (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN | %"eif_path_name.h%""
        end

    eif_set_directory (s, p, v: POINTER) is
        external
            "C (EIF_REFERENCE, EIF_CHARACTER *, EIF_CHARACTER *) | %"eif_path_name.h%""
        end

    eif_volume_name (s: POINTER): STRING is
        external
            "C (EIF_CHARACTER *): EIF_REFERENCE | %"eif_path_name.h%""
        end

feature {NONE} -- Output

    out: like Current is
            -- Printable representation
            -- (from STRING)
        do
            Result := clone (Current)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PATH_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PATH_NAME Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Path name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PATH_NAME

feature -- Initialization

    make
            -- Create path name object.

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
        ensure
            valid_file_name: is_valid

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the path name equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN
            -- Is dir_name a valid subdirectory part for the operating system?
        require
            exists: dir_name /= void

    is_valid: BOOLEAN
            -- Is the path name valid for the operating system?

    is_volume_name_valid (vol_name: STRING): BOOLEAN
            -- Is vol_name a valid volume name for the operating system?
        require
            exists: vol_name /= void

feature  -- Status report

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

feature -- Status setting

    extend (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    extend_from_array (directories: ARRAY [STRING])
            -- Append the subdirectories from directories to the path name.
        require
            array_exists: directories /= void and then not (directories.is_empty)
        ensure
            valid_file_name: is_valid

    set_directory (directory_name: STRING)
            -- Set the absolute directory part of the path name to directory_name.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    set_subdirectory (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    set_volume (volume_name: STRING)
            -- Set the volume part of the path name to volume_name.
        require
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        ensure
            valid_file_name: is_valid

feature  -- Removal

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature  -- Conversion

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PATH_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PATH_NAME Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PATH_NAME

Ancestors
    STRING

Descendants
    DIRECTORY_NAME
    FILE_NAME

Clients
    PATH_NAME

Suppliers
    ARRAY [G]
    BOOLEAN
    INTEGER
    PATH_NAME
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PATH_NAME Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Path name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PATH_NAME

feature -- Initialization

    make
            -- Create path name object.

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
        ensure
            valid_file_name: is_valid

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the path name equal to other?

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN
            -- Is dir_name a valid subdirectory part for the operating system?
        require
            exists: dir_name /= void

    is_volume_name_valid (vol_name: STRING): BOOLEAN
            -- Is vol_name a valid volume name for the operating system?
        require
            exists: vol_name /= void

    is_valid: BOOLEAN
            -- Is the path name valid for the operating system?

feature -- Status setting

    set_volume (volume_name: STRING)
            -- Set the volume part of the path name to volume_name.
        require
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        ensure
            valid_file_name: is_valid

    extend (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    set_subdirectory (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    set_directory (directory_name: STRING)
            -- Set the absolute directory part of the path name to directory_name.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    extend_from_array (directories: ARRAY [STRING])
            -- Append the subdirectories from directories to the path name.
        require
            array_exists: directories /= void and then not (directories.is_empty)
        ensure
            valid_file_name: is_valid

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PATH_NAME

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLAIN_TEXT_FILE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files viewed as persistent sequences of ASCII characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    PLAIN_TEXT_FILE

inherit
    FILE
        rename
            index as position
        redefine
            is_plain_text
        end

create
    make,
    make_open_read,
    make_open_write,
    make_open_append,
    make_open_read_write,
    make_create_read_write,
    make_open_read_append

feature -- Status report

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)? (Yes)
        do
            Result := True
        end

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?

feature -- Output

    put_integer (i: INTEGER) is
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putint.
        do
            file_pi (file_pointer, i)
        end

    putint (i: INTEGER) is
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_integer.
        do
            file_pi (file_pointer, i)
        end

    put_boolean (b: BOOLEAN) is
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putbool.
        local
            ext_bool_str: ANY
        do
            if b then
                ext_bool_str := true_string.to_c
                file_ps (file_pointer, $ext_bool_str, true_string.count)
            else
                ext_bool_str := false_string.to_c
                file_ps (file_pointer, $ext_bool_str, false_string.count)
            end
        end

    putbool (b: BOOLEAN) is
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_boolean.
        local
            ext_bool_str: ANY
        do
            if b then
                ext_bool_str := true_string.to_c
                file_ps (file_pointer, $ext_bool_str, true_string.count)
            else
                ext_bool_str := false_string.to_c
                file_ps (file_pointer, $ext_bool_str, false_string.count)
            end
        end

    put_real (r: REAL) is
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putreal.
        do
            file_pr (file_pointer, r)
        end

    putreal (r: REAL) is
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_real.
        do
            file_pr (file_pointer, r)
        end

    put_double (d: DOUBLE) is
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putdouble.
        do
            file_pd (file_pointer, d)
        end

    putdouble (d: DOUBLE) is
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_double.
        do
            file_pd (file_pointer, d)
        end

feature -- Input

    read_integer is
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readint.
        do
            last_integer := file_gi (file_pointer)
        end

    readint is
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_integer.
        do
            last_integer := file_gi (file_pointer)
        end

    read_real is
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readreal.
        do
            last_real := file_gr (file_pointer)
        end

    readreal is
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_real.
        do
            last_real := file_gr (file_pointer)
        end

    read_double is
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readdouble.
        do
            last_double := file_gd (file_pointer)
        end

    readdouble is
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_double.
        do
            last_double := file_gd (file_pointer)
        end

feature {NONE} -- Implementation

    file_gi (file: POINTER): INTEGER is
            -- Get an integer from file
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_gr (file: POINTER): REAL is
            -- Read a real from file
        external
            "C (FILE *): EIF_REAL | %"eif_file.h%""
        end

    file_gd (file: POINTER): DOUBLE is
            -- Read a double from file
        external
            "C (FILE *): EIF_DOUBLE | %"eif_file.h%""
        end

    file_pi (file: POINTER; n: INTEGER) is
            -- Put n to end of file.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_pr (file: POINTER; r: REAL) is
            -- Put r to end of file.
        external
            "C (FILE *, EIF_REAL) | %"eif_file.h%""
        end

    file_pd (file: POINTER; d: DOUBLE) is
            -- Put d to end of file.
        external
            "C (FILE *, EIF_DOUBLE) | %"eif_file.h%""
        end

invariant

    plain_text: is_plain_text

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLAIN_TEXT_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLAIN_TEXT_FILE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PLAIN_TEXT_FILE

General
    cluster: base.kernel
    description: "Files viewed as persistent sequences of ASCII characters"
    create: make, make_open_read, make_open_append, make_open_read_append, make_open_write, make_open_read_write, make_create_read_write

Ancestors
    FILE

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    Support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] PLAIN_TEXT_FILE)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] PLAIN_TEXT_FILE)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make (fn: STRING)
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out

Constraints
    plain text

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLAIN_TEXT_FILE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files viewed as persistent sequences of ASCII characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    PLAIN_TEXT_FILE

create
    make,
    make_open_read,
    make_open_write,
    make_open_append,
    make_open_read_write,
    make_create_read_write,
    make_open_read_append

feature -- Initialization

    make (fn: STRING) is
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            name := fn
            mode := closed_file
            create last_string.make (256)
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed
        end

    make_create_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            create_read_write
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_append
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    make_open_read (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    make_open_read_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_append
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    make_open_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_write
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_write
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

feature -- Access

    access_date: INTEGER is
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.access_date
        end

    date: INTEGER is
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.date
        end

    descriptor: INTEGER is
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed
        do
            Result := file_fd (file_pointer)
            descriptor_available := True
        end

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO is
            -- Collected information about the file.
            -- (from FILE)
        do
            set_buffer
            Result := clone (buffered_file_info)
        end

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER is
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.group_id
        end

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    inode: INTEGER is
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.inode
        end

    item: CHARACTER is
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            read_character
            Result := last_character
            back
        end

    links: INTEGER is
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.links
        end

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    owner_name: STRING is
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.owner_name
        end

    position: INTEGER is
            -- Current cursor position.
            -- (from FILE)
        do
            if not is_closed then
                Result := file_tell (file_pointer)
            end
        end

    protection: INTEGER is
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.protection
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        do
            Result := c_retrieved (descriptor)
        ensure -- from IO_MEDIUM
            result_exists: Result /= void
        end

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER is
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.user_id
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    count: INTEGER is
            -- Size in bytes (0 if no associated physical file)
            -- (from FILE)
        do
            if exists then
                if not is_open_write then
                    set_buffer
                    Result := buffered_file_info.size
                else
                    Result := file_size (file_pointer)
                end
            end
        end

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    access_exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_access ($external_name, 0)
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)
        do
            Result := not is_closed and then (end_of_file or count = 0)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)
        do
            Result := is_closed
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    end_of_file: BOOLEAN is
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed
        do
            Result := file_feof (file_pointer)
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_exists ($external_name)
        ensure then -- from FILE
            unchanged_mode: mode = old mode
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from FILE)
        do
            Result := mode >= write_file
        end

    file_prunable: BOOLEAN is
            -- May items be removed?
            -- (from FILE)
        do
            Result := mode >= write_file and prunable
        end

    file_readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from FILE)
        do
            Result := (mode >= read_write_file or mode = read_file) and readable
        end

    file_writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from FILE)
        do
            Result := mode >= write_file
        end

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN is
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_executable
        end

    is_access_owner: BOOLEAN is
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_owner
        end

    is_access_readable: BOOLEAN is
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_readable
        end

    is_access_writable: BOOLEAN is
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_writable
        end

    is_block: BOOLEAN is
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_block
        end

    is_character: BOOLEAN is
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_character
        end

    is_closed: BOOLEAN is
            -- Is file closed?
            -- (from FILE)
        do
            Result := mode = closed_file
        end

    is_creatable: BOOLEAN is
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_creatable ($external_name)
        end

    is_device: BOOLEAN is
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_device
        end

    is_directory: BOOLEAN is
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_directory
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_executable: BOOLEAN is
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_executable
        end

    is_fifo: BOOLEAN is
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_fifo
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_open_append: BOOLEAN is
            -- Is file open for appending?
            -- (from FILE)
        do
            Result := mode = append_file or else mode = append_read_file
        end

    is_open_read: BOOLEAN is
            -- Is file open for reading?
            -- (from FILE)
        do
            Result := mode = read_file or else mode = read_write_file or else mode = append_read_file
        end

    is_open_write: BOOLEAN is
            -- Is file open for writing?
            -- (from FILE)
        do
            Result := mode = write_file or else mode = read_write_file or else mode = append_read_file or else mode = append_file
        end

    is_owner: BOOLEAN is
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_owner
        end

    is_plain: BOOLEAN is
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_plain
        end

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)? (Yes)
        do
            Result := True
        end

    is_readable: BOOLEAN is
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_readable
        end

    is_setgid: BOOLEAN is
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setgid
        end

    is_setuid: BOOLEAN is
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setuid
        end

    is_socket: BOOLEAN is
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_socket
        end

    is_sticky: BOOLEAN is
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_sticky
        end

    is_symlink: BOOLEAN is
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_symlink
        end

    is_writable: BOOLEAN is
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_writable
        end

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no item?
            -- (from FILE)
        do
            Result := (count = 0) or else is_closed or else end_of_file
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            Result := not off
        end

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature -- Status setting

    close is
            -- Close file.
            -- (from FILE)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        do
            file_close (file_pointer)
            mode := closed_file
            descriptor_available := False
        ensure then -- from FILE
            is_closed: is_closed
        end

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

    create_read_write is
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 4)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_append (fd: INTEGER) is
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 2)
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    fd_open_read (fd: INTEGER) is
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 0)
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    fd_open_read_append (fd: INTEGER) is
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_dopen (fd, 5)
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    fd_open_read_write (fd: INTEGER) is
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 3)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_write (fd: INTEGER) is
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 1)
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

    open_append is
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 2)
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    open_read is
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 0)
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    open_read_append is
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 5)
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    open_read_write is
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 3)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    open_write is
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 1)
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

    recreate_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 4, file_pointer)
            name := fname
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_append (fname: STRING) is
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 2, file_pointer)
            name := fname
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    reopen_read (fname: STRING) is
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := fname.to_c
            file_pointer := file_reopen ($external_name, 0, file_pointer)
            name := fname
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    reopen_read_append (fname: STRING) is
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 5, file_pointer)
            name := fname
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    reopen_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 3, file_pointer)
            name := fname
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_write (fname: STRING) is
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 1, file_pointer)
            name := fname
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Cursor movement

    back is
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before
        do
            file_move (file_pointer, - 1)
        end

    finish is
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed
        do
            file_recede (file_pointer, 0)
        end

    forth is
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed
        do
            file_move (file_pointer, 1)
        end

    go (abs_position: INTEGER) is
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_go (file_pointer, abs_position)
        end

    move (offset: INTEGER) is
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
        do
            file_move (file_pointer, offset)
        end

    next_line is
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable
        do
            file_tnil (file_pointer)
        end

    recede (abs_position: INTEGER) is
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_recede (file_pointer, abs_position)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed
        do
            file_go (file_pointer, 0)
        end

feature -- Element change

    add_permission (who, what: STRING) is
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 1)
        end

    append (f: like Current) is
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        do
            open_append
            f.open_read
            file_append (file_pointer, f.file_pointer, f.count)
            close
            f.close
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed
        end

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_basic_store (descriptor, $object)
        end

    change_date: INTEGER is
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.change_date
        end

    change_group (new_group_id: INTEGER) is
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chgrp ($external_name, new_group_id)
        end

    change_mode (mask: INTEGER) is
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chmod ($external_name, mask)
        end

    change_name (new_name: STRING) is
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        local
            ext_old_name, ext_new_name: ANY
        do
            ext_old_name := name.to_c
            ext_new_name := new_name.to_c
            file_rename ($ext_old_name, $ext_new_name)
            name := new_name
        ensure -- from FILE
            name_changed: name.is_equal (new_name)
        end

    change_owner (new_owner_id: INTEGER) is
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chown ($external_name, new_owner_id)
        end

    extend (v: CHARACTER) is
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        do
            put_character (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    flush is
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
        do
            file_flush (file_pointer)
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_general_store (descriptor, $object)
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_independent_store (descriptor, $object)
        end

    link (fn: STRING) is
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
            fn_name: ANY
        do
            external_name := name.to_c
            fn_name := fn.to_c
            file_link ($external_name, $fn_name)
        end

    new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_tnwl (file_pointer)
        end

    put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_character (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pc (file_pointer, c)
        end

    put_new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_tnwl (file_pointer)
        end

    put_string (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    putchar (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pc (file_pointer, c)
        end

    putstring (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    remove_permission (who, what: STRING) is
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 0)
        end

    set_access (time: INTEGER) is
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 0)
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date
        end

    set_date (time: INTEGER) is
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 1)
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time
        end

    stamp (time: INTEGER) is
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 2)
        ensure -- from FILE
            date_updated: date = time
        end

    touch is
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_touch ($external_name)
        ensure -- from FILE
            date_changed: date /= old date
        end

feature -- Removal

    delete is
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_unlink ($external_name)
        end

    dispose is
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)
        do
            if not is_closed then
                close
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    reset (fn: STRING) is
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        do
            name := fn
            if mode /= closed_file then
                close
            end
            last_integer := 0
            if last_string /= void then
                last_string.wipe_out
            end
            last_real := 0.0
            last_character := '%U'
            last_double := 0.0
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed
        end

    wipe_out is
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        do
            open_write
            close
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Conversion

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Obsolete

    lastchar: CHARACTER is
            -- Last character read by read_character
            -- (from IO_MEDIUM)
        do
            Result := last_character
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
            -- (from IO_MEDIUM)
        do
            Result := last_double
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)
        do
            Result := last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
            -- (from IO_MEDIUM)
        do
            Result := last_real
        end

    laststring: STRING is
            -- Last string read
            -- (from IO_MEDIUM)
        do
            Result := last_string
        end

feature {NONE} -- Inapplicable

    go_to (r: CURSOR) is
            -- Move to position marked r.
            -- (from FILE)
        do
        end

    prunable: BOOLEAN is
            -- Is there an item to be removed?
            -- (from FILE)
        do
        end

    prune (v: like item) is
            -- Remove an occurrence of v if any.
            -- (from FILE)
        require -- from COLLECTION
            prunable: prunable
        require else -- from FILE
            prunable: file_prunable
        do
        ensure then -- from FILE
            count <= old count
        end

    remove is
            -- Remove current item.
            -- (from FILE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else -- from FILE
            file_prunable: file_prunable
        do
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from FILE)
        require -- from ACTIVE
            writable: writable
        require else -- from FILE
            is_writable: file_writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        ensure then -- from FILE
            item = v
            count = old count
        end

feature {NONE} -- Implementation

    buffered_file_info: UNIX_FILE_INFO is
            -- Information about the file.
            -- (from FILE)
        once
            create Result.make
        end

    c_basic_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "estore"
        end

    c_general_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "eestore"
        end

    c_independent_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "sstore"
        end

    c_retrieved (file_handle: INTEGER): ANY is
            -- Object structured retrieved from file of pointer
            -- file_ptr
            -- (from FILE)
        external
            "C | %"eif_retrieve.h%""
        alias
            "eretrieve"
        end

    false_string: STRING is
            -- Character string "false"
            -- (from FILE)
        once
            Result := "False"
        end

    file_access (f_name: POINTER; which: INTEGER): BOOLEAN is
            -- Perform access test which on f_name using real UID.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_append (file, from_file: POINTER; length: INTEGER) is
            -- Append a copy of from_file to file
            -- (from FILE)
        external
            "C (FILE *, FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_chgrp (f_name: POINTER; new_group: INTEGER) is
            -- Change group of f_name to new_group
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_chmod (f_name: POINTER; mask: INTEGER) is
            -- Change mode of f_name to mask.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_chown (f_name: POINTER; new_owner: INTEGER) is
            -- Change owner of f_name to new_owner
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_close (file: POINTER) is
            -- Close file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_creatable (f_name: POINTER): BOOLEAN is
            -- Is f_name creatable.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_dopen (fd, how: INTEGER): POINTER is
            -- File pointer for file of descriptor fd in mode how
            -- (which must fit the way fd was obtained).
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_exists (f_name: POINTER): BOOLEAN is
            -- Does f_name exist.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_fd (file: POINTER): INTEGER is
            -- Operating system's file descriptor
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_feof (file: POINTER): BOOLEAN is
            -- End of file?
            -- (from FILE)
        external
            "C (FILE *): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_flush (file: POINTER) is
            -- Flush file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_gc (file: POINTER): CHARACTER is
            -- Access the next character
            -- (from FILE)
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_gd (file: POINTER): DOUBLE is
            -- Read a double from file
        external
            "C (FILE *): EIF_DOUBLE | %"eif_file.h%""
        end

    file_gi (file: POINTER): INTEGER is
            -- Get an integer from file
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_go (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from start.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_gr (file: POINTER): REAL is
            -- Read a real from file
        external
            "C (FILE *): EIF_REAL | %"eif_file.h%""
        end

    file_gs (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- a_string updated with characters read from file
            -- until new line, with begin characters already read.
            -- If it does not fit, result is length - begin + 1.
            -- If it fits, result is number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gss (file: POINTER; a_string: POINTER; length: INTEGER): INTEGER is
            -- Read min (length, remaining bytes in file) characters
            -- into a_string. If it does not fit, result is length + 1.
            -- Otherwise, result is the number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gw (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a string excluding white space and stripping
            -- leading white space from file into a_string.
            -- White space characters are: blank, new_line,
            -- tab, vertical tab, formfeed or end of file.
            -- If it does not fit, result is length - begin + 1,
            -- otherwise result is number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_lh (file: POINTER): CHARACTER is
            -- Look ahead in file and find out the value of the next
            -- character. Do not read over character.
            -- (from FILE)
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_link (from_name, to_name: POINTER) is
            -- Link to_name to from_name
            -- (from FILE)
        external
            "C (char *, char *) | %"eif_file.h%""
        end

    file_move (file: POINTER; offset: INTEGER) is
            -- Move file pointer by offset.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_open (f_name: POINTER; how: INTEGER): POINTER is
            -- File pointer for file f_name, in mode how.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_pc (file: POINTER; c: CHARACTER) is
            -- Put c to end of file.
            -- (from FILE)
        external
            "C (FILE *, EIF_CHARACTER) | %"eif_file.h%""
        end

    file_pd (file: POINTER; d: DOUBLE) is
            -- Put d to end of file.
        external
            "C (FILE *, EIF_DOUBLE) | %"eif_file.h%""
        end

    file_perm (f_name, who, what: POINTER; flag: INTEGER) is
            -- Change permissions for f_name to who and what.
            -- flag = 1 -> add permissions,
            -- flag = 0 -> remove permissions.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_pi (file: POINTER; n: INTEGER) is
            -- Put n to end of file.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_pr (file: POINTER; r: REAL) is
            -- Put r to end of file.
        external
            "C (FILE *, EIF_REAL) | %"eif_file.h%""
        end

    file_ps (file: POINTER; a_string: POINTER; length: INTEGER) is
            -- Print a_string to file.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_recede (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from end.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_rename (old_name, new_name: POINTER) is
            -- Change file name from old_name to new_name.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_reopen (f_name: POINTER; how: INTEGER; file: POINTER): POINTER is
            -- File pointer to file, reopened to have new name f_name
            -- in a mode specified by how.
            -- (from FILE)
        external
            "C (char *, EIF_INTEGER, FILE *): EIF_POINTER | %"eif_file.h%""
        end

    file_size (file: POINTER): INTEGER is
            -- Size of file
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tell (file: POINTER): INTEGER is
            -- Current cursor position in file.
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tnil (file: POINTER) is
            -- Read upto next input line.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_tnwl (file: POINTER) is
            -- Print a new-line to file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_touch (f_name: POINTER) is
            -- Touch file f_name.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_unlink (fname: POINTER) is
            -- Delete file fname.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_utime (f_name: POINTER; time, how: INTEGER) is
            -- Set access, modification time or both (how = 0,1,2) on
            -- f_name, using time as time stamp.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    set_buffer is
            -- Resynchronizes information on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            buffered_file_info.update (name)
        end

    true_string: STRING is
            -- Character string "true"
            -- (from FILE)
        once
            Result := "True"
        end

feature {FILE} -- Implementation

    Append_file: INTEGER is 3
            -- (from FILE)

    Append_read_file: INTEGER is 5
            -- (from FILE)

    Closed_file: INTEGER is 0
            -- (from FILE)

    mode: INTEGER
            -- Input-output mode
            -- (from FILE)

    Read_file: INTEGER is 1
            -- (from FILE)

    Read_write_file: INTEGER is 4
            -- (from FILE)

    set_read_mode is
            -- Define file mode as read.
            -- (from FILE)
        do
            mode := read_file
        end

    set_write_mode is
            -- Define file mode as write.
            -- (from FILE)
        do
            mode := write_file
        end

    Write_file: INTEGER is 2
            -- (from FILE)

feature -- Convenience

    copy_to (file: like Current) is
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read
        do
            read_stream (count)
            file.put_string (last_string)
            create last_string.make (256)
        end

feature -- Input

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    read_double is
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_double := file_gd (file_pointer)
        end

    read_integer is
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_integer := file_gi (file_pointer)
        end

    read_line is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    read_real is
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_real := file_gr (file_pointer)
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    read_word is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    readdouble is
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_double := file_gd (file_pointer)
        end

    readint is
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_integer := file_gi (file_pointer)
        end

    readline is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    readreal is
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_real := file_gr (file_pointer)
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    readword is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature -- Output

    put_boolean (b: BOOLEAN) is
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible
        local
            ext_bool_str: ANY
        do
            if b then
                ext_bool_str := true_string.to_c
                file_ps (file_pointer, $ext_bool_str, true_string.count)
            else
                ext_bool_str := false_string.to_c
                file_ps (file_pointer, $ext_bool_str, false_string.count)
            end
        end

    put_double (d: DOUBLE) is
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pd (file_pointer, d)
        end

    put_integer (i: INTEGER) is
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pi (file_pointer, i)
        end

    put_real (r: REAL) is
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pr (file_pointer, r)
        end

    putbool (b: BOOLEAN) is
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible
        local
            ext_bool_str: ANY
        do
            if b then
                ext_bool_str := true_string.to_c
                file_ps (file_pointer, $ext_bool_str, true_string.count)
            else
                ext_bool_str := false_string.to_c
                file_ps (file_pointer, $ext_bool_str, false_string.count)
            end
        end

    putdouble (d: DOUBLE) is
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pd (file_pointer, d)
        end

    putint (i: INTEGER) is
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pi (file_pointer, i)
        end

    putreal (r: REAL) is
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pr (file_pointer, r)
        end

invariant

    plain_text: is_plain_text
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLAIN_TEXT_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLAIN_TEXT_FILE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files viewed as persistent sequences of ASCII characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    PLAIN_TEXT_FILE

create

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

feature -- Initialization

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.
            -- (from FILE)

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    item: CHARACTER
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    position: INTEGER
            -- Current cursor position.
            -- (from FILE)

    protection: INTEGER
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

feature -- Measurement

    count: INTEGER
            -- Size in bytes (0 if no associated physical file)
            -- (from FILE)

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        ensure then -- from FILE
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?
            -- (from FILE)

    file_prunable: BOOLEAN
            -- May items be removed?
            -- (from FILE)

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from FILE)

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?
            -- (from FILE)

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)

    is_device: BOOLEAN
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?
            -- (from FILE)

    is_open_read: BOOLEAN
            -- Is file open for reading?
            -- (from FILE)

    is_open_write: BOOLEAN
            -- Is file open for writing?
            -- (from FILE)

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)? (Yes)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?
            -- (from FILE)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
            -- (from FILE)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then -- from FILE
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed

    forth
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed

    next_line
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure -- from FILE
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_real
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readreal
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    put_boolean (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    putbool (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

invariant

    plain_text: is_plain_text
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLAIN_TEXT_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLAIN_TEXT_FILE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PLAIN_TEXT_FILE

Ancestors
    FILE

Descendants
    CONSOLE

Clients
    PLAIN_TEXT_FILE
    STD_FILES

Suppliers
    PLAIN_TEXT_FILE
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLAIN_TEXT_FILE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files viewed as persistent sequences of ASCII characters"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    PLAIN_TEXT_FILE

create
    make,
    make_open_read,
    make_open_write,
    make_open_append,
    make_open_read_write,
    make_create_read_write,
    make_open_read_append

feature -- Status report

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)? (Yes)

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?

feature -- Output

    put_integer (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putint.

    putint (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_integer.

    put_boolean (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putbool.

    putbool (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_boolean.

    put_real (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putreal.

    putreal (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_real.

    put_double (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putdouble.

    putdouble (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_double.

feature -- Input

    read_integer
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readint.

    readint
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_integer.

    read_real
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readreal.

    readreal
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_real.

    read_double
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readdouble.

    readdouble
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_double.

invariant

    plain_text: is_plain_text

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLAIN_TEXT_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLATFORM Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Platform-dependent properties.
        This class is an ancestor to all developer-written classes.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    PLATFORM

feature -- Access bytes size

    boolean_bytes: INTEGER is
            -- Number of bytes in a value of type BOOLEAN
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_BOOLEAN)"
        end

    character_bytes: INTEGER is
            -- Number of bytes in a value of type CHARACTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_CHARACTER)"
        end

    wide_character_bytes: INTEGER is
            -- Number of bytes in a value of type WIDE_CHARACTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_WIDE_CHAR)"
        end

    integer_8_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER_8
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER_8)"
        end

    integer_16_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER_16
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER_16)"
        end

    integer_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER)"
        end

    integer_64_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER_64
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER_64)"
        end

    real_bytes: INTEGER is
            -- Number of bytes in a value of type REAL
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_REAL)"
        end

    double_bytes: INTEGER is
            -- Number of bytes in a value of type DOUBLE
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_DOUBLE)"
        end

    pointer_bytes: INTEGER is
            -- Number of bytes in a value of type POINTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_POINTER)"
        end

feature -- Access bits size

    boolean_bits: INTEGER is
            -- Number of bits in a value of type BOOLEAN
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esbool_size"
        end

    character_bits: INTEGER is
            -- Number of bits in a value of type CHARACTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "eschar_size"
        end

    integer_bits: INTEGER is
            -- Number of bits in a value of type INTEGER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esint_size"
        end

    real_bits: INTEGER is
            -- Number of bits in a value of type REAL
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esreal_size"
        end

    double_bits: INTEGER is
            -- Number of bits in a value of type DOUBLE
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esdouble_size"
        end

    pointer_bits: INTEGER is
            -- Number of bits in a value of type POINTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esptr_size"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLATFORM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLATFORM Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PLATFORM

General
    cluster: base.kernel
    description:
        "Platform-dependent properties.
        This class is an ancestor to all developer-written classes."

Ancestors
    ANY

Queries
    boolean_bits: INTEGER
    boolean_bytes: INTEGER
    character_bits: INTEGER
    character_bytes: INTEGER
    double_bits: INTEGER
    double_bytes: INTEGER
    integer_16_bytes: INTEGER
    integer_64_bytes: INTEGER
    integer_8_bytes: INTEGER
    integer_bits: INTEGER
    integer_bytes: INTEGER
    pointer_bits: INTEGER
    pointer_bytes: INTEGER
    real_bits: INTEGER
    real_bytes: INTEGER
    wide_character_bytes: INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLATFORM Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Platform-dependent properties.
        This class is an ancestor to all developer-written classes.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    PLATFORM

feature -- Access bits size

    boolean_bits: INTEGER is
            -- Number of bits in a value of type BOOLEAN
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esbool_size"
        end

    character_bits: INTEGER is
            -- Number of bits in a value of type CHARACTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "eschar_size"
        end

    double_bits: INTEGER is
            -- Number of bits in a value of type DOUBLE
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esdouble_size"
        end

    integer_bits: INTEGER is
            -- Number of bits in a value of type INTEGER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esint_size"
        end

    pointer_bits: INTEGER is
            -- Number of bits in a value of type POINTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esptr_size"
        end

    real_bits: INTEGER is
            -- Number of bits in a value of type REAL
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "esreal_size"
        end

feature -- Access bytes size

    boolean_bytes: INTEGER is
            -- Number of bytes in a value of type BOOLEAN
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_BOOLEAN)"
        end

    character_bytes: INTEGER is
            -- Number of bytes in a value of type CHARACTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_CHARACTER)"
        end

    double_bytes: INTEGER is
            -- Number of bytes in a value of type DOUBLE
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_DOUBLE)"
        end

    integer_16_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER_16
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER_16)"
        end

    integer_64_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER_64
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER_64)"
        end

    integer_8_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER_8
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER_8)"
        end

    integer_bytes: INTEGER is
            -- Number of bytes in a value of type INTEGER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_INTEGER)"
        end

    pointer_bytes: INTEGER is
            -- Number of bytes in a value of type POINTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_POINTER)"
        end

    real_bytes: INTEGER is
            -- Number of bytes in a value of type REAL
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_REAL)"
        end

    wide_character_bytes: INTEGER is
            -- Number of bytes in a value of type WIDE_CHARACTER
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "sizeof(EIF_WIDE_CHAR)"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLATFORM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLATFORM Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Platform-dependent properties.
        This class is an ancestor to all developer-written classes.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    PLATFORM

feature -- Access bits size

    boolean_bits: INTEGER
            -- Number of bits in a value of type BOOLEAN

    character_bits: INTEGER
            -- Number of bits in a value of type CHARACTER

    double_bits: INTEGER
            -- Number of bits in a value of type DOUBLE

    integer_bits: INTEGER
            -- Number of bits in a value of type INTEGER

    pointer_bits: INTEGER
            -- Number of bits in a value of type POINTER

    real_bits: INTEGER
            -- Number of bits in a value of type REAL

feature -- Access bytes size

    boolean_bytes: INTEGER
            -- Number of bytes in a value of type BOOLEAN

    character_bytes: INTEGER
            -- Number of bytes in a value of type CHARACTER

    double_bytes: INTEGER
            -- Number of bytes in a value of type DOUBLE

    integer_16_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_16

    integer_64_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_64

    integer_8_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_8

    integer_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER

    pointer_bytes: INTEGER
            -- Number of bytes in a value of type POINTER

    real_bytes: INTEGER
            -- Number of bytes in a value of type REAL

    wide_character_bytes: INTEGER
            -- Number of bytes in a value of type WIDE_CHARACTER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLATFORM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLATFORM Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PLATFORM

Ancestors
    ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PLATFORM Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Platform-dependent properties.
        This class is an ancestor to all developer-written classes.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    PLATFORM

feature -- Access bytes size

    boolean_bytes: INTEGER
            -- Number of bytes in a value of type BOOLEAN

    character_bytes: INTEGER
            -- Number of bytes in a value of type CHARACTER

    wide_character_bytes: INTEGER
            -- Number of bytes in a value of type WIDE_CHARACTER

    integer_8_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_8

    integer_16_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_16

    integer_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER

    integer_64_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_64

    real_bytes: INTEGER
            -- Number of bytes in a value of type REAL

    double_bytes: INTEGER
            -- Number of bytes in a value of type DOUBLE

    pointer_bytes: INTEGER
            -- Number of bytes in a value of type POINTER

feature -- Access bits size

    boolean_bits: INTEGER
            -- Number of bits in a value of type BOOLEAN

    character_bits: INTEGER
            -- Number of bits in a value of type CHARACTER

    integer_bits: INTEGER
            -- Number of bits in a value of type INTEGER

    real_bits: INTEGER
            -- Number of bits in a value of type REAL

    double_bits: INTEGER
            -- Number of bits in a value of type DOUBLE

    pointer_bits: INTEGER
            -- Number of bits in a value of type POINTER

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLATFORM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects meant to be exchanged with non-Eiffel software."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class
    POINTER

inherit
    POINTER_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    POINTER

General
    cluster: base.kernel
    description: "References to objects meant to be exchanged with non-Eiffel software."

Ancestors
    POINTER_REF

Queries
    infix "+" (offset: INTEGER): [like Current] POINTER
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: POINTER
    out: STRING

Commands
    memory_copy (a_source: POINTER; a_size: INTEGER)
    memory_move (a_source: POINTER; a_size: INTEGER)
    memory_set (val, n: INTEGER)
    set_item (p: POINTER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects meant to be exchanged with non-Eiffel software."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class
    POINTER

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
            -- (from POINTER_REF)
        do
            Result := (c_hashcode (item)).abs
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: POINTER
            -- Pointer value
            -- (from POINTER_REF)

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from POINTER_REF)
        do
            Result := item /= default_pointer
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (p: POINTER) is
            -- Make p the item value.
            -- (from POINTER_REF)
        do
            item := p
        end

feature {NONE} -- Implementation

    c_hashcode (p: POINTER): INTEGER is
            -- Hash code value of p
            -- (from POINTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_pi"
        end

    c_memcpy (destination, source: POINTER; count: INTEGER) is
            -- C memcpy
            -- (from POINTER_REF)
        external
            "C (void *, const void *, size_t) | <string.h>"
        alias
            "memcpy"
        end

    c_memmove (destination, source: POINTER; count: INTEGER) is
            -- C memmove
            -- (from POINTER_REF)
        external
            "C (void *, const void *, size_t) | <string.h>"
        alias
            "memmove"
        end

    c_memset (source: POINTER; val: INTEGER; count: INTEGER) is
            -- C memset
            -- (from POINTER_REF)
        external
            "C (void *, int, size_t) | <string.h>"
        alias
            "memset"
        end

    c_offset_pointer (p: POINTER; o: INTEGER): POINTER is
            -- Pointer moved by an offset of o bytes from p.
            -- (from POINTER_REF)
        external
            "C [macro %"eif_macros.h%"]"
        alias
            "RTPOF"
        end

    c_outp (p: POINTER): STRING is
            -- Printable representation of pointer value
            -- (from POINTER_REF)
        external
            "C | %"eif_out.h%""
        end

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER) is
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer
        do
            c_memcpy (item, a_source, a_size)
        end

    memory_move (a_source: POINTER; a_size: INTEGER) is
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer
        do
            c_memmove (item, a_source, a_size)
        end

    memory_set (val, n: INTEGER) is
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_val: val >= 0
            valid_n: n >= 0
        do
            c_memset (item, val, n)
        end

feature -- Operations

    infix "+" (offset: INTEGER): like Current is
            -- Pointer moved by an offset of offset bytes.
            -- (from POINTER_REF)
        do
            create Result
            Result.set_item (c_offset_pointer (item, offset))
        end

feature -- Output

    out: STRING is
            -- Printable representation of pointer value
            -- (from POINTER_REF)
        do
            Result := c_outp (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects meant to be exchanged with non-Eiffel software."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    POINTER

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from POINTER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: POINTER
            -- Pointer value
            -- (from POINTER_REF)

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from POINTER_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (p: POINTER)
            -- Make p the item value.
            -- (from POINTER_REF)

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_move (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_set (val, n: INTEGER)
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_val: val >= 0
            valid_n: n >= 0

feature -- Operations

    infix "+" (offset: INTEGER): like Current
            -- Pointer moved by an offset of offset bytes.
            -- (from POINTER_REF)

feature -- Output

    out: STRING
            -- Printable representation of pointer value
            -- (from POINTER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    POINTER

Ancestors
    POINTER_REF

Clients
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        References to objects containing reference to object
        meant to be exchanged with non-Eiffel software.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    POINTER_REF

inherit
    HASHABLE
        redefine
            out,
            is_hashable
        end

feature -- Access

    item: POINTER
            -- Pointer value

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := (c_hashcode (item)).abs
        end

feature -- Element change

    set_item (p: POINTER) is
            -- Make p the item value.
        do
            item := p
        end

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= default_pointer
        end

feature -- Operations

    infix "+" (offset: INTEGER): like Current is
            -- Pointer moved by an offset of offset bytes.
        do
            create Result
            Result.set_item (c_offset_pointer (item, offset))
        end

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER) is
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer
        do
            c_memcpy (item, a_source, a_size)
        end

    memory_move (a_source: POINTER; a_size: INTEGER) is
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer
        do
            c_memmove (item, a_source, a_size)
        end

    memory_set (val, n: INTEGER) is
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
        require
            valid_val: val >= 0
            valid_n: n >= 0
        do
            c_memset (item, val, n)
        end

feature -- Output

    out: STRING is
            -- Printable representation of pointer value
        do
            Result := c_outp (item)
        end

feature {NONE} -- Implementation

    c_outp (p: POINTER): STRING is
            -- Printable representation of pointer value
        external
            "C | %"eif_out.h%""
        end

    c_hashcode (p: POINTER): INTEGER is
            -- Hash code value of p
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_pi"
        end

    c_offset_pointer (p: POINTER; o: INTEGER): POINTER is
            -- Pointer moved by an offset of o bytes from p.
        external
            "C [macro %"eif_macros.h%"]"
        alias
            "RTPOF"
        end

    c_memcpy (destination, source: POINTER; count: INTEGER) is
            -- C memcpy
        external
            "C (void *, const void *, size_t) | <string.h>"
        alias
            "memcpy"
        end

    c_memmove (destination, source: POINTER; count: INTEGER) is
            -- C memmove
        external
            "C (void *, const void *, size_t) | <string.h>"
        alias
            "memmove"
        end

    c_memset (source: POINTER; val: INTEGER; count: INTEGER) is
            -- C memset
        external
            "C (void *, int, size_t) | <string.h>"
        alias
            "memset"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    POINTER_REF

General
    cluster: base.kernel
    description:
        "References to objects containing reference to object
        meant to be exchanged with non-Eiffel software."

Ancestors
    HASHABLE

Queries
    infix "+" (offset: INTEGER): [like Current] POINTER_REF
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: POINTER
    out: STRING

Commands
    memory_copy (a_source: POINTER; a_size: INTEGER)
    memory_move (a_source: POINTER; a_size: INTEGER)
    memory_set (val, n: INTEGER)
    set_item (p: POINTER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        References to objects containing reference to object
        meant to be exchanged with non-Eiffel software.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    POINTER_REF

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := (c_hashcode (item)).abs
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: POINTER
            -- Pointer value

feature -- Status report

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= default_pointer
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (p: POINTER) is
            -- Make p the item value.
        do
            item := p
        end

feature {NONE} -- Implementation

    c_hashcode (p: POINTER): INTEGER is
            -- Hash code value of p
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_pi"
        end

    c_memcpy (destination, source: POINTER; count: INTEGER) is
            -- C memcpy
        external
            "C (void *, const void *, size_t) | <string.h>"
        alias
            "memcpy"
        end

    c_memmove (destination, source: POINTER; count: INTEGER) is
            -- C memmove
        external
            "C (void *, const void *, size_t) | <string.h>"
        alias
            "memmove"
        end

    c_memset (source: POINTER; val: INTEGER; count: INTEGER) is
            -- C memset
        external
            "C (void *, int, size_t) | <string.h>"
        alias
            "memset"
        end

    c_offset_pointer (p: POINTER; o: INTEGER): POINTER is
            -- Pointer moved by an offset of o bytes from p.
        external
            "C [macro %"eif_macros.h%"]"
        alias
            "RTPOF"
        end

    c_outp (p: POINTER): STRING is
            -- Printable representation of pointer value
        external
            "C | %"eif_out.h%""
        end

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER) is
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer
        do
            c_memcpy (item, a_source, a_size)
        end

    memory_move (a_source: POINTER; a_size: INTEGER) is
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer
        do
            c_memmove (item, a_source, a_size)
        end

    memory_set (val, n: INTEGER) is
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
        require
            valid_val: val >= 0
            valid_n: n >= 0
        do
            c_memset (item, val, n)
        end

feature -- Operations

    infix "+" (offset: INTEGER): like Current is
            -- Pointer moved by an offset of offset bytes.
        do
            create Result
            Result.set_item (c_offset_pointer (item, offset))
        end

feature -- Output

    out: STRING is
            -- Printable representation of pointer value
        do
            Result := c_outp (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        References to objects containing reference to object
        meant to be exchanged with non-Eiffel software.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    POINTER_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: POINTER
            -- Pointer value

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (p: POINTER)
            -- Make p the item value.

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_move (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_set (val, n: INTEGER)
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
        require
            valid_val: val >= 0
            valid_n: n >= 0

feature -- Operations

    infix "+" (offset: INTEGER): like Current
            -- Pointer moved by an offset of offset bytes.

feature -- Output

    out: STRING
            -- Printable representation of pointer value

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    POINTER_REF

Ancestors
    HASHABLE

Descendants
    POINTER

Clients
    DLL_32_ROUTINE
    POINTER_REF
    TUPLE

Suppliers
    INTEGER
    POINTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        References to objects containing reference to object
        meant to be exchanged with non-Eiffel software.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    POINTER_REF

feature -- Access

    item: POINTER
            -- Pointer value

    hash_code: INTEGER
            -- Hash code value

feature -- Element change

    set_item (p: POINTER)
            -- Make p the item value.

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Operations

    infix "+" (offset: INTEGER): like Current
            -- Pointer moved by an offset of offset bytes.

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_move (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_set (val, n: INTEGER)
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
        require
            valid_val: val >= 0
            valid_n: n >= 0

feature -- Output

    out: STRING
            -- Printable representation of pointer value

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


POINTER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects meant to be exchanged with non-Eiffel software."
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    POINTER

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROCEDURE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a procedure.
        with some operands possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and no further
        redefinition of `is_equal' and `copy'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

inherit
    ROUTINE [BASE_TYPE, OPEN_ARGS]

feature -- Calls

    apply is
            -- Call procedure with operands as last set.
        do
            rout_set_cargs
            rout_obj_call_procedure (rout_disp, rout_cargs)
        end

feature {NONE} -- Implementation

    rout_obj_call_procedure (rout: POINTER; args: POINTER) is
            -- Perform call to rout with args.
        external
            "C [macro %"eif_rout_obj.h%"]"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROCEDURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROCEDURE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

General
    cluster: base.kernel
    description:
        "Objects representing delayed calls to a procedure.
        with some operands possibly still open."

Ancestors
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Queries
    callable: BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] PROCEDURE [BASE_TYPE, OPEN_ARGS]): BOOLEAN
    is_hashable: BOOLEAN
    open_count: INTEGER
    open_operand_type (i: INTEGER): INTEGER
    operands: OPEN_ARGS
    postcondition (args: [like operands] OPEN_ARGS): BOOLEAN
    precondition (args: [like operands] OPEN_ARGS): BOOLEAN
    target: ANY
    valid_operands (args: OPEN_ARGS): BOOLEAN

Commands
    adapt (other: ROUTINE [ANY, OPEN_ARGS])
    apply
    call (args: OPEN_ARGS)
    copy (other: [like Current] PROCEDURE [BASE_TYPE, OPEN_ARGS])
    set_operands (args: OPEN_ARGS)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROCEDURE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a procedure.
        with some operands possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and no further
        redefinition of `is_equal' and `copy'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS]) is
            -- Initialize from other.
            -- Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
            operands := other.operands
            operands_set_by_user := other.operands_set_by_user
            closed_operands := other.closed_operands
            open_map := other.open_map
            closed_map := other.closed_map
            rout_disp := other.rout_disp
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable
        end

feature -- Access

    hash_code: INTEGER is
            -- Hash code value.
            -- (from ROUTINE)
        do
            Result := rout_disp.hash_code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    open_operand_type (i: INTEGER): INTEGER is
            -- Type of ith open operand.
            -- (from ROUTINE)
        require -- from ROUTINE
            positive: i >= 1
            within_bounds: i <= open_count
        do
            if open_types = void then
                create open_types.make (1, open_map.count)
            end
            Result := open_types.item (i)
            if Result = 0 then
                Result := eif_gen_param_id (- 1, eif_gen_create ($Current, 2), i)
                open_types.force (Result, i)
            end
        end

    operands: OPEN_ARGS
            -- Open operands.
            -- (from ROUTINE)

    postcondition (args: like operands): BOOLEAN is
            -- Does current state satisfy routine's
            -- postcondition for args?
            -- (from ROUTINE)
        do
            Result := True
        end

    precondition (args: like operands): BOOLEAN is
            -- Do args satisfy routine's precondition
            -- in current state?
            -- (from ROUTINE)
        do
            Result := True
        end

    target: ANY is
            -- Target of call.
            -- (from ROUTINE)
        do
            if closed_map.count > 0 and then closed_map.item (closed_map.lower) = 0 then
                Result := closed_operands.item (closed_operands.lower)
            elseif operands /= void and then operands.count > 0 then
                Result := operands.item (operands.lower)
            end
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    open_count: INTEGER is
            -- Number of open operands.
            -- (from ROUTINE)
        do
            if open_map /= void then
                Result := open_map.count
            end
        end

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    callable: BOOLEAN is
            -- Can routine be called on current object?
            -- (from ROUTINE)
        local
            null_ptr: POINTER
        do
            Result := (rout_disp /= null_ptr)
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is associated routine the same as the one
            -- associated with other.
            -- (from ROUTINE)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := equal (operands, other.operands) and then equal (closed_operands, other.closed_operands) and then equal (open_map, other.open_map) and then equal (closed_map, other.closed_map) and then (rout_disp = other.rout_disp)
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    valid_operands (args: OPEN_ARGS): BOOLEAN is
            -- Are args valid operands for this routine?
            -- (from ROUTINE)
        local
            i: INTEGER
            mismatch: BOOLEAN
            arg: ANY
            arg_type_code: CHARACTER
            open_arg_type_code: CHARACTER
            a_boolean_ref: BOOLEAN_REF
            a_character_ref: CHARACTER_REF
            a_double_ref: DOUBLE_REF
            an_integer_ref: INTEGER_REF
            a_pointer_ref: POINTER_REF
            a_real_ref: REAL_REF
            int: INTERNAL
        do
            if args = void or open_map = void then
                Result := (open_map = void)
            elseif open_map /= void and then args.count >= open_map.count then
                from
                    create int
                    i := 1
                until
                    i > open_map.count or mismatch
                loop
                    arg := args.item (i)
                    arg_type_code := args.arg_item_code (i)
                    open_arg_type_code := open_type_codes.item (i + 1)
                    if arg_type_code = 'r' then
                        inspect open_arg_type_code
                        when 'b' then
                            a_boolean_ref ?= arg;
                            mismatch := a_boolean_ref = void
                        when 'c' then
                            a_character_ref ?= arg;
                            mismatch := a_character_ref = void
                        when 'd' then
                            a_double_ref ?= arg;
                            mismatch := a_double_ref = void
                        when 'i' then
                            an_integer_ref ?= arg;
                            mismatch := an_integer_ref = void
                        when 'p' then
                            a_pointer_ref ?= arg;
                            mismatch := a_pointer_ref = void
                        when 'f' then
                            a_real_ref ?= arg;
                            mismatch := a_real_ref = void
                        when 'r' then
                            if arg /= void and then not eif_gen_conf (int.dynamic_type (arg), open_operand_type (i)) then
                                mismatch := True
                            end
                        end
                    else
                        if arg_type_code /= open_arg_type_code and (open_arg_type_code = 'r' implies open_operand_type (i) > 0) then
                            mismatch := True
                        end
                    end
                    i := i + 1
                end;
                Result := not mismatch
            end
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Element change

    set_operands (args: OPEN_ARGS) is
            -- Use args as operands for next call.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
        do
            operands := args
            operands_set_by_user := True
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Duplication

    copy (other: like Current) is
            -- Use same routine as other.
            -- (from ROUTINE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
            operands := other.operands
            operands_set_by_user := other.operands_set_by_user
            closed_operands := other.closed_operands
            open_map := other.open_map
            closed_map := other.closed_map
            rout_disp := other.rout_disp
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ROUTINE
            same_call_status: other.callable implies callable
        end

feature -- Basic operations

    call (args: OPEN_ARGS) is
            -- Call routine with operands args.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
            callable: callable
        do
            operands := args
            apply
            if not operands_set_by_user then
                operands := void
            end
        end

feature -- Obsolete

    adapt_from (other: like Current) is
        obsolete "Please use `adapt' instead (it's also a creation procedure)"
            -- Adapt from other. Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        do
            adapt (other)
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable
        end

    arguments: OPEN_ARGS is
        obsolete "use operands"
            -- (from ROUTINE)
        do
            Result := operands
        end

    set_arguments (args: OPEN_ARGS) is
        obsolete "use set_operands"
            -- (from ROUTINE)
        do
            set_operands (args)
        end

    valid_arguments (args: OPEN_ARGS): BOOLEAN is
        obsolete "use valid_operands"
            -- (from ROUTINE)
        do
            Result := valid_operands (args)
        end

feature {NONE} -- Implementation

    dispose is
            -- Free routine argument union structure
            -- (from ROUTINE)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    frozen internal_closed_type_codes: STRING
            -- (from ROUTINE)

    frozen internal_open_type_codes: STRING
            -- (from ROUTINE)

    frozen rout_cargs: POINTER
            -- Routine operands
            -- (from ROUTINE)

    rout_obj_call_procedure (rout: POINTER; args: POINTER) is
            -- Perform call to rout with args.
        external
            "C [macro %"eif_rout_obj.h%"]"
        end

    frozen rout_set_cargs is
            -- Allocate and fill argument structure
            -- (from ROUTINE)
        local
            new_args: POINTER
            i, j, ocnt, ccnt: INTEGER
            code: CHARACTER
            ref_arg: ANY
            null_ptr: POINTER
            was_on: BOOLEAN
            loc_open_map: like open_map
            loc_closed_map: like closed_map
            loc_operands: like operands
            loc_closed_operands: like closed_operands
            loc_open_type_codes: like open_type_codes
            loc_closed_type_codes: like closed_type_codes
        do
            was_on := collecting
            collection_off
            loc_open_map := open_map
            if loc_open_map /= void then
                ocnt := loc_open_map.count
                loc_open_type_codes := open_type_codes
                loc_operands := operands
            end
            loc_closed_map := closed_map
            if loc_closed_map /= void then
                ccnt := loc_closed_map.count
                loc_closed_type_codes := closed_type_codes
                loc_closed_operands := closed_operands
            end
            if rout_cargs = null_ptr then
                new_args := rout_obj_new_args (ocnt + ccnt + 1)
                rout_cargs := new_args
            else
                new_args := rout_cargs
            end
            from
                i := 1
            until
                i > ocnt
            loop
                code := loc_open_type_codes.item (i + 1)
                check
                    loc_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_operands.real_item (i)
                else
                    ref_arg := loc_operands.item (i)
                end
                j := loc_open_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            from
                i := 1
            until
                i > ccnt
            loop
                code := loc_closed_type_codes.item (i)
                check
                    loc_closed_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_closed_operands.real_item (i)
                else
                    ref_arg := loc_closed_operands.item (i)
                end
                j := loc_closed_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            if was_on then
                collection_on
            end
        rescue
            if was_on then
                collection_on
            end
        end

feature {ROUTINE, E_FEATURE} -- Implementation

    frozen closed_map: ARRAY [INTEGER]
            -- Index map for closed arguments
            -- (from ROUTINE)

    frozen closed_operands: TUPLE
            -- Closed arguments provided at creation time
            -- (from ROUTINE)

    closed_type_codes: STRING is
            -- Type codes for closed arguments
            -- (from ROUTINE)
        do
            if closed_operands /= void and internal_closed_type_codes = void then
                internal_closed_type_codes := eif_gen_tuple_typecode_str ($closed_operands)
            end
            Result := internal_closed_type_codes
        end

    frozen eiffel_rout_disp: POINTER
            -- Eiffel routine dispatcher
            -- (from ROUTINE)

    frozen open_map: ARRAY [INTEGER]
            -- Index map for open arguments
            -- (from ROUTINE)

    open_type_codes: STRING is
            -- Type codes for open arguments
            -- (from ROUTINE)
        do
            if internal_open_type_codes = void then
                internal_open_type_codes := eif_gen_typecode_str ($Current)
            end
            Result := internal_open_type_codes
        end

    frozen open_types: ARRAY [INTEGER]
            -- Types of open operands
            -- (from ROUTINE)

    frozen operands_set_by_user: BOOLEAN
            -- Are operands set throug call to set_operands.
            -- If not, we can delete them after routine call for
            -- later collection.
            -- (from ROUTINE)

    frozen rout_disp: POINTER
            -- Routine dispatcher
            -- (from ROUTINE)

    frozen set_rout_args (closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
            -- (from ROUTINE)
        require -- from ROUTINE
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

    frozen set_rout_disp (p: POINTER; tp: POINTER; closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
            -- (from ROUTINE)
        require -- from ROUTINE
            p_not_void: p /= default_pointer
            tp_not_void: tp /= default_pointer
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            rout_disp := p
            eiffel_rout_disp := tp
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

feature -- Calls

    apply is
            -- Call procedure with operands as last set.
        require -- from ROUTINE
            valid_operands: valid_operands (operands)
            callable: callable
        do
            rout_set_cargs
            rout_obj_call_procedure (rout_disp, rout_cargs)
        end

feature {NONE} -- Externals

    eif_gen_conf (type1, type2: INTEGER): BOOLEAN is
            -- Does type1 conform to type2?
            -- (from ROUTINE)
        external
            "C (int16, int16): EIF_BOOLEAN | %"eif_gen_conf.h%""
        end

    eif_gen_create (obj: POINTER; pos: INTEGER): POINTER is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_param_id (stype: INTEGER; obj: POINTER; pos: INTEGER): INTEGER is
            -- Type of generic parameter in obj at position pos.
            -- (from ROUTINE)
        external
            "C (int16, EIF_REFERENCE, int): EIF_INTEGER | %"eif_gen_conf.h%""
        end

    eif_gen_tuple_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode (obj: POINTER; pos: INTEGER): CHARACTER is
            -- Code for generic parameter pos in obj.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
            -- (from ROUTINE)
        external
            "C | %"eif_gen_conf.h%""
        end

    rout_obj_free_args (args: POINTER) is
            -- Free args.
            -- (from ROUTINE)
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_new_args (cnt: INTEGER): POINTER is
            -- Initialize for new operands.
            -- (from ROUTINE)
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_putb (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putd (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putf (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti16 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti32 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti64 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti8 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putp (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putr (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putwc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
            -- (from ROUTINE)
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

feature {NONE} -- Runtime constants

    Eif_boolean_code: CHARACTER is 'b'
            -- (from ROUTINE)

    Eif_character_code: CHARACTER is 'c'
            -- (from ROUTINE)

    Eif_double_code: CHARACTER is 'd'
            -- (from ROUTINE)

    Eif_integer_16_code: CHARACTER is 'k'
            -- (from ROUTINE)

    Eif_integer_64_code: CHARACTER is 'l'
            -- (from ROUTINE)

    Eif_integer_8_code: CHARACTER is 'j'
            -- (from ROUTINE)

    Eif_integer_code: CHARACTER is 'i'
            -- (from ROUTINE)

    Eif_pointer_code: CHARACTER is 'p'
            -- (from ROUTINE)

    Eif_real_code: CHARACTER is 'f'
            -- (from ROUTINE)

    Eif_reference_code: CHARACTER is 'r'
            -- (from ROUTINE)

    Eif_wide_char_code: CHARACTER is 'u'
            -- Type constants used by runtime to recognize types
            -- needed to perform call
            -- (from ROUTINE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROCEDURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROCEDURE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a procedure.
        with some operands possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and no further
        redefinition of `is_equal' and `copy'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS])
            -- Initialize from other.
            -- Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Access

    hash_code: INTEGER
            -- Hash code value.
            -- (from ROUTINE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    open_operand_type (i: INTEGER): INTEGER
            -- Type of ith open operand.
            -- (from ROUTINE)
        require -- from ROUTINE
            positive: i >= 1
            within_bounds: i <= open_count

    operands: OPEN_ARGS
            -- Open operands.
            -- (from ROUTINE)

    postcondition (args: like operands): BOOLEAN
            -- Does current state satisfy routine's
            -- postcondition for args?
            -- (from ROUTINE)

    precondition (args: like operands): BOOLEAN
            -- Do args satisfy routine's precondition
            -- in current state?
            -- (from ROUTINE)

    target: ANY
            -- Target of call.
            -- (from ROUTINE)

feature -- Measurement

    open_count: INTEGER
            -- Number of open operands.
            -- (from ROUTINE)

feature -- Status report

    callable: BOOLEAN
            -- Can routine be called on current object?
            -- (from ROUTINE)

    is_equal (other: like Current): BOOLEAN
            -- Is associated routine the same as the one
            -- associated with other.
            -- (from ROUTINE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    valid_operands (args: OPEN_ARGS): BOOLEAN
            -- Are args valid operands for this routine?
            -- (from ROUTINE)

feature -- Element change

    set_operands (args: OPEN_ARGS)
            -- Use args as operands for next call.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)

feature -- Duplication

    copy (other: like Current)
            -- Use same routine as other.
            -- (from ROUTINE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Basic operations

    call (args: OPEN_ARGS)
            -- Call routine with operands args.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
            callable: callable

feature -- Calls

    apply
            -- Call procedure with operands as last set.
        require -- from ROUTINE
            valid_operands: valid_operands (operands)
            callable: callable

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROCEDURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROCEDURE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Ancestors
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    DIRECTORY
    LINEAR [G]
    LINEAR_ITERATOR [G]
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Suppliers
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROCEDURE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a procedure.
        with some operands possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and no further
        redefinition of `is_equal' and `copy'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Calls

    apply
            -- Call procedure with operands as last set.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROCEDURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RAW_FILE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files, viewed as persistent sequences of bytes"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    RAW_FILE

inherit
    FILE
        rename
            index as position
        redefine
            file_reopen,
            file_open,
            file_dopen
        end

create
    make,
    make_open_read,
    make_open_write,
    make_open_append,
    make_open_read_write,
    make_create_read_write,
    make_open_read_append

feature -- Status report

    Support_storable: BOOLEAN is True
            -- Can medium be used to an Eiffel structure?

feature -- Output

    put_integer (i: INTEGER) is
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of putint.
        do
            file_pib (file_pointer, i)
        end

    putint (i: INTEGER) is
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of put_integer.
        do
            file_pib (file_pointer, i)
        end

    put_boolean (b: BOOLEAN) is
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of putbool.
        do
            if b then
                put_character ('%/1/')
            else
                put_character ('%U')
            end
        end

    putbool (b: BOOLEAN) is
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of put_boolean.
        do
            if b then
                put_character ('%/1/')
            else
                put_character ('%U')
            end
        end

    put_real (r: REAL) is
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of putreal.
        do
            file_prb (file_pointer, r)
        end

    putreal (r: REAL) is
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of put_real.
        do
            file_prb (file_pointer, r)
        end

    put_double (d: DOUBLE) is
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of putdouble.
        do
            file_pdb (file_pointer, d)
        end

    putdouble (d: DOUBLE) is
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of put_double.
        do
            file_pdb (file_pointer, d)
        end

feature -- Input

    read_integer is
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of readint.
        do
            last_integer := file_gib (file_pointer)
        end

    readint is
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of read_integer.
        do
            last_integer := file_gib (file_pointer)
        end

    read_real is
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of readreal.
        do
            last_real := file_grb (file_pointer)
        end

    readreal is
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of read_real.
        do
            last_real := file_grb (file_pointer)
        end

    read_double is
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of readdouble.
        do
            last_double := file_gdb (file_pointer)
        end

    readdouble is
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of read_double.
        do
            last_double := file_gdb (file_pointer)
        end

feature {NONE} -- Implementation

    file_gib (file: POINTER): INTEGER is
            -- Get an integer from file
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_grb (file: POINTER): REAL is
            -- Read a real from file
        external
            "C (FILE *): EIF_REAL | %"eif_file.h%""
        end

    file_gdb (file: POINTER): DOUBLE is
            -- Read a double from file
        external
            "C (FILE *): EIF_DOUBLE | %"eif_file.h%""
        end

    file_open (f_name: POINTER; how: INTEGER): POINTER is
            -- File pointer for file f_name, in mode how.
        external
            "C | %"eif_file.h%""
        alias
            "file_binary_open"
        end

    file_dopen (fd, how: INTEGER): POINTER is
            -- File pointer for file of descriptor fd in mode how
            -- (which must fit the way fd was obtained).
        external
            "C | %"eif_file.h%""
        alias
            "file_binary_dopen"
        end

    file_reopen (f_name: POINTER; how: INTEGER; file: POINTER): POINTER is
            -- File pointer to file, reopened to have new name f_name
            -- in a mode specified by how.
        external
            "C (char *, EIF_INTEGER, FILE *): EIF_POINTER | %"eif_file.h%""
        alias
            "file_binary_reopen"
        end

    file_pib (file: POINTER; n: INTEGER) is
            -- Put n to end of file.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_prb (file: POINTER; r: REAL) is
            -- Put r to end of file.
        external
            "C (FILE *, EIF_REAL) | %"eif_file.h%""
        end

    file_pdb (file: POINTER; d: DOUBLE) is
            -- Put d to end of file.
        external
            "C (FILE *, EIF_DOUBLE) | %"eif_file.h%""
        end

invariant

    not_plain_text: not is_plain_text

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RAW_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RAW_FILE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    RAW_FILE

General
    cluster: base.kernel
    description: "Files, viewed as persistent sequences of bytes"
    create: make, make_open_read, make_open_append, make_open_read_append, make_open_write, make_open_read_write, make_create_read_write

Ancestors
    FILE

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    Support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] RAW_FILE)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] RAW_FILE)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make (fn: STRING)
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out

Constraints
    not plain text

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RAW_FILE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files, viewed as persistent sequences of bytes"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    RAW_FILE

create
    make,
    make_open_read,
    make_open_write,
    make_open_append,
    make_open_read_write,
    make_create_read_write,
    make_open_read_append

feature -- Initialization

    make (fn: STRING) is
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            name := fn
            mode := closed_file
            create last_string.make (256)
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed
        end

    make_create_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            create_read_write
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_append
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    make_open_read (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    make_open_read_append (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_append
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    make_open_read_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_read_write
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    make_open_write (fn: STRING) is
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        do
            make (fn)
            open_write
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

feature -- Access

    access_date: INTEGER is
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.access_date
        end

    date: INTEGER is
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.date
        end

    descriptor: INTEGER is
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed
        do
            Result := file_fd (file_pointer)
            descriptor_available := True
        end

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO is
            -- Collected information about the file.
            -- (from FILE)
        do
            set_buffer
            Result := clone (buffered_file_info)
        end

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER is
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.group_id
        end

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    inode: INTEGER is
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.inode
        end

    item: CHARACTER is
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            read_character
            Result := last_character
            back
        end

    links: INTEGER is
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.links
        end

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    owner_name: STRING is
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.owner_name
        end

    position: INTEGER is
            -- Current cursor position.
            -- (from FILE)
        do
            if not is_closed then
                Result := file_tell (file_pointer)
            end
        end

    protection: INTEGER is
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.protection
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        do
            Result := c_retrieved (descriptor)
        ensure -- from IO_MEDIUM
            result_exists: Result /= void
        end

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER is
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.user_id
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    count: INTEGER is
            -- Size in bytes (0 if no associated physical file)
            -- (from FILE)
        do
            if exists then
                if not is_open_write then
                    set_buffer
                    Result := buffered_file_info.size
                else
                    Result := file_size (file_pointer)
                end
            end
        end

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    access_exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_access ($external_name, 0)
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)
        do
            Result := not is_closed and then (end_of_file or count = 0)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)
        do
            Result := is_closed
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    end_of_file: BOOLEAN is
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed
        do
            Result := file_feof (file_pointer)
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    exists: BOOLEAN is
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_exists ($external_name)
        ensure then -- from FILE
            unchanged_mode: mode = old mode
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from FILE)
        do
            Result := mode >= write_file
        end

    file_prunable: BOOLEAN is
            -- May items be removed?
            -- (from FILE)
        do
            Result := mode >= write_file and prunable
        end

    file_readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from FILE)
        do
            Result := (mode >= read_write_file or mode = read_file) and readable
        end

    file_writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from FILE)
        do
            Result := mode >= write_file
        end

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN is
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_executable
        end

    is_access_owner: BOOLEAN is
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_owner
        end

    is_access_readable: BOOLEAN is
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_readable
        end

    is_access_writable: BOOLEAN is
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_access_writable
        end

    is_block: BOOLEAN is
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_block
        end

    is_character: BOOLEAN is
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_character
        end

    is_closed: BOOLEAN is
            -- Is file closed?
            -- (from FILE)
        do
            Result := mode = closed_file
        end

    is_creatable: BOOLEAN is
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            Result := file_creatable ($external_name)
        end

    is_device: BOOLEAN is
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_device
        end

    is_directory: BOOLEAN is
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_directory
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_executable: BOOLEAN is
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_executable
        end

    is_fifo: BOOLEAN is
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_fifo
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_open_append: BOOLEAN is
            -- Is file open for appending?
            -- (from FILE)
        do
            Result := mode = append_file or else mode = append_read_file
        end

    is_open_read: BOOLEAN is
            -- Is file open for reading?
            -- (from FILE)
        do
            Result := mode = read_file or else mode = read_write_file or else mode = append_read_file
        end

    is_open_write: BOOLEAN is
            -- Is file open for writing?
            -- (from FILE)
        do
            Result := mode = write_file or else mode = read_write_file or else mode = append_read_file or else mode = append_file
        end

    is_owner: BOOLEAN is
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_owner
        end

    is_plain: BOOLEAN is
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_plain
        end

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)
        do
        end

    is_readable: BOOLEAN is
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_readable
        end

    is_setgid: BOOLEAN is
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setgid
        end

    is_setuid: BOOLEAN is
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_setuid
        end

    is_socket: BOOLEAN is
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_socket
        end

    is_sticky: BOOLEAN is
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_sticky
        end

    is_symlink: BOOLEAN is
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_symlink
        end

    is_writable: BOOLEAN is
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            set_buffer
            Result := buffered_file_info.is_writable
        end

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no item?
            -- (from FILE)
        do
            Result := (count = 0) or else is_closed or else end_of_file
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            Result := not off
        end

    Support_storable: BOOLEAN is True
            -- Can medium be used to an Eiffel structure?

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature -- Status setting

    close is
            -- Close file.
            -- (from FILE)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        do
            file_close (file_pointer)
            mode := closed_file
            descriptor_available := False
        ensure then -- from FILE
            is_closed: is_closed
        end

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

    create_read_write is
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 4)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_append (fd: INTEGER) is
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 2)
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    fd_open_read (fd: INTEGER) is
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 0)
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    fd_open_read_append (fd: INTEGER) is
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_dopen (fd, 5)
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    fd_open_read_write (fd: INTEGER) is
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 3)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    fd_open_write (fd: INTEGER) is
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        do
            file_pointer := file_dopen (fd, 1)
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

    open_append is
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 2)
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    open_read is
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 0)
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    open_read_append is
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 5)
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    open_read_write is
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 3)
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    open_write is
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_open ($external_name, 1)
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

    recreate_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 4, file_pointer)
            name := fname
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_append (fname: STRING) is
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 2, file_pointer)
            name := fname
            mode := append_file
        ensure -- from FILE
            exists: exists
            open_append: is_open_append
        end

    reopen_read (fname: STRING) is
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := fname.to_c
            file_pointer := file_reopen ($external_name, 0, file_pointer)
            name := fname
            mode := read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
        end

    reopen_read_append (fname: STRING) is
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 5, file_pointer)
            name := fname
            mode := append_read_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append
        end

    reopen_read_write (fname: STRING) is
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 3, file_pointer)
            name := fname
            mode := read_write_file
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write
        end

    reopen_write (fname: STRING) is
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_pointer := file_reopen ($external_name, 1, file_pointer)
            name := fname
            mode := write_file
        ensure -- from FILE
            exists: exists
            open_write: is_open_write
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Cursor movement

    back is
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before
        do
            file_move (file_pointer, - 1)
        end

    finish is
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed
        do
            file_recede (file_pointer, 0)
        end

    forth is
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed
        do
            file_move (file_pointer, 1)
        end

    go (abs_position: INTEGER) is
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_go (file_pointer, abs_position)
        end

    move (offset: INTEGER) is
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
        do
            file_move (file_pointer, offset)
        end

    next_line is
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable
        do
            file_tnil (file_pointer)
        end

    recede (abs_position: INTEGER) is
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0
        do
            file_recede (file_pointer, abs_position)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed
        do
            file_go (file_pointer, 0)
        end

feature -- Element change

    add_permission (who, what: STRING) is
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 1)
        end

    append (f: like Current) is
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        do
            open_append
            f.open_read
            file_append (file_pointer, f.file_pointer, f.count)
            close
            f.close
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed
        end

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_basic_store (descriptor, $object)
        end

    change_date: INTEGER is
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            set_buffer
            Result := buffered_file_info.change_date
        end

    change_group (new_group_id: INTEGER) is
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chgrp ($external_name, new_group_id)
        end

    change_mode (mask: INTEGER) is
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chmod ($external_name, mask)
        end

    change_name (new_name: STRING) is
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        local
            ext_old_name, ext_new_name: ANY
        do
            ext_old_name := name.to_c
            ext_new_name := new_name.to_c
            file_rename ($ext_old_name, $ext_new_name)
            name := new_name
        ensure -- from FILE
            name_changed: name.is_equal (new_name)
        end

    change_owner (new_owner_id: INTEGER) is
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_chown ($external_name, new_owner_id)
        end

    extend (v: CHARACTER) is
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        do
            put_character (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    flush is
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
        do
            file_flush (file_pointer)
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_general_store (descriptor, $object)
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        do
            c_independent_store (descriptor, $object)
        end

    link (fn: STRING) is
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
            fn_name: ANY
        do
            external_name := name.to_c
            fn_name := fn.to_c
            file_link ($external_name, $fn_name)
        end

    new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_tnwl (file_pointer)
        end

    put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_character (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pc (file_pointer, c)
        end

    put_new_line is
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_tnwl (file_pointer)
        end

    put_string (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    putchar (c: CHARACTER) is
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pc (file_pointer, c)
        end

    putstring (s: STRING) is
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        local
            ext_s: ANY
        do
            if s.count /= 0 then
                ext_s := s.area
                file_ps (file_pointer, $ext_s, s.count)
            end
        end

    remove_permission (who, what: STRING) is
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists
        local
            external_name, ext_who, ext_what: ANY
        do
            external_name := name.to_c
            ext_who := who.to_c
            ext_what := what.to_c
            file_perm ($external_name, $ext_who, $ext_what, 0)
        end

    set_access (time: INTEGER) is
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 0)
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date
        end

    set_date (time: INTEGER) is
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 1)
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time
        end

    stamp (time: INTEGER) is
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_utime ($external_name, time, 2)
        ensure -- from FILE
            date_updated: date = time
        end

    touch is
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_touch ($external_name)
        ensure -- from FILE
            date_changed: date /= old date
        end

feature -- Removal

    delete is
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists
        local
            external_name: ANY
        do
            external_name := name.to_c
            file_unlink ($external_name)
        end

    dispose is
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)
        do
            if not is_closed then
                close
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    reset (fn: STRING) is
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        do
            name := fn
            if mode /= closed_file then
                close
            end
            last_integer := 0
            if last_string /= void then
                last_string.wipe_out
            end
            last_real := 0.0
            last_character := '%U'
            last_double := 0.0
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed
        end

    wipe_out is
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        do
            open_write
            close
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Conversion

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Obsolete

    lastchar: CHARACTER is
            -- Last character read by read_character
            -- (from IO_MEDIUM)
        do
            Result := last_character
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
            -- (from IO_MEDIUM)
        do
            Result := last_double
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)
        do
            Result := last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
            -- (from IO_MEDIUM)
        do
            Result := last_real
        end

    laststring: STRING is
            -- Last string read
            -- (from IO_MEDIUM)
        do
            Result := last_string
        end

feature {NONE} -- Inapplicable

    go_to (r: CURSOR) is
            -- Move to position marked r.
            -- (from FILE)
        do
        end

    prunable: BOOLEAN is
            -- Is there an item to be removed?
            -- (from FILE)
        do
        end

    prune (v: like item) is
            -- Remove an occurrence of v if any.
            -- (from FILE)
        require -- from COLLECTION
            prunable: prunable
        require else -- from FILE
            prunable: file_prunable
        do
        ensure then -- from FILE
            count <= old count
        end

    remove is
            -- Remove current item.
            -- (from FILE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else -- from FILE
            file_prunable: file_prunable
        do
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from FILE)
        require -- from ACTIVE
            writable: writable
        require else -- from FILE
            is_writable: file_writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        ensure then -- from FILE
            item = v
            count = old count
        end

feature {NONE} -- Implementation

    buffered_file_info: UNIX_FILE_INFO is
            -- Information about the file.
            -- (from FILE)
        once
            create Result.make
        end

    c_basic_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "estore"
        end

    c_general_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "eestore"
        end

    c_independent_store (file_handle: INTEGER; object: POINTER) is
            -- Store object structure reachable form current object
            -- in file pointer file_ptr.
            -- (from FILE)
        external
            "C | %"eif_store.h%""
        alias
            "sstore"
        end

    c_retrieved (file_handle: INTEGER): ANY is
            -- Object structured retrieved from file of pointer
            -- file_ptr
            -- (from FILE)
        external
            "C | %"eif_retrieve.h%""
        alias
            "eretrieve"
        end

    false_string: STRING is
            -- Character string "false"
            -- (from FILE)
        once
            Result := "False"
        end

    file_access (f_name: POINTER; which: INTEGER): BOOLEAN is
            -- Perform access test which on f_name using real UID.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_append (file, from_file: POINTER; length: INTEGER) is
            -- Append a copy of from_file to file
            -- (from FILE)
        external
            "C (FILE *, FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_chgrp (f_name: POINTER; new_group: INTEGER) is
            -- Change group of f_name to new_group
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_chmod (f_name: POINTER; mask: INTEGER) is
            -- Change mode of f_name to mask.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_chown (f_name: POINTER; new_owner: INTEGER) is
            -- Change owner of f_name to new_owner
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_close (file: POINTER) is
            -- Close file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_creatable (f_name: POINTER): BOOLEAN is
            -- Is f_name creatable.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_dopen (fd, how: INTEGER): POINTER is
            -- File pointer for file of descriptor fd in mode how
            -- (which must fit the way fd was obtained).
        external
            "C | %"eif_file.h%""
        alias
            "file_binary_dopen"
        end

    file_exists (f_name: POINTER): BOOLEAN is
            -- Does f_name exist.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_fd (file: POINTER): INTEGER is
            -- Operating system's file descriptor
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_feof (file: POINTER): BOOLEAN is
            -- End of file?
            -- (from FILE)
        external
            "C (FILE *): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_flush (file: POINTER) is
            -- Flush file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_gc (file: POINTER): CHARACTER is
            -- Access the next character
            -- (from FILE)
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_gdb (file: POINTER): DOUBLE is
            -- Read a double from file
        external
            "C (FILE *): EIF_DOUBLE | %"eif_file.h%""
        end

    file_gib (file: POINTER): INTEGER is
            -- Get an integer from file
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_go (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from start.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_grb (file: POINTER): REAL is
            -- Read a real from file
        external
            "C (FILE *): EIF_REAL | %"eif_file.h%""
        end

    file_gs (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- a_string updated with characters read from file
            -- until new line, with begin characters already read.
            -- If it does not fit, result is length - begin + 1.
            -- If it fits, result is number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gss (file: POINTER; a_string: POINTER; length: INTEGER): INTEGER is
            -- Read min (length, remaining bytes in file) characters
            -- into a_string. If it does not fit, result is length + 1.
            -- Otherwise, result is the number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_gw (file: POINTER; a_string: POINTER; length, begin: INTEGER): INTEGER is
            -- Read a string excluding white space and stripping
            -- leading white space from file into a_string.
            -- White space characters are: blank, new_line,
            -- tab, vertical tab, formfeed or end of file.
            -- If it does not fit, result is length - begin + 1,
            -- otherwise result is number of characters read.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_lh (file: POINTER): CHARACTER is
            -- Look ahead in file and find out the value of the next
            -- character. Do not read over character.
            -- (from FILE)
        external
            "C (FILE *): EIF_CHARACTER | %"eif_file.h%""
        end

    file_link (from_name, to_name: POINTER) is
            -- Link to_name to from_name
            -- (from FILE)
        external
            "C (char *, char *) | %"eif_file.h%""
        end

    file_move (file: POINTER; offset: INTEGER) is
            -- Move file pointer by offset.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_open (f_name: POINTER; how: INTEGER): POINTER is
            -- File pointer for file f_name, in mode how.
        external
            "C | %"eif_file.h%""
        alias
            "file_binary_open"
        end

    file_pc (file: POINTER; c: CHARACTER) is
            -- Put c to end of file.
            -- (from FILE)
        external
            "C (FILE *, EIF_CHARACTER) | %"eif_file.h%""
        end

    file_pdb (file: POINTER; d: DOUBLE) is
            -- Put d to end of file.
        external
            "C (FILE *, EIF_DOUBLE) | %"eif_file.h%""
        end

    file_perm (f_name, who, what: POINTER; flag: INTEGER) is
            -- Change permissions for f_name to who and what.
            -- flag = 1 -> add permissions,
            -- flag = 0 -> remove permissions.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_pib (file: POINTER; n: INTEGER) is
            -- Put n to end of file.
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_prb (file: POINTER; r: REAL) is
            -- Put r to end of file.
        external
            "C (FILE *, EIF_REAL) | %"eif_file.h%""
        end

    file_ps (file: POINTER; a_string: POINTER; length: INTEGER) is
            -- Print a_string to file.
            -- (from FILE)
        external
            "C (FILE *, char *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_recede (file: POINTER; abs_position: INTEGER) is
            -- Go to absolute position, originated from end.
            -- (from FILE)
        external
            "C (FILE *, EIF_INTEGER) | %"eif_file.h%""
        end

    file_rename (old_name, new_name: POINTER) is
            -- Change file name from old_name to new_name.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_reopen (f_name: POINTER; how: INTEGER; file: POINTER): POINTER is
            -- File pointer to file, reopened to have new name f_name
            -- in a mode specified by how.
        external
            "C (char *, EIF_INTEGER, FILE *): EIF_POINTER | %"eif_file.h%""
        alias
            "file_binary_reopen"
        end

    file_size (file: POINTER): INTEGER is
            -- Size of file
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tell (file: POINTER): INTEGER is
            -- Current cursor position in file.
            -- (from FILE)
        external
            "C (FILE *): EIF_INTEGER | %"eif_file.h%""
        end

    file_tnil (file: POINTER) is
            -- Read upto next input line.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_tnwl (file: POINTER) is
            -- Print a new-line to file.
            -- (from FILE)
        external
            "C (FILE *) | %"eif_file.h%""
        end

    file_touch (f_name: POINTER) is
            -- Touch file f_name.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_unlink (fname: POINTER) is
            -- Delete file fname.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    file_utime (f_name: POINTER; time, how: INTEGER) is
            -- Set access, modification time or both (how = 0,1,2) on
            -- f_name, using time as time stamp.
            -- (from FILE)
        external
            "C | %"eif_file.h%""
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    set_buffer is
            -- Resynchronizes information on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        do
            buffered_file_info.update (name)
        end

    true_string: STRING is
            -- Character string "true"
            -- (from FILE)
        once
            Result := "True"
        end

feature {FILE} -- Implementation

    Append_file: INTEGER is 3
            -- (from FILE)

    Append_read_file: INTEGER is 5
            -- (from FILE)

    Closed_file: INTEGER is 0
            -- (from FILE)

    mode: INTEGER
            -- Input-output mode
            -- (from FILE)

    Read_file: INTEGER is 1
            -- (from FILE)

    Read_write_file: INTEGER is 4
            -- (from FILE)

    set_read_mode is
            -- Define file mode as read.
            -- (from FILE)
        do
            mode := read_file
        end

    set_write_mode is
            -- Define file mode as write.
            -- (from FILE)
        do
            mode := write_file
        end

    Write_file: INTEGER is 2
            -- (from FILE)

feature -- Convenience

    copy_to (file: like Current) is
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read
        do
            read_stream (count)
            file.put_string (last_string)
            create last_string.make (256)
        end

feature -- Input

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    read_double is
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_double := file_gdb (file_pointer)
        end

    read_integer is
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_integer := file_gib (file_pointer)
        end

    read_line is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    read_real is
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_real := file_grb (file_pointer)
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    read_word is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_character := file_gc (file_pointer)
        end

    readdouble is
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_double := file_gdb (file_pointer)
        end

    readint is
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_integer := file_gib (file_pointer)
        end

    readline is
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            str_cap: INTEGER
            read: INTEGER
            str_area: ANY
            done: BOOLEAN
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                done
            loop
                read := read + file_gs (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    last_string.set_count (str_cap)
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_cap := last_string.capacity
                    read := read - 1
                    str_area := last_string.area
                else
                    last_string.set_count (read)
                    done := True
                end
            end
        end

    readreal is
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        do
            last_real := file_grb (file_pointer)
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        local
            new_count: INTEGER
            str_area: ANY
        do
            last_string.grow (nb_char)
            str_area := last_string.area
            new_count := file_gss (file_pointer, $str_area, nb_char)
            last_string.set_count (new_count)
        end

    readword is
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable
        local
            str_area: ANY
            str_cap: INTEGER
            read: INTEGER
        do
            from
                str_area := last_string.area
                str_cap := last_string.capacity
            until
                read > str_cap
            loop
                read := read + file_gw (file_pointer, $str_area, str_cap, read)
                if read > str_cap then
                    if str_cap < 2048 then
                        last_string.grow (str_cap + 1024)
                    else
                        last_string.automatic_grow
                    end
                    str_area := last_string.area
                    str_cap := last_string.capacity
                    read := read - 1
                else
                    last_string.set_count (read)
                    read := str_cap + 1
                end
            end
            separator := file_lh (file_pointer)
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature -- Output

    put_boolean (b: BOOLEAN) is
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            if b then
                put_character ('%/1/')
            else
                put_character ('%U')
            end
        end

    put_double (d: DOUBLE) is
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pdb (file_pointer, d)
        end

    put_integer (i: INTEGER) is
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pib (file_pointer, i)
        end

    put_real (r: REAL) is
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_prb (file_pointer, r)
        end

    putbool (b: BOOLEAN) is
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            if b then
                put_character ('%/1/')
            else
                put_character ('%U')
            end
        end

    putdouble (d: DOUBLE) is
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pdb (file_pointer, d)
        end

    putint (i: INTEGER) is
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_pib (file_pointer, i)
        end

    putreal (r: REAL) is
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible
        do
            file_prb (file_pointer, r)
        end

invariant

    not_plain_text: not is_plain_text
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RAW_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RAW_FILE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files, viewed as persistent sequences of bytes"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    RAW_FILE

create

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

feature -- Initialization

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.
            -- (from FILE)

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    item: CHARACTER
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    position: INTEGER
            -- Current cursor position.
            -- (from FILE)

    protection: INTEGER
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

feature -- Measurement

    count: INTEGER
            -- Size in bytes (0 if no associated physical file)
            -- (from FILE)

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        ensure then -- from FILE
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?
            -- (from FILE)

    file_prunable: BOOLEAN
            -- May items be removed?
            -- (from FILE)

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from FILE)

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?
            -- (from FILE)

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)

    is_device: BOOLEAN
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?
            -- (from FILE)

    is_open_read: BOOLEAN
            -- Is file open for reading?
            -- (from FILE)

    is_open_write: BOOLEAN
            -- Is file open for writing?
            -- (from FILE)

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?
            -- (from FILE)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is True
            -- Can medium be used to an Eiffel structure?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
            -- (from FILE)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then -- from FILE
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed

    forth
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed

    next_line
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure -- from FILE
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_real
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readreal
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    put_boolean (b: BOOLEAN)
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    putbool (b: BOOLEAN)
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

invariant

    not_plain_text: not is_plain_text
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RAW_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RAW_FILE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    RAW_FILE

Ancestors
    FILE

Clients
    DIRECTORY
    RAW_FILE
    STORABLE

Suppliers
    BOOLEAN
    RAW_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RAW_FILE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Files, viewed as persistent sequences of bytes"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    RAW_FILE

create
    make,
    make_open_read,
    make_open_write,
    make_open_append,
    make_open_read_write,
    make_create_read_write,
    make_open_read_append

feature -- Status report

    Support_storable: BOOLEAN is True
            -- Can medium be used to an Eiffel structure?

feature -- Output

    put_integer (i: INTEGER)
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of putint.

    putint (i: INTEGER)
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of put_integer.

    put_boolean (b: BOOLEAN)
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of putbool.

    putbool (b: BOOLEAN)
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of put_boolean.

    put_real (r: REAL)
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of putreal.

    putreal (r: REAL)
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of put_real.

    put_double (d: DOUBLE)
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of putdouble.

    putdouble (d: DOUBLE)
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of put_double.

feature -- Input

    read_integer
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of readint.

    readint
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of read_integer.

    read_real
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of readreal.

    readreal
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of read_real.

    read_double
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of readdouble.

    readdouble
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of read_double.

invariant

    not_plain_text: not is_plain_text

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RAW_FILE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, single precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class
    REAL

inherit
    REAL_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    REAL

General
    cluster: base.kernel
    description: "Real values, single precision"

Ancestors
    REAL_REF

Queries
    infix ">=" (other: [like Current] REAL): BOOLEAN
    infix ">" (other: [like Current] REAL): BOOLEAN
    infix "<=" (other: [like Current] REAL): BOOLEAN
    infix "<" (other: [like Current] REAL): BOOLEAN
    infix "-" (other: [like Current] REAL): [like Current] REAL
    infix "+" (other: [like Current] REAL): [like Current] REAL
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] REAL): [like Current] REAL
    infix "*" (other: [like Current] REAL): [like Current] REAL
    prefix "-": [like Current] REAL
    prefix "+": [like Current] REAL
    abs: REAL
    ceiling: INTEGER
    divisible (other: REAL_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] REAL): BOOLEAN
    is_hashable: BOOLEAN
    item: REAL
    max (other: [like Current] REAL): [like Current] REAL
    min (other: [like Current] REAL): [like Current] REAL
    one: [like Current] REAL
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: REAL_REF): INTEGER
    truncated_to_integer: INTEGER
    zero: [like Current] REAL

Commands
    set_item (r: REAL)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, single precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class
    REAL

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
            -- (from REAL_REF)
        do
            Result := truncated_to_integer.hash_code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: REAL
            -- Numeric real value
            -- (from REAL_REF)

    one: like Current is
            -- Neutral element for "*" and "/"
            -- (from REAL_REF)
        do
            create Result
            Result.set_item (1.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
            -- (from REAL_REF)
        do
            if item > 0.0 then
                Result := 1
            elseif item < 0.0 then
                Result := - 1
            end
        ensure -- from REAL_REF
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
            -- (from REAL_REF)
        do
            create Result
            Result.set_item (0.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from REAL_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: REAL_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from REAL_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current real?
            -- (from REAL_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN is
            -- May current object be divided by other?
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0.0
        ensure then -- from REAL_REF
            ref_not_exact_zero: Result implies (other.item /= 0.0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0.0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0.0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0.0
            end
        ensure then -- from REAL_REF
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from REAL_REF)
        do
            Result := item /= 0.0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (r: REAL) is
            -- Make r the value of item.
            -- (from REAL_REF)
        do
            item := r
        end

feature -- Conversion

    ceiling: INTEGER is
            -- Smallest integral value no smaller than current object
            -- (from REAL_REF)
        do
            Result := c_ceiling (item).truncated_to_integer
        ensure -- from REAL_REF
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one
        end

    floor: INTEGER is
            -- Greatest integral value no greater than current object
            -- (from REAL_REF)
        do
            Result := c_floor (item).truncated_to_integer
        ensure -- from REAL_REF
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one
        end

    rounded: INTEGER is
            -- Rounded integral value
            -- (from REAL_REF)
        do
            Result := sign * ((abs + 0.5).floor)
        ensure -- from REAL_REF
            definition: Result = sign * ((abs + 0.5).floor)
        end

    truncated_to_integer: INTEGER is
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)
            -- (from REAL_REF)
        do
            Result := c_truncated_to_integer (item)
        end

feature -- Basic operations

    abs: REAL is
            -- Absolute value
            -- (from REAL_REF)
        do
            Result := abs_ref.item
        ensure -- from REAL_REF
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
            -- (from REAL_REF)
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
            -- (from REAL_REF)
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item / other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Current real to the power other
            -- (from REAL_REF)
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

feature {NONE} -- Implementation

    abs_ref: REAL_REF is
            -- Absolute value
            -- (from REAL_REF)
        do
            if item >= 0.0 then
                Result := Current
            else
                Result := - Current
            end
        ensure -- from REAL_REF
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ceiling (r: REAL): REAL is
            -- Smallest integral value no smaller than r
            -- (from REAL_REF)
        external
            "C (double): EIF_REAL | <math.h>"
        alias
            "ceil"
        end

    c_floor (r: REAL): REAL is
            -- Greatest integral value no greater than r
            -- (from REAL_REF)
        external
            "C (double): EIF_REAL | <math.h>"
        alias
            "floor"
        end

    c_outr (r: REAL): STRING is
            -- Printable representation of real value
            -- (from REAL_REF)
        external
            "C | %"eif_out.h%""
        end

    c_truncated_to_integer (r: REAL): INTEGER is
            -- Integer part of r (same sign, largest absolute
            -- value no greater than r's)
            -- (from REAL_REF)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_ri"
        end

feature -- Output

    out: STRING is
            -- Printable representation of real value
            -- (from REAL_REF)
        do
            Result := c_outr (item)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from REAL_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, single precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    REAL

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from REAL_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: REAL
            -- Numeric real value
            -- (from REAL_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from REAL_REF)
        ensure -- from REAL_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from REAL_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: REAL_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from REAL_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current real?
            -- (from REAL_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from REAL_REF
            ref_not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from REAL_REF
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from REAL_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (r: REAL)
            -- Make r the value of item.
            -- (from REAL_REF)

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
            -- (from REAL_REF)
        ensure -- from REAL_REF
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
            -- (from REAL_REF)
        ensure -- from REAL_REF
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
            -- (from REAL_REF)
        ensure -- from REAL_REF
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)
            -- (from REAL_REF)

feature -- Basic operations

    abs: REAL
            -- Absolute value
            -- (from REAL_REF)
        ensure -- from REAL_REF
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current real to the power other
            -- (from REAL_REF)

feature -- Output

    out: STRING
            -- Printable representation of real value
            -- (from REAL_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from REAL_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    REAL

Ancestors
    REAL_REF

Clients
    BASIC_ROUTINES
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    RANDOM
    REAL_REF
    SINGLE_MATH
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a real value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    REAL_REF

inherit
    NUMERIC
        redefine
            out,
            is_equal
        end

    COMPARABLE
        redefine
            out,
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            out,
            is_equal
        end

feature -- Access

    item: REAL
            -- Numeric real value

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := truncated_to_integer.hash_code
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0.0 then
                Result := 1
            elseif item < 0.0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1.0)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0.0)
        end

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current real?
        do
            Result := item < other.item
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: REAL_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Element change

    set_item (r: REAL) is
            -- Make r the value of item.
        do
            item := r
        end

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN is
            -- May current object be divided by other?
        do
            Result := other.item /= 0.0
        ensure then
            ref_not_exact_zero: Result implies (other.item /= 0.0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0.0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0.0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0.0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0.0
        end

feature -- Conversion

    truncated_to_integer: INTEGER is
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)
        do
            Result := c_truncated_to_integer (item)
        end

    ceiling: INTEGER is
            -- Smallest integral value no smaller than current object
        do
            Result := c_ceiling (item).truncated_to_integer
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one
        end

    floor: INTEGER is
            -- Greatest integral value no greater than current object
        do
            Result := c_floor (item).truncated_to_integer
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one
        end

    rounded: INTEGER is
            -- Rounded integral value
        do
            Result := sign * ((abs + 0.5).floor)
        ensure
            definition: Result = sign * ((abs + 0.5).floor)
        end

feature -- Basic operations

    abs: REAL is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        do
            create Result
            Result.set_item (item + other.item)
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        do
            create Result
            Result.set_item (item - other.item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        do
            create Result
            Result.set_item (item * other.item)
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
        do
            create Result
            Result.set_item (item / other.item)
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Current real to the power other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        end

feature -- Output

    out: STRING is
            -- Printable representation of real value
        do
            Result := c_outr (item)
        end

feature {NONE} -- Implementation

    abs_ref: REAL_REF is
            -- Absolute value
        do
            if item >= 0.0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_outr (r: REAL): STRING is
            -- Printable representation of real value
        external
            "C | %"eif_out.h%""
        end

    c_truncated_to_integer (r: REAL): INTEGER is
            -- Integer part of r (same sign, largest absolute
            -- value no greater than r's)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_ri"
        end

    c_ceiling (r: REAL): REAL is
            -- Smallest integral value no smaller than r
        external
            "C (double): EIF_REAL | <math.h>"
        alias
            "ceil"
        end

    c_floor (r: REAL): REAL is
            -- Greatest integral value no greater than r
        external
            "C (double): EIF_REAL | <math.h>"
        alias
            "floor"
        end

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    REAL_REF

General
    cluster: base.kernel
    description: "References to objects containing a real value"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix ">=" (other: [like Current] REAL_REF): BOOLEAN
    infix ">" (other: [like Current] REAL_REF): BOOLEAN
    infix "<=" (other: [like Current] REAL_REF): BOOLEAN
    infix "<" (other: [like Current] REAL_REF): BOOLEAN
    infix "-" (other: [like Current] REAL_REF): [like Current] REAL_REF
    infix "+" (other: [like Current] REAL_REF): [like Current] REAL_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] REAL_REF): [like Current] REAL_REF
    infix "*" (other: [like Current] REAL_REF): [like Current] REAL_REF
    prefix "-": [like Current] REAL_REF
    prefix "+": [like Current] REAL_REF
    abs: REAL
    ceiling: INTEGER
    divisible (other: REAL_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] REAL_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: REAL
    max (other: [like Current] REAL_REF): [like Current] REAL_REF
    min (other: [like Current] REAL_REF): [like Current] REAL_REF
    one: [like Current] REAL_REF
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: REAL_REF): INTEGER
    truncated_to_integer: INTEGER
    zero: [like Current] REAL_REF

Commands
    set_item (r: REAL)

Constraints
    sign times abs

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a real value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    REAL_REF

feature -- Access

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := truncated_to_integer.hash_code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: REAL
            -- Numeric real value

    one: like Current is
            -- Neutral element for "*" and "/"
        do
            create Result
            Result.set_item (1.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    sign: INTEGER is
            -- Sign value (0, -1 or 1)
        do
            if item > 0.0 then
                Result := 1
            elseif item < 0.0 then
                Result := - 1
            end
        ensure
            three_way: Result = three_way_comparison (zero)
        end

    zero: like Current is
            -- Neutral element for "+" and "-"
        do
            create Result
            Result.set_item (0.0)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: REAL_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current real?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN is
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        do
            Result := other.item /= 0.0
        ensure then
            ref_not_exact_zero: Result implies (other.item /= 0.0)
        end

    exponentiable (other: NUMERIC): BOOLEAN is
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            real_value: REAL_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := integer_value.item >= 0 or item /= 0.0
            elseif real_value /= void then
                Result := real_value.item >= 0.0 or item /= 0.0
            elseif double_value /= void then
                Result := double_value.item >= 0.0 or item /= 0.0
            end
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        do
            Result := item /= 0.0
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

feature -- Element change

    set_item (r: REAL) is
            -- Make r the value of item.
        do
            item := r
        end

feature -- Conversion

    ceiling: INTEGER is
            -- Smallest integral value no smaller than current object
        do
            Result := c_ceiling (item).truncated_to_integer
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one
        end

    floor: INTEGER is
            -- Greatest integral value no greater than current object
        do
            Result := c_floor (item).truncated_to_integer
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one
        end

    rounded: INTEGER is
            -- Rounded integral value
        do
            Result := sign * ((abs + 0.5).floor)
        ensure
            definition: Result = sign * ((abs + 0.5).floor)
        end

    truncated_to_integer: INTEGER is
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)
        do
            Result := c_truncated_to_integer (item)
        end

feature -- Basic operations

    abs: REAL is
            -- Absolute value
        do
            Result := abs_ref.item
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)
        end

    infix "*" (other: like Current): like Current is
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item * other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    prefix "+": like Current is
            -- Unary plus
        do
            create Result
            Result.set_item (+ item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "+" (other: like Current): like Current is
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item + other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)
        end

    prefix "-": like Current is
            -- Unary minus
        do
            create Result
            Result.set_item (- item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "-" (other: like Current): like Current is
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        do
            create Result
            Result.set_item (item - other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "/" (other: like Current): like Current is
            -- Division by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        do
            create Result
            Result.set_item (item / other.item)
        ensure -- from NUMERIC
            result_exists: Result /= void
        end

    infix "^" (other: NUMERIC): DOUBLE is
            -- Current real to the power other
        local
            integer_value: INTEGER_REF
            real_value: REAL_REF
            double_value: DOUBLE_REF
        do
            integer_value ?= other
            real_value ?= other
            double_value ?= other
            if integer_value /= void then
                Result := item ^ integer_value.item
            elseif real_value /= void then
                Result := item ^ real_value.item
            elseif double_value /= void then
                Result := item ^ double_value.item
            end
        end

feature {NONE} -- Implementation

    abs_ref: REAL_REF is
            -- Absolute value
        do
            if item >= 0.0 then
                Result := Current
            else
                Result := - Current
            end
        ensure
            result_exists: Result /= void
            same_absolute_value: equal (Result, Current) or equal (Result, - Current)
        end

    c_ceiling (r: REAL): REAL is
            -- Smallest integral value no smaller than r
        external
            "C (double): EIF_REAL | <math.h>"
        alias
            "ceil"
        end

    c_floor (r: REAL): REAL is
            -- Greatest integral value no greater than r
        external
            "C (double): EIF_REAL | <math.h>"
        alias
            "floor"
        end

    c_outr (r: REAL): STRING is
            -- Printable representation of real value
        external
            "C | %"eif_out.h%""
        end

    c_truncated_to_integer (r: REAL): INTEGER is
            -- Integer part of r (same sign, largest absolute
            -- value no greater than r's)
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "conv_ri"
        end

feature -- Output

    out: STRING is
            -- Printable representation of real value
        do
            Result := c_outr (item)
        end

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a real value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    REAL_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: REAL
            -- Numeric real value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: REAL_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current real?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            ref_not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (r: REAL)
            -- Make r the value of item.

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
        ensure
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)

feature -- Basic operations

    abs: REAL
            -- Absolute value
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current real to the power other

feature -- Output

    out: STRING
            -- Printable representation of real value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    REAL_REF

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Descendants
    REAL

Clients
    DLL_32_ROUTINE
    DOUBLE_REF
    INTEGER_16_REF
    INTEGER_64_REF
    INTEGER_8_REF
    INTEGER_REF
    REAL_REF
    TUPLE

Suppliers
    BOOLEAN
    DOUBLE
    DOUBLE_REF
    INTEGER
    INTEGER_REF
    NUMERIC
    REAL
    REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a real value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class interface
    REAL_REF

feature -- Access

    item: REAL
            -- Numeric real value

    hash_code: INTEGER
            -- Hash code value

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    one: like Current
            -- Neutral element for "*" and "/"

    zero: like Current
            -- Neutral element for "+" and "-"

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current real?

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: REAL_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1

feature -- Element change

    set_item (r: REAL)
            -- Make r the value of item.

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN
            -- May current object be divided by other?
        ensure then
            ref_not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)

feature -- Conversion

    truncated_to_integer: INTEGER
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
        ensure
            definition: Result = sign * ((abs + 0.5).floor)

feature -- Basic operations

    abs: REAL
            -- Absolute value
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "+" (other: like Current): like Current
            -- Sum with other

    infix "-" (other: like Current): like Current
            -- Result of subtracting other

    infix "*" (other: like Current): like Current
            -- Product by other

    infix "/" (other: like Current): like Current
            -- Division by other

    infix "^" (other: NUMERIC): DOUBLE
            -- Current real to the power other

    prefix "+": like Current
            -- Unary plus

    prefix "-": like Current
            -- Unary minus

feature -- Output

    out: STRING
            -- Printable representation of real value

invariant

    sign_times_abs: sign * abs = item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


REAL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Real values, single precision"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    REAL

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ROUTINE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a routine,
        with some operands possibly still open
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

inherit
    MEMORY
        export
            {NONE} all
        redefine
            dispose,
            is_equal,
            copy
        end

    HASHABLE
        undefine
            copy,
            is_equal
        end

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS]) is
            -- Initialize from other.
            -- Useful in descendants.
        require
            other_exists: other /= void
            conforming: conforms_to (other)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
            operands := other.operands
            operands_set_by_user := other.operands_set_by_user
            closed_operands := other.closed_operands
            open_map := other.open_map
            closed_map := other.closed_map
            rout_disp := other.rout_disp
        ensure
            same_call_status: other.callable implies callable
        end

feature -- Access

    operands: OPEN_ARGS
            -- Open operands.

    target: ANY is
            -- Target of call.
        do
            if closed_map.count > 0 and then closed_map.item (closed_map.lower) = 0 then
                Result := closed_operands.item (closed_operands.lower)
            elseif operands /= void and then operands.count > 0 then
                Result := operands.item (operands.lower)
            end
        end

    open_operand_type (i: INTEGER): INTEGER is
            -- Type of ith open operand.
        require
            positive: i >= 1
            within_bounds: i <= open_count
        do
            if open_types = void then
                create open_types.make (1, open_map.count)
            end
            Result := open_types.item (i)
            if Result = 0 then
                Result := eif_gen_param_id (- 1, eif_gen_create ($Current, 2), i)
                open_types.force (Result, i)
            end
        end

    hash_code: INTEGER is
            -- Hash code value.
        do
            Result := rout_disp.hash_code
        end

    precondition (args: like operands): BOOLEAN is
            -- Do args satisfy routine's precondition
            -- in current state?
        do
            Result := True
        end

    postcondition (args: like operands): BOOLEAN is
            -- Does current state satisfy routine's
            -- postcondition for args?
        do
            Result := True
        end

feature -- Status report

    callable: BOOLEAN is
            -- Can routine be called on current object?
        local
            null_ptr: POINTER
        do
            Result := (rout_disp /= null_ptr)
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is associated routine the same as the one
            -- associated with other.
        do
            Result := equal (operands, other.operands) and then equal (closed_operands, other.closed_operands) and then equal (open_map, other.open_map) and then equal (closed_map, other.closed_map) and then (rout_disp = other.rout_disp)
        end

    valid_operands (args: OPEN_ARGS): BOOLEAN is
            -- Are args valid operands for this routine?
        local
            i: INTEGER
            mismatch: BOOLEAN
            arg: ANY
            arg_type_code: CHARACTER
            open_arg_type_code: CHARACTER
            a_boolean_ref: BOOLEAN_REF
            a_character_ref: CHARACTER_REF
            a_double_ref: DOUBLE_REF
            an_integer_ref: INTEGER_REF
            a_pointer_ref: POINTER_REF
            a_real_ref: REAL_REF
            int: INTERNAL
        do
            if args = void or open_map = void then
                Result := (open_map = void)
            elseif open_map /= void and then args.count >= open_map.count then
                from
                    create int
                    i := 1
                until
                    i > open_map.count or mismatch
                loop
                    arg := args.item (i)
                    arg_type_code := args.arg_item_code (i)
                    open_arg_type_code := open_type_codes.item (i + 1)
                    if arg_type_code = 'r' then
                        inspect open_arg_type_code
                        when 'b' then
                            a_boolean_ref ?= arg;
                            mismatch := a_boolean_ref = void
                        when 'c' then
                            a_character_ref ?= arg;
                            mismatch := a_character_ref = void
                        when 'd' then
                            a_double_ref ?= arg;
                            mismatch := a_double_ref = void
                        when 'i' then
                            an_integer_ref ?= arg;
                            mismatch := an_integer_ref = void
                        when 'p' then
                            a_pointer_ref ?= arg;
                            mismatch := a_pointer_ref = void
                        when 'f' then
                            a_real_ref ?= arg;
                            mismatch := a_real_ref = void
                        when 'r' then
                            if arg /= void and then not eif_gen_conf (int.dynamic_type (arg), open_operand_type (i)) then
                                mismatch := True
                            end
                        end
                    else
                        if arg_type_code /= open_arg_type_code and (open_arg_type_code = 'r' implies open_operand_type (i) > 0) then
                            mismatch := True
                        end
                    end
                    i := i + 1
                end;
                Result := not mismatch
            end
        end

feature -- Measurement

    open_count: INTEGER is
            -- Number of open operands.
        do
            if open_map /= void then
                Result := open_map.count
            end
        end

feature -- Element change

    set_operands (args: OPEN_ARGS) is
            -- Use args as operands for next call.
        require
            valid_operands: valid_operands (args)
        do
            operands := args
            operands_set_by_user := True
        end

feature -- Duplication

    copy (other: like Current) is
            -- Use same routine as other.
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
            operands := other.operands
            operands_set_by_user := other.operands_set_by_user
            closed_operands := other.closed_operands
            open_map := other.open_map
            closed_map := other.closed_map
            rout_disp := other.rout_disp
        ensure then
            same_call_status: other.callable implies callable
        end

feature -- Basic operations

    call (args: OPEN_ARGS) is
            -- Call routine with operands args.
        require
            valid_operands: valid_operands (args)
            callable: callable
        do
            operands := args
            apply
            if not operands_set_by_user then
                operands := void
            end
        end

    apply is
            -- Call routine with operands as last set.
        require
            valid_operands: valid_operands (operands)
            callable: callable
        deferred
        end

feature -- Obsolete

    adapt_from (other: like Current) is
        obsolete "Please use `adapt' instead (it's also a creation procedure)"
            -- Adapt from other. Useful in descendants.
        require
            other_exists: other /= void
            conforming: conforms_to (other)
        do
            adapt (other)
        ensure
            same_call_status: other.callable implies callable
        end

feature {ROUTINE, E_FEATURE} -- Implementation

    frozen operands_set_by_user: BOOLEAN
            -- Are operands set throug call to set_operands.
            -- If not, we can delete them after routine call for
            -- later collection.

    frozen closed_operands: TUPLE
            -- Closed arguments provided at creation time

    frozen open_map: ARRAY [INTEGER]
            -- Index map for open arguments

    frozen closed_map: ARRAY [INTEGER]
            -- Index map for closed arguments

    open_type_codes: STRING is
            -- Type codes for open arguments
        do
            if internal_open_type_codes = void then
                internal_open_type_codes := eif_gen_typecode_str ($Current)
            end
            Result := internal_open_type_codes
        end

    frozen open_types: ARRAY [INTEGER]
            -- Types of open operands

    closed_type_codes: STRING is
            -- Type codes for closed arguments
        do
            if closed_operands /= void and internal_closed_type_codes = void then
                internal_closed_type_codes := eif_gen_tuple_typecode_str ($closed_operands)
            end
            Result := internal_closed_type_codes
        end

    frozen rout_disp: POINTER
            -- Routine dispatcher

    frozen eiffel_rout_disp: POINTER
            -- Eiffel routine dispatcher

    frozen set_rout_disp (p: POINTER; tp: POINTER; closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
        require
            p_not_void: p /= default_pointer
            tp_not_void: tp /= default_pointer
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            rout_disp := p
            eiffel_rout_disp := tp
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

    frozen set_rout_args (closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
        require
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

feature {NONE} -- Implementation

    frozen internal_open_type_codes: STRING

    frozen internal_closed_type_codes: STRING

    dispose is
            -- Free routine argument union structure
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
        end

    frozen rout_cargs: POINTER
            -- Routine operands

    frozen rout_set_cargs is
            -- Allocate and fill argument structure
        local
            new_args: POINTER
            i, j, ocnt, ccnt: INTEGER
            code: CHARACTER
            ref_arg: ANY
            null_ptr: POINTER
            was_on: BOOLEAN
            loc_open_map: like open_map
            loc_closed_map: like closed_map
            loc_operands: like operands
            loc_closed_operands: like closed_operands
            loc_open_type_codes: like open_type_codes
            loc_closed_type_codes: like closed_type_codes
        do
            was_on := collecting
            collection_off
            loc_open_map := open_map
            if loc_open_map /= void then
                ocnt := loc_open_map.count
                loc_open_type_codes := open_type_codes
                loc_operands := operands
            end
            loc_closed_map := closed_map
            if loc_closed_map /= void then
                ccnt := loc_closed_map.count
                loc_closed_type_codes := closed_type_codes
                loc_closed_operands := closed_operands
            end
            if rout_cargs = null_ptr then
                new_args := rout_obj_new_args (ocnt + ccnt + 1)
                rout_cargs := new_args
            else
                new_args := rout_cargs
            end
            from
                i := 1
            until
                i > ocnt
            loop
                code := loc_open_type_codes.item (i + 1)
                check
                    loc_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_operands.real_item (i)
                else
                    ref_arg := loc_operands.item (i)
                end
                j := loc_open_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            from
                i := 1
            until
                i > ccnt
            loop
                code := loc_closed_type_codes.item (i)
                check
                    loc_closed_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_closed_operands.real_item (i)
                else
                    ref_arg := loc_closed_operands.item (i)
                end
                j := loc_closed_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            if was_on then
                collection_on
            end
        rescue
            if was_on then
                collection_on
            end
        end

feature {NONE} -- Runtime constants

    Eif_boolean_code: CHARACTER is 'b'

    Eif_character_code: CHARACTER is 'c'

    Eif_double_code: CHARACTER is 'd'

    Eif_real_code: CHARACTER is 'f'

    Eif_integer_code: CHARACTER is 'i'

    Eif_pointer_code: CHARACTER is 'p'

    Eif_reference_code: CHARACTER is 'r'

    Eif_integer_8_code: CHARACTER is 'j'

    Eif_integer_16_code: CHARACTER is 'k'

    Eif_integer_64_code: CHARACTER is 'l'

    Eif_wide_char_code: CHARACTER is 'u'
            -- Type constants used by runtime to recognize types
            -- needed to perform call

feature {NONE} -- Externals

    rout_obj_new_args (cnt: INTEGER): POINTER is
            -- Initialize for new operands.
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_free_args (args: POINTER) is
            -- Free args.
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_putb (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putwc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putd (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti8 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti16 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti32 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti64 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putp (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putf (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putr (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    eif_gen_conf (type1, type2: INTEGER): BOOLEAN is
            -- Does type1 conform to type2?
        external
            "C (int16, int16): EIF_BOOLEAN | %"eif_gen_conf.h%""
        end

    eif_gen_create (obj: POINTER; pos: INTEGER): POINTER is
            -- Adapt args for idx and val.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_param_id (stype: INTEGER; obj: POINTER; pos: INTEGER): INTEGER is
            -- Type of generic parameter in obj at position pos.
        external
            "C (int16, EIF_REFERENCE, int): EIF_INTEGER | %"eif_gen_conf.h%""
        end

    eif_gen_typecode (obj: POINTER; pos: INTEGER): CHARACTER is
            -- Code for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_tuple_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

feature -- Obsolete

    arguments: OPEN_ARGS is
        obsolete "use operands"
        do
            Result := operands
        end

    set_arguments (args: OPEN_ARGS) is
        obsolete "use set_operands"
        do
            set_operands (args)
        end

    valid_arguments (args: OPEN_ARGS): BOOLEAN is
        obsolete "use valid_operands"
        do
            Result := valid_operands (args)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ROUTINE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

General
    cluster: base.kernel
    description:
        "Objects representing delayed calls to a routine,
        with some operands possibly still open"

Ancestors
    HASHABLE
    MEMORY

Queries
    callable: BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] ROUTINE [BASE_TYPE, OPEN_ARGS]): BOOLEAN
    is_hashable: BOOLEAN
    open_count: INTEGER
    open_operand_type (i: INTEGER): INTEGER
    operands: OPEN_ARGS
    postcondition (args: [like operands] OPEN_ARGS): BOOLEAN
    precondition (args: [like operands] OPEN_ARGS): BOOLEAN
    target: ANY
    valid_operands (args: OPEN_ARGS): BOOLEAN

Commands
    adapt (other: ROUTINE [ANY, OPEN_ARGS])
    apply
    call (args: OPEN_ARGS)
    copy (other: [like Current] ROUTINE [BASE_TYPE, OPEN_ARGS])
    set_operands (args: OPEN_ARGS)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ROUTINE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a routine,
        with some operands possibly still open
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS]) is
            -- Initialize from other.
            -- Useful in descendants.
        require
            other_exists: other /= void
            conforming: conforms_to (other)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
            operands := other.operands
            operands_set_by_user := other.operands_set_by_user
            closed_operands := other.closed_operands
            open_map := other.open_map
            closed_map := other.closed_map
            rout_disp := other.rout_disp
        ensure
            same_call_status: other.callable implies callable
        end

feature -- Access

    hash_code: INTEGER is
            -- Hash code value.
        do
            Result := rout_disp.hash_code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    open_operand_type (i: INTEGER): INTEGER is
            -- Type of ith open operand.
        require
            positive: i >= 1
            within_bounds: i <= open_count
        do
            if open_types = void then
                create open_types.make (1, open_map.count)
            end
            Result := open_types.item (i)
            if Result = 0 then
                Result := eif_gen_param_id (- 1, eif_gen_create ($Current, 2), i)
                open_types.force (Result, i)
            end
        end

    operands: OPEN_ARGS
            -- Open operands.

    postcondition (args: like operands): BOOLEAN is
            -- Does current state satisfy routine's
            -- postcondition for args?
        do
            Result := True
        end

    precondition (args: like operands): BOOLEAN is
            -- Do args satisfy routine's precondition
            -- in current state?
        do
            Result := True
        end

    target: ANY is
            -- Target of call.
        do
            if closed_map.count > 0 and then closed_map.item (closed_map.lower) = 0 then
                Result := closed_operands.item (closed_operands.lower)
            elseif operands /= void and then operands.count > 0 then
                Result := operands.item (operands.lower)
            end
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    open_count: INTEGER is
            -- Number of open operands.
        do
            if open_map /= void then
                Result := open_map.count
            end
        end

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    callable: BOOLEAN is
            -- Can routine be called on current object?
        local
            null_ptr: POINTER
        do
            Result := (rout_disp /= null_ptr)
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is associated routine the same as the one
            -- associated with other.
        require -- from ANY
            other_not_void: other /= void
        do
            Result := equal (operands, other.operands) and then equal (closed_operands, other.closed_operands) and then equal (open_map, other.open_map) and then equal (closed_map, other.closed_map) and then (rout_disp = other.rout_disp)
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    valid_operands (args: OPEN_ARGS): BOOLEAN is
            -- Are args valid operands for this routine?
        local
            i: INTEGER
            mismatch: BOOLEAN
            arg: ANY
            arg_type_code: CHARACTER
            open_arg_type_code: CHARACTER
            a_boolean_ref: BOOLEAN_REF
            a_character_ref: CHARACTER_REF
            a_double_ref: DOUBLE_REF
            an_integer_ref: INTEGER_REF
            a_pointer_ref: POINTER_REF
            a_real_ref: REAL_REF
            int: INTERNAL
        do
            if args = void or open_map = void then
                Result := (open_map = void)
            elseif open_map /= void and then args.count >= open_map.count then
                from
                    create int
                    i := 1
                until
                    i > open_map.count or mismatch
                loop
                    arg := args.item (i)
                    arg_type_code := args.arg_item_code (i)
                    open_arg_type_code := open_type_codes.item (i + 1)
                    if arg_type_code = 'r' then
                        inspect open_arg_type_code
                        when 'b' then
                            a_boolean_ref ?= arg;
                            mismatch := a_boolean_ref = void
                        when 'c' then
                            a_character_ref ?= arg;
                            mismatch := a_character_ref = void
                        when 'd' then
                            a_double_ref ?= arg;
                            mismatch := a_double_ref = void
                        when 'i' then
                            an_integer_ref ?= arg;
                            mismatch := an_integer_ref = void
                        when 'p' then
                            a_pointer_ref ?= arg;
                            mismatch := a_pointer_ref = void
                        when 'f' then
                            a_real_ref ?= arg;
                            mismatch := a_real_ref = void
                        when 'r' then
                            if arg /= void and then not eif_gen_conf (int.dynamic_type (arg), open_operand_type (i)) then
                                mismatch := True
                            end
                        end
                    else
                        if arg_type_code /= open_arg_type_code and (open_arg_type_code = 'r' implies open_operand_type (i) > 0) then
                            mismatch := True
                        end
                    end
                    i := i + 1
                end;
                Result := not mismatch
            end
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Element change

    set_operands (args: OPEN_ARGS) is
            -- Use args as operands for next call.
        require
            valid_operands: valid_operands (args)
        do
            operands := args
            operands_set_by_user := True
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Duplication

    copy (other: like Current) is
            -- Use same routine as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
            operands := other.operands
            operands_set_by_user := other.operands_set_by_user
            closed_operands := other.closed_operands
            open_map := other.open_map
            closed_map := other.closed_map
            rout_disp := other.rout_disp
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            same_call_status: other.callable implies callable
        end

feature -- Basic operations

    apply is
            -- Call routine with operands as last set.
        require
            valid_operands: valid_operands (operands)
            callable: callable
        deferred
        end

    call (args: OPEN_ARGS) is
            -- Call routine with operands args.
        require
            valid_operands: valid_operands (args)
            callable: callable
        do
            operands := args
            apply
            if not operands_set_by_user then
                operands := void
            end
        end

feature -- Obsolete

    adapt_from (other: like Current) is
        obsolete "Please use `adapt' instead (it's also a creation procedure)"
            -- Adapt from other. Useful in descendants.
        require
            other_exists: other /= void
            conforming: conforms_to (other)
        do
            adapt (other)
        ensure
            same_call_status: other.callable implies callable
        end

    arguments: OPEN_ARGS is
        obsolete "use operands"
        do
            Result := operands
        end

    set_arguments (args: OPEN_ARGS) is
        obsolete "use set_operands"
        do
            set_operands (args)
        end

    valid_arguments (args: OPEN_ARGS): BOOLEAN is
        obsolete "use valid_operands"
        do
            Result := valid_operands (args)
        end

feature {ROUTINE, E_FEATURE} -- Implementation

    frozen closed_map: ARRAY [INTEGER]
            -- Index map for closed arguments

    frozen closed_operands: TUPLE
            -- Closed arguments provided at creation time

    closed_type_codes: STRING is
            -- Type codes for closed arguments
        do
            if closed_operands /= void and internal_closed_type_codes = void then
                internal_closed_type_codes := eif_gen_tuple_typecode_str ($closed_operands)
            end
            Result := internal_closed_type_codes
        end

    frozen eiffel_rout_disp: POINTER
            -- Eiffel routine dispatcher

    frozen open_map: ARRAY [INTEGER]
            -- Index map for open arguments

    open_type_codes: STRING is
            -- Type codes for open arguments
        do
            if internal_open_type_codes = void then
                internal_open_type_codes := eif_gen_typecode_str ($Current)
            end
            Result := internal_open_type_codes
        end

    frozen open_types: ARRAY [INTEGER]
            -- Types of open operands

    frozen operands_set_by_user: BOOLEAN
            -- Are operands set throug call to set_operands.
            -- If not, we can delete them after routine call for
            -- later collection.

    frozen rout_disp: POINTER
            -- Routine dispatcher

    frozen set_rout_args (closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
        require
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

    frozen set_rout_disp (p: POINTER; tp: POINTER; closed_args: TUPLE; omap, cmap: ARRAY [INTEGER]) is
            -- Initialize object.
        require
            p_not_void: p /= default_pointer
            tp_not_void: tp /= default_pointer
            consistent_args: (closed_args = void and cmap = void) or else (closed_args /= void and cmap /= void) and then (closed_args.count >= cmap.count)
            valid_maps: not (omap = void and cmap = void)
        do
            rout_disp := p
            eiffel_rout_disp := tp
            closed_operands := closed_args
            open_map := omap
            closed_map := cmap
        end

feature {NONE} -- Implementation

    dispose is
            -- Free routine argument union structure
        local
            null_ptr: POINTER
        do
            if rout_cargs /= null_ptr then
                rout_obj_free_args (rout_cargs)
                rout_cargs := null_ptr
            end
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

    frozen internal_closed_type_codes: STRING

    frozen internal_open_type_codes: STRING

    frozen rout_cargs: POINTER
            -- Routine operands

    frozen rout_set_cargs is
            -- Allocate and fill argument structure
        local
            new_args: POINTER
            i, j, ocnt, ccnt: INTEGER
            code: CHARACTER
            ref_arg: ANY
            null_ptr: POINTER
            was_on: BOOLEAN
            loc_open_map: like open_map
            loc_closed_map: like closed_map
            loc_operands: like operands
            loc_closed_operands: like closed_operands
            loc_open_type_codes: like open_type_codes
            loc_closed_type_codes: like closed_type_codes
        do
            was_on := collecting
            collection_off
            loc_open_map := open_map
            if loc_open_map /= void then
                ocnt := loc_open_map.count
                loc_open_type_codes := open_type_codes
                loc_operands := operands
            end
            loc_closed_map := closed_map
            if loc_closed_map /= void then
                ccnt := loc_closed_map.count
                loc_closed_type_codes := closed_type_codes
                loc_closed_operands := closed_operands
            end
            if rout_cargs = null_ptr then
                new_args := rout_obj_new_args (ocnt + ccnt + 1)
                rout_cargs := new_args
            else
                new_args := rout_cargs
            end
            from
                i := 1
            until
                i > ocnt
            loop
                code := loc_open_type_codes.item (i + 1)
                check
                    loc_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_operands.real_item (i)
                else
                    ref_arg := loc_operands.item (i)
                end
                j := loc_open_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            from
                i := 1
            until
                i > ccnt
            loop
                code := loc_closed_type_codes.item (i)
                check
                    loc_closed_operands /= void
                end
                if code = eif_real_code then
                    ref_arg := loc_closed_operands.real_item (i)
                else
                    ref_arg := loc_closed_operands.item (i)
                end
                j := loc_closed_map.item (i)
                inspect code
                when eif_boolean_code then
                    rout_obj_putb (new_args, j, $ref_arg)
                when eif_character_code then
                    rout_obj_putc (new_args, j, $ref_arg)
                when eif_double_code then
                    rout_obj_putd (new_args, j, $ref_arg)
                when eif_integer_8_code then
                    rout_obj_puti8 (new_args, j, $ref_arg)
                when eif_integer_16_code then
                    rout_obj_puti16 (new_args, j, $ref_arg)
                when eif_integer_code then
                    rout_obj_puti32 (new_args, j, $ref_arg)
                when eif_integer_64_code then
                    rout_obj_puti64 (new_args, j, $ref_arg)
                when eif_pointer_code then
                    rout_obj_putp (new_args, j, $ref_arg)
                when eif_real_code then
                    rout_obj_putf (new_args, j, $ref_arg)
                when eif_wide_char_code then
                    rout_obj_putwc (new_args, j, $ref_arg)
                else
                    rout_obj_putr (new_args, j, $ref_arg)
                end
                i := i + 1
            end
            if was_on then
                collection_on
            end
        rescue
            if was_on then
                collection_on
            end
        end

feature {NONE} -- Externals

    eif_gen_conf (type1, type2: INTEGER): BOOLEAN is
            -- Does type1 conform to type2?
        external
            "C (int16, int16): EIF_BOOLEAN | %"eif_gen_conf.h%""
        end

    eif_gen_create (obj: POINTER; pos: INTEGER): POINTER is
            -- Adapt args for idx and val.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_param_id (stype: INTEGER; obj: POINTER; pos: INTEGER): INTEGER is
            -- Type of generic parameter in obj at position pos.
        external
            "C (int16, EIF_REFERENCE, int): EIF_INTEGER | %"eif_gen_conf.h%""
        end

    eif_gen_tuple_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode (obj: POINTER; pos: INTEGER): CHARACTER is
            -- Code for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode_str (obj: POINTER): STRING is
            -- Code name for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    rout_obj_free_args (args: POINTER) is
            -- Free args.
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_new_args (cnt: INTEGER): POINTER is
            -- Initialize for new operands.
        external
            "C | %"eif_rout_obj.h%""
        end

    rout_obj_putb (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putd (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putf (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti16 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti32 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti64 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_puti8 (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putp (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putr (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

    rout_obj_putwc (args: POINTER; idx: INTEGER; val: POINTER) is
            -- Adapt args for idx and val.
        external
            "C[macro %"eif_rout_obj.h%"]"
        end

feature {NONE} -- Runtime constants

    Eif_boolean_code: CHARACTER is 'b'

    Eif_character_code: CHARACTER is 'c'

    Eif_double_code: CHARACTER is 'd'

    Eif_integer_16_code: CHARACTER is 'k'

    Eif_integer_64_code: CHARACTER is 'l'

    Eif_integer_8_code: CHARACTER is 'j'

    Eif_integer_code: CHARACTER is 'i'

    Eif_pointer_code: CHARACTER is 'p'

    Eif_real_code: CHARACTER is 'f'

    Eif_reference_code: CHARACTER is 'r'

    Eif_wide_char_code: CHARACTER is 'u'
            -- Type constants used by runtime to recognize types
            -- needed to perform call

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ROUTINE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a routine,
        with some operands possibly still open
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS])
            -- Initialize from other.
            -- Useful in descendants.
        require
            other_exists: other /= void
            conforming: conforms_to (other)
        ensure
            same_call_status: other.callable implies callable

feature -- Access

    hash_code: INTEGER
            -- Hash code value.
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    open_operand_type (i: INTEGER): INTEGER
            -- Type of ith open operand.
        require
            positive: i >= 1
            within_bounds: i <= open_count

    operands: OPEN_ARGS
            -- Open operands.

    postcondition (args: like operands): BOOLEAN
            -- Does current state satisfy routine's
            -- postcondition for args?

    precondition (args: like operands): BOOLEAN
            -- Do args satisfy routine's precondition
            -- in current state?

    target: ANY
            -- Target of call.

feature -- Measurement

    open_count: INTEGER
            -- Number of open operands.

feature -- Status report

    callable: BOOLEAN
            -- Can routine be called on current object?

    is_equal (other: like Current): BOOLEAN
            -- Is associated routine the same as the one
            -- associated with other.
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    valid_operands (args: OPEN_ARGS): BOOLEAN
            -- Are args valid operands for this routine?

feature -- Element change

    set_operands (args: OPEN_ARGS)
            -- Use args as operands for next call.
        require
            valid_operands: valid_operands (args)

feature -- Duplication

    copy (other: like Current)
            -- Use same routine as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            same_call_status: other.callable implies callable

feature -- Basic operations

    apply
            -- Call routine with operands as last set.
        require
            valid_operands: valid_operands (operands)
            callable: callable

    call (args: OPEN_ARGS)
            -- Call routine with operands args.
        require
            valid_operands: valid_operands (args)
            callable: callable

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ROUTINE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Ancestors
    HASHABLE
    MEMORY

Descendants
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Clients
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Suppliers
    ARRAY [G]
    BOOLEAN
    INTEGER
    INTERNAL
    POINTER
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    STRING
    TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ROUTINE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects representing delayed calls to a routine,
        with some operands possibly still open
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS])
            -- Initialize from other.
            -- Useful in descendants.
        require
            other_exists: other /= void
            conforming: conforms_to (other)
        ensure
            same_call_status: other.callable implies callable

feature -- Access

    operands: OPEN_ARGS
            -- Open operands.

    target: ANY
            -- Target of call.

    open_operand_type (i: INTEGER): INTEGER
            -- Type of ith open operand.
        require
            positive: i >= 1
            within_bounds: i <= open_count

    hash_code: INTEGER
            -- Hash code value.

    precondition (args: like operands): BOOLEAN
            -- Do args satisfy routine's precondition
            -- in current state?

    postcondition (args: like operands): BOOLEAN
            -- Does current state satisfy routine's
            -- postcondition for args?

feature -- Status report

    callable: BOOLEAN
            -- Can routine be called on current object?

    is_equal (other: like Current): BOOLEAN
            -- Is associated routine the same as the one
            -- associated with other.

    valid_operands (args: OPEN_ARGS): BOOLEAN
            -- Are args valid operands for this routine?

feature -- Measurement

    open_count: INTEGER
            -- Number of open operands.

feature -- Element change

    set_operands (args: OPEN_ARGS)
            -- Use args as operands for next call.
        require
            valid_operands: valid_operands (args)

feature -- Duplication

    copy (other: like Current)
            -- Use same routine as other.
        ensure then
            same_call_status: other.callable implies callable

feature -- Basic operations

    call (args: OPEN_ARGS)
            -- Call routine with operands args.
        require
            valid_operands: valid_operands (args)
            callable: callable

    apply
            -- Call routine with operands as last set.
        require
            valid_operands: valid_operands (operands)
            callable: callable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ROUTINE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQ_STRING Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    SEQ_STRING

inherit
    STRING
        rename
            precede as string_precede,
            prepend as string_prepend,
            mirrored as string_mirrored,
            mirror as string_mirror,
            share as string_share,
            wipe_out as string_wipe_out
        export
            {ANY} linear_representation
        undefine
            linear_representation
        redefine
            has,
            prune
        end

    SEQUENCE [CHARACTER]
        rename
            append as seq_append,
            item as current_item,
            index_of as index_of_occurrence,
            put as sequence_put,
            remove as remove_current_item
        export
            {NONE} sequence_put, seq_append
        undefine
            occurrences,
            out,
            copy,
            is_equal,
            prune_all,
            changeable_comparison_criterion
        redefine
            has,
            index_of_occurrence,
            prune
        select
            wipe_out,
            sequence_put
        end

create
    make

feature -- Access

    search_after (c: CHARACTER) is
            -- Move cursor to first position
            -- (at or after current cursor position)
            -- where current_item and c are identical.
        do
            if not off then
                index := index_of (c, index)
                if index = 0 then
                    index := count + 1
                end
            end
        end

    search_before (c: CHARACTER) is
            -- Move cursor to greatest position at or before cursor
            -- where current_item and c are identical;
            -- go before if unsuccessful.
        local
            str: like Current
        do
            str := mirrored
            if not str.off then
                index := count + 1 - str.index_of (c, str.index)
                if index = count + 1 then
                    index := 0
                end
            end
        end

    search_string_after (s: STRING; fuzzy: INTEGER) is
            -- Move cursor to first position
            -- (at or after cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go after if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.
        local
            s_area: ANY
        do
            if not off then
                s_area := s.area
                index := str_str ($area, $s_area, count, s.count, index, fuzzy)
                if index = 0 then
                    index := count + 1
                end
            end
        end

    search_string_before (s: STRING; fuzzy: INTEGER) is
            -- Move cursor to first position
            -- (at or before cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go before if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.
        local
            s_mir_area, mir_area: ANY
            str_mirrored: like Current
            s_mirrored: STRING
        do
            if not off then
                str_mirrored := mirrored
                s_mirrored := s.mirrored
                s_mir_area := s_mirrored.area
                mir_area := str_mirrored.area
                index := count - str_str ($mir_area, $s_mir_area, count, s.count, str_mirrored.index, fuzzy) + 1
                if index = count + 1 then
                    index := 0
                else
                    index := index - s.count + 1
                end
            end
        end

    current_item: CHARACTER is
            -- Current item
        do
            Result := item (index)
        end

    index: INTEGER
            -- Index of current_item, if valid
            -- Valid values are between 1 and count (if count > 0).

    index_of_occurrence (c: CHARACTER; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of c.
            -- 0 if none.
        local
            occur: INTEGER
        do
            if not is_empty then
                from
                    Result := index_of (c, 1)
                    if Result /= 0 then
                        occur := 1
                    end
                until
                    (Result = 0) or else (occur = i)
                loop
                    if Result /= count then
                        Result := index_of (c, Result + 1)
                        if Result /= 0 then
                            occur := occur + 1
                        end
                    else
                        Result := 0
                    end
                end
            end
        ensure then
            index_value: (Result = 0) or item (Result) = c
        end

    has (c: CHARACTER): BOOLEAN is
            -- Does string include c?
        do
            if not is_empty then
                Result := (index_of (c, 1) /= 0)
            end
        end

feature -- Status report

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
        do
            Result := index < 1
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := index > count
        end

feature -- Cursor movement

    start is
            -- Move to first position.
        do
            index := 1
        end

    finish is
            -- Move to last position.
        do
            index := count
        end

    back is
            -- Move to previous position.
        do
            index := index - 1
        end

    forth is
            -- Move to next position.
        do
            index := index + 1
        end

feature -- Element change

    replace (c: CHARACTER) is
            -- Replace current item by c.
        do
            put (c, index)
        end

    share (other: like Current) is
            -- Make string share the text of other.
        require
            argument_not_void: other /= void
        do
            string_share (other)
            index := other.index
        ensure
            shared_index: other.index = index
        end

    precede (c: CHARACTER) is
            -- Add c at front.
        do
            string_precede (c)
            index := index + 1
        ensure
            new_index: index = old index + 1
        end

    prepend (s: STRING) is
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        do
            string_prepend (s)
            index := index + s.count
        ensure
            new_index: index = old index + s.count
        end

feature -- Removal

    prune (c: CHARACTER) is
            -- Remove first occurrence of c.
        local
            i: INTEGER
        do
            if count /= 0 then
                i := index_of (c, 1)
                if i /= 0 then
                    remove (i)
                end
            end
        end

    remove_current_item is
            -- Remove current item.
        do
            remove (index)
        end

    wipe_out is
            -- Clear out all characters.
        do
            string_wipe_out
            index := 0
        end

feature -- Duplication

    mirrored: like Current is
            -- Current string read from right to left.
            -- The result string has the same capacity and the
            -- same current position (i.e. the cursor is pointing
            -- at the same item)
        do
            Result := string_mirrored
            if not after then
                from
                    Result.start
                until
                    Result.index = count - index + 1
                loop
                    Result.forth
                end
            end
        ensure
            mirrored_index: Result.index = count - index + 1
            same_count: Result.count = count
        end

    mirror is
            -- Reverse the characters order.
            -- "Hello world" -> "dlrow olleH".
            -- The current position will be on the same item
            -- as before.
        do
            string_mirror
            index := count + 1 - index
        ensure
            same_count: count = old count
            mirrored_index: index = count - old index + 1
        end

feature {NONE} -- Inapplicable

    go_to (r: CURSOR) is
            -- Go to position marked r.
        do
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQ_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQ_STRING Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SEQ_STRING

General
    cluster: base.kernel
    create: make

Ancestors
    SEQUENCE [G]
    STRING

Queries
    infix "@" (i: INTEGER): CHARACTER
    infix ">=" (other: [like Current] SEQ_STRING): BOOLEAN
    infix ">" (other: [like Current] SEQ_STRING): BOOLEAN
    infix "<=" (other: [like Current] SEQ_STRING): BOOLEAN
    infix "<" (other: [like Current] SEQ_STRING): BOOLEAN
    infix "+" (s: STRING): STRING
    adapt (s: STRING): [like Current] SEQ_STRING
    additional_space: INTEGER
    after: BOOLEAN
    area: SPECIAL [CHARACTER]
    before: BOOLEAN
    capacity: INTEGER
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    current_item: CHARACTER
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    False_constant: STRING
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    fuzzy_index (other: STRING; start, fuzz: INTEGER): INTEGER
    Growth_percentage: INTEGER
    has (c: CHARACTER): BOOLEAN
    hash_code: INTEGER
    index: INTEGER
    index_of (c: CHARACTER; start: INTEGER): INTEGER
    index_of_occurrence (c: CHARACTER; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_boolean: BOOLEAN
    is_double: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] SEQ_STRING): BOOLEAN
    is_hashable: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_integer: BOOLEAN
    is_real: BOOLEAN
    item (i: INTEGER): CHARACTER
    item_code (i: INTEGER): INTEGER
    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
    linear_representation: LINEAR [CHARACTER]
    max (other: [like Current] SEQ_STRING): [like Current] SEQ_STRING
    min (other: [like Current] SEQ_STRING): [like Current] SEQ_STRING
    Minimal_increase: INTEGER
    mirrored: [like Current] SEQ_STRING
    object_comparison: BOOLEAN
    occurrences (c: CHARACTER): INTEGER
    off: BOOLEAN
    out: [like Current] SEQ_STRING
    prunable: BOOLEAN
    readable: BOOLEAN
    resizable: BOOLEAN
    shared_with (other: [like Current] SEQ_STRING): BOOLEAN
    split (a_separator: CHARACTER): LINEAR [STRING]
    string_mirrored: [like Current] SEQ_STRING
    substring (n1, n2: INTEGER): [like Current] SEQ_STRING
    substring_index (other: STRING; start: INTEGER): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    three_way_comparison (other: [like Current] SEQ_STRING): INTEGER
    to_boolean: BOOLEAN
    to_c: ANY
    to_double: DOUBLE
    to_integer: INTEGER
    to_real: REAL
    True_constant: STRING
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    adapt_size
    append (s: STRING)
    append_boolean (b: BOOLEAN)
    append_character (c: CHARACTER)
    append_double (d: DOUBLE)
    append_integer (i: INTEGER)
    append_real (r: REAL)
    append_string (s: STRING)
    automatic_grow
    back
    center_justify
    character_justify (pivot: CHARACTER; position: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] SEQ_STRING)
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (c: CHARACTER)
    fill (other: CONTAINER [CHARACTER])
    fill_blank
    fill_character (c: CHARACTER)
    finish
    force (v: [like item] CHARACTER)
    forth
    from_c (c_string: POINTER)
    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
    grow (newsize: INTEGER)
    head (n: INTEGER)
    insert (s: STRING; i: INTEGER)
    left_adjust
    left_justify
    make_from_c (c_string: POINTER)
    make_from_string (s: STRING)
    mirror
    multiply (n: INTEGER)
    precede (c: CHARACTER)
    prepend (s: STRING)
    prepend_boolean (b: BOOLEAN)
    prepend_character (c: CHARACTER)
    prepend_double (d: DOUBLE)
    prepend_integer (i: INTEGER)
    prepend_real (r: REAL)
    prepend_string (s: STRING)
    prune (c: CHARACTER)
    prune_all (c: CHARACTER)
    prune_all_leading (c: CHARACTER)
    prune_all_trailing (c: CHARACTER)
    put (c: CHARACTER; i: INTEGER)
    remove (i: INTEGER)
    remove_current_item
    replace (c: CHARACTER)
    replace_blank
    replace_character (c: CHARACTER)
    replace_substring (s: [like Current] SEQ_STRING; start_pos, end_pos: INTEGER)
    replace_substring_all (original, new: [like Current] SEQ_STRING)
    resize (newsize: INTEGER)
    right_adjust
    right_justify
    search (v: [like item] CHARACTER)
    search_after (c: CHARACTER)
    search_before (c: CHARACTER)
    search_string_after (s: STRING; fuzzy: INTEGER)
    search_string_before (s: STRING; fuzzy: INTEGER)
    set (t: [like Current] SEQ_STRING; n1, n2: INTEGER)
    share (other: [like Current] SEQ_STRING)
    start
    string_mirror
    string_precede (c: CHARACTER)
    string_prepend (s: STRING)
    string_share (other: [like Current] SEQ_STRING)
    string_wipe_out
    subcopy (other: [like Current] SEQ_STRING; start_pos, end_pos, index_pos: INTEGER)
    tail (n: INTEGER)
    to_lower
    to_upper
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQ_STRING Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:29 $"
    revision: "$Revision: 1.2 $"

class
    SEQ_STRING

create
    make

feature {NONE} -- Initialization

    make (n: INTEGER) is
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            if n = 0 then
                area := empty_area
            else
                make_area (n + 1)
            end
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature -- Initialization

    adapt (s: STRING): like Current is
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)
        do
            create Result.make (0)
            Result.string_share (s)
        end

    from_c (c_string: POINTER) is
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string, length)
            count := length
        ensure -- from STRING
            no_zero_byte: not has ('%U')
        end

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER) is
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        local
            length: INTEGER
        do
            length := end_pos - start_pos + 1
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string + (start_pos - 1), (end_pos - start_pos + 1))
            count := length
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1
        end

    make_from_c (c_string: POINTER) is
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            make_area (length + 1);
            ($area).memory_copy (c_string, length)
            count := length
        end

    make_from_string (s: STRING) is
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        do
            area := s.area
            count := s.count
        ensure -- from STRING
            shared_implementation: shared_with (s)
        end

    remake (n: INTEGER) is
        obsolete "Use `make' instead"
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        do
            count := 0
            make (n)
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n
        end

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    current_item: CHARACTER is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := item (index)
        end

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, fuzz)
        end

    has (c: CHARACTER): BOOLEAN is
            -- Does string include c?
        do
            if not is_empty then
                Result := (index_of (c, 1) /= 0)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from STRING)
        do
            Result := hashcode ($area, count)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    index: INTEGER
            -- Index of current_item, if valid
            -- Valid values are between 1 and count (if count > 0).

    index_of (c: CHARACTER; start: INTEGER): INTEGER is
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        local
            a: like area
            i, nb: INTEGER
        do
            nb := count
            if start <= nb then
                from
                    i := start - 1
                    nb := nb - 1
                    a := area
                until
                    i > nb or else a.item (i) = c
                loop
                    i := i + 1
                end
                if i <= nb then
                    Result := i + 1
                end
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    index_of_occurrence (c: CHARACTER; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of c.
            -- 0 if none.
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur: INTEGER
        do
            if not is_empty then
                from
                    Result := index_of (c, 1)
                    if Result /= 0 then
                        occur := 1
                    end
                until
                    (Result = 0) or else (occur = i)
                loop
                    if Result /= count then
                        Result := index_of (c, Result + 1)
                        if Result /= 0 then
                            occur := occur + 1
                        end
                    else
                        Result := 0
                    end
                end
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then
            index_value: (Result = 0) or item (Result) = c
        end

    item (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

    item_code (i: INTEGER): INTEGER is
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            Result := area.item (i - 1).code
        end

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER is
            -- Position of last occurence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        local
            a: like area
            i: INTEGER
        do
            from
                i := start_index_from_end - 1
                a := area
            until
                i < 0 or else a.item (i) = c
            loop
                i := i - 1
            end
            if i >= 0 then
                Result := i + 1
            end
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from BILINEAR)
        do
            Result := before or after
        end

    search_after (c: CHARACTER) is
            -- Move cursor to first position
            -- (at or after current cursor position)
            -- where current_item and c are identical.
        do
            if not off then
                index := index_of (c, index)
                if index = 0 then
                    index := count + 1
                end
            end
        end

    search_before (c: CHARACTER) is
            -- Move cursor to greatest position at or before cursor
            -- where current_item and c are identical;
            -- go before if unsuccessful.
        local
            str: like Current
        do
            str := mirrored
            if not str.off then
                index := count + 1 - str.index_of (c, str.index)
                if index = count + 1 then
                    index := 0
                end
            end
        end

    search_string_after (s: STRING; fuzzy: INTEGER) is
            -- Move cursor to first position
            -- (at or after cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go after if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.
        local
            s_area: ANY
        do
            if not off then
                s_area := s.area
                index := str_str ($area, $s_area, count, s.count, index, fuzzy)
                if index = 0 then
                    index := count + 1
                end
            end
        end

    search_string_before (s: STRING; fuzzy: INTEGER) is
            -- Move cursor to first position
            -- (at or before cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go before if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.
        local
            s_mir_area, mir_area: ANY
            str_mirrored: like Current
            s_mirrored: STRING
        do
            if not off then
                str_mirrored := mirrored
                s_mirrored := s.mirrored
                s_mir_area := s_mirrored.area
                mir_area := str_mirrored.area
                index := count - str_str ($mir_area, $s_mir_area, count, s.count, str_mirrored.index, fuzzy) + 1
                if index = count + 1 then
                    index := 0
                else
                    index := index - s.count + 1
                end
            end
        end

    shared_with (other: like Current): BOOLEAN is
            -- Does string share the text of other?
            -- (from STRING)
        do
            Result := (other /= void) and then (area = other.area)
        end

    substring_index (other: STRING; start: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, 0)
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)
        end

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

feature {NONE} -- Access

    sequential_search (v: like current_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (current_item /= void and then v.is_equal (current_item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = current_item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, current_item)
            item_found: (not exhausted and not object_comparison) implies v = current_item
        end

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Allocated space
            -- (from STRING)
        do
            Result := area.count - 1
        end

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from STRING)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count
        end

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER is
            -- Number of times c appears in the string
            -- (from STRING)
        local
            counter, nb: INTEGER
            a: SPECIAL [CHARACTER]
        do
            from
                counter := 0
                nb := count - 1
                a := area
            until
                counter > nb
            loop
                if a.item (counter) = c then
                    Result := Result + 1
                end
                counter := counter + 1
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
        local
            o_area: like area
        do
            if other = Current then
                Result := True
            elseif count = other.count then
                o_area := other.area;
                Result := str_strict_cmp ($area, $o_area, count) = 0
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: like Current): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current < other then
                Result := - 1
            elseif other < Current then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        local
            other_area: like area
            other_count: INTEGER
            current_count: INTEGER
        do
            other_area := other.area
            other_count := other.count
            current_count := count
            if other_count = current_count then
                Result := str_strict_cmp ($other_area, $area, other_count) > 0
            else
                if current_count < other_count then
                    Result := str_strict_cmp ($other_area, $area, current_count) >= 0
                else
                    Result := str_strict_cmp ($other_area, $area, other_count) > 0
                end
            end
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := index > count
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
        do
            Result := index < 1
        end

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_boolean: BOOLEAN is
            -- Does Current represent a BOOLEAN?
            -- (from STRING)
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant) or else s.is_equal (false_constant)
        end

    is_double: BOOLEAN is
            -- Does Current represent a DOUBLE?
            -- (from STRING)
        do
            Result := str_isd ($area, count)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_integer: BOOLEAN is
            -- Does Current represent an INTEGER?
            -- (from STRING)
        do
            Result := str_isi ($area, count)
        end

    is_real: BOOLEAN is
            -- Does Current represent a REAL?
            -- (from STRING)
        do
            Result := str_isr ($area, count)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from STRING)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the string?
            -- (from STRING)
        do
            Result := (i > 0) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
        require -- from BILINEAR
            not_before: not before
        do
            index := index - 1
        end

    finish is
            -- Move to last position.
        do
            index := count
        end

    forth is
            -- Move to next position.
        require -- from LINEAR
            not_after: not after
        do
            index := index + 1
        end

    search (v: like current_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, current_item)
            item_found: (not exhausted and not object_comparison) implies v = current_item
        end

    start is
            -- Move to first position.
        do
            index := 1
        end

feature -- Element change

    append (s: STRING) is
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area;
            ($area + count).memory_copy ($s_area, s.count)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + old s.count
        end

    append_boolean (b: BOOLEAN) is
            -- Append the string representation of b at end.
            -- (from STRING)
        do
            append (b.out)
        end

    append_character (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    append_double (d: DOUBLE) is
            -- Append the string representation of d at end.
            -- (from STRING)
        do
            append (d.out)
        end

    append_integer (i: INTEGER) is
            -- Append the string representation of i at end.
            -- (from STRING)
        do
            append (i.out)
        end

    append_real (r: REAL) is
            -- Append the string representation of r at end.
            -- (from STRING)
        do
            append (r.out)
        end

    append_string (s: STRING) is
            -- Append a copy of s, if not void, at end.
            -- (from STRING)
        do
            if s /= void then
                append (s)
            end
        end

    copy (other: like Current) is
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            old_area: like area
        do
            if other /= Current then
                old_area := area
                standard_copy (other)
                if old_area = void or else old_area.count < area.count then
                    area := standard_clone (area)
                else
                    ($old_area).memory_copy ($area, count)
                    area := old_area
                end
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count
        end

    extend (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_blank is
            -- Fill with capacity blank characters.
            -- (from STRING)
        do
            fill_character (' ')
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    fill_character (c: CHARACTER) is
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, capacity)
            count := capacity
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    force (v: like current_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    head (n: INTEGER) is
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        do
            if n < count then
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    insert (s: STRING; i: INTEGER) is
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, i)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    left_adjust is
            -- Remove leading whitespace.
            -- (from STRING)
        do
            count := str_left ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))
        end

    string_precede (c: CHARACTER) is
            -- Add c at front.
            -- (from STRING)
        do
            if count = capacity then
                resize (count + additional_space)
            end
            str_cprepend ($area, c, count)
            count := count + 1
        ensure -- from STRING
            new_count: count = old count + 1
        end

    precede (c: CHARACTER) is
            -- Add c at front.
        do
            string_precede (c)
            index := index + 1
        ensure
            new_index: index = old index + 1
        end

    prepend (s: STRING) is
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        do
            string_prepend (s)
            index := index + s.count
        ensure
            new_index: index = old index + s.count
        end

    string_prepend (s: STRING) is
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := count + s.count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, 1)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count
        end

    prepend_boolean (b: BOOLEAN) is
            -- Prepend the string representation of b at front.
            -- (from STRING)
        do
            string_prepend (b.out)
        end

    prepend_character (c: CHARACTER) is
            -- Prepend the string representation of c at front.
            -- (from STRING)
        do
            string_prepend (c.out)
        end

    prepend_double (d: DOUBLE) is
            -- Prepend the string representation of d at front.
            -- (from STRING)
        do
            string_prepend (d.out)
        end

    prepend_integer (i: INTEGER) is
            -- Prepend the string representation of i at front.
            -- (from STRING)
        do
            string_prepend (i.out)
        end

    prepend_real (r: REAL) is
            -- Prepend the string representation of r at front.
            -- (from STRING)
        do
            string_prepend (r.out)
        end

    prepend_string (s: STRING) is
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)
        do
            if s /= void then
                string_prepend (s)
            end
        end

    put (c: CHARACTER; i: INTEGER) is
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (c, i - 1)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    replace (c: CHARACTER) is
            -- Replace current item by c.
        require -- from ACTIVE
            writable: writable
        do
            put (c, index)
        ensure -- from ACTIVE
            item_replaced: current_item = v
        end

    replace_blank is
            -- Replace all current characters with blanks.
            -- (from STRING)
        do
            replace_character (' ')
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_character (c: CHARACTER) is
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        do
            ($area).memory_set (c.code, count)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_substring (s: like Current; start_pos, end_pos: INTEGER) is
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        local
            new_size, substring_size: INTEGER
            s_area: like area
        do
            substring_size := end_pos - start_pos + 1
            new_size := s.count + count - substring_size
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_replace ($area, $s_area, count, s.count, start_pos, end_pos)
            count := new_size
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1
        end

    replace_substring_all (original, new: like Current) is
            -- Replace every occurence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty
        local
            change_pos: INTEGER
        do
            if not is_empty then
                from
                    change_pos := substring_index (original, 1)
                until
                    change_pos = 0
                loop
                    replace_substring (new, change_pos, change_pos + original.count - 1)
                    if change_pos + new.count <= count then
                        change_pos := substring_index (original, change_pos + new.count)
                    else
                        change_pos := 0
                    end
                end
            end
        end

    right_adjust is
            -- Remove trailing whitespace.
            -- (from STRING)
        do
            count := str_right ($area, count)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))
        end

    set (t: like Current; n1, n2: INTEGER) is
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        local
            s: STRING
        do
            s := t.substring (n1, n2)
            area := s.area
            count := s.count
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))
        end

    share (other: like Current) is
            -- Make string share the text of other.
        require
            argument_not_void: other /= void
        do
            string_share (other)
            index := other.index
        ensure
            shared_index: other.index = index
        end

    string_share (other: like Current) is
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        do
            area := other.area
            count := other.count
        ensure -- from STRING
            shared_count: other.count = count
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            start0 := start_pos - 1
            end0 := end_pos - 1
            index0 := index_pos - 1
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

    tail (n: INTEGER) is
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        local
            i, j: INTEGER
        do
            if n < count then
                from
                    j := (count - n)
                    i := 0
                until
                    i = n
                loop
                    area.put (area.item (j), i)
                    i := i + 1
                    j := j + 1
                end
                count := n
            end
        ensure -- from STRING
            new_count: count = n.min (old count)
        end

    infix "+" (s: STRING): STRING is
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        do
            create Result.make (count + s.count)
            Result.append_string (Current)
            Result.append_string (s)
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count
        end

feature {NONE} -- Element change

    seq_append (s: SEQUENCE [CHARACTER]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    sequence_put (v: like current_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature -- Removal

    clear_all is
            -- Reset all characters.
            -- (from STRING)
        do
            count := 0
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity
        end

    prune (c: CHARACTER) is
            -- Remove first occurrence of c.
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True
        local
            i: INTEGER
        do
            if count /= 0 then
                i := index_of (c, 1)
                if i /= 0 then
                    remove (i)
                end
            end
        end

    prune_all (c: CHARACTER) is
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        do
            count := str_rmall ($area, c, count)
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))
        end

    prune_all_leading (c: CHARACTER) is
            -- Remove all leading occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (1) /= c
            loop
                remove (1)
            end
        end

    prune_all_trailing (c: CHARACTER) is
            -- Remove all trailing occurrences of c.
            -- (from STRING)
        do
            from
            until
                is_empty or else item (count) /= c
            loop
                remove (count)
            end
        end

    remove (i: INTEGER) is
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            str_rmchar ($area, count, i)
            count := count - 1
        ensure -- from STRING
            new_count: count = old count - 1
        end

    remove_current_item is
            -- Remove current item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            remove (index)
        end

    wipe_out is
            -- Clear out all characters.
        require -- from COLLECTION
            prunable
        do
            string_wipe_out
            index := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

    string_wipe_out is
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        do
            area := empty_area
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0
        end

feature -- Resizing

    adapt_size is
            -- Adapt the size to accommodate count characters.
            -- (from STRING)
        do
            resize (count)
        end

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (newsize: INTEGER) is
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        do
            if newsize > capacity then
                resize (newsize)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (newsize: INTEGER) is
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0
        local
            area_count: INTEGER
        do
            area_count := area.count
            if newsize >= area_count then
                if area_count = 1 then
                    make_area (newsize + 1)
                else
                    area := str_resize ($area, newsize + 1)
                end
            end
        end

feature -- Conversion

    center_justify is
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_cjustify ($area, count, capacity)
        end

    character_justify (pivot: CHARACTER; position: INTEGER) is
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty
        do
            if index_of (pivot, 1) < position then
                from
                    string_precede (' ')
                until
                    index_of (pivot, 1) = position
                loop
                    string_precede (' ')
                end
            elseif index_of (pivot, 1) > position then
                from
                    remove (1)
                until
                    index_of (pivot, 1) = position
                loop
                    remove (1)
                end
            end
            from
            until
                count = capacity
            loop
                extend (' ')
            end
        end

    left_justify is
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_ljustify ($area, count, capacity)
        end

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

    string_mirror is
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        local
            a: like area
            c: CHARACTER
            i, j: INTEGER
        do
            if count > 0 then
                from
                    i := count - 1
                    a := area
                until
                    i <= j
                loop
                    c := a.item (i)
                    a.put (a.item (j), i)
                    a.put (c, j)
                    i := i - 1
                    j := j + 1
                end
            end
        ensure -- from STRING
            same_count: count = old count
        end

    string_mirrored: like Current is
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        do
            Result := clone (Current)
            if count > 0 then
                Result.string_mirror
            end
        ensure -- from STRING
            same_count: Result.count = count
        end

    right_justify is
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)
        do
            str_rjustify ($area, count, capacity)
        end

    split (a_separator: CHARACTER): LINEAR [STRING] is
            -- Split on a_separator.
            -- Ignore separators in quotes.
            -- (from STRING)
        local
            al: ARRAYED_LIST [STRING]
            part: STRING
            i, j, c: INTEGER
            q: BOOLEAN
            p: CHARACTER
        do
            from
                c := count
                create al.make (c)
                i := 1
                j := 0
            until
                i > c
            loop
                j := index_of (a_separator, i)
                if j = 0 then
                    j := c + 1
                end
                part := substring (i, j - 1)
                if part.has ('"') then
                    from
                        j := i - 1
                        p := '%U'
                    until
                        j >= c or p = a_separator
                    loop
                        j := j + 1
                        p := item (j)
                        if p = '"' and not (j > 1 and then item (j - 1) = '%%') then
                            q := not q
                        end
                        if q and p = a_separator then
                            p := '%U'
                        end
                    end
                    part := substring (i, j - 1)
                    part.replace_substring_all ("%%%%", "_#___PERCENT___#_")
                    part.replace_substring_all ("%%%"", "_#___QUOTE___#_")
                    part.replace_substring_all ("%"", "")
                    part.replace_substring_all ("_#___PERCENT___#_", "%%")
                    part.replace_substring_all ("_#___QUOTE___#_", "%"")
                    part.prepend ("%"")
                    part.append ("%"")
                end
                al.extend (part)
                i := j + 1
            end
            Result := al
            check
                al.count = occurrences (a_separator)
            end
        ensure -- from STRING
            Result /= void
        end

    to_boolean: BOOLEAN is
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant)
        end

    frozen to_c: ANY is
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)
        do
            area.put ('%U', count)
            Result := area
        end

    to_double: DOUBLE is
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double
        do
            Result := str_atod ($area, count)
        end

    to_integer: INTEGER is
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer
        do
            Result := str_atoi ($area, count)
        end

    to_lower is
            -- Convert to lower case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).lower, i)
                i := i - 1
            end
        end

    to_real: REAL is
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real
        do
            Result := str_ator ($area, count)
        end

    to_upper is
            -- Convert to upper case.
            -- (from STRING)
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).upper, i)
                i := i - 1
            end
        end

feature -- Duplication

    mirror is
            -- Reverse the characters order.
            -- "Hello world" -> "dlrow olleH".
            -- The current position will be on the same item
            -- as before.
        do
            string_mirror
            index := count + 1 - index
        ensure
            same_count: count = old count
            mirrored_index: index = count - old index + 1
        end

    mirrored: like Current is
            -- Current string read from right to left.
            -- The result string has the same capacity and the
            -- same current position (i.e. the cursor is pointing
            -- at the same item)
        do
            Result := string_mirrored
            if not after then
                from
                    Result.start
                until
                    Result.index = count - index + 1
                loop
                    Result.forth
                end
            end
        ensure
            mirrored_index: Result.index = count - index + 1
            same_count: Result.count = count
        end

    multiply (n: INTEGER) is
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1
        local
            s: STRING
            i: INTEGER
        do
            s := clone (Current)
            grow (n * count)
            from
                i := n
            until
                i = 1
            loop
                append (s)
                i := i - 1
            end
        end

    substring (n1, n2: INTEGER): like Current is
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        local
            other_area: like area
        do
            if (1 <= n1) and (n1 <= n2) and (n2 <= count) then
                create Result.make (n2 - n1 + 1)
                other_area := Result.area
                ($other_area).memory_copy ($area + (n1 - 1), n2 - n1 + 1)
                Result.set_count (n2 - n1 + 1)
            else
                create Result.make (0)
            end
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0
        end

feature {NONE} -- Inapplicable

    bag_put (v: CHARACTER) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    go_to (r: CURSOR) is
            -- Go to position marked r.
        do
        end

feature {STRING_HANDLER} -- Implementation

    frozen set_count (number: INTEGER) is
            -- Set count to number of characters.
            -- (from STRING)
        require -- from STRING
            valid_count: 0 <= number and number <= capacity
        do
            count := number
        ensure -- from STRING
            new_count: count = number
        end

feature {STRING} -- Implementation

    c_p_i: INTEGER is
        obsolete "You now have to implement it yourself by inheriting from PLATFORM."
            -- Number of characters per INTEGER
            -- (from STRING)
        do
        end

    hashcode (c_string: POINTER; len: INTEGER): INTEGER is
            -- Hash code value of c_string
            -- (from STRING)
        external
            "C use %"eif_tools.h%""
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy characters of source within bounds s
            -- and e to target starting at index i.
            -- (from STRING)
        external
            "C use %"eif_copy.h%""
        end

    str_atod (c_string: POINTER; length: INTEGER): DOUBLE is
            -- Value of double in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_DOUBLE use %"eif_str.h%""
        end

    str_atoi (c_string: POINTER; length: INTEGER): INTEGER is
            -- Value of integer in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_ator (c_string: POINTER; length: INTEGER): REAL is
            -- Value of real in c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_REAL use %"eif_str.h%""
        end

    str_cjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Center justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_cprepend (c_string: POINTER; c: CHARACTER; length: INTEGER) is
            -- Prepend c to c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_insert (c_string, other_string: POINTER; c_length, other_length, position: INTEGER) is
            -- Insert other_string into c_string at position.
            -- Insertion occurs at the left of position.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_isd (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a double?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isi (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is an integer?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isr (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a real?
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_left (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all leading whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_len (c_string: POINTER): INTEGER is
            -- Length of the C string: c_string
            -- (from STRING)
        external
            "C signature (char *): EIF_INTEGER use %"eif_str.h%""
        alias
            "strlen"
        end

    str_ljustify (c_string: POINTER; length, cap: INTEGER) is
            -- Left justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_replace (c_string, other_string: POINTER; c_length, other_length, star_post, end_pos: INTEGER) is
            -- Replace substring (start_pos, end_pos) from c_string
            -- by other_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_resize (a: POINTER; newsize: INTEGER): like area is
            -- Area which can accomodate
            -- at least newsize characters
            -- (from STRING)
        external
            "C use %"eif_malloc.h%""
        alias
            "sprealloc"
        end

    str_right (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all trailing whitespace from c_string.
            -- Return the new number of characters making c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Right justify in a field of capacity
            -- the c_string of length length
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rmall (c_string: POINTER; c: CHARACTER; length: INTEGER): INTEGER is
            -- Remove all occurrences of c in c_string.
            -- Return new number of character making up c_string
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rmchar (c_string: POINTER; length, i: INTEGER) is
            -- Remove i-th character from c_string.
            -- (from STRING)
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_str (c_str, o_str: POINTER; clen, olen, i, fuzzy: INTEGER): INTEGER is
            -- Forward search of o_str within c_str starting at i.
            -- Return the index within c_str where the pattern was
            -- located, 0 if not found.
            -- The 'fuzzy' parameter is the maximum allowed number of
            -- mismatches within the pattern. A 0 means an exact match.
            -- (from STRING)
        external
            "C use %"eif_eiffel.h%""
        end

    str_strict_cmp (this, other: POINTER; len: INTEGER): INTEGER is
            -- Compare this and other C strings
            -- for the first len characters.
            -- 0 if equal, < 0 if this < other,
            -- > 0 if this > other
            -- (from STRING)
        external
            "C signature (char *, char *, size_t): EIF_INTEGER use <string.h>"
        alias
            "strncmp"
        end

feature {NONE} -- Empty string implementation

    empty_area: SPECIAL [CHARACTER] is
            -- Empty area used when calling `make (0)'.
            -- (from STRING)
        local
            old_area: like area
        once
            old_area := area
            make_area (1)
            Result := area
            area := old_area
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (current_item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [CHARACTER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (current_item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (current_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [CHARACTER]
            c: CURSOR
            t: TUPLE [CHARACTER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (current_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature -- Output

    out: like Current is
            -- Printable representation
            -- (from STRING)
        do
            Result := clone (Current)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQ_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQ_STRING Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    SEQ_STRING

create

    make (n: INTEGER)
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n

feature -- Initialization

    adapt (s: STRING): like Current
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)

    from_c (c_string: POINTER)
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        ensure -- from STRING
            no_zero_byte: not has ('%U')

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        ensure -- from STRING
            shared_implementation: shared_with (s)

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    current_item: CHARACTER
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    hash_code: INTEGER
            -- Hash code value
            -- (from STRING)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    index: INTEGER
            -- Index of current_item, if valid
            -- Valid values are between 1 and count (if count > 0).

    index_of (c: CHARACTER; start: INTEGER): INTEGER
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    index_of_occurrence (c: CHARACTER; i: INTEGER): INTEGER
            -- Index of i-th occurrence of c.
            -- 0 if none.
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then
            index_value: (Result = 0) or item (Result) = c

    item (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

    item_code (i: INTEGER): INTEGER
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
            -- Position of last occurence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    off: BOOLEAN
            -- Is there no current item?
            -- (from BILINEAR)

    search_after (c: CHARACTER)
            -- Move cursor to first position
            -- (at or after current cursor position)
            -- where current_item and c are identical.

    search_before (c: CHARACTER)
            -- Move cursor to greatest position at or before cursor
            -- where current_item and c are identical;
            -- go before if unsuccessful.

    search_string_after (s: STRING; fuzzy: INTEGER)
            -- Move cursor to first position
            -- (at or after cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go after if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.

    search_string_before (s: STRING; fuzzy: INTEGER)
            -- Move cursor to first position
            -- (at or before cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go before if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.

    shared_with (other: like Current): BOOLEAN
            -- Does string share the text of other?
            -- (from STRING)

    substring_index (other: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Allocated space
            -- (from STRING)

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from STRING)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER
            -- Number of times c appears in the string
            -- (from STRING)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_boolean: BOOLEAN
            -- Does Current represent a BOOLEAN?
            -- (from STRING)

    is_double: BOOLEAN
            -- Does Current represent a DOUBLE?
            -- (from STRING)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_integer: BOOLEAN
            -- Does Current represent an INTEGER?
            -- (from STRING)

    is_real: BOOLEAN
            -- Does Current represent a REAL?
            -- (from STRING)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from STRING)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the string?
            -- (from STRING)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move to last position.

    forth
            -- Move to next position.
        require -- from LINEAR
            not_after: not after

    search (v: like current_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, current_item)
            item_found: (not exhausted and not object_comparison) implies v = current_item

    start
            -- Move to first position.

feature -- Element change

    append (s: STRING)
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + old s.count

    append_boolean (b: BOOLEAN)
            -- Append the string representation of b at end.
            -- (from STRING)

    append_character (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    append_double (d: DOUBLE)
            -- Append the string representation of d at end.
            -- (from STRING)

    append_integer (i: INTEGER)
            -- Append the string representation of i at end.
            -- (from STRING)

    append_real (r: REAL)
            -- Append the string representation of r at end.
            -- (from STRING)

    append_string (s: STRING)
            -- Append a copy of s, if not void, at end.
            -- (from STRING)

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count

    extend (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_blank
            -- Fill with capacity blank characters.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    fill_character (c: CHARACTER)
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    force (v: like current_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    head (n: INTEGER)
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    insert (s: STRING; i: INTEGER)
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count + s.count

    left_adjust
            -- Remove leading whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))

    string_precede (c: CHARACTER)
            -- Add c at front.
            -- (from STRING)
        ensure -- from STRING
            new_count: count = old count + 1

    precede (c: CHARACTER)
            -- Add c at front.
        ensure
            new_index: index = old index + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        ensure
            new_index: index = old index + s.count

    string_prepend (s: STRING)
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + s.count

    prepend_boolean (b: BOOLEAN)
            -- Prepend the string representation of b at front.
            -- (from STRING)

    prepend_character (c: CHARACTER)
            -- Prepend the string representation of c at front.
            -- (from STRING)

    prepend_double (d: DOUBLE)
            -- Prepend the string representation of d at front.
            -- (from STRING)

    prepend_integer (i: INTEGER)
            -- Prepend the string representation of i at front.
            -- (from STRING)

    prepend_real (r: REAL)
            -- Prepend the string representation of r at front.
            -- (from STRING)

    prepend_string (s: STRING)
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)

    put (c: CHARACTER; i: INTEGER)
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    replace (c: CHARACTER)
            -- Replace current item by c.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: current_item = v

    replace_blank
            -- Replace all current characters with blanks.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_character (c: CHARACTER)
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_substring (s: like Current; start_pos, end_pos: INTEGER)
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1

    replace_substring_all (original, new: like Current)
            -- Replace every occurence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty

    right_adjust
            -- Remove trailing whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))

    set (t: like Current; n1, n2: INTEGER)
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))

    share (other: like Current)
            -- Make string share the text of other.
        require
            argument_not_void: other /= void
        ensure
            shared_index: other.index = index

    string_share (other: like Current)
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        ensure -- from STRING
            shared_count: other.count = count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)

    tail (n: INTEGER)
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    infix "+" (s: STRING): STRING
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count

feature -- Removal

    clear_all
            -- Reset all characters.
            -- (from STRING)
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity

    prune (c: CHARACTER)
            -- Remove first occurrence of c.
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True

    prune_all (c: CHARACTER)
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))

    prune_all_leading (c: CHARACTER)
            -- Remove all leading occurrences of c.
            -- (from STRING)

    prune_all_trailing (c: CHARACTER)
            -- Remove all trailing occurrences of c.
            -- (from STRING)

    remove (i: INTEGER)
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count - 1

    remove_current_item
            -- Remove current item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Clear out all characters.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

    string_wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature -- Resizing

    adapt_size
            -- Adapt the size to accommodate count characters.
            -- (from STRING)

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (newsize: INTEGER)
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (newsize: INTEGER)
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0

feature -- Conversion

    center_justify
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)

    character_justify (pivot: CHARACTER; position: INTEGER)
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty

    left_justify
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

    string_mirror
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: count = old count

    string_mirrored: like Current
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: Result.count = count

    right_justify
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)

    split (a_separator: CHARACTER): LINEAR [STRING]
            -- Split on a_separator.
            -- Ignore separators in quotes.
            -- (from STRING)
        ensure -- from STRING
            Result /= void

    to_boolean: BOOLEAN
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

    to_double: DOUBLE
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double

    to_integer: INTEGER
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer

    to_lower
            -- Convert to lower case.
            -- (from STRING)

    to_real: REAL
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real

    to_upper
            -- Convert to upper case.
            -- (from STRING)

feature -- Duplication

    mirror
            -- Reverse the characters order.
            -- "Hello world" -> "dlrow olleH".
            -- The current position will be on the same item
            -- as before.
        ensure
            same_count: count = old count
            mirrored_index: index = count - old index + 1

    mirrored: like Current
            -- Current string read from right to left.
            -- The result string has the same capacity and the
            -- same current position (i.e. the cursor is pointing
            -- at the same item)
        ensure
            mirrored_index: Result.index = count - index + 1
            same_count: Result.count = count

    multiply (n: INTEGER)
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1

    substring (n1, n2: INTEGER): like Current
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    out: like Current
            -- Printable representation
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQ_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQ_STRING Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SEQ_STRING

Ancestors
    SEQUENCE [G]
    STRING

Clients
    SEQ_STRING

Suppliers
    BOOLEAN
    INTEGER
    SEQ_STRING
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQ_STRING Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    SEQ_STRING

create
    make

feature -- Access

    search_after (c: CHARACTER)
            -- Move cursor to first position
            -- (at or after current cursor position)
            -- where current_item and c are identical.

    search_before (c: CHARACTER)
            -- Move cursor to greatest position at or before cursor
            -- where current_item and c are identical;
            -- go before if unsuccessful.

    search_string_after (s: STRING; fuzzy: INTEGER)
            -- Move cursor to first position
            -- (at or after cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go after if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.

    search_string_before (s: STRING; fuzzy: INTEGER)
            -- Move cursor to first position
            -- (at or before cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go before if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.

    current_item: CHARACTER
            -- Current item

    index: INTEGER
            -- Index of current_item, if valid
            -- Valid values are between 1 and count (if count > 0).

    index_of_occurrence (c: CHARACTER; i: INTEGER): INTEGER
            -- Index of i-th occurrence of c.
            -- 0 if none.
        ensure then
            index_value: (Result = 0) or item (Result) = c

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?

feature -- Status report

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

feature -- Cursor movement

    start
            -- Move to first position.

    finish
            -- Move to last position.

    back
            -- Move to previous position.

    forth
            -- Move to next position.

feature -- Element change

    replace (c: CHARACTER)
            -- Replace current item by c.

    share (other: like Current)
            -- Make string share the text of other.
        require
            argument_not_void: other /= void
        ensure
            shared_index: other.index = index

    precede (c: CHARACTER)
            -- Add c at front.
        ensure
            new_index: index = old index + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        ensure
            new_index: index = old index + s.count

feature -- Removal

    prune (c: CHARACTER)
            -- Remove first occurrence of c.

    remove_current_item
            -- Remove current item.

    wipe_out
            -- Clear out all characters.

feature -- Duplication

    mirrored: like Current
            -- Current string read from right to left.
            -- The result string has the same capacity and the
            -- same current position (i.e. the cursor is pointing
            -- at the same item)
        ensure
            mirrored_index: Result.index = count - index + 1
            same_count: Result.count = count

    mirror
            -- Reverse the characters order.
            -- "Hello world" -> "dlrow olleH".
            -- The current position will be on the same item
            -- as before.
        ensure
            same_count: count = old count
            mirrored_index: index = count - old index + 1

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQ_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SPECIAL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Special objects: homogeneous sequences of values,
        used to represent arrays and strings
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    SPECIAL [T]

create
    frozen make

feature -- Initialization

    make (n: INTEGER) is
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        do
        ensure
            area_allocated: count = n
        end

feature -- Access

    item (i: INTEGER): T is
            -- Item at i-th position
            -- (indices begin at 0)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count
        do
        end

feature -- Measurement

    count: INTEGER is
            -- Count of the special area
        do
            Result := sp_count ($Current)
        end

feature -- Status report

    all_default (upper: INTEGER): BOOLEAN is
            -- Are all items between index 0 and upper
            -- set to default values?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
        local
            i: INTEGER
            t: T
        do
            from
                Result := True
                i := 0
            until
                i > upper or else not Result
            loop
                Result := item (i) = t
                i := i + 1
            end
        ensure
            valid_on_empty_area: upper = - 1 implies Result
        end

    same_items (other: like Current; upper: INTEGER): BOOLEAN is
            -- Do all items between index 0 and upper have
            -- same value?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
            other_not_void: other /= void
            other_has_enough_items: upper < other.count
        local
            i: INTEGER
        do
            from
                Result := True
                i := 0
            until
                i > upper or else not Result
            loop
                Result := item (i) = other.item (i)
                i := i + 1
            end
        ensure
            valid_on_empty_area: upper = - 1 implies Result
        end

feature -- Element change

    put (v: T; i: INTEGER) is
            -- Replace i-th item by v.
            -- (Indices begin at 0.)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count
        do
        end

feature -- Removal

    clear_all is
            -- Reset all items to default values.
        do
            spclearall ($Current)
        end

feature {NONE} -- Implementation

    sp_count (sp_obj: POINTER): INTEGER is
            -- Count of the special object
        external
            "C | %"eif_plug.h%""
        end

    spclearall (p: POINTER) is
            -- Reset all items to default value.
        external
            "C | %"eif_copy.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SPECIAL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SPECIAL [T]

General
    cluster: base.kernel
    description:
        "Special objects: homogeneous sequences of values,
        used to represent arrays and strings"
    create: make

Ancestors
    ANY

Queries
    all_default (upper: INTEGER): BOOLEAN
    count: INTEGER
    item (i: INTEGER): T
    same_items (other: [like Current] SPECIAL [T]; upper: INTEGER): BOOLEAN

Commands
    clear_all
    make (n: INTEGER)
    put (v: T; i: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SPECIAL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Special objects: homogeneous sequences of values,
        used to represent arrays and strings
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    SPECIAL [T]

create
    frozen make

feature -- Initialization

    make (n: INTEGER) is
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        do
        ensure
            area_allocated: count = n
        end

feature -- Access

    item (i: INTEGER): T is
            -- Item at i-th position
            -- (indices begin at 0)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count
        do
        end

feature -- Measurement

    count: INTEGER is
            -- Count of the special area
        do
            Result := sp_count ($Current)
        end

feature -- Status report

    all_default (upper: INTEGER): BOOLEAN is
            -- Are all items between index 0 and upper
            -- set to default values?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
        local
            i: INTEGER
            t: T
        do
            from
                Result := True
                i := 0
            until
                i > upper or else not Result
            loop
                Result := item (i) = t
                i := i + 1
            end
        ensure
            valid_on_empty_area: upper = - 1 implies Result
        end

    same_items (other: like Current; upper: INTEGER): BOOLEAN is
            -- Do all items between index 0 and upper have
            -- same value?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
            other_not_void: other /= void
            other_has_enough_items: upper < other.count
        local
            i: INTEGER
        do
            from
                Result := True
                i := 0
            until
                i > upper or else not Result
            loop
                Result := item (i) = other.item (i)
                i := i + 1
            end
        ensure
            valid_on_empty_area: upper = - 1 implies Result
        end

feature -- Element change

    put (v: T; i: INTEGER) is
            -- Replace i-th item by v.
            -- (Indices begin at 0.)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count
        do
        end

feature -- Removal

    clear_all is
            -- Reset all items to default values.
        do
            spclearall ($Current)
        end

feature {NONE} -- Implementation

    sp_count (sp_obj: POINTER): INTEGER is
            -- Count of the special object
        external
            "C | %"eif_plug.h%""
        end

    spclearall (p: POINTER) is
            -- Reset all items to default value.
        external
            "C | %"eif_copy.h%""
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SPECIAL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Special objects: homogeneous sequences of values,
        used to represent arrays and strings
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    SPECIAL [T]

create

    make (n: INTEGER)
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        ensure
            area_allocated: count = n

feature -- Initialization

    make (n: INTEGER)
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        ensure
            area_allocated: count = n

feature -- Access

    item (i: INTEGER): T
            -- Item at i-th position
            -- (indices begin at 0)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count

feature -- Measurement

    count: INTEGER
            -- Count of the special area

feature -- Status report

    all_default (upper: INTEGER): BOOLEAN
            -- Are all items between index 0 and upper
            -- set to default values?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
        ensure
            valid_on_empty_area: upper = - 1 implies Result

    same_items (other: like Current; upper: INTEGER): BOOLEAN
            -- Do all items between index 0 and upper have
            -- same value?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
            other_not_void: other /= void
            other_has_enough_items: upper < other.count
        ensure
            valid_on_empty_area: upper = - 1 implies Result

feature -- Element change

    put (v: T; i: INTEGER)
            -- Replace i-th item by v.
            -- (Indices begin at 0.)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count

feature -- Removal

    clear_all
            -- Reset all items to default values.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SPECIAL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SPECIAL [T]

Ancestors
    ANY

Clients
    ARRAY [G]
    ARRAYED_LIST [G]
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BOOL_STRING
    FIXED_LIST [G]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    SPECIAL [T]
    STRING
    TO_SPECIAL [T]

Suppliers
    BOOLEAN
    INTEGER
    SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SPECIAL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Special objects: homogeneous sequences of values,
        used to represent arrays and strings
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    SPECIAL [T]

create
    frozen make

feature -- Initialization

    make (n: INTEGER)
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        ensure
            area_allocated: count = n

feature -- Access

    item (i: INTEGER): T
            -- Item at i-th position
            -- (indices begin at 0)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count

feature -- Measurement

    count: INTEGER
            -- Count of the special area

feature -- Status report

    all_default (upper: INTEGER): BOOLEAN
            -- Are all items between index 0 and upper
            -- set to default values?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
        ensure
            valid_on_empty_area: upper = - 1 implies Result

    same_items (other: like Current; upper: INTEGER): BOOLEAN
            -- Do all items between index 0 and upper have
            -- same value?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
            other_not_void: other /= void
            other_has_enough_items: upper < other.count
        ensure
            valid_on_empty_area: upper = - 1 implies Result

feature -- Element change

    put (v: T; i: INTEGER)
            -- Replace i-th item by v.
            -- (Indices begin at 0.)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count

feature -- Removal

    clear_all
            -- Reset all items to default values.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STD_FILES Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used input and output mechanisms.
        This class may be used as either ancestor or supplier
        by classes needing its facilities."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STD_FILES

feature -- Access

    input: PLAIN_TEXT_FILE is
            -- Standard input file
        once
            create {CONSOLE} Result.make_open_stdin ("stdin")
        end

    output: PLAIN_TEXT_FILE is
            -- Standard output file
        once
            create {CONSOLE} Result.make_open_stdout ("stdout")
        end

    error: PLAIN_TEXT_FILE is
            -- Standard error file
        once
            create {CONSOLE} Result.make_open_stderr ("stderr")
        end

    default_output: PLAIN_TEXT_FILE
            -- Default output

    standard_default: PLAIN_TEXT_FILE is
            -- Return the default_output or output
            -- if default_output is Void.
        do
            if default_output = void then
                Result := output
            else
                Result := default_output
            end
        end

feature -- Status report

    last_character: CHARACTER is
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of lastchar.
        do
            Result := input.last_character
        end

    lastchar: CHARACTER is
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of last_character.
        do
            Result := input.last_character
        end

    last_integer: INTEGER is
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of lastint.
        do
            Result := input.last_integer
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of last_integer.
        do
            Result := input.last_integer
        end

    last_real: REAL is
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of lastreal.
        do
            Result := input.last_real
        end

    lastreal: REAL is
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of last_real.
        do
            Result := input.last_real
        end

    last_string: STRING is
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of laststring.
        do
            Result := input.last_string
        end

    laststring: STRING is
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of last_string.
        do
            Result := input.last_string
        end

    last_double: DOUBLE is
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of lastdouble.
        do
            Result := input.last_double
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of last_double.
        do
            Result := input.last_double
        end

feature -- Element change

    set_error_default is
            -- Use standard error as default output.
        do
            default_output := error
        end

    set_file_default (f: PLAIN_TEXT_FILE) is
            -- Use f as default output.
        require
            valid_argument: f /= void
            file_open_write: f.is_open_write
        do
            default_output := f
        end

    set_output_default is
            -- Use standard output as default output.
        do
            default_output := output
        end

    put_character (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of putchar.
        do
            standard_default.put_character (c)
        end

    putchar (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of put_character.
        do
            standard_default.put_character (c)
        end

    put_string (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of putstring.
        require
            string_not_void: s /= void
        do
            standard_default.put_string (s)
        end

    putstring (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of put_string.
        require
            string_not_void: s /= void
        do
            standard_default.put_string (s)
        end

    put_real (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of putreal.
        do
            standard_default.put_real (r)
        end

    putreal (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of put_real.
        do
            standard_default.put_real (r)
        end

    put_double (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of putdouble.
        do
            standard_default.put_double (d)
        end

    putdouble (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of put_double.
        do
            standard_default.put_double (d)
        end

    put_integer (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of putint.
        do
            standard_default.put_integer (i)
        end

    putint (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of put_integer.
        do
            standard_default.put_integer (i)
        end

    put_boolean (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of putbool.
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    putbool (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of put_boolean.
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    put_new_line is
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of new_line.
        do
            standard_default.new_line
        end

    new_line is
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of put_new_line.
        do
            standard_default.new_line
        end

feature -- Input

    read_integer is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of readint.
        do
            input.read_integer
        end

    readint is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of read_integer.
        do
            input.read_integer
        end

    read_real is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of readreal.
        do
            input.read_real
        end

    readreal is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of read_real.
        do
            input.read_real
        end

    read_double is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of readdouble.
        do
            input.read_double
        end

    readdouble is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of read_double.
        do
            input.read_double
        end

    read_line is
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readline.
        do
            input.read_line
        end

    readline is
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_line.
        do
            input.read_line
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readstream.
        do
            input.read_stream (nb_char)
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_stream.
        do
            input.read_stream (nb_char)
        end

    read_word is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readword.
        do
            input.read_word
        end

    readword is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_word.
        do
            input.read_word
        end

    read_character is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of readchar.
        do
            input.read_character
        end

    readchar is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of read_character.
        do
            input.read_character
        end

    to_next_line is
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of next_line.
        do
            input.next_line
        end

    next_line is
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of to_next_line.
        do
            input.next_line
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STD_FILES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STD_FILES Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STD_FILES

General
    cluster: base.kernel
    description:
        "Commonly used input and output mechanisms.
        This class may be used as either ancestor or supplier
        by classes needing its facilities.%""

Ancestors
    ANY

Queries
    default_output: PLAIN_TEXT_FILE
    Error: PLAIN_TEXT_FILE
    Input: PLAIN_TEXT_FILE
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    Output: PLAIN_TEXT_FILE
    standard_default: PLAIN_TEXT_FILE

Commands
    new_line
    next_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    set_error_default
    set_file_default (f: PLAIN_TEXT_FILE)
    set_output_default
    to_next_line

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STD_FILES Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used input and output mechanisms.
        This class may be used as either ancestor or supplier
        by classes needing its facilities."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STD_FILES

feature -- Access

    default_output: PLAIN_TEXT_FILE
            -- Default output

    error: PLAIN_TEXT_FILE is
            -- Standard error file
        once
            create {CONSOLE} Result.make_open_stderr ("stderr")
        end

    input: PLAIN_TEXT_FILE is
            -- Standard input file
        once
            create {CONSOLE} Result.make_open_stdin ("stdin")
        end

    output: PLAIN_TEXT_FILE is
            -- Standard output file
        once
            create {CONSOLE} Result.make_open_stdout ("stdout")
        end

    standard_default: PLAIN_TEXT_FILE is
            -- Return the default_output or output
            -- if default_output is Void.
        do
            if default_output = void then
                Result := output
            else
                Result := default_output
            end
        end

feature -- Status report

    last_character: CHARACTER is
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of lastchar.
        do
            Result := input.last_character
        end

    last_double: DOUBLE is
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of lastdouble.
        do
            Result := input.last_double
        end

    last_integer: INTEGER is
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of lastint.
        do
            Result := input.last_integer
        end

    last_real: REAL is
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of lastreal.
        do
            Result := input.last_real
        end

    last_string: STRING is
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of laststring.
        do
            Result := input.last_string
        end

    lastchar: CHARACTER is
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of last_character.
        do
            Result := input.last_character
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of last_double.
        do
            Result := input.last_double
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of last_integer.
        do
            Result := input.last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of last_real.
        do
            Result := input.last_real
        end

    laststring: STRING is
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of last_string.
        do
            Result := input.last_string
        end

feature -- Element change

    new_line is
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of put_new_line.
        do
            standard_default.new_line
        end

    put_boolean (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of putbool.
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    put_character (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of putchar.
        do
            standard_default.put_character (c)
        end

    put_double (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of putdouble.
        do
            standard_default.put_double (d)
        end

    put_integer (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of putint.
        do
            standard_default.put_integer (i)
        end

    put_new_line is
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of new_line.
        do
            standard_default.new_line
        end

    put_real (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of putreal.
        do
            standard_default.put_real (r)
        end

    put_string (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of putstring.
        require
            string_not_void: s /= void
        do
            standard_default.put_string (s)
        end

    putbool (b: BOOLEAN) is
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of put_boolean.
        do
            if b then
                put_string ("True")
            else
                put_string ("False")
            end
        end

    putchar (c: CHARACTER) is
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of put_character.
        do
            standard_default.put_character (c)
        end

    putdouble (d: DOUBLE) is
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of put_double.
        do
            standard_default.put_double (d)
        end

    putint (i: INTEGER) is
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of put_integer.
        do
            standard_default.put_integer (i)
        end

    putreal (r: REAL) is
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of put_real.
        do
            standard_default.put_real (r)
        end

    putstring (s: STRING) is
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of put_string.
        require
            string_not_void: s /= void
        do
            standard_default.put_string (s)
        end

    set_error_default is
            -- Use standard error as default output.
        do
            default_output := error
        end

    set_file_default (f: PLAIN_TEXT_FILE) is
            -- Use f as default output.
        require
            valid_argument: f /= void
            file_open_write: f.is_open_write
        do
            default_output := f
        end

    set_output_default is
            -- Use standard output as default output.
        do
            default_output := output
        end

feature -- Input

    next_line is
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of to_next_line.
        do
            input.next_line
        end

    read_character is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of readchar.
        do
            input.read_character
        end

    read_double is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of readdouble.
        do
            input.read_double
        end

    read_integer is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of readint.
        do
            input.read_integer
        end

    read_line is
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readline.
        do
            input.read_line
        end

    read_real is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of readreal.
        do
            input.read_real
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readstream.
        do
            input.read_stream (nb_char)
        end

    read_word is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readword.
        do
            input.read_word
        end

    readchar is
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of read_character.
        do
            input.read_character
        end

    readdouble is
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of read_double.
        do
            input.read_double
        end

    readint is
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of read_integer.
        do
            input.read_integer
        end

    readline is
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_line.
        do
            input.read_line
        end

    readreal is
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of read_real.
        do
            input.read_real
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_stream.
        do
            input.read_stream (nb_char)
        end

    readword is
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_word.
        do
            input.read_word
        end

    to_next_line is
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of next_line.
        do
            input.next_line
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STD_FILES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STD_FILES Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used input and output mechanisms.
        This class may be used as either ancestor or supplier
        by classes needing its facilities."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STD_FILES

feature -- Access

    default_output: PLAIN_TEXT_FILE
            -- Default output

    error: PLAIN_TEXT_FILE
            -- Standard error file

    input: PLAIN_TEXT_FILE
            -- Standard input file

    output: PLAIN_TEXT_FILE
            -- Standard output file

    standard_default: PLAIN_TEXT_FILE
            -- Return the default_output or output
            -- if default_output is Void.

feature -- Status report

    last_character: CHARACTER
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of lastchar.

    last_double: DOUBLE
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of lastdouble.

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of lastint.

    last_real: REAL
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of lastreal.

    last_string: STRING
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of laststring.

    lastchar: CHARACTER
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of last_character.

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of last_double.

    lastint: INTEGER
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of last_integer.

    lastreal: REAL
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of last_real.

    laststring: STRING
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of last_string.

feature -- Element change

    new_line
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of put_new_line.

    put_boolean (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of putbool.

    put_character (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of putchar.

    put_double (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of putdouble.

    put_integer (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of putint.

    put_new_line
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of new_line.

    put_real (r: REAL)
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of putreal.

    put_string (s: STRING)
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of putstring.
        require
            string_not_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of put_boolean.

    putchar (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of put_character.

    putdouble (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of put_double.

    putint (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of put_integer.

    putreal (r: REAL)
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of put_real.

    putstring (s: STRING)
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of put_string.
        require
            string_not_void: s /= void

    set_error_default
            -- Use standard error as default output.

    set_file_default (f: PLAIN_TEXT_FILE)
            -- Use f as default output.
        require
            valid_argument: f /= void
            file_open_write: f.is_open_write

    set_output_default
            -- Use standard output as default output.

feature -- Input

    next_line
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of to_next_line.

    read_character
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of readchar.

    read_double
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of readdouble.

    read_integer
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of readint.

    read_line
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readline.

    read_real
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of readreal.

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readstream.

    read_word
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readword.

    readchar
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of read_character.

    readdouble
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of read_double.

    readint
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of read_integer.

    readline
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_line.

    readreal
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of read_real.

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_stream.

    readword
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_word.

    to_next_line
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of next_line.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STD_FILES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STD_FILES Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STD_FILES

Ancestors
    ANY

Clients
    ANY
    HEIR
    PARENT
    STD_FILES
    TESTROOT

Suppliers
    CONSOLE
    PLAIN_TEXT_FILE
    STD_FILES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STD_FILES Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Commonly used input and output mechanisms.
        This class may be used as either ancestor or supplier
        by classes needing its facilities."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STD_FILES

feature -- Access

    input: PLAIN_TEXT_FILE
            -- Standard input file

    output: PLAIN_TEXT_FILE
            -- Standard output file

    error: PLAIN_TEXT_FILE
            -- Standard error file

    default_output: PLAIN_TEXT_FILE
            -- Default output

    standard_default: PLAIN_TEXT_FILE
            -- Return the default_output or output
            -- if default_output is Void.

feature -- Status report

    last_character: CHARACTER
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of lastchar.

    lastchar: CHARACTER
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of last_character.

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of lastint.

    lastint: INTEGER
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of last_integer.

    last_real: REAL
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of lastreal.

    lastreal: REAL
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of last_real.

    last_string: STRING
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of laststring.

    laststring: STRING
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of last_string.

    last_double: DOUBLE
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of lastdouble.

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of last_double.

feature -- Element change

    set_error_default
            -- Use standard error as default output.

    set_file_default (f: PLAIN_TEXT_FILE)
            -- Use f as default output.
        require
            valid_argument: f /= void
            file_open_write: f.is_open_write

    set_output_default
            -- Use standard output as default output.

    put_character (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of putchar.

    putchar (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of put_character.

    put_string (s: STRING)
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of putstring.
        require
            string_not_void: s /= void

    putstring (s: STRING)
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of put_string.
        require
            string_not_void: s /= void

    put_real (r: REAL)
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of putreal.

    putreal (r: REAL)
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of put_real.

    put_double (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of putdouble.

    putdouble (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of put_double.

    put_integer (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of putint.

    putint (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of put_integer.

    put_boolean (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of putbool.

    putbool (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of put_boolean.

    put_new_line
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of new_line.

    new_line
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of put_new_line.

feature -- Input

    read_integer
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of readint.

    readint
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of read_integer.

    read_real
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of readreal.

    readreal
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of read_real.

    read_double
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of readdouble.

    readdouble
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of read_double.

    read_line
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readline.

    readline
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_line.

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readstream.

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_stream.

    read_word
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readword.

    readword
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_word.

    read_character
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of readchar.

    readchar
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of read_character.

    to_next_line
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of next_line.

    next_line
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of to_next_line.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STD_FILES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STORABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that may be stored and retrieved along with all their dependents.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STORABLE

inherit
    EXCEPTIONS

feature -- Access

    retrieved (medium: IO_MEDIUM): ANY is
            -- Retrieved object structure, from external
            -- representation previously stored in medium.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if medium content is not a stored Eiffel structure.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_read: medium.is_open_read
            medium_supports_storable: medium.support_storable
        do
            Result := medium.retrieved
        ensure
            result_exists: Result /= void
        end

    retrieve_by_name (file_name: STRING): ANY is
            -- Retrieve object structure, from external
            -- representation previously stored in a file
            -- called file_name.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if file content is not a stored Eiffel structure.
            -- Will return Void if the file does not exist or
            -- is not readable.
        require
            file_name_exists: file_name /= void
            file_name_meaningful: not file_name.is_empty
        local
            file: RAW_FILE
        do
            create file.make (file_name)
            if file.exists and then file.is_readable then
                file.open_read
                Result := file.retrieved
                file.close
            end
        end

feature -- Setting

    set_discard_pointers (v: BOOLEAN) is
            -- If v it will discard POINTER values and replace them by
            -- the default_pointer pointer. Otherwise it keeps the original value.
        external
            "C macro signature (EIF_BOOLEAN) use %"eif_retrieve.h%""
        alias
            "eif_set_discard_pointer_values"
        end

    set_new_independent_format (v: BOOLEAN) is
            -- If v it will use ISE Eiffel 5.0 storable format for
            -- storing.
        external
            "C macro signature (EIF_BOOLEAN) use %"eif_store.h%""
        alias
            "eif_set_new_independent_format"
        end

feature -- Element change

    basic_store (medium: IO_MEDIUM) is
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable within current system only.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable
        do
            medium.basic_store (Current)
        end

    general_store (medium: IO_MEDIUM) is
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable
        do
            medium.general_store (Current)
        end

    independent_store (medium: IO_MEDIUM) is
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable
        do
            medium.independent_store (Current)
        end

    store_by_name (file_name: STRING) is
            -- Produce on file called file_name an external
            -- representation of the entire object structure
            -- reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            file_name_not_void: file_name /= void
            file_name_meaningful: not file_name.is_empty
        local
            file: RAW_FILE
            a: ANY
        do
            create file.make (file_name)
            if (file.exists and then file.is_writable) or else (file.is_creatable) then
                file.open_write
                file.independent_store (Current)
                file.close
            else
                a := ("write permission failure").to_c
                eraise ($a, io_exception)
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STORABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STORABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STORABLE

General
    cluster: base.kernel
    description:
        "Objects that may be stored and retrieved along with all their dependents.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    EXCEPTIONS

Queries
    assertion_violation: BOOLEAN
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    Postcondition: INTEGER
    Precondition: INTEGER
    recipient_name: STRING
    Rescue_exception: INTEGER
    retrieve_by_name (file_name: STRING): ANY
    Retrieve_exception: INTEGER
    retrieved (medium: IO_MEDIUM): ANY
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    tag_name: STRING
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Commands
    basic_store (medium: IO_MEDIUM)
    catch (code: INTEGER)
    die (code: INTEGER)
    general_store (medium: IO_MEDIUM)
    ignore (code: INTEGER)
    independent_store (medium: IO_MEDIUM)
    message_on_failure
    no_message_on_failure
    raise (name: STRING)
    set_discard_pointers (v: BOOLEAN)
    set_new_independent_format (v: BOOLEAN)
    store_by_name (file_name: STRING)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STORABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that may be stored and retrieved along with all their dependents.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STORABLE

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    retrieve_by_name (file_name: STRING): ANY is
            -- Retrieve object structure, from external
            -- representation previously stored in a file
            -- called file_name.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if file content is not a stored Eiffel structure.
            -- Will return Void if the file does not exist or
            -- is not readable.
        require
            file_name_exists: file_name /= void
            file_name_meaningful: not file_name.is_empty
        local
            file: RAW_FILE
        do
            create file.make (file_name)
            if file.exists and then file.is_readable then
                file.open_read
                Result := file.retrieved
                file.close
            end
        end

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    retrieved (medium: IO_MEDIUM): ANY is
            -- Retrieved object structure, from external
            -- representation previously stored in medium.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if medium content is not a stored Eiffel structure.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_read: medium.is_open_read
            medium_supports_storable: medium.support_storable
        do
            Result := medium.retrieved
        ensure
            result_exists: Result /= void
        end

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN is
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)
        do
            Result := (original_exception = check_instruction) or else (original_exception = class_invariant) or else (original_exception = loop_invariant) or else (original_exception = loop_variant) or else (original_exception = postcondition) or else (original_exception = precondition)
        end

    class_name: STRING is
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eelclass"
        end

    developer_exception_name: STRING is
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception
        do
            Result := original_tag_name
        end

    exception: INTEGER is
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eelcode"
        end

    exception_trace: STRING is
            -- String representation of the exception trace
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "stack_trace_string"
        end

    is_developer_exception: BOOLEAN is
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)
        do
            Result := (original_exception = developer_exception)
        end

    is_developer_exception_of_name (name: STRING): BOOLEAN is
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)
        do
            Result := is_developer_exception and then equal (name, developer_exception_name)
        end

    is_signal: BOOLEAN is
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)
        do
            Result := (original_exception = signal_exception)
        end

    is_system_exception: BOOLEAN is
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)
        do
            Result := (original_exception = external_exception) or else (original_exception = operating_system_exception)
        end

    meaning (except: INTEGER): STRING is
            -- A message in English describing what except is
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eename"
        end

    original_class_name: STRING is
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eeoclass"
        end

    original_exception: INTEGER is
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eeocode"
        end

    original_recipient_name: STRING is
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eeorout"
        end

    original_tag_name: STRING is
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eeotag"
        end

    recipient_name: STRING is
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eelrout"
        end

    tag_name: STRING is
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eeltag"
        end

feature -- Status setting

    catch (code: INTEGER) is
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eecatch"
        end

    die (code: INTEGER) is
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "esdie"
        end

    ignore (code: INTEGER) is
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eeignore"
        end

    message_on_failure is
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)
        do
            c_trace_exception (True)
        end

    new_die (code: INTEGER) is
        obsolete "Use ``die''"
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "esdie"
        end

    no_message_on_failure is
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)
        do
            c_trace_exception (False)
        end

    raise (name: STRING) is
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)
        local
            str: ANY
        do
            if name /= void then
                str := name.to_c
            end
            exclear
            eraise ($str, developer_exception)
        end

feature -- Element change

    basic_store (medium: IO_MEDIUM) is
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable within current system only.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable
        do
            medium.basic_store (Current)
        end

    general_store (medium: IO_MEDIUM) is
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable
        do
            medium.general_store (Current)
        end

    independent_store (medium: IO_MEDIUM) is
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable
        do
            medium.independent_store (Current)
        end

    store_by_name (file_name: STRING) is
            -- Produce on file called file_name an external
            -- representation of the entire object structure
            -- reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            file_name_not_void: file_name /= void
            file_name_meaningful: not file_name.is_empty
        local
            file: RAW_FILE
            a: ANY
        do
            create file.make (file_name)
            if (file.exists and then file.is_writable) or else (file.is_creatable) then
                file.open_write
                file.independent_store (Current)
                file.close
            else
                a := ("write permission failure").to_c
                eraise ($a, io_exception)
            end
        end

feature {NONE} -- Implementation

    c_trace_exception (b: BOOLEAN) is
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        alias
            "eetrace"
        end

    eraise (str: POINTER; code: INTEGER) is
            -- Raise an exception
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        end

    exclear is
            -- (from EXCEPTIONS)
        external
            "C | %"eif_except.h%""
        end

feature -- Setting

    set_discard_pointers (v: BOOLEAN) is
            -- If v it will discard POINTER values and replace them by
            -- the default_pointer pointer. Otherwise it keeps the original value.
        external
            "C macro signature (EIF_BOOLEAN) use %"eif_retrieve.h%""
        alias
            "eif_set_discard_pointer_values"
        end

    set_new_independent_format (v: BOOLEAN) is
            -- If v it will use ISE Eiffel 5.0 storable format for
            -- storing.
        external
            "C macro signature (EIF_BOOLEAN) use %"eif_store.h%""
        alias
            "eif_set_new_independent_format"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STORABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STORABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that may be stored and retrieved along with all their dependents.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STORABLE

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    retrieve_by_name (file_name: STRING): ANY
            -- Retrieve object structure, from external
            -- representation previously stored in a file
            -- called file_name.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if file content is not a stored Eiffel structure.
            -- Will return Void if the file does not exist or
            -- is not readable.
        require
            file_name_exists: file_name /= void
            file_name_meaningful: not file_name.is_empty

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    retrieved (medium: IO_MEDIUM): ANY
            -- Retrieved object structure, from external
            -- representation previously stored in medium.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if medium content is not a stored Eiffel structure.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_read: medium.is_open_read
            medium_supports_storable: medium.support_storable
        ensure
            result_exists: Result /= void

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

feature -- Element change

    basic_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable within current system only.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    general_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    independent_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    store_by_name (file_name: STRING)
            -- Produce on file called file_name an external
            -- representation of the entire object structure
            -- reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            file_name_not_void: file_name /= void
            file_name_meaningful: not file_name.is_empty

feature -- Setting

    set_discard_pointers (v: BOOLEAN)
            -- If v it will discard POINTER values and replace them by
            -- the default_pointer pointer. Otherwise it keeps the original value.

    set_new_independent_format (v: BOOLEAN)
            -- If v it will use ISE Eiffel 5.0 storable format for
            -- storing.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STORABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STORABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STORABLE

Ancestors
    EXCEPTIONS

Clients
    STORABLE

Suppliers
    BOOLEAN
    IO_MEDIUM
    RAW_FILE
    STORABLE
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STORABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that may be stored and retrieved along with all their dependents.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STORABLE

feature -- Access

    retrieved (medium: IO_MEDIUM): ANY
            -- Retrieved object structure, from external
            -- representation previously stored in medium.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if medium content is not a stored Eiffel structure.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_read: medium.is_open_read
            medium_supports_storable: medium.support_storable
        ensure
            result_exists: Result /= void

    retrieve_by_name (file_name: STRING): ANY
            -- Retrieve object structure, from external
            -- representation previously stored in a file
            -- called file_name.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if file content is not a stored Eiffel structure.
            -- Will return Void if the file does not exist or
            -- is not readable.
        require
            file_name_exists: file_name /= void
            file_name_meaningful: not file_name.is_empty

feature -- Setting

    set_discard_pointers (v: BOOLEAN)
            -- If v it will discard POINTER values and replace them by
            -- the default_pointer pointer. Otherwise it keeps the original value.

    set_new_independent_format (v: BOOLEAN)
            -- If v it will use ISE Eiffel 5.0 storable format for
            -- storing.

feature -- Element change

    basic_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable within current system only.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    general_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    independent_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    store_by_name (file_name: STRING)
            -- Produce on file called file_name an external
            -- representation of the entire object structure
            -- reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            file_name_not_void: file_name /= void
            file_name_meaningful: not file_name.is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STORABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STREAM Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of the STORABLE mechanism with streams."
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STREAM

inherit
    IO_MEDIUM

create
    make,
    make_with_size

feature -- Initialization

    make is
            -- Create stream object with a default_size of 100 bytes
        do
            buffer_size := 200
            create_c_buffer
        end

    make_with_size (n: INTEGER) is
            -- Create stream object with a default_size of n bytes
        do
            buffer_size := n
            create_c_buffer
        end

feature -- Status report

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?

feature -- Access

    buffer: POINTER
            -- C buffer correspond to the Eiffel STREAM.

    buffer_size: INTEGER
            -- Buffer's size.

    object_stored_size: INTEGER
            -- Size of last stored object.

    create_c_buffer is
            -- Create the C memory corresponding to the C
            -- buffer.
        do
            buffer := c_malloc (buffer_size)
        end

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        local
            size: INTEGER
        do
            Result := c_retrieved (buffer, buffer_size, 0, $size)
            object_stored_size := size
        end

feature -- Element change

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        local
            size: INTEGER
        do
            buffer_size := c_stream_basic_store (buffer, buffer_size, $object, $size)
            object_stored_size := size
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        local
            size: INTEGER
        do
            buffer_size := c_stream_general_store (buffer, buffer_size, $object, $size)
            object_stored_size := size
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        local
            size: INTEGER
        do
            buffer_size := c_stream_independent_store (buffer, buffer_size, $object, $size)
            object_stored_size := size
        end

    set_additional_size (new_size: INTEGER) is
            -- Set new_size to BUFFER_SIZE, internal value used to
            -- increment buffer_size during storable operations.
        external
            "C | %"eif_store.h%""
        alias
            "set_buffer_size"
        end

feature {NONE} -- Implementation

    c_stream_basic_store (stream_buffer: POINTER; stream_buffer_size: INTEGER; object: POINTER; c_real_size: POINTER): INTEGER is
            -- Store object structure reachable form current object
            -- Return new size of buffer.
        external
            "C | %"eif_store.h%""
        alias
            "stream_estore"
        end

    c_stream_general_store (stream_buffer: POINTER; stream_buffer_size: INTEGER; object: POINTER; c_real_size: POINTER): INTEGER is
            -- Store object structure reachable form current object
            -- Return new size of buffer.
        external
            "C | %"eif_store.h%""
        alias
            "stream_eestore"
        end

    c_stream_independent_store (stream_buffer: POINTER; stream_buffer_size: INTEGER; object: POINTER; c_real_size: POINTER): INTEGER is
            -- Store object structure reachable form current object
            -- Return new size of buffer.
        external
            "C |%"eif_store.h%""
        alias
            "stream_sstore"
        end

    c_retrieved (stream_buffer: POINTER; stream_buffer_size: INTEGER; stream_buffer_position: INTEGER; c_real_size: POINTER): ANY is
            -- Object structured retrieved from stream of pointer
            -- stream_ptr
        external
            "C | %"eif_retrieve.h%""
        alias
            "stream_eretrieve"
        end

    c_malloc (size: INTEGER): POINTER is
        external
            "C | %"eif_store.h%""
        alias
            "stream_malloc"
        end

    c_free (buf: POINTER) is
        external
            "C | %"eif_store.h%""
        alias
            "stream_free"
        end

feature -- Status report

    Exists: BOOLEAN is True
            -- Stream exists in any cases.

    Is_open_read: BOOLEAN is True
            -- Stream opens for input.

    Is_open_write: BOOLEAN is True
            -- Stream opens for output.

    Is_readable: BOOLEAN is True

    is_executable: BOOLEAN is
            -- Is stream executable?
        do
            Result := False
        end

    Is_writable: BOOLEAN is True
            -- Stream is writable.

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
        end

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := True
        end

    is_closed: BOOLEAN
            -- Is the I/O medium open

feature -- Status setting

    close is
            -- Close medium.
        do
            is_closed := True
            c_free (buffer)
            buffer := default_pointer
        end

feature -- Output

    put_new_line is
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of new_line.
        require else
            stream_exists: exists
        do
            put_character ('%N')
        end

    new_line is
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of put_new_line.
        require else
            stream_exists: exists
        do
            put_character ('%N')
        end

    put_string (s: STRING) is
            -- Write s to medium.
            -- Was declared in STREAM as synonym of putstring.
        do
        end

    putstring (s: STRING) is
            -- Write s to medium.
            -- Was declared in STREAM as synonym of put_string.
        do
        end

    put_character (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in STREAM as synonym of putchar.
        do
        end

    putchar (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in STREAM as synonym of put_character.
        do
        end

    put_real (r: REAL) is
            -- Write r to medium.
            -- Was declared in STREAM as synonym of putreal.
        do
        end

    putreal (r: REAL) is
            -- Write r to medium.
            -- Was declared in STREAM as synonym of put_real.
        do
        end

    put_integer (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in STREAM as synonym of putint.
        do
        end

    putint (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in STREAM as synonym of put_integer.
        do
        end

    put_boolean (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in STREAM as synonym of putbool.
        do
        end

    putbool (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in STREAM as synonym of put_boolean.
        do
        end

    put_double (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in STREAM as synonym of putdouble.
        do
        end

    putdouble (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in STREAM as synonym of put_double.
        do
        end

feature -- Input

    read_real is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of readreal.
        do
        end

    readreal is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of read_real.
        do
        end

    read_double is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of readdouble.
        do
        end

    readdouble is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of read_double.
        do
        end

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of readchar.
        do
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of read_character.
        do
        end

    read_integer is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of readint.
        do
        end

    readint is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of read_integer.
        do
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readstream.
        do
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_stream.
        do
        end

    read_line is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readline.
        do
        end

    readline is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_line.
        do
        end

feature {NONE} -- Not exported

    name: STRING is
            -- Not meaningful
        do
        end

    handle: INTEGER is
            -- Handle to medium
        do
        end

    handle_available: BOOLEAN is
            -- Is the handle available after class has been
            -- created?
        do
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STREAM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STREAM Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STREAM

General
    cluster: base.kernel
    description: "Implementation of the STORABLE mechanism with streams."
    create: make_with_size, make

Ancestors
    IO_MEDIUM

Queries
    buffer: POINTER
    buffer_size: INTEGER
    Exists: BOOLEAN
    extendible: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    Is_open_read: BOOLEAN
    Is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    Is_readable: BOOLEAN
    Is_writable: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    object_stored_size: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    Support_storable: BOOLEAN

Commands
    basic_store (object: ANY)
    close
    create_c_buffer
    dispose
    general_store (object: ANY)
    independent_store (object: ANY)
    make
    make_with_size (n: INTEGER)
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    set_additional_size (new_size: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STREAM Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of the STORABLE mechanism with streams."
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STREAM

create
    make,
    make_with_size

feature -- Initialization

    make is
            -- Create stream object with a default_size of 100 bytes
        do
            buffer_size := 200
            create_c_buffer
        end

    make_with_size (n: INTEGER) is
            -- Create stream object with a default_size of n bytes
        do
            buffer_size := n
            create_c_buffer
        end

feature -- Access

    buffer: POINTER
            -- C buffer correspond to the Eiffel STREAM.

    buffer_size: INTEGER
            -- Buffer's size.

    create_c_buffer is
            -- Create the C memory corresponding to the C
            -- buffer.
        do
            buffer := c_malloc (buffer_size)
        end

    object_stored_size: INTEGER
            -- Size of last stored object.

    retrieved: ANY is
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        local
            size: INTEGER
        do
            Result := c_retrieved (buffer, buffer_size, 0, $size)
            object_stored_size := size
        ensure -- from IO_MEDIUM
            result_exists: Result /= void
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Status report

    Exists: BOOLEAN is True
            -- Stream exists in any cases.

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := True
        end

    is_closed: BOOLEAN
            -- Is the I/O medium open

    is_executable: BOOLEAN is
            -- Is stream executable?
        require -- from IO_MEDIUM
            handle_exists: exists
        do
            Result := False
        end

    Is_open_read: BOOLEAN is True
            -- Stream opens for input.

    Is_open_write: BOOLEAN is True
            -- Stream opens for output.

    is_plain_text: BOOLEAN is
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)
        do
        end

    Is_readable: BOOLEAN is True

    Is_writable: BOOLEAN is True
            -- Stream is writable.

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        require -- from IO_MEDIUM
            handle_exists: exists
        do
        end

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature -- Status setting

    close is
            -- Close medium.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        do
            is_closed := True
            c_free (buffer)
            buffer := default_pointer
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Element change

    basic_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        local
            size: INTEGER
        do
            buffer_size := c_stream_basic_store (buffer, buffer_size, $object, $size)
            object_stored_size := size
        end

    general_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        local
            size: INTEGER
        do
            buffer_size := c_stream_general_store (buffer, buffer_size, $object, $size)
            object_stored_size := size
        end

    independent_store (object: ANY) is
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable
        local
            size: INTEGER
        do
            buffer_size := c_stream_independent_store (buffer, buffer_size, $object, $size)
            object_stored_size := size
        end

    set_additional_size (new_size: INTEGER) is
            -- Set new_size to BUFFER_SIZE, internal value used to
            -- increment buffer_size during storable operations.
        external
            "C | %"eif_store.h%""
        alias
            "set_buffer_size"
        end

feature -- Removal

    dispose is
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)
        do
            if not is_closed then
                close
            end
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Obsolete

    lastchar: CHARACTER is
            -- Last character read by read_character
            -- (from IO_MEDIUM)
        do
            Result := last_character
        end

    lastdouble: DOUBLE is
            -- Last double read by read_double
            -- (from IO_MEDIUM)
        do
            Result := last_double
        end

    lastint: INTEGER is
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)
        do
            Result := last_integer
        end

    lastreal: REAL is
            -- Last real read by read_real
            -- (from IO_MEDIUM)
        do
            Result := last_real
        end

    laststring: STRING is
            -- Last string read
            -- (from IO_MEDIUM)
        do
            Result := last_string
        end

feature {NONE} -- Implementation

    c_free (buf: POINTER) is
        external
            "C | %"eif_store.h%""
        alias
            "stream_free"
        end

    c_malloc (size: INTEGER): POINTER is
        external
            "C | %"eif_store.h%""
        alias
            "stream_malloc"
        end

    c_retrieved (stream_buffer: POINTER; stream_buffer_size: INTEGER; stream_buffer_position: INTEGER; c_real_size: POINTER): ANY is
            -- Object structured retrieved from stream of pointer
            -- stream_ptr
        external
            "C | %"eif_retrieve.h%""
        alias
            "stream_eretrieve"
        end

    c_stream_basic_store (stream_buffer: POINTER; stream_buffer_size: INTEGER; object: POINTER; c_real_size: POINTER): INTEGER is
            -- Store object structure reachable form current object
            -- Return new size of buffer.
        external
            "C | %"eif_store.h%""
        alias
            "stream_estore"
        end

    c_stream_general_store (stream_buffer: POINTER; stream_buffer_size: INTEGER; object: POINTER; c_real_size: POINTER): INTEGER is
            -- Store object structure reachable form current object
            -- Return new size of buffer.
        external
            "C | %"eif_store.h%""
        alias
            "stream_eestore"
        end

    c_stream_independent_store (stream_buffer: POINTER; stream_buffer_size: INTEGER; object: POINTER; c_real_size: POINTER): INTEGER is
            -- Store object structure reachable form current object
            -- Return new size of buffer.
        external
            "C |%"eif_store.h%""
        alias
            "stream_sstore"
        end

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

feature -- Input

    read_character is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    read_double is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    read_integer is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    read_line is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    read_real is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    read_stream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    readchar is
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    readdouble is
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    readint is
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    readline is
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    readreal is
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

    readstream (nb_char: INTEGER) is
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        do
        end

feature {NONE} -- Not exported

    handle: INTEGER is
            -- Handle to medium
        require -- from IO_MEDIUM
            valid_handle: handle_available
        do
        end

    handle_available: BOOLEAN is
            -- Is the handle available after class has been
            -- created?
        do
        end

    name: STRING is
            -- Not meaningful
        do
        end

feature -- Output

    new_line is
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            stream_exists: exists
        do
            put_character ('%N')
        end

    put_boolean (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in STREAM as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    put_character (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in STREAM as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    put_double (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in STREAM as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    put_integer (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in STREAM as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    put_new_line is
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            stream_exists: exists
        do
            put_character ('%N')
        end

    put_real (r: REAL) is
            -- Write r to medium.
            -- Was declared in STREAM as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    put_string (s: STRING) is
            -- Write s to medium.
            -- Was declared in STREAM as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        do
        end

    putbool (b: BOOLEAN) is
            -- Write b to medium.
            -- Was declared in STREAM as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    putchar (c: CHARACTER) is
            -- Write c to medium.
            -- Was declared in STREAM as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    putdouble (d: DOUBLE) is
            -- Write d to medium.
            -- Was declared in STREAM as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    putint (i: INTEGER) is
            -- Write i to medium.
            -- Was declared in STREAM as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    putreal (r: REAL) is
            -- Write r to medium.
            -- Was declared in STREAM as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible
        do
        end

    putstring (s: STRING) is
            -- Write s to medium.
            -- Was declared in STREAM as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        do
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STREAM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STREAM Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of the STORABLE mechanism with streams."
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STREAM

create

    make
            -- Create stream object with a default_size of 100 bytes

    make_with_size (n: INTEGER)
            -- Create stream object with a default_size of n bytes

feature -- Initialization

    make
            -- Create stream object with a default_size of 100 bytes

    make_with_size (n: INTEGER)
            -- Create stream object with a default_size of n bytes

feature -- Access

    buffer: POINTER
            -- C buffer correspond to the Eiffel STREAM.

    buffer_size: INTEGER
            -- Buffer's size.

    create_c_buffer
            -- Create the C memory corresponding to the C
            -- buffer.

    object_stored_size: INTEGER
            -- Size of last stored object.

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    Exists: BOOLEAN is True
            -- Stream exists in any cases.

    extendible: BOOLEAN
            -- May new items be added?

    is_closed: BOOLEAN
            -- Is the I/O medium open

    is_executable: BOOLEAN
            -- Is stream executable?
        require -- from IO_MEDIUM
            handle_exists: exists

    Is_open_read: BOOLEAN is True
            -- Stream opens for input.

    Is_open_write: BOOLEAN is True
            -- Stream opens for output.

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    Is_readable: BOOLEAN is True

    Is_writable: BOOLEAN is True
            -- Stream is writable.

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    readable: BOOLEAN
            -- Is there a current item that may be read?
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?

feature -- Status setting

    close
            -- Close medium.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    set_additional_size (new_size: INTEGER)
            -- Set new_size to BUFFER_SIZE, internal value used to
            -- increment buffer_size during storable operations.

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable

    read_line
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable

    readline
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable

feature -- Output

    new_line
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            stream_exists: exists

    put_boolean (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in STREAM as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in STREAM as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in STREAM as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i to medium.
            -- Was declared in STREAM as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            stream_exists: exists

    put_real (r: REAL)
            -- Write r to medium.
            -- Was declared in STREAM as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s to medium.
            -- Was declared in STREAM as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in STREAM as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in STREAM as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in STREAM as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write i to medium.
            -- Was declared in STREAM as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write r to medium.
            -- Was declared in STREAM as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s to medium.
            -- Was declared in STREAM as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STREAM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STREAM Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STREAM

Ancestors
    IO_MEDIUM

Clients
    STREAM

Suppliers
    STREAM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STREAM Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of the STORABLE mechanism with streams."
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STREAM

create
    make,
    make_with_size

feature -- Initialization

    make
            -- Create stream object with a default_size of 100 bytes

    make_with_size (n: INTEGER)
            -- Create stream object with a default_size of n bytes

feature -- Status report

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?

feature -- Access

    buffer: POINTER
            -- C buffer correspond to the Eiffel STREAM.

    buffer_size: INTEGER
            -- Buffer's size.

    object_stored_size: INTEGER
            -- Size of last stored object.

    create_c_buffer
            -- Create the C memory corresponding to the C
            -- buffer.

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).

    set_additional_size (new_size: INTEGER)
            -- Set new_size to BUFFER_SIZE, internal value used to
            -- increment buffer_size during storable operations.

feature -- Status report

    Exists: BOOLEAN is True
            -- Stream exists in any cases.

    Is_open_read: BOOLEAN is True
            -- Stream opens for input.

    Is_open_write: BOOLEAN is True
            -- Stream opens for output.

    Is_readable: BOOLEAN is True

    is_executable: BOOLEAN
            -- Is stream executable?

    Is_writable: BOOLEAN is True
            -- Stream is writable.

    readable: BOOLEAN
            -- Is there a current item that may be read?

    extendible: BOOLEAN
            -- May new items be added?

    is_closed: BOOLEAN
            -- Is the I/O medium open

feature -- Status setting

    close
            -- Close medium.

feature -- Output

    put_new_line
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of new_line.
        require else
            stream_exists: exists

    new_line
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of put_new_line.
        require else
            stream_exists: exists

    put_string (s: STRING)
            -- Write s to medium.
            -- Was declared in STREAM as synonym of putstring.

    putstring (s: STRING)
            -- Write s to medium.
            -- Was declared in STREAM as synonym of put_string.

    put_character (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in STREAM as synonym of putchar.

    putchar (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in STREAM as synonym of put_character.

    put_real (r: REAL)
            -- Write r to medium.
            -- Was declared in STREAM as synonym of putreal.

    putreal (r: REAL)
            -- Write r to medium.
            -- Was declared in STREAM as synonym of put_real.

    put_integer (i: INTEGER)
            -- Write i to medium.
            -- Was declared in STREAM as synonym of putint.

    putint (i: INTEGER)
            -- Write i to medium.
            -- Was declared in STREAM as synonym of put_integer.

    put_boolean (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in STREAM as synonym of putbool.

    putbool (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in STREAM as synonym of put_boolean.

    put_double (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in STREAM as synonym of putdouble.

    putdouble (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in STREAM as synonym of put_double.

feature -- Input

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of readreal.

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of read_real.

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of readdouble.

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of read_double.

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of readchar.

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of read_character.

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of readint.

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of read_integer.

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readstream.

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_stream.

    read_line
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readline.

    readline
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_line.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STREAM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of characters, accessible through integer indices
        in a contiguous range.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STRING

inherit
    INDEXABLE [CHARACTER, INTEGER]
        redefine
            copy,
            is_equal,
            out,
            prune_all,
            changeable_comparison_criterion
        end

    RESIZABLE [CHARACTER]
        redefine
            copy,
            is_equal,
            out,
            changeable_comparison_criterion
        end

    HASHABLE
        redefine
            copy,
            is_equal,
            out
        end

    COMPARABLE
        redefine
            copy,
            is_equal,
            out
        end

    TO_SPECIAL [CHARACTER]
        redefine
            copy,
            is_equal,
            out
        end

    STRING_HANDLER
        redefine
            copy,
            is_equal,
            out
        end

create
    make,
    make_from_string,
    make_from_c

feature {NONE} -- Initialization

    make (n: INTEGER) is
            -- Allocate space for at least n characters.
        require
            non_negative_size: n >= 0
        do
            count := 0
            if n = 0 then
                area := empty_area
            else
                make_area (n + 1)
            end
        ensure
            empty_string: count = 0
            area_allocated: capacity >= n
        end

feature -- Initialization

    remake (n: INTEGER) is
        obsolete "Use `make' instead"
            -- Allocate space for at least n characters.
        require
            non_negative_size: n >= 0
        do
            count := 0
            make (n)
        ensure
            empty_string: count = 0
            area_allocated: capacity >= n
        end

    make_from_string (s: STRING) is
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
        require
            string_exists: s /= void
        do
            area := s.area
            count := s.count
        ensure
            shared_implementation: shared_with (s)
        end

    make_from_c (c_string: POINTER) is
            -- Initialize from contents of c_string,
            -- a string created by some external C function
        require
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            make_area (length + 1);
            ($area).memory_copy (c_string, length)
            count := length
        end

    from_c (c_string: POINTER) is
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string, length)
            count := length
        ensure
            no_zero_byte: not has ('%U')
        end

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER) is
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        local
            length: INTEGER
        do
            length := end_pos - start_pos + 1
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string + (start_pos - 1), (end_pos - start_pos + 1))
            count := length
        ensure
            valid_count: count = end_pos - start_pos + 1
        end

    adapt (s: STRING): like Current is
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
        do
            create Result.make (0)
            Result.share (s)
        end

feature -- Access

    item (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of @.
        do
            Result := area.item (i - 1)
        end

    infix "@" (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of item.
        do
            Result := area.item (i - 1)
        end

    item_code (i: INTEGER): INTEGER is
            -- Numeric code of character at position i
        require
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            Result := area.item (i - 1).code
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := hashcode ($area, count)
        end

    False_constant: STRING is "false"
            -- Constant string "false"

    True_constant: STRING is "true"
            -- Constant string "true"

    shared_with (other: like Current): BOOLEAN is
            -- Does string share the text of other?
        do
            Result := (other /= void) and then (area = other.area)
        end

    has (c: CHARACTER): BOOLEAN is
            -- Does string include c?
        local
            counter: INTEGER
        do
            if not is_empty then
                from
                    counter := 1
                until
                    counter > count or else (item (counter) = c)
                loop
                    counter := counter + 1
                end
                Result := (counter <= count)
            end
        end

    index_of (c: CHARACTER; start: INTEGER): INTEGER is
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
        require
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        local
            a: like area
            i, nb: INTEGER
        do
            nb := count
            if start <= nb then
                from
                    i := start - 1
                    nb := nb - 1
                    a := area
                until
                    i > nb or else a.item (i) = c
                loop
                    i := i + 1
                end
                if i <= nb then
                    Result := i + 1
                end
            end
        ensure
            correct_place: Result > 0 implies item (Result) = c
        end

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER is
            -- Position of last occurence of c.
            -- 0 if none
        require
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        local
            a: like area
            i: INTEGER
        do
            from
                i := start_index_from_end - 1
                a := area
            until
                i < 0 or else a.item (i) = c
            loop
                i := i - 1
            end
            if i >= 0 then
                Result := i + 1
            end
        ensure
            correct_place: Result > 0 implies item (Result) = c
        end

    substring_index (other: STRING; start: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
        require
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, 0)
        ensure
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)
        end

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
        require
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, fuzz)
        end

feature -- Measurement

    capacity: INTEGER is
            -- Allocated space
        do
            Result := area.count - 1
        end

    count: INTEGER
            -- Actual number of characters making up the string

    occurrences (c: CHARACTER): INTEGER is
            -- Number of times c appears in the string
        local
            counter, nb: INTEGER
            a: SPECIAL [CHARACTER]
        do
            from
                counter := 0
                nb := count - 1
                a := area
            until
                counter > nb
            loop
                if a.item (counter) = c then
                    Result := Result + 1
                end
                counter := counter + 1
            end
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure then
            Result.count = count
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
        local
            o_area: like area
        do
            if other = Current then
                Result := True
            elseif count = other.count then
                o_area := other.area;
                Result := str_strict_cmp ($area, $o_area, count) = 0
            end
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is string lexicographically lower than other?
        local
            other_area: like area
            other_count: INTEGER
            current_count: INTEGER
        do
            other_area := other.area
            other_count := other.count
            current_count := count
            if other_count = current_count then
                Result := str_strict_cmp ($other_area, $area, other_count) > 0
            else
                if current_count < other_count then
                    Result := str_strict_cmp ($other_area, $area, current_count) >= 0
                else
                    Result := str_strict_cmp ($other_area, $area, other_count) > 0
                end
            end
        end

feature -- Status report

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the string?
        do
            Result := (i > 0) and (i <= count)
        end

    Changeable_comparison_criterion: BOOLEAN is False

    is_integer: BOOLEAN is
            -- Does Current represent an INTEGER?
        do
            Result := str_isi ($area, count)
        end

    is_real: BOOLEAN is
            -- Does Current represent a REAL?
        do
            Result := str_isr ($area, count)
        end

    is_double: BOOLEAN is
            -- Does Current represent a DOUBLE?
        do
            Result := str_isd ($area, count)
        end

    is_boolean: BOOLEAN is
            -- Does Current represent a BOOLEAN?
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant) or else s.is_equal (false_constant)
        end

feature -- Element change

    set (t: like Current; n1, n2: INTEGER) is
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
        require
            argument_not_void: t /= void
        local
            s: STRING
        do
            s := t.substring (n1, n2)
            area := s.area
            count := s.count
        ensure
            is_substring: is_equal (t.substring (n1, n2))
        end

    copy (other: like Current) is
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
        local
            old_area: like area
        do
            if other /= Current then
                old_area := area
                standard_copy (other)
                if old_area = void or else old_area.count < area.count then
                    area := standard_clone (area)
                else
                    ($old_area).memory_copy ($area, count)
                    area := old_area
                end
            end
        ensure then
            new_result_count: count = other.count
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            start0 := start_pos - 1
            end0 := end_pos - 1
            index0 := index_pos - 1
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

    replace_substring (s: like Current; start_pos, end_pos: INTEGER) is
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
        require
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        local
            new_size, substring_size: INTEGER
            s_area: like area
        do
            substring_size := end_pos - start_pos + 1
            new_size := s.count + count - substring_size
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_replace ($area, $s_area, count, s.count, start_pos, end_pos)
            count := new_size
        ensure
            new_count: count = old count + s.count - end_pos + start_pos - 1
        end

    replace_substring_all (original, new: like Current) is
            -- Replace every occurence of original with new.
        require
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty
        local
            change_pos: INTEGER
        do
            if not is_empty then
                from
                    change_pos := substring_index (original, 1)
                until
                    change_pos = 0
                loop
                    replace_substring (new, change_pos, change_pos + original.count - 1)
                    if change_pos + new.count <= count then
                        change_pos := substring_index (original, change_pos + new.count)
                    else
                        change_pos := 0
                    end
                end
            end
        end

    replace_blank is
            -- Replace all current characters with blanks.
        do
            replace_character (' ')
        ensure
            same_size: (count = old count) and (capacity = old capacity)
        end

    fill_blank is
            -- Fill with capacity blank characters.
        do
            fill_character (' ')
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    replace_character (c: CHARACTER) is
            -- Replace all current characters with characters all equal to c.
        do
            ($area).memory_set (c.code, count)
        ensure
            same_size: (count = old count) and (capacity = old capacity)
        end

    fill_character (c: CHARACTER) is
            -- Fill with capacity characters all equal to c.
        do
            ($area).memory_set (c.code, capacity)
            count := capacity
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    head (n: INTEGER) is
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        do
            if n < count then
                count := n
            end
        ensure
            new_count: count = n.min (old count)
        end

    tail (n: INTEGER) is
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        local
            i, j: INTEGER
        do
            if n < count then
                from
                    j := (count - n)
                    i := 0
                until
                    i = n
                loop
                    area.put (area.item (j), i)
                    i := i + 1
                    j := j + 1
                end
                count := n
            end
        ensure
            new_count: count = n.min (old count)
        end

    left_adjust is
            -- Remove leading whitespace.
        do
            count := str_left ($area, count)
        ensure
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))
        end

    right_adjust is
            -- Remove trailing whitespace.
        do
            count := str_right ($area, count)
        ensure
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))
        end

    share (other: like Current) is
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
        require
            argument_not_void: other /= void
        do
            area := other.area
            count := other.count
        ensure
            shared_count: other.count = count
        end

    put (c: CHARACTER; i: INTEGER) is
            -- Replace character at position i by c.
        do
            area.put (c, i - 1)
        end

    precede (c: CHARACTER) is
            -- Add c at front.
        do
            if count = capacity then
                resize (count + additional_space)
            end
            str_cprepend ($area, c, count)
            count := count + 1
        ensure
            new_count: count = old count + 1
        end

    prepend (s: STRING) is
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := count + s.count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, 1)
            count := new_size
        ensure
            new_count: count = old count + s.count
        end

    prepend_boolean (b: BOOLEAN) is
            -- Prepend the string representation of b at front.
        do
            prepend (b.out)
        end

    prepend_character (c: CHARACTER) is
            -- Prepend the string representation of c at front.
        do
            prepend (c.out)
        end

    prepend_double (d: DOUBLE) is
            -- Prepend the string representation of d at front.
        do
            prepend (d.out)
        end

    prepend_integer (i: INTEGER) is
            -- Prepend the string representation of i at front.
        do
            prepend (i.out)
        end

    prepend_real (r: REAL) is
            -- Prepend the string representation of r at front.
        do
            prepend (r.out)
        end

    prepend_string (s: STRING) is
            -- Prepend a copy of s, if not void, at front.
        do
            if s /= void then
                prepend (s)
            end
        end

    append (s: STRING) is
            -- Append a copy of s at end.
        require
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area;
            ($area + count).memory_copy ($s_area, s.count)
            count := new_size
        ensure
            new_count: count = old count + old s.count
        end

    infix "+" (s: STRING): STRING is
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
        require
            argument_not_void: s /= void
        do
            create Result.make (count + s.count)
            Result.append_string (Current)
            Result.append_string (s)
        ensure
            result_exists: Result /= void
            new_count: Result.count = count + s.count
        end

    append_string (s: STRING) is
            -- Append a copy of s, if not void, at end.
        do
            if s /= void then
                append (s)
            end
        end

    append_integer (i: INTEGER) is
            -- Append the string representation of i at end.
        do
            append (i.out)
        end

    append_real (r: REAL) is
            -- Append the string representation of r at end.
        do
            append (r.out)
        end

    append_double (d: DOUBLE) is
            -- Append the string representation of d at end.
        do
            append (d.out)
        end

    append_character (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    extend (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    append_boolean (b: BOOLEAN) is
            -- Append the string representation of b at end.
        do
            append (b.out)
        end

    insert (s: STRING; i: INTEGER) is
            -- Add s to the left of position i in current string.
        require
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, i)
            count := new_size
        ensure
            new_count: count = old count + s.count
        end

feature -- Removal

    remove (i: INTEGER) is
            -- Remove i-th character.
        require
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            str_rmchar ($area, count, i)
            count := count - 1
        ensure
            new_count: count = old count - 1
        end

    prune (c: CHARACTER) is
            -- Remove first occurrence of c, if any.
        require else
            True
        local
            counter: INTEGER
        do
            from
                counter := 1
            until
                counter > count or else (item (counter) = c)
            loop
                counter := counter + 1
            end
            if counter <= count then
                remove (counter)
            end
        end

    prune_all (c: CHARACTER) is
            -- Remove all occurrences of c.
        require else
            True
        do
            count := str_rmall ($area, c, count)
        ensure then
            changed_count: count = (old count) - (old occurrences (c))
        end

    prune_all_leading (c: CHARACTER) is
            -- Remove all leading occurrences of c.
        do
            from
            until
                is_empty or else item (1) /= c
            loop
                remove (1)
            end
        end

    prune_all_trailing (c: CHARACTER) is
            -- Remove all trailing occurrences of c.
        do
            from
            until
                is_empty or else item (count) /= c
            loop
                remove (count)
            end
        end

    wipe_out is
            -- Remove all characters.
        do
            area := empty_area
            count := 0
        ensure then
            is_empty: count = 0
            empty_capacity: capacity = 0
        end

    clear_all is
            -- Reset all characters.
        do
            count := 0
        ensure
            is_empty: count = 0
            same_capacity: capacity = old capacity
        end

feature -- Resizing

    adapt_size is
            -- Adapt the size to accommodate count characters.
        do
            resize (count)
        end

    resize (newsize: INTEGER) is
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
        require
            new_size_non_negative: newsize >= 0
        local
            area_count: INTEGER
        do
            area_count := area.count
            if newsize >= area_count then
                if area_count = 1 then
                    make_area (newsize + 1)
                else
                    area := str_resize ($area, newsize + 1)
                end
            end
        end

    grow (newsize: INTEGER) is
            -- Ensure that the capacity is at least newsize.
        require else
            new_size_non_negative: newsize >= 0
        do
            if newsize > capacity then
                resize (newsize)
            end
        end

feature -- Conversion

    left_justify is
            -- Left justify the string using
            -- the capacity as the width
        do
            str_ljustify ($area, count, capacity)
        end

    center_justify is
            -- Center justify the string using
            -- the capacity as the width
        do
            str_cjustify ($area, count, capacity)
        end

    right_justify is
            -- Right justify the string using
            -- the capacity as the width
        do
            str_rjustify ($area, count, capacity)
        end

    character_justify (pivot: CHARACTER; position: INTEGER) is
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
        require
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty
        do
            if index_of (pivot, 1) < position then
                from
                    precede (' ')
                until
                    index_of (pivot, 1) = position
                loop
                    precede (' ')
                end
            elseif index_of (pivot, 1) > position then
                from
                    remove (1)
                until
                    index_of (pivot, 1) = position
                loop
                    remove (1)
                end
            end
            from
            until
                count = capacity
            loop
                extend (' ')
            end
        end

    to_lower is
            -- Convert to lower case.
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).lower, i)
                i := i - 1
            end
        end

    to_upper is
            -- Convert to upper case.
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).upper, i)
                i := i - 1
            end
        end

    to_integer: INTEGER is
            -- Integer value;
            -- for example, when applied to "123", will yield 123
        require
            is_integer: is_integer
        do
            Result := str_atoi ($area, count)
        end

    to_real: REAL is
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
        require
            represents_a_real: is_real
        do
            Result := str_ator ($area, count)
        end

    to_double: DOUBLE is
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
        require
            represents_a_double: is_double
        do
            Result := str_atod ($area, count)
        end

    to_boolean: BOOLEAN is
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
        require
            is_boolean: is_boolean
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant)
        end

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
        local
            temp: ARRAYED_LIST [CHARACTER]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := 1
            until
                i > count
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

    split (a_separator: CHARACTER): LINEAR [STRING] is
            -- Split on a_separator.
            -- Ignore separators in quotes.
        local
            al: ARRAYED_LIST [STRING]
            part: STRING
            i, j, c: INTEGER
            q: BOOLEAN
            p: CHARACTER
        do
            from
                c := count
                create al.make (c)
                i := 1
                j := 0
            until
                i > c
            loop
                j := index_of (a_separator, i)
                if j = 0 then
                    j := c + 1
                end
                part := substring (i, j - 1)
                if part.has ('"') then
                    from
                        j := i - 1
                        p := '%U'
                    until
                        j >= c or p = a_separator
                    loop
                        j := j + 1
                        p := item (j)
                        if p = '"' and not (j > 1 and then item (j - 1) = '%%') then
                            q := not q
                        end
                        if q and p = a_separator then
                            p := '%U'
                        end
                    end
                    part := substring (i, j - 1)
                    part.replace_substring_all ("%%%%", "_#___PERCENT___#_")
                    part.replace_substring_all ("%%%"", "_#___QUOTE___#_")
                    part.replace_substring_all ("%"", "")
                    part.replace_substring_all ("_#___PERCENT___#_", "%%")
                    part.replace_substring_all ("_#___QUOTE___#_", "%"")
                    part.prepend ("%"")
                    part.append ("%"")
                end
                al.extend (part)
                i := j + 1
            end
            Result := al
            check
                al.count = occurrences (a_separator)
            end
        ensure
            Result /= void
        end

    frozen to_c: ANY is
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
        do
            area.put ('%U', count)
            Result := area
        end

    mirrored: like Current is
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
        do
            Result := clone (Current)
            if count > 0 then
                Result.mirror
            end
        ensure
            same_count: Result.count = count
        end

    mirror is
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
        local
            a: like area
            c: CHARACTER
            i, j: INTEGER
        do
            if count > 0 then
                from
                    i := count - 1
                    a := area
                until
                    i <= j
                loop
                    c := a.item (i)
                    a.put (a.item (j), i)
                    a.put (c, j)
                    i := i - 1
                    j := j + 1
                end
            end
        ensure
            same_count: count = old count
        end

feature -- Duplication

    substring (n1, n2: INTEGER): like Current is
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
        local
            other_area: like area
        do
            if (1 <= n1) and (n1 <= n2) and (n2 <= count) then
                create Result.make (n2 - n1 + 1)
                other_area := Result.area
                ($other_area).memory_copy ($area + (n1 - 1), n2 - n1 + 1)
                Result.set_count (n2 - n1 + 1)
            else
                create Result.make (0)
            end
        ensure
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0
        end

    multiply (n: INTEGER) is
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
        require
            meaningful_multiplier: n >= 1
        local
            s: STRING
            i: INTEGER
        do
            s := clone (Current)
            grow (n * count)
            from
                i := n
            until
                i = 1
            loop
                append (s)
                i := i - 1
            end
        end

feature -- Output

    out: like Current is
            -- Printable representation
        do
            Result := clone (Current)
        end

feature {STRING_HANDLER} -- Implementation

    frozen set_count (number: INTEGER) is
            -- Set count to number of characters.
        require
            valid_count: 0 <= number and number <= capacity
        do
            count := number
        ensure
            new_count: count = number
        end

feature {NONE} -- Empty string implementation

    empty_area: SPECIAL [CHARACTER] is
            -- Empty area used when calling `make (0)'.
        local
            old_area: like area
        once
            old_area := area
            make_area (1)
            Result := area
            area := old_area
        end

feature {STRING} -- Implementation

    hashcode (c_string: POINTER; len: INTEGER): INTEGER is
            -- Hash code value of c_string
        external
            "C use %"eif_tools.h%""
        end

    str_str (c_str, o_str: POINTER; clen, olen, i, fuzzy: INTEGER): INTEGER is
            -- Forward search of o_str within c_str starting at i.
            -- Return the index within c_str where the pattern was
            -- located, 0 if not found.
            -- The 'fuzzy' parameter is the maximum allowed number of
            -- mismatches within the pattern. A 0 means an exact match.
        external
            "C use %"eif_eiffel.h%""
        end

    str_len (c_string: POINTER): INTEGER is
            -- Length of the C string: c_string
        external
            "C signature (char *): EIF_INTEGER use %"eif_str.h%""
        alias
            "strlen"
        end

    c_p_i: INTEGER is
        obsolete "You now have to implement it yourself by inheriting from PLATFORM."
            -- Number of characters per INTEGER
        do
        end

    str_ljustify (c_string: POINTER; length, cap: INTEGER) is
            -- Left justify in a field of capacity
            -- the c_string of length length
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_cjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Center justify in a field of capacity
            -- the c_string of length length
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Right justify in a field of capacity
            -- the c_string of length length
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_strict_cmp (this, other: POINTER; len: INTEGER): INTEGER is
            -- Compare this and other C strings
            -- for the first len characters.
            -- 0 if equal, < 0 if this < other,
            -- > 0 if this > other
        external
            "C signature (char *, char *, size_t): EIF_INTEGER use <string.h>"
        alias
            "strncmp"
        end

    str_atoi (c_string: POINTER; length: INTEGER): INTEGER is
            -- Value of integer in c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_ator (c_string: POINTER; length: INTEGER): REAL is
            -- Value of real in c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_REAL use %"eif_str.h%""
        end

    str_atod (c_string: POINTER; length: INTEGER): DOUBLE is
            -- Value of double in c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_DOUBLE use %"eif_str.h%""
        end

    str_isi (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is an integer?
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isr (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a real?
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isd (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a double?
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_cprepend (c_string: POINTER; c: CHARACTER; length: INTEGER) is
            -- Prepend c to c_string.
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_insert (c_string, other_string: POINTER; c_length, other_length, position: INTEGER) is
            -- Insert other_string into c_string at position.
            -- Insertion occurs at the left of position.
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rmchar (c_string: POINTER; length, i: INTEGER) is
            -- Remove i-th character from c_string.
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_replace (c_string, other_string: POINTER; c_length, other_length, star_post, end_pos: INTEGER) is
            -- Replace substring (start_pos, end_pos) from c_string
            -- by other_string.
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rmall (c_string: POINTER; c: CHARACTER; length: INTEGER): INTEGER is
            -- Remove all occurrences of c in c_string.
            -- Return new number of character making up c_string
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_left (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all leading whitespace from c_string.
            -- Return the new number of characters making c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_right (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all trailing whitespace from c_string.
            -- Return the new number of characters making c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_resize (a: POINTER; newsize: INTEGER): like area is
            -- Area which can accomodate
            -- at least newsize characters
        external
            "C use %"eif_malloc.h%""
        alias
            "sprealloc"
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy characters of source within bounds s
            -- and e to target starting at index i.
        external
            "C use %"eif_copy.h%""
        end

invariant

    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STRING

General
    cluster: base.kernel
    description:
        "Sequences of characters, accessible through integer indices
        in a contiguous range."
    create: make_from_c, make_from_string, make

Ancestors
    COMPARABLE
    HASHABLE
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    STRING_HANDLER
    TO_SPECIAL [T]

Queries
    infix "@" (i: INTEGER): CHARACTER
    infix ">=" (other: [like Current] STRING): BOOLEAN
    infix ">" (other: [like Current] STRING): BOOLEAN
    infix "<=" (other: [like Current] STRING): BOOLEAN
    infix "<" (other: [like Current] STRING): BOOLEAN
    infix "+" (s: STRING): STRING
    adapt (s: STRING): [like Current] STRING
    additional_space: INTEGER
    area: SPECIAL [CHARACTER]
    capacity: INTEGER
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    False_constant: STRING
    full: BOOLEAN
    fuzzy_index (other: STRING; start, fuzz: INTEGER): INTEGER
    Growth_percentage: INTEGER
    has (c: CHARACTER): BOOLEAN
    hash_code: INTEGER
    index_of (c: CHARACTER; start: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_boolean: BOOLEAN
    is_double: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] STRING): BOOLEAN
    is_hashable: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_integer: BOOLEAN
    is_real: BOOLEAN
    item (i: INTEGER): CHARACTER
    item_code (i: INTEGER): INTEGER
    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
    linear_representation: LINEAR [CHARACTER]
    max (other: [like Current] STRING): [like Current] STRING
    min (other: [like Current] STRING): [like Current] STRING
    Minimal_increase: INTEGER
    mirrored: [like Current] STRING
    object_comparison: BOOLEAN
    occurrences (c: CHARACTER): INTEGER
    out: [like Current] STRING
    prunable: BOOLEAN
    resizable: BOOLEAN
    shared_with (other: [like Current] STRING): BOOLEAN
    split (a_separator: CHARACTER): LINEAR [STRING]
    substring (n1, n2: INTEGER): [like Current] STRING
    substring_index (other: STRING; start: INTEGER): INTEGER
    three_way_comparison (other: [like Current] STRING): INTEGER
    to_boolean: BOOLEAN
    to_c: ANY
    to_double: DOUBLE
    to_integer: INTEGER
    to_real: REAL
    True_constant: STRING
    valid_index (i: INTEGER): BOOLEAN

Commands
    adapt_size
    append (s: STRING)
    append_boolean (b: BOOLEAN)
    append_character (c: CHARACTER)
    append_double (d: DOUBLE)
    append_integer (i: INTEGER)
    append_real (r: REAL)
    append_string (s: STRING)
    automatic_grow
    center_justify
    character_justify (pivot: CHARACTER; position: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] STRING)
    extend (c: CHARACTER)
    fill (other: CONTAINER [CHARACTER])
    fill_blank
    fill_character (c: CHARACTER)
    from_c (c_string: POINTER)
    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
    grow (newsize: INTEGER)
    head (n: INTEGER)
    insert (s: STRING; i: INTEGER)
    left_adjust
    left_justify
    make_from_c (c_string: POINTER)
    make_from_string (s: STRING)
    mirror
    multiply (n: INTEGER)
    precede (c: CHARACTER)
    prepend (s: STRING)
    prepend_boolean (b: BOOLEAN)
    prepend_character (c: CHARACTER)
    prepend_double (d: DOUBLE)
    prepend_integer (i: INTEGER)
    prepend_real (r: REAL)
    prepend_string (s: STRING)
    prune (c: CHARACTER)
    prune_all (c: CHARACTER)
    prune_all_leading (c: CHARACTER)
    prune_all_trailing (c: CHARACTER)
    put (c: CHARACTER; i: INTEGER)
    remove (i: INTEGER)
    replace_blank
    replace_character (c: CHARACTER)
    replace_substring (s: [like Current] STRING; start_pos, end_pos: INTEGER)
    replace_substring_all (original, new: [like Current] STRING)
    resize (newsize: INTEGER)
    right_adjust
    right_justify
    set (t: [like Current] STRING; n1, n2: INTEGER)
    share (other: [like Current] STRING)
    subcopy (other: [like Current] STRING; start_pos, end_pos, index_pos: INTEGER)
    tail (n: INTEGER)
    to_lower
    to_upper
    wipe_out

Constraints
    extendible
    compare character
    index set has same count

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of characters, accessible through integer indices
        in a contiguous range.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STRING

create
    make,
    make_from_string,
    make_from_c

feature {NONE} -- Initialization

    make (n: INTEGER) is
            -- Allocate space for at least n characters.
        require
            non_negative_size: n >= 0
        do
            count := 0
            if n = 0 then
                area := empty_area
            else
                make_area (n + 1)
            end
        ensure
            empty_string: count = 0
            area_allocated: capacity >= n
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature -- Initialization

    adapt (s: STRING): like Current is
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
        do
            create Result.make (0)
            Result.share (s)
        end

    from_c (c_string: POINTER) is
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string, length)
            count := length
        ensure
            no_zero_byte: not has ('%U')
        end

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER) is
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        local
            length: INTEGER
        do
            length := end_pos - start_pos + 1
            if capacity < length then
                make_area (length + 1)
            end;
            ($area).memory_copy (c_string + (start_pos - 1), (end_pos - start_pos + 1))
            count := length
        ensure
            valid_count: count = end_pos - start_pos + 1
        end

    make_from_c (c_string: POINTER) is
            -- Initialize from contents of c_string,
            -- a string created by some external C function
        require
            c_string_exists: c_string /= default_pointer
        local
            length: INTEGER
        do
            length := str_len (c_string)
            make_area (length + 1);
            ($area).memory_copy (c_string, length)
            count := length
        end

    make_from_string (s: STRING) is
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
        require
            string_exists: s /= void
        do
            area := s.area
            count := s.count
        ensure
            shared_implementation: shared_with (s)
        end

    remake (n: INTEGER) is
        obsolete "Use `make' instead"
            -- Allocate space for at least n characters.
        require
            non_negative_size: n >= 0
        do
            count := 0
            make (n)
        ensure
            empty_string: count = 0
            area_allocated: capacity >= n
        end

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    False_constant: STRING is "false"
            -- Constant string "false"

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
        require
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, fuzz)
        end

    has (c: CHARACTER): BOOLEAN is
            -- Does string include c?
        local
            counter: INTEGER
        do
            if not is_empty then
                from
                    counter := 1
                until
                    counter > count or else (item (counter) = c)
                loop
                    counter := counter + 1
                end
                Result := (counter <= count)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := hashcode ($area, count)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    index_of (c: CHARACTER; start: INTEGER): INTEGER is
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
        require
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        local
            a: like area
            i, nb: INTEGER
        do
            nb := count
            if start <= nb then
                from
                    i := start - 1
                    nb := nb - 1
                    a := area
                until
                    i > nb or else a.item (i) = c
                loop
                    i := i + 1
                end
                if i <= nb then
                    Result := i + 1
                end
            end
        ensure
            correct_place: Result > 0 implies item (Result) = c
        end

    item (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

    item_code (i: INTEGER): INTEGER is
            -- Numeric code of character at position i
        require
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            Result := area.item (i - 1).code
        end

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER is
            -- Position of last occurence of c.
            -- 0 if none
        require
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        local
            a: like area
            i: INTEGER
        do
            from
                i := start_index_from_end - 1
                a := area
            until
                i < 0 or else a.item (i) = c
            loop
                i := i - 1
            end
            if i >= 0 then
                Result := i + 1
            end
        ensure
            correct_place: Result > 0 implies item (Result) = c
        end

    shared_with (other: like Current): BOOLEAN is
            -- Does string share the text of other?
        do
            Result := (other /= void) and then (area = other.area)
        end

    substring_index (other: STRING; start: INTEGER): INTEGER is
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
        require
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        local
            a: ANY
        do
            a := other.area
            Result := str_str ($area, $a, count, other.count, start, 0)
        ensure
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)
        end

    True_constant: STRING is "true"
            -- Constant string "true"

    infix "@" (i: INTEGER): CHARACTER is
            -- Character at position i
            -- Was declared in STRING as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - 1)
        end

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Allocated space
        do
            Result := area.count - 1
        end

    count: INTEGER
            -- Actual number of characters making up the string

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            Result.count = count
        end

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER is
            -- Number of times c appears in the string
        local
            counter, nb: INTEGER
            a: SPECIAL [CHARACTER]
        do
            from
                counter := 0
                nb := count - 1
                a := area
            until
                counter > nb
            loop
                if a.item (counter) = c then
                    Result := Result + 1
                end
                counter := counter + 1
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
        require -- from ANY
            other_not_void: other /= void
        local
            o_area: like area
        do
            if other = Current then
                Result := True
            elseif count = other.count then
                o_area := other.area;
                Result := str_strict_cmp ($area, $o_area, count) = 0
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: like Current): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current < other then
                Result := - 1
            elseif other < Current then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is string lexicographically lower than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        local
            other_area: like area
            other_count: INTEGER
            current_count: INTEGER
        do
            other_area := other.area
            other_count := other.count
            current_count := count
            if other_count = current_count then
                Result := str_strict_cmp ($other_area, $area, other_count) > 0
            else
                if current_count < other_count then
                    Result := str_strict_cmp ($other_area, $area, current_count) >= 0
                else
                    Result := str_strict_cmp ($other_area, $area, other_count) > 0
                end
            end
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    Changeable_comparison_criterion: BOOLEAN is False

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_boolean: BOOLEAN is
            -- Does Current represent a BOOLEAN?
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant) or else s.is_equal (false_constant)
        end

    is_double: BOOLEAN is
            -- Does Current represent a DOUBLE?
        do
            Result := str_isd ($area, count)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_hashable: BOOLEAN is
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        do
            Result := (Current /= default)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)
        end

    is_inserted (v: CHARACTER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_integer: BOOLEAN is
            -- Does Current represent an INTEGER?
        do
            Result := str_isi ($area, count)
        end

    is_real: BOOLEAN is
            -- Does Current represent a REAL?
        do
            Result := str_isr ($area, count)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the string?
        do
            Result := (i > 0) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: STRING) is
            -- Append a copy of s at end.
        require
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area;
            ($area + count).memory_copy ($s_area, s.count)
            count := new_size
        ensure
            new_count: count = old count + old s.count
        end

    append_boolean (b: BOOLEAN) is
            -- Append the string representation of b at end.
        do
            append (b.out)
        end

    append_character (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    append_double (d: DOUBLE) is
            -- Append the string representation of d at end.
        do
            append (d.out)
        end

    append_integer (i: INTEGER) is
            -- Append the string representation of i at end.
        do
            append (i.out)
        end

    append_real (r: REAL) is
            -- Append the string representation of r at end.
        do
            append (r.out)
        end

    append_string (s: STRING) is
            -- Append a copy of s, if not void, at end.
        do
            if s /= void then
                append (s)
            end
        end

    copy (other: like Current) is
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            old_area: like area
        do
            if other /= Current then
                old_area := area
                standard_copy (other)
                if old_area = void or else old_area.count < area.count then
                    area := standard_clone (area)
                else
                    ($old_area).memory_copy ($area, count)
                    area := old_area
                end
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            new_result_count: count = other.count
        end

    extend (c: CHARACTER) is
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
        require -- from COLLECTION
            extendible: extendible
        local
            current_count: INTEGER
        do
            current_count := count
            if current_count = capacity then
                resize (current_count + additional_space)
            end
            area.put (c, current_count)
            count := current_count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1
        end

    fill (other: CONTAINER [CHARACTER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [CHARACTER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_blank is
            -- Fill with capacity blank characters.
        do
            fill_character (' ')
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    fill_character (c: CHARACTER) is
            -- Fill with capacity characters all equal to c.
        do
            ($area).memory_set (c.code, capacity)
            count := capacity
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)
        end

    head (n: INTEGER) is
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        do
            if n < count then
                count := n
            end
        ensure
            new_count: count = n.min (old count)
        end

    insert (s: STRING; i: INTEGER) is
            -- Add s to the left of position i in current string.
        require
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := s.count + count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, i)
            count := new_size
        ensure
            new_count: count = old count + s.count
        end

    left_adjust is
            -- Remove leading whitespace.
        do
            count := str_left ($area, count)
        ensure
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))
        end

    precede (c: CHARACTER) is
            -- Add c at front.
        do
            if count = capacity then
                resize (count + additional_space)
            end
            str_cprepend ($area, c, count)
            count := count + 1
        ensure
            new_count: count = old count + 1
        end

    prepend (s: STRING) is
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        local
            new_size: INTEGER
            s_area: like area
        do
            new_size := count + s.count
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_insert ($area, $s_area, count, s.count, 1)
            count := new_size
        ensure
            new_count: count = old count + s.count
        end

    prepend_boolean (b: BOOLEAN) is
            -- Prepend the string representation of b at front.
        do
            prepend (b.out)
        end

    prepend_character (c: CHARACTER) is
            -- Prepend the string representation of c at front.
        do
            prepend (c.out)
        end

    prepend_double (d: DOUBLE) is
            -- Prepend the string representation of d at front.
        do
            prepend (d.out)
        end

    prepend_integer (i: INTEGER) is
            -- Prepend the string representation of i at front.
        do
            prepend (i.out)
        end

    prepend_real (r: REAL) is
            -- Prepend the string representation of r at front.
        do
            prepend (r.out)
        end

    prepend_string (s: STRING) is
            -- Prepend a copy of s, if not void, at front.
        do
            if s /= void then
                prepend (s)
            end
        end

    put (c: CHARACTER; i: INTEGER) is
            -- Replace character at position i by c.
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (c, i - 1)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    replace_blank is
            -- Replace all current characters with blanks.
        do
            replace_character (' ')
        ensure
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_character (c: CHARACTER) is
            -- Replace all current characters with characters all equal to c.
        do
            ($area).memory_set (c.code, count)
        ensure
            same_size: (count = old count) and (capacity = old capacity)
        end

    replace_substring (s: like Current; start_pos, end_pos: INTEGER) is
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
        require
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        local
            new_size, substring_size: INTEGER
            s_area: like area
        do
            substring_size := end_pos - start_pos + 1
            new_size := s.count + count - substring_size
            if new_size > capacity then
                resize (new_size + additional_space)
            end
            s_area := s.area
            str_replace ($area, $s_area, count, s.count, start_pos, end_pos)
            count := new_size
        ensure
            new_count: count = old count + s.count - end_pos + start_pos - 1
        end

    replace_substring_all (original, new: like Current) is
            -- Replace every occurence of original with new.
        require
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty
        local
            change_pos: INTEGER
        do
            if not is_empty then
                from
                    change_pos := substring_index (original, 1)
                until
                    change_pos = 0
                loop
                    replace_substring (new, change_pos, change_pos + original.count - 1)
                    if change_pos + new.count <= count then
                        change_pos := substring_index (original, change_pos + new.count)
                    else
                        change_pos := 0
                    end
                end
            end
        end

    right_adjust is
            -- Remove trailing whitespace.
        do
            count := str_right ($area, count)
        ensure
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))
        end

    set (t: like Current; n1, n2: INTEGER) is
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
        require
            argument_not_void: t /= void
        local
            s: STRING
        do
            s := t.substring (n1, n2)
            area := s.area
            count := s.count
        ensure
            is_substring: is_equal (t.substring (n1, n2))
        end

    share (other: like Current) is
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
        require
            argument_not_void: other /= void
        do
            area := other.area
            count := other.count
        ensure
            shared_count: other.count = count
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            start0 := start_pos - 1
            end0 := end_pos - 1
            index0 := index_pos - 1
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

    tail (n: INTEGER) is
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        local
            i, j: INTEGER
        do
            if n < count then
                from
                    j := (count - n)
                    i := 0
                until
                    i = n
                loop
                    area.put (area.item (j), i)
                    i := i + 1
                    j := j + 1
                end
                count := n
            end
        ensure
            new_count: count = n.min (old count)
        end

    infix "+" (s: STRING): STRING is
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
        require
            argument_not_void: s /= void
        do
            create Result.make (count + s.count)
            Result.append_string (Current)
            Result.append_string (s)
        ensure
            result_exists: Result /= void
            new_count: Result.count = count + s.count
        end

feature {NONE} -- Element change

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature -- Removal

    clear_all is
            -- Reset all characters.
        do
            count := 0
        ensure
            is_empty: count = 0
            same_capacity: capacity = old capacity
        end

    prune (c: CHARACTER) is
            -- Remove first occurrence of c, if any.
        require -- from COLLECTION
            prunable: prunable
        require else
            True
        local
            counter: INTEGER
        do
            from
                counter := 1
            until
                counter > count or else (item (counter) = c)
            loop
                counter := counter + 1
            end
            if counter <= count then
                remove (counter)
            end
        end

    prune_all (c: CHARACTER) is
            -- Remove all occurrences of c.
        require -- from COLLECTION
            prunable
        require else
            True
        do
            count := str_rmall ($area, c, count)
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then
            changed_count: count = (old count) - (old occurrences (c))
        end

    prune_all_leading (c: CHARACTER) is
            -- Remove all leading occurrences of c.
        do
            from
            until
                is_empty or else item (1) /= c
            loop
                remove (1)
            end
        end

    prune_all_trailing (c: CHARACTER) is
            -- Remove all trailing occurrences of c.
        do
            from
            until
                is_empty or else item (count) /= c
            loop
                remove (count)
            end
        end

    remove (i: INTEGER) is
            -- Remove i-th character.
        require
            index_small_enough: i <= count
            index_large_enough: i > 0
        do
            str_rmchar ($area, count, i)
            count := count - 1
        ensure
            new_count: count = old count - 1
        end

    wipe_out is
            -- Remove all characters.
        require -- from COLLECTION
            prunable
        do
            area := empty_area
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            is_empty: count = 0
            empty_capacity: capacity = 0
        end

feature -- Resizing

    adapt_size is
            -- Adapt the size to accommodate count characters.
        do
            resize (count)
        end

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (newsize: INTEGER) is
            -- Ensure that the capacity is at least newsize.
        require -- from  RESIZABLE
            True
        require else
            new_size_non_negative: newsize >= 0
        do
            if newsize > capacity then
                resize (newsize)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (newsize: INTEGER) is
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
        require
            new_size_non_negative: newsize >= 0
        local
            area_count: INTEGER
        do
            area_count := area.count
            if newsize >= area_count then
                if area_count = 1 then
                    make_area (newsize + 1)
                else
                    area := str_resize ($area, newsize + 1)
                end
            end
        end

feature -- Conversion

    center_justify is
            -- Center justify the string using
            -- the capacity as the width
        do
            str_cjustify ($area, count, capacity)
        end

    character_justify (pivot: CHARACTER; position: INTEGER) is
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
        require
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty
        do
            if index_of (pivot, 1) < position then
                from
                    precede (' ')
                until
                    index_of (pivot, 1) = position
                loop
                    precede (' ')
                end
            elseif index_of (pivot, 1) > position then
                from
                    remove (1)
                until
                    index_of (pivot, 1) = position
                loop
                    remove (1)
                end
            end
            from
            until
                count = capacity
            loop
                extend (' ')
            end
        end

    left_justify is
            -- Left justify the string using
            -- the capacity as the width
        do
            str_ljustify ($area, count, capacity)
        end

    linear_representation: LINEAR [CHARACTER] is
            -- Representation as a linear structure
        local
            temp: ARRAYED_LIST [CHARACTER]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := 1
            until
                i > count
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

    mirror is
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
        local
            a: like area
            c: CHARACTER
            i, j: INTEGER
        do
            if count > 0 then
                from
                    i := count - 1
                    a := area
                until
                    i <= j
                loop
                    c := a.item (i)
                    a.put (a.item (j), i)
                    a.put (c, j)
                    i := i - 1
                    j := j + 1
                end
            end
        ensure
            same_count: count = old count
        end

    mirrored: like Current is
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
        do
            Result := clone (Current)
            if count > 0 then
                Result.mirror
            end
        ensure
            same_count: Result.count = count
        end

    right_justify is
            -- Right justify the string using
            -- the capacity as the width
        do
            str_rjustify ($area, count, capacity)
        end

    split (a_separator: CHARACTER): LINEAR [STRING] is
            -- Split on a_separator.
            -- Ignore separators in quotes.
        local
            al: ARRAYED_LIST [STRING]
            part: STRING
            i, j, c: INTEGER
            q: BOOLEAN
            p: CHARACTER
        do
            from
                c := count
                create al.make (c)
                i := 1
                j := 0
            until
                i > c
            loop
                j := index_of (a_separator, i)
                if j = 0 then
                    j := c + 1
                end
                part := substring (i, j - 1)
                if part.has ('"') then
                    from
                        j := i - 1
                        p := '%U'
                    until
                        j >= c or p = a_separator
                    loop
                        j := j + 1
                        p := item (j)
                        if p = '"' and not (j > 1 and then item (j - 1) = '%%') then
                            q := not q
                        end
                        if q and p = a_separator then
                            p := '%U'
                        end
                    end
                    part := substring (i, j - 1)
                    part.replace_substring_all ("%%%%", "_#___PERCENT___#_")
                    part.replace_substring_all ("%%%"", "_#___QUOTE___#_")
                    part.replace_substring_all ("%"", "")
                    part.replace_substring_all ("_#___PERCENT___#_", "%%")
                    part.replace_substring_all ("_#___QUOTE___#_", "%"")
                    part.prepend ("%"")
                    part.append ("%"")
                end
                al.extend (part)
                i := j + 1
            end
            Result := al
            check
                al.count = occurrences (a_separator)
            end
        ensure
            Result /= void
        end

    to_boolean: BOOLEAN is
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
        require
            is_boolean: is_boolean
        local
            s: STRING
        do
            s := clone (Current)
            s.right_adjust
            s.left_adjust
            s.to_lower
            Result := s.is_equal (true_constant)
        end

    frozen to_c: ANY is
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
        do
            area.put ('%U', count)
            Result := area
        end

    to_double: DOUBLE is
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
        require
            represents_a_double: is_double
        do
            Result := str_atod ($area, count)
        end

    to_integer: INTEGER is
            -- Integer value;
            -- for example, when applied to "123", will yield 123
        require
            is_integer: is_integer
        do
            Result := str_atoi ($area, count)
        end

    to_lower is
            -- Convert to lower case.
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).lower, i)
                i := i - 1
            end
        end

    to_real: REAL is
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
        require
            represents_a_real: is_real
        do
            Result := str_ator ($area, count)
        end

    to_upper is
            -- Convert to upper case.
        local
            i: INTEGER
            a: like area
        do
            from
                i := count - 1
                a := area
            until
                i < 0
            loop
                a.put (a.item (i).upper, i)
                i := i - 1
            end
        end

feature -- Duplication

    multiply (n: INTEGER) is
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
        require
            meaningful_multiplier: n >= 1
        local
            s: STRING
            i: INTEGER
        do
            s := clone (Current)
            grow (n * count)
            from
                i := n
            until
                i = 1
            loop
                append (s)
                i := i - 1
            end
        end

    substring (n1, n2: INTEGER): like Current is
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
        local
            other_area: like area
        do
            if (1 <= n1) and (n1 <= n2) and (n2 <= count) then
                create Result.make (n2 - n1 + 1)
                other_area := Result.area
                ($other_area).memory_copy ($area + (n1 - 1), n2 - n1 + 1)
                Result.set_count (n2 - n1 + 1)
            else
                create Result.make (0)
            end
        ensure
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0
        end

feature {NONE} -- Inapplicable

    bag_put (v: CHARACTER) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {STRING_HANDLER} -- Implementation

    frozen set_count (number: INTEGER) is
            -- Set count to number of characters.
        require
            valid_count: 0 <= number and number <= capacity
        do
            count := number
        ensure
            new_count: count = number
        end

feature {STRING} -- Implementation

    c_p_i: INTEGER is
        obsolete "You now have to implement it yourself by inheriting from PLATFORM."
            -- Number of characters per INTEGER
        do
        end

    hashcode (c_string: POINTER; len: INTEGER): INTEGER is
            -- Hash code value of c_string
        external
            "C use %"eif_tools.h%""
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy characters of source within bounds s
            -- and e to target starting at index i.
        external
            "C use %"eif_copy.h%""
        end

    str_atod (c_string: POINTER; length: INTEGER): DOUBLE is
            -- Value of double in c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_DOUBLE use %"eif_str.h%""
        end

    str_atoi (c_string: POINTER; length: INTEGER): INTEGER is
            -- Value of integer in c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_ator (c_string: POINTER; length: INTEGER): REAL is
            -- Value of real in c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_REAL use %"eif_str.h%""
        end

    str_cjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Center justify in a field of capacity
            -- the c_string of length length
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_cprepend (c_string: POINTER; c: CHARACTER; length: INTEGER) is
            -- Prepend c to c_string.
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_insert (c_string, other_string: POINTER; c_length, other_length, position: INTEGER) is
            -- Insert other_string into c_string at position.
            -- Insertion occurs at the left of position.
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_isd (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a double?
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isi (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is an integer?
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_isr (c_string: POINTER; length: INTEGER): BOOLEAN is
            -- Is is a real?
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_BOOLEAN use %"eif_str.h%""
        end

    str_left (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all leading whitespace from c_string.
            -- Return the new number of characters making c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_len (c_string: POINTER): INTEGER is
            -- Length of the C string: c_string
        external
            "C signature (char *): EIF_INTEGER use %"eif_str.h%""
        alias
            "strlen"
        end

    str_ljustify (c_string: POINTER; length, cap: INTEGER) is
            -- Left justify in a field of capacity
            -- the c_string of length length
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_replace (c_string, other_string: POINTER; c_length, other_length, star_post, end_pos: INTEGER) is
            -- Replace substring (start_pos, end_pos) from c_string
            -- by other_string.
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_resize (a: POINTER; newsize: INTEGER): like area is
            -- Area which can accomodate
            -- at least newsize characters
        external
            "C use %"eif_malloc.h%""
        alias
            "sprealloc"
        end

    str_right (c_string: POINTER; length: INTEGER): INTEGER is
            -- Remove all trailing whitespace from c_string.
            -- Return the new number of characters making c_string
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rjustify (c_string: POINTER; length, cap: INTEGER) is
            -- Right justify in a field of capacity
            -- the c_string of length length
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_rmall (c_string: POINTER; c: CHARACTER; length: INTEGER): INTEGER is
            -- Remove all occurrences of c in c_string.
            -- Return new number of character making up c_string
        external
            "C signature (EIF_CHARACTER *, EIF_CHARACTER, EIF_INTEGER): EIF_INTEGER use %"eif_str.h%""
        end

    str_rmchar (c_string: POINTER; length, i: INTEGER) is
            -- Remove i-th character from c_string.
        external
            "C signature (EIF_CHARACTER *, EIF_INTEGER, EIF_INTEGER) use %"eif_str.h%""
        end

    str_str (c_str, o_str: POINTER; clen, olen, i, fuzzy: INTEGER): INTEGER is
            -- Forward search of o_str within c_str starting at i.
            -- Return the index within c_str where the pattern was
            -- located, 0 if not found.
            -- The 'fuzzy' parameter is the maximum allowed number of
            -- mismatches within the pattern. A 0 means an exact match.
        external
            "C use %"eif_eiffel.h%""
        end

    str_strict_cmp (this, other: POINTER; len: INTEGER): INTEGER is
            -- Compare this and other C strings
            -- for the first len characters.
            -- 0 if equal, < 0 if this < other,
            -- > 0 if this > other
        external
            "C signature (char *, char *, size_t): EIF_INTEGER use <string.h>"
        alias
            "strncmp"
        end

feature {NONE} -- Empty string implementation

    empty_area: SPECIAL [CHARACTER] is
            -- Empty area used when calling `make (0)'.
        local
            old_area: like area
        once
            old_area := area
            make_area (1)
            Result := area
            area := old_area
        end

feature -- Output

    out: like Current is
            -- Printable representation
        do
            Result := clone (Current)
        end

invariant

    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of characters, accessible through integer indices
        in a contiguous range.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STRING

create

    make (n: INTEGER)
            -- Allocate space for at least n characters.
        require
            non_negative_size: n >= 0
        ensure
            empty_string: count = 0
            area_allocated: capacity >= n

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
        require
            string_exists: s /= void
        ensure
            shared_implementation: shared_with (s)

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
        require
            c_string_exists: c_string /= default_pointer

feature -- Initialization

    adapt (s: STRING): like Current
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s

    from_c (c_string: POINTER)
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
        ensure
            no_zero_byte: not has ('%U')

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        ensure
            valid_count: count = end_pos - start_pos + 1

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
        require
            c_string_exists: c_string /= default_pointer

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
        require
            string_exists: s /= void
        ensure
            shared_implementation: shared_with (s)

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    False_constant: STRING is "false"
            -- Constant string "false"

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
        require
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    index_of (c: CHARACTER; start: INTEGER): INTEGER
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
        require
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        ensure
            correct_place: Result > 0 implies item (Result) = c

    item (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    item_code (i: INTEGER): INTEGER
            -- Numeric code of character at position i
        require
            index_small_enough: i <= count
            index_large_enough: i > 0

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
            -- Position of last occurence of c.
            -- 0 if none
        require
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        ensure
            correct_place: Result > 0 implies item (Result) = c

    shared_with (other: like Current): BOOLEAN
            -- Does string share the text of other?

    substring_index (other: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
        require
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        ensure
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)

    True_constant: STRING is "true"
            -- Constant string "true"

    infix "@" (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Allocated space

    count: INTEGER
            -- Actual number of characters making up the string

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            Result.count = count

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER
            -- Number of times c appears in the string
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is string lexicographically lower than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Changeable_comparison_criterion: BOOLEAN is False

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_boolean: BOOLEAN
            -- Does Current represent a BOOLEAN?

    is_double: BOOLEAN
            -- Does Current represent a DOUBLE?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_integer: BOOLEAN
            -- Does Current represent an INTEGER?

    is_real: BOOLEAN
            -- Does Current represent a REAL?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the string?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: STRING)
            -- Append a copy of s at end.
        require
            argument_not_void: s /= void
        ensure
            new_count: count = old count + old s.count

    append_boolean (b: BOOLEAN)
            -- Append the string representation of b at end.

    append_character (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1

    append_double (d: DOUBLE)
            -- Append the string representation of d at end.

    append_integer (i: INTEGER)
            -- Append the string representation of i at end.

    append_real (r: REAL)
            -- Append the string representation of r at end.

    append_string (s: STRING)
            -- Append a copy of s, if not void, at end.

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            new_result_count: count = other.count

    extend (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_blank
            -- Fill with capacity blank characters.
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    fill_character (c: CHARACTER)
            -- Fill with capacity characters all equal to c.
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    head (n: INTEGER)
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        ensure
            new_count: count = n.min (old count)

    insert (s: STRING; i: INTEGER)
            -- Add s to the left of position i in current string.
        require
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure
            new_count: count = old count + s.count

    left_adjust
            -- Remove leading whitespace.
        ensure
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))

    precede (c: CHARACTER)
            -- Add c at front.
        ensure
            new_count: count = old count + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        ensure
            new_count: count = old count + s.count

    prepend_boolean (b: BOOLEAN)
            -- Prepend the string representation of b at front.

    prepend_character (c: CHARACTER)
            -- Prepend the string representation of c at front.

    prepend_double (d: DOUBLE)
            -- Prepend the string representation of d at front.

    prepend_integer (i: INTEGER)
            -- Prepend the string representation of i at front.

    prepend_real (r: REAL)
            -- Prepend the string representation of r at front.

    prepend_string (s: STRING)
            -- Prepend a copy of s, if not void, at front.

    put (c: CHARACTER; i: INTEGER)
            -- Replace character at position i by c.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    replace_blank
            -- Replace all current characters with blanks.
        ensure
            same_size: (count = old count) and (capacity = old capacity)

    replace_character (c: CHARACTER)
            -- Replace all current characters with characters all equal to c.
        ensure
            same_size: (count = old count) and (capacity = old capacity)

    replace_substring (s: like Current; start_pos, end_pos: INTEGER)
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
        require
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        ensure
            new_count: count = old count + s.count - end_pos + start_pos - 1

    replace_substring_all (original, new: like Current)
            -- Replace every occurence of original with new.
        require
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty

    right_adjust
            -- Remove trailing whitespace.
        ensure
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))

    set (t: like Current; n1, n2: INTEGER)
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
        require
            argument_not_void: t /= void
        ensure
            is_substring: is_equal (t.substring (n1, n2))

    share (other: like Current)
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
        require
            argument_not_void: other /= void
        ensure
            shared_count: other.count = count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)

    tail (n: INTEGER)
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        ensure
            new_count: count = n.min (old count)

    infix "+" (s: STRING): STRING
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
        require
            argument_not_void: s /= void
        ensure
            result_exists: Result /= void
            new_count: Result.count = count + s.count

feature -- Removal

    clear_all
            -- Reset all characters.
        ensure
            is_empty: count = 0
            same_capacity: capacity = old capacity

    prune (c: CHARACTER)
            -- Remove first occurrence of c, if any.
        require -- from COLLECTION
            prunable: prunable
        require else
            True

    prune_all (c: CHARACTER)
            -- Remove all occurrences of c.
        require -- from COLLECTION
            prunable
        require else
            True
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then
            changed_count: count = (old count) - (old occurrences (c))

    prune_all_leading (c: CHARACTER)
            -- Remove all leading occurrences of c.

    prune_all_trailing (c: CHARACTER)
            -- Remove all trailing occurrences of c.

    remove (i: INTEGER)
            -- Remove i-th character.
        require
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure
            new_count: count = old count - 1

    wipe_out
            -- Remove all characters.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            is_empty: count = 0
            empty_capacity: capacity = 0

feature -- Resizing

    adapt_size
            -- Adapt the size to accommodate count characters.

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (newsize: INTEGER)
            -- Ensure that the capacity is at least newsize.
        require -- from  RESIZABLE
            True
        require else
            new_size_non_negative: newsize >= 0
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (newsize: INTEGER)
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
        require
            new_size_non_negative: newsize >= 0

feature -- Conversion

    center_justify
            -- Center justify the string using
            -- the capacity as the width

    character_justify (pivot: CHARACTER; position: INTEGER)
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
        require
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty

    left_justify
            -- Left justify the string using
            -- the capacity as the width

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure

    mirror
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
        ensure
            same_count: count = old count

    mirrored: like Current
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
        ensure
            same_count: Result.count = count

    right_justify
            -- Right justify the string using
            -- the capacity as the width

    split (a_separator: CHARACTER): LINEAR [STRING]
            -- Split on a_separator.
            -- Ignore separators in quotes.
        ensure
            Result /= void

    to_boolean: BOOLEAN
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
        require
            is_boolean: is_boolean

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.

    to_double: DOUBLE
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
        require
            represents_a_double: is_double

    to_integer: INTEGER
            -- Integer value;
            -- for example, when applied to "123", will yield 123
        require
            is_integer: is_integer

    to_lower
            -- Convert to lower case.

    to_real: REAL
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
        require
            represents_a_real: is_real

    to_upper
            -- Convert to upper case.

feature -- Duplication

    multiply (n: INTEGER)
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
        require
            meaningful_multiplier: n >= 1

    substring (n1, n2: INTEGER): like Current
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
        ensure
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0

feature -- Output

    out: like Current
            -- Printable representation

invariant

    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING_HANDLER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that can access `set_count' from STRING"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STRING_HANDLER

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING_HANDLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING_HANDLER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STRING_HANDLER

General
    cluster: base.kernel
    description: "Objects that can access `set_count' from STRING"

Ancestors
    ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING_HANDLER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that can access `set_count' from STRING"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    STRING_HANDLER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING_HANDLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING_HANDLER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that can access `set_count' from STRING"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STRING_HANDLER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING_HANDLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING_HANDLER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STRING_HANDLER

Ancestors
    ANY

Descendants
    IO_MEDIUM
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING_HANDLER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that can access `set_count' from STRING"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STRING_HANDLER

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING_HANDLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    STRING

Ancestors
    COMPARABLE
    HASHABLE
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    STRING_HANDLER
    TO_SPECIAL [T]

Descendants
    PATH_NAME
    SEQ_STRING

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ARGUMENTS
    BIT_REF
    CONSOLE
    DIRECTORY
    DLL_32
    DLL_32_ROUTINE
    EXCEPTIONS
    EXECUTION_ENVIRONMENT
    FILE
    FILE_NAME
    FORMAT_DOUBLE
    FORMAT_INTEGER
    HEIR
    INTERNAL
    PATH_NAME
    PLAIN_TEXT_FILE
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    SEQ_STRING
    SHARED_LIBRARY
    SHARED_LIBRARY_ROUTINE
    STORABLE
    STRING
    UNIX_FILE_INFO
    UNIX_SIGNALS

Suppliers
    ARRAYED_LIST [G]
    BOOLEAN
    CHARACTER
    DOUBLE
    INTEGER
    INTEGER_INTERVAL
    POINTER
    REAL
    SPECIAL [T]
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STRING Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequences of characters, accessible through integer indices
        in a contiguous range.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    STRING

create
    make,
    make_from_string,
    make_from_c

feature -- Initialization

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
        require
            string_exists: s /= void
        ensure
            shared_implementation: shared_with (s)

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
        require
            c_string_exists: c_string /= default_pointer

    from_c (c_string: POINTER)
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
        ensure
            no_zero_byte: not has ('%U')

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        ensure
            valid_count: count = end_pos - start_pos + 1

    adapt (s: STRING): like Current
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s

feature -- Access

    item (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of @.

    infix "@" (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of item.

    item_code (i: INTEGER): INTEGER
            -- Numeric code of character at position i
        require
            index_small_enough: i <= count
            index_large_enough: i > 0

    hash_code: INTEGER
            -- Hash code value

    False_constant: STRING is "false"
            -- Constant string "false"

    True_constant: STRING is "true"
            -- Constant string "true"

    shared_with (other: like Current): BOOLEAN
            -- Does string share the text of other?

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?

    index_of (c: CHARACTER; start: INTEGER): INTEGER
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
        require
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        ensure
            correct_place: Result > 0 implies item (Result) = c

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
            -- Position of last occurence of c.
            -- 0 if none
        require
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        ensure
            correct_place: Result > 0 implies item (Result) = c

    substring_index (other: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
        require
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        ensure
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
        require
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count

feature -- Measurement

    capacity: INTEGER
            -- Allocated space

    count: INTEGER
            -- Actual number of characters making up the string

    occurrences (c: CHARACTER): INTEGER
            -- Number of times c appears in the string

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure then
            Result.count = count

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?

    infix "<" (other: like Current): BOOLEAN
            -- Is string lexicographically lower than other?

feature -- Status report

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the string?

    Changeable_comparison_criterion: BOOLEAN is False

    is_integer: BOOLEAN
            -- Does Current represent an INTEGER?

    is_real: BOOLEAN
            -- Does Current represent a REAL?

    is_double: BOOLEAN
            -- Does Current represent a DOUBLE?

    is_boolean: BOOLEAN
            -- Does Current represent a BOOLEAN?

feature -- Element change

    set (t: like Current; n1, n2: INTEGER)
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
        require
            argument_not_void: t /= void
        ensure
            is_substring: is_equal (t.substring (n1, n2))

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
        ensure then
            new_result_count: count = other.count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)

    replace_substring (s: like Current; start_pos, end_pos: INTEGER)
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
        require
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        ensure
            new_count: count = old count + s.count - end_pos + start_pos - 1

    replace_substring_all (original, new: like Current)
            -- Replace every occurence of original with new.
        require
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty

    replace_blank
            -- Replace all current characters with blanks.
        ensure
            same_size: (count = old count) and (capacity = old capacity)

    fill_blank
            -- Fill with capacity blank characters.
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    replace_character (c: CHARACTER)
            -- Replace all current characters with characters all equal to c.
        ensure
            same_size: (count = old count) and (capacity = old capacity)

    fill_character (c: CHARACTER)
            -- Fill with capacity characters all equal to c.
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    head (n: INTEGER)
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        ensure
            new_count: count = n.min (old count)

    tail (n: INTEGER)
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        ensure
            new_count: count = n.min (old count)

    left_adjust
            -- Remove leading whitespace.
        ensure
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '%T') and (item (1) /= '%R') and (item (1) /= '%N'))

    right_adjust
            -- Remove trailing whitespace.
        ensure
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '%T') and (item (count) /= '%R') and (item (count) /= '%N'))

    share (other: like Current)
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
        require
            argument_not_void: other /= void
        ensure
            shared_count: other.count = count

    put (c: CHARACTER; i: INTEGER)
            -- Replace character at position i by c.

    precede (c: CHARACTER)
            -- Add c at front.
        ensure
            new_count: count = old count + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        ensure
            new_count: count = old count + s.count

    prepend_boolean (b: BOOLEAN)
            -- Prepend the string representation of b at front.

    prepend_character (c: CHARACTER)
            -- Prepend the string representation of c at front.

    prepend_double (d: DOUBLE)
            -- Prepend the string representation of d at front.

    prepend_integer (i: INTEGER)
            -- Prepend the string representation of i at front.

    prepend_real (r: REAL)
            -- Prepend the string representation of r at front.

    prepend_string (s: STRING)
            -- Prepend a copy of s, if not void, at front.

    append (s: STRING)
            -- Append a copy of s at end.
        require
            argument_not_void: s /= void
        ensure
            new_count: count = old count + old s.count

    infix "+" (s: STRING): STRING
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
        require
            argument_not_void: s /= void
        ensure
            result_exists: Result /= void
            new_count: Result.count = count + s.count

    append_string (s: STRING)
            -- Append a copy of s, if not void, at end.

    append_integer (i: INTEGER)
            -- Append the string representation of i at end.

    append_real (r: REAL)
            -- Append the string representation of r at end.

    append_double (d: DOUBLE)
            -- Append the string representation of d at end.

    append_character (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1

    extend (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1

    append_boolean (b: BOOLEAN)
            -- Append the string representation of b at end.

    insert (s: STRING; i: INTEGER)
            -- Add s to the left of position i in current string.
        require
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure
            new_count: count = old count + s.count

feature -- Removal

    remove (i: INTEGER)
            -- Remove i-th character.
        require
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure
            new_count: count = old count - 1

    prune (c: CHARACTER)
            -- Remove first occurrence of c, if any.
        require else
            True

    prune_all (c: CHARACTER)
            -- Remove all occurrences of c.
        require else
            True
        ensure then
            changed_count: count = (old count) - (old occurrences (c))

    prune_all_leading (c: CHARACTER)
            -- Remove all leading occurrences of c.

    prune_all_trailing (c: CHARACTER)
            -- Remove all trailing occurrences of c.

    wipe_out
            -- Remove all characters.
        ensure then
            is_empty: count = 0
            empty_capacity: capacity = 0

    clear_all
            -- Reset all characters.
        ensure
            is_empty: count = 0
            same_capacity: capacity = old capacity

feature -- Resizing

    adapt_size
            -- Adapt the size to accommodate count characters.

    resize (newsize: INTEGER)
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
        require
            new_size_non_negative: newsize >= 0

    grow (newsize: INTEGER)
            -- Ensure that the capacity is at least newsize.
        require else
            new_size_non_negative: newsize >= 0

feature -- Conversion

    left_justify
            -- Left justify the string using
            -- the capacity as the width

    center_justify
            -- Center justify the string using
            -- the capacity as the width

    right_justify
            -- Right justify the string using
            -- the capacity as the width

    character_justify (pivot: CHARACTER; position: INTEGER)
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
        require
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty

    to_lower
            -- Convert to lower case.

    to_upper
            -- Convert to upper case.

    to_integer: INTEGER
            -- Integer value;
            -- for example, when applied to "123", will yield 123
        require
            is_integer: is_integer

    to_real: REAL
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
        require
            represents_a_real: is_real

    to_double: DOUBLE
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
        require
            represents_a_double: is_double

    to_boolean: BOOLEAN
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
        require
            is_boolean: is_boolean

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure

    split (a_separator: CHARACTER): LINEAR [STRING]
            -- Split on a_separator.
            -- Ignore separators in quotes.
        ensure
            Result /= void

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.

    mirrored: like Current
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
        ensure
            same_count: Result.count = count

    mirror
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
        ensure
            same_count: count = old count

feature -- Duplication

    substring (n1, n2: INTEGER): like Current
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
        ensure
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0

    multiply (n: INTEGER)
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
        require
            meaningful_multiplier: n >= 1

feature -- Output

    out: like Current
            -- Printable representation

invariant

    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TO_SPECIAL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to special objects, for direct access to arrays and strings"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    TO_SPECIAL [T]

create
    make_area

feature -- Access

    area: SPECIAL [T]
            -- Special data zone

feature {NONE} -- Initialization

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure
            area_allocated: area /= void and then area.count = n
        end

feature {NONE} -- Element change

    set_area (other: like area) is
            -- Make other the new area
        do
            area := other
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TO_SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TO_SPECIAL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TO_SPECIAL [T]

General
    cluster: base.kernel
    description: "References to special objects, for direct access to arrays and strings"
    create: make_area

Ancestors
    ANY

Queries
    area: SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TO_SPECIAL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to special objects, for direct access to arrays and strings"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    TO_SPECIAL [T]

create
    make_area

feature {NONE} -- Initialization

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure
            area_allocated: area /= void and then area.count = n
        end

feature -- Access

    area: SPECIAL [T]
            -- Special data zone

feature {NONE} -- Element change

    set_area (other: like area) is
            -- Make other the new area
        do
            area := other
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TO_SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TO_SPECIAL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to special objects, for direct access to arrays and strings"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    TO_SPECIAL [T]

create

    make_area (n: INTEGER)
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        ensure
            area_allocated: area /= void and then area.count = n

feature -- Access

    area: SPECIAL [T]
            -- Special data zone

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TO_SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TO_SPECIAL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TO_SPECIAL [T]

Ancestors
    ANY

Descendants
    ARRAY [G]
    BOOL_STRING
    STRING
    UNIX_FILE_INFO

Clients
    TO_SPECIAL [T]

Suppliers
    BOOLEAN
    INTEGER
    SPECIAL [T]
    TO_SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TO_SPECIAL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to special objects, for direct access to arrays and strings"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    TO_SPECIAL [T]

create
    make_area

feature -- Access

    area: SPECIAL [T]
            -- Special data zone

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TO_SPECIAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TUPLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of TUPLE"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    TUPLE

inherit
    ARRAY [ANY]
        rename
            make as array_make
        end

create
    make

feature -- Creation

    make is
        do
            array_make (1, eif_gen_count ($Current))
        end

feature -- Type queries

    is_boolean_item (index: INTEGER): BOOLEAN is
            -- Is item at index a BOOLEAN?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'b')
        end

    is_character_item (index: INTEGER): BOOLEAN is
            -- Is item at index a CHARACTER?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'c')
        end

    is_double_item (index: INTEGER): BOOLEAN is
            -- Is item at index a DOUBLE?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'd')
        end

    is_integer_item (index: INTEGER): BOOLEAN is
            -- Is item at index an INTEGER?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'i')
        end

    is_pointer_item (index: INTEGER): BOOLEAN is
            -- Is item at index a POINTER?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'p')
        end

    is_real_item (index: INTEGER): BOOLEAN is
            -- Is item at index a REAL?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'f')
        end

    is_reference_item (index: INTEGER): BOOLEAN is
            -- Is item at index a REFERENCE?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'r')
        end

    is_numeric_item (index: INTEGER): BOOLEAN is
            -- Is item at index a number?
        require
            valid_index: valid_index (index)
        local
            tcode: CHARACTER
        do
            tcode := eif_gen_typecode ($Current, index)
            Result := (tcode = 'i') or else (tcode = 'f') or else (tcode = 'd')
        end

    is_uniform: BOOLEAN is
            -- Are all items of the same basic type or all of reference type?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, '?')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_boolean: BOOLEAN is
            -- Are all items of type BOOLEAN?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'b')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_character: BOOLEAN is
            -- Are all items of type CHARACTER?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'c')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_double: BOOLEAN is
            -- Are all items of type DOUBLE?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'd')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_integer: BOOLEAN is
            -- Are all items of type INTEGER?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'i')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_pointer: BOOLEAN is
            -- Are all items of type POINTER?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'p')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_real: BOOLEAN is
            -- Are all items of type REAL?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'f')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_reference: BOOLEAN is
            -- Are all items of reference type?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'r')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

feature -- Type conversion queries

    convertible_to_double: BOOLEAN is
            -- Is current convertible to an array of doubles?
        local
            i, cnt: INTEGER
            tcode: CHARACTER
        do
            Result := True
            from
                i := 1
                cnt := count
            until
                i > cnt or else not Result
            loop
                tcode := eif_gen_typecode ($Current, i)
                Result := (tcode = 'i') or else (tcode = 'f') or else (tcode = 'd')
                i := i + 1
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    convertible_to_real: BOOLEAN is
            -- Is current convertible to an array of reals?
        local
            i, cnt: INTEGER
            tcode: CHARACTER
        do
            Result := True
            from
                i := 1
                cnt := count
            until
                i > cnt or else not Result
            loop
                tcode := eif_gen_typecode ($Current, i)
                Result := (tcode = 'i') or else (tcode = 'f')
                i := i + 1
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

feature -- Access

    boolean_item (index: INTEGER): BOOLEAN is
            -- Boolean item at index.
        require
            valid_index: valid_index (index)
            is_boolean: is_boolean_item (index)
        local
            ref: BOOLEAN_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    character_item (index: INTEGER): CHARACTER is
            -- Character item at index.
        require
            valid_index: valid_index (index)
            is_character: is_character_item (index)
        local
            ref: CHARACTER_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    double_item (index: INTEGER): DOUBLE is
            -- Double item at index.
        require
            valid_index: valid_index (index)
            is_numeric: is_numeric_item (index)
        local
            iref: INTEGER_REF
            rref: REAL_REF
            dref: DOUBLE_REF
        do
            dref ?= item (index)
            if dref /= void then
                Result := dref.item
            else
                rref ?= item (index)
                if rref /= void then
                    Result := rref.item
                else
                    iref ?= item (index)
                    if iref /= void then
                        Result := iref.item
                    end
                end
            end
        end

    integer_item (index: INTEGER): INTEGER is
            -- Integer item at index.
        require
            valid_index: valid_index (index)
            is_integer: is_integer_item (index)
        local
            ref: INTEGER_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    pointer_item (index: INTEGER): POINTER is
            -- Pointer item at index.
        require
            valid_index: valid_index (index)
            is_pointer: is_pointer_item (index)
        local
            ref: POINTER_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    real_item (index: INTEGER): REAL is
            -- real item at index.
        require
            valid_index: valid_index (index)
            is_real_or_integer: is_real_item (index) or else is_integer_item (index)
        local
            iref: INTEGER_REF
            rref: REAL_REF
            dref: DOUBLE_REF
        do
            rref ?= item (index)
            if rref /= void then
                Result := rref.item
            else
                iref ?= item (index)
                if iref /= void then
                    Result := iref.item
                else
                    dref ?= item (index)
                    if dref /= void then
                        Result := dref.truncated_to_real
                    end
                end
            end
        end

feature -- Conversion

    arrayed: ARRAY [ANY] is
            -- Items of Current as array
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    boolean_arrayed: ARRAY [BOOLEAN] is
            -- Items of Current as array
        require
            is_uniform_boolean: is_uniform_boolean
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (boolean_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    character_arrayed: ARRAY [CHARACTER] is
            -- Items of Current as array
        require
            is_uniform_character: is_uniform_character
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (character_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    double_arrayed: ARRAY [DOUBLE] is
            -- Items of Current as array
        require
            convertible: convertible_to_double
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (double_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    integer_arrayed: ARRAY [INTEGER] is
            -- Items of Current as array
        require
            is_uniform_integer: is_uniform_integer
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (integer_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    pointer_arrayed: ARRAY [POINTER] is
            -- Items of Current as array
        require
            is_uniform_pointer: is_uniform_pointer
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (pointer_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    real_arrayed: ARRAY [REAL] is
            -- Items of Current as array
        require
            convertible: convertible_to_real
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (real_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    string_arrayed: ARRAY [STRING] is
            -- Items of Current as array
            -- NOTE: Items with a type not cconforming to
            --       type STRING are set to Void.
        local
            i, cnt: INTEGER
            s: STRING
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                s ?= item (i)
                Result.put (s, i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

feature {ROUTINE}

    arg_item_code (index: INTEGER): CHARACTER is
            -- Type code of item at index. Used for
            -- argument processing in ROUTINE
        require
            valid_index: valid_index (index)
        do
            Result := eif_gen_typecode ($Current, index)
        end

feature {NONE} -- Implementation

    eif_gen_is_uniform (obj: POINTER; code: CHARACTER): BOOLEAN is
            -- Are all items in obj of type code?
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode (obj: POINTER; pos: INTEGER): CHARACTER is
            -- Code for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_count (obj: POINTER): INTEGER is
            -- Number of generic parameters of obj.
        external
            "C | %"eif_gen_conf.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TUPLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TUPLE

General
    cluster: base.kernel
    description: "Implementation of TUPLE"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): ANY
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [ANY]
    arrayed: ARRAY [ANY]
    boolean_arrayed: ARRAY [BOOLEAN]
    boolean_item (index: INTEGER): BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    character_arrayed: ARRAY [CHARACTER]
    character_item (index: INTEGER): CHARACTER
    convertible_to_double: BOOLEAN
    convertible_to_real: BOOLEAN
    count: INTEGER
    double_arrayed: ARRAY [DOUBLE]
    double_item (index: INTEGER): DOUBLE
    entry (i: INTEGER): ANY
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: ANY): BOOLEAN
    index_set: INTEGER_INTERVAL
    integer_arrayed: ARRAY [INTEGER]
    integer_item (index: INTEGER): INTEGER
    is_boolean_item (index: INTEGER): BOOLEAN
    is_character_item (index: INTEGER): BOOLEAN
    is_double_item (index: INTEGER): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] TUPLE): BOOLEAN
    is_inserted (v: ANY): BOOLEAN
    is_integer_item (index: INTEGER): BOOLEAN
    is_numeric_item (index: INTEGER): BOOLEAN
    is_pointer_item (index: INTEGER): BOOLEAN
    is_real_item (index: INTEGER): BOOLEAN
    is_reference_item (index: INTEGER): BOOLEAN
    is_uniform: BOOLEAN
    is_uniform_boolean: BOOLEAN
    is_uniform_character: BOOLEAN
    is_uniform_double: BOOLEAN
    is_uniform_integer: BOOLEAN
    is_uniform_pointer: BOOLEAN
    is_uniform_real: BOOLEAN
    is_uniform_reference: BOOLEAN
    item (i: INTEGER): ANY
    linear_representation: LINEAR [ANY]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: ANY): INTEGER
    pointer_arrayed: ARRAY [POINTER]
    pointer_item (index: INTEGER): POINTER
    prunable: BOOLEAN
    real_arrayed: ARRAY [REAL]
    real_item (index: INTEGER): REAL
    resizable: BOOLEAN
    same_items (other: [like Current] TUPLE): BOOLEAN
    string_arrayed: ARRAY [STRING]
    subarray (start_pos, end_pos: INTEGER): [like Current] TUPLE
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    array_make (min_index, max_index: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] TUPLE)
    discard_items
    enter (v: [like item] ANY; i: INTEGER)
    fill (other: CONTAINER [ANY])
    force (v: [like item] ANY; i: INTEGER)
    grow (i: INTEGER)
    make
    make_from_array (a: ARRAY [ANY])
    prune_all (v: ANY)
    put (v: [like item] ANY; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    subcopy (other: [like Current] TUPLE; start_pos, end_pos, index_pos: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TUPLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of TUPLE"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    TUPLE

create
    make

feature -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_from_array (a: ARRAY [ANY]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature {NONE} -- Initialization

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature -- Access

    area: SPECIAL [ANY]
            -- Special data zone
            -- (from TO_SPECIAL)

    boolean_item (index: INTEGER): BOOLEAN is
            -- Boolean item at index.
        require
            valid_index: valid_index (index)
            is_boolean: is_boolean_item (index)
        local
            ref: BOOLEAN_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    character_item (index: INTEGER): CHARACTER is
            -- Character item at index.
        require
            valid_index: valid_index (index)
            is_character: is_character_item (index)
        local
            ref: CHARACTER_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    double_item (index: INTEGER): DOUBLE is
            -- Double item at index.
        require
            valid_index: valid_index (index)
            is_numeric: is_numeric_item (index)
        local
            iref: INTEGER_REF
            rref: REAL_REF
            dref: DOUBLE_REF
        do
            dref ?= item (index)
            if dref /= void then
                Result := dref.item
            else
                rref ?= item (index)
                if rref /= void then
                    Result := rref.item
                else
                    iref ?= item (index)
                    if iref /= void then
                        Result := iref.item
                    end
                end
            end
        end

    entry (i: INTEGER): ANY is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            Result := item (i)
        end

    has (v: ANY): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (item (i) /= void and then item (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (item (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    integer_item (index: INTEGER): INTEGER is
            -- Integer item at index.
        require
            valid_index: valid_index (index)
            is_integer: is_integer_item (index)
        local
            ref: INTEGER_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    item (i: INTEGER): ANY is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

    pointer_item (index: INTEGER): POINTER is
            -- Pointer item at index.
        require
            valid_index: valid_index (index)
            is_pointer: is_pointer_item (index)
        local
            ref: POINTER_REF
        do
            ref ?= item (index)
            if ref /= void then
                Result := ref.item
            end
        end

    real_item (index: INTEGER): REAL is
            -- real item at index.
        require
            valid_index: valid_index (index)
            is_real_or_integer: is_real_item (index) or else is_integer_item (index)
        local
            iref: INTEGER_REF
            rref: REAL_REF
            dref: DOUBLE_REF
        do
            rref ?= item (index)
            if rref /= void then
                Result := rref.item
            else
                iref ?= item (index)
                if iref /= void then
                    Result := iref.item
                else
                    dref ?= item (index)
                    if dref /= void then
                        Result := dref.truncated_to_real
                    end
                end
            end
        end

    infix "@" (i: INTEGER): ANY is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    count: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: ANY): INTEGER is
            -- Number of times v appears in structure
            -- (from ARRAY)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if item (i) /= void and then v.is_equal (item (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if item (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        local
            i: INTEGER
        do
            if lower = other.lower and then upper = other.upper and then object_comparison = other.object_comparison then
                if object_comparison then
                    from
                        Result := True
                        i := lower
                    until
                        not Result or i > upper
                    loop
                        Result := equal (item (i), other.item (i))
                        i := i + 1
                    end
                else
                    Result := area.same_items (other.area, upper - lower)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)
        do
            Result := False
        end

    full: BOOLEAN is
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)
        do
            Result := True
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: ANY): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)
        do
            Result := False
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = count
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    enter (v: like item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    fill (other: CONTAINER [ANY]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [ANY]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put (v, i)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count
        end

    put (v: like item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature {ARRAY} -- Element change

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    prune_all (v: ANY) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
        obsolete "Not applicable since not `prunable'. Use `discard_items' instead."
            -- Make array empty.
            -- (from ARRAY)
        require -- from COLLECTION
            prunable
        do
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Conversion

    arrayed: ARRAY [ANY] is
            -- Items of Current as array
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    boolean_arrayed: ARRAY [BOOLEAN] is
            -- Items of Current as array
        require
            is_uniform_boolean: is_uniform_boolean
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (boolean_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    character_arrayed: ARRAY [CHARACTER] is
            -- Items of Current as array
        require
            is_uniform_character: is_uniform_character
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (character_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    double_arrayed: ARRAY [DOUBLE] is
            -- Items of Current as array
        require
            convertible: convertible_to_double
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (double_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    integer_arrayed: ARRAY [INTEGER] is
            -- Items of Current as array
        require
            is_uniform_integer: is_uniform_integer
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (integer_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    linear_representation: LINEAR [ANY] is
            -- Representation as a linear structure
            -- (from ARRAY)
        local
            temp: ARRAYED_LIST [ANY]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := lower
            until
                i > upper
            loop
                temp.extend (item (i))
                i := i + 1
            end
            Result := temp
        end

    pointer_arrayed: ARRAY [POINTER] is
            -- Items of Current as array
        require
            is_uniform_pointer: is_uniform_pointer
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (pointer_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    real_arrayed: ARRAY [REAL] is
            -- Items of Current as array
        require
            convertible: convertible_to_real
        local
            i, cnt: INTEGER
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                Result.put (real_item (i), i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    string_arrayed: ARRAY [STRING] is
            -- Items of Current as array
            -- NOTE: Items with a type not cconforming to
            --       type STRING are set to Void.
        local
            i, cnt: INTEGER
            s: STRING
        do
            from
                i := 1
                cnt := count
                create Result.make (1, cnt)
            until
                i > cnt
            loop
                s ?= item (i)
                Result.put (s, i)
                i := i + 1
            end
        ensure
            exists: Result /= void
            same_count: Result.count = count
        end

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: ANY) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    extend (v: ANY) is
            -- Add v to structure.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    prune (v: ANY) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {NONE} -- Implementation

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    eif_gen_count (obj: POINTER): INTEGER is
            -- Number of generic parameters of obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_is_uniform (obj: POINTER; code: CHARACTER): BOOLEAN is
            -- Are all items in obj of type code?
        external
            "C | %"eif_gen_conf.h%""
        end

    eif_gen_typecode (obj: POINTER; pos: INTEGER): CHARACTER is
            -- Code for generic parameter pos in obj.
        external
            "C | %"eif_gen_conf.h%""
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

feature {ARRAY} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

feature {ROUTINE}

    arg_item_code (index: INTEGER): CHARACTER is
            -- Type code of item at index. Used for
            -- argument processing in ROUTINE
        require
            valid_index: valid_index (index)
        do
            Result := eif_gen_typecode ($Current, index)
        end

feature -- Creation

    make is
        do
            array_make (1, eif_gen_count ($Current))
        end

feature -- Type conversion queries

    convertible_to_double: BOOLEAN is
            -- Is current convertible to an array of doubles?
        local
            i, cnt: INTEGER
            tcode: CHARACTER
        do
            Result := True
            from
                i := 1
                cnt := count
            until
                i > cnt or else not Result
            loop
                tcode := eif_gen_typecode ($Current, i)
                Result := (tcode = 'i') or else (tcode = 'f') or else (tcode = 'd')
                i := i + 1
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    convertible_to_real: BOOLEAN is
            -- Is current convertible to an array of reals?
        local
            i, cnt: INTEGER
            tcode: CHARACTER
        do
            Result := True
            from
                i := 1
                cnt := count
            until
                i > cnt or else not Result
            loop
                tcode := eif_gen_typecode ($Current, i)
                Result := (tcode = 'i') or else (tcode = 'f')
                i := i + 1
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

feature -- Type queries

    is_boolean_item (index: INTEGER): BOOLEAN is
            -- Is item at index a BOOLEAN?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'b')
        end

    is_character_item (index: INTEGER): BOOLEAN is
            -- Is item at index a CHARACTER?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'c')
        end

    is_double_item (index: INTEGER): BOOLEAN is
            -- Is item at index a DOUBLE?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'd')
        end

    is_integer_item (index: INTEGER): BOOLEAN is
            -- Is item at index an INTEGER?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'i')
        end

    is_numeric_item (index: INTEGER): BOOLEAN is
            -- Is item at index a number?
        require
            valid_index: valid_index (index)
        local
            tcode: CHARACTER
        do
            tcode := eif_gen_typecode ($Current, index)
            Result := (tcode = 'i') or else (tcode = 'f') or else (tcode = 'd')
        end

    is_pointer_item (index: INTEGER): BOOLEAN is
            -- Is item at index a POINTER?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'p')
        end

    is_real_item (index: INTEGER): BOOLEAN is
            -- Is item at index a REAL?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'f')
        end

    is_reference_item (index: INTEGER): BOOLEAN is
            -- Is item at index a REFERENCE?
        require
            valid_index: valid_index (index)
        do
            Result := (eif_gen_typecode ($Current, index) = 'r')
        end

    is_uniform: BOOLEAN is
            -- Are all items of the same basic type or all of reference type?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, '?')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_boolean: BOOLEAN is
            -- Are all items of type BOOLEAN?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'b')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_character: BOOLEAN is
            -- Are all items of type CHARACTER?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'c')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_double: BOOLEAN is
            -- Are all items of type DOUBLE?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'd')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_integer: BOOLEAN is
            -- Are all items of type INTEGER?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'i')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_pointer: BOOLEAN is
            -- Are all items of type POINTER?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'p')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_real: BOOLEAN is
            -- Are all items of type REAL?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'f')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

    is_uniform_reference: BOOLEAN is
            -- Are all items of reference type?
        do
            if count > 0 then
                Result := eif_gen_is_uniform ($Current, 'r')
            else
                Result := True
            end
        ensure
            yes_if_empty: (count = 0) implies Result
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TUPLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of TUPLE"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    TUPLE

create

    make

feature -- Initialization

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [ANY])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    area: SPECIAL [ANY]
            -- Special data zone
            -- (from TO_SPECIAL)

    boolean_item (index: INTEGER): BOOLEAN
            -- Boolean item at index.
        require
            valid_index: valid_index (index)
            is_boolean: is_boolean_item (index)

    character_item (index: INTEGER): CHARACTER
            -- Character item at index.
        require
            valid_index: valid_index (index)
            is_character: is_character_item (index)

    double_item (index: INTEGER): DOUBLE
            -- Double item at index.
        require
            valid_index: valid_index (index)
            is_numeric: is_numeric_item (index)

    entry (i: INTEGER): ANY
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: ANY): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    integer_item (index: INTEGER): INTEGER
            -- Integer item at index.
        require
            valid_index: valid_index (index)
            is_integer: is_integer_item (index)

    item (i: INTEGER): ANY
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    pointer_item (index: INTEGER): POINTER
            -- Pointer item at index.
        require
            valid_index: valid_index (index)
            is_pointer: is_pointer_item (index)

    real_item (index: INTEGER): REAL
            -- real item at index.
        require
            valid_index: valid_index (index)
            is_real_or_integer: is_real_item (index) or else is_integer_item (index)

    infix "@" (i: INTEGER): ANY
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: ANY): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: ANY): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [ANY])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: ANY)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    arrayed: ARRAY [ANY]
            -- Items of Current as array
        ensure
            exists: Result /= void
            same_count: Result.count = count

    boolean_arrayed: ARRAY [BOOLEAN]
            -- Items of Current as array
        require
            is_uniform_boolean: is_uniform_boolean
        ensure
            exists: Result /= void
            same_count: Result.count = count

    character_arrayed: ARRAY [CHARACTER]
            -- Items of Current as array
        require
            is_uniform_character: is_uniform_character
        ensure
            exists: Result /= void
            same_count: Result.count = count

    double_arrayed: ARRAY [DOUBLE]
            -- Items of Current as array
        require
            convertible: convertible_to_double
        ensure
            exists: Result /= void
            same_count: Result.count = count

    integer_arrayed: ARRAY [INTEGER]
            -- Items of Current as array
        require
            is_uniform_integer: is_uniform_integer
        ensure
            exists: Result /= void
            same_count: Result.count = count

    linear_representation: LINEAR [ANY]
            -- Representation as a linear structure
            -- (from ARRAY)

    pointer_arrayed: ARRAY [POINTER]
            -- Items of Current as array
        require
            is_uniform_pointer: is_uniform_pointer
        ensure
            exists: Result /= void
            same_count: Result.count = count

    real_arrayed: ARRAY [REAL]
            -- Items of Current as array
        require
            convertible: convertible_to_real
        ensure
            exists: Result /= void
            same_count: Result.count = count

    string_arrayed: ARRAY [STRING]
            -- Items of Current as array
            -- NOTE: Items with a type not cconforming to
            --       type STRING are set to Void.
        ensure
            exists: Result /= void
            same_count: Result.count = count

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Creation

    make

feature -- Type conversion queries

    convertible_to_double: BOOLEAN
            -- Is current convertible to an array of doubles?
        ensure
            yes_if_empty: (count = 0) implies Result

    convertible_to_real: BOOLEAN
            -- Is current convertible to an array of reals?
        ensure
            yes_if_empty: (count = 0) implies Result

feature -- Type queries

    is_boolean_item (index: INTEGER): BOOLEAN
            -- Is item at index a BOOLEAN?
        require
            valid_index: valid_index (index)

    is_character_item (index: INTEGER): BOOLEAN
            -- Is item at index a CHARACTER?
        require
            valid_index: valid_index (index)

    is_double_item (index: INTEGER): BOOLEAN
            -- Is item at index a DOUBLE?
        require
            valid_index: valid_index (index)

    is_integer_item (index: INTEGER): BOOLEAN
            -- Is item at index an INTEGER?
        require
            valid_index: valid_index (index)

    is_numeric_item (index: INTEGER): BOOLEAN
            -- Is item at index a number?
        require
            valid_index: valid_index (index)

    is_pointer_item (index: INTEGER): BOOLEAN
            -- Is item at index a POINTER?
        require
            valid_index: valid_index (index)

    is_real_item (index: INTEGER): BOOLEAN
            -- Is item at index a REAL?
        require
            valid_index: valid_index (index)

    is_reference_item (index: INTEGER): BOOLEAN
            -- Is item at index a REFERENCE?
        require
            valid_index: valid_index (index)

    is_uniform: BOOLEAN
            -- Are all items of the same basic type or all of reference type?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_boolean: BOOLEAN
            -- Are all items of type BOOLEAN?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_character: BOOLEAN
            -- Are all items of type CHARACTER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_double: BOOLEAN
            -- Are all items of type DOUBLE?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_integer: BOOLEAN
            -- Are all items of type INTEGER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_pointer: BOOLEAN
            -- Are all items of type POINTER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_real: BOOLEAN
            -- Are all items of type REAL?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_reference: BOOLEAN
            -- Are all items of reference type?
        ensure
            yes_if_empty: (count = 0) implies Result

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TUPLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TUPLE

Ancestors
    ARRAY [G]

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    DIRECTORY
    LINEAR [G]
    LINEAR_ITERATOR [G]
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    TUPLE

Suppliers
    ARRAY [G]
    BOOLEAN
    BOOLEAN_REF
    CHARACTER_REF
    DOUBLE_REF
    INTEGER
    INTEGER_REF
    POINTER_REF
    REAL_REF
    TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TUPLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Implementation of TUPLE"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    TUPLE

create
    make

feature -- Creation

    make

feature -- Type queries

    is_boolean_item (index: INTEGER): BOOLEAN
            -- Is item at index a BOOLEAN?
        require
            valid_index: valid_index (index)

    is_character_item (index: INTEGER): BOOLEAN
            -- Is item at index a CHARACTER?
        require
            valid_index: valid_index (index)

    is_double_item (index: INTEGER): BOOLEAN
            -- Is item at index a DOUBLE?
        require
            valid_index: valid_index (index)

    is_integer_item (index: INTEGER): BOOLEAN
            -- Is item at index an INTEGER?
        require
            valid_index: valid_index (index)

    is_pointer_item (index: INTEGER): BOOLEAN
            -- Is item at index a POINTER?
        require
            valid_index: valid_index (index)

    is_real_item (index: INTEGER): BOOLEAN
            -- Is item at index a REAL?
        require
            valid_index: valid_index (index)

    is_reference_item (index: INTEGER): BOOLEAN
            -- Is item at index a REFERENCE?
        require
            valid_index: valid_index (index)

    is_numeric_item (index: INTEGER): BOOLEAN
            -- Is item at index a number?
        require
            valid_index: valid_index (index)

    is_uniform: BOOLEAN
            -- Are all items of the same basic type or all of reference type?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_boolean: BOOLEAN
            -- Are all items of type BOOLEAN?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_character: BOOLEAN
            -- Are all items of type CHARACTER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_double: BOOLEAN
            -- Are all items of type DOUBLE?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_integer: BOOLEAN
            -- Are all items of type INTEGER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_pointer: BOOLEAN
            -- Are all items of type POINTER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_real: BOOLEAN
            -- Are all items of type REAL?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_reference: BOOLEAN
            -- Are all items of reference type?
        ensure
            yes_if_empty: (count = 0) implies Result

feature -- Type conversion queries

    convertible_to_double: BOOLEAN
            -- Is current convertible to an array of doubles?
        ensure
            yes_if_empty: (count = 0) implies Result

    convertible_to_real: BOOLEAN
            -- Is current convertible to an array of reals?
        ensure
            yes_if_empty: (count = 0) implies Result

feature -- Access

    boolean_item (index: INTEGER): BOOLEAN
            -- Boolean item at index.
        require
            valid_index: valid_index (index)
            is_boolean: is_boolean_item (index)

    character_item (index: INTEGER): CHARACTER
            -- Character item at index.
        require
            valid_index: valid_index (index)
            is_character: is_character_item (index)

    double_item (index: INTEGER): DOUBLE
            -- Double item at index.
        require
            valid_index: valid_index (index)
            is_numeric: is_numeric_item (index)

    integer_item (index: INTEGER): INTEGER
            -- Integer item at index.
        require
            valid_index: valid_index (index)
            is_integer: is_integer_item (index)

    pointer_item (index: INTEGER): POINTER
            -- Pointer item at index.
        require
            valid_index: valid_index (index)
            is_pointer: is_pointer_item (index)

    real_item (index: INTEGER): REAL
            -- real item at index.
        require
            valid_index: valid_index (index)
            is_real_or_integer: is_real_item (index) or else is_integer_item (index)

feature -- Conversion

    arrayed: ARRAY [ANY]
            -- Items of Current as array
        ensure
            exists: Result /= void
            same_count: Result.count = count

    boolean_arrayed: ARRAY [BOOLEAN]
            -- Items of Current as array
        require
            is_uniform_boolean: is_uniform_boolean
        ensure
            exists: Result /= void
            same_count: Result.count = count

    character_arrayed: ARRAY [CHARACTER]
            -- Items of Current as array
        require
            is_uniform_character: is_uniform_character
        ensure
            exists: Result /= void
            same_count: Result.count = count

    double_arrayed: ARRAY [DOUBLE]
            -- Items of Current as array
        require
            convertible: convertible_to_double
        ensure
            exists: Result /= void
            same_count: Result.count = count

    integer_arrayed: ARRAY [INTEGER]
            -- Items of Current as array
        require
            is_uniform_integer: is_uniform_integer
        ensure
            exists: Result /= void
            same_count: Result.count = count

    pointer_arrayed: ARRAY [POINTER]
            -- Items of Current as array
        require
            is_uniform_pointer: is_uniform_pointer
        ensure
            exists: Result /= void
            same_count: Result.count = count

    real_arrayed: ARRAY [REAL]
            -- Items of Current as array
        require
            convertible: convertible_to_real
        ensure
            exists: Result /= void
            same_count: Result.count = count

    string_arrayed: ARRAY [STRING]
            -- Items of Current as array
            -- NOTE: Items with a type not cconforming to
            --       type STRING are set to Void.
        ensure
            exists: Result /= void
            same_count: Result.count = count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_FILE_INFO Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Internal file information"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    UNIX_FILE_INFO

inherit
    TO_SPECIAL [CHARACTER]
        rename
            area as buffered_file_info,
            make_area as make_buffered_file_info
        end

create
    make

feature -- Initialization

    make is
            -- Creation procedure
        do
            make_buffered_file_info (stat_size)
        end

feature -- Access

    protection: INTEGER is
            -- Protection mode of file (12 lower bits)
        do
            Result := file_info ($buffered_file_info, 0)
        end

    type: INTEGER is
            -- File type (4 bits, 12 lowest bits zeroed)
        do
            Result := file_info ($buffered_file_info, 11)
        end

    inode: INTEGER is
            -- Inode number
        do
            Result := file_info ($buffered_file_info, 1)
        end

    size: INTEGER is
            -- File size, in bytes
        do
            Result := file_info ($buffered_file_info, 6)
        end

    user_id: INTEGER is
            -- UID of the file owner
        do
            Result := file_info ($buffered_file_info, 4)
        end

    group_id: INTEGER is
            -- GID of the file
        do
            Result := file_info ($buffered_file_info, 5)
        end

    date: INTEGER is
            -- Last modification date
        do
            Result := file_info ($buffered_file_info, 7)
        end

    access_date: INTEGER is
            -- Date of last access
        do
            Result := file_info ($buffered_file_info, 8)
        end

    change_date: INTEGER is
            -- Date of last status change
        do
            Result := file_info ($buffered_file_info, 9)
        end

    device: INTEGER is
            -- Device number on which inode resides
        do
            Result := file_info ($buffered_file_info, 2)
        end

    device_type: INTEGER is
            -- Device type on which inode resides
        do
            Result := file_info ($buffered_file_info, 3)
        end

    links: INTEGER is
            -- Number of links
        do
            Result := file_info ($buffered_file_info, 10)
        end

    owner_name: STRING is
            -- Name of the file owner, if available from /etc/passwd.
            -- Otherwise, the UID
        do
            Result := file_owner (user_id)
        end

    group_name: STRING is
            -- Name of the file group, if available from /etc/group.
            -- Otherwise, the GID
        do
            Result := file_group (group_id)
        end

    file_name: STRING
            -- File name to which information applies.

feature -- Status report

    is_plain: BOOLEAN is
            -- Is file a plain file?
        do
            Result := file_info ($buffered_file_info, 13) /= 0
        end

    is_device: BOOLEAN is
            -- Is file a device?
        do
            Result := file_info ($buffered_file_info, 14) /= 0
        end

    is_directory: BOOLEAN is
            -- Is file a directory?
        do
            Result := file_info ($buffered_file_info, 12) /= 0
        end

    is_symlink: BOOLEAN is
            -- Is file a symbolic link?
        do
            Result := file_info ($buffered_file_info, 18) /= 0
        end

    is_fifo: BOOLEAN is
            -- Is file a named pipe?
        do
            Result := file_info ($buffered_file_info, 17) /= 0
        end

    is_socket: BOOLEAN is
            -- Is file a named socket?
        do
            Result := file_info ($buffered_file_info, 19) /= 0
        end

    is_block: BOOLEAN is
            -- Is file a device block special file?
        do
            Result := file_info ($buffered_file_info, 16) /= 0
        end

    is_character: BOOLEAN is
            -- Is file a character block special file?
        do
            Result := file_info ($buffered_file_info, 15) /= 0
        end

    is_readable: BOOLEAN is
            -- Is file readable by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 0)
        end

    is_writable: BOOLEAN is
            -- Is file writable by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 1)
        end

    is_executable: BOOLEAN is
            -- Is file executable by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 2)
        end

    is_setuid: BOOLEAN is
            -- Is file setuid?
        do
            Result := file_eaccess ($buffered_file_info, 3)
        end

    is_setgid: BOOLEAN is
            -- Is file setgid?
        do
            Result := file_eaccess ($buffered_file_info, 4)
        end

    is_sticky: BOOLEAN is
            -- Is file sticky?
        do
            Result := file_eaccess ($buffered_file_info, 5)
        end

    is_owner: BOOLEAN is
            -- Is file owned by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 6)
        end

    is_access_owner: BOOLEAN is
            -- Is file owned by real UID?
        do
            Result := file_eaccess ($buffered_file_info, 7)
        end

    is_access_readable: BOOLEAN is
            -- Is file readable by real UID?
        local
            ext_name: ANY
        do
            ext_name := file_name.to_c
            Result := file_access ($ext_name, 3)
        end

    is_access_writable: BOOLEAN is
            -- Is file writable by real UID?
        local
            ext_name: ANY
        do
            ext_name := file_name.to_c
            Result := file_access ($ext_name, 2)
        end

    is_access_executable: BOOLEAN is
            -- Is file executable by real UID?
        local
            ext_name: ANY
        do
            ext_name := file_name.to_c
            Result := file_access ($ext_name, 1)
        end

feature -- Element change

    update (f_name: STRING) is
            -- Update information buffer: fill it in with information
            -- from the inode of f_name.
        local
            ext_name: ANY
        do
            ext_name := f_name.to_c
            file_stat ($ext_name, $buffered_file_info)
            file_name := f_name
        end

feature {NONE} -- Implementation

    stat_size: INTEGER is
            -- Get size of 'struct stat' (in bytes)
        external
            "C | %"eif_file.h%""
        end

    file_stat (name, stat_buf: POINTER) is
            -- Get information from file name into stat_buf
        external
            "C (char *, struct stat *) | %"eif_file.h%""
        end

    file_access (f_name: ANY; which: INTEGER): BOOLEAN is
            -- Perform access test which on f_name using real ID.
        external
            "C (char *, EIF_INTEGER): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_eaccess (stat_buf: POINTER; which: INTEGER): BOOLEAN is
            -- Perform access tests using effective ID.
        external
            "C (struct stat *, EIF_INTEGER): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_info (stat_buf: POINTER; which: INTEGER): INTEGER is
            -- Extract information which from information buffer
        external
            "C (struct stat *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_owner (uid: INTEGER): STRING is
            -- Convert UID to login name if possible
        external
            "C | %"eif_file.h%""
        end

    file_group (gid: INTEGER): STRING is
            -- Convert GID to group name if possible
        external
            "C | %"eif_file.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_FILE_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_FILE_INFO Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    UNIX_FILE_INFO

General
    cluster: base.kernel
    description: "Internal file information"
    create: make

Ancestors
    TO_SPECIAL [T]

Queries
    access_date: INTEGER
    buffered_file_info: SPECIAL [CHARACTER]
    change_date: INTEGER
    date: INTEGER
    device: INTEGER
    device_type: INTEGER
    file_name: STRING
    group_id: INTEGER
    group_name: STRING
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    links: INTEGER
    owner_name: STRING
    protection: INTEGER
    size: INTEGER
    type: INTEGER
    user_id: INTEGER

Commands
    make
    update (f_name: STRING)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_FILE_INFO Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Internal file information"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    UNIX_FILE_INFO

create
    make

feature -- Initialization

    make is
            -- Creation procedure
        do
            make_buffered_file_info (stat_size)
        end

feature {NONE} -- Initialization

    make_buffered_file_info (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create buffered_file_info.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: buffered_file_info /= void and then buffered_file_info.count = n
        end

feature -- Access

    access_date: INTEGER is
            -- Date of last access
        do
            Result := file_info ($buffered_file_info, 8)
        end

    buffered_file_info: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    change_date: INTEGER is
            -- Date of last status change
        do
            Result := file_info ($buffered_file_info, 9)
        end

    date: INTEGER is
            -- Last modification date
        do
            Result := file_info ($buffered_file_info, 7)
        end

    device: INTEGER is
            -- Device number on which inode resides
        do
            Result := file_info ($buffered_file_info, 2)
        end

    device_type: INTEGER is
            -- Device type on which inode resides
        do
            Result := file_info ($buffered_file_info, 3)
        end

    file_name: STRING
            -- File name to which information applies.

    group_id: INTEGER is
            -- GID of the file
        do
            Result := file_info ($buffered_file_info, 5)
        end

    group_name: STRING is
            -- Name of the file group, if available from /etc/group.
            -- Otherwise, the GID
        do
            Result := file_group (group_id)
        end

    inode: INTEGER is
            -- Inode number
        do
            Result := file_info ($buffered_file_info, 1)
        end

    links: INTEGER is
            -- Number of links
        do
            Result := file_info ($buffered_file_info, 10)
        end

    owner_name: STRING is
            -- Name of the file owner, if available from /etc/passwd.
            -- Otherwise, the UID
        do
            Result := file_owner (user_id)
        end

    protection: INTEGER is
            -- Protection mode of file (12 lower bits)
        do
            Result := file_info ($buffered_file_info, 0)
        end

    size: INTEGER is
            -- File size, in bytes
        do
            Result := file_info ($buffered_file_info, 6)
        end

    type: INTEGER is
            -- File type (4 bits, 12 lowest bits zeroed)
        do
            Result := file_info ($buffered_file_info, 11)
        end

    user_id: INTEGER is
            -- UID of the file owner
        do
            Result := file_info ($buffered_file_info, 4)
        end

feature -- Status report

    is_access_executable: BOOLEAN is
            -- Is file executable by real UID?
        local
            ext_name: ANY
        do
            ext_name := file_name.to_c
            Result := file_access ($ext_name, 1)
        end

    is_access_owner: BOOLEAN is
            -- Is file owned by real UID?
        do
            Result := file_eaccess ($buffered_file_info, 7)
        end

    is_access_readable: BOOLEAN is
            -- Is file readable by real UID?
        local
            ext_name: ANY
        do
            ext_name := file_name.to_c
            Result := file_access ($ext_name, 3)
        end

    is_access_writable: BOOLEAN is
            -- Is file writable by real UID?
        local
            ext_name: ANY
        do
            ext_name := file_name.to_c
            Result := file_access ($ext_name, 2)
        end

    is_block: BOOLEAN is
            -- Is file a device block special file?
        do
            Result := file_info ($buffered_file_info, 16) /= 0
        end

    is_character: BOOLEAN is
            -- Is file a character block special file?
        do
            Result := file_info ($buffered_file_info, 15) /= 0
        end

    is_device: BOOLEAN is
            -- Is file a device?
        do
            Result := file_info ($buffered_file_info, 14) /= 0
        end

    is_directory: BOOLEAN is
            -- Is file a directory?
        do
            Result := file_info ($buffered_file_info, 12) /= 0
        end

    is_executable: BOOLEAN is
            -- Is file executable by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 2)
        end

    is_fifo: BOOLEAN is
            -- Is file a named pipe?
        do
            Result := file_info ($buffered_file_info, 17) /= 0
        end

    is_owner: BOOLEAN is
            -- Is file owned by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 6)
        end

    is_plain: BOOLEAN is
            -- Is file a plain file?
        do
            Result := file_info ($buffered_file_info, 13) /= 0
        end

    is_readable: BOOLEAN is
            -- Is file readable by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 0)
        end

    is_setgid: BOOLEAN is
            -- Is file setgid?
        do
            Result := file_eaccess ($buffered_file_info, 4)
        end

    is_setuid: BOOLEAN is
            -- Is file setuid?
        do
            Result := file_eaccess ($buffered_file_info, 3)
        end

    is_socket: BOOLEAN is
            -- Is file a named socket?
        do
            Result := file_info ($buffered_file_info, 19) /= 0
        end

    is_sticky: BOOLEAN is
            -- Is file sticky?
        do
            Result := file_eaccess ($buffered_file_info, 5)
        end

    is_symlink: BOOLEAN is
            -- Is file a symbolic link?
        do
            Result := file_info ($buffered_file_info, 18) /= 0
        end

    is_writable: BOOLEAN is
            -- Is file writable by effective UID?
        do
            Result := file_eaccess ($buffered_file_info, 1)
        end

feature -- Element change

    update (f_name: STRING) is
            -- Update information buffer: fill it in with information
            -- from the inode of f_name.
        local
            ext_name: ANY
        do
            ext_name := f_name.to_c
            file_stat ($ext_name, $buffered_file_info)
            file_name := f_name
        end

feature {NONE} -- Element change

    set_area (other: like buffered_file_info) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            buffered_file_info := other
        end

feature {NONE} -- Implementation

    file_access (f_name: ANY; which: INTEGER): BOOLEAN is
            -- Perform access test which on f_name using real ID.
        external
            "C (char *, EIF_INTEGER): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_eaccess (stat_buf: POINTER; which: INTEGER): BOOLEAN is
            -- Perform access tests using effective ID.
        external
            "C (struct stat *, EIF_INTEGER): EIF_BOOLEAN | %"eif_file.h%""
        end

    file_group (gid: INTEGER): STRING is
            -- Convert GID to group name if possible
        external
            "C | %"eif_file.h%""
        end

    file_info (stat_buf: POINTER; which: INTEGER): INTEGER is
            -- Extract information which from information buffer
        external
            "C (struct stat *, EIF_INTEGER): EIF_INTEGER | %"eif_file.h%""
        end

    file_owner (uid: INTEGER): STRING is
            -- Convert UID to login name if possible
        external
            "C | %"eif_file.h%""
        end

    file_stat (name, stat_buf: POINTER) is
            -- Get information from file name into stat_buf
        external
            "C (char *, struct stat *) | %"eif_file.h%""
        end

    stat_size: INTEGER is
            -- Get size of 'struct stat' (in bytes)
        external
            "C | %"eif_file.h%""
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_FILE_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_FILE_INFO Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Internal file information"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_FILE_INFO

create

    make
            -- Creation procedure

feature -- Initialization

    make
            -- Creation procedure

feature -- Access

    access_date: INTEGER
            -- Date of last access

    buffered_file_info: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    change_date: INTEGER
            -- Date of last status change

    date: INTEGER
            -- Last modification date

    device: INTEGER
            -- Device number on which inode resides

    device_type: INTEGER
            -- Device type on which inode resides

    file_name: STRING
            -- File name to which information applies.

    group_id: INTEGER
            -- GID of the file

    group_name: STRING
            -- Name of the file group, if available from /etc/group.
            -- Otherwise, the GID

    inode: INTEGER
            -- Inode number

    links: INTEGER
            -- Number of links

    owner_name: STRING
            -- Name of the file owner, if available from /etc/passwd.
            -- Otherwise, the UID

    protection: INTEGER
            -- Protection mode of file (12 lower bits)

    size: INTEGER
            -- File size, in bytes

    type: INTEGER
            -- File type (4 bits, 12 lowest bits zeroed)

    user_id: INTEGER
            -- UID of the file owner

feature -- Status report

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?

    is_block: BOOLEAN
            -- Is file a device block special file?

    is_character: BOOLEAN
            -- Is file a character block special file?

    is_device: BOOLEAN
            -- Is file a device?

    is_directory: BOOLEAN
            -- Is file a directory?

    is_executable: BOOLEAN
            -- Is file executable by effective UID?

    is_fifo: BOOLEAN
            -- Is file a named pipe?

    is_owner: BOOLEAN
            -- Is file owned by effective UID?

    is_plain: BOOLEAN
            -- Is file a plain file?

    is_readable: BOOLEAN
            -- Is file readable by effective UID?

    is_setgid: BOOLEAN
            -- Is file setgid?

    is_setuid: BOOLEAN
            -- Is file setuid?

    is_socket: BOOLEAN
            -- Is file a named socket?

    is_sticky: BOOLEAN
            -- Is file sticky?

    is_symlink: BOOLEAN
            -- Is file a symbolic link?

    is_writable: BOOLEAN
            -- Is file writable by effective UID?

feature -- Element change

    update (f_name: STRING)
            -- Update information buffer: fill it in with information
            -- from the inode of f_name.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_FILE_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_FILE_INFO Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    UNIX_FILE_INFO

Ancestors
    TO_SPECIAL [T]

Clients
    FILE
    UNIX_FILE_INFO

Suppliers
    STRING
    UNIX_FILE_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_FILE_INFO Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Internal file information"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_FILE_INFO

create
    make

feature -- Initialization

    make
            -- Creation procedure

feature -- Access

    protection: INTEGER
            -- Protection mode of file (12 lower bits)

    type: INTEGER
            -- File type (4 bits, 12 lowest bits zeroed)

    inode: INTEGER
            -- Inode number

    size: INTEGER
            -- File size, in bytes

    user_id: INTEGER
            -- UID of the file owner

    group_id: INTEGER
            -- GID of the file

    date: INTEGER
            -- Last modification date

    access_date: INTEGER
            -- Date of last access

    change_date: INTEGER
            -- Date of last status change

    device: INTEGER
            -- Device number on which inode resides

    device_type: INTEGER
            -- Device type on which inode resides

    links: INTEGER
            -- Number of links

    owner_name: STRING
            -- Name of the file owner, if available from /etc/passwd.
            -- Otherwise, the UID

    group_name: STRING
            -- Name of the file group, if available from /etc/group.
            -- Otherwise, the GID

    file_name: STRING
            -- File name to which information applies.

feature -- Status report

    is_plain: BOOLEAN
            -- Is file a plain file?

    is_device: BOOLEAN
            -- Is file a device?

    is_directory: BOOLEAN
            -- Is file a directory?

    is_symlink: BOOLEAN
            -- Is file a symbolic link?

    is_fifo: BOOLEAN
            -- Is file a named pipe?

    is_socket: BOOLEAN
            -- Is file a named socket?

    is_block: BOOLEAN
            -- Is file a device block special file?

    is_character: BOOLEAN
            -- Is file a character block special file?

    is_readable: BOOLEAN
            -- Is file readable by effective UID?

    is_writable: BOOLEAN
            -- Is file writable by effective UID?

    is_executable: BOOLEAN
            -- Is file executable by effective UID?

    is_setuid: BOOLEAN
            -- Is file setuid?

    is_setgid: BOOLEAN
            -- Is file setgid?

    is_sticky: BOOLEAN
            -- Is file sticky?

    is_owner: BOOLEAN
            -- Is file owned by effective UID?

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?

feature -- Element change

    update (f_name: STRING)
            -- Update information buffer: fill it in with information
            -- from the inode of f_name.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_FILE_INFO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_SIGNALS Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for signal handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    UNIX_SIGNALS

feature -- Access

    meaning (sig: INTEGER): STRING is
            -- A message in English describing what sig is
        do
            if is_defined (sig) then
                create Result.make_from_c (c_signal_name (sig))
            end
        end

    is_defined (sig: INTEGER): BOOLEAN is
            -- Is sig a signal defined for this platform?
        external
            "C | %"eif_sig.h%""
        alias
            "esigdefined"
        end

    is_ignored (sig: INTEGER): BOOLEAN is
            -- Is sig currently set to be ignored?
        do
            Result := not is_caught (sig)
        end

    sighup: INTEGER is
            -- Code for `Hangup' signal
        once
            Result := c_signal_map (1)
        end

    sigint: INTEGER is
            -- Code for `Interrupt' signal
        once
            Result := c_signal_map (2)
        end

    sigquit: INTEGER is
            -- Code for `Quit' signal
        once
            Result := c_signal_map (3)
        end

    sigill: INTEGER is
            -- Code for ``Illegal instruction'' signal
        once
            Result := c_signal_map (4)
        end

    sigtrap: INTEGER is
            -- Code for ``Trace trap'' signal
        once
            Result := c_signal_map (5)
        end

    sigabrt: INTEGER is
            -- Code for `Abort' signal
        once
            Result := c_signal_map (6)
        end

    sigiot: INTEGER is
            -- Code for ``IOT instruction'' signal
        once
            Result := c_signal_map (7)
        end

    sigemt: INTEGER is
            -- Code for ``EMT instruction'' signal
        once
            Result := c_signal_map (8)
        end

    sigfpe: INTEGER is
            -- Code for ``Floating point exception'' signal
        once
            Result := c_signal_map (9)
        end

    sigkill: INTEGER is
            -- Code for `Terminator' signal
        once
            Result := c_signal_map (10)
        end

    sigbus: INTEGER is
            -- Code for ``Bus error'' signal
        once
            Result := c_signal_map (11)
        end

    sigsegv: INTEGER is
            -- Code for ``Segmentation violation'' signal
        once
            Result := c_signal_map (12)
        end

    sigsys: INTEGER is
            -- Code for ``Bad argument to system call'' signal
        once
            Result := c_signal_map (13)
        end

    sigpipe: INTEGER is
            -- Code for ``Broken pipe'' signal
        once
            Result := c_signal_map (14)
        end

    sigalrm: INTEGER is
            -- Code for ``Alarm clock'' signal
        once
            Result := c_signal_map (15)
        end

    sigterm: INTEGER is
            -- Code for ``Software termination'' signal
        once
            Result := c_signal_map (16)
        end

    sigusr1: INTEGER is
            -- Code for ``User-defined signal #1''
        once
            Result := c_signal_map (17)
        end

    sigusr2: INTEGER is
            -- Code for ``User-defined signal #2''
        once
            Result := c_signal_map (18)
        end

    sigchld: INTEGER is
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (19)
        end

    sigcld: INTEGER is
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (20)
        end

    sigio: INTEGER is
            -- Code for ``Pending I/O on a descriptor'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (21)
        end

    sigpoll: INTEGER is
            -- Code for ``Selectable event pending'' signal
        once
            Result := c_signal_map (22)
        end

    sigttin: INTEGER is
            -- Code for ``Tty input from background'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (23)
        end

    sigttou: INTEGER is
            -- Code for ``Tty output from background'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (24)
        end

    sigstop: INTEGER is
            -- Code for `Stop' signal
        once
            Result := c_signal_map (25)
        end

    sigtstp: INTEGER is
            -- Code for ``Stop from tty'' signal
        once
            Result := c_signal_map (26)
        end

    sigxcpu: INTEGER is
            -- Code for ``Cpu time limit exceeded'' signal
        once
            Result := c_signal_map (27)
        end

    sigxfsz: INTEGER is
            -- Code for ``File size limit exceeded'' signal
        once
            Result := c_signal_map (28)
        end

    sigvtalarm: INTEGER is
            -- Code for ``Virtual time alarm'' signal
        once
            Result := c_signal_map (29)
        end

    sigpwr: INTEGER is
            -- Code for `Power-fail' signal
        once
            Result := c_signal_map (30)
        end

    sigprof: INTEGER is
            -- Code for ``Profiling timer alarm'' signal
        once
            Result := c_signal_map (31)
        end

    sigwinch: INTEGER is
            -- Code for ``Window size changed'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (32)
        end

    sigwind: INTEGER is
            -- Code for ``Window change'' signal
        once
            Result := c_signal_map (33)
        end

    sigphone: INTEGER is
            -- Code for ``Line status change'' signal
        once
            Result := c_signal_map (34)
        end

    siglost: INTEGER is
            -- Code for ``Resource lost'' signal
        once
            Result := c_signal_map (35)
        end

    sigurg: INTEGER is
            -- Code for ``Urgent condition on socket'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (36)
        end

    sigcont: INTEGER is
            -- Code for ``Continue after stop'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (37)
        end

feature -- Status report

    signal: INTEGER is
            -- Code of last signal
        external
            "C | %"eif_sig.h%""
        alias
            "esignum"
        end

feature -- Status setting

    catch (sig: INTEGER) is
            -- Make sure that future occurrences of sig
            -- will be treated as exceptions.
            -- (This is the default for all signals.)
            -- No effect if signal not defined.
        external
            "C | %"eif_sig.h%""
        alias
            "esigcatch"
        end

    ignore (sig: INTEGER) is
            -- Make sure that future occurrences of sig
            -- will be ignored. (This is not the default.)
            -- No effect if signal not defined.
        external
            "C | %"eif_sig.h%""
        alias
            "esigignore"
        end

    reset_all_default is
            -- Make sure that all exceptions will lead to their
            -- default handling.
        external
            "C | %"eif_sig.h%""
        alias
            "esigresall"
        end

    reset_default (sig: INTEGER) is
            -- Make sure that exception of code code will lead
            -- to its default action.
        require
            is_defined (sig)
        external
            "C | %"eif_sig.h%""
        alias
            "esigresdef"
        end

feature {NONE} -- Implementation

    is_caught (sig: INTEGER): BOOLEAN is
            -- Is sig currently set to be caught?
        external
            "C | %"eif_sig.h%""
        alias
            "esigiscaught"
        end

    c_signal_map (i: INTEGER): INTEGER is
        external
            "C | %"eif_sig.h%""
        alias
            "esigmap"
        end

    c_signal_name (i: INTEGER): POINTER is
        external
            "C | %"eif_sig.h%""
        alias
            "esigname"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_SIGNALS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_SIGNALS Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    UNIX_SIGNALS

General
    cluster: base.kernel
    description:
        "Constants used for signal handling.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    is_defined (sig: INTEGER): BOOLEAN
    is_ignored (sig: INTEGER): BOOLEAN
    meaning (sig: INTEGER): STRING
    Sigabrt: INTEGER
    Sigalrm: INTEGER
    Sigbus: INTEGER
    Sigchld: INTEGER
    Sigcld: INTEGER
    Sigcont: INTEGER
    Sigemt: INTEGER
    Sigfpe: INTEGER
    Sighup: INTEGER
    Sigill: INTEGER
    Sigint: INTEGER
    Sigio: INTEGER
    Sigiot: INTEGER
    Sigkill: INTEGER
    Siglost: INTEGER
    signal: INTEGER
    Sigphone: INTEGER
    Sigpipe: INTEGER
    Sigpoll: INTEGER
    Sigprof: INTEGER
    Sigpwr: INTEGER
    Sigquit: INTEGER
    Sigsegv: INTEGER
    Sigstop: INTEGER
    Sigsys: INTEGER
    Sigterm: INTEGER
    Sigtrap: INTEGER
    Sigtstp: INTEGER
    Sigttin: INTEGER
    Sigttou: INTEGER
    Sigurg: INTEGER
    Sigusr1: INTEGER
    Sigusr2: INTEGER
    Sigvtalarm: INTEGER
    Sigwinch: INTEGER
    Sigwind: INTEGER
    Sigxcpu: INTEGER
    Sigxfsz: INTEGER

Commands
    catch (sig: INTEGER)
    ignore (sig: INTEGER)
    reset_all_default
    reset_default (sig: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_SIGNALS Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for signal handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    UNIX_SIGNALS

feature -- Access

    is_defined (sig: INTEGER): BOOLEAN is
            -- Is sig a signal defined for this platform?
        external
            "C | %"eif_sig.h%""
        alias
            "esigdefined"
        end

    is_ignored (sig: INTEGER): BOOLEAN is
            -- Is sig currently set to be ignored?
        do
            Result := not is_caught (sig)
        end

    meaning (sig: INTEGER): STRING is
            -- A message in English describing what sig is
        do
            if is_defined (sig) then
                create Result.make_from_c (c_signal_name (sig))
            end
        end

    sigabrt: INTEGER is
            -- Code for `Abort' signal
        once
            Result := c_signal_map (6)
        end

    sigalrm: INTEGER is
            -- Code for ``Alarm clock'' signal
        once
            Result := c_signal_map (15)
        end

    sigbus: INTEGER is
            -- Code for ``Bus error'' signal
        once
            Result := c_signal_map (11)
        end

    sigchld: INTEGER is
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (19)
        end

    sigcld: INTEGER is
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (20)
        end

    sigcont: INTEGER is
            -- Code for ``Continue after stop'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (37)
        end

    sigemt: INTEGER is
            -- Code for ``EMT instruction'' signal
        once
            Result := c_signal_map (8)
        end

    sigfpe: INTEGER is
            -- Code for ``Floating point exception'' signal
        once
            Result := c_signal_map (9)
        end

    sighup: INTEGER is
            -- Code for `Hangup' signal
        once
            Result := c_signal_map (1)
        end

    sigill: INTEGER is
            -- Code for ``Illegal instruction'' signal
        once
            Result := c_signal_map (4)
        end

    sigint: INTEGER is
            -- Code for `Interrupt' signal
        once
            Result := c_signal_map (2)
        end

    sigio: INTEGER is
            -- Code for ``Pending I/O on a descriptor'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (21)
        end

    sigiot: INTEGER is
            -- Code for ``IOT instruction'' signal
        once
            Result := c_signal_map (7)
        end

    sigkill: INTEGER is
            -- Code for `Terminator' signal
        once
            Result := c_signal_map (10)
        end

    siglost: INTEGER is
            -- Code for ``Resource lost'' signal
        once
            Result := c_signal_map (35)
        end

    sigphone: INTEGER is
            -- Code for ``Line status change'' signal
        once
            Result := c_signal_map (34)
        end

    sigpipe: INTEGER is
            -- Code for ``Broken pipe'' signal
        once
            Result := c_signal_map (14)
        end

    sigpoll: INTEGER is
            -- Code for ``Selectable event pending'' signal
        once
            Result := c_signal_map (22)
        end

    sigprof: INTEGER is
            -- Code for ``Profiling timer alarm'' signal
        once
            Result := c_signal_map (31)
        end

    sigpwr: INTEGER is
            -- Code for `Power-fail' signal
        once
            Result := c_signal_map (30)
        end

    sigquit: INTEGER is
            -- Code for `Quit' signal
        once
            Result := c_signal_map (3)
        end

    sigsegv: INTEGER is
            -- Code for ``Segmentation violation'' signal
        once
            Result := c_signal_map (12)
        end

    sigstop: INTEGER is
            -- Code for `Stop' signal
        once
            Result := c_signal_map (25)
        end

    sigsys: INTEGER is
            -- Code for ``Bad argument to system call'' signal
        once
            Result := c_signal_map (13)
        end

    sigterm: INTEGER is
            -- Code for ``Software termination'' signal
        once
            Result := c_signal_map (16)
        end

    sigtrap: INTEGER is
            -- Code for ``Trace trap'' signal
        once
            Result := c_signal_map (5)
        end

    sigtstp: INTEGER is
            -- Code for ``Stop from tty'' signal
        once
            Result := c_signal_map (26)
        end

    sigttin: INTEGER is
            -- Code for ``Tty input from background'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (23)
        end

    sigttou: INTEGER is
            -- Code for ``Tty output from background'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (24)
        end

    sigurg: INTEGER is
            -- Code for ``Urgent condition on socket'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (36)
        end

    sigusr1: INTEGER is
            -- Code for ``User-defined signal #1''
        once
            Result := c_signal_map (17)
        end

    sigusr2: INTEGER is
            -- Code for ``User-defined signal #2''
        once
            Result := c_signal_map (18)
        end

    sigvtalarm: INTEGER is
            -- Code for ``Virtual time alarm'' signal
        once
            Result := c_signal_map (29)
        end

    sigwinch: INTEGER is
            -- Code for ``Window size changed'' signal.
            -- Signal ignored by default
        once
            Result := c_signal_map (32)
        end

    sigwind: INTEGER is
            -- Code for ``Window change'' signal
        once
            Result := c_signal_map (33)
        end

    sigxcpu: INTEGER is
            -- Code for ``Cpu time limit exceeded'' signal
        once
            Result := c_signal_map (27)
        end

    sigxfsz: INTEGER is
            -- Code for ``File size limit exceeded'' signal
        once
            Result := c_signal_map (28)
        end

feature -- Status report

    signal: INTEGER is
            -- Code of last signal
        external
            "C | %"eif_sig.h%""
        alias
            "esignum"
        end

feature -- Status setting

    catch (sig: INTEGER) is
            -- Make sure that future occurrences of sig
            -- will be treated as exceptions.
            -- (This is the default for all signals.)
            -- No effect if signal not defined.
        external
            "C | %"eif_sig.h%""
        alias
            "esigcatch"
        end

    ignore (sig: INTEGER) is
            -- Make sure that future occurrences of sig
            -- will be ignored. (This is not the default.)
            -- No effect if signal not defined.
        external
            "C | %"eif_sig.h%""
        alias
            "esigignore"
        end

    reset_all_default is
            -- Make sure that all exceptions will lead to their
            -- default handling.
        external
            "C | %"eif_sig.h%""
        alias
            "esigresall"
        end

    reset_default (sig: INTEGER) is
            -- Make sure that exception of code code will lead
            -- to its default action.
        require
            is_defined (sig)
        external
            "C | %"eif_sig.h%""
        alias
            "esigresdef"
        end

feature {NONE} -- Implementation

    c_signal_map (i: INTEGER): INTEGER is
        external
            "C | %"eif_sig.h%""
        alias
            "esigmap"
        end

    c_signal_name (i: INTEGER): POINTER is
        external
            "C | %"eif_sig.h%""
        alias
            "esigname"
        end

    is_caught (sig: INTEGER): BOOLEAN is
            -- Is sig currently set to be caught?
        external
            "C | %"eif_sig.h%""
        alias
            "esigiscaught"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_SIGNALS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_SIGNALS Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for signal handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_SIGNALS

feature -- Access

    is_defined (sig: INTEGER): BOOLEAN
            -- Is sig a signal defined for this platform?

    is_ignored (sig: INTEGER): BOOLEAN
            -- Is sig currently set to be ignored?

    meaning (sig: INTEGER): STRING
            -- A message in English describing what sig is

    sigabrt: INTEGER
            -- Code for `Abort' signal

    sigalrm: INTEGER
            -- Code for ``Alarm clock'' signal

    sigbus: INTEGER
            -- Code for ``Bus error'' signal

    sigchld: INTEGER
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default

    sigcld: INTEGER
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default

    sigcont: INTEGER
            -- Code for ``Continue after stop'' signal.
            -- Signal ignored by default

    sigemt: INTEGER
            -- Code for ``EMT instruction'' signal

    sigfpe: INTEGER
            -- Code for ``Floating point exception'' signal

    sighup: INTEGER
            -- Code for `Hangup' signal

    sigill: INTEGER
            -- Code for ``Illegal instruction'' signal

    sigint: INTEGER
            -- Code for `Interrupt' signal

    sigio: INTEGER
            -- Code for ``Pending I/O on a descriptor'' signal.
            -- Signal ignored by default

    sigiot: INTEGER
            -- Code for ``IOT instruction'' signal

    sigkill: INTEGER
            -- Code for `Terminator' signal

    siglost: INTEGER
            -- Code for ``Resource lost'' signal

    sigphone: INTEGER
            -- Code for ``Line status change'' signal

    sigpipe: INTEGER
            -- Code for ``Broken pipe'' signal

    sigpoll: INTEGER
            -- Code for ``Selectable event pending'' signal

    sigprof: INTEGER
            -- Code for ``Profiling timer alarm'' signal

    sigpwr: INTEGER
            -- Code for `Power-fail' signal

    sigquit: INTEGER
            -- Code for `Quit' signal

    sigsegv: INTEGER
            -- Code for ``Segmentation violation'' signal

    sigstop: INTEGER
            -- Code for `Stop' signal

    sigsys: INTEGER
            -- Code for ``Bad argument to system call'' signal

    sigterm: INTEGER
            -- Code for ``Software termination'' signal

    sigtrap: INTEGER
            -- Code for ``Trace trap'' signal

    sigtstp: INTEGER
            -- Code for ``Stop from tty'' signal

    sigttin: INTEGER
            -- Code for ``Tty input from background'' signal.
            -- Signal ignored by default

    sigttou: INTEGER
            -- Code for ``Tty output from background'' signal.
            -- Signal ignored by default

    sigurg: INTEGER
            -- Code for ``Urgent condition on socket'' signal.
            -- Signal ignored by default

    sigusr1: INTEGER
            -- Code for ``User-defined signal #1''

    sigusr2: INTEGER
            -- Code for ``User-defined signal #2''

    sigvtalarm: INTEGER
            -- Code for ``Virtual time alarm'' signal

    sigwinch: INTEGER
            -- Code for ``Window size changed'' signal.
            -- Signal ignored by default

    sigwind: INTEGER
            -- Code for ``Window change'' signal

    sigxcpu: INTEGER
            -- Code for ``Cpu time limit exceeded'' signal

    sigxfsz: INTEGER
            -- Code for ``File size limit exceeded'' signal

feature -- Status report

    signal: INTEGER
            -- Code of last signal

feature -- Status setting

    catch (sig: INTEGER)
            -- Make sure that future occurrences of sig
            -- will be treated as exceptions.
            -- (This is the default for all signals.)
            -- No effect if signal not defined.

    ignore (sig: INTEGER)
            -- Make sure that future occurrences of sig
            -- will be ignored. (This is not the default.)
            -- No effect if signal not defined.

    reset_all_default
            -- Make sure that all exceptions will lead to their
            -- default handling.

    reset_default (sig: INTEGER)
            -- Make sure that exception of code code will lead
            -- to its default action.
        require
            is_defined (sig)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_SIGNALS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_SIGNALS Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    UNIX_SIGNALS

Ancestors
    ANY

Clients
    UNIX_SIGNALS

Suppliers
    BOOLEAN
    STRING
    UNIX_SIGNALS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNIX_SIGNALS Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Constants used for signal handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_SIGNALS

feature -- Access

    meaning (sig: INTEGER): STRING
            -- A message in English describing what sig is

    is_defined (sig: INTEGER): BOOLEAN
            -- Is sig a signal defined for this platform?

    is_ignored (sig: INTEGER): BOOLEAN
            -- Is sig currently set to be ignored?

    sighup: INTEGER
            -- Code for `Hangup' signal

    sigint: INTEGER
            -- Code for `Interrupt' signal

    sigquit: INTEGER
            -- Code for `Quit' signal

    sigill: INTEGER
            -- Code for ``Illegal instruction'' signal

    sigtrap: INTEGER
            -- Code for ``Trace trap'' signal

    sigabrt: INTEGER
            -- Code for `Abort' signal

    sigiot: INTEGER
            -- Code for ``IOT instruction'' signal

    sigemt: INTEGER
            -- Code for ``EMT instruction'' signal

    sigfpe: INTEGER
            -- Code for ``Floating point exception'' signal

    sigkill: INTEGER
            -- Code for `Terminator' signal

    sigbus: INTEGER
            -- Code for ``Bus error'' signal

    sigsegv: INTEGER
            -- Code for ``Segmentation violation'' signal

    sigsys: INTEGER
            -- Code for ``Bad argument to system call'' signal

    sigpipe: INTEGER
            -- Code for ``Broken pipe'' signal

    sigalrm: INTEGER
            -- Code for ``Alarm clock'' signal

    sigterm: INTEGER
            -- Code for ``Software termination'' signal

    sigusr1: INTEGER
            -- Code for ``User-defined signal #1''

    sigusr2: INTEGER
            -- Code for ``User-defined signal #2''

    sigchld: INTEGER
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default

    sigcld: INTEGER
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default

    sigio: INTEGER
            -- Code for ``Pending I/O on a descriptor'' signal.
            -- Signal ignored by default

    sigpoll: INTEGER
            -- Code for ``Selectable event pending'' signal

    sigttin: INTEGER
            -- Code for ``Tty input from background'' signal.
            -- Signal ignored by default

    sigttou: INTEGER
            -- Code for ``Tty output from background'' signal.
            -- Signal ignored by default

    sigstop: INTEGER
            -- Code for `Stop' signal

    sigtstp: INTEGER
            -- Code for ``Stop from tty'' signal

    sigxcpu: INTEGER
            -- Code for ``Cpu time limit exceeded'' signal

    sigxfsz: INTEGER
            -- Code for ``File size limit exceeded'' signal

    sigvtalarm: INTEGER
            -- Code for ``Virtual time alarm'' signal

    sigpwr: INTEGER
            -- Code for `Power-fail' signal

    sigprof: INTEGER
            -- Code for ``Profiling timer alarm'' signal

    sigwinch: INTEGER
            -- Code for ``Window size changed'' signal.
            -- Signal ignored by default

    sigwind: INTEGER
            -- Code for ``Window change'' signal

    sigphone: INTEGER
            -- Code for ``Line status change'' signal

    siglost: INTEGER
            -- Code for ``Resource lost'' signal

    sigurg: INTEGER
            -- Code for ``Urgent condition on socket'' signal.
            -- Signal ignored by default

    sigcont: INTEGER
            -- Code for ``Continue after stop'' signal.
            -- Signal ignored by default

feature -- Status report

    signal: INTEGER
            -- Code of last signal

feature -- Status setting

    catch (sig: INTEGER)
            -- Make sure that future occurrences of sig
            -- will be treated as exceptions.
            -- (This is the default for all signals.)
            -- No effect if signal not defined.

    ignore (sig: INTEGER)
            -- Make sure that future occurrences of sig
            -- will be ignored. (This is not the default.)
            -- No effect if signal not defined.

    reset_all_default
            -- Make sure that all exceptions will lead to their
            -- default handling.

    reset_default (sig: INTEGER)
            -- Make sure that exception of code code will lead
            -- to its default action.
        require
            is_defined (sig)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_SIGNALS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unicode characters, with comparison operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

expanded class
    WIDE_CHARACTER

inherit
    WIDE_CHARACTER_REF

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    WIDE_CHARACTER

General
    cluster: base.kernel
    description: "Unicode characters, with comparison operations"

Ancestors
    WIDE_CHARACTER_REF

Queries
    infix ">=" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    infix ">" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    infix "<=" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    infix "<" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    code: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] WIDE_CHARACTER): BOOLEAN
    Is_hashable: BOOLEAN
    item: WIDE_CHARACTER
    max (other: [like Current] WIDE_CHARACTER): [like Current] WIDE_CHARACTER
    min (other: [like Current] WIDE_CHARACTER): [like Current] WIDE_CHARACTER
    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER

Commands
    set_item (c: WIDE_CHARACTER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unicode characters, with comparison operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

expanded class
    WIDE_CHARACTER

feature -- Access

    code: INTEGER is
            -- Associated integer value
            -- (from WIDE_CHARACTER_REF)
        do
            Result := chcode (item)
        end

    hash_code: INTEGER is
            -- Hash code value
            -- (from WIDE_CHARACTER_REF)
        do
            Result := code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: WIDE_CHARACTER
            -- Character value
            -- (from WIDE_CHARACTER_REF)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from WIDE_CHARACTER_REF)
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from WIDE_CHARACTER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current character?
            -- (from WIDE_CHARACTER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?
            -- (from WIDE_CHARACTER_REF)

feature -- Element change

    set_item (c: WIDE_CHARACTER) is
            -- Make c the item value.
            -- (from WIDE_CHARACTER_REF)
        do
            item := c
        end

feature {NONE} -- Implementation

    chcode (c: like item): INTEGER is
            -- Associated integer value
            -- (from WIDE_CHARACTER_REF)
        external
            "C [macro %"eif_misc.h%"]"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unicode characters, with comparison operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    WIDE_CHARACTER

feature -- Access

    code: INTEGER
            -- Associated integer value
            -- (from WIDE_CHARACTER_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from WIDE_CHARACTER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: WIDE_CHARACTER
            -- Character value
            -- (from WIDE_CHARACTER_REF)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from WIDE_CHARACTER_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from WIDE_CHARACTER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
            -- (from WIDE_CHARACTER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?
            -- (from WIDE_CHARACTER_REF)

feature -- Element change

    set_item (c: WIDE_CHARACTER)
            -- Make c the item value.
            -- (from WIDE_CHARACTER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

expanded class
    WIDE_CHARACTER

Ancestors
    WIDE_CHARACTER_REF

Clients
    WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER_REF Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    WIDE_CHARACTER_REF

inherit
    COMPARABLE
        redefine
            three_way_comparison,
            is_equal
        end

    HASHABLE
        redefine
            is_hashable,
            is_equal
        end

feature -- Access

    item: WIDE_CHARACTER
            -- Character value

    code: INTEGER is
            -- Associated integer value
        do
            Result := chcode (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := code
        end

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current character?
        do
            Result := item < other.item
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := other.item = item
        end

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        end

feature -- Element change

    set_item (c: WIDE_CHARACTER) is
            -- Make c the item value.
        do
            item := c
        end

feature {NONE} -- Implementation

    chcode (c: like item): INTEGER is
            -- Associated integer value
        external
            "C [macro %"eif_misc.h%"]"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER_REF Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    WIDE_CHARACTER_REF

General
    cluster: base.kernel
    description: "References to objects containing a character value"

Ancestors
    COMPARABLE
    HASHABLE

Queries
    infix ">=" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    infix ">" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    infix "<=" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    infix "<" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    code: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    Is_hashable: BOOLEAN
    item: WIDE_CHARACTER
    max (other: [like Current] WIDE_CHARACTER_REF): [like Current] WIDE_CHARACTER_REF
    min (other: [like Current] WIDE_CHARACTER_REF): [like Current] WIDE_CHARACTER_REF
    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER

Commands
    set_item (c: WIDE_CHARACTER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER_REF Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class
    WIDE_CHARACTER_REF

feature -- Access

    code: INTEGER is
            -- Associated integer value
        do
            Result := chcode (item)
        end

    hash_code: INTEGER is
            -- Hash code value
        do
            Result := code
        ensure -- from HASHABLE
            good_hash_value: Result >= 0
        end

    item: WIDE_CHARACTER
            -- Character value

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := other.item = item
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))
        end

    max (other: like Current): like Current is
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current >= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other
        end

    min (other: like Current): like Current is
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if Current <= other then
                Result := Current
            else
                Result := other
            end
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other
        end

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER is
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        do
            if item < other.item then
                Result := - 1
            elseif other.item < item then
                Result := 1
            end
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)
        end

    infix "<" (other: like Current): BOOLEAN is
            -- Is other greater than current character?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := item < other.item
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (other < Current)
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := other < Current
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        do
            Result := not (Current < other)
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)
        end

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?

feature -- Element change

    set_item (c: WIDE_CHARACTER) is
            -- Make c the item value.
        do
            item := c
        end

feature {NONE} -- Implementation

    chcode (c: like item): INTEGER is
            -- Associated integer value
        external
            "C [macro %"eif_misc.h%"]"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER_REF Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    WIDE_CHARACTER_REF

feature -- Access

    code: INTEGER
            -- Associated integer value

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: WIDE_CHARACTER
            -- Character value

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?

feature -- Element change

    set_item (c: WIDE_CHARACTER)
            -- Make c the item value.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER_REF Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    WIDE_CHARACTER_REF

Ancestors
    COMPARABLE
    HASHABLE

Descendants
    WIDE_CHARACTER

Clients
    WIDE_CHARACTER_REF

Suppliers
    INTEGER
    WIDE_CHARACTER
    WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER_REF Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

class interface
    WIDE_CHARACTER_REF

feature -- Access

    item: WIDE_CHARACTER
            -- Character value

    code: INTEGER
            -- Associated integer value

    hash_code: INTEGER
            -- Hash code value

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1

feature -- Element change

    set_item (c: WIDE_CHARACTER)
            -- Make c the item value.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER_REF

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


WIDE_CHARACTER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unicode characters, with comparison operations"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

expanded class interface
    WIDE_CHARACTER

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures	(diagram)

Supercluster
    base

Subclusters
    base.structures.access
    base.structures.cursors
    base.structures.cursor_tree
    base.structures.dispenser
    base.structures.iteration
    base.structures.list
    base.structures.set
    base.structures.sort
    base.structures.storage
    base.structures.table
    base.structures.traversing
    base.structures.tree

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.access

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.access	(diagram)

Supercluster
    base.structures

Classes
    ACTIVE [G]
    BAG [G]
    COLLECTION [G]
    CONTAINER [G]
    CURSOR_STRUCTURE [G]
    INDEXABLE [G, H -> INTEGER]
    TABLE [G, H]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        ``Active'' data structures, which at every stage have
        a possibly undefined ``current item''.
        Basic access and modification operations apply to the current item.
    ]"
    status: "See notice at end of class"
    names: active, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    ACTIVE [G]

inherit
    BAG [G]

feature -- Access

    item: G is
            -- Current item
        require
            readable: readable
        deferred
        end

feature -- Status report

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        deferred
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        deferred
        end

feature -- Element change

    replace (v: G) is
            -- Replace current item by v.
        require
            writable: writable
        deferred
        ensure
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove current item.
        require
            prunable: prunable
            writable: writable
        deferred
        end

invariant

    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    ACTIVE [G]

General
    cluster: base.structures.access
    description:
        "``Active'' data structures, which at every stage have
        a possibly undefined ``current item''.
        Basic access and modification operations apply to the current item."

Ancestors
    BAG [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    remove
    replace (v: G)
    wipe_out

Constraints
    writable constraint
    empty constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        ``Active'' data structures, which at every stage have
        a possibly undefined ``current item''.
        Basic access and modification operations apply to the current item.
    ]"
    status: "See notice at end of class"
    names: active, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    ACTIVE [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Current item
        require
            readable: readable
        deferred
        end

feature -- Measurement

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        deferred
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: G) is
            -- Replace current item by v.
        require
            writable: writable
        deferred
        ensure
            item_replaced: item = v
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
        require
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        ``Active'' data structures, which at every stage have
        a possibly undefined ``current item''.
        Basic access and modification operations apply to the current item.
    ]"
    status: "See notice at end of class"
    names: active, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    ACTIVE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
        require
            readable: readable

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
        require
            writable: writable
        ensure
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
        require
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    ACTIVE [G]

Ancestors
    BAG [G]

Descendants
    COUNTABLE_SEQUENCE [G]
    CURSOR_STRUCTURE [G]
    DISPENSER [G]
    SEQUENCE [G]

Clients
    ACTIVE [G]

Suppliers
    ACTIVE [G]
    BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ACTIVE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        ``Active'' data structures, which at every stage have
        a possibly undefined ``current item''.
        Basic access and modification operations apply to the current item.
    ]"
    status: "See notice at end of class"
    names: active, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    ACTIVE [G]

feature -- Access

    item: G
            -- Current item
        require
            readable: readable

feature -- Status report

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Element change

    replace (v: G)
            -- Replace current item by v.
        require
            writable: writable
        ensure
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove current item.
        require
            prunable: prunable
            writable: writable

invariant

    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BAG Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Collections of items, where each item may occur zero
        or more times, and the number of occurrences is meaningful.
    ]"
    status: "See notice at end of class"
    names: bag, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    BAG [G]

inherit
    COLLECTION [G]
        redefine
            extend
        end

feature -- Measurement

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
        deferred
        ensure
            non_negative_occurrences: Result >= 0
        end

feature -- Element change

    extend (v: G) is
            -- Add a new occurrence of v.
        deferred
        ensure then
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BAG

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BAG Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BAG [G]

General
    cluster: base.structures.access
    description:
        "Collections of items, where each item may occur zero
        or more times, and the number of occurrences is meaningful."

Ancestors
    COLLECTION [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BAG Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Collections of items, where each item may occur zero
        or more times, and the number of occurrences is meaningful.
    ]"
    status: "See notice at end of class"
    names: bag, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    BAG [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
        deferred
        ensure
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: G) is
            -- Add a new occurrence of v.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BAG

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BAG Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Collections of items, where each item may occur zero
        or more times, and the number of occurrences is meaningful.
    ]"
    status: "See notice at end of class"
    names: bag, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BAG [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BAG

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BAG Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BAG [G]

Ancestors
    COLLECTION [G]

Descendants
    ACTIVE [G]
    TABLE [G, H]

Clients
    BAG [G]

Suppliers
    BAG [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BAG Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Collections of items, where each item may occur zero
        or more times, and the number of occurrences is meaningful.
    ]"
    status: "See notice at end of class"
    names: bag, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BAG [G]

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure
            non_negative_occurrences: Result >= 0

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
        ensure then
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BAG

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COLLECTION Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        General container data structures,
        characterized by the membership properties of their items.
    ]"
    status: "See notice at end of class"
    names: collection, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    COLLECTION [G]

inherit
    CONTAINER [G]

feature -- Status report

    extendible: BOOLEAN is
            -- May new items be added?
        deferred
        end

    prunable: BOOLEAN is
            -- May items be removed?
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
        do
            Result := has (v)
        end

feature -- Element change

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
        require
            extendible: extendible
        deferred
        ensure
            item_inserted: is_inserted (v)
        end

    extend (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of put.
        require
            extendible: extendible
        deferred
        ensure
            item_inserted: is_inserted (v)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
        require
            prunable
        deferred
        ensure
            wiped_out: is_empty
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COLLECTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COLLECTION Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COLLECTION [G]

General
    cluster: base.structures.access
    description:
        "General container data structures,
        characterized by the membership properties of their items."

Ancestors
    CONTAINER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COLLECTION Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        General container data structures,
        characterized by the membership properties of their items.
    ]"
    status: "See notice at end of class"
    names: collection, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    COLLECTION [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of put.
        require
            extendible: extendible
        deferred
        ensure
            item_inserted: is_inserted (v)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
        require
            extendible: extendible
        deferred
        ensure
            item_inserted: is_inserted (v)
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
        require
            prunable
        deferred
        ensure
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COLLECTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COLLECTION Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        General container data structures,
        characterized by the membership properties of their items.
    ]"
    status: "See notice at end of class"
    names: collection, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COLLECTION [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of put.
        require
            extendible: extendible
        ensure
            item_inserted: is_inserted (v)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
        require
            extendible: extendible
        ensure
            item_inserted: is_inserted (v)

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable
        ensure
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
        require
            prunable
        ensure
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COLLECTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COLLECTION Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COLLECTION [G]

Ancestors
    CONTAINER [G]

Descendants
    BAG [G]
    SET [G]

Clients
    COLLECTION [G]

Suppliers
    BOOLEAN
    COLLECTION [G]
    CONTAINER [G]
    LINEAR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COLLECTION Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        General container data structures,
        characterized by the membership properties of their items.
    ]"
    status: "See notice at end of class"
    names: collection, access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COLLECTION [G]

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?

    prunable: BOOLEAN
            -- May items be removed?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)

feature -- Element change

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
        require
            extendible: extendible
        ensure
            item_inserted: is_inserted (v)

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of put.
        require
            extendible: extendible
        ensure
            item_inserted: is_inserted (v)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            other_not_void: other /= void
            extendible

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable
        ensure
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
        require
            prunable
        ensure
            wiped_out: is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COLLECTION

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONTAINER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        used to hold zero or more items.
    ]"
    status: "See notice at end of class"
    names: access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    CONTAINER [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        deferred
        ensure
            not_found_in_empty: Result implies not is_empty
        end

feature -- Status report

    is_empty: BOOLEAN is
            -- Is there no element?
        deferred
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
        do
            Result := is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
        do
            Result := True
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
        require
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
        require
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        deferred
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONTAINER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONTAINER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CONTAINER [G]

General
    cluster: base.structures.access
    description:
        "Data structures of the most general kind,
        used to hold zero or more items."

Ancestors
    ANY

Queries
    changeable_comparison_criterion: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONTAINER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        used to hold zero or more items.
    ]"
    status: "See notice at end of class"
    names: access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    CONTAINER [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        deferred
        ensure
            not_found_in_empty: Result implies not is_empty
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
        do
            Result := is_empty
        end

    is_empty: BOOLEAN is
            -- Is there no element?
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
        require
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
        require
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONTAINER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONTAINER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        used to hold zero or more items.
    ]"
    status: "See notice at end of class"
    names: access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CONTAINER [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)

    is_empty: BOOLEAN
            -- Is there no element?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
        require
            changeable_comparison_criterion
        ensure
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
        require
            changeable_comparison_criterion
        ensure
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONTAINER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONTAINER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CONTAINER [G]

Ancestors
    ANY

Descendants
    BOX [G]
    COLLECTION [G]
    TRAVERSABLE [G]
    TREE [G]

Clients
    COLLECTION [G]
    CONTAINER [G]
    SUBSET [G]
    TRAVERSABLE_SUBSET [G]

Suppliers
    BOOLEAN
    CONTAINER [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CONTAINER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        used to hold zero or more items.
    ]"
    status: "See notice at end of class"
    names: access
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CONTAINER [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    is_empty: BOOLEAN
            -- Is there no element?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
        require
            changeable_comparison_criterion
        ensure
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
        require
            changeable_comparison_criterion
        ensure
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONTAINER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_STRUCTURE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Active structures, which always have a current position
        accessible through a cursor.
    ]"
    status: "See notice at end of class"
    names: cursor_structure, access
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    CURSOR_STRUCTURE [G]

inherit
    ACTIVE [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
        deferred
        end

feature -- Status report

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        deferred
        end

feature -- Cursor movement

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require
            cursor_position_valid: valid_cursor (p)
        deferred
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_STRUCTURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_STRUCTURE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CURSOR_STRUCTURE [G]

General
    cluster: base.structures.access
    description:
        "Active structures, which always have a current position
        accessible through a cursor."

Ancestors
    ACTIVE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    cursor: CURSOR
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    writable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    go_to (p: CURSOR)
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    remove
    replace (v: G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_STRUCTURE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Active structures, which always have a current position
        accessible through a cursor.
    ]"
    status: "See notice at end of class"
    names: cursor_structure, access
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:30 $"
    revision: "$Revision: 1.2 $"

deferred class
    CURSOR_STRUCTURE [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
        deferred
        end

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable
        deferred
        end

feature -- Measurement

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from ACTIVE)
        deferred
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        deferred
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from ACTIVE)
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require
            cursor_position_valid: valid_cursor (p)
        deferred
        end

feature -- Element change

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_STRUCTURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_STRUCTURE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Active structures, which always have a current position
        accessible through a cursor.
    ]"
    status: "See notice at end of class"
    names: cursor_structure, access
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CURSOR_STRUCTURE [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from ACTIVE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from ACTIVE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require
            cursor_position_valid: valid_cursor (p)

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_STRUCTURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_STRUCTURE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CURSOR_STRUCTURE [G]

Ancestors
    ACTIVE [G]

Descendants
    CHAIN [G]
    CURSOR_TREE [G]

Clients
    CURSOR_STRUCTURE [G]
    LINEAR [G]

Suppliers
    CURSOR_STRUCTURE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_STRUCTURE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Active structures, which always have a current position
        accessible through a cursor.
    ]"
    status: "See notice at end of class"
    names: cursor_structure, access
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CURSOR_STRUCTURE [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position

feature -- Status report

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

feature -- Cursor movement

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require
            cursor_position_valid: valid_cursor (p)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_STRUCTURE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.access

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


INDEXABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Tables whose keys are integers in a contiguous interval"
    status: "See notice at end of class"
    names: indexable, access
    access: index, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    INDEXABLE [G, H -> INTEGER]

inherit
    TABLE [G, H]
        rename
            valid_key as valid_index
        redefine
            put,
            valid_index
        end

feature -- Measurement

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        deferred
        ensure
            not_void: Result /= void
        end

feature -- Status report

    valid_index (i: H): BOOLEAN is
            -- Is i a valid index?
        deferred
        ensure then
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature -- Element change

    put (v: G; k: H) is
            -- Associate value v with key k.
        deferred
        ensure then
            insertion_done: item (k) = v
        end

invariant

    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INDEXABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INDEXABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    INDEXABLE [G, H -> INTEGER]

General
    cluster: base.structures.access
    description: "Tables whose keys are integers in a contiguous interval"

Ancestors
    TABLE [G, H]

Queries
    infix "@" (k: H): G
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (k: H): G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    valid_index (i: H): BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G; k: H)
    wipe_out

Constraints
    index set not void

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INDEXABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Tables whose keys are integers in a contiguous interval"
    status: "See notice at end of class"
    names: indexable, access
    access: index, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    INDEXABLE [G, H -> INTEGER]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item (k: H): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)
        deferred
        end

    infix "@" (k: H): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)
        deferred
        end

feature -- Measurement

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        deferred
        ensure
            not_void: Result /= void
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    valid_index (i: H): BOOLEAN is
            -- Is i a valid index?
        deferred
        ensure then
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G; k: H) is
            -- Associate value v with key k.
        require -- from TABLE
            valid_key: valid_index (k)
        deferred
        ensure then
            insertion_done: item (k) = v
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

invariant

    index_set_not_void: index_set /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INDEXABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INDEXABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Tables whose keys are integers in a contiguous interval"
    status: "See notice at end of class"
    names: indexable, access
    access: index, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    INDEXABLE [G, H -> INTEGER]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

    infix "@" (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure
            not_void: Result /= void

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    valid_index (i: H): BOOLEAN
            -- Is i a valid index?
        ensure then
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G; k: H)
            -- Associate value v with key k.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then
            insertion_done: item (k) = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    index_set_not_void: index_set /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INDEXABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INDEXABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    INDEXABLE [G, H -> INTEGER]

Ancestors
    TABLE [G, H]

Descendants
    ARRAY [G]
    CHAIN [G]
    INTEGER_INTERVAL
    SORTED_STRUCT [G -> COMPARABLE]
    STRING

Clients
    INDEXABLE [G, H -> INTEGER]

Suppliers
    BOOLEAN
    INDEXABLE [G, H -> INTEGER]
    INTEGER
    INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INDEXABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Tables whose keys are integers in a contiguous interval"
    status: "See notice at end of class"
    names: indexable, access
    access: index, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    INDEXABLE [G, H -> INTEGER]

feature -- Measurement

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure
            not_void: Result /= void

feature -- Status report

    valid_index (i: H): BOOLEAN
            -- Is i a valid index?
        ensure then
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Element change

    put (v: G; k: H)
            -- Associate value v with key k.
        ensure then
            insertion_done: item (k) = v

invariant

    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INDEXABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Containers whose items are accessible through keys"
    status: "See notice at end of class"
    names: table, access
    access: key, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    TABLE [G, H]

inherit
    BAG [G]
        rename
            put as bag_put
        end

feature -- Access

    item (k: H): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
        require
            valid_key: valid_key (k)
        deferred
        end

    infix "@" (k: H): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
        require
            valid_key: valid_key (k)
        deferred
        end

feature -- Status report

    valid_key (k: H): BOOLEAN is
            -- Is k a valid key?
        deferred
        end

feature -- Element change

    put (v: G; k: H) is
            -- Associate value v with key k.
        require
            valid_key: valid_key (k)
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
        do
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TABLE [G, H]

General
    cluster: base.structures.access
    description: "Containers whose items are accessible through keys"

Ancestors
    BAG [G]

Queries
    infix "@" (k: H): G
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (k: H): G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    valid_key (k: H): BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G; k: H)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Containers whose items are accessible through keys"
    status: "See notice at end of class"
    names: table, access
    access: key, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    TABLE [G, H]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item (k: H): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
        require
            valid_key: valid_key (k)
        deferred
        end

    infix "@" (k: H): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
        require
            valid_key: valid_key (k)
        deferred
        end

feature -- Measurement

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    valid_key (k: H): BOOLEAN is
            -- Is k a valid key?
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G; k: H) is
            -- Associate value v with key k.
        require
            valid_key: valid_key (k)
        deferred
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Containers whose items are accessible through keys"
    status: "See notice at end of class"
    names: table, access
    access: key, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TABLE [G, H]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
        require
            valid_key: valid_key (k)

    infix "@" (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
        require
            valid_key: valid_key (k)

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    valid_key (k: H): BOOLEAN
            -- Is k a valid key?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G; k: H)
            -- Associate value v with key k.
        require
            valid_key: valid_key (k)

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TABLE [G, H]

Ancestors
    BAG [G]

Descendants
    HASH_TABLE [G, H -> HASHABLE]
    INDEXABLE [G, H -> INTEGER]

Clients
    TABLE [G, H]

Suppliers
    TABLE [G, H]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Containers whose items are accessible through keys"
    status: "See notice at end of class"
    names: table, access
    access: key, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TABLE [G, H]

feature -- Access

    item (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
        require
            valid_key: valid_key (k)

    infix "@" (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
        require
            valid_key: valid_key (k)

feature -- Status report

    valid_key (k: H): BOOLEAN
            -- Is k a valid key?

feature -- Element change

    put (v: G; k: H)
            -- Associate value v with key k.
        require
            valid_key: valid_key (k)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.cursors

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.cursors	(diagram)

Supercluster
    base.structures

Classes
    ARRAYED_LIST_CURSOR
    CIRCULAR_CURSOR
    COMPACT_TREE_CURSOR
    CURSOR
    HASH_TABLE_CURSOR
    LINKED_LIST_CURSOR [G]
    LINKED_TREE_CURSOR [G]
    MULTAR_LIST_CURSOR [G]
    RECURSIVE_TREE_CURSOR [G]
    TWO_WAY_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for arrayed lists"
    status: "See notice at end of class"
    names: fixed_list_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_LIST_CURSOR

inherit
    CURSOR

create
    make

feature {ARRAYED_LIST, FIXED_LIST, BINARY_TREE} -- Initialization

    make (current_index: INTEGER) is
            -- Create a cursor and set it up on current_index.
        do
            index := current_index
        end

feature {ARRAYED_LIST, FIXED_LIST, BINARY_TREE} -- Access

    index: INTEGER
            -- Index of current item

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_LIST_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for arrayed lists"
    create: make

Ancestors
    CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for arrayed lists"
    status: "See notice at end of class"
    names: fixed_list_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_LIST_CURSOR

create
    make

feature {ARRAYED_LIST, FIXED_LIST, BINARY_TREE} -- Initialization

    make (current_index: INTEGER) is
            -- Create a cursor and set it up on current_index.
        do
            index := current_index
        end

feature {ARRAYED_LIST, FIXED_LIST, BINARY_TREE} -- Access

    index: INTEGER
            -- Index of current item

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for arrayed lists"
    status: "See notice at end of class"
    names: fixed_list_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_LIST_CURSOR

create

    make (current_index: INTEGER)
            -- Create a cursor and set it up on current_index.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_LIST_CURSOR

Ancestors
    CURSOR

Clients
    ARRAYED_LIST [G]
    ARRAYED_LIST_CURSOR
    BINARY_TREE [G]
    FIXED_LIST [G]

Suppliers
    ARRAYED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for arrayed lists"
    status: "See notice at end of class"
    names: fixed_list_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_LIST_CURSOR

create
    make

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for circular lists"
    status: "See notice at end of class"
    names: circular_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    CIRCULAR_CURSOR

inherit
    CURSOR

create
    make

feature {LINKED_LIST} -- Initialization

    make (curs: like cursor; int: BOOLEAN; start: INTEGER) is
            -- Create a cursor and set it up on active_element.
        do
            cursor := curs
            internal_exhausted := int
            starter := start
        end

feature {CIRCULAR} -- Implementation

    cursor: CURSOR
            -- Current element in implementation

    internal_exhausted: BOOLEAN
            -- Has traversal passsed the start?

    starter: INTEGER
            -- Index of start position

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CIRCULAR_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for circular lists"
    create: make

Ancestors
    CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for circular lists"
    status: "See notice at end of class"
    names: circular_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    CIRCULAR_CURSOR

create
    make

feature {LINKED_LIST} -- Initialization

    make (curs: like cursor; int: BOOLEAN; start: INTEGER) is
            -- Create a cursor and set it up on active_element.
        do
            cursor := curs
            internal_exhausted := int
            starter := start
        end

feature {CIRCULAR} -- Implementation

    cursor: CURSOR
            -- Current element in implementation

    internal_exhausted: BOOLEAN
            -- Has traversal passsed the start?

    starter: INTEGER
            -- Index of start position

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for circular lists"
    status: "See notice at end of class"
    names: circular_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    CIRCULAR_CURSOR

create

    make (curs: like cursor; int: BOOLEAN; start: INTEGER)
            -- Create a cursor and set it up on active_element.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CIRCULAR_CURSOR

Ancestors
    CURSOR

Clients
    ARRAYED_CIRCULAR [G]
    CIRCULAR_CURSOR
    LINKED_CIRCULAR [G]

Suppliers
    CIRCULAR_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for circular lists"
    status: "See notice at end of class"
    names: circular_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    CIRCULAR_CURSOR

create
    make

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_TREE_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for compact trees"
    status: "See notice at end of class"
    names: compact_tree_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    COMPACT_TREE_CURSOR

inherit
    CURSOR

create
    make

feature {COMPACT_CURSOR_TREE} -- Initialization

    make (i: INTEGER; aft, bef, bel, abv: BOOLEAN) is
            -- Create a cursor and set it up on i.
        do
            active := i
            after := aft
            below := bel
            before := bef
            above := abv
        end

feature {COMPACT_CURSOR_TREE} -- Access

    active: INTEGER
            -- Index of current item

feature {COMPACT_CURSOR_TREE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_TREE_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    COMPACT_TREE_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for compact trees"
    create: make

Ancestors
    CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_TREE_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for compact trees"
    status: "See notice at end of class"
    names: compact_tree_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    COMPACT_TREE_CURSOR

create
    make

feature {COMPACT_CURSOR_TREE} -- Initialization

    make (i: INTEGER; aft, bef, bel, abv: BOOLEAN) is
            -- Create a cursor and set it up on i.
        do
            active := i
            after := aft
            below := bel
            before := bef
            above := abv
        end

feature {COMPACT_CURSOR_TREE} -- Access

    active: INTEGER
            -- Index of current item

feature {COMPACT_CURSOR_TREE} -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_TREE_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for compact trees"
    status: "See notice at end of class"
    names: compact_tree_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    COMPACT_TREE_CURSOR

create

    make (i: INTEGER; aft, bef, bel, abv: BOOLEAN)
            -- Create a cursor and set it up on i.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_TREE_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    COMPACT_TREE_CURSOR

Ancestors
    CURSOR

Clients
    COMPACT_CURSOR_TREE [G]
    COMPACT_TREE_CURSOR

Suppliers
    COMPACT_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_TREE_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for compact trees"
    status: "See notice at end of class"
    names: compact_tree_cursor, cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    COMPACT_TREE_CURSOR

create
    make

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for remembering positions in arbitrary data structures"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    CURSOR

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for remembering positions in arbitrary data structures"

Ancestors
    ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for remembering positions in arbitrary data structures"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    CURSOR

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for remembering positions in arbitrary data structures"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    CURSOR

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CURSOR

Ancestors
    ANY

Descendants
    ARRAYED_LIST_CURSOR
    CIRCULAR_CURSOR
    COMPACT_TREE_CURSOR
    HASH_TABLE_CURSOR
    LINKED_LIST_CURSOR [G]
    MULTAR_LIST_CURSOR [G]
    RECURSIVE_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for remembering positions in arbitrary data structures"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    CURSOR

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.cursors

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


HASH_TABLE_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for hash table traversal"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    HASH_TABLE_CURSOR

inherit
    CURSOR

create
    make

feature {NONE} -- Initialization

    make (pos: INTEGER) is
            -- Create a new cursor.
        do
            position := pos
        ensure
            position_set: position = pos
        end

feature {HASH_TABLE} -- Access

    position: INTEGER
            -- Cursor position

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HASH_TABLE_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for hash table traversal"
    create: make

Ancestors
    CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for hash table traversal"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    HASH_TABLE_CURSOR

create
    make

feature {NONE} -- Initialization

    make (pos: INTEGER) is
            -- Create a new cursor.
        do
            position := pos
        ensure
            position_set: position = pos
        end

feature {HASH_TABLE} -- Access

    position: INTEGER
            -- Cursor position

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for hash table traversal"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    HASH_TABLE_CURSOR

create

    make (pos: INTEGER)
            -- Create a new cursor.
        ensure
            position_set: position = pos

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HASH_TABLE_CURSOR

Ancestors
    CURSOR

Clients
    HASH_TABLE [G, H -> HASHABLE]
    HASH_TABLE_CURSOR

Suppliers
    HASH_TABLE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for hash table traversal"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    HASH_TABLE_CURSOR

create
    make

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked lists"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_LIST_CURSOR [G]

inherit
    CURSOR

create
    make

feature {LINKED_LIST} -- Initialization

    make (active_element: like active; aft, bef: BOOLEAN) is
            -- Create a cursor and set it up on active_element.
        do
            active := active_element
            after := aft
            before := bef
        end

feature {LINKED_LIST} -- Implementation

    active: LINKABLE [G]
            -- Current element in linked list

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

invariant

    not_both: not (before and after)
    no_active_not_on: active = void implies (before or after)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_LIST_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for linked lists"
    create: make

Ancestors
    CURSOR

Constraints
    not both
    no active not on

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked lists"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_LIST_CURSOR [G]

create
    make

feature {LINKED_LIST} -- Initialization

    make (active_element: like active; aft, bef: BOOLEAN) is
            -- Create a cursor and set it up on active_element.
        do
            active := active_element
            after := aft
            before := bef
        end

feature {LINKED_LIST} -- Implementation

    active: LINKABLE [G]
            -- Current element in linked list

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

invariant

    not_both: not (before and after)
    no_active_not_on: active = void implies (before or after)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked lists"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_LIST_CURSOR [G]

create

    make (active_element: like active; aft, bef: BOOLEAN)
            -- Create a cursor and set it up on active_element.

invariant

    not_both: not (before and after),
    no_active_not_on: active = void implies (before or after)
        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_LIST_CURSOR [G]

Ancestors
    CURSOR

Clients
    LINKED_LIST [G]
    LINKED_LIST_CURSOR [G]

Suppliers
    BOOLEAN
    LINKED_LIST_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked lists"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_LIST_CURSOR [G]

create
    make

invariant

    not_both: not (before and after),
    no_active_not_on: active = void implies (before or after)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked trees"
    status: "See notice at end of class"
    names: linked_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_TREE_CURSOR [G]

inherit
    RECURSIVE_TREE_CURSOR [G]
        export
            {LINKED_CURSOR_TREE} make
        redefine
            active
        end

feature {LINKED_CURSOR_TREE} -- Access

    active: LINKED_TREE [G]
            -- Current node

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_TREE_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for linked trees"

Ancestors
    RECURSIVE_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked trees"
    status: "See notice at end of class"
    names: linked_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_TREE_CURSOR [G]

feature {LINKED_CURSOR_TREE} -- Initialization

    make (active_node, parent_of_active: like active; aft, bef, bel: BOOLEAN) is
            -- Create a cursor and set it up on active_node.
            -- (from RECURSIVE_TREE_CURSOR)
        do
            active := active_node
            active_parent := parent_of_active
            after := aft
            before := bef
            below := bel
        end

feature {LINKED_CURSOR_TREE} -- Access

    active: LINKED_TREE [G]
            -- Current node

feature {RECURSIVE_CURSOR_TREE} -- Access

    active_parent: like active
            -- Parent of current node
            -- (from RECURSIVE_TREE_CURSOR)

feature {RECURSIVE_CURSOR_TREE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_TREE_CURSOR)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_TREE_CURSOR)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from RECURSIVE_TREE_CURSOR)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked trees"
    status: "See notice at end of class"
    names: linked_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_TREE_CURSOR [G]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_TREE_CURSOR [G]

Ancestors
    RECURSIVE_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for linked trees"
    status: "See notice at end of class"
    names: linked_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_TREE_CURSOR [G]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTAR_LIST_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for multi-array trees"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    MULTAR_LIST_CURSOR [G]

inherit
    CURSOR

create
    make

feature {MULTI_ARRAY_LIST} -- Initialization

    make (active_element: like active; current_active_index, current_index: INTEGER) is
            -- Create a cursor and set it up on active_element.
        do
            active := active_element
            active_index := current_active_index
            index := current_index
        end

feature {MULTI_ARRAY_LIST} -- Implementation

    active: BI_LINKABLE [ARRAYED_LIST [G]]
            -- Current element in array_sequence list

    active_index: INTEGER
            -- Index relative to active.item

    index: INTEGER
            -- Index in array_sequence list

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTAR_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTAR_LIST_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MULTAR_LIST_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for multi-array trees"
    create: make

Ancestors
    CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTAR_LIST_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for multi-array trees"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    MULTAR_LIST_CURSOR [G]

create
    make

feature {MULTI_ARRAY_LIST} -- Initialization

    make (active_element: like active; current_active_index, current_index: INTEGER) is
            -- Create a cursor and set it up on active_element.
        do
            active := active_element
            active_index := current_active_index
            index := current_index
        end

feature {MULTI_ARRAY_LIST} -- Implementation

    active: BI_LINKABLE [ARRAYED_LIST [G]]
            -- Current element in array_sequence list

    active_index: INTEGER
            -- Index relative to active.item

    index: INTEGER
            -- Index in array_sequence list

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTAR_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTAR_LIST_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for multi-array trees"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    MULTAR_LIST_CURSOR [G]

create

    make (active_element: like active; current_active_index, current_index: INTEGER)
            -- Create a cursor and set it up on active_element.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTAR_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTAR_LIST_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MULTAR_LIST_CURSOR [G]

Ancestors
    CURSOR

Clients
    MULTAR_LIST_CURSOR [G]
    MULTI_ARRAY_LIST [G]

Suppliers
    MULTAR_LIST_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTAR_LIST_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for multi-array trees"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    MULTAR_LIST_CURSOR [G]

create
    make

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTAR_LIST_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_TREE_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for recursive trees"
    status: "See notice at end of class"
    names: recursive_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    RECURSIVE_TREE_CURSOR [G]

inherit
    CURSOR

create {RECURSIVE_CURSOR_TREE}
    make

feature {RECURSIVE_CURSOR_TREE} -- Initialization

    make (active_node, parent_of_active: like active; aft, bef, bel: BOOLEAN) is
            -- Create a cursor and set it up on active_node.
        do
            active := active_node
            active_parent := parent_of_active
            after := aft
            before := bef
            below := bel
        end

feature {RECURSIVE_CURSOR_TREE} -- Access

    active: DYNAMIC_TREE [G]
            -- Current node

    active_parent: like active
            -- Parent of current node

feature {RECURSIVE_CURSOR_TREE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_TREE_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    RECURSIVE_TREE_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for recursive trees"
    create: make

Ancestors
    CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_TREE_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for recursive trees"
    status: "See notice at end of class"
    names: recursive_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    RECURSIVE_TREE_CURSOR [G]

create {RECURSIVE_CURSOR_TREE}
    make

feature {RECURSIVE_CURSOR_TREE} -- Initialization

    make (active_node, parent_of_active: like active; aft, bef, bel: BOOLEAN) is
            -- Create a cursor and set it up on active_node.
        do
            active := active_node
            active_parent := parent_of_active
            after := aft
            before := bef
            below := bel
        end

feature {RECURSIVE_CURSOR_TREE} -- Access

    active: DYNAMIC_TREE [G]
            -- Current node

    active_parent: like active
            -- Parent of current node

feature {RECURSIVE_CURSOR_TREE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_TREE_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for recursive trees"
    status: "See notice at end of class"
    names: recursive_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    RECURSIVE_TREE_CURSOR [G]

create

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_TREE_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    RECURSIVE_TREE_CURSOR [G]

Ancestors
    CURSOR

Descendants
    LINKED_TREE_CURSOR [G]
    TWO_WAY_TREE_CURSOR [G]

Clients
    RECURSIVE_CURSOR_TREE [G]
    RECURSIVE_TREE_CURSOR [G]

Suppliers
    RECURSIVE_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_TREE_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for recursive trees"
    status: "See notice at end of class"
    names: recursive_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    RECURSIVE_TREE_CURSOR [G]

create

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE_CURSOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for two-way cursor trees"
    status: "See notice at end of class"
    names: two_way_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_TREE_CURSOR [G]

inherit
    RECURSIVE_TREE_CURSOR [G]
        export
            {TWO_WAY_CURSOR_TREE} make
        redefine
            active
        end

feature {TWO_WAY_CURSOR_TREE} -- Access

    active: TWO_WAY_TREE [G]
            -- Current node

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE_CURSOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_TREE_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for two-way cursor trees"

Ancestors
    RECURSIVE_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE_CURSOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for two-way cursor trees"
    status: "See notice at end of class"
    names: two_way_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_TREE_CURSOR [G]

feature {TWO_WAY_CURSOR_TREE} -- Initialization

    make (active_node, parent_of_active: like active; aft, bef, bel: BOOLEAN) is
            -- Create a cursor and set it up on active_node.
            -- (from RECURSIVE_TREE_CURSOR)
        do
            active := active_node
            active_parent := parent_of_active
            after := aft
            before := bef
            below := bel
        end

feature {TWO_WAY_CURSOR_TREE} -- Access

    active: TWO_WAY_TREE [G]
            -- Current node

feature {RECURSIVE_CURSOR_TREE} -- Access

    active_parent: like active
            -- Parent of current node
            -- (from RECURSIVE_TREE_CURSOR)

feature {RECURSIVE_CURSOR_TREE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_TREE_CURSOR)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_TREE_CURSOR)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from RECURSIVE_TREE_CURSOR)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE_CURSOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for two-way cursor trees"
    status: "See notice at end of class"
    names: two_way_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_TREE_CURSOR [G]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE_CURSOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_TREE_CURSOR [G]

Ancestors
    RECURSIVE_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE_CURSOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursors for two-way cursor trees"
    status: "See notice at end of class"
    names: two_way_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_TREE_CURSOR [G]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE_CURSOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.cursor_tree

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.cursor_tree	(diagram)

Supercluster
    base.structures

Classes
    COMPACT_CURSOR_TREE [G]
    CURSOR_TREE [G]
    LINKED_CURSOR_TREE [G]
    RECURSIVE_CURSOR_TREE [G]
    TWO_WAY_CURSOR_TREE [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_CURSOR_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Compact trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: compact_cursor_tree, cursor_tree
    representation: array
    access: cursor, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    COMPACT_CURSOR_TREE [G]

inherit
    CURSOR_TREE [G]
        rename
            index as linear_index
        redefine
            put_left,
            put_right,
            extend,
            has,
            occurrences
        end

create
    make

feature -- Initialization

    make (i: INTEGER) is
            -- Create an empty tree.
            -- i is an estimate of the number of nodes.
        do
            last := 1
            active := 1
            above := True
            create item_table.make (1, i + 1)
            create next_sibling_table.make (1, i + 1)
            create first_child_table.make (1, i + 1)
        ensure
            is_above: above
            is_empty: is_empty
        end

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                item_table.compare_objects
            else
                item_table.compare_references
            end
            Result := item_table.has (v)
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                item_table.compare_objects
            else
                item_table.compare_references
            end
            Result := item_table.occurrences (v)
        end

    item: G is
            -- Current item
        do
            Result := item_table.item (active)
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {COMPACT_TREE_CURSOR} Result.make (active, after, before, below, above)
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
        local
            index: INTEGER
        do
            index := first_child_table.item (active)
            from
            until
                index <= 0
            loop
                Result := Result + 1
                index := next_sibling_table.item (index)
            end
        end

    count: INTEGER is
            -- Number of items in subtree
        do
            Result := last - free_list_count - 1
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    above: BOOLEAN
            -- Is there no valid cursor position above the cursor?

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
        local
            index: INTEGER
        do
            if not off then
                from
                    index := next_sibling_table.item (active)
                until
                    index <= 0
                loop
                    index := next_sibling_table.item (index)
                end
                Result := (index = 0) or else (first_child_table.item (- index) = active)
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
        do
            if not off then
                Result := (next_sibling_table.item (active) <= 0)
            end
        end

    is_root: BOOLEAN is
            -- Is cursor on root?
        do
            if not off then
                Result := next_sibling_table.item (active) = 0
            end
        end

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN is
        do
            Result := count = 0
        end

    prunable: BOOLEAN is
        do
            Result := True
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            temp: COMPACT_TREE_CURSOR
        do
            temp ?= p
            if temp /= void then
                Result := (first_child_table.item (temp.active) /= removed_mark)
            end
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
        local
            index, next: INTEGER
        do
            if below then
                check
                    after
                end
                after := False
                before := True
            elseif after then
                after := False
            else
                from
                    index := next_sibling_table.item (active)
                until
                    index <= 0
                loop
                    index := next_sibling_table.item (index)
                end
                if index = 0 then
                    before := True
                elseif first_child_table.item (- index) = active then
                    before := True
                else
                    from
                        index := first_child_table.item (- index)
                        next := next_sibling_table.item (index)
                    until
                        next = active
                    loop
                        index := next
                        next := next_sibling_table.item (index)
                    end
                    active := index
                end
            end
        end

    forth is
            -- Move cursor one position forward.
        do
            if below then
                check
                    before
                end
                before := False
                after := True
            elseif before then
                before := False
            elseif islast then
                after := True
            else
                active := next_sibling_table.item (active)
            end
        end

    up is
            -- Move cursor one level upward, to parent
            -- or above if is_root holds.
        local
            index: INTEGER
        do
            if below then
                below := False
            else
                from
                    index := next_sibling_table.item (active)
                until
                    index <= 0
                loop
                    index := next_sibling_table.item (index)
                end
                if index = 0 then
                    above := True
                else
                    active := - index
                end
            end
            after := False
            before := False
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require else
            True
        local
            index, next, counter: INTEGER
        do
            index := first_child_table.item (active)
            if above then
                above := False
                below := is_empty
                before := is_empty
                after := False
            elseif index <= 0 then
                below := True;
                if i = 0 then
                    before := True;
                    after := False
                else
                    after := True;
                    before := False
                end
            else
                from
                    next := next_sibling_table.item (index)
                until
                    counter = i or next <= 0
                loop
                    index := next
                    next := next_sibling_table.item (index)
                    counter := counter + 1
                end
                active := index
                if i = 0 then
                    before := True
                    after := False
                elseif counter < i then
                    after := True;
                    before := False
                end
            end
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        local
            temp: COMPACT_TREE_CURSOR
        do
            temp ?= p
            check
                temp /= void
            end
            active := temp.active
            after := temp.after
            before := temp.before
            below := temp.below
            above := temp.above
        end

feature -- Element change

    replace (v: G) is
            -- Replace current item by v
        require else
            is_writable: writable
        do
            item_table.put (v, active)
        end

    put_right (v: G) is
            -- Add a leaf v to the right of cursor position.
        local
            new: INTEGER
        do
            new := new_cell_index
            first_child_table.put (0, new)
            if below then
                first_child_table.put (new, active)
                next_sibling_table.put (- active, new)
                item_table.put (v, new)
                active := new
            elseif before then
                item_table.put (item_table.item (active), new);
                next_sibling_table.put (next_sibling_table.item (active), new);
                first_child_table.put (first_child_table.item (active), new);
                item_table.put (v, active);
                next_sibling_table.put (new, active);
                first_child_table.put (0, active);
                active := new
            else
                next_sibling_table.put (next_sibling_table.item (active), new)
                next_sibling_table.put (new, active)
            end
        end

    put_left (v: G) is
            -- Add v to the left of current position.
        require else
            not_above: not above
        local
            new: INTEGER
        do
            new := new_cell_index
            if below then
                first_child_table.put (new, active)
                next_sibling_table.put (- active, new)
                item_table.put (v, new)
            else
                item_table.put (item_table.item (active), new)
                next_sibling_table.put (next_sibling_table.item (active), new)
                first_child_table.put (first_child_table.item (active), new)
                item_table.put (v, active)
                next_sibling_table.put (new, active)
                first_child_table.put (0, active)
            end
            active := new
        end

    put_front (v: G) is
            -- Add a leaf v as first child.
            -- If above and is_empty, make v the root value
        local
            old_active: like active
            new: INTEGER
        do
            new := new_cell_index
            if below then
                item_table.put (v, new)
                first_child_table.put (0, new)
                next_sibling_table.put (- active, new)
                active := new
            elseif before then
                item_table.put (item_table.item (active), new);
                next_sibling_table.put (next_sibling_table.item (active), new);
                first_child_table.put (first_child_table.item (active), new);
                item_table.put (v, active);
                next_sibling_table.put (new, active);
                first_child_table.put (0, active);
                active := new
            else
                old_active := active
                up
                item_table.put (v, new)
                next_sibling_table.put (first_child_table.item (active), new)
                first_child_table.put (new, active)
                active := old_active
            end
        end

    put_parent (v: G) is
            -- insert a new node, with value v, as parent of
            -- current node and
            -- with the same position
            --if above or on root, add a new root
        require
            not after
            not before
        local
            new, old_index: INTEGER
        do
            new := new_cell_index
            old_index := active
            if is_empty then
                active := new
                item_table.put (v, new)
                next_sibling_table.put (0, new)
                first_child_table.put (0, new)
            else
                item_table.put (item, new)
                first_child_table.put (first_child_table.item (active), new)
                next_sibling_table.put (- active, new)
                item_table.put (v, active)
            end
        end

    extend (v: G) is
        local
            new, index, next: INTEGER
        do
            new := new_cell_index
            item_table.put (v, new)
            if below then
                first_child_table.put (0, new)
                next_sibling_table.put (- active, new)
                if first_child_table.item (active) = 0 then
                    first_child_table.put (new, active)
                end
                active := new
            else
                from
                    index := active
                    next := next_sibling_table.item (index)
                until
                    next <= 0
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                check
                    next < 0
                end
                next_sibling_table.put (next, new)
                next_sibling_table.put (new, index)
            end
        end

feature -- Removal

    remove is
            -- Remove node at cursor position
            -- (and consequently the corresponding subtree).
            -- Move cursor to next sibling, or after if none.
        local
            removed, index, next: INTEGER
        do
            removed := active
            up
            if first_child_table.item (active) = removed then
                index := next_sibling_table.item (removed)
                if index > 0 then
                    first_child_table.put (index, active)
                    active := index
                else
                    first_child_table.put (0, active)
                    below := True
                    after := True
                end
            else
                from
                    index := first_child_table.item (active)
                    next := next_sibling_table.item (index)
                until
                    next = removed
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                next_sibling_table.put (next_sibling_table.item (removed), index)
                if next_sibling_table.item (removed) > 0 then
                    active := next_sibling_table.item (removed)
                else
                    active := index
                    after := True
                end
            end
            remove_subtree (removed)
        ensure then
            not_before: not before
        end

    remove_node is
            -- Remove node at cursor position; insert children into
            -- parent's children at current position; move cursor up.
            -- If node is root, it must not have more than one child.
        require
            not_off: not off
            is_root implies arity <= 1
        local
            old_active, next, index, first_child_index: INTEGER
            default_value: G
        do
            old_active := active
            first_child_index := first_child_table.item (old_active)
            up
            next := first_child_table.item (active)
            if next = old_active then
                first_child_table.put (next_sibling_table.item (old_active), active)
            else
                from
                until
                    next = old_active
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                next_sibling_table.put (first_child_index, index)
                from
                    next := first_child_index
                until
                    next <= 0
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                next_sibling_table.put (next_sibling_table.item (old_active), index)
            end
            if old_active = last then
                last := last - 1
            else
                item_table.put (default_value, old_active)
                first_child_table.put (removed_mark, old_active)
                next_sibling_table.put (free_list_index, old_active)
                free_list_index := old_active
                free_list_count := free_list_count + 1
            end
        end

    wipe_out is
            -- Remove all items.
        do
            item_table.resize (1, block_threshold + 1)
            next_sibling_table.resize (1, block_threshold + 1)
            first_child_table.resize (1, block_threshold + 1)
            item_table.clear_all
            next_sibling_table.clear_all
            first_child_table.clear_all
            last := 1
            active := 1
            free_list_count := 0
            free_list_index := 0
            above := True
            after := False
            before := False
            below := False
        ensure then
            cursor_above: above
        end

feature {COMPACT_CURSOR_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (block_threshold)
        end

feature {NONE} -- Implementation

    item_table: ARRAY [G]
            -- Array containing the items

    first_child_table: ARRAY [INTEGER]
            -- Indices to the first child

    next_sibling_table: ARRAY [INTEGER]
            -- Indices to siblings

    active: INTEGER
            -- Index of current item

    Removed_mark: INTEGER is -1
            -- Mark for removed child in first_child_table

    last: INTEGER
            -- Index into item_table; yields last item

    free_list_index: INTEGER
            -- Index to first empty space in item_table

    free_list_count: INTEGER
            -- Number of empty spaces in item_table

    remove_subtree (i: INTEGER) is
        local
            index, next: INTEGER
            default_value: G
        do
            from
                index := first_child_table.item (i)
            until
                index <= 0
            loop
                next := next_sibling_table.item (index)
                remove_subtree (index)
                index := next
            end
            if i = last then
                last := last - 1
            else
                item_table.put (default_value, i)
                first_child_table.put (removed_mark, i)
                next_sibling_table.put (free_list_index, i)
                free_list_index := i
                free_list_count := free_list_count + 1
            end
        end

    new_cell_index: INTEGER is
        local
            default_value: like item
        do
            if free_list_index > 0 then
                Result := free_list_index
                free_list_index := next_sibling_table.item (Result)
                free_list_count := free_list_count - 1
            else
                last := last + 1
                item_table.force (default_value, last)
                next_sibling_table.force (0, last)
                first_child_table.force (0, last)
                Result := last
            end
        end

    block_threshold: INTEGER is
        do
            Result := 10
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_CURSOR_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    COMPACT_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Compact trees as active structures that may be traversed using a cursor"
    create: make

Ancestors
    CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] COMPACT_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] COMPACT_CURSOR_TREE [G]
    prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] COMPACT_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    make (i: INTEGER)
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_front (v: G)
    put_left (v: G)
    put_parent (v: G)
    put_right (v: G)
    remove
    remove_node
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_CURSOR_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Compact trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: compact_cursor_tree, cursor_tree
    representation: array
    access: cursor, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    COMPACT_CURSOR_TREE [G]

create
    make

feature -- Initialization

    make (i: INTEGER) is
            -- Create an empty tree.
            -- i is an estimate of the number of nodes.
        do
            last := 1
            active := 1
            above := True
            create item_table.make (1, i + 1)
            create next_sibling_table.make (1, i + 1)
            create first_child_table.make (1, i + 1)
        ensure
            is_above: above
            is_empty: is_empty
        end

feature -- Access

    child_item (i: INTEGER): G is
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := item
            go_to (pos)
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {COMPACT_TREE_CURSOR} Result.make (active, after, before, below, above)
        end

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                item_table.compare_objects
            else
                item_table.compare_references
            end
            Result := item_table.has (v)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := item_table.item (active)
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                item_table.compare_objects
            else
                item_table.compare_references
            end
            Result := item_table.occurrences (v)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent_item: G is
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := item
            go_to (pos)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    preorder_forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    preorder_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature {NONE} -- Access

    linear_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    linear_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                preorder_forth
                search (v)
            end
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
        require -- from HIERARCHICAL
            not_off: not off
        local
            index: INTEGER
        do
            index := first_child_table.item (active)
            from
            until
                index <= 0
            loop
                Result := Result + 1
                index := next_sibling_table.item (index)
            end
        end

    breadth: INTEGER is
            -- Breadth of current level
            -- (from CURSOR_TREE)
        local
            l: INTEGER
            pos: CURSOR
        do
            l := level
            if l > 0 then
                pos := cursor
                go_above
                Result := breadth_of_level_from_active (l + 1)
                go_to (pos)
            end
        end

    count: INTEGER is
            -- Number of items in subtree
        do
            Result := last - free_list_count - 1
        end

    depth: INTEGER is
            -- Depth of the tree
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                go_above
                Result := depth_from_active - 1
                go_to (pos)
            end
        end

    level: INTEGER is
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            from
                pos := cursor
            until
                above
            loop
                Result := Result + 1
                up
            end
            go_to (pos)
        end

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above the cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from CURSOR_TREE)
        do
            Result := not above and then (level = 1) implies is_empty
        end

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN is
        do
            Result := count = 0
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_leaf: BOOLEAN is
            -- Is cursor on a leaf?
            -- (from CURSOR_TREE)
        do
            if not off then
                Result := (arity = 0)
            end
        end

    is_root: BOOLEAN is
            -- Is cursor on root?
        do
            if not off then
                Result := next_sibling_table.item (active) = 0
            end
        end

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
        local
            index: INTEGER
        do
            if not off then
                from
                    index := next_sibling_table.item (active)
                until
                    index <= 0
                loop
                    index := next_sibling_table.item (index)
                end
                Result := (index = 0) or else (first_child_table.item (- index) = active)
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
        do
            if not off then
                Result := (next_sibling_table.item (active) <= 0)
            end
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)
        do
            Result := (after or before or below or above)
        end

    prunable: BOOLEAN is
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            temp: COMPACT_TREE_CURSOR
        do
            temp ?= p
            if temp /= void then
                Result := (first_child_table.item (temp.active) /= removed_mark)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)
        do
            Result := i >= 0 and i <= (arity + 1)
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    linear_off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
        local
            index, next: INTEGER
        do
            if below then
                check
                    after
                end
                after := False
                before := True
            elseif after then
                after := False
            else
                from
                    index := next_sibling_table.item (active)
                until
                    index <= 0
                loop
                    index := next_sibling_table.item (index)
                end
                if index = 0 then
                    before := True
                elseif first_child_table.item (- index) = active then
                    before := True
                else
                    from
                        index := first_child_table.item (- index)
                        next := next_sibling_table.item (index)
                    until
                        next = active
                    loop
                        index := next
                        next := next_sibling_table.item (index)
                    end
                    active := index
                end
            end
        end

    breadth_forth is
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        local
            l: INTEGER
        do
            l := level
            level_forth
            if above and (l < depth) then
                start_on_level (l + 1)
            end
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        require else
            True
        local
            index, next, counter: INTEGER
        do
            index := first_child_table.item (active)
            if above then
                above := False
                below := is_empty
                before := is_empty
                after := False
            elseif index <= 0 then
                below := True;
                if i = 0 then
                    before := True;
                    after := False
                else
                    after := True;
                    before := False
                end
            else
                from
                    next := next_sibling_table.item (index)
                until
                    counter = i or next <= 0
                loop
                    index := next
                    next := next_sibling_table.item (index)
                    counter := counter + 1
                end
                active := index
                if i = 0 then
                    before := True
                    after := False
                elseif counter < i then
                    after := True;
                    before := False
                end
            end
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before
        end

    forth is
            -- Move cursor one position forward.
        do
            if below then
                check
                    before
                end
                before := False
                after := True
            elseif before then
                before := False
            elseif islast then
                after := True
            else
                active := next_sibling_table.item (active)
            end
        end

    go_last_child is
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above
        do
            up
            down (arity)
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            temp: COMPACT_TREE_CURSOR
        do
            temp ?= p
            check
                temp /= void
            end
            active := temp.active
            after := temp.after
            before := temp.before
            below := temp.below
            above := temp.above
        end

    level_back is
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)
        do
            if not isfirst then
                back
            elseif not above then
                from
                    up
                    level_back
                until
                    above or else not is_leaf
                loop
                    level_back
                end;
                if not above then
                    down (arity)
                end
            end
        end

    level_forth is
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)
        do
            if not above and then not islast then
                forth
            elseif not above then
                from
                    up
                    level_forth
                until
                    above or else not is_leaf
                loop
                    level_forth
                end;
                if not above then
                    down (1)
                end
            end
        end

    postorder_forth is
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        do
            if islast then
                up
            else
                forth
                from
                until
                    is_leaf
                loop
                    down (1)
                end
            end
        end

    postorder_start is
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)
        do
            from
                go_above
            until
                arity = 0
            loop
                down (1)
            end
        end

    preorder_forth is
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after
        do
            if is_leaf then
                from
                until
                    not islast
                loop
                    up
                end
                if not above then
                    forth
                end
            else
                down (1)
            end
        end

    start is
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        do
            go_above
            if not is_empty then
                down (1)
            end
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root
        end

    start_on_level (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        do
            go_above
            start_on_level_from_active (l + 1)
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst
        end

    up is
            -- Move cursor one level upward, to parent
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        local
            index: INTEGER
        do
            if below then
                below := False
            else
                from
                    index := next_sibling_table.item (active)
                until
                    index <= 0
                loop
                    index := next_sibling_table.item (index)
                end
                if index = 0 then
                    above := True
                else
                    active := - index
                end
            end
            after := False
            before := False
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)
        end

feature -- Element change

    extend (v: G) is
        require -- from COLLECTION
            extendible: extendible
        local
            new, index, next: INTEGER
        do
            new := new_cell_index
            item_table.put (v, new)
            if below then
                first_child_table.put (0, new)
                next_sibling_table.put (- active, new)
                if first_child_table.item (active) = 0 then
                    first_child_table.put (new, active)
                end
                active := new
            else
                from
                    index := active
                    next := next_sibling_table.item (index)
                until
                    next <= 0
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                check
                    next < 0
                end
                next_sibling_table.put (next, new)
                next_sibling_table.put (new, index)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    container_fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill (other: CURSOR_TREE [G]) is
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty
        do
            go_above
            if not other.is_empty then
                other.start
                down (0)
                put_right (other.item)
                forth
                fill_from_active (other)
            end
        end

    fill_from_active (other: CURSOR_TREE [G]) is
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf
        do
            if not other.is_leaf then
                from
                    other.down (1)
                    down (0)
                until
                    other.after
                loop
                    put_right (other.item)
                    forth
                    fill_from_active (other)
                    other.forth
                end
                other.up
                up
            end
        end

    merge_left (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            merge_right (other)
        end

    merge_right (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        local
            pos: CURSOR
        do
            if not other.is_empty then
                pos := other.cursor
                other.start
                put_right (other.item)
                forth
                if not other.is_leaf then
                    down (0)
                    other.down (0)
                    from
                    until
                        other.islast
                    loop
                        other.forth
                        merge_right (other.subtree)
                    end
                    up
                end
                other.go_to (pos)
            end
        end

    put (v: G) is
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    put_front (v: G) is
            -- Add a leaf v as first child.
            -- If above and is_empty, make v the root value
        local
            old_active: like active
            new: INTEGER
        do
            new := new_cell_index
            if below then
                item_table.put (v, new)
                first_child_table.put (0, new)
                next_sibling_table.put (- active, new)
                active := new
            elseif before then
                item_table.put (item_table.item (active), new);
                next_sibling_table.put (next_sibling_table.item (active), new);
                first_child_table.put (first_child_table.item (active), new);
                item_table.put (v, active);
                next_sibling_table.put (new, active);
                first_child_table.put (0, active);
                active := new
            else
                old_active := active
                up
                item_table.put (v, new)
                next_sibling_table.put (first_child_table.item (active), new)
                first_child_table.put (new, active)
                active := old_active
            end
        end

    put_left (v: G) is
            -- Add v to the left of current position.
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        require else
            not_above: not above
        local
            new: INTEGER
        do
            new := new_cell_index
            if below then
                first_child_table.put (new, active)
                next_sibling_table.put (- active, new)
                item_table.put (v, new)
            else
                item_table.put (item_table.item (active), new)
                next_sibling_table.put (next_sibling_table.item (active), new)
                first_child_table.put (first_child_table.item (active), new)
                item_table.put (v, active)
                next_sibling_table.put (new, active)
                first_child_table.put (0, active)
            end
            active := new
        end

    put_parent (v: G) is
            -- insert a new node, with value v, as parent of
            -- current node and
            -- with the same position
            --if above or on root, add a new root
        require
            not after
            not before
        local
            new, old_index: INTEGER
        do
            new := new_cell_index
            old_index := active
            if is_empty then
                active := new
                item_table.put (v, new)
                next_sibling_table.put (0, new)
                first_child_table.put (0, new)
            else
                item_table.put (item, new)
                first_child_table.put (first_child_table.item (active), new)
                next_sibling_table.put (- active, new)
                item_table.put (v, active)
            end
        end

    put_right (v: G) is
            -- Add a leaf v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        local
            new: INTEGER
        do
            new := new_cell_index
            first_child_table.put (0, new)
            if below then
                first_child_table.put (new, active)
                next_sibling_table.put (- active, new)
                item_table.put (v, new)
                active := new
            elseif before then
                item_table.put (item_table.item (active), new);
                next_sibling_table.put (next_sibling_table.item (active), new);
                first_child_table.put (first_child_table.item (active), new);
                item_table.put (v, active);
                next_sibling_table.put (new, active);
                first_child_table.put (0, active);
                active := new
            else
                next_sibling_table.put (next_sibling_table.item (active), new)
                next_sibling_table.put (new, active)
            end
        end

    replace (v: G) is
            -- Replace current item by v
        require -- from ACTIVE
            writable: writable
        require else
            is_writable: writable
        do
            item_table.put (v, active)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove node at cursor position
            -- (and consequently the corresponding subtree).
            -- Move cursor to next sibling, or after if none.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            removed, index, next: INTEGER
        do
            removed := active
            up
            if first_child_table.item (active) = removed then
                index := next_sibling_table.item (removed)
                if index > 0 then
                    first_child_table.put (index, active)
                    active := index
                else
                    first_child_table.put (0, active)
                    below := True
                    after := True
                end
            else
                from
                    index := first_child_table.item (active)
                    next := next_sibling_table.item (index)
                until
                    next = removed
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                next_sibling_table.put (next_sibling_table.item (removed), index)
                if next_sibling_table.item (removed) > 0 then
                    active := next_sibling_table.item (removed)
                else
                    active := index
                    after := True
                end
            end
            remove_subtree (removed)
        ensure then
            not_before: not before
        end

    remove_node is
            -- Remove node at cursor position; insert children into
            -- parent's children at current position; move cursor up.
            -- If node is root, it must not have more than one child.
        require
            not_off: not off
            is_root implies arity <= 1
        local
            old_active, next, index, first_child_index: INTEGER
            default_value: G
        do
            old_active := active
            first_child_index := first_child_table.item (old_active)
            up
            next := first_child_table.item (active)
            if next = old_active then
                first_child_table.put (next_sibling_table.item (old_active), active)
            else
                from
                until
                    next = old_active
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                next_sibling_table.put (first_child_index, index)
                from
                    next := first_child_index
                until
                    next <= 0
                loop
                    index := next
                    next := next_sibling_table.item (index)
                end
                next_sibling_table.put (next_sibling_table.item (old_active), index)
            end
            if old_active = last then
                last := last - 1
            else
                item_table.put (default_value, old_active)
                first_child_table.put (removed_mark, old_active)
                next_sibling_table.put (free_list_index, old_active)
                free_list_index := old_active
                free_list_count := free_list_count + 1
            end
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            item_table.resize (1, block_threshold + 1)
            next_sibling_table.resize (1, block_threshold + 1)
            first_child_table.resize (1, block_threshold + 1)
            item_table.clear_all
            next_sibling_table.clear_all
            first_child_table.clear_all
            last := 1
            active := 1
            free_list_count := 0
            free_list_index := 0
            above := True
            after := False
            before := False
            below := False
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            cursor_above: above
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    child_tree (i: INTEGER): like Current is
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := subtree
            go_to (pos)
        end

    parent_tree: like Current is
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := subtree
            go_to (pos)
        end

    subtree: like Current is
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        do
            Result := new_tree
            Result.go_above
            Result.down (0)
            Result.put_right (item)
            Result.forth
            Result.fill_from_active (Current)
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove item v.
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {COMPACT_CURSOR_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (block_threshold)
        ensure -- from CURSOR_TREE
            result_exists: Result /= void
            result_is_empty: Result.is_empty
        end

feature {NONE} -- Implementation

    active: INTEGER
            -- Index of current item

    block_threshold: INTEGER is
        do
            Result := 10
        end

    breadth_of_level_from_active (a_level: INTEGER): INTEGER is
            -- Breadth of level level of subtree starting at current node
            -- (from CURSOR_TREE)
        do
            if (a_level = 2) or else is_leaf then
                Result := arity
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result + breadth_of_level_from_active (a_level - 1)
                    forth
                end
                up
            end
        end

    depth_from_active: INTEGER is
            -- Depth of subtree starting at active
            -- (from CURSOR_TREE)
        do
            if not off and then arity = 0 then
                Result := 1
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result.max (depth_from_active + 1)
                    forth
                end
                up
            end
        end

    first_child_table: ARRAY [INTEGER]
            -- Indices to the first child

    free_list_count: INTEGER
            -- Number of empty spaces in item_table

    free_list_index: INTEGER
            -- Index to first empty space in item_table

    item_table: ARRAY [G]
            -- Array containing the items

    last: INTEGER
            -- Index into item_table; yields last item

    new_cell_index: INTEGER is
        local
            default_value: like item
        do
            if free_list_index > 0 then
                Result := free_list_index
                free_list_index := next_sibling_table.item (Result)
                free_list_count := free_list_count - 1
            else
                last := last + 1
                item_table.force (default_value, last)
                next_sibling_table.force (0, last)
                first_child_table.force (0, last)
                Result := last
            end
        end

    next_sibling_table: ARRAY [INTEGER]
            -- Indices to siblings

    remove_subtree (i: INTEGER) is
        local
            index, next: INTEGER
            default_value: G
        do
            from
                index := first_child_table.item (i)
            until
                index <= 0
            loop
                next := next_sibling_table.item (index)
                remove_subtree (index)
                index := next
            end
            if i = last then
                last := last - 1
            else
                item_table.put (default_value, i)
                first_child_table.put (removed_mark, i)
                next_sibling_table.put (free_list_index, i)
                free_list_index := i
                free_list_count := free_list_count + 1
            end
        end

    Removed_mark: INTEGER is -1
            -- Mark for removed child in first_child_table

    start_on_level_from_active (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from active.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            deep_enough: depth_from_active >= l
        do
            from
                down (1)
            until
                depth_from_active >= l - 1
            loop
                forth
            end
            if (l > 2) then
                start_on_level_from_active (l - 1)
            end
        end

feature {CURSOR_TREE} -- Implementation

    go_above is
            -- Move the cursor above the tree
            -- (from CURSOR_TREE)
        do
            from
            until
                above
            loop
                up
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                preorder_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                preorder_forth
            end
        end

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature {NONE} -- Not applicable

    linear_index: INTEGER is
            -- (from CURSOR_TREE)
        do
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_CURSOR_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Compact trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: compact_cursor_tree, cursor_tree
    representation: array
    access: cursor, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    COMPACT_CURSOR_TREE [G]

create

    make (i: INTEGER)
            -- Create an empty tree.
            -- i is an estimate of the number of nodes.
        ensure
            is_above: above
            is_empty: is_empty

feature -- Initialization

    make (i: INTEGER)
            -- Create an empty tree.
            -- i is an estimate of the number of nodes.
        ensure
            is_above: above
            is_empty: is_empty

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children
        require -- from HIERARCHICAL
            not_off: not off

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in subtree

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above the cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from CURSOR_TREE)

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Is cursor on a leaf?
            -- (from CURSOR_TREE)

    is_root: BOOLEAN
            -- Is cursor on root?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    prunable: BOOLEAN

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        require else
            True
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward, to parent
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    extend (v: G)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_front (v: G)
            -- Add a leaf v as first child.
            -- If above and is_empty, make v the root value

    put_left (v: G)
            -- Add v to the left of current position.
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        require else
            not_above: not above

    put_parent (v: G)
            -- insert a new node, with value v, as parent of
            -- current node and
            -- with the same position
            --if above or on root, add a new root
        require
            not after
            not before

    put_right (v: G)
            -- Add a leaf v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    replace (v: G)
            -- Replace current item by v
        require -- from ACTIVE
            writable: writable
        require else
            is_writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding subtree).
            -- Move cursor to next sibling, or after if none.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then
            not_before: not before

    remove_node
            -- Remove node at cursor position; insert children into
            -- parent's children at current position; move cursor up.
            -- If node is root, it must not have more than one child.
        require
            not_off: not off
            is_root implies arity <= 1

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_CURSOR_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    COMPACT_CURSOR_TREE [G]

Ancestors
    CURSOR_TREE [G]

Clients
    COMPACT_CURSOR_TREE [G]

Suppliers
    ARRAY [G]
    BOOLEAN
    COMPACT_CURSOR_TREE [G]
    COMPACT_TREE_CURSOR
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPACT_CURSOR_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Compact trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: compact_cursor_tree, cursor_tree
    representation: array
    access: cursor, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    COMPACT_CURSOR_TREE [G]

create
    make

feature -- Initialization

    make (i: INTEGER)
            -- Create an empty tree.
            -- i is an estimate of the number of nodes.
        ensure
            is_above: above
            is_empty: is_empty

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)

    item: G
            -- Current item

    cursor: CURSOR
            -- Current cursor position

feature -- Measurement

    arity: INTEGER
            -- Number of children

    count: INTEGER
            -- Number of items in subtree

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    above: BOOLEAN
            -- Is there no valid cursor position above the cursor?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    is_root: BOOLEAN
            -- Is cursor on root?

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN

    prunable: BOOLEAN

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    forth
            -- Move cursor one position forward.

    up
            -- Move cursor one level upward, to parent
            -- or above if is_root holds.

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require else
            True

    go_to (p: CURSOR)
            -- Move cursor to position p.

feature -- Element change

    replace (v: G)
            -- Replace current item by v
        require else
            is_writable: writable

    put_right (v: G)
            -- Add a leaf v to the right of cursor position.

    put_left (v: G)
            -- Add v to the left of current position.
        require else
            not_above: not above

    put_front (v: G)
            -- Add a leaf v as first child.
            -- If above and is_empty, make v the root value

    put_parent (v: G)
            -- insert a new node, with value v, as parent of
            -- current node and
            -- with the same position
            --if above or on root, add a new root
        require
            not after
            not before

    extend (v: G)

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding subtree).
            -- Move cursor to next sibling, or after if none.
        ensure then
            not_before: not before

    remove_node
            -- Remove node at cursor position; insert children into
            -- parent's children at current position; move cursor up.
            -- If node is root, it must not have more than one child.
        require
            not_off: not off
            is_root implies arity <= 1

    wipe_out
            -- Remove all items.
        ensure then
            cursor_above: above

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: cursor_tree, tree
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    CURSOR_TREE [G]

inherit
    HIERARCHICAL [G]
        rename
            successor_count as arity
        end

    CURSOR_STRUCTURE [G]
        rename
            fill as container_fill
        export
            {NONE} prune_all
        end

    LINEAR [G]
        rename
            forth as preorder_forth,
            finish as go_last_child,
            occurrences as linear_occurrences,
            has as linear_has,
            off as linear_off,
            do_all as linear_do_all,
            do_if as linear_do_if,
            there_exists as linear_there_exists,
            for_all as linear_for_all
        export
            {ANY} all,
            {NONE} linear_occurrences, linear_has, linear_off
        end

    LINEAR [G]
        rename
            forth as preorder_forth,
            finish as go_last_child,
            do_all as linear_do_all,
            do_if as linear_do_if,
            there_exists as linear_there_exists,
            for_all as linear_for_all
        redefine
            occurrences,
            has,
            off
        select
            occurrences,
            has,
            off,
            linear_do_all,
            linear_do_if,
            linear_there_exists,
            linear_for_all
        end

feature -- Access

    parent_item: G is
            -- Item in parent.
        require
            not_on_root: not is_root
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := item
            go_to (pos)
        end

    child_item (i: INTEGER): G is
            -- Item in i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := item
            go_to (pos)
        end

    has (v: G): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_has (v)
            go_to (pos)
        end

    occurrences (v: G): INTEGER is
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_occurrences (v)
            go_to (pos)
        end

feature -- Measurement

    depth: INTEGER is
            -- Depth of the tree
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                go_above
                Result := depth_from_active - 1
                go_to (pos)
            end
        end

    level: INTEGER is
            -- Level of current node in tree
            -- (Root is on level 1)
        local
            pos: CURSOR
        do
            from
                pos := cursor
            until
                above
            loop
                Result := Result + 1
                up
            end
            go_to (pos)
        end

    breadth: INTEGER is
            -- Breadth of current level
        local
            l: INTEGER
            pos: CURSOR
        do
            l := level
            if l > 0 then
                pos := cursor
                go_above
                Result := breadth_of_level_from_active (l + 1)
                go_to (pos)
            end
        end

feature -- Status report

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not off
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := not off
        end

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := not above and then (level = 1) implies is_empty
        end

    is_leaf: BOOLEAN is
            -- Is cursor on a leaf?
        do
            if not off then
                Result := (arity = 0)
            end
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (True if is_empty)
        do
            Result := (after or before or below or above)
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
        deferred
        end

    above: BOOLEAN is
            -- Is there no valid cursor position above cursor?
        deferred
        end

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
        deferred
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
        deferred
        end

    is_root: BOOLEAN is
            -- Is cursor on root?
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
        do
            Result := i >= 0 and i <= (arity + 1)
        end

feature -- Cursor movement

    start is
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
        do
            go_above
            if not is_empty then
                down (1)
            end
        ensure then
            on_root_unless_empty: not is_empty implies is_root
        end

    go_last_child is
            -- Go to the last child of current parent.
            -- No effect if below
        require else
            not_above: not above
        do
            up
            down (arity)
        end

    back is
            -- Move cursor one position backward.
        deferred
        end

    forth is
            -- Move cursor one position forward.
        deferred
        end

    up is
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require else
            not_above: not above
        deferred
        ensure then
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require else
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        deferred
        ensure then
            gone_before: (i = 0) implies before
        end

    preorder_forth is
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
        do
            if is_leaf then
                from
                until
                    not islast
                loop
                    up
                end
                if not above then
                    forth
                end
            else
                down (1)
            end
        end

    postorder_forth is
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
        require
            not_off: not off
        do
            if islast then
                up
            else
                forth
                from
                until
                    is_leaf
                loop
                    down (1)
                end
            end
        end

    breadth_forth is
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
        require
            not_off: not off
        local
            l: INTEGER
        do
            l := level
            level_forth
            if above and (l < depth) then
                start_on_level (l + 1)
            end
        end

    start_on_level (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
        require
            argument_within_bounds: l >= 1 and then depth >= l
        do
            go_above
            start_on_level_from_active (l + 1)
        ensure
            level_expected: level = l
            is_first: isfirst
        end

    level_forth is
            -- Move cursor to next position of current level.
        do
            if not above and then not islast then
                forth
            elseif not above then
                from
                    up
                    level_forth
                until
                    above or else not is_leaf
                loop
                    level_forth
                end;
                if not above then
                    down (1)
                end
            end
        end

    level_back is
            -- Move cursor to previous position of current level.
        do
            if not isfirst then
                back
            elseif not above then
                from
                    up
                    level_back
                until
                    above or else not is_leaf
                loop
                    level_back
                end;
                if not above then
                    down (arity)
                end
            end
        end

    postorder_start is
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
        do
            from
                go_above
            until
                arity = 0
            loop
                down (1)
            end
        end

feature -- Element change

    put (v: G) is
            -- Put v at cursor position.
            -- (Synonym for replace)
        do
            replace (v)
        end

    extend (v: G) is
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        local
            pos: CURSOR
        do
            pos := cursor
            go_last_child
            put_right (v)
            go_to (pos)
            if below then
                below := False
                down (0)
            end
        end

    put_left (v: G) is
            -- Add v to the left of cursor position.
        require
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            put_right (v)
            forth
            forth
        end

    put_right (v: G) is
            -- Add v to the right of cursor position.
        require
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        deferred
        end

    fill (other: CURSOR_TREE [G]) is
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            is_empty: is_empty
        do
            go_above
            if not other.is_empty then
                other.start
                down (0)
                put_right (other.item)
                forth
                fill_from_active (other)
            end
        end

    fill_from_active (other: CURSOR_TREE [G]) is
            -- Copy subtree of other's active node
            -- onto active node of current tree.
        require
            cursor_on_leaf: is_leaf
        do
            if not other.is_leaf then
                from
                    other.down (1)
                    down (0)
                until
                    other.after
                loop
                    put_right (other.item)
                    forth
                    fill_from_active (other)
                    other.forth
                end
                other.up
                up
            end
        end

    merge_right (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the right of cursor position.
        require
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        local
            pos: CURSOR
        do
            if not other.is_empty then
                pos := other.cursor
                other.start
                put_right (other.item)
                forth
                if not other.is_leaf then
                    down (0)
                    other.down (0)
                    from
                    until
                        other.islast
                    loop
                        other.forth
                        merge_right (other.subtree)
                    end
                    up
                end
                other.go_to (pos)
            end
        end

    merge_left (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the left of cursor position.
        require
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            merge_right (other)
        end

feature -- Duplication

    subtree: like Current is
            -- Subtree rooted at current node
        require
            not_off: not off
        do
            Result := new_tree
            Result.go_above
            Result.down (0)
            Result.put_right (item)
            Result.forth
            Result.fill_from_active (Current)
        end

    parent_tree: like Current is
            -- Subtree rooted at parent
        require
            not_on_root: not is_root
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := subtree
            go_to (pos)
        end

    child_tree (i: INTEGER): like Current is
            -- Subtree rooted at i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := subtree
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove item v.
        do
        end

feature {CURSOR_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        deferred
        ensure
            result_exists: Result /= void
            result_is_empty: Result.is_empty
        end

    go_above is
            -- Move the cursor above the tree
        do
            from
            until
                above
            loop
                up
            end
        end

feature {NONE} -- Implementation

    depth_from_active: INTEGER is
            -- Depth of subtree starting at active
        do
            if not off and then arity = 0 then
                Result := 1
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result.max (depth_from_active + 1)
                    forth
                end
                up
            end
        end

    breadth_of_level_from_active (a_level: INTEGER): INTEGER is
            -- Breadth of level level of subtree starting at current node
        do
            if (a_level = 2) or else is_leaf then
                Result := arity
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result + breadth_of_level_from_active (a_level - 1)
                    forth
                end
                up
            end
        end

    start_on_level_from_active (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from active.
        require
            deep_enough: depth_from_active >= l
        do
            from
                down (1)
            until
                depth_from_active >= l - 1
            loop
                forth
            end
            if (l > 2) then
                start_on_level_from_active (l - 1)
            end
        end

feature {NONE} -- Not applicable

    index: INTEGER is
        do
        end

invariant

    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Trees as active structures that may be traversed using a cursor"

Ancestors
    CURSOR_STRUCTURE [G]
    HIERARCHICAL [G]
    LINEAR [G]
    LINEAR [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] CURSOR_TREE [G]
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] CURSOR_TREE [G]
    prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_left (v: G)
    put_right (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out

Constraints
    non negative depth
    non negative breadth
    is leaf definition
    above property
    on tree
    off definition
    below constraint
    above constraint
    after constraint
    before constaint
    empty below constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: cursor_tree, tree
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    CURSOR_TREE [G]

feature -- Access

    child_item (i: INTEGER): G is
            -- Item in i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := item
            go_to (pos)
        end

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    has (v: G): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    occurrences (v: G): INTEGER is
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent_item: G is
            -- Item in parent.
        require
            not_on_root: not is_root
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := item
            go_to (pos)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    preorder_forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    preorder_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    arity: INTEGER is
            -- Number of successors of current element
            -- (from HIERARCHICAL)
        require -- from HIERARCHICAL
            not_off: not off
        deferred
        end

feature {NONE} -- Access

    linear_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    linear_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                preorder_forth
                search (v)
            end
        end

feature -- Measurement

    breadth: INTEGER is
            -- Breadth of current level
        local
            l: INTEGER
            pos: CURSOR
        do
            l := level
            if l > 0 then
                pos := cursor
                go_above
                Result := breadth_of_level_from_active (l + 1)
                go_to (pos)
            end
        end

    depth: INTEGER is
            -- Depth of the tree
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                go_above
                Result := depth_from_active - 1
                go_to (pos)
            end
        end

    level: INTEGER is
            -- Level of current node in tree
            -- (Root is on level 1)
        local
            pos: CURSOR
        do
            from
                pos := cursor
            until
                above
            loop
                Result := Result + 1
                up
            end
            go_to (pos)
        end

feature -- Status report

    above: BOOLEAN is
            -- Is there no valid cursor position above cursor?
        deferred
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
        deferred
        end

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := not above and then (level = 1) implies is_empty
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_leaf: BOOLEAN is
            -- Is cursor on a leaf?
        do
            if not off then
                Result := (arity = 0)
            end
        end

    is_root: BOOLEAN is
            -- Is cursor on root?
        deferred
        end

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
        deferred
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (True if is_empty)
        do
            Result := (after or before or below or above)
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
        do
            Result := i >= 0 and i <= (arity + 1)
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := not off
        end

feature {NONE} -- Status report

    linear_off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
        deferred
        end

    breadth_forth is
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
        require
            not_off: not off
        local
            l: INTEGER
        do
            l := level
            level_forth
            if above and (l < depth) then
                start_on_level (l + 1)
            end
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        deferred
        ensure then
            gone_before: (i = 0) implies before
        end

    forth is
            -- Move cursor one position forward.
        deferred
        end

    go_last_child is
            -- Go to the last child of current parent.
            -- No effect if below
        require -- from  LINEAR
            True
        require else
            not_above: not above
        do
            up
            down (arity)
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    level_back is
            -- Move cursor to previous position of current level.
        do
            if not isfirst then
                back
            elseif not above then
                from
                    up
                    level_back
                until
                    above or else not is_leaf
                loop
                    level_back
                end;
                if not above then
                    down (arity)
                end
            end
        end

    level_forth is
            -- Move cursor to next position of current level.
        do
            if not above and then not islast then
                forth
            elseif not above then
                from
                    up
                    level_forth
                until
                    above or else not is_leaf
                loop
                    level_forth
                end;
                if not above then
                    down (1)
                end
            end
        end

    postorder_forth is
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
        require
            not_off: not off
        do
            if islast then
                up
            else
                forth
                from
                until
                    is_leaf
                loop
                    down (1)
                end
            end
        end

    postorder_start is
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
        do
            from
                go_above
            until
                arity = 0
            loop
                down (1)
            end
        end

    preorder_forth is
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
        require -- from LINEAR
            not_after: not after
        do
            if is_leaf then
                from
                until
                    not islast
                loop
                    up
                end
                if not above then
                    forth
                end
            else
                down (1)
            end
        end

    start is
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
        do
            go_above
            if not is_empty then
                down (1)
            end
        ensure then
            on_root_unless_empty: not is_empty implies is_root
        end

    start_on_level (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
        require
            argument_within_bounds: l >= 1 and then depth >= l
        do
            go_above
            start_on_level_from_active (l + 1)
        ensure
            level_expected: level = l
            is_first: isfirst
        end

    up is
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else
            not_above: not above
        deferred
        ensure then
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)
        end

feature -- Element change

    extend (v: G) is
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        require -- from COLLECTION
            extendible: extendible
        local
            pos: CURSOR
        do
            pos := cursor
            go_last_child
            put_right (v)
            go_to (pos)
            if below then
                below := False
                down (0)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CURSOR_TREE [G]) is
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            is_empty: is_empty
        do
            go_above
            if not other.is_empty then
                other.start
                down (0)
                put_right (other.item)
                forth
                fill_from_active (other)
            end
        end

    container_fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_from_active (other: CURSOR_TREE [G]) is
            -- Copy subtree of other's active node
            -- onto active node of current tree.
        require
            cursor_on_leaf: is_leaf
        do
            if not other.is_leaf then
                from
                    other.down (1)
                    down (0)
                until
                    other.after
                loop
                    put_right (other.item)
                    forth
                    fill_from_active (other)
                    other.forth
                end
                other.up
                up
            end
        end

    merge_left (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the left of cursor position.
        require
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            merge_right (other)
        end

    merge_right (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the right of cursor position.
        require
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        local
            pos: CURSOR
        do
            if not other.is_empty then
                pos := other.cursor
                other.start
                put_right (other.item)
                forth
                if not other.is_leaf then
                    down (0)
                    other.down (0)
                    from
                    until
                        other.islast
                    loop
                        other.forth
                        merge_right (other.subtree)
                    end
                    up
                end
                other.go_to (pos)
            end
        end

    put (v: G) is
            -- Put v at cursor position.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    put_left (v: G) is
            -- Add v to the left of cursor position.
        require
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            put_right (v)
            forth
            forth
        end

    put_right (v: G) is
            -- Add v to the right of cursor position.
        require
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        deferred
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    child_tree (i: INTEGER): like Current is
            -- Subtree rooted at i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := subtree
            go_to (pos)
        end

    parent_tree: like Current is
            -- Subtree rooted at parent
        require
            not_on_root: not is_root
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := subtree
            go_to (pos)
        end

    subtree: like Current is
            -- Subtree rooted at current node
        require
            not_off: not off
        do
            Result := new_tree
            Result.go_above
            Result.down (0)
            Result.put_right (item)
            Result.forth
            Result.fill_from_active (Current)
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove item v.
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {CURSOR_TREE} -- Implementation

    go_above is
            -- Move the cursor above the tree
        do
            from
            until
                above
            loop
                up
            end
        end

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        deferred
        ensure
            result_exists: Result /= void
            result_is_empty: Result.is_empty
        end

feature {NONE} -- Implementation

    breadth_of_level_from_active (a_level: INTEGER): INTEGER is
            -- Breadth of level level of subtree starting at current node
        do
            if (a_level = 2) or else is_leaf then
                Result := arity
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result + breadth_of_level_from_active (a_level - 1)
                    forth
                end
                up
            end
        end

    depth_from_active: INTEGER is
            -- Depth of subtree starting at active
        do
            if not off and then arity = 0 then
                Result := 1
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result.max (depth_from_active + 1)
                    forth
                end
                up
            end
        end

    start_on_level_from_active (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from active.
        require
            deep_enough: depth_from_active >= l
        do
            from
                down (1)
            until
                depth_from_active >= l - 1
            loop
                forth
            end
            if (l > 2) then
                start_on_level_from_active (l - 1)
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                preorder_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                preorder_forth
            end
        end

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature {NONE} -- Not applicable

    index: INTEGER is
        do
        end

invariant

    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: cursor_tree, tree
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CURSOR_TREE [G]

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
        require
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    arity: INTEGER
            -- Number of successors of current element
            -- (from HIERARCHICAL)
        require -- from HIERARCHICAL
            not_off: not off

feature -- Measurement

    breadth: INTEGER
            -- Breadth of current level

    depth: INTEGER
            -- Depth of the tree

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Is cursor on a leaf?

    is_root: BOOLEAN
            -- Is cursor on root?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
        require
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
        require -- from  LINEAR
            True
        require else
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.

    level_forth
            -- Move cursor to next position of current level.

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
        require
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
        ensure then
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
        require
            argument_within_bounds: l >= 1 and then depth >= l
        ensure
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else
            not_above: not above
        ensure then
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
        require
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
        require
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
        require
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_left (v: G)
            -- Add v to the left of cursor position.
        require
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
        require
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
        require
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
        require
            not_off: not off

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CURSOR_TREE [G]

Ancestors
    CURSOR_STRUCTURE [G]
    HIERARCHICAL [G]
    LINEAR [G]
    LINEAR [G]

Descendants
    COMPACT_CURSOR_TREE [G]
    RECURSIVE_CURSOR_TREE [G]

Clients
    CURSOR_TREE [G]
    CURSOR_TREE_ITERATOR [G]

Suppliers
    BOOLEAN
    CURSOR_TREE [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: cursor_tree, tree
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CURSOR_TREE [G]

feature -- Access

    parent_item: G
            -- Item in parent.
        require
            not_on_root: not is_root

    child_item (i: INTEGER): G
            -- Item in i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    occurrences (v: G): INTEGER

feature -- Measurement

    depth: INTEGER
            -- Depth of the tree

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)

    breadth: INTEGER
            -- Breadth of current level

feature -- Status report

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

    extendible: BOOLEAN
            -- May new items be added?

    is_leaf: BOOLEAN
            -- Is cursor on a leaf?

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    is_root: BOOLEAN
            -- Is cursor on root?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.

feature -- Cursor movement

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
        ensure then
            on_root_unless_empty: not is_empty implies is_root

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
        require else
            not_above: not above

    back
            -- Move cursor one position backward.

    forth
            -- Move cursor one position forward.

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require else
            not_above: not above
        ensure then
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require else
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then
            gone_before: (i = 0) implies before

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
        require
            not_off: not off

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
        require
            not_off: not off

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
        require
            argument_within_bounds: l >= 1 and then depth >= l
        ensure
            level_expected: level = l
            is_first: isfirst

    level_forth
            -- Move cursor to next position of current level.

    level_back
            -- Move cursor to previous position of current level.

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.

feature -- Element change

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.

    put_left (v: G)
            -- Add v to the left of cursor position.
        require
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
        require
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            is_empty: is_empty

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
        require
            cursor_on_leaf: is_leaf

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
        require
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
        require
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

feature -- Duplication

    subtree: like Current
            -- Subtree rooted at current node
        require
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
        require
            not_on_root: not is_root
            not_off: not off

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

invariant

    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.cursor_tree

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


LINKED_CURSOR_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees in linked representation"
    status: "See notice at end of class"
    names: linked_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_CURSOR_TREE [G]

inherit
    RECURSIVE_CURSOR_TREE [G]
        redefine
            put_right,
            active,
            cursor_anchor,
            is_leaf
        end

create
    make,
    make_root

feature -- Initialization

    make is
            -- Create an empty tree.
        local
            dummy: G
        do
            create above_node.make (dummy)
            active := above_node
        ensure
            is_above: above
            is_empty: is_empty
        end

    make_root (v: G) is
            -- Create a tree with v as root.
        do
            make
            put_root (v)
        end

feature -- Status report

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    Prunable: BOOLEAN is True

    is_leaf: BOOLEAN is
        do
            if not off then
                Result := not below and then active.arity = 0
            end
        end

feature -- Element change

    put_right (v: G) is
            -- Add v to the right of cursor position.
        do
            if below then
                active.child_put_right (v)
                active.child_forth
                active_parent := active
                active := active_parent.child
                below := False
            elseif before then
                active_parent.child_put_left (v);
                active_parent.child_back;
                active := active_parent.child
            else
                active_parent.child_put_right (v)
            end
        end

    put_root (v: G) is
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        do
            above_node.child_put_right (v)
            active_parent := above_node
            active := active_parent.child
        ensure
            is_root: is_root
            count = 1
        end

    put_child (v: G) is
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf
        do
            down (0)
            put_right (v)
        end

feature {LINKED_CURSOR_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        end

feature {NONE} -- Implementation

    cursor_anchor: LINKED_TREE_CURSOR [G]
            -- Anchor for definitions concerning cursors

    active: LINKED_TREE [G]
            -- Current node

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CURSOR_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Cursor trees in linked representation"
    create: make_root, make

Ancestors
    RECURSIVE_CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] LINKED_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] LINKED_CURSOR_TREE [G]
    Prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] LINKED_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    make
    make_root (v: G)
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_child (v: G)
    put_left (v: G)
    put_right (v: G)
    put_root (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CURSOR_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees in linked representation"
    status: "See notice at end of class"
    names: linked_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_CURSOR_TREE [G]

create
    make,
    make_root

feature -- Initialization

    make is
            -- Create an empty tree.
        local
            dummy: G
        do
            create above_node.make (dummy)
            active := above_node
        ensure
            is_above: above
            is_empty: is_empty
        end

    make_root (v: G) is
            -- Create a tree with v as root.
        do
            make
            put_root (v)
        end

feature -- Access

    child_item (i: INTEGER): G is
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := item
            go_to (pos)
        end

    cursor: CURSOR is
            -- Current cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        local
            temp: like cursor_anchor
        do
            create temp.make (active, active_parent, after, before, below)
            Result := temp
        end

    has (v: G): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    occurrences (v: G): INTEGER is
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent_item: G is
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := item
            go_to (pos)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    preorder_forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    preorder_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature {NONE} -- Access

    linear_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    linear_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                preorder_forth
                search (v)
            end
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from RECURSIVE_CURSOR_TREE
            valid_cursor: not off or else above
        do
            Result := active.arity
        end

    breadth: INTEGER is
            -- Breadth of current level
            -- (from CURSOR_TREE)
        local
            l: INTEGER
            pos: CURSOR
        do
            l := level
            if l > 0 then
                pos := cursor
                go_above
                Result := breadth_of_level_from_active (l + 1)
                go_to (pos)
            end
        end

    count: INTEGER is
            -- Number of items in the tree
            -- (from RECURSIVE_CURSOR_TREE)
        local
            pos: like cursor_anchor
        do
            pos ?= cursor
            from
                start
            until
                off
            loop
                Result := Result + 1
                preorder_forth
            end
            go_to (pos)
            corresponding_child
        end

    depth: INTEGER is
            -- Depth of the tree
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                go_above
                Result := depth_from_active - 1
                go_to (pos)
            end
        end

    level: INTEGER is
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            from
                pos := cursor
            until
                above
            loop
                Result := Result + 1
                up
            end
            go_to (pos)
        end

feature -- Status report

    above: BOOLEAN is
            -- Is there no valid cursor position above cursor?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not below then
                Result := (active_parent = void)
            end
        end

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added on current level?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            Result := (not above) and (not is_root)
        end

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN is
            -- Is the tree empty?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            Result := (above_node.arity = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_leaf: BOOLEAN is
        do
            if not off then
                Result := not below and then active.arity = 0
            end
        end

    is_root: BOOLEAN is
            -- Is cursor on tree root?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not off then
                Result := (active_parent = above_node)
            end
        end

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not off then
                Result := active_parent.child_isfirst
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not off then
                Result := active_parent.child_islast
            end
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)
        do
            Result := (after or before or below or above)
        end

    Prunable: BOOLEAN is True

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from RECURSIVE_CURSOR_TREE)
        local
            temp: like cursor_anchor
            pos: CURSOR
        do
            temp ?= p
            if temp /= void then
                if temp.active = above_node or temp.before or temp.after or temp.below then
                    Result := True
                else
                    pos := cursor
                    from
                        start
                    until
                        active = temp.active or else off
                    loop
                        preorder_forth
                    end
                    Result := not off
                    go_to (pos)
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)
        do
            Result := i >= 0 and i <= (arity + 1)
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    linear_off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if below then
                after := False
                before := True
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active_parent.child_back
                active := active_parent.child
            end
        end

    breadth_forth is
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        local
            l: INTEGER
        do
            l := level
            level_forth
            if above and (l < depth) then
                start_on_level (l + 1)
            end
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        do
            if i = 0 then
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (1)
                    active := active.child
                end
                before := True
            elseif above or else i <= arity then
                active_parent := active;
                active.child_go_i_th (i);
                active := active.child
            else
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (arity)
                    active := active.child
                end
                after := True
            end
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before
        end

    forth is
            -- Move cursor one position forward.
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if below then
                before := False
                after := True
            elseif before then
                before := False
            elseif islast then
                after := True
            else
                active_parent.child_forth
                active := active_parent.child
            end
        end

    go_last_child is
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above
        do
            up
            down (arity)
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            temp: like cursor_anchor
        do
            temp ?= p
            check
                temp /= void
            end
            unchecked_go (temp)
        end

    level_back is
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)
        do
            if not isfirst then
                back
            elseif not above then
                from
                    up
                    level_back
                until
                    above or else not is_leaf
                loop
                    level_back
                end;
                if not above then
                    down (arity)
                end
            end
        end

    level_forth is
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)
        do
            if not above and then not islast then
                forth
            elseif not above then
                from
                    up
                    level_forth
                until
                    above or else not is_leaf
                loop
                    level_forth
                end;
                if not above then
                    down (1)
                end
            end
        end

    postorder_forth is
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        do
            if islast then
                up
            else
                forth
                from
                until
                    is_leaf
                loop
                    down (1)
                end
            end
        end

    postorder_start is
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)
        do
            from
                go_above
            until
                arity = 0
            loop
                down (1)
            end
        end

    preorder_forth is
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after
        do
            if is_leaf then
                from
                until
                    not islast
                loop
                    up
                end
                if not above then
                    forth
                end
            else
                down (1)
            end
        end

    start is
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        do
            go_above
            if not is_empty then
                down (1)
            end
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root
        end

    start_on_level (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        do
            go_above
            start_on_level_from_active (l + 1)
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst
        end

    up is
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        do
            if below then
                below := False
            else
                active := active_parent
                if active /= void then
                    active_parent := active.parent
                end
                corresponding_child
            end
            after := False
            before := False
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)
        end

feature -- Element change

    fill (other: CURSOR_TREE [G]) is
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty
        do
            go_above
            if not other.is_empty then
                other.start
                down (0)
                put_right (other.item)
                forth
                fill_from_active (other)
            end
        end

    container_fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_from_active (other: CURSOR_TREE [G]) is
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf
        do
            if not other.is_leaf then
                from
                    other.down (1)
                    down (0)
                until
                    other.after
                loop
                    put_right (other.item)
                    forth
                    fill_from_active (other)
                    other.forth
                end
                other.up
                up
            end
        end

    merge_left (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            merge_right (other)
        end

    merge_right (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        local
            pos: CURSOR
        do
            if not other.is_empty then
                pos := other.cursor
                other.start
                put_right (other.item)
                forth
                if not other.is_leaf then
                    down (0)
                    other.down (0)
                    from
                    until
                        other.islast
                    loop
                        other.forth
                        merge_right (other.subtree)
                    end
                    up
                end
                other.go_to (pos)
            end
        end

    put (v: G) is
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    put_child (v: G) is
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf
        do
            down (0)
            put_right (v)
        end

    put_left (v: G) is
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            put_right (v)
            forth
            forth
        end

    put_right (v: G) is
            -- Add v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            if below then
                active.child_put_right (v)
                active.child_forth
                active_parent := active
                active := active_parent.child
                below := False
            elseif before then
                active_parent.child_put_left (v);
                active_parent.child_back;
                active := active_parent.child
            else
                active_parent.child_put_right (v)
            end
        end

    put_root (v: G) is
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        do
            above_node.child_put_right (v)
            active_parent := above_node
            active := active_parent.child
        ensure
            is_root: is_root
            count = 1
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            writable: writable
        do
            active.replace (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            corresponding_child
            active := active_parent
            active_parent := active.parent
            active.remove_child
            active.child_back
        ensure then -- from RECURSIVE_CURSOR_TREE
            not_off_unless_empty: is_empty or else not off
        end

    wipe_out is
            -- Remove all items.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            prunable
        do
            if not is_empty then
                above_node.child_start
                above_node.remove_child
            end
            active := above_node
            active_parent := void
            after := False
            before := False
            below := False
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from RECURSIVE_CURSOR_TREE
            cursor_above: above
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    child_tree (i: INTEGER): like Current is
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := subtree
            go_to (pos)
        end

    parent_tree: like Current is
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := subtree
            go_to (pos)
        end

    subtree: like Current is
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        do
            Result := new_tree
            Result.go_above
            Result.down (0)
            Result.put_right (item)
            Result.forth
            Result.fill_from_active (Current)
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove item v.
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {LINKED_CURSOR_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        ensure -- from CURSOR_TREE
            result_exists: Result /= void
            result_is_empty: Result.is_empty
        end

feature {NONE} -- Implementation

    above_node: like active
            -- Node above root; physical root of tree
            -- (from RECURSIVE_CURSOR_TREE)

    active: LINKED_TREE [G]
            -- Current node

    active_parent: like active
            -- Parent of current node
            -- (from RECURSIVE_CURSOR_TREE)

    breadth_of_level_from_active (a_level: INTEGER): INTEGER is
            -- Breadth of level level of subtree starting at current node
            -- (from CURSOR_TREE)
        do
            if (a_level = 2) or else is_leaf then
                Result := arity
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result + breadth_of_level_from_active (a_level - 1)
                    forth
                end
                up
            end
        end

    corresponding_child is
            -- Make active the current child of active_parent.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from RECURSIVE_CURSOR_TREE
            active_exists: active /= void
        do
            if active_parent /= void then
                active_parent.set_child (active)
            end
        end

    cursor_anchor: LINKED_TREE_CURSOR [G]
            -- Anchor for definitions concerning cursors

    depth_from_active: INTEGER is
            -- Depth of subtree starting at active
            -- (from CURSOR_TREE)
        do
            if not off and then arity = 0 then
                Result := 1
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result.max (depth_from_active + 1)
                    forth
                end
                up
            end
        end

    start_on_level_from_active (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from active.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            deep_enough: depth_from_active >= l
        do
            from
                down (1)
            until
                depth_from_active >= l - 1
            loop
                forth
            end
            if (l > 2) then
                start_on_level_from_active (l - 1)
            end
        end

    unchecked_go (p: like cursor_anchor) is
            -- Make an attempt to move cursor
            -- to position p, without checking
            -- whether p is a valid cursor position
            -- or not.
            -- (from RECURSIVE_CURSOR_TREE)
        do
            active_parent := p.active_parent
            active := p.active
            corresponding_child
            after := p.after
            before := p.before
            below := p.below
        end

feature {CURSOR_TREE} -- Implementation

    go_above is
            -- Move the cursor above the tree
            -- (from CURSOR_TREE)
        do
            from
            until
                above
            loop
                up
            end
        end

feature -- Insert element

    extend (v: G) is
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        local
            pos: CURSOR
        do
            pos := cursor
            go_last_child
            put_right (v)
            go_to (pos)
            if below then
                below := False
                before := False
                after := False
                down (0)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                preorder_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                preorder_forth
            end
        end

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature {NONE} -- Not applicable

    index: INTEGER is
            -- (from CURSOR_TREE)
        do
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RECURSIVE_CURSOR_TREE
    coherency: not above implies active_parent.child = active
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CURSOR_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees in linked representation"
    status: "See notice at end of class"
    names: linked_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_CURSOR_TREE [G]

create

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Initialization

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position
            -- (from RECURSIVE_CURSOR_TREE)

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- (from CURSOR_TREE)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from RECURSIVE_CURSOR_TREE
            valid_cursor: not off or else above

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in the tree
            -- (from RECURSIVE_CURSOR_TREE)

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added on current level?
            -- (from RECURSIVE_CURSOR_TREE)

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is the tree empty?
            -- (from RECURSIVE_CURSOR_TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN

    is_root: BOOLEAN
            -- Is cursor on tree root?
            -- (from RECURSIVE_CURSOR_TREE)

    isfirst: BOOLEAN
            -- Is cursor on first sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    islast: BOOLEAN
            -- Is cursor on last sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from RECURSIVE_CURSOR_TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from RECURSIVE_CURSOR_TREE)

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.
            -- (from RECURSIVE_CURSOR_TREE)

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_child (v: G)
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf

    put_left (v: G)
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_root (v: G)
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        ensure
            is_root: is_root
            count = 1

    replace (v: G)
            -- Replace current item by v.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from RECURSIVE_CURSOR_TREE
            not_off_unless_empty: is_empty or else not off

    wipe_out
            -- Remove all items.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from RECURSIVE_CURSOR_TREE
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

feature -- Insert element

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RECURSIVE_CURSOR_TREE
    coherency: not above implies active_parent.child = active
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CURSOR_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_CURSOR_TREE [G]

Ancestors
    RECURSIVE_CURSOR_TREE [G]

Clients
    LINKED_CURSOR_TREE [G]

Suppliers
    BOOLEAN
    LINKED_CURSOR_TREE [G]
    LINKED_TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CURSOR_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees in linked representation"
    status: "See notice at end of class"
    names: linked_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_CURSOR_TREE [G]

create
    make,
    make_root

feature -- Initialization

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Status report

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    Prunable: BOOLEAN is True

    is_leaf: BOOLEAN

feature -- Element change

    put_right (v: G)
            -- Add v to the right of cursor position.

    put_root (v: G)
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        ensure
            is_root: is_root
            count = 1

    put_child (v: G)
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_CURSOR_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees with a recursive structure"
    status: "See notice at end of class"
    names: recursive_cursor_tree, cursor_tree, tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    RECURSIVE_CURSOR_TREE [G]

inherit
    CURSOR_TREE [G]
        redefine
            is_empty,
            extendible,
            extend
        end

feature -- Access

    item: G is
            -- Item at cursor position
        do
            Result := active.item
        end

    cursor: CURSOR is
            -- Current cursor position
        local
            temp: like cursor_anchor
        do
            create temp.make (active, active_parent, after, before, below)
            Result := temp
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
        require else
            valid_cursor: not off or else above
        do
            Result := active.arity
        end

    count: INTEGER is
            -- Number of items in the tree
        local
            pos: like cursor_anchor
        do
            pos ?= cursor
            from
                start
            until
                off
            loop
                Result := Result + 1
                preorder_forth
            end
            go_to (pos)
            corresponding_child
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    above: BOOLEAN is
            -- Is there no valid cursor position above cursor?
        do
            if not below then
                Result := (active_parent = void)
            end
        end

    is_empty: BOOLEAN is
            -- Is the tree empty?
        do
            Result := (above_node.arity = 0)
        end

    extendible: BOOLEAN is
            -- May new items be added on current level?
        do
            Result := (not above) and (not is_root)
        end

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
        do
            if not off then
                Result := active_parent.child_isfirst
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
        do
            if not off then
                Result := active_parent.child_islast
            end
        end

    is_root: BOOLEAN is
            -- Is cursor on tree root?
        do
            if not off then
                Result := (active_parent = above_node)
            end
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            temp: like cursor_anchor
            pos: CURSOR
        do
            temp ?= p
            if temp /= void then
                if temp.active = above_node or temp.before or temp.after or temp.below then
                    Result := True
                else
                    pos := cursor
                    from
                        start
                    until
                        active = temp.active or else off
                    loop
                        preorder_forth
                    end
                    Result := not off
                    go_to (pos)
                end
            end
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
        do
            if below then
                after := False
                before := True
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active_parent.child_back
                active := active_parent.child
            end
        end

    forth is
            -- Move cursor one position forward.
        do
            if below then
                before := False
                after := True
            elseif before then
                before := False
            elseif islast then
                after := True
            else
                active_parent.child_forth
                active := active_parent.child
            end
        end

    up is
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        do
            if below then
                below := False
            else
                active := active_parent
                if active /= void then
                    active_parent := active.parent
                end
                corresponding_child
            end
            after := False
            before := False
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        do
            if i = 0 then
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (1)
                    active := active.child
                end
                before := True
            elseif above or else i <= arity then
                active_parent := active;
                active.child_go_i_th (i);
                active := active.child
            else
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (arity)
                    active := active.child
                end
                after := True
            end
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        local
            temp: like cursor_anchor
        do
            temp ?= p
            check
                temp /= void
            end
            unchecked_go (temp)
        end

feature -- Insert element

    extend (v: G) is
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        local
            pos: CURSOR
        do
            pos := cursor
            go_last_child
            put_right (v)
            go_to (pos)
            if below then
                below := False
                before := False
                after := False
                down (0)
            end
        end

feature -- Element change

    replace (v: G) is
            -- Replace current item by v.
        do
            active.replace (v)
        end

feature -- Removal

    remove is
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
        do
            corresponding_child
            active := active_parent
            active_parent := active.parent
            active.remove_child
            active.child_back
        ensure then
            not_off_unless_empty: is_empty or else not off
        end

    wipe_out is
            -- Remove all items.
        do
            if not is_empty then
                above_node.child_start
                above_node.remove_child
            end
            active := above_node
            active_parent := void
            after := False
            before := False
            below := False
        ensure then
            cursor_above: above
        end

feature {NONE} -- Implementation

    active: DYNAMIC_TREE [G]
            -- Current node

    active_parent: like active
            -- Parent of current node

    above_node: like active
            -- Node above root; physical root of tree

    cursor_anchor: RECURSIVE_TREE_CURSOR [G]
            -- Anchor for definitions concerning cursors

    corresponding_child is
            -- Make active the current child of active_parent.
        require
            active_exists: active /= void
        do
            if active_parent /= void then
                active_parent.set_child (active)
            end
        end

    unchecked_go (p: like cursor_anchor) is
            -- Make an attempt to move cursor
            -- to position p, without checking
            -- whether p is a valid cursor position
            -- or not.
        do
            active_parent := p.active_parent
            active := p.active
            corresponding_child
            after := p.after
            before := p.before
            below := p.below
        end

invariant

    coherency: not above implies active_parent.child = active

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_CURSOR_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    RECURSIVE_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Cursor trees with a recursive structure"

Ancestors
    CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] RECURSIVE_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] RECURSIVE_CURSOR_TREE [G]
    prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] RECURSIVE_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_left (v: G)
    put_right (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out

Constraints
    coherency

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_CURSOR_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees with a recursive structure"
    status: "See notice at end of class"
    names: recursive_cursor_tree, cursor_tree, tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class
    RECURSIVE_CURSOR_TREE [G]

feature -- Access

    child_item (i: INTEGER): G is
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := item
            go_to (pos)
        end

    cursor: CURSOR is
            -- Current cursor position
        local
            temp: like cursor_anchor
        do
            create temp.make (active, active_parent, after, before, below)
            Result := temp
        end

    has (v: G): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at cursor position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    occurrences (v: G): INTEGER is
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent_item: G is
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := item
            go_to (pos)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    preorder_forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    preorder_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature {NONE} -- Access

    linear_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    linear_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                preorder_forth
                search (v)
            end
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
        require -- from HIERARCHICAL
            not_off: not off
        require else
            valid_cursor: not off or else above
        do
            Result := active.arity
        end

    breadth: INTEGER is
            -- Breadth of current level
            -- (from CURSOR_TREE)
        local
            l: INTEGER
            pos: CURSOR
        do
            l := level
            if l > 0 then
                pos := cursor
                go_above
                Result := breadth_of_level_from_active (l + 1)
                go_to (pos)
            end
        end

    count: INTEGER is
            -- Number of items in the tree
        local
            pos: like cursor_anchor
        do
            pos ?= cursor
            from
                start
            until
                off
            loop
                Result := Result + 1
                preorder_forth
            end
            go_to (pos)
            corresponding_child
        end

    depth: INTEGER is
            -- Depth of the tree
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                go_above
                Result := depth_from_active - 1
                go_to (pos)
            end
        end

    level: INTEGER is
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            from
                pos := cursor
            until
                above
            loop
                Result := Result + 1
                up
            end
            go_to (pos)
        end

feature -- Status report

    above: BOOLEAN is
            -- Is there no valid cursor position above cursor?
        do
            if not below then
                Result := (active_parent = void)
            end
        end

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added on current level?
        do
            Result := (not above) and (not is_root)
        end

    is_empty: BOOLEAN is
            -- Is the tree empty?
        do
            Result := (above_node.arity = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_leaf: BOOLEAN is
            -- Is cursor on a leaf?
            -- (from CURSOR_TREE)
        do
            if not off then
                Result := (arity = 0)
            end
        end

    is_root: BOOLEAN is
            -- Is cursor on tree root?
        do
            if not off then
                Result := (active_parent = above_node)
            end
        end

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
        do
            if not off then
                Result := active_parent.child_isfirst
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
        do
            if not off then
                Result := active_parent.child_islast
            end
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)
        do
            Result := (after or before or below or above)
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            temp: like cursor_anchor
            pos: CURSOR
        do
            temp ?= p
            if temp /= void then
                if temp.active = above_node or temp.before or temp.after or temp.below then
                    Result := True
                else
                    pos := cursor
                    from
                        start
                    until
                        active = temp.active or else off
                    loop
                        preorder_forth
                    end
                    Result := not off
                    go_to (pos)
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)
        do
            Result := i >= 0 and i <= (arity + 1)
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    linear_off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
        do
            if below then
                after := False
                before := True
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active_parent.child_back
                active := active_parent.child
            end
        end

    breadth_forth is
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        local
            l: INTEGER
        do
            l := level
            level_forth
            if above and (l < depth) then
                start_on_level (l + 1)
            end
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        do
            if i = 0 then
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (1)
                    active := active.child
                end
                before := True
            elseif above or else i <= arity then
                active_parent := active;
                active.child_go_i_th (i);
                active := active.child
            else
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (arity)
                    active := active.child
                end
                after := True
            end
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before
        end

    forth is
            -- Move cursor one position forward.
        do
            if below then
                before := False
                after := True
            elseif before then
                before := False
            elseif islast then
                after := True
            else
                active_parent.child_forth
                active := active_parent.child
            end
        end

    go_last_child is
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above
        do
            up
            down (arity)
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            temp: like cursor_anchor
        do
            temp ?= p
            check
                temp /= void
            end
            unchecked_go (temp)
        end

    level_back is
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)
        do
            if not isfirst then
                back
            elseif not above then
                from
                    up
                    level_back
                until
                    above or else not is_leaf
                loop
                    level_back
                end;
                if not above then
                    down (arity)
                end
            end
        end

    level_forth is
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)
        do
            if not above and then not islast then
                forth
            elseif not above then
                from
                    up
                    level_forth
                until
                    above or else not is_leaf
                loop
                    level_forth
                end;
                if not above then
                    down (1)
                end
            end
        end

    postorder_forth is
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        do
            if islast then
                up
            else
                forth
                from
                until
                    is_leaf
                loop
                    down (1)
                end
            end
        end

    postorder_start is
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)
        do
            from
                go_above
            until
                arity = 0
            loop
                down (1)
            end
        end

    preorder_forth is
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after
        do
            if is_leaf then
                from
                until
                    not islast
                loop
                    up
                end
                if not above then
                    forth
                end
            else
                down (1)
            end
        end

    start is
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        do
            go_above
            if not is_empty then
                down (1)
            end
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root
        end

    start_on_level (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        do
            go_above
            start_on_level_from_active (l + 1)
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst
        end

    up is
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        do
            if below then
                below := False
            else
                active := active_parent
                if active /= void then
                    active_parent := active.parent
                end
                corresponding_child
            end
            after := False
            before := False
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)
        end

feature -- Element change

    fill (other: CURSOR_TREE [G]) is
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty
        do
            go_above
            if not other.is_empty then
                other.start
                down (0)
                put_right (other.item)
                forth
                fill_from_active (other)
            end
        end

    container_fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_from_active (other: CURSOR_TREE [G]) is
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf
        do
            if not other.is_leaf then
                from
                    other.down (1)
                    down (0)
                until
                    other.after
                loop
                    put_right (other.item)
                    forth
                    fill_from_active (other)
                    other.forth
                end
                other.up
                up
            end
        end

    merge_left (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            merge_right (other)
        end

    merge_right (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        local
            pos: CURSOR
        do
            if not other.is_empty then
                pos := other.cursor
                other.start
                put_right (other.item)
                forth
                if not other.is_leaf then
                    down (0)
                    other.down (0)
                    from
                    until
                        other.islast
                    loop
                        other.forth
                        merge_right (other.subtree)
                    end
                    up
                end
                other.go_to (pos)
            end
        end

    put (v: G) is
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    put_left (v: G) is
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            put_right (v)
            forth
            forth
        end

    put_right (v: G) is
            -- Add v to the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        deferred
        end

    replace (v: G) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        do
            active.replace (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            corresponding_child
            active := active_parent
            active_parent := active.parent
            active.remove_child
            active.child_back
        ensure then
            not_off_unless_empty: is_empty or else not off
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            if not is_empty then
                above_node.child_start
                above_node.remove_child
            end
            active := above_node
            active_parent := void
            after := False
            before := False
            below := False
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            cursor_above: above
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    child_tree (i: INTEGER): like Current is
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := subtree
            go_to (pos)
        end

    parent_tree: like Current is
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := subtree
            go_to (pos)
        end

    subtree: like Current is
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        do
            Result := new_tree
            Result.go_above
            Result.down (0)
            Result.put_right (item)
            Result.forth
            Result.fill_from_active (Current)
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove item v.
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {NONE} -- Implementation

    above_node: like active
            -- Node above root; physical root of tree

    active: DYNAMIC_TREE [G]
            -- Current node

    active_parent: like active
            -- Parent of current node

    breadth_of_level_from_active (a_level: INTEGER): INTEGER is
            -- Breadth of level level of subtree starting at current node
            -- (from CURSOR_TREE)
        do
            if (a_level = 2) or else is_leaf then
                Result := arity
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result + breadth_of_level_from_active (a_level - 1)
                    forth
                end
                up
            end
        end

    corresponding_child is
            -- Make active the current child of active_parent.
        require
            active_exists: active /= void
        do
            if active_parent /= void then
                active_parent.set_child (active)
            end
        end

    cursor_anchor: RECURSIVE_TREE_CURSOR [G]
            -- Anchor for definitions concerning cursors

    depth_from_active: INTEGER is
            -- Depth of subtree starting at active
            -- (from CURSOR_TREE)
        do
            if not off and then arity = 0 then
                Result := 1
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result.max (depth_from_active + 1)
                    forth
                end
                up
            end
        end

    start_on_level_from_active (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from active.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            deep_enough: depth_from_active >= l
        do
            from
                down (1)
            until
                depth_from_active >= l - 1
            loop
                forth
            end
            if (l > 2) then
                start_on_level_from_active (l - 1)
            end
        end

    unchecked_go (p: like cursor_anchor) is
            -- Make an attempt to move cursor
            -- to position p, without checking
            -- whether p is a valid cursor position
            -- or not.
        do
            active_parent := p.active_parent
            active := p.active
            corresponding_child
            after := p.after
            before := p.before
            below := p.below
        end

feature {CURSOR_TREE} -- Implementation

    go_above is
            -- Move the cursor above the tree
            -- (from CURSOR_TREE)
        do
            from
            until
                above
            loop
                up
            end
        end

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from CURSOR_TREE)
        deferred
        ensure -- from CURSOR_TREE
            result_exists: Result /= void
            result_is_empty: Result.is_empty
        end

feature -- Insert element

    extend (v: G) is
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        require -- from COLLECTION
            extendible: extendible
        local
            pos: CURSOR
        do
            pos := cursor
            go_last_child
            put_right (v)
            go_to (pos)
            if below then
                below := False
                before := False
                after := False
                down (0)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                preorder_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                preorder_forth
            end
        end

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature {NONE} -- Not applicable

    index: INTEGER is
            -- (from CURSOR_TREE)
        do
        end

invariant

    coherency: not above implies active_parent.child = active
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_CURSOR_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees with a recursive structure"
    status: "See notice at end of class"
    names: recursive_cursor_tree, cursor_tree, tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    RECURSIVE_CURSOR_TREE [G]

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- (from CURSOR_TREE)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
        require -- from HIERARCHICAL
            not_off: not off
        require else
            valid_cursor: not off or else above

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in the tree

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added on current level?

    is_empty: BOOLEAN
            -- Is the tree empty?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Is cursor on a leaf?
            -- (from CURSOR_TREE)

    is_root: BOOLEAN
            -- Is cursor on tree root?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_left (v: G)
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    replace (v: G)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then
            not_off_unless_empty: is_empty or else not off

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

feature -- Insert element

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    coherency: not above implies active_parent.child = active
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_CURSOR_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    RECURSIVE_CURSOR_TREE [G]

Ancestors
    CURSOR_TREE [G]

Descendants
    LINKED_CURSOR_TREE [G]
    TWO_WAY_CURSOR_TREE [G]

Clients
    RECURSIVE_CURSOR_TREE [G]

Suppliers
    BOOLEAN
    DYNAMIC_TREE [G]
    INTEGER
    RECURSIVE_CURSOR_TREE [G]
    RECURSIVE_TREE_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RECURSIVE_CURSOR_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees with a recursive structure"
    status: "See notice at end of class"
    names: recursive_cursor_tree, cursor_tree, tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    RECURSIVE_CURSOR_TREE [G]

feature -- Access

    item: G
            -- Item at cursor position

    cursor: CURSOR
            -- Current cursor position

feature -- Measurement

    arity: INTEGER
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
        require else
            valid_cursor: not off or else above

    count: INTEGER
            -- Number of items in the tree

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

    is_empty: BOOLEAN
            -- Is the tree empty?

    extendible: BOOLEAN
            -- May new items be added on current level?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    is_root: BOOLEAN
            -- Is cursor on tree root?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    forth
            -- Move cursor one position forward.

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.

    go_to (p: CURSOR)
            -- Move cursor to position p.

feature -- Insert element

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.

feature -- Element change

    replace (v: G)
            -- Replace current item by v.

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
        ensure then
            not_off_unless_empty: is_empty or else not off

    wipe_out
            -- Remove all items.
        ensure then
            cursor_above: above

invariant

    coherency: not above implies active_parent.child = active

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CURSOR_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees implemented in two-way linked representation"
    status: "See notice at end of class"
    names: two_way_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_CURSOR_TREE [G]

inherit
    RECURSIVE_CURSOR_TREE [G]
        redefine
            put_right,
            subtree,
            active,
            cursor_anchor,
            is_leaf
        end

create
    make,
    make_root

feature -- Initialization

    make is
            -- Create an empty tree.
        local
            dummy: G
        do
            create above_node.make (dummy)
            active := above_node
        ensure
            is_above: above
            is_empty: is_empty
        end

    make_root (v: G) is
            -- Create a tree with v as root.
        do
            make
            put_root (v)
        end

feature -- Status report

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    Prunable: BOOLEAN is True

    is_leaf: BOOLEAN is
        do
            if not off then
                Result := not below and then active.arity = 0
            end
        end

feature -- Element change

    put_right (v: G) is
            -- Add v to the right of cursor position.
        do
            if below then
                active.child_put_right (v)
                active.child_forth
                active_parent := active
                active := active_parent.child
                below := False
            elseif before then
                active_parent.child_put_left (v);
                active_parent.child_back;
                active := active_parent.child
            else
                active_parent.child_put_right (v)
            end
        end

    put_root (v: G) is
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        do
            above_node.child_put_right (v)
            active_parent := above_node
            active := active_parent.child
        ensure
            is_root: is_root
            count = 1
        end

    put_child (v: G) is
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf
        do
            down (0)
            put_right (v)
        end

feature -- Duplication

    subtree: like Current is
            -- Subtree rooted at current node.
        do
            create Result.make_root (item)
            Result.fill_from_active (Current)
        end

feature {LINKED_CURSOR_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        end

feature {NONE} -- Implementation

    cursor_anchor: TWO_WAY_TREE_CURSOR [G]
            -- Anchor for definitions concerning cursors

    active: TWO_WAY_TREE [G]
            -- Current node

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CURSOR_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Cursor trees implemented in two-way linked representation"
    create: make_root, make

Ancestors
    RECURSIVE_CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] TWO_WAY_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] TWO_WAY_CURSOR_TREE [G]
    Prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] TWO_WAY_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    make
    make_root (v: G)
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_child (v: G)
    put_left (v: G)
    put_right (v: G)
    put_root (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CURSOR_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees implemented in two-way linked representation"
    status: "See notice at end of class"
    names: two_way_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_CURSOR_TREE [G]

create
    make,
    make_root

feature -- Initialization

    make is
            -- Create an empty tree.
        local
            dummy: G
        do
            create above_node.make (dummy)
            active := above_node
        ensure
            is_above: above
            is_empty: is_empty
        end

    make_root (v: G) is
            -- Create a tree with v as root.
        do
            make
            put_root (v)
        end

feature -- Access

    child_item (i: INTEGER): G is
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := item
            go_to (pos)
        end

    cursor: CURSOR is
            -- Current cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        local
            temp: like cursor_anchor
        do
            create temp.make (active, active_parent, after, before, below)
            Result := temp
        end

    has (v: G): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    preorder_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    occurrences (v: G): INTEGER is
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := linear_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent_item: G is
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := item
            go_to (pos)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    preorder_forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    preorder_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature {NONE} -- Access

    linear_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    linear_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                preorder_forth
                search (v)
            end
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from RECURSIVE_CURSOR_TREE
            valid_cursor: not off or else above
        do
            Result := active.arity
        end

    breadth: INTEGER is
            -- Breadth of current level
            -- (from CURSOR_TREE)
        local
            l: INTEGER
            pos: CURSOR
        do
            l := level
            if l > 0 then
                pos := cursor
                go_above
                Result := breadth_of_level_from_active (l + 1)
                go_to (pos)
            end
        end

    count: INTEGER is
            -- Number of items in the tree
            -- (from RECURSIVE_CURSOR_TREE)
        local
            pos: like cursor_anchor
        do
            pos ?= cursor
            from
                start
            until
                off
            loop
                Result := Result + 1
                preorder_forth
            end
            go_to (pos)
            corresponding_child
        end

    depth: INTEGER is
            -- Depth of the tree
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                go_above
                Result := depth_from_active - 1
                go_to (pos)
            end
        end

    level: INTEGER is
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)
        local
            pos: CURSOR
        do
            from
                pos := cursor
            until
                above
            loop
                Result := Result + 1
                up
            end
            go_to (pos)
        end

feature -- Status report

    above: BOOLEAN is
            -- Is there no valid cursor position above cursor?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not below then
                Result := (active_parent = void)
            end
        end

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added on current level?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            Result := (not above) and (not is_root)
        end

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN is
            -- Is the tree empty?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            Result := (above_node.arity = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_leaf: BOOLEAN is
        do
            if not off then
                Result := not below and then active.arity = 0
            end
        end

    is_root: BOOLEAN is
            -- Is cursor on tree root?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not off then
                Result := (active_parent = above_node)
            end
        end

    isfirst: BOOLEAN is
            -- Is cursor on first sibling?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not off then
                Result := active_parent.child_isfirst
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last sibling?
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if not off then
                Result := active_parent.child_islast
            end
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)
        do
            Result := (after or before or below or above)
        end

    Prunable: BOOLEAN is True

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from RECURSIVE_CURSOR_TREE)
        local
            temp: like cursor_anchor
            pos: CURSOR
        do
            temp ?= p
            if temp /= void then
                if temp.active = above_node or temp.before or temp.after or temp.below then
                    Result := True
                else
                    pos := cursor
                    from
                        start
                    until
                        active = temp.active or else off
                    loop
                        preorder_forth
                    end
                    Result := not off
                    go_to (pos)
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)
        do
            Result := i >= 0 and i <= (arity + 1)
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    linear_off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if below then
                after := False
                before := True
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active_parent.child_back
                active := active_parent.child
            end
        end

    breadth_forth is
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        local
            l: INTEGER
        do
            l := level
            level_forth
            if above and (l < depth) then
                start_on_level (l + 1)
            end
        end

    down (i: INTEGER) is
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        do
            if i = 0 then
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (1)
                    active := active.child
                end
                before := True
            elseif above or else i <= arity then
                active_parent := active;
                active.child_go_i_th (i);
                active := active.child
            else
                if arity = 0 then
                    below := True
                else
                    active_parent := active
                    active.child_go_i_th (arity)
                    active := active.child
                end
                after := True
            end
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before
        end

    forth is
            -- Move cursor one position forward.
            -- (from RECURSIVE_CURSOR_TREE)
        do
            if below then
                before := False
                after := True
            elseif before then
                before := False
            elseif islast then
                after := True
            else
                active_parent.child_forth
                active := active_parent.child
            end
        end

    go_last_child is
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above
        do
            up
            down (arity)
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            temp: like cursor_anchor
        do
            temp ?= p
            check
                temp /= void
            end
            unchecked_go (temp)
        end

    level_back is
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)
        do
            if not isfirst then
                back
            elseif not above then
                from
                    up
                    level_back
                until
                    above or else not is_leaf
                loop
                    level_back
                end;
                if not above then
                    down (arity)
                end
            end
        end

    level_forth is
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)
        do
            if not above and then not islast then
                forth
            elseif not above then
                from
                    up
                    level_forth
                until
                    above or else not is_leaf
                loop
                    level_forth
                end;
                if not above then
                    down (1)
                end
            end
        end

    postorder_forth is
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off
        do
            if islast then
                up
            else
                forth
                from
                until
                    is_leaf
                loop
                    down (1)
                end
            end
        end

    postorder_start is
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)
        do
            from
                go_above
            until
                arity = 0
            loop
                down (1)
            end
        end

    preorder_forth is
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after
        do
            if is_leaf then
                from
                until
                    not islast
                loop
                    up
                end
                if not above then
                    forth
                end
            else
                down (1)
            end
        end

    start is
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        do
            go_above
            if not is_empty then
                down (1)
            end
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root
        end

    start_on_level (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        do
            go_above
            start_on_level_from_active (l + 1)
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst
        end

    up is
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        do
            if below then
                below := False
            else
                active := active_parent
                if active /= void then
                    active_parent := active.parent
                end
                corresponding_child
            end
            after := False
            before := False
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)
        end

feature -- Element change

    fill (other: CURSOR_TREE [G]) is
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty
        do
            go_above
            if not other.is_empty then
                other.start
                down (0)
                put_right (other.item)
                forth
                fill_from_active (other)
            end
        end

    container_fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    fill_from_active (other: CURSOR_TREE [G]) is
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf
        do
            if not other.is_leaf then
                from
                    other.down (1)
                    down (0)
                until
                    other.after
                loop
                    put_right (other.item)
                    forth
                    fill_from_active (other)
                    other.forth
                end
                other.up
                up
            end
        end

    merge_left (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            merge_right (other)
        end

    merge_right (other: CURSOR_TREE [G]) is
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        local
            pos: CURSOR
        do
            if not other.is_empty then
                pos := other.cursor
                other.start
                put_right (other.item)
                forth
                if not other.is_leaf then
                    down (0)
                    other.down (0)
                    from
                    until
                        other.islast
                    loop
                        other.forth
                        merge_right (other.subtree)
                    end
                    up
                end
                other.go_to (pos)
            end
        end

    put (v: G) is
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    put_child (v: G) is
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf
        do
            down (0)
            put_right (v)
        end

    put_left (v: G) is
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            back
            put_right (v)
            forth
            forth
        end

    put_right (v: G) is
            -- Add v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        do
            if below then
                active.child_put_right (v)
                active.child_forth
                active_parent := active
                active := active_parent.child
                below := False
            elseif before then
                active_parent.child_put_left (v);
                active_parent.child_back;
                active := active_parent.child
            else
                active_parent.child_put_right (v)
            end
        end

    put_root (v: G) is
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        do
            above_node.child_put_right (v)
            active_parent := above_node
            active := active_parent.child
        ensure
            is_root: is_root
            count = 1
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            writable: writable
        do
            active.replace (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            corresponding_child
            active := active_parent
            active_parent := active.parent
            active.remove_child
            active.child_back
        ensure then -- from RECURSIVE_CURSOR_TREE
            not_off_unless_empty: is_empty or else not off
        end

    wipe_out is
            -- Remove all items.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            prunable
        do
            if not is_empty then
                above_node.child_start
                above_node.remove_child
            end
            active := above_node
            active_parent := void
            after := False
            before := False
            below := False
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from RECURSIVE_CURSOR_TREE
            cursor_above: above
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    child_tree (i: INTEGER): like Current is
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            down (i)
            Result := subtree
            go_to (pos)
        end

    parent_tree: like Current is
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off
        local
            pos: CURSOR
        do
            pos := cursor
            up
            Result := subtree
            go_to (pos)
        end

    subtree: like Current is
            -- Subtree rooted at current node.
        require -- from CURSOR_TREE
            not_off: not off
        do
            create Result.make_root (item)
            Result.fill_from_active (Current)
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove item v.
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {LINKED_CURSOR_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        ensure -- from CURSOR_TREE
            result_exists: Result /= void
            result_is_empty: Result.is_empty
        end

feature {NONE} -- Implementation

    above_node: like active
            -- Node above root; physical root of tree
            -- (from RECURSIVE_CURSOR_TREE)

    active: TWO_WAY_TREE [G]
            -- Current node

    active_parent: like active
            -- Parent of current node
            -- (from RECURSIVE_CURSOR_TREE)

    breadth_of_level_from_active (a_level: INTEGER): INTEGER is
            -- Breadth of level level of subtree starting at current node
            -- (from CURSOR_TREE)
        do
            if (a_level = 2) or else is_leaf then
                Result := arity
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result + breadth_of_level_from_active (a_level - 1)
                    forth
                end
                up
            end
        end

    corresponding_child is
            -- Make active the current child of active_parent.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from RECURSIVE_CURSOR_TREE
            active_exists: active /= void
        do
            if active_parent /= void then
                active_parent.set_child (active)
            end
        end

    cursor_anchor: TWO_WAY_TREE_CURSOR [G]
            -- Anchor for definitions concerning cursors

    depth_from_active: INTEGER is
            -- Depth of subtree starting at active
            -- (from CURSOR_TREE)
        do
            if not off and then arity = 0 then
                Result := 1
            else
                from
                    down (1)
                until
                    after
                loop
                    Result := Result.max (depth_from_active + 1)
                    forth
                end
                up
            end
        end

    start_on_level_from_active (l: INTEGER) is
            -- Move the cursor to the first position
            -- of the l-th level counting from active.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            deep_enough: depth_from_active >= l
        do
            from
                down (1)
            until
                depth_from_active >= l - 1
            loop
                forth
            end
            if (l > 2) then
                start_on_level_from_active (l - 1)
            end
        end

    unchecked_go (p: like cursor_anchor) is
            -- Make an attempt to move cursor
            -- to position p, without checking
            -- whether p is a valid cursor position
            -- or not.
            -- (from RECURSIVE_CURSOR_TREE)
        do
            active_parent := p.active_parent
            active := p.active
            corresponding_child
            after := p.after
            before := p.before
            below := p.below
        end

feature {CURSOR_TREE} -- Implementation

    go_above is
            -- Move the cursor above the tree
            -- (from CURSOR_TREE)
        do
            from
            until
                above
            loop
                up
            end
        end

feature -- Insert element

    extend (v: G) is
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        local
            pos: CURSOR
        do
            pos := cursor
            go_last_child
            put_right (v)
            go_to (pos)
            if below then
                below := False
                before := False
                after := False
                down (0)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                preorder_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                preorder_forth
            end
        end

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                preorder_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature {NONE} -- Not applicable

    index: INTEGER is
            -- (from CURSOR_TREE)
        do
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RECURSIVE_CURSOR_TREE
    coherency: not above implies active_parent.child = active
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CURSOR_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees implemented in two-way linked representation"
    status: "See notice at end of class"
    names: two_way_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_CURSOR_TREE [G]

create

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Initialization

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position
            -- (from RECURSIVE_CURSOR_TREE)

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- (from CURSOR_TREE)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from RECURSIVE_CURSOR_TREE
            valid_cursor: not off or else above

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in the tree
            -- (from RECURSIVE_CURSOR_TREE)

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added on current level?
            -- (from RECURSIVE_CURSOR_TREE)

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is the tree empty?
            -- (from RECURSIVE_CURSOR_TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN

    is_root: BOOLEAN
            -- Is cursor on tree root?
            -- (from RECURSIVE_CURSOR_TREE)

    isfirst: BOOLEAN
            -- Is cursor on first sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    islast: BOOLEAN
            -- Is cursor on last sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from RECURSIVE_CURSOR_TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from RECURSIVE_CURSOR_TREE)

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.
            -- (from RECURSIVE_CURSOR_TREE)

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_child (v: G)
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf

    put_left (v: G)
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_root (v: G)
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        ensure
            is_root: is_root
            count = 1

    replace (v: G)
            -- Replace current item by v.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from RECURSIVE_CURSOR_TREE
            not_off_unless_empty: is_empty or else not off

    wipe_out
            -- Remove all items.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from RECURSIVE_CURSOR_TREE
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node.
        require -- from CURSOR_TREE
            not_off: not off

feature -- Insert element

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RECURSIVE_CURSOR_TREE
    coherency: not above implies active_parent.child = active
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CURSOR_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_CURSOR_TREE [G]

Ancestors
    RECURSIVE_CURSOR_TREE [G]

Clients
    TWO_WAY_CURSOR_TREE [G]

Suppliers
    BOOLEAN
    TWO_WAY_CURSOR_TREE [G]
    TWO_WAY_TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CURSOR_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cursor trees implemented in two-way linked representation"
    status: "See notice at end of class"
    names: two_way_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_CURSOR_TREE [G]

create
    make,
    make_root

feature -- Initialization

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Status report

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    Prunable: BOOLEAN is True

    is_leaf: BOOLEAN

feature -- Element change

    put_right (v: G)
            -- Add v to the right of cursor position.

    put_root (v: G)
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        ensure
            is_root: is_root
            count = 1

    put_child (v: G)
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf

feature -- Duplication

    subtree: like Current
            -- Subtree rooted at current node.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CURSOR_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


cluster base.structures.dispenser

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.dispenser	(diagram)

Supercluster
    base.structures

Classes
    ARRAYED_QUEUE [G]
    ARRAYED_STACK [G]
    BOUNDED_QUEUE [G]
    BOUNDED_STACK [G]
    DISPENSER [G]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]
    LINKED_QUEUE [G]
    LINKED_STACK [G]
    PRIORITY_QUEUE [G -> PART_COMPARABLE]
    QUEUE [G]
    STACK [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_QUEUE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues, implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_QUEUE [G]

inherit
    QUEUE [G]
        undefine
            copy,
            is_equal,
            prune_all
        redefine
            linear_representation,
            has,
            is_empty
        select
            count,
            is_empty,
            put
        end

    ARRAY [G]
        rename
            count as array_count,
            force as force_i_th,
            item as i_th,
            make as array_make,
            put as put_i_th,
            grow as array_grow,
            is_empty as array_empty
        export
            {NONE} all
        redefine
            wipe_out,
            extend,
            prunable,
            linear_representation,
            has,
            full,
            extendible,
            valid_index_set,
            index_set
        end

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        do
            array_make (1, n)
            in_index := 1
            out_index := 1
        ensure
            capacity_expected: capacity = n
        end

feature -- Access

    item: G is
            -- Oldest item.
        do
            Result := i_th (out_index)
        end

    has (v: like item): BOOLEAN is
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := out_index
                    until
                        i = in_index or (i_th (i) /= void and then v.is_equal (i_th (i)))
                    loop
                        i := i + 1
                        if i > capacity then
                            i := 1
                        end
                    end
                end
            else
                from
                    i := out_index
                until
                    i = in_index or v = i_th (i)
                loop
                    i := i + 1
                    if i > capacity then
                        i := 1
                    end
                end
            end
            Result := (i /= in_index)
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items.
        do
            if capacity > 0 then
                Result := (in_index - out_index + capacity) \\ capacity
            end
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure then
            count_definition: Result.count = count
        end

feature -- Status report

    is_empty: BOOLEAN is
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of off.
        do
            Result := (in_index = out_index)
        end

    off: BOOLEAN is
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of is_empty.
        do
            Result := (in_index = out_index)
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (Answer: no.)
        do
            Result := False
        end

    extendible: BOOLEAN is
            -- May items be added? (Answer: yes.)
        do
            Result := True
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

feature -- Element change

    extend (v: G) is
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of put and force.
        do
            if count + 1 >= array_count then
                grow
            end
            put_i_th (v, in_index)
            in_index := (in_index + 1) \\ capacity
            if in_index = 0 then
                in_index := capacity
            end
        end

    put (v: G) is
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and force.
        do
            if count + 1 >= array_count then
                grow
            end
            put_i_th (v, in_index)
            in_index := (in_index + 1) \\ capacity
            if in_index = 0 then
                in_index := capacity
            end
        end

    force (v: G) is
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and put.
        do
            if count + 1 >= array_count then
                grow
            end
            put_i_th (v, in_index)
            in_index := (in_index + 1) \\ capacity
            if in_index = 0 then
                in_index := capacity
            end
        end

    replace (v: like item) is
            -- Replace oldest item by v.
        do
            put_i_th (v, out_index)
        end

feature -- Removal

    remove is
            -- Remove oldest item.
        local
            default_value: G
        do
            put_i_th (default_value, out_index)
            out_index := (out_index + 1) \\ capacity
            if out_index = 0 then
                out_index := capacity
            end
        end

    wipe_out is
            -- Remove all items.
        do
            clear_all
            out_index := 1
            in_index := 1
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the original insertion order)
        local
            i: INTEGER
        do
            create Result.make (count)
            from
                i := out_index
            until
                i = in_index
            loop
                Result.extend (i_th (i))
                i := i + 1
                if i > capacity then
                    i := 1
                end
            end
            i := 1
        end

feature {NONE} -- Inapplicable

    start is
            -- Move cursor to first position.
        do
        end

    finish is
            -- Move cursor to last position.
        do
        end

    forth is
            -- Move cursor to next position.
        do
        end

    valid_index_set: BOOLEAN is
        do
            Result := True
        end

feature {ARRAYED_QUEUE} -- Implementation

    out_index: INTEGER
            -- Position of oldest item

    in_index: INTEGER
            -- Position for next insertion

    grow is
        local
            i, j: INTEGER
            default_value: G
        do
            i := array_count
            resize (1, capacity + additional_space)
            if out_index > 1 then
                from
                    j := capacity
                until
                    i < out_index
                loop
                    put_i_th (i_th (i), j)
                    put_i_th (default_value, i)
                    i := i - 1
                    j := j - 1
                end
                out_index := j + 1
            end
        end

invariant

    not_full: not full
    extendible: extendible
    prunable: prunable
    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_QUEUE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_QUEUE [G]

General
    cluster: base.structures.dispenser
    description: "Unbounded queues, implemented by resizable arrays"
    create: make

Ancestors
    ARRAY [G]
    QUEUE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_QUEUE [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    force (v: G)
    make (n: INTEGER)
    put (v: G)
    remove
    replace (v: [like item] G)
    wipe_out

Constraints
    not full
    extendible
    prunable
    empty means storage empty

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_QUEUE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues, implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:31 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_QUEUE [G]

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        do
            array_make (1, n)
            in_index := 1
            out_index := 1
        ensure
            capacity_expected: capacity = n
        end

feature {NONE} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_from_array (a: ARRAY [G]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := out_index
                    until
                        i = in_index or (i_th (i) /= void and then v.is_equal (i_th (i)))
                    loop
                        i := i + 1
                        if i > capacity then
                            i := 1
                        end
                    end
                end
            else
                from
                    i := out_index
                until
                    i = in_index or v = i_th (i)
                loop
                    i := i + 1
                    if i > capacity then
                        i := 1
                    end
                end
            end
            Result := (i /= in_index)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Oldest item.
        require -- from ACTIVE
            readable: readable
        do
            Result := i_th (out_index)
        end

feature {NONE} -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            Result := i_th (i)
        end

    i_th (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items.
        do
            if capacity > 0 then
                Result := (in_index - out_index + capacity) \\ capacity
            end
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        ensure then
            count_definition: Result.count = count
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (from ARRAY)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if i_th (i) /= void and then v.is_equal (i_th (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if i_th (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    array_count: INTEGER is
            -- Number of available indices
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        local
            i: INTEGER
        do
            if lower = other.lower and then upper = other.upper and then object_comparison = other.object_comparison then
                if object_comparison then
                    from
                        Result := True
                        i := lower
                    until
                        not Result or i > upper
                    loop
                        Result := equal (i_th (i), other.i_th (i))
                        i := i + 1
                    end
                else
                    Result := area.same_items (other.area, upper - lower)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May items be added? (Answer: yes.)
        do
            Result := True
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (Answer: no.)
        do
            Result := False
        end

    is_empty: BOOLEAN is
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of off.
        do
            Result := (in_index = out_index)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of is_empty.
        do
            Result := (in_index = out_index)
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature {NONE} -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((i_th (upper) = void or else i_th (upper) = i_th (upper).default) and subarray (lower, upper - 1).all_default))
        end

    array_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (i_th (upper) = other.i_th (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        do
            fill (s)
        end

    extend (v: G) is
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        do
            if count + 1 >= array_count then
                grow
            end
            put_i_th (v, in_index)
            in_index := (in_index + 1) \\ capacity
            if in_index = 0 then
                in_index := capacity
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: G) is
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and put.
        do
            if count + 1 >= array_count then
                grow
            end
            put_i_th (v, in_index)
            in_index := (in_index + 1) \\ capacity
            if in_index = 0 then
                in_index := capacity
            end
        end

    put (v: G) is
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        do
            if count + 1 >= array_count then
                grow
            end
            put_i_th (v, in_index)
            in_index := (in_index + 1) \\ capacity
            if in_index = 0 then
                in_index := capacity
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: like item) is
            -- Replace oldest item by v.
        require -- from ACTIVE
            writable: writable
        do
            put_i_th (v, out_index)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    enter (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    force_i_th (v: like i_th; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count
        end

    put_i_th (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    remove is
            -- Remove oldest item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            default_value: G
        do
            put_i_th (default_value, out_index)
            out_index := (out_index + 1) \\ capacity
            if out_index = 0 then
                out_index := capacity
            end
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            clear_all
            out_index := 1
            in_index := 1
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            array_grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    array_grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the original insertion order)
        local
            i: INTEGER
        do
            create Result.make (count)
            from
                i := out_index
            until
                i = in_index
            loop
                Result.extend (i_th (i))
                i := i + 1
                if i > capacity then
                    i := 1
                end
            end
            i := 1
        end

feature {NONE} -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

feature {NONE} -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    finish is
            -- Move cursor to last position.
        do
        end

    forth is
            -- Move cursor to next position.
        do
        end

    prune (v: G) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        do
        end

    start is
            -- Move cursor to first position.
        do
        end

    valid_index_set: BOOLEAN is
        do
            Result := True
        end

feature {ARRAYED_QUEUE} -- Implementation

    grow is
        local
            i, j: INTEGER
            default_value: G
        do
            i := array_count
            resize (1, capacity + additional_space)
            if out_index > 1 then
                from
                    j := capacity
                until
                    i < out_index
                loop
                    put_i_th (i_th (i), j)
                    put_i_th (default_value, i)
                    i := i - 1
                    j := j - 1
                end
                out_index := j + 1
            end
        end

    in_index: INTEGER
            -- Position for next insertion

    out_index: INTEGER
            -- Position of oldest item

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

invariant

    not_full: not full
    extendible: extendible
    prunable: prunable
    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_QUEUE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues, implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_QUEUE [G]

create

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Initialization

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Access

    has (v: like item): BOOLEAN
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Oldest item.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items.

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        ensure then
            count_definition: Result.count = count

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added? (Answer: yes.)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (Answer: no.)

    is_empty: BOOLEAN
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of off.

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of is_empty.

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and put.

    put (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: like item)
            -- Replace oldest item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove oldest item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the original insertion order)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

invariant

    not_full: not full
    extendible: extendible
    prunable: prunable
    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_QUEUE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_QUEUE [G]

Ancestors
    ARRAY [G]
    QUEUE [G]

Clients
    ARRAYED_QUEUE [G]

Suppliers
    ANY
    ARRAYED_LIST [G]
    ARRAYED_QUEUE [G]
    BOOLEAN
    INTEGER
    INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_QUEUE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues, implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_QUEUE [G]

create
    make

feature -- Initialization

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Access

    item: G
            -- Oldest item.

    has (v: like item): BOOLEAN
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)

feature -- Measurement

    count: INTEGER
            -- Number of items.

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure then
            count_definition: Result.count = count

feature -- Status report

    is_empty: BOOLEAN
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of off.

    off: BOOLEAN
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of is_empty.

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (Answer: no.)

    extendible: BOOLEAN
            -- May items be added? (Answer: yes.)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

feature -- Element change

    extend (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of put and force.

    put (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and force.

    force (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and put.

    replace (v: like item)
            -- Replace oldest item by v.

feature -- Removal

    remove
            -- Remove oldest item.

    wipe_out
            -- Remove all items.

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the original insertion order)

invariant

    not_full: not full
    extendible: extendible
    prunable: prunable
    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_STACK Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_STACK [G]

inherit
    STACK [G]
        undefine
            copy,
            is_equal,
            prune_all,
            replace,
            is_inserted
        redefine
            linear_representation
        select
            remove,
            extend,
            put
        end

    ARRAYED_LIST [G]
        rename
            put as al_put,
            extend as al_extend,
            force as al_force,
            remove as al_remove,
            start as finish,
            finish as start,
            forth as back,
            back as forth,
            after as before,
            before as after
        export
            {NONE} all,
            {ANY} count, readable, writable, extendible, make, wipe_out,
            {STACK} start, finish, forth, back
        undefine
            readable,
            writable,
            append,
            fill
        redefine
            linear_representation
        end

create
    make

feature -- Element change

    extend (v: like item) is
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of put and force.
        do
            al_extend (v)
            start
        end

    put (v: like item) is
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and force.
        do
            al_extend (v)
            start
        end

    force (v: like item) is
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and put.
        do
            al_extend (v)
            start
        end

feature -- Removal

    remove is
            -- Remove top item.
        require else
            not_empty: count /= 0
        do
            al_remove
            start
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)
        local
            i: INTEGER
        do
            from
                create Result.make (count)
                i := count
            until
                i < 1
            loop
                Result.extend (i_th (i))
                i := i - 1
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_STACK Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_STACK [G]

General
    cluster: base.structures.dispenser
    description: "Stacks implemented by resizable arrays"
    create: make

Ancestors
    ARRAYED_LIST [G]
    STACK [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_STACK [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: [like first] G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_STACK [G])
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    make (n: INTEGER)
    put (v: [like item] G)
    remove
    replace (v: [like first] G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_STACK Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_STACK [G]

create
    make

feature  -- Initialization

    make (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        do
            index := 0
            count := 0
            array_make (1, n)
        ensure -- from ARRAYED_LIST
            correct_position: after
        end

feature {NONE} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_filled (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        do
            index := 0
            count := n
            array_make (1, n)
        ensure -- from ARRAYED_LIST
            correct_position: after
            filled: full
        end

    make_from_array (a: ARRAY [G]) is
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void
        do
            Precursor  (a)
            lower := 1
            count := a.count
            upper := count
            index := 0
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (i_th (i) /= void and then i_th (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (i_th (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: like first is
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)
        do
            Result := area.item (index - 1)
        end

feature {NONE} -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    cursor: CURSOR is
            -- Current cursor position
            -- (from ARRAYED_LIST)
        do
            create {ARRAYED_LIST_CURSOR} Result.make (index)
        end

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            Result := i_th (i)
        end

    first: G is
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (0)
        end

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            finish
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    finish
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    back
                    pos := pos + 1
                end
            else
                from
                    finish
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    back
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    i_th (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

    last: like first is
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (count - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                finish
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                back
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    back
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    back
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    array_count: INTEGER is
            -- Number of available indices
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    array_index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        finish
                        other.finish
                    until
                        before or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        back
                        other.back
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)
        do
            check
                put_constraint: (v /= last) implies not off
            end
            Result := (v = last) or else (v = item)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature {NONE} -- Status report

    before: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((i_th (upper) = void or else i_th (upper) = i_th (upper).default) and subarray (lower, upper - 1).all_default))
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (i_th (upper) = other.i_th (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            if al_c /= void then
                Result := valid_cursor_index (al_c.index)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        do
            Result := (1 <= i) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        do
            Result := (1 <= i) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    array_valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = count
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Cursor movement

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            index := i
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            check
                al_c /= void
            end
            index := al_c.index
        end

    move (i: INTEGER) is
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        do
            index := index + i
            if (index > count + 1) then
                index := count + 1
            elseif (index < 0) then
                index := 0
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if after and not is_empty then
                back
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature {STACK} -- Cursor movement

    forth is
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not after
        do
            index := index - 1
        end

    start is
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        do
            index := count
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies after
        end

    back is
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not before
        do
            index := index + 1
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    finish is
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        do
            index := 1
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies before
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        do
            fill (s)
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        do
            al_extend (v)
            start
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v
        end

    fill (other: LINEAR [G]) is
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            temp: ARRAYED_STACK [G]
        do
            create temp.make (0)
            from
                other.start
            until
                other.off
            loop
                temp.extend (other.item)
                other.forth
            end
            from
            until
                temp.is_empty or else not extendible
            loop
                extend (temp.item)
                temp.remove
            end
        end

    force (v: like item) is
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and put.
        do
            al_extend (v)
            start
        ensure then -- from STACK
            item_pushed: item = v
        end

    put (v: like item) is
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        do
            al_extend (v)
            start
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v
        end

    replace (v: like first) is
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            put_i_th (v, index)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    enter (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            area.put (v, i - lower)
        end

    al_extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        do
            count := count + 1
            force_i_th (v, count)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    force_i_th (v: like i_th; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count
        end

    al_force (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        do
            count := count + 1
            force_i_th (v, count)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not after
            other_exists: other /= void
        local
            old_index: INTEGER
            old_other_count: INTEGER
        do
            old_index := index
            old_other_count := other.count
            index := index - 1
            merge_right (other)
            index := old_index + old_other_count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not before
            other_exists: other /= void
        do
            if not other.is_empty then
                resize (1, count + other.count)
                if index < count then
                    subcopy (Current, index + 1, count, index + other.count + 1)
                end
                subcopy (other, 1, other.count, index + 1)
                count := count + other.count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    al_put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_front (v: like item) is
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        do
            if is_empty then
                extend (v)
            else
                insert (v, 1)
            end
            index := index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_left (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not after
        do
            if before or is_empty then
                extend (v)
            else
                insert (v, index)
            end
            index := index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not before
        do
            if index = count then
                extend (v)
            else
                insert (v, index + 1)
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.array_valid_index (start_pos)
            valid_end_pos: other.array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: array_valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    remove is
            -- Remove top item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else
            not_empty: count /= 0
        do
            al_remove
            start
        end

    wipe_out is
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        do
            count := 0
            index := 0
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: after
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable
        do
            if after then
                index := 1
            end
            if object_comparison then
                if v /= void then
                    from
                    until
                        before or else (item /= void and then v.is_equal (item))
                    loop
                        back
                    end
                end
            else
                from
                until
                    before or else item = v
                loop
                    back
                end
            end
            if not before then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        local
            i: INTEGER
            offset: INTEGER
            res: BOOLEAN
            obj_cmp: BOOLEAN
            default_val: like item
        do
            obj_cmp := object_comparison
            from
                i := 1
            until
                i > count
            loop
                if i <= count - offset then
                    if offset > 0 then
                        put_i_th (i_th (i + offset), i)
                    end
                    if obj_cmp then
                        res := equal (v, i_th (i))
                    else
                        res := (v = i_th (i))
                    end
                    if res then
                        offset := offset + 1
                    else
                        i := i + 1
                    end
                else
                    put_i_th (default_val, i)
                    i := i + 1
                end
            end
            count := count - offset
            index := count + 1
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: before
        end

    al_remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            default_value: G
        do
            if index < count then
                subcopy (Current, index + 1, count, index)
            end
            count := count - 1
            area.put (default_value, count)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies before
        ensure then -- from ARRAYED_LIST
            index: index = old index
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not after
        do
            index := index - 1
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            index := index + 1
            remove
            index := index - 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                finish
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature {NONE} -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        local
            old_item: like item
        do
            old_item := item
            replace (area.item (i - 1))
            area.put (old_item, i - 1)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)
        local
            i: INTEGER
        do
            from
                create Result.make (count)
                i := count
            until
                i < 1
            loop
                Result.extend (i_th (i))
                i := i - 1
            end
        end

feature {NONE} -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature {NONE} -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies before
            valid_subchain: n >= 0
        local
            end_pos: INTEGER
        do
            if before then
                create Result.make (0)
            else
                end_pos := count.min (index + n - 1)
                create Result.make_filled (end_pos - index + 1)
                Result.subcopy (Current, index, end_pos, 1)
            end
        end

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: array_valid_index (start_pos)
            valid_end_pos: array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    new_chain: like Current is
            -- Unused
            -- (from ARRAYED_LIST)
        do
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    insert (v: like item; pos: INTEGER) is
            -- Add v at pos, moving subsequent items
            -- to the right.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            index_small_enough: pos <= count
            index_large_enough: pos >= 1
        do
            if count + 1 > capacity then
                auto_resize (lower, count + 1)
            end
            count := count + 1
            subcopy (Current, pos, count - 1, pos + 1)
            enter (v, pos)
        ensure -- from ARRAYED_LIST
            new_count: count = old count + 1
            index_unchanged: index = old index
            insertion_done: i_th (pos) = v
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                finish
            until
                before
            loop
                t.put (item, 1)
                action.call (t)
                back
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                finish
            until
                before
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                back
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                finish
                Result := True
            until
                before or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                back
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                finish
            until
                before or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                back
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: after = (index = 0)
    after_definition: before = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from BILINEAR
    not_both: not (before and after)
    before_constraint: after implies off
        -- from LINEAR
    after_constraint: before implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_STACK Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_STACK [G]

create

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: after

feature  -- Initialization

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: after

feature -- Access

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and put.
        ensure then -- from STACK
            item_pushed: item = v

    put (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove top item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else
            not_empty: count /= 0

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: after

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: after = (index = 0)
    after_definition: before = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from BILINEAR
    not_both: not (before and after)
    before_constraint: after implies off
        -- from LINEAR
    after_constraint: before implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_STACK Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_STACK [G]

Ancestors
    ARRAYED_LIST [G]
    STACK [G]

Clients
    ARRAYED_STACK [G]
    STACK [G]

Suppliers
    ARRAYED_LIST [G]
    ARRAYED_STACK [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_STACK Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_STACK [G]

create
    make

feature -- Element change

    extend (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of put and force.

    put (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and force.

    force (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and put.

feature -- Removal

    remove
            -- Remove top item.
        require else
            not_empty: count /= 0

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_QUEUE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Queues with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    BOUNDED_QUEUE [G]

inherit
    QUEUE [G]
        redefine
            linear_representation,
            has
        end

    BOUNDED [G]
        undefine
            copy,
            is_equal
        end

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        do
            create fl.make (0, n)
        ensure
            capacity_expected: capacity = n
        end

feature -- Access

    item: G is
            -- Oldest item.
        do
            Result := fl.item (out_index)
        end

    has (v: like item): BOOLEAN is
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    if out_index > in_index then
                        from
                            i := out_index
                        until
                            Result or i > fl.count
                        loop
                            Result := fl.item (i) /= void and then v.is_equal (fl.item (i))
                            i := i + 1
                        end
                        from
                            i := 0
                        until
                            Result or i >= in_index
                        loop
                            Result := fl.item (i) /= void and then v.is_equal (fl.item (i))
                            i := i + 1
                        end
                    else
                        from
                            i := out_index
                        until
                            Result or i >= in_index
                        loop
                            Result := fl.item (i) /= void and then v.is_equal (fl.item (i))
                            i := i + 1
                        end
                    end
                end
            else
                if out_index > in_index then
                    from
                        i := out_index
                    until
                        Result or i > fl.count
                    loop
                        Result := v = fl.item (i)
                        i := i + 1
                    end
                    from
                        i := 0
                    until
                        Result or i >= in_index
                    loop
                        Result := v = fl.item (i)
                        i := i + 1
                    end
                else
                    from
                        i := out_index
                    until
                        Result or i >= in_index
                    loop
                        Result := v = fl.item (i)
                        i := i + 1
                    end
                end
            end
        end

feature -- Measurement

    capacity: INTEGER is
            -- Number of items that may be kept.
        do
            Result := fl.capacity - 1
        end

    count: INTEGER is
            -- Number of items.
        local
            size: INTEGER
        do
            size := fl.capacity
            Result := (in_index - out_index + size) \\ size
        end

feature -- Status report

    off: BOOLEAN is
            -- Is there no current item?
        local
            size: INTEGER
        do
            if index = in_index then
                Result := True
            else
                size := fl.capacity
                Result := count <= ((index - out_index + size) \\ size)
            end
        end

    Prunable: BOOLEAN is True

    Resizable: BOOLEAN is True

    extendible: BOOLEAN is
        do
            Result := not full
        end

feature -- Cursor movement

    start is
            -- Move cursor to first position.
        do
            index := out_index
        end

    finish is
            -- Move cursor to last position.
        local
            size: INTEGER
        do
            if is_empty then
                index := 0
            else
                size := fl.capacity
                index := (in_index - 1 + size) \\ size
            end
        end

    forth is
            -- Move cursor to next position.
        do
            index := (index + 1) \\ fl.capacity
        end

feature -- Element change

    extend (v: G) is
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of force and put.
        do
            fl.put (v, in_index)
            in_index := (in_index + 1) \\ fl.capacity
        end

    force (v: G) is
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and put.
        do
            fl.put (v, in_index)
            in_index := (in_index + 1) \\ fl.capacity
        end

    put (v: G) is
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and force.
        do
            fl.put (v, in_index)
            in_index := (in_index + 1) \\ fl.capacity
        end

    replace (v: like item) is
            -- Replace oldest item by v.
        do
            fl.put (v, out_index)
        end

feature -- Removal

    remove is
            -- Remove oldest item.
        do
            out_index := (out_index + 1) \\ fl.capacity
        end

    prune (v: like item) is
        do
        end

    wipe_out is
            -- Remove all items.
        do
            out_index := 0
            in_index := 0
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the original insertion order)
        local
            i: INTEGER
        do
            create Result.make (count)
            if out_index > in_index then
                from
                    i := out_index
                until
                    i >= fl.count
                loop
                    Result.extend (fl.item (i))
                    i := i + 1
                end
                from
                    i := 1
                until
                    i >= in_index
                loop
                    Result.extend (fl.item (i))
                    i := i + 1
                end
            else
                from
                    i := out_index
                until
                    i >= in_index
                loop
                    Result.extend (fl.item (i))
                    i := i + 1
                end
            end
        end

feature {BOUNDED_QUEUE} -- Implementation

    out_index: INTEGER
            -- Position of oldest item

    in_index: INTEGER
            -- Position for next insertion

    index: INTEGER
            -- Current position

    fl: ARRAY [G]
            -- Storage

feature -- Measurement

    occurrences (v: G): INTEGER is
        do
            if object_comparison then
                fl.compare_objects
            else
                fl.compare_references
            end
            Result := fl.occurrences (v)
        end

invariant

    extendible_definition: extendible = not full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_QUEUE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOUNDED_QUEUE [G]

General
    cluster: base.structures.dispenser
    description: "Queues with a bounded physical size, implemented by arrays"
    create: make

Ancestors
    BOUNDED [G]
    QUEUE [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    readable: BOOLEAN
    Resizable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: G)
    forth
    make (n: INTEGER)
    prune (v: [like item] G)
    put (v: G)
    remove
    replace (v: [like item] G)
    start
    wipe_out

Constraints
    extendible definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_QUEUE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Queues with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    BOUNDED_QUEUE [G]

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        do
            create fl.make (0, n)
        ensure
            capacity_expected: capacity = n
        end

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    if out_index > in_index then
                        from
                            i := out_index
                        until
                            Result or i > fl.count
                        loop
                            Result := fl.item (i) /= void and then v.is_equal (fl.item (i))
                            i := i + 1
                        end
                        from
                            i := 0
                        until
                            Result or i >= in_index
                        loop
                            Result := fl.item (i) /= void and then v.is_equal (fl.item (i))
                            i := i + 1
                        end
                    else
                        from
                            i := out_index
                        until
                            Result or i >= in_index
                        loop
                            Result := fl.item (i) /= void and then v.is_equal (fl.item (i))
                            i := i + 1
                        end
                    end
                end
            else
                if out_index > in_index then
                    from
                        i := out_index
                    until
                        Result or i > fl.count
                    loop
                        Result := v = fl.item (i)
                        i := i + 1
                    end
                    from
                        i := 0
                    until
                        Result or i >= in_index
                    loop
                        Result := v = fl.item (i)
                        i := i + 1
                    end
                else
                    from
                        i := out_index
                    until
                        Result or i >= in_index
                    loop
                        Result := v = fl.item (i)
                        i := i + 1
                    end
                end
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Oldest item.
        require -- from ACTIVE
            readable: readable
        do
            Result := fl.item (out_index)
        end

feature -- Measurement

    capacity: INTEGER is
            -- Number of items that may be kept.
        do
            Result := fl.capacity - 1
        end

    count: INTEGER is
            -- Number of items.
        local
            size: INTEGER
        do
            size := fl.capacity
            Result := (in_index - out_index + size) \\ size
        end

    occurrences (v: G): INTEGER is
        do
            if object_comparison then
                fl.compare_objects
            else
                fl.compare_references
            end
            Result := fl.occurrences (v)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
        do
            Result := not full
        end

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
        local
            size: INTEGER
        do
            if index = in_index then
                Result := True
            else
                size := fl.capacity
                Result := count <= ((index - out_index + size) \\ size)
            end
        end

    Prunable: BOOLEAN is True

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    Resizable: BOOLEAN is True

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    finish is
            -- Move cursor to last position.
        local
            size: INTEGER
        do
            if is_empty then
                index := 0
            else
                size := fl.capacity
                index := (in_index - 1 + size) \\ size
            end
        end

    forth is
            -- Move cursor to next position.
        do
            index := (index + 1) \\ fl.capacity
        end

    start is
            -- Move cursor to first position.
        do
            index := out_index
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        do
            fill (s)
        end

    extend (v: G) is
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        do
            fl.put (v, in_index)
            in_index := (in_index + 1) \\ fl.capacity
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: G) is
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and put.
        do
            fl.put (v, in_index)
            in_index := (in_index + 1) \\ fl.capacity
        end

    put (v: G) is
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        do
            fl.put (v, in_index)
            in_index := (in_index + 1) \\ fl.capacity
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: like item) is
            -- Replace oldest item by v.
        require -- from ACTIVE
            writable: writable
        do
            fl.put (v, out_index)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    prune (v: like item) is
        require -- from COLLECTION
            prunable: prunable
        do
        end

    remove is
            -- Remove oldest item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            out_index := (out_index + 1) \\ fl.capacity
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            out_index := 0
            in_index := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the original insertion order)
        local
            i: INTEGER
        do
            create Result.make (count)
            if out_index > in_index then
                from
                    i := out_index
                until
                    i >= fl.count
                loop
                    Result.extend (fl.item (i))
                    i := i + 1
                end
                from
                    i := 1
                until
                    i >= in_index
                loop
                    Result.extend (fl.item (i))
                    i := i + 1
                end
            else
                from
                    i := out_index
                until
                    i >= in_index
                loop
                    Result.extend (fl.item (i))
                    i := i + 1
                end
            end
        end

feature {BOUNDED_QUEUE} -- Implementation

    fl: ARRAY [G]
            -- Storage

    in_index: INTEGER
            -- Position for next insertion

    index: INTEGER
            -- Current position

    out_index: INTEGER
            -- Position of oldest item

invariant

    extendible_definition: extendible = not full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_QUEUE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Queues with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    BOUNDED_QUEUE [G]

create

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Initialization

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Access

    has (v: like item): BOOLEAN
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Oldest item.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be kept.

    count: INTEGER
            -- Number of items.

    occurrences (v: G): INTEGER
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    Resizable: BOOLEAN is True

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    finish
            -- Move cursor to last position.

    forth
            -- Move cursor to next position.

    start
            -- Move cursor to first position.

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and put.

    put (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: like item)
            -- Replace oldest item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
        require -- from COLLECTION
            prunable: prunable

    remove
            -- Remove oldest item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the original insertion order)

invariant

    extendible_definition: extendible = not full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_QUEUE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOUNDED_QUEUE [G]

Ancestors
    BOUNDED [G]
    QUEUE [G]

Clients
    BOUNDED_QUEUE [G]

Suppliers
    ANY
    ARRAY [G]
    ARRAYED_LIST [G]
    BOOLEAN
    BOUNDED_QUEUE [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_QUEUE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Queues with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    BOUNDED_QUEUE [G]

create
    make

feature -- Initialization

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Access

    item: G
            -- Oldest item.

    has (v: like item): BOOLEAN
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be kept.

    count: INTEGER
            -- Number of items.

feature -- Status report

    off: BOOLEAN
            -- Is there no current item?

    Prunable: BOOLEAN is True

    Resizable: BOOLEAN is True

    extendible: BOOLEAN

feature -- Cursor movement

    start
            -- Move cursor to first position.

    finish
            -- Move cursor to last position.

    forth
            -- Move cursor to next position.

feature -- Element change

    extend (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of force and put.

    force (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and put.

    put (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and force.

    replace (v: like item)
            -- Replace oldest item by v.

feature -- Removal

    remove
            -- Remove oldest item.

    prune (v: like item)

    wipe_out
            -- Remove all items.

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the original insertion order)

feature -- Measurement

    occurrences (v: G): INTEGER

invariant

    extendible_definition: extendible = not full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_STACK Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    BOUNDED_STACK [G]

inherit
    STACK [G]
        redefine
            replace,
            item,
            linear_representation
        end

    BOUNDED [G]
        undefine
            copy,
            is_equal
        end

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create a stack for at most n items.
        require
            non_negative_argument: n >= 0
        do
            create fl.make (0, n)
        ensure
            stack_allocated: capacity = n
            empty_stack: count = 0
        end

feature -- Access

    item: G is
            -- Last item pushed (i.e. top)
        require else
            not_empty: count > 0
        do
            Result := fl.item (count)
        end

feature -- Measurement

    count: INTEGER

    capacity: INTEGER is
        do
            Result := fl.count - 1
        end

    occurrences (v: G): INTEGER is
        do
            if object_comparison then
                fl.compare_objects
            else
                fl.compare_references
            end
            Result := fl.occurrences (v)
        end

feature -- Element change

    extend (v: like item) is
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of force and put.
        do
            count := count + 1
            fl.put (v, count)
        end

    force (v: like item) is
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and put.
        do
            count := count + 1
            fl.put (v, count)
        end

    put (v: like item) is
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and force.
        do
            count := count + 1
            fl.put (v, count)
        end

    replace (v: like item) is
            -- Replace top item by v.
        do
            fl.put (v, count)
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does v appear in stack?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                fl.compare_objects
            else
                fl.compare_references
            end
            Result := fl.has (v)
        end

feature -- Removal

    remove is
            -- Remove top item.
        require else
            not_empty: count /= 0
        local
            default_value: like item
        do
            fl.put (default_value, count)
            count := count - 1
        end

    wipe_out is
            -- Remove all items.
        do
            fl.clear_all
            count := 0
        end

feature -- Status report

    extendible: BOOLEAN is
        do
            Result := not full
        ensure then
            Result = not full
        end

    Resizable: BOOLEAN is True

    Prunable: BOOLEAN is True

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)
        local
            i: INTEGER
        do
            from
                create Result.make (count)
                i := count
            until
                i < 0
            loop
                Result.extend (fl.item (i))
                i := i - 1
            end
        end

feature {STACK} -- Implementation

    start is
            -- Move to first position.
            -- (No effect if empty)
        do
            if not is_empty then
                index := count
            end
        end

    finish is
            -- Move to last position.
            -- (No effect if empty)
        do
            if not is_empty then
                index := 1
            end
        end

    forth is
            -- Move to next position.
        do
            index := index - 1
        end

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := (index < 1) or else (index > count)
        end

    fl: ARRAY [G]
            -- Storage

    index: INTEGER
            -- Current place in stack.

feature {NONE} -- Inapplicable

    prune (v: G) is
        do
        end

invariant

    count_small_enough: count <= capacity
    extendible_definition: extendible = not full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_STACK Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOUNDED_STACK [G]

General
    cluster: base.structures.dispenser
    description: "Stacks with a bounded physical size, implemented by arrays"
    create: make

Ancestors
    BOUNDED [G]
    STACK [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    Prunable: BOOLEAN
    readable: BOOLEAN
    Resizable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    make (n: INTEGER)
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out

Constraints
    count small enough
    extendible definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_STACK Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    BOUNDED_STACK [G]

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create a stack for at most n items.
        require
            non_negative_argument: n >= 0
        do
            create fl.make (0, n)
        ensure
            stack_allocated: capacity = n
            empty_stack: count = 0
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does v appear in stack?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                fl.compare_objects
            else
                fl.compare_references
            end
            Result := fl.has (v)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Last item pushed (i.e. top)
        require -- from ACTIVE
            readable: readable
        require else
            not_empty: count > 0
        do
            Result := fl.item (count)
        end

feature -- Measurement

    capacity: INTEGER is
        do
            Result := fl.count - 1
        end

    count: INTEGER

    occurrences (v: G): INTEGER is
        do
            if object_comparison then
                fl.compare_objects
            else
                fl.compare_references
            end
            Result := fl.occurrences (v)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
        do
            Result := not full
        ensure then
            Result = not full
        end

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Prunable: BOOLEAN is True

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    Resizable: BOOLEAN is True

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        do
            fill (s)
        end

    extend (v: like item) is
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        do
            count := count + 1
            fl.put (v, count)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v
        end

    fill (other: LINEAR [G]) is
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            temp: ARRAYED_STACK [G]
        do
            create temp.make (0)
            from
                other.start
            until
                other.off
            loop
                temp.extend (other.item)
                other.forth
            end
            from
            until
                temp.is_empty or else not extendible
            loop
                extend (temp.item)
                temp.remove
            end
        end

    force (v: like item) is
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and put.
        do
            count := count + 1
            fl.put (v, count)
        ensure then -- from STACK
            item_pushed: item = v
        end

    put (v: like item) is
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        do
            count := count + 1
            fl.put (v, count)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v
        end

    replace (v: like item) is
            -- Replace top item by v.
        require -- from ACTIVE
            writable: writable
        do
            fl.put (v, count)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove top item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else
            not_empty: count /= 0
        local
            default_value: like item
        do
            fl.put (default_value, count)
            count := count - 1
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            fl.clear_all
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)
        local
            i: INTEGER
        do
            from
                create Result.make (count)
                i := count
            until
                i < 0
            loop
                Result.extend (fl.item (i))
                i := i - 1
            end
        end

feature {NONE} -- Inapplicable

    prune (v: G) is
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {STACK} -- Implementation

    finish is
            -- Move to last position.
            -- (No effect if empty)
        do
            if not is_empty then
                index := 1
            end
        end

    fl: ARRAY [G]
            -- Storage

    forth is
            -- Move to next position.
        do
            index := index - 1
        end

    index: INTEGER
            -- Current place in stack.

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := (index < 1) or else (index > count)
        end

    start is
            -- Move to first position.
            -- (No effect if empty)
        do
            if not is_empty then
                index := count
            end
        end

invariant

    count_small_enough: count <= capacity
    extendible_definition: extendible = not full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_STACK Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    BOUNDED_STACK [G]

create

    make (n: INTEGER)
            -- Create a stack for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            stack_allocated: capacity = n
            empty_stack: count = 0

feature -- Initialization

    make (n: INTEGER)
            -- Create a stack for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            stack_allocated: capacity = n
            empty_stack: count = 0

feature -- Access

    has (v: G): BOOLEAN
            -- Does v appear in stack?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Last item pushed (i.e. top)
        require -- from ACTIVE
            readable: readable
        require else
            not_empty: count > 0

feature -- Measurement

    capacity: INTEGER

    count: INTEGER

    occurrences (v: G): INTEGER
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
        ensure then
            Result = not full

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    Resizable: BOOLEAN is True

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and put.
        ensure then -- from STACK
            item_pushed: item = v

    put (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v

    replace (v: like item)
            -- Replace top item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove top item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else
            not_empty: count /= 0

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)

invariant

    count_small_enough: count <= capacity
    extendible_definition: extendible = not full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_STACK Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOUNDED_STACK [G]

Ancestors
    BOUNDED [G]
    STACK [G]

Clients
    BOUNDED_STACK [G]

Suppliers
    ARRAY [G]
    ARRAYED_LIST [G]
    BOOLEAN
    BOUNDED_STACK [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED_STACK Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Stacks with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    BOUNDED_STACK [G]

create
    make

feature -- Initialization

    make (n: INTEGER)
            -- Create a stack for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            stack_allocated: capacity = n
            empty_stack: count = 0

feature -- Access

    item: G
            -- Last item pushed (i.e. top)
        require else
            not_empty: count > 0

feature -- Measurement

    count: INTEGER

    capacity: INTEGER

    occurrences (v: G): INTEGER

feature -- Element change

    extend (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of force and put.

    force (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and put.

    put (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and force.

    replace (v: like item)
            -- Replace top item by v.

feature -- Access

    has (v: G): BOOLEAN
            -- Does v appear in stack?
            -- (Reference or object equality,
            -- based on object_comparison.)

feature -- Removal

    remove
            -- Remove top item.
        require else
            not_empty: count /= 0

    wipe_out
            -- Remove all items.

feature -- Status report

    extendible: BOOLEAN
        ensure then
            Result = not full

    Resizable: BOOLEAN is True

    Prunable: BOOLEAN is True

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)

invariant

    count_small_enough: count <= capacity
    extendible_definition: extendible = not full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.dispenser

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


DISPENSER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Dispensers: containers for which clients have no say
            as to what item they can access at a given time.
            Examples include stacks and queues.
    ]"
    status: "See notice at end of class"
    names: dispenser, active
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    DISPENSER [G]

inherit
    ACTIVE [G]

    FINITE [G]

feature -- Status report

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := not is_empty
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
        do
            fill (s)
        end

    extend (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
        deferred
        end

    force (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.
        deferred
        end

    put (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
        deferred
        end

invariant

    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DISPENSER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DISPENSER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DISPENSER [G]

General
    cluster: base.structures.dispenser
    description:
        "Dispensers: containers for which clients have no say
        as to what item they can access at a given time.
        Examples include stacks and queues."

Ancestors
    ACTIVE [G]
    FINITE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    prune (v: G)
    prune_all (v: G)
    put (v: [like item] G)
    remove
    replace (v: G)
    wipe_out

Constraints
    readable definition
    writable definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DISPENSER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Dispensers: containers for which clients have no say
            as to what item they can access at a given time.
            Examples include stacks and queues.
    ]"
    status: "See notice at end of class"
    names: dispenser, active
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    DISPENSER [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable
        deferred
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := not is_empty
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
        do
            fill (s)
        end

    extend (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.
        deferred
        end

    put (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DISPENSER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DISPENSER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Dispensers: containers for which clients have no say
            as to what item they can access at a given time.
            Examples include stacks and queues.
    ]"
    status: "See notice at end of class"
    names: dispenser, active
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DISPENSER [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)

    extend (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.

    put (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DISPENSER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DISPENSER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DISPENSER [G]

Ancestors
    ACTIVE [G]
    FINITE [G]

Descendants
    PRIORITY_QUEUE [G -> PART_COMPARABLE]
    QUEUE [G]
    STACK [G]

Clients
    DISPENSER [G]

Suppliers
    BOOLEAN
    DISPENSER [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DISPENSER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Dispensers: containers for which clients have no say
            as to what item they can access at a given time.
            Examples include stacks and queues.
    ]"
    status: "See notice at end of class"
    names: dispenser, active
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DISPENSER [G]

feature -- Status report

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)

    extend (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.

    force (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.

    put (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.

invariant

    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DISPENSER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEAP_PRIORITY_QUEUE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as heaps"
    status: "See notice at end of class"
    names: sorted_priority_queue, dispenser, heap
    representation: heap
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

inherit
    PRIORITY_QUEUE [G]
        undefine
            is_equal,
            copy,
            is_empty
        redefine
            linear_representation
        select
            count
        end

    ARRAY [G]
        rename
            make as array_make,
            item as i_th,
            put as put_i_th,
            bag_put as put,
            force as array_force,
            count as array_count
        export
            {NONE} all,
            {HEAP_PRIORITY_QUEUE} put_i_th
        redefine
            full,
            prunable,
            put,
            extendible,
            linear_representation,
            index_set
        end

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Allocate heap space.
        do
            array_make (1, n)
        end

feature -- Access

    item: G is
            -- Entry at top of heap.
        do
            Result := area.item (0)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure then
            count_definition: Result.count = count
        end

feature -- Status report

    extendible: BOOLEAN is
            -- May items be added?
        do
            Result := not full
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
        do
            Result := (count = capacity)
        end

    Prunable: BOOLEAN is True
            -- May items be removed? (Answer: yes.)

feature -- Element change

    force (v: like item) is
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of put.
        do
            count := count + 1
            array_force (v, count)
            up_heap
        end

    put (v: like item) is
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of force.
        do
            count := count + 1
            array_force (v, count)
            up_heap
        end

feature -- Removal

    remove is
            -- Remove item of highest value.
        do
            put_i_th (i_th (count), 1)
            count := count - 1
            down_heap
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (Sorted according to decreasing priority)
        local
            i: INTEGER
        do
            from
                create Result.make (count)
            until
                is_empty
            loop
                Result.extend (item)
                remove
            end
            from
                i := 1
            until
                i > Result.count
            loop
                put_i_th (Result.i_th (i), i)
                i := i + 1
            end
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New priority queue containing the n greatest items
        local
            temp: ARRAY [G]
            i, j: INTEGER
        do
            from
                create temp.make (1, n)
                i := 1
            until
                i <= n
            loop
                temp.put (item, i)
                remove
                i := i + 1
            end
            from
                i := count
                j := i + n - 1
            until
                i < 1
            loop
                area.put (area.item (i), j)
                i := i - 1
                j := j - 1
            end
            from
                create Result.make (n)
                i := 1
            until
                i > n
            loop
                Result.put_i_th (temp.item (i), i)
                put_i_th (temp.item (i), i)
            end
        end

feature {NONE} -- Inapplicable

    replace (v: like item) is
        do
        end

feature {NONE} -- Implementation

    down_heap is
            -- Move the heap downwards.
        local
            i, j, k: INTEGER
            up, left, right: like item
            stop: BOOLEAN
        do
            from
                up := area.item (0)
            until
                stop
            loop
                j := 2 * i + 1
                if j < count - 1 then
                    left := area.item (j)
                    k := j + 1
                    right := area.item (k)
                    if right > left then
                        j := k
                        left := right
                    end
                elseif j = count - 1 then
                    left := area.item (j)
                else
                    stop := True
                end
                if not stop then
                    if left > up then
                        area.put (left, i)
                        i := j
                    else
                        stop := True
                    end
                end
            end
            area.put (up, i)
        end

    up_heap is
            -- Move the heap downwards.
        local
            i, j: INTEGER
            up, down: like item
            stop: BOOLEAN
        do
            from
                i := count - 1
                down := area.item (i)
            until
                stop or i = 0
            loop
                j := (i - 1) // 2
                up := area.item (j)
                if up < down then
                    area.put (up, i)
                    i := j
                else
                    stop := True
                end
            end
            area.put (down, i)
        end

invariant

    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HEAP_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEAP_PRIORITY_QUEUE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

General
    cluster: base.structures.dispenser
    description: "Priority queues implemented as heaps"
    create: make

Ancestors
    ARRAY [G]
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] HEAP_PRIORITY_QUEUE [G]
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] HEAP_PRIORITY_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    Prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] HEAP_PRIORITY_QUEUE [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    make (n: INTEGER)
    prune (v: G)
    prune_all (v: G)
    put (v: [like item] G)
    remove

Constraints
    empty means storage empty

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEAP_PRIORITY_QUEUE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as heaps"
    status: "See notice at end of class"
    names: sorted_priority_queue, dispenser, heap
    representation: heap
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Allocate heap space.
        do
            array_make (1, n)
        end

feature {NONE} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_from_array (a: ARRAY [G]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (i_th (i) /= void and then i_th (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (i_th (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Entry at top of heap.
        require -- from ACTIVE
            readable: readable
        do
            Result := area.item (0)
        end

feature {NONE} -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            Result := i_th (i)
        end

    i_th (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        ensure then
            count_definition: Result.count = count
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (from ARRAY)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if i_th (i) /= void and then v.is_equal (i_th (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if i_th (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    array_count: INTEGER is
            -- Number of available indices
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        local
            i: INTEGER
        do
            if lower = other.lower and then upper = other.upper and then object_comparison = other.object_comparison then
                if object_comparison then
                    from
                        Result := True
                        i := lower
                    until
                        not Result or i > upper
                    loop
                        Result := equal (i_th (i), other.i_th (i))
                        i := i + 1
                    end
                else
                    Result := area.same_items (other.area, upper - lower)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May items be added?
        do
            Result := not full
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Prunable: BOOLEAN is True
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature {NONE} -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((i_th (upper) = void or else i_th (upper) = i_th (upper).default) and subarray (lower, upper - 1).all_default))
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (i_th (upper) = other.i_th (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = count
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        do
            fill (s)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of put.
        do
            count := count + 1
            array_force (v, count)
            up_heap
        end

    put (v: like item) is
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of force.
        require -- from COLLECTION
            extendible: extendible
        do
            count := count + 1
            array_force (v, count)
            up_heap
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {HEAP_PRIORITY_QUEUE} -- Element change

    put_i_th (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

feature {NONE} -- Element change

    enter (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    array_force (v: like i_th; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove item of highest value.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            put_i_th (i_th (count), 1)
            count := count - 1
            down_heap
        end

    wipe_out is
        obsolete "Not applicable since not `prunable'. Use `discard_items' instead."
            -- Make array empty.
            -- (from ARRAY)
        require -- from COLLECTION
            prunable
        do
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (Sorted according to decreasing priority)
        local
            i: INTEGER
        do
            from
                create Result.make (count)
            until
                is_empty
            loop
                Result.extend (item)
                remove
            end
            from
                i := 1
            until
                i > Result.count
            loop
                put_i_th (Result.i_th (i), i)
                i := i + 1
            end
        end

feature {NONE} -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

    duplicate (n: INTEGER): like Current is
            -- New priority queue containing the n greatest items
        local
            temp: ARRAY [G]
            i, j: INTEGER
        do
            from
                create temp.make (1, n)
                i := 1
            until
                i <= n
            loop
                temp.put (item, i)
                remove
                i := i + 1
            end
            from
                i := count
                j := i + n - 1
            until
                i < 1
            loop
                area.put (area.item (i), j)
                i := i - 1
                j := j - 1
            end
            from
                create Result.make (n)
                i := 1
            until
                i > n
            loop
                Result.put_i_th (temp.item (i), i)
                put_i_th (temp.item (i), i)
            end
        end

feature {NONE} -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    replace (v: like item) is
        require -- from ACTIVE
            writable: writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Inapplicable

    extend (v: G) is
            -- Add v to structure.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    prune (v: G) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    down_heap is
            -- Move the heap downwards.
        local
            i, j, k: INTEGER
            up, left, right: like item
            stop: BOOLEAN
        do
            from
                up := area.item (0)
            until
                stop
            loop
                j := 2 * i + 1
                if j < count - 1 then
                    left := area.item (j)
                    k := j + 1
                    right := area.item (k)
                    if right > left then
                        j := k
                        left := right
                    end
                elseif j = count - 1 then
                    left := area.item (j)
                else
                    stop := True
                end
                if not stop then
                    if left > up then
                        area.put (left, i)
                        i := j
                    else
                        stop := True
                    end
                end
            end
            area.put (up, i)
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

    up_heap is
            -- Move the heap downwards.
        local
            i, j: INTEGER
            up, down: like item
            stop: BOOLEAN
        do
            from
                i := count - 1
                down := area.item (i)
            until
                stop or i = 0
            loop
                j := (i - 1) // 2
                up := area.item (j)
                if up < down then
                    area.put (up, i)
                    i := j
                else
                    stop := True
                end
            end
            area.put (down, i)
        end

invariant

    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HEAP_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEAP_PRIORITY_QUEUE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as heaps"
    status: "See notice at end of class"
    names: sorted_priority_queue, dispenser, heap
    representation: heap
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

create

    make (n: INTEGER)
            -- Allocate heap space.

feature -- Initialization

    make (n: INTEGER)
            -- Allocate heap space.

feature -- Access

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Entry at top of heap.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        ensure then
            count_definition: Result.count = count

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Prunable: BOOLEAN is True
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of put.

    put (v: like item)
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

feature -- Removal

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove item of highest value.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (Sorted according to decreasing priority)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- New priority queue containing the n greatest items

feature -- Inapplicable

    extend (v: G)
            -- Add v to structure.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    prune (v: G)
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable

invariant

    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HEAP_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEAP_PRIORITY_QUEUE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

Ancestors
    ARRAY [G]
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

Clients
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

Suppliers
    ARRAY [G]
    ARRAYED_LIST [G]
    BOOLEAN
    COMPARABLE
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    INTEGER
    INTEGER_INTERVAL
    SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEAP_PRIORITY_QUEUE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as heaps"
    status: "See notice at end of class"
    names: sorted_priority_queue, dispenser, heap
    representation: heap
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

create
    make

feature -- Initialization

    make (n: INTEGER)
            -- Allocate heap space.

feature -- Access

    item: G
            -- Entry at top of heap.

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure then
            count_definition: Result.count = count

feature -- Status report

    extendible: BOOLEAN
            -- May items be added?

    full: BOOLEAN
            -- Is structure filled to capacity?

    Prunable: BOOLEAN is True
            -- May items be removed? (Answer: yes.)

feature -- Element change

    force (v: like item)
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of put.

    put (v: like item)
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of force.

feature -- Removal

    remove
            -- Remove item of highest value.

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (Sorted according to decreasing priority)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New priority queue containing the n greatest items

invariant

    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HEAP_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_PRIORITY_QUEUE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as sorted lists"
    status: "See notice at end of class"
    names: priority_queue, queue
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

inherit
    PRIORITY_QUEUE [G]
        undefine
            copy,
            is_equal,
            prune_all,
            append,
            readable,
            writable
        select
            put,
            remove,
            item
        end

    SORTED_TWO_WAY_LIST [G]
        rename
            make as sl_make,
            remove as sl_remove,
            put as sl_put,
            item as sl_item
        export
            {NONE} all
        end

create
    make

feature -- Initialization

    make is
            -- Allocate heap space.
        do
            sl_make
        end

feature -- Access

    item: G is
            -- Entry at top of heap.
        do
            Result := i_th (count)
        end

feature -- Removal

    remove is
            -- Remove item of highest value.
        do
            go_i_th (count)
            sl_remove
            go_i_th (count)
        end

feature -- Element change

    put (v: like item) is
            -- Insert item v at its proper position.
        do
            extend (v)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_PRIORITY_QUEUE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

General
    cluster: base.structures.dispenser
    description: "Priority queues implemented as sorted lists"
    create: make

Ancestors
    PRIORITY_QUEUE [G -> PART_COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_PRIORITY_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    make
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_PRIORITY_QUEUE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as sorted lists"
    status: "See notice at end of class"
    names: priority_queue, queue
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

create
    make

feature -- Initialization

    make is
            -- Allocate heap space.
        do
            sl_make
        end

feature {NONE} -- Initialization

    sl_make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Entry at top of heap.
        require -- from ACTIVE
            readable: readable
        do
            Result := i_th (count)
        end

feature {NONE} -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like sl_item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    sequential_has (v: like sl_item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like sl_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := sl_item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like sl_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_index_of (v: like sl_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if sl_item /= void and then v.is_equal (sl_item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if sl_item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sl_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    sl_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like sl_item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    sequential_search (v: like sl_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (sl_item /= void and then v.is_equal (sl_item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = sl_item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, sl_item)
            item_found: (not exhausted and not object_comparison) implies v = sl_item
        end

    search_after (v: like sl_item) is
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                start
            until
                after or else v <= sl_item
            loop
                forth
            end
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= sl_item)
        end

    search_before (v: like sl_item) is
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                finish
            until
                before or else v >= sl_item
            loop
                back
            end
        ensure -- from PART_SORTED_LIST
            (not off) implies (sl_item <= v)
        end

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like sl_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := sl_item
            go_to (pos)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like sl_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like sl_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    max: like sl_item is
            -- Maximum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := last
        ensure -- from SORTED_LIST
            max_is_last: Result = last
        end

    median: like sl_item is
            -- Median item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := i_th ((count + 1) // 2)
        ensure -- from SORTED_LIST
            median_definition: Result = i_th ((count + 1) // 2)
        end

    min: like sl_item is
            -- Minimum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := first
        ensure -- from SORTED_LIST
            min_is_first: Result = first
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (sl_item, other.sl_item)
                        else
                            Result := (sl_item = other.sl_item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        do
            Result := (active = last_element) and then not after and then not before
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    sorted: BOOLEAN is
            -- Is the structure sorted?
            -- (from SORTED_TWO_WAY_LIST)
        local
            c: CURSOR
            prev: like sl_item
        do
            Result := True
            if count > 1 then
                from
                    c := cursor
                    start
                    check
                        not off
                    end
                    prev := sl_item
                    forth
                until
                    after or not Result
                loop
                    Result := (prev <= sl_item)
                    prev := sl_item
                    forth
                end
                go_to (c)
            end
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                active := active.left
                if active = void then
                    active := first_element
                    before := True
                end
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        do
            if not is_empty then
                active := last_element
                after := False
                before := False
            else
                after := False
                before := True
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after
        end

    forth is
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                active := active.right
                if active = void then
                    active := last_element
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        local
            counter: INTEGER
            p: like first_element
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if after then
                    after := False;
                    counter := - 1
                end;
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left
                    counter := counter - 1
                end;
                if p = void then
                    before := True;
                    active := first_element
                else
                    active := p
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    ll_move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like sl_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, sl_item)
            item_found: (not exhausted and not object_comparison) implies v = sl_item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like sl_item) is
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            extendible: extendible
        do
            search_after (v)
            put_left (v)
            back
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: sl_item = v
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like sl_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Insert item v at its proper position.
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: like sl_item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    last_element := other_last_element
                    first_element := other_first_element
                    if before then
                        active := first_element
                    else
                        active := last_element
                    end
                elseif isfirst then
                    other_last_element.put_right (first_element);
                    first_element := other_first_element
                elseif after then
                    other_first_element.put_left (last_element);
                    last_element := other_last_element;
                    active := last_element
                else
                    other_first_element.put_left (active.left)
                    active.put_left (other_last_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if is_empty or else islast then
                last_element := other.last_element
            end
            ll_merge_right (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    sl_put (v: like sl_item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    sequence_put (v: like sl_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_front (v: like sl_item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        do
            ll_put_front (v)
            if count = 1 then
                last_element := first_element
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    ll_put_front (v: like sl_item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like sl_item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like sl_item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                last_element := p
                active := p
                before := False
            elseif after then
                p.put_left (last_element);
                last_element := p;
                active := p
            elseif isfirst then
                p.put_right (active);
                first_element := p
            else
                p.put_left (active.left)
                p.put_right (active)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like sl_item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            was_last: BOOLEAN
        do
            was_last := islast
            ll_put_right (v)
            if count = 1 then
                last_element := active
            elseif was_last then
                last_element := active.right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    ll_put_right (v: like sl_item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

feature -- Removal

    prune (v: like sl_item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like sl_item) is
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                off or else v < sl_item
            loop
                remove
            end
            if not off then
                finish
                forth
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove item of highest value.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            go_i_th (count)
            sl_remove
            go_i_th (count)
        end

    wipe_out is
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            ll_wipe_out
            last_element := void
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    sl_remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            succ, pred, removed: like first_element
        do
            removed := active
            if isfirst then
                active := first_element.right
                first_element.forget_right
                first_element := active
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                    last_element := void
                end
            elseif islast then
                active := last_element.left;
                last_element.forget_left;
                last_element := active;
                after := True
            else
                pred := active.left
                succ := active.right
                pred.forget_right
                succ.forget_left
                pred.put_right (succ)
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            back
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            forth
            remove
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    remove_sublist is
            -- (from TWO_WAY_LIST)
        do
            sublist := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_element
        do
            if n = 0 then
                create sublist.sl_make
            else
                active_index := index
                if active_index + n > count + 1 then
                    actual_number := count + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := active
                p_elem := previous
                move (actual_number - 1)
                e_elem := active
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                count := count - actual_number
                if p_elem /= void then
                    p_elem.put_right (n_elem)
                else
                    first_element := n_elem
                end
                if n_elem /= void then
                    active := n_elem
                else
                    last_element := p_elem
                    active := p_elem
                    after := True
                end
            end
        end

    ll_wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Transformation

    sort is
            -- Sort all items.
            -- Has O(count * log (count)) complexity.
            -- (from SORTED_TWO_WAY_LIST)
        local
            no_change: BOOLEAN
            gap: INTEGER
            left_cell, cell: like first_element
            left_cell_item, cell_item: like sl_item
        do
            if not is_empty then
                from
                    gap := count * 10 // 13
                until
                    gap = 0
                loop
                    from
                        no_change := False
                        go_i_th (1 + gap)
                    until
                        no_change
                    loop
                        no_change := True
                        from
                            left_cell := first_element
                            cell := active
                        until
                            cell = void
                        loop
                            left_cell_item := left_cell.item
                            cell_item := cell.item
                            if cell_item < left_cell_item then
                                no_change := False
                                cell.put (left_cell_item)
                                left_cell.put (cell_item)
                            end
                            left_cell := left_cell.right
                            cell := cell.right
                        end
                    end
                    gap := gap * 10 // 13
                end
            end
        end

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like sl_item
            pos: CURSOR
        do
            pos := cursor
            old_item := sl_item
            go_i_th (i)
            new_item := sl_item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: sl_item = old i_th (i)
            swapped_from_item: i_th (i) = old sl_item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature {NONE} -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (sl_item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    make_sublist (first_item, last_item: like first_element; n: INTEGER) is
            -- Create sublist
            -- (from TWO_WAY_LIST)
        do
            sl_make
            first_element := first_item
            last_element := last_item
            active := first_element
            count := n
        end

    new_cell (v: like sl_item): like first_element is
            -- A newly created instance of the type of first_element.
            -- (from TWO_WAY_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from SORTED_TWO_WAY_LIST)
        do
            create Result.sl_make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from TWO_WAY_LIST)
        do
            if after then
                Result := active
            elseif active /= void then
                Result := active.left
            end
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (sl_item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (sl_item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (sl_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (sl_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (sl_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_PRIORITY_QUEUE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as sorted lists"
    status: "See notice at end of class"
    names: priority_queue, queue
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

create

    make
            -- Allocate heap space.

feature -- Initialization

    make
            -- Allocate heap space.

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Entry at top of heap.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like sl_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like sl_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like sl_item)
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: sl_item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like sl_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Insert item v at its proper position.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: like sl_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like sl_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like sl_item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item of highest value.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (sl_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_PRIORITY_QUEUE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

Ancestors
    PRIORITY_QUEUE [G -> PART_COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Clients
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

Suppliers
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_PRIORITY_QUEUE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues implemented as sorted lists"
    status: "See notice at end of class"
    names: priority_queue, queue
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

create
    make

feature -- Initialization

    make
            -- Allocate heap space.

feature -- Access

    item: G
            -- Entry at top of heap.

feature -- Removal

    remove
            -- Remove item of highest value.

feature -- Element change

    put (v: like item)
            -- Insert item v at its proper position.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_QUEUE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues implemented as linked lists"
    status: "See notice at end of class"
    names: linked_queue, dispenser, linked_list
    representation: linked
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_QUEUE [G]

inherit
    QUEUE [G]
        undefine
            is_empty,
            copy,
            is_equal
        redefine
            linear_representation,
            prune_all,
            extend
        select
            item,
            put
        end

    LINKED_LIST [G]
        rename
            item as ll_item,
            remove as ll_remove,
            make as ll_make,
            remove_left as remove,
            put as ll_put
        export
            {NONE} all,
            {ANY} writable, extendible, wipe_out, readable
        undefine
            fill,
            append,
            prune,
            readable,
            writable,
            prune_all,
            extend,
            force,
            is_inserted
        redefine
            duplicate,
            linear_representation
        select
            remove
        end

create
    make

feature -- Initialization

    make is
            -- Create linked queue.
        do
            after := True
        end

feature -- Access

    item: G is
            -- Oldest item
        do
            Result := active.item
        ensure then
            last_element_if_not_empty: not is_empty implies (active = last_element)
        end

feature -- Element change

    put (v: G) is
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of extend and force.
        do
            put_front (v)
            before := False
            after := True
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)
        end

    extend (v: G) is
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and force.
        do
            put_front (v)
            before := False
            after := True
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)
        end

    force (v: G) is
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and extend.
        do
            put_front (v)
            before := False
            after := True
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (order is same as original order of insertion)
        do
            create Result.make_filled (count)
            from
                start
                Result.finish
            until
                after
            loop
                Result.replace (item)
                forth
                Result.back
            end
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New queue containing the n oldest items in current queue.
            -- If n is greater than count, identical to current queue.
        do
            start
            from
                create Result.make
                start
            until
                after or Result.count = n
            loop
                Result.extend (ll_item)
                forth
            end
            finish
        end

feature {NONE} -- Not applicable

    prune (v: like item) is
            -- Remove one occurrence of v.
            -- Not available.
        do
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- Not available
        do
        end

invariant

    is_always_after: not is_empty implies after

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_QUEUE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_QUEUE [G]

General
    cluster: base.structures.dispenser
    description: "Unbounded queues implemented as linked lists"
    create: make

Ancestors
    LINKED_LIST [G]
    QUEUE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] LINKED_QUEUE [G]
    Extendible: BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_QUEUE [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    force (v: G)
    make
    put (v: G)
    remove
    replace (v: [like item] G)
    wipe_out

Constraints
    is always after

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_QUEUE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues implemented as linked lists"
    status: "See notice at end of class"
    names: linked_queue, dispenser, linked_list
    representation: linked
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_QUEUE [G]

create
    make

feature -- Initialization

    make is
            -- Create linked queue.
        do
            after := True
        end

feature {NONE} -- Initialization

    ll_make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    has (v: like ll_item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Oldest item
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        ensure then
            last_element_if_not_empty: not is_empty implies (active = last_element)
        end

feature {NONE} -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like ll_item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    sequential_has (v: like ll_item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like ll_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := ll_item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    sequential_index_of (v: like ll_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if ll_item /= void and then v.is_equal (ll_item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if ll_item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    index_of (v: like ll_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    ll_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    ll_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like ll_item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    sequential_search (v: like ll_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (ll_item /= void and then v.is_equal (ll_item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = ll_item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, ll_item)
            item_found: (not exhausted and not object_comparison) implies v = ll_item
        end

    infix "@" (i: INTEGER): like ll_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := ll_item
            go_to (pos)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like ll_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like ll_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (ll_item, other.ll_item)
                        else
                            Result := (ll_item = other.ll_item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature {NONE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Cursor movement

    back is
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like ll_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, ll_item)
            item_found: (not exhausted and not object_comparison) implies v = ll_item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        do
            fill (s)
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        do
            put_front (v)
            before := False
            after := True
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: G) is
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and extend.
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        do
            put_front (v)
            before := False
            after := True
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)
        end

    put (v: G) is
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        do
            put_front (v)
            before := False
            after := True
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)
        end

    replace (v: like ll_item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            p: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                elseif isfirst then
                    p := first_element;
                    other_last_element.put_right (p);
                    first_element := other_first_element
                else
                    p := previous
                    if p /= void then
                        p.put_right (other_first_element)
                    end
                    other_last_element.put_right (active)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    ll_put (v: like ll_item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    sequence_put (v: like ll_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_front (v: like ll_item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like ll_item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like ll_item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                p := new_cell (active.item)
                p.put_right (active.right)
                active.put (v)
                active.put_right (p)
                active := p
                count := count + 1
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like ll_item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

feature {NONE} -- Removal

    ll_remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            removed, succ: like first_element
        do
            removed := active
            if isfirst then
                first_element := first_element.right
                active.forget_right
                active := first_element
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                end
            elseif islast then
                active := previous;
                if active /= void then
                    active.forget_right
                end;
                after := True
            else
                succ := active.right
                previous.put_right (succ)
                active.forget_right
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        local
            removed, succ: like first_element
        do
            if before then
                removed := first_element
                first_element := first_element.right
                active.forget_right
                active := first_element
            else
                succ := active.right
                removed := succ
                active.put_right (succ.right)
                succ.forget_right
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Removal

    remove is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            move (- 2)
            remove_right
            forth
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like ll_item
            pos: CURSOR
        do
            pos := cursor
            old_item := ll_item
            go_i_th (i)
            new_item := ll_item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: ll_item = old i_th (i)
            swapped_from_item: i_th (i) = old ll_item
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (order is same as original order of insertion)
        do
            create Result.make_filled (count)
            from
                start
                Result.finish
            until
                after
            loop
                Result.replace (item)
                forth
                Result.back
            end
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.ll_make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.ll_item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- New queue containing the n oldest items in current queue.
            -- If n is greater than count, identical to current queue.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        do
            start
            from
                create Result.make
                start
            until
                after or Result.count = n
            loop
                Result.extend (ll_item)
                forth
            end
            finish
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    first_element: LINKABLE [G]
            -- Head of list
            -- (from LINKED_LIST)

    last_element: like first_element is
            -- Tail of list
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    new_cell (v: like ll_item): like first_element is
            -- A newly created instance of the same type as first_element.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result.ll_make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (ll_item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (ll_item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (ll_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (ll_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature {NONE} -- Not applicable

    prune (v: like item) is
            -- Remove one occurrence of v.
            -- Not available.
        require -- from COLLECTION
            prunable: prunable
        do
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- Not available
        require -- from COLLECTION
            prunable
        do
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

invariant

    is_always_after: not is_empty implies after
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (ll_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_QUEUE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues implemented as linked lists"
    status: "See notice at end of class"
    names: linked_queue, dispenser, linked_list
    representation: linked
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_QUEUE [G]

create

    make
            -- Create linked queue.

feature -- Initialization

    make
            -- Create linked queue.

feature -- Access

    has (v: like ll_item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Oldest item
        require -- from ACTIVE
            readable: readable
        ensure then
            last_element_if_not_empty: not is_empty implies (active = last_element)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and extend.
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    put (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    replace (v: like ll_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (order is same as original order of insertion)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- New queue containing the n oldest items in current queue.
            -- If n is greater than count, identical to current queue.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

invariant

    is_always_after: not is_empty implies after
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (ll_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_QUEUE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_QUEUE [G]

Ancestors
    LINKED_LIST [G]
    QUEUE [G]

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    LINKED_QUEUE [G]

Suppliers
    ARRAYED_LIST [G]
    BOOLEAN
    LINKABLE [G]
    LINKED_QUEUE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_QUEUE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded queues implemented as linked lists"
    status: "See notice at end of class"
    names: linked_queue, dispenser, linked_list
    representation: linked
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_QUEUE [G]

create
    make

feature -- Initialization

    make
            -- Create linked queue.

feature -- Access

    item: G
            -- Oldest item
        ensure then
            last_element_if_not_empty: not is_empty implies (active = last_element)

feature -- Element change

    put (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of extend and force.
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    extend (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and force.
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    force (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and extend.
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (order is same as original order of insertion)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New queue containing the n oldest items in current queue.
            -- If n is greater than count, identical to current queue.

invariant

    is_always_after: not is_empty implies after

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_STACK Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded stacks implemented as linked lists"
    status: "See notice at end of class"
    names: linked_stack, dispenser, linked_list
    representation: linked
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_STACK [G]

inherit
    STACK [G]
        undefine
            replace,
            copy,
            is_equal
        select
            remove,
            put,
            item
        end

    LINKED_LIST [G]
        rename
            item as ll_item,
            remove as ll_remove,
            put as ll_put
        export
            {NONE} all,
            {ANY} count, readable, writable, extendible, make, wipe_out
        undefine
            readable,
            writable,
            fill,
            append,
            linear_representation,
            prune_all,
            is_inserted
        redefine
            extend,
            force,
            duplicate
        end

create
    make

feature -- Access

    item: G is
            -- Item at the first position
        do
            check
                not_empty: not is_empty
            end
            Result := first_element.item
        end

feature -- Element change

    force (v: like item) is
            -- Push v onto top.
        do
            put_front (v)
        end

    extend (v: like item) is
            -- Push v onto top.
        do
            put_front (v)
        end

    put (v: like item) is
        do
            put_front (v)
        end

feature -- Removal

    remove is
            -- Remove item on top.
        do
            start
            ll_remove
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (order is reverse of original order of insertion)
        local
            old_cursor: CURSOR
        do
            old_cursor := cursor
            from
                create Result.make (count)
                start
            until
                after
            loop
                Result.extend (ll_item)
                forth
            end
            go_to (old_cursor)
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New stack containing the n latest items inserted
            -- in current stack.
            -- If n is greater than count, identical to current stack.
        require else
            positive_argument: n > 0
        local
            counter: INTEGER
            old_cursor: CURSOR
            list: LINKED_LIST [G]
        do
            if not is_empty then
                old_cursor := cursor
                from
                    create Result.make
                    list := Result
                    start
                until
                    after or counter = n
                loop
                    list.finish
                    list.put_right (ll_item)
                    counter := counter + 1
                    forth
                end
                go_to (old_cursor)
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_STACK Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_STACK [G]

General
    cluster: base.structures.dispenser
    description: "Unbounded stacks implemented as linked lists"
    create: make

Ancestors
    LINKED_LIST [G]
    STACK [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] LINKED_STACK [G]
    Extendible: BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_STACK [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_STACK [G])
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    make
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_STACK Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded stacks implemented as linked lists"
    status: "See notice at end of class"
    names: linked_stack, dispenser, linked_list
    representation: linked
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_STACK [G]

create
    make

feature  -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    has (v: like ll_item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Item at the first position
        require -- from ACTIVE
            readable: readable
        do
            check
                not_empty: not is_empty
            end
            Result := first_element.item
        end

feature {NONE} -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like ll_item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    sequential_has (v: like ll_item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like ll_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := ll_item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    sequential_index_of (v: like ll_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if ll_item /= void and then v.is_equal (ll_item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if ll_item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    index_of (v: like ll_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    ll_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    ll_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like ll_item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    sequential_search (v: like ll_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (ll_item /= void and then v.is_equal (ll_item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = ll_item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, ll_item)
            item_found: (not exhausted and not object_comparison) implies v = ll_item
        end

    infix "@" (i: INTEGER): like ll_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := ll_item
            go_to (pos)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like ll_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like ll_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (ll_item, other.ll_item)
                        else
                            Result := (ll_item = other.ll_item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature {NONE} -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Cursor movement

    back is
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like ll_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, ll_item)
            item_found: (not exhausted and not object_comparison) implies v = ll_item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        do
            fill (s)
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Push v onto top.
        require -- from COLLECTION
            extendible: extendible
        do
            put_front (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v
        end

    fill (other: LINEAR [G]) is
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            temp: ARRAYED_STACK [G]
        do
            create temp.make (0)
            from
                other.start
            until
                other.off
            loop
                temp.extend (other.item)
                other.forth
            end
            from
            until
                temp.is_empty or else not extendible
            loop
                extend (temp.item)
                temp.remove
            end
        end

    force (v: like item) is
            -- Push v onto top.
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        do
            put_front (v)
        ensure then -- from STACK
            item_pushed: item = v
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
        require -- from COLLECTION
            extendible: extendible
        do
            put_front (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v
        end

    replace (v: like ll_item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            p: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                elseif isfirst then
                    p := first_element;
                    other_last_element.put_right (p);
                    first_element := other_first_element
                else
                    p := previous
                    if p /= void then
                        p.put_right (other_first_element)
                    end
                    other_last_element.put_right (active)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    ll_put (v: like ll_item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    sequence_put (v: like ll_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_front (v: like ll_item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like ll_item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like ll_item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                p := new_cell (active.item)
                p.put_right (active.right)
                active.put (v)
                active.put_right (p)
                active := p
                count := count + 1
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like ll_item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

feature -- Removal

    remove is
            -- Remove item on top.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            start
            ll_remove
        end

    wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    prune (v: like ll_item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    ll_remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            removed, succ: like first_element
        do
            removed := active
            if isfirst then
                first_element := first_element.right
                active.forget_right
                active := first_element
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                end
            elseif islast then
                active := previous;
                if active /= void then
                    active.forget_right
                end;
                after := True
            else
                succ := active.right
                previous.put_right (succ)
                active.forget_right
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            move (- 2)
            remove_right
            forth
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        local
            removed, succ: like first_element
        do
            if before then
                removed := first_element
                first_element := first_element.right
                active.forget_right
                active := first_element
            else
                succ := active.right
                removed := succ
                active.put_right (succ.right)
                succ.forget_right
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like ll_item
            pos: CURSOR
        do
            pos := cursor
            old_item := ll_item
            go_i_th (i)
            new_item := ll_item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: ll_item = old i_th (i)
            swapped_from_item: i_th (i) = old ll_item
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
            -- (order is reverse of original order of insertion)
        local
            old_cursor: CURSOR
        do
            old_cursor := cursor
            from
                create Result.make (count)
                start
            until
                after
            loop
                Result.extend (ll_item)
                forth
            end
            go_to (old_cursor)
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.ll_item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- New stack containing the n latest items inserted
            -- in current stack.
            -- If n is greater than count, identical to current stack.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require else
            positive_argument: n > 0
        local
            counter: INTEGER
            old_cursor: CURSOR
            list: LINKED_LIST [G]
        do
            if not is_empty then
                old_cursor := cursor
                from
                    create Result.make
                    list := Result
                    start
                until
                    after or counter = n
                loop
                    list.finish
                    list.put_right (ll_item)
                    counter := counter + 1
                    forth
                end
                go_to (old_cursor)
            end
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    first_element: LINKABLE [G]
            -- Head of list
            -- (from LINKED_LIST)

    last_element: like first_element is
            -- Tail of list
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    new_cell (v: like ll_item): like first_element is
            -- A newly created instance of the same type as first_element.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (ll_item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (ll_item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (ll_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (ll_item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (ll_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_STACK Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded stacks implemented as linked lists"
    status: "See notice at end of class"
    names: linked_stack, dispenser, linked_list
    representation: linked
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_STACK [G]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature  -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    has (v: like ll_item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Item at the first position
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Push v onto top.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v onto top.
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from STACK
            item_pushed: item = v
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v

    replace (v: like ll_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove item on top.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (order is reverse of original order of insertion)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- New stack containing the n latest items inserted
            -- in current stack.
            -- If n is greater than count, identical to current stack.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require else
            positive_argument: n > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (ll_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_STACK Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_STACK [G]

Ancestors
    LINKED_LIST [G]
    STACK [G]

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    LINKED_STACK [G]
    TREE [G]

Suppliers
    ARRAYED_LIST [G]
    BOOLEAN
    INTEGER
    LINKABLE [G]
    LINKED_LIST [G]
    LINKED_STACK [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_STACK Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Unbounded stacks implemented as linked lists"
    status: "See notice at end of class"
    names: linked_stack, dispenser, linked_list
    representation: linked
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_STACK [G]

create
    make

feature -- Access

    item: G
            -- Item at the first position

feature -- Element change

    force (v: like item)
            -- Push v onto top.

    extend (v: like item)
            -- Push v onto top.

    put (v: like item)

feature -- Removal

    remove
            -- Remove item on top.

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (order is reverse of original order of insertion)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New stack containing the n latest items inserted
            -- in current stack.
            -- If n is greater than count, identical to current stack.
        require else
            positive_argument: n > 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIORITY_QUEUE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues, without commitment to a particular representation"
    status: "See notice at end of class"
    names: priority_queue, dispenser
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

inherit
    DISPENSER [G]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIORITY_QUEUE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

General
    cluster: base.structures.dispenser
    description: "Priority queues, without commitment to a particular representation"

Ancestors
    DISPENSER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    prune (v: G)
    prune_all (v: G)
    put (v: [like item] G)
    remove
    replace (v: G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIORITY_QUEUE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues, without commitment to a particular representation"
    status: "See notice at end of class"
    names: priority_queue, dispenser
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable
        deferred
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        do
            fill (s)
        end

    extend (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.
            -- (from DISPENSER)
        deferred
        end

    put (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIORITY_QUEUE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues, without commitment to a particular representation"
    status: "See notice at end of class"
    names: priority_queue, dispenser
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.
            -- (from DISPENSER)

    put (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIORITY_QUEUE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

Ancestors
    DISPENSER [G]

Descendants
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIORITY_QUEUE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Priority queues, without commitment to a particular representation"
    status: "See notice at end of class"
    names: priority_queue, dispenser
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIORITY_QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


QUEUE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Queues (first-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: queue, dispenser
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    QUEUE [G]

inherit
    DISPENSER [G]
        export
            {NONE} prune, prune_all
        end

feature -- Element change

    force (v: like item) is
            -- Add v as newest item.
        deferred
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


QUEUE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    QUEUE [G]

General
    cluster: base.structures.dispenser
    description:
        "Queues (first-in, first-out dispensers), without commitment
        to a particular representation"

Ancestors
    DISPENSER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


QUEUE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Queues (first-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: queue, dispenser
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    QUEUE [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable
        deferred
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        do
            fill (s)
        end

    extend (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v as newest item.
        deferred
        end

    put (v: like item) is
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


QUEUE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Queues (first-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: queue, dispenser
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    QUEUE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v as newest item.

    put (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


QUEUE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    QUEUE [G]

Ancestors
    DISPENSER [G]

Descendants
    ARRAYED_QUEUE [G]
    BOUNDED_QUEUE [G]
    LINKED_QUEUE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


QUEUE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Queues (first-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: queue, dispenser
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    QUEUE [G]

feature -- Element change

    force (v: like item)
            -- Add v as newest item.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class QUEUE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STACK Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Stacks (last-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: stack, dispenser
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    STACK [G]

inherit
    DISPENSER [G]
        export
            {NONE} prune, prune_all
        redefine
            extend,
            force,
            put,
            fill
        end

feature -- Element change

    extend (v: like item) is
            -- Push v onto top.
            -- Was declared in STACK as synonym of force and put.
        deferred
        ensure then
            item_pushed: item = v
        end

    force (v: like item) is
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and put.
        deferred
        ensure then
            item_pushed: item = v
        end

    put (v: like item) is
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and force.
        deferred
        ensure then
            item_pushed: item = v
        end

    replace (v: like item) is
            -- Replace top item by v.
        do
            remove
            extend (v)
        end

    fill (other: LINEAR [G]) is
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
        local
            temp: ARRAYED_STACK [G]
        do
            create temp.make (0)
            from
                other.start
            until
                other.off
            loop
                temp.extend (other.item)
                other.forth
            end
            from
            until
                temp.is_empty or else not extendible
            loop
                extend (temp.item)
                temp.remove
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STACK Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    STACK [G]

General
    cluster: base.structures.dispenser
    description:
        "Stacks (last-in, first-out dispensers), without commitment
        to a particular representation"

Ancestors
    DISPENSER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STACK Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Stacks (last-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: stack, dispenser
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    STACK [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable
        deferred
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        deferred
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from DISPENSER)
        do
            Result := not is_empty
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        do
            fill (s)
        end

    extend (v: like item) is
            -- Push v onto top.
            -- Was declared in STACK as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            item_pushed: item = v
        end

    fill (other: LINEAR [G]) is
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            temp: ARRAYED_STACK [G]
        do
            create temp.make (0)
            from
                other.start
            until
                other.off
            loop
                temp.extend (other.item)
                other.forth
            end
            from
            until
                temp.is_empty or else not extendible
            loop
                extend (temp.item)
                temp.remove
            end
        end

    force (v: like item) is
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and put.
        deferred
        ensure then
            item_pushed: item = v
        end

    put (v: like item) is
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            item_pushed: item = v
        end

    replace (v: like item) is
            -- Replace top item by v.
        require -- from ACTIVE
            writable: writable
        do
            remove
            extend (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    remove is
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STACK Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Stacks (last-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: stack, dispenser
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    STACK [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and put.
        ensure then
            item_pushed: item = v

    put (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            item_pushed: item = v

    replace (v: like item)
            -- Replace top item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STACK Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    STACK [G]

Ancestors
    DISPENSER [G]

Descendants
    ARRAYED_STACK [G]
    BOUNDED_STACK [G]
    LINKED_STACK [G]

Clients
    STACK [G]

Suppliers
    ARRAYED_STACK [G]
    BOOLEAN
    LINEAR [G]
    STACK [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


STACK Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Stacks (last-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: stack, dispenser
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    STACK [G]

feature -- Element change

    extend (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of force and put.
        ensure then
            item_pushed: item = v

    force (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and put.
        ensure then
            item_pushed: item = v

    put (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and force.
        ensure then
            item_pushed: item = v

    replace (v: like item)
            -- Replace top item by v.

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STACK

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.iteration

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.iteration	(diagram)

Supercluster
    base.structures

Classes
    CURSOR_TREE_ITERATOR [G]
    ITERATOR [G]
    LINEAR_ITERATOR [G]
    TWO_WAY_CHAIN_ITERATOR [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE_ITERATOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over cursor trees,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, cursor_tree_iterators, cursor_tree_iteration, tree_iterators, tree_iteration
    exploration: depth_first, breadth_first
    traversal: preorder, postorder, inorder
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    CURSOR_TREE_ITERATOR [G]

inherit
    LINEAR_ITERATOR [G]
        rename
            do_all as pre_do_all,
            until_do as pre_until_do,
            do_until as pre_do_until,
            do_if as pre_do_if,
            search as pre_search,
            do_for as pre_do_for,
            do_while as pre_do_while,
            while_do as pre_while_do,
            while_continue as pre_while_continue,
            continue_while as pre_continue_while,
            continue_until as pre_continue_until,
            continue_search as pre_continue_search,
            continue_for as pre_continue_for,
            for_all as pre_for_all,
            there_exists as pre_there_exists,
            forth as pre_forth
        redefine
            target,
            pre_forth
        select
            pre_do_all,
            pre_until_do,
            pre_do_until,
            pre_do_if,
            pre_search,
            pre_do_for,
            pre_continue_until,
            pre_continue_search,
            pre_continue_for,
            pre_for_all,
            pre_there_exists,
            pre_forth,
            start,
            pre_while_do,
            pre_do_while,
            pre_continue_while,
            pre_while_continue
        end

    LINEAR_ITERATOR [G]
        rename
            do_all as post_do_all,
            until_do as post_until_do,
            do_until as post_do_until,
            do_if as post_do_if,
            search as post_search,
            do_for as post_do_for,
            do_while as post_do_while,
            while_do as post_while_do,
            while_continue as post_while_continue,
            continue_while as post_continue_while,
            continue_until as post_continue_until,
            continue_search as post_continue_search,
            continue_for as post_continue_for,
            for_all as post_for_all,
            there_exists as post_there_exists,
            forth as post_forth,
            start as post_start
        redefine
            post_forth,
            post_start,
            target
        end

    LINEAR_ITERATOR [G]
        rename
            do_all as breadth_do_all,
            until_do as breadth_until_do,
            do_until as breadth_do_until,
            do_if as breadth_do_if,
            search as breadth_search,
            do_for as breadth_do_for,
            do_while as breadth_do_while,
            while_do as breadth_while_do,
            while_continue as breadth_while_continue,
            continue_while as breadth_continue_while,
            continue_until as breadth_continue_until,
            continue_search as breadth_continue_search,
            continue_for as breadth_continue_for,
            for_all as breadth_for_all,
            there_exists as breadth_there_exists,
            forth as breadth_forth
        redefine
            breadth_forth,
            target
        end

feature -- Status report

    target: CURSOR_TREE [G]
            -- The structure to which iteration features will apply

feature -- Cursor movement

    pre_start is
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of breadth_start.
        do
            target.start
        end

    breadth_start is
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of pre_start.
        do
            target.start
        end

    post_start is
            -- Move cursor of target to first position in postorder.
        do
            target.postorder_start
        end

    pre_forth is
            -- Move cursor of target to next position in preorder.
        do
            target.preorder_forth
        end

    post_forth is
            -- Move cursor of target to next position in postorder.
        do
            target.postorder_forth
        end

    breadth_forth is
            -- Move cursor of target to next position in breadth-first.
        do
            target.breadth_forth
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE_ITERATOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CURSOR_TREE_ITERATOR [G]

General
    cluster: base.structures.iteration
    description:
        "Objects that are able to iterate over cursor trees,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others."

Ancestors
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]

Queries
    breadth_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    breadth_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    exhausted: BOOLEAN
    internal_item_tuple: TUPLE [G]
    invariant_value: BOOLEAN
    item: G
    item_tuple: TUPLE [G]
    off: BOOLEAN
    post_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    post_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    pre_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    pre_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    target: CURSOR_TREE [G]

Commands
    breadth_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    breadth_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    breadth_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    breadth_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    breadth_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_forth
    breadth_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    breadth_start
    breadth_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    post_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    post_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    post_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    post_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_forth
    post_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    post_start
    post_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    pre_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    pre_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    pre_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    pre_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_forth
    pre_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    pre_start
    pre_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    set (s: [like target] CURSOR_TREE [G])
    start
    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE_ITERATOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over cursor trees,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, cursor_tree_iterators, cursor_tree_iteration, tree_iterators, tree_iteration
    exploration: depth_first, breadth_first
    traversal: preorder, postorder, inorder
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    CURSOR_TREE_ITERATOR [G]

feature -- Initialization

    set (s: like target) is
            -- Make s the new target of iterations.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            target_exists: s /= void
        do
            Precursor  (s)
            create internal_item_tuple.make
        ensure -- from ITERATOR
            target = s
            target /= void
        end

feature -- Access

    item: G is
            -- The item at cursor position in target
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            traversable_exists: target /= void
        do
            Result := target.item
        end

    item_tuple: TUPLE [G] is
            -- Tuple containing a single element,
            -- the item at cursor position in target''
            -- (from LINEAR_ITERATOR)
        do
            internal_item_tuple.put (target.item, 1)
            Result := internal_item_tuple
        end

feature -- Status report

    invariant_value: BOOLEAN is
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)
        do
            Result := True
        end

    target: CURSOR_TREE [G]
            -- The structure to which iteration features will apply

feature -- Cursor movement

    breadth_forth is
            -- Move cursor of target to next position in breadth-first.
        do
            target.breadth_forth
        end

    breadth_start is
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of pre_start.
        do
            target.start
        end

    exhausted: BOOLEAN is
            -- Is target exhausted?
            -- (from LINEAR_ITERATOR)
        do
            Result := target.exhausted
        end

    off: BOOLEAN is
            -- Is position of target off?
            -- (from LINEAR_ITERATOR)
        do
            Result := target.off
        end

    post_forth is
            -- Move cursor of target to next position in postorder.
        do
            target.postorder_forth
        end

    post_start is
            -- Move cursor of target to first position in postorder.
        do
            target.postorder_start
        end

    pre_forth is
            -- Move cursor of target to next position in preorder.
        do
            target.preorder_forth
        end

    pre_start is
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of breadth_start.
        do
            target.start
        end

    start is
            -- Move to first position of target.
            -- (from LINEAR_ITERATOR)
        do
            target.start
        end

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target
            -- (from LINEAR_ITERATOR)

feature -- Iteration

    breadth_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            i, j: INTEGER
        do
            from
            invariant
                i >= 0 and i <= n
            variant
                n - i
            until
                exhausted or else i = n
            loop
                action.call (item_tuple)
                i := i + 1
                from
                    j := 0
                invariant
                    j >= 0 and j <= k
                variant
                    k - j
                until
                    exhausted or else j = k
                loop
                    pre_forth
                    j := j + 1
                end
            end
        end

    post_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            i, j: INTEGER
        do
            from
            invariant
                i >= 0 and i <= n
            variant
                n - i
            until
                exhausted or else i = n
            loop
                action.call (item_tuple)
                i := i + 1
                from
                    j := 0
                invariant
                    j >= 0 and j <= k
                variant
                    k - j
                until
                    exhausted or else j = k
                loop
                    pre_forth
                    j := j + 1
                end
            end
        end

    pre_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            i, j: INTEGER
        do
            from
            invariant
                i >= 0 and i <= n
            variant
                n - i
            until
                exhausted or else i = n
            loop
                action.call (item_tuple)
                i := i + 1
                from
                    j := 0
                invariant
                    j >= 0 and j <= k
                variant
                    k - j
                until
                    exhausted or else j = k
                loop
                    pre_forth
                    j := j + 1
                end
            end
        end

    post_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else (b = test.item (item_tuple))
            loop
                pre_forth
            end
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))
        end

    breadth_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else (b = test.item (item_tuple))
            loop
                pre_forth
            end
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))
        end

    pre_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else (b = test.item (item_tuple))
            loop
                pre_forth
            end
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))
        end

    post_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                pre_forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    breadth_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                pre_forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    pre_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                pre_forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    pre_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                pre_forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    breadth_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                pre_forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    post_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                pre_forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    breadth_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
        do
            target.linear_do_all (action)
        end

    post_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
        do
            target.linear_do_all (action)
        end

    pre_do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
        do
            target.linear_do_all (action)
        end

    pre_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            j: INTEGER
        do
            from
                start
                j := 1
            invariant
                j >= 1 and j <= i
            variant
                i - j
            until
                exhausted or else j = i
            loop
                pre_forth
                j := j + 1
            end
            pre_continue_for (action, n, k)
        end

    post_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            j: INTEGER
        do
            from
                start
                j := 1
            invariant
                j >= 1 and j <= i
            variant
                i - j
            until
                exhausted or else j = i
            loop
                pre_forth
                j := j + 1
            end
            pre_continue_for (action, n, k)
        end

    breadth_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            j: INTEGER
        do
            from
                start
                j := 1
            invariant
                j >= 1 and j <= i
            variant
                i - j
            until
                exhausted or else j = i
            loop
                pre_forth
                j := j + 1
            end
            pre_continue_for (action, n, k)
        end

    post_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            target.linear_do_if (action, test)
        end

    pre_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            target.linear_do_if (action, test)
        end

    breadth_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            target.linear_do_if (action, test)
        end

    breadth_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_continue_until (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    pre_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_continue_until (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    post_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_continue_until (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    pre_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_continue_while (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    breadth_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_continue_while (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    post_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_continue_while (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    pre_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            pre_search (test, False)
            Result := exhausted
        end

    post_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            pre_search (test, False)
            Result := exhausted
        end

    breadth_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            pre_search (test, False)
            Result := exhausted
        end

    post_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)
        do
            start
            pre_continue_search (test, b)
        end

    breadth_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)
        do
            start
            pre_continue_search (test, b)
        end

    pre_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)
        do
            start
            pre_continue_search (test, b)
        end

    post_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            pre_search (test, True)
            Result := not exhausted
        end

    breadth_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            pre_search (test, True)
            Result := not exhausted
        end

    pre_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            pre_search (test, True)
            Result := not exhausted
        end

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                action.call ([item])
                pre_forth
            end
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value
        end

    breadth_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            until_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    pre_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            until_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    post_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            until_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    breadth_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                action.call (item_tuple)
                pre_forth
            end
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    pre_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                action.call (item_tuple)
                pre_forth
            end
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    post_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                action.call (item_tuple)
                pre_forth
            end
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    breadth_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_while_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    pre_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_while_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    post_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            pre_while_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_ITERATOR
    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ITERATOR
    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE_ITERATOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over cursor trees,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, cursor_tree_iterators, cursor_tree_iteration, tree_iterators, tree_iteration
    exploration: depth_first, breadth_first
    traversal: preorder, postorder, inorder
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    CURSOR_TREE_ITERATOR [G]

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Access

    item: G
            -- The item at cursor position in target
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            traversable_exists: target /= void

    item_tuple: TUPLE [G]
            -- Tuple containing a single element,
            -- the item at cursor position in target''
            -- (from LINEAR_ITERATOR)

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)

    target: CURSOR_TREE [G]
            -- The structure to which iteration features will apply

feature -- Cursor movement

    breadth_forth
            -- Move cursor of target to next position in breadth-first.

    breadth_start
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of pre_start.

    exhausted: BOOLEAN
            -- Is target exhausted?
            -- (from LINEAR_ITERATOR)

    off: BOOLEAN
            -- Is position of target off?
            -- (from LINEAR_ITERATOR)

    post_forth
            -- Move cursor of target to next position in postorder.

    post_start
            -- Move cursor of target to first position in postorder.

    pre_forth
            -- Move cursor of target to next position in preorder.

    pre_start
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of breadth_start.

    start
            -- Move to first position of target.
            -- (from LINEAR_ITERATOR)

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target
            -- (from LINEAR_ITERATOR)

feature -- Iteration

    breadth_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    post_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    pre_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    post_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    breadth_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    pre_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    post_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    breadth_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    post_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    post_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    pre_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    pre_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    post_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    breadth_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    post_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    pre_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    breadth_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    breadth_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    post_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    post_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    pre_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    post_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    breadth_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    post_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    breadth_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    pre_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    post_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    breadth_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    pre_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    breadth_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    post_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    breadth_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    pre_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    post_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    pre_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    post_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_ITERATOR
    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ITERATOR
    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE_ITERATOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CURSOR_TREE_ITERATOR [G]

Ancestors
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]

Clients
    CURSOR_TREE_ITERATOR [G]

Suppliers
    CURSOR_TREE [G]
    CURSOR_TREE_ITERATOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CURSOR_TREE_ITERATOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over cursor trees,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, cursor_tree_iterators, cursor_tree_iteration, tree_iterators, tree_iteration
    exploration: depth_first, breadth_first
    traversal: preorder, postorder, inorder
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class interface
    CURSOR_TREE_ITERATOR [G]

feature -- Status report

    target: CURSOR_TREE [G]
            -- The structure to which iteration features will apply

feature -- Cursor movement

    pre_start
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of breadth_start.

    breadth_start
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of pre_start.

    post_start
            -- Move cursor of target to first position in postorder.

    pre_forth
            -- Move cursor of target to next position in preorder.

    post_forth
            -- Move cursor of target to next position in postorder.

    breadth_forth
            -- Move cursor of target to next position in breadth-first.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.iteration

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


ITERATOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over traversable structures,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    ITERATOR [G]

feature -- Initialization

    set (s: like target) is
            -- Make s the new target of iterations.
        require
            target_exists: s /= void
        do
            target := s
        ensure
            target = s
            target /= void
        end

feature -- Access

    target: TRAVERSABLE [G]
            -- The structure to which iteration features will apply

feature -- Status report

    invariant_value: BOOLEAN is
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
        do
            Result := True
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
        require
            action_exists: action /= void
        do
            target.do_all (action)
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
        require
            action_exists: action /= void
            test_exists: test /= void
        do
            target.do_if (action, test)
        end

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (Apply to full list if no item satisfies test).
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (Apply to full list if all items satisfy test).
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying not test.
            -- (Apply to full list if all items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item of target?
        require
            test_exists: test /= void
        deferred
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items of target?
        require
            test_exists: test /= void
        deferred
        end

invariant

    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ITERATOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    ITERATOR [G]

General
    cluster: base.structures.iteration
    description:
        "Objects that are able to iterate over traversable structures,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others."

Ancestors
    ANY

Queries
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    invariant_value: BOOLEAN
    target: TRAVERSABLE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    set (s: [like target] TRAVERSABLE [G])
    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])

Constraints
    traversable exists

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ITERATOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over traversable structures,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class
    ITERATOR [G]

feature -- Initialization

    set (s: like target) is
            -- Make s the new target of iterations.
        require
            target_exists: s /= void
        do
            target := s
        ensure
            target = s
            target /= void
        end

feature -- Access

    target: TRAVERSABLE [G]
            -- The structure to which iteration features will apply

feature -- Status report

    invariant_value: BOOLEAN is
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
        do
            Result := True
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
        require
            action_exists: action /= void
        do
            target.do_all (action)
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
        require
            action_exists: action /= void
            test_exists: test /= void
        do
            target.do_if (action, test)
        end

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (Apply to full list if no item satisfies test).
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (Apply to full list if all items satisfy test).
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items of target?
        require
            test_exists: test /= void
        deferred
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item of target?
        require
            test_exists: test /= void
        deferred
        end

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying not test.
            -- (Apply to full list if all items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void
        deferred
        end

invariant

    traversable_exists: target /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ITERATOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over traversable structures,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    ITERATOR [G]

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
        require
            target_exists: s /= void
        ensure
            target = s
            target /= void

feature -- Access

    target: TRAVERSABLE [G]
            -- The structure to which iteration features will apply

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
        require
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
        require
            action_exists: action /= void
            test_exists: test /= void

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (Apply to full list if no item satisfies test).
        require
            action_exists: action /= void
            test_exists: test /= void

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (Apply to full list if all items satisfy test).
        require
            action_exists: action /= void
            test_exists: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items of target?
        require
            test_exists: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item of target?
        require
            test_exists: test /= void

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying not test.
            -- (Apply to full list if all items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void

invariant

    traversable_exists: target /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ITERATOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    ITERATOR [G]

Ancestors
    ANY

Descendants
    LINEAR_ITERATOR [G]

Clients
    ITERATOR [G]
    LINEAR_ITERATOR [G]

Suppliers
    ITERATOR [G]
    TRAVERSABLE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ITERATOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over traversable structures,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    ITERATOR [G]

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
        require
            target_exists: s /= void
        ensure
            target = s
            target /= void

feature -- Access

    target: TRAVERSABLE [G]
            -- The structure to which iteration features will apply

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
        require
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
        require
            action_exists: action /= void
            test_exists: test /= void

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (Apply to full list if no item satisfies test).
        require
            action_exists: action /= void
            test_exists: test /= void

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (Apply to full list if all items satisfy test).
        require
            action_exists: action /= void
            test_exists: test /= void

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying not test.
            -- (Apply to full list if all items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item of target?
        require
            test_exists: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items of target?
        require
            test_exists: test /= void

invariant

    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_ITERATOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that are able to iterate over linear structures"
    status: "See notice at end of class"
    names: iterators, iteration, linear_iterators, linear_iteration
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINEAR_ITERATOR [G]

inherit
    ITERATOR [G]
        redefine
            target,
            set
        end

create
    set

feature -- Initialization

    set (s: like target) is
            -- Make s the new target of iterations.
        do
            Precursor  (s)
            create internal_item_tuple.make
        end

feature -- Access

    item: G is
            -- The item at cursor position in target
        require
            traversable_exists: target /= void
        do
            Result := target.item
        end

    item_tuple: TUPLE [G] is
            -- Tuple containing a single element,
            -- the item at cursor position in target''
        do
            internal_item_tuple.put (target.item, 1)
            Result := internal_item_tuple
        end

    target: LINEAR [G]
            -- The structure to which iteration features will apply.

feature -- Cursor movement

    start is
            -- Move to first position of target.
        do
            target.start
        end

    forth is
            -- Move to next position of target.
        do
            target.forth
        end

    off: BOOLEAN is
            -- Is position of target off?
        do
            Result := target.off
        end

    exhausted: BOOLEAN is
            -- Is target exhausted?
        do
            Result := target.exhausted
        end

feature -- Iteration

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
        do
            start
            continue_while (action, test)
        ensure then
            finished: not exhausted implies not test.item (item_tuple)
        end

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
        require else
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then
            finished: not exhausted implies not test.item (item_tuple)
        end

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
        do
            start
            while_continue (action, test)
        ensure then
            finished: not exhausted implies not test.item (item_tuple)
        end

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
        do
            from
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                action.call (item_tuple)
                forth
            end
        ensure
            finished: not exhausted implies not test.item (item_tuple)
        end

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
        do
            start
            until_continue (action, test)
        ensure then
            achieved: not exhausted implies test.item (item_tuple)
        end

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
        require
            invariant_satisfied: invariant_value
        do
            from
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                action.call ([item])
                forth
            end
        ensure
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value
        end

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
        do
            start
            continue_until (action, test)
        ensure then
            achieved: not exhausted implies test.item (item_tuple)
        end

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
        require
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then
            achieved: not exhausted implies test.item (item_tuple)
        end

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
        do
            start
            continue_search (test, b)
        end

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
        do
            from
            invariant
                invariant_value
            until
                exhausted or else (b = test.item (item_tuple))
            loop
                forth
            end
        ensure then
            found: not exhausted = (b = test.item (item_tuple))
        end

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
        require
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            j: INTEGER
        do
            from
                start
                j := 1
            invariant
                j >= 1 and j <= i
            variant
                i - j
            until
                exhausted or else j = i
            loop
                forth
                j := j + 1
            end
            continue_for (action, n, k)
        end

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible.
        require
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            i, j: INTEGER
        do
            from
            invariant
                i >= 0 and i <= n
            variant
                n - i
            until
                exhausted or else i = n
            loop
                action.call (item_tuple)
                i := i + 1
                from
                    j := 0
                invariant
                    j >= 0 and j <= k
                variant
                    k - j
                until
                    exhausted or else j = k
                loop
                    forth
                    j := j + 1
                end
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- all items of target?
        do
            search (test, False)
            Result := exhausted
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- at least one item of target?
        do
            search (test, True)
            Result := not exhausted
        end

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target

invariant

    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void

end -- class LINEAR_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_ITERATOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINEAR_ITERATOR [G]

General
    cluster: base.structures.iteration
    description: "Objects that are able to iterate over linear structures"
    create: set

Ancestors
    ITERATOR [G]

Queries
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    internal_item_tuple: TUPLE [G]
    invariant_value: BOOLEAN
    item: G
    item_tuple: TUPLE [G]
    off: BOOLEAN
    target: LINEAR [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    forth
    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    set (s: [like target] LINEAR [G])
    start
    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])

Constraints
    target exists
    item tuple exists
    internal item tuple exists

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_ITERATOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that are able to iterate over linear structures"
    status: "See notice at end of class"
    names: iterators, iteration, linear_iterators, linear_iteration
    date: "$Date: 2001/07/15 05:36:32 $"
    revision: "$Revision: 1.2 $"

class
    LINEAR_ITERATOR [G]

create
    set

feature -- Initialization

    set (s: like target) is
            -- Make s the new target of iterations.
        require -- from ITERATOR
            target_exists: s /= void
        do
            Precursor  (s)
            create internal_item_tuple.make
        ensure -- from ITERATOR
            target = s
            target /= void
        end

feature -- Access

    item: G is
            -- The item at cursor position in target
        require
            traversable_exists: target /= void
        do
            Result := target.item
        end

    item_tuple: TUPLE [G] is
            -- Tuple containing a single element,
            -- the item at cursor position in target''
        do
            internal_item_tuple.put (target.item, 1)
            Result := internal_item_tuple
        end

    target: LINEAR [G]
            -- The structure to which iteration features will apply.

feature -- Status report

    invariant_value: BOOLEAN is
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)
        do
            Result := True
        end

feature -- Cursor movement

    exhausted: BOOLEAN is
            -- Is target exhausted?
        do
            Result := target.exhausted
        end

    forth is
            -- Move to next position of target.
        do
            target.forth
        end

    off: BOOLEAN is
            -- Is position of target off?
        do
            Result := target.off
        end

    start is
            -- Move to first position of target.
        do
            target.start
        end

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target

feature -- Iteration

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible.
        require
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            i, j: INTEGER
        do
            from
            invariant
                i >= 0 and i <= n
            variant
                n - i
            until
                exhausted or else i = n
            loop
                action.call (item_tuple)
                i := i + 1
                from
                    j := 0
                invariant
                    j >= 0 and j <= k
                variant
                    k - j
                until
                    exhausted or else j = k
                loop
                    forth
                    j := j + 1
                end
            end
        end

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
        do
            from
            invariant
                invariant_value
            until
                exhausted or else (b = test.item (item_tuple))
            loop
                forth
            end
        ensure then
            found: not exhausted = (b = test.item (item_tuple))
        end

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
        require
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then
            achieved: not exhausted implies test.item (item_tuple)
        end

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
        require else
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then
            finished: not exhausted implies not test.item (item_tuple)
        end

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
        do
            target.do_all (action)
        end

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
        require
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            j: INTEGER
        do
            from
                start
                j := 1
            invariant
                j >= 1 and j <= i
            variant
                i - j
            until
                exhausted or else j = i
            loop
                forth
                j := j + 1
            end
            continue_for (action, n, k)
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            target.do_if (action, test)
        end

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            continue_until (action, test)
        ensure then
            achieved: not exhausted implies test.item (item_tuple)
        end

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            continue_while (action, test)
        ensure then
            finished: not exhausted implies not test.item (item_tuple)
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- all items of target?
        require -- from ITERATOR
            test_exists: test /= void
        do
            search (test, False)
            Result := exhausted
        end

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
        do
            start
            continue_search (test, b)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- at least one item of target?
        require -- from ITERATOR
            test_exists: test /= void
        do
            search (test, True)
            Result := not exhausted
        end

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
        require
            invariant_satisfied: invariant_value
        do
            from
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                action.call ([item])
                forth
            end
        ensure
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value
        end

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            until_continue (action, test)
        ensure then
            achieved: not exhausted implies test.item (item_tuple)
        end

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
        do
            from
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                action.call (item_tuple)
                forth
            end
        ensure
            finished: not exhausted implies not test.item (item_tuple)
        end

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            while_continue (action, test)
        ensure then
            finished: not exhausted implies not test.item (item_tuple)
        end

invariant

    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ITERATOR
    traversable_exists: target /= void

end -- class LINEAR_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_ITERATOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that are able to iterate over linear structures"
    status: "See notice at end of class"
    names: iterators, iteration, linear_iterators, linear_iteration
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    LINEAR_ITERATOR [G]

create

    set (s: like target)
            -- Make s the new target of iterations.
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Access

    item: G
            -- The item at cursor position in target
        require
            traversable_exists: target /= void

    item_tuple: TUPLE [G]
            -- Tuple containing a single element,
            -- the item at cursor position in target''

    target: LINEAR [G]
            -- The structure to which iteration features will apply.

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)

feature -- Cursor movement

    exhausted: BOOLEAN
            -- Is target exhausted?

    forth
            -- Move to next position of target.

    off: BOOLEAN
            -- Is position of target off?

    start
            -- Move to first position of target.

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target

feature -- Iteration

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
        require
            valid_repetition: n >= 0
            valid_skip: k >= 1

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
        ensure then
            found: not exhausted = (b = test.item (item_tuple))

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
        require
            invariant_satisfied: invariant_value
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
        require else
            invariant_satisfied: invariant_value
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
        require
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
        require -- from ITERATOR
            test_exists: test /= void

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
        require -- from ITERATOR
            test_exists: test /= void

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
        require
            invariant_satisfied: invariant_value
        ensure
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
        ensure
            finished: not exhausted implies not test.item (item_tuple)

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

invariant

    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ITERATOR
    traversable_exists: target /= void

end -- class LINEAR_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_ITERATOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINEAR_ITERATOR [G]

Ancestors
    ITERATOR [G]

Descendants
    CURSOR_TREE_ITERATOR [G]
    TWO_WAY_CHAIN_ITERATOR [G]

Clients
    LINEAR_ITERATOR [G]

Suppliers
    BOOLEAN
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    INTEGER
    ITERATOR [G]
    LINEAR [G]
    LINEAR_ITERATOR [G]
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_ITERATOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that are able to iterate over linear structures"
    status: "See notice at end of class"
    names: iterators, iteration, linear_iterators, linear_iteration
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    LINEAR_ITERATOR [G]

create
    set

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.

feature -- Access

    item: G
            -- The item at cursor position in target
        require
            traversable_exists: target /= void

    item_tuple: TUPLE [G]
            -- Tuple containing a single element,
            -- the item at cursor position in target''

    target: LINEAR [G]
            -- The structure to which iteration features will apply.

feature -- Cursor movement

    start
            -- Move to first position of target.

    forth
            -- Move to next position of target.

    off: BOOLEAN
            -- Is position of target off?

    exhausted: BOOLEAN
            -- Is target exhausted?

feature -- Iteration

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
        require else
            invariant_satisfied: invariant_value
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
        ensure
            finished: not exhausted implies not test.item (item_tuple)

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
        require
            invariant_satisfied: invariant_value
        ensure
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
        require
            invariant_satisfied: invariant_value
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
        ensure then
            found: not exhausted = (b = test.item (item_tuple))

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
        require
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
        require
            valid_repetition: n >= 0
            valid_skip: k >= 1

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target

invariant

    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void

end -- class LINEAR_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CHAIN_ITERATOR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over two-way chains,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, two_way_chain_iterators, two_way_chain_iteration
    traversal: sequential
    exploration: forward, backward
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_CHAIN_ITERATOR [G]

inherit
    LINEAR_ITERATOR [G]
        redefine
            target
        select
            start,
            forth,
            do_all,
            until_do,
            do_until,
            while_do,
            do_while,
            do_if,
            do_for,
            search,
            for_all,
            there_exists,
            until_continue,
            continue_until,
            while_continue,
            continue_while,
            continue_for,
            continue_search
        end

    LINEAR_ITERATOR [G]
        rename
            start as finish,
            forth as back,
            do_all as do_all_back,
            until_do as until_do_back,
            do_until as do_until_back,
            do_while as do_while_back,
            while_do as while_do_back,
            do_if as do_if_back,
            do_for as do_for_back,
            search as search_back,
            for_all as for_all_back,
            there_exists as there_exists_back,
            until_continue as until_continue_back,
            continue_until as continue_until_back,
            while_continue as while_continue_back,
            continue_while as continue_while_back,
            continue_for as continue_for_back,
            continue_search as continue_search_back
        redefine
            back,
            finish,
            target
        end

feature -- Access

    target: CHAIN [G]

feature -- Cursor movement

    finish is
            -- Move cursor of target to last position.
        do
            target.finish
        end

    back is
            -- Move cursor of target backward one position.
        do
            target.back
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CHAIN_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CHAIN_ITERATOR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_CHAIN_ITERATOR [G]

General
    cluster: base.structures.iteration
    description:
        "Objects that are able to iterate over two-way chains,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others."

Ancestors
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]

Queries
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    for_all_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    internal_item_tuple: TUPLE [G]
    invariant_value: BOOLEAN
    item: G
    item_tuple: TUPLE [G]
    off: BOOLEAN
    target: CHAIN [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    there_exists_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    back
    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    continue_for_back (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    continue_search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_all_back (action: PROCEDURE [ANY, TUPLE [G]])
    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    do_for_back (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_if_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    set (s: [like target] CHAIN [G])
    start
    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CHAIN_ITERATOR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over two-way chains,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, two_way_chain_iterators, two_way_chain_iteration
    traversal: sequential
    exploration: forward, backward
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_CHAIN_ITERATOR [G]

feature -- Initialization

    set (s: like target) is
            -- Make s the new target of iterations.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            target_exists: s /= void
        do
            Precursor  (s)
            create internal_item_tuple.make
        ensure -- from ITERATOR
            target = s
            target /= void
        end

feature -- Access

    item: G is
            -- The item at cursor position in target
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            traversable_exists: target /= void
        do
            Result := target.item
        end

    item_tuple: TUPLE [G] is
            -- Tuple containing a single element,
            -- the item at cursor position in target''
            -- (from LINEAR_ITERATOR)
        do
            internal_item_tuple.put (target.item, 1)
            Result := internal_item_tuple
        end

    target: CHAIN [G]

feature -- Status report

    invariant_value: BOOLEAN is
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)
        do
            Result := True
        end

feature -- Cursor movement

    back is
            -- Move cursor of target backward one position.
        do
            target.back
        end

    exhausted: BOOLEAN is
            -- Is target exhausted?
            -- (from LINEAR_ITERATOR)
        do
            Result := target.exhausted
        end

    finish is
            -- Move cursor of target to last position.
        do
            target.finish
        end

    forth is
            -- Move to next position of target.
            -- (from LINEAR_ITERATOR)
        do
            target.forth
        end

    off: BOOLEAN is
            -- Is position of target off?
            -- (from LINEAR_ITERATOR)
        do
            Result := target.off
        end

    start is
            -- Move to first position of target.
            -- (from LINEAR_ITERATOR)
        do
            target.start
        end

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target
            -- (from LINEAR_ITERATOR)

feature -- Iteration

    continue_for_back (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            i, j: INTEGER
        do
            from
            invariant
                i >= 0 and i <= n
            variant
                n - i
            until
                exhausted or else i = n
            loop
                action.call (item_tuple)
                i := i + 1
                from
                    j := 0
                invariant
                    j >= 0 and j <= k
                variant
                    k - j
                until
                    exhausted or else j = k
                loop
                    forth
                    j := j + 1
                end
            end
        end

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            i, j: INTEGER
        do
            from
            invariant
                i >= 0 and i <= n
            variant
                n - i
            until
                exhausted or else i = n
            loop
                action.call (item_tuple)
                i := i + 1
                from
                    j := 0
                invariant
                    j >= 0 and j <= k
                variant
                    k - j
                until
                    exhausted or else j = k
                loop
                    forth
                    j := j + 1
                end
            end
        end

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else (b = test.item (item_tuple))
            loop
                forth
            end
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))
        end

    continue_search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else (b = test.item (item_tuple))
            loop
                forth
            end
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))
        end

    continue_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    continue_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
                if not exhausted then
                    action.call (item_tuple)
                end
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                forth
                if not exhausted then
                    action.call (item_tuple)
                end
            end
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
        do
            target.do_all (action)
        end

    do_all_back (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
        do
            target.do_all (action)
        end

    do_for_back (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            j: INTEGER
        do
            from
                start
                j := 1
            invariant
                j >= 1 and j <= i
            variant
                i - j
            until
                exhausted or else j = i
            loop
                forth
                j := j + 1
            end
            continue_for (action, n, k)
        end

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER) is
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1
        local
            j: INTEGER
        do
            from
                start
                j := 1
            invariant
                j >= 1 and j <= i
            variant
                i - j
            until
                exhausted or else j = i
            loop
                forth
                j := j + 1
            end
            continue_for (action, n, k)
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            target.do_if (action, test)
        end

    do_if_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            target.do_if (action, test)
        end

    do_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            continue_until (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            continue_until (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            continue_while (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    do_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            continue_while (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            search (test, False)
            Result := exhausted
        end

    for_all_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            search (test, False)
            Result := exhausted
        end

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)
        do
            start
            continue_search (test, b)
        end

    search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN) is
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)
        do
            start
            continue_search (test, b)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            search (test, True)
            Result := not exhausted
        end

    there_exists_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void
        do
            search (test, True)
            Result := not exhausted
        end

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                action.call ([item])
                forth
            end
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value
        end

    until_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        do
            from
            invariant
                invariant_value
            until
                exhausted or else test.item (item_tuple)
            loop
                action.call ([item])
                forth
            end
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value
        end

    until_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            until_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            until_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)
        end

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                action.call (item_tuple)
                forth
            end
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    while_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        do
            from
            invariant
                invariant_value
            until
                exhausted or else not test.item (item_tuple)
            loop
                action.call (item_tuple)
                forth
            end
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    while_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            while_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        do
            start
            while_continue (action, test)
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_ITERATOR
    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ITERATOR
    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CHAIN_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CHAIN_ITERATOR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over two-way chains,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, two_way_chain_iterators, two_way_chain_iteration
    traversal: sequential
    exploration: forward, backward
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_CHAIN_ITERATOR [G]

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Access

    item: G
            -- The item at cursor position in target
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            traversable_exists: target /= void

    item_tuple: TUPLE [G]
            -- Tuple containing a single element,
            -- the item at cursor position in target''
            -- (from LINEAR_ITERATOR)

    target: CHAIN [G]

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)

feature -- Cursor movement

    back
            -- Move cursor of target backward one position.

    exhausted: BOOLEAN
            -- Is target exhausted?
            -- (from LINEAR_ITERATOR)

    finish
            -- Move cursor of target to last position.

    forth
            -- Move to next position of target.
            -- (from LINEAR_ITERATOR)

    off: BOOLEAN
            -- Is position of target off?
            -- (from LINEAR_ITERATOR)

    start
            -- Move to first position of target.
            -- (from LINEAR_ITERATOR)

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target
            -- (from LINEAR_ITERATOR)

feature -- Iteration

    continue_for_back (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    continue_search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    continue_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    continue_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    do_all_back (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    do_for_back (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    do_if_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    do_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    do_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    for_all_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    there_exists_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    until_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    until_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    while_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    while_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_ITERATOR
    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ITERATOR
    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CHAIN_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CHAIN_ITERATOR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_CHAIN_ITERATOR [G]

Ancestors
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]

Clients
    TWO_WAY_CHAIN_ITERATOR [G]

Suppliers
    CHAIN [G]
    TWO_WAY_CHAIN_ITERATOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CHAIN_ITERATOR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Objects that are able to iterate over two-way chains,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, two_way_chain_iterators, two_way_chain_iteration
    traversal: sequential
    exploration: forward, backward
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_CHAIN_ITERATOR [G]

feature -- Access

    target: CHAIN [G]

feature -- Cursor movement

    finish
            -- Move cursor of target to last position.

    back
            -- Move cursor of target backward one position.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CHAIN_ITERATOR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.list

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.list	(diagram)

Supercluster
    base.structures

Classes
    ARRAYED_CIRCULAR [G]
    ARRAYED_LIST [G]
    BI_LINKABLE [G]
    CELL [G]
    CHAIN [G]
    CIRCULAR [G]
    DYNAMIC_CHAIN [G]
    DYNAMIC_CIRCULAR [G]
    DYNAMIC_LIST [G]
    FIXED_LIST [G]
    LINKABLE [G]
    LINKED_CIRCULAR [G]
    LINKED_LIST [G]
    LIST [G]
    MULTI_ARRAY_LIST [G]
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
    SEQUENCE [G]
    SORTED_LIST [G -> COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
    TWO_WAY_CIRCULAR [G]
    TWO_WAY_LIST [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_CIRCULAR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented by resizable arrays"
    status: "See notice at end of class"
    names: arrayed_circular, ring, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_CIRCULAR [G]

inherit
    DYNAMIC_CIRCULAR [G]
        undefine
            readable,
            isfirst,
            writable,
            is_equal
        redefine
            start,
            islast,
            wipe_out
        select
            remove,
            go_i_th,
            after,
            before,
            off,
            prune_all,
            prune,
            first,
            forth
        end

    LIST [G]
        rename
            after as l_after,
            before as l_before,
            remove as l_remove,
            first as l_first,
            off as l_off,
            prune as l_prune,
            prune_all as l_prune_all,
            go_i_th as l_go_i_th,
            forth as l_forth
        export
            {NONE} l_after, l_before, l_remove, l_first, l_off, l_prune, l_prune_all, l_go_i_th, l_forth
        undefine
            last,
            exhausted,
            move,
            valid_cursor_index,
            isfirst,
            readable,
            islast,
            start,
            writable
        end

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create a circular chain with n items.
        require
            at_least_one: n >= 1
        do
            create list.make (n)
        end

feature -- Access

    item: G is
            -- Current item
        do
            Result := list.item
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {CIRCULAR_CURSOR} Result.make (list.cursor, internal_exhausted, starter)
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        do
            Result := list.count
        end

feature -- Status report

    full: BOOLEAN is
            -- Is structure filled to capacity?
        do
            Result := list.full
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := list.readable
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                Result := list.valid_cursor (c_c.cursor) and then c_c.starter >= 0 and then c_c.starter <= count
            end
        end

    writable: BOOLEAN is
            -- Is there a current item that may be written?
        do
            Result := list.writable
        end

    isfirst: BOOLEAN is
            -- Is cursor on first item?
        do
            if not is_empty then
                if starter = 0 then
                    Result := list.isfirst
                else
                    Result := (standard_index = starter)
                end
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last item?
        do
            if not is_empty then
                if (starter = 0) or (starter = 1) then
                    Result := standard_islast
                else
                    Result := (standard_index = starter - 1)
                end
            end
        end

feature -- Cursor movement

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                list.go_to (c_c.cursor)
                internal_exhausted := c_c.internal_exhausted
                starter := c_c.starter
            end
        end

    set_start is
            -- Select current item as the first.
        do
            starter := standard_index
            internal_exhausted := False
        end

    start is
            -- Move to position currently selected as first.
        do
            internal_exhausted := False
            if starter = 0 then
                standard_start
                starter := 1
            else
                standard_go_i_th (starter)
                if standard_off then
                    standard_start
                end
            end
        end

feature -- Element change

    replace (v: G) is
            -- Replace current item by v.
        do
            list.replace (v)
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        do
            list.merge_right (other.list)
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        do
            list.put_right (v)
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            list.put_front (v)
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor except if it was off.
        do
            list.extend (v)
            if standard_index = 0 then
                list.forth
            end
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        do
            list.merge_left (other.list)
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        do
            list.put_left (v)
        end

feature -- Removal

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require else
            count > 1
        do
            if standard_isfirst then
                standard_finish
                remove
            else
                standard_remove_left
            end
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require else
            count > 1
        do
            if standard_islast then
                standard_start
                remove
                finish
            else
                standard_remove_right
            end
        end

    wipe_out is
            -- Remove all items.
        do
            list.wipe_out
            starter := 0
            internal_exhausted := False
        end

feature {ARRAYED_CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
        do
            if count = 1 or starter = 0 then
                starter := 0
            elseif starter = standard_index then
                if standard_islast then
                    starter := 1
                else
                    starter := starter + 1
                end
            end
        end

    starter: INTEGER
            -- The position currently selected as first

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (count)
        end

    list: ARRAYED_LIST [G]

    standard_after: BOOLEAN is
        do
            Result := list.after
        end

    standard_back is
        do
            list.back
        end

    standard_before: BOOLEAN is
        do
            Result := list.before
        end

    standard_finish is
        do
            list.finish
        end

    standard_forth is
        do
            list.forth
        end

    standard_go_i_th (i: INTEGER) is
        do
            list.go_i_th (i)
        end

    standard_index: INTEGER is
        do
            Result := list.index
        end

    standard_isfirst: BOOLEAN is
        do
            Result := list.isfirst
        end

    standard_islast: BOOLEAN is
        do
            Result := list.islast
        end

    standard_move (i: INTEGER) is
        do
            list.move (i)
        end

    standard_off: BOOLEAN is
        do
            Result := list.off
        end

    standard_remove is
        do
            list.remove
        end

    standard_remove_left is
        do
            list.remove_left
        end

    standard_remove_right is
        do
            list.remove_right
        end

    standard_search (v: G) is
        do
            list.search (v)
        end

    standard_start is
        do
            list.start
        end

feature {NONE} -- Inapplicable

    l_forth is
        do
        end

invariant

    non_negative_count: count >= 0
    valid_starter: starter >= 0 and starter <= count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_CIRCULAR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains implemented by resizable arrays"
    create: make

Ancestors
    DYNAMIC_CIRCULAR [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] ARRAYED_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_CIRCULAR [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (n: INTEGER)
    merge_left (other: [like Current] ARRAYED_CIRCULAR [G])
    merge_right (other: [like Current] ARRAYED_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    non negative count
    valid starter

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_CIRCULAR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented by resizable arrays"
    status: "See notice at end of class"
    names: arrayed_circular, ring, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_CIRCULAR [G]

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Create a circular chain with n items.
        require
            at_least_one: n >= 1
        do
            create list.make (n)
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
        do
            create {CIRCULAR_CURSOR} Result.make (list.cursor, internal_exhausted, starter)
        end

    first: G is
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            start
            Result := item
            move (pos - 1)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)
        local
            first_ind, std_ind: INTEGER
            p: CURSOR
        do
            p := cursor
            std_ind := standard_index
            start
            first_ind := standard_index
            Result := std_ind - first_ind + 1
            if Result < 0 then
                Result := count + Result
            end
            move (Result - 1)
            go_to (p)
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := list.item
        end

    last: like first is
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            finish
            Result := item
            start
            move (pos - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    l_first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        do
            Result := list.count
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_after
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_before
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        do
            Result := is_empty or internal_exhausted
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN is
            -- Is structure filled to capacity?
        do
            Result := list.full
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor on first item?
        do
            if not is_empty then
                if starter = 0 then
                    Result := list.isfirst
                else
                    Result := (standard_index = starter)
                end
            end
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor on last item?
        do
            if not is_empty then
                if (starter = 0) or (starter = 1) then
                    Result := standard_islast
                else
                    Result := (standard_index = starter - 1)
                end
            end
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CIRCULAR)
        do
            Result := is_empty
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := list.readable
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                Result := list.valid_cursor (c_c.cursor) and then c_c.starter >= 0 and then c_c.starter <= count
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        do
            Result := (i >= 0) and (i <= count)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be written?
        do
            Result := list.writable
        end

feature {NONE} -- Status report

    l_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    l_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    l_off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before
        do
            if isfirst then
                internal_exhausted := True
            end
            standard_back
            if standard_before then
                standard_finish
            end
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        do
            if islast then
                internal_exhausted := True
            end
            standard_forth
            if standard_after then
                standard_start
            end
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        do
            start
            move (i - 1)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                list.go_to (c_c.cursor)
                internal_exhausted := c_c.internal_exhausted
                starter := c_c.starter
            end
        end

    move (i: INTEGER) is
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        local
            real_move, counter, start_index: INTEGER
        do
            if i /= 0 and count > 0 then
                start_index := index
                real_move := i \\ count
                if real_move < 0 then
                    real_move := count + real_move
                end
                from
                until
                    counter = real_move
                loop
                    forth
                    counter := counter + 1
                end
                if (start_index + i > count) or (start_index + i < 1) then
                    internal_exhausted := True
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    set_start is
            -- Select current item as the first.
        require -- from CIRCULAR
            not_empty: not is_empty
        do
            starter := standard_index
            internal_exhausted := False
        end

    start is
            -- Move to position currently selected as first.
        do
            internal_exhausted := False
            if starter = 0 then
                standard_start
                starter := 1
            else
                standard_go_i_th (starter)
                if standard_off then
                    standard_start
                end
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature {NONE} -- Cursor movement

    l_go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor except if it was off.
        require -- from COLLECTION
            extendible: extendible
        do
            list.extend (v)
            if standard_index = 0 then
                list.forth
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            list.merge_left (other.list)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            list.merge_right (other.list)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            list.put_front (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        do
            list.put_left (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            list.put_right (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: G) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        do
            list.replace (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            fix_start_for_remove
            standard_remove
            if standard_after then
                finish
            elseif standard_before then
                start
            end
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            count > 1
        do
            if standard_isfirst then
                standard_finish
                remove
            else
                standard_remove_left
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else
            count > 1
        do
            if standard_islast then
                standard_start
                remove
                finish
            else
                standard_remove_right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            list.wipe_out
            starter := 0
            internal_exhausted := False
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    l_prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    l_prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            to_be_removed, counter: INTEGER
        do
            from
                Result := new_chain
                pos := cursor
                to_be_removed := count.min (n)
            until
                counter = to_be_removed
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    l_forth is
        require -- from LINEAR
            not_after: not after
        do
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    l_remove is
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature {ARRAYED_CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
        do
            if count = 1 or starter = 0 then
                starter := 0
            elseif starter = standard_index then
                if standard_islast then
                    starter := 1
                else
                    starter := starter + 1
                end
            end
        end

    list: ARRAYED_LIST [G]

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (count)
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    standard_after: BOOLEAN is
        do
            Result := list.after
        end

    standard_back is
        do
            list.back
        end

    standard_before: BOOLEAN is
        do
            Result := list.before
        end

    standard_finish is
        do
            list.finish
        end

    standard_forth is
        do
            list.forth
        end

    standard_go_i_th (i: INTEGER) is
        do
            list.go_i_th (i)
        end

    standard_index: INTEGER is
        do
            Result := list.index
        end

    standard_isfirst: BOOLEAN is
        do
            Result := list.isfirst
        end

    standard_islast: BOOLEAN is
        do
            Result := list.islast
        end

    standard_move (i: INTEGER) is
        do
            list.move (i)
        end

    standard_off: BOOLEAN is
        do
            Result := list.off
        end

    standard_remove is
        do
            list.remove
        end

    standard_remove_left is
        do
            list.remove_left
        end

    standard_remove_right is
        do
            list.remove_right
        end

    standard_search (v: G) is
        do
            list.search (v)
        end

    standard_start is
        do
            list.start
        end

    starter: INTEGER
            -- The position currently selected as first

feature {CIRCULAR} -- Implementation

    internal_exhausted: BOOLEAN
            -- Has last forth or back operation exhausted the structure?
            -- (from CIRCULAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    non_negative_count: count >= 0
    valid_starter: starter >= 0 and starter <= count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_CIRCULAR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented by resizable arrays"
    status: "See notice at end of class"
    names: arrayed_circular, ring, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_CIRCULAR [G]

create

    make (n: INTEGER)
            -- Create a circular chain with n items.
        require
            at_least_one: n >= 1

feature -- Initialization

    make (n: INTEGER)
            -- Create a circular chain with n items.
        require
            at_least_one: n >= 1

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor on first item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor on last item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be written?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Select current item as the first.
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move to position currently selected as first.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor except if it was off.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_count: count >= 0
    valid_starter: starter >= 0 and starter <= count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_CIRCULAR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_CIRCULAR [G]

Ancestors
    DYNAMIC_CIRCULAR [G]
    LIST [G]

Clients
    ARRAYED_CIRCULAR [G]

Suppliers
    ARRAYED_CIRCULAR [G]
    ARRAYED_LIST [G]
    BOOLEAN
    CIRCULAR_CURSOR
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_CIRCULAR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented by resizable arrays"
    status: "See notice at end of class"
    names: arrayed_circular, ring, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_CIRCULAR [G]

create
    make

feature -- Initialization

    make (n: INTEGER)
            -- Create a circular chain with n items.
        require
            at_least_one: n >= 1

feature -- Access

    item: G
            -- Current item

    cursor: CURSOR
            -- Current cursor position

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    full: BOOLEAN
            -- Is structure filled to capacity?

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    writable: BOOLEAN
            -- Is there a current item that may be written?

    isfirst: BOOLEAN
            -- Is cursor on first item?

    islast: BOOLEAN
            -- Is cursor on last item?

feature -- Cursor movement

    go_to (p: CURSOR)
            -- Move cursor to position p.

    set_start
            -- Select current item as the first.

    start
            -- Move to position currently selected as first.

feature -- Element change

    replace (v: G)
            -- Replace current item by v.

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor except if it was off.

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.

feature -- Removal

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require else
            count > 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require else
            count > 1

    wipe_out
            -- Remove all items.

invariant

    non_negative_count: count >= 0
    valid_starter: starter >= 0 and starter <= count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists implemented by resizable arrays"
    status: "See notice at end of class"
    names: sequence
    representation: array
    access: index, cursor, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_LIST [G]

inherit
    ARRAY [G]
        rename
            force as force_i_th,
            item as i_th,
            make as array_make,
            put as put_i_th,
            count as array_count,
            index_set as array_index_set,
            bag_put as put,
            valid_index as array_valid_index
        export
            {NONE} all,
            {ARRAYED_LIST} array_make, subcopy,
            {ANY} capacity
        undefine
            linear_representation,
            prunable,
            put,
            is_equal,
            prune,
            occurrences,
            extendible
        redefine
            extend,
            prune_all,
            full,
            wipe_out,
            is_inserted,
            make_from_array
        select
            array_valid_index
        end

    DYNAMIC_LIST [G]
        undefine
            valid_index,
            infix "@",
            i_th,
            put_i_th,
            force,
            is_inserted,
            copy,
            has
        redefine
            first,
            last,
            swap,
            wipe_out,
            go_i_th,
            move,
            prunable,
            start,
            finish,
            count,
            prune,
            remove,
            put_left,
            merge_left,
            merge_right,
            duplicate,
            prune_all
        select
            count,
            index_set
        end

create
    make,
    make_filled,
    make_from_array

feature -- Initialization

    make (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
        require
            valid_number_of_items: n >= 0
        do
            index := 0
            count := 0
            array_make (1, n)
        ensure
            correct_position: before
        end

    make_filled (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
        require
            valid_number_of_items: n >= 0
        do
            index := 0
            count := n
            array_make (1, n)
        ensure
            correct_position: before
            filled: full
        end

    make_from_array (a: ARRAY [G]) is
            -- Create list from array a.
        do
            Precursor  (a)
            lower := 1
            count := a.count
            upper := count
            index := 0
        end

feature -- Access

    item: like first is
            -- Current item
        require else
            index_is_valid: valid_index (index)
        do
            Result := area.item (index - 1)
        end

    first: G is
            -- Item at first position
        do
            Result := area.item (0)
        end

    last: like first is
            -- Item at last position
        do
            Result := area.item (count - 1)
        end

    index: INTEGER
            -- Index of item, if valid.

    cursor: CURSOR is
            -- Current cursor position
        do
            create {ARRAYED_LIST_CURSOR} Result.make (index)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items.

feature -- Status report

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
        do
            Result := (count = capacity)
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            if al_c /= void then
                Result := valid_cursor_index (al_c.index)
            end
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
        do
            Result := (1 <= i) and (i <= count)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
        do
            check
                put_constraint: (v /= last) implies not off
            end
            Result := (v = last) or else (v = item)
        end

feature -- Cursor movement

    move (i: INTEGER) is
            -- Move cursor i positions.
        do
            index := index + i
            if (index > count + 1) then
                index := count + 1
            elseif (index < 0) then
                index := 0
            end
        end

    start is
            -- Move cursor to first position if any.
        do
            index := 1
        ensure then
            after_when_empty: is_empty implies after
        end

    finish is
            -- Move cursor to last position if any.
        do
            index := count
        ensure then
            before_when_empty: is_empty implies before
        end

    forth is
            -- Move cursor one position forward.
        do
            index := index + 1
        end

    back is
            -- Move cursor one position backward.
        do
            index := index - 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        do
            index := i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            check
                al_c /= void
            end
            index := al_c.index
        end

feature -- Element change

    put_front (v: like item) is
            -- Add v to the beginning.
            -- Do not move cursor.
        do
            if is_empty then
                extend (v)
            else
                insert (v, 1)
            end
            index := index + 1
        end

    force (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
        do
            count := count + 1
            force_i_th (v, count)
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
        do
            count := count + 1
            force_i_th (v, count)
        end

    put_left (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
        do
            if after or is_empty then
                extend (v)
            else
                insert (v, index)
            end
            index := index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of current position.
            -- Do not move cursor.
        do
            if index = count then
                extend (v)
            else
                insert (v, index + 1)
            end
        end

    replace (v: like first) is
            -- Replace current item by v.
        do
            put_i_th (v, index)
        end

    merge_left (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure before cursor.
        local
            old_index: INTEGER
            old_other_count: INTEGER
        do
            old_index := index
            old_other_count := other.count
            index := index - 1
            merge_right (other)
            index := old_index + old_other_count
        end

    merge_right (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure after cursor.
        do
            if not other.is_empty then
                resize (1, count + other.count)
                if index < count then
                    subcopy (Current, index + 1, count, index + other.count + 1)
                end
                subcopy (other, 1, other.count, index + 1)
                count := count + other.count
                other.wipe_out
            end
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
        do
            if before then
                index := 1
            end
            if object_comparison then
                if v /= void then
                    from
                    until
                        after or else (item /= void and then v.is_equal (item))
                    loop
                        forth
                    end
                end
            else
                from
                until
                    after or else item = v
                loop
                    forth
                end
            end
            if not after then
                remove
            end
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        local
            default_value: G
        do
            if index < count then
                subcopy (Current, index + 1, count, index)
            end
            count := count - 1
            area.put (default_value, count)
        ensure then
            index: index = old index
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
            offset: INTEGER
            res: BOOLEAN
            obj_cmp: BOOLEAN
            default_val: like item
        do
            obj_cmp := object_comparison
            from
                i := 1
            until
                i > count
            loop
                if i <= count - offset then
                    if offset > 0 then
                        put_i_th (i_th (i + offset), i)
                    end
                    if obj_cmp then
                        res := equal (v, i_th (i))
                    else
                        res := (v = i_th (i))
                    end
                    if res then
                        offset := offset + 1
                    else
                        i := i + 1
                    end
                else
                    put_i_th (default_val, i)
                    i := i + 1
                end
            end
            count := count - offset
            index := count + 1
        ensure then
            is_after: after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        do
            index := index - 1
            remove
        end

    remove_right is
            -- Remove item to the right of cursor position
            -- Do not move cursor
        do
            index := index + 1
            remove
            index := index - 1
        end

    wipe_out is
            -- Remove all items.
        do
            count := 0
            index := 0
            discard_items
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
        local
            old_item: like item
        do
            old_item := item
            replace (area.item (i - 1))
            area.put (old_item, i - 1)
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
        local
            end_pos: INTEGER
        do
            if after then
                create Result.make (0)
            else
                end_pos := count.min (index + n - 1)
                create Result.make_filled (end_pos - index + 1)
                Result.subcopy (Current, index, end_pos, 1)
            end
        end

feature {NONE} -- Inapplicable

    new_chain: like Current is
            -- Unused
        do
        end

feature {NONE} -- Implementation

    insert (v: like item; pos: INTEGER) is
            -- Add v at pos, moving subsequent items
            -- to the right.
        require
            index_small_enough: pos <= count
            index_large_enough: pos >= 1
        do
            if count + 1 > capacity then
                auto_resize (lower, count + 1)
            end
            count := count + 1
            subcopy (Current, pos, count - 1, pos + 1)
            enter (v, pos)
        ensure
            new_count: count = old count + 1
            index_unchanged: index = old index
            insertion_done: i_th (pos) = v
        end

invariant

    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_LIST [G]

General
    cluster: base.structures.list
    description: "Lists implemented by resizable arrays"
    create: make_from_array, make_filled, make

Ancestors
    ARRAY [G]
    DYNAMIC_LIST [G]

Queries
    infix "@" (i: INTEGER): G
    after: BOOLEAN
    before: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] ARRAYED_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (n: INTEGER)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [G])
    merge_left (other: ARRAYED_LIST [G])
    merge_right (other: ARRAYED_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like first] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    prunable
    starts from one
    empty means storage empty

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists implemented by resizable arrays"
    status: "See notice at end of class"
    names: sequence
    representation: array
    access: index, cursor, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_LIST [G]

create
    make,
    make_filled,
    make_from_array

feature -- Initialization

    make (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
        require
            valid_number_of_items: n >= 0
        do
            index := 0
            count := 0
            array_make (1, n)
        ensure
            correct_position: before
        end

    make_filled (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
        require
            valid_number_of_items: n >= 0
        do
            index := 0
            count := n
            array_make (1, n)
        ensure
            correct_position: before
            filled: full
        end

    make_from_array (a: ARRAY [G]) is
            -- Create list from array a.
        require -- from ARRAY
            array_exists: a /= void
        do
            Precursor  (a)
            lower := 1
            count := a.count
            upper := count
            index := 0
        end

feature {ARRAYED_LIST} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

feature {NONE} -- Initialization

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
        do
            create {ARRAYED_LIST_CURSOR} Result.make (index)
        end

    first: G is
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (0)
        end

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (i_th (i) /= void and then i_th (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (i_th (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER
            -- Index of item, if valid.

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: like first is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else
            index_is_valid: valid_index (index)
        do
            Result := area.item (index - 1)
        end

    i_th (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

    last: like first is
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (count - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature {NONE} -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            Result := i_th (i)
        end

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items.

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    array_count: INTEGER is
            -- Number of available indices
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    array_index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature  -- Measurement

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN is
            -- Is structure filled to capacity?
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
        do
            check
                put_constraint: (v /= last) implies not off
            end
            Result := (v = last) or else (v = item)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            if al_c /= void then
                Result := valid_cursor_index (al_c.index)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
        do
            Result := (1 <= i) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((i_th (upper) = void or else i_th (upper) = i_th (upper).default) and subarray (lower, upper - 1).all_default))
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (i_th (upper) = other.i_th (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    array_valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = count
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor one position backward.
        require -- from BILINEAR
            not_before: not before
        do
            index := index - 1
        end

    finish is
            -- Move cursor to last position if any.
        do
            index := count
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then
            before_when_empty: is_empty implies before
        end

    forth is
            -- Move cursor one position forward.
        require -- from LINEAR
            not_after: not after
        do
            index := index + 1
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            index := i
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            check
                al_c /= void
            end
            index := al_c.index
        end

    move (i: INTEGER) is
            -- Move cursor i positions.
        do
            index := index + i
            if (index > count + 1) then
                index := count + 1
            elseif (index < 0) then
                index := 0
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position if any.
        do
            index := 1
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then
            after_when_empty: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
        require -- from COLLECTION
            extendible: extendible
        do
            count := count + 1
            force_i_th (v, count)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
        require -- from SEQUENCE
            extendible: extendible
        do
            count := count + 1
            force_i_th (v, count)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure before cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            old_index: INTEGER
            old_other_count: INTEGER
        do
            old_index := index
            old_other_count := other.count
            index := index - 1
            merge_right (other)
            index := old_index + old_other_count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure after cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if not other.is_empty then
                resize (1, count + other.count)
                if index < count then
                    subcopy (Current, index + 1, count, index + other.count + 1)
                end
                subcopy (other, 1, other.count, index + 1)
                count := count + other.count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_front (v: like item) is
            -- Add v to the beginning.
            -- Do not move cursor.
        do
            if is_empty then
                extend (v)
            else
                insert (v, 1)
            end
            index := index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_left (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        do
            if after or is_empty then
                extend (v)
            else
                insert (v, index)
            end
            index := index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            if index = count then
                extend (v)
            else
                insert (v, index + 1)
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: like first) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        do
            put_i_th (v, index)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    enter (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            area.put (v, i - lower)
        end

    force_i_th (v: like i_th; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature {ARRAYED_LIST} -- Element change

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.array_valid_index (start_pos)
            valid_end_pos: other.array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: array_valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
        require -- from COLLECTION
            prunable: prunable
        do
            if before then
                index := 1
            end
            if object_comparison then
                if v /= void then
                    from
                    until
                        after or else (item /= void and then v.is_equal (item))
                    loop
                        forth
                    end
                end
            else
                from
                until
                    after or else item = v
                loop
                    forth
                end
            end
            if not after then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require -- from COLLECTION
            prunable
        local
            i: INTEGER
            offset: INTEGER
            res: BOOLEAN
            obj_cmp: BOOLEAN
            default_val: like item
        do
            obj_cmp := object_comparison
            from
                i := 1
            until
                i > count
            loop
                if i <= count - offset then
                    if offset > 0 then
                        put_i_th (i_th (i + offset), i)
                    end
                    if obj_cmp then
                        res := equal (v, i_th (i))
                    else
                        res := (v = i_th (i))
                    end
                    if res then
                        offset := offset + 1
                    else
                        i := i + 1
                    end
                else
                    put_i_th (default_val, i)
                    i := i + 1
                end
            end
            count := count - offset
            index := count + 1
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then
            is_after: after
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            default_value: G
        do
            if index < count then
                subcopy (Current, index + 1, count, index)
            end
            count := count - 1
            area.put (default_value, count)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then
            index: index = old index
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            index := index - 1
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position
            -- Do not move cursor
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            index := index + 1
            remove
            index := index - 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            count := 0
            index := 0
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        local
            old_item: like item
        do
            old_item := item
            replace (area.item (i - 1))
            area.put (old_item, i - 1)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature {NONE} -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            end_pos: INTEGER
        do
            if after then
                create Result.make (0)
            else
                end_pos := count.min (index + n - 1)
                create Result.make_filled (end_pos - index + 1)
                Result.subcopy (Current, index, end_pos, 1)
            end
        end

feature {NONE} -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: array_valid_index (start_pos)
            valid_end_pos: array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    new_chain: like Current is
            -- Unused
        do
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    insert (v: like item; pos: INTEGER) is
            -- Add v at pos, moving subsequent items
            -- to the right.
        require
            index_small_enough: pos <= count
            index_large_enough: pos >= 1
        do
            if count + 1 > capacity then
                auto_resize (lower, count + 1)
            end
            count := count + 1
            subcopy (Current, pos, count - 1, pos + 1)
            enter (v, pos)
        ensure
            new_count: count = old count + 1
            index_unchanged: index = old index
            insertion_done: i_th (pos) = v
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists implemented by resizable arrays"
    status: "See notice at end of class"
    names: sequence
    representation: array
    access: index, cursor, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_LIST [G]

create

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [G])
            -- Create list from array a.
        require -- from ARRAY
            array_exists: a /= void

feature -- Initialization

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [G])
            -- Create list from array a.
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [G])
            -- Merge other into current structure before cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [G])
            -- Merge other into current structure after cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_LIST [G]

Ancestors
    ARRAY [G]
    DYNAMIC_LIST [G]

Descendants
    ARRAYED_SET [G]
    ARRAYED_STACK [G]
    ARRAYED_TREE [G]

Clients
    ARRAY [G]
    ARRAYED_CIRCULAR [G]
    ARRAYED_LIST [G]
    ARRAYED_QUEUE [G]
    ARRAYED_STACK [G]
    BINARY_TREE [G]
    BOUNDED_QUEUE [G]
    BOUNDED_STACK [G]
    DIRECTORY
    HASH_TABLE [G, H -> HASHABLE]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    LINKED_QUEUE [G]
    LINKED_STACK [G]
    MULTI_ARRAY_LIST [G]
    STRING
    TREE [G]

Suppliers
    ANY
    ARRAY [G]
    ARRAYED_LIST [G]
    ARRAYED_LIST_CURSOR
    BOOLEAN
    INTEGER
    SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists implemented by resizable arrays"
    status: "See notice at end of class"
    names: sequence
    representation: array
    access: index, cursor, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_LIST [G]

create
    make,
    make_filled,
    make_from_array

feature -- Initialization

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [G])
            -- Create list from array a.

feature -- Access

    item: like first
            -- Current item
        require else
            index_is_valid: valid_index (index)

    first: G
            -- Item at first position

    last: like first
            -- Item at last position

    index: INTEGER
            -- Index of item, if valid.

    cursor: CURSOR
            -- Current cursor position

feature -- Measurement

    count: INTEGER
            -- Number of items.

feature -- Status report

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    full: BOOLEAN
            -- Is structure filled to capacity?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?

feature -- Cursor movement

    move (i: INTEGER)
            -- Move cursor i positions.

    start
            -- Move cursor to first position if any.
        ensure then
            after_when_empty: is_empty implies after

    finish
            -- Move cursor to last position if any.
        ensure then
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.

    back
            -- Move cursor one position backward.

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.

    go_to (p: CURSOR)
            -- Move cursor to position p.

feature -- Element change

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.

    replace (v: like first)
            -- Replace current item by v.

    merge_left (other: ARRAYED_LIST [G])
            -- Merge other into current structure before cursor.

    merge_right (other: ARRAYED_LIST [G])
            -- Merge other into current structure after cursor.

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        ensure then
            index: index = old index

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure then
            is_after: after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor

    wipe_out
            -- Remove all items.

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.

invariant

    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BI_LINKABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells with a reference to the left and right neighbors"
    status: "See notice at end of class"
    names: bi_linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    BI_LINKABLE [G]

inherit
    LINKABLE [G]
        redefine
            put_right,
            forget_right
        end

feature -- Access

    left: like Current
            -- Left neighbor

feature {CELL, CHAIN} -- Implementation

    put_right (other: like Current) is
            -- Put other to the right of current cell.
        do
            if right /= void then
                right.simple_forget_left
            end
            right := other
            if (other /= void) then
                other.simple_put_left (Current)
            end
        end

    put_left (other: like Current) is
            -- Put other to the left of current cell.
        do
            if left /= void then
                left.simple_forget_right
            end
            left := other
            if (other /= void) then
                other.simple_put_right (Current)
            end
        ensure
            chained: left = other
        end

    forget_right is
            -- Remove links with right neighbor.
        do
            if right /= void then
                right.simple_forget_left
                right := void
            end
        ensure then
            right_not_chained: (old right /= void) implies ((old right).left = void)
        end

    forget_left is
            -- Remove links with left neighbor.
        do
            if left /= void then
                left.simple_forget_right
                left := void
            end
        ensure
            left_not_chained: left = void or else (old left /= void) implies ((old left).right = void)
        end

feature {BI_LINKABLE, TWO_WAY_LIST} -- Implementation

    simple_put_right (other: like Current) is
            -- set right to other
        do
            if right /= void then
                right.simple_forget_left
            end
            right := other
        end

    simple_put_left (other: like Current) is
            -- set left to other is
        do
            if left /= void then
                left.simple_forget_right
            end
            left := other
        end

    simple_forget_right is
            -- Remove right link (do nothing to right neighbor).
        do
            right := void
        end

    simple_forget_left is
            -- Remove left link (do nothing to left neighbor).
        do
            left := void
        ensure
            not_chained: left = void
        end

invariant

    right_symmetry: (right /= void) implies (right.left = Current)
    left_symmetry: (left /= void) implies (left.right = Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BI_LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BI_LINKABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BI_LINKABLE [G]

General
    cluster: base.structures.list
    description: "Linkable cells with a reference to the left and right neighbors"

Ancestors
    LINKABLE [G]

Queries
    item: G
    left: [like Current] BI_LINKABLE [G]
    right: [like Current] BI_LINKABLE [G]

Commands
    replace (v: [like item] G)

Constraints
    right symmetry
    left symmetry

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BI_LINKABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells with a reference to the left and right neighbors"
    status: "See notice at end of class"
    names: bi_linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    BI_LINKABLE [G]

feature -- Access

    left: like Current
            -- Left neighbor

    right: like Current
            -- Right neighbor
            -- (from LINKABLE)

feature  -- Access

    item: G
            -- Content of cell.
            -- (from CELL)

feature {CELL, CHAIN} -- Element change

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        do
            item := v
        ensure -- from CELL
            item_inserted: item = v
        end

feature -- Element change

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        do
            item := v
        ensure -- from CELL
            item_inserted: item = v
        end

feature {CELL, CHAIN} -- Implementation

    forget_left is
            -- Remove links with left neighbor.
        do
            if left /= void then
                left.simple_forget_right
                left := void
            end
        ensure
            left_not_chained: left = void or else (old left /= void) implies ((old left).right = void)
        end

    forget_right is
            -- Remove links with right neighbor.
        do
            if right /= void then
                right.simple_forget_left
                right := void
            end
        ensure -- from LINKABLE
            not_chained: right = void
        ensure then
            right_not_chained: (old right /= void) implies ((old right).left = void)
        end

    put_left (other: like Current) is
            -- Put other to the left of current cell.
        do
            if left /= void then
                left.simple_forget_right
            end
            left := other
            if (other /= void) then
                other.simple_put_right (Current)
            end
        ensure
            chained: left = other
        end

    put_right (other: like Current) is
            -- Put other to the right of current cell.
        do
            if right /= void then
                right.simple_forget_left
            end
            right := other
            if (other /= void) then
                other.simple_put_left (Current)
            end
        ensure -- from LINKABLE
            chained: right = other
        end

feature {BI_LINKABLE, TWO_WAY_LIST} -- Implementation

    simple_forget_left is
            -- Remove left link (do nothing to left neighbor).
        do
            left := void
        ensure
            not_chained: left = void
        end

    simple_forget_right is
            -- Remove right link (do nothing to right neighbor).
        do
            right := void
        end

    simple_put_left (other: like Current) is
            -- set left to other is
        do
            if left /= void then
                left.simple_forget_right
            end
            left := other
        end

    simple_put_right (other: like Current) is
            -- set right to other
        do
            if right /= void then
                right.simple_forget_left
            end
            right := other
        end

invariant

    right_symmetry: (right /= void) implies (right.left = Current)
    left_symmetry: (left /= void) implies (left.right = Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BI_LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BI_LINKABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells with a reference to the left and right neighbors"
    status: "See notice at end of class"
    names: bi_linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    BI_LINKABLE [G]

feature -- Access

    left: like Current
            -- Left neighbor

    right: like Current
            -- Right neighbor
            -- (from LINKABLE)

feature  -- Access

    item: G
            -- Content of cell.
            -- (from CELL)

feature -- Element change

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        ensure -- from CELL
            item_inserted: item = v

invariant

    right_symmetry: (right /= void) implies (right.left = Current)
    left_symmetry: (left /= void) implies (left.right = Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BI_LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BI_LINKABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BI_LINKABLE [G]

Ancestors
    LINKABLE [G]

Descendants
    TWO_WAY_TREE [G]

Clients
    BI_LINKABLE [G]
    MULTI_ARRAY_LIST [G]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
    TWO_WAY_LIST [G]

Suppliers
    BI_LINKABLE [G]
    BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BI_LINKABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells with a reference to the left and right neighbors"
    status: "See notice at end of class"
    names: bi_linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    BI_LINKABLE [G]

feature -- Access

    left: like Current
            -- Left neighbor

invariant

    right_symmetry: (right /= void) implies (right.left = Current)
    left_symmetry: (left /= void) implies (left.right = Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BI_LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CELL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cells containing an item"
    status: "See notice at end of class"
    names: cell
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    CELL [G]

create
    put

feature -- Access

    item: G
            -- Content of cell.

feature -- Element change

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
        do
            item := v
        ensure
            item_inserted: item = v
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
        do
            item := v
        ensure
            item_inserted: item = v
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CELL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CELL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CELL [G]

General
    cluster: base.structures.list
    description: "Cells containing an item"
    create: put

Ancestors
    ANY

Queries
    item: G

Commands
    put (v: [like item] G)
    replace (v: [like item] G)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CELL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cells containing an item"
    status: "See notice at end of class"
    names: cell
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class
    CELL [G]

create
    put

feature -- Access

    item: G
            -- Content of cell.

feature -- Element change

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
        do
            item := v
        ensure
            item_inserted: item = v
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
        do
            item := v
        ensure
            item_inserted: item = v
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CELL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CELL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cells containing an item"
    status: "See notice at end of class"
    names: cell
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    CELL [G]

create

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
        ensure
            item_inserted: item = v

feature -- Access

    item: G
            -- Content of cell.

feature -- Element change

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
        ensure
            item_inserted: item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
        ensure
            item_inserted: item = v

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CELL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CELL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    CELL [G]

Ancestors
    ANY

Descendants
    ARRAYED_TREE [G]
    BINARY_TREE [G]
    FIXED_TREE [G]
    LINKABLE [G]

Clients
    CELL [G]

Suppliers
    CELL [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CELL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Cells containing an item"
    status: "See notice at end of class"
    names: cell
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

class interface
    CELL [G]

create
    put

feature -- Access

    item: G
            -- Content of cell.

feature -- Element change

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
        ensure
            item_inserted: item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
        ensure
            item_inserted: item = v

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CELL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHAIN Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Possibly circular sequences of items,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    CHAIN [G]

inherit
    CURSOR_STRUCTURE [G]
        undefine
            prune_all
        select
            put
        end

    INDEXABLE [G, INTEGER]
        rename
            item as i_th,
            put as put_i_th
        undefine
            prune_all
        end

    SEQUENCE [G]
        rename
            put as sequence_put
        export
            {NONE} sequence_put
        redefine
            index_of,
            has,
            off,
            occurrences
        select
            index_of,
            has,
            occurrences
        end

    SEQUENCE [G]
        rename
            put as sequence_put,
            index_of as sequential_index_of,
            has as sequential_has,
            occurrences as sequential_occurrences
        export
            {NONE} sequential_index_of, sequential_has, sequence_put
        redefine
            off
        end

feature -- Access

    first: like item is
            -- Item at first position
        require
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    last: like item is
            -- Item at last position
        require
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            finish
            Result := item
            go_to (pos)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index
        deferred
        end

feature -- Measurement

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure then
            count_definition: Result.count = count
        end

feature -- Cursor movement

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then
            at_first: not is_empty implies isfirst
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then
            at_last: not is_empty implies islast
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
        local
            counter, pos, final: INTEGER
        do
            if i > 0 then
                from
                until
                    (counter = i) or else off
                loop
                    forth
                    counter := counter + 1
                end
            elseif i < 0 then
                final := index + i;
                if final <= 0 then
                    start;
                    back
                else
                    from
                        start
                        pos := 1
                    until
                        pos = final
                    loop
                        forth
                        pos := pos + 1
                    end
                end
            end
        ensure
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        require
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure
            position_expected: index = i
        end

feature -- Status report

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
        do
            Result := (i >= 1) and (i <= count)
        ensure then
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
        do
            Result := not is_empty and (index = 1)
        ensure
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
        do
            Result := not is_empty and (index = count)
        ensure
            valid_position: Result implies not is_empty
        end

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := (index = 0) or (index = count + 1)
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

feature -- Element change

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
        do
            replace (v)
        ensure then
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
        require
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        deferred
        end

feature {NONE} -- Inapplicable

    remove is
            -- Remove current item.
        do
        end

invariant

    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHAIN Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CHAIN [G]

General
    cluster: base.structures.list
    description:
        "Possibly circular sequences of items,
        without commitment to a particular representation"

Ancestors
    CURSOR_STRUCTURE [G]
    INDEXABLE [G, H -> INTEGER]
    SEQUENCE [G]
    SEQUENCE [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] CHAIN [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    non negative index
    index small enough
    off definition
    isfirst definition
    islast definition
    item corresponds to index
    index set has same count

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHAIN Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Possibly circular sequences of items,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    CHAIN [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: like item is
            -- Item at first position
        require
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like item is
            -- Item at last position
        require
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            finish
            Result := item
            go_to (pos)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)
        deferred
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
        do
            Result := not is_empty and (index = 1)
        ensure
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
        do
            Result := not is_empty and (index = count)
        ensure
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)
        deferred
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then
            at_last: not is_empty implies islast
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        require
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
        local
            counter, pos, final: INTEGER
        do
            if i > 0 then
                from
                until
                    (counter = i) or else off
                loop
                    forth
                    counter := counter + 1
                end
            elseif i < 0 then
                final := index + i;
                if final <= 0 then
                    start;
                    back
                else
                    from
                        start
                        pos := 1
                    until
                        pos = final
                    loop
                        forth
                        pos := pos + 1
                    end
                end
            end
        ensure
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
        require
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove current item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHAIN Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Possibly circular sequences of items,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CHAIN [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
        require
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
        require
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
        ensure
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
        ensure
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
        ensure
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
        ensure then
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require
            valid_cursor_index: valid_cursor_index (i)
        ensure
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
        ensure
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
        ensure then
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
        require
            not_off: not off
            valid_index: valid_index (i)
        ensure
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHAIN Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CHAIN [G]

Ancestors
    CURSOR_STRUCTURE [G]
    INDEXABLE [G, H -> INTEGER]
    SEQUENCE [G]
    SEQUENCE [G]

Descendants
    CIRCULAR [G]
    DYNAMIC_CHAIN [G]
    LIST [G]

Clients
    CHAIN [G]
    TWO_WAY_CHAIN_ITERATOR [G]

Suppliers
    BOOLEAN
    CHAIN [G]
    INTEGER
    INTEGER_INTERVAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CHAIN Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Possibly circular sequences of items,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CHAIN [G]

feature -- Access

    first: like item
            -- Item at first position
        require
            not_empty: not is_empty

    last: like item
            -- Item at last position
        require
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.

    index: INTEGER
            -- Current cursor index

feature -- Measurement

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure then
            count_definition: Result.count = count

feature -- Cursor movement

    start
            -- Move cursor to first position.
            -- (No effect if empty)
        ensure then
            at_first: not is_empty implies isfirst

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
        ensure then
            at_last: not is_empty implies islast

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
        ensure
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require
            valid_cursor_index: valid_cursor_index (i)
        ensure
            position_expected: index = i

feature -- Status report

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
        ensure then
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    isfirst: BOOLEAN
            -- Is cursor at first position?
        ensure
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
        ensure
            valid_position: Result implies not is_empty

    off: BOOLEAN
            -- Is there no current item?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
        ensure
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

feature -- Element change

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
        ensure then
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
        require
            not_off: not off
            valid_index: valid_index (i)
        ensure
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

invariant

    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains, without commitment to a particular representation"
    status: "See notice at end of class"
    names: circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    CIRCULAR [G]

inherit
    CHAIN [G]
        redefine
            remove,
            forth,
            back,
            before,
            after,
            off,
            move,
            go_i_th,
            valid_cursor_index,
            exhausted,
            first,
            last,
            index
        end

feature -- Access

    first: G is
            -- Item at position currently defined as first
        local
            pos: INTEGER
        do
            pos := standard_index
            start
            Result := item
            move (pos - 1)
        end

    index: INTEGER is
            -- Current cursor index, with respect to position
            -- currently defined as first
        local
            first_ind, std_ind: INTEGER
            p: CURSOR
        do
            p := cursor
            std_ind := standard_index
            start
            first_ind := standard_index
            Result := std_ind - first_ind + 1
            if Result < 0 then
                Result := count + Result
            end
            move (Result - 1)
            go_to (p)
        end

    last: like first is
            -- Item at position currently defined as last
        local
            pos: INTEGER
        do
            pos := standard_index
            finish
            Result := item
            start
            move (pos - 1)
        end

feature -- Status report

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i a possible cursor position?
        do
            Result := (i >= 0) and (i <= count)
        ensure then
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))
        end

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := is_empty and standard_after
        ensure then
            empty_and_std_after: Result = (is_empty and standard_after)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := is_empty and standard_before
        ensure then
            empty_and_std_before: Result = (is_empty and standard_before)
        end

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := is_empty
        ensure then
            only_when_empty: Result = is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
        do
            Result := is_empty or internal_exhausted
        end

feature -- Cursor movement

    forth is
            -- Move cursor to next item, cyclically.
        do
            if islast then
                internal_exhausted := True
            end
            standard_forth
            if standard_after then
                standard_start
            end
        ensure then
            moved_forth_at_end: (old index = count) implies (index = 1)
        end

    back is
            -- Move cursor to previous item, cyclically.
        do
            if isfirst then
                internal_exhausted := True
            end
            standard_back
            if standard_before then
                standard_finish
            end
        end

    move (i: INTEGER) is
            -- Move cursor to i-th item from current position,
            -- cyclically.
        local
            real_move, counter, start_index: INTEGER
        do
            if i /= 0 and count > 0 then
                start_index := index
                real_move := i \\ count
                if real_move < 0 then
                    real_move := count + real_move
                end
                from
                until
                    counter = real_move
                loop
                    forth
                    counter := counter + 1
                end
                if (start_index + i > count) or (start_index + i < 1) then
                    internal_exhausted := True
                end
            end
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position from current start, cyclically.
        require else
            index_big_enough: i >= 1
            not_empty: not is_empty
        do
            start
            move (i - 1)
        end

    set_start is
            -- Define current position as the first.
        require
            not_empty: not is_empty
        deferred
        end

feature -- Removal

    remove is
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
        do
            fix_start_for_remove
            standard_remove
            if standard_after then
                finish
            elseif standard_before then
                start
            end
        end

feature {CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
        deferred
        end

    internal_exhausted: BOOLEAN
            -- Has last forth or back operation exhausted the structure?

    standard_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (Non-cyclically)
        deferred
        end

    standard_back is
            -- Move cursor to previous element, non-cyclically.
        deferred
        end

    standard_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (Non-cyclically)
        deferred
        end

    standard_finish is
            -- Move cursor to last element.
        deferred
        end

    standard_forth is
            -- Move cursor to next element, non-cyclically.
        deferred
        end

    standard_isfirst: BOOLEAN is
            -- Is cursor at first position, non-cyclically?
        deferred
        end

    standard_islast: BOOLEAN is
            -- Is cursor at last position, non-cyclically?
        deferred
        end

    standard_move (i: INTEGER) is
            -- Move cursor to i-th element, non-cyclically.
        deferred
        end

    standard_go_i_th (i: INTEGER) is
            -- Move cursor to i-th element, non-cyclically.
        deferred
        end

    standard_index: INTEGER is
            -- Current cursor index, non-cyclically
        deferred
        end

    standard_remove is
            -- Remove, non-cyclically.
        deferred
        end

    standard_search (v: like first) is
            -- Search non-cyclically.
        deferred
        end

    standard_start is
            -- Move cursor to first element.
        deferred
        end

invariant

    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains, without commitment to a particular representation"

Ancestors
    CHAIN [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] CIRCULAR [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    not before unless empty
    not after unless empty
    not off unless empty

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains, without commitment to a particular representation"
    status: "See notice at end of class"
    names: circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    CIRCULAR [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: G is
            -- Item at position currently defined as first
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            start
            Result := item
            move (pos - 1)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index, with respect to position
            -- currently defined as first
        local
            first_ind, std_ind: INTEGER
            p: CURSOR
        do
            p := cursor
            std_ind := standard_index
            start
            first_ind := standard_index
            Result := std_ind - first_ind + 1
            if Result < 0 then
                Result := count + Result
            end
            move (Result - 1)
            go_to (p)
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like first is
            -- Item at position currently defined as last
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            finish
            Result := item
            start
            move (pos - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := is_empty and standard_after
        ensure then
            empty_and_std_after: Result = (is_empty and standard_after)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := is_empty and standard_before
        ensure then
            empty_and_std_before: Result = (is_empty and standard_before)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
        do
            Result := is_empty or internal_exhausted
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := is_empty
        ensure then
            only_when_empty: Result = is_empty
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i a possible cursor position?
        do
            Result := (i >= 0) and (i <= count)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous item, cyclically.
        require -- from BILINEAR
            not_before: not before
        do
            if isfirst then
                internal_exhausted := True
            end
            standard_back
            if standard_before then
                standard_finish
            end
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move cursor to next item, cyclically.
        require -- from LINEAR
            not_after: not after
        do
            if islast then
                internal_exhausted := True
            end
            standard_forth
            if standard_after then
                standard_start
            end
        ensure then
            moved_forth_at_end: (old index = count) implies (index = 1)
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position from current start, cyclically.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else
            index_big_enough: i >= 1
            not_empty: not is_empty
        do
            start
            move (i - 1)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor to i-th item from current position,
            -- cyclically.
        local
            real_move, counter, start_index: INTEGER
        do
            if i /= 0 and count > 0 then
                start_index := index
                real_move := i \\ count
                if real_move < 0 then
                    real_move := count + real_move
                end
                from
                until
                    counter = real_move
                loop
                    forth
                    counter := counter + 1
                end
                if (start_index + i > count) or (start_index + i < 1) then
                    internal_exhausted := True
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    set_start is
            -- Define current position as the first.
        require
            not_empty: not is_empty
        deferred
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            fix_start_for_remove
            standard_remove
            if standard_after then
                finish
            elseif standard_before then
                start
            end
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
        deferred
        end

    internal_exhausted: BOOLEAN
            -- Has last forth or back operation exhausted the structure?

    standard_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (Non-cyclically)
        deferred
        end

    standard_back is
            -- Move cursor to previous element, non-cyclically.
        deferred
        end

    standard_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (Non-cyclically)
        deferred
        end

    standard_finish is
            -- Move cursor to last element.
        deferred
        end

    standard_forth is
            -- Move cursor to next element, non-cyclically.
        deferred
        end

    standard_go_i_th (i: INTEGER) is
            -- Move cursor to i-th element, non-cyclically.
        deferred
        end

    standard_index: INTEGER is
            -- Current cursor index, non-cyclically
        deferred
        end

    standard_isfirst: BOOLEAN is
            -- Is cursor at first position, non-cyclically?
        deferred
        end

    standard_islast: BOOLEAN is
            -- Is cursor at last position, non-cyclically?
        deferred
        end

    standard_move (i: INTEGER) is
            -- Move cursor to i-th element, non-cyclically.
        deferred
        end

    standard_remove is
            -- Remove, non-cyclically.
        deferred
        end

    standard_search (v: like first) is
            -- Search non-cyclically.
        deferred
        end

    standard_start is
            -- Move cursor to first element.
        deferred
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains, without commitment to a particular representation"
    status: "See notice at end of class"
    names: circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CIRCULAR [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: G
            -- Item at position currently defined as first
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
        ensure then
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
        ensure then
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
        ensure then
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
        require -- from LINEAR
            not_after: not after
        ensure then
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Define current position as the first.
        require
            not_empty: not is_empty

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    CIRCULAR [G]

Ancestors
    CHAIN [G]

Descendants
    DYNAMIC_CIRCULAR [G]

Clients
    CIRCULAR [G]

Suppliers
    BOOLEAN
    CIRCULAR [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


CIRCULAR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains, without commitment to a particular representation"
    status: "See notice at end of class"
    names: circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CIRCULAR [G]

feature -- Access

    first: G
            -- Item at position currently defined as first

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first

    last: like first
            -- Item at position currently defined as last

feature -- Status report

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
        ensure then
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
        ensure then
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
        ensure then
            empty_and_std_before: Result = (is_empty and standard_before)

    off: BOOLEAN
            -- Is there no current item?
        ensure then
            only_when_empty: Result = is_empty

    exhausted: BOOLEAN
            -- Has structure been completely explored?

feature -- Cursor movement

    forth
            -- Move cursor to next item, cyclically.
        ensure then
            moved_forth_at_end: (old index = count) implies (index = 1)

    back
            -- Move cursor to previous item, cyclically.

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
        require else
            index_big_enough: i >= 1
            not_empty: not is_empty

    set_start
            -- Define current position as the first.
        require
            not_empty: not is_empty

feature -- Removal

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.

invariant

    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.list

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


DYNAMIC_CHAIN Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable chains"
    status: "See notice at end of class"
    names: dynamic_chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_CHAIN [G]

inherit
    CHAIN [G]
        export
            {ANY} remove, prune_all, prune
        undefine
            remove,
            prune_all,
            prune
        end

    UNBOUNDED [G]

feature -- Status report

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

feature -- Element change

    put_front (v: like item) is
            -- Add v at beginning.
            -- Do not move cursor.
        deferred
        ensure
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_before: not before
        deferred
        ensure
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_after: not after
        deferred
        ensure
            new_count: count = old count + 1
            same_index: index = old index
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        deferred
        ensure
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        deferred
        ensure
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            left_exists: index > 1
        deferred
        ensure
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            right_exists: index < count
        deferred
        ensure
            new_count: count = old count - 1
            same_index: index = old index
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure then
            is_exhausted: exhausted
        end

    wipe_out is
            -- Remove all items.
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {DYNAMIC_CHAIN} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        deferred
        ensure
            result_exists: Result /= void
        end

invariant

    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CHAIN Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_CHAIN [G]

General
    cluster: base.structures.list
    description: "Dynamically modifiable chains"

Ancestors
    CHAIN [G]
    UNBOUNDED [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] DYNAMIC_CHAIN [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] DYNAMIC_CHAIN [G])
    merge_right (other: [like Current] DYNAMIC_CHAIN [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    extendible

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CHAIN Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable chains"
    status: "See notice at end of class"
    names: dynamic_chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_CHAIN [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index
            -- (from CHAIN)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like item is
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            finish
            Result := item
            go_to (pos)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)
        deferred
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)
        deferred
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        local
            counter, pos, final: INTEGER
        do
            if i > 0 then
                from
                until
                    (counter = i) or else off
                loop
                    forth
                    counter := counter + 1
                end
            elseif i < 0 then
                final := index + i;
                if final <= 0 then
                    start;
                    back
                else
                    from
                        start
                        pos := 1
                    until
                        pos = final
                    loop
                        forth
                        pos := pos + 1
                    end
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        deferred
        ensure
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        deferred
        ensure
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v at beginning.
            -- Do not move cursor.
        deferred
        ensure
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_before: not before
        deferred
        ensure
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_after: not after
        deferred
        ensure
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then
            is_exhausted: exhausted
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            left_exists: index > 1
        deferred
        ensure
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            right_exists: index < count
        deferred
        ensure
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature  -- Inapplicable

    remove is
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {DYNAMIC_CHAIN} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        deferred
        ensure
            result_exists: Result /= void
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    extendible: extendible
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CHAIN Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable chains"
    status: "See notice at end of class"
    names: dynamic_chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_CHAIN [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning.
            -- Do not move cursor.
        ensure
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_before: not before
        ensure
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_after: not after
        ensure
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            left_exists: index > 1
        ensure
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            right_exists: index < count
        ensure
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature  -- Inapplicable

    remove
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    extendible: extendible
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CHAIN Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_CHAIN [G]

Ancestors
    CHAIN [G]
    UNBOUNDED [G]

Descendants
    DYNAMIC_CIRCULAR [G]
    DYNAMIC_LIST [G]

Clients
    DYNAMIC_CHAIN [G]

Suppliers
    BOOLEAN
    DYNAMIC_CHAIN [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CHAIN Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable chains"
    status: "See notice at end of class"
    names: dynamic_chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_CHAIN [G]

feature -- Status report

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

feature -- Element change

    put_front (v: like item)
            -- Add v at beginning.
            -- Do not move cursor.
        ensure
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_before: not before
        ensure
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_after: not after
        ensure
            new_count: count = old count + 1
            same_index: index = old index

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            left_exists: index > 1
        ensure
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            right_exists: index < count
        ensure
            new_count: count = old count - 1
            same_index: index = old index

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
        ensure then
            is_exhausted: exhausted

    wipe_out
            -- Remove all items.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.

invariant

    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CHAIN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CIRCULAR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable circular chains"
    status: "See notice at end of class"
    names: dynamic_circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_CIRCULAR [G]

inherit
    CIRCULAR [G]
        undefine
            prune,
            prune_all
        end

    DYNAMIC_CHAIN [G]
        undefine
            valid_cursor_index,
            search,
            first,
            last,
            finish,
            start,
            move,
            go_i_th,
            off,
            exhausted
        redefine
            duplicate
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
        local
            pos: CURSOR
            to_be_removed, counter: INTEGER
        do
            from
                Result := new_chain
                pos := cursor
                to_be_removed := count.min (n)
            until
                counter = to_be_removed
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CIRCULAR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Dynamically modifiable circular chains"

Ancestors
    CIRCULAR [G]
    DYNAMIC_CHAIN [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] DYNAMIC_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] DYNAMIC_CIRCULAR [G])
    merge_right (other: [like Current] DYNAMIC_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CIRCULAR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable circular chains"
    status: "See notice at end of class"
    names: dynamic_circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_CIRCULAR [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: G is
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            start
            Result := item
            move (pos - 1)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)
        local
            first_ind, std_ind: INTEGER
            p: CURSOR
        do
            p := cursor
            std_ind := standard_index
            start
            first_ind := standard_index
            Result := std_ind - first_ind + 1
            if Result < 0 then
                Result := count + Result
            end
            move (Result - 1)
            go_to (p)
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like first is
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            finish
            Result := item
            start
            move (pos - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_after
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_before
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        do
            Result := is_empty or internal_exhausted
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CIRCULAR)
        do
            Result := is_empty
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        do
            Result := (i >= 0) and (i <= count)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before
        do
            if isfirst then
                internal_exhausted := True
            end
            standard_back
            if standard_before then
                standard_finish
            end
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        do
            if islast then
                internal_exhausted := True
            end
            standard_forth
            if standard_after then
                standard_start
            end
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        do
            start
            move (i - 1)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        local
            real_move, counter, start_index: INTEGER
        do
            if i /= 0 and count > 0 then
                start_index := index
                real_move := i \\ count
                if real_move < 0 then
                    real_move := count + real_move
                end
                from
                until
                    counter = real_move
                loop
                    forth
                    counter := counter + 1
                end
                if (start_index + i > count) or (start_index + i < 1) then
                    internal_exhausted := True
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    set_start is
            -- Define current position as the first.
            -- (from CIRCULAR)
        require -- from CIRCULAR
            not_empty: not is_empty
        deferred
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v at beginning.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            fix_start_for_remove
            standard_remove
            if standard_after then
                finish
            elseif standard_before then
                start
            end
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            to_be_removed, counter: INTEGER
        do
            from
                Result := new_chain
                pos := cursor
                to_be_removed := count.min (n)
            until
                counter = to_be_removed
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
            -- (from CIRCULAR)
        deferred
        end

    internal_exhausted: BOOLEAN
            -- Has last forth or back operation exhausted the structure?
            -- (from CIRCULAR)

    standard_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (Non-cyclically)
            -- (from CIRCULAR)
        deferred
        end

    standard_back is
            -- Move cursor to previous element, non-cyclically.
            -- (from CIRCULAR)
        deferred
        end

    standard_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (Non-cyclically)
            -- (from CIRCULAR)
        deferred
        end

    standard_finish is
            -- Move cursor to last element.
            -- (from CIRCULAR)
        deferred
        end

    standard_forth is
            -- Move cursor to next element, non-cyclically.
            -- (from CIRCULAR)
        deferred
        end

    standard_go_i_th (i: INTEGER) is
            -- Move cursor to i-th element, non-cyclically.
            -- (from CIRCULAR)
        deferred
        end

    standard_index: INTEGER is
            -- Current cursor index, non-cyclically
            -- (from CIRCULAR)
        deferred
        end

    standard_isfirst: BOOLEAN is
            -- Is cursor at first position, non-cyclically?
            -- (from CIRCULAR)
        deferred
        end

    standard_islast: BOOLEAN is
            -- Is cursor at last position, non-cyclically?
            -- (from CIRCULAR)
        deferred
        end

    standard_move (i: INTEGER) is
            -- Move cursor to i-th element, non-cyclically.
            -- (from CIRCULAR)
        deferred
        end

    standard_remove is
            -- Remove, non-cyclically.
            -- (from CIRCULAR)
        deferred
        end

    standard_search (v: like first) is
            -- Search non-cyclically.
            -- (from CIRCULAR)
        deferred
        end

    standard_start is
            -- Move cursor to first element.
            -- (from CIRCULAR)
        deferred
        end

feature {DYNAMIC_CHAIN} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from DYNAMIC_CHAIN)
        deferred
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CIRCULAR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable circular chains"
    status: "See notice at end of class"
    names: dynamic_circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_CIRCULAR [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Define current position as the first.
            -- (from CIRCULAR)
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CIRCULAR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_CIRCULAR [G]

Ancestors
    CIRCULAR [G]
    DYNAMIC_CHAIN [G]

Descendants
    ARRAYED_CIRCULAR [G]
    LINKED_CIRCULAR [G]

Clients
    DYNAMIC_CIRCULAR [G]

Suppliers
    DYNAMIC_CIRCULAR [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_CIRCULAR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Dynamically modifiable circular chains"
    status: "See notice at end of class"
    names: dynamic_circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_CIRCULAR [G]

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, dynamically modifiable lists,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: dynamic_list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_LIST [G]

inherit
    LIST [G]
        undefine
            prune,
            sequential_index_of,
            sequential_has,
            remove,
            prune_all
        end

    DYNAMIC_CHAIN [G]
        rename
            wipe_out as chain_wipe_out
        export
            {NONE} chain_wipe_out
        undefine
            is_equal
        redefine
            put_left,
            put_right,
            remove_left,
            remove_right
        end

    DYNAMIC_CHAIN [G]
        undefine
            is_equal
        redefine
            put_left,
            put_right,
            remove_left,
            remove_right,
            wipe_out
        select
            wipe_out
        end

feature -- Element change

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        local
            temp: like item
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                temp := item
                replace (v)
                put_right (temp)
                forth
            end
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        deferred
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        do
            from
                other.start
            until
                other.is_empty
            loop
                put_left (other.item)
                other.remove
            end
        ensure then
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        do
            from
                other.finish
            until
                other.is_empty
            loop
                put_right (other.item)
                other.back
                other.remove_right
            end
        ensure then
            other_empty: other.is_empty
        end

feature -- Removal

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        deferred
        ensure then
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require else
            not_before: not before
        deferred
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        deferred
        end

    wipe_out is
            -- Remove all items.
        do
            chain_wipe_out
            back
        ensure then
            is_before: before
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_LIST [G]

General
    cluster: base.structures.list
    description:
        "Sequential, dynamically modifiable lists,
        without commitment to a particular representation"

Ancestors
    DYNAMIC_CHAIN [G]
    DYNAMIC_CHAIN [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] DYNAMIC_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] DYNAMIC_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] DYNAMIC_LIST [G])
    merge_right (other: [like Current] DYNAMIC_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, dynamically modifiable lists,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: dynamic_list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_LIST [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index
            -- (from CHAIN)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like item is
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            finish
            Result := item
            go_to (pos)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        local
            counter, pos, final: INTEGER
        do
            if i > 0 then
                from
                until
                    (counter = i) or else off
                loop
                    forth
                    counter := counter + 1
                end
            elseif i < 0 then
                final := index + i;
                if final <= 0 then
                    start;
                    back
                else
                    from
                        start
                        pos := 1
                    until
                        pos = final
                    loop
                        forth
                        pos := pos + 1
                    end
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            from
                other.start
            until
                other.is_empty
            loop
                put_left (other.item)
                other.remove
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            from
                other.finish
            until
                other.is_empty
            loop
                put_right (other.item)
                other.back
                other.remove_right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then
            other_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v at beginning.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            temp: like item
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                temp := item
                replace (v)
                put_right (temp)
                forth
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        ensure then
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            not_before: not before
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        deferred
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            chain_wipe_out
            back
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            is_before: before
        end

feature {NONE} -- Removal

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {DYNAMIC_CHAIN} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from DYNAMIC_CHAIN)
        deferred
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, dynamically modifiable lists,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: dynamic_list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_LIST [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_LIST [G]

Ancestors
    DYNAMIC_CHAIN [G]
    DYNAMIC_CHAIN [G]
    LIST [G]

Descendants
    ARRAYED_LIST [G]
    LINKED_LIST [G]
    MULTI_ARRAY_LIST [G]

Clients
    DYNAMIC_LIST [G]

Suppliers
    BOOLEAN
    DYNAMIC_LIST [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential, dynamically modifiable lists,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: dynamic_list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:33 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_LIST [G]

feature -- Element change

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        ensure then
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        ensure then
            other_empty: other.is_empty

feature -- Removal

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        ensure then
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require else
            not_before: not before

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.

    wipe_out
            -- Remove all items.
        ensure then
            is_before: before

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists with fixed maximum numbers of items, implemented by arrays"
    status: "See notice at end of class"
    names: fixed, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    FIXED_LIST [G]

inherit
    LIST [G]
        export
            {ANY} put,
            {NONE} force, extend, fill, prune, prune_all
        undefine
            force,
            prune,
            infix "@",
            is_equal,
            put_i_th,
            occurrences,
            valid_index,
            prune_all,
            copy,
            has,
            i_th
        redefine
            first,
            last,
            swap,
            duplicate,
            move,
            start,
            finish,
            go_i_th,
            put,
            remove
        select
            extendible,
            index_set
        end

    ARRAY [G]
        rename
            make as array_make,
            put as put_i_th,
            item as i_th,
            force as force_i_th,
            bag_put as put,
            index_set as array_index_set,
            extendible as array_extendible
        export
            {NONE} all,
            {ANY} i_th, put_i_th, infix "@", is_equal, occurrences, valid_index, copy, area, has,
            {FIXED_LIST} array_make
        undefine
            count,
            linear_representation,
            put,
            resizable
        redefine
            full,
            extend,
            prunable
        end

    FIXED [G]
        undefine
            copy,
            is_equal,
            full
        end

create
    make,
    make_filled

feature -- Initialization

    make (n: INTEGER) is
            -- Create an empty list.
        do
            array_make (1, n)
        ensure
            is_before: before
            new_count: count = 0
        end

    make_filled (n: INTEGER) is
            -- Create a list with n void elements.
        do
            array_make (1, n)
            count := n
        ensure
            is_before: before
            new_count: count = n
        end

feature -- Access

    index: INTEGER
            -- Current position in the list

    item: G is
            -- Current item
        do
            Result := area.item (index - 1)
        end

    first: G is
            -- Item at first position
        do
            Result := area.item (0)
        end

    last: like first is
            -- Item at last position
        do
            Result := area.item (count - 1)
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {ARRAYED_LIST_CURSOR} Result.make (index)
        end

feature -- Measurement

    count: INTEGER

feature -- Status report

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := (count < capacity)
        end

    prunable: BOOLEAN is
            -- May items be removed?
        do
            Result := not is_empty
        end

    full: BOOLEAN is
            -- Is the list full?
        do
            Result := count = capacity
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Is p a valid cursor?
        local
            fl_c: ARRAYED_LIST_CURSOR
        do
            fl_c ?= p
            if fl_c /= void then
                Result := valid_cursor_index (fl_c.index)
            end
        end

feature -- Cursor movement

    move (i: INTEGER) is
            -- Move cursor i positions.
        do
            index := index + i
            if (index > count + 1) then
                index := count + 1
            elseif index < 0 then
                index := 0
            end
        end

    start is
            -- Move cursor to first position.
        do
            index := 1
        end

    finish is
            -- Move cursor to last position.
        do
            index := count
        end

    forth is
            -- Move cursor to next position, if any.
        do
            index := index + 1
        end

    back is
            -- Move cursor to previous position, if any.
        do
            index := index - 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        do
            index := i
        end

    go_to (p: CURSOR) is
            -- Move cursor to element remembered in p.
        local
            fl_c: ARRAYED_LIST_CURSOR
        do
            fl_c ?= p
            check
                fl_c /= void
            end
            index := fl_c.index
        end

feature -- Element change

    put (v: like first) is
            -- Replace current item by v.
            -- (Synonym for replace)
        require else
            True
        do
            replace (v)
        end

    replace (v: like first) is
            -- Replace current item by v.
        do
            put_i_th (v, index)
        end

    extend (v: like item) is
            -- Add v to end.
            -- Move index to the current item.
        do
            count := count + 1
            index := count
            force_i_th (v, count)
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        local
            i, j: INTEGER
            default_value: G
        do
            if not off then
                from
                    i := index - 1
                until
                    i >= count - 1
                loop
                    j := i + 1
                    area.put (area.item (j), i)
                    i := j
                end
                put_i_th (default_value, count)
                count := count - 1
            end
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
        local
            old_item: like item
        do
            old_item := item
            replace (i_th (i))
            put_i_th (old_item, i)
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        local
            pos: INTEGER
        do
            create Result.make_filled (n.min (count - index + 1))
            from
                Result.start
                pos := index
            until
                Result.exhausted
            loop
                Result.replace (item)
                forth
                Result.forth
            end
            Result.start
            index := pos
        end

feature {NONE} -- Implementation

    force (v: like item) is
            -- Not used since extend is not always applicable.
        do
        end

invariant

    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FIXED_LIST [G]

General
    cluster: base.structures.list
    description: "Lists with fixed maximum numbers of items, implemented by arrays"
    create: make_filled, make

Ancestors
    ARRAY [G]
    FIXED [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): G
    after: BOOLEAN
    area: SPECIAL [G]
    before: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] FIXED_LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] FIXED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    Resizable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] FIXED_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    finish
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (n: INTEGER)
    make_filled (n: INTEGER)
    move (i: INTEGER)
    put (v: [like first] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove
    replace (v: [like first] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)

Constraints
    empty means storage empty

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists with fixed maximum numbers of items, implemented by arrays"
    status: "See notice at end of class"
    names: fixed, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    FIXED_LIST [G]

create
    make,
    make_filled

feature -- Initialization

    make (n: INTEGER) is
            -- Create an empty list.
        do
            array_make (1, n)
        ensure
            is_before: before
            new_count: count = 0
        end

    make_filled (n: INTEGER) is
            -- Create a list with n void elements.
        do
            array_make (1, n)
            count := n
        ensure
            is_before: before
            new_count: count = n
        end

feature {FIXED_LIST} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

feature {NONE} -- Initialization

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_from_array (a: ARRAY [G]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
        do
            create {ARRAYED_LIST_CURSOR} Result.make (index)
        end

    first: G is
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (0)
        end

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (i_th (i) /= void and then i_th (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (i_th (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER
            -- Current position in the list

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := area.item (index - 1)
        end

    i_th (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

    last: like first is
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (count - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature {NONE} -- Access

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            Result := i_th (i)
        end

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature  -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    count: INTEGER

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (from ARRAY)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if i_th (i) /= void and then v.is_equal (i_th (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if i_th (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    array_index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        local
            i: INTEGER
        do
            if lower = other.lower and then upper = other.upper and then object_comparison = other.object_comparison then
                if object_comparison then
                    from
                        Result := True
                        i := lower
                    until
                        not Result or i > upper
                    loop
                        Result := equal (i_th (i), other.i_th (i))
                        i := i + 1
                    end
                else
                    Result := area.same_items (other.area, upper - lower)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
        do
            Result := (count < capacity)
        end

    full: BOOLEAN is
            -- Is the list full?
        do
            Result := count = capacity
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed?
        do
            Result := not is_empty
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)
            -- (from FIXED)

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Is p a valid cursor?
        local
            fl_c: ARRAYED_LIST_CURSOR
        do
            fl_c ?= p
            if fl_c /= void then
                Result := valid_cursor_index (fl_c.index)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature {NONE} -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((i_th (upper) = void or else i_th (upper) = i_th (upper).default) and subarray (lower, upper - 1).all_default))
        end

    array_extendible: BOOLEAN is
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)
        do
            Result := False
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (i_th (upper) = other.i_th (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = count
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before
        do
            index := index - 1
        end

    finish is
            -- Move cursor to last position.
        do
            index := count
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        do
            index := index + 1
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            index := i
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to element remembered in p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            fl_c: ARRAYED_LIST_CURSOR
        do
            fl_c ?= p
            check
                fl_c /= void
            end
            index := fl_c.index
        end

    move (i: INTEGER) is
            -- Move cursor i positions.
        do
            index := index + i
            if (index > count + 1) then
                index := count + 1
            elseif index < 0 then
                index := 0
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
        do
            index := 1
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Move index to the current item.
        require -- from COLLECTION
            extendible: extendible
        do
            count := count + 1
            index := count
            force_i_th (v, count)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    put_i_th (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put (v: like first) is
            -- Replace current item by v.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        require else
            True
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            i, j: INTEGER
            default_value: G
        do
            if not off then
                from
                    i := index - 1
                until
                    i >= count - 1
                loop
                    j := i + 1
                    area.put (area.item (j), i)
                    i := j
                end
                put_i_th (default_value, count)
                count := count - 1
            end
        end

    replace (v: like first) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        do
            put_i_th (v, index)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    enter (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force_i_th (v: like i_th; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Removal

    wipe_out is
        obsolete "Not applicable since not `prunable'. Use `discard_items' instead."
            -- Make array empty.
            -- (from ARRAY)
        require -- from COLLECTION
            prunable
        do
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item: like item
        do
            old_item := item
            replace (i_th (i))
            put_i_th (old_item, i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature {NONE} -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: INTEGER
        do
            create Result.make_filled (n.min (count - index + 1))
            from
                Result.start
                pos := index
            until
                Result.exhausted
            loop
                Result.replace (item)
                forth
                Result.forth
            end
            Result.start
            index := pos
        end

feature {NONE} -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    prune (v: G) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    force (v: like item) is
            -- Not used since extend is not always applicable.
        require -- from SEQUENCE
            extendible: extendible
        do
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FIXED
    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists with fixed maximum numbers of items, implemented by arrays"
    status: "See notice at end of class"
    names: fixed, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    FIXED_LIST [G]

create

    make (n: INTEGER)
            -- Create an empty list.
        ensure
            is_before: before
            new_count: count = 0

    make_filled (n: INTEGER)
            -- Create a list with n void elements.
        ensure
            is_before: before
            new_count: count = n

feature -- Initialization

    make (n: INTEGER)
            -- Create an empty list.
        ensure
            is_before: before
            new_count: count = 0

    make_filled (n: INTEGER)
            -- Create a list with n void elements.
        ensure
            is_before: before
            new_count: count = n

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Current position in the list

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    i_th (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    last: like first
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?

    full: BOOLEAN
            -- Is the list full?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)
            -- (from FIXED)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Is p a valid cursor?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to element remembered in p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Move index to the current item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like first)
            -- Replace current item by v.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        require else
            True
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    replace (v: like first)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FIXED
    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FIXED_LIST [G]

Ancestors
    ARRAY [G]
    FIXED [G]
    LIST [G]

Descendants
    FIXED_TREE [G]

Clients
    FIXED_LIST [G]

Suppliers
    ARRAYED_LIST_CURSOR
    BOOLEAN
    FIXED_LIST [G]
    INTEGER
    SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Lists with fixed maximum numbers of items, implemented by arrays"
    status: "See notice at end of class"
    names: fixed, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    FIXED_LIST [G]

create
    make,
    make_filled

feature -- Initialization

    make (n: INTEGER)
            -- Create an empty list.
        ensure
            is_before: before
            new_count: count = 0

    make_filled (n: INTEGER)
            -- Create a list with n void elements.
        ensure
            is_before: before
            new_count: count = n

feature -- Access

    index: INTEGER
            -- Current position in the list

    item: G
            -- Current item

    first: G
            -- Item at first position

    last: like first
            -- Item at last position

    cursor: CURSOR
            -- Current cursor position

feature -- Measurement

    count: INTEGER

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?

    prunable: BOOLEAN
            -- May items be removed?

    full: BOOLEAN
            -- Is the list full?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Is p a valid cursor?

feature -- Cursor movement

    move (i: INTEGER)
            -- Move cursor i positions.

    start
            -- Move cursor to first position.

    finish
            -- Move cursor to last position.

    forth
            -- Move cursor to next position, if any.

    back
            -- Move cursor to previous position, if any.

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.

    go_to (p: CURSOR)
            -- Move cursor to element remembered in p.

feature -- Element change

    put (v: like first)
            -- Replace current item by v.
            -- (Synonym for replace)
        require else
            True

    replace (v: like first)
            -- Replace current item by v.

    extend (v: like item)
            -- Add v to end.
            -- Move index to the current item.

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items

invariant

    empty_means_storage_empty: is_empty implies all_default

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells containing a reference to their right neighbor"
    status: "See notice at end of class"
    names: linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    LINKABLE [G]

inherit
    CELL [G]
        export
            {CELL, CHAIN} put,
            {ANY} item
        end

feature -- Access

    right: like Current
            -- Right neighbor

feature {CELL, CHAIN} -- Implementation

    put_right (other: like Current) is
            -- Put other to the right of current cell.
        do
            right := other
        ensure
            chained: right = other
        end

    forget_right is
            -- Remove right link.
        do
            right := void
        ensure
            not_chained: right = void
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKABLE [G]

General
    cluster: base.structures.list
    description: "Linkable cells containing a reference to their right neighbor"

Ancestors
    CELL [G]

Queries
    item: G
    right: [like Current] LINKABLE [G]

Commands
    replace (v: [like item] G)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells containing a reference to their right neighbor"
    status: "See notice at end of class"
    names: linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    LINKABLE [G]

feature -- Access

    right: like Current
            -- Right neighbor

feature  -- Access

    item: G
            -- Content of cell.
            -- (from CELL)

feature {CELL, CHAIN} -- Element change

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        do
            item := v
        ensure -- from CELL
            item_inserted: item = v
        end

feature -- Element change

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        do
            item := v
        ensure -- from CELL
            item_inserted: item = v
        end

feature {CELL, CHAIN} -- Implementation

    forget_right is
            -- Remove right link.
        do
            right := void
        ensure
            not_chained: right = void
        end

    put_right (other: like Current) is
            -- Put other to the right of current cell.
        do
            right := other
        ensure
            chained: right = other
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells containing a reference to their right neighbor"
    status: "See notice at end of class"
    names: linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKABLE [G]

feature -- Access

    right: like Current
            -- Right neighbor

feature  -- Access

    item: G
            -- Content of cell.
            -- (from CELL)

feature -- Element change

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        ensure -- from CELL
            item_inserted: item = v

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKABLE [G]

Ancestors
    CELL [G]

Descendants
    BI_LINKABLE [G]
    LINKED_TREE [G]

Clients
    INTERACTIVE_LIST [G]
    LINKABLE [G]
    LINKED_LIST [G]
    LINKED_QUEUE [G]
    LINKED_STACK [G]

Suppliers
    LINKABLE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Linkable cells containing a reference to their right neighbor"
    status: "See notice at end of class"
    names: linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKABLE [G]

feature -- Access

    right: like Current
            -- Right neighbor

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CIRCULAR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as linked lists"
    status: "See notice at end of class"
    names: linked_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_CIRCULAR [G]

inherit
    DYNAMIC_CIRCULAR [G]
        undefine
            readable,
            isfirst,
            writable,
            is_equal
        redefine
            start,
            islast
        select
            remove,
            go_i_th,
            after,
            before,
            off,
            prune_all,
            prune,
            first,
            forth
        end

    LIST [G]
        rename
            after as l_after,
            before as l_before,
            remove as l_remove,
            first as l_first,
            off as l_off,
            prune as l_prune,
            prune_all as l_prune_all,
            go_i_th as l_go_i_th,
            forth as l_forth
        export
            {NONE} l_after, l_before, l_remove, l_first, l_off, l_prune, l_prune_all, l_go_i_th, l_forth
        undefine
            last,
            exhausted,
            move,
            valid_cursor_index,
            isfirst,
            readable,
            islast,
            start,
            writable
        end

create
    make

feature -- Initialization

    make is
            -- Create an empty list
        do
            create list.make
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        do
            Result := list.count
        end

feature -- Element change

    replace (v: G) is
            -- Replace current item by v.
        do
            list.replace (v)
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        do
            list.merge_right (other.list)
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        do
            list.put_right (v)
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            list.put_front (v)
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        local
            e: BOOLEAN
        do
            e := is_empty
            list.extend (v)
            if e then
                start
            end
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        do
            list.merge_left (other.list)
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        do
            list.put_left (v)
        end

feature -- Access

    item: G is
            -- Current item
        do
            Result := list.item
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {CIRCULAR_CURSOR} Result.make (list.cursor, internal_exhausted, starter)
        end

feature -- Status report

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := list.readable
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                Result := list.valid_cursor (c_c.cursor)
            end
        end

    writable: BOOLEAN is
            -- Is there a current item that may be written?
        do
            Result := list.writable
        end

    isfirst: BOOLEAN is
            -- Is cursor on first item?
        do
            if not is_empty then
                if starter = 0 then
                    Result := list.isfirst
                else
                    Result := (standard_index = starter)
                end
            end
        end

    islast: BOOLEAN is
            -- Is cursor on last item?
        do
            if not is_empty then
                if (starter = 0) or (starter = 1) then
                    Result := standard_islast
                else
                    Result := (standard_index = starter - 1)
                end
            end
        end

feature -- Cursor movement

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                list.go_to (c_c.cursor)
                internal_exhausted := c_c.internal_exhausted
                starter := c_c.starter
            end
        end

    set_start is
            -- Select current item as the first.
        do
            starter := standard_index
            internal_exhausted := False
        end

    start is
            -- Move to position currently selected as first.
        do
            internal_exhausted := False
            if starter = 0 then
                standard_start
                starter := 1
            else
                standard_go_i_th (starter)
                if standard_off then
                    standard_start
                end
            end
        end

feature {NONE} -- Cursor movement

    l_forth is
        do
        end

feature -- Removal

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require else
            count > 1
        do
            if standard_isfirst then
                standard_finish
                remove
            else
                standard_remove_left
            end
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require else
            count > 1
        do
            if standard_islast then
                standard_start
                remove
                finish
            else
                standard_remove_right
            end
        end

feature {LINKED_CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
        do
            if count = 1 then
                starter := 0
            elseif starter = standard_index then
                if standard_islast then
                    starter := 1
                else
                    starter := starter + 1
                end
            end
        end

    starter: INTEGER
            -- The position currently selected as first

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        end

    list: LINKED_LIST [G]

    standard_after: BOOLEAN is
        do
            Result := list.after
        end

    standard_back is
        do
            list.back
        end

    standard_before: BOOLEAN is
        do
            Result := list.before
        end

    standard_finish is
        do
            list.finish
        end

    standard_forth is
        do
            list.forth
        end

    standard_go_i_th (i: INTEGER) is
        do
            list.go_i_th (i)
        end

    standard_index: INTEGER is
        do
            Result := list.index
        end

    standard_isfirst: BOOLEAN is
        do
            Result := list.isfirst
        end

    standard_islast: BOOLEAN is
        do
            Result := list.islast
        end

    standard_move (i: INTEGER) is
        do
            list.move (i)
        end

    standard_off: BOOLEAN is
        do
            Result := list.off
        end

    standard_remove is
        do
            list.remove
        end

    standard_remove_left is
        do
            list.remove_left
        end

    standard_remove_right is
        do
            list.remove_right
        end

    standard_search (v: G) is
        do
            list.search (v)
        end

    standard_start is
        do
            list.start
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CIRCULAR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains implemented as linked lists"
    create: make

Ancestors
    DYNAMIC_CIRCULAR [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LINKED_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_CIRCULAR [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] LINKED_CIRCULAR [G])
    merge_right (other: [like Current] LINKED_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CIRCULAR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as linked lists"
    status: "See notice at end of class"
    names: linked_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_CIRCULAR [G]

create
    make

feature -- Initialization

    make is
            -- Create an empty list
        do
            create list.make
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
        do
            create {CIRCULAR_CURSOR} Result.make (list.cursor, internal_exhausted, starter)
        end

    first: G is
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            start
            Result := item
            move (pos - 1)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)
        local
            first_ind, std_ind: INTEGER
            p: CURSOR
        do
            p := cursor
            std_ind := standard_index
            start
            first_ind := standard_index
            Result := std_ind - first_ind + 1
            if Result < 0 then
                Result := count + Result
            end
            move (Result - 1)
            go_to (p)
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := list.item
        end

    last: like first is
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            finish
            Result := item
            start
            move (pos - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    l_first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        do
            Result := list.count
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_after
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_before
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        do
            Result := is_empty or internal_exhausted
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor on first item?
        do
            if not is_empty then
                if starter = 0 then
                    Result := list.isfirst
                else
                    Result := (standard_index = starter)
                end
            end
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor on last item?
        do
            if not is_empty then
                if (starter = 0) or (starter = 1) then
                    Result := standard_islast
                else
                    Result := (standard_index = starter - 1)
                end
            end
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CIRCULAR)
        do
            Result := is_empty
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := list.readable
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                Result := list.valid_cursor (c_c.cursor)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        do
            Result := (i >= 0) and (i <= count)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be written?
        do
            Result := list.writable
        end

feature {NONE} -- Status report

    l_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    l_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    l_off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before
        do
            if isfirst then
                internal_exhausted := True
            end
            standard_back
            if standard_before then
                standard_finish
            end
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        do
            if islast then
                internal_exhausted := True
            end
            standard_forth
            if standard_after then
                standard_start
            end
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        do
            start
            move (i - 1)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                list.go_to (c_c.cursor)
                internal_exhausted := c_c.internal_exhausted
                starter := c_c.starter
            end
        end

    move (i: INTEGER) is
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        local
            real_move, counter, start_index: INTEGER
        do
            if i /= 0 and count > 0 then
                start_index := index
                real_move := i \\ count
                if real_move < 0 then
                    real_move := count + real_move
                end
                from
                until
                    counter = real_move
                loop
                    forth
                    counter := counter + 1
                end
                if (start_index + i > count) or (start_index + i < 1) then
                    internal_exhausted := True
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    set_start is
            -- Select current item as the first.
        require -- from CIRCULAR
            not_empty: not is_empty
        do
            starter := standard_index
            internal_exhausted := False
        end

    start is
            -- Move to position currently selected as first.
        do
            internal_exhausted := False
            if starter = 0 then
                standard_start
                starter := 1
            else
                standard_go_i_th (starter)
                if standard_off then
                    standard_start
                end
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature {NONE} -- Cursor movement

    l_go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    l_forth is
        require -- from LINEAR
            not_after: not after
        do
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        local
            e: BOOLEAN
        do
            e := is_empty
            list.extend (v)
            if e then
                start
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            list.merge_left (other.list)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            list.merge_right (other.list)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            list.put_front (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        do
            list.put_left (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            list.put_right (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: G) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        do
            list.replace (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            fix_start_for_remove
            standard_remove
            if standard_after then
                finish
            elseif standard_before then
                start
            end
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            count > 1
        do
            if standard_isfirst then
                standard_finish
                remove
            else
                standard_remove_left
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else
            count > 1
        do
            if standard_islast then
                standard_start
                remove
                finish
            else
                standard_remove_right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    l_prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    l_prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            to_be_removed, counter: INTEGER
        do
            from
                Result := new_chain
                pos := cursor
                to_be_removed := count.min (n)
            until
                counter = to_be_removed
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    l_remove is
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature {LINKED_CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
        do
            if count = 1 then
                starter := 0
            elseif starter = standard_index then
                if standard_islast then
                    starter := 1
                else
                    starter := starter + 1
                end
            end
        end

    list: LINKED_LIST [G]

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    standard_after: BOOLEAN is
        do
            Result := list.after
        end

    standard_back is
        do
            list.back
        end

    standard_before: BOOLEAN is
        do
            Result := list.before
        end

    standard_finish is
        do
            list.finish
        end

    standard_forth is
        do
            list.forth
        end

    standard_go_i_th (i: INTEGER) is
        do
            list.go_i_th (i)
        end

    standard_index: INTEGER is
        do
            Result := list.index
        end

    standard_isfirst: BOOLEAN is
        do
            Result := list.isfirst
        end

    standard_islast: BOOLEAN is
        do
            Result := list.islast
        end

    standard_move (i: INTEGER) is
        do
            list.move (i)
        end

    standard_off: BOOLEAN is
        do
            Result := list.off
        end

    standard_remove is
        do
            list.remove
        end

    standard_remove_left is
        do
            list.remove_left
        end

    standard_remove_right is
        do
            list.remove_right
        end

    standard_search (v: G) is
        do
            list.search (v)
        end

    standard_start is
        do
            list.start
        end

    starter: INTEGER
            -- The position currently selected as first

feature {CIRCULAR} -- Implementation

    internal_exhausted: BOOLEAN
            -- Has last forth or back operation exhausted the structure?
            -- (from CIRCULAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CIRCULAR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as linked lists"
    status: "See notice at end of class"
    names: linked_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_CIRCULAR [G]

create

    make
            -- Create an empty list

feature -- Initialization

    make
            -- Create an empty list

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor on first item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor on last item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be written?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Select current item as the first.
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move to position currently selected as first.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CIRCULAR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_CIRCULAR [G]

Ancestors
    DYNAMIC_CIRCULAR [G]
    LIST [G]

Descendants
    TWO_WAY_CIRCULAR [G]

Clients
    LINKED_CIRCULAR [G]

Suppliers
    BOOLEAN
    CIRCULAR_CURSOR
    INTEGER
    LINKED_CIRCULAR [G]
    LINKED_LIST [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_CIRCULAR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as linked lists"
    status: "See notice at end of class"
    names: linked_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_CIRCULAR [G]

create
    make

feature -- Initialization

    make
            -- Create an empty list

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Element change

    replace (v: G)
            -- Replace current item by v.

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.

feature -- Access

    item: G
            -- Current item

    cursor: CURSOR
            -- Current cursor position

feature -- Status report

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    writable: BOOLEAN
            -- Is there a current item that may be written?

    isfirst: BOOLEAN
            -- Is cursor on first item?

    islast: BOOLEAN
            -- Is cursor on last item?

feature -- Cursor movement

    go_to (p: CURSOR)
            -- Move cursor to position p.

    set_start
            -- Select current item as the first.

    start
            -- Move to position currently selected as first.

feature -- Removal

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require else
            count > 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require else
            count > 1

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, one-way linked lists"
    status: "See notice at end of class"
    names: linked_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_LIST [G]

inherit
    DYNAMIC_LIST [G]
        redefine
            go_i_th,
            put_left,
            move,
            wipe_out,
            isfirst,
            islast,
            is_inserted,
            first,
            last,
            finish,
            merge_left,
            merge_right,
            readable,
            start,
            before,
            after,
            off,
            copy
        end

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
        do
            before := True
        ensure
            is_before: before
        end

feature -- Access

    item: G is
            -- Current item
        do
            Result := active.item
        end

    first: like item is
            -- Item at first position
        do
            Result := first_element.item
        end

    last: like item is
            -- Item at last position
        do
            Result := last_element.item
        end

    index: INTEGER is
            -- Index of current position
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not off
        end

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := after or before
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
        do
            Result := not after and not before and (active = first_element)
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
        do
            check
                put_constraint: (v /= last_element.item) implies not off
            end
            Result := (v = last_element.item) or else (v = item)
        end

feature -- Cursor movement

    start is
            -- Move cursor to first position.
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then
            empty_convention: is_empty implies after
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        end

    back is
            -- Move to previous item.
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure then
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

feature -- Element change

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                active := p
            else
                last_element.put_right (p)
                if after then
                    active := p
                end
            end
            count := count + 1
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        local
            p: like first_element
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                p := new_cell (active.item)
                p.put_right (active.right)
                active.put (v)
                active.put_right (p)
                active := p
                count := count + 1
            end
        ensure then
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure then
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
        do
            active.put (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        local
            other_first_element: like first_element
            other_last_element: like first_element
            p: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                elseif isfirst then
                    p := first_element;
                    other_last_element.put_right (p);
                    first_element := other_first_element
                else
                    p := previous
                    if p /= void then
                        p.put_right (other_first_element)
                    end
                    other_last_element.put_right (active)
                end
                count := count + other_count
                other.wipe_out
            end
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        end

feature -- Removal

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        local
            removed, succ: like first_element
        do
            removed := active
            if isfirst then
                first_element := first_element.right
                active.forget_right
                active := first_element
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                end
            elseif islast then
                active := previous;
                if active /= void then
                    active.forget_right
                end;
                after := True
            else
                succ := active.right
                previous.put_right (succ)
                active.forget_right
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        do
            move (- 2)
            remove_right
            forth
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        local
            removed, succ: like first_element
        do
            if before then
                removed := first_element
                first_element := first_element.right
                active.forget_right
                active := first_element
            else
                succ := active.right
                removed := succ
                active.put_right (succ.right)
                succ.forget_right
            end
            count := count - 1
            cleanup_after_remove (removed)
        end

    wipe_out is
            -- Remove all items.
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        end

feature {LINKED_LIST} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the same type as first_element.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result
            Result.put (v)
        ensure
            result_exists: Result /= void
        end

    previous: like first_element is
            -- Element left of cursor
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

    next: like first_element is
            -- Element right of cursor
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    active: like first_element
            -- Element at cursor position

    first_element: LINKABLE [G]
            -- Head of list

    last_element: like first_element is
            -- Tail of list
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
        require
            non_void_cell: v /= void
        do
        end

invariant

    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_LIST [G]

General
    cluster: base.structures.list
    description: "Sequential, one-way linked lists"
    create: make

Ancestors
    DYNAMIC_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LINKED_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] LINKED_LIST [G])
    merge_right (other: [like Current] LINKED_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    prunable
    empty constraint
    not void unless empty
    before constraint
    after constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, one-way linked lists"
    status: "See notice at end of class"
    names: linked_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_LIST [G]

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
        do
            before := True
        ensure
            is_before: before
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
        do
            check
                put_constraint: (v /= last_element.item) implies not off
            end
            Result := (v = last_element.item) or else (v = item)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous item.
        require -- from BILINEAR
            not_before: not before
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
        require -- from LINEAR
            not_after: not after
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                active := p
            else
                last_element.put_right (p)
                if after then
                    active := p
                end
            end
            count := count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            p: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                elseif isfirst then
                    p := first_element;
                    other_last_element.put_right (p);
                    first_element := other_first_element
                else
                    p := previous
                    if p /= void then
                        p.put_right (other_first_element)
                    end
                    other_last_element.put_right (active)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                p := new_cell (active.item)
                p.put_right (active.right)
                active.put (v)
                active.put_right (p)
                active := p
                count := count + 1
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            removed, succ: like first_element
        do
            removed := active
            if isfirst then
                first_element := first_element.right
                active.forget_right
                active := first_element
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                end
            elseif islast then
                active := previous;
                if active /= void then
                    active.forget_right
                end;
                after := True
            else
                succ := active.right
                previous.put_right (succ)
                active.forget_right
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            move (- 2)
            remove_right
            forth
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        local
            removed, succ: like first_element
        do
            if before then
                removed := first_element
                first_element := first_element.right
                active.forget_right
                active := first_element
            else
                succ := active.right
                removed := succ
                active.put_right (succ.right)
                succ.forget_right
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
        require
            non_void_cell: v /= void
        do
        end

    first_element: LINKABLE [G]
            -- Head of list

    last_element: like first_element is
            -- Tail of list
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the same type as first_element.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result
            Result.put (v)
        ensure
            result_exists: Result /= void
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, one-way linked lists"
    status: "See notice at end of class"
    names: linked_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_LIST [G]

create

    make
            -- Create an empty list.
        ensure
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
        ensure
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: like item
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?

    isfirst: BOOLEAN
            -- Is cursor at first position?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_LIST [G]

Ancestors
    DYNAMIC_LIST [G]

Descendants
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    INTERACTIVE_LIST [G]
    LINKED_QUEUE [G]
    LINKED_SET [G]
    LINKED_STACK [G]
    LINKED_TREE [G]
    TWO_WAY_LIST [G]

Clients
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    INTERACTIVE_LIST [G]
    LINKED_CIRCULAR [G]
    LINKED_LIST [G]
    LINKED_STACK [G]
    SUBSET_STRATEGY_GENERIC [G]

Suppliers
    BOOLEAN
    INTEGER
    LINKABLE [G]
    LINKED_LIST [G]
    LINKED_LIST_CURSOR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, one-way linked lists"
    status: "See notice at end of class"
    names: linked_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_LIST [G]

create
    make

feature -- Initialization

    make
            -- Create an empty list.
        ensure
            is_before: before

feature -- Access

    item: G
            -- Current item

    first: like item
            -- Item at first position

    last: like item
            -- Item at last position

    index: INTEGER
            -- Index of current position

    cursor: CURSOR
            -- Current cursor position

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    readable: BOOLEAN
            -- Is there a current item that may be read?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    off: BOOLEAN
            -- Is there no current item?

    isfirst: BOOLEAN
            -- Is cursor at first position?

    islast: BOOLEAN
            -- Is cursor at last position?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?

feature -- Cursor movement

    start
            -- Move cursor to first position.
        ensure then
            empty_convention: is_empty implies after

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
        ensure then
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.

    back
            -- Move to previous item.

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        ensure then
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.

    go_to (p: CURSOR)
            -- Move cursor to position p.

feature -- Element change

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        ensure then
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        ensure then
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.

feature -- Removal

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.

    wipe_out
            -- Remove all items.

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.

invariant

    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential lists, without commitment to a particular representation"
    status: "See notice at end of class"
    names: list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    LIST [G]

inherit
    CHAIN [G]
        redefine
            forth,
            is_equal
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure then
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
        do
            Result := (index = 0)
        end

feature -- Cursor movement

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        deferred
        ensure then
            moved_forth: index = old index + 1
        end

invariant

    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    LIST [G]

General
    cluster: base.structures.list
    description: "Sequential lists, without commitment to a particular representation"

Ancestors
    CHAIN [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    before definition
    after definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential lists, without commitment to a particular representation"
    status: "See notice at end of class"
    names: list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    LIST [G]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index
            -- (from CHAIN)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like item is
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            finish
            Result := item
            go_to (pos)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
        do
            Result := (index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require -- from LINEAR
            not_after: not after
        deferred
        ensure then
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        local
            counter, pos, final: INTEGER
        do
            if i > 0 then
                from
                until
                    (counter = i) or else off
                loop
                    forth
                    counter := counter + 1
                end
            elseif i < 0 then
                final := index + i;
                if final <= 0 then
                    start;
                    back
                else
                    from
                        start
                        pos := 1
                    until
                        pos = final
                    loop
                        forth
                        pos := pos + 1
                    end
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential lists, without commitment to a particular representation"
    status: "See notice at end of class"
    names: list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    LIST [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require -- from LINEAR
            not_after: not after
        ensure then
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    LIST [G]

Ancestors
    CHAIN [G]

Descendants
    ARRAYED_CIRCULAR [G]
    DYNAMIC_LIST [G]
    FIXED_LIST [G]
    LINKED_CIRCULAR [G]
    PART_SORTED_LIST [G -> PART_COMPARABLE]

Clients
    LIST [G]

Suppliers
    BOOLEAN
    INTEGER
    LIST [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential lists, without commitment to a particular representation"
    status: "See notice at end of class"
    names: list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    LIST [G]

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
        ensure then
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

feature -- Cursor movement

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        ensure then
            moved_forth: index = old index + 1

invariant

    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTI_ARRAY_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Lists implemented as sequences of arrays, the last of which may
        be non-full. No limit on size (a new array is allocated if list
        outgrows its initial allocation).
    ]"
    status: "See notice at end of class"
    names: list, sequence
    representation: array, linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    MULTI_ARRAY_LIST [G]

inherit
    DYNAMIC_LIST [G]
        redefine
            start,
            finish,
            move,
            has,
            first,
            last,
            prune_all,
            search,
            remove,
            duplicate,
            wipe_out,
            put_left,
            put_right,
            put_front,
            extend
        end

create
    make

feature -- Initialization

    make (b: INTEGER) is
            -- Create an empty list, setting block_size to b
        do
            block_size := b
            first_element := new_cell (create {ARRAYED_LIST [G]}.make (b))
            last_element := first_element
            active := first_element
        end

feature -- Access

    item: G is
            -- Item at cursor position
        do
            Result := active.item.item
        end

    first: like item is
            -- Item at first position
        do
            Result := first_element.item.first
        end

    last: like item is
            -- Item at last position
        do
            Result := last_element.item.last
        end

    has (v: like item): BOOLEAN is
            -- Does list include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        end

    index: INTEGER
            -- Current cursor index

    cursor: CURSOR is
            -- Current cursor position
        do
            create {MULTAR_LIST_CURSOR [G]} Result.make (active, active.item.index, index)
        end

    first_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- First array_sequence element of the list

    last_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- Last array_sequence element of the list

    block_size: INTEGER

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    full: BOOLEAN is
        do
            Result := False
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            al_c: MULTAR_LIST_CURSOR [G]
        do
            al_c ?= p
            check
                al_c /= void
            end
            Result := (al_c /= void) and then valid_cursor_index (al_c.index) and then al_c.active.item.valid_cursor_index (al_c.active_index)
        end

feature -- Cursor movement

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
        do
            active := first_element
            active.item.start
            index := 1
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
        do
            active := last_element
            active.item.finish
            index := count
        end

    forth is
            -- Move cursor to next position, if any.
        local
            current_array: ARRAYED_LIST [G]
        do
            if not is_empty then
                current_array := active.item
                current_array.forth
                if current_array.after then
                    if active /= last_element then
                        active := active.right
                        active.item.start
                    end
                end
            end
            index := index + 1
        end

    back is
            -- Move cursor to previous position, if any.
        local
            current_array: ARRAYED_LIST [G]
        do
            if not is_empty then
                current_array := active.item
                current_array.back
                if current_array.before then
                    if active /= first_element then
                        active := active.left
                        active.item.finish
                    end
                end
            end
            index := index - 1
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        local
            counter: INTEGER
            cell: like active
            current_array: ARRAYED_LIST [G]
        do
            cell := active
            current_array := cell.item
            if i > 0 then
                from
                    counter := i + active.item.index
                until
                    counter <= current_array.count or cell = void
                loop
                    counter := counter - current_array.count
                    cell := cell.right
                    if cell /= void then
                        current_array := cell.item
                    end
                end
                if cell = void then
                    cell := last_element
                    current_array.finish
                    current_array.forth
                else
                    active := cell
                    current_array.go_i_th (counter)
                end
            elseif i < 0 then
                from
                    counter := current_array.count - current_array.index - i
                until
                    counter <= current_array.count or cell = void
                loop
                    counter := counter - current_array.count
                    cell := cell.left
                    if cell /= void then
                        current_array := cell.item
                    end
                end;
                if counter = current_array.count then
                    counter := 0;
                    cell := cell.left;
                    if cell /= void then
                        current_array := cell.item
                    end
                end;
                if cell = void then
                    cell := first_element;
                    current_array.go_i_th (0)
                else
                    active := cell;
                    current_array.go_i_th (current_array.count - counter)
                end
            end
            if i /= 0 then
                if current_array.before then
                    index := 0
                elseif current_array.after then
                    index := count + 1
                else
                    index := index + i
                end
            end
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p
        local
            al_c: MULTAR_LIST_CURSOR [G]
        do
            al_c ?= p
            check
                al_c /= void
            end
            active := al_c.active
            active.item.go_i_th (al_c.active_index)
            index := al_c.index
        end

    search (v: like item) is
            -- Move cursor to first position (at or after current
            -- cursor position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            current_array: ARRAYED_LIST [G]
            old_index: INTEGER
            cell: like active
        do
            cell := active
            current_array := cell.item
            old_index := current_array.index
            if object_comparison then
                current_array.compare_objects
            else
                current_array.compare_references
            end
            current_array.search (v)
            if current_array.after then
                cell := cell.right
                index := index + current_array.count - old_index + 1
            else
                index := index + current_array.index - old_index
            end
            from
            invariant
                index <= count + 1
            until
                not current_array.after or else cell = void
            loop
                current_array := cell.item
                if object_comparison then
                    current_array.compare_objects
                else
                    current_array.compare_references
                end
                current_array.start
                current_array.search (v)
                if current_array.after then
                    cell := cell.right
                    index := index + current_array.count
                else
                    index := index + current_array.index - 1
                end
            end
            if cell /= void then
                active := cell
            else
                active := last_element
            end
        end

feature -- Element change

    replace (v: like item) is
            -- Replace current item by v.
        do
            active.item.replace (v)
        end

    extend (v: like item) is
            -- Add v to end.
        local
            current_array: ARRAYED_LIST [G]
        do
            current_array := last_element.item
            if current_array.count = block_size then
                create current_array.make (block_size)
                last_element.put_right (new_cell (current_array))
                last_element := last_element.right
            end
            current_array.extend (v)
            count := count + 1
        end

    put_front (v: like item) is
            -- Add v at the beginning.
            -- Do not move cursor.
        local
            first_array: ARRAYED_LIST [G]
            pos: INTEGER
        do
            first_array := first_element.item
            if active = first_element then
                pos := first_array.index
            else
                pos := - 1
            end
            first_array.start
            put_left (v)
            if pos > 0 then
                first_array.go_i_th (pos + 1)
            elseif pos = 0 then
                first_array.go_i_th (0)
            end
            if not before then
                index := index + 1
            end
            count := count + 1
        end

    put_left (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
        local
            cell: like first_element
            current_array: ARRAYED_LIST [G]
            pos, cut: INTEGER
        do
            current_array := active_array
            check
                is_empty implies after
            end
            if after then
                extend (v)
            elseif active /= first_element and then not active.left.item.full then
                active.left.item.extend (v)
            elseif current_array.count <= block_size then
                current_array.put_left (v)
            else
                pos := current_array.index
                current_array.go_i_th (block_size // 2 + 1)
                cut := index
                cell := new_cell (current_array.duplicate (count))
                cell.put_right (active.right)
                cell.put_left (active)
                if last_element = active then
                    last_element := cell
                end
                if pos < cut then
                    current_array.go_i_th (pos)
                    current_array.put_left (v)
                elseif pos = cut then
                    current_array.extend (v);
                    active := cell;
                    active.item.start
                else
                    active := cell
                    current_array := cell.item
                    current_array.go_i_th (pos - cut + 1)
                    current_array.put_left (v)
                end
            end
            index := index + 1
            count := count + 1
        end

    put_right (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
        do
            forth
            put_left (v)
            back
            back
        end

feature -- Removal

    wipe_out is
            -- Remove all items.
        do
            count := 0
            index := 0
            check
                first_element /= void
            end
            first_element.item.wipe_out
            first_element.forget_right
            active := first_element
            last_element := first_element
        end

    remove is
            -- Remove current item
        local
            current_array: ARRAYED_LIST [G]
        do
            current_array := active.item
            current_array.remove
            if current_array.is_empty then
                if active = first_element then
                    if active /= last_element then
                        first_element := active.right
                        first_element.forget_left
                    end
                elseif active = last_element then
                    last_element := active.left;
                    last_element.forget_right
                else
                    active.right.put_left (active.left)
                    active := active.right
                end
            elseif current_array.after then
                if active /= last_element then
                    active := active.right;
                    active.item.start
                end
            end
            count := count - 1
        end

    remove_left is
        do
            back
            remove
        end

    remove_right is
        do
            forth
            remove
            back
        end

    prune_all (v: like item) is
        local
            cell: like active
            array: ARRAYED_LIST [G]
        do
            from
                cell := first_element
            until
                cell = void
            loop
                array := cell.item
                if object_comparison then
                    array.compare_objects
                else
                    array.compare_references
                end
                count := count - array.count
                array.prune_all (v)
                count := count + array.count
                if array.is_empty then
                    if cell = first_element then
                        if cell /= last_element then
                            first_element := cell.right
                            cell := first_element
                            cell.forget_left
                        else
                            cell := void
                        end
                    elseif cell = last_element then
                        last_element := cell.left;
                        last_element.forget_right;
                        cell := void
                    else
                        cell.right.put_left (cell.left)
                        cell := cell.right
                    end
                else
                    cell := cell.right
                end
            end
            active := last_element
            index := count + 1
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                pos := cursor
                Result := new_chain
            until
                (counter = n) or exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {MULTI_ARRAY_LIST} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (block_size)
        end

    active_array: ARRAYED_LIST [G] is
            -- Array_sequence at cursor position
        require
            active_exists: active /= void
            not_off: not off
        do
            Result := active.item
        end

    active: like first_element
            -- Element at cursor position

feature {NONE} -- Implementation

    go_before is
            -- Move the cursor before first position.
        do
            active := void
            index := 0
        ensure
            is_before: before
        end

    new_cell (a: ARRAYED_LIST [G]): like first_element is
        do
            create Result
            Result.put (a)
        end

invariant

    writable_definition: writable = not off
    readable_definition: readable = not off
    extendible_definition: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTI_ARRAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTI_ARRAY_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MULTI_ARRAY_LIST [G]

General
    cluster: base.structures.list
    description:
        "Lists implemented as sequences of arrays, the last of which may
        be non-full. No limit on size (a new array is allocated if list
        outgrows its initial allocation)."
    create: make

Ancestors
    DYNAMIC_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    block_size: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] MULTI_ARRAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [ARRAYED_LIST [G]]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] MULTI_ARRAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: BI_LINKABLE [ARRAYED_LIST [G]]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (b: INTEGER)
    merge_left (other: [like Current] MULTI_ARRAY_LIST [G])
    merge_right (other: [like Current] MULTI_ARRAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    writable definition
    readable definition
    extendible definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTI_ARRAY_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Lists implemented as sequences of arrays, the last of which may
        be non-full. No limit on size (a new array is allocated if list
        outgrows its initial allocation).
    ]"
    status: "See notice at end of class"
    names: list, sequence
    representation: array, linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    MULTI_ARRAY_LIST [G]

create
    make

feature -- Initialization

    make (b: INTEGER) is
            -- Create an empty list, setting block_size to b
        do
            block_size := b
            first_element := new_cell (create {ARRAYED_LIST [G]}.make (b))
            last_element := first_element
            active := first_element
        end

feature -- Access

    block_size: INTEGER

    cursor: CURSOR is
            -- Current cursor position
        do
            create {MULTAR_LIST_CURSOR [G]} Result.make (active, active.item.index, index)
        end

    first: like item is
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item.first
        end

    first_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- First array_sequence element of the list

    has (v: like item): BOOLEAN is
            -- Does list include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER
            -- Current cursor index

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at cursor position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item.item
        end

    last: like item is
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item.last
        end

    last_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- Last array_sequence element of the list

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN is
        do
            Result := False
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
        local
            al_c: MULTAR_LIST_CURSOR [G]
        do
            al_c ?= p
            check
                al_c /= void
            end
            Result := (al_c /= void) and then valid_cursor_index (al_c.index) and then al_c.active.item.valid_cursor_index (al_c.active_index)
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before
        local
            current_array: ARRAYED_LIST [G]
        do
            if not is_empty then
                current_array := active.item
                current_array.back
                if current_array.before then
                    if active /= first_element then
                        active := active.left
                        active.item.finish
                    end
                end
            end
            index := index - 1
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
        do
            active := last_element
            active.item.finish
            index := count
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        local
            current_array: ARRAYED_LIST [G]
        do
            if not is_empty then
                current_array := active.item
                current_array.forth
                if current_array.after then
                    if active /= last_element then
                        active := active.right
                        active.item.start
                    end
                end
            end
            index := index + 1
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            al_c: MULTAR_LIST_CURSOR [G]
        do
            al_c ?= p
            check
                al_c /= void
            end
            active := al_c.active
            active.item.go_i_th (al_c.active_index)
            index := al_c.index
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        local
            counter: INTEGER
            cell: like active
            current_array: ARRAYED_LIST [G]
        do
            cell := active
            current_array := cell.item
            if i > 0 then
                from
                    counter := i + active.item.index
                until
                    counter <= current_array.count or cell = void
                loop
                    counter := counter - current_array.count
                    cell := cell.right
                    if cell /= void then
                        current_array := cell.item
                    end
                end
                if cell = void then
                    cell := last_element
                    current_array.finish
                    current_array.forth
                else
                    active := cell
                    current_array.go_i_th (counter)
                end
            elseif i < 0 then
                from
                    counter := current_array.count - current_array.index - i
                until
                    counter <= current_array.count or cell = void
                loop
                    counter := counter - current_array.count
                    cell := cell.left
                    if cell /= void then
                        current_array := cell.item
                    end
                end;
                if counter = current_array.count then
                    counter := 0;
                    cell := cell.left;
                    if cell /= void then
                        current_array := cell.item
                    end
                end;
                if cell = void then
                    cell := first_element;
                    current_array.go_i_th (0)
                else
                    active := cell;
                    current_array.go_i_th (current_array.count - counter)
                end
            end
            if i /= 0 then
                if current_array.before then
                    index := 0
                elseif current_array.after then
                    index := count + 1
                else
                    index := index + i
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move cursor to first position (at or after current
            -- cursor position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            current_array: ARRAYED_LIST [G]
            old_index: INTEGER
            cell: like active
        do
            cell := active
            current_array := cell.item
            old_index := current_array.index
            if object_comparison then
                current_array.compare_objects
            else
                current_array.compare_references
            end
            current_array.search (v)
            if current_array.after then
                cell := cell.right
                index := index + current_array.count - old_index + 1
            else
                index := index + current_array.index - old_index
            end
            from
            invariant
                index <= count + 1
            until
                not current_array.after or else cell = void
            loop
                current_array := cell.item
                if object_comparison then
                    current_array.compare_objects
                else
                    current_array.compare_references
                end
                current_array.start
                current_array.search (v)
                if current_array.after then
                    cell := cell.right
                    index := index + current_array.count
                else
                    index := index + current_array.index - 1
                end
            end
            if cell /= void then
                active := cell
            else
                active := last_element
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
        do
            active := first_element
            active.item.start
            index := 1
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
        require -- from COLLECTION
            extendible: extendible
        local
            current_array: ARRAYED_LIST [G]
        do
            current_array := last_element.item
            if current_array.count = block_size then
                create current_array.make (block_size)
                last_element.put_right (new_cell (current_array))
                last_element := last_element.right
            end
            current_array.extend (v)
            count := count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            from
                other.start
            until
                other.is_empty
            loop
                put_left (other.item)
                other.remove
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            from
                other.finish
            until
                other.is_empty
            loop
                put_right (other.item)
                other.back
                other.remove_right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v at the beginning.
            -- Do not move cursor.
        local
            first_array: ARRAYED_LIST [G]
            pos: INTEGER
        do
            first_array := first_element.item
            if active = first_element then
                pos := first_array.index
            else
                pos := - 1
            end
            first_array.start
            put_left (v)
            if pos > 0 then
                first_array.go_i_th (pos + 1)
            elseif pos = 0 then
                first_array.go_i_th (0)
            end
            if not before then
                index := index + 1
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            cell: like first_element
            current_array: ARRAYED_LIST [G]
            pos, cut: INTEGER
        do
            current_array := active_array
            check
                is_empty implies after
            end
            if after then
                extend (v)
            elseif active /= first_element and then not active.left.item.full then
                active.left.item.extend (v)
            elseif current_array.count <= block_size then
                current_array.put_left (v)
            else
                pos := current_array.index
                current_array.go_i_th (block_size // 2 + 1)
                cut := index
                cell := new_cell (current_array.duplicate (count))
                cell.put_right (active.right)
                cell.put_left (active)
                if last_element = active then
                    last_element := cell
                end
                if pos < cut then
                    current_array.go_i_th (pos)
                    current_array.put_left (v)
                elseif pos = cut then
                    current_array.extend (v);
                    active := cell;
                    active.item.start
                else
                    active := cell
                    current_array := cell.item
                    current_array.go_i_th (pos - cut + 1)
                    current_array.put_left (v)
                end
            end
            index := index + 1
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            forth
            put_left (v)
            back
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: like item) is
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        do
            active.item.replace (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
        require -- from COLLECTION
            prunable
        local
            cell: like active
            array: ARRAYED_LIST [G]
        do
            from
                cell := first_element
            until
                cell = void
            loop
                array := cell.item
                if object_comparison then
                    array.compare_objects
                else
                    array.compare_references
                end
                count := count - array.count
                array.prune_all (v)
                count := count + array.count
                if array.is_empty then
                    if cell = first_element then
                        if cell /= last_element then
                            first_element := cell.right
                            cell := first_element
                            cell.forget_left
                        else
                            cell := void
                        end
                    elseif cell = last_element then
                        last_element := cell.left;
                        last_element.forget_right;
                        cell := void
                    else
                        cell.right.put_left (cell.left)
                        cell := cell.right
                    end
                else
                    cell := cell.right
                end
            end
            active := last_element
            index := count + 1
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            current_array: ARRAYED_LIST [G]
        do
            current_array := active.item
            current_array.remove
            if current_array.is_empty then
                if active = first_element then
                    if active /= last_element then
                        first_element := active.right
                        first_element.forget_left
                    end
                elseif active = last_element then
                    last_element := active.left;
                    last_element.forget_right
                else
                    active.right.put_left (active.left)
                    active := active.right
                end
            elseif current_array.after then
                if active /= last_element then
                    active := active.right;
                    active.item.start
                end
            end
            count := count - 1
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            back
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            forth
            remove
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            count := 0
            index := 0
            check
                first_element /= void
            end
            first_element.item.wipe_out
            first_element.forget_right
            active := first_element
            last_element := first_element
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                pos := cursor
                Result := new_chain
            until
                (counter = n) or exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {MULTI_ARRAY_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position

    active_array: ARRAYED_LIST [G] is
            -- Array_sequence at cursor position
        require
            active_exists: active /= void
            not_off: not off
        do
            Result := active.item
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (block_size)
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {NONE} -- Implementation

    go_before is
            -- Move the cursor before first position.
        do
            active := void
            index := 0
        ensure
            is_before: before
        end

    new_cell (a: ARRAYED_LIST [G]): like first_element is
        do
            create Result
            Result.put (a)
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    writable_definition: writable = not off
    readable_definition: readable = not off
    extendible_definition: extendible
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTI_ARRAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTI_ARRAY_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Lists implemented as sequences of arrays, the last of which may
        be non-full. No limit on size (a new array is allocated if list
        outgrows its initial allocation).
    ]"
    status: "See notice at end of class"
    names: list, sequence
    representation: array, linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    MULTI_ARRAY_LIST [G]

create

    make (b: INTEGER)
            -- Create an empty list, setting block_size to b

feature -- Initialization

    make (b: INTEGER)
            -- Create an empty list, setting block_size to b

feature -- Access

    block_size: INTEGER

    cursor: CURSOR
            -- Current cursor position

    first: like item
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- First array_sequence element of the list

    has (v: like item): BOOLEAN
            -- Does list include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    last_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- Last array_sequence element of the list

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move cursor to first position (at or after current
            -- cursor position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at the beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    writable_definition: writable = not off
    readable_definition: readable = not off
    extendible_definition: extendible
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTI_ARRAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTI_ARRAY_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MULTI_ARRAY_LIST [G]

Ancestors
    DYNAMIC_LIST [G]

Clients
    MULTI_ARRAY_LIST [G]

Suppliers
    ARRAYED_LIST [G]
    BI_LINKABLE [G]
    BOOLEAN
    INTEGER
    MULTAR_LIST_CURSOR [G]
    MULTI_ARRAY_LIST [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MULTI_ARRAY_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Lists implemented as sequences of arrays, the last of which may
        be non-full. No limit on size (a new array is allocated if list
        outgrows its initial allocation).
    ]"
    status: "See notice at end of class"
    names: list, sequence
    representation: array, linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    MULTI_ARRAY_LIST [G]

create
    make

feature -- Initialization

    make (b: INTEGER)
            -- Create an empty list, setting block_size to b

feature -- Access

    item: G
            -- Item at cursor position

    first: like item
            -- Item at first position

    last: like item
            -- Item at last position

    has (v: like item): BOOLEAN
            -- Does list include v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    index: INTEGER
            -- Current cursor index

    cursor: CURSOR
            -- Current cursor position

    first_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- First array_sequence element of the list

    last_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- Last array_sequence element of the list

    block_size: INTEGER

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    full: BOOLEAN

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

feature -- Cursor movement

    start
            -- Move cursor to first position.
            -- (No effect if empty)

    finish
            -- Move cursor to last position.
            -- (No effect if empty)

    forth
            -- Move cursor to next position, if any.

    back
            -- Move cursor to previous position, if any.

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.

    go_to (p: CURSOR)
            -- Move cursor to position p

    search (v: like item)
            -- Move cursor to first position (at or after current
            -- cursor position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)

feature -- Element change

    replace (v: like item)
            -- Replace current item by v.

    extend (v: like item)
            -- Add v to end.

    put_front (v: like item)
            -- Add v at the beginning.
            -- Do not move cursor.

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.

    put_right (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.

feature -- Removal

    wipe_out
            -- Remove all items.

    remove
            -- Remove current item

    remove_left

    remove_right

    prune_all (v: like item)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items

invariant

    writable_definition: writable = not off
    readable_definition: readable = not off
    extendible_definition: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTI_ARRAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists whose items are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    PART_SORTED_LIST [G -> PART_COMPARABLE]

inherit
    LIST [G]
        redefine
            has,
            extend
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        end

    search_after (v: like item) is
            -- Go to first position with item greater
            -- than or equal to v.
        do
            from
                start
            until
                after or else v <= item
            loop
                forth
            end
        ensure
            argument_less_than_item: (not after) implies (v <= item)
        end

    search_before (v: like item) is
            -- Go to last position with item less
            -- than or equal to v.
        do
            from
                finish
            until
                before or else v >= item
            loop
                back
            end
        ensure
            (not off) implies (item <= v)
        end

feature -- Element change

    extend (v: like item) is
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        deferred
        ensure then
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v
        end

    merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then
            remains_sorted: (old sorted) implies sorted
        end

feature -- Status report

    sorted: BOOLEAN is
        deferred
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PART_SORTED_LIST [G -> PART_COMPARABLE]

General
    cluster: base.structures.list
    description:
        "Sequential lists whose items are sorted in ascending order
        according to the relational operators of PART_COMPARABLE"

Ancestors
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] PART_SORTED_LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] PART_SORTED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge (other: LINEAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists whose items are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    PART_SORTED_LIST [G -> PART_COMPARABLE]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index
            -- (from CHAIN)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like item is
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            finish
            Result := item
            go_to (pos)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search_after (v: like item) is
            -- Go to first position with item greater
            -- than or equal to v.
        do
            from
                start
            until
                after or else v <= item
            loop
                forth
            end
        ensure
            argument_less_than_item: (not after) implies (v <= item)
        end

    search_before (v: like item) is
            -- Go to last position with item less
            -- than or equal to v.
        do
            from
                finish
            until
                before or else v >= item
            loop
                back
            end
        ensure
            (not off) implies (item <= v)
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    sorted: BOOLEAN is
        deferred
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LIST)
        require -- from LINEAR
            not_after: not after
        deferred
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        local
            counter, pos, final: INTEGER
        do
            if i > 0 then
                from
                until
                    (counter = i) or else off
                loop
                    forth
                    counter := counter + 1
                end
            elseif i < 0 then
                final := index + i;
                if final <= 0 then
                    start;
                    back
                else
                    from
                        start
                        pos := 1
                    until
                        pos = final
                    loop
                        forth
                        pos := pos + 1
                    end
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then
            remains_sorted: (old sorted) implies sorted
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists whose items are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PART_SORTED_LIST [G -> PART_COMPARABLE]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
        ensure
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
        ensure
            (not off) implies (item <= v)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    sorted: BOOLEAN

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
        ensure then
            remains_sorted: (old sorted) implies sorted

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    PART_SORTED_LIST [G -> PART_COMPARABLE]

Ancestors
    LIST [G]

Descendants
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
    SORTED_LIST [G -> COMPARABLE]

Clients
    PART_SORTED_LIST [G -> PART_COMPARABLE]

Suppliers
    BOOLEAN
    LINEAR [G]
    PART_COMPARABLE
    PART_SORTED_LIST [G -> PART_COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists whose items are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PART_SORTED_LIST [G -> PART_COMPARABLE]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
        ensure
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
        ensure
            (not off) implies (item <= v)

feature -- Element change

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        ensure then
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
        ensure then
            remains_sorted: (old sorted) implies sorted

feature -- Status report

    sorted: BOOLEAN

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_TWO_WAY_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted"
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

inherit
    TWO_WAY_LIST [G]
        undefine
            has,
            search,
            is_inserted
        redefine
            prune_all,
            extend,
            new_chain
        end

    PART_SORTED_LIST [G]
        undefine
            move,
            remove,
            before,
            go_i_th,
            isfirst,
            start,
            finish,
            readable,
            islast,
            first,
            prune,
            after,
            last,
            off,
            prune_all,
            copy,
            is_equal
        end

create
    make

feature -- Element change

    extend (v: like item) is
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        do
            search_after (v)
            put_left (v)
            back
        end

feature -- Removal

    prune_all (v: like item) is
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        do
            from
                start
                search (v)
            until
                off or else v < item
            loop
                remove
            end
            if not off then
                finish
                forth
            end
        end

feature -- Status report

    sorted: BOOLEAN is
            -- is the structures topologically sorted
            -- i.e i < j implies not i_th (i) > i_th (j)
        local
            c: CURSOR
            prev: like item
        do
            Result := True
            if count > 1 then
                from
                    c := cursor
                    start
                    check
                        not off
                    end
                    prev := item
                    forth
                until
                    after or not Result
                loop
                    Result := (prev <= item)
                    prev := item
                    forth
                end
                go_to (c)
            end
        end

feature -- Transformation

    sort is
            -- sort the list
            -- Has O(count * log (count)) complexity.
        local
            no_change: BOOLEAN
            gap: INTEGER
            left_cell, cell: like first_element
            left_cell_item, cell_item: like item
        do
            if not is_empty then
                from
                    gap := count * 10 // 13
                until
                    gap = 0
                loop
                    from
                        no_change := False
                        go_i_th (1 + gap)
                    until
                        no_change
                    loop
                        no_change := True
                        from
                            left_cell := first_element
                            cell := active
                        until
                            cell = void
                        loop
                            left_cell_item := left_cell.item
                            cell_item := cell.item
                            if cell_item < left_cell_item then
                                no_change := False
                                cell.put (left_cell_item)
                                left_cell.put (cell_item)
                            end
                            left_cell := left_cell.right
                            cell := cell.right
                        end
                    end
                    gap := gap * 10 // 13
                end
            end
        end

feature {PART_SORTED_TWO_WAY_LIST} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_TWO_WAY_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

General
    cluster: base.structures.list
    description: "Two-way lists, kept sorted"
    create: make

Ancestors
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    TWO_WAY_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] PART_SORTED_TWO_WAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] PART_SORTED_TWO_WAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    sublist: [like Current] PART_SORTED_TWO_WAY_LIST [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] PART_SORTED_TWO_WAY_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge (other: LINEAR [G])
    merge_left (other: [like Current] PART_SORTED_TWO_WAY_LIST [G])
    merge_right (other: [like Current] PART_SORTED_TWO_WAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    sort
    split (n: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_TWO_WAY_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted"
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search_after (v: like item) is
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                start
            until
                after or else v <= item
            loop
                forth
            end
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)
        end

    search_before (v: like item) is
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                finish
            until
                before or else v >= item
            loop
                back
            end
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)
        end

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        do
            Result := (active = last_element) and then not after and then not before
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    sorted: BOOLEAN is
            -- is the structures topologically sorted
            -- i.e i < j implies not i_th (i) > i_th (j)
        local
            c: CURSOR
            prev: like item
        do
            Result := True
            if count > 1 then
                from
                    c := cursor
                    start
                    check
                        not off
                    end
                    prev := item
                    forth
                until
                    after or not Result
                loop
                    Result := (prev <= item)
                    prev := item
                    forth
                end
                go_to (c)
            end
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                active := active.left
                if active = void then
                    active := first_element
                    before := True
                end
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        do
            if not is_empty then
                active := last_element
                after := False
                before := False
            else
                after := False
                before := True
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after
        end

    forth is
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                active := active.right
                if active = void then
                    active := last_element
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        local
            counter: INTEGER
            p: like first_element
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if after then
                    after := False;
                    counter := - 1
                end;
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left
                    counter := counter - 1
                end;
                if p = void then
                    before := True;
                    active := first_element
                else
                    active := p
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature {NONE} -- Cursor movement

    ll_move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        require -- from COLLECTION
            extendible: extendible
        do
            search_after (v)
            put_left (v)
            back
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    last_element := other_last_element
                    first_element := other_first_element
                    if before then
                        active := first_element
                    else
                        active := last_element
                    end
                elseif isfirst then
                    other_last_element.put_right (first_element);
                    first_element := other_first_element
                elseif after then
                    other_first_element.put_left (last_element);
                    last_element := other_last_element;
                    active := last_element
                else
                    other_first_element.put_left (active.left)
                    active.put_left (other_last_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if is_empty or else islast then
                last_element := other.last_element
            end
            ll_merge_right (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        do
            ll_put_front (v)
            if count = 1 then
                last_element := first_element
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                last_element := p
                active := p
                before := False
            elseif after then
                p.put_left (last_element);
                last_element := p;
                active := p
            elseif isfirst then
                p.put_right (active);
                first_element := p
            else
                p.put_left (active.left)
                p.put_right (active)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            was_last: BOOLEAN
        do
            was_last := islast
            ll_put_right (v)
            if count = 1 then
                last_element := active
            elseif was_last then
                last_element := active.right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    ll_put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    ll_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                off or else v < item
            loop
                remove
            end
            if not off then
                finish
                forth
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            succ, pred, removed: like first_element
        do
            removed := active
            if isfirst then
                active := first_element.right
                first_element.forget_right
                first_element := active
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                    last_element := void
                end
            elseif islast then
                active := last_element.left;
                last_element.forget_left;
                last_element := active;
                after := True
            else
                pred := active.left
                succ := active.right
                pred.forget_right
                succ.forget_left
                pred.put_right (succ)
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            back
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            forth
            remove
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    remove_sublist is
            -- (from TWO_WAY_LIST)
        do
            sublist := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_element
        do
            if n = 0 then
                create sublist.make
            else
                active_index := index
                if active_index + n > count + 1 then
                    actual_number := count + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := active
                p_elem := previous
                move (actual_number - 1)
                e_elem := active
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                count := count - actual_number
                if p_elem /= void then
                    p_elem.put_right (n_elem)
                else
                    first_element := n_elem
                end
                if n_elem /= void then
                    active := n_elem
                else
                    last_element := p_elem
                    active := p_elem
                    after := True
                end
            end
        end

    wipe_out is
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            ll_wipe_out
            last_element := void
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    ll_wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    sort is
            -- sort the list
            -- Has O(count * log (count)) complexity.
        local
            no_change: BOOLEAN
            gap: INTEGER
            left_cell, cell: like first_element
            left_cell_item, cell_item: like item
        do
            if not is_empty then
                from
                    gap := count * 10 // 13
                until
                    gap = 0
                loop
                    from
                        no_change := False
                        go_i_th (1 + gap)
                    until
                        no_change
                    loop
                        no_change := True
                        from
                            left_cell := first_element
                            cell := active
                        until
                            cell = void
                        loop
                            left_cell_item := left_cell.item
                            cell_item := cell.item
                            if cell_item < left_cell_item then
                                no_change := False
                                cell.put (left_cell_item)
                                left_cell.put (cell_item)
                            end
                            left_cell := left_cell.right
                            cell := cell.right
                        end
                    end
                    gap := gap * 10 // 13
                end
            end
        end

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {PART_SORTED_TWO_WAY_LIST} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {TWO_WAY_LIST} -- Implementation

    make_sublist (first_item, last_item: like first_element; n: INTEGER) is
            -- Create sublist
            -- (from TWO_WAY_LIST)
        do
            make
            first_element := first_item
            last_element := last_item
            active := first_element
            count := n
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the type of first_element.
            -- (from TWO_WAY_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from TWO_WAY_LIST)
        do
            if after then
                Result := active
            elseif active /= void then
                Result := active.left
            end
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_TWO_WAY_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted"
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    sorted: BOOLEAN
            -- is the structures topologically sorted
            -- i.e i < j implies not i_th (i) > i_th (j)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    sort
            -- sort the list
            -- Has O(count * log (count)) complexity.

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_TWO_WAY_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

Ancestors
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    TWO_WAY_LIST [G]

Descendants
    PART_SORTED_SET [G -> PART_COMPARABLE]

Clients
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

Suppliers
    BI_LINKABLE [G]
    BOOLEAN
    INTEGER
    PART_COMPARABLE
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_TWO_WAY_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted"
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

class interface
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

create
    make

feature -- Element change

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.

feature -- Removal

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.

feature -- Status report

    sorted: BOOLEAN
            -- is the structures topologically sorted
            -- i.e i < j implies not i_th (i) > i_th (j)

feature -- Transformation

    sort
            -- sort the list
            -- Has O(count * log (count)) complexity.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQUENCE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Finite sequences: structures where existing items are arranged
        and accessed sequentially, and new ones can be added at the end.
    ]"
    status: "See notice at end of class"
    names: sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    SEQUENCE [G]

inherit
    ACTIVE [G]
        redefine
            prune_all
        end

    BILINEAR [G]

    FINITE [G]

feature -- Status report

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not off
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := not off
        end

feature -- Element change

    force (v: like item) is
            -- Add v to end.
        require
            extendible: extendible
        do
            extend (v)
        ensure then
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
        require
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure
            new_count: count >= old count
        end

    put (v: like item) is
            -- Add v to end.
        do
            extend (v)
        ensure then
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQUENCE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SEQUENCE [G]

General
    cluster: base.structures.list
    description:
        "Finite sequences: structures where existing items are arranged
        and accessed sequentially, and new ones can be added at the end."

Ancestors
    ACTIVE [G]
    BILINEAR [G]
    FINITE [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQUENCE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Finite sequences: structures where existing items are arranged
        and accessed sequentially, and new ones can be added at the end.
    ]"
    status: "See notice at end of class"
    names: sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    SEQUENCE [G]

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINEAR)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from BILINEAR)
        do
            Result := before or after
        end

feature {NONE} -- Access

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)
        deferred
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
        do
            Result := not off
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)
        deferred
        end

    finish is
            -- Move to last position.
            -- (from LINEAR)
        deferred
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move to first position if any.
            -- (from TRAVERSABLE)
        deferred
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
        require
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure
            new_count: count >= old count
        end

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
        require
            extendible: extendible
        do
            extend (v)
        ensure then
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    put (v: like item) is
            -- Add v to end.
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            new_count: count = old count + 1
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQUENCE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Finite sequences: structures where existing items are arranged
        and accessed sequentially, and new ones can be added at the end.
    ]"
    status: "See notice at end of class"
    names: sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SEQUENCE [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    off: BOOLEAN
            -- Is there no current item?
            -- (from BILINEAR)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
        require
            argument_not_void: s /= void
        ensure
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
        require
            extendible: extendible
        ensure then
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Add v to end.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            new_count: count = old count + 1

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQUENCE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SEQUENCE [G]

Ancestors
    ACTIVE [G]
    BILINEAR [G]
    FINITE [G]

Descendants
    CHAIN [G]
    FILE
    SEQ_STRING

Clients
    SEQUENCE [G]

Suppliers
    BOOLEAN
    INTEGER
    SEQUENCE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SEQUENCE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Finite sequences: structures where existing items are arranged
        and accessed sequentially, and new ones can be added at the end.
    ]"
    status: "See notice at end of class"
    names: sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SEQUENCE [G]

feature -- Status report

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Element change

    force (v: like item)
            -- Add v to end.
        require
            extendible: extendible
        ensure then
            new_count: count = old count + 1
            item_inserted: has (v)

    append (s: SEQUENCE [G])
            -- Append a copy of s.
        require
            argument_not_void: s /= void
        ensure
            new_count: count >= old count

    put (v: like item)
            -- Add v to end.
        ensure then
            new_count: count = old count + 1

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists where the cells are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    SORTED_LIST [G -> COMPARABLE]

inherit
    PART_SORTED_LIST [G]

feature -- Measurement

    min: like item is
            -- Minimum item
        require
            not_empty: not is_empty
        do
            Result := first
        ensure
            min_is_first: Result = first
        end

    max: like item is
            -- Maximum item
        require
            not_empty: not is_empty
        do
            Result := last
        ensure
            max_is_last: Result = last
        end

    median: like item is
            -- Median item
        require
            not_empty: not is_empty
        do
            Result := i_th ((count + 1) // 2)
        ensure
            median_definition: Result = i_th ((count + 1) // 2)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SORTED_LIST [G -> COMPARABLE]

General
    cluster: base.structures.list
    description:
        "Sequential lists where the cells are sorted in ascending order
        according to the relational operators of PART_COMPARABLE"

Ancestors
    PART_SORTED_LIST [G -> PART_COMPARABLE]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] SORTED_LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] SORTED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge (other: LINEAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists where the cells are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class
    SORTED_LIST [G -> COMPARABLE]

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index
            -- (from CHAIN)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        deferred
        end

    last: like item is
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            finish
            Result := item
            go_to (pos)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search_after (v: like item) is
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                start
            until
                after or else v <= item
            loop
                forth
            end
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)
        end

    search_before (v: like item) is
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                finish
            until
                before or else v >= item
            loop
                back
            end
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    max: like item is
            -- Maximum item
        require
            not_empty: not is_empty
        do
            Result := last
        ensure
            max_is_last: Result = last
        end

    median: like item is
            -- Median item
        require
            not_empty: not is_empty
        do
            Result := i_th ((count + 1) // 2)
        ensure
            median_definition: Result = i_th ((count + 1) // 2)
        end

    min: like item is
            -- Minimum item
        require
            not_empty: not is_empty
        do
            Result := first
        ensure
            min_is_first: Result = first
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    sorted: BOOLEAN is
            -- (from PART_SORTED_LIST)
        deferred
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)
        deferred
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LIST)
        require -- from LINEAR
            not_after: not after
        deferred
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        deferred
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        local
            counter, pos, final: INTEGER
        do
            if i > 0 then
                from
                until
                    (counter = i) or else off
                loop
                    forth
                    counter := counter + 1
                end
            elseif i < 0 then
                final := index + i;
                if final <= 0 then
                    start;
                    back
                else
                    from
                        start
                        pos := 1
                    until
                        pos = final
                    loop
                        forth
                        pos := pos + 1
                    end
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (1)
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
            -- (from PART_SORTED_LIST)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        deferred
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        deferred
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists where the cells are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:34 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SORTED_LIST [G -> COMPARABLE]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    max: like item
            -- Maximum item
        require
            not_empty: not is_empty
        ensure
            max_is_last: Result = last

    median: like item
            -- Median item
        require
            not_empty: not is_empty
        ensure
            median_definition: Result = i_th ((count + 1) // 2)

    min: like item
            -- Minimum item
        require
            not_empty: not is_empty
        ensure
            min_is_first: Result = first

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    sorted: BOOLEAN
            -- (from PART_SORTED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
            -- (from PART_SORTED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SORTED_LIST [G -> COMPARABLE]

Ancestors
    PART_SORTED_LIST [G -> PART_COMPARABLE]

Descendants
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Clients
    SORTED_LIST [G -> COMPARABLE]

Suppliers
    BOOLEAN
    INTEGER
    SORTED_LIST [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sequential lists where the cells are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SORTED_LIST [G -> COMPARABLE]

feature -- Measurement

    min: like item
            -- Minimum item
        require
            not_empty: not is_empty
        ensure
            min_is_first: Result = first

    max: like item
            -- Maximum item
        require
            not_empty: not is_empty
        ensure
            max_is_last: Result = last

    median: like item
            -- Median item
        require
            not_empty: not is_empty
        ensure
            median_definition: Result = i_th ((count + 1) // 2)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_TWO_WAY_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted."
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

inherit
    TWO_WAY_LIST [G]
        undefine
            has,
            search,
            copy,
            is_equal,
            is_inserted
        redefine
            prune_all,
            extend,
            new_chain
        end

    SORTED_LIST [G]
        undefine
            move,
            remove,
            before,
            go_i_th,
            isfirst,
            start,
            finish,
            readable,
            islast,
            first,
            prune,
            after,
            last,
            off,
            prune_all
        end

create
    make

feature -- Element change

    extend (v: like item) is
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
        do
            search_after (v)
            put_left (v)
            back
        end

feature -- Removal

    prune_all (v: like item) is
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        do
            from
                start
                search (v)
            until
                off or else v < item
            loop
                remove
            end
            if not off then
                finish
                forth
            end
        end

feature -- Transformation

    sort is
            -- Sort all items.
            -- Has O(count * log (count)) complexity.
        local
            no_change: BOOLEAN
            gap: INTEGER
            left_cell, cell: like first_element
            left_cell_item, cell_item: like item
        do
            if not is_empty then
                from
                    gap := count * 10 // 13
                until
                    gap = 0
                loop
                    from
                        no_change := False
                        go_i_th (1 + gap)
                    until
                        no_change
                    loop
                        no_change := True
                        from
                            left_cell := first_element
                            cell := active
                        until
                            cell = void
                        loop
                            left_cell_item := left_cell.item
                            cell_item := cell.item
                            if cell_item < left_cell_item then
                                no_change := False
                                cell.put (left_cell_item)
                                left_cell.put (cell_item)
                            end
                            left_cell := left_cell.right
                            cell := cell.right
                        end
                    end
                    gap := gap * 10 // 13
                end
            end
        end

feature -- Status report

    sorted: BOOLEAN is
            -- Is the structure sorted?
        local
            c: CURSOR
            prev: like item
        do
            Result := True
            if count > 1 then
                from
                    c := cursor
                    start
                    check
                        not off
                    end
                    prev := item
                    forth
                until
                    after or not Result
                loop
                    Result := (prev <= item)
                    prev := item
                    forth
                end
                go_to (c)
            end
        end

feature {SORTED_TWO_WAY_LIST} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_TWO_WAY_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

General
    cluster: base.structures.list
    description: "Two-way lists, kept sorted."
    create: make

Ancestors
    SORTED_LIST [G -> COMPARABLE]
    TWO_WAY_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] SORTED_TWO_WAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] SORTED_TWO_WAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    sublist: [like Current] SORTED_TWO_WAY_LIST [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge (other: LINEAR [G])
    merge_left (other: [like Current] SORTED_TWO_WAY_LIST [G])
    merge_right (other: [like Current] SORTED_TWO_WAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    sort
    split (n: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_TWO_WAY_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted."
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search_after (v: like item) is
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                start
            until
                after or else v <= item
            loop
                forth
            end
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)
        end

    search_before (v: like item) is
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                finish
            until
                before or else v >= item
            loop
                back
            end
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)
        end

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    max: like item is
            -- Maximum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := last
        ensure -- from SORTED_LIST
            max_is_last: Result = last
        end

    median: like item is
            -- Median item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := i_th ((count + 1) // 2)
        ensure -- from SORTED_LIST
            median_definition: Result = i_th ((count + 1) // 2)
        end

    min: like item is
            -- Minimum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := first
        ensure -- from SORTED_LIST
            min_is_first: Result = first
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        do
            Result := (active = last_element) and then not after and then not before
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    sorted: BOOLEAN is
            -- Is the structure sorted?
        local
            c: CURSOR
            prev: like item
        do
            Result := True
            if count > 1 then
                from
                    c := cursor
                    start
                    check
                        not off
                    end
                    prev := item
                    forth
                until
                    after or not Result
                loop
                    Result := (prev <= item)
                    prev := item
                    forth
                end
                go_to (c)
            end
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                active := active.left
                if active = void then
                    active := first_element
                    before := True
                end
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        do
            if not is_empty then
                active := last_element
                after := False
                before := False
            else
                after := False
                before := True
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after
        end

    forth is
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                active := active.right
                if active = void then
                    active := last_element
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        local
            counter: INTEGER
            p: like first_element
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if after then
                    after := False;
                    counter := - 1
                end;
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left
                    counter := counter - 1
                end;
                if p = void then
                    before := True;
                    active := first_element
                else
                    active := p
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature {NONE} -- Cursor movement

    ll_move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
        require -- from COLLECTION
            extendible: extendible
        do
            search_after (v)
            put_left (v)
            back
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    last_element := other_last_element
                    first_element := other_first_element
                    if before then
                        active := first_element
                    else
                        active := last_element
                    end
                elseif isfirst then
                    other_last_element.put_right (first_element);
                    first_element := other_first_element
                elseif after then
                    other_first_element.put_left (last_element);
                    last_element := other_last_element;
                    active := last_element
                else
                    other_first_element.put_left (active.left)
                    active.put_left (other_last_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if is_empty or else islast then
                last_element := other.last_element
            end
            ll_merge_right (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        do
            ll_put_front (v)
            if count = 1 then
                last_element := first_element
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                last_element := p
                active := p
                before := False
            elseif after then
                p.put_left (last_element);
                last_element := p;
                active := p
            elseif isfirst then
                p.put_right (active);
                first_element := p
            else
                p.put_left (active.left)
                p.put_right (active)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            was_last: BOOLEAN
        do
            was_last := islast
            ll_put_right (v)
            if count = 1 then
                last_element := active
            elseif was_last then
                last_element := active.right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    ll_put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    ll_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                off or else v < item
            loop
                remove
            end
            if not off then
                finish
                forth
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            succ, pred, removed: like first_element
        do
            removed := active
            if isfirst then
                active := first_element.right
                first_element.forget_right
                first_element := active
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                    last_element := void
                end
            elseif islast then
                active := last_element.left;
                last_element.forget_left;
                last_element := active;
                after := True
            else
                pred := active.left
                succ := active.right
                pred.forget_right
                succ.forget_left
                pred.put_right (succ)
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            back
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            forth
            remove
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    remove_sublist is
            -- (from TWO_WAY_LIST)
        do
            sublist := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_element
        do
            if n = 0 then
                create sublist.make
            else
                active_index := index
                if active_index + n > count + 1 then
                    actual_number := count + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := active
                p_elem := previous
                move (actual_number - 1)
                e_elem := active
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                count := count - actual_number
                if p_elem /= void then
                    p_elem.put_right (n_elem)
                else
                    first_element := n_elem
                end
                if n_elem /= void then
                    active := n_elem
                else
                    last_element := p_elem
                    active := p_elem
                    after := True
                end
            end
        end

    wipe_out is
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            ll_wipe_out
            last_element := void
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    ll_wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    sort is
            -- Sort all items.
            -- Has O(count * log (count)) complexity.
        local
            no_change: BOOLEAN
            gap: INTEGER
            left_cell, cell: like first_element
            left_cell_item, cell_item: like item
        do
            if not is_empty then
                from
                    gap := count * 10 // 13
                until
                    gap = 0
                loop
                    from
                        no_change := False
                        go_i_th (1 + gap)
                    until
                        no_change
                    loop
                        no_change := True
                        from
                            left_cell := first_element
                            cell := active
                        until
                            cell = void
                        loop
                            left_cell_item := left_cell.item
                            cell_item := cell.item
                            if cell_item < left_cell_item then
                                no_change := False
                                cell.put (left_cell_item)
                                left_cell.put (cell_item)
                            end
                            left_cell := left_cell.right
                            cell := cell.right
                        end
                    end
                    gap := gap * 10 // 13
                end
            end
        end

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {SORTED_TWO_WAY_LIST} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {TWO_WAY_LIST} -- Implementation

    make_sublist (first_item, last_item: like first_element; n: INTEGER) is
            -- Create sublist
            -- (from TWO_WAY_LIST)
        do
            make
            first_element := first_item
            last_element := last_item
            active := first_element
            count := n
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the type of first_element.
            -- (from TWO_WAY_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from TWO_WAY_LIST)
        do
            if after then
                Result := active
            elseif active /= void then
                Result := active.left
            end
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_TWO_WAY_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted."
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    max: like item
            -- Maximum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            max_is_last: Result = last

    median: like item
            -- Median item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            median_definition: Result = i_th ((count + 1) // 2)

    min: like item
            -- Minimum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            min_is_first: Result = first

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    sorted: BOOLEAN
            -- Is the structure sorted?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    sort
            -- Sort all items.
            -- Has O(count * log (count)) complexity.

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_TWO_WAY_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Ancestors
    SORTED_LIST [G -> COMPARABLE]
    TWO_WAY_LIST [G]

Descendants
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Clients
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Suppliers
    BI_LINKABLE [G]
    BOOLEAN
    COMPARABLE
    INTEGER
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_TWO_WAY_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-way lists, kept sorted."
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

create
    make

feature -- Element change

    extend (v: like item)
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.

feature -- Removal

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.

feature -- Transformation

    sort
            -- Sort all items.
            -- Has O(count * log (count)) complexity.

feature -- Status report

    sorted: BOOLEAN
            -- Is the structure sorted?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CIRCULAR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as two-way linked lists"
    status: "See notice at end of class"
    names: two_way_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_CIRCULAR [G]

inherit
    LINKED_CIRCULAR [G]
        redefine
            list
        end

create
    make

feature -- Implementation

    list: TWO_WAY_LIST [G]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CIRCULAR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains implemented as two-way linked lists"
    create: make

Ancestors
    LINKED_CIRCULAR [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] TWO_WAY_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_CIRCULAR [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    list: TWO_WAY_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] TWO_WAY_CIRCULAR [G])
    merge_right (other: [like Current] TWO_WAY_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CIRCULAR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as two-way linked lists"
    status: "See notice at end of class"
    names: two_way_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_CIRCULAR [G]

create
    make

feature -- Initialization

    make is
            -- Create an empty list
            -- (from LINKED_CIRCULAR)
        do
            create list.make
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_CIRCULAR)
        do
            create {CIRCULAR_CURSOR} Result.make (list.cursor, internal_exhausted, starter)
        end

    first: G is
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            start
            Result := item
            move (pos - 1)
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)
        local
            first_ind, std_ind: INTEGER
            p: CURSOR
        do
            p := cursor
            std_ind := standard_index
            start
            first_ind := standard_index
            Result := std_ind - first_ind + 1
            if Result < 0 then
                Result := count + Result
            end
            move (Result - 1)
            go_to (p)
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_CIRCULAR)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := list.item
        end

    last: like first is
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: INTEGER
        do
            pos := standard_index
            finish
            Result := item
            start
            move (pos - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    l_first: like item is
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty
        local
            pos: CURSOR
        do
            pos := cursor
            start
            Result := item
            go_to (pos)
        end

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from LINKED_CIRCULAR)
        do
            Result := list.count
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_after
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        do
            Result := is_empty and standard_before
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        do
            Result := is_empty or internal_exhausted
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_CIRCULAR)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor on first item?
            -- (from LINKED_CIRCULAR)
        do
            if not is_empty then
                if starter = 0 then
                    Result := list.isfirst
                else
                    Result := (standard_index = starter)
                end
            end
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor on last item?
            -- (from LINKED_CIRCULAR)
        do
            if not is_empty then
                if (starter = 0) or (starter = 1) then
                    Result := standard_islast
                else
                    Result := (standard_index = starter - 1)
                end
            end
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CIRCULAR)
        do
            Result := is_empty
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_CIRCULAR)
        do
            Result := list.readable
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_CIRCULAR)
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                Result := list.valid_cursor (c_c.cursor)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        do
            Result := (i >= 0) and (i <= count)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be written?
            -- (from LINKED_CIRCULAR)
        do
            Result := list.writable
        end

feature {NONE} -- Status report

    l_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    l_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    l_off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before
        do
            if isfirst then
                internal_exhausted := True
            end
            standard_back
            if standard_before then
                standard_finish
            end
        end

    finish is
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        do
            if not is_empty then
                go_i_th (count)
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        end

    forth is
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        do
            if islast then
                internal_exhausted := True
            end
            standard_forth
            if standard_after then
                standard_start
            end
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        do
            start
            move (i - 1)
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_CIRCULAR)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            c_c: CIRCULAR_CURSOR
        do
            c_c ?= p
            if c_c /= void then
                list.go_to (c_c.cursor)
                internal_exhausted := c_c.internal_exhausted
                starter := c_c.starter
            end
        end

    move (i: INTEGER) is
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        local
            real_move, counter, start_index: INTEGER
        do
            if i /= 0 and count > 0 then
                start_index := index
                real_move := i \\ count
                if real_move < 0 then
                    real_move := count + real_move
                end
                from
                until
                    counter = real_move
                loop
                    forth
                    counter := counter + 1
                end
                if (start_index + i > count) or (start_index + i < 1) then
                    internal_exhausted := True
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    set_start is
            -- Select current item as the first.
            -- (from LINKED_CIRCULAR)
        require -- from CIRCULAR
            not_empty: not is_empty
        do
            starter := standard_index
            internal_exhausted := False
        end

    start is
            -- Move to position currently selected as first.
            -- (from LINKED_CIRCULAR)
        do
            internal_exhausted := False
            if starter = 0 then
                standard_start
                starter := 1
            else
                standard_go_i_th (starter)
                if standard_off then
                    standard_start
                end
            end
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        end

feature {NONE} -- Cursor movement

    l_go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            move (i - index)
        ensure -- from CHAIN
            position_expected: index = i
        end

    l_forth is
            -- (from LINKED_CIRCULAR)
        require -- from LINEAR
            not_after: not after
        do
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    l_forth is
            -- (from LINKED_CIRCULAR)
        require -- from LINEAR
            not_after: not after
        do
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from COLLECTION
            extendible: extendible
        local
            e: BOOLEAN
        do
            e := is_empty
            list.extend (v)
            if e then
                start
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        do
            list.merge_left (other.list)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            list.merge_right (other.list)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        do
            list.put_front (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        do
            list.put_left (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            list.put_right (v)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: G) is
            -- Replace current item by v.
            -- (from LINKED_CIRCULAR)
        require -- from ACTIVE
            writable: writable
        do
            list.replace (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
            fix_start_for_remove
            standard_remove
            if standard_after then
                finish
            elseif standard_before then
                start
            end
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from LINKED_CIRCULAR
            count > 1
        do
            if standard_isfirst then
                standard_finish
                remove
            else
                standard_remove_left
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else -- from LINKED_CIRCULAR
            count > 1
        do
            if standard_islast then
                standard_start
                remove
                finish
            else
                standard_remove_right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Removal

    l_prune (v: like item) is
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
            start
            search (v)
            if not exhausted then
                remove
            end
        end

    l_prune_all (v: like item) is
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                exhausted
            loop
                search (v)
                if not exhausted then
                    remove
                end
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            to_be_removed, counter: INTEGER
        do
            from
                Result := new_chain
                pos := cursor
                to_be_removed := count.min (n)
            until
                counter = to_be_removed
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    l_remove is
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

feature -- Implementation

    list: TWO_WAY_LIST [G]

feature {LINKED_CIRCULAR} -- Implementation

    fix_start_for_remove is
            -- Before deletion, update starting position if necessary.
            -- (from LINKED_CIRCULAR)
        do
            if count = 1 then
                starter := 0
            elseif starter = standard_index then
                if standard_islast then
                    starter := 1
                else
                    starter := starter + 1
                end
            end
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_CIRCULAR)
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    standard_after: BOOLEAN is
            -- (from LINKED_CIRCULAR)
        do
            Result := list.after
        end

    standard_back is
            -- (from LINKED_CIRCULAR)
        do
            list.back
        end

    standard_before: BOOLEAN is
            -- (from LINKED_CIRCULAR)
        do
            Result := list.before
        end

    standard_finish is
            -- (from LINKED_CIRCULAR)
        do
            list.finish
        end

    standard_forth is
            -- (from LINKED_CIRCULAR)
        do
            list.forth
        end

    standard_go_i_th (i: INTEGER) is
            -- (from LINKED_CIRCULAR)
        do
            list.go_i_th (i)
        end

    standard_index: INTEGER is
            -- (from LINKED_CIRCULAR)
        do
            Result := list.index
        end

    standard_isfirst: BOOLEAN is
            -- (from LINKED_CIRCULAR)
        do
            Result := list.isfirst
        end

    standard_islast: BOOLEAN is
            -- (from LINKED_CIRCULAR)
        do
            Result := list.islast
        end

    standard_move (i: INTEGER) is
            -- (from LINKED_CIRCULAR)
        do
            list.move (i)
        end

    standard_off: BOOLEAN is
            -- (from LINKED_CIRCULAR)
        do
            Result := list.off
        end

    standard_remove is
            -- (from LINKED_CIRCULAR)
        do
            list.remove
        end

    standard_remove_left is
            -- (from LINKED_CIRCULAR)
        do
            list.remove_left
        end

    standard_remove_right is
            -- (from LINKED_CIRCULAR)
        do
            list.remove_right
        end

    standard_search (v: G) is
            -- (from LINKED_CIRCULAR)
        do
            list.search (v)
        end

    standard_start is
            -- (from LINKED_CIRCULAR)
        do
            list.start
        end

    starter: INTEGER
            -- The position currently selected as first
            -- (from LINKED_CIRCULAR)

feature {CIRCULAR} -- Implementation

    internal_exhausted: BOOLEAN
            -- Has last forth or back operation exhausted the structure?
            -- (from CIRCULAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CIRCULAR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as two-way linked lists"
    status: "See notice at end of class"
    names: two_way_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_CIRCULAR [G]

create

    make
            -- Create an empty list
            -- (from LINKED_CIRCULAR)

feature -- Initialization

    make
            -- Create an empty list
            -- (from LINKED_CIRCULAR)

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_CIRCULAR)

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_CIRCULAR)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_CIRCULAR)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_CIRCULAR)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor on first item?
            -- (from LINKED_CIRCULAR)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor on last item?
            -- (from LINKED_CIRCULAR)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_CIRCULAR)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_CIRCULAR)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be written?
            -- (from LINKED_CIRCULAR)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_CIRCULAR)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Select current item as the first.
            -- (from LINKED_CIRCULAR)
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move to position currently selected as first.
            -- (from LINKED_CIRCULAR)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from LINKED_CIRCULAR)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from LINKED_CIRCULAR
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else -- from LINKED_CIRCULAR
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Implementation

    list: TWO_WAY_LIST [G]

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CIRCULAR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_CIRCULAR [G]

Ancestors
    LINKED_CIRCULAR [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_CIRCULAR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Circular chains implemented as two-way linked lists"
    status: "See notice at end of class"
    names: two_way_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_CIRCULAR [G]

create
    make

feature -- Implementation

    list: TWO_WAY_LIST [G]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CIRCULAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_LIST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, two-way linked lists"
    status: "See notice at end of class"
    names: two_way_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_LIST [G]

inherit
    LINKED_LIST [G]
        redefine
            first_element,
            last_element,
            extend,
            put_front,
            put_left,
            put_right,
            merge_right,
            merge_left,
            new_cell,
            remove,
            remove_left,
            remove_right,
            wipe_out,
            previous,
            finish,
            move,
            islast,
            new_chain,
            forth,
            back
        select
            put_front,
            merge_right,
            move,
            put_right,
            wipe_out
        end

    LINKED_LIST [G]
        rename
            put_front as ll_put_front,
            put_right as ll_put_right,
            merge_right as ll_merge_right,
            move as ll_move,
            wipe_out as ll_wipe_out
        export
            {NONE} ll_put_front, ll_put_right, ll_move, ll_merge_right, ll_wipe_out
        redefine
            put_left,
            merge_left,
            remove,
            new_chain,
            remove_left,
            finish,
            islast,
            first_element,
            extend,
            last_element,
            previous,
            new_cell,
            remove_right,
            forth,
            back
        end

create
    make_sublist,
    make

feature -- Access

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)

    last_element: like first_element
            -- Tail of the list

    sublist: like Current
            -- Result produced by last split

feature -- Status report

    islast: BOOLEAN is
            -- Is cursor at last position?
        do
            Result := (active = last_element) and then not after and then not before
        end

feature -- Cursor movement

    forth is
            -- Move cursor to next position, if any.
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                active := active.right
                if active = void then
                    active := last_element
                    after := True
                end
            end
        end

    back is
            -- Move cursor to previous position, if any.
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                active := active.left
                if active = void then
                    active := first_element
                    before := True
                end
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
        do
            if not is_empty then
                active := last_element
                after := False
                before := False
            else
                after := False
                before := True
            end
        ensure then
            not_after: not after
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
        local
            counter: INTEGER
            p: like first_element
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if after then
                    after := False;
                    counter := - 1
                end;
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left
                    counter := counter - 1
                end;
                if p = void then
                    before := True;
                    active := first_element
                else
                    active := p
                end
            end
        end

feature -- Element change

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            ll_put_front (v)
            if count = 1 then
                last_element := first_element
            end
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                active := p
            else
                p.put_left (last_element)
            end
            last_element := p
            if after then
                active := p
            end
            count := count + 1
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                last_element := p
                active := p
                before := False
            elseif after then
                p.put_left (last_element);
                last_element := p;
                active := p
            elseif isfirst then
                p.put_right (active);
                first_element := p
            else
                p.put_left (active.left)
                p.put_right (active)
            end
            count := count + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        local
            was_last: BOOLEAN
        do
            was_last := islast
            ll_put_right (v)
            if count = 1 then
                last_element := active
            elseif was_last then
                last_element := active.right
            end
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    last_element := other_last_element
                    first_element := other_first_element
                    if before then
                        active := first_element
                    else
                        active := last_element
                    end
                elseif isfirst then
                    other_last_element.put_right (first_element);
                    first_element := other_first_element
                elseif after then
                    other_first_element.put_left (last_element);
                    last_element := other_last_element;
                    active := last_element
                else
                    other_first_element.put_left (active.left)
                    active.put_left (other_last_element)
                end
                count := count + other_count
                other.wipe_out
            end
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        do
            if is_empty or else islast then
                last_element := other.last_element
            end
            ll_merge_right (other)
        end

feature -- Removal

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        local
            succ, pred, removed: like first_element
        do
            removed := active
            if isfirst then
                active := first_element.right
                first_element.forget_right
                first_element := active
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                    last_element := void
                end
            elseif islast then
                active := last_element.left;
                last_element.forget_left;
                last_element := active;
                after := True
            else
                pred := active.left
                succ := active.right
                pred.forget_right
                succ.forget_left
                pred.put_right (succ)
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        do
            back
            remove
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        do
            forth
            remove
            back
        end

    wipe_out is
            -- Remove all items.
        do
            ll_wipe_out
            last_element := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
        require
            not_off: not off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_element
        do
            if n = 0 then
                create sublist.make
            else
                active_index := index
                if active_index + n > count + 1 then
                    actual_number := count + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := active
                p_elem := previous
                move (actual_number - 1)
                e_elem := active
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                count := count - actual_number
                if p_elem /= void then
                    p_elem.put_right (n_elem)
                else
                    first_element := n_elem
                end
                if n_elem /= void then
                    active := n_elem
                else
                    last_element := p_elem
                    active := p_elem
                    after := True
                end
            end
        end

    remove_sublist is
        do
            sublist := void
        end

feature {TWO_WAY_LIST} -- Implementation

    make_sublist (first_item, last_item: like first_element; n: INTEGER) is
            -- Create sublist
        do
            make
            first_element := first_item
            last_element := last_item
            active := first_element
            count := n
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the type of first_element.
        do
            create Result
            Result.put (v)
        end

    previous: like first_element is
            -- Element left of cursor
        do
            if after then
                Result := active
            elseif active /= void then
                Result := active.left
            end
        end

invariant

    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_LIST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_LIST [G]

General
    cluster: base.structures.list
    description: "Sequential, two-way linked lists"
    create: make_sublist, make

Ancestors
    LINKED_LIST [G]
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] TWO_WAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sublist: [like Current] TWO_WAY_LIST [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] TWO_WAY_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] TWO_WAY_LIST [G])
    merge_right (other: [like Current] TWO_WAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    split (n: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    non empty list has two endpoints
    first element constraint
    last element constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_LIST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, two-way linked lists"
    status: "See notice at end of class"
    names: two_way_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_LIST [G]

create
    make_sublist,
    make

feature -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    last_element: like first_element
            -- Tail of the list

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    sublist: like Current
            -- Result produced by last split

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)
        do
            check
                put_constraint: (v /= last_element.item) implies not off
            end
            Result := (v = last_element.item) or else (v = item)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
        do
            Result := (active = last_element) and then not after and then not before
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                active := active.left
                if active = void then
                    active := first_element
                    before := True
                end
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
        do
            if not is_empty then
                active := last_element
                after := False
                before := False
            else
                after := False
                before := True
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then
            not_after: not after
        end

    forth is
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                active := active.right
                if active = void then
                    active := last_element
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
        local
            counter: INTEGER
            p: like first_element
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if after then
                    after := False;
                    counter := - 1
                end;
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left
                    counter := counter - 1
                end;
                if p = void then
                    before := True;
                    active := first_element
                else
                    active := p
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature {NONE} -- Cursor movement

    ll_move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                active := p
            else
                p.put_left (last_element)
            end
            last_element := p
            if after then
                active := p
            end
            count := count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    last_element := other_last_element
                    first_element := other_first_element
                    if before then
                        active := first_element
                    else
                        active := last_element
                    end
                elseif isfirst then
                    other_last_element.put_right (first_element);
                    first_element := other_first_element
                elseif after then
                    other_first_element.put_left (last_element);
                    last_element := other_last_element;
                    active := last_element
                else
                    other_first_element.put_left (active.left)
                    active.put_left (other_last_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if is_empty or else islast then
                last_element := other.last_element
            end
            ll_merge_right (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
        do
            ll_put_front (v)
            if count = 1 then
                last_element := first_element
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                last_element := p
                active := p
                before := False
            elseif after then
                p.put_left (last_element);
                last_element := p;
                active := p
            elseif isfirst then
                p.put_right (active);
                first_element := p
            else
                p.put_left (active.left)
                p.put_right (active)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            was_last: BOOLEAN
        do
            was_last := islast
            ll_put_right (v)
            if count = 1 then
                last_element := active
            elseif was_last then
                last_element := active.right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    ll_put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    ll_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

feature -- Removal

    prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        local
            succ, pred, removed: like first_element
        do
            removed := active
            if isfirst then
                active := first_element.right
                first_element.forget_right
                first_element := active
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                    last_element := void
                end
            elseif islast then
                active := last_element.left;
                last_element.forget_left;
                last_element := active;
                after := True
            else
                pred := active.left
                succ := active.right
                pred.forget_right
                succ.forget_left
                pred.put_right (succ)
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            back
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            forth
            remove
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    remove_sublist is
        do
            sublist := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
        require
            not_off: not off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_element
        do
            if n = 0 then
                create sublist.make
            else
                active_index := index
                if active_index + n > count + 1 then
                    actual_number := count + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := active
                p_elem := previous
                move (actual_number - 1)
                e_elem := active
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                count := count - actual_number
                if p_elem /= void then
                    p_elem.put_right (n_elem)
                else
                    first_element := n_elem
                end
                if n_elem /= void then
                    active := n_elem
                else
                    last_element := p_elem
                    active := p_elem
                    after := True
                end
            end
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            ll_wipe_out
            last_element := void
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    ll_wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {TWO_WAY_LIST} -- Implementation

    make_sublist (first_item, last_item: like first_element; n: INTEGER) is
            -- Create sublist
        do
            make
            first_element := first_item
            last_element := last_item
            active := first_element
            count := n
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the type of first_element.
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    previous: like first_element is
            -- Element left of cursor
        do
            if after then
                Result := active
            elseif active /= void then
                Result := active.left
            end
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_LIST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, two-way linked lists"
    status: "See notice at end of class"
    names: two_way_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_LIST [G]

create

    make_sublist (first_item, last_item: like first_element; n: INTEGER)
            -- Create sublist

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    sublist: like Current
            -- Result produced by last split

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then
            not_after: not after

    forth
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
        require
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_LIST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_LIST [G]

Ancestors
    LINKED_LIST [G]
    LINKED_LIST [G]

Descendants
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
    TWO_WAY_TREE [G]

Clients
    TWO_WAY_LIST [G]

Suppliers
    BI_LINKABLE [G]
    BOOLEAN
    INTEGER
    TWO_WAY_LIST [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_LIST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sequential, two-way linked lists"
    status: "See notice at end of class"
    names: two_way_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_LIST [G]

create
    make_sublist,
    make

feature -- Access

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)

    last_element: like first_element
            -- Tail of the list

    sublist: like Current
            -- Result produced by last split

feature -- Status report

    islast: BOOLEAN
            -- Is cursor at last position?

feature -- Cursor movement

    forth
            -- Move cursor to next position, if any.

    back
            -- Move cursor to previous position, if any.

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
        ensure then
            not_after: not after

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.

feature -- Element change

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.

feature -- Removal

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.

    wipe_out
            -- Remove all items.

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
        require
            not_off: not off
            valid_sublist: n >= 0

    remove_sublist

invariant

    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_LIST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.set

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.set	(diagram)

Supercluster
    base.structures

Subclusters
    base.structures.set.strategies

Classes
    ARRAYED_SET [G]
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    COMPARABLE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]
    LINKED_SET [G]
    PART_SORTED_SET [G -> PART_COMPARABLE]
    SET [G]
    SUBSET [G]
    TRAVERSABLE_SUBSET [G]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_SET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets represented as arrayed lists"
    status: "See notice at end of class"
    names: arrayed_set, set, arrayed_list
    representation: array
    size: fixed
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_SET [G]

inherit
    LINEAR_SUBSET [G]
        undefine
            prune_all,
            copy,
            is_equal
        select
            extend,
            put,
            prune
        end

    ARRAYED_LIST [G]
        rename
            extend as al_extend,
            put as al_put,
            prune as al_prune
        export
            {NONE} all
        undefine
            is_inserted,
            changeable_comparison_criterion
        end

create
    make

feature -- Element change

    put (v: G) is
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of extend.
        do
            if is_empty or else not has (v) then
                al_extend (v)
            end
        end

    extend (v: G) is
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of put.
        do
            if is_empty or else not has (v) then
                al_extend (v)
            end
        end

feature -- Removal

    prune (v: like item) is
            -- Remove v if present.
        do
            start
            al_prune (v)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_SET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_SET [G]

General
    cluster: base.structures.set
    description: "Sets represented as arrayed lists"
    create: make

Ancestors
    ARRAYED_LIST [G]
    LINEAR_SUBSET [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] ARRAYED_SET [G]
    Extendible: BOOLEAN
    has (v: G): BOOLEAN
    index: INTEGER
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    islast: BOOLEAN
    item: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN
    valid_index (i: INTEGER): BOOLEAN

Commands
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_SET [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    forth
    go_i_th (i: INTEGER)
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: CONTAINER [G])
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_left (v: [like item] G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_SET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets represented as arrayed lists"
    status: "See notice at end of class"
    names: arrayed_set, set, arrayed_list
    representation: array
    size: fixed
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_SET [G]

create
    make

feature {NONE} -- Initialization

    make (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        do
            index := 0
            count := 0
            array_make (1, n)
        ensure -- from ARRAYED_LIST
            correct_position: before
        end

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    make_filled (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        do
            index := 0
            count := n
            array_make (1, n)
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full
        end

    make_from_array (a: ARRAY [G]) is
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void
        do
            Precursor  (a)
            lower := 1
            count := a.count
            upper := count
            index := 0
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (i_th (i) /= void and then i_th (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (i_th (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    item: like first is
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)
        do
            Result := area.item (index - 1)
        end

feature {NONE} -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    cursor: CURSOR is
            -- Current cursor position
            -- (from ARRAYED_LIST)
        do
            create {ARRAYED_LIST_CURSOR} Result.make (index)
        end

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            Result := i_th (i)
        end

    first: G is
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (0)
        end

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    i_th (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

    last: like first is
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := area.item (count - 1)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    array_count: INTEGER is
            -- Number of available indices
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    array_index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (index = count + 1)
        end

    before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (index = 0)
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = count)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (index = 0) or (index = count + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        do
            Result := (1 <= i) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        do
            Result := (1 <= i) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        end

feature {NONE} -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((i_th (upper) = void or else i_th (upper) = i_th (upper).default) and subarray (lower, upper - 1).all_default))
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)
        do
            Result := (count = capacity)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from CHAIN)
        do
            Result := not is_empty and (index = 1)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not off
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (i_th (upper) = other.i_th (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            if al_c /= void then
                Result := valid_cursor_index (al_c.index)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    array_valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = count
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Cursor movement

    back is
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            index := index - 1
        end

    finish is
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        do
            index := count
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            check
                al_c /= void
            end
            index := al_c.index
        end

    move (i: INTEGER) is
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        do
            index := index + i
            if (index > count + 1) then
                index := count + 1
            elseif (index < 0) then
                index := 0
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Cursor movement

    forth is
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        do
            index := index + 1
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        do
            index := i
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i
        end

    start is
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        do
            index := 1
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after
        end

feature -- Element change

    extend (v: G) is
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        do
            if is_empty or else not has (v) then
                al_extend (v)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            lin_rep: LINEAR [G]
        do
            lin_rep ?= other
            if lin_rep = void then
                lin_rep := other.linear_representation
            end
            from
                lin_rep.start
            until
                lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    move_item (v: G) is
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)
        local
            idx: INTEGER
            found: BOOLEAN
        do
            idx := index
            from
                start
            until
                found or after
            loop
                if object_comparison then
                    found := equal (v, item)
                else
                    found := (v = item)
                end
                if not found then
                    forth
                end
            end
            check
                found: found and not after
            end
            remove
            go_i_th (idx)
            put_left (v)
        end

    put (v: G) is
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        do
            if is_empty or else not has (v) then
                al_extend (v)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    put_left (v: like item) is
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        do
            if after or is_empty then
                extend (v)
            else
                insert (v, index)
            end
            index := index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1
        end

feature {NONE} -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    enter (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            area.put (v, i - lower)
        end

    al_extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        do
            count := count + 1
            force_i_th (v, count)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    force (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        do
            count := count + 1
            force_i_th (v, count)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    force_i_th (v: like i_th; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count
        end

    merge_left (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            old_index: INTEGER
            old_other_count: INTEGER
        do
            old_index := index
            old_other_count := other.count
            index := index - 1
            merge_right (other)
            index := old_index + old_other_count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: ARRAYED_LIST [G]) is
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if not other.is_empty then
                resize (1, count + other.count)
                if index < count then
                    subcopy (Current, index + 1, count, index + other.count + 1)
                end
                subcopy (other, 1, other.count, index + 1)
                count := count + other.count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    al_put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_i_th (v: like i_th; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_front (v: like item) is
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        do
            if is_empty then
                extend (v)
            else
                insert (v, 1)
            end
            index := index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_right (v: like item) is
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        do
            if index = count then
                extend (v)
            else
                insert (v, index + 1)
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        end

    replace (v: like first) is
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            put_i_th (v, index)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.array_valid_index (start_pos)
            valid_end_pos: other.array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: array_valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: like item) is
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        do
            start
            al_prune (v)
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        local
            i: INTEGER
            offset: INTEGER
            res: BOOLEAN
            obj_cmp: BOOLEAN
            default_val: like item
        do
            obj_cmp := object_comparison
            from
                i := 1
            until
                i > count
            loop
                if i <= count - offset then
                    if offset > 0 then
                        put_i_th (i_th (i + offset), i)
                    end
                    if obj_cmp then
                        res := equal (v, i_th (i))
                    else
                        res := (v = i_th (i))
                    end
                    if res then
                        offset := offset + 1
                    else
                        i := i + 1
                    end
                else
                    put_i_th (default_val, i)
                    i := i + 1
                end
            end
            count := count - offset
            index := count + 1
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        local
            default_value: G
        do
            if index < count then
                subcopy (Current, index + 1, count, index)
            end
            count := count - 1
            area.put (default_value, count)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index
        end

    wipe_out is
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        do
            count := 0
            index := 0
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    al_prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable
        do
            if before then
                index := 1
            end
            if object_comparison then
                if v /= void then
                    from
                    until
                        after or else (item /= void and then v.is_equal (item))
                    loop
                        forth
                    end
                end
            else
                from
                until
                    after or else item = v
                loop
                    forth
                end
            end
            if not after then
                remove
            end
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            index := index - 1
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            index := index + 1
            remove
            index := index - 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature {NONE} -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        local
            old_item: like item
        do
            old_item := item
            replace (area.item (i - 1))
            area.put (old_item, i - 1)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature {NONE} -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        local
            end_pos: INTEGER
        do
            if after then
                create Result.make (0)
            else
                end_pos := count.min (index + n - 1)
                create Result.make_filled (end_pos - index + 1)
                Result.subcopy (Current, index, end_pos, 1)
            end
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature {NONE} -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: array_valid_index (start_pos)
            valid_end_pos: array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        forth
                    else
                        remove
                    end
                end
            else
                wipe_out
            end
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not (other.is_empty or is_empty) then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        remove
                    else
                        forth
                    end
                end
            end
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    new_chain: like Current is
            -- Unused
            -- (from ARRAYED_LIST)
        do
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    insert (v: like item; pos: INTEGER) is
            -- Add v at pos, moving subsequent items
            -- to the right.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            index_small_enough: pos <= count
            index_large_enough: pos >= 1
        do
            if count + 1 > capacity then
                auto_resize (lower, count + 1)
            end
            count := count + 1
            subcopy (Current, pos, count - 1, pos + 1)
            enter (v, pos)
        ensure -- from ARRAYED_LIST
            new_count: count = old count + 1
            index_unchanged: index = old index
            insertion_done: i_th (pos) = v
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
            -- (from LINEAR_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            item_exists: v /= void
            other_exists: other /= void
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        ensure -- from TRAVERSABLE_SUBSET
            strategy_set: Result /= void
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_SET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets represented as arrayed lists"
    status: "See notice at end of class"
    names: arrayed_set, set, arrayed_list
    representation: array
    size: fixed
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_SET [G]

create

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

feature -- Access

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    extend (v: G)
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_SET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_SET [G]

Ancestors
    ARRAYED_LIST [G]
    LINEAR_SUBSET [G]

Clients
    ARRAYED_SET [G]

Suppliers
    ARRAYED_SET [G]
    BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_SET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets represented as arrayed lists"
    status: "See notice at end of class"
    names: arrayed_set, set, arrayed_list
    representation: array
    size: fixed
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_SET [G]

create
    make

feature -- Element change

    put (v: G)
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of extend.

    extend (v: G)
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of put.

feature -- Removal

    prune (v: like item)
            -- Remove v if present.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE_SET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sorted sets implemented as binary search trees"
    status: "See notice at end of class"
    names: binary_search_tree_set, set, binary_search_tree
    representation: recursive, array
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

inherit
    COMPARABLE_SET [G]
        redefine
            min,
            max,
            has,
            off
        end

    TRAVERSABLE_SUBSET [G]

create
    make

feature -- Initialization

    make is
            -- Create set.
        do
            before := True
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items in tree
        do
            if tree /= void then
                Result := tree.count
            end
        end

    min: like item is
            -- Minimum item in tree
        do
            Result := tree.min
        end

    max: like item is
            -- Maximum item in tree
        do
            Result := tree.max
        end

    item: G is
            -- Current item
        do
            Result := active_node.item
        end

feature -- Status report

    is_empty: BOOLEAN is
            -- Is set empty?
        do
            Result := tree = void
        end

    Extendible: BOOLEAN is True
            -- Can new items be added? (Answer: yes.)

    Prunable: BOOLEAN is True
            -- Can items be removed? (Answer: yes.)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    has (v: like item): BOOLEAN is
            -- Is there a node with item v in tree?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if tree /= void then
                Result := tree.has (v)
            end
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- off only if tree is_empty or if
            -- it is before or after.
        do
            Result := is_empty or Precursor {COMPARABLE_SET}
        end

feature -- Cursor movement

    start is
            -- Move cursor to first node.
        do
            before := False
            if tree = void then
                after := True
            else
                after := False
                active_node := tree.min_node
            end
        end

    finish is
            -- Move cursor to last node.
        do
            after := False
            if tree = void then
                before := True
            else
                before := False
                active_node := tree.max_node
            end
        end

    forth is
            -- Move cursor to next node.
        local
            prev_node: like tree
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                if active_node.has_right then
                    active_node := active_node.right_child.min_node
                else
                    prev_node := active_node
                    active_node := active_node.parent
                    from
                    until
                        active_node = void or else prev_node = active_node.left_child
                    loop
                        prev_node := active_node
                        active_node := active_node.parent
                    end
                    if active_node = void then
                        active_node := tree
                        after := True
                    end
                end
            end
        end

    back is
            -- Move cursor to previous node.
        local
            prev_node: like tree
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                if active_node.has_left then
                    active_node := active_node.left_child.max_node
                else
                    prev_node := active_node
                    active_node := active_node.parent
                    from
                    until
                        active_node = void or else prev_node = active_node.right_child
                    loop
                        prev_node := active_node
                        active_node := active_node.parent
                    end
                    if active_node = void then
                        active_node := tree
                        before := True
                    end
                end
            end
        end

feature -- Element change

    put (v: like item) is
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of extend.
        require else
            item_exists: v /= void
        do
            if tree = void then
                tree := new_tree (v)
            else
                if not has (v) then
                    tree.extend (v)
                end
            end
        end

    extend (v: like item) is
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of put.
        require else
            item_exists: v /= void
        do
            if tree = void then
                tree := new_tree (v)
            else
                if not has (v) then
                    tree.extend (v)
                end
            end
        end

feature -- Removal

    wipe_out is
            -- Remove all items.
        do
            tree := void
        end

    prune (v: like item) is
            -- Remove v.
        do
            if tree /= void then
                tree := tree.pruned (v, tree.parent)
            end
        end

    remove is
            -- Remove current item.
        do
            prune (item)
        end

feature -- Duplication

    duplicate (n: INTEGER): BINARY_SEARCH_TREE_SET [G] is
            -- New structure containing min (n, count)
            -- items from current structure
        do
            create Result.make
            Result.set_tree (tree.duplicate (n))
        end

feature {BINARY_SEARCH_TREE_SET} -- Implementation

    tree: BINARY_SEARCH_TREE [G]

    active_node: like tree

    set_tree (t: like tree) is
            -- Set tree and active_node to t
        do
            tree := t
            active_node := t
        end

feature {NONE} -- Implementation

    new_tree (v: like item): like tree is
            -- New allocated node with item set to v
        do
            create Result.make (v)
            if object_comparison then
                Result.compare_objects
            end
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            elseif object_comparison and same_type (other) then
                create {SUBSET_STRATEGY_TREE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        end

invariant

    comparison_mode_equal: tree /= void implies object_comparison = tree.object_comparison

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE_SET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

General
    cluster: base.structures.set
    description: "Sorted sets implemented as binary search trees"
    create: make

Ancestors
    COMPARABLE_SET [G -> COMPARABLE]
    TRAVERSABLE_SUBSET [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): BINARY_SEARCH_TREE_SET [G]
    Extendible: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    max: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    off: BOOLEAN
    Prunable: BOOLEAN

Commands
    back
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    forth
    intersect (other: TRAVERSABLE_SUBSET [G])
    make
    merge (other: CONTAINER [G])
    prune (v: [like item] G)
    prune_all (v: G)
    put (v: [like item] G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Constraints
    comparison mode equal

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE_SET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sorted sets implemented as binary search trees"
    status: "See notice at end of class"
    names: binary_search_tree_set, set, binary_search_tree
    representation: recursive, array
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

create
    make

feature -- Initialization

    make is
            -- Create set.
        do
            before := True
        end

feature {NONE} -- Access

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items in tree
        do
            if tree /= void then
                Result := tree.count
            end
        end

    item: G is
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        do
            Result := active_node.item
        end

    max: like item is
            -- Maximum item in tree
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        do
            Result := tree.max
        end

    min: like item is
            -- Minimum item in tree
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        do
            Result := tree.min
        end

feature {NONE} -- Measurement

    cs_max: like item is
            -- Maximum item
            -- (from COMPARABLE_STRUCT)
        require -- from COMPARABLE_STRUCT
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item > Result then
                    Result := item
                end
                forth
            end
        end

    cs_min: like item is
            -- Minimum item
            -- (from COMPARABLE_STRUCT)
        require -- from COMPARABLE_STRUCT
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item < Result then
                    Result := item
                end
                forth
            end
        end

    min_max_available: BOOLEAN is
            -- Can min and max be computed?
            -- (from COMPARABLE_STRUCT)
        do
            Result := not is_empty
        ensure -- from COMPARABLE_STRUCT
            Result implies not is_empty
        end

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- Can new items be added? (Answer: yes.)

    has (v: like item): BOOLEAN is
            -- Is there a node with item v in tree?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if tree /= void then
                Result := tree.has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    is_empty: BOOLEAN is
            -- Is set empty?
        do
            Result := tree = void
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- off only if tree is_empty or if
            -- it is before or after.
        do
            Result := is_empty or Precursor {COMPARABLE_SET}
        end

    Prunable: BOOLEAN is True
            -- Can items be removed? (Answer: yes.)

feature {NONE} -- Status report

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move cursor to previous node.
        require -- from BILINEAR
            not_before: not before
        local
            prev_node: like tree
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                if active_node.has_left then
                    active_node := active_node.left_child.max_node
                else
                    prev_node := active_node
                    active_node := active_node.parent
                    from
                    until
                        active_node = void or else prev_node = active_node.right_child
                    loop
                        prev_node := active_node
                        active_node := active_node.parent
                    end
                    if active_node = void then
                        active_node := tree
                        before := True
                    end
                end
            end
        end

    finish is
            -- Move cursor to last node.
        do
            after := False
            if tree = void then
                before := True
            else
                before := False
                active_node := tree.max_node
            end
        end

    forth is
            -- Move cursor to next node.
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        local
            prev_node: like tree
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                if active_node.has_right then
                    active_node := active_node.right_child.min_node
                else
                    prev_node := active_node
                    active_node := active_node.parent
                    from
                    until
                        active_node = void or else prev_node = active_node.left_child
                    loop
                        prev_node := active_node
                        active_node := active_node.parent
                    end
                    if active_node = void then
                        active_node := tree
                        after := True
                    end
                end
            end
        end

    start is
            -- Move cursor to first node.
        do
            before := False
            if tree = void then
                after := True
            else
                after := False
                active_node := tree.min_node
            end
        end

feature {NONE} -- Cursor movement

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Element change

    extend (v: like item) is
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        require else
            item_exists: v /= void
        do
            if tree = void then
                tree := new_tree (v)
            else
                if not has (v) then
                    tree.extend (v)
                end
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            lin_rep: LINEAR [G]
        do
            lin_rep ?= other
            if lin_rep = void then
                lin_rep := other.linear_representation
            end
            from
                lin_rep.start
            until
                lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: like item) is
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        require else
            item_exists: v /= void
        do
            if tree = void then
                tree := new_tree (v)
            else
                if not has (v) then
                    tree.extend (v)
                end
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: like item) is
            -- Remove v.
        require -- from COLLECTION
            prunable: prunable
        do
            if tree /= void then
                tree := tree.pruned (v, tree.parent)
            end
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        do
            prune (item)
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
            tree := void
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): BINARY_SEARCH_TREE_SET [G] is
            -- New structure containing min (n, count)
            -- items from current structure
        require -- from SUBSET
            non_negative: n >= 0
        do
            create Result.make
            Result.set_tree (tree.duplicate (n))
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        forth
                    else
                        remove
                    end
                end
            else
                wipe_out
            end
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not (other.is_empty or is_empty) then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        remove
                    else
                        forth
                    end
                end
            end
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

feature {NONE} -- Inapplicable

    index: INTEGER is
            -- (from COMPARABLE_STRUCT)
        do
        end

feature {BINARY_SEARCH_TREE_SET} -- Implementation

    active_node: like tree

    set_tree (t: like tree) is
            -- Set tree and active_node to t
        do
            tree := t
            active_node := t
        end

    tree: BINARY_SEARCH_TREE [G]

feature {NONE} -- Implementation

    new_tree (v: like item): like tree is
            -- New allocated node with item set to v
        do
            create Result.make (v)
            if object_comparison then
                Result.compare_objects
            end
        end

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
        require -- from TRAVERSABLE_SUBSET
            item_exists: v /= void
            other_exists: other /= void
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            elseif object_comparison and same_type (other) then
                create {SUBSET_STRATEGY_TREE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        ensure -- from TRAVERSABLE_SUBSET
            strategy_set: Result /= void
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    comparison_mode_equal: tree /= void implies object_comparison = tree.object_comparison
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE_SET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sorted sets implemented as binary search trees"
    status: "See notice at end of class"
    names: binary_search_tree_set, set, binary_search_tree
    representation: recursive, array
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

create

    make
            -- Create set.

feature -- Initialization

    make
            -- Create set.

feature -- Measurement

    count: INTEGER
            -- Number of items in tree

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    max: like item
            -- Maximum item in tree
        require -- from COMPARABLE_SET
            not_empty: not is_empty

    min: like item
            -- Minimum item in tree
        require -- from COMPARABLE_SET
            not_empty: not is_empty

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    Extendible: BOOLEAN is True
            -- Can new items be added? (Answer: yes.)

    has (v: like item): BOOLEAN
            -- Is there a node with item v in tree?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    is_empty: BOOLEAN
            -- Is set empty?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- off only if tree is_empty or if
            -- it is before or after.

    Prunable: BOOLEAN is True
            -- Can items be removed? (Answer: yes.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous node.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last node.

    forth
            -- Move cursor to next node.
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after

    start
            -- Move cursor to first node.

feature -- Element change

    extend (v: like item)
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        require else
            item_exists: v /= void
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: like item)
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        require else
            item_exists: v /= void
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): BINARY_SEARCH_TREE_SET [G]
            -- New structure containing min (n, count)
            -- items from current structure
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

    comparison_mode_equal: tree /= void implies object_comparison = tree.object_comparison
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE_SET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

Ancestors
    COMPARABLE_SET [G -> COMPARABLE]
    TRAVERSABLE_SUBSET [G]

Clients
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

Suppliers
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    BOOLEAN
    COMPARABLE_SET [G -> COMPARABLE]
    SUBSET_STRATEGY_GENERIC [G]
    SUBSET_STRATEGY_HASHABLE [G]
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE_SET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sorted sets implemented as binary search trees"
    status: "See notice at end of class"
    names: binary_search_tree_set, set, binary_search_tree
    representation: recursive, array
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

create
    make

feature -- Initialization

    make
            -- Create set.

feature -- Measurement

    count: INTEGER
            -- Number of items in tree

    min: like item
            -- Minimum item in tree

    max: like item
            -- Maximum item in tree

    item: G
            -- Current item

feature -- Status report

    is_empty: BOOLEAN
            -- Is set empty?

    Extendible: BOOLEAN is True
            -- Can new items be added? (Answer: yes.)

    Prunable: BOOLEAN is True
            -- Can items be removed? (Answer: yes.)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    has (v: like item): BOOLEAN
            -- Is there a node with item v in tree?
            -- (Reference or object equality,
            -- based on object_comparison.)

    off: BOOLEAN
            -- Is there no current item?
            -- off only if tree is_empty or if
            -- it is before or after.

feature -- Cursor movement

    start
            -- Move cursor to first node.

    finish
            -- Move cursor to last node.

    forth
            -- Move cursor to next node.

    back
            -- Move cursor to previous node.

feature -- Element change

    put (v: like item)
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of extend.
        require else
            item_exists: v /= void

    extend (v: like item)
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of put.
        require else
            item_exists: v /= void

feature -- Removal

    wipe_out
            -- Remove all items.

    prune (v: like item)
            -- Remove v.

    remove
            -- Remove current item.

feature -- Duplication

    duplicate (n: INTEGER): BINARY_SEARCH_TREE_SET [G]
            -- New structure containing min (n, count)
            -- items from current structure

invariant

    comparison_mode_equal: tree /= void implies object_comparison = tree.object_comparison

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_SET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets whose items may be compared according to a total order relation"
    status: "See notice at end of class"
    names: comparable_set, comparable_struct
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class
    COMPARABLE_SET [G -> COMPARABLE]

inherit
    SUBSET [G]
        undefine
            disjoint,
            symdif
        end

    COMPARABLE_STRUCT [G]
        rename
            min as cs_min,
            max as cs_max
        export
            {NONE} all
        undefine
            changeable_comparison_criterion
        end

feature -- Measurement

    min: G is
            -- Minimum item
        require
            not_empty: not is_empty
        do
            Result := cs_min
        end

    max: G is
            -- Maximum item
        require
            not_empty: not is_empty
        do
            Result := cs_max
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_SET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COMPARABLE_SET [G -> COMPARABLE]

General
    cluster: base.structures.set
    description: "Sets whose items may be compared according to a total order relation"

Ancestors
    COMPARABLE_STRUCT [G -> COMPARABLE]
    SUBSET [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] COMPARABLE_SET [G]
    extendible: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    linear_representation: LINEAR [G]
    max: G
    min: G
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    intersect (other: SUBSET [G])
    merge (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    subtract (other: SUBSET [G])
    symdif (other: SUBSET [G])
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_SET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets whose items may be compared according to a total order relation"
    status: "See notice at end of class"
    names: comparable_set, comparable_struct
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class
    COMPARABLE_SET [G -> COMPARABLE]

feature {NONE} -- Access

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from BILINEAR)
        do
            Result := before or after
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from SET)
        deferred
        end

    max: G is
            -- Maximum item
        require
            not_empty: not is_empty
        do
            Result := cs_max
        end

    min: G is
            -- Minimum item
        require
            not_empty: not is_empty
        do
            Result := cs_min
        end

feature {NONE} -- Measurement

    cs_max: like item is
            -- Maximum item
            -- (from COMPARABLE_STRUCT)
        require -- from COMPARABLE_STRUCT
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item > Result then
                    Result := item
                end
                forth
            end
        end

    cs_min: like item is
            -- Minimum item
            -- (from COMPARABLE_STRUCT)
        require -- from COMPARABLE_STRUCT
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item < Result then
                    Result := item
                end
                forth
            end
        end

    min_max_available: BOOLEAN is
            -- Can min and max be computed?
            -- (from COMPARABLE_STRUCT)
        do
            Result := not is_empty
        ensure -- from COMPARABLE_STRUCT
            Result implies not is_empty
        end

feature -- Comparison

    disjoint (other: SUBSET [G]): BOOLEAN is
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            temp: like Current
        do
            if not is_empty then
                temp := duplicate (count)
                temp.intersect (other)
                Result := temp.is_empty
            else
                Result := True
            end
        end

    is_subset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

feature {NONE} -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)
        deferred
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature {NONE} -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)
        deferred
        end

    finish is
            -- Move to last position.
            -- (from LINEAR)
        deferred
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move to first position if any.
            -- (from TRAVERSABLE)
        deferred
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        end

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: G) is
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        deferred
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        deferred
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: SUBSET [G]) is
            -- Remove all items not in other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: SUBSET [G]) is
            -- Remove all items also in other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            temp: like Current
        do
            temp := duplicate (count)
            temp.intersect (other)
            merge (other)
            subtract (temp)
        end

feature {NONE} -- Inapplicable

    index: INTEGER is
            -- (from COMPARABLE_STRUCT)
        do
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_SET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets whose items may be compared according to a total order relation"
    status: "See notice at end of class"
    names: comparable_set, comparable_struct
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COMPARABLE_SET [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from SET)

    max: G
            -- Maximum item
        require
            not_empty: not is_empty

    min: G
            -- Minimum item
        require
            not_empty: not is_empty

feature -- Comparison

    disjoint (other: SUBSET [G]): BOOLEAN
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: SUBSET [G])
            -- Remove all items not in other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: SUBSET [G])
            -- Remove all items also in other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_SET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COMPARABLE_SET [G -> COMPARABLE]

Ancestors
    COMPARABLE_STRUCT [G -> COMPARABLE]
    SUBSET [G]

Descendants
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Clients
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    COMPARABLE_SET [G -> COMPARABLE]

Suppliers
    BOOLEAN
    COMPARABLE_SET [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_SET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets whose items may be compared according to a total order relation"
    status: "See notice at end of class"
    names: comparable_set, comparable_struct
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COMPARABLE_SET [G -> COMPARABLE]

feature -- Measurement

    min: G
            -- Minimum item
        require
            not_empty: not is_empty

    max: G
            -- Maximum item
        require
            not_empty: not is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.set

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


LINEAR_SUBSET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets that are traversable linearly without commitment to a concrete
        implementation.
    ]"
    status: "See notice at end of class"
    names: linear_subset, subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class
    LINEAR_SUBSET [G]

inherit
    TRAVERSABLE_SUBSET [G]

feature -- Access

    index: INTEGER is
            -- Current index
        deferred
        end

feature -- Status report

    before: BOOLEAN is
            -- Is cursor at left from first item?
        deferred
        end

    islast: BOOLEAN is
            -- Is cursor at last item?
        deferred
        end

    valid_index (n: INTEGER): BOOLEAN is
            -- Is n a valid index?
        deferred
        ensure
            index_valid: 0 <= n and n <= count + 1
        end

feature -- Cursor movement

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th item.
        require
            valid_index: valid_index (i)
        deferred
        ensure
            cursor_moved: index = i
        end

feature -- Element change

    put_left (v: G) is
            -- Insert v before the cursor.
        require
            item_exists: v /= void
            not_before: not before
        deferred
        ensure
            cursor_position_unchanged: index = old index + 1
        end

    move_item (v: G) is
            -- Move v to the left of cursor.
        require
            item_exists: v /= void
            item_in_set: has (v)
        local
            idx: INTEGER
            found: BOOLEAN
        do
            idx := index
            from
                start
            until
                found or after
            loop
                if object_comparison then
                    found := equal (v, item)
                else
                    found := (v = item)
                end
                if not found then
                    forth
                end
            end
            check
                found: found and not after
            end
            remove
            go_i_th (idx)
            put_left (v)
        end

feature {NONE} -- Implementation

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        end

invariant

    before_definition: before = (index = 0)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_SUBSET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    LINEAR_SUBSET [G]

General
    cluster: base.structures.set
    description:
        "Subsets that are traversable linearly without commitment to a concrete
        implementation."

Ancestors
    TRAVERSABLE_SUBSET [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] LINEAR_SUBSET [G]
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    index: INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    islast: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN
    valid_index (n: INTEGER): BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    forth
    go_i_th (i: INTEGER)
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: CONTAINER [G])
    move_item (v: G)
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    put_left (v: G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Constraints
    before definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_SUBSET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets that are traversable linearly without commitment to a concrete
        implementation.
    ]"
    status: "See notice at end of class"
    names: linear_subset, subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class
    LINEAR_SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER is
            -- Current index
        deferred
        end

    item: G is
            -- Current item
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        deferred
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from TRAVERSABLE_SUBSET)
        deferred
        end

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    after: BOOLEAN is
            -- Is cursor behind last item?
            -- (from TRAVERSABLE_SUBSET)
        deferred
        end

    before: BOOLEAN is
            -- Is cursor at left from first item?
        deferred
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is container empty?
            -- (from TRAVERSABLE_SUBSET)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    islast: BOOLEAN is
            -- Is cursor at last item?
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is cursor off the active items?
            -- (from TRAVERSABLE_SUBSET)
        deferred
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    valid_index (n: INTEGER): BOOLEAN is
            -- Is n a valid index?
        deferred
        ensure
            index_valid: 0 <= n and n <= count + 1
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Move cursor to next element.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        deferred
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th item.
        require
            valid_index: valid_index (i)
        deferred
        ensure
            cursor_moved: index = i
        end

    start is
            -- Move cursor to first item.
            -- (from TRAVERSABLE_SUBSET)
        deferred
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            lin_rep: LINEAR [G]
        do
            lin_rep ?= other
            if lin_rep = void then
                lin_rep := other.linear_representation
            end
            from
                lin_rep.start
            until
                lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    move_item (v: G) is
            -- Move v to the left of cursor.
        require
            item_exists: v /= void
            item_in_set: has (v)
        local
            idx: INTEGER
            found: BOOLEAN
        do
            idx := index
            from
                start
            until
                found or after
            loop
                if object_comparison then
                    found := equal (v, item)
                else
                    found := (v = item)
                end
                if not found then
                    forth
                end
            end
            check
                found: found and not after
            end
            remove
            go_i_th (idx)
            put_left (v)
        end

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    put_left (v: G) is
            -- Insert v before the cursor.
        require
            item_exists: v /= void
            not_before: not before
        deferred
        ensure
            cursor_position_unchanged: index = old index + 1
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: G) is
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        deferred
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        deferred
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        forth
                    else
                        remove
                    end
                end
            else
                wipe_out
            end
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not (other.is_empty or is_empty) then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        remove
                    else
                        forth
                    end
                end
            end
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

feature {NONE} -- Implementation

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
        require -- from TRAVERSABLE_SUBSET
            item_exists: v /= void
            other_exists: other /= void
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        ensure -- from TRAVERSABLE_SUBSET
            strategy_set: Result /= void
        end

invariant

    before_definition: before = (index = 0)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_SUBSET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets that are traversable linearly without commitment to a concrete
        implementation.
    ]"
    status: "See notice at end of class"
    names: linear_subset, subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    LINEAR_SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Current index

    item: G
            -- Current item
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from TRAVERSABLE_SUBSET)

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is cursor behind last item?
            -- (from TRAVERSABLE_SUBSET)

    before: BOOLEAN
            -- Is cursor at left from first item?

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is container empty?
            -- (from TRAVERSABLE_SUBSET)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    islast: BOOLEAN
            -- Is cursor at last item?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is cursor off the active items?
            -- (from TRAVERSABLE_SUBSET)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    valid_index (n: INTEGER): BOOLEAN
            -- Is n a valid index?
        ensure
            index_valid: 0 <= n and n <= count + 1

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor to next element.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_after: not after

    go_i_th (i: INTEGER)
            -- Move cursor to i-th item.
        require
            valid_index: valid_index (i)
        ensure
            cursor_moved: index = i

    start
            -- Move cursor to first item.
            -- (from TRAVERSABLE_SUBSET)

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    move_item (v: G)
            -- Move v to the left of cursor.
        require
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_left (v: G)
            -- Insert v before the cursor.
        require
            item_exists: v /= void
            not_before: not before
        ensure
            cursor_position_unchanged: index = old index + 1

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

    before_definition: before = (index = 0)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_SUBSET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    LINEAR_SUBSET [G]

Ancestors
    TRAVERSABLE_SUBSET [G]

Descendants
    ARRAYED_SET [G]
    LINKED_SET [G]
    PART_SORTED_SET [G -> PART_COMPARABLE]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Clients
    LINEAR_SUBSET [G]

Suppliers
    BOOLEAN
    INTEGER
    LINEAR_SUBSET [G]
    SUBSET_STRATEGY_GENERIC [G]
    SUBSET_STRATEGY_HASHABLE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR_SUBSET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets that are traversable linearly without commitment to a concrete
        implementation.
    ]"
    status: "See notice at end of class"
    names: linear_subset, subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    LINEAR_SUBSET [G]

feature -- Access

    index: INTEGER
            -- Current index

feature -- Status report

    before: BOOLEAN
            -- Is cursor at left from first item?

    islast: BOOLEAN
            -- Is cursor at last item?

    valid_index (n: INTEGER): BOOLEAN
            -- Is n a valid index?
        ensure
            index_valid: 0 <= n and n <= count + 1

feature -- Cursor movement

    go_i_th (i: INTEGER)
            -- Move cursor to i-th item.
        require
            valid_index: valid_index (i)
        ensure
            cursor_moved: index = i

feature -- Element change

    put_left (v: G)
            -- Insert v before the cursor.
        require
            item_exists: v /= void
            not_before: not before
        ensure
            cursor_position_unchanged: index = old index + 1

    move_item (v: G)
            -- Move v to the left of cursor.
        require
            item_exists: v /= void
            item_in_set: has (v)

invariant

    before_definition: before = (index = 0)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_SET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets implemented by linked lists"
    status: "See notice at end of class"
    names: linked_set, set, linked_list
    representation: linked
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_SET [G]

inherit
    LINEAR_SUBSET [G]
        undefine
            prune_all,
            copy,
            is_equal
        select
            extend,
            put,
            prune
        end

    LINKED_LIST [G]
        rename
            extend as ll_extend,
            put as ll_put,
            prune as ll_prune
        export
            {NONE} ll_extend, ll_put, ll_prune
        undefine
            changeable_comparison_criterion,
            is_inserted
        end

create
    make

feature -- Element change

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of extend.
        do
            if is_empty or else not has (v) then
                ll_extend (v)
            end
        end

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of put.
        do
            if is_empty or else not has (v) then
                ll_extend (v)
            end
        end

feature -- Removal

    prune (v: like item) is
            -- Remove v if present.
        do
            start
            ll_prune (v)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_SET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_SET [G]

General
    cluster: base.structures.set
    description: "Sets implemented by linked lists"
    create: make

Ancestors
    LINEAR_SUBSET [G]
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] LINKED_SET [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_SET [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    intersect (other: TRAVERSABLE_SUBSET [G])
    make
    merge (other: CONTAINER [G])
    merge_left (other: [like Current] LINKED_SET [G])
    merge_right (other: [like Current] LINKED_SET [G])
    move (i: INTEGER)
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    swap (i: INTEGER)
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_SET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets implemented by linked lists"
    status: "See notice at end of class"
    names: linked_set, set, linked_list
    representation: linked
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_SET [G]

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    has (v: like item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_has (v)
            go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active /= void) and then (active.right = void)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if is_empty then
                before := True
                after := False
            elseif after then
                after := False
            elseif isfirst then
                before := True
            else
                active := previous
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    p := active
                until
                    p.right = void
                loop
                    p := p.right
                end
                active := p
                after := False
                before := False
            else
                before := True
                after := False
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        end

    forth is
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        local
            old_active: like first_element
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                old_active := active
                active := active.right
                if active = void then
                    active := old_active
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        do
            if is_empty or else not has (v) then
                ll_extend (v)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            lin_rep: LINEAR [G]
        do
            lin_rep ?= other
            if lin_rep = void then
                lin_rep := other.linear_representation
            end
            from
                lin_rep.start
            until
                lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            p: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                elseif isfirst then
                    p := first_element;
                    other_last_element.put_right (p);
                    first_element := other_first_element
                else
                    p := previous
                    if p /= void then
                        p.put_right (other_first_element)
                    end
                    other_last_element.put_right (active)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    move_item (v: G) is
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)
        local
            idx: INTEGER
            found: BOOLEAN
        do
            idx := index
            from
                start
            until
                found or after
            loop
                if object_comparison then
                    found := equal (v, item)
                else
                    found := (v = item)
                end
                if not found then
                    forth
                end
            end
            check
                found: found and not after
            end
            remove
            go_i_th (idx)
            put_left (v)
        end

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        do
            if is_empty or else not has (v) then
                ll_extend (v)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        local
            p: like first_element
        do
            if is_empty then
                put_front (v)
            elseif after then
                back;
                put_right (v);
                move (2)
            else
                p := new_cell (active.item)
                p.put_right (active.right)
                active.put (v)
                active.put_right (p)
                active := p
                count := count + 1
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    ll_extend (v: like item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            extendible: extendible
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                active := p
            else
                last_element.put_right (p)
                if after then
                    active := p
                end
            end
            count := count + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    ll_put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: like item) is
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        do
            start
            ll_prune (v)
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: like item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                remove
                search (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        local
            removed, succ: like first_element
        do
            removed := active
            if isfirst then
                first_element := first_element.right
                active.forget_right
                active := first_element
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                end
            elseif islast then
                active := previous;
                if active /= void then
                    active.forget_right
                end;
                after := True
            else
                succ := active.right
                previous.put_right (succ)
                active.forget_right
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            move (- 2)
            remove_right
            forth
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        local
            removed, succ: like first_element
        do
            if before then
                removed := first_element
                first_element := first_element.right
                active.forget_right
                active := first_element
            else
                succ := active.right
                removed := succ
                active.put_right (succ.right)
                succ.forget_right
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    ll_prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := cursor
            until
                (counter = n) or else exhausted
            loop
                Result.extend (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        forth
                    else
                        remove
                    end
                end
            else
                wipe_out
            end
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not (other.is_empty or is_empty) then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        remove
                    else
                        forth
                    end
                end
            end
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
            -- (from LINEAR_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            item_exists: v /= void
            other_exists: other /= void
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        ensure -- from TRAVERSABLE_SUBSET
            strategy_set: Result /= void
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    first_element: LINKABLE [G]
            -- Head of list
            -- (from LINKED_LIST)

    last_element: like first_element is
            -- Tail of list
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if not is_empty then
                from
                    Result := active
                    p := active.right
                until
                    p = void
                loop
                    Result := p
                    p := p.right
                end
            end
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the same type as first_element.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            if after then
                Result := active
            elseif not (isfirst or before) then
                from
                    p := first_element
                until
                    p.right = active
                loop
                    p := p.right
                end;
                Result := p
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_SET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets implemented by linked lists"
    status: "See notice at end of class"
    names: linked_set, set, linked_list
    representation: linked
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_SET [G]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_SET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_SET [G]

Ancestors
    LINEAR_SUBSET [G]
    LINKED_LIST [G]

Clients
    LINKED_SET [G]
    SUBSET_STRATEGY_GENERIC [G]

Suppliers
    BOOLEAN
    LINKED_SET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_SET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Sets implemented by linked lists"
    status: "See notice at end of class"
    names: linked_set, set, linked_list
    representation: linked
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_SET [G]

create
    make

feature -- Element change

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of extend.

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of put.

feature -- Removal

    prune (v: like item)
            -- Remove v if present.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_SET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a partial order relation
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    PART_SORTED_SET [G -> PART_COMPARABLE]

inherit
    LINEAR_SUBSET [G]
        undefine
            prune_all,
            changeable_comparison_criterion,
            copy,
            is_equal
        redefine
            merge
        select
            extend,
            prune,
            put
        end

    PART_SORTED_TWO_WAY_LIST [G]
        rename
            extend as pstwl_extend,
            prune as pstwl_prune,
            put as pstwl_put,
            merge as pstwl_merge
        export
            {ANY} duplicate, forth, item, after, start, put_left, finish,
            {NONE} all
        redefine
            duplicate
        end

create
    make

feature -- Element change

    extend (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of put.
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
            end
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of extend.
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
            end
        end

    merge (other: TRAVERSABLE_SUBSET [G]) is
            -- Add all items of other.
        do
            from
                start
                other.start
            until
                other.after or else after
            loop
                if item < other.item then
                    forth
                elseif item.is_equal (other.item) then
                    forth;
                    other.forth
                else
                    put_left (other.item)
                    other.forth
                end
            end
            if after then
                from
                until
                    other.after
                loop
                    put_left (other.item)
                    other.forth
                end
            end
        end

feature -- Removal

    prune (v: like item) is
            -- Remove v if present.
        do
            start
            pstwl_prune (v)
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        local
            pos: CURSOR
            counter: INTEGER
        do
            pos := cursor
            Result := new_chain
            Result.finish
            from
            until
                (counter = n) or else after
            loop
                Result.put_left (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_SET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PART_SORTED_SET [G -> PART_COMPARABLE]

General
    cluster: base.structures.set
    description:
        "Sets whose items may be compared according to a partial order relation
        implemented as sorted two-way lists."
    create: make

Ancestors
    LINEAR_SUBSET [G]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] PART_SORTED_SET [G]
    Extendible: BOOLEAN
    has (v: G): BOOLEAN
    index: INTEGER
    is_empty: BOOLEAN
    is_equal (other: [like Current] PART_SORTED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    islast: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN
    valid_index (i: INTEGER): BOOLEAN

Commands
    compare_objects
    compare_references
    copy (other: [like Current] PART_SORTED_SET [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    forth
    go_i_th (i: INTEGER)
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: TRAVERSABLE_SUBSET [G])
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_left (v: [like item] G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_SET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a partial order relation
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:35 $"
    revision: "$Revision: 1.2 $"

class
    PART_SORTED_SET [G -> PART_COMPARABLE]

create
    make

feature {NONE} -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature {NONE} -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    search_after (v: like item) is
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                start
            until
                after or else v <= item
            loop
                forth
            end
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)
        end

    search_before (v: like item) is
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                finish
            until
                before or else v >= item
            loop
                back
            end
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)
        end

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        do
            Result := active.item
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

feature {NONE} -- Measurement

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        do
            Result := (active = last_element) and then not after and then not before
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

feature {NONE} -- Status report

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    sorted: BOOLEAN is
            -- is the structures topologically sorted
            -- i.e i < j implies not i_th (i) > i_th (j)
            -- (from PART_SORTED_TWO_WAY_LIST)
        local
            c: CURSOR
            prev: like item
        do
            Result := True
            if count > 1 then
                from
                    c := cursor
                    start
                    check
                        not off
                    end
                    prev := item
                    forth
                until
                    after or not Result
                loop
                    Result := (prev <= item)
                    prev := item
                    forth
                end
                go_to (c)
            end
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                active := active.right
                if active = void then
                    active := last_element
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature {NONE} -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                active := active.left
                if active = void then
                    active := first_element
                    before := True
                end
            end
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        local
            counter: INTEGER
            p: like first_element
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if after then
                    after := False;
                    counter := - 1
                end;
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left
                    counter := counter - 1
                end;
                if p = void then
                    before := True;
                    active := first_element
                else
                    active := p
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    ll_move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature  -- Cursor movement

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        do
            if not is_empty then
                active := last_element
                after := False
                before := False
            else
                after := False
                before := True
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge (other: TRAVERSABLE_SUBSET [G]) is
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            from
                start
                other.start
            until
                other.after or else after
            loop
                if item < other.item then
                    forth
                elseif item.is_equal (other.item) then
                    forth;
                    other.forth
                else
                    put_left (other.item)
                    other.forth
                end
            end
            if after then
                from
                until
                    other.after
                loop
                    put_left (other.item)
                    other.forth
                end
            end
        end

    move_item (v: G) is
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)
        local
            idx: INTEGER
            found: BOOLEAN
        do
            idx := index
            from
                start
            until
                found or after
            loop
                if object_comparison then
                    found := equal (v, item)
                else
                    found := (v = item)
                end
                if not found then
                    forth
                end
            end
            check
                found: found and not after
            end
            remove
            go_i_th (idx)
            put_left (v)
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                last_element := p
                active := p
                before := False
            elseif after then
                p.put_left (last_element);
                last_element := p;
                active := p
            elseif isfirst then
                p.put_right (active);
                first_element := p
            else
                p.put_left (active.left)
                p.put_right (active)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1
        end

feature {NONE} -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    pstwl_extend (v: like item) is
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
            -- (from PART_SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            extendible: extendible
        do
            search_after (v)
            put_left (v)
            back
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    pstwl_merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    last_element := other_last_element
                    first_element := other_first_element
                    if before then
                        active := first_element
                    else
                        active := last_element
                    end
                elseif isfirst then
                    other_last_element.put_right (first_element);
                    first_element := other_first_element
                elseif after then
                    other_first_element.put_left (last_element);
                    last_element := other_last_element;
                    active := last_element
                else
                    other_first_element.put_left (active.left)
                    active.put_left (other_last_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if is_empty or else islast then
                last_element := other.last_element
            end
            ll_merge_right (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    pstwl_put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        do
            ll_put_front (v)
            if count = 1 then
                last_element := first_element
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    ll_put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            was_last: BOOLEAN
        do
            was_last := islast
            ll_put_right (v)
            if count = 1 then
                last_element := active
            elseif was_last then
                last_element := active.right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    ll_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature -- Removal

    prune (v: like item) is
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        do
            start
            pstwl_prune (v)
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: like item) is
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from PART_SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                off or else v < item
            loop
                remove
            end
            if not off then
                finish
                forth
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        local
            succ, pred, removed: like first_element
        do
            removed := active
            if isfirst then
                active := first_element.right
                first_element.forget_right
                first_element := active
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                    last_element := void
                end
            elseif islast then
                active := last_element.left;
                last_element.forget_left;
                last_element := active;
                after := True
            else
                pred := active.left
                succ := active.right
                pred.forget_right
                succ.forget_left
                pred.put_right (succ)
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    wipe_out is
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            ll_wipe_out
            last_element := void
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    pstwl_prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            back
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            forth
            remove
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    remove_sublist is
            -- (from TWO_WAY_LIST)
        do
            sublist := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_element
        do
            if n = 0 then
                create sublist.make
            else
                active_index := index
                if active_index + n > count + 1 then
                    actual_number := count + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := active
                p_elem := previous
                move (actual_number - 1)
                e_elem := active
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                count := count - actual_number
                if p_elem /= void then
                    p_elem.put_right (n_elem)
                else
                    first_element := n_elem
                end
                if n_elem /= void then
                    active := n_elem
                else
                    last_element := p_elem
                    active := p_elem
                    after := True
                end
            end
        end

    ll_wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Transformation

    sort is
            -- sort the list
            -- Has O(count * log (count)) complexity.
            -- (from PART_SORTED_TWO_WAY_LIST)
        local
            no_change: BOOLEAN
            gap: INTEGER
            left_cell, cell: like first_element
            left_cell_item, cell_item: like item
        do
            if not is_empty then
                from
                    gap := count * 10 // 13
                until
                    gap = 0
                loop
                    from
                        no_change := False
                        go_i_th (1 + gap)
                    until
                        no_change
                    loop
                        no_change := True
                        from
                            left_cell := first_element
                            cell := active
                        until
                            cell = void
                        loop
                            left_cell_item := left_cell.item
                            cell_item := cell.item
                            if cell_item < left_cell_item then
                                no_change := False
                                cell.put (left_cell_item)
                                left_cell.put (cell_item)
                            end
                            left_cell := left_cell.right
                            cell := cell.right
                        end
                    end
                    gap := gap * 10 // 13
                end
            end
        end

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            cur: LINKED_LIST_CURSOR [G]
            new_list: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            if not other.is_empty then
                cur ?= other.cursor
                create new_list.make
                from
                    other.start
                until
                    other.off
                loop
                    new_list.extend (other.item)
                    other.forth
                end
                other.go_to (cur)
            else
                new_list := other
            end
            standard_copy (new_list)
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            pos := cursor
            Result := new_chain
            Result.finish
            from
            until
                (counter = n) or else after
            loop
                Result.put_left (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        forth
                    else
                        remove
                    end
                end
            else
                wipe_out
            end
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not (other.is_empty or is_empty) then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        remove
                    else
                        forth
                    end
                end
            end
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {NONE} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    make_sublist (first_item, last_item: like first_element; n: INTEGER) is
            -- Create sublist
            -- (from TWO_WAY_LIST)
        do
            make
            first_element := first_item
            last_element := last_item
            active := first_element
            count := n
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the type of first_element.
            -- (from TWO_WAY_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from PART_SORTED_TWO_WAY_LIST)
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from TWO_WAY_LIST)
        do
            if after then
                Result := active
            elseif active /= void then
                Result := active.left
            end
        end

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
            -- (from LINEAR_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            item_exists: v /= void
            other_exists: other /= void
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        ensure -- from TRAVERSABLE_SUBSET
            strategy_set: Result /= void
        end

feature {NONE} -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_SET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a partial order relation
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    PART_SORTED_SET [G -> PART_COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature  -- Cursor movement

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

feature -- Element change

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: TRAVERSABLE_SUBSET [G])
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1

feature -- Removal

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from PART_SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_SET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PART_SORTED_SET [G -> PART_COMPARABLE]

Ancestors
    LINEAR_SUBSET [G]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

Clients
    PART_SORTED_SET [G -> PART_COMPARABLE]

Suppliers
    BOOLEAN
    INTEGER
    PART_COMPARABLE
    PART_SORTED_SET [G -> PART_COMPARABLE]
    TRAVERSABLE_SUBSET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PART_SORTED_SET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a partial order relation
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    PART_SORTED_SET [G -> PART_COMPARABLE]

create
    make

feature -- Element change

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of put.

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of extend.

    merge (other: TRAVERSABLE_SUBSET [G])
            -- Add all items of other.

feature -- Removal

    prune (v: like item)
            -- Remove v if present.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Collection, where each element must be unique."
    status: "See notice at end of class"
    names: set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SET [G]

inherit
    COLLECTION [G]
        redefine
            changeable_comparison_criterion
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        deferred
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
        deferred
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
        deferred
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

feature -- Removal

    prune (v: G) is
            -- Remove v if present.
        deferred
        ensure then
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
        do
            Result := is_empty
        ensure then
            only_on_empty: Result = is_empty
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SET [G]

General
    cluster: base.structures.set
    description: "Collection, where each element must be unique."

Ancestors
    COLLECTION [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Collection, where each element must be unique."
    status: "See notice at end of class"
    names: set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SET [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        deferred
        end

feature -- Status report

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
        do
            Result := is_empty
        ensure then
            only_on_empty: Result = is_empty
        end

    prune (v: G) is
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        deferred
        ensure then
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Collection, where each element must be unique."
    status: "See notice at end of class"
    names: set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
        ensure then
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SET [G]

Ancestors
    COLLECTION [G]

Descendants
    INTEGER_INTERVAL
    SUBSET [G]

Clients
    SET [G]

Suppliers
    BOOLEAN
    INTEGER
    SET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Collection, where each element must be unique."
    status: "See notice at end of class"
    names: set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SET [G]

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    prune (v: G)
            -- Remove v if present.
        ensure then
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
        ensure then
            only_on_empty: Result = is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.set.strategies

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.set.strategies	(diagram)

Supercluster
    base.structures.set

Classes
    SUBSET_STRATEGY [G]
    SUBSET_STRATEGY_GENERIC [G]
    SUBSET_STRATEGY_HASHABLE [G]
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.set.strategies

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


SUBSET_STRATEGY Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for computing several features of subsets. The computing
        strategy is optimized depending on the type of elements contained in
        the set.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        deferred
        end

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        deferred
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SUBSET_STRATEGY [G]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for computing several features of subsets. The computing
        strategy is optimized depending on the type of elements contained in
        the set."

Ancestors
    ANY

Queries
    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN

Commands
    symdif (set1, set2: TRAVERSABLE_SUBSET [G])

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for computing several features of subsets. The computing
        strategy is optimized depending on the type of elements contained in
        the set.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        deferred
        end

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for computing several features of subsets. The computing
        strategy is optimized depending on the type of elements contained in
        the set.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_GENERIC Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        items of any type.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    SUBSET_STRATEGY_GENERIC [G]

inherit
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        local
            tmp_set: LINKED_SET [G]
        do
            create tmp_set.make
            if set1.object_comparison then
                tmp_set.compare_objects
            end
            from
                Result := True
                set1.start
                set2.start
            until
                not Result or else (set1.after and set2.after)
            loop
                if not set1.after then
                    Result := not tmp_set.has (set1.item)
                    if Result then
                        tmp_set.put (set1.item)
                    end
                end
                if Result and then not set2.after then
                    Result := not tmp_set.has (set2.item)
                    if Result then
                        tmp_set.put (set2.item)
                    end
                end
                set1.forth
                set2.forth
            end
        end

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        local
            tmp_set: LINKED_LIST [G]
        do
            create tmp_set.make
            if set1.object_comparison then
                tmp_set.compare_objects
            end
            from
                set1.start
            until
                set1.after
            loop
                tmp_set.extend (set1.item)
                set1.forth
            end
            from
                set2.start
            until
                set2.after
            loop
                if tmp_set.has (set2.item) then
                    tmp_set.prune (set2.item)
                else
                    tmp_set.extend (set2.item)
                end
                set2.forth
            end
            set1.wipe_out
            from
                tmp_set.start
            until
                tmp_set.after
            loop
                set1.extend (tmp_set.item)
                tmp_set.forth
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_GENERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_GENERIC Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SUBSET_STRATEGY_GENERIC [G]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for calculating several features for subsets containing
        items of any type."

Ancestors
    SUBSET_STRATEGY [G]

Queries
    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN

Commands
    symdif (set1, set2: TRAVERSABLE_SUBSET [G])

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_GENERIC Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        items of any type.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    SUBSET_STRATEGY_GENERIC [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        local
            tmp_set: LINKED_SET [G]
        do
            create tmp_set.make
            if set1.object_comparison then
                tmp_set.compare_objects
            end
            from
                Result := True
                set1.start
                set2.start
            until
                not Result or else (set1.after and set2.after)
            loop
                if not set1.after then
                    Result := not tmp_set.has (set1.item)
                    if Result then
                        tmp_set.put (set1.item)
                    end
                end
                if Result and then not set2.after then
                    Result := not tmp_set.has (set2.item)
                    if Result then
                        tmp_set.put (set2.item)
                    end
                end
                set1.forth
                set2.forth
            end
        end

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        local
            tmp_set: LINKED_LIST [G]
        do
            create tmp_set.make
            if set1.object_comparison then
                tmp_set.compare_objects
            end
            from
                set1.start
            until
                set1.after
            loop
                tmp_set.extend (set1.item)
                set1.forth
            end
            from
                set2.start
            until
                set2.after
            loop
                if tmp_set.has (set2.item) then
                    tmp_set.prune (set2.item)
                else
                    tmp_set.extend (set2.item)
                end
                set2.forth
            end
            set1.wipe_out
            from
                tmp_set.start
            until
                tmp_set.after
            loop
                set1.extend (tmp_set.item)
                tmp_set.forth
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_GENERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_GENERIC Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        items of any type.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    SUBSET_STRATEGY_GENERIC [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_GENERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_GENERIC Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SUBSET_STRATEGY_GENERIC [G]

Ancestors
    SUBSET_STRATEGY [G]

Clients
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]
    SUBSET_STRATEGY_GENERIC [G]

Suppliers
    BOOLEAN
    LINKED_LIST [G]
    LINKED_SET [G]
    SUBSET_STRATEGY_GENERIC [G]
    TRAVERSABLE_SUBSET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_GENERIC Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        items of any type.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    SUBSET_STRATEGY_GENERIC [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_GENERIC

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_HASHABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        HASHABLEs.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    SUBSET_STRATEGY_HASHABLE [G]

inherit
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        local
            hash: HASH_TABLE [G, INTEGER]
            h: HASHABLE
            c: INTEGER
        do
            create hash.make (set1.count + set2.count)
            if set1.object_comparison then
                hash.compare_objects
            end
            from
                Result := True
                set1.start
                set2.start
            until
                not Result or else (set1.after and set2.after)
            loop
                if not set1.after then
                    h ?= set1.item
                    check
                        hashable_item: h /= void
                    end
                    c := h.hash_code
                    Result := not hash.has (c)
                    if Result then
                        hash.put (set1.item, c)
                    else
                        hash.search (c)
                        check
                            item_found: hash.found
                        end
                        if set1.object_comparison then
                            Result := not equal (set1.item, hash.found_item)
                        else
                            Result := (set1.item /= hash.found_item)
                        end
                    end
                end
                if Result and then not set2.after then
                    h ?= set2.item
                    check
                        hashable_item: h /= void
                    end
                    c := h.hash_code
                    hash.search (c)
                    Result := not hash.found
                    if Result then
                        hash.put (set2.item, c)
                    else
                        if set1.object_comparison then
                            Result := not equal (set2.item, hash.found_item)
                        else
                            Result := (set2.item /= hash.found_item)
                        end
                    end
                end
                set1.forth
                set2.forth
            end
        end

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        local
            hash: HASH_TABLE [G, INTEGER]
            h: HASHABLE
            c: INTEGER
            eq: BOOLEAN
        do
            create hash.make (set1.count + set2.count)
            if set1.object_comparison then
                hash.compare_objects
            end
            from
                set1.start
            until
                set1.after
            loop
                h ?= set1.item
                check
                    hashable_item: h /= void
                end
                hash.put (set1.item, h.hash_code)
                set1.forth
            end
            from
                set2.start
            until
                set2.after
            loop
                h ?= set2.item
                check
                    hashable_item: h /= void
                end
                c := h.hash_code
                hash.search (c)
                if hash.found then
                    if set1.object_comparison then
                        eq := equal (set2.item, hash.found_item)
                    else
                        eq := (set2.item = hash.found_item)
                    end
                    if eq then
                        hash.remove (h.hash_code)
                    end
                else
                    hash.put (set2.item, h.hash_code)
                end
                set2.forth
            end
            set1.wipe_out
            from
                hash.start
            until
                hash.after
            loop
                set1.extend (hash.item_for_iteration)
                hash.forth
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_HASHABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SUBSET_STRATEGY_HASHABLE [G]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for calculating several features for subsets containing
        HASHABLEs."

Ancestors
    SUBSET_STRATEGY [G]

Queries
    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN

Commands
    symdif (set1, set2: TRAVERSABLE_SUBSET [G])

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_HASHABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        HASHABLEs.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    SUBSET_STRATEGY_HASHABLE [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        local
            hash: HASH_TABLE [G, INTEGER]
            h: HASHABLE
            c: INTEGER
        do
            create hash.make (set1.count + set2.count)
            if set1.object_comparison then
                hash.compare_objects
            end
            from
                Result := True
                set1.start
                set2.start
            until
                not Result or else (set1.after and set2.after)
            loop
                if not set1.after then
                    h ?= set1.item
                    check
                        hashable_item: h /= void
                    end
                    c := h.hash_code
                    Result := not hash.has (c)
                    if Result then
                        hash.put (set1.item, c)
                    else
                        hash.search (c)
                        check
                            item_found: hash.found
                        end
                        if set1.object_comparison then
                            Result := not equal (set1.item, hash.found_item)
                        else
                            Result := (set1.item /= hash.found_item)
                        end
                    end
                end
                if Result and then not set2.after then
                    h ?= set2.item
                    check
                        hashable_item: h /= void
                    end
                    c := h.hash_code
                    hash.search (c)
                    Result := not hash.found
                    if Result then
                        hash.put (set2.item, c)
                    else
                        if set1.object_comparison then
                            Result := not equal (set2.item, hash.found_item)
                        else
                            Result := (set2.item /= hash.found_item)
                        end
                    end
                end
                set1.forth
                set2.forth
            end
        end

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        local
            hash: HASH_TABLE [G, INTEGER]
            h: HASHABLE
            c: INTEGER
            eq: BOOLEAN
        do
            create hash.make (set1.count + set2.count)
            if set1.object_comparison then
                hash.compare_objects
            end
            from
                set1.start
            until
                set1.after
            loop
                h ?= set1.item
                check
                    hashable_item: h /= void
                end
                hash.put (set1.item, h.hash_code)
                set1.forth
            end
            from
                set2.start
            until
                set2.after
            loop
                h ?= set2.item
                check
                    hashable_item: h /= void
                end
                c := h.hash_code
                hash.search (c)
                if hash.found then
                    if set1.object_comparison then
                        eq := equal (set2.item, hash.found_item)
                    else
                        eq := (set2.item = hash.found_item)
                    end
                    if eq then
                        hash.remove (h.hash_code)
                    end
                else
                    hash.put (set2.item, h.hash_code)
                end
                set2.forth
            end
            set1.wipe_out
            from
                hash.start
            until
                hash.after
            loop
                set1.extend (hash.item_for_iteration)
                hash.forth
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_HASHABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        HASHABLEs.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    SUBSET_STRATEGY_HASHABLE [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_HASHABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SUBSET_STRATEGY_HASHABLE [G]

Ancestors
    SUBSET_STRATEGY [G]

Clients
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]
    SUBSET_STRATEGY_HASHABLE [G]

Suppliers
    BOOLEAN
    HASH_TABLE [G, H -> HASHABLE]
    HASHABLE
    INTEGER
    SUBSET_STRATEGY_HASHABLE [G]
    TRAVERSABLE_SUBSET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_HASHABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        HASHABLEs.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    SUBSET_STRATEGY_HASHABLE [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_HASHABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SUBSET_STRATEGY [G]

Ancestors
    ANY

Descendants
    SUBSET_STRATEGY_GENERIC [G]
    SUBSET_STRATEGY_HASHABLE [G]
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

Clients
    SUBSET_STRATEGY [G]
    TRAVERSABLE_SUBSET [G]

Suppliers
    BOOLEAN
    SUBSET_STRATEGY [G]
    TRAVERSABLE_SUBSET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for computing several features of subsets. The computing
        strategy is optimized depending on the type of elements contained in
        the set.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets represented
        by binary search trees. Contained items have to be COMPARABLE
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

inherit
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: BINARY_SEARCH_TREE_SET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        do
            from
                Result := True
                set1.start
            until
                not Result or else set1.after
            loop
                Result := not set2.has (set1.item)
                set1.forth
            end
            if Result then
                from
                    set2.start
                until
                    not Result or else set2.after
                loop
                    Result := not set1.has (set2.item)
                    set2.forth
                end
            end
        end

feature -- Basic operations

    symdif (set1, set2: BINARY_SEARCH_TREE_SET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        do
            from
                set2.start
            until
                set2.after
            loop
                if set1.has (set2.item) then
                    set1.prune (set2.item)
                else
                    set1.extend (set2.item)
                end
                set2.forth
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for calculating several features for subsets represented
        by binary search trees. Contained items have to be COMPARABLE"

Ancestors
    SUBSET_STRATEGY [G]

Queries
    disjoint (set1, set2: BINARY_SEARCH_TREE_SET [G]): BOOLEAN

Commands
    symdif (set1, set2: BINARY_SEARCH_TREE_SET [G])

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets represented
        by binary search trees. Contained items have to be COMPARABLE
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

feature -- Comparison

    disjoint (set1, set2: BINARY_SEARCH_TREE_SET [G]): BOOLEAN is
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        do
            from
                Result := True
                set1.start
            until
                not Result or else set1.after
            loop
                Result := not set2.has (set1.item)
                set1.forth
            end
            if Result then
                from
                    set2.start
                until
                    not Result or else set2.after
                loop
                    Result := not set1.has (set2.item)
                    set2.forth
                end
            end
        end

feature -- Basic operations

    symdif (set1, set2: BINARY_SEARCH_TREE_SET [G]) is
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison
        do
            from
                set2.start
            until
                set2.after
            loop
                if set1.has (set2.item) then
                    set1.prune (set2.item)
                else
                    set1.extend (set2.item)
                end
                set2.forth
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets represented
        by binary search trees. Contained items have to be COMPARABLE
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

feature -- Comparison

    disjoint (set1, set2: BINARY_SEARCH_TREE_SET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: BINARY_SEARCH_TREE_SET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

Ancestors
    SUBSET_STRATEGY [G]

Clients
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

Suppliers
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    BOOLEAN
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET_STRATEGY_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Strategies for calculating several features for subsets represented
        by binary search trees. Contained items have to be COMPARABLE
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

feature -- Comparison

    disjoint (set1, set2: BINARY_SEARCH_TREE_SET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?

feature -- Basic operations

    symdif (set1, set2: BINARY_SEARCH_TREE_SET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets with the associated operations,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SUBSET [G]

inherit
    SET [G]

feature -- Comparison

    is_subset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

    disjoint (other: SUBSET [G]): BOOLEAN is
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            temp: like Current
        do
            if not is_empty then
                temp := duplicate (count)
                temp.intersect (other)
                Result := temp.is_empty
            else
                Result := True
            end
        end

feature -- Element change

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New structure containing min (n, count)
            -- items from current structure
        require
            non_negative: n >= 0
        deferred
        ensure
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: SUBSET [G]) is
            -- Remove all items not in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        ensure
            is_subset_other: is_subset (other)
        end

    subtract (other: SUBSET [G]) is
            -- Remove all items also in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        ensure
            is_disjoint: disjoint (other)
        end

    symdif (other: SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            temp: like Current
        do
            temp := duplicate (count)
            temp.intersect (other)
            merge (other)
            subtract (temp)
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SUBSET [G]

General
    cluster: base.structures.set
    description:
        "Subsets with the associated operations,
        without commitment to a particular representation"

Ancestors
    SET [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] SUBSET [G]
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    intersect (other: SUBSET [G])
    merge (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    subtract (other: SUBSET [G])
    symdif (other: SUBSET [G])
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets with the associated operations,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from SET)
        deferred
        end

feature -- Comparison

    disjoint (other: SUBSET [G]): BOOLEAN is
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            temp: like Current
        do
            if not is_empty then
                temp := duplicate (count)
                temp.intersect (other)
                Result := temp.is_empty
            else
                Result := True
            end
        end

    is_subset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        end

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: G) is
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        deferred
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New structure containing min (n, count)
            -- items from current structure
        require
            non_negative: n >= 0
        deferred
        ensure
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: SUBSET [G]) is
            -- Remove all items not in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        ensure
            is_subset_other: is_subset (other)
        end

    subtract (other: SUBSET [G]) is
            -- Remove all items also in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        deferred
        ensure
            is_disjoint: disjoint (other)
        end

    symdif (other: SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            temp: like Current
        do
            temp := duplicate (count)
            temp.intersect (other)
            merge (other)
            subtract (temp)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets with the associated operations,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from SET)

feature -- Comparison

    disjoint (other: SUBSET [G]): BOOLEAN
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
        require
            non_negative: n >= 0
        ensure
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: SUBSET [G])
            -- Remove all items not in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure
            is_subset_other: is_subset (other)

    subtract (other: SUBSET [G])
            -- Remove all items also in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure
            is_disjoint: disjoint (other)

    symdif (other: SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SUBSET [G]

Ancestors
    SET [G]

Descendants
    COMPARABLE_SET [G -> COMPARABLE]
    TRAVERSABLE_SUBSET [G]

Clients
    SUBSET [G]

Suppliers
    BOOLEAN
    CONTAINER [G]
    INTEGER
    SUBSET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SUBSET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Subsets with the associated operations,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SUBSET [G]

feature -- Comparison

    is_subset (other: SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    disjoint (other: SUBSET [G]): BOOLEAN
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Element change

    merge (other: CONTAINER [G])
            -- Add all items of other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
        require
            non_negative: n >= 0
        ensure
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: SUBSET [G])
            -- Remove all items not in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure
            is_subset_other: is_subset (other)

    subtract (other: SUBSET [G])
            -- Remove all items also in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure
            is_disjoint: disjoint (other)

    symdif (other: SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE_SUBSET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Subsets that are traversable sequentially"
    status: "See notice at end of class"
    names: traversable_subset, set, subset
    access: sequential
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    TRAVERSABLE_SUBSET [G]

inherit
    SUBSET [G]
        undefine
            disjoint,
            symdif
        end

feature -- Access

    item: G is
            -- Current item
        require
            not_off: not off
        deferred
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        deferred
        end

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

feature -- Status report

    after: BOOLEAN is
            -- Is cursor behind last item?
        deferred
        end

    off: BOOLEAN is
            -- Is cursor off the active items?
        deferred
        end

    is_empty: BOOLEAN is
            -- Is container empty?
        deferred
        end

feature -- Cursor movement

    start is
            -- Move cursor to first item.
        deferred
        end

    forth is
            -- Move cursor to next element.
        require
            not_after: not after
        deferred
        end

feature -- Element change

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
        local
            lin_rep: LINEAR [G]
        do
            lin_rep ?= other
            if lin_rep = void then
                lin_rep := other.linear_representation
            end
            from
                lin_rep.start
            until
                lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

feature -- Removal

    remove is
            -- Remove current item.
        require
            not_off: not off
        deferred
        end

feature -- Basic operations

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

    intersect (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items not in other.
            -- No effect if other is_empty.
        do
            if not other.is_empty then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        forth
                    else
                        remove
                    end
                end
            else
                wipe_out
            end
        end

    subtract (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other.
        do
            if not (other.is_empty or is_empty) then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        remove
                    else
                        forth
                    end
                end
            end
        end

feature {NONE} -- Implementation

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
        require
            item_exists: v /= void
            other_exists: other /= void
        deferred
        ensure
            strategy_set: Result /= void
        end

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
        require
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

invariant

    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE_SUBSET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TRAVERSABLE_SUBSET [G]

General
    cluster: base.structures.set
    description: "Subsets that are traversable sequentially"

Ancestors
    SUBSET [G]

Queries
    after: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] TRAVERSABLE_SUBSET [G]
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    forth
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Constraints
    empty definition
    count range

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE_SUBSET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Subsets that are traversable sequentially"
    status: "See notice at end of class"
    names: traversable_subset, set, subset
    access: sequential
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    TRAVERSABLE_SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Current item
        require
            not_off: not off
        deferred
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        deferred
        end

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    after: BOOLEAN is
            -- Is cursor behind last item?
        deferred
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is container empty?
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is cursor off the active items?
        deferred
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Move cursor to next element.
        require
            not_after: not after
        deferred
        end

    start is
            -- Move cursor to first item.
        deferred
        end

feature -- Element change

    extend (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    merge (other: CONTAINER [G]) is
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            lin_rep: LINEAR [G]
        do
            lin_rep ?= other
            if lin_rep = void then
                lin_rep := other.linear_representation
            end
            from
                lin_rep.start
            until
                lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put (v: G) is
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: G) is
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        deferred
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    remove is
            -- Remove current item.
        require
            not_off: not off
        deferred
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        deferred
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items not in other.
            -- No effect if other is_empty.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        forth
                    else
                        remove
                    end
                end
            else
                wipe_out
            end
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not (other.is_empty or is_empty) then
                from
                    start
                    other.start
                until
                    off
                loop
                    if other.has (item) then
                        remove
                    else
                        forth
                    end
                end
            end
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

feature {NONE} -- Implementation

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
        require
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
        require
            item_exists: v /= void
            other_exists: other /= void
        deferred
        ensure
            strategy_set: Result /= void
        end

invariant

    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE_SUBSET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Subsets that are traversable sequentially"
    status: "See notice at end of class"
    names: traversable_subset, set, subset
    access: sequential
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TRAVERSABLE_SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
        require
            not_off: not off

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is cursor behind last item?

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is container empty?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is cursor off the active items?

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor to next element.
        require
            not_after: not after

    start
            -- Move cursor to first item.

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
        require
            not_off: not off

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE_SUBSET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TRAVERSABLE_SUBSET [G]

Ancestors
    SUBSET [G]

Descendants
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]

Clients
    PART_SORTED_SET [G -> PART_COMPARABLE]
    SUBSET_STRATEGY [G]
    SUBSET_STRATEGY_GENERIC [G]
    SUBSET_STRATEGY_HASHABLE [G]
    TRAVERSABLE_SUBSET [G]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Suppliers
    BOOLEAN
    CONTAINER [G]
    INTEGER
    LINEAR [G]
    SUBSET_STRATEGY [G]
    TRAVERSABLE_SUBSET [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE_SUBSET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Subsets that are traversable sequentially"
    status: "See notice at end of class"
    names: traversable_subset, set, subset
    access: sequential
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TRAVERSABLE_SUBSET [G]

feature -- Access

    item: G
            -- Current item
        require
            not_off: not off

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?

feature -- Status report

    after: BOOLEAN
            -- Is cursor behind last item?

    off: BOOLEAN
            -- Is cursor off the active items?

    is_empty: BOOLEAN
            -- Is container empty?

feature -- Cursor movement

    start
            -- Move cursor to first item.

    forth
            -- Move cursor to next element.
        require
            not_after: not after

feature -- Element change

    merge (other: CONTAINER [G])
            -- Add all items of other.

feature -- Removal

    remove
            -- Remove current item.
        require
            not_off: not off

feature -- Basic operations

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.

invariant

    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE_SUBSET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_SORTED_SET Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a total order relation;
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

inherit
    COMPARABLE_SET [G]
        rename
            symdif as subset_symdif
        export
            {NONE} subset_symdif
        undefine
            search,
            has,
            index,
            off,
            min,
            max,
            index_of,
            prune_all,
            occurrences,
            is_equal
        redefine
            merge,
            intersect,
            subtract
        select
            extend,
            put,
            prune
        end

    LINEAR_SUBSET [G]
        undefine
            is_equal,
            prune_all
        redefine
            merge,
            intersect,
            subtract
        select
            symdif
        end

    SORTED_TWO_WAY_LIST [G]
        rename
            extend as stwl_extend,
            put as stwl_put,
            prune as stwl_prune,
            merge as stwl_merge
        export
            {NONE} stwl_extend, stwl_put, stwl_prune, stwl_merge,
            {ANY} min, max, index, after, before, forth, finish, start, item, is_empty, empty, back, remove, search, off, go_i_th
        undefine
            changeable_comparison_criterion
        redefine
            duplicate
        end

create
    make

feature -- Element change

    extend (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of put.
        local
            found: BOOLEAN
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
                back
            end
            if object_comparison then
                if after or else not equal (item, v) then
                    put_left (v)
                    back
                end
            else
                from
                until
                    found or after or else not equal (item, v)
                loop
                    found := item = v
                    forth
                end
                if not found then
                    put_left (v)
                end
                back
            end
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of extend.
        local
            found: BOOLEAN
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
                back
            end
            if object_comparison then
                if after or else not equal (item, v) then
                    put_left (v)
                    back
                end
            else
                from
                until
                    found or after or else not equal (item, v)
                loop
                    found := item = v
                    forth
                end
                if not found then
                    put_left (v)
                end
                back
            end
        end

    merge (other: TRAVERSABLE_SUBSET [G]) is
            -- Add all items of other.
        local
            mode: BOOLEAN
            other_item: like item
        do
            from
                mode := object_comparison
                start
                other.start
            until
                after or other.after
            loop
                other_item := other.item
                if item < other_item then
                    search_after (other_item)
                end
                if not after then
                    if (not mode and then item = other_item) or else (mode and then item.is_equal (other_item)) then
                        forth
                        other.forth
                    else
                        from
                        until
                            other.after or else other.item >= item
                        loop
                            put_left (other.item)
                            other.forth
                        end
                    end
                end
            end
            from
            until
                other.after
            loop
                put_left (other.item)
                other.forth
            end
        end

feature -- Removal

    prune (v: like item) is
            -- Remove v if present.
        do
            start
            stwl_prune (v)
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        local
            pos: CURSOR
            counter: INTEGER
        do
            pos := cursor
            Result := new_chain
            Result.finish
            Result.forth
            from
            until
                (counter = n) or else after
            loop
                Result.put_left (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        end

feature -- Basic operations

    intersect (other: like Current) is
            -- Remove all items not in other.
        do
            from
                start
                other.start
            until
                after or other.after
            loop
                from
                until
                    after or item >= other.item
                loop
                    remove
                end
                if not after then
                    from
                    until
                        other.after or else other.item >= item
                    loop
                        other.forth
                    end
                    if not other.after and then other.item.is_equal (item) then
                        forth
                        other.forth
                    end
                end
            end
            if other.after then
                from
                until
                    after
                loop
                    remove
                end
            end
        end

    subtract (other: like Current) is
            -- Remove all items also in other.
        local
            other_item: like item
        do
            from
                start
                other.start
            until
                after or other.after
            loop
                other_item := other.item
                if item < other_item then
                    search_after (other_item)
                end
                if not after and then other_item.is_equal (item) then
                    remove
                end
                other.forth
            end
        end

feature {NONE} -- Inapplicable

    subset_symdif (other: SUBSET [G]) is
            -- Inapplicable symdif.
        do
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_SORTED_SET Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

General
    cluster: base.structures.set
    description:
        "Sets whose items may be compared according to a total order relation;
        implemented as sorted two-way lists."
    create: make

Ancestors
    COMPARABLE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] TWO_WAY_SORTED_SET [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_SORTED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    sublist: [like Current] TWO_WAY_SORTED_SET [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    intersect (other: [like Current] TWO_WAY_SORTED_SET [G])
    make
    merge (other: TRAVERSABLE_SUBSET [G])
    merge_left (other: [like Current] TWO_WAY_SORTED_SET [G])
    merge_right (other: [like Current] TWO_WAY_SORTED_SET [G])
    move (i: INTEGER)
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    sort
    split (n: INTEGER)
    start
    subtract (other: [like Current] TWO_WAY_SORTED_SET [G])
    swap (i: INTEGER)
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_SORTED_SET Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a total order relation;
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            before := True
        ensure -- from LINKED_LIST
            is_before: before
        end

feature {NONE} -- Access

    sequential_has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    sequential_index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Access

    cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (active, after, before)
        end

    first: like item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := first_element.item
        end

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        local
            pos: CURSOR
        do
            if not is_empty then
                pos := cursor
                start
                search (v)
                Result := not after
                go_to (pos)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if after then
                Result := count + 1
            elseif not before then
                p ?= cursor;
                check
                    p /= void
                end;
                from
                    start
                    Result := 1
                until
                    p.active = active
                loop
                    forth
                    Result := Result + 1
                end;
                go_to (p)
            end
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_index_of (v, i)
            go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        do
            Result := active.item
        end

    last: like item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty
        do
            Result := last_element.item
        end

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search_after (v: like item) is
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                start
            until
                after or else v <= item
            loop
                forth
            end
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)
        end

    search_before (v: like item) is
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        do
            from
                finish
            until
                before or else v >= item
            loop
                back
            end
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)
        end

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            Result := item
            go_to (pos)
        end

feature {NONE} -- Measurement

    cs_max: like item is
            -- Maximum item
            -- (from COMPARABLE_STRUCT)
        require -- from COMPARABLE_STRUCT
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item > Result then
                    Result := item
                end
                forth
            end
        end

    cs_min: like item is
            -- Minimum item
            -- (from COMPARABLE_STRUCT)
        require -- from COMPARABLE_STRUCT
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item < Result then
                    Result := item
                end
                forth
            end
        end

    min_max_available: BOOLEAN is
            -- Can min and max be computed?
            -- (from COMPARABLE_STRUCT)
        do
            Result := not is_empty
        ensure -- from COMPARABLE_STRUCT
            Result implies not is_empty
        end

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, count)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count
        end

    max: like item is
            -- Maximum item
            -- (from SORTED_LIST)
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := last
        ensure -- from SORTED_LIST
            max_is_last: Result = last
        end

    median: like item is
            -- Median item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := i_th ((count + 1) // 2)
        ensure -- from SORTED_LIST
            median_definition: Result = i_th ((count + 1) // 2)
        end

    min: like item is
            -- Minimum item
            -- (from SORTED_LIST)
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        require -- from SORTED_LIST
            not_empty: not is_empty
        do
            Result := first
        ensure -- from SORTED_LIST
            min_is_first: Result = first
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := cursor
            Result := sequential_occurrences (v)
            go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not is_empty and not other.is_empty then
                s := subset_strategy (other)
                Result := s.disjoint (Current, other)
            else
                Result := True
            end
        end

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        local
            c1, c2: CURSOR
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison)
                if Result and not is_empty then
                    c1 ?= cursor
                    c2 ?= other.cursor
                    check
                        cursors_exist: c1 /= void and c2 /= void
                    end
                    from
                        start
                        other.start
                    until
                        after or not Result
                    loop
                        if object_comparison then
                            Result := equal (item, other.item)
                        else
                            Result := (item = other.item)
                        end
                        forth
                        other.forth
                    end
                    go_to (c1)
                    other.go_to (c2)
                elseif is_empty and other.is_empty and object_comparison = other.object_comparison then
                    Result := True
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count
        end

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN is
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            if not other.is_empty and then count <= other.count then
                from
                    start
                until
                    off or else not other.has (item)
                loop
                    forth
                end
                if off then
                    Result := True
                end
            elseif is_empty then
                Result := True
            end
        end

    is_superset (other: SUBSET [G]): BOOLEAN is
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            Result := other.is_subset (Current)
        end

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    isfirst: BOOLEAN is
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        do
            Result := not after and not before and (active = first_element)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    islast: BOOLEAN is
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        do
            Result := (active = last_element) and then not after and then not before
        ensure -- from CHAIN
            valid_position: Result implies not is_empty
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := after or before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)
        do
            Result := not off
        end

    sorted: BOOLEAN is
            -- Is the structure sorted?
            -- (from SORTED_TWO_WAY_LIST)
        local
            c: CURSOR
            prev: like item
        do
            Result := True
            if count > 1 then
                from
                    c := cursor
                    start
                    check
                        not off
                    end
                    prev := item
                    forth
                until
                    after or not Result
                loop
                    Result := (prev <= item)
                    prev := item
                    forth
                end
                go_to (c)
            end
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_element
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_element
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        do
            Result := (i >= 0) and (i <= count + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= count)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        end

    writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature  -- Cursor movement

    back is
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before
        do
            if after then
                after := False
                if is_empty then
                    before := True
                end
            else
                active := active.left
                if active = void then
                    active := first_element
                    before := True
                end
            end
        end

    finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        do
            if not is_empty then
                active := last_element
                after := False
                before := False
            else
                after := False
                before := True
            end
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Cursor movement

    forth is
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        do
            if before then
                before := False
                if is_empty then
                    after := True
                end
            else
                active := active.right
                if active = void then
                    active := last_element
                    after := True
                end
            end
        ensure then -- from LIST
            moved_forth: index = old index + 1
        end

    go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        do
            if i = 0 then
                before := True
                after := False
                active := first_element
            elseif i = count + 1 then
                before := False;
                after := True;
                active := last_element
            else
                move (i - index)
            end
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i
        end

    go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            after := ll_c.after
            before := ll_c.before
            if before then
                active := first_element
            elseif after then
                active := last_element
            else
                active := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        local
            counter: INTEGER
            p: like first_element
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if after then
                    after := False;
                    counter := - 1
                end;
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left
                    counter := counter - 1
                end;
                if p = void then
                    before := True;
                    active := first_element
                else
                    active := p
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

    start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_element /= void then
                active := first_element
                after := False
            else
                after := True
            end
            before := False
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after
        end

feature {NONE} -- Cursor movement

    ll_move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_element
        do
            if i > 0 then
                if before then
                    before := False
                    counter := 1
                end
                from
                    p := active
                until
                    (counter = i) or else (p = void)
                loop
                    active := p
                    p := p.right
                    counter := counter + 1
                end
                if p = void then
                    after := True
                else
                    active := p
                end
            elseif i < 0 then
                new_index := index + i;
                before := True;
                after := False;
                active := first_element;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: count >= old count
        end

    extend (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        local
            found: BOOLEAN
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
                back
            end
            if object_comparison then
                if after or else not equal (item, v) then
                    put_left (v)
                    back
                end
            else
                from
                until
                    found or after or else not equal (item, v)
                loop
                    found := item = v
                    forth
                end
                if not found then
                    put_left (v)
                end
                back
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        do
            extend (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        end

    merge (other: TRAVERSABLE_SUBSET [G]) is
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            mode: BOOLEAN
            other_item: like item
        do
            from
                mode := object_comparison
                start
                other.start
            until
                after or other.after
            loop
                other_item := other.item
                if item < other_item then
                    search_after (other_item)
                end
                if not after then
                    if (not mode and then item = other_item) or else (mode and then item.is_equal (other_item)) then
                        forth
                        other.forth
                    else
                        from
                        until
                            other.after or else other.item >= item
                        loop
                            put_left (other.item)
                            other.forth
                        end
                    end
                end
            end
            from
            until
                other.after
            loop
                put_left (other.item)
                other.forth
            end
        end

    merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    last_element := other_last_element
                    first_element := other_first_element
                    if before then
                        active := first_element
                    else
                        active := last_element
                    end
                elseif isfirst then
                    other_last_element.put_right (first_element);
                    first_element := other_first_element
                elseif after then
                    other_first_element.put_left (last_element);
                    last_element := other_last_element;
                    active := last_element
                else
                    other_first_element.put_left (active.left)
                    active.put_left (other_last_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        do
            if is_empty or else islast then
                last_element := other.last_element
            end
            ll_merge_right (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    move_item (v: G) is
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)
        local
            idx: INTEGER
            found: BOOLEAN
        do
            idx := index
            from
                start
            until
                found or after
            loop
                if object_comparison then
                    found := equal (v, item)
                else
                    found := (v = item)
                end
                if not found then
                    forth
                end
            end
            check
                found: found and not after
            end
            remove
            go_i_th (idx)
            put_left (v)
        end

    put (v: G) is
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        local
            found: BOOLEAN
        do
            search_after (v)
            if after or else not item.is_equal (v) then
                put_left (v)
                back
            end
            if object_comparison then
                if after or else not equal (item, v) then
                    put_left (v)
                    back
                end
            else
                from
                until
                    found or after or else not equal (item, v)
                loop
                    found := item = v
                    forth
                end
                if not found then
                    put_left (v)
                end
                back
            end
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        end

    put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        do
            ll_put_front (v)
            if count = 1 then
                last_element := first_element
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    put_i_th (v: like item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := cursor
            go_i_th (i)
            replace (v)
            go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        local
            p: like first_element
        do
            p := new_cell (v)
            if is_empty then
                first_element := p
                last_element := p
                active := p
                before := False
            elseif after then
                p.put_left (last_element);
                last_element := p;
                active := p
            elseif isfirst then
                p.put_right (active);
                first_element := p
            else
                p.put_left (active.left)
                p.put_right (active)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1
        end

    put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            was_last: BOOLEAN
        do
            was_last := islast
            ll_put_right (v)
            if count = 1 then
                last_element := active
            elseif was_last then
                last_element := active.right
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

    replace (v: like item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        do
            active.put (v)
        ensure -- from ACTIVE
            item_replaced: item = v
        end

feature {NONE} -- Element change

    stwl_extend (v: like item) is
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            extendible: extendible
        do
            search_after (v)
            put_left (v)
            back
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v
        end

    stwl_merge (other: LINEAR [G]) is
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        do
            from
                other.start
            until
                other.off
            loop
                extend (other.item)
                other.forth
            end
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
        end

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        local
            other_first_element: like first_element
            other_last_element: like first_element
            other_count: INTEGER
        do
            if not other.is_empty then
                other_first_element := other.first_element
                other_last_element := other.last_element
                other_count := other.count
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_empty then
                    first_element := other_first_element
                    active := first_element
                else
                    if not islast then
                        other_last_element.put_right (active.right)
                    end
                    active.put_right (other_first_element)
                end
                count := count + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    stwl_put (v: like item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        do
            replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        end

    sequence_put (v: like item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
        end

    ll_put_front (v: like item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_element
        do
            p := new_cell (v)
            p.put_right (first_element)
            first_element := p
            if before or is_empty then
                active := p
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v
        end

    ll_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        local
            p: like first_element
        do
            p := new_cell (v)
            check
                is_empty implies before
            end
            if before then
                p.put_right (first_element)
                first_element := p
                active := p
            else
                p.put_right (active.right)
                active.put_right (p)
            end
            count := count + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v
        end

feature -- Removal

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        do
            Result := is_empty
        ensure then -- from SET
            only_on_empty: Result = is_empty
        end

    prune (v: like item) is
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        do
            start
            stwl_prune (v)
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        end

    prune_all (v: like item) is
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            from
                start
                search (v)
            until
                off or else v < item
            loop
                remove
            end
            if not off then
                finish
                forth
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        local
            succ, pred, removed: like first_element
        do
            removed := active
            if isfirst then
                active := first_element.right
                first_element.forget_right
                first_element := active
                if count = 1 then
                    check
                        no_active: active = void
                    end
                    after := True
                    last_element := void
                end
            elseif islast then
                active := last_element.left;
                last_element.forget_left;
                last_element := active;
                after := True
            else
                pred := active.left
                succ := active.right
                pred.forget_right
                succ.forget_left
                pred.put_right (succ)
                active := succ
            end
            count := count - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        end

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        do
            back
            remove
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        end

    remove_right is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        do
            forth
            remove
            back
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        end

    remove_sublist is
            -- (from TWO_WAY_LIST)
        do
            sublist := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_element
        do
            if n = 0 then
                create sublist.make
            else
                active_index := index
                if active_index + n > count + 1 then
                    actual_number := count + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := active
                p_elem := previous
                move (actual_number - 1)
                e_elem := active
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                count := count - actual_number
                if p_elem /= void then
                    p_elem.put_right (n_elem)
                else
                    first_element := n_elem
                end
                if n_elem /= void then
                    active := n_elem
                else
                    last_element := p_elem
                    active := p_elem
                    after := True
                end
            end
        end

    wipe_out is
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        do
            ll_wipe_out
            last_element := void
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

feature {NONE} -- Removal

    stwl_prune (v: like item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search (v)
            if not exhausted then
                remove
            end
        end

    ll_wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            active := void
            first_element := void
            before := True
            after := False
            count := 0
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                start
            until
                is_empty
            loop
                remove
            end
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    sort is
            -- Sort all items.
            -- Has O(count * log (count)) complexity.
            -- (from SORTED_TWO_WAY_LIST)
        local
            no_change: BOOLEAN
            gap: INTEGER
            left_cell, cell: like first_element
            left_cell_item, cell_item: like item
        do
            if not is_empty then
                from
                    gap := count * 10 // 13
                until
                    gap = 0
                loop
                    from
                        no_change := False
                        go_i_th (1 + gap)
                    until
                        no_change
                    loop
                        no_change := True
                        from
                            left_cell := first_element
                            cell := active
                        until
                            cell = void
                        loop
                            left_cell_item := left_cell.item
                            cell_item := cell.item
                            if cell_item < left_cell_item then
                                no_change := False
                                cell.put (left_cell_item)
                                left_cell.put (cell_item)
                            end
                            left_cell := left_cell.right
                            cell := cell.right
                        end
                    end
                    gap := gap * 10 // 13
                end
            end
        end

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        local
            old_item, new_item: like item
            pos: CURSOR
        do
            pos := cursor
            old_item := item
            go_i_th (i)
            new_item := item
            replace (old_item)
            go_to (pos)
            replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            pos := cursor
            Result := new_chain
            Result.finish
            Result.forth
            from
            until
                (counter = n) or else after
            loop
                Result.put_left (item)
                forth
                counter := counter + 1
            end
            go_to (pos)
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count
        end

feature -- Basic operations

    intersect (other: like Current) is
            -- Remove all items not in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
            from
                start
                other.start
            until
                after or other.after
            loop
                from
                until
                    after or item >= other.item
                loop
                    remove
                end
                if not after then
                    from
                    until
                        other.after or else other.item >= item
                    loop
                        other.forth
                    end
                    if not other.after and then other.item.is_equal (item) then
                        forth
                        other.forth
                    end
                end
            end
            if other.after then
                from
                until
                    after
                loop
                    remove
                end
            end
        ensure -- from SUBSET
            is_subset_other: is_subset (other)
        end

    subtract (other: like Current) is
            -- Remove all items also in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            other_item: like item
        do
            from
                start
                other.start
            until
                after or other.after
            loop
                other_item := other.item
                if item < other_item then
                    search_after (other_item)
                end
                if not after and then other_item.is_equal (item) then
                    remove
                end
                other.forth
            end
        ensure -- from SUBSET
            is_disjoint: disjoint (other)
        end

    symdif (other: TRAVERSABLE_SUBSET [G]) is
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        local
            s: SUBSET_STRATEGY [G]
        do
            if not other.is_empty then
                if is_empty then
                    copy (other)
                else
                    s := subset_strategy (other)
                    s.symdif (Current, other)
                end
            end
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    subset_symdif (other: SUBSET [G]) is
            -- Inapplicable symdif.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        do
        end

feature {NONE} -- Implementation

    subset_strategy (other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Subset strategy suitable for the type of the contained elements.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_empty: not is_empty
        do
            start
            check
                not_off: not off
            end
            Result := subset_strategy_selection (item, other)
        end

    subset_strategy_selection (v: G; other: TRAVERSABLE_SUBSET [G]): SUBSET_STRATEGY [G] is
            -- Strategy to calculate several subset features selected depending
            -- on the dynamic type of v and other
            -- (from LINEAR_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            item_exists: v /= void
            other_exists: other /= void
        local
            h: HASHABLE
        do
            h ?= v
            if h /= void and object_comparison then
                create {SUBSET_STRATEGY_HASHABLE [G]} Result
            else
                create {SUBSET_STRATEGY_GENERIC [G]} Result
            end
        ensure -- from TRAVERSABLE_SUBSET
            strategy_set: Result /= void
        end

feature {SORTED_TWO_WAY_LIST} -- Implementation

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from SORTED_TWO_WAY_LIST)
        do
            create Result.make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {TWO_WAY_LIST} -- Implementation

    make_sublist (first_item, last_item: like first_element; n: INTEGER) is
            -- Create sublist
            -- (from TWO_WAY_LIST)
        do
            make
            first_element := first_item
            last_element := last_item
            active := first_element
            count := n
        end

    new_cell (v: like item): like first_element is
            -- A newly created instance of the type of first_element.
            -- (from TWO_WAY_LIST)
        do
            create Result
            Result.put (v)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    previous: like first_element is
            -- Element left of cursor
            -- (from TWO_WAY_LIST)
        do
            if after then
                Result := active
            elseif active /= void then
                Result := active.left
            end
        end

feature {LINKED_LIST} -- Implementation

    active: like first_element
            -- Element at cursor position
            -- (from LINKED_LIST)

    cleanup_after_remove (v: like first_element) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    next: like first_element is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if before then
                Result := active
            elseif active /= void then
                Result := active.right
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_SORTED_SET Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a total order relation;
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    max: like item
            -- Maximum item
            -- (from SORTED_LIST)
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            max_is_last: Result = last

    median: like item
            -- Median item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            median_definition: Result = i_th ((count + 1) // 2)

    min: like item
            -- Minimum item
            -- (from SORTED_LIST)
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            min_is_first: Result = first

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    sorted: BOOLEAN
            -- Is the structure sorted?
            -- (from SORTED_TWO_WAY_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature  -- Cursor movement

    back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Cursor movement

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: TRAVERSABLE_SUBSET [G])
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    sort
            -- Sort all items.
            -- Has O(count * log (count)) complexity.
            -- (from SORTED_TWO_WAY_LIST)

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: like Current)
            -- Remove all items not in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: like Current)
            -- Remove all items also in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_SORTED_SET Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Ancestors
    COMPARABLE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Clients
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Suppliers
    BOOLEAN
    COMPARABLE
    INTEGER
    TRAVERSABLE_SUBSET [G]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_SORTED_SET Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Sets whose items may be compared according to a total order relation;
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

create
    make

feature -- Element change

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of put.

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of extend.

    merge (other: TRAVERSABLE_SUBSET [G])
            -- Add all items of other.

feature -- Removal

    prune (v: like item)
            -- Remove v if present.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items

feature -- Basic operations

    intersect (other: like Current)
            -- Remove all items not in other.

    subtract (other: like Current)
            -- Remove all items also in other.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_SORTED_SET

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.sort

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.sort	(diagram)

Supercluster
    base.structures

Classes
    COMPARABLE_STRUCT [G -> COMPARABLE]
    SORTED_STRUCT [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_STRUCT Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures whose items may be compared
        according to a total order relation
    ]"
    status: "See notice at end of class"
    names: comparable_struct
    access: min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    COMPARABLE_STRUCT [G -> COMPARABLE]

inherit
    BILINEAR [G]

feature -- Measurement

    min: like item is
            -- Minimum item
        require
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item < Result then
                    Result := item
                end
                forth
            end
        end

    max: like item is
            -- Maximum item
        require
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item > Result then
                    Result := item
                end
                forth
            end
        end

    min_max_available: BOOLEAN is
            -- Can min and max be computed?
        do
            Result := not is_empty
        ensure
            Result implies not is_empty
        end

feature {NONE} -- Inapplicable

    index: INTEGER is
        do
        end

invariant

    empty_constraint: min_max_available implies not is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_STRUCT Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COMPARABLE_STRUCT [G -> COMPARABLE]

General
    cluster: base.structures.sort
    description:
        "Data structures whose items may be compared
        according to a total order relation"

Ancestors
    BILINEAR [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    max: [like item] G
    min: [like item] G
    min_max_available: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (v: [like item] G)
    start

Constraints
    empty constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_STRUCT Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures whose items may be compared
        according to a total order relation
    ]"
    status: "See notice at end of class"
    names: comparable_struct
    access: min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    COMPARABLE_STRUCT [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        end

    off: BOOLEAN is
            -- Is there no current item?
            -- (from BILINEAR)
        do
            Result := before or after
        end

feature {NONE} -- Access

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    max: like item is
            -- Maximum item
        require
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item > Result then
                    Result := item
                end
                forth
            end
        end

    min: like item is
            -- Minimum item
        require
            min_max_available
        do
            from
                start
                Result := item
                forth
            until
                off
            loop
                if item < Result then
                    Result := item
                end
                forth
            end
        end

    min_max_available: BOOLEAN is
            -- Can min and max be computed?
        do
            Result := not is_empty
        ensure
            Result implies not is_empty
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)
        deferred
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)
        deferred
        end

    finish is
            -- Move to last position.
            -- (from LINEAR)
        deferred
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move to first position if any.
            -- (from TRAVERSABLE)
        deferred
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature {NONE} -- Inapplicable

    index: INTEGER is
        do
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    empty_constraint: min_max_available implies not is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_STRUCT Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures whose items may be compared
        according to a total order relation
    ]"
    status: "See notice at end of class"
    names: comparable_struct
    access: min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COMPARABLE_STRUCT [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)

    off: BOOLEAN
            -- Is there no current item?
            -- (from BILINEAR)

feature -- Measurement

    max: like item
            -- Maximum item
        require
            min_max_available

    min: like item
            -- Minimum item
        require
            min_max_available

    min_max_available: BOOLEAN
            -- Can min and max be computed?
        ensure
            Result implies not is_empty

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    empty_constraint: min_max_available implies not is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_STRUCT Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COMPARABLE_STRUCT [G -> COMPARABLE]

Ancestors
    BILINEAR [G]

Descendants
    COMPARABLE_SET [G -> COMPARABLE]
    SORTED_STRUCT [G -> COMPARABLE]

Clients
    COMPARABLE_STRUCT [G -> COMPARABLE]

Suppliers
    BOOLEAN
    COMPARABLE
    COMPARABLE_STRUCT [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COMPARABLE_STRUCT Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures whose items may be compared
        according to a total order relation
    ]"
    status: "See notice at end of class"
    names: comparable_struct
    access: min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COMPARABLE_STRUCT [G -> COMPARABLE]

feature -- Measurement

    min: like item
            -- Minimum item
        require
            min_max_available

    max: like item
            -- Maximum item
        require
            min_max_available

    min_max_available: BOOLEAN
            -- Can min and max be computed?
        ensure
            Result implies not is_empty

invariant

    empty_constraint: min_max_available implies not is_empty

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.sort

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


SORTED_STRUCT Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items are sorted according to a total order relation"
    status: "See notice at end of class"
    names: sorted_struct, comparable_struct
    access: index, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SORTED_STRUCT [G -> COMPARABLE]

inherit
    COMPARABLE_STRUCT [G]
        undefine
            search,
            off
        redefine
            min,
            max
        end

    INDEXABLE [G, INTEGER]
        rename
            item as i_th,
            put as put_i_th,
            bag_put as putt
        redefine
            putt
        end

    LINEAR [G]

feature -- Measurement

    min: like item is
            -- Minimum item
        require else
            is_sorted: sorted
        do
            start
            Result := item
        end

    max: like item is
            -- Maximum item
        require else
            is_sorted: sorted
        do
            finish
            Result := item
        end

    median: like item is
            -- Median element
        deferred
        ensure
            median_present: has (Result)
        end

feature -- Status report

    sorted: BOOLEAN is
            -- Is structure sorted?
        local
            m: like item
        do
            if is_empty then
                Result := True
            else
                from
                    start
                    m := item
                    forth
                until
                    exhausted or else (item < m)
                loop
                    m := item
                    forth
                end
                Result := exhausted
            end
        end

feature -- Transformation

    sort is
            -- Sort structure.
        deferred
        ensure
            is_sorted: sorted
        end

feature {NONE} -- Inapplicable

    putt (v: like item) is
        do
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_STRUCT Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SORTED_STRUCT [G -> COMPARABLE]

General
    cluster: base.structures.sort
    description: "Structures whose items are sorted according to a total order relation"

Ancestors
    COMPARABLE_STRUCT [G -> COMPARABLE]
    INDEXABLE [G, H -> INTEGER]
    LINEAR [G]

Queries
    infix "@" (k: INTEGER): G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (k: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    min_max_available: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    sorted: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN

Commands
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    forth
    prune (v: G)
    prune_all (v: G)
    put_i_th (v: G; k: INTEGER)
    search (v: [like item] G)
    sort
    start
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_STRUCT Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items are sorted according to a total order relation"
    status: "See notice at end of class"
    names: sorted_struct, comparable_struct
    access: index, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    SORTED_STRUCT [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        deferred
        end

    i_th (k: INTEGER): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    infix "@" (k: INTEGER): G is
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)
        deferred
        end

feature {NONE} -- Access

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Measurement

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from INDEXABLE)
        deferred
        ensure -- from INDEXABLE
            not_void: Result /= void
        end

    max: like item is
            -- Maximum item
        require -- from COMPARABLE_STRUCT
            min_max_available
        require else
            is_sorted: sorted
        do
            finish
            Result := item
        end

    median: like item is
            -- Median element
        deferred
        ensure
            median_present: has (Result)
        end

    min: like item is
            -- Minimum item
        require -- from COMPARABLE_STRUCT
            min_max_available
        require else
            is_sorted: sorted
        do
            start
            Result := item
        end

    min_max_available: BOOLEAN is
            -- Can min and max be computed?
            -- (from COMPARABLE_STRUCT)
        do
            Result := not is_empty
        ensure -- from COMPARABLE_STRUCT
            Result implies not is_empty
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)
        deferred
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    extendible: BOOLEAN is
            -- May new items be added?
            -- (from COLLECTION)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from COLLECTION)
        deferred
        end

    sorted: BOOLEAN is
            -- Is structure sorted?
        local
            m: like item
        do
            if is_empty then
                Result := True
            else
                from
                    start
                    m := item
                    forth
                until
                    exhausted or else (item < m)
                loop
                    m := item
                    forth
                end
                Result := exhausted
            end
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
            -- (from INDEXABLE)
        deferred
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)
        deferred
        end

    finish is
            -- Move to last position.
            -- (from LINEAR)
        deferred
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        end

    start is
            -- Move to first position if any.
            -- (from TRAVERSABLE)
        deferred
        end

feature -- Element change

    extend (v: G) is
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        deferred
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    put_i_th (v: G; k: INTEGER) is
            -- Associate value v with key k.
            -- (from INDEXABLE)
        require -- from TABLE
            valid_key: valid_index (k)
        deferred
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

feature -- Removal

    prune (v: G) is
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable
        deferred
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        deferred
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Transformation

    sort is
            -- Sort structure.
        deferred
        ensure
            is_sorted: sorted
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature {NONE} -- Inapplicable

    putt (v: like item) is
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature -- Inapplicable

    index: INTEGER is
            -- (from COMPARABLE_STRUCT)
        do
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_STRUCT Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items are sorted according to a total order relation"
    status: "See notice at end of class"
    names: sorted_struct, comparable_struct
    access: index, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SORTED_STRUCT [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    i_th (k: INTEGER): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    infix "@" (k: INTEGER): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from INDEXABLE)
        ensure -- from INDEXABLE
            not_void: Result /= void

    max: like item
            -- Maximum item
        require -- from COMPARABLE_STRUCT
            min_max_available
        require else
            is_sorted: sorted

    median: like item
            -- Median element
        ensure
            median_present: has (Result)

    min: like item
            -- Minimum item
        require -- from COMPARABLE_STRUCT
            min_max_available
        require else
            is_sorted: sorted

    min_max_available: BOOLEAN
            -- Can min and max be computed?
            -- (from COMPARABLE_STRUCT)
        ensure -- from COMPARABLE_STRUCT
            Result implies not is_empty

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    sorted: BOOLEAN
            -- Is structure sorted?

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from INDEXABLE)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put_i_th (v: G; k: INTEGER)
            -- Associate value v with key k.
            -- (from INDEXABLE)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    sort
            -- Sort structure.
        ensure
            is_sorted: sorted

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Inapplicable

    index: INTEGER
            -- (from COMPARABLE_STRUCT)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_STRUCT Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    SORTED_STRUCT [G -> COMPARABLE]

Ancestors
    COMPARABLE_STRUCT [G -> COMPARABLE]
    INDEXABLE [G, H -> INTEGER]
    LINEAR [G]

Clients
    SORTED_STRUCT [G -> COMPARABLE]

Suppliers
    BOOLEAN
    COMPARABLE
    SORTED_STRUCT [G -> COMPARABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SORTED_STRUCT Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items are sorted according to a total order relation"
    status: "See notice at end of class"
    names: sorted_struct, comparable_struct
    access: index, membership, min, max
    contents: generic
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SORTED_STRUCT [G -> COMPARABLE]

feature -- Measurement

    min: like item
            -- Minimum item
        require else
            is_sorted: sorted

    max: like item
            -- Maximum item
        require else
            is_sorted: sorted

    median: like item
            -- Median element
        ensure
            median_present: has (Result)

feature -- Status report

    sorted: BOOLEAN
            -- Is structure sorted?

feature -- Transformation

    sort
            -- Sort structure.
        ensure
            is_sorted: sorted

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_STRUCT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.storage

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.storage	(diagram)

Supercluster
    base.structures

Classes
    BOUNDED [G]
    BOX [G]
    COUNTABLE [G]
    FINITE [G]
    FIXED [G]
    INFINITE [G]
    RESIZABLE [G]
    UNBOUNDED [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bounded data structures, with a notion of capacity."
    status: "See notice at end of class"
    names: bounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    BOUNDED [G]

inherit
    FINITE [G]

feature -- Measurement

    capacity: INTEGER is
            -- Number of items that may be stored
        deferred
        end

feature -- Status report

    full: BOOLEAN is
            -- Is structure full?
        do
            Result := (count = capacity)
        end

    resizable: BOOLEAN is
            -- May capacity be changed?
        deferred
        end

invariant

    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BOUNDED [G]

General
    cluster: base.structures.storage
    description: "Bounded data structures, with a notion of capacity."

Ancestors
    FINITE [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    resizable: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    valid count
    full definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bounded data structures, with a notion of capacity."
    status: "See notice at end of class"
    names: bounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    BOUNDED [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    capacity: INTEGER is
            -- Number of items that may be stored
        deferred
        end

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    full: BOOLEAN is
            -- Is structure full?
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    resizable: BOOLEAN is
            -- May capacity be changed?
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bounded data structures, with a notion of capacity."
    status: "See notice at end of class"
    names: bounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BOUNDED [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure full?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    resizable: BOOLEAN
            -- May capacity be changed?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BOUNDED [G]

Ancestors
    FINITE [G]

Descendants
    BOUNDED_QUEUE [G]
    BOUNDED_STACK [G]
    FIXED [G]
    RESIZABLE [G]

Clients
    BOUNDED [G]

Suppliers
    BOUNDED [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOUNDED Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Bounded data structures, with a notion of capacity."
    status: "See notice at end of class"
    names: bounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BOUNDED [G]

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored

feature -- Status report

    full: BOOLEAN
            -- Is structure full?

    resizable: BOOLEAN
            -- May capacity be changed?

invariant

    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOX Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        having the potential ability to become full,
        and characterized by their implementation properties.
    ]"
    status: "See notice at end of class"
    names: storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    BOX [G]

inherit
    CONTAINER [G]

feature -- Status report

    full: BOOLEAN is
            -- Is structure filled to capacity?
        deferred
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOX

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOX Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BOX [G]

General
    cluster: base.structures.storage
    description:
        "Data structures of the most general kind,
        having the potential ability to become full,
        and characterized by their implementation properties."

Ancestors
    CONTAINER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOX Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        having the potential ability to become full,
        and characterized by their implementation properties.
    ]"
    status: "See notice at end of class"
    names: storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    BOX [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
        deferred
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOX

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOX Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        having the potential ability to become full,
        and characterized by their implementation properties.
    ]"
    status: "See notice at end of class"
    names: storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BOX [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOX

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOX Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BOX [G]

Ancestors
    CONTAINER [G]

Descendants
    FINITE [G]
    INFINITE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOX Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Data structures of the most general kind,
        having the potential ability to become full,
        and characterized by their implementation properties.
    ]"
    status: "See notice at end of class"
    names: storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BOX [G]

feature -- Status report

    full: BOOLEAN
            -- Is structure filled to capacity?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOX

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Infinite containers whose items are in one-to-one
        correspondence with the integers.
    ]"
    status: "See notice at end of class"
    names: countable, infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    COUNTABLE [G]

inherit
    INFINITE [G]

feature -- Access

    item (i: INTEGER): G is
            -- The i-th item
        require
            positive_argument: i > 0
        deferred
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COUNTABLE [G]

General
    cluster: base.structures.storage
    description:
        "Infinite containers whose items are in one-to-one
        correspondence with the integers."

Ancestors
    INFINITE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    Is_empty: BOOLEAN
    item (i: INTEGER): G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Infinite containers whose items are in one-to-one
        correspondence with the integers.
    ]"
    status: "See notice at end of class"
    names: countable, infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    COUNTABLE [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item (i: INTEGER): G is
            -- The i-th item
        require
            positive_argument: i > 0
        deferred
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Infinite containers whose items are in one-to-one
        correspondence with the integers.
    ]"
    status: "See notice at end of class"
    names: countable, infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COUNTABLE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (i: INTEGER): G
            -- The i-th item
        require
            positive_argument: i > 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COUNTABLE [G]

Ancestors
    INFINITE [G]

Descendants
    COUNTABLE_SEQUENCE [G]

Suppliers
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Infinite containers whose items are in one-to-one
        correspondence with the integers.
    ]"
    status: "See notice at end of class"
    names: countable, infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COUNTABLE [G]

feature -- Access

    item (i: INTEGER): G
            -- The i-th item
        require
            positive_argument: i > 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.storage

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


FINITE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures with a finite item count"
    status: "See notice at end of class"
    names: finite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    FINITE [G]

inherit
    BOX [G]

feature -- Measurement

    count: INTEGER is
            -- Number of items
        deferred
        end

feature -- Status report

    is_empty: BOOLEAN is
            -- Is structure empty?
        do
            Result := (count = 0)
        end

invariant

    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FINITE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    FINITE [G]

General
    cluster: base.structures.storage
    description: "Structures with a finite item count"

Ancestors
    BOX [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    empty definition
    non negative count

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FINITE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures with a finite item count"
    status: "See notice at end of class"
    names: finite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    FINITE [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
        deferred
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
        do
            Result := (count = 0)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FINITE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures with a finite item count"
    status: "See notice at end of class"
    names: finite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    FINITE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FINITE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    FINITE [G]

Ancestors
    BOX [G]

Descendants
    BOUNDED [G]
    DISPENSER [G]
    SEQUENCE [G]
    UNBOUNDED [G]

Clients
    FINITE [G]

Suppliers
    FINITE [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FINITE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures with a finite item count"
    status: "See notice at end of class"
    names: finite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    FINITE [G]

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    is_empty: BOOLEAN
            -- Is structure empty?

invariant

    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count cannot be changed"
    status: "See notice at end of class"
    names: fixed, storage
    size: fixed
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    FIXED [G]

inherit
    BOUNDED [G]

feature -- Status report

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)

invariant

    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    FIXED [G]

General
    cluster: base.structures.storage
    description: "Finite structures whose item count cannot be changed"

Ancestors
    BOUNDED [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    Resizable: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    not resizable

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count cannot be changed"
    status: "See notice at end of class"
    names: fixed, storage
    size: fixed
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    FIXED [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    capacity: INTEGER is
            -- Number of items that may be stored
            -- (from BOUNDED)
        deferred
        end

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

    not_resizable: not resizable
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count cannot be changed"
    status: "See notice at end of class"
    names: fixed, storage
    size: fixed
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    FIXED [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored
            -- (from BOUNDED)

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    not_resizable: not resizable
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    FIXED [G]

Ancestors
    BOUNDED [G]

Descendants
    FIXED_LIST [G]

Clients
    FIXED [G]

Suppliers
    BOOLEAN
    FIXED [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count cannot be changed"
    status: "See notice at end of class"
    names: fixed, storage
    size: fixed
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    FIXED [G]

feature -- Status report

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)

invariant

    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INFINITE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite containers."
    status: "See notice at end of class"
    names: infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    INFINITE [G]

inherit
    BOX [G]
        redefine
            is_empty
        end

feature -- Status report

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)

    Full: BOOLEAN is True
            -- The structure is complete

invariant

    never_empty: not is_empty
    always_full: full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INFINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INFINITE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    INFINITE [G]

General
    cluster: base.structures.storage
    description: "Infinite containers."

Ancestors
    BOX [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    Is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    never empty
    always full

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INFINITE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite containers."
    status: "See notice at end of class"
    names: infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    INFINITE [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Full: BOOLEAN is True
            -- The structure is complete

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

    never_empty: not is_empty
    always_full: full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INFINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INFINITE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite containers."
    status: "See notice at end of class"
    names: infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    INFINITE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Full: BOOLEAN is True
            -- The structure is complete

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    never_empty: not is_empty
    always_full: full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INFINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INFINITE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    INFINITE [G]

Ancestors
    BOX [G]

Descendants
    COUNTABLE [G]

Clients
    INFINITE [G]

Suppliers
    BOOLEAN
    INFINITE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INFINITE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite containers."
    status: "See notice at end of class"
    names: infinite, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    INFINITE [G]

feature -- Status report

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)

    Full: BOOLEAN is True
            -- The structure is complete

invariant

    never_empty: not is_empty
    always_full: full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INFINITE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RESIZABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is subject to change"
    status: "See notice at end of class"
    names: storage
    size: resizable
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    RESIZABLE [G]

inherit
    BOUNDED [G]

feature -- Measurement

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items

    additional_space: INTEGER is
            -- Proposed number of additional items
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure
            at_least_one: Result >= 1
        end

feature -- Status report

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
        do
            Result := True
        end

feature -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
        do
            grow (capacity + additional_space)
        ensure
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Ensure that capacity is at least i.
        deferred
        ensure
            new_capacity: capacity >= i
        end

invariant

    increase_by_at_least_one: minimal_increase >= 1

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RESIZABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RESIZABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    RESIZABLE [G]

General
    cluster: base.structures.storage
    description: "Finite structures whose item count is subject to change"

Ancestors
    BOUNDED [G]

Queries
    additional_space: INTEGER
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    resizable: BOOLEAN

Commands
    automatic_grow
    compare_objects
    compare_references
    grow (i: INTEGER)

Constraints
    increase by at least one

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RESIZABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is subject to change"
    status: "See notice at end of class"
    names: storage
    size: resizable
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    RESIZABLE [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of items that may be stored
            -- (from BOUNDED)
        deferred
        end

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    full: BOOLEAN is
            -- Is structure full?
            -- (from BOUNDED)
        do
            Result := (count = capacity)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
        do
            Result := True
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
        do
            grow (capacity + additional_space)
        ensure
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Ensure that capacity is at least i.
        deferred
        ensure
            new_capacity: capacity >= i
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

    increase_by_at_least_one: minimal_increase >= 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RESIZABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RESIZABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is subject to change"
    status: "See notice at end of class"
    names: storage
    size: resizable
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    RESIZABLE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
        ensure
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of items that may be stored
            -- (from BOUNDED)

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
        ensure
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
        ensure
            new_capacity: capacity >= i

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    increase_by_at_least_one: minimal_increase >= 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RESIZABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RESIZABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    RESIZABLE [G]

Ancestors
    BOUNDED [G]

Descendants
    ARRAY [G]
    INTEGER_INTERVAL
    STRING

Clients
    RESIZABLE [G]

Suppliers
    INTEGER
    RESIZABLE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RESIZABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is subject to change"
    status: "See notice at end of class"
    names: storage
    size: resizable
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    RESIZABLE [G]

feature -- Measurement

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items

    additional_space: INTEGER
            -- Proposed number of additional items
        ensure
            at_least_one: Result >= 1

feature -- Status report

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
        ensure
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
        ensure
            new_capacity: capacity >= i

invariant

    increase_by_at_least_one: minimal_increase >= 1

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RESIZABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNBOUNDED Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is not bounded"
    status: "See notice at end of class"
    names: unbounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    UNBOUNDED [G]

inherit
    FINITE [G]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNBOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNBOUNDED Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    UNBOUNDED [G]

General
    cluster: base.structures.storage
    description: "Finite structures whose item count is not bounded"

Ancestors
    FINITE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNBOUNDED Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is not bounded"
    status: "See notice at end of class"
    names: unbounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class
    UNBOUNDED [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

feature -- Measurement

    count: INTEGER is
            -- Number of items
            -- (from FINITE)
        deferred
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from BOX)
        deferred
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNBOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNBOUNDED Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is not bounded"
    status: "See notice at end of class"
    names: unbounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    UNBOUNDED [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNBOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNBOUNDED Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    UNBOUNDED [G]

Ancestors
    FINITE [G]

Descendants
    DYNAMIC_CHAIN [G]
    FILE
    HASH_TABLE [G, H -> HASHABLE]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


UNBOUNDED Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Finite structures whose item count is not bounded"
    status: "See notice at end of class"
    names: unbounded, storage
    date: "$Date: 2001/07/15 05:36:36 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    UNBOUNDED [G]

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNBOUNDED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.table

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.table	(diagram)

Supercluster
    base.structures

Classes
    ARRAY2 [G]
    HASH_TABLE [G, H -> HASHABLE]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY2 Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-dimensional arrays"
    status: "See notice at end of class"
    names: array2, matrix, table
    representation: array
    access: index, row_and_column, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    ARRAY2 [G]

inherit
    ARRAY [G]
        rename
            make as array_make,
            item as array_item,
            put as array_put,
            force as array_force,
            resize as array_resize,
            wipe_out as array_wipe_out
        export
            {NONE} array_make, array_item, array_force, array_resize, array_wipe_out,
            {ARRAY2} array_put,
            {ANY} copy, is_equal, area, to_c
        end

create
    make

feature -- Initialization

    make (nb_rows, nb_columns: INTEGER) is
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
        require
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        do
            height := nb_rows
            width := nb_columns
            array_make (1, height * width)
        ensure
            new_count: count = height * width
        end

    initialize (v: G) is
            -- Make each entry have value v.
        local
            row, column: INTEGER
        do
            from
                row := 1
            until
                row > height
            loop
                from
                    column := 1
                until
                    column > width
                loop
                    put (v, row, column)
                    column := column + 1
                end
                row := row + 1
            end
        end

feature -- Access

    item (row, column: INTEGER): G is
            -- Entry at coordinates (row, column)
        require
            valid_row: (1 <= row) and (row <= height)
            valid_column: (1 <= column) and (column <= width)
        do
            Result := array_item ((row - 1) * width + column)
        end

feature -- Measurement

    height: INTEGER
            -- Number of rows

    width: INTEGER
            -- Number of columns

feature -- Element change

    put (v: like item; row, column: INTEGER) is
            -- Assign item v at coordinates (row, column).
        require
            valid_row: 1 <= row and row <= height
            valid_column: 1 <= column and column <= width
        do
            array_put (v, (row - 1) * width + column)
        end

    force (v: like item; row, column: INTEGER) is
            -- Assign item v at coordinates (row, column).
            -- Resize if necessary.
        require
            row_large_enough: 1 <= row
            column_large_enough: 1 <= column
        do
            resize (row, column)
            put (v, row, column)
        end

feature -- Removal

    wipe_out is
            -- Remove all items.
        do
            height := 0
            width := 0
            discard_items
        end

feature -- Resizing

    resize (nb_rows, nb_columns: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- nb_rows rows and nb_columns columns,
            -- without losing any previously
            -- entered items, nor changing their coordinates;
            -- do nothing if not possible.
        require
            valid_row: nb_rows >= 1
            valid_column: nb_columns >= 1
        local
            i, new_height: INTEGER
            in_new, in_old: INTEGER
            new: like Current
        do
            if nb_rows > height then
                new_height := nb_rows
            else
                new_height := height
            end
            if nb_columns > width then
                create new.make (new_height, nb_columns)
                from
                    in_old := 1
                    in_new := 1
                until
                    i = height
                loop
                    i := i + 1
                    transfer (new, in_old, in_new, width)
                    in_new := in_new + nb_columns
                    in_old := in_old + width
                end
                width := nb_columns
                height := new_height
                upper := width * height
                area := new.area
            elseif new_height > height then
                create new.make (new_height, width);
                transfer (new, 1, 1, width * height);
                height := new_height;
                upper := width * height;
                area := new.area
            end
        end

feature {NONE} -- Implementation

    transfer (new: like Current; in_old, in_new, nb: INTEGER) is
            -- Copy nb items, starting from in_old,
            -- to new, starting from in_new.
            -- Do not copy out_of_bounds items.
        local
            i, j: INTEGER
        do
            from
                i := in_old
                j := in_new
            until
                i = in_old + nb
            loop
                new.array_put (array_item (i), j)
                i := i + 1
                j := j + 1
            end
        end

invariant

    items_number: count = width * height

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY2

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY2 Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAY2 [G]

General
    cluster: base.structures.table
    description: "Two-dimensional arrays"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): G
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): G
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: G): BOOLEAN
    height: INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAY2 [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (row, column: INTEGER): G
    linear_representation: LINEAR [G]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] ARRAY2 [G]): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] ARRAY2 [G]
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    width: INTEGER

Commands
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] ARRAY2 [G])
    discard_items
    enter (v: [like item] G; i: INTEGER)
    fill (other: CONTAINER [G])
    force (v: [like item] G; row, column: INTEGER)
    grow (i: INTEGER)
    initialize (v: G)
    make (nb_rows, nb_columns: INTEGER)
    make_from_array (a: ARRAY [G])
    prune_all (v: G)
    put (v: [like item] G; row, column: INTEGER)
    resize (nb_rows, nb_columns: INTEGER)
    subcopy (other: [like Current] ARRAY2 [G]; start_pos, end_pos, index_pos: INTEGER)
    wipe_out

Constraints
    items number

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY2 Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-dimensional arrays"
    status: "See notice at end of class"
    names: array2, matrix, table
    representation: array
    access: index, row_and_column, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    ARRAY2 [G]

create
    make

feature -- Initialization

    initialize (v: G) is
            -- Make each entry have value v.
        local
            row, column: INTEGER
        do
            from
                row := 1
            until
                row > height
            loop
                from
                    column := 1
                until
                    column > width
                loop
                    put (v, row, column)
                    column := column + 1
                end
                row := row + 1
            end
        end

    make (nb_rows, nb_columns: INTEGER) is
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
        require
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        do
            height := nb_rows
            width := nb_columns
            array_make (1, height * width)
        ensure
            new_count: count = height * width
        end

    make_from_array (a: ARRAY [G]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature {NONE} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature -- Access

    entry (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            Result := array_item (i)
        end

    has (v: G): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (array_item (i) /= void and then array_item (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (array_item (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item (row, column: INTEGER): G is
            -- Entry at coordinates (row, column)
        require
            valid_row: (1 <= row) and (row <= height)
            valid_column: (1 <= column) and (column <= width)
        do
            Result := array_item ((row - 1) * width + column)
        end

    infix "@" (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature {NONE} -- Access

    array_item (i: INTEGER): G is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature  -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    count: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    height: INTEGER
            -- Number of rows

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: G): INTEGER is
            -- Number of times v appears in structure
            -- (from ARRAY)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if array_item (i) /= void and then v.is_equal (array_item (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if array_item (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

    width: INTEGER
            -- Number of columns

feature  -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        local
            i: INTEGER
        do
            if lower = other.lower and then upper = other.upper and then object_comparison = other.object_comparison then
                if object_comparison then
                    from
                        Result := True
                        i := lower
                    until
                        not Result or i > upper
                    loop
                        Result := equal (array_item (i), other.array_item (i))
                        i := i + 1
                    end
                else
                    Result := area.same_items (other.area, upper - lower)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((array_item (upper) = void or else array_item (upper) = array_item (upper).default) and subarray (lower, upper - 1).all_default))
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    extendible: BOOLEAN is
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)
        do
            Result := False
        end

    full: BOOLEAN is
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)
        do
            Result := True
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)
        do
            Result := False
        end

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if count = other.count then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (array_item (upper) = other.array_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = count
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Element change

    enter (v: like array_item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (v: like item; row, column: INTEGER) is
            -- Assign item v at coordinates (row, column).
            -- Resize if necessary.
        require
            row_large_enough: 1 <= row
            column_large_enough: 1 <= column
        do
            resize (row, column)
            put (v, row, column)
        end

    put (v: like item; row, column: INTEGER) is
            -- Assign item v at coordinates (row, column).
        require
            valid_row: 1 <= row and row <= height
            valid_column: 1 <= column and column <= width
        do
            array_put (v, (row - 1) * width + column)
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature {ARRAY2} -- Element change

    array_put (v: like array_item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: array_item (k) = v
        end

feature {NONE} -- Element change

    array_force (v: like array_item; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            array_put (v, i)
        ensure -- from ARRAY
            inserted: array_item (i) = v
            higher_count: count >= old count
        end

feature {ARRAY} -- Element change

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

    wipe_out is
            -- Remove all items.
        do
            height := 0
            width := 0
            discard_items
        end

feature {NONE} -- Removal

    array_wipe_out is
        obsolete "Not applicable since not `prunable'. Use `discard_items' instead."
            -- Make array empty.
            -- (from ARRAY)
        require -- from COLLECTION
            prunable
        do
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                array_resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (nb_rows, nb_columns: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- nb_rows rows and nb_columns columns,
            -- without losing any previously
            -- entered items, nor changing their coordinates;
            -- do nothing if not possible.
        require
            valid_row: nb_rows >= 1
            valid_column: nb_columns >= 1
        local
            i, new_height: INTEGER
            in_new, in_old: INTEGER
            new: like Current
        do
            if nb_rows > height then
                new_height := nb_rows
            else
                new_height := height
            end
            if nb_columns > width then
                create new.make (new_height, nb_columns)
                from
                    in_old := 1
                    in_new := 1
                until
                    i = height
                loop
                    i := i + 1
                    transfer (new, in_old, in_new, width)
                    in_new := in_new + nb_columns
                    in_old := in_old + width
                end
                width := nb_columns
                height := new_height
                upper := width * height
                area := new.area
            elseif new_height > height then
                create new.make (new_height, width);
                transfer (new, 1, 1, width * height);
                height := new_height;
                upper := width * height;
                area := new.area
            end
        end

feature {NONE} -- Resizing

    array_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature  -- Conversion

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from ARRAY)
        local
            temp: ARRAYED_LIST [G]
            i: INTEGER
        do
            create temp.make (capacity)
            from
                i := lower
            until
                i > upper
            loop
                temp.extend (array_item (i))
                i := i + 1
            end
            Result := temp
        end

feature  -- Duplication

    copy (other: like Current) is
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            if other /= Current then
                standard_copy (other)
                set_area (standard_clone (other.area))
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

feature -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    extend (v: G) is
            -- Add v to structure.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    prune (v: G) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {NONE} -- Implementation

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

    transfer (new: like Current; in_old, in_new, nb: INTEGER) is
            -- Copy nb items, starting from in_old,
            -- to new, starting from in_new.
            -- Do not copy out_of_bounds items.
        local
            i, j: INTEGER
        do
            from
                i := in_old
                j := in_new
            until
                i = in_old + nb
            loop
                new.array_put (array_item (i), j)
                i := i + 1
                j := j + 1
            end
        end

feature {ARRAY} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

invariant

    items_number: count = width * height
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY2

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY2 Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-dimensional arrays"
    status: "See notice at end of class"
    names: array2, matrix, table
    representation: array
    access: index, row_and_column, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAY2 [G]

create

    make (nb_rows, nb_columns: INTEGER)
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
        require
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        ensure
            new_count: count = height * width

feature -- Initialization

    initialize (v: G)
            -- Make each entry have value v.

    make (nb_rows, nb_columns: INTEGER)
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
        require
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        ensure
            new_count: count = height * width

    make_from_array (a: ARRAY [G])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    entry (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (row, column: INTEGER): G
            -- Entry at coordinates (row, column)
        require
            valid_row: (1 <= row) and (row <= height)
            valid_column: (1 <= column) and (column <= width)

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    height: INTEGER
            -- Number of rows

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

    width: INTEGER
            -- Number of columns

feature  -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((array_item (upper) = void or else array_item (upper) = array_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (array_item (upper) = other.array_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
            -- Resize if necessary.
        require
            row_large_enough: 1 <= row
            column_large_enough: 1 <= column

    put (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
        require
            valid_row: 1 <= row and row <= height
            valid_column: 1 <= column and column <= width

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (nb_rows, nb_columns: INTEGER)
            -- Rearrange array so that it can accommodate
            -- nb_rows rows and nb_columns columns,
            -- without losing any previously
            -- entered items, nor changing their coordinates;
            -- do nothing if not possible.
        require
            valid_row: nb_rows >= 1
            valid_column: nb_columns >= 1

feature  -- Conversion

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from ARRAY)

feature  -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

feature -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

    items_number: count = width * height
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY2

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY2 Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAY2 [G]

Ancestors
    ARRAY [G]

Clients
    ARRAY2 [G]

Suppliers
    ARRAY2 [G]
    BOOLEAN
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAY2 Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Two-dimensional arrays"
    status: "See notice at end of class"
    names: array2, matrix, table
    representation: array
    access: index, row_and_column, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAY2 [G]

create
    make

feature -- Initialization

    make (nb_rows, nb_columns: INTEGER)
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
        require
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        ensure
            new_count: count = height * width

    initialize (v: G)
            -- Make each entry have value v.

feature -- Access

    item (row, column: INTEGER): G
            -- Entry at coordinates (row, column)
        require
            valid_row: (1 <= row) and (row <= height)
            valid_column: (1 <= column) and (column <= width)

feature -- Measurement

    height: INTEGER
            -- Number of rows

    width: INTEGER
            -- Number of columns

feature -- Element change

    put (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
        require
            valid_row: 1 <= row and row <= height
            valid_column: 1 <= column and column <= width

    force (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
            -- Resize if necessary.
        require
            row_large_enough: 1 <= row
            column_large_enough: 1 <= column

feature -- Removal

    wipe_out
            -- Remove all items.

feature -- Resizing

    resize (nb_rows, nb_columns: INTEGER)
            -- Rearrange array so that it can accommodate
            -- nb_rows rows and nb_columns columns,
            -- without losing any previously
            -- entered items, nor changing their coordinates;
            -- do nothing if not possible.
        require
            valid_row: nb_rows >= 1
            valid_column: nb_columns >= 1

invariant

    items_number: count = width * height

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY2

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.table

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


HASH_TABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Hash tables, used to store items identified by hashable keys"
    instructions: "[
        Several procedures are provided for inserting an item
        with a given key.

        Here is how to choose between them:

            - Use `put' if you want to do an insertion only if
              there was no item with the given key, doing nothing
              otherwise. (You can find out on return if there was one,
              and what it was.)

            - Use `force' if you always want to insert the item;
              if there was one for the given key it will be removed,
              (and you can find out on return what it was).

            - Use `extend' if you are sure there is no item with
              the given key, enabling faster insertion (but
              unpredictable behavior if this assumption is not true).

            - Use `replace' if you want to replace an already present
              item with the given key, and do nothing if there is none.

        In addition you can use `replace_key' to change the key of an
        already present item, identified by its previous key, or
        do nothing if there is nothing for that previous key.
        You can find out on return.
    ]"
    instructions: "[
        To find out whether a key appears in the table, use `has'.
        To find out the item, if any, associated with a certain key,
        use `item'.

        Both of these routines perform a search. If you need
        both pieces of information (does a key appear? And, if so,
        what is the associated item?), you can avoid performing
        two redundant traversals by using instead the combination
        of `search', `found' and `found_item' as follows:

            your_table.search (your_key)
            if your_table.found then
                what_you_where_looking_for := your_table.found_item
                ... Do whatever is needed to `what_you_were_looking_for' ...
            else
                ... No item was present for `your_key' ...
            end
    ]"
    compatibility: "[
        This version of the class accepts any value of type H as key.
        Previous versions did not accept the default value as a key;
        this restriction no longer applies. Most clients of the old version
        should work correctly with this one; a client that explicitly relied
        on the default value not being hashable should use the old version
        available in the EiffelBase 3.3 compatibility cluster.

        Also, `force' now sets either `found' or `not_found'.
        (Previously it would always set `inserted'.)
    ]"
    storable_compatibility: "[
        Persistent instances of the old version of this class will not be
         retrievable with the present version.
    ]"
    warning: "[
        Modifying an object used as a key by an item present in a table will
        cause incorrect behavior. If you will be modifying key objects,
        pass a clone, not the object itself, as key argument to
        `put' and `replace_key'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    HASH_TABLE [G, H -> HASHABLE]

inherit
    UNBOUNDED [G]
        rename
            has as has_item
        redefine
            has_item,
            copy,
            is_equal
        end

    TABLE [G, H]
        rename
            has as has_item,
            wipe_out as clear_all,
            extend as collection_extend
        export
            {NONE} prune_all
        redefine
            copy,
            is_equal,
            clear_all,
            has_item
        end

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
        local
            clever: PRIMES
        do
            create clever
            capacity := n.max (minimum_capacity)
            capacity := (capacity * 100) // initial_occupation + 1
            capacity := clever.higher_prime (capacity)
            create content.make (0, capacity)
            create keys.make (0, capacity)
            create deleted_marks.make (0, capacity - 1)
            iteration_position := capacity + 1
        ensure
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status
        end

    accommodate (n: INTEGER) is
            -- Reallocate table with enough space for n items;
            -- keep all current items.
        require
            n >= 0
        local
            i: INTEGER
            new_table: HASH_TABLE [G, H]
            default_key: H
        do
            from
                create new_table.make (count.max (n))
            until
                i = capacity
            loop
                if occupied (i) then
                    check
                        not new_table.soon_full
                    end
                    new_table.put (content.item (i), keys.item (i))
                end
                i := i + 1
            end
            if has_default then
                new_table.put (content.item (capacity), default_key)
            end
            set_content (new_table.content)
            set_keys (new_table.keys)
            set_deleted_marks (new_table.deleted_marks)
            capacity := new_table.capacity
            used_slot_count := count
            iteration_position := new_table.iteration_position
        ensure
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation
        end

feature -- Access

    found_item: G
            -- Item, if any, yielded by last search operation

    item (key: H): G is
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of @.
        local
            old_control, old_position: INTEGER
        do
            old_control := control
            old_position := position
            internal_search (key)
            if found then
                Result := content.item (position)
            end
            control := old_control
            position := old_position
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)
        end

    infix "@" (key: H): G is
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of item.
        local
            old_control, old_position: INTEGER
        do
            old_control := control
            old_position := position
            internal_search (key)
            if found then
                Result := content.item (position)
            end
            control := old_control
            position := old_position
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)
        end

    has (key: H): BOOLEAN is
            -- Is there an item in the table with key key?
        local
            old_control, old_position: INTEGER
        do
            old_control := control
            old_position := position
            internal_search (key)
            Result := found
            control := old_control
            position := old_position
        ensure then
            default_case: (key = computed_default_key) implies (Result = has_default)
        end

    has_item (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
        do
            if has_default then
                Result := (v = default_key_value)
            end
            if not Result then
                if object_comparison then
                    from
                    until
                        i = capacity or else Result
                    loop
                        Result := occupied (i) and then equal (v, content.item (i))
                        i := i + 1
                    end
                else
                    from
                    until
                        i = capacity or else Result
                    loop
                        Result := occupied (i) and then (v = content.item (i))
                        i := i + 1
                    end
                end
            end
        end

    current_keys: ARRAY [H] is
            -- New array containing actually used keys, from 1 to count
        local
            j: INTEGER
            old_iteration_position: INTEGER
        do
            old_iteration_position := iteration_position
            from
                create Result.make (1, count)
                start
            until
                off
            loop
                j := j + 1
                Result.put (key_for_iteration, j)
                forth
            end
            iteration_position := old_iteration_position
        ensure
            good_count: Result.count = count
        end

    item_for_iteration: G is
            -- Element at current iteration position
        require
            not_off: not off
        do
            Result := content.item (iteration_position)
        end

    key_for_iteration: H is
            -- Key at current iteration position
        require
            not_off: not off
        do
            Result := keys.item (iteration_position)
        ensure
            at_iteration_position: Result = key_at (iteration_position)
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {HASH_TABLE_CURSOR} Result.make (iteration_position)
        ensure
            cursor_not_void: Result /= void
        end

feature -- Measurement

    count: INTEGER
            -- Number of items in table

    capacity: INTEGER
            -- Number of items that may be stored.

    occurrences (v: G): INTEGER is
            -- Number of table items equal to v.
        local
            old_iteration_position: INTEGER
        do
            old_iteration_position := iteration_position
            if object_comparison then
                from
                    start
                until
                    off
                loop
                    if equal (item_for_iteration, v) then
                        Result := Result + 1
                    end
                    forth
                end
            else
                from
                    start
                until
                    off
                loop
                    if item_for_iteration = v then
                        Result := Result + 1
                    end
                    forth
                end
            end
            iteration_position := old_iteration_position
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does table contain the same information as other?
        do
            Result := equal (keys, other.keys) and equal (content, other.content) and equal (deleted_marks, other.deleted_marks) and (has_default = other.has_default)
        end

feature -- Status report

    Full: BOOLEAN is False
            -- Is structure filled to capacity? (Answer: no.)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    conflict: BOOLEAN is
            -- Did last operation cause a conflict?
        do
            Result := (control = conflict_constant)
        end

    inserted: BOOLEAN is
            -- Did last operation insert an item?
        do
            Result := (control = inserted_constant)
        end

    replaced: BOOLEAN is
            -- Did last operation replace an item?
        do
            Result := (control = replaced_constant)
        end

    removed: BOOLEAN is
            -- Did last operation remove an item?
        do
            Result := (control = removed_constant)
        end

    found: BOOLEAN is
            -- Did last operation find the item sought?
        do
            Result := (control = found_constant)
        end

    not_found: BOOLEAN is
            -- Did last operation fail to find the item sought?
        do
            Result := (control = not_found_constant)
        end

    after: BOOLEAN is
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of off.
        do
            Result := is_off_position (iteration_position)
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))
        end

    off: BOOLEAN is
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of after.
        do
            Result := is_off_position (iteration_position)
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))
        end

    valid_cursor (c: CURSOR): BOOLEAN is
            -- Can cursor be moved to position c?
        require
            c_not_void: c /= void
        local
            ht_cursor: HASH_TABLE_CURSOR
            cursor_position: INTEGER
        do
            ht_cursor ?= c
            if ht_cursor /= void then
                cursor_position := ht_cursor.position
                Result := (is_off_position (cursor_position)) or else ((cursor_position >= 0) and (cursor_position <= capacity) and then truly_occupied (cursor_position))
            end
        end

    valid_key (k: H): BOOLEAN is
            -- Is k a valid key?
            -- (Answer: always yes for hash tables in this version)
        do
            Result := True
        ensure then
            Result
        end

feature -- Cursor movement

    start is
            -- Bring cursor to first position.
        do
            iteration_position := - 1
            forth
        end

    forth is
            -- Advance cursor to next occupied position,
            -- or off if no such position remains.
        require
            not_off: not off
        do
            from
                iteration_position := iteration_position + 1
            until
                off or else truly_occupied (iteration_position)
            loop
                iteration_position := iteration_position + 1
            end
        end

    go_to (c: CURSOR) is
            -- Move to position c.
        require
            c_not_void: c /= void
            valid_cursor: valid_cursor (c)
        local
            ht_cursor: HASH_TABLE_CURSOR
        do
            ht_cursor ?= c
            if ht_cursor /= void then
                iteration_position := ht_cursor.position
            end
        end

    search (key: H) is
            -- Search for item of key key.
            -- If found, set found to true, and set
            -- found_item to item associated with key.
        local
            default_value: G
        do
            internal_search (key)
            if found then
                found_item := content.item (position)
            else
                found_item := default_value
            end
        ensure
            found_or_not_found: found or not_found
            item_if_found: found implies (found_item = content.item (position))
        end

    search_item: G is
        obsolete "Use found_item instead."
        do
            Result := found_item
        end

feature -- Element change

    put (new: G; key: H) is
            -- Insert new with key if there is no other item
            -- associated with the same key.
            -- Set inserted if and only if an insertion has
            -- been made (i.e. key was not present).
            -- If so, set position to the insertion position.
            -- If not, set conflict.
            -- In either case, set found_item to the item
            -- now associated with key (previous item if
            -- there was one, new otherwise).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        do
            internal_search (key)
            if found then
                set_conflict
                found_item := content.item (position)
            else
                if soon_full then
                    add_space
                    internal_search (key)
                    check
                        not found
                    end
                end
                if deleted_position /= impossible_position then
                    position := deleted_position
                    set_not_deleted (position)
                end
                count := count + 1
                used_slot_count := used_slot_count + 1
                put_at_position (new, key)
                found_item := new
                set_inserted
            end
        ensure then
            conflict_or_inserted: conflict or inserted
            insertion_done: inserted implies item (key) = new
            now_present: inserted implies has (key)
            one_more_if_inserted: inserted implies (count = old count + 1)
            one_more_slot_if_inserted_unless_reallocated: inserted implies ((used_slot_count = old used_slot_count + 1) or (used_slot_count = count))
            unchanged_if_conflict: conflict implies (count = old count)
            same_item_if_conflict: conflict implies (item (key) = old (item (key)))
            slot_count_unchanged_if_conflict: conflict implies (used_slot_count = old used_slot_count)
            found_item_associated_with_key: found_item = item (key)
            new_item_if_inserted: inserted implies (found_item = new)
            old_item_if_conflict: conflict implies (found_item = old (item (key)))
            default_property: has_default = ((inserted and (key = computed_default_key)) or ((conflict or (key /= computed_default_key)) and (old has_default)))
        end

    force (new: G; key: H) is
            -- Update table so that new will be the item associated
            -- with key.
            -- If there was an item for that key, set found
            -- and set found_item to that item.
            -- If there was none, set not_found and set
            -- found_item to the default value.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require else
            True
        local
            default_key: H
        do
            search (key)
            if not_found then
                if soon_full then
                    add_space
                    internal_search (key)
                end
                if deleted_position /= impossible_position then
                    position := deleted_position
                    set_not_deleted (position)
                end
                keys.put (key, position)
                if key = default_key then
                    set_default
                end
                count := count + 1
                used_slot_count := used_slot_count + 1
            end
            content.put (new, position)
        ensure then
            insertion_done: item (key) = new
            now_present: has (key)
            found_or_not_found: found or not_found
            not_found_if_was_not_present: not_found = not (old has (key))
            same_count_or_one_more: (count = old count) or (count = old count + 1)
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            found_item_is_old_item: found implies (found_item = old (item (key)))
            default_value_if_not_found: not_found implies (found_item = computed_default_value)
            default_property: has_default = ((key = computed_default_key) or ((key /= computed_default_key) and (old has_default)))
        end

    extend (new: G; key: H) is
            -- Assuming there is no item of key key,
            -- insert new with key.
            -- Set inserted.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require
            not_present: not has (key)
        do
            search_for_insertion (key)
            if soon_full then
                add_space
                search_for_insertion (key)
            end
            if position < capacity and then deleted (position) then
                set_not_deleted (position)
            else
                used_slot_count := used_slot_count + 1
            end
            count := count + 1
            put_at_position (new, key)
            set_inserted
        ensure
            inserted: inserted
            insertion_done: item (key) = new
            one_more: count = old count + 1
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            default_property: has_default = ((key = computed_default_key) or (old has_default))
        end

    replace (new: G; key: H) is
            -- Replace item at key, if present,
            -- with new; do not change associated key.
            -- Set replaced if and only if a replacement has been made
            -- (i.e. key was present); otherwise set not_found.
            -- Set found_item to the item previously associated
            -- with key (default value if there was none).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        do
            search (key)
            if found then
                content.put (new, position)
                set_replaced
            end
        ensure
            replaced_or_not_found: replaced or not_found
            insertion_done: replaced implies item (key) = new
            no_change_if_not_found: not_found implies item (key) = old (item (key))
            found_item_is_old_item: found_item = old (item (key))
        end

    replace_key (new_key: H; old_key: H) is
            -- If there is an item of key old_key and no item of key
            -- new_key, replace the former's key by new_key,
            -- set replaced, and set found_item to the item
            -- previously associated with old_key.
            -- Otherwise set not_found or conflict respectively.
            -- If conflict, set found_item to the item previously
            -- associated with new_key.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        local
            insert_position: INTEGER
            default_value: G
            default_key: H
        do
            put (default_value, new_key)
            if inserted then
                count := count - 1
                used_slot_count := used_slot_count - 1
                insert_position := position
                search (old_key)
                if found then
                    content.put (found_item, insert_position)
                    if old_key = default_key then
                        set_no_default
                    else
                        remove_at_position
                    end
                    if new_key = default_key then
                        set_default
                    end
                    set_replaced
                else
                    position := insert_position
                    remove_at_position
                    check
                        not_found: not_found
                    end
                end
            end
        ensure
            same_count: count = old count
            same_slot_count: used_slot_count = old used_slot_count
            replaced_or_conflict_or_not_found: replaced or conflict or not_found
            old_absent: (replaced and not equal (new_key, old_key)) implies (not has (old_key))
            new_present: (replaced or conflict) = has (new_key)
            new_item: replaced implies (item (new_key) = old (item (old_key)))
            not_found_iff_no_old_key: not_found = old (not has (old_key))
            conflict_iff_already_present: conflict = old (has (new_key))
            not_inserted_if_conflict: conflict implies (item (new_key) = old (item (new_key)))
            default_property: has_default = ((new_key = computed_default_key) or ((new_key /= computed_default_key) and (old has_default)))
        end

feature -- Removal

    remove (key: H) is
            -- Remove item associated with key, if present.
            -- Set removed if and only if an item has been
            -- removed (i.e. key was present);
            -- if so, set position to index of removed element.
            -- If not, set not_found.
        local
            default_key: H
        do
            internal_search (key)
            if found then
                if key = default_key then
                    set_no_default
                else
                    remove_at_position
                end
                count := count - 1
                set_removed
            end
        ensure
            removed_or_not_found: removed or not_found
            not_present: not has (key)
            one_less: found implies (count = old count - 1)
            same_slot_count: used_slot_count = old used_slot_count
            default_case: (key = computed_default_key) implies (not has_default)
            non_default_case: (key /= computed_default_key) implies (has_default = old has_default)
        end

    clear_all is
            -- Reset all items to default values; reset status.
        do
            content.clear_all
            keys.clear_all
            deleted_marks.clear_all
            count := 0
            used_slot_count := 0
            position := 0
            iteration_position := capacity + 1
            set_no_status
            set_no_default
        ensure then
            position_equal_to_zero: position = 0
            count_equal_to_zero: count = 0
            used_slot_count_equal_to_zero: used_slot_count = 0
            has_default_set: not has_default
            no_status: not special_status
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
        local
            old_iteration_position: INTEGER
        do
            old_iteration_position := iteration_position
            from
                create Result.make (count)
                start
            until
                off
            loop
                Result.extend (item_for_iteration)
                forth
            end
            iteration_position := old_iteration_position
        ensure then
            result_exists: Result /= void
            good_count: Result.count = count
        end

feature -- Duplication

    copy (other: like Current) is
            -- Re-initialize from other.
        do
            standard_copy (other)
            set_keys (clone (other.keys))
            set_content (clone (other.content))
            set_deleted_marks (clone (other.deleted_marks))
        end

feature {HASH_TABLE} -- Implementation: content attributes and preservation

    content: ARRAY [G]
            -- Array of contents

    keys: ARRAY [H]
            -- Array of keys

    deleted_marks: ARRAY [BOOLEAN]
            -- Is position that of a deleted element?

    has_default: BOOLEAN
            -- Is the default key present?

    set_default is
            -- Record information that there is a value for default key.
        do
            has_default := True
        end

    set_no_default is
            -- Record information that there is no value for default key.
        local
            default_value: G
        do
            has_default := False
            content.put (default_value, capacity)
        end

feature {HASH_TABLE} -- Implementation: search attributes

    iteration_position: INTEGER
            -- Cursor for iteration primitives

    position: INTEGER
            -- Hash table cursor, updated after each operation:
            -- put, remove, has, replace, force, change_key...

    soon_full: BOOLEAN is
            -- Is table close to being filled to current capacity?
            -- (If so, resizing is needed to avoid performance degradation.)
        do
            Result := ((used_slot_count + 1) * 100 >= capacity * max_occupation)
        ensure
            Result = ((used_slot_count + 1) * 100 >= capacity * max_occupation)
        end

    control: INTEGER
            -- Control code set by operations that may produce
            -- several possible conditions.

    deleted_position: INTEGER
            -- Place where a deleted element was found during a search

feature {NONE} -- Implementation

    Max_occupation: INTEGER is 80
            -- Filling percentage over which table will be resized

    Initial_occupation: INTEGER is 50
            -- Filling percentage for initial requested occupation

    Extra_space: INTEGER is 50
            -- Percentage of extra positions when resizing

    Impossible_position: INTEGER is -1
            -- Position outside the array indices

    used_slot_count: INTEGER
            -- Number of slots occuped by an element either present
            -- or marked as deleted

    occupied (i: INTEGER): BOOLEAN is
            -- Is position i occupied by a non-default key and a value?
        require
            in_bounds: i >= 0 and i < capacity
        local
            default_key: H
        do
            Result := (keys.item (i) /= default_key)
        end

    truly_occupied (i: INTEGER): BOOLEAN is
            -- Is position i occupied by a key and a value?
        require
            in_bounds: i >= 0 and i <= capacity
        do
            Result := (has_default and i = capacity) or else (i < capacity and then occupied (i))
        ensure
            normal_key: (i < capacity) implies (occupied (i) implies Result)
            default_key: (i = capacity) implies (Result = has_default)
        end

    is_off_position (pos: INTEGER): BOOLEAN is
            -- Is pos a cursor position past last item?
        do
            Result := (not has_default and (pos >= capacity)) or (has_default and (pos = (capacity + 1)))
        ensure
            definition: Result = ((not has_default and (pos >= capacity)) or (has_default and (pos = (capacity + 1))))
        end

    set_content (c: like content) is
            -- Assign c to content.
        do
            content := c
        end

    deleted (i: INTEGER): BOOLEAN is
            -- Is position i that of a deleted item?
        require
            in_bounds: i >= 0 and i < capacity
        do
            Result := deleted_marks.item (i)
        end

    set_not_deleted (i: INTEGER) is
            -- Mark position i as not deleted.
        require
            in_bounds: i >= 0 and i < capacity
        do
            deleted_marks.put (False, i)
        end

    set_deleted (i: INTEGER) is
            -- Mark position i as deleted.
        require
            in_bounds: i >= 0 and i < capacity
        do
            deleted_marks.put (True, i)
        ensure
            deleted: deleted (i)
        end

    set_keys (c: like keys) is
            -- Assign c to keys.
        do
            keys := c
        end

    set_deleted_marks (d: like deleted_marks) is
            -- Assign d to deleted_marks.
        do
            deleted_marks := d
        end

    default_key_value: G is
            -- Value associated with the default key, if any
        require
            has_default: has_default
        do
            Result := content.item (capacity)
        end

    computed_default_key: H is
            -- Default key
            -- (For performance reasons, used only in assertions;
            -- elsewhere, see use of local entity default_key.)
        do
        end

    computed_default_value: G is
            -- Default value of type G
            -- (For performance reasons, used only in assertions;
            -- elsewhere, see use of local entity default_value.)
        do
        end

    internal_search (key: H) is
            -- Search for item of key key.
            -- If successful, set position to index
            -- of item with this key (the same index as the key's index).
            -- If not, set position to possible position for insertion,
            -- and set status to found or not_found.
        local
            default_key: H
            hash_value, increment: INTEGER
            stop: BOOLEAN
        do
            deleted_position := impossible_position
            if key = default_key then
                position := capacity
                if has_default then
                    set_found
                else
                    set_not_found
                end
            else
                from
                    hash_value := key.hash_code
                    increment := position_increment (hash_value)
                    position := initial_position (hash_value)
                until
                    stop
                loop
                    if deleted (position) then
                        if deleted_position = impossible_position then
                            deleted_position := position
                        end
                        to_next_candidate (increment)
                    elseif keys.item (position) = default_key then
                        stop := True;
                        set_not_found
                    elseif keys.item (position).is_equal (key) then
                        stop := True;
                        set_found
                    else
                        to_next_candidate (increment)
                    end
                end
            end
        ensure
            found_or_not_found: found or not_found
            deleted_item_at_deleted_position: (deleted_position /= impossible_position) implies (deleted (deleted_position))
            default_value_if_not_found: not_found implies (content.item (position) = computed_default_value)
            default_iff_at_capacity: (position = capacity) = (key = computed_default_key)
        end

    search_for_insertion (key: H) is
            -- Assuming there is no item of key key, compute
            -- position at which to insert such an item.
        require
            not_present: not has (key)
        local
            default_key: H
            hash_value, increment: INTEGER
        do
            if key = default_key then
                check
                    not has_default
                end
                position := capacity
            else
                from
                    hash_value := key.hash_code
                    increment := position_increment (hash_value)
                    position := initial_position (hash_value)
                until
                    deleted (position) or keys.item (position) = default_key
                loop
                    to_next_candidate (increment)
                end
            end
        ensure
            deleted_or_default: deleted (position) or (key_at (position) = computed_default_key)
            default_iff_at_capacity: (position = capacity) = (key = computed_default_key)
        end

    put_at_position (new: G; key: H) is
            -- Put new with key at position.
        require
            in_bounds: position >= 0 and position <= capacity
            default_if_at_capacity: (position = capacity) implies (key = computed_default_key)
        local
            default_key: H
        do
            content.put (new, position)
            keys.put (key, position)
            if key = default_key then
                set_default
            end
        ensure
            item_at_position: content.item (position) = new
            key_at_position: key_at (position) = key
            default_if_at_capacity: (position = capacity) implies has_default
        end

    remove_at_position is
            -- Remove item at position
        require
            in_bounds: position >= 0 and position <= capacity
        local
            default_value: G
            default_key: H
        do
            content.put (default_value, position)
            keys.put (default_key, position)
            set_deleted (position)
            if iteration_position = position then
                forth
            end
        ensure
            deleted: deleted (position)
            status_not_changed: control = old control
            count_not_changed: count = old count
            slot_count_not_changed: used_slot_count = old used_slot_count
            key_at (position) = computed_default_key
        end

    key_at (n: INTEGER): H is
            -- Key at position n
        require
            in_bounds: n >= 0 and n < capacity
        do
            Result := keys.item (n)
        end

    initial_position (hash_value: INTEGER): INTEGER is
            -- Initial position for an item of hash code hash_value
        do
            Result := (hash_value \\ capacity)
        end

    position_increment (hash_value: INTEGER): INTEGER is
            -- Distance between successive positions for hash code
            -- hash_value (computed for no cycle: capacity is prime)
        do
            Result := 1 + hash_value \\ (capacity - 1)
        end

    to_next_candidate (increment: INTEGER) is
            -- Move from current position to next for same key
        do
            position := (position + increment) \\ capacity
        end

    Conflict_constant: INTEGER is unique
            -- Could not insert an already existing key

    set_conflict is
            -- Set status to conflict.
        do
            control := conflict_constant
        ensure
            conflict: conflict
        end

    Found_constant: INTEGER is unique
            -- Key found

    set_found is
            -- Set status to found.
        do
            control := found_constant
        ensure
            found: found
        end

    Inserted_constant: INTEGER is unique
            -- Insertion successful

    set_inserted is
            -- Set status to inserted.
        do
            control := inserted_constant
        ensure
            inserted: inserted
        end

    Not_found_constant: INTEGER is unique
            -- Key not found

    set_not_found is
            -- Set status to not found.
        do
            control := not_found_constant
        ensure
            not_found: not_found
        end

    set_no_status is
            -- Set status to normal.
        do
            control := 0
        ensure
            default_status: not special_status
        end

    Removed_constant: INTEGER is unique
            -- Remove successful

    set_removed is
            -- Set status to removed.
        do
            control := removed_constant
        ensure
            removed: removed
        end

    Replaced_constant: INTEGER is unique
            -- Replaced value

    set_replaced is
            -- Set status to replaced.
        do
            control := replaced_constant
        ensure
            replaced: replaced
        end

    special_status: BOOLEAN is
            -- Has status been set to some non-default value?
        do
            Result := (control > 0)
        ensure
            Result = (control > 0)
        end

    add_space is
            -- Increase capacity.
        do
            accommodate ((count * (100 + extra_space)) // 100)
        ensure
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation
        end

    Minimum_capacity: INTEGER is 5

feature {NONE} -- Inapplicable

    prune (v: G) is
            -- Remove one occurrence of v if any.
        do
        end

    collection_extend (v: G) is
            -- Insert a new occurrence of v.
        do
        end

invariant

    keys_not_void: keys /= void
    content_not_void: content /= void
    keys_same_capacity_plus_one: keys.count = capacity + 1
    content_same_capacity_plus_one: content.count = capacity + 1
    deleted_same_capacity: deleted_marks.count = capacity
    keys_starts_at_zero: keys.lower = 0
    content_starts_at_zero: content.lower = 0
    deleted_starts_at_zero: deleted_marks.lower = 0
    valid_iteration_position: off or truly_occupied (iteration_position)
    control_non_negative: control >= 0
    special_status: special_status = (conflict or inserted or replaced or removed or found or not_found)
    max_occupation_meaningful: (max_occupation > 0) and (max_occupation < 100)
    initial_occupation_meaningful: (initial_occupation > 0) and (initial_occupation < 100)
    sized_generously_enough: initial_occupation < max_occupation
    count_big_enough: 0 <= count
    count_small_enough: count <= capacity
    breathing_space: count * 100 <= capacity * max_occupation
    count_no_more_than_slot_count: count <= used_slot_count
    slot_count_big_enough: 0 <= count
    slot_count_small_enough: used_slot_count <= capacity
    extra_space_non_negative: extra_space >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HASH_TABLE [G, H -> HASHABLE]

General
    cluster: base.structures.table
    description: "Hash tables, used to store items identified by hashable keys"
    create: make

Ancestors
    TABLE [G, H]
    UNBOUNDED [G]

Queries
    infix "@" (key: H): G
    after: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    conflict: BOOLEAN
    count: INTEGER
    current_keys: ARRAY [H]
    cursor: CURSOR
    Extendible: BOOLEAN
    found: BOOLEAN
    found_item: G
    Full: BOOLEAN
    has (key: H): BOOLEAN
    has_item (v: G): BOOLEAN
    inserted: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] HASH_TABLE [G, H]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (key: H): G
    item_for_iteration: G
    key_for_iteration: H
    linear_representation: ARRAYED_LIST [G]
    not_found: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    removed: BOOLEAN
    replaced: BOOLEAN
    valid_cursor (c: CURSOR): BOOLEAN
    valid_key (k: H): BOOLEAN

Commands
    accommodate (n: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] HASH_TABLE [G, H])
    extend (new: G; key: H)
    fill (other: CONTAINER [G])
    force (new: G; key: H)
    forth
    go_to (c: CURSOR)
    make (n: INTEGER)
    put (new: G; key: H)
    remove (key: H)
    replace (new: G; key: H)
    replace_key (new_key, old_key: H)
    search (key: H)
    start

Constraints
    keys not void
    content not void
    keys same capacity plus one
    content same capacity plus one
    deleted same capacity
    keys starts at zero
    content starts at zero
    deleted starts at zero
    valid iteration position
    control non negative
    special status
    max occupation meaningful
    initial occupation meaningful
    sized generously enough
    count big enough
    count small enough
    breathing space
    count no more than slot count
    slot count big enough
    slot count small enough
    extra space non negative

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Hash tables, used to store items identified by hashable keys"
    instructions: "[
        Several procedures are provided for inserting an item
        with a given key.

        Here is how to choose between them:

            - Use `put' if you want to do an insertion only if
              there was no item with the given key, doing nothing
              otherwise. (You can find out on return if there was one,
              and what it was.)

            - Use `force' if you always want to insert the item;
              if there was one for the given key it will be removed,
              (and you can find out on return what it was).

            - Use `extend' if you are sure there is no item with
              the given key, enabling faster insertion (but
              unpredictable behavior if this assumption is not true).

            - Use `replace' if you want to replace an already present
              item with the given key, and do nothing if there is none.

        In addition you can use `replace_key' to change the key of an
        already present item, identified by its previous key, or
        do nothing if there is nothing for that previous key.
        You can find out on return.
    ]"
    instructions: "[
        To find out whether a key appears in the table, use `has'.
        To find out the item, if any, associated with a certain key,
        use `item'.

        Both of these routines perform a search. If you need
        both pieces of information (does a key appear? And, if so,
        what is the associated item?), you can avoid performing
        two redundant traversals by using instead the combination
        of `search', `found' and `found_item' as follows:

            your_table.search (your_key)
            if your_table.found then
                what_you_where_looking_for := your_table.found_item
                ... Do whatever is needed to `what_you_were_looking_for' ...
            else
                ... No item was present for `your_key' ...
            end
    ]"
    compatibility: "[
        This version of the class accepts any value of type H as key.
        Previous versions did not accept the default value as a key;
        this restriction no longer applies. Most clients of the old version
        should work correctly with this one; a client that explicitly relied
        on the default value not being hashable should use the old version
        available in the EiffelBase 3.3 compatibility cluster.

        Also, `force' now sets either `found' or `not_found'.
        (Previously it would always set `inserted'.)
    ]"
    storable_compatibility: "[
        Persistent instances of the old version of this class will not be
         retrievable with the present version.
    ]"
    warning: "[
        Modifying an object used as a key by an item present in a table will
        cause incorrect behavior. If you will be modifying key objects,
        pass a clone, not the object itself, as key argument to
        `put' and `replace_key'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    HASH_TABLE [G, H -> HASHABLE]

create
    make

feature -- Initialization

    accommodate (n: INTEGER) is
            -- Reallocate table with enough space for n items;
            -- keep all current items.
        require
            n >= 0
        local
            i: INTEGER
            new_table: HASH_TABLE [G, H]
            default_key: H
        do
            from
                create new_table.make (count.max (n))
            until
                i = capacity
            loop
                if occupied (i) then
                    check
                        not new_table.soon_full
                    end
                    new_table.put (content.item (i), keys.item (i))
                end
                i := i + 1
            end
            if has_default then
                new_table.put (content.item (capacity), default_key)
            end
            set_content (new_table.content)
            set_keys (new_table.keys)
            set_deleted_marks (new_table.deleted_marks)
            capacity := new_table.capacity
            used_slot_count := count
            iteration_position := new_table.iteration_position
        ensure
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation
        end

    make (n: INTEGER) is
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
        local
            clever: PRIMES
        do
            create clever
            capacity := n.max (minimum_capacity)
            capacity := (capacity * 100) // initial_occupation + 1
            capacity := clever.higher_prime (capacity)
            create content.make (0, capacity)
            create keys.make (0, capacity)
            create deleted_marks.make (0, capacity - 1)
            iteration_position := capacity + 1
        ensure
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status
        end

feature -- Access

    current_keys: ARRAY [H] is
            -- New array containing actually used keys, from 1 to count
        local
            j: INTEGER
            old_iteration_position: INTEGER
        do
            old_iteration_position := iteration_position
            from
                create Result.make (1, count)
                start
            until
                off
            loop
                j := j + 1
                Result.put (key_for_iteration, j)
                forth
            end
            iteration_position := old_iteration_position
        ensure
            good_count: Result.count = count
        end

    cursor: CURSOR is
            -- Current cursor position
        do
            create {HASH_TABLE_CURSOR} Result.make (iteration_position)
        ensure
            cursor_not_void: Result /= void
        end

    found_item: G
            -- Item, if any, yielded by last search operation

    has (key: H): BOOLEAN is
            -- Is there an item in the table with key key?
        local
            old_control, old_position: INTEGER
        do
            old_control := control
            old_position := position
            internal_search (key)
            Result := found
            control := old_control
            position := old_position
        ensure then
            default_case: (key = computed_default_key) implies (Result = has_default)
        end

    has_item (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            i: INTEGER
        do
            if has_default then
                Result := (v = default_key_value)
            end
            if not Result then
                if object_comparison then
                    from
                    until
                        i = capacity or else Result
                    loop
                        Result := occupied (i) and then equal (v, content.item (i))
                        i := i + 1
                    end
                else
                    from
                    until
                        i = capacity or else Result
                    loop
                        Result := occupied (i) and then (v = content.item (i))
                        i := i + 1
                    end
                end
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item (key: H): G is
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of @.
        require -- from TABLE
            valid_key: valid_key (k)
        local
            old_control, old_position: INTEGER
        do
            old_control := control
            old_position := position
            internal_search (key)
            if found then
                Result := content.item (position)
            end
            control := old_control
            position := old_position
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)
        end

    item_for_iteration: G is
            -- Element at current iteration position
        require
            not_off: not off
        do
            Result := content.item (iteration_position)
        end

    key_for_iteration: H is
            -- Key at current iteration position
        require
            not_off: not off
        do
            Result := keys.item (iteration_position)
        ensure
            at_iteration_position: Result = key_at (iteration_position)
        end

    infix "@" (key: H): G is
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of item.
        require -- from TABLE
            valid_key: valid_key (k)
        local
            old_control, old_position: INTEGER
        do
            old_control := control
            old_position := position
            internal_search (key)
            if found then
                Result := content.item (position)
            end
            control := old_control
            position := old_position
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)
        end

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored.

    count: INTEGER
            -- Number of items in table

    occurrences (v: G): INTEGER is
            -- Number of table items equal to v.
        local
            old_iteration_position: INTEGER
        do
            old_iteration_position := iteration_position
            if object_comparison then
                from
                    start
                until
                    off
                loop
                    if equal (item_for_iteration, v) then
                        Result := Result + 1
                    end
                    forth
                end
            else
                from
                    start
                until
                    off
                loop
                    if item_for_iteration = v then
                        Result := Result + 1
                    end
                    forth
                end
            end
            iteration_position := old_iteration_position
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does table contain the same information as other?
        require -- from ANY
            other_not_void: other /= void
        do
            Result := equal (keys, other.keys) and equal (content, other.content) and equal (deleted_marks, other.deleted_marks) and (has_default = other.has_default)
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    after: BOOLEAN is
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of off.
        do
            Result := is_off_position (iteration_position)
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    conflict: BOOLEAN is
            -- Did last operation cause a conflict?
        do
            Result := (control = conflict_constant)
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    found: BOOLEAN is
            -- Did last operation find the item sought?
        do
            Result := (control = found_constant)
        end

    Full: BOOLEAN is False
            -- Is structure filled to capacity? (Answer: no.)

    inserted: BOOLEAN is
            -- Did last operation insert an item?
        do
            Result := (control = inserted_constant)
        end

    is_empty: BOOLEAN is
            -- Is structure empty?
            -- (from FINITE)
        do
            Result := (count = 0)
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has_item (v)
        end

    not_found: BOOLEAN is
            -- Did last operation fail to find the item sought?
        do
            Result := (control = not_found_constant)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of after.
        do
            Result := is_off_position (iteration_position)
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
        do
            Result := True
        end

    removed: BOOLEAN is
            -- Did last operation remove an item?
        do
            Result := (control = removed_constant)
        end

    replaced: BOOLEAN is
            -- Did last operation replace an item?
        do
            Result := (control = replaced_constant)
        end

    valid_cursor (c: CURSOR): BOOLEAN is
            -- Can cursor be moved to position c?
        require
            c_not_void: c /= void
        local
            ht_cursor: HASH_TABLE_CURSOR
            cursor_position: INTEGER
        do
            ht_cursor ?= c
            if ht_cursor /= void then
                cursor_position := ht_cursor.position
                Result := (is_off_position (cursor_position)) or else ((cursor_position >= 0) and (cursor_position <= capacity) and then truly_occupied (cursor_position))
            end
        end

    valid_key (k: H): BOOLEAN is
            -- Is k a valid key?
            -- (Answer: always yes for hash tables in this version)
        do
            Result := True
        ensure then
            Result
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Advance cursor to next occupied position,
            -- or off if no such position remains.
        require
            not_off: not off
        do
            from
                iteration_position := iteration_position + 1
            until
                off or else truly_occupied (iteration_position)
            loop
                iteration_position := iteration_position + 1
            end
        end

    go_to (c: CURSOR) is
            -- Move to position c.
        require
            c_not_void: c /= void
            valid_cursor: valid_cursor (c)
        local
            ht_cursor: HASH_TABLE_CURSOR
        do
            ht_cursor ?= c
            if ht_cursor /= void then
                iteration_position := ht_cursor.position
            end
        end

    search (key: H) is
            -- Search for item of key key.
            -- If found, set found to true, and set
            -- found_item to item associated with key.
        local
            default_value: G
        do
            internal_search (key)
            if found then
                found_item := content.item (position)
            else
                found_item := default_value
            end
        ensure
            found_or_not_found: found or not_found
            item_if_found: found implies (found_item = content.item (position))
        end

    search_item: G is
        obsolete "Use found_item instead."
        do
            Result := found_item
        end

    start is
            -- Bring cursor to first position.
        do
            iteration_position := - 1
            forth
        end

feature -- Element change

    extend (new: G; key: H) is
            -- Assuming there is no item of key key,
            -- insert new with key.
            -- Set inserted.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require
            not_present: not has (key)
        do
            search_for_insertion (key)
            if soon_full then
                add_space
                search_for_insertion (key)
            end
            if position < capacity and then deleted (position) then
                set_not_deleted (position)
            else
                used_slot_count := used_slot_count + 1
            end
            count := count + 1
            put_at_position (new, key)
            set_inserted
        ensure
            inserted: inserted
            insertion_done: item (key) = new
            one_more: count = old count + 1
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            default_property: has_default = ((key = computed_default_key) or (old has_default))
        end

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                collection_extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force (new: G; key: H) is
            -- Update table so that new will be the item associated
            -- with key.
            -- If there was an item for that key, set found
            -- and set found_item to that item.
            -- If there was none, set not_found and set
            -- found_item to the default value.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require else
            True
        local
            default_key: H
        do
            search (key)
            if not_found then
                if soon_full then
                    add_space
                    internal_search (key)
                end
                if deleted_position /= impossible_position then
                    position := deleted_position
                    set_not_deleted (position)
                end
                keys.put (key, position)
                if key = default_key then
                    set_default
                end
                count := count + 1
                used_slot_count := used_slot_count + 1
            end
            content.put (new, position)
        ensure then
            insertion_done: item (key) = new
            now_present: has (key)
            found_or_not_found: found or not_found
            not_found_if_was_not_present: not_found = not (old has (key))
            same_count_or_one_more: (count = old count) or (count = old count + 1)
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            found_item_is_old_item: found implies (found_item = old (item (key)))
            default_value_if_not_found: not_found implies (found_item = computed_default_value)
            default_property: has_default = ((key = computed_default_key) or ((key /= computed_default_key) and (old has_default)))
        end

    put (new: G; key: H) is
            -- Insert new with key if there is no other item
            -- associated with the same key.
            -- Set inserted if and only if an insertion has
            -- been made (i.e. key was not present).
            -- If so, set position to the insertion position.
            -- If not, set conflict.
            -- In either case, set found_item to the item
            -- now associated with key (previous item if
            -- there was one, new otherwise).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require -- from TABLE
            valid_key: valid_key (k)
        do
            internal_search (key)
            if found then
                set_conflict
                found_item := content.item (position)
            else
                if soon_full then
                    add_space
                    internal_search (key)
                    check
                        not found
                    end
                end
                if deleted_position /= impossible_position then
                    position := deleted_position
                    set_not_deleted (position)
                end
                count := count + 1
                used_slot_count := used_slot_count + 1
                put_at_position (new, key)
                found_item := new
                set_inserted
            end
        ensure then
            conflict_or_inserted: conflict or inserted
            insertion_done: inserted implies item (key) = new
            now_present: inserted implies has (key)
            one_more_if_inserted: inserted implies (count = old count + 1)
            one_more_slot_if_inserted_unless_reallocated: inserted implies ((used_slot_count = old used_slot_count + 1) or (used_slot_count = count))
            unchanged_if_conflict: conflict implies (count = old count)
            same_item_if_conflict: conflict implies (item (key) = old (item (key)))
            slot_count_unchanged_if_conflict: conflict implies (used_slot_count = old used_slot_count)
            found_item_associated_with_key: found_item = item (key)
            new_item_if_inserted: inserted implies (found_item = new)
            old_item_if_conflict: conflict implies (found_item = old (item (key)))
            default_property: has_default = ((inserted and (key = computed_default_key)) or ((conflict or (key /= computed_default_key)) and (old has_default)))
        end

    replace (new: G; key: H) is
            -- Replace item at key, if present,
            -- with new; do not change associated key.
            -- Set replaced if and only if a replacement has been made
            -- (i.e. key was present); otherwise set not_found.
            -- Set found_item to the item previously associated
            -- with key (default value if there was none).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        do
            search (key)
            if found then
                content.put (new, position)
                set_replaced
            end
        ensure
            replaced_or_not_found: replaced or not_found
            insertion_done: replaced implies item (key) = new
            no_change_if_not_found: not_found implies item (key) = old (item (key))
            found_item_is_old_item: found_item = old (item (key))
        end

    replace_key (new_key: H; old_key: H) is
            -- If there is an item of key old_key and no item of key
            -- new_key, replace the former's key by new_key,
            -- set replaced, and set found_item to the item
            -- previously associated with old_key.
            -- Otherwise set not_found or conflict respectively.
            -- If conflict, set found_item to the item previously
            -- associated with new_key.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        local
            insert_position: INTEGER
            default_value: G
            default_key: H
        do
            put (default_value, new_key)
            if inserted then
                count := count - 1
                used_slot_count := used_slot_count - 1
                insert_position := position
                search (old_key)
                if found then
                    content.put (found_item, insert_position)
                    if old_key = default_key then
                        set_no_default
                    else
                        remove_at_position
                    end
                    if new_key = default_key then
                        set_default
                    end
                    set_replaced
                else
                    position := insert_position
                    remove_at_position
                    check
                        not_found: not_found
                    end
                end
            end
        ensure
            same_count: count = old count
            same_slot_count: used_slot_count = old used_slot_count
            replaced_or_conflict_or_not_found: replaced or conflict or not_found
            old_absent: (replaced and not equal (new_key, old_key)) implies (not has (old_key))
            new_present: (replaced or conflict) = has (new_key)
            new_item: replaced implies (item (new_key) = old (item (old_key)))
            not_found_iff_no_old_key: not_found = old (not has (old_key))
            conflict_iff_already_present: conflict = old (has (new_key))
            not_inserted_if_conflict: conflict implies (item (new_key) = old (item (new_key)))
            default_property: has_default = ((new_key = computed_default_key) or ((new_key /= computed_default_key) and (old has_default)))
        end

feature -- Removal

    clear_all is
            -- Reset all items to default values; reset status.
        require -- from COLLECTION
            prunable
        do
            content.clear_all
            keys.clear_all
            deleted_marks.clear_all
            count := 0
            used_slot_count := 0
            position := 0
            iteration_position := capacity + 1
            set_no_status
            set_no_default
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            position_equal_to_zero: position = 0
            count_equal_to_zero: count = 0
            used_slot_count_equal_to_zero: used_slot_count = 0
            has_default_set: not has_default
            no_status: not special_status
        end

    remove (key: H) is
            -- Remove item associated with key, if present.
            -- Set removed if and only if an item has been
            -- removed (i.e. key was present);
            -- if so, set position to index of removed element.
            -- If not, set not_found.
        local
            default_key: H
        do
            internal_search (key)
            if found then
                if key = default_key then
                    set_no_default
                else
                    remove_at_position
                end
                count := count - 1
                set_removed
            end
        ensure
            removed_or_not_found: removed or not_found
            not_present: not has (key)
            one_less: found implies (count = old count - 1)
            same_slot_count: used_slot_count = old used_slot_count
            default_case: (key = computed_default_key) implies (not has_default)
            non_default_case: (key /= computed_default_key) implies (has_default = old has_default)
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has_item (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has_item (v)
        end

feature -- Conversion

    linear_representation: ARRAYED_LIST [G] is
            -- Representation as a linear structure
        local
            old_iteration_position: INTEGER
        do
            old_iteration_position := iteration_position
            from
                create Result.make (count)
                start
            until
                off
            loop
                Result.extend (item_for_iteration)
                forth
            end
            iteration_position := old_iteration_position
        ensure then
            result_exists: Result /= void
            good_count: Result.count = count
        end

feature -- Duplication

    copy (other: like Current) is
            -- Re-initialize from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        do
            standard_copy (other)
            set_keys (clone (other.keys))
            set_content (clone (other.content))
            set_deleted_marks (clone (other.deleted_marks))
        ensure -- from ANY
            is_equal: is_equal (other)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    collection_extend (v: G) is
            -- Insert a new occurrence of v.
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    prune (v: G) is
            -- Remove one occurrence of v if any.
        require -- from COLLECTION
            prunable: prunable
        do
        end

feature {NONE} -- Implementation

    add_space is
            -- Increase capacity.
        do
            accommodate ((count * (100 + extra_space)) // 100)
        ensure
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation
        end

    computed_default_key: H is
            -- Default key
            -- (For performance reasons, used only in assertions;
            -- elsewhere, see use of local entity default_key.)
        do
        end

    computed_default_value: G is
            -- Default value of type G
            -- (For performance reasons, used only in assertions;
            -- elsewhere, see use of local entity default_value.)
        do
        end

    Conflict_constant: INTEGER is unique
            -- Could not insert an already existing key

    default_key_value: G is
            -- Value associated with the default key, if any
        require
            has_default: has_default
        do
            Result := content.item (capacity)
        end

    deleted (i: INTEGER): BOOLEAN is
            -- Is position i that of a deleted item?
        require
            in_bounds: i >= 0 and i < capacity
        do
            Result := deleted_marks.item (i)
        end

    Extra_space: INTEGER is 50
            -- Percentage of extra positions when resizing

    Found_constant: INTEGER is unique
            -- Key found

    Impossible_position: INTEGER is -1
            -- Position outside the array indices

    Initial_occupation: INTEGER is 50
            -- Filling percentage for initial requested occupation

    initial_position (hash_value: INTEGER): INTEGER is
            -- Initial position for an item of hash code hash_value
        do
            Result := (hash_value \\ capacity)
        end

    Inserted_constant: INTEGER is unique
            -- Insertion successful

    internal_search (key: H) is
            -- Search for item of key key.
            -- If successful, set position to index
            -- of item with this key (the same index as the key's index).
            -- If not, set position to possible position for insertion,
            -- and set status to found or not_found.
        local
            default_key: H
            hash_value, increment: INTEGER
            stop: BOOLEAN
        do
            deleted_position := impossible_position
            if key = default_key then
                position := capacity
                if has_default then
                    set_found
                else
                    set_not_found
                end
            else
                from
                    hash_value := key.hash_code
                    increment := position_increment (hash_value)
                    position := initial_position (hash_value)
                until
                    stop
                loop
                    if deleted (position) then
                        if deleted_position = impossible_position then
                            deleted_position := position
                        end
                        to_next_candidate (increment)
                    elseif keys.item (position) = default_key then
                        stop := True;
                        set_not_found
                    elseif keys.item (position).is_equal (key) then
                        stop := True;
                        set_found
                    else
                        to_next_candidate (increment)
                    end
                end
            end
        ensure
            found_or_not_found: found or not_found
            deleted_item_at_deleted_position: (deleted_position /= impossible_position) implies (deleted (deleted_position))
            default_value_if_not_found: not_found implies (content.item (position) = computed_default_value)
            default_iff_at_capacity: (position = capacity) = (key = computed_default_key)
        end

    is_off_position (pos: INTEGER): BOOLEAN is
            -- Is pos a cursor position past last item?
        do
            Result := (not has_default and (pos >= capacity)) or (has_default and (pos = (capacity + 1)))
        ensure
            definition: Result = ((not has_default and (pos >= capacity)) or (has_default and (pos = (capacity + 1))))
        end

    key_at (n: INTEGER): H is
            -- Key at position n
        require
            in_bounds: n >= 0 and n < capacity
        do
            Result := keys.item (n)
        end

    Max_occupation: INTEGER is 80
            -- Filling percentage over which table will be resized

    Minimum_capacity: INTEGER is 5

    Not_found_constant: INTEGER is unique
            -- Key not found

    occupied (i: INTEGER): BOOLEAN is
            -- Is position i occupied by a non-default key and a value?
        require
            in_bounds: i >= 0 and i < capacity
        local
            default_key: H
        do
            Result := (keys.item (i) /= default_key)
        end

    position_increment (hash_value: INTEGER): INTEGER is
            -- Distance between successive positions for hash code
            -- hash_value (computed for no cycle: capacity is prime)
        do
            Result := 1 + hash_value \\ (capacity - 1)
        end

    put_at_position (new: G; key: H) is
            -- Put new with key at position.
        require
            in_bounds: position >= 0 and position <= capacity
            default_if_at_capacity: (position = capacity) implies (key = computed_default_key)
        local
            default_key: H
        do
            content.put (new, position)
            keys.put (key, position)
            if key = default_key then
                set_default
            end
        ensure
            item_at_position: content.item (position) = new
            key_at_position: key_at (position) = key
            default_if_at_capacity: (position = capacity) implies has_default
        end

    remove_at_position is
            -- Remove item at position
        require
            in_bounds: position >= 0 and position <= capacity
        local
            default_value: G
            default_key: H
        do
            content.put (default_value, position)
            keys.put (default_key, position)
            set_deleted (position)
            if iteration_position = position then
                forth
            end
        ensure
            deleted: deleted (position)
            status_not_changed: control = old control
            count_not_changed: count = old count
            slot_count_not_changed: used_slot_count = old used_slot_count
            key_at (position) = computed_default_key
        end

    Removed_constant: INTEGER is unique
            -- Remove successful

    Replaced_constant: INTEGER is unique
            -- Replaced value

    search_for_insertion (key: H) is
            -- Assuming there is no item of key key, compute
            -- position at which to insert such an item.
        require
            not_present: not has (key)
        local
            default_key: H
            hash_value, increment: INTEGER
        do
            if key = default_key then
                check
                    not has_default
                end
                position := capacity
            else
                from
                    hash_value := key.hash_code
                    increment := position_increment (hash_value)
                    position := initial_position (hash_value)
                until
                    deleted (position) or keys.item (position) = default_key
                loop
                    to_next_candidate (increment)
                end
            end
        ensure
            deleted_or_default: deleted (position) or (key_at (position) = computed_default_key)
            default_iff_at_capacity: (position = capacity) = (key = computed_default_key)
        end

    set_conflict is
            -- Set status to conflict.
        do
            control := conflict_constant
        ensure
            conflict: conflict
        end

    set_content (c: like content) is
            -- Assign c to content.
        do
            content := c
        end

    set_deleted (i: INTEGER) is
            -- Mark position i as deleted.
        require
            in_bounds: i >= 0 and i < capacity
        do
            deleted_marks.put (True, i)
        ensure
            deleted: deleted (i)
        end

    set_deleted_marks (d: like deleted_marks) is
            -- Assign d to deleted_marks.
        do
            deleted_marks := d
        end

    set_found is
            -- Set status to found.
        do
            control := found_constant
        ensure
            found: found
        end

    set_inserted is
            -- Set status to inserted.
        do
            control := inserted_constant
        ensure
            inserted: inserted
        end

    set_keys (c: like keys) is
            -- Assign c to keys.
        do
            keys := c
        end

    set_no_status is
            -- Set status to normal.
        do
            control := 0
        ensure
            default_status: not special_status
        end

    set_not_deleted (i: INTEGER) is
            -- Mark position i as not deleted.
        require
            in_bounds: i >= 0 and i < capacity
        do
            deleted_marks.put (False, i)
        end

    set_not_found is
            -- Set status to not found.
        do
            control := not_found_constant
        ensure
            not_found: not_found
        end

    set_removed is
            -- Set status to removed.
        do
            control := removed_constant
        ensure
            removed: removed
        end

    set_replaced is
            -- Set status to replaced.
        do
            control := replaced_constant
        ensure
            replaced: replaced
        end

    special_status: BOOLEAN is
            -- Has status been set to some non-default value?
        do
            Result := (control > 0)
        ensure
            Result = (control > 0)
        end

    to_next_candidate (increment: INTEGER) is
            -- Move from current position to next for same key
        do
            position := (position + increment) \\ capacity
        end

    truly_occupied (i: INTEGER): BOOLEAN is
            -- Is position i occupied by a key and a value?
        require
            in_bounds: i >= 0 and i <= capacity
        do
            Result := (has_default and i = capacity) or else (i < capacity and then occupied (i))
        ensure
            normal_key: (i < capacity) implies (occupied (i) implies Result)
            default_key: (i = capacity) implies (Result = has_default)
        end

    used_slot_count: INTEGER
            -- Number of slots occuped by an element either present
            -- or marked as deleted

feature {HASH_TABLE} -- Implementation: content attributes and preservation

    content: ARRAY [G]
            -- Array of contents

    deleted_marks: ARRAY [BOOLEAN]
            -- Is position that of a deleted element?

    has_default: BOOLEAN
            -- Is the default key present?

    keys: ARRAY [H]
            -- Array of keys

    set_default is
            -- Record information that there is a value for default key.
        do
            has_default := True
        end

    set_no_default is
            -- Record information that there is no value for default key.
        local
            default_value: G
        do
            has_default := False
            content.put (default_value, capacity)
        end

feature {HASH_TABLE} -- Implementation: search attributes

    control: INTEGER
            -- Control code set by operations that may produce
            -- several possible conditions.

    deleted_position: INTEGER
            -- Place where a deleted element was found during a search

    iteration_position: INTEGER
            -- Cursor for iteration primitives

    position: INTEGER
            -- Hash table cursor, updated after each operation:
            -- put, remove, has, replace, force, change_key...

    soon_full: BOOLEAN is
            -- Is table close to being filled to current capacity?
            -- (If so, resizing is needed to avoid performance degradation.)
        do
            Result := ((used_slot_count + 1) * 100 >= capacity * max_occupation)
        ensure
            Result = ((used_slot_count + 1) * 100 >= capacity * max_occupation)
        end

invariant

    keys_not_void: keys /= void
    content_not_void: content /= void
    keys_same_capacity_plus_one: keys.count = capacity + 1
    content_same_capacity_plus_one: content.count = capacity + 1
    deleted_same_capacity: deleted_marks.count = capacity
    keys_starts_at_zero: keys.lower = 0
    content_starts_at_zero: content.lower = 0
    deleted_starts_at_zero: deleted_marks.lower = 0
    valid_iteration_position: off or truly_occupied (iteration_position)
    control_non_negative: control >= 0
    special_status: special_status = (conflict or inserted or replaced or removed or found or not_found)
    max_occupation_meaningful: (max_occupation > 0) and (max_occupation < 100)
    initial_occupation_meaningful: (initial_occupation > 0) and (initial_occupation < 100)
    sized_generously_enough: initial_occupation < max_occupation
    count_big_enough: 0 <= count
    count_small_enough: count <= capacity
    breathing_space: count * 100 <= capacity * max_occupation
    count_no_more_than_slot_count: count <= used_slot_count
    slot_count_big_enough: 0 <= count
    slot_count_small_enough: used_slot_count <= capacity
    extra_space_non_negative: extra_space >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Hash tables, used to store items identified by hashable keys"
    instructions: "[
        Several procedures are provided for inserting an item
        with a given key.

        Here is how to choose between them:

            - Use `put' if you want to do an insertion only if
              there was no item with the given key, doing nothing
              otherwise. (You can find out on return if there was one,
              and what it was.)

            - Use `force' if you always want to insert the item;
              if there was one for the given key it will be removed,
              (and you can find out on return what it was).

            - Use `extend' if you are sure there is no item with
              the given key, enabling faster insertion (but
              unpredictable behavior if this assumption is not true).

            - Use `replace' if you want to replace an already present
              item with the given key, and do nothing if there is none.

        In addition you can use `replace_key' to change the key of an
        already present item, identified by its previous key, or
        do nothing if there is nothing for that previous key.
        You can find out on return.
    ]"
    instructions: "[
        To find out whether a key appears in the table, use `has'.
        To find out the item, if any, associated with a certain key,
        use `item'.

        Both of these routines perform a search. If you need
        both pieces of information (does a key appear? And, if so,
        what is the associated item?), you can avoid performing
        two redundant traversals by using instead the combination
        of `search', `found' and `found_item' as follows:

            your_table.search (your_key)
            if your_table.found then
                what_you_where_looking_for := your_table.found_item
                ... Do whatever is needed to `what_you_were_looking_for' ...
            else
                ... No item was present for `your_key' ...
            end
    ]"
    compatibility: "[
        This version of the class accepts any value of type H as key.
        Previous versions did not accept the default value as a key;
        this restriction no longer applies. Most clients of the old version
        should work correctly with this one; a client that explicitly relied
        on the default value not being hashable should use the old version
        available in the EiffelBase 3.3 compatibility cluster.

        Also, `force' now sets either `found' or `not_found'.
        (Previously it would always set `inserted'.)
    ]"
    storable_compatibility: "[
        Persistent instances of the old version of this class will not be
         retrievable with the present version.
    ]"
    warning: "[
        Modifying an object used as a key by an item present in a table will
        cause incorrect behavior. If you will be modifying key objects,
        pass a clone, not the object itself, as key argument to
        `put' and `replace_key'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    HASH_TABLE [G, H -> HASHABLE]

create

    make (n: INTEGER)
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
        ensure
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status

feature -- Initialization

    accommodate (n: INTEGER)
            -- Reallocate table with enough space for n items;
            -- keep all current items.
        require
            n >= 0
        ensure
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation

    make (n: INTEGER)
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
        ensure
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status

feature -- Access

    current_keys: ARRAY [H]
            -- New array containing actually used keys, from 1 to count
        ensure
            good_count: Result.count = count

    cursor: CURSOR
            -- Current cursor position
        ensure
            cursor_not_void: Result /= void

    found_item: G
            -- Item, if any, yielded by last search operation

    has (key: H): BOOLEAN
            -- Is there an item in the table with key key?
        ensure then
            default_case: (key = computed_default_key) implies (Result = has_default)

    has_item (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (key: H): G
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of @.
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

    item_for_iteration: G
            -- Element at current iteration position
        require
            not_off: not off

    key_for_iteration: H
            -- Key at current iteration position
        require
            not_off: not off
        ensure
            at_iteration_position: Result = key_at (iteration_position)

    infix "@" (key: H): G
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of item.
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored.

    count: INTEGER
            -- Number of items in table

    occurrences (v: G): INTEGER
            -- Number of table items equal to v.
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does table contain the same information as other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    after: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of off.
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    conflict: BOOLEAN
            -- Did last operation cause a conflict?

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    found: BOOLEAN
            -- Did last operation find the item sought?

    Full: BOOLEAN is False
            -- Is structure filled to capacity? (Answer: no.)

    inserted: BOOLEAN
            -- Did last operation insert an item?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    not_found: BOOLEAN
            -- Did last operation fail to find the item sought?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of after.
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    removed: BOOLEAN
            -- Did last operation remove an item?

    replaced: BOOLEAN
            -- Did last operation replace an item?

    valid_cursor (c: CURSOR): BOOLEAN
            -- Can cursor be moved to position c?
        require
            c_not_void: c /= void

    valid_key (k: H): BOOLEAN
            -- Is k a valid key?
            -- (Answer: always yes for hash tables in this version)
        ensure then
            Result

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Advance cursor to next occupied position,
            -- or off if no such position remains.
        require
            not_off: not off

    go_to (c: CURSOR)
            -- Move to position c.
        require
            c_not_void: c /= void
            valid_cursor: valid_cursor (c)

    search (key: H)
            -- Search for item of key key.
            -- If found, set found to true, and set
            -- found_item to item associated with key.
        ensure
            found_or_not_found: found or not_found
            item_if_found: found implies (found_item = content.item (position))

    start
            -- Bring cursor to first position.

feature -- Element change

    extend (new: G; key: H)
            -- Assuming there is no item of key key,
            -- insert new with key.
            -- Set inserted.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require
            not_present: not has (key)
        ensure
            inserted: inserted
            insertion_done: item (key) = new
            one_more: count = old count + 1
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            default_property: has_default = ((key = computed_default_key) or (old has_default))

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (new: G; key: H)
            -- Update table so that new will be the item associated
            -- with key.
            -- If there was an item for that key, set found
            -- and set found_item to that item.
            -- If there was none, set not_found and set
            -- found_item to the default value.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require else
            True
        ensure then
            insertion_done: item (key) = new
            now_present: has (key)
            found_or_not_found: found or not_found
            not_found_if_was_not_present: not_found = not (old has (key))
            same_count_or_one_more: (count = old count) or (count = old count + 1)
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            found_item_is_old_item: found implies (found_item = old (item (key)))
            default_value_if_not_found: not_found implies (found_item = computed_default_value)
            default_property: has_default = ((key = computed_default_key) or ((key /= computed_default_key) and (old has_default)))

    put (new: G; key: H)
            -- Insert new with key if there is no other item
            -- associated with the same key.
            -- Set inserted if and only if an insertion has
            -- been made (i.e. key was not present).
            -- If so, set position to the insertion position.
            -- If not, set conflict.
            -- In either case, set found_item to the item
            -- now associated with key (previous item if
            -- there was one, new otherwise).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then
            conflict_or_inserted: conflict or inserted
            insertion_done: inserted implies item (key) = new
            now_present: inserted implies has (key)
            one_more_if_inserted: inserted implies (count = old count + 1)
            one_more_slot_if_inserted_unless_reallocated: inserted implies ((used_slot_count = old used_slot_count + 1) or (used_slot_count = count))
            unchanged_if_conflict: conflict implies (count = old count)
            same_item_if_conflict: conflict implies (item (key) = old (item (key)))
            slot_count_unchanged_if_conflict: conflict implies (used_slot_count = old used_slot_count)
            found_item_associated_with_key: found_item = item (key)
            new_item_if_inserted: inserted implies (found_item = new)
            old_item_if_conflict: conflict implies (found_item = old (item (key)))
            default_property: has_default = ((inserted and (key = computed_default_key)) or ((conflict or (key /= computed_default_key)) and (old has_default)))

    replace (new: G; key: H)
            -- Replace item at key, if present,
            -- with new; do not change associated key.
            -- Set replaced if and only if a replacement has been made
            -- (i.e. key was present); otherwise set not_found.
            -- Set found_item to the item previously associated
            -- with key (default value if there was none).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        ensure
            replaced_or_not_found: replaced or not_found
            insertion_done: replaced implies item (key) = new
            no_change_if_not_found: not_found implies item (key) = old (item (key))
            found_item_is_old_item: found_item = old (item (key))

    replace_key (new_key: H; old_key: H)
            -- If there is an item of key old_key and no item of key
            -- new_key, replace the former's key by new_key,
            -- set replaced, and set found_item to the item
            -- previously associated with old_key.
            -- Otherwise set not_found or conflict respectively.
            -- If conflict, set found_item to the item previously
            -- associated with new_key.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        ensure
            same_count: count = old count
            same_slot_count: used_slot_count = old used_slot_count
            replaced_or_conflict_or_not_found: replaced or conflict or not_found
            old_absent: (replaced and not equal (new_key, old_key)) implies (not has (old_key))
            new_present: (replaced or conflict) = has (new_key)
            new_item: replaced implies (item (new_key) = old (item (old_key)))
            not_found_iff_no_old_key: not_found = old (not has (old_key))
            conflict_iff_already_present: conflict = old (has (new_key))
            not_inserted_if_conflict: conflict implies (item (new_key) = old (item (new_key)))
            default_property: has_default = ((new_key = computed_default_key) or ((new_key /= computed_default_key) and (old has_default)))

feature -- Removal

    clear_all
            -- Reset all items to default values; reset status.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            position_equal_to_zero: position = 0
            count_equal_to_zero: count = 0
            used_slot_count_equal_to_zero: used_slot_count = 0
            has_default_set: not has_default
            no_status: not special_status

    remove (key: H)
            -- Remove item associated with key, if present.
            -- Set removed if and only if an item has been
            -- removed (i.e. key was present);
            -- if so, set position to index of removed element.
            -- If not, set not_found.
        ensure
            removed_or_not_found: removed or not_found
            not_present: not has (key)
            one_less: found implies (count = old count - 1)
            same_slot_count: used_slot_count = old used_slot_count
            default_case: (key = computed_default_key) implies (not has_default)
            non_default_case: (key /= computed_default_key) implies (has_default = old has_default)

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
        ensure then
            result_exists: Result /= void
            good_count: Result.count = count

feature -- Duplication

    copy (other: like Current)
            -- Re-initialize from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

invariant

    keys_not_void: keys /= void
    content_not_void: content /= void
    keys_same_capacity_plus_one: keys.count = capacity + 1
    content_same_capacity_plus_one: content.count = capacity + 1
    deleted_same_capacity: deleted_marks.count = capacity
    keys_starts_at_zero: keys.lower = 0
    content_starts_at_zero: content.lower = 0
    deleted_starts_at_zero: deleted_marks.lower = 0
    valid_iteration_position: off or truly_occupied (iteration_position)
    control_non_negative: control >= 0
    special_status: special_status = (conflict or inserted or replaced or removed or found or not_found)
    max_occupation_meaningful: (max_occupation > 0) and (max_occupation < 100)
    initial_occupation_meaningful: (initial_occupation > 0) and (initial_occupation < 100)
    sized_generously_enough: initial_occupation < max_occupation
    count_big_enough: 0 <= count
    count_small_enough: count <= capacity
    breathing_space: count * 100 <= capacity * max_occupation
    count_no_more_than_slot_count: count <= used_slot_count
    slot_count_big_enough: 0 <= count
    slot_count_small_enough: used_slot_count <= capacity
    extra_space_non_negative: extra_space >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HASH_TABLE [G, H -> HASHABLE]

Ancestors
    TABLE [G, H]
    UNBOUNDED [G]

Clients
    HASH_TABLE [G, H -> HASHABLE]
    SUBSET_STRATEGY_HASHABLE [G]

Suppliers
    ARRAY [G]
    ARRAYED_LIST [G]
    BOOLEAN
    HASH_TABLE [G, H -> HASHABLE]
    HASH_TABLE_CURSOR
    HASHABLE
    INTEGER
    PRIMES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HASH_TABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Hash tables, used to store items identified by hashable keys"
    instructions: "[
        Several procedures are provided for inserting an item
        with a given key.

        Here is how to choose between them:

            - Use `put' if you want to do an insertion only if
              there was no item with the given key, doing nothing
              otherwise. (You can find out on return if there was one,
              and what it was.)

            - Use `force' if you always want to insert the item;
              if there was one for the given key it will be removed,
              (and you can find out on return what it was).

            - Use `extend' if you are sure there is no item with
              the given key, enabling faster insertion (but
              unpredictable behavior if this assumption is not true).

            - Use `replace' if you want to replace an already present
              item with the given key, and do nothing if there is none.

        In addition you can use `replace_key' to change the key of an
        already present item, identified by its previous key, or
        do nothing if there is nothing for that previous key.
        You can find out on return.
    ]"
    instructions: "[
        To find out whether a key appears in the table, use `has'.
        To find out the item, if any, associated with a certain key,
        use `item'.

        Both of these routines perform a search. If you need
        both pieces of information (does a key appear? And, if so,
        what is the associated item?), you can avoid performing
        two redundant traversals by using instead the combination
        of `search', `found' and `found_item' as follows:

            your_table.search (your_key)
            if your_table.found then
                what_you_where_looking_for := your_table.found_item
                ... Do whatever is needed to `what_you_were_looking_for' ...
            else
                ... No item was present for `your_key' ...
            end
    ]"
    compatibility: "[
        This version of the class accepts any value of type H as key.
        Previous versions did not accept the default value as a key;
        this restriction no longer applies. Most clients of the old version
        should work correctly with this one; a client that explicitly relied
        on the default value not being hashable should use the old version
        available in the EiffelBase 3.3 compatibility cluster.

        Also, `force' now sets either `found' or `not_found'.
        (Previously it would always set `inserted'.)
    ]"
    storable_compatibility: "[
        Persistent instances of the old version of this class will not be
         retrievable with the present version.
    ]"
    warning: "[
        Modifying an object used as a key by an item present in a table will
        cause incorrect behavior. If you will be modifying key objects,
        pass a clone, not the object itself, as key argument to
        `put' and `replace_key'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    HASH_TABLE [G, H -> HASHABLE]

create
    make

feature -- Initialization

    make (n: INTEGER)
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
        ensure
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status

    accommodate (n: INTEGER)
            -- Reallocate table with enough space for n items;
            -- keep all current items.
        require
            n >= 0
        ensure
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation

feature -- Access

    found_item: G
            -- Item, if any, yielded by last search operation

    item (key: H): G
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of @.
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

    infix "@" (key: H): G
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of item.
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

    has (key: H): BOOLEAN
            -- Is there an item in the table with key key?
        ensure then
            default_case: (key = computed_default_key) implies (Result = has_default)

    has_item (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    current_keys: ARRAY [H]
            -- New array containing actually used keys, from 1 to count
        ensure
            good_count: Result.count = count

    item_for_iteration: G
            -- Element at current iteration position
        require
            not_off: not off

    key_for_iteration: H
            -- Key at current iteration position
        require
            not_off: not off
        ensure
            at_iteration_position: Result = key_at (iteration_position)

    cursor: CURSOR
            -- Current cursor position
        ensure
            cursor_not_void: Result /= void

feature -- Measurement

    count: INTEGER
            -- Number of items in table

    capacity: INTEGER
            -- Number of items that may be stored.

    occurrences (v: G): INTEGER
            -- Number of table items equal to v.

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does table contain the same information as other?

feature -- Status report

    Full: BOOLEAN is False
            -- Is structure filled to capacity? (Answer: no.)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    conflict: BOOLEAN
            -- Did last operation cause a conflict?

    inserted: BOOLEAN
            -- Did last operation insert an item?

    replaced: BOOLEAN
            -- Did last operation replace an item?

    removed: BOOLEAN
            -- Did last operation remove an item?

    found: BOOLEAN
            -- Did last operation find the item sought?

    not_found: BOOLEAN
            -- Did last operation fail to find the item sought?

    after: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of off.
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    off: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of after.
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    valid_cursor (c: CURSOR): BOOLEAN
            -- Can cursor be moved to position c?
        require
            c_not_void: c /= void

    valid_key (k: H): BOOLEAN
            -- Is k a valid key?
            -- (Answer: always yes for hash tables in this version)
        ensure then
            Result

feature -- Cursor movement

    start
            -- Bring cursor to first position.

    forth
            -- Advance cursor to next occupied position,
            -- or off if no such position remains.
        require
            not_off: not off

    go_to (c: CURSOR)
            -- Move to position c.
        require
            c_not_void: c /= void
            valid_cursor: valid_cursor (c)

    search (key: H)
            -- Search for item of key key.
            -- If found, set found to true, and set
            -- found_item to item associated with key.
        ensure
            found_or_not_found: found or not_found
            item_if_found: found implies (found_item = content.item (position))

feature -- Element change

    put (new: G; key: H)
            -- Insert new with key if there is no other item
            -- associated with the same key.
            -- Set inserted if and only if an insertion has
            -- been made (i.e. key was not present).
            -- If so, set position to the insertion position.
            -- If not, set conflict.
            -- In either case, set found_item to the item
            -- now associated with key (previous item if
            -- there was one, new otherwise).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        ensure then
            conflict_or_inserted: conflict or inserted
            insertion_done: inserted implies item (key) = new
            now_present: inserted implies has (key)
            one_more_if_inserted: inserted implies (count = old count + 1)
            one_more_slot_if_inserted_unless_reallocated: inserted implies ((used_slot_count = old used_slot_count + 1) or (used_slot_count = count))
            unchanged_if_conflict: conflict implies (count = old count)
            same_item_if_conflict: conflict implies (item (key) = old (item (key)))
            slot_count_unchanged_if_conflict: conflict implies (used_slot_count = old used_slot_count)
            found_item_associated_with_key: found_item = item (key)
            new_item_if_inserted: inserted implies (found_item = new)
            old_item_if_conflict: conflict implies (found_item = old (item (key)))
            default_property: has_default = ((inserted and (key = computed_default_key)) or ((conflict or (key /= computed_default_key)) and (old has_default)))

    force (new: G; key: H)
            -- Update table so that new will be the item associated
            -- with key.
            -- If there was an item for that key, set found
            -- and set found_item to that item.
            -- If there was none, set not_found and set
            -- found_item to the default value.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require else
            True
        ensure then
            insertion_done: item (key) = new
            now_present: has (key)
            found_or_not_found: found or not_found
            not_found_if_was_not_present: not_found = not (old has (key))
            same_count_or_one_more: (count = old count) or (count = old count + 1)
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            found_item_is_old_item: found implies (found_item = old (item (key)))
            default_value_if_not_found: not_found implies (found_item = computed_default_value)
            default_property: has_default = ((key = computed_default_key) or ((key /= computed_default_key) and (old has_default)))

    extend (new: G; key: H)
            -- Assuming there is no item of key key,
            -- insert new with key.
            -- Set inserted.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require
            not_present: not has (key)
        ensure
            inserted: inserted
            insertion_done: item (key) = new
            one_more: count = old count + 1
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            default_property: has_default = ((key = computed_default_key) or (old has_default))

    replace (new: G; key: H)
            -- Replace item at key, if present,
            -- with new; do not change associated key.
            -- Set replaced if and only if a replacement has been made
            -- (i.e. key was present); otherwise set not_found.
            -- Set found_item to the item previously associated
            -- with key (default value if there was none).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        ensure
            replaced_or_not_found: replaced or not_found
            insertion_done: replaced implies item (key) = new
            no_change_if_not_found: not_found implies item (key) = old (item (key))
            found_item_is_old_item: found_item = old (item (key))

    replace_key (new_key: H; old_key: H)
            -- If there is an item of key old_key and no item of key
            -- new_key, replace the former's key by new_key,
            -- set replaced, and set found_item to the item
            -- previously associated with old_key.
            -- Otherwise set not_found or conflict respectively.
            -- If conflict, set found_item to the item previously
            -- associated with new_key.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        ensure
            same_count: count = old count
            same_slot_count: used_slot_count = old used_slot_count
            replaced_or_conflict_or_not_found: replaced or conflict or not_found
            old_absent: (replaced and not equal (new_key, old_key)) implies (not has (old_key))
            new_present: (replaced or conflict) = has (new_key)
            new_item: replaced implies (item (new_key) = old (item (old_key)))
            not_found_iff_no_old_key: not_found = old (not has (old_key))
            conflict_iff_already_present: conflict = old (has (new_key))
            not_inserted_if_conflict: conflict implies (item (new_key) = old (item (new_key)))
            default_property: has_default = ((new_key = computed_default_key) or ((new_key /= computed_default_key) and (old has_default)))

feature -- Removal

    remove (key: H)
            -- Remove item associated with key, if present.
            -- Set removed if and only if an item has been
            -- removed (i.e. key was present);
            -- if so, set position to index of removed element.
            -- If not, set not_found.
        ensure
            removed_or_not_found: removed or not_found
            not_present: not has (key)
            one_less: found implies (count = old count - 1)
            same_slot_count: used_slot_count = old used_slot_count
            default_case: (key = computed_default_key) implies (not has_default)
            non_default_case: (key /= computed_default_key) implies (has_default = old has_default)

    clear_all
            -- Reset all items to default values; reset status.
        ensure then
            position_equal_to_zero: position = 0
            count_equal_to_zero: count = 0
            used_slot_count_equal_to_zero: used_slot_count = 0
            has_default_set: not has_default
            no_status: not special_status

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
        ensure then
            result_exists: Result /= void
            good_count: Result.count = count

feature -- Duplication

    copy (other: like Current)
            -- Re-initialize from other.

invariant

    keys_not_void: keys /= void
    content_not_void: content /= void
    keys_same_capacity_plus_one: keys.count = capacity + 1
    content_same_capacity_plus_one: content.count = capacity + 1
    deleted_same_capacity: deleted_marks.count = capacity
    keys_starts_at_zero: keys.lower = 0
    content_starts_at_zero: content.lower = 0
    deleted_starts_at_zero: deleted_marks.lower = 0
    valid_iteration_position: off or truly_occupied (iteration_position)
    control_non_negative: control >= 0
    special_status: special_status = (conflict or inserted or replaced or removed or found or not_found)
    max_occupation_meaningful: (max_occupation > 0) and (max_occupation < 100)
    initial_occupation_meaningful: (initial_occupation > 0) and (initial_occupation < 100)
    sized_generously_enough: initial_occupation < max_occupation
    count_big_enough: 0 <= count
    count_small_enough: count <= capacity
    breathing_space: count * 100 <= capacity * max_occupation
    count_no_more_than_slot_count: count <= used_slot_count
    slot_count_big_enough: 0 <= count
    slot_count_small_enough: used_slot_count <= capacity
    extra_space_non_negative: extra_space >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.traversing

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.traversing	(diagram)

Supercluster
    base.structures

Classes
    BILINEAR [G]
    HIERARCHICAL [G]
    LINEAR [G]
    TRAVERSABLE [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BILINEAR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures that may be traversed forward and backward"
    status: "See notice at end of class"
    names: bidirectional, traversing
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    BILINEAR [G]

inherit
    LINEAR [G]
        rename
            search as sequential_search
        export
            {NONE} sequential_search
        redefine
            off
        end

    LINEAR [G]
        redefine
            search,
            off
        select
            search
        end

feature -- Access

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := before or after
        end

feature -- Cursor movement

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
        deferred
        end

    back is
            -- Move to previous position.
        require
            not_before: not before
        deferred
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        end

invariant

    not_both: not (after and before)
    before_constraint: before implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BILINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BILINEAR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BILINEAR [G]

General
    cluster: base.structures.traversing
    description: "Structures that may be traversed forward and backward"

Ancestors
    LINEAR [G]
    LINEAR [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (v: [like item] G)
    start

Constraints
    not both
    before constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BILINEAR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures that may be traversed forward and backward"
    status: "See notice at end of class"
    names: bidirectional, traversing
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    BILINEAR [G]

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER is
            -- Index of current position
            -- (from LINEAR)
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        end

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := before or after
        end

feature {NONE} -- Access

    sequential_search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)
        deferred
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    back is
            -- Move to previous position.
        require
            not_before: not before
        deferred
        end

    before: BOOLEAN is
            -- Is there no valid position to the left of current one?
        deferred
        end

    finish is
            -- Move to last position.
            -- (from LINEAR)
        deferred
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        deferred
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if before and not is_empty then
                forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    start is
            -- Move to first position if any.
            -- (from TRAVERSABLE)
        deferred
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    not_both: not (after and before)
    before_constraint: before implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BILINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BILINEAR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures that may be traversed forward and backward"
    status: "See notice at end of class"
    names: bidirectional, traversing
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BILINEAR [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)

    off: BOOLEAN
            -- Is there no current item?

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
        require
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    not_both: not (after and before)
    before_constraint: before implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BILINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BILINEAR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    BILINEAR [G]

Ancestors
    LINEAR [G]
    LINEAR [G]

Descendants
    COMPARABLE_STRUCT [G -> COMPARABLE]
    SEQUENCE [G]

Clients
    BILINEAR [G]

Suppliers
    BILINEAR [G]
    BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BILINEAR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures that may be traversed forward and backward"
    status: "See notice at end of class"
    names: bidirectional, traversing
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    BILINEAR [G]

feature -- Access

    off: BOOLEAN
            -- Is there no current item?

feature -- Cursor movement

    before: BOOLEAN
            -- Is there no valid position to the left of current one?

    back
            -- Move to previous position.
        require
            not_before: not before

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)

invariant

    not_both: not (after and before)
    before_constraint: before implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BILINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.traversing

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


HIERARCHICAL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Hierarchical structures in which each item has zero or
        one immediate predecessor, and zero or more successors.
    ]"
    status: "See notice at end of class"
    names: hierarchical, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    HIERARCHICAL [G]

inherit
    TRAVERSABLE [G]

feature -- Access

    successor_count: INTEGER is
            -- Number of successors of current element
        require
            not_off: not off
        deferred
        end

feature -- Cursor movement

    up is
            -- Move to predecessor.
        require
            not_off: not off
        deferred
        end

    down (i: INTEGER) is
            -- Move to i-th successor.
        require
            not_off: not off
            argument_within_bounds: i >= 1 and i <= successor_count
        deferred
        end

invariant

    non_negative_successor_count: successor_count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HIERARCHICAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HIERARCHICAL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    HIERARCHICAL [G]

General
    cluster: base.structures.traversing
    description:
        "Hierarchical structures in which each item has zero or
        one immediate predecessor, and zero or more successors."

Ancestors
    TRAVERSABLE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    successor_count: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    start
    up

Constraints
    non negative successor count

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HIERARCHICAL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Hierarchical structures in which each item has zero or
        one immediate predecessor, and zero or more successors.
    ]"
    status: "See notice at end of class"
    names: hierarchical, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    HIERARCHICAL [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        deferred
        end

    successor_count: INTEGER is
            -- Number of successors of current element
        require
            not_off: not off
        deferred
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from TRAVERSABLE)
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    down (i: INTEGER) is
            -- Move to i-th successor.
        require
            not_off: not off
            argument_within_bounds: i >= 1 and i <= successor_count
        deferred
        end

    start is
            -- Move to first position if any.
            -- (from TRAVERSABLE)
        deferred
        end

    up is
            -- Move to predecessor.
        require
            not_off: not off
        deferred
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

invariant

    non_negative_successor_count: successor_count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HIERARCHICAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HIERARCHICAL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Hierarchical structures in which each item has zero or
        one immediate predecessor, and zero or more successors.
    ]"
    status: "See notice at end of class"
    names: hierarchical, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    HIERARCHICAL [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    successor_count: INTEGER
            -- Number of successors of current element
        require
            not_off: not off

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from TRAVERSABLE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    down (i: INTEGER)
            -- Move to i-th successor.
        require
            not_off: not off
            argument_within_bounds: i >= 1 and i <= successor_count

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

    up
            -- Move to predecessor.
        require
            not_off: not off

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_successor_count: successor_count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HIERARCHICAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HIERARCHICAL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    HIERARCHICAL [G]

Ancestors
    TRAVERSABLE [G]

Descendants
    CURSOR_TREE [G]

Clients
    HIERARCHICAL [G]

Suppliers
    BOOLEAN
    HIERARCHICAL [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HIERARCHICAL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Hierarchical structures in which each item has zero or
        one immediate predecessor, and zero or more successors.
    ]"
    status: "See notice at end of class"
    names: hierarchical, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    HIERARCHICAL [G]

feature -- Access

    successor_count: INTEGER
            -- Number of successors of current element
        require
            not_off: not off

feature -- Cursor movement

    up
            -- Move to predecessor.
        require
            not_off: not off

    down (i: INTEGER)
            -- Move to i-th successor.
        require
            not_off: not off
            argument_within_bounds: i >= 1 and i <= successor_count

invariant

    non_negative_successor_count: successor_count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HIERARCHICAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items may be accessed sequentially, one-way"
    status: "See notice at end of class"
    names: sequential, traversing
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    LINEAR [G]

inherit
    TRAVERSABLE [G]
        redefine
            do_all,
            do_if,
            there_exists,
            for_all
        end

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure
            non_negative_result: Result >= 0
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    index: INTEGER is
            -- Index of current position
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        end

feature -- Status report

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
        do
            Result := off
        ensure
            exhausted_when_off: off implies Result
        end

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
        deferred
        end

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := is_empty or after
        end

feature -- Cursor movement

    finish is
            -- Move to last position.
        deferred
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require
            not_after: not after
        deferred
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        do
            Result := Current
        end

invariant

    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    LINEAR [G]

General
    cluster: base.structures.traversing
    description: "Structures whose items may be accessed sequentially, one-way"

Ancestors
    TRAVERSABLE [G]

Queries
    after: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (v: [like item] G)
    start

Constraints
    after constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items may be accessed sequentially, one-way"
    status: "See notice at end of class"
    names: sequential, traversing
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    LINEAR [G]

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    index: INTEGER is
            -- Index of current position
        deferred
        end

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        deferred
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Status report

    after: BOOLEAN is
            -- Is there no valid position to the right of current one?
        deferred
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
        do
            Result := off
        ensure
            exhausted_when_off: off implies Result
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
        do
            Result := is_empty or after
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    finish is
            -- Move to last position.
        deferred
        end

    forth is
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require
            not_after: not after
        deferred
        end

    start is
            -- Move to first position if any.
            -- (from TRAVERSABLE)
        deferred
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        do
            Result := Current
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    after_constraint: after implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items may be accessed sequentially, one-way"
    status: "See notice at end of class"
    names: sequential, traversing
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    LINEAR [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            positive_occurrences: i > 0
        ensure
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
        ensure
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
        ensure
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    finish
            -- Move to last position.

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require
            not_after: not after

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    after_constraint: after implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    LINEAR [G]

Ancestors
    TRAVERSABLE [G]

Descendants
    BILINEAR [G]
    COUNTABLE_SEQUENCE [G]
    CURSOR_TREE [G]
    SORTED_STRUCT [G -> COMPARABLE]

Clients
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    COLLECTION [G]
    DIRECTORY
    LINEAR [G]
    LINEAR_ITERATOR [G]
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    STACK [G]
    TRAVERSABLE [G]
    TRAVERSABLE_SUBSET [G]

Suppliers
    ANY
    BOOLEAN
    CURSOR_STRUCTURE [G]
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    INTEGER
    LINEAR [G]
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    TUPLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINEAR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Structures whose items may be accessed sequentially, one-way"
    status: "See notice at end of class"
    names: sequential, traversing
    access: membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    LINEAR [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            positive_occurrences: i > 0
        ensure
            non_negative_result: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
        ensure
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    index: INTEGER
            -- Index of current position

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)

feature -- Status report

    exhausted: BOOLEAN
            -- Has structure been completely explored?
        ensure
            exhausted_when_off: off implies Result

    after: BOOLEAN
            -- Is there no valid position to the right of current one?

    off: BOOLEAN
            -- Is there no current item?

feature -- Cursor movement

    finish
            -- Move to last position.

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require
            not_after: not after

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

invariant

    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Structures for which there exists a traversal policy
        that will visit every element exactly once.
    ]"
    status: "See notice at end of class"
    names: traversable, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    TRAVERSABLE [G]

inherit
    CONTAINER [G]

feature -- Access

    item: G is
            -- Item at current position
        require
            not_off: not off
        deferred
        end

feature -- Status report

    off: BOOLEAN is
            -- Is there no current item?
        deferred
        end

feature -- Cursor movement

    start is
            -- Move to first position if any.
        deferred
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
        require
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
        require
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

invariant

    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TRAVERSABLE [G]

General
    cluster: base.structures.traversing
    description:
        "Structures for which there exists a traversal policy
        that will visit every element exactly once."

Ancestors
    CONTAINER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    start

Constraints
    empty constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Structures for which there exists a traversal policy
        that will visit every element exactly once.
    ]"
    status: "See notice at end of class"
    names: traversable, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class
    TRAVERSABLE [G]

feature -- Access

    has (v: G): BOOLEAN is
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        deferred
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G is
            -- Item at current position
        require
            not_off: not off
        deferred
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    is_empty: BOOLEAN is
            -- Is there no element?
            -- (from CONTAINER)
        deferred
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
        deferred
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    start is
            -- Move to first position if any.
        deferred
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from CONTAINER)
        deferred
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void
        do
            linear_representation.do_all (action)
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void
            test_exits: test /= void
        do
            linear_representation.do_if (action, test)
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
        require
            test_exits: test /= void
        do
            Result := linear_representation.for_all (test)
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
        require
            test_exits: test /= void
        do
            Result := linear_representation.there_exists (test)
        end

invariant

    empty_constraint: is_empty implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Structures for which there exists a traversal policy
        that will visit every element exactly once.
    ]"
    status: "See notice at end of class"
    names: traversable, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TRAVERSABLE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Item at current position
        require
            not_off: not off

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    start
            -- Move to first position if any.

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
        require
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
        require
            test_exits: test /= void

invariant

    empty_constraint: is_empty implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TRAVERSABLE [G]

Ancestors
    CONTAINER [G]

Descendants
    HIERARCHICAL [G]
    LINEAR [G]

Clients
    ITERATOR [G]
    TRAVERSABLE [G]

Suppliers
    BOOLEAN
    LINEAR [G]
    TRAVERSABLE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TRAVERSABLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Structures for which there exists a traversal policy
        that will visit every element exactly once.
    ]"
    status: "See notice at end of class"
    names: traversable, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TRAVERSABLE [G]

feature -- Access

    item: G
            -- Item at current position
        require
            not_off: not off

feature -- Status report

    off: BOOLEAN
            -- Is there no current item?

feature -- Cursor movement

    start
            -- Move to first position if any.

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
        require
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
        require
            test_exits: test /= void

invariant

    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.structures.tree

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.structures.tree	(diagram)

Supercluster
    base.structures

Classes
    ARRAYED_TREE [G]
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BINARY_TREE [G]
    DYNAMIC_TREE [G]
    FIXED_TREE [G]
    LINKED_TREE [G]
    TREE [G]
    TWO_WAY_TREE [G]

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees where the children of each node are kept in an array"
    status: "See notice at end of class"
    names: tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_TREE [G]

inherit
    CELL [G]
        undefine
            is_equal
        redefine
            copy
        end

    DYNAMIC_TREE [G]
        rename
            empty as al_empty
        export
            {NONE} al_empty
        undefine
            child_after,
            readable_child,
            writable_child,
            child_off,
            child_before
        redefine
            parent,
            attach_to_parent,
            duplicate,
            extend,
            duplicate_all,
            fill_subtree,
            copy
        select
            object_comparison,
            linear_representation,
            has
        end

    ARRAYED_LIST [ARRAYED_TREE [G]]
        rename
            make as al_make,
            item as child,
            i_th as array_item,
            last as last_child,
            first as first_child,
            search as search_child,
            has as al_has,
            readable as readable_child,
            extend as al_extend,
            extendible as al_extendible,
            put as al_put,
            replace as al_replace,
            fill as al_fill,
            writable as writable_child,
            remove as al_remove,
            remove_left as al_remove_left,
            remove_right as al_remove_right,
            linear_representation as al_lin_rep,
            count as arity,
            empty as al_empty,
            is_empty as is_leaf,
            full as al_full,
            start as child_start,
            finish as child_finish,
            forth as child_forth,
            back as child_back,
            go_i_th as child_go_i_th,
            index as child_index,
            off as child_off,
            after as child_after,
            before as child_before,
            isfirst as child_isfirst,
            islast as child_islast,
            cursor as child_cursor,
            go_to as child_go_to,
            duplicate as al_duplicate,
            put_left as al_put_left,
            put_right as al_put_right,
            merge_left as al_merge_left,
            merge_right as al_merge_right,
            object_comparison as al_object_comparison
        export
            {NONE} al_extend, al_duplicate, al_remove, al_make, al_put, al_replace, al_has, al_fill, al_full, al_empty, al_remove_left, al_remove_right, al_lin_rep, al_put_left, al_put_right, al_merge_left, al_merge_right, al_object_comparison
        undefine
            is_equal,
            is_leaf,
            child_isfirst,
            child_islast,
            valid_cursor_index,
            changeable_comparison_criterion,
            compare_objects,
            compare_references,
            al_empty
        redefine
            copy
        select
            is_leaf
        end

create
    make

feature -- Initialization

    make (n: INTEGER; v: G) is
            -- Create node with item v.
            -- Allocate space for n children.
        require
            valid_number_of_children: n >= 0
        do
            al_make (n)
            replace (v)
        ensure
            node_item: item = v
        end

feature -- Access

    parent: ARRAYED_TREE [G]
            -- Parent of current node

    left_sibling: like parent is
            -- Left neighbor if any
        do
            if position_in_parent > 1 then
                Result := parent.array_item (position_in_parent - 1)
            end
        end

    right_sibling: like parent is
            -- Right neighbor if any
        do
            if position_in_parent < parent.arity then
                Result := parent.array_item (position_in_parent + 1)
            end
        end

feature -- Element change

    child_put (v: like item) is
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_replace.
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        end

    child_replace (v: like item) is
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_put.
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        end

    replace_child (n: like parent) is
            -- Make n the node's current child.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_replace (n)
            n.attach_to_parent (Current)
        ensure then
            child_replaced: n.parent = Current
        end

    child_extend (v: like item) is
            -- Add v at end.
            -- Do not move child cursor.
        local
            n: like parent
        do
            n := new_cell (v)
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_extend (n)
        end

    child_put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        local
            n: like parent
        do
            n := new_cell (v)
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_left (n)
        end

    child_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        local
            n: like parent
        do
            n := new_cell (v)
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_right (n)
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_left (n)
            n.attach_to_parent (Current)
        end

    put_child_right (n: like parent) is
            -- Add n to the right of the cursor position.
            -- Do not move cursor.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_right (n)
            n.attach_to_parent (Current)
        end

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_extend (n)
            n.attach_to_parent (Current)
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        do
            attach (other)
            al_merge_left (other)
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        do
            attach (other)
            al_merge_right (other)
        end

feature -- Removal

    remove_child is
            -- Remove child at cursor position.
            -- Move cursor to the next sibling, or after if none.
        do
            child.attach_to_parent (void)
            al_remove
        end

    remove_left_child is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        do
            child_back
            remove_child
        end

    remove_right_child is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        do
            child_forth
            remove_child
            child_back
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        local
            counter: INTEGER
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
            until
                child_after or else (counter = n)
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

    copy (other: like Current) is
            -- Copy contents from other.
        local
            tmp_tree: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            create tmp_tree.make (other.arity, other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
            object_comparison := obj_comparison
        end

feature {NONE} -- Inapplicable

    extend (v: G) is
            -- Add v as new child.
        do
        end

feature {ARRAYED_TREE} -- Implementation

    new_node: like Current is
            -- A newly created instance of the same type,
            -- with the same arity and node value.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (arity, item)
        end

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
        local
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other
        local
            temp: like parent
        do
            from
                other.child_start
                child_start
            until
                child_after
            loop
                if other.child /= void then
                    create temp.make (other.arity, other.child_item)
                    temp.fill_subtree (other.child)
                end
                replace_child (temp)
                child_forth
                other.child_forth
            end
        end

    attach_to_parent (n: like parent) is
            -- Make n parent of current node;
        do
            parent := n
        end

feature {NONE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
        do
            create Result.make (0, item)
        end

    new_cell (v: like item): like Current is
            -- New node with value v and no children.
        do
            create Result.make (0, v)
            Result.attach_to_parent (Current)
        end

    position_in_parent: INTEGER is
            -- Position of current node in parent
        do
            if parent /= void then
                Result := parent.index_of (Current, 1)
            end
        end

    attach (other: like first_child) is
            -- Attach all children of other to current node.
            -- Put other in mode off.
        local
            c: like child
        do
            from
                other.child_start
            until
                other.child_off
            loop
                c := other.child
                other.child_forth
                c.attach_to_parent (Current)
            end
        end

feature {NONE} -- Not Applicable

    set_child (n: like parent) is
        do
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees where the children of each node are kept in an array"
    create: make

Ancestors
    ARRAYED_LIST [G]
    CELL [G]
    DYNAMIC_TREE [G]

Queries
    infix "@" (i: INTEGER): ARRAYED_TREE [G]
    Al_extendible: BOOLEAN
    arity: INTEGER
    array_item (i: INTEGER): ARRAYED_TREE [G]
    binary_representation: BINARY_TREE [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child: [like first] ARRAYED_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] ARRAYED_TREE [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first_child: ARRAYED_TREE [G]
    for_all (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] ARRAYED_TREE [G]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_TREE [G]): BOOLEAN
    is_inserted (v: ARRAYED_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] ARRAYED_TREE [G]): BOOLEAN
    item: G
    last_child: [like first] ARRAYED_TREE [G]
    left_sibling: [like parent] ARRAYED_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] ARRAYED_TREE [G]): INTEGER
    parent: ARRAYED_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like parent] ARRAYED_TREE [G]
    sequential_occurrences (v: ARRAYED_TREE [G]): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [ARRAYED_TREE [G]])
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]])
    do_if (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN])
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    force (v: [like item] ARRAYED_TREE [G])
    make (n: INTEGER; v: G)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [ARRAYED_TREE [G]])
    merge_tree_after (other: [like first_child] ARRAYED_TREE [G])
    merge_tree_before (other: [like first_child] ARRAYED_TREE [G])
    move (i: INTEGER)
    prune (v: [like item] ARRAYED_TREE [G])
    prune_all (v: [like item] ARRAYED_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] ARRAYED_TREE [G])
    put_child_left (n: [like parent] ARRAYED_TREE [G])
    put_child_right (n: [like parent] ARRAYED_TREE [G])
    put_front (v: [like item] ARRAYED_TREE [G])
    put_i_th (v: [like item] ARRAYED_TREE [G]; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] ARRAYED_TREE [G])
    search_child (v: [like item] ARRAYED_TREE [G])
    sprout
    swap (i: INTEGER)
    wipe_out

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees where the children of each node are kept in an array"
    status: "See notice at end of class"
    names: tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    ARRAYED_TREE [G]

create
    make

feature -- Initialization

    make (n: INTEGER; v: G) is
            -- Create node with item v.
            -- Allocate space for n children.
        require
            valid_number_of_children: n >= 0
        do
            al_make (n)
            replace (v)
        ensure
            node_item: item = v
        end

    make_filled (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        do
            child_index := 0
            arity := n
            array_make (1, n)
        ensure -- from ARRAYED_LIST
            correct_position: child_before
            filled: al_full
        end

    make_from_array (a: ARRAY [ARRAYED_TREE [G]]) is
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void
        do
            Precursor  (a)
            lower := 1
            arity := a.count
            upper := arity
            child_index := 0
        end

feature {NONE} -- Initialization

    al_make (n: INTEGER) is
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        do
            child_index := 0
            arity := 0
            array_make (1, n)
        ensure -- from ARRAYED_LIST
            correct_position: child_before
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature {ARRAYED_LIST} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

feature -- Access

    child_item: like item is
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable
        do
            Result := child.item
        end

    child_cursor: CURSOR is
            -- Current cursor position
            -- (from ARRAYED_LIST)
        do
            create {ARRAYED_LIST_CURSOR} Result.make (child_index)
        end

    first_child: ARRAYED_TREE [G] is
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := area.item (0)
        end

    child_index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like child; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_index_of (v, i)
            child_go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G
            -- Content of cell.
            -- (from CELL)

    child: like first_child is
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: readable_child
        require -- from TREE
            readable: readable_child
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (child_index)
        do
            Result := area.item (child_index - 1)
        end

    array_item (i: INTEGER): ARRAYED_TREE [G] is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

    last_child: like first_child is
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := area.item (arity - 1)
        end

    left_sibling: like parent is
            -- Left neighbor if any
        require -- from TREE
            is_not_root: not is_root
        do
            if position_in_parent > 1 then
                Result := parent.array_item (position_in_parent - 1)
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    sequential_occurrences (v: ARRAYED_TREE [G]): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                child_start
                search_child (v)
            until
                exhausted
            loop
                Result := Result + 1
                child_forth
                search_child (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent: ARRAYED_TREE [G]
            -- Parent of current node

    right_sibling: like parent is
            -- Right neighbor if any
        require -- from TREE
            is_not_root: not is_root
        do
            if position_in_parent < parent.arity then
                Result := parent.array_item (position_in_parent + 1)
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)
        end

    infix "@" (i: INTEGER): ARRAYED_TREE [G] is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature {NONE} -- Access

    area: SPECIAL [ARRAYED_TREE [G]]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): ARRAYED_TREE [G] is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            Result := array_item (i)
        end

    al_has (v: ARRAYED_TREE [G]): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (array_item (i) /= void and then array_item (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (array_item (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    sequential_has (v: like child): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            child_start
            if not child_off then
                search_child (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    sequential_index_of (v: like child; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child /= void and then v.is_equal (child) then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            else
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child = v then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like child) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (child /= void and then v.is_equal (child))
                loop
                    child_forth
                end
            else
                from
                until
                    exhausted or else v = child
                loop
                    child_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child
        end

feature -- Measurement

    child_capacity: INTEGER is
            -- Maximal number of children
            -- (from TREE)
        do
            Result := arity
        end

    count: INTEGER is
            -- Number of items
            -- (from TREE)
        do
            Result := subtree_count + 1
        end

    arity: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, arity)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity
        end

    occurrences (v: like child): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_occurrences (v)
            child_go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like child): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_occurrences (v)
            child_go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    array_count: INTEGER is
            -- Number of available indices
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    array_index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = arity
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature  -- Measurement

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_leaf = other.is_leaf) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_leaf then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity
        end

feature -- Status report

    child_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (child_index = arity + 1)
        end

    child_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (child_index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = 1
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = child_capacity
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := child_off
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Al_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
            -- (from TREE)
        do
            Result := False
        end

    is_inserted (v: ARRAYED_TREE [G]): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)
        do
            check
                put_constraint: (v /= last_child) implies not child_off
            end
            Result := (v = last_child) or else (v = child)
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- (from TREE)
        do
            Result := arity = 0
        end

    is_root: BOOLEAN is
            -- Is there no parent?
            -- (from TREE)
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (child_index = 0) or (child_index = arity + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)
        do
            Result := True
        end

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not child_off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            if al_c /= void then
                Result := valid_cursor_index (al_c.index)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        do
            Result := (1 <= i) and (i <= arity)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        do
            Result := (1 <= i) and (i <= arity)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not child_off
        end

feature {NONE} -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (arity = 0 or else ((array_item (upper) = void or else array_item (upper) = array_item (upper).default) and subarray (lower, upper - 1).all_default))
        end

    al_empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_leaf
        end

    al_full: BOOLEAN is
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)
        do
            Result := (arity = capacity)
        end

    al_object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    resizable: BOOLEAN is
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)
        do
            Result := True
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if arity = other.arity then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((arity = other.arity) and then (arity = 0 or else (array_item (upper) = other.array_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    array_valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = arity
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before
        do
            child_index := child_index - 1
        end

    child_finish is
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        do
            child_index := arity
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_leaf implies child_before
        end

    child_forth is
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        do
            child_index := child_index + 1
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        do
            child_index := i
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i
        end

    child_go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            al_c: ARRAYED_LIST_CURSOR
        do
            al_c ?= p
            check
                al_c /= void
            end
            child_index := al_c.index
        end

    move (i: INTEGER) is
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        do
            child_index := child_index + i
            if (child_index > arity + 1) then
                child_index := arity + 1
            elseif (child_index < 0) then
                child_index := 0
            end
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        end

    search_child (v: like child) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if child_before and not is_leaf then
                child_forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child
        end

    child_start is
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        do
            child_index := 1
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_leaf implies child_after
        end

feature -- Element change

    append (s: SEQUENCE [ARRAYED_TREE [G]]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                al_extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: arity >= old arity
        end

    child_extend (v: like item) is
            -- Add v at end.
            -- Do not move child cursor.
        local
            n: like parent
        do
            n := new_cell (v)
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_extend (n)
        end

    child_put (v: like item) is
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        ensure -- from TREE
            item_inserted: child_item = v
        end

    child_put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        local
            n: like parent
        do
            n := new_cell (v)
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_left (n)
        end

    child_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        local
            n: like parent
        do
            n := new_cell (v)
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_right (n)
        end

    child_replace (v: like item) is
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        ensure -- from TREE
            item_inserted: child_item = v
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)
        do
            replace (other.item)
            fill_subtree (other)
        end

    force (v: like child) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: al_extendible
        do
            arity := arity + 1
            force_i_th (v, arity)
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        do
            attach (other)
            al_merge_right (other)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        do
            attach (other)
            al_merge_left (other)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf
        end

    put_i_th (v: like array_item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: array_item (k) = v
        end

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_extend (n)
            n.attach_to_parent (Current)
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_left (n)
            n.attach_to_parent (Current)
        end

    put_child_right (n: like parent) is
            -- Add n to the right of the cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_put_right (n)
            n.attach_to_parent (Current)
        end

    put_front (v: like child) is
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        do
            if is_leaf then
                al_extend (v)
            else
                insert (v, 1)
            end
            child_index := child_index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first_child = v
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    replace_child (n: like parent) is
            -- Make n the node's current child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            al_replace (n)
            n.attach_to_parent (Current)
        ensure -- from TREE
            child_replaced: child = n
        ensure then
            child_replaced: n.parent = Current
        end

    sprout is
            -- Make current node a root.
            -- (from TREE)
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature {NONE} -- Element change

    enter (v: like array_item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: array_valid_index (i)
        do
            area.put (v, i - lower)
        end

    al_extend (v: like child) is
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: al_extendible
        do
            arity := arity + 1
            force_i_th (v, arity)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    al_fill (other: CONTAINER [ARRAYED_TREE [G]]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            al_extendible
        local
            lin_rep: LINEAR [ARRAYED_TREE [G]]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not al_extendible or else lin_rep.off
            loop
                al_extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force_i_th (v: like array_item; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: array_item (i) = v
            higher_count: arity >= old arity
        end

    al_merge_left (other: ARRAYED_LIST [ARRAYED_TREE [G]]) is
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: al_extendible
            not_before: not child_before
            other_exists: other /= void
        local
            old_index: INTEGER
            old_other_count: INTEGER
        do
            old_index := child_index
            old_other_count := other.count
            child_index := child_index - 1
            al_merge_right (other)
            child_index := old_index + old_other_count
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.count
            new_index: child_index = old child_index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    al_merge_right (other: ARRAYED_LIST [ARRAYED_TREE [G]]) is
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: al_extendible
            not_after: not child_after
            other_exists: other /= void
        do
            if not other.is_empty then
                resize (1, arity + other.count)
                if child_index < arity then
                    subcopy (Current, child_index + 1, arity, child_index + other.count + 1)
                end
                subcopy (other, 1, other.count, child_index + 1)
                arity := arity + other.count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.count
            same_index: child_index = old child_index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty
        end

    al_put (v: like child) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: al_extendible
        do
            al_replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: arity = old arity
        end

    sequence_put (v: like child) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: al_extendible
        do
            al_extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
        end

    al_put_left (v: like child) is
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: al_extendible
            not_before: not child_before
        do
            if child_after or is_leaf then
                al_extend (v)
            else
                insert (v, child_index)
            end
            child_index := child_index + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        end

    al_put_right (v: like child) is
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: al_extendible
            not_after: not child_after
        do
            if child_index = arity then
                al_extend (v)
            else
                insert (v, child_index + 1)
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        end

    al_replace (v: like first_child) is
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable_child
        do
            put_i_th (v, child_index)
        ensure -- from ACTIVE
            item_replaced: child = v
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature {ARRAYED_LIST} -- Element change

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.array_valid_index (start_pos)
            valid_end_pos: other.array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: array_valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    prune (v: like child) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable
        require -- from TREE
            is_child: n.parent = Current
        do
            if child_before then
                child_index := 1
            end
            if object_comparison then
                if v /= void then
                    from
                    until
                        child_after or else (child /= void and then v.is_equal (child))
                    loop
                        child_forth
                    end
                end
            else
                from
                until
                    child_after or else child = v
                loop
                    child_forth
                end
            end
            if not child_after then
                al_remove
            end
        ensure -- from TREE
            n_is_root: n.is_root
        end

    prune_all (v: like child) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        local
            i: INTEGER
            offset: INTEGER
            res: BOOLEAN
            obj_cmp: BOOLEAN
            default_val: like child
        do
            obj_cmp := object_comparison
            from
                i := 1
            until
                i > arity
            loop
                if i <= arity - offset then
                    if offset > 0 then
                        put_i_th (array_item (i + offset), i)
                    end
                    if obj_cmp then
                        res := equal (v, array_item (i))
                    else
                        res := (v = array_item (i))
                    end
                    if res then
                        offset := offset + 1
                    else
                        i := i + 1
                    end
                else
                    put_i_th (default_val, i)
                    i := i + 1
                end
            end
            arity := arity - offset
            child_index := arity + 1
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: child_after
        end

    remove_child is
            -- Remove child at cursor position.
            -- Move cursor to the next sibling, or after if none.
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        do
            child.attach_to_parent (void)
            al_remove
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    remove_left_child is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        do
            child_back
            remove_child
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1
        end

    remove_right_child is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        do
            child_forth
            remove_child
            child_back
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    wipe_out is
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        do
            arity := 0
            child_index := 0
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    al_remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable_child
        local
            default_value: ARRAYED_TREE [G]
        do
            if child_index < arity then
                subcopy (Current, child_index + 1, arity, child_index)
            end
            arity := arity - 1
            area.put (default_value, arity)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure then -- from ARRAYED_LIST
            index: child_index = old child_index
        end

    al_remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        do
            child_index := child_index - 1
            al_remove
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        end

    al_remove_right is
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        do
            child_index := child_index + 1
            al_remove
            child_index := child_index - 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                child_start
            until
                is_leaf
            loop
                al_remove
            end
        ensure -- from COLLECTION
            wiped_out: is_leaf
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not child_off
            valid_index: array_valid_index (i)
        local
            old_item: like child
        do
            old_item := child
            al_replace (area.item (i - 1))
            area.put (old_item, i - 1)
        ensure -- from CHAIN
            swapped_to_item: child = old array_item (i)
            swapped_from_item: array_item (i) = old child
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    fill_from_binary (b: BINARY_TREE [G]) is
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)
        local
            current_node: BINARY_TREE [G]
        do
            replace (b.item)
            wipe_out
            if b.has_left then
                from
                    current_node := b.left_child
                until
                    current_node = void
                loop
                    child_put_right (current_node.item)
                    child_forth
                    child.fill_from_binary (current_node)
                    current_node := current_node.right_child
                end
            end
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from TREE)
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature {NONE} -- Conversion

    al_lin_rep: LINEAR [ARRAYED_TREE [G]] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            tmp_tree: like Current
            obj_comparison: BOOLEAN
        do
            obj_comparison := other.object_comparison
            create tmp_tree.make (other.arity, other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
            object_comparison := obj_comparison
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0
        local
            counter: INTEGER
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
            until
                child_after or else (counter = n)
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {NONE} -- Duplication

    al_duplicate (n: INTEGER): like Current is
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: child_off implies child_after
            valid_subchain: n >= 0
        local
            end_pos: INTEGER
        do
            if child_after then
                create Result.al_make (0)
            else
                end_pos := arity.min (child_index + n - 1)
                create Result.make_filled (end_pos - child_index + 1)
                Result.subcopy (Current, child_index, end_pos, 1)
            end
        end

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: array_valid_index (start_pos)
            valid_end_pos: array_valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: ARRAYED_TREE [G]) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: al_extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    extend (v: G) is
            -- Add v as new child.
        do
        end

    new_chain: like Current is
            -- Unused
            -- (from ARRAYED_LIST)
        do
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

feature {ARRAYED_TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node;
        do
            parent := n
        ensure -- from TREE
            new_parent: parent = n
        end

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
        local
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other
        local
            temp: like parent
        do
            from
                other.child_start
                child_start
            until
                child_after
            loop
                if other.child /= void then
                    create temp.make (other.arity, other.child_item)
                    temp.fill_subtree (other.child)
                end
                replace_child (temp)
                child_forth
                other.child_forth
            end
        end

    new_node: like Current is
            -- A newly created instance of the same type,
            -- with the same arity and node value.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (arity, item)
        end

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    attach (other: like first_child) is
            -- Attach all children of other to current node.
            -- Put other in mode off.
        local
            c: like child
        do
            from
                other.child_start
            until
                other.child_off
            loop
                c := other.child
                other.child_forth
                c.attach_to_parent (Current)
            end
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    child_remove is
            -- Remove item of current child
            -- (from TREE)
        do
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    insert (v: like child; pos: INTEGER) is
            -- Add v at pos, moving subsequent items
            -- to the right.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            index_small_enough: pos <= arity
            index_large_enough: pos >= 1
        do
            if arity + 1 > capacity then
                auto_resize (lower, arity + 1)
            end
            arity := arity + 1
            subcopy (Current, pos, arity - 1, pos + 1)
            enter (v, pos)
        ensure -- from ARRAYED_LIST
            new_count: arity = old arity + 1
            index_unchanged: child_index = old child_index
            insertion_done: array_item (pos) = v
        end

    new_cell (v: like item): like Current is
            -- New node with value v and no children.
        do
            create Result.make (0, v)
            Result.attach_to_parent (Current)
        end

    new_tree: like Current is
            -- A newly created instance of the same type.
        do
            create Result.make (0, item)
        ensure -- from DYNAMIC_TREE
            result_exists: Result /= void
            result_item: Result.item = item
        end

    position_in_parent: INTEGER is
            -- Position of current node in parent
        do
            if parent /= void then
                Result := parent.index_of (Current, 1)
            end
        end

    remove is
            -- Remove current item
            -- (from TREE)
        do
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
            -- (from TREE)
        require -- from TREE
            other_not_empty: other /= void and then not other.is_leaf
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
            -- (from TREE)
        require -- from TREE
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_leaf and not t2.is_leaf
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

feature {TREE} -- Implementation

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
            -- (from TREE)
        do
            from
                child_start
            until
                child_off
            loop
                if child /= void then
                    al.extend (child_item)
                    child.fill_list (al)
                end
                child_forth
            end
        end

    subtree_count: INTEGER is
            -- Number of items in children
            -- (from TREE)
        local
            pos: CURSOR
        do
            Result := arity
            from
                pos := child_cursor
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result := Result + child.subtree_count
                end
                child_forth
            end
            child_go_to (pos)
        end

    subtree_has (v: G): BOOLEAN is
            -- Do children include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        local
            cursor: CURSOR
        do
            cursor := child_cursor
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    if object_comparison then
                        Result := (v /= void) and then (child_item /= void) and then v.is_equal (child_item)
                    else
                        Result := v = child_item
                    end
                end
                child_forth
            end
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    Result := child.subtree_has (v)
                end
                child_forth
            end
            child_go_to (cursor)
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [ARRAYED_TREE [G]]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child, 1)
                action.call (t)
                child_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [ARRAYED_TREE [G]]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child, 1)
                if test.item (t) then
                    action.call (t)
                end
                child_forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [ARRAYED_TREE [G]]
            c: CURSOR
            t: TUPLE [ARRAYED_TREE [G]]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
                Result := True
            until
                child_after or not Result
            loop
                t.put (child, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [ARRAYED_TREE [G]]
            c: CURSOR
            t: TUPLE [ARRAYED_TREE [G]]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
            until
                child_after or Result
            loop
                t.put (child, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

feature {NONE} -- Not Applicable

    set_child (n: like parent) is
        require -- from DYNAMIC_TREE
            non_void_argument: n /= void
        do
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_leaf implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: arity >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + arity - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: arity <= capacity
    full_definition: al_full = (arity = capacity)
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child = array_item (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: writable_child implies readable_child
    empty_constraint: is_leaf implies (not readable_child) and (not writable_child)
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from DYNAMIC_CHAIN
    extendible: al_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees where the children of each node are kept in an array"
    status: "See notice at end of class"
    names: tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_TREE [G]

create

    make (n: INTEGER; v: G)
            -- Create node with item v.
            -- Allocate space for n children.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v

feature -- Initialization

    make (n: INTEGER; v: G)
            -- Create node with item v.
            -- Allocate space for n children.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: child_before
            filled: al_full

    make_from_array (a: ARRAY [ARRAYED_TREE [G]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    child_cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    first_child: ARRAYED_TREE [G]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    child_index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like child; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Content of cell.
            -- (from CELL)

    child: like first_child
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: readable_child
        require -- from TREE
            readable: readable_child
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (child_index)

    array_item (i: INTEGER): ARRAYED_TREE [G]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last_child: like first_child
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    sequential_occurrences (v: ARRAYED_TREE [G]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: ARRAYED_TREE [G]
            -- Parent of current node

    right_sibling: like parent
            -- Right neighbor if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

    infix "@" (i: INTEGER): ARRAYED_TREE [G]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Al_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: ARRAYED_TREE [G]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_leaf implies child_before

    child_forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)

    search_child (v: like child)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child

    child_start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [ARRAYED_TREE [G]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    child_extend (v: like item)
            -- Add v at end.
            -- Do not move child cursor.

    child_put (v: like item)
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before

    child_put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after

    child_replace (v: like item)
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: al_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    put_i_th (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: array_item (k) = v

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of the cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first_child = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Make n the node's current child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n
        ensure then
            child_replaced: n.parent = Current

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    prune (v: like child)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    prune_all (v: like child)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: child_after

    remove_child
            -- Remove child at cursor position.
            -- Move cursor to the next sibling, or after if none.
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not child_off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child = old array_item (i)
            swapped_from_item: array_item (i) = old child

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_leaf implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: arity >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + arity - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: arity <= capacity
    full_definition: al_full = (arity = capacity)
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child = array_item (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: writable_child implies readable_child
    empty_constraint: is_leaf implies (not readable_child) and (not writable_child)
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from DYNAMIC_CHAIN
    extendible: al_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ARRAYED_TREE [G]

Ancestors
    ARRAYED_LIST [G]
    CELL [G]
    DYNAMIC_TREE [G]

Clients
    ARRAYED_TREE [G]

Suppliers
    ARRAYED_TREE [G]
    BOOLEAN
    INTEGER
    TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ARRAYED_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees where the children of each node are kept in an array"
    status: "See notice at end of class"
    names: tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    ARRAYED_TREE [G]

create
    make

feature -- Initialization

    make (n: INTEGER; v: G)
            -- Create node with item v.
            -- Allocate space for n children.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v

feature -- Access

    parent: ARRAYED_TREE [G]
            -- Parent of current node

    left_sibling: like parent
            -- Left neighbor if any

    right_sibling: like parent
            -- Right neighbor if any

feature -- Element change

    child_put (v: like item)
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_replace.

    child_replace (v: like item)
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_put.

    replace_child (n: like parent)
            -- Make n the node's current child.
        ensure then
            child_replaced: n.parent = Current

    child_extend (v: like item)
            -- Add v at end.
            -- Do not move child cursor.

    child_put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move child cursor.

    child_put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move child cursor.

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.

    put_child_right (n: like parent)
            -- Add n to the right of the cursor position.
            -- Do not move cursor.

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.

feature -- Removal

    remove_child
            -- Remove child at cursor position.
            -- Move cursor to the next sibling, or after if none.

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.

    copy (other: like Current)
            -- Copy contents from other.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Binary search trees; left child item is less than current item,
        right child item is greater
    ]"
    status: "See notice at end of class"
    names: binary_search_tree, tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    BINARY_SEARCH_TREE [G -> COMPARABLE]

inherit
    BINARY_TREE [G]
        rename
            make as bt_make,
            put as bt_put
        export
            {BINARY_SEARCH_TREE} put_left_child, put_right_child, remove_left_child, remove_right_child
        redefine
            parent,
            has
        end

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create single node with item v.
        require
            item_exists: v /= void
        do
            bt_make (v)
        ensure
            node_item: item = v
            no_child: (left_child = void) and (right_child = void)
        end

feature -- Access

    parent: BINARY_SEARCH_TREE [G]
            -- Parent of current node

    has (v: like item): BOOLEAN is
            -- Does tree contain a node whose item
            -- is equal to v (object comparison)?
        require else
            argument_not_void: v /= void
        do
            if items_equal (item, v) then
                Result := True
            elseif v < item then
                if left_child /= void then
                    set_comparison_mode (left_child);
                    Result := left_child.has (v)
                end
            else
                if right_child /= void then
                    set_comparison_mode (right_child)
                    Result := right_child.has (v)
                end
            end
        end

feature -- Measurement

    min: like item is
            -- Minimum item in tree
        do
            if has_left then
                Result := left_child.min
            else
                Result := item
            end
        ensure
            minimum_present: has (Result)
        end

    max: like item is
            -- Maximum item in tree
        do
            if has_right then
                Result := right_child.max
            else
                Result := item
            end
        ensure
            maximum_present: has (Result)
        end

feature -- Status report

    sorted: BOOLEAN is
            -- Is tree sorted?
        do
            Result := True
            if (has_left and then left_item > item) or (has_right and then right_item < item) then
                Result := False
            else
                if has_left then
                    Result := left_child.sorted_and_less (item)
                end
                if has_right and Result then
                    Result := right_child.sorted
                end
            end
        end

    sorted_and_less (i: like item): BOOLEAN is
            -- Is tree sorted and all its elements less then i
        do
            Result := True
            if (has_left and then left_item > item) or (has_right and then right_item < item) then
                Result := False
            else
                if has_left then
                    Result := left_child.sorted_and_less (item)
                end
                if has_right and Result then
                    Result := right_child.sorted_and_less (i)
                end
            end
        end

feature -- Cursor movement

    node_action (v: like item) is
            -- Operation on node item,
            -- to be defined by descendant classes.
            -- Here it is defined as an empty operation.
            -- Redefine this procedure in descendant classes if useful
            -- operations are to be performed during traversals.
        do
        end

    preorder is
            -- Apply node_action to every node's item
            -- in tree, using pre-order.
        do
            node_action (item)
            if left_child /= void then
                left_child.preorder
            end
            if right_child /= void then
                right_child.preorder
            end
        end

    i_infix is
            -- Apply node_action to every node's item
            -- in tree, using infix order.
        do
            if left_child /= void then
                left_child.i_infix
            end
            node_action (item)
            if right_child /= void then
                right_child.i_infix
            end
        end

    postorder is
            -- Apply node_action to every node's item
            -- in tree, using post-order.
        do
            if left_child /= void then
                left_child.postorder
            end
            if right_child /= void then
                right_child.postorder
            end
            node_action (item)
        end

feature -- Element change

    put (v: like item) is
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of extend.
        require
            new_item_exists: v /= void
        do
            if not items_equal (v, item) then
                if v < item then
                    if left_child = void then
                        put_left_child (new_tree)
                        left_child.replace (v)
                    else
                        left_child.put (v)
                    end
                else
                    if right_child = void then
                        put_right_child (new_tree)
                        right_child.replace (v)
                    else
                        right_child.put (v)
                    end
                end
            end
        ensure
            item_inserted: has (v)
        end

    extend (v: like item) is
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of put.
        require
            new_item_exists: v /= void
        do
            if not items_equal (v, item) then
                if v < item then
                    if left_child = void then
                        put_left_child (new_tree)
                        left_child.replace (v)
                    else
                        left_child.put (v)
                    end
                else
                    if right_child = void then
                        put_right_child (new_tree)
                        right_child.replace (v)
                    else
                        right_child.put (v)
                    end
                end
            end
        ensure
            item_inserted: has (v)
        end

feature -- Transformation

    sort is
            -- Sort tree.
        local
            seq: LINEAR [G]
            temp: ARRAY [G]
            heap: HEAP_PRIORITY_QUEUE [G]
            i: INTEGER
        do
            seq := linear_representation
            i := count
            remove_left_child
            remove_right_child
            from
                seq.start
                create heap.make (i)
            until
                seq.off
            loop
                heap.put (seq.item)
                seq.forth
            end
            from
                create temp.make (1, heap.count)
                i := 1
            until
                heap.is_empty
            loop
                temp.put (heap.item, i)
                heap.remove
                i := i + 1
            end
            replace (temp.item ((temp.count) // 2 + 1))
            fill_from_sorted_special (temp.area, 0, temp.count - 1)
        ensure
            is_sorted: sorted
        end

feature {BINARY_SEARCH_TREE, BINARY_SEARCH_TREE_SET} -- Implementation

    is_subset (other: like Current): BOOLEAN is
            -- Is Current a subset of other
        do
            Result := other.has (item)
            if Result and left_child /= void then
                Result := left_child.is_subset (other)
            end
            if Result and right_child /= void then
                Result := right_child.is_subset (other)
            end
        end

    intersect (other: BINARY_SEARCH_TREE [G]) is
            -- Remove all items not in other.
        do
            if right_child /= void then
                right_child.intersect (other)
            end
            if left_child /= void then
                left_child.intersect (other)
            end
            if not other.has (item) then
                remove_node
            end
        end

    subtract (other: BINARY_SEARCH_TREE [G]) is
            -- Remove all items also in other.
        require
            set_exists: other /= void
        do
            if right_child /= void then
                right_child.subtract (other)
            end
            if left_child /= void then
                left_child.subtract (other)
            end
            if other.has (item) then
                remove_node
            end
        end

    merge (other: like Current) is
            -- Add all items of other.
        do
            if other.right_child /= void then
                merge (other.right_child)
            end
            if other.left_child /= void then
                merge (other.left_child)
            end
            extend (other.item)
        end

    remove_node is
            -- Remove current node from the tree.
        require
            is_not_root: not is_root
        local
            is_left_child: BOOLEAN
            m: like Current
        do
            is_left_child := Current = parent.left_child
            if not has_right then
                if left_child /= void then
                    left_child.attach_to_parent (void)
                end
                if is_left_child then
                    parent.put_left_child (left_child)
                else
                    parent.put_right_child (left_child)
                end
                parent := void
            elseif not has_left then
                if right_child /= void then
                    right_child.attach_to_parent (void)
                end;
                if is_left_child then
                    parent.put_left_child (right_child)
                else
                    parent.put_right_child (right_child)
                end;
                parent := void
            else
                m := right_child.min_node
                m.remove_node
                item := m.item
            end
        end

    pruned (v: like item; par: like Current): like Current is
            -- Prune v.
            -- (par is the parent node of the current node, needed to update
            -- parent correctly.)
        local
            m: like Current
        do
            if items_equal (item, v) then
                if has_none then
                elseif not has_right then
                    left_child.attach_to_parent (par);
                    Result := left_child
                elseif not has_left then
                    right_child.attach_to_parent (par);
                    Result := right_child
                else
                    m := right_child.min_node
                    m.remove_node
                    item := m.item
                    Result := Current
                end
            else
                Result := Current
                if v < item then
                    if left_child /= void then
                        left_child := left_child.pruned (v, Current)
                    end
                else
                    if right_child /= void then
                        right_child := right_child.pruned (v, Current)
                    end
                end
            end
        end

    min_node: like Current is
            -- Node containing min
        do
            if has_left then
                Result := left_child.min_node
            else
                Result := Current
            end
        end

    max_node: like Current is
            -- Node containing max
        do
            if has_right then
                Result := right_child.min_node
            else
                Result := Current
            end
        end

feature {NONE} -- Implementation

    fill_from_sorted_special (t: SPECIAL [G]; s, e: INTEGER) is
            -- Put values from t into tree in such an order that
            -- the tree will be balanced if t is sorted.
        local
            m: INTEGER
        do
            m := (s + e) // 2
            put (t.item (m))
            if m - 1 >= s then
                fill_from_sorted_special (t, s, m - 1)
            end
            if m + 1 <= e then
                fill_from_sorted_special (t, m + 1, e)
            end
        end

    items_equal (src, dest: like item): BOOLEAN is
            -- Are src and dest equal?
            -- (depending on object_comparison)
        do
            if object_comparison then
                Result := src /= void and then src.is_equal (dest)
            else
                Result := (src = dest)
            end
        end

    set_comparison_mode (t: like Current) is
            -- Set comparison mode of t to the same mode as Current.
        require
            not_void: t /= void
        do
            if object_comparison then
                t.compare_objects
            else
                t.compare_references
            end
        ensure
            mode_set: object_comparison = t.object_comparison
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BINARY_SEARCH_TREE [G -> COMPARABLE]

General
    cluster: base.structures.tree
    description:
        "Binary search trees; left child item is less than current item,
        right child item is greater"
    create: make

Ancestors
    BINARY_TREE [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] BINARY_SEARCH_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] BINARY_SEARCH_TREE [G]
    duplicate_all: [like Current] BINARY_SEARCH_TREE [G]
    first_child: [like parent] BINARY_SEARCH_TREE [G]
    has (v: [like item] G): BOOLEAN
    has_both: BOOLEAN
    has_left: BOOLEAN
    has_none: BOOLEAN
    has_right: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] BINARY_SEARCH_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] BINARY_SEARCH_TREE [G]): BOOLEAN
    item: G
    last_child: [like parent] BINARY_SEARCH_TREE [G]
    left_child: [like parent] BINARY_SEARCH_TREE [G]
    left_item: [like item] G
    left_sibling: [like parent] BINARY_SEARCH_TREE [G]
    linear_representation: LINEAR [G]
    max: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    parent: BINARY_SEARCH_TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_child: [like parent] BINARY_SEARCH_TREE [G]
    right_item: [like item] G
    right_sibling: [like parent] BINARY_SEARCH_TREE [G]
    sorted: BOOLEAN
    sorted_and_less (i: [like item] G): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    bt_make (v: [like item] G)
    bt_put (v: [like item] G)
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: ARRAYED_LIST_CURSOR)
    child_put (v: [like item] G)
    child_remove
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] BINARY_SEARCH_TREE [G])
    extend (v: [like item] G)
    fill (other: TREE [G])
    i_infix
    make (v: [like item] G)
    node_action (v: [like item] G)
    postorder
    preorder
    prune (n: [like parent] BINARY_SEARCH_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] BINARY_SEARCH_TREE [G])
    replace (v: [like item] G)
    replace_child (n: [like parent] BINARY_SEARCH_TREE [G])
    sort
    sprout

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Binary search trees; left child item is less than current item,
        right child item is greater
    ]"
    status: "See notice at end of class"
    names: binary_search_tree, tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    BINARY_SEARCH_TREE [G -> COMPARABLE]

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create single node with item v.
        require
            item_exists: v /= void
        do
            bt_make (v)
        ensure
            node_item: item = v
            no_child: (left_child = void) and (right_child = void)
        end

    bt_make (v: like item) is
            -- Create a root node with value v.
            -- (from BINARY_TREE)
        do
            item := v
        ensure -- from BINARY_TREE
            is_root: is_root
            is_leaf: is_leaf
        end

feature -- Access

    child: like parent is
            -- Child at cursor position
            -- (from BINARY_TREE)
        require -- from TREE
            readable: readable_child
        do
            inspect child_index
            when 1 then
                Result := left_child
            when 2 then
                Result := right_child
            end
        end

    child_cursor: CURSOR is
            -- Current cursor position
            -- (from BINARY_TREE)
        do
            create {ARRAYED_LIST_CURSOR} Result.make (child_index)
        end

    child_index: INTEGER
            -- Index of cursor position
            -- (from BINARY_TREE)

    child_item: like item is
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable
        do
            Result := child.item
        end

    first_child: like parent is
            -- Left child
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := left_child
        end

    has (v: like item): BOOLEAN is
            -- Does tree contain a node whose item
            -- is equal to v (object comparison)?
        require -- from  CONTAINER
            True
        require else
            argument_not_void: v /= void
        do
            if items_equal (item, v) then
                Result := True
            elseif v < item then
                if left_child /= void then
                    set_comparison_mode (left_child);
                    Result := left_child.has (v)
                end
            else
                if right_child /= void then
                    set_comparison_mode (right_child)
                    Result := right_child.has (v)
                end
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: G
            -- Content of cell.
            -- (from CELL)

    last_child: like parent is
            -- Right child
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := right_child
        end

    left_child: like parent
            -- Left child, if any
            -- (from BINARY_TREE)

    left_item: like item is
            -- Value of left child
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            has_left: left_child /= void
        do
            Result := left_child.item
        end

    left_sibling: like parent is
            -- Left neighbor, if any
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_root: not is_root
        do
            if parent.right_child = Current then
                Result := parent.left_child
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    parent: BINARY_SEARCH_TREE [G]
            -- Parent of current node

    right_child: like parent
            -- Right child, if any
            -- (from BINARY_TREE)

    right_item: like item is
            -- Value of right child
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            has_right: right_child /= void
        do
            Result := right_child.item
        end

    right_sibling: like parent is
            -- Right neighbor, if any
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_root: not is_root
        do
            if parent.left_child = Current then
                Result := parent.right_child
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
            -- (from BINARY_TREE)
        do
            if has_left then
                Result := Result + 1
            end
            if has_right then
                Result := Result + 1
            end
        ensure then -- from BINARY_TREE
            valid_arity: Result <= 2
        end

    count: INTEGER is
            -- Number of items
            -- (from TREE)
        do
            Result := subtree_count + 1
        end

    max: like item is
            -- Maximum item in tree
        do
            if has_right then
                Result := right_child.max
            else
                Result := item
            end
        ensure
            maximum_present: has (Result)
        end

    min: like item is
            -- Minimum item in tree
        do
            if has_left then
                Result := left_child.min
            else
                Result := item
            end
        ensure
            minimum_present: has (Result)
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_empty then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_after: BOOLEAN is
            -- Is there no valid child position to the right of cursor?
            -- (from BINARY_TREE)
        do
            Result := child_index >= child_capacity + 1
        end

    child_before: BOOLEAN is
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)
        do
            Result := child_index = 0
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = 1
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = child_capacity
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_off: BOOLEAN is
            -- Is there no current child?
            -- (from TREE)
        do
            Result := child_before or child_after
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    has_both: BOOLEAN is
            -- Has current node two children?
            -- (from BINARY_TREE)
        do
            Result := left_child /= void and right_child /= void
        ensure -- from BINARY_TREE
            Result = (has_left and has_right)
        end

    has_left: BOOLEAN is
            -- Has current node a left child?
            -- (from BINARY_TREE)
        do
            Result := left_child /= void
        ensure -- from BINARY_TREE
            Result = (left_child /= void)
        end

    has_none: BOOLEAN is
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.
            -- (from BINARY_TREE)
        do
            Result := left_child = void and right_child = void
        end

    has_right: BOOLEAN is
            -- Has current node a right child?
            -- (from BINARY_TREE)
        do
            Result := right_child /= void
        ensure -- from BINARY_TREE
            Result = (right_child /= void)
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
            -- (from TREE)
        do
            Result := False
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.
            -- (from BINARY_TREE)
        do
            Result := left_child = void and right_child = void
        end

    is_root: BOOLEAN is
            -- Is there no parent?
            -- (from TREE)
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
            -- (from TREE)
        do
            Result := not child_off
        end

    sorted: BOOLEAN is
            -- Is tree sorted?
        do
            Result := True
            if (has_left and then left_item > item) or (has_right and then right_item < item) then
                Result := False
            else
                if has_left then
                    Result := left_child.sorted_and_less (item)
                end
                if has_right and Result then
                    Result := right_child.sorted
                end
            end
        end

    sorted_and_less (i: like item): BOOLEAN is
            -- Is tree sorted and all its elements less then i
        do
            Result := True
            if (has_left and then left_item > item) or (has_right and then right_item < item) then
                Result := False
            else
                if has_left then
                    Result := left_child.sorted_and_less (item)
                end
                if has_right and Result then
                    Result := right_child.sorted_and_less (i)
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
            -- (from TREE)
        do
            Result := not child_off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move cursor to previous child.
            -- (from BINARY_TREE)
        do
            child_index := child_index - 1
        end

    child_finish is
            -- Move cursor to last child.
            -- (from BINARY_TREE)
        do
            child_index := 2
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        end

    child_forth is
            -- Move cursor to next child.
            -- (from BINARY_TREE)
        do
            child_index := child_index + 1
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th child.
            -- (from BINARY_TREE)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        do
            child_index := i
        ensure then -- from TREE
            position: child_index = i
        end

    child_go_to (p: ARRAYED_LIST_CURSOR) is
            -- Move cursor to child remembered by p.
            -- (from BINARY_TREE)
        do
            child_index := p.index
        end

    child_start is
            -- Move to first child.
            -- (from BINARY_TREE)
        do
            child_index := 1
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        end

    i_infix is
            -- Apply node_action to every node's item
            -- in tree, using infix order.
        do
            if left_child /= void then
                left_child.i_infix
            end
            node_action (item)
            if right_child /= void then
                right_child.i_infix
            end
        end

    node_action (v: like item) is
            -- Operation on node item,
            -- to be defined by descendant classes.
            -- Here it is defined as an empty operation.
            -- Redefine this procedure in descendant classes if useful
            -- operations are to be performed during traversals.
        do
        end

    postorder is
            -- Apply node_action to every node's item
            -- in tree, using post-order.
        do
            if left_child /= void then
                left_child.postorder
            end
            if right_child /= void then
                right_child.postorder
            end
            node_action (item)
        end

    preorder is
            -- Apply node_action to every node's item
            -- in tree, using pre-order.
        do
            node_action (item)
            if left_child /= void then
                left_child.preorder
            end
            if right_child /= void then
                right_child.preorder
            end
        end

feature -- Element change

    child_put (v: like item) is
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.
            -- (from BINARY_TREE)
        require -- from TREE
            child_writable: child_writable
        local
            node: like Current
        do
            if child /= void then
                if object_comparison then
                    child.compare_objects
                else
                    child.compare_references
                end
                child.bt_put (v)
            else
                create node.bt_make (v)
                if object_comparison then
                    node.compare_objects
                end
                put_child (node)
            end
        ensure -- from TREE
            item_inserted: child_item = v
        end

    child_replace (v: like item) is
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.
            -- (from BINARY_TREE)
        require -- from TREE
            child_writable: child_writable
        local
            node: like Current
        do
            if child /= void then
                if object_comparison then
                    child.compare_objects
                else
                    child.compare_references
                end
                child.bt_put (v)
            else
                create node.bt_make (v)
                if object_comparison then
                    node.compare_objects
                end
                put_child (node)
            end
        ensure -- from TREE
            item_inserted: child_item = v
        end

    extend (v: like item) is
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of put.
        require
            new_item_exists: v /= void
        do
            if not items_equal (v, item) then
                if v < item then
                    if left_child = void then
                        put_left_child (new_tree)
                        left_child.replace (v)
                    else
                        left_child.put (v)
                    end
                else
                    if right_child = void then
                        put_right_child (new_tree)
                        right_child.replace (v)
                    else
                        right_child.put (v)
                    end
                end
            end
        ensure
            item_inserted: has (v)
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)
        do
            replace (other.item)
            fill_subtree (other)
        end

    put (v: like item) is
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of extend.
        require
            new_item_exists: v /= void
        do
            if not items_equal (v, item) then
                if v < item then
                    if left_child = void then
                        put_left_child (new_tree)
                        left_child.replace (v)
                    else
                        left_child.put (v)
                    end
                else
                    if right_child = void then
                        put_right_child (new_tree)
                        right_child.replace (v)
                    else
                        right_child.put (v)
                    end
                end
            end
        ensure
            item_inserted: has (v)
        end

    bt_put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    put_child (n: like parent) is
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.
            -- (from BINARY_TREE)
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            n.attach_to_parent (Current)
            inspect child_index
            when 1 then
                left_child := n
            when 2 then
                right_child := n
            end
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    replace_child (n: like parent) is
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.
            -- (from BINARY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            n.attach_to_parent (Current)
            inspect child_index
            when 1 then
                left_child := n
            when 2 then
                right_child := n
            end
        ensure -- from TREE
            child_replaced: child = n
        end

    sprout is
            -- Make current node a root.
            -- (from TREE)
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature {BINARY_SEARCH_TREE} -- Element change

    put_left_child (n: like parent) is
            -- Set left_child to n.
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            no_parent: n = void or else n.is_root
        do
            if n /= void then
                if object_comparison then
                    n.compare_objects
                else
                    n.compare_references
                end
            end
            if left_child /= void then
                left_child.attach_to_parent (void)
            end
            if n /= void then
                n.attach_to_parent (Current)
            end
            left_child := n
        end

    put_right_child (n: like parent) is
            -- Set right_child to n.
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            no_parent: n = void or else n.is_root
        do
            if n /= void then
                if object_comparison then
                    n.compare_objects
                else
                    n.compare_references
                end
            end
            if right_child /= void then
                right_child.attach_to_parent (void)
            end
            if n /= void then
                n.attach_to_parent (Current)
            end
            right_child := n
        end

feature {BINARY_SEARCH_TREE} -- Removal

    remove_left_child is
            -- Remove left child.
            -- (from BINARY_TREE)
        do
            if left_child /= void then
                left_child.attach_to_parent (void)
            end
            left_child := void
        ensure -- from BINARY_TREE
            not has_left
        end

    remove_right_child is
            -- Remove right child.
            -- (from BINARY_TREE)
        do
            if right_child /= void then
                right_child.attach_to_parent (void)
            end
            right_child := void
        ensure -- from BINARY_TREE
            not has_right
        end

feature -- Removal

    child_remove is
            -- Remove current child.
            -- (from BINARY_TREE)
        do
            inspect child_index
            when 1 then
                left_child.attach_to_parent (void);
                left_child := void
            when 2 then
                right_child.attach_to_parent (void);
                right_child := void
            end
        end

    prune (n: like parent) is
            -- Prune n from child nodes.
            -- (from BINARY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        do
            if left_child = n then
                remove_left_child
            elseif right_child = n then
                remove_right_child
            end
        ensure -- from TREE
            n_is_root: n.is_root
        end

feature -- Transformation

    sort is
            -- Sort tree.
        local
            seq: LINEAR [G]
            temp: ARRAY [G]
            heap: HEAP_PRIORITY_QUEUE [G]
            i: INTEGER
        do
            seq := linear_representation
            i := count
            remove_left_child
            remove_right_child
            from
                seq.start
                create heap.make (i)
            until
                seq.off
            loop
                heap.put (seq.item)
                seq.forth
            end
            from
                create temp.make (1, heap.count)
                i := 1
            until
                heap.is_empty
            loop
                temp.put (heap.item, i)
                heap.remove
                i := i + 1
            end
            replace (temp.item ((temp.count) // 2 + 1))
            fill_from_sorted_special (temp.area, 0, temp.count - 1)
        ensure
            is_sorted: sorted
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from TREE)
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
            -- (from BINARY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            tmp_tree: like Current
        do
            create tmp_tree.bt_make (other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
            -- (from BINARY_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0
        do
            Result := new_tree
            if child_index <= 1 and child_index + n >= 1 and has_left then
                Result.put_left_child (left_child.duplicate_all)
            end
            if child_index <= 2 and child_index + n >= 2 and has_right then
                Result.put_right_child (right_child.duplicate_all)
            end
        end

    duplicate_all: like Current is
            -- (from BINARY_TREE)
        do
            Result := new_tree
            if has_left then
                Result.put_left_child (left_child.duplicate_all)
            end
            if has_right then
                Result.put_right_child (right_child.duplicate_all)
            end
        end

feature {BINARY_SEARCH_TREE, BINARY_SEARCH_TREE_SET} -- Implementation

    intersect (other: BINARY_SEARCH_TREE [G]) is
            -- Remove all items not in other.
        do
            if right_child /= void then
                right_child.intersect (other)
            end
            if left_child /= void then
                left_child.intersect (other)
            end
            if not other.has (item) then
                remove_node
            end
        end

    is_subset (other: like Current): BOOLEAN is
            -- Is Current a subset of other
        do
            Result := other.has (item)
            if Result and left_child /= void then
                Result := left_child.is_subset (other)
            end
            if Result and right_child /= void then
                Result := right_child.is_subset (other)
            end
        end

    max_node: like Current is
            -- Node containing max
        do
            if has_right then
                Result := right_child.min_node
            else
                Result := Current
            end
        end

    merge (other: like Current) is
            -- Add all items of other.
        do
            if other.right_child /= void then
                merge (other.right_child)
            end
            if other.left_child /= void then
                merge (other.left_child)
            end
            extend (other.item)
        end

    min_node: like Current is
            -- Node containing min
        do
            if has_left then
                Result := left_child.min_node
            else
                Result := Current
            end
        end

    pruned (v: like item; par: like Current): like Current is
            -- Prune v.
            -- (par is the parent node of the current node, needed to update
            -- parent correctly.)
        local
            m: like Current
        do
            if items_equal (item, v) then
                if has_none then
                elseif not has_right then
                    left_child.attach_to_parent (par);
                    Result := left_child
                elseif not has_left then
                    right_child.attach_to_parent (par);
                    Result := right_child
                else
                    m := right_child.min_node
                    m.remove_node
                    item := m.item
                    Result := Current
                end
            else
                Result := Current
                if v < item then
                    if left_child /= void then
                        left_child := left_child.pruned (v, Current)
                    end
                else
                    if right_child /= void then
                        right_child := right_child.pruned (v, Current)
                    end
                end
            end
        end

    remove_node is
            -- Remove current node from the tree.
        require
            is_not_root: not is_root
        local
            is_left_child: BOOLEAN
            m: like Current
        do
            is_left_child := Current = parent.left_child
            if not has_right then
                if left_child /= void then
                    left_child.attach_to_parent (void)
                end
                if is_left_child then
                    parent.put_left_child (left_child)
                else
                    parent.put_right_child (left_child)
                end
                parent := void
            elseif not has_left then
                if right_child /= void then
                    right_child.attach_to_parent (void)
                end;
                if is_left_child then
                    parent.put_left_child (right_child)
                else
                    parent.put_right_child (right_child)
                end;
                parent := void
            else
                m := right_child.min_node
                m.remove_node
                item := m.item
            end
        end

    subtract (other: BINARY_SEARCH_TREE [G]) is
            -- Remove all items also in other.
        require
            set_exists: other /= void
        do
            if right_child /= void then
                right_child.subtract (other)
            end
            if left_child /= void then
                left_child.subtract (other)
            end
            if other.has (item) then
                remove_node
            end
        end

feature {NONE} -- Implementation

    Child_capacity: INTEGER is 2
            -- (from BINARY_TREE)

    fill_from_sorted_special (t: SPECIAL [G]; s, e: INTEGER) is
            -- Put values from t into tree in such an order that
            -- the tree will be balanced if t is sorted.
        local
            m: INTEGER
        do
            m := (s + e) // 2
            put (t.item (m))
            if m - 1 >= s then
                fill_from_sorted_special (t, s, m - 1)
            end
            if m + 1 <= e then
                fill_from_sorted_special (t, m + 1, e)
            end
        end

    fill_subtree (other: BINARY_TREE [G]) is
            -- Copy other to subtee.
            -- (from BINARY_TREE)
        do
            if not other.is_leaf then
                put_left_child (other.left_child.duplicate_all)
            end
            if other.arity >= 2 then
                put_right_child (other.right_child.duplicate_all)
            end
        end

    items_equal (src, dest: like item): BOOLEAN is
            -- Are src and dest equal?
            -- (depending on object_comparison)
        do
            if object_comparison then
                Result := src /= void and then src.is_equal (dest)
            else
                Result := (src = dest)
            end
        end

    new_tree: like Current is
            -- New tree node
            -- (from BINARY_TREE)
        do
            create Result.bt_make (item)
            if object_comparison then
                Result.compare_objects
            end
        end

    remove is
            -- Remove current item
            -- (from TREE)
        do
        end

    set_comparison_mode (t: like Current) is
            -- Set comparison mode of t to the same mode as Current.
        require
            not_void: t /= void
        do
            if object_comparison then
                t.compare_objects
            else
                t.compare_references
            end
        ensure
            mode_set: object_comparison = t.object_comparison
        end

    subtree_count: INTEGER is
            -- Number of items in subtree
            -- (from BINARY_TREE)
        do
            if left_child /= void then
                Result := left_child.count
            end
            if right_child /= void then
                Result := Result + right_child.count
            end
        end

    subtree_has (v: G): BOOLEAN is
            -- Does subtree contain v?
            -- (from BINARY_TREE)
        do
            if left_child /= void then
                Result := left_child.has (v)
            end
            if right_child /= void and not Result then
                Result := right_child.has (v)
            end
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
            -- (from TREE)
        require -- from TREE
            other_not_empty: other /= void and then not other.is_empty
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
            -- (from TREE)
        require -- from TREE
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_empty and not t2.is_empty
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

feature {BINARY_TREE} -- Implementation

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
            -- (from BINARY_TREE)
        do
            if left_child /= void then
                al.extend (left_child.item)
                left_child.fill_list (al)
            end
            if right_child /= void then
                al.extend (right_child.item)
                right_child.fill_list (al)
            end
        end

feature {TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node.
            -- (from TREE)
        do
            parent := n
        ensure -- from TREE
            new_parent: parent = n
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BINARY_TREE
    tree_is_binary: child_capacity = 2
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Binary search trees; left child item is less than current item,
        right child item is greater
    ]"
    status: "See notice at end of class"
    names: binary_search_tree, tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    BINARY_SEARCH_TREE [G -> COMPARABLE]

create

    make (v: like item)
            -- Create single node with item v.
        require
            item_exists: v /= void
        ensure
            node_item: item = v
            no_child: (left_child = void) and (right_child = void)

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.
        require
            item_exists: v /= void
        ensure
            node_item: item = v
            no_child: (left_child = void) and (right_child = void)

    bt_make (v: like item)
            -- Create a root node with value v.
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            is_root: is_root
            is_leaf: is_leaf

feature -- Access

    child: like parent
            -- Child at cursor position
            -- (from BINARY_TREE)
        require -- from TREE
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position
            -- (from BINARY_TREE)

    child_index: INTEGER
            -- Index of cursor position
            -- (from BINARY_TREE)

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    first_child: like parent
            -- Left child
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    has (v: like item): BOOLEAN
            -- Does tree contain a node whose item
            -- is equal to v (object comparison)?
        require -- from  CONTAINER
            True
        require else
            argument_not_void: v /= void
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Content of cell.
            -- (from CELL)

    last_child: like parent
            -- Right child
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    left_child: like parent
            -- Left child, if any
            -- (from BINARY_TREE)

    left_item: like item
            -- Value of left child
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            has_left: left_child /= void

    left_sibling: like parent
            -- Left neighbor, if any
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: BINARY_SEARCH_TREE [G]
            -- Parent of current node

    right_child: like parent
            -- Right child, if any
            -- (from BINARY_TREE)

    right_item: like item
            -- Value of right child
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            has_right: right_child /= void

    right_sibling: like parent
            -- Right neighbor, if any
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children
            -- (from BINARY_TREE)
        ensure then -- from BINARY_TREE
            valid_arity: Result <= 2

    count: INTEGER
            -- Number of items
            -- (from TREE)

    max: like item
            -- Maximum item in tree
        ensure
            maximum_present: has (Result)

    min: like item
            -- Minimum item in tree
        ensure
            minimum_present: has (Result)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?
            -- (from BINARY_TREE)

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?
            -- (from TREE)

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    has_both: BOOLEAN
            -- Has current node two children?
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            Result = (has_left and has_right)

    has_left: BOOLEAN
            -- Has current node a left child?
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            Result = (left_child /= void)

    has_none: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.
            -- (from BINARY_TREE)

    has_right: BOOLEAN
            -- Has current node a right child?
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            Result = (right_child /= void)

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.
            -- (from BINARY_TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    sorted: BOOLEAN
            -- Is tree sorted?

    sorted_and_less (i: like item): BOOLEAN
            -- Is tree sorted and all its elements less then i

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.
            -- (from BINARY_TREE)

    child_finish
            -- Move cursor to last child.
            -- (from BINARY_TREE)
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.
            -- (from BINARY_TREE)

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
            -- (from BINARY_TREE)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: ARRAYED_LIST_CURSOR)
            -- Move cursor to child remembered by p.
            -- (from BINARY_TREE)

    child_start
            -- Move to first child.
            -- (from BINARY_TREE)
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

    i_infix
            -- Apply node_action to every node's item
            -- in tree, using infix order.

    node_action (v: like item)
            -- Operation on node item,
            -- to be defined by descendant classes.
            -- Here it is defined as an empty operation.
            -- Redefine this procedure in descendant classes if useful
            -- operations are to be performed during traversals.

    postorder
            -- Apply node_action to every node's item
            -- in tree, using post-order.

    preorder
            -- Apply node_action to every node's item
            -- in tree, using pre-order.

feature -- Element change

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.
            -- (from BINARY_TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.
            -- (from BINARY_TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    extend (v: like item)
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of put.
        require
            new_item_exists: v /= void
        ensure
            item_inserted: has (v)

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    put (v: like item)
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of extend.
        require
            new_item_exists: v /= void
        ensure
            item_inserted: has (v)

    bt_put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.
            -- (from BINARY_TREE)

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.
            -- (from BINARY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    child_remove
            -- Remove current child.
            -- (from BINARY_TREE)

    prune (n: like parent)
            -- Prune n from child nodes.
            -- (from BINARY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

feature -- Transformation

    sort
            -- Sort tree.
        ensure
            is_sorted: sorted

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from BINARY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
            -- (from BINARY_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

    duplicate_all: like Current
            -- (from BINARY_TREE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BINARY_TREE
    tree_is_binary: child_capacity = 2
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BINARY_SEARCH_TREE [G -> COMPARABLE]

Ancestors
    BINARY_TREE [G]

Clients
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

Suppliers
    ARRAY [G]
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BOOLEAN
    COMPARABLE
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    INTEGER
    LINEAR [G]
    SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_SEARCH_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Binary search trees; left child item is less than current item,
        right child item is greater
    ]"
    status: "See notice at end of class"
    names: binary_search_tree, tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class interface
    BINARY_SEARCH_TREE [G -> COMPARABLE]

create
    make

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.
        require
            item_exists: v /= void
        ensure
            node_item: item = v
            no_child: (left_child = void) and (right_child = void)

feature -- Access

    parent: BINARY_SEARCH_TREE [G]
            -- Parent of current node

    has (v: like item): BOOLEAN
            -- Does tree contain a node whose item
            -- is equal to v (object comparison)?
        require else
            argument_not_void: v /= void

feature -- Measurement

    min: like item
            -- Minimum item in tree
        ensure
            minimum_present: has (Result)

    max: like item
            -- Maximum item in tree
        ensure
            maximum_present: has (Result)

feature -- Status report

    sorted: BOOLEAN
            -- Is tree sorted?

    sorted_and_less (i: like item): BOOLEAN
            -- Is tree sorted and all its elements less then i

feature -- Cursor movement

    node_action (v: like item)
            -- Operation on node item,
            -- to be defined by descendant classes.
            -- Here it is defined as an empty operation.
            -- Redefine this procedure in descendant classes if useful
            -- operations are to be performed during traversals.

    preorder
            -- Apply node_action to every node's item
            -- in tree, using pre-order.

    i_infix
            -- Apply node_action to every node's item
            -- in tree, using infix order.

    postorder
            -- Apply node_action to every node's item
            -- in tree, using post-order.

feature -- Element change

    put (v: like item)
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of extend.
        require
            new_item_exists: v /= void
        ensure
            item_inserted: has (v)

    extend (v: like item)
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of put.
        require
            new_item_exists: v /= void
        ensure
            item_inserted: has (v)

feature -- Transformation

    sort
            -- Sort tree.
        ensure
            is_sorted: sorted

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Binary tree: each node may have a left child and a right child"
    status: "See notice at end of class"
    names: binary_tree, tree, fixed_tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    BINARY_TREE [G]

inherit
    CELL [G]
        undefine
            is_equal
        redefine
            copy
        end

    TREE [G]
        redefine
            parent,
            is_leaf,
            subtree_has,
            subtree_count,
            fill_list,
            child_remove,
            child_after,
            child_capacity,
            copy
        end

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create a root node with value v.
        do
            item := v
        ensure
            is_root: is_root
            is_leaf: is_leaf
        end

feature -- Access

    parent: BINARY_TREE [G]
            -- Parent of current node

    child_index: INTEGER
            -- Index of cursor position

    left_child: like parent
            -- Left child, if any

    right_child: like parent
            -- Right child, if any

    left_item: like item is
            -- Value of left child
        require
            has_left: left_child /= void
        do
            Result := left_child.item
        end

    right_item: like item is
            -- Value of right child
        require
            has_right: right_child /= void
        do
            Result := right_child.item
        end

    first_child: like parent is
            -- Left child
        do
            Result := left_child
        end

    last_child: like parent is
            -- Right child
        do
            Result := right_child
        end

    child: like parent is
            -- Child at cursor position
        do
            inspect child_index
            when 1 then
                Result := left_child
            when 2 then
                Result := right_child
            end
        end

    child_cursor: CURSOR is
            -- Current cursor position
        do
            create {ARRAYED_LIST_CURSOR} Result.make (child_index)
        end

    left_sibling: like parent is
            -- Left neighbor, if any
        do
            if parent.right_child = Current then
                Result := parent.left_child
            end
        end

    right_sibling: like parent is
            -- Right neighbor, if any
        do
            if parent.left_child = Current then
                Result := parent.right_child
            end
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
        do
            if has_left then
                Result := Result + 1
            end
            if has_right then
                Result := Result + 1
            end
        ensure then
            valid_arity: Result <= 2
        end

feature -- Status report

    child_after: BOOLEAN is
            -- Is there no valid child position to the right of cursor?
        do
            Result := child_index >= child_capacity + 1
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.
        do
            Result := left_child = void and right_child = void
        end

    has_none: BOOLEAN is
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.
        do
            Result := left_child = void and right_child = void
        end

    has_left: BOOLEAN is
            -- Has current node a left child?
        do
            Result := left_child /= void
        ensure
            Result = (left_child /= void)
        end

    has_right: BOOLEAN is
            -- Has current node a right child?
        do
            Result := right_child /= void
        ensure
            Result = (right_child /= void)
        end

    has_both: BOOLEAN is
            -- Has current node two children?
        do
            Result := left_child /= void and right_child /= void
        ensure
            Result = (has_left and has_right)
        end

feature -- Cursor movement

    child_go_to (p: ARRAYED_LIST_CURSOR) is
            -- Move cursor to child remembered by p.
        do
            child_index := p.index
        end

    child_start is
            -- Move to first child.
        do
            child_index := 1
        end

    child_finish is
            -- Move cursor to last child.
        do
            child_index := 2
        end

    child_forth is
            -- Move cursor to next child.
        do
            child_index := child_index + 1
        end

    child_back is
            -- Move cursor to previous child.
        do
            child_index := child_index - 1
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th child.
        do
            child_index := i
        end

feature -- Element change

    put_left_child (n: like parent) is
            -- Set left_child to n.
        require
            no_parent: n = void or else n.is_root
        do
            if n /= void then
                if object_comparison then
                    n.compare_objects
                else
                    n.compare_references
                end
            end
            if left_child /= void then
                left_child.attach_to_parent (void)
            end
            if n /= void then
                n.attach_to_parent (Current)
            end
            left_child := n
        end

    put_right_child (n: like parent) is
            -- Set right_child to n.
        require
            no_parent: n = void or else n.is_root
        do
            if n /= void then
                if object_comparison then
                    n.compare_objects
                else
                    n.compare_references
                end
            end
            if right_child /= void then
                right_child.attach_to_parent (void)
            end
            if n /= void then
                n.attach_to_parent (Current)
            end
            right_child := n
        end

    child_put (v: like item) is
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.
        local
            node: like Current
        do
            if child /= void then
                if object_comparison then
                    child.compare_objects
                else
                    child.compare_references
                end
                child.put (v)
            else
                create node.make (v)
                if object_comparison then
                    node.compare_objects
                end
                put_child (node)
            end
        end

    child_replace (v: like item) is
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.
        local
            node: like Current
        do
            if child /= void then
                if object_comparison then
                    child.compare_objects
                else
                    child.compare_references
                end
                child.put (v)
            else
                create node.make (v)
                if object_comparison then
                    node.compare_objects
                end
                put_child (node)
            end
        end

    put_child (n: like parent) is
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            n.attach_to_parent (Current)
            inspect child_index
            when 1 then
                left_child := n
            when 2 then
                right_child := n
            end
        end

    replace_child (n: like parent) is
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            n.attach_to_parent (Current)
            inspect child_index
            when 1 then
                left_child := n
            when 2 then
                right_child := n
            end
        end

feature -- Removal

    remove_left_child is
            -- Remove left child.
        do
            if left_child /= void then
                left_child.attach_to_parent (void)
            end
            left_child := void
        ensure
            not has_left
        end

    remove_right_child is
            -- Remove right child.
        do
            if right_child /= void then
                right_child.attach_to_parent (void)
            end
            right_child := void
        ensure
            not has_right
        end

    child_remove is
            -- Remove current child.
        do
            inspect child_index
            when 1 then
                left_child.attach_to_parent (void);
                left_child := void
            when 2 then
                right_child.attach_to_parent (void);
                right_child := void
            end
        end

    prune (n: like parent) is
            -- Prune n from child nodes.
        do
            if left_child = n then
                remove_left_child
            elseif right_child = n then
                remove_right_child
            end
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        do
            Result := new_tree
            if child_index <= 1 and child_index + n >= 1 and has_left then
                Result.put_left_child (left_child.duplicate_all)
            end
            if child_index <= 2 and child_index + n >= 2 and has_right then
                Result.put_right_child (right_child.duplicate_all)
            end
        end

    duplicate_all: like Current is
        do
            Result := new_tree
            if has_left then
                Result.put_left_child (left_child.duplicate_all)
            end
            if has_right then
                Result.put_right_child (right_child.duplicate_all)
            end
        end

    copy (other: like Current) is
            -- Copy contents from other.
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        end

feature {BINARY_TREE} -- Implementation

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
        do
            if left_child /= void then
                al.extend (left_child.item)
                left_child.fill_list (al)
            end
            if right_child /= void then
                al.extend (right_child.item)
                right_child.fill_list (al)
            end
        end

feature {NONE} -- Implementation

    subtree_has (v: G): BOOLEAN is
            -- Does subtree contain v?
        do
            if left_child /= void then
                Result := left_child.has (v)
            end
            if right_child /= void and not Result then
                Result := right_child.has (v)
            end
        end

    subtree_count: INTEGER is
            -- Number of items in subtree
        do
            if left_child /= void then
                Result := left_child.count
            end
            if right_child /= void then
                Result := Result + right_child.count
            end
        end

    fill_subtree (other: BINARY_TREE [G]) is
            -- Copy other to subtee.
        do
            if not other.is_leaf then
                put_left_child (other.left_child.duplicate_all)
            end
            if other.arity >= 2 then
                put_right_child (other.right_child.duplicate_all)
            end
        end

    new_tree: like Current is
            -- New tree node
        do
            create Result.make (item)
            if object_comparison then
                Result.compare_objects
            end
        end

    Child_capacity: INTEGER is 2

invariant

    tree_is_binary: child_capacity = 2

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BINARY_TREE [G]

General
    cluster: base.structures.tree
    description: "Binary tree: each node may have a left child and a right child"
    create: make

Ancestors
    CELL [G]
    TREE [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] BINARY_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] BINARY_TREE [G]
    duplicate_all: [like Current] BINARY_TREE [G]
    first_child: [like parent] BINARY_TREE [G]
    has (v: G): BOOLEAN
    has_both: BOOLEAN
    has_left: BOOLEAN
    has_none: BOOLEAN
    has_right: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] BINARY_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] BINARY_TREE [G]): BOOLEAN
    item: G
    last_child: [like parent] BINARY_TREE [G]
    left_child: [like parent] BINARY_TREE [G]
    left_item: [like item] G
    left_sibling: [like parent] BINARY_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    parent: BINARY_TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_child: [like parent] BINARY_TREE [G]
    right_item: [like item] G
    right_sibling: [like parent] BINARY_TREE [G]
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: ARRAYED_LIST_CURSOR)
    child_put (v: [like item] G)
    child_remove
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] BINARY_TREE [G])
    fill (other: TREE [G])
    make (v: [like item] G)
    prune (n: [like parent] BINARY_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] BINARY_TREE [G])
    put_left_child (n: [like parent] BINARY_TREE [G])
    put_right_child (n: [like parent] BINARY_TREE [G])
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] BINARY_TREE [G])
    sprout

Constraints
    tree is binary

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Binary tree: each node may have a left child and a right child"
    status: "See notice at end of class"
    names: binary_tree, tree, fixed_tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:37 $"
    revision: "$Revision: 1.2 $"

class
    BINARY_TREE [G]

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create a root node with value v.
        do
            item := v
        ensure
            is_root: is_root
            is_leaf: is_leaf
        end

feature -- Access

    child: like parent is
            -- Child at cursor position
        require -- from TREE
            readable: readable_child
        do
            inspect child_index
            when 1 then
                Result := left_child
            when 2 then
                Result := right_child
            end
        end

    child_cursor: CURSOR is
            -- Current cursor position
        do
            create {ARRAYED_LIST_CURSOR} Result.make (child_index)
        end

    child_index: INTEGER
            -- Index of cursor position

    child_item: like item is
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable
        do
            Result := child.item
        end

    first_child: like parent is
            -- Left child
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := left_child
        end

    item: G
            -- Content of cell.
            -- (from CELL)

    last_child: like parent is
            -- Right child
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := right_child
        end

    left_child: like parent
            -- Left child, if any

    left_item: like item is
            -- Value of left child
        require
            has_left: left_child /= void
        do
            Result := left_child.item
        end

    left_sibling: like parent is
            -- Left neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        do
            if parent.right_child = Current then
                Result := parent.left_child
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    parent: BINARY_TREE [G]
            -- Parent of current node

    right_child: like parent
            -- Right child, if any

    right_item: like item is
            -- Value of right child
        require
            has_right: right_child /= void
        do
            Result := right_child.item
        end

    right_sibling: like parent is
            -- Right neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        do
            if parent.left_child = Current then
                Result := parent.right_child
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
        do
            if has_left then
                Result := Result + 1
            end
            if has_right then
                Result := Result + 1
            end
        ensure then
            valid_arity: Result <= 2
        end

    count: INTEGER is
            -- Number of items
            -- (from TREE)
        do
            Result := subtree_count + 1
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_empty then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_after: BOOLEAN is
            -- Is there no valid child position to the right of cursor?
        do
            Result := child_index >= child_capacity + 1
        end

    child_before: BOOLEAN is
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)
        do
            Result := child_index = 0
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = 1
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = child_capacity
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_off: BOOLEAN is
            -- Is there no current child?
            -- (from TREE)
        do
            Result := child_before or child_after
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    has_both: BOOLEAN is
            -- Has current node two children?
        do
            Result := left_child /= void and right_child /= void
        ensure
            Result = (has_left and has_right)
        end

    has_left: BOOLEAN is
            -- Has current node a left child?
        do
            Result := left_child /= void
        ensure
            Result = (left_child /= void)
        end

    has_none: BOOLEAN is
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.
        do
            Result := left_child = void and right_child = void
        end

    has_right: BOOLEAN is
            -- Has current node a right child?
        do
            Result := right_child /= void
        ensure
            Result = (right_child /= void)
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
            -- (from TREE)
        do
            Result := False
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.
        do
            Result := left_child = void and right_child = void
        end

    is_root: BOOLEAN is
            -- Is there no parent?
            -- (from TREE)
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
            -- (from TREE)
        do
            Result := not child_off
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
            -- (from TREE)
        do
            Result := not child_off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move cursor to previous child.
        do
            child_index := child_index - 1
        end

    child_finish is
            -- Move cursor to last child.
        do
            child_index := 2
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        end

    child_forth is
            -- Move cursor to next child.
        do
            child_index := child_index + 1
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th child.
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        do
            child_index := i
        ensure then -- from TREE
            position: child_index = i
        end

    child_go_to (p: ARRAYED_LIST_CURSOR) is
            -- Move cursor to child remembered by p.
        do
            child_index := p.index
        end

    child_start is
            -- Move to first child.
        do
            child_index := 1
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        end

feature -- Element change

    child_put (v: like item) is
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        local
            node: like Current
        do
            if child /= void then
                if object_comparison then
                    child.compare_objects
                else
                    child.compare_references
                end
                child.put (v)
            else
                create node.make (v)
                if object_comparison then
                    node.compare_objects
                end
                put_child (node)
            end
        ensure -- from TREE
            item_inserted: child_item = v
        end

    child_replace (v: like item) is
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        local
            node: like Current
        do
            if child /= void then
                if object_comparison then
                    child.compare_objects
                else
                    child.compare_references
                end
                child.put (v)
            else
                create node.make (v)
                if object_comparison then
                    node.compare_objects
                end
                put_child (node)
            end
        ensure -- from TREE
            item_inserted: child_item = v
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)
        do
            replace (other.item)
            fill_subtree (other)
        end

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    put_child (n: like parent) is
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            n.attach_to_parent (Current)
            inspect child_index
            when 1 then
                left_child := n
            when 2 then
                right_child := n
            end
        end

    put_left_child (n: like parent) is
            -- Set left_child to n.
        require
            no_parent: n = void or else n.is_root
        do
            if n /= void then
                if object_comparison then
                    n.compare_objects
                else
                    n.compare_references
                end
            end
            if left_child /= void then
                left_child.attach_to_parent (void)
            end
            if n /= void then
                n.attach_to_parent (Current)
            end
            left_child := n
        end

    put_right_child (n: like parent) is
            -- Set right_child to n.
        require
            no_parent: n = void or else n.is_root
        do
            if n /= void then
                if object_comparison then
                    n.compare_objects
                else
                    n.compare_references
                end
            end
            if right_child /= void then
                right_child.attach_to_parent (void)
            end
            if n /= void then
                n.attach_to_parent (Current)
            end
            right_child := n
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    replace_child (n: like parent) is
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            n.attach_to_parent (Current)
            inspect child_index
            when 1 then
                left_child := n
            when 2 then
                right_child := n
            end
        ensure -- from TREE
            child_replaced: child = n
        end

    sprout is
            -- Make current node a root.
            -- (from TREE)
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature -- Removal

    child_remove is
            -- Remove current child.
        do
            inspect child_index
            when 1 then
                left_child.attach_to_parent (void);
                left_child := void
            when 2 then
                right_child.attach_to_parent (void);
                right_child := void
            end
        end

    prune (n: like parent) is
            -- Prune n from child nodes.
        require -- from TREE
            is_child: n.parent = Current
        do
            if left_child = n then
                remove_left_child
            elseif right_child = n then
                remove_right_child
            end
        ensure -- from TREE
            n_is_root: n.is_root
        end

    remove_left_child is
            -- Remove left child.
        do
            if left_child /= void then
                left_child.attach_to_parent (void)
            end
            left_child := void
        ensure
            not has_left
        end

    remove_right_child is
            -- Remove right child.
        do
            if right_child /= void then
                right_child.attach_to_parent (void)
            end
            right_child := void
        ensure
            not has_right
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from TREE)
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0
        do
            Result := new_tree
            if child_index <= 1 and child_index + n >= 1 and has_left then
                Result.put_left_child (left_child.duplicate_all)
            end
            if child_index <= 2 and child_index + n >= 2 and has_right then
                Result.put_right_child (right_child.duplicate_all)
            end
        end

    duplicate_all: like Current is
        do
            Result := new_tree
            if has_left then
                Result.put_left_child (left_child.duplicate_all)
            end
            if has_right then
                Result.put_right_child (right_child.duplicate_all)
            end
        end

feature {BINARY_TREE} -- Implementation

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
        do
            if left_child /= void then
                al.extend (left_child.item)
                left_child.fill_list (al)
            end
            if right_child /= void then
                al.extend (right_child.item)
                right_child.fill_list (al)
            end
        end

feature {NONE} -- Implementation

    Child_capacity: INTEGER is 2

    fill_subtree (other: BINARY_TREE [G]) is
            -- Copy other to subtee.
        do
            if not other.is_leaf then
                put_left_child (other.left_child.duplicate_all)
            end
            if other.arity >= 2 then
                put_right_child (other.right_child.duplicate_all)
            end
        end

    new_tree: like Current is
            -- New tree node
        do
            create Result.make (item)
            if object_comparison then
                Result.compare_objects
            end
        end

    remove is
            -- Remove current item
            -- (from TREE)
        do
        end

    subtree_count: INTEGER is
            -- Number of items in subtree
        do
            if left_child /= void then
                Result := left_child.count
            end
            if right_child /= void then
                Result := Result + right_child.count
            end
        end

    subtree_has (v: G): BOOLEAN is
            -- Does subtree contain v?
        do
            if left_child /= void then
                Result := left_child.has (v)
            end
            if right_child /= void and not Result then
                Result := right_child.has (v)
            end
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
            -- (from TREE)
        require -- from TREE
            other_not_empty: other /= void and then not other.is_empty
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
            -- (from TREE)
        require -- from TREE
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_empty and not t2.is_empty
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

feature {TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node.
            -- (from TREE)
        do
            parent := n
        ensure -- from TREE
            new_parent: parent = n
        end

invariant

    tree_is_binary: child_capacity = 2
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Binary tree: each node may have a left child and a right child"
    status: "See notice at end of class"
    names: binary_tree, tree, fixed_tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    BINARY_TREE [G]

create

    make (v: like item)
            -- Create a root node with value v.
        ensure
            is_root: is_root
            is_leaf: is_leaf

feature -- Initialization

    make (v: like item)
            -- Create a root node with value v.
        ensure
            is_root: is_root
            is_leaf: is_leaf

feature -- Access

    child: like parent
            -- Child at cursor position
        require -- from TREE
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position

    child_index: INTEGER
            -- Index of cursor position

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    first_child: like parent
            -- Left child
        require -- from TREE
            is_not_leaf: not is_leaf

    item: G
            -- Content of cell.
            -- (from CELL)

    last_child: like parent
            -- Right child
        require -- from TREE
            is_not_leaf: not is_leaf

    left_child: like parent
            -- Left child, if any

    left_item: like item
            -- Value of left child
        require
            has_left: left_child /= void

    left_sibling: like parent
            -- Left neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: BINARY_TREE [G]
            -- Parent of current node

    right_child: like parent
            -- Right child, if any

    right_item: like item
            -- Value of right child
        require
            has_right: right_child /= void

    right_sibling: like parent
            -- Right neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children
        ensure then
            valid_arity: Result <= 2

    count: INTEGER
            -- Number of items
            -- (from TREE)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?
            -- (from TREE)

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_both: BOOLEAN
            -- Has current node two children?
        ensure
            Result = (has_left and has_right)

    has_left: BOOLEAN
            -- Has current node a left child?
        ensure
            Result = (left_child /= void)

    has_none: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.

    has_right: BOOLEAN
            -- Has current node a right child?
        ensure
            Result = (right_child /= void)

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.

    child_finish
            -- Move cursor to last child.
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: ARRAYED_LIST_CURSOR)
            -- Move cursor to child remembered by p.

    child_start
            -- Move to first child.
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.

    put_left_child (n: like parent)
            -- Set left_child to n.
        require
            no_parent: n = void or else n.is_root

    put_right_child (n: like parent)
            -- Set right_child to n.
        require
            no_parent: n = void or else n.is_root

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    child_remove
            -- Remove current child.

    prune (n: like parent)
            -- Prune n from child nodes.
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    remove_left_child
            -- Remove left child.
        ensure
            not has_left

    remove_right_child
            -- Remove right child.
        ensure
            not has_right

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

    duplicate_all: like Current

invariant

    tree_is_binary: child_capacity = 2
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BINARY_TREE [G]

Ancestors
    CELL [G]
    TREE [G]

Descendants
    BINARY_SEARCH_TREE [G -> COMPARABLE]

Clients
    BINARY_TREE [G]
    DYNAMIC_TREE [G]
    TREE [G]

Suppliers
    ARRAYED_LIST [G]
    ARRAYED_LIST_CURSOR
    BINARY_TREE [G]
    BOOLEAN
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BINARY_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Binary tree: each node may have a left child and a right child"
    status: "See notice at end of class"
    names: binary_tree, tree, fixed_tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    BINARY_TREE [G]

create
    make

feature -- Initialization

    make (v: like item)
            -- Create a root node with value v.
        ensure
            is_root: is_root
            is_leaf: is_leaf

feature -- Access

    parent: BINARY_TREE [G]
            -- Parent of current node

    child_index: INTEGER
            -- Index of cursor position

    left_child: like parent
            -- Left child, if any

    right_child: like parent
            -- Right child, if any

    left_item: like item
            -- Value of left child
        require
            has_left: left_child /= void

    right_item: like item
            -- Value of right child
        require
            has_right: right_child /= void

    first_child: like parent
            -- Left child

    last_child: like parent
            -- Right child

    child: like parent
            -- Child at cursor position

    child_cursor: CURSOR
            -- Current cursor position

    left_sibling: like parent
            -- Left neighbor, if any

    right_sibling: like parent
            -- Right neighbor, if any

feature -- Measurement

    arity: INTEGER
            -- Number of children
        ensure then
            valid_arity: Result <= 2

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?

    is_leaf: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.

    has_none: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.

    has_left: BOOLEAN
            -- Has current node a left child?
        ensure
            Result = (left_child /= void)

    has_right: BOOLEAN
            -- Has current node a right child?
        ensure
            Result = (right_child /= void)

    has_both: BOOLEAN
            -- Has current node two children?
        ensure
            Result = (has_left and has_right)

feature -- Cursor movement

    child_go_to (p: ARRAYED_LIST_CURSOR)
            -- Move cursor to child remembered by p.

    child_start
            -- Move to first child.

    child_finish
            -- Move cursor to last child.

    child_forth
            -- Move cursor to next child.

    child_back
            -- Move cursor to previous child.

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.

feature -- Element change

    put_left_child (n: like parent)
            -- Set left_child to n.
        require
            no_parent: n = void or else n.is_root

    put_right_child (n: like parent)
            -- Set right_child to n.
        require
            no_parent: n = void or else n.is_root

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.

    put_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.

    replace_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.

feature -- Removal

    remove_left_child
            -- Remove left child.
        ensure
            not has_left

    remove_right_child
            -- Remove right child.
        ensure
            not has_right

    child_remove
            -- Remove current child.

    prune (n: like parent)
            -- Prune n from child nodes.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.

    duplicate_all: like Current

    copy (other: like Current)
            -- Copy contents from other.

invariant

    tree_is_binary: child_capacity = 2

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.structures.tree

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


DYNAMIC_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees with a dynamically modifiable structure"
    status: "See notice at end of class"
    names: dynamic_tree, tree
    representation: recursive
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_TREE [G]

inherit
    TREE [G]
        redefine
            parent
        end

feature -- Access

    parent: DYNAMIC_TREE [G]
            -- Parent of current node.

feature -- Status report

    Extendible: BOOLEAN is True
            -- May new items be added?

feature {RECURSIVE_CURSOR_TREE} -- Element change

    set_child (n: like parent) is
            -- Set the child of parent to n.
        require
            non_void_argument: n /= void
        deferred
        end

feature -- Element change

    extend (v: like item) is
            -- Add v as new child.
        do
            child_extend (v)
        end

    child_extend (v: like item) is
            -- Add v to the list of children.
            -- Do not move child cursor.
        deferred
        end

    child_put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require
            not_child_before: not child_before
        deferred
        end

    child_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require
            not_child_after: not child_after
        deferred
        end

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else
            non_void_argument: n /= void
        deferred
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require
            not_child_before: not child_before
            non_void_argument: n /= void
        deferred
        end

    put_child_right (n: like parent) is
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require
            not_child_after: not child_after
            non_void_argument: n /= void
        deferred
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        deferred
        ensure
            other_is_leaf: other.is_leaf
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        deferred
        ensure
            other_is_leaf: other.is_leaf
        end

feature -- Removal

    remove_left_child is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            is_not_first: not child_isfirst
        deferred
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1
        end

    remove_right_child is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            is_not_last: not child_islast
        deferred
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    remove_child is
            -- Remove child at cursor position.
            -- Move cursor to next sibling, or after if none.
        require
            child_not_off: not child_off
        deferred
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    wipe_out is
            -- Remove all child
        deferred
        end

feature -- Conversion

    fill_from_binary (b: BINARY_TREE [G]) is
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
        local
            current_node: BINARY_TREE [G]
        do
            replace (b.item)
            wipe_out
            if b.has_left then
                from
                    current_node := b.left_child
                until
                    current_node = void
                loop
                    child_put_right (current_node.item)
                    child_forth
                    child.fill_from_binary (current_node)
                    current_node := current_node.right_child
                end
            end
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_tree
                pos := child_cursor
            until
                child_after or else (counter = n)
            loop
                Result.put_child (child.duplicate_all)
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {DYNAMIC_TREE} -- Implementation

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        deferred
        ensure
            result_exists: Result /= void
            result_item: Result.item = item
        end

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
        local
            pos: CURSOR
        do
            from
                Result := new_tree
                pos := child_cursor
                child_start
            until
                child_off
            loop
                Result.put_child (child.duplicate_all)
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other.
        do
            from
                other.child_start
            until
                other.child_off
            loop
                child_extend (other.item)
                other.child_forth
            end
            from
                child_start
                other.child_start
            until
                child_off
            loop
                child.fill_subtree (other.child)
                other.child_forth
                child_forth
            end
        end

invariant

    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees with a dynamically modifiable structure"

Ancestors
    TREE [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] DYNAMIC_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] DYNAMIC_TREE [G]
    Extendible: BOOLEAN
    first_child: [like parent] DYNAMIC_TREE [G]
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] DYNAMIC_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] DYNAMIC_TREE [G]): BOOLEAN
    item: G
    last_child: [like first_child] DYNAMIC_TREE [G]
    left_sibling: [like parent] DYNAMIC_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    parent: DYNAMIC_TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like parent] DYNAMIC_TREE [G]
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    merge_tree_after (other: [like first_child] DYNAMIC_TREE [G])
    merge_tree_before (other: [like first_child] DYNAMIC_TREE [G])
    prune (n: [like parent] DYNAMIC_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] DYNAMIC_TREE [G])
    put_child_left (n: [like parent] DYNAMIC_TREE [G])
    put_child_right (n: [like parent] DYNAMIC_TREE [G])
    remove_child
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] DYNAMIC_TREE [G])
    sprout
    wipe_out

Constraints
    extendible definition
    child after definition

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees with a dynamically modifiable structure"
    status: "See notice at end of class"
    names: dynamic_tree, tree
    representation: recursive
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class
    DYNAMIC_TREE [G]

feature -- Access

    child: like parent is
            -- Current child node
            -- (from TREE)
        require -- from TREE
            readable: readable_child
        deferred
        end

    child_cursor: CURSOR is
            -- Current cursor position
            -- (from TREE)
        deferred
        end

    child_index: INTEGER is
            -- Index of current child
            -- (from TREE)
        deferred
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1
        end

    child_item: like item is
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable
        do
            Result := child.item
        end

    first_child: like parent is
            -- Leftmost child
            -- (from TREE)
        require -- from TREE
            is_not_leaf: not is_leaf
        deferred
        end

    item: G is
            -- Item in current node
            -- (from TREE)
        deferred
        end

    last_child: like first_child is
            -- Right most child
            -- (from TREE)
        require -- from TREE
            is_not_leaf: not is_leaf
        deferred
        end

    left_sibling: like parent is
            -- Left neighbor (if any)
            -- (from TREE)
        require -- from TREE
            is_not_root: not is_root
        deferred
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    parent: DYNAMIC_TREE [G]
            -- Parent of current node.

    right_sibling: like parent is
            -- Right neighbor (if any)
            -- (from TREE)
        require -- from TREE
            is_not_root: not is_root
        deferred
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
            -- (from TREE)
        deferred
        end

    child_capacity: INTEGER is
            -- Maximal number of children
            -- (from TREE)
        do
            Result := arity
        end

    count: INTEGER is
            -- Number of items
            -- (from TREE)
        do
            Result := subtree_count + 1
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_empty then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_after: BOOLEAN is
            -- Is there no valid child position to the right of cursor?
            -- (from TREE)
        do
            Result := child_index = child_capacity + 1
        end

    child_before: BOOLEAN is
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)
        do
            Result := child_index = 0
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = 1
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = child_capacity
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_off: BOOLEAN is
            -- Is there no current child?
            -- (from TREE)
        do
            Result := child_before or child_after
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    Extendible: BOOLEAN is True
            -- May new items be added?

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
            -- (from TREE)
        do
            Result := False
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- (from TREE)
        do
            Result := arity = 0
        end

    is_root: BOOLEAN is
            -- Is there no parent?
            -- (from TREE)
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
            -- (from TREE)
        do
            Result := not child_off
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
            -- (from TREE)
        do
            Result := not child_off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move cursor to previous child.
            -- (from TREE)
        deferred
        end

    child_finish is
            -- Move cursor to last child.
            -- (from TREE)
        deferred
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        end

    child_forth is
            -- Move cursor to next child.
            -- (from TREE)
        deferred
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th child.
            -- (from TREE)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        deferred
        ensure then -- from TREE
            position: child_index = i
        end

    child_go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from TREE)
        deferred
        end

    child_start is
            -- Move cursor to first child.
            -- (from TREE)
        deferred
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        end

feature {RECURSIVE_CURSOR_TREE} -- Element change

    set_child (n: like parent) is
            -- Set the child of parent to n.
        require
            non_void_argument: n /= void
        deferred
        end

feature -- Element change

    child_extend (v: like item) is
            -- Add v to the list of children.
            -- Do not move child cursor.
        deferred
        end

    child_put (v: like item) is
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
            -- (from TREE)
        require -- from TREE
            child_writable: child_writable
        deferred
        ensure -- from TREE
            item_inserted: child_item = v
        end

    child_put_left (v: like item) is
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require
            not_child_before: not child_before
        deferred
        end

    child_put_right (v: like item) is
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require
            not_child_after: not child_after
        deferred
        end

    child_replace (v: like item) is
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
            -- (from TREE)
        require -- from TREE
            child_writable: child_writable
        deferred
        ensure -- from TREE
            item_inserted: child_item = v
        end

    extend (v: like item) is
            -- Add v as new child.
        do
            child_extend (v)
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)
        do
            replace (other.item)
            fill_subtree (other)
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        deferred
        ensure
            other_is_leaf: other.is_leaf
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        deferred
        ensure
            other_is_leaf: other.is_leaf
        end

    prune (n: like parent) is
            -- Remove n from the children.
            -- (from TREE)
        require -- from TREE
            is_child: n.parent = Current
        deferred
        ensure -- from TREE
            n_is_root: n.is_root
        end

    put (v: like item) is
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
            -- (from TREE)
        require -- from TREE
            is_writable: writable
        deferred
        ensure -- from TREE
            item_inserted: item = v
        end

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else
            non_void_argument: n /= void
        deferred
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require
            not_child_before: not child_before
            non_void_argument: n /= void
        deferred
        end

    put_child_right (n: like parent) is
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require
            not_child_after: not child_after
            non_void_argument: n /= void
        deferred
        end

    replace (v: like item) is
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
            -- (from TREE)
        require -- from TREE
            is_writable: writable
        deferred
        ensure -- from TREE
            item_inserted: item = v
        end

    replace_child (n: like parent) is
            -- Put n at current child position.
            -- (from TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        deferred
        ensure -- from TREE
            child_replaced: child = n
        end

    sprout is
            -- Make current node a root.
            -- (from TREE)
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature -- Removal

    remove_child is
            -- Remove child at cursor position.
            -- Move cursor to next sibling, or after if none.
        require
            child_not_off: not child_off
        deferred
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    remove_left_child is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            is_not_first: not child_isfirst
        deferred
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1
        end

    remove_right_child is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            is_not_last: not child_islast
        deferred
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    wipe_out is
            -- Remove all child
        deferred
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    fill_from_binary (b: BINARY_TREE [G]) is
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
        local
            current_node: BINARY_TREE [G]
        do
            replace (b.item)
            wipe_out
            if b.has_left then
                from
                    current_node := b.left_child
                until
                    current_node = void
                loop
                    child_put_right (current_node.item)
                    child_forth
                    child.fill_from_binary (current_node)
                    current_node := current_node.right_child
                end
            end
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from TREE)
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_tree
                pos := child_cursor
            until
                child_after or else (counter = n)
            loop
                Result.put_child (child.duplicate_all)
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {DYNAMIC_TREE} -- Implementation

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
        local
            pos: CURSOR
        do
            from
                Result := new_tree
                pos := child_cursor
                child_start
            until
                child_off
            loop
                Result.put_child (child.duplicate_all)
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other.
        do
            from
                other.child_start
            until
                other.child_off
            loop
                child_extend (other.item)
                other.child_forth
            end
            from
                child_start
                other.child_start
            until
                child_off
            loop
                child.fill_subtree (other.child)
                other.child_forth
                child_forth
            end
        end

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        deferred
        ensure
            result_exists: Result /= void
            result_item: Result.item = item
        end

feature {TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node.
            -- (from TREE)
        do
            parent := n
        ensure -- from TREE
            new_parent: parent = n
        end

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
            -- (from TREE)
        do
            from
                child_start
            until
                child_off
            loop
                if child /= void then
                    al.extend (child_item)
                    child.fill_list (al)
                end
                child_forth
            end
        end

    subtree_count: INTEGER is
            -- Number of items in children
            -- (from TREE)
        local
            pos: CURSOR
        do
            Result := arity
            from
                pos := child_cursor
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result := Result + child.subtree_count
                end
                child_forth
            end
            child_go_to (pos)
        end

    subtree_has (v: G): BOOLEAN is
            -- Do children include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        local
            cursor: CURSOR
        do
            cursor := child_cursor
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    if object_comparison then
                        Result := (v /= void) and then (child_item /= void) and then v.is_equal (child_item)
                    else
                        Result := v = child_item
                    end
                end
                child_forth
            end
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    Result := child.subtree_has (v)
                end
                child_forth
            end
            child_go_to (cursor)
        end

feature {NONE} -- Implementation

    child_remove is
            -- Remove item of current child
            -- (from TREE)
        do
        end

    remove is
            -- Remove current item
            -- (from TREE)
        do
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
            -- (from TREE)
        require -- from TREE
            other_not_empty: other /= void and then not other.is_empty
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
            -- (from TREE)
        require -- from TREE
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_empty and not t2.is_empty
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

invariant

    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees with a dynamically modifiable structure"
    status: "See notice at end of class"
    names: dynamic_tree, tree
    representation: recursive
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_TREE [G]

feature -- Access

    child: like parent
            -- Current child node
            -- (from TREE)
        require -- from TREE
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position
            -- (from TREE)

    child_index: INTEGER
            -- Index of current child
            -- (from TREE)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    first_child: like parent
            -- Leftmost child
            -- (from TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    item: G
            -- Item in current node
            -- (from TREE)

    last_child: like first_child
            -- Right most child
            -- (from TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor (if any)
            -- (from TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: DYNAMIC_TREE [G]
            -- Parent of current node.

    right_sibling: like parent
            -- Right neighbor (if any)
            -- (from TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children
            -- (from TREE)

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?
            -- (from TREE)

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?
            -- (from TREE)

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    Extendible: BOOLEAN is True
            -- May new items be added?

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.
            -- (from TREE)

    child_finish
            -- Move cursor to last child.
            -- (from TREE)
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.
            -- (from TREE)

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
            -- (from TREE)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from TREE)

    child_start
            -- Move cursor to first child.
            -- (from TREE)
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    child_extend (v: like item)
            -- Add v to the list of children.
            -- Do not move child cursor.

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
            -- (from TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require
            not_child_before: not child_before

    child_put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require
            not_child_after: not child_after

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
            -- (from TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    extend (v: like item)
            -- Add v as new child.

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure
            other_is_leaf: other.is_leaf

    prune (n: like parent)
            -- Remove n from the children.
            -- (from TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    put (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
            -- (from TREE)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require
            not_child_after: not child_after
            non_void_argument: n /= void

    replace (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
            -- (from TREE)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
            -- (from TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    remove_child
            -- Remove child at cursor position.
            -- Move cursor to next sibling, or after if none.
        require
            child_not_off: not child_off
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            is_not_first: not child_isfirst
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            is_not_last: not child_islast
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    wipe_out
            -- Remove all child

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

invariant

    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    DYNAMIC_TREE [G]

Ancestors
    TREE [G]

Descendants
    ARRAYED_TREE [G]
    LINKED_TREE [G]
    TWO_WAY_TREE [G]

Clients
    DYNAMIC_TREE [G]
    RECURSIVE_CURSOR_TREE [G]

Suppliers
    BINARY_TREE [G]
    BOOLEAN
    DYNAMIC_TREE [G]
    INTEGER
    TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DYNAMIC_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees with a dynamically modifiable structure"
    status: "See notice at end of class"
    names: dynamic_tree, tree
    representation: recursive
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DYNAMIC_TREE [G]

feature -- Access

    parent: DYNAMIC_TREE [G]
            -- Parent of current node.

feature -- Status report

    Extendible: BOOLEAN is True
            -- May new items be added?

feature -- Element change

    extend (v: like item)
            -- Add v as new child.

    child_extend (v: like item)
            -- Add v to the list of children.
            -- Do not move child cursor.

    child_put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require
            not_child_before: not child_before

    child_put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require
            not_child_after: not child_after

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require
            not_child_after: not child_after
            non_void_argument: n /= void

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure
            other_is_leaf: other.is_leaf

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure
            other_is_leaf: other.is_leaf

feature -- Removal

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            is_not_first: not child_isfirst
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            is_not_last: not child_islast
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_child
            -- Remove child at cursor position.
            -- Move cursor to next sibling, or after if none.
        require
            child_not_off: not child_off
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    wipe_out
            -- Remove all child

feature -- Conversion

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children

invariant

    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Trees where each node has a fixed number of children
        (The number of children is arbitrary but cannot be
        changed once the node has been created
    ]"
    names: fixed_tree, tree, fixed_list
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class
    FIXED_TREE [G]

inherit
    CELL [G]
        undefine
            is_equal
        redefine
            copy
        end

    TREE [G]
        rename
            empty as fl_empty
        export
            {NONE} fl_empty
        undefine
            child_off,
            child_after,
            child_before,
            child_item
        redefine
            parent,
            attach_to_parent,
            copy
        select
            linear_representation,
            changeable_comparison_criterion,
            object_comparison,
            is_leaf,
            has
        end

    FIXED_LIST [FIXED_TREE [G]]
        rename
            make as fl_make,
            make_filled as fl_make_filled,
            item as child,
            i_th as array_item,
            last as last_child,
            first as first_child,
            search as search_child,
            has as fl_has,
            readable as fl_readable,
            put as fl_put,
            replace as fl_replace,
            fill as fl_fill,
            writable as fl_writable,
            extendible as fl_extendible,
            remove as fl_remove,
            linear_representation as fl_lin_rep,
            count as arity,
            empty as fl_empty,
            is_empty as is_leaf,
            full as fl_full,
            start as child_start,
            finish as child_finish,
            forth as child_forth,
            back as child_back,
            go_i_th as child_go_i_th,
            index as child_index,
            off as child_off,
            after as child_after,
            before as child_before,
            isfirst as child_isfirst,
            islast as child_islast,
            cursor as child_cursor,
            go_to as child_go_to,
            object_comparison as fl_object_comparison,
            changeable_comparison_criterion as fl_changeable_object_criterion
        export
            {NONE} fl_put, fl_replace, fl_writable, fl_extendible, fl_remove, fl_make, fl_make_filled, fl_has, fl_readable, fl_lin_rep, fl_empty, fl_fill, fl_full,
            {FIXED_TREE} array_item
        undefine
            is_leaf,
            child_isfirst,
            child_islast,
            valid_cursor_index,
            compare_references,
            compare_objects,
            fl_empty,
            is_equal
        redefine
            duplicate,
            first_child,
            copy
        end

create
    make

feature -- Initialization

    make (n: INTEGER; v: G) is
            -- Create node with n void children and item v.
        require
            valid_number_of_children: n >= 0
        do
            fl_make_filled (n)
            replace (v)
        ensure
            node_item: item = v
            node_arity: arity = n
        end

feature -- Access

    parent: FIXED_TREE [G]
            -- Parent of current node

    first_child: like parent is
            -- Leftmost child
        do
            Result := array_item (1)
        end

    child_item: like item is
            -- Item of active child
        do
            Result := child.item
        end

    left_sibling: like parent is
            -- Left neighbor, if any
        do
            if position_in_parent > 1 then
                Result := parent.array_item (position_in_parent - 1)
            end
        end

    right_sibling: like parent is
            -- Right neighbor, if any
        do
            if position_in_parent < parent.arity then
                Result := parent.array_item (position_in_parent + 1)
            end
        end

feature -- Status report

    child_contractable: BOOLEAN is
            -- May items be removed?
        do
            Result := not child_off
        ensure
            Result = not child_off
        end

    Full: BOOLEAN is True
            -- Is tree full?

feature -- Element change

    child_put (v: like item) is
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_replace.
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        end

    child_replace (v: like item) is
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_put.
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        end

    put_left (v: like item) is
            -- Add v to the left of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        do
            parent.child_go_i_th (position_in_parent - 1)
            parent.child_replace (v)
        ensure
            item_put: left_sibling.item = v
        end

    put_right (v: like item) is
            -- Add v to the right of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        do
            parent.child_go_i_th (position_in_parent + 1)
            parent.child_replace (v)
        ensure
            item_put: right_sibling.item = v
        end

    put_child (n: like parent) is
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of replace_child.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            fl_replace (n)
            n.attach_to_parent (Current)
        ensure then
            child_replaced: n.parent = Current
        end

    replace_child (n: like parent) is
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of put_child.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            fl_replace (n)
            n.attach_to_parent (Current)
        ensure then
            child_replaced: n.parent = Current
        end

    put_left_sibling (other: like parent) is
            -- Make other the left sibling of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        do
            parent.child_go_i_th (position_in_parent - 1)
            parent.replace_child (other)
        ensure
            left_sibling_replaced: left_sibling = other
        end

    put_right_sibling (other: like parent) is
            -- Make other the right sibling of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        do
            parent.child_go_i_th (position_in_parent + 1)
            parent.replace_child (other)
        ensure
            right_sibling_replaced: right_sibling = other
        end

feature -- Removal

    remove_child is
            -- Remove active child.
        do
            fl_replace (void)
        ensure then
            child_removed: child = void
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        local
            counter: INTEGER
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
            until
                child_after or else (counter = n)
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

    copy (other: like Current) is
            -- Copy contents from other.
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.arity, other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        end

feature {FIXED_TREE} -- Implementation

    new_node: like Current is
            -- Instance of class `like Current'.
            -- New allocated node of arity arity
            -- and node value item
        do
            create Result.make (arity, item)
        end

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
        local
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other
        local
            temp: like parent
        do
            from
                other.child_start
                child_start
            until
                child_after
            loop
                if other.child /= void then
                    create temp.make (other.arity, other.child_item)
                    temp.fill_subtree (other.child)
                end
                replace_child (temp)
                child_forth
                other.child_forth
            end
        end

    attach_to_parent (n: like parent) is
            -- Make n parent of current node
            -- and set position_in_parent.
        do
            parent := n
            position_in_parent := n.child_index
        end

feature {NONE} -- Implementation

    position_in_parent: INTEGER
            -- Position of current node in parent

    Extendible: BOOLEAN is False
            -- May new items be added?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FIXED_TREE [G]

General
    cluster: base.structures.tree
    description:
        "Trees where each node has a fixed number of children
        (The number of children is arbitrary but cannot be
        changed once the node has been created"
    create: make

Ancestors
    CELL [G]
    FIXED_LIST [G]
    TREE [G]

Queries
    infix "@" (i: INTEGER): FIXED_TREE [G]
    area: SPECIAL [FIXED_TREE [G]]
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child: FIXED_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_contractable: BOOLEAN
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] FIXED_TREE [G]
    exhausted: BOOLEAN
    first_child: [like parent] FIXED_TREE [G]
    fl_changeable_object_criterion: BOOLEAN
    fl_object_comparison: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] FIXED_TREE [G]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] FIXED_TREE [G]): BOOLEAN
    is_inserted (v: FIXED_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] FIXED_TREE [G]): BOOLEAN
    item: G
    last_child: [like first] FIXED_TREE [G]
    left_sibling: [like parent] FIXED_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: FIXED_TREE [G]): INTEGER
    parent: FIXED_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    Resizable: BOOLEAN
    right_sibling: [like parent] FIXED_TREE [G]
    sequential_occurrences (v: FIXED_TREE [G]): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [FIXED_TREE [G]])
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] FIXED_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]])
    do_if (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN])
    extend (v: [like item] FIXED_TREE [G])
    fill (other: TREE [G])
    make (n: INTEGER; v: G)
    move (i: INTEGER)
    prune (v: FIXED_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] FIXED_TREE [G])
    put_i_th (v: [like item] FIXED_TREE [G]; i: INTEGER)
    put_left (v: [like item] G)
    put_left_sibling (other: [like parent] FIXED_TREE [G])
    put_right (v: [like item] G)
    put_right_sibling (other: [like parent] FIXED_TREE [G])
    remove_child
    replace (v: [like item] G)
    replace_child (n: [like parent] FIXED_TREE [G])
    search_child (v: [like item] FIXED_TREE [G])
    sprout
    swap (i: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Trees where each node has a fixed number of children
        (The number of children is arbitrary but cannot be
        changed once the node has been created
    ]"
    names: fixed_tree, tree, fixed_list
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class
    FIXED_TREE [G]

create
    make

feature -- Initialization

    make (n: INTEGER; v: G) is
            -- Create node with n void children and item v.
        require
            valid_number_of_children: n >= 0
        do
            fl_make_filled (n)
            replace (v)
        ensure
            node_item: item = v
            node_arity: arity = n
        end

feature {NONE} -- Initialization

    fl_make (n: INTEGER) is
            -- Create an empty list.
            -- (from FIXED_LIST)
        do
            array_make (1, n)
        ensure -- from FIXED_LIST
            is_before: child_before
            new_count: arity = 0
        end

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

    fl_make_filled (n: INTEGER) is
            -- Create a list with n void elements.
            -- (from FIXED_LIST)
        do
            array_make (1, n)
            arity := n
        ensure -- from FIXED_LIST
            is_before: child_before
            new_count: arity = n
        end

    make_from_array (a: ARRAY [FIXED_TREE [G]]) is
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void
        do
            area := a.area
            lower := a.lower
            upper := a.upper
        end

feature {FIXED_LIST} -- Initialization

    array_make (min_index, max_index: INTEGER) is
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        do
            lower := min_index
            upper := max_index
            if min_index <= max_index then
                make_area (max_index - min_index + 1)
            else
                make_area (0)
            end
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default
        end

feature -- Access

    child_item: like item is
            -- Item of active child
        require -- from TREE
            readable: child_readable
        do
            Result := child.item
        end

    child_cursor: CURSOR is
            -- Current cursor position
            -- (from FIXED_LIST)
        do
            create {ARRAYED_LIST_CURSOR} Result.make (child_index)
        end

    first_child: like parent is
            -- Leftmost child
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := array_item (1)
        end

    child_index: INTEGER
            -- Current position in the list
            -- (from FIXED_LIST)

    index_of (v: like child; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_index_of (v, i)
            child_go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G
            -- Content of cell.
            -- (from CELL)

    child: FIXED_TREE [G] is
            -- Current item
            -- (from FIXED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: fl_readable
        require -- from TREE
            readable: readable_child
        do
            Result := area.item (child_index - 1)
        end

    last_child: like first_child is
            -- Item at last position
            -- (from FIXED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf
        do
            Result := area.item (arity - 1)
        end

    left_sibling: like parent is
            -- Left neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        do
            if position_in_parent > 1 then
                Result := parent.array_item (position_in_parent - 1)
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    sequential_occurrences (v: FIXED_TREE [G]): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                child_start
                search_child (v)
            until
                exhausted
            loop
                Result := Result + 1
                child_forth
                search_child (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent: FIXED_TREE [G]
            -- Parent of current node

    right_sibling: like parent is
            -- Right neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        do
            if position_in_parent < parent.arity then
                Result := parent.array_item (position_in_parent + 1)
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)
        end

    infix "@" (i: INTEGER): FIXED_TREE [G] is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature {NONE} -- Access

    entry (i: INTEGER): FIXED_TREE [G] is
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            Result := array_item (i)
        end

    sequential_has (v: like child): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            child_start
            if not child_off then
                search_child (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    fl_has (v: FIXED_TREE [G]): BOOLEAN is
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        local
            i: INTEGER
            upper_bound: INTEGER
        do
            upper_bound := upper
            if object_comparison then
                if v = void then
                    i := upper_bound + 1
                else
                    from
                        i := lower
                    until
                        i > upper_bound or else (array_item (i) /= void and then array_item (i).is_equal (v))
                    loop
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper_bound or else (array_item (i) = v)
                loop
                    i := i + 1
                end
            end
            Result := not (i > upper_bound)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    sequential_index_of (v: like child; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child /= void and then v.is_equal (child) then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            else
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child = v then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like child) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (child /= void and then v.is_equal (child))
                loop
                    child_forth
                end
            else
                from
                until
                    exhausted or else v = child
                loop
                    child_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child
        end

feature {FIXED_TREE} -- Access

    array_item (i: INTEGER): FIXED_TREE [G] is
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            Result := area.item (i - lower)
        end

feature  -- Access

    area: SPECIAL [FIXED_TREE [G]]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    capacity: INTEGER is
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        do
            Result := upper - lower + 1
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1
        end

    child_capacity: INTEGER is
            -- Maximal number of children
            -- (from TREE)
        do
            Result := arity
        end

    count: INTEGER is
            -- Number of items
            -- (from TREE)
        do
            Result := subtree_count + 1
        end

    arity: INTEGER
            -- (from FIXED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, arity)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity
        end

    occurrences (v: FIXED_TREE [G]): INTEGER is
            -- Number of times v appears in structure
            -- (from ARRAY)
        local
            i: INTEGER
        do
            if object_comparison then
                if v /= void then
                    from
                        i := lower
                    until
                        i > upper
                    loop
                        if array_item (i) /= void and then v.is_equal (array_item (i)) then
                            Result := Result + 1
                        end
                        i := i + 1
                    end
                end
            else
                from
                    i := lower
                until
                    i > upper
                loop
                    if array_item (i) = v then
                        Result := Result + 1
                    end
                    i := i + 1
                end
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature {NONE} -- Measurement

    additional_space: INTEGER is
            -- Proposed number of additional items
            -- (from RESIZABLE)
        do
            Result := (capacity * growth_percentage // 100).max (minimal_increase)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1
        end

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    array_index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from ARRAY)
        do
            create Result.make (lower, upper)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = arity
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        end

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_leaf = other.is_leaf) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_leaf then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity
        end

feature -- Status report

    child_after: BOOLEAN is
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)
        do
            Result := (child_index = arity + 1)
        end

    child_before: BOOLEAN is
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)
        do
            Result := (child_index = 0)
        end

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    fl_changeable_object_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_contractable: BOOLEAN is
            -- May items be removed?
        do
            Result := not child_off
        ensure
            Result = not child_off
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = 1
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = child_capacity
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := child_off
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result
        end

    Full: BOOLEAN is True
            -- Is tree full?

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
            -- (from TREE)
        do
            Result := False
        end

    is_inserted (v: FIXED_TREE [G]): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- (from TREE)
        do
            Result := arity = 0
        end

    is_root: BOOLEAN is
            -- Is there no parent?
            -- (from TREE)
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    fl_object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN is
            -- Is there no current item?
            -- (from CHAIN)
        do
            Result := (child_index = 0) or (child_index = arity + 1)
        end

    prunable: BOOLEAN is
            -- May items be removed?
            -- (from FIXED_LIST)
        do
            Result := not is_leaf
        end

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
            -- (from TREE)
        do
            Result := not child_off
        end

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)
            -- (from FIXED)

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Is p a valid cursor?
            -- (from FIXED_LIST)
        local
            fl_c: ARRAYED_LIST_CURSOR
        do
            fl_c ?= p
            if fl_c /= void then
                Result := valid_cursor_index (fl_c.index)
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        do
            Result := (lower <= i) and then (i <= upper)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
            -- (from TREE)
        do
            Result := not child_off
        end

feature {NONE} -- Status report

    all_cleared: BOOLEAN is
        obsolete "Use `all_default' instead"
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := all_default
        end

    all_default: BOOLEAN is
            -- Are all items set to default values?
            -- (from ARRAY)
        do
            Result := area.all_default (upper - lower)
        ensure -- from ARRAY
            definition: Result = (arity = 0 or else ((array_item (upper) = void or else array_item (upper) = array_item (upper).default) and subarray (lower, upper - 1).all_default))
        end

    fl_empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_leaf
        end

    fl_extendible: BOOLEAN is
            -- May new items be added?
            -- (from FIXED_LIST)
        do
            Result := (arity < capacity)
        end

    array_extendible: BOOLEAN is
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)
        do
            Result := False
        end

    fl_full: BOOLEAN is
            -- Is the list full?
            -- (from FIXED_LIST)
        do
            Result := arity = capacity
        end

    fl_readable: BOOLEAN is
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        do
            Result := not child_off
        end

    same_items (other: like Current): BOOLEAN is
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        do
            if arity = other.arity then
                Result := area.same_items (other.area, upper - lower)
            end
        ensure -- from ARRAY
            definition: Result = ((arity = other.arity) and then (arity = 0 or else (array_item (upper) = other.array_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
        end

    valid_index_set: BOOLEAN is
            -- (from ARRAY)
        do
            Result := index_set.count = arity
        end

    fl_writable: BOOLEAN is
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        do
            Result := not child_off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move cursor to previous position, if any.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before
        do
            child_index := child_index - 1
        end

    child_finish is
            -- Move cursor to last position.
            -- (from FIXED_LIST)
        do
            child_index := arity
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        end

    child_forth is
            -- Move cursor to next position, if any.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        do
            child_index := child_index + 1
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from FIXED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        do
            child_index := i
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i
        end

    child_go_to (p: CURSOR) is
            -- Move cursor to element remembered in p.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            fl_c: ARRAYED_LIST_CURSOR
        do
            fl_c ?= p
            check
                fl_c /= void
            end
            child_index := fl_c.index
        end

    move (i: INTEGER) is
            -- Move cursor i positions.
            -- (from FIXED_LIST)
        do
            child_index := child_index + i
            if (child_index > arity + 1) then
                child_index := arity + 1
            elseif child_index < 0 then
                child_index := 0
            end
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        end

    search_child (v: like child) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if child_before and not is_leaf then
                child_forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child
        end

    child_start is
            -- Move cursor to first position.
            -- (from FIXED_LIST)
        do
            child_index := 1
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        end

feature -- Element change

    append (s: SEQUENCE [FIXED_TREE [G]]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: arity >= old arity
        end

    child_put (v: like item) is
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        ensure -- from TREE
            item_inserted: child_item = v
        end

    child_replace (v: like item) is
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        do
            if object_comparison then
                child.compare_objects
            else
                child.compare_references
            end
            child.replace (v)
        ensure -- from TREE
            item_inserted: child_item = v
        end

    extend (v: like child) is
            -- Add v to end.
            -- Move index to the current item.
            -- (from FIXED_LIST)
        require -- from COLLECTION
            extendible: fl_extendible
        do
            arity := arity + 1
            child_index := arity
            force_i_th (v, arity)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)
        do
            replace (other.item)
            fill_subtree (other)
        end

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    put_i_th (v: like array_item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        do
            area.put (v, i - lower)
        ensure then -- from INDEXABLE
            insertion_done: array_item (k) = v
        end

    put_child (n: like parent) is
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of replace_child.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            fl_replace (n)
            n.attach_to_parent (Current)
        ensure then
            child_replaced: n.parent = Current
        end

    put_left (v: like item) is
            -- Add v to the left of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        do
            parent.child_go_i_th (position_in_parent - 1)
            parent.child_replace (v)
        ensure
            item_put: left_sibling.item = v
        end

    put_left_sibling (other: like parent) is
            -- Make other the left sibling of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        do
            parent.child_go_i_th (position_in_parent - 1)
            parent.replace_child (other)
        ensure
            left_sibling_replaced: left_sibling = other
        end

    put_right (v: like item) is
            -- Add v to the right of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        do
            parent.child_go_i_th (position_in_parent + 1)
            parent.child_replace (v)
        ensure
            item_put: right_sibling.item = v
        end

    put_right_sibling (other: like parent) is
            -- Make other the right sibling of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        do
            parent.child_go_i_th (position_in_parent + 1)
            parent.replace_child (other)
        ensure
            right_sibling_replaced: right_sibling = other
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    replace_child (n: like parent) is
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of put_child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            fl_replace (n)
            n.attach_to_parent (Current)
        ensure -- from TREE
            child_replaced: child = n
        ensure then
            child_replaced: n.parent = Current
        end

    sprout is
            -- Make current node a root.
            -- (from TREE)
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature {NONE} -- Element change

    enter (v: like array_item; i: INTEGER) is
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)
        do
            area.put (v, i - lower)
        end

    fl_fill (other: CONTAINER [FIXED_TREE [G]]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            fl_extendible
        local
            lin_rep: LINEAR [FIXED_TREE [G]]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not fl_extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

    force_i_th (v: like array_item; i: INTEGER) is
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        do
            if i < lower then
                auto_resize (i, upper)
            elseif i > upper then
                auto_resize (lower, i)
            end
            put_i_th (v, i)
        ensure -- from ARRAY
            inserted: array_item (i) = v
            higher_count: arity >= old arity
        end

    fl_put (v: like first_child) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from FIXED_LIST)
        require -- from COLLECTION
            extendible: fl_extendible
        require else -- from FIXED_LIST
            True
        do
            fl_replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: arity = old arity
        end

    sequence_put (v: like child) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: fl_extendible
        do
            extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
        end

    fl_remove is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from FIXED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: fl_writable
        local
            i, j: INTEGER
            default_value: FIXED_TREE [G]
        do
            if not child_off then
                from
                    i := child_index - 1
                until
                    i >= arity - 1
                loop
                    j := i + 1
                    area.put (area.item (j), i)
                    i := j
                end
                put_i_th (default_value, arity)
                arity := arity - 1
            end
        end

    fl_replace (v: like first_child) is
            -- Replace current item by v.
            -- (from FIXED_LIST)
        require -- from ACTIVE
            writable: fl_writable
        do
            put_i_th (v, child_index)
        ensure -- from ACTIVE
            item_replaced: child = v
        end

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER) is
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)
        local
            other_area: like area
            other_lower: INTEGER
            start0, end0, index0: INTEGER
        do
            other_area := other.area
            other_lower := other.lower
            start0 := start_pos - other_lower
            end0 := end_pos - other_lower
            index0 := index_pos - lower
            spsubcopy ($other_area, $area, start0, end0, index0)
        end

feature -- Removal

    remove_child is
            -- Remove active child.
        do
            fl_replace (void)
        ensure then
            child_removed: child = void
        end

    wipe_out is
        obsolete "Not applicable since not `prunable'. Use `discard_items' instead."
            -- Make array empty.
            -- (from ARRAY)
        require -- from COLLECTION
            prunable
        do
            discard_items
        ensure -- from COLLECTION
            wiped_out: is_leaf
        end

feature {NONE} -- Removal

    clear_all is
            -- Reset all items to default values.
            -- (from ARRAY)
        do
            area.clear_all
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default
        end

    discard_items is
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        do
            make_area (capacity)
        ensure -- from ARRAY
            default_items: all_default
        end

    prune_all (v: FIXED_TREE [G]) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature {NONE} -- Resizing

    automatic_grow is
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        do
            grow (capacity + additional_space)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
        end

    grow (i: INTEGER) is
            -- Change the capacity to at least i.
            -- (from ARRAY)
        do
            if i > capacity then
                resize (lower, upper + i - capacity)
            end
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        end

    resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        local
            old_size, new_size, old_count: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                old_count := upper - lower + 1
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, old_count)
            end
            lower := new_lower
            upper := new_upper
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from FIXED_LIST)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        local
            old_item: like child
        do
            old_item := child
            fl_replace (array_item (i))
            put_i_th (old_item, i)
        ensure -- from CHAIN
            swapped_to_item: child = old array_item (i)
            swapped_from_item: array_item (i) = old child
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from TREE)
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature {NONE} -- Conversion

    fl_lin_rep: LINEAR [FIXED_TREE [G]] is
            -- Representation as a linear structure
            -- (from LINEAR)
        do
            Result := Current
        end

    to_c: ANY is
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)
        do
            Result := area
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.arity, other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from CHAIN
            not_off_unless_after: child_off implies child_after
            valid_subchain: n >= 0
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0
        local
            counter: INTEGER
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
            until
                child_after or else (counter = n)
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {NONE} -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current is
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        do
            create Result.array_make (start_pos, end_pos)
            Result.subcopy (Current, start_pos, end_pos, start_pos)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos
        end

feature {NONE} -- Inapplicable

    bag_put (v: FIXED_TREE [G]) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: fl_extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature -- Inapplicable

    prune (v: FIXED_TREE [G]) is
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        require -- from TREE
            is_child: n.parent = Current
        do
        ensure -- from TREE
            n_is_root: n.is_root
        end

feature {FIXED_TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node
            -- and set position_in_parent.
        do
            parent := n
            position_in_parent := n.child_index
        ensure -- from TREE
            new_parent: parent = n
        end

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
        local
            pos: CURSOR
        do
            from
                Result := new_node
                pos := child_cursor
                Result.child_start
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result.replace_child (child.duplicate_all)
                end
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other
        local
            temp: like parent
        do
            from
                other.child_start
                child_start
            until
                child_after
            loop
                if other.child /= void then
                    create temp.make (other.arity, other.child_item)
                    temp.fill_subtree (other.child)
                end
                replace_child (temp)
                child_forth
                other.child_forth
            end
        end

    new_node: like Current is
            -- Instance of class `like Current'.
            -- New allocated node of arity arity
            -- and node value item
        do
            create Result.make (arity, item)
        end

feature {NONE} -- Implementation

    arycpy (old_area: POINTER; newsize, s, n: INTEGER): like area is
            -- New area of size newsize containing n items
            -- from oldarea.
            -- Old items are at position s in new area.
            -- (from ARRAY)
        external
            "C | %"eif_misc.h%""
        end

    auto_resize (min_index, max_index: INTEGER) is
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- If area must be extended, ensure that space for at least
            -- additional_space item is added.
            -- (from ARRAY)
        require -- from ARRAY
            valid_indices: min_index <= max_index
        local
            old_size, new_size: INTEGER
            new_lower, new_upper: INTEGER
        do
            if empty_area then
                new_lower := min_index
                new_upper := max_index
            else
                new_lower := min_index.min (lower)
                new_upper := max_index.max (upper)
            end
            new_size := new_upper - new_lower + 1
            if not empty_area then
                old_size := area.count
                if new_size > old_size and new_size - old_size < additional_space then
                    new_size := old_size + additional_space
                end
            end
            if empty_area then
                make_area (new_size)
            elseif new_size > old_size or new_lower < lower then
                area := arycpy ($area, new_size, lower - new_lower, capacity)
            end
            lower := new_lower
            upper := new_upper
        end

    child_remove is
            -- Remove item of current child
            -- (from TREE)
        do
        end

    empty_area: BOOLEAN is
            -- Is area empty?
            -- (from ARRAY)
        do
            Result := (area.count = 0)
        end

    Extendible: BOOLEAN is False
            -- May new items be added?

    force (v: like child) is
            -- Not used since extend is not always applicable.
            -- (from FIXED_LIST)
        require -- from SEQUENCE
            extendible: fl_extendible
        do
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)
        end

    position_in_parent: INTEGER
            -- Position of current node in parent

    remove is
            -- Remove current item
            -- (from TREE)
        do
        end

    spsubcopy (source, target: POINTER; s, e, i: INTEGER) is
            -- Copy elements of source within bounds s
            -- and e to target starting at index i.
            -- (from ARRAY)
        external
            "C | %"eif_copy.h%""
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
            -- (from TREE)
        require -- from TREE
            other_not_empty: other /= void and then not other.is_leaf
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
            -- (from TREE)
        require -- from TREE
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_leaf and not t2.is_leaf
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

feature {TREE} -- Implementation

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
            -- (from TREE)
        do
            from
                child_start
            until
                child_off
            loop
                if child /= void then
                    al.extend (child_item)
                    child.fill_list (al)
                end
                child_forth
            end
        end

    subtree_count: INTEGER is
            -- Number of items in children
            -- (from TREE)
        local
            pos: CURSOR
        do
            Result := arity
            from
                pos := child_cursor
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result := Result + child.subtree_count
                end
                child_forth
            end
            child_go_to (pos)
        end

    subtree_has (v: G): BOOLEAN is
            -- Do children include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        local
            cursor: CURSOR
        do
            cursor := child_cursor
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    if object_comparison then
                        Result := (v /= void) and then (child_item /= void) and then v.is_equal (child_item)
                    else
                        Result := v = child_item
                    end
                end
                child_forth
            end
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    Result := child.subtree_has (v)
                end
                child_forth
            end
            child_go_to (cursor)
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [FIXED_TREE [G]]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child, 1)
                action.call (t)
                child_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [FIXED_TREE [G]]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child, 1)
                if test.item (t) then
                    action.call (t)
                end
                child_forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [FIXED_TREE [G]]
            c: CURSOR
            t: TUPLE [FIXED_TREE [G]]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
                Result := True
            until
                child_after or not Result
            loop
                t.put (child, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [FIXED_TREE [G]]
            c: CURSOR
            t: TUPLE [FIXED_TREE [G]]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
            until
                child_after or Result
            loop
                t.put (child, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from FIXED_LIST
    empty_means_storage_empty: is_leaf implies all_default
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child = array_item (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: fl_writable implies fl_readable
    empty_constraint: is_leaf implies (not fl_readable) and (not fl_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: arity >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + arity - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: arity <= capacity
    full_definition: fl_full = (arity = capacity)
        -- from FIXED
    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Trees where each node has a fixed number of children
        (The number of children is arbitrary but cannot be
        changed once the node has been created
    ]"
    names: fixed_tree, tree, fixed_list
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    FIXED_TREE [G]

create

    make (n: INTEGER; v: G)
            -- Create node with n void children and item v.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v
            node_arity: arity = n

feature -- Initialization

    make (n: INTEGER; v: G)
            -- Create node with n void children and item v.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v
            node_arity: arity = n

feature -- Access

    child_item: like item
            -- Item of active child
        require -- from TREE
            readable: child_readable

    child_cursor: CURSOR
            -- Current cursor position
            -- (from FIXED_LIST)

    first_child: like parent
            -- Leftmost child
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    child_index: INTEGER
            -- Current position in the list
            -- (from FIXED_LIST)

    index_of (v: like child; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Content of cell.
            -- (from CELL)

    child: FIXED_TREE [G]
            -- Current item
            -- (from FIXED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: fl_readable
        require -- from TREE
            readable: readable_child

    last_child: like first_child
            -- Item at last position
            -- (from FIXED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    sequential_occurrences (v: FIXED_TREE [G]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: FIXED_TREE [G]
            -- Parent of current node

    right_sibling: like parent
            -- Right neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

    infix "@" (i: INTEGER): FIXED_TREE [G]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [FIXED_TREE [G]]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- (from FIXED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: FIXED_TREE [G]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    fl_changeable_object_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_contractable: BOOLEAN
            -- May items be removed?
        ensure
            Result = not child_off

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Full: BOOLEAN is True
            -- Is tree full?

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: FIXED_TREE [G]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    fl_object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from FIXED_LIST)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)
            -- (from FIXED)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Is p a valid cursor?
            -- (from FIXED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (from FIXED_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next position, if any.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from FIXED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to element remembered in p.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from FIXED_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)

    search_child (v: like child)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child

    child_start
            -- Move cursor to first position.
            -- (from FIXED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    append (s: SEQUENCE [FIXED_TREE [G]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    child_put (v: like item)
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    extend (v: like child)
            -- Add v to end.
            -- Move index to the current item.
            -- (from FIXED_LIST)
        require -- from COLLECTION
            extendible: fl_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_i_th (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: array_item (k) = v

    put_child (n: like parent)
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of replace_child.
        ensure then
            child_replaced: n.parent = Current

    put_left (v: like item)
            -- Add v to the left of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        ensure
            item_put: left_sibling.item = v

    put_left_sibling (other: like parent)
            -- Make other the left sibling of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        ensure
            left_sibling_replaced: left_sibling = other

    put_right (v: like item)
            -- Add v to the right of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        ensure
            item_put: right_sibling.item = v

    put_right_sibling (other: like parent)
            -- Make other the right sibling of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        ensure
            right_sibling_replaced: right_sibling = other

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of put_child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n
        ensure then
            child_replaced: n.parent = Current

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    remove_child
            -- Remove active child.
        ensure then
            child_removed: child = void

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from FIXED_LIST)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child = old array_item (i)
            swapped_from_item: array_item (i) = old child

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from CHAIN
            not_off_unless_after: child_off implies child_after
            valid_subchain: n >= 0
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Inapplicable

    prune (v: FIXED_TREE [G])
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from FIXED_LIST
    empty_means_storage_empty: is_leaf implies all_default
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child = array_item (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: fl_writable implies fl_readable
    empty_constraint: is_leaf implies (not fl_readable) and (not fl_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: arity >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + arity - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: arity <= capacity
    full_definition: fl_full = (arity = capacity)
        -- from FIXED
    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FIXED_TREE [G]

Ancestors
    CELL [G]
    FIXED_LIST [G]
    TREE [G]

Clients
    FIXED_TREE [G]

Suppliers
    BOOLEAN
    FIXED_TREE [G]
    INTEGER
    TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIXED_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Trees where each node has a fixed number of children
        (The number of children is arbitrary but cannot be
        changed once the node has been created
    ]"
    names: fixed_tree, tree, fixed_list
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    FIXED_TREE [G]

create
    make

feature -- Initialization

    make (n: INTEGER; v: G)
            -- Create node with n void children and item v.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v
            node_arity: arity = n

feature -- Access

    parent: FIXED_TREE [G]
            -- Parent of current node

    first_child: like parent
            -- Leftmost child

    child_item: like item
            -- Item of active child

    left_sibling: like parent
            -- Left neighbor, if any

    right_sibling: like parent
            -- Right neighbor, if any

feature -- Status report

    child_contractable: BOOLEAN
            -- May items be removed?
        ensure
            Result = not child_off

    Full: BOOLEAN is True
            -- Is tree full?

feature -- Element change

    child_put (v: like item)
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_replace.

    child_replace (v: like item)
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_put.

    put_left (v: like item)
            -- Add v to the left of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        ensure
            item_put: left_sibling.item = v

    put_right (v: like item)
            -- Add v to the right of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        ensure
            item_put: right_sibling.item = v

    put_child (n: like parent)
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of replace_child.
        ensure then
            child_replaced: n.parent = Current

    replace_child (n: like parent)
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of put_child.
        ensure then
            child_replaced: n.parent = Current

    put_left_sibling (other: like parent)
            -- Make other the left sibling of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        ensure
            left_sibling_replaced: left_sibling = other

    put_right_sibling (other: like parent)
            -- Make other the right sibling of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        ensure
            right_sibling_replaced: right_sibling = other

feature -- Removal

    remove_child
            -- Remove active child.
        ensure then
            child_removed: child = void

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.

    copy (other: like Current)
            -- Copy contents from other.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a linked list representation"
    status: "See notice at end of class"
    names: linked_tree, tree, linked_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_TREE [G]

inherit
    DYNAMIC_TREE [G]
        rename
            empty as ll_empty
        export
            {NONE} ll_empty
        undefine
            child_after,
            child_before,
            child_item,
            child_off
        redefine
            parent,
            copy
        select
            has
        end

    LINKABLE [G]
        rename
            right as right_sibling,
            put_right as l_put_right
        export
            {ANY} put, replace,
            {LINKED_TREE} l_put_right, forget_right
        undefine
            is_equal
        redefine
            copy
        end

    LINKED_LIST [G]
        rename
            active as child,
            put_left as child_put_left,
            put_right as child_put_right,
            after as child_after,
            back as child_back,
            before as child_before,
            count as arity,
            cursor as child_cursor,
            duplicate as ll_duplicate,
            empty as ll_empty,
            is_empty as is_leaf,
            extend as child_extend,
            extendible as child_extendible,
            fill as ll_fill,
            finish as child_finish,
            first_element as first_child,
            forth as child_forth,
            full as ll_full,
            go_i_th as child_go_i_th,
            go_to as child_go_to,
            has as ll_has,
            index as child_index,
            isfirst as child_isfirst,
            islast as child_islast,
            item as child_item,
            last_element as last_child,
            make as ll_make,
            merge_left as ll_merge_left,
            merge_right as ll_merge_right,
            off as child_off,
            prune as ll_prune,
            put as child_put,
            readable as child_readable,
            remove as remove_child,
            remove_left as remove_left_child,
            remove_right as remove_right_child,
            replace as child_replace,
            search as search_child,
            start as child_start,
            writable as child_writable
        export
            {ANY} child,
            {NONE} ll_make, ll_has, ll_merge_left, ll_merge_right, ll_fill, ll_duplicate, ll_full, ll_empty
        undefine
            child_readable,
            is_leaf,
            child_writable,
            linear_representation,
            child_isfirst,
            child_islast,
            valid_cursor_index,
            is_equal
        redefine
            first_child,
            new_cell,
            copy
        select
            is_leaf
        end

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create single node with item v.
        do
            put (v)
            ll_make
        ensure
            is_root
            is_leaf
        end

feature -- Access

    parent: LINKED_TREE [G]
            -- Parent of current node

    first_child: like parent
            -- Leftmost child

    left_sibling: like parent is
            -- Left neighbor (if any)
        do
            if parent /= void then
                from
                    Result := parent.first_child
                until
                    Result = void or else Result.right_sibling = Current
                loop
                    Result := Result.right_sibling
                end
            end
        end

feature {RECURSIVE_CURSOR_TREE} -- Element change

    set_child (n: like parent) is
            -- Set the child of parent to n.
        do
            child := n
        ensure then
            child_set: child = n
        end

feature -- Element change

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if is_leaf then
                first_child := n
                child := n
            else
                last_child.l_put_right (n)
                if child_after then
                    child := n
                end
            end
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    replace_child (n: like parent) is
            -- Replace current child by n.
        do
            put_child_right (n)
            remove_child
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        do
            child_back
            put_child_right (n)
            child_forth
            child_forth
        end

    put_child_right (n: like parent) is
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if child_before then
                n.l_put_right (first_child)
                first_child := n
            else
                n.l_put_right (child.right_sibling)
                child.l_put_right (n)
            end
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        do
            attach (other)
            ll_merge_left (other)
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        do
            attach (other)
            ll_merge_right (other)
        end

feature -- Removal

    prune (n: like first_child) is
        local
            l_child: like first_child
            left_child: like first_child
        do
            from
                l_child := first_child
            until
                l_child = void or l_child = n
            loop
                left_child := l_child
                l_child := l_child.right_sibling
            end
            if l_child /= void then
                if left_child /= void then
                    left_child.l_put_right (l_child.right_sibling)
                    if child = n then
                        child := left_child
                    end
                else
                    first_child := first_child.right_sibling
                    if n = child then
                        child := first_child
                    end
                end
                arity := arity - 1
                if is_leaf and not child_before then
                    child_after := True
                end
                n.attach_to_parent (void)
                n.forget_right
            end
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        end

feature {LINKED_TREE} -- Implementation

    new_cell (v: like item): like first_child is
            -- New cell containing v
        do
            create Result.make (v)
            Result.attach_to_parent (Current)
        end

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (item)
        end

feature {NONE} -- Implementation

    attach (other: like first_child) is
            -- Attach all children of other to current node.
        local
            cursor: CURSOR
        do
            cursor := other.child_cursor
            from
                other.child_start
            until
                other.child_off
            loop
                other.child.attach_to_parent (Current)
                other.child_forth
            end
            other.child_go_to (cursor)
        end

invariant

    no_void_child: readable_child = child_readable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees implemented using a linked list representation"
    create: make

Ancestors
    DYNAMIC_TREE [G]
    LINKABLE [G]
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] LINKED_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] LINKED_TREE [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_child: [like parent] LINKED_TREE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_TREE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] LINKED_TREE [G]): BOOLEAN
    item: G
    last: [like item] G
    last_child: [like first_element] LINKED_TREE [G]
    left_sibling: [like parent] LINKED_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    parent: LINKED_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] LINKED_TREE [G]
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    force (v: [like item] G)
    ll_prune (v: [like item] G)
    make (v: [like item] G)
    merge_tree_after (other: [like first_child] LINKED_TREE [G])
    merge_tree_before (other: [like first_child] LINKED_TREE [G])
    move (i: INTEGER)
    prune (n: [like first_child] LINKED_TREE [G])
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_child (n: [like parent] LINKED_TREE [G])
    put_child_left (n: [like parent] LINKED_TREE [G])
    put_child_right (n: [like parent] LINKED_TREE [G])
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] LINKED_TREE [G])
    search_child (v: [like item] G)
    sprout
    swap (i: INTEGER)
    wipe_out

Constraints
    no void child

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a linked list representation"
    status: "See notice at end of class"
    names: linked_tree, tree, linked_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class
    LINKED_TREE [G]

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create single node with item v.
        do
            put (v)
            ll_make
        ensure
            is_root
            is_leaf
        end

feature {NONE} -- Initialization

    ll_make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            child_before := True
        ensure -- from LINKED_LIST
            is_before: child_before
        end

feature -- Access

    child_cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (child, child_after, child_before)
        end

    first: like child_item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        do
            Result := first_child.item
        end

    first_child: like parent
            -- Leftmost child

    i_th (i: INTEGER): like child_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := child_cursor
            child_go_i_th (i)
            Result := child_item
            child_go_to (pos)
        end

    child_index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if child_after then
                Result := arity + 1
            elseif not child_before then
                p ?= child_cursor;
                check
                    p /= void
                end;
                from
                    child_start
                    Result := 1
                until
                    p.active = child
                loop
                    child_forth
                    Result := Result + 1
                end;
                child_go_to (p)
            end
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1
        end

    index_of (v: like child_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_index_of (v, i)
            child_go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    child_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable
        do
            Result := child.item
        end

    item: G
            -- Content of cell.
            -- (from CELL)

    last: like child_item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        do
            Result := last_child.item
        end

    left_sibling: like parent is
            -- Left neighbor (if any)
        require -- from TREE
            is_not_root: not is_root
        do
            if parent /= void then
                from
                    Result := parent.first_child
                until
                    Result = void or else Result.right_sibling = Current
                loop
                    Result := Result.right_sibling
                end
            end
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                child_start
                search_child (v)
            until
                exhausted
            loop
                Result := Result + 1
                child_forth
                search_child (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent: LINKED_TREE [G]
            -- Parent of current node

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    infix "@" (i: INTEGER): like child_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := child_cursor
            child_go_i_th (i)
            Result := child_item
            child_go_to (pos)
        end

feature {NONE} -- Access

    ll_has (v: like child_item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_has (v)
            child_go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    sequential_has (v: like child_item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            child_start
            if not child_off then
                search_child (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    sequential_index_of (v: like child_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child_item /= void and then v.is_equal (child_item) then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            else
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child_item = v then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like child_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (child_item /= void and then v.is_equal (child_item))
                loop
                    child_forth
                end
            else
                from
                until
                    exhausted or else v = child_item
                loop
                    child_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item
        end

feature -- Measurement

    child_capacity: INTEGER is
            -- Maximal number of children
            -- (from TREE)
        do
            Result := arity
        end

    count: INTEGER is
            -- Number of items
            -- (from TREE)
        do
            Result := subtree_count + 1
        end

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, arity)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity
        end

    occurrences (v: like child_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_occurrences (v)
            child_go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like child_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_occurrences (v)
            child_go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_leaf = other.is_leaf) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_leaf then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity
        end

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = 1
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = child_capacity
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := child_off
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
            -- (from TREE)
        do
            Result := False
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)
        do
            check
                put_constraint: (v /= last_child.item) implies not child_off
            end
            Result := (v = last_child.item) or else (v = child_item)
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- (from TREE)
        do
            Result := arity = 0
        end

    is_root: BOOLEAN is
            -- Is there no parent?
            -- (from TREE)
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := child_after or child_before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
            -- (from TREE)
        do
            Result := not child_off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_child
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_child
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right_sibling
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= arity)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
            -- (from TREE)
        do
            Result := not child_off
        end

feature {NONE} -- Status report

    ll_empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_leaf
        end

    Ll_full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before
        do
            if is_leaf then
                child_before := True
                child_after := False
            elseif child_after then
                child_after := False
            elseif child_isfirst then
                child_before := True
            else
                child := previous
            end
        end

    child_finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        local
            p: like first_child
        do
            if not is_leaf then
                from
                    p := child
                until
                    p.right_sibling = void
                loop
                    p := p.right_sibling
                end
                child := p
                child_after := False
                child_before := False
            else
                child_before := True
                child_after := False
            end
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before
        end

    child_forth is
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        local
            old_active: like first_child
        do
            if child_before then
                child_before := False
                if is_leaf then
                    child_after := True
                end
            else
                old_active := child
                child := child.right_sibling
                if child = void then
                    child := old_active
                    child_after := True
                end
            end
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                child_before := True
                child_after := False
                child := first_child
            elseif i = arity + 1 then
                child_before := False;
                child_after := True;
                child := last_child
            else
                move (i - child_index)
            end
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i
        end

    child_go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            child_after := ll_c.after
            child_before := ll_c.before
            if child_before then
                child := first_child
            elseif child_after then
                child := last_child
            else
                child := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_child
        do
            if i > 0 then
                if child_before then
                    child_before := False
                    counter := 1
                end
                from
                    p := child
                until
                    (counter = i) or else (p = void)
                loop
                    child := p
                    p := p.right_sibling
                    counter := counter + 1
                end
                if p = void then
                    child_after := True
                else
                    child := p
                end
            elseif i < 0 then
                new_index := child_index + i;
                child_before := True;
                child_after := False;
                child := first_child;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after
        end

    search_child (v: like child_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if child_before and not is_leaf then
                child_forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item
        end

    child_start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_child /= void then
                child := first_child
                child_after := False
            else
                child_after := True
            end
            child_before := False
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after
        end

feature {RECURSIVE_CURSOR_TREE} -- Element change

    set_child (n: like parent) is
            -- Set the child of parent to n.
        require -- from DYNAMIC_TREE
            non_void_argument: n /= void
        do
            child := n
        ensure then
            child_set: child = n
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                child_extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: arity >= old arity
        end

    extend (v: like item) is
            -- Add v as new child.
            -- (from DYNAMIC_TREE)
        do
            child_extend (v)
        end

    child_extend (v: like child_item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        local
            p: like first_child
        do
            p := new_cell (v)
            if is_leaf then
                first_child := p
                child := p
            else
                last_child.l_put_right (p)
                if child_after then
                    child := p
                end
            end
            arity := arity + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)
        do
            replace (other.item)
            fill_subtree (other)
        end

    force (v: like child_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        do
            child_extend (v)
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        do
            attach (other)
            ll_merge_right (other)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        do
            attach (other)
            ll_merge_left (other)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf
        end

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    child_put (v: like child_item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        do
            child_replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity
        end

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if is_leaf then
                first_child := n
                child := n
            else
                last_child.l_put_right (n)
                if child_after then
                    child := n
                end
            end
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void
        do
            child_back
            put_child_right (n)
            child_forth
            child_forth
        end

    put_child_right (n: like parent) is
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if child_before then
                n.l_put_right (first_child)
                first_child := n
            else
                n.l_put_right (child.right_sibling)
                child.l_put_right (n)
            end
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    put_front (v: like child_item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_child
        do
            p := new_cell (v)
            p.l_put_right (first_child)
            first_child := p
            if child_before or is_leaf then
                child := p
            end
            arity := arity + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v
        end

    put_i_th (v: like child_item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := child_cursor
            child_go_i_th (i)
            child_replace (v)
            child_go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    child_put_left (v: like child_item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        local
            p: like first_child
        do
            if is_leaf then
                put_front (v)
            elseif child_after then
                child_back;
                child_put_right (v);
                move (2)
            else
                p := new_cell (child.item)
                p.l_put_right (child.right_sibling)
                child.put (v)
                child.l_put_right (p)
                child := p
                arity := arity + 1
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    child_put_right (v: like child_item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        local
            p: like first_child
        do
            p := new_cell (v)
            check
                is_leaf implies child_before
            end
            if child_before then
                p.l_put_right (first_child)
                first_child := p
                child := p
            else
                p.l_put_right (child.right_sibling)
                child.l_put_right (p)
            end
            arity := arity + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    child_replace (v: like child_item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        do
            child.put (v)
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v
        end

    replace_child (n: like parent) is
            -- Replace current child by n.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        do
            put_child_right (n)
            remove_child
        ensure -- from TREE
            child_replaced: child = n
        end

    sprout is
            -- Make current node a root.
            -- (from TREE)
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature {NONE} -- Element change

    ll_fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            child_extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not child_extendible or else lin_rep.off
            loop
                child_extend (lin_rep.item)
                lin_rep.forth
            end
        end

    ll_merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        local
            other_first_element: like first_child
            other_last_element: like first_child
            p: like first_child
            other_count: INTEGER
        do
            if not other.is_leaf then
                other_first_element := other.first_child
                other_last_element := other.last_child
                other_count := other.arity
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_leaf then
                    first_child := other_first_element
                    child := first_child
                elseif child_isfirst then
                    p := first_child;
                    other_last_element.l_put_right (p);
                    first_child := other_first_element
                else
                    p := previous
                    if p /= void then
                        p.l_put_right (other_first_element)
                    end
                    other_last_element.l_put_right (child)
                end
                arity := arity + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf
        end

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        local
            other_first_element: like first_child
            other_last_element: like first_child
            other_count: INTEGER
        do
            if not other.is_leaf then
                other_first_element := other.first_child
                other_last_element := other.last_child
                other_count := other.arity
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_leaf then
                    first_child := other_first_element
                    child := first_child
                else
                    if not child_islast then
                        other_last_element.l_put_right (child.right_sibling)
                    end
                    child.l_put_right (other_first_element)
                end
                arity := arity + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf
        end

    sequence_put (v: like child_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: child_extendible
        do
            child_extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
        end

feature -- Removal

    prune (n: like first_child) is
        require -- from TREE
            is_child: n.parent = Current
        local
            l_child: like first_child
            left_child: like first_child
        do
            from
                l_child := first_child
            until
                l_child = void or l_child = n
            loop
                left_child := l_child
                l_child := l_child.right_sibling
            end
            if l_child /= void then
                if left_child /= void then
                    left_child.l_put_right (l_child.right_sibling)
                    if child = n then
                        child := left_child
                    end
                else
                    first_child := first_child.right_sibling
                    if n = child then
                        child := first_child
                    end
                end
                arity := arity - 1
                if is_leaf and not child_before then
                    child_after := True
                end
                n.attach_to_parent (void)
                n.forget_right
            end
        ensure -- from TREE
            n_is_root: n.is_root
        end

    ll_prune (v: like child_item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search_child (v)
            if not exhausted then
                remove_child
            end
        end

    prune_all (v: like child_item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                child_start
                search_child (v)
            until
                exhausted
            loop
                remove_child
                search_child (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove_child is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        local
            removed, succ: like first_child
        do
            removed := child
            if child_isfirst then
                first_child := first_child.right_sibling
                child.forget_right
                child := first_child
                if arity = 1 then
                    check
                        no_active: child = void
                    end
                    child_after := True
                end
            elseif child_islast then
                child := previous;
                if child /= void then
                    child.forget_right
                end;
                child_after := True
            else
                succ := child.right_sibling
                previous.l_put_right (succ)
                child.forget_right
                child := succ
            end
            arity := arity - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    remove_left_child is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        do
            move (- 2)
            remove_right_child
            child_forth
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1
        end

    remove_right_child is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        local
            removed, succ: like first_child
        do
            if child_before then
                removed := first_child
                first_child := first_child.right_sibling
                child.forget_right
                child := first_child
            else
                succ := child.right_sibling
                removed := succ
                child.l_put_right (succ.right_sibling)
                succ.forget_right
            end
            arity := arity - 1
            cleanup_after_remove (removed)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        do
            child := void
            first_child := void
            child_before := True
            child_after := False
            arity := 0
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before
        end

feature {NONE} -- Removal

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                child_start
            until
                is_leaf
            loop
                remove_child
            end
        ensure -- from COLLECTION
            wiped_out: is_leaf
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        local
            old_item, new_item: like child_item
            pos: CURSOR
        do
            pos := child_cursor
            old_item := child_item
            child_go_i_th (i)
            new_item := child_item
            child_replace (old_item)
            child_go_to (pos)
            child_replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    fill_from_binary (b: BINARY_TREE [G]) is
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)
        local
            current_node: BINARY_TREE [G]
        do
            replace (b.item)
            wipe_out
            if b.has_left then
                from
                    current_node := b.left_child
                until
                    current_node = void
                loop
                    child_put_right (current_node.item)
                    child_forth
                    child.fill_from_binary (current_node)
                    current_node := current_node.right_child
                end
            end
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from TREE)
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_tree
                pos := child_cursor
            until
                child_after or else (counter = n)
            loop
                Result.put_child (child.duplicate_all)
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {NONE} -- Duplication

    ll_duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: child_off implies child_after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := child_cursor
            until
                (counter = n) or else exhausted
            loop
                Result.child_extend (child_item)
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: child_extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {LINKED_TREE} -- Implementation

    forget_right is
            -- Remove right link.
            -- (from LINKABLE)
        do
            right_sibling := void
        ensure -- from LINKABLE
            not_chained: right_sibling = void
        end

    new_cell (v: like item): like first_child is
            -- New cell containing v
        do
            create Result.make (v)
            Result.attach_to_parent (Current)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_tree: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (item)
        ensure -- from DYNAMIC_TREE
            result_exists: Result /= void
            result_item: Result.item = item
        end

    l_put_right (other: like Current) is
            -- Put other to the right of current cell.
            -- (from LINKABLE)
        do
            right_sibling := other
        ensure -- from LINKABLE
            chained: right_sibling = other
        end

feature {NONE} -- Implementation

    attach (other: like first_child) is
            -- Attach all children of other to current node.
        local
            cursor: CURSOR
        do
            cursor := other.child_cursor
            from
                other.child_start
            until
                other.child_off
            loop
                other.child.attach_to_parent (Current)
                other.child_forth
            end
            other.child_go_to (cursor)
        end

    child_remove is
            -- Remove item of current child
            -- (from TREE)
        do
        end

    remove is
            -- Remove current item
            -- (from TREE)
        do
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
            -- (from TREE)
        require -- from TREE
            other_not_empty: other /= void and then not other.is_leaf
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
            -- (from TREE)
        require -- from TREE
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_leaf and not t2.is_leaf
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

feature {DYNAMIC_TREE} -- Implementation

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
            -- (from DYNAMIC_TREE)
        local
            pos: CURSOR
        do
            from
                Result := new_tree
                pos := child_cursor
                child_start
            until
                child_off
            loop
                Result.put_child (child.duplicate_all)
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other.
            -- (from DYNAMIC_TREE)
        do
            from
                other.child_start
            until
                other.child_off
            loop
                child_extend (other.item)
                other.child_forth
            end
            from
                child_start
                other.child_start
            until
                child_off
            loop
                child.fill_subtree (other.child)
                other.child_forth
                child_forth
            end
        end

feature {TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node.
            -- (from TREE)
        do
            parent := n
        ensure -- from TREE
            new_parent: parent = n
        end

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
            -- (from TREE)
        do
            from
                child_start
            until
                child_off
            loop
                if child /= void then
                    al.extend (child_item)
                    child.fill_list (al)
                end
                child_forth
            end
        end

    subtree_count: INTEGER is
            -- Number of items in children
            -- (from TREE)
        local
            pos: CURSOR
        do
            Result := arity
            from
                pos := child_cursor
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result := Result + child.subtree_count
                end
                child_forth
            end
            child_go_to (pos)
        end

    subtree_has (v: G): BOOLEAN is
            -- Do children include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        local
            cursor: CURSOR
        do
            cursor := child_cursor
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    if object_comparison then
                        Result := (v /= void) and then (child_item /= void) and then v.is_equal (child_item)
                    else
                        Result := v = child_item
                    end
                end
                child_forth
            end
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    Result := child.subtree_has (v)
                end
                child_forth
            end
            child_go_to (cursor)
        end

feature {LINKED_LIST} -- Implementation

    cleanup_after_remove (v: like first_child) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from LINKED_LIST)
        do
            create Result.ll_make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    next: like first_child is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if child_before then
                Result := child
            elseif child /= void then
                Result := child.right_sibling
            end
        end

    previous: like first_child is
            -- Element left of cursor
            -- (from LINKED_LIST)
        local
            p: like first_child
        do
            if child_after then
                Result := child
            elseif not (child_isfirst or child_before) then
                from
                    p := first_child
                until
                    p.right_sibling = child
                loop
                    p := p.right_sibling
                end;
                Result := p
            end
        end

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

    last_child: like first_child is
            -- Tail of list
            -- (from LINKED_LIST)
        require -- from TREE
            is_not_leaf: not is_leaf
        local
            p: like first_child
        do
            if not is_leaf then
                from
                    Result := child
                    p := child.right_sibling
                until
                    p = void
                loop
                    Result := p
                    p := p.right_sibling
                end
            end
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child_item, 1)
                action.call (t)
                child_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child_item, 1)
                if test.item (t) then
                    action.call (t)
                end
                child_forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
                Result := True
            until
                child_after or not Result
            loop
                t.put (child_item, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
            until
                child_after or Result
            loop
                t.put (child_item, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    no_void_child: readable_child = child_readable
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a linked list representation"
    status: "See notice at end of class"
    names: linked_tree, tree, linked_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_TREE [G]

create

    make (v: like item)
            -- Create single node with item v.
        ensure
            is_root
            is_leaf

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.
        ensure
            is_root
            is_leaf

feature -- Access

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    first_child: like parent
            -- Leftmost child

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    child_item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    item: G
            -- Content of cell.
            -- (from CELL)

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    left_sibling: like parent
            -- Left neighbor (if any)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: LINKED_TREE [G]
            -- Parent of current node

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before

    child_forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    prune (n: like first_child)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    ll_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

    last_child: like first_child
            -- Tail of list
            -- (from LINKED_LIST)
        require -- from TREE
            is_not_leaf: not is_leaf

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    no_void_child: readable_child = child_readable
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    LINKED_TREE [G]

Ancestors
    DYNAMIC_TREE [G]
    LINKABLE [G]
    LINKED_LIST [G]

Clients
    LINKED_CURSOR_TREE [G]
    LINKED_TREE [G]

Suppliers
    BOOLEAN
    INTEGER
    LINKED_TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


LINKED_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a linked list representation"
    status: "See notice at end of class"
    names: linked_tree, tree, linked_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    LINKED_TREE [G]

create
    make

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.
        ensure
            is_root
            is_leaf

feature -- Access

    parent: LINKED_TREE [G]
            -- Parent of current node

    first_child: like parent
            -- Leftmost child

    left_sibling: like parent
            -- Left neighbor (if any)

feature -- Element change

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.

    replace_child (n: like parent)
            -- Replace current child by n.

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.

feature -- Removal

    prune (n: like first_child)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.

invariant

    no_void_child: readable_child = child_readable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees, without commitment to a particular representation"
    status: "See notice at end of class"
    names: tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class
    TREE [G]

inherit
    CONTAINER [G]
        redefine
            is_equal
        end

feature -- Access

    parent: TREE [G]
            -- Parent of current node

    child: like parent is
            -- Current child node
        require
            readable: readable_child
        deferred
        end

    item: G is
            -- Item in current node
        deferred
        end

    child_item: like item is
            -- Item in current child node
        require
            readable: child_readable
        do
            Result := child.item
        end

    child_cursor: CURSOR is
            -- Current cursor position
        deferred
        end

    child_index: INTEGER is
            -- Index of current child
        deferred
        ensure
            valid_index: Result >= 0 and Result <= arity + 1
        end

    first_child: like parent is
            -- Leftmost child
        require
            is_not_leaf: not is_leaf
        deferred
        end

    last_child: like first_child is
            -- Right most child
        require
            is_not_leaf: not is_leaf
        deferred
        end

    left_sibling: like parent is
            -- Left neighbor (if any)
        require
            is_not_root: not is_root
        deferred
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    right_sibling: like parent is
            -- Right neighbor (if any)
        require
            is_not_root: not is_root
        deferred
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
        deferred
        end

    child_capacity: INTEGER is
            -- Maximal number of children
        do
            Result := arity
        end

    count: INTEGER is
            -- Number of items
        do
            Result := subtree_count + 1
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_empty then
                    Result := tree_is_equal (Current, other)
                end
            end
        end

feature -- Status report

    Readable: BOOLEAN is True

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
        do
            Result := not child_off and then (child /= void)
        end

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
        do
            Result := not child_off
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
        do
            Result := not child_off and then (child /= void)
        end

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
        do
            Result := not child_off
        end

    child_off: BOOLEAN is
            -- Is there no current child?
        do
            Result := child_before or child_after
        end

    child_before: BOOLEAN is
            -- Is there no valid child position to the left of cursor?
        do
            Result := child_index = 0
        end

    child_after: BOOLEAN is
            -- Is there no valid child position to the right of cursor?
        do
            Result := child_index = child_capacity + 1
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
        do
            Result := False
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
        do
            Result := arity = 0
        end

    is_root: BOOLEAN is
            -- Is there no parent?
        do
            Result := parent = void
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
        do
            Result := not is_leaf and child_index = 1
        ensure
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
        do
            Result := not is_leaf and child_index = child_capacity
        ensure
            not_is_leaf: Result implies not is_leaf
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
        require
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

feature -- Cursor movement

    child_go_to (p: CURSOR) is
            -- Move cursor to position p.
        deferred
        end

    child_start is
            -- Move cursor to first child.
        deferred
        ensure then
            is_first_child: not is_leaf implies child_isfirst
        end

    child_finish is
            -- Move cursor to last child.
        deferred
        ensure then
            is_last_child: not is_leaf implies child_islast
        end

    child_forth is
            -- Move cursor to next child.
        deferred
        end

    child_back is
            -- Move cursor to previous child.
        deferred
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th child.
        require else
            valid_cursor_index: valid_cursor_index (i)
        deferred
        ensure then
            position: child_index = i
        end

feature -- Element change

    sprout is
            -- Make current node a root.
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

    put (v: like item) is
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
        require
            is_writable: writable
        deferred
        ensure
            item_inserted: item = v
        end

    replace (v: like item) is
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
        require
            is_writable: writable
        deferred
        ensure
            item_inserted: item = v
        end

    child_put (v: like item) is
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
        require
            child_writable: child_writable
        deferred
        ensure
            item_inserted: child_item = v
        end

    child_replace (v: like item) is
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
        require
            child_writable: child_writable
        deferred
        ensure
            item_inserted: child_item = v
        end

    replace_child (n: like parent) is
            -- Put n at current child position.
        require
            writable_child: writable_child
            was_root: n.is_root
        deferred
        ensure
            child_replaced: child = n
        end

    prune (n: like parent) is
            -- Remove n from the children.
        require
            is_child: n.parent = Current
        deferred
        ensure
            n_is_root: n.is_root
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
        do
            replace (other.item)
            fill_subtree (other)
        end

feature -- Conversion

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require
            not_child_off: not child_off
            valid_sublist: n >= 0
        deferred
        end

feature {TREE} -- Implementation

    subtree_has (v: G): BOOLEAN is
            -- Do children include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            cursor: CURSOR
        do
            cursor := child_cursor
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    if object_comparison then
                        Result := (v /= void) and then (child_item /= void) and then v.is_equal (child_item)
                    else
                        Result := v = child_item
                    end
                end
                child_forth
            end
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    Result := child.subtree_has (v)
                end
                child_forth
            end
            child_go_to (cursor)
        end

    subtree_count: INTEGER is
            -- Number of items in children
        local
            pos: CURSOR
        do
            Result := arity
            from
                pos := child_cursor
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result := Result + child.subtree_count
                end
                child_forth
            end
            child_go_to (pos)
        end

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
        do
            from
                child_start
            until
                child_off
            loop
                if child /= void then
                    al.extend (child_item)
                    child.fill_list (al)
                end
                child_forth
            end
        end

    attach_to_parent (n: like parent) is
            -- Make n parent of current node.
        do
            parent := n
        ensure
            new_parent: parent = n
        end

    fill_subtree (s: TREE [G]) is
            -- Fill children with children of other.
        deferred
        end

feature {NONE} -- Implementation

    remove is
            -- Remove current item
        do
        end

    child_remove is
            -- Remove item of current child
        do
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
        require
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_empty and not t2.is_empty
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
        require
            other_not_empty: other /= void and then not other.is_empty
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

invariant

    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TREE [G]

General
    cluster: base.structures.tree
    description: "Trees, without commitment to a particular representation"

Ancestors
    CONTAINER [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] TREE [G]
    first_child: [like parent] TREE [G]
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] TREE [G]): BOOLEAN
    item: G
    last_child: [like first_child] TREE [G]
    left_sibling: [like parent] TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    parent: TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like parent] TREE [G]
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    fill (other: TREE [G])
    prune (n: [like parent] TREE [G])
    put (v: [like item] G)
    replace (v: [like item] G)
    replace_child (n: [like parent] TREE [G])
    sprout

Constraints
    leaf definition
    child off definition
    child before definition
    child isfirst definition
    child islast definition
    child after definition
    child consistency

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees, without commitment to a particular representation"
    status: "See notice at end of class"
    names: tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class
    TREE [G]

feature -- Access

    child: like parent is
            -- Current child node
        require
            readable: readable_child
        deferred
        end

    child_cursor: CURSOR is
            -- Current cursor position
        deferred
        end

    child_index: INTEGER is
            -- Index of current child
        deferred
        ensure
            valid_index: Result >= 0 and Result <= arity + 1
        end

    child_item: like item is
            -- Item in current child node
        require
            readable: child_readable
        do
            Result := child.item
        end

    first_child: like parent is
            -- Leftmost child
        require
            is_not_leaf: not is_leaf
        deferred
        end

    item: G is
            -- Item in current node
        deferred
        end

    last_child: like first_child is
            -- Right most child
        require
            is_not_leaf: not is_leaf
        deferred
        end

    left_sibling: like parent is
            -- Left neighbor (if any)
        require
            is_not_root: not is_root
        deferred
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)
        end

    parent: TREE [G]
            -- Parent of current node

    right_sibling: like parent is
            -- Right neighbor (if any)
        require
            is_not_root: not is_root
        deferred
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)
        end

feature -- Measurement

    arity: INTEGER is
            -- Number of children
        deferred
        end

    child_capacity: INTEGER is
            -- Maximal number of children
        do
            Result := arity
        end

    count: INTEGER is
            -- Number of items
        do
            Result := subtree_count + 1
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_empty = other.is_empty) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_empty then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_after: BOOLEAN is
            -- Is there no valid child position to the right of cursor?
        do
            Result := child_index = child_capacity + 1
        end

    child_before: BOOLEAN is
            -- Is there no valid child position to the left of cursor?
        do
            Result := child_index = 0
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
        do
            Result := not is_leaf and child_index = 1
        ensure
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
        do
            Result := not is_leaf and child_index = child_capacity
        ensure
            not_is_leaf: Result implies not is_leaf
        end

    child_off: BOOLEAN is
            -- Is there no current child?
        do
            Result := child_before or child_after
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
        do
            Result := not child_off and then (child /= void)
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
        do
            Result := False
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
        do
            Result := arity = 0
        end

    is_root: BOOLEAN is
            -- Is there no parent?
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
        require
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
        do
            Result := not child_off
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
        do
            Result := not child_off
        end

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move cursor to previous child.
        deferred
        end

    child_finish is
            -- Move cursor to last child.
        deferred
        ensure then
            is_last_child: not is_leaf implies child_islast
        end

    child_forth is
            -- Move cursor to next child.
        deferred
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th child.
        require else
            valid_cursor_index: valid_cursor_index (i)
        deferred
        ensure then
            position: child_index = i
        end

    child_go_to (p: CURSOR) is
            -- Move cursor to position p.
        deferred
        end

    child_start is
            -- Move cursor to first child.
        deferred
        ensure then
            is_first_child: not is_leaf implies child_isfirst
        end

feature -- Element change

    child_put (v: like item) is
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
        require
            child_writable: child_writable
        deferred
        ensure
            item_inserted: child_item = v
        end

    child_replace (v: like item) is
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
        require
            child_writable: child_writable
        deferred
        ensure
            item_inserted: child_item = v
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
        do
            replace (other.item)
            fill_subtree (other)
        end

    prune (n: like parent) is
            -- Remove n from the children.
        require
            is_child: n.parent = Current
        deferred
        ensure
            n_is_root: n.is_root
        end

    put (v: like item) is
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
        require
            is_writable: writable
        deferred
        ensure
            item_inserted: item = v
        end

    replace (v: like item) is
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
        require
            is_writable: writable
        deferred
        ensure
            item_inserted: item = v
        end

    replace_child (n: like parent) is
            -- Put n at current child position.
        require
            writable_child: writable_child
            was_root: n.is_root
        deferred
        ensure
            child_replaced: child = n
        end

    sprout is
            -- Make current node a root.
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature -- Duplication

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require
            not_child_off: not child_off
            valid_sublist: n >= 0
        deferred
        end

feature {TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node.
        do
            parent := n
        ensure
            new_parent: parent = n
        end

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
        do
            from
                child_start
            until
                child_off
            loop
                if child /= void then
                    al.extend (child_item)
                    child.fill_list (al)
                end
                child_forth
            end
        end

    fill_subtree (s: TREE [G]) is
            -- Fill children with children of other.
        deferred
        end

    subtree_count: INTEGER is
            -- Number of items in children
        local
            pos: CURSOR
        do
            Result := arity
            from
                pos := child_cursor
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result := Result + child.subtree_count
                end
                child_forth
            end
            child_go_to (pos)
        end

    subtree_has (v: G): BOOLEAN is
            -- Do children include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        local
            cursor: CURSOR
        do
            cursor := child_cursor
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    if object_comparison then
                        Result := (v /= void) and then (child_item /= void) and then v.is_equal (child_item)
                    else
                        Result := v = child_item
                    end
                end
                child_forth
            end
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    Result := child.subtree_has (v)
                end
                child_forth
            end
            child_go_to (cursor)
        end

feature {NONE} -- Implementation

    child_remove is
            -- Remove item of current child
        do
        end

    remove is
            -- Remove current item
        do
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
        require
            other_not_empty: other /= void and then not other.is_empty
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
        require
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_empty and not t2.is_empty
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

invariant

    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees, without commitment to a particular representation"
    status: "See notice at end of class"
    names: tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TREE [G]

feature -- Access

    child: like parent
            -- Current child node
        require
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position

    child_index: INTEGER
            -- Index of current child
        ensure
            valid_index: Result >= 0 and Result <= arity + 1

    child_item: like item
            -- Item in current child node
        require
            readable: child_readable

    first_child: like parent
            -- Leftmost child
        require
            is_not_leaf: not is_leaf

    item: G
            -- Item in current node

    last_child: like first_child
            -- Right most child
        require
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor (if any)
        require
            is_not_root: not is_root
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: TREE [G]
            -- Parent of current node

    right_sibling: like parent
            -- Right neighbor (if any)
        require
            is_not_root: not is_root
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children

    child_capacity: INTEGER
            -- Maximal number of children

    count: INTEGER
            -- Number of items

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
        ensure
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
        ensure
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    is_empty: BOOLEAN
            -- Is structure empty of items?

    is_leaf: BOOLEAN
            -- Are there no children?

    is_root: BOOLEAN
            -- Is there no parent?

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
        require
            other_exists: other /= void
        ensure
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True

    readable_child: BOOLEAN
            -- Is there a current child to be read?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
        ensure
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.

    child_finish
            -- Move cursor to last child.
        ensure then
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
        require else
            valid_cursor_index: valid_cursor_index (i)
        ensure then
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.

    child_start
            -- Move cursor to first child.
        ensure then
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
        require
            child_writable: child_writable
        ensure
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
        require
            child_writable: child_writable
        ensure
            item_inserted: child_item = v

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.

    prune (n: like parent)
            -- Remove n from the children.
        require
            is_child: n.parent = Current
        ensure
            n_is_root: n.is_root

    put (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
        require
            is_writable: writable
        ensure
            item_inserted: item = v

    replace (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
        require
            is_writable: writable
        ensure
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
        require
            writable_child: writable_child
            was_root: n.is_root
        ensure
            child_replaced: child = n

    sprout
            -- Make current node a root.

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
        ensure
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require
            not_child_off: not child_off
            valid_sublist: n >= 0

invariant

    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    TREE [G]

Ancestors
    CONTAINER [G]

Descendants
    BINARY_TREE [G]
    DYNAMIC_TREE [G]
    FIXED_TREE [G]

Clients
    ARRAYED_TREE [G]
    DYNAMIC_TREE [G]
    FIXED_TREE [G]
    TREE [G]

Suppliers
    ANY
    ARRAYED_LIST [G]
    BINARY_TREE [G]
    BOOLEAN
    INTEGER
    LINKED_STACK [G]
    TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees, without commitment to a particular representation"
    status: "See notice at end of class"
    names: tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TREE [G]

feature -- Access

    parent: TREE [G]
            -- Parent of current node

    child: like parent
            -- Current child node
        require
            readable: readable_child

    item: G
            -- Item in current node

    child_item: like item
            -- Item in current child node
        require
            readable: child_readable

    child_cursor: CURSOR
            -- Current cursor position

    child_index: INTEGER
            -- Index of current child
        ensure
            valid_index: Result >= 0 and Result <= arity + 1

    first_child: like parent
            -- Leftmost child
        require
            is_not_leaf: not is_leaf

    last_child: like first_child
            -- Right most child
        require
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor (if any)
        require
            is_not_root: not is_root
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    right_sibling: like parent
            -- Right neighbor (if any)
        require
            is_not_root: not is_root
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children

    child_capacity: INTEGER
            -- Maximal number of children

    count: INTEGER
            -- Number of items

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)

feature -- Status report

    Readable: BOOLEAN is True

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?

    readable_child: BOOLEAN
            -- Is there a current child to be read?

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?

    child_off: BOOLEAN
            -- Is there no current child?

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?

    is_empty: BOOLEAN
            -- Is structure empty of items?

    is_leaf: BOOLEAN
            -- Are there no children?

    is_root: BOOLEAN
            -- Is there no parent?

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
        ensure
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
        ensure
            not_is_leaf: Result implies not is_leaf

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
        ensure
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
        require
            other_exists: other /= void
        ensure
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

feature -- Cursor movement

    child_go_to (p: CURSOR)
            -- Move cursor to position p.

    child_start
            -- Move cursor to first child.
        ensure then
            is_first_child: not is_leaf implies child_isfirst

    child_finish
            -- Move cursor to last child.
        ensure then
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.

    child_back
            -- Move cursor to previous child.

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
        require else
            valid_cursor_index: valid_cursor_index (i)
        ensure then
            position: child_index = i

feature -- Element change

    sprout
            -- Make current node a root.

    put (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
        require
            is_writable: writable
        ensure
            item_inserted: item = v

    replace (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
        require
            is_writable: writable
        ensure
            item_inserted: item = v

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
        require
            child_writable: child_writable
        ensure
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
        require
            child_writable: child_writable
        ensure
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Put n at current child position.
        require
            writable_child: writable_child
            was_root: n.is_root
        ensure
            child_replaced: child = n

    prune (n: like parent)
            -- Remove n from the children.
        require
            is_child: n.parent = Current
        ensure
            n_is_root: n.is_root

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
        ensure
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require
            not_child_off: not child_off
            valid_sublist: n >= 0

invariant

    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a two way linked list representation"
    status: "See notice at end of class"
    names: two_way_tree, tree, two_way_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_TREE [G]

inherit
    DYNAMIC_TREE [G]
        undefine
            child_after,
            child_before,
            child_item,
            child_off
        redefine
            parent,
            copy
        select
            has
        end

    BI_LINKABLE [G]
        rename
            left as left_sibling,
            right as right_sibling,
            put_left as bl_put_left,
            put_right as bl_put_right
        export
            {ANY} left_sibling, right_sibling,
            {TWO_WAY_TREE} bl_put_left, bl_put_right, forget_left, forget_right
        undefine
            is_equal
        redefine
            copy
        end

    TWO_WAY_LIST [G]
        rename
            active as child,
            put_left as child_put_left,
            put_right as child_put_right,
            after as child_after,
            back as child_back,
            before as child_before,
            count as arity,
            cursor as child_cursor,
            duplicate as twl_duplicate,
            is_empty as is_leaf,
            extend as child_extend,
            extendible as child_extendible,
            fill as twl_fill,
            finish as child_finish,
            first_element as first_child,
            forth as child_forth,
            full as twl_full,
            go_i_th as child_go_i_th,
            go_to as child_go_to,
            has as twl_has,
            index as child_index,
            isfirst as child_isfirst,
            islast as child_islast,
            item as child_item,
            last_element as last_child,
            make as twl_make,
            merge_left as twl_merge_left,
            merge_right as twl_merge_right,
            off as child_off,
            prune as twl_prune,
            put as child_put,
            readable as child_readable,
            remove as remove_child,
            remove_left as remove_left_child,
            remove_right as remove_right_child,
            replace as child_replace,
            search as search_child,
            start as child_start,
            writable as child_writable
        export
            {ANY} child,
            {NONE} twl_make, twl_has, twl_fill, twl_duplicate, twl_full
        undefine
            child_readable,
            is_leaf,
            child_writable,
            linear_representation,
            child_isfirst,
            child_islast,
            valid_cursor_index,
            is_equal
        redefine
            first_child,
            last_child,
            new_cell,
            copy
        select
            is_leaf
        end

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create single node with item v.
        do
            put (v)
            twl_make
        end

feature -- Access

    parent: TWO_WAY_TREE [G]
            -- Parent node

    first_child: like parent
            -- Leftmost child

    last_child: like parent

feature {RECURSIVE_CURSOR_TREE} -- Element change

    set_child (n: like parent) is
            -- Set the child of parent to n.
        do
            child := n
        ensure then
            child_set: child = n
        end

feature -- Element change

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if is_leaf then
                first_child := n
                child := n
            else
                last_child.bl_put_right (n)
                if child_after then
                    child := n
                end
            end
            last_child := n
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    replace_child (n: like parent) is
            -- Replace current child by n.
        do
            put_child_right (n)
            remove_child
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        do
            child_back
            put_child_right (n)
            child_forth
            child_forth
        end

    put_child_right (n: like parent) is
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if child_before then
                if is_leaf then
                    last_child := n
                end
                n.bl_put_right (first_child)
                first_child := n
                child := n
            elseif child_islast then
                child.bl_put_right (n);
                last_child := n
            else
                n.bl_put_right (child.right_sibling)
                n.bl_put_left (child)
            end
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        do
            attach (other)
            twl_merge_left (other)
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        do
            attach (other)
            twl_merge_right (other)
        end

    prune (n: like first_child) is
        local
            l_child: like first_child
        do
            from
                l_child := first_child
            until
                l_child = void or l_child = n
            loop
                l_child := l_child.right_sibling
            end
            if l_child /= void then
                if l_child = first_child then
                    first_child := first_child.right_sibling
                    if child = n then
                        child := first_child
                    end
                    if l_child = last_child then
                        last_child := last_child.left_sibling
                    end
                elseif l_child = last_child then
                    last_child := last_child.left_sibling;
                    if child = n then
                        child := last_child
                    end
                else
                    l_child.right_sibling.bl_put_left (l_child.left_sibling)
                    if child = n then
                        child := l_child.left_sibling
                    end
                end
                arity := arity - 1
                if is_leaf and not child_before then
                    first_child := void
                    last_child := void
                    child_after := True
                end
                n.attach_to_parent (void)
                n.simple_forget_left
                n.simple_forget_right
            end
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        end

feature {LINKED_TREE} -- Implementation

    new_cell (v: like item): like first_child is
            -- New cell containing v
        do
            create Result.make (v)
            Result.attach_to_parent (Current)
        end

    new_tree: like Current is
            -- A newly created instance of the same type, with
            -- the same node value.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (item)
        end

feature {NONE} -- Implementation

    attach (other: like first_child) is
            -- Attach all children of other to current node.
        local
            cursor: CURSOR
        do
            from
                other.child_start
            until
                other.child_off
            loop
                other.child.attach_to_parent (Current)
                other.child_forth
            end
            other.child_go_to (cursor)
        end

invariant

    off_constraint: (child = void) implies child_off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees implemented using a two way linked list representation"
    create: make

Ancestors
    BI_LINKABLE [G]
    DYNAMIC_TREE [G]
    TWO_WAY_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] TWO_WAY_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] TWO_WAY_TREE [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_child: [like parent] TWO_WAY_TREE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_TREE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] TWO_WAY_TREE [G]): BOOLEAN
    item: G
    last: [like item] G
    last_child: [like parent] TWO_WAY_TREE [G]
    left_sibling: [like Current] TWO_WAY_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    parent: TWO_WAY_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] TWO_WAY_TREE [G]
    sequential_occurrences (v: G): INTEGER
    sublist: [like Current] TWO_WAY_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] TWO_WAY_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    force (v: [like item] G)
    make (v: [like item] G)
    merge_tree_after (other: [like first_child] TWO_WAY_TREE [G])
    merge_tree_before (other: [like first_child] TWO_WAY_TREE [G])
    move (i: INTEGER)
    prune (n: [like first_child] TWO_WAY_TREE [G])
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_child (n: [like parent] TWO_WAY_TREE [G])
    put_child_left (n: [like parent] TWO_WAY_TREE [G])
    put_child_right (n: [like parent] TWO_WAY_TREE [G])
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] G)
    replace_child (n: [like parent] TWO_WAY_TREE [G])
    search_child (v: [like item] G)
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] TWO_WAY_TREE [G])
    twl_merge_right (other: [like Current] TWO_WAY_TREE [G])
    twl_prune (v: [like item] G)
    wipe_out

Constraints
    off constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a two way linked list representation"
    status: "See notice at end of class"
    names: two_way_tree, tree, two_way_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class
    TWO_WAY_TREE [G]

create
    make

feature -- Initialization

    make (v: like item) is
            -- Create single node with item v.
        do
            put (v)
            twl_make
        end

feature {NONE} -- Initialization

    twl_make is
            -- Create an empty list.
            -- (from LINKED_LIST)
        do
            child_before := True
        ensure -- from LINKED_LIST
            is_before: child_before
        end

feature -- Access

    child_cursor: CURSOR is
            -- Current cursor position
            -- (from LINKED_LIST)
        do
            create {LINKED_LIST_CURSOR [G]} Result.make (child, child_after, child_before)
        end

    first: like child_item is
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        do
            Result := first_child.item
        end

    first_child: like parent
            -- Leftmost child

    i_th (i: INTEGER): like child_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := child_cursor
            child_go_i_th (i)
            Result := child_item
            child_go_to (pos)
        end

    child_index: INTEGER is
            -- Index of current position
            -- (from LINKED_LIST)
        local
            p: LINKED_LIST_CURSOR [G]
        do
            if child_after then
                Result := arity + 1
            elseif not child_before then
                p ?= child_cursor;
                check
                    p /= void
                end;
                from
                    child_start
                    Result := 1
                until
                    p.active = child
                loop
                    child_forth
                    Result := Result + 1
                end;
                child_go_to (p)
            end
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1
        end

    index_of (v: like child_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_index_of (v, i)
            child_go_to (pos)
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    child_item: G is
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable
        do
            Result := child.item
        end

    item: G
            -- Content of cell.
            -- (from CELL)

    last: like child_item is
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        do
            Result := last_child.item
        end

    last_child: like parent

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                child_start
                search_child (v)
            until
                exhausted
            loop
                Result := Result + 1
                child_forth
                search_child (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    parent: TWO_WAY_TREE [G]
            -- Parent node

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like child_item is
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := child_cursor
            child_go_i_th (i)
            Result := child_item
            child_go_to (pos)
        end

feature {NONE} -- Access

    twl_has (v: like child_item): BOOLEAN is
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_has (v)
            child_go_to (pos)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    sequential_has (v: like child_item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            child_start
            if not child_off then
                search_child (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    sequential_index_of (v: like child_item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child_item /= void and then v.is_equal (child_item) then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            else
                from
                    child_start
                    pos := 1
                until
                    child_off or (occur = i)
                loop
                    if child_item = v then
                        occur := occur + 1
                    end
                    child_forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    sequential_search (v: like child_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (child_item /= void and then v.is_equal (child_item))
                loop
                    child_forth
                end
            else
                from
                until
                    exhausted or else v = child_item
                loop
                    child_forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item
        end

feature -- Measurement

    child_capacity: INTEGER is
            -- Maximal number of children
            -- (from TREE)
        do
            Result := arity
        end

    count: INTEGER is
            -- Number of items
            -- (from TREE)
        do
            Result := subtree_count + 1
        end

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL is
            -- Range of acceptable indexes
            -- (from CHAIN)
        do
            create Result.make (1, arity)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity
        end

    occurrences (v: like child_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_occurrences (v)
            child_go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    occurrences (v: like child_item): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        local
            pos: CURSOR
        do
            pos := child_cursor
            Result := sequential_occurrences (v)
            child_go_to (pos)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        do
            if Current = other then
                Result := True
            else
                Result := (is_leaf = other.is_leaf) and (object_comparison = other.object_comparison) and (child_capacity = other.child_capacity)
                if Result and not is_leaf then
                    Result := tree_is_equal (Current, other)
                end
            end
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity
        end

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    child_isfirst: BOOLEAN is
            -- Is cursor under first child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = 1
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_islast: BOOLEAN is
            -- Is cursor under last child?
            -- (from TREE)
        do
            Result := not is_leaf and child_index = child_capacity
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf
        end

    child_readable: BOOLEAN is
            -- Is there a current child_item to be read?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    child_writable: BOOLEAN is
            -- Is there a current child_item that may be modified?
            -- (from TREE)
        do
            Result := not child_off and then (child /= void)
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_leaf
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := child_off
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result
        end

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN is
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        do
            if object_comparison then
                Result := (v /= void) and then (item /= void) and then (v.is_equal (item) or else subtree_has (v))
            else
                Result := v = item or else subtree_has (v)
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf
        end

    is_empty: BOOLEAN is
            -- Is structure empty of items?
            -- (from TREE)
        do
            Result := False
        end

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)
        do
            check
                put_constraint: (v /= last_child.item) implies not child_off
            end
            Result := (v = last_child.item) or else (v = child_item)
        end

    is_leaf: BOOLEAN is
            -- Are there no children?
            -- (from TREE)
        do
            Result := arity = 0
        end

    is_root: BOOLEAN is
            -- Is there no parent?
            -- (from TREE)
        do
            Result := parent = void
        end

    is_sibling (other: like parent): BOOLEAN is
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        do
            Result := not is_root and other.parent = parent
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN is
            -- Is there no current item?
            -- (from LINKED_LIST)
        do
            Result := child_after or child_before
        end

    prunable: BOOLEAN is
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)
        do
            Result := True
        end

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN is
            -- Is there a current child to be read?
            -- (from TREE)
        do
            Result := not child_off
        end

    valid_cursor (p: CURSOR): BOOLEAN is
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)
        local
            ll_c: LINKED_LIST_CURSOR [G]
            temp, sought: like first_child
        do
            ll_c ?= p
            if ll_c /= void then
                from
                    temp := first_child
                    sought := ll_c.active
                    Result := ll_c.after or else ll_c.before
                until
                    Result or else temp = void
                loop
                    Result := (temp = sought)
                    temp := temp.right_sibling
                end
            end
        end

    valid_cursor_index (i: INTEGER): BOOLEAN is
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        do
            Result := (i >= 0) and (i <= child_capacity + 1)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)
        end

    valid_index (i: INTEGER): BOOLEAN is
            -- Is i within allowable bounds?
            -- (from CHAIN)
        do
            Result := (i >= 1) and (i <= arity)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))
        end

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN is
            -- Is there a current child that may be modified?
            -- (from TREE)
        do
            Result := not child_off
        end

feature {NONE} -- Status report

    Twl_full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    child_back is
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before
        do
            if child_after then
                child_after := False
                if is_leaf then
                    child_before := True
                end
            else
                child := child.left_sibling
                if child = void then
                    child := first_child
                    child_before := True
                end
            end
        end

    child_finish is
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        do
            if not is_leaf then
                child := last_child
                child_after := False
                child_before := False
            else
                child_after := False
                child_before := True
            end
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after
        end

    child_forth is
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        do
            if child_before then
                child_before := False
                if is_leaf then
                    child_after := True
                end
            else
                child := child.right_sibling
                if child = void then
                    child := last_child
                    child_after := True
                end
            end
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1
        end

    child_go_i_th (i: INTEGER) is
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        do
            if i = 0 then
                child_before := True
                child_after := False
                child := first_child
            elseif i = arity + 1 then
                child_before := False;
                child_after := True;
                child := last_child
            else
                move (i - child_index)
            end
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i
        end

    child_go_to (p: CURSOR) is
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)
        local
            ll_c: LINKED_LIST_CURSOR [G]
        do
            ll_c ?= p
            check
                ll_c /= void
            end
            child_after := ll_c.after
            child_before := ll_c.before
            if child_before then
                child := first_child
            elseif child_after then
                child := last_child
            else
                child := ll_c.active
            end
        end

    move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        local
            counter: INTEGER
            p: like first_child
        do
            if i > 0 then
                ll_move (i)
            elseif i < 0 then
                if child_after then
                    child_after := False;
                    counter := - 1
                end;
                from
                    p := child
                until
                    (counter = i) or else (p = void)
                loop
                    p := p.left_sibling
                    counter := counter - 1
                end;
                if p = void then
                    child_before := True;
                    child := first_child
                else
                    child := p
                end
            end
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after
        end

    search_child (v: like child_item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        do
            if child_before and not is_leaf then
                child_forth
            end
            sequential_search (v)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item
        end

    child_start is
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        do
            if first_child /= void then
                child := first_child
                child_after := False
            else
                child_after := True
            end
            child_before := False
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after
        end

feature {NONE} -- Cursor movement

    ll_move (i: INTEGER) is
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        local
            counter, new_index: INTEGER
            p: like first_child
        do
            if i > 0 then
                if child_before then
                    child_before := False
                    counter := 1
                end
                from
                    p := child
                until
                    (counter = i) or else (p = void)
                loop
                    child := p
                    p := p.right_sibling
                    counter := counter + 1
                end
                if p = void then
                    child_after := True
                else
                    child := p
                end
            elseif i < 0 then
                new_index := child_index + i;
                child_before := True;
                child_after := False;
                child := first_child;
                if (new_index > 0) then
                    move (new_index)
                end
            end
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after
        end

feature {RECURSIVE_CURSOR_TREE} -- Element change

    set_child (n: like parent) is
            -- Set the child of parent to n.
        require -- from DYNAMIC_TREE
            non_void_argument: n /= void
        do
            child := n
        ensure then
            child_set: child = n
        end

feature -- Element change

    append (s: SEQUENCE [G]) is
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        local
            l: like s
        do
            if s = Current then
                l := deep_clone (s)
            else
                l := s
            end
            from
                l.start
            until
                l.exhausted
            loop
                child_extend (l.item)
                l.forth
            end
        ensure -- from SEQUENCE
            new_count: arity >= old arity
        end

    extend (v: like item) is
            -- Add v as new child.
            -- (from DYNAMIC_TREE)
        do
            child_extend (v)
        end

    child_extend (v: like child_item) is
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        local
            p: like first_child
        do
            p := new_cell (v)
            if is_leaf then
                first_child := p
                child := p
            else
                p.bl_put_left (last_child)
            end
            last_child := p
            if child_after then
                child := p
            end
            arity := arity + 1
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    fill (other: TREE [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)
        do
            replace (other.item)
            fill_subtree (other)
        end

    force (v: like child_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        do
            child_extend (v)
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)
        end

    twl_merge_left (other: like Current) is
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        local
            other_first_element: like first_child
            other_last_element: like first_child
            other_count: INTEGER
        do
            if not other.is_leaf then
                other_first_element := other.first_child
                other_last_element := other.last_child
                other_count := other.arity
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_leaf then
                    last_child := other_last_element
                    first_child := other_first_element
                    if child_before then
                        child := first_child
                    else
                        child := last_child
                    end
                elseif child_isfirst then
                    other_last_element.bl_put_right (first_child);
                    first_child := other_first_element
                elseif child_after then
                    other_first_element.bl_put_left (last_child);
                    last_child := other_last_element;
                    child := last_child
                else
                    other_first_element.bl_put_left (child.left_sibling)
                    child.bl_put_left (other_last_element)
                end
                arity := arity + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf
        end

    twl_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        do
            if is_leaf or else child_islast then
                last_child := other.last_child
            end
            ll_merge_right (other)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf
        end

    merge_tree_after (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        do
            attach (other)
            twl_merge_right (other)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf
        end

    merge_tree_before (other: like first_child) is
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        do
            attach (other)
            twl_merge_left (other)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf
        end

    prune (n: like first_child) is
        require -- from TREE
            is_child: n.parent = Current
        local
            l_child: like first_child
        do
            from
                l_child := first_child
            until
                l_child = void or l_child = n
            loop
                l_child := l_child.right_sibling
            end
            if l_child /= void then
                if l_child = first_child then
                    first_child := first_child.right_sibling
                    if child = n then
                        child := first_child
                    end
                    if l_child = last_child then
                        last_child := last_child.left_sibling
                    end
                elseif l_child = last_child then
                    last_child := last_child.left_sibling;
                    if child = n then
                        child := last_child
                    end
                else
                    l_child.right_sibling.bl_put_left (l_child.left_sibling)
                    if child = n then
                        child := l_child.left_sibling
                    end
                end
                arity := arity - 1
                if is_leaf and not child_before then
                    first_child := void
                    last_child := void
                    child_after := True
                end
                n.attach_to_parent (void)
                n.simple_forget_left
                n.simple_forget_right
            end
        ensure -- from TREE
            n_is_root: n.is_root
        end

    put (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    child_put (v: like child_item) is
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        do
            child_replace (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity
        end

    put_child (n: like parent) is
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if is_leaf then
                first_child := n
                child := n
            else
                last_child.bl_put_right (n)
                if child_after then
                    child := n
                end
            end
            last_child := n
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    put_child_left (n: like parent) is
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void
        do
            child_back
            put_child_right (n)
            child_forth
            child_forth
        end

    put_child_right (n: like parent) is
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void
        do
            if object_comparison then
                n.compare_objects
            else
                n.compare_references
            end
            if child_before then
                if is_leaf then
                    last_child := n
                end
                n.bl_put_right (first_child)
                first_child := n
                child := n
            elseif child_islast then
                child.bl_put_right (n);
                last_child := n
            else
                n.bl_put_right (child.right_sibling)
                n.bl_put_left (child)
            end
            n.attach_to_parent (Current)
            arity := arity + 1
        end

    put_front (v: like child_item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        do
            ll_put_front (v)
            if arity = 1 then
                last_child := first_child
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v
        end

    put_i_th (v: like child_item; i: INTEGER) is
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        local
            pos: CURSOR
        do
            pos := child_cursor
            child_go_i_th (i)
            child_replace (v)
            child_go_to (pos)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v
        end

    child_put_left (v: like child_item) is
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        local
            p: like first_child
        do
            p := new_cell (v)
            if is_leaf then
                first_child := p
                last_child := p
                child := p
                child_before := False
            elseif child_after then
                p.bl_put_left (last_child);
                last_child := p;
                child := p
            elseif child_isfirst then
                p.bl_put_right (child);
                first_child := p
            else
                p.bl_put_left (child.left_sibling)
                p.bl_put_right (child)
            end
            arity := arity + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        end

    child_put_right (v: like child_item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        local
            was_last: BOOLEAN
        do
            was_last := child_islast
            ll_put_right (v)
            if arity = 1 then
                last_child := child
            elseif was_last then
                last_child := child.right_sibling
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v
        end

    replace (v: like item) is
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        do
            item := v
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v
        end

    child_replace (v: like child_item) is
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        do
            child.put (v)
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v
        end

    replace_child (n: like parent) is
            -- Replace current child by n.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        do
            put_child_right (n)
            remove_child
        ensure -- from TREE
            child_replaced: child = n
        end

    sprout is
            -- Make current node a root.
            -- (from TREE)
        do
            if parent /= void then
                parent.prune (Current)
            end
        end

feature {NONE} -- Element change

    twl_fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            child_extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not child_extendible or else lin_rep.off
            loop
                child_extend (lin_rep.item)
                lin_rep.forth
            end
        end

    ll_merge_right (other: like Current) is
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        local
            other_first_element: like first_child
            other_last_element: like first_child
            other_count: INTEGER
        do
            if not other.is_leaf then
                other_first_element := other.first_child
                other_last_element := other.last_child
                other_count := other.arity
                check
                    other_first_element /= void
                    other_last_element /= void
                end
                if is_leaf then
                    first_child := other_first_element
                    child := first_child
                else
                    if not child_islast then
                        other_last_element.bl_put_right (child.right_sibling)
                    end
                    child.bl_put_right (other_first_element)
                end
                arity := arity + other_count
                other.wipe_out
            end
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf
        end

    sequence_put (v: like child_item) is
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: child_extendible
        do
            child_extend (v)
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
        end

    ll_put_front (v: like child_item) is
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        local
            p: like first_child
        do
            p := new_cell (v)
            p.bl_put_right (first_child)
            first_child := p
            if child_before or is_leaf then
                child := p
            end
            arity := arity + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v
        end

    ll_put_right (v: like child_item) is
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        local
            p: like first_child
        do
            p := new_cell (v)
            check
                is_leaf implies child_before
            end
            if child_before then
                p.bl_put_right (first_child)
                first_child := p
                child := p
            else
                p.bl_put_right (child.right_sibling)
                child.bl_put_right (p)
            end
            arity := arity + 1
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v
        end

feature -- Removal

    twl_prune (v: like child_item) is
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable
        do
            search_child (v)
            if not exhausted then
                remove_child
            end
        end

    prune_all (v: like child_item) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                child_start
                search_child (v)
            until
                exhausted
            loop
                remove_child
                search_child (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        end

    remove_child is
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        local
            succ, pred, removed: like first_child
        do
            removed := child
            if child_isfirst then
                child := first_child.right_sibling
                first_child.forget_right
                first_child := child
                if arity = 1 then
                    check
                        no_active: child = void
                    end
                    child_after := True
                    last_child := void
                end
            elseif child_islast then
                child := last_child.left_sibling;
                last_child.forget_left;
                last_child := child;
                child_after := True
            else
                pred := child.left_sibling
                succ := child.right_sibling
                pred.forget_right
                succ.forget_left
                pred.bl_put_right (succ)
                child := succ
            end
            arity := arity - 1
            cleanup_after_remove (removed)
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    remove_left_child is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        do
            child_back
            remove_child
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1
        end

    remove_right_child is
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        do
            child_forth
            remove_child
            child_back
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index
        end

    remove_sublist is
            -- (from TWO_WAY_LIST)
        do
            sublist := void
        end

    split (n: INTEGER) is
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0
        local
            actual_number, active_index: INTEGER
            p_elem, s_elem, e_elem, n_elem: like first_child
        do
            if n = 0 then
                create sublist.twl_make
            else
                active_index := child_index
                if active_index + n > arity + 1 then
                    actual_number := arity + 1 - active_index
                else
                    actual_number := n
                end
                s_elem := child
                p_elem := previous
                move (actual_number - 1)
                e_elem := child
                n_elem := next
                s_elem.forget_left
                e_elem.forget_right
                create sublist.make_sublist (s_elem, e_elem, actual_number)
                arity := arity - actual_number
                if p_elem /= void then
                    p_elem.bl_put_right (n_elem)
                else
                    first_child := n_elem
                end
                if n_elem /= void then
                    child := n_elem
                else
                    last_child := p_elem
                    child := p_elem
                    child_after := True
                end
            end
        end

    wipe_out is
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        do
            ll_wipe_out
            last_child := void
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before
        end

feature {NONE} -- Removal

    ll_wipe_out is
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        do
            child := void
            first_child := void
            child_before := True
            child_after := False
            arity := 0
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before
        end

    chain_wipe_out is
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        do
            from
                child_start
            until
                is_leaf
            loop
                remove_child
            end
        ensure -- from COLLECTION
            wiped_out: is_leaf
        end

feature -- Transformation

    swap (i: INTEGER) is
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        local
            old_item, new_item: like child_item
            pos: CURSOR
        do
            pos := child_cursor
            old_item := child_item
            child_go_i_th (i)
            new_item := child_item
            child_replace (old_item)
            child_go_to (pos)
            child_replace (new_item)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item
        end

feature -- Conversion

    binary_representation: BINARY_TREE [G] is
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        local
            current_sibling: BINARY_TREE [G]
        do
            create Result.make (item)
            if not is_leaf then
                Result.put_left_child (first_child.binary_representation)
                from
                    child_start
                    child_forth
                    current_sibling := Result.left_child
                until
                    child_after
                loop
                    current_sibling.put_right_child (child.binary_representation)
                    current_sibling := current_sibling.right_child
                    child_forth
                end
            end
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right
        end

    fill_from_binary (b: BINARY_TREE [G]) is
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)
        local
            current_node: BINARY_TREE [G]
        do
            replace (b.item)
            wipe_out
            if b.has_left then
                from
                    current_node := b.left_child
                until
                    current_node = void
                loop
                    child_put_right (current_node.item)
                    child_forth
                    child.fill_from_binary (current_node)
                    current_node := current_node.right_child
                end
            end
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
            -- (from TREE)
        local
            al: ARRAYED_LIST [G]
        do
            create al.make (count)
            al.start
            al.extend (item)
            fill_list (al)
            Result := al
        end

feature -- Duplication

    copy (other: like Current) is
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            tmp_tree: like Current
        do
            create tmp_tree.make (other.item)
            if not other.is_leaf then
                tree_copy (other, tmp_tree)
            end
        ensure -- from ANY
            is_equal: is_equal (other)
        end

    duplicate (n: INTEGER): like Current is
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_tree
                pos := child_cursor
            until
                child_after or else (counter = n)
            loop
                Result.put_child (child.duplicate_all)
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {NONE} -- Duplication

    twl_duplicate (n: INTEGER): like Current is
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: child_off implies child_after
            valid_subchain: n >= 0
        local
            pos: CURSOR
            counter: INTEGER
        do
            from
                Result := new_chain
                if object_comparison then
                    Result.compare_objects
                end
                pos := child_cursor
            until
                (counter = n) or else exhausted
            loop
                Result.child_extend (child_item)
                child_forth
                counter := counter + 1
            end
            child_go_to (pos)
        end

feature {NONE} -- Inapplicable

    bag_put (v: G) is
            -- (from TABLE)
        require -- from COLLECTION
            extendible: child_extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

feature {LINKED_TREE} -- Implementation

    new_cell (v: like item): like first_child is
            -- New cell containing v
        do
            create Result.make (v)
            Result.attach_to_parent (Current)
        ensure -- from LINKED_LIST
            result_exists: Result /= void
        end

    new_tree: like Current is
            -- A newly created instance of the same type, with
            -- the same node value.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
        do
            create Result.make (item)
        ensure -- from DYNAMIC_TREE
            result_exists: Result /= void
            result_item: Result.item = item
        end

feature {NONE} -- Implementation

    attach (other: like first_child) is
            -- Attach all children of other to current node.
        local
            cursor: CURSOR
        do
            from
                other.child_start
            until
                other.child_off
            loop
                other.child.attach_to_parent (Current)
                other.child_forth
            end
            other.child_go_to (cursor)
        end

    child_remove is
            -- Remove item of current child
            -- (from TREE)
        do
        end

    remove is
            -- Remove current item
            -- (from TREE)
        do
        end

    tree_copy (other, tmp_tree: like Current) is
            -- Generic implementation of copy. other is copied onto
            -- Current. tmp_tree is used as temporary storage during
            -- copying. Since it cannot be created locally because of the
            -- generic implementation, it has to be passed in.
            -- (from TREE)
        require -- from TREE
            other_not_empty: other /= void and then not other.is_leaf
            other_not_leaf: not other.is_leaf
            tmp_tree_exists: tmp_tree /= void
            same_rule: object_comparison = other.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            other_stack, tmp_stack: LINKED_STACK [like Current]
            idx_stack, orgidx_stack: LINKED_STACK [INTEGER]
        do
            create other_stack.make
            create tmp_stack.make
            create idx_stack.make
            create orgidx_stack.make
            if other.object_comparison then
                tmp_tree.compare_objects
            end
            orgidx_stack.put (other.child_index)
            from
                i := 1
                p1 := other
                p2 := tmp_tree
            invariant
                same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
            until
                i > p1.child_capacity and other_stack.is_empty
            loop
                p1.child_go_i_th (i)
                p2.child_go_i_th (i)
                if p1.child_readable then
                    check
                        source_tree_not_void: p1 /= void
                        target_tree_not_void: p2 /= void
                        source_child_not_void: p1.child /= void
                        target_child_void: p2.child = void
                    end
                    p2.replace_child (clone (p1.child))
                    if other_stack.is_empty then
                        p2.child.attach_to_parent (Current)
                    end
                    check
                        comparison_mode_ok: p2.child.object_comparison = p1.child.object_comparison
                        p1_consistent: p1.child.parent = p1
                        p2_consistent: p2.child.parent = p2
                    end
                    if not p1.child.is_leaf then
                        other_stack.put (p1)
                        tmp_stack.put (p2)
                        idx_stack.put (i + 1)
                        p1 := p1.child
                        p2 := p2.child
                        orgidx_stack.put (p1.child_index)
                        i := 0
                    end
                end
                if i <= p1.child_capacity then
                    i := i + 1
                else
                    from
                    invariant
                        same_count: other_stack.count = tmp_stack.count and tmp_stack.count = idx_stack.count
                    until
                        other_stack.is_empty or else i <= p1.child_capacity
                    loop
                        p1.child_go_i_th (orgidx_stack.item)
                        p1 := other_stack.item
                        p2 := tmp_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        i := idx_stack.item
                        other_stack.remove
                        tmp_stack.remove
                        idx_stack.remove
                        orgidx_stack.remove
                    end
                end
            end
            check
                tree_stacks_empty: other_stack.is_empty and tmp_stack.is_empty
                at_root: p1 = other and p2 = tmp_tree
            end
            standard_copy (tmp_tree)
            child_go_i_th (orgidx_stack.item)
            orgidx_stack.remove
            check
                index_stack_empty: orgidx_stack.is_empty
            end
        end

    tree_is_equal (t1, t2: like Current): BOOLEAN is
            -- Are t1 and t2 recursively equal?
            -- (from TREE)
        require -- from TREE
            trees_exist: t1 /= void and t2 /= void
            trees_not_empty: not t1.is_leaf and not t2.is_leaf
            same_rule: t1.object_comparison = t2.object_comparison
        local
            i: INTEGER
            p1, p2: like Current
            t1_stack, t2_stack: LINKED_STACK [like Current]
            idx_stack, orgidx1_stack, orgidx2_stack: LINKED_STACK [INTEGER]
        do
            if t1.is_leaf and t2.is_leaf then
                if t1.object_comparison then
                    Result := equal (t1.item, t2.item)
                else
                    Result := (t1.item = t2.item)
                end
            elseif t1.is_leaf xor t2.is_leaf then
                Result := False
            else
                create t1_stack.make
                create t2_stack.make
                create idx_stack.make
                create orgidx1_stack.make
                create orgidx2_stack.make
                orgidx1_stack.put (t1.child_index)
                orgidx2_stack.put (t2.child_index)
                from
                    Result := True
                    i := 1
                    p1 := t1
                    p2 := t2
                invariant
                    same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                until
                    not Result or else (i > p1.child_capacity and t1_stack.is_empty)
                loop
                    check
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (i)
                    p2.child_go_i_th (i)
                    if p1.child_readable and p2.child_readable and p1.child_capacity = p2.child_capacity then
                        check
                            p1_consistent: p1.child.parent = p1
                            p2_consistent: p2.child.parent = p2
                        end
                        if t1.object_comparison then
                            Result := equal (p1.item, p2.item)
                        else
                            Result := (p1.item = p2.item)
                        end
                        if not (p1.child.is_leaf or p2.child.is_leaf) then
                            t1_stack.put (p1)
                            t2_stack.put (p2)
                            idx_stack.put (i + 1)
                            p1 := p1.child
                            p2 := p2.child
                            orgidx1_stack.put (p1.child_index)
                            orgidx2_stack.put (p2.child_index)
                            i := 0
                        elseif p1.child.is_leaf xor p2.child.is_leaf then
                            Result := False
                        end
                    elseif p1.child_capacity /= p2.child_capacity or else (p1.child_readable xor p2.child_readable) then
                        Result := False
                    end
                    if i <= p1.child_capacity then
                        i := i + 1
                    else
                        from
                        invariant
                            same_count: t1_stack.count = t2_stack.count and t2_stack.count = idx_stack.count
                        until
                            t1_stack.is_empty or else i <= p1.child_capacity
                        loop
                            p1.child_go_i_th (orgidx1_stack.item)
                            p2.child_go_i_th (orgidx2_stack.item)
                            p1 := t1_stack.item
                            p2 := t2_stack.item
                            i := idx_stack.item
                            t1_stack.remove
                            t2_stack.remove
                            idx_stack.remove
                            orgidx1_stack.remove
                            orgidx2_stack.remove
                        end
                    end
                end
                if not Result then
                    from
                    invariant
                        same_count: t1_stack.count = t2_stack.count and orgidx1_stack.count = orgidx2_stack.count
                    until
                        orgidx1_stack.count = 1
                    loop
                        p1.child_go_i_th (orgidx1_stack.item)
                        p2.child_go_i_th (orgidx2_stack.item)
                        p1 := t1_stack.item
                        p2 := t2_stack.item
                        check
                            p1_not_void: p1 /= void
                            p2_not_void: p2 /= void
                        end
                        t1_stack.remove
                        t2_stack.remove
                        orgidx1_stack.remove
                        orgidx2_stack.remove
                    end
                    check
                        tree_stacks_empty: t1_stack.is_empty and t2_stack.is_empty
                        at_root: p1 = t1 and p2 = t2
                        p1_not_void: p1 /= void
                        p2_not_void: p2 /= void
                    end
                    p1.child_go_i_th (orgidx1_stack.item)
                    p2.child_go_i_th (orgidx2_stack.item)
                    orgidx1_stack.remove
                    orgidx2_stack.remove
                    check
                        index_stacks_empty: orgidx1_stack.is_empty and orgidx2_stack.is_empty
                    end
                end
            end
        end

feature {DYNAMIC_TREE} -- Implementation

    duplicate_all: like Current is
            -- Copy of sub-tree including all children
            -- (from DYNAMIC_TREE)
        local
            pos: CURSOR
        do
            from
                Result := new_tree
                pos := child_cursor
                child_start
            until
                child_off
            loop
                Result.put_child (child.duplicate_all)
                Result.child_forth
                child_forth
            end
            child_go_to (pos)
        end

    fill_subtree (other: TREE [G]) is
            -- Fill children with children of other.
            -- (from DYNAMIC_TREE)
        do
            from
                other.child_start
            until
                other.child_off
            loop
                child_extend (other.item)
                other.child_forth
            end
            from
                child_start
                other.child_start
            until
                child_off
            loop
                child.fill_subtree (other.child)
                other.child_forth
                child_forth
            end
        end

feature {TREE} -- Implementation

    attach_to_parent (n: like parent) is
            -- Make n parent of current node.
            -- (from TREE)
        do
            parent := n
        ensure -- from TREE
            new_parent: parent = n
        end

    fill_list (al: ARRAYED_LIST [G]) is
            -- Fill al with all the children's items.
            -- (from TREE)
        do
            from
                child_start
            until
                child_off
            loop
                if child /= void then
                    al.extend (child_item)
                    child.fill_list (al)
                end
                child_forth
            end
        end

    subtree_count: INTEGER is
            -- Number of items in children
            -- (from TREE)
        local
            pos: CURSOR
        do
            Result := arity
            from
                pos := child_cursor
                child_start
            until
                child_off
            loop
                if child /= void then
                    Result := Result + child.subtree_count
                end
                child_forth
            end
            child_go_to (pos)
        end

    subtree_has (v: G): BOOLEAN is
            -- Do children include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        local
            cursor: CURSOR
        do
            cursor := child_cursor
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    if object_comparison then
                        Result := (v /= void) and then (child_item /= void) and then v.is_equal (child_item)
                    else
                        Result := v = child_item
                    end
                end
                child_forth
            end
            from
                child_start
            until
                child_off or else Result
            loop
                if child /= void then
                    Result := child.subtree_has (v)
                end
                child_forth
            end
            child_go_to (cursor)
        end

feature {TWO_WAY_TREE} -- Implementation

    forget_left is
            -- Remove links with left neighbor.
            -- (from BI_LINKABLE)
        do
            if left_sibling /= void then
                left_sibling.simple_forget_right
                left_sibling := void
            end
        ensure -- from BI_LINKABLE
            left_not_chained: left_sibling = void or else (old left_sibling /= void) implies ((old left_sibling).right_sibling = void)
        end

    forget_right is
            -- Remove links with right neighbor.
            -- (from BI_LINKABLE)
        do
            if right_sibling /= void then
                right_sibling.simple_forget_left
                right_sibling := void
            end
        ensure -- from LINKABLE
            not_chained: right_sibling = void
        ensure then -- from BI_LINKABLE
            right_not_chained: (old right_sibling /= void) implies ((old right_sibling).left_sibling = void)
        end

    bl_put_left (other: like Current) is
            -- Put other to the left of current cell.
            -- (from BI_LINKABLE)
        do
            if left_sibling /= void then
                left_sibling.simple_forget_right
            end
            left_sibling := other
            if (other /= void) then
                other.simple_put_right (Current)
            end
        ensure -- from BI_LINKABLE
            chained: left_sibling = other
        end

    bl_put_right (other: like Current) is
            -- Put other to the right of current cell.
            -- (from BI_LINKABLE)
        do
            if right_sibling /= void then
                right_sibling.simple_forget_left
            end
            right_sibling := other
            if (other /= void) then
                other.simple_put_left (Current)
            end
        ensure -- from LINKABLE
            chained: right_sibling = other
        end

feature {BI_LINKABLE, TWO_WAY_LIST} -- Implementation

    simple_forget_left is
            -- Remove left link (do nothing to left neighbor).
            -- (from BI_LINKABLE)
        do
            left_sibling := void
        ensure -- from BI_LINKABLE
            not_chained: left_sibling = void
        end

    simple_forget_right is
            -- Remove right link (do nothing to right neighbor).
            -- (from BI_LINKABLE)
        do
            right_sibling := void
        end

    simple_put_left (other: like Current) is
            -- set left to other is
            -- (from BI_LINKABLE)
        do
            if left_sibling /= void then
                left_sibling.simple_forget_right
            end
            left_sibling := other
        end

    simple_put_right (other: like Current) is
            -- set right to other
            -- (from BI_LINKABLE)
        do
            if right_sibling /= void then
                right_sibling.simple_forget_left
            end
            right_sibling := other
        end

feature {TWO_WAY_LIST} -- Implementation

    make_sublist (first_item, last_item: like first_child; n: INTEGER) is
            -- Create sublist
            -- (from TWO_WAY_LIST)
        do
            twl_make
            first_child := first_item
            last_child := last_item
            child := first_child
            arity := n
        end

    new_chain: like Current is
            -- A newly created instance of the same type.
            -- This feature may be redefined in descendants so as to
            -- produce an adequately allocated and initialized object.
            -- (from TWO_WAY_LIST)
        do
            create Result.twl_make
        ensure -- from DYNAMIC_CHAIN
            result_exists: Result /= void
        end

    previous: like first_child is
            -- Element left of cursor
            -- (from TWO_WAY_LIST)
        do
            if child_after then
                Result := child
            elseif child /= void then
                Result := child.left_sibling
            end
        end

feature {LINKED_LIST} -- Implementation

    cleanup_after_remove (v: like first_child) is
            -- Clean-up a just removed cell.
            -- (from LINKED_LIST)
        require -- from LINKED_LIST
            non_void_cell: v /= void
        do
        end

    next: like first_child is
            -- Element right of cursor
            -- (from LINKED_LIST)
        do
            if child_before then
                Result := child
            elseif child /= void then
                Result := child.right_sibling
            end
        end

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child_item, 1)
                action.call (t)
                child_forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                child_start
            until
                child_after
            loop
                t.put (child_item, 1)
                if test.item (t) then
                    action.call (t)
                end
                child_forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
                Result := True
            until
                child_after or not Result
            loop
                t.put (child_item, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                child_start
            until
                child_after or Result
            loop
                t.put (child_item, 1)
                Result := test.item (t)
                child_forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    off_constraint: (child = void) implies child_off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_leaf implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a two way linked list representation"
    status: "See notice at end of class"
    names: two_way_tree, tree, two_way_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_TREE [G]

create

    make (v: like item)
            -- Create single node with item v.

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.

feature -- Access

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    first_child: like parent
            -- Leftmost child

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    child_item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    item: G
            -- Content of cell.
            -- (from CELL)

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    last_child: like parent

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: TWO_WAY_TREE [G]
            -- Parent node

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    off_constraint: (child = void) implies child_off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_leaf implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TWO_WAY_TREE [G]

Ancestors
    BI_LINKABLE [G]
    DYNAMIC_TREE [G]
    TWO_WAY_LIST [G]

Clients
    TWO_WAY_CURSOR_TREE [G]
    TWO_WAY_TREE [G]

Suppliers
    BOOLEAN
    INTEGER
    TWO_WAY_TREE [G]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TWO_WAY_TREE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Trees implemented using a two way linked list representation"
    status: "See notice at end of class"
    names: two_way_tree, tree, two_way_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:38 $"
    revision: "$Revision: 1.2 $"

class interface
    TWO_WAY_TREE [G]

create
    make

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.

feature -- Access

    parent: TWO_WAY_TREE [G]
            -- Parent node

    first_child: like parent
            -- Leftmost child

    last_child: like parent

feature -- Element change

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.

    replace_child (n: like parent)
            -- Replace current child by n.

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.

    prune (n: like first_child)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.

invariant

    off_constraint: (child = void) implies child_off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster base.support

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    base.support	(diagram)

Supercluster
    base

Classes
    ASCII
    BOOL_STRING
    COUNTABLE_SEQUENCE [G]
    DOUBLE_MATH
    EXECUTION_ENVIRONMENT
    FIBONACCI
    FORMAT_DOUBLE
    FORMAT_INTEGER
    IDENTIFIED
    IDENTIFIED_CONTROLLER
    INTERNAL
    MATH_CONST
    OPERATING_ENVIRONMENT
    PRIMES
    PROFILING_SETTING
    RANDOM
    SINGLE_MATH

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ASCII Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        The ASCII character set.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    ASCII

feature -- Access

    Character_set_size: INTEGER is 128

    Last_ascii: INTEGER is 127

    First_printable: INTEGER is 32

    Last_printable: INTEGER is 126

    Letter_layout: INTEGER is 70

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a

    Buf_overflow: INTEGER is -9

    Overflow: INTEGER is -8

    Break: INTEGER is -7

    Home_arrow: INTEGER is -6

    Right_arrow: INTEGER is -5

    Left_arrow: INTEGER is -4

    Down_arrow: INTEGER is -3

    Up_arrow: INTEGER is -2

    Nul: INTEGER is 0

    Ctrl_a: INTEGER is 1

    Soh: INTEGER is 1

    Ctrl_b: INTEGER is 2

    Stx: INTEGER is 2

    Ctrl_c: INTEGER is 3

    Etx: INTEGER is 3

    Ctrl_d: INTEGER is 4

    Eot: INTEGER is 4

    Ctrl_e: INTEGER is 5

    Enq: INTEGER is 5

    Ctrl_f: INTEGER is 6

    Ack: INTEGER is 6

    Ctrl_g: INTEGER is 7

    Bel: INTEGER is 7

    Ctrl_h: INTEGER is 8

    Bs: INTEGER is 8

    Back_space: INTEGER is 8

    Ctrl_i: INTEGER is 9

    Ht: INTEGER is 9

    Tabulation: INTEGER is 9

    Ctrl_j: INTEGER is 10

    Nl: INTEGER is 10

    Line_feed: INTEGER is 10

    Ctrl_k: INTEGER is 11

    Vt: INTEGER is 11

    Ctrl_l: INTEGER is 12

    Np: INTEGER is 12

    Ctrl_m: INTEGER is 13

    Cr: INTEGER is 13

    Carriage_return: INTEGER is 13

    Ctrl_n: INTEGER is 14

    So: INTEGER is 14

    Ctrl_o: INTEGER is 15

    Si: INTEGER is 15

    Ctrl_p: INTEGER is 16

    Dle: INTEGER is 16

    Ctrl_q: INTEGER is 17

    Dc1: INTEGER is 17

    Ctrl_r: INTEGER is 18

    Dc2: INTEGER is 18

    Ctrl_s: INTEGER is 19

    Dc3: INTEGER is 19

    Ctrl_t: INTEGER is 20

    Dc4: INTEGER is 20

    Ctrl_u: INTEGER is 21

    Nak: INTEGER is 21

    Ctrl_v: INTEGER is 22

    Syn: INTEGER is 22

    Ctrl_w: INTEGER is 23

    Etb: INTEGER is 23

    Ctrl_x: INTEGER is 24

    Can: INTEGER is 24

    Ctrl_y: INTEGER is 25

    Em: INTEGER is 25

    Ctrl_z: INTEGER is 26

    Sub: INTEGER is 26

    Ctrl_lbracket: INTEGER is 27

    Esc: INTEGER is 27

    Ctrl_backslash: INTEGER is 28

    Fs: INTEGER is 28

    Ctrl_rbracket: INTEGER is 29

    Gs: INTEGER is 29

    Ctrl_circumflex: INTEGER is 30

    Rs: INTEGER is 30

    Ctrl_underlined: INTEGER is 31

    Us: INTEGER is 31

    Blank: INTEGER is 32

    Sp: INTEGER is 32

    Exclamation: INTEGER is 33

    Doublequote: INTEGER is 34

    Number_sign: INTEGER is 35

    Dollar: INTEGER is 36

    Percent: INTEGER is 37

    Ampersand: INTEGER is 38

    Singlequote: INTEGER is 39

    Lcurly: INTEGER is 40

    Rcurly: INTEGER is 41

    Star: INTEGER is 42

    Plus: INTEGER is 43

    Comma: INTEGER is 44

    Minus: INTEGER is 45

    Dot: INTEGER is 46

    Slash: INTEGER is 47

    Zero: INTEGER is 48

    One: INTEGER is 49

    Two: INTEGER is 50

    Three: INTEGER is 51

    Four: INTEGER is 52

    Five: INTEGER is 53

    Six: INTEGER is 54

    Seven: INTEGER is 55

    Eight: INTEGER is 56

    Nine: INTEGER is 57

    Colon: INTEGER is 58

    Semicolon: INTEGER is 59

    Lessthan: INTEGER is 60

    Equal_sign: INTEGER is 61

    Greaterthan: INTEGER is 62

    Questmark: INTEGER is 63

    Commercial_at: INTEGER is 64

    Upper_a: INTEGER is 65

    Upper_b: INTEGER is 66

    Upper_c: INTEGER is 67

    Upper_d: INTEGER is 68

    Upper_e: INTEGER is 69

    Upper_f: INTEGER is 70

    Upper_g: INTEGER is 71

    Upper_h: INTEGER is 72

    Upper_i: INTEGER is 73

    Upper_j: INTEGER is 74

    Upper_k: INTEGER is 75

    Upper_l: INTEGER is 76

    Upper_m: INTEGER is 77

    Upper_n: INTEGER is 78

    Upper_o: INTEGER is 79

    Upper_p: INTEGER is 80

    Upper_q: INTEGER is 81

    Upper_r: INTEGER is 82

    Upper_s: INTEGER is 83

    Upper_t: INTEGER is 84

    Upper_u: INTEGER is 85

    Upper_v: INTEGER is 86

    Upper_w: INTEGER is 87

    Upper_x: INTEGER is 88

    Upper_y: INTEGER is 89

    Upper_z: INTEGER is 90

    Lbracket: INTEGER is 91

    Backslash: INTEGER is 92

    Rbracket: INTEGER is 93

    Circumflex: INTEGER is 94

    Underlined: INTEGER is 95

    Grave_accent: INTEGER is 96

    Lower_a: INTEGER is 97

    Lower_b: INTEGER is 98

    Lower_c: INTEGER is 99

    Lower_d: INTEGER is 100

    Lower_e: INTEGER is 101

    Lower_f: INTEGER is 102

    Lower_g: INTEGER is 103

    Lower_h: INTEGER is 104

    Lower_i: INTEGER is 105

    Lower_j: INTEGER is 106

    Lower_k: INTEGER is 107

    Lower_l: INTEGER is 108

    Lower_m: INTEGER is 109

    Lower_n: INTEGER is 110

    Lower_o: INTEGER is 111

    Lower_p: INTEGER is 112

    Lower_q: INTEGER is 113

    Lower_r: INTEGER is 114

    Lower_s: INTEGER is 115

    Lower_t: INTEGER is 116

    Lower_u: INTEGER is 117

    Lower_v: INTEGER is 118

    Lower_w: INTEGER is 119

    Lower_x: INTEGER is 120

    Lower_y: INTEGER is 121

    Lower_z: INTEGER is 122

    Opening_brace: INTEGER is 123

    Bar: INTEGER is 124

    Closing_brace: INTEGER is 125

    Tilde: INTEGER is 126

    Ctrl_questmark: INTEGER is 127

    Del: INTEGER is 127

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ASCII

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ASCII Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ASCII

General
    cluster: base.support
    description:
        "The ASCII character set.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    Ack: INTEGER
    Ampersand: INTEGER
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    Eot: INTEGER
    Equal_sign: INTEGER
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    Gs: INTEGER
    Home_arrow: INTEGER
    Ht: INTEGER
    Last_ascii: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    Line_feed: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    Percent: INTEGER
    Plus: INTEGER
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    Right_arrow: INTEGER
    Rs: INTEGER
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    Vt: INTEGER
    Zero: INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ASCII Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        The ASCII character set.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    ASCII

feature -- Access

    Ack: INTEGER is 6

    Ampersand: INTEGER is 38

    Back_space: INTEGER is 8

    Backslash: INTEGER is 92

    Bar: INTEGER is 124

    Bel: INTEGER is 7

    Blank: INTEGER is 32

    Break: INTEGER is -7

    Bs: INTEGER is 8

    Buf_overflow: INTEGER is -9

    Can: INTEGER is 24

    Carriage_return: INTEGER is 13

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a

    Character_set_size: INTEGER is 128

    Circumflex: INTEGER is 94

    Closing_brace: INTEGER is 125

    Colon: INTEGER is 58

    Comma: INTEGER is 44

    Commercial_at: INTEGER is 64

    Cr: INTEGER is 13

    Ctrl_a: INTEGER is 1

    Ctrl_b: INTEGER is 2

    Ctrl_backslash: INTEGER is 28

    Ctrl_c: INTEGER is 3

    Ctrl_circumflex: INTEGER is 30

    Ctrl_d: INTEGER is 4

    Ctrl_e: INTEGER is 5

    Ctrl_f: INTEGER is 6

    Ctrl_g: INTEGER is 7

    Ctrl_h: INTEGER is 8

    Ctrl_i: INTEGER is 9

    Ctrl_j: INTEGER is 10

    Ctrl_k: INTEGER is 11

    Ctrl_l: INTEGER is 12

    Ctrl_lbracket: INTEGER is 27

    Ctrl_m: INTEGER is 13

    Ctrl_n: INTEGER is 14

    Ctrl_o: INTEGER is 15

    Ctrl_p: INTEGER is 16

    Ctrl_q: INTEGER is 17

    Ctrl_questmark: INTEGER is 127

    Ctrl_r: INTEGER is 18

    Ctrl_rbracket: INTEGER is 29

    Ctrl_s: INTEGER is 19

    Ctrl_t: INTEGER is 20

    Ctrl_u: INTEGER is 21

    Ctrl_underlined: INTEGER is 31

    Ctrl_v: INTEGER is 22

    Ctrl_w: INTEGER is 23

    Ctrl_x: INTEGER is 24

    Ctrl_y: INTEGER is 25

    Ctrl_z: INTEGER is 26

    Dc1: INTEGER is 17

    Dc2: INTEGER is 18

    Dc3: INTEGER is 19

    Dc4: INTEGER is 20

    Del: INTEGER is 127

    Dle: INTEGER is 16

    Dollar: INTEGER is 36

    Dot: INTEGER is 46

    Doublequote: INTEGER is 34

    Down_arrow: INTEGER is -3

    Eight: INTEGER is 56

    Em: INTEGER is 25

    Enq: INTEGER is 5

    Eot: INTEGER is 4

    Equal_sign: INTEGER is 61

    Esc: INTEGER is 27

    Etb: INTEGER is 23

    Etx: INTEGER is 3

    Exclamation: INTEGER is 33

    First_printable: INTEGER is 32

    Five: INTEGER is 53

    Four: INTEGER is 52

    Fs: INTEGER is 28

    Grave_accent: INTEGER is 96

    Greaterthan: INTEGER is 62

    Gs: INTEGER is 29

    Home_arrow: INTEGER is -6

    Ht: INTEGER is 9

    Last_ascii: INTEGER is 127

    Last_printable: INTEGER is 126

    Lbracket: INTEGER is 91

    Lcurly: INTEGER is 40

    Left_arrow: INTEGER is -4

    Lessthan: INTEGER is 60

    Letter_layout: INTEGER is 70

    Line_feed: INTEGER is 10

    Lower_a: INTEGER is 97

    Lower_b: INTEGER is 98

    Lower_c: INTEGER is 99

    Lower_d: INTEGER is 100

    Lower_e: INTEGER is 101

    Lower_f: INTEGER is 102

    Lower_g: INTEGER is 103

    Lower_h: INTEGER is 104

    Lower_i: INTEGER is 105

    Lower_j: INTEGER is 106

    Lower_k: INTEGER is 107

    Lower_l: INTEGER is 108

    Lower_m: INTEGER is 109

    Lower_n: INTEGER is 110

    Lower_o: INTEGER is 111

    Lower_p: INTEGER is 112

    Lower_q: INTEGER is 113

    Lower_r: INTEGER is 114

    Lower_s: INTEGER is 115

    Lower_t: INTEGER is 116

    Lower_u: INTEGER is 117

    Lower_v: INTEGER is 118

    Lower_w: INTEGER is 119

    Lower_x: INTEGER is 120

    Lower_y: INTEGER is 121

    Lower_z: INTEGER is 122

    Minus: INTEGER is 45

    Nak: INTEGER is 21

    Nine: INTEGER is 57

    Nl: INTEGER is 10

    Np: INTEGER is 12

    Nul: INTEGER is 0

    Number_sign: INTEGER is 35

    One: INTEGER is 49

    Opening_brace: INTEGER is 123

    Overflow: INTEGER is -8

    Percent: INTEGER is 37

    Plus: INTEGER is 43

    Questmark: INTEGER is 63

    Rbracket: INTEGER is 93

    Rcurly: INTEGER is 41

    Right_arrow: INTEGER is -5

    Rs: INTEGER is 30

    Semicolon: INTEGER is 59

    Seven: INTEGER is 55

    Si: INTEGER is 15

    Singlequote: INTEGER is 39

    Six: INTEGER is 54

    Slash: INTEGER is 47

    So: INTEGER is 14

    Soh: INTEGER is 1

    Sp: INTEGER is 32

    Star: INTEGER is 42

    Stx: INTEGER is 2

    Sub: INTEGER is 26

    Syn: INTEGER is 22

    Tabulation: INTEGER is 9

    Three: INTEGER is 51

    Tilde: INTEGER is 126

    Two: INTEGER is 50

    Underlined: INTEGER is 95

    Up_arrow: INTEGER is -2

    Upper_a: INTEGER is 65

    Upper_b: INTEGER is 66

    Upper_c: INTEGER is 67

    Upper_d: INTEGER is 68

    Upper_e: INTEGER is 69

    Upper_f: INTEGER is 70

    Upper_g: INTEGER is 71

    Upper_h: INTEGER is 72

    Upper_i: INTEGER is 73

    Upper_j: INTEGER is 74

    Upper_k: INTEGER is 75

    Upper_l: INTEGER is 76

    Upper_m: INTEGER is 77

    Upper_n: INTEGER is 78

    Upper_o: INTEGER is 79

    Upper_p: INTEGER is 80

    Upper_q: INTEGER is 81

    Upper_r: INTEGER is 82

    Upper_s: INTEGER is 83

    Upper_t: INTEGER is 84

    Upper_u: INTEGER is 85

    Upper_v: INTEGER is 86

    Upper_w: INTEGER is 87

    Upper_x: INTEGER is 88

    Upper_y: INTEGER is 89

    Upper_z: INTEGER is 90

    Us: INTEGER is 31

    Vt: INTEGER is 11

    Zero: INTEGER is 48

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ASCII

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ASCII Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        The ASCII character set.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    ASCII

feature -- Access

    Ack: INTEGER is 6

    Ampersand: INTEGER is 38

    Back_space: INTEGER is 8

    Backslash: INTEGER is 92

    Bar: INTEGER is 124

    Bel: INTEGER is 7

    Blank: INTEGER is 32

    Break: INTEGER is -7

    Bs: INTEGER is 8

    Buf_overflow: INTEGER is -9

    Can: INTEGER is 24

    Carriage_return: INTEGER is 13

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a

    Character_set_size: INTEGER is 128

    Circumflex: INTEGER is 94

    Closing_brace: INTEGER is 125

    Colon: INTEGER is 58

    Comma: INTEGER is 44

    Commercial_at: INTEGER is 64

    Cr: INTEGER is 13

    Ctrl_a: INTEGER is 1

    Ctrl_b: INTEGER is 2

    Ctrl_backslash: INTEGER is 28

    Ctrl_c: INTEGER is 3

    Ctrl_circumflex: INTEGER is 30

    Ctrl_d: INTEGER is 4

    Ctrl_e: INTEGER is 5

    Ctrl_f: INTEGER is 6

    Ctrl_g: INTEGER is 7

    Ctrl_h: INTEGER is 8

    Ctrl_i: INTEGER is 9

    Ctrl_j: INTEGER is 10

    Ctrl_k: INTEGER is 11

    Ctrl_l: INTEGER is 12

    Ctrl_lbracket: INTEGER is 27

    Ctrl_m: INTEGER is 13

    Ctrl_n: INTEGER is 14

    Ctrl_o: INTEGER is 15

    Ctrl_p: INTEGER is 16

    Ctrl_q: INTEGER is 17

    Ctrl_questmark: INTEGER is 127

    Ctrl_r: INTEGER is 18

    Ctrl_rbracket: INTEGER is 29

    Ctrl_s: INTEGER is 19

    Ctrl_t: INTEGER is 20

    Ctrl_u: INTEGER is 21

    Ctrl_underlined: INTEGER is 31

    Ctrl_v: INTEGER is 22

    Ctrl_w: INTEGER is 23

    Ctrl_x: INTEGER is 24

    Ctrl_y: INTEGER is 25

    Ctrl_z: INTEGER is 26

    Dc1: INTEGER is 17

    Dc2: INTEGER is 18

    Dc3: INTEGER is 19

    Dc4: INTEGER is 20

    Del: INTEGER is 127

    Dle: INTEGER is 16

    Dollar: INTEGER is 36

    Dot: INTEGER is 46

    Doublequote: INTEGER is 34

    Down_arrow: INTEGER is -3

    Eight: INTEGER is 56

    Em: INTEGER is 25

    Enq: INTEGER is 5

    Eot: INTEGER is 4

    Equal_sign: INTEGER is 61

    Esc: INTEGER is 27

    Etb: INTEGER is 23

    Etx: INTEGER is 3

    Exclamation: INTEGER is 33

    First_printable: INTEGER is 32

    Five: INTEGER is 53

    Four: INTEGER is 52

    Fs: INTEGER is 28

    Grave_accent: INTEGER is 96

    Greaterthan: INTEGER is 62

    Gs: INTEGER is 29

    Home_arrow: INTEGER is -6

    Ht: INTEGER is 9

    Last_ascii: INTEGER is 127

    Last_printable: INTEGER is 126

    Lbracket: INTEGER is 91

    Lcurly: INTEGER is 40

    Left_arrow: INTEGER is -4

    Lessthan: INTEGER is 60

    Letter_layout: INTEGER is 70

    Line_feed: INTEGER is 10

    Lower_a: INTEGER is 97

    Lower_b: INTEGER is 98

    Lower_c: INTEGER is 99

    Lower_d: INTEGER is 100

    Lower_e: INTEGER is 101

    Lower_f: INTEGER is 102

    Lower_g: INTEGER is 103

    Lower_h: INTEGER is 104

    Lower_i: INTEGER is 105

    Lower_j: INTEGER is 106

    Lower_k: INTEGER is 107

    Lower_l: INTEGER is 108

    Lower_m: INTEGER is 109

    Lower_n: INTEGER is 110

    Lower_o: INTEGER is 111

    Lower_p: INTEGER is 112

    Lower_q: INTEGER is 113

    Lower_r: INTEGER is 114

    Lower_s: INTEGER is 115

    Lower_t: INTEGER is 116

    Lower_u: INTEGER is 117

    Lower_v: INTEGER is 118

    Lower_w: INTEGER is 119

    Lower_x: INTEGER is 120

    Lower_y: INTEGER is 121

    Lower_z: INTEGER is 122

    Minus: INTEGER is 45

    Nak: INTEGER is 21

    Nine: INTEGER is 57

    Nl: INTEGER is 10

    Np: INTEGER is 12

    Nul: INTEGER is 0

    Number_sign: INTEGER is 35

    One: INTEGER is 49

    Opening_brace: INTEGER is 123

    Overflow: INTEGER is -8

    Percent: INTEGER is 37

    Plus: INTEGER is 43

    Questmark: INTEGER is 63

    Rbracket: INTEGER is 93

    Rcurly: INTEGER is 41

    Right_arrow: INTEGER is -5

    Rs: INTEGER is 30

    Semicolon: INTEGER is 59

    Seven: INTEGER is 55

    Si: INTEGER is 15

    Singlequote: INTEGER is 39

    Six: INTEGER is 54

    Slash: INTEGER is 47

    So: INTEGER is 14

    Soh: INTEGER is 1

    Sp: INTEGER is 32

    Star: INTEGER is 42

    Stx: INTEGER is 2

    Sub: INTEGER is 26

    Syn: INTEGER is 22

    Tabulation: INTEGER is 9

    Three: INTEGER is 51

    Tilde: INTEGER is 126

    Two: INTEGER is 50

    Underlined: INTEGER is 95

    Up_arrow: INTEGER is -2

    Upper_a: INTEGER is 65

    Upper_b: INTEGER is 66

    Upper_c: INTEGER is 67

    Upper_d: INTEGER is 68

    Upper_e: INTEGER is 69

    Upper_f: INTEGER is 70

    Upper_g: INTEGER is 71

    Upper_h: INTEGER is 72

    Upper_i: INTEGER is 73

    Upper_j: INTEGER is 74

    Upper_k: INTEGER is 75

    Upper_l: INTEGER is 76

    Upper_m: INTEGER is 77

    Upper_n: INTEGER is 78

    Upper_o: INTEGER is 79

    Upper_p: INTEGER is 80

    Upper_q: INTEGER is 81

    Upper_r: INTEGER is 82

    Upper_s: INTEGER is 83

    Upper_t: INTEGER is 84

    Upper_u: INTEGER is 85

    Upper_v: INTEGER is 86

    Upper_w: INTEGER is 87

    Upper_x: INTEGER is 88

    Upper_y: INTEGER is 89

    Upper_z: INTEGER is 90

    Us: INTEGER is 31

    Vt: INTEGER is 11

    Zero: INTEGER is 48

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ASCII

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ASCII Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    ASCII

Ancestors
    ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


ASCII Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        The ASCII character set.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    ASCII

feature -- Access

    Character_set_size: INTEGER is 128

    Last_ascii: INTEGER is 127

    First_printable: INTEGER is 32

    Last_printable: INTEGER is 126

    Letter_layout: INTEGER is 70

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a

    Buf_overflow: INTEGER is -9

    Overflow: INTEGER is -8

    Break: INTEGER is -7

    Home_arrow: INTEGER is -6

    Right_arrow: INTEGER is -5

    Left_arrow: INTEGER is -4

    Down_arrow: INTEGER is -3

    Up_arrow: INTEGER is -2

    Nul: INTEGER is 0

    Ctrl_a: INTEGER is 1

    Soh: INTEGER is 1

    Ctrl_b: INTEGER is 2

    Stx: INTEGER is 2

    Ctrl_c: INTEGER is 3

    Etx: INTEGER is 3

    Ctrl_d: INTEGER is 4

    Eot: INTEGER is 4

    Ctrl_e: INTEGER is 5

    Enq: INTEGER is 5

    Ctrl_f: INTEGER is 6

    Ack: INTEGER is 6

    Ctrl_g: INTEGER is 7

    Bel: INTEGER is 7

    Ctrl_h: INTEGER is 8

    Bs: INTEGER is 8

    Back_space: INTEGER is 8

    Ctrl_i: INTEGER is 9

    Ht: INTEGER is 9

    Tabulation: INTEGER is 9

    Ctrl_j: INTEGER is 10

    Nl: INTEGER is 10

    Line_feed: INTEGER is 10

    Ctrl_k: INTEGER is 11

    Vt: INTEGER is 11

    Ctrl_l: INTEGER is 12

    Np: INTEGER is 12

    Ctrl_m: INTEGER is 13

    Cr: INTEGER is 13

    Carriage_return: INTEGER is 13

    Ctrl_n: INTEGER is 14

    So: INTEGER is 14

    Ctrl_o: INTEGER is 15

    Si: INTEGER is 15

    Ctrl_p: INTEGER is 16

    Dle: INTEGER is 16

    Ctrl_q: INTEGER is 17

    Dc1: INTEGER is 17

    Ctrl_r: INTEGER is 18

    Dc2: INTEGER is 18

    Ctrl_s: INTEGER is 19

    Dc3: INTEGER is 19

    Ctrl_t: INTEGER is 20

    Dc4: INTEGER is 20

    Ctrl_u: INTEGER is 21

    Nak: INTEGER is 21

    Ctrl_v: INTEGER is 22

    Syn: INTEGER is 22

    Ctrl_w: INTEGER is 23

    Etb: INTEGER is 23

    Ctrl_x: INTEGER is 24

    Can: INTEGER is 24

    Ctrl_y: INTEGER is 25

    Em: INTEGER is 25

    Ctrl_z: INTEGER is 26

    Sub: INTEGER is 26

    Ctrl_lbracket: INTEGER is 27

    Esc: INTEGER is 27

    Ctrl_backslash: INTEGER is 28

    Fs: INTEGER is 28

    Ctrl_rbracket: INTEGER is 29

    Gs: INTEGER is 29

    Ctrl_circumflex: INTEGER is 30

    Rs: INTEGER is 30

    Ctrl_underlined: INTEGER is 31

    Us: INTEGER is 31

    Blank: INTEGER is 32

    Sp: INTEGER is 32

    Exclamation: INTEGER is 33

    Doublequote: INTEGER is 34

    Number_sign: INTEGER is 35

    Dollar: INTEGER is 36

    Percent: INTEGER is 37

    Ampersand: INTEGER is 38

    Singlequote: INTEGER is 39

    Lcurly: INTEGER is 40

    Rcurly: INTEGER is 41

    Star: INTEGER is 42

    Plus: INTEGER is 43

    Comma: INTEGER is 44

    Minus: INTEGER is 45

    Dot: INTEGER is 46

    Slash: INTEGER is 47

    Zero: INTEGER is 48

    One: INTEGER is 49

    Two: INTEGER is 50

    Three: INTEGER is 51

    Four: INTEGER is 52

    Five: INTEGER is 53

    Six: INTEGER is 54

    Seven: INTEGER is 55

    Eight: INTEGER is 56

    Nine: INTEGER is 57

    Colon: INTEGER is 58

    Semicolon: INTEGER is 59

    Lessthan: INTEGER is 60

    Equal_sign: INTEGER is 61

    Greaterthan: INTEGER is 62

    Questmark: INTEGER is 63

    Commercial_at: INTEGER is 64

    Upper_a: INTEGER is 65

    Upper_b: INTEGER is 66

    Upper_c: INTEGER is 67

    Upper_d: INTEGER is 68

    Upper_e: INTEGER is 69

    Upper_f: INTEGER is 70

    Upper_g: INTEGER is 71

    Upper_h: INTEGER is 72

    Upper_i: INTEGER is 73

    Upper_j: INTEGER is 74

    Upper_k: INTEGER is 75

    Upper_l: INTEGER is 76

    Upper_m: INTEGER is 77

    Upper_n: INTEGER is 78

    Upper_o: INTEGER is 79

    Upper_p: INTEGER is 80

    Upper_q: INTEGER is 81

    Upper_r: INTEGER is 82

    Upper_s: INTEGER is 83

    Upper_t: INTEGER is 84

    Upper_u: INTEGER is 85

    Upper_v: INTEGER is 86

    Upper_w: INTEGER is 87

    Upper_x: INTEGER is 88

    Upper_y: INTEGER is 89

    Upper_z: INTEGER is 90

    Lbracket: INTEGER is 91

    Backslash: INTEGER is 92

    Rbracket: INTEGER is 93

    Circumflex: INTEGER is 94

    Underlined: INTEGER is 95

    Grave_accent: INTEGER is 96

    Lower_a: INTEGER is 97

    Lower_b: INTEGER is 98

    Lower_c: INTEGER is 99

    Lower_d: INTEGER is 100

    Lower_e: INTEGER is 101

    Lower_f: INTEGER is 102

    Lower_g: INTEGER is 103

    Lower_h: INTEGER is 104

    Lower_i: INTEGER is 105

    Lower_j: INTEGER is 106

    Lower_k: INTEGER is 107

    Lower_l: INTEGER is 108

    Lower_m: INTEGER is 109

    Lower_n: INTEGER is 110

    Lower_o: INTEGER is 111

    Lower_p: INTEGER is 112

    Lower_q: INTEGER is 113

    Lower_r: INTEGER is 114

    Lower_s: INTEGER is 115

    Lower_t: INTEGER is 116

    Lower_u: INTEGER is 117

    Lower_v: INTEGER is 118

    Lower_w: INTEGER is 119

    Lower_x: INTEGER is 120

    Lower_y: INTEGER is 121

    Lower_z: INTEGER is 122

    Opening_brace: INTEGER is 123

    Bar: INTEGER is 124

    Closing_brace: INTEGER is 125

    Tilde: INTEGER is 126

    Ctrl_questmark: INTEGER is 127

    Del: INTEGER is 127

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ASCII

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOL_STRING Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Packed boolean strings"
    status: "See notice at end of class"
    names: packed_booleans
    access: index
    representation: array
    size: fixed
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    BOOL_STRING

inherit
    TO_SPECIAL [BOOLEAN]
        export
            {NONE} all,
            {BOOL_STRING} area
        end

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Allocate area of n booleans.
        require
            non_negative_size: n >= 0
        do
            make_area (n)
        ensure
            correct_allocation: count = n
        end

feature -- Access

    item (i: INTEGER): BOOLEAN is
            -- Boolean at i-th position,
            -- beginning at left, 1 origin
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count
        do
            Result := area.item (i - 1)
        end

feature -- Measurement

    count: INTEGER is
            -- Number of boolean in the area.
        do
            Result := area.count
        end

feature -- Element change

    put (v: like item; i: INTEGER) is
            -- Put boolean v at i-th position
            -- beginning at left, 1 origin.
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count
        do
            area.put (v, i - 1)
        end

    all_true is
            -- Set all booleans to true.
        do
            bl_str_set ($area, count, 1)
        end

    all_false is
            -- Set all booleans to false.
        do
            bl_str_set ($area, count, 0)
        end

feature -- Basic operations

    infix "and" (other: like Current): like Current is
            -- Logical and of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count
        local
            other_area, result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            other_area := other.area
            bl_str_and ($area, $other_area, $result_area, count)
        end

    infix "or" (other: like Current): like Current is
            -- Logical or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count
        local
            other_area, result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            other_area := other.area
            bl_str_or ($area, $other_area, $result_area, count)
        end

    infix "xor" (other: like Current): like Current is
            -- Logical exclusive or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count
        local
            other_area, result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            other_area := other.area
            bl_str_xor ($area, $other_area, $result_area, count)
        end

    prefix "not": like Current is
            -- Negation of 'Current'
        local
            result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            bl_str_not ($area, $result_area, count)
        end

    right_shifted (n: INTEGER): like Current is
            -- Right shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0
        local
            result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            bl_str_shiftr ($area, $result_area, count, n)
        end

    left_shifted (n: INTEGER): like Current is
            -- Left shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0
        local
            result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            bl_str_shiftl ($area, $result_area, count, n)
        end

feature {NONE} -- Implementation

    bl_str_and (a1, a2, a3: POINTER; size: INTEGER) is
            -- Apply logic and on a1 with a2.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_or (a1, a2, a3: POINTER; size: INTEGER) is
            -- Apply logic or on a1 with a2.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_xor (a1, a2, a3: POINTER; size: INTEGER) is
            -- Apply exclusive or on a1 with a2.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_not (a1, a2: POINTER; size: INTEGER) is
            -- Negation of a1.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_shiftr (a1, a2: POINTER; size, value: INTEGER) is
            -- Right shifted a1 by n positions.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_shiftl (a1, a2: POINTER; size, value: INTEGER) is
            -- Left shifted a1 by n positions.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_set (a1: POINTER; size, value: INTEGER) is
            -- Set all booleans to true if value = 1
            -- or false if value = 0.
        external
            "C | %"eif_boolstr.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOL_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOL_STRING Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOOL_STRING

General
    cluster: base.support
    description: "Packed boolean strings"
    create: make

Ancestors
    TO_SPECIAL [T]

Queries
    infix "and" (other: [like Current] BOOL_STRING): [like Current] BOOL_STRING
    infix "or" (other: [like Current] BOOL_STRING): [like Current] BOOL_STRING
    infix "xor" (other: [like Current] BOOL_STRING): [like Current] BOOL_STRING
    prefix "not": [like Current] BOOL_STRING
    count: INTEGER
    item (i: INTEGER): BOOLEAN
    left_shifted (n: INTEGER): [like Current] BOOL_STRING
    right_shifted (n: INTEGER): [like Current] BOOL_STRING

Commands
    all_false
    all_true
    make (n: INTEGER)
    put (v: [like item] BOOLEAN; i: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOL_STRING Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Packed boolean strings"
    status: "See notice at end of class"
    names: packed_booleans
    access: index
    representation: array
    size: fixed
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    BOOL_STRING

create
    make

feature -- Initialization

    make (n: INTEGER) is
            -- Allocate area of n booleans.
        require
            non_negative_size: n >= 0
        do
            make_area (n)
        ensure
            correct_allocation: count = n
        end

feature {NONE} -- Initialization

    make_area (n: INTEGER) is
            -- Creates a special object for n entries.
            -- (from TO_SPECIAL)
        require -- from TO_SPECIAL
            non_negative_argument: n >= 0
        do
            create area.make (n)
        ensure -- from TO_SPECIAL
            area_allocated: area /= void and then area.count = n
        end

feature -- Access

    item (i: INTEGER): BOOLEAN is
            -- Boolean at i-th position,
            -- beginning at left, 1 origin
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count
        do
            Result := area.item (i - 1)
        end

feature {BOOL_STRING} -- Access

    area: SPECIAL [BOOLEAN]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    count: INTEGER is
            -- Number of boolean in the area.
        do
            Result := area.count
        end

feature -- Element change

    all_false is
            -- Set all booleans to false.
        do
            bl_str_set ($area, count, 0)
        end

    all_true is
            -- Set all booleans to true.
        do
            bl_str_set ($area, count, 1)
        end

    put (v: like item; i: INTEGER) is
            -- Put boolean v at i-th position
            -- beginning at left, 1 origin.
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count
        do
            area.put (v, i - 1)
        end

feature {NONE} -- Element change

    set_area (other: like area) is
            -- Make other the new area
            -- (from TO_SPECIAL)
        do
            area := other
        end

feature -- Basic operations

    left_shifted (n: INTEGER): like Current is
            -- Left shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0
        local
            result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            bl_str_shiftl ($area, $result_area, count, n)
        end

    right_shifted (n: INTEGER): like Current is
            -- Right shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0
        local
            result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            bl_str_shiftr ($area, $result_area, count, n)
        end

    infix "and" (other: like Current): like Current is
            -- Logical and of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count
        local
            other_area, result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            other_area := other.area
            bl_str_and ($area, $other_area, $result_area, count)
        end

    prefix "not": like Current is
            -- Negation of 'Current'
        local
            result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            bl_str_not ($area, $result_area, count)
        end

    infix "or" (other: like Current): like Current is
            -- Logical or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count
        local
            other_area, result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            other_area := other.area
            bl_str_or ($area, $other_area, $result_area, count)
        end

    infix "xor" (other: like Current): like Current is
            -- Logical exclusive or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count
        local
            other_area, result_area: like area
        do
            create Result.make (count)
            result_area := Result.area
            other_area := other.area
            bl_str_xor ($area, $other_area, $result_area, count)
        end

feature {NONE} -- Implementation

    bl_str_and (a1, a2, a3: POINTER; size: INTEGER) is
            -- Apply logic and on a1 with a2.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_not (a1, a2: POINTER; size: INTEGER) is
            -- Negation of a1.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_or (a1, a2, a3: POINTER; size: INTEGER) is
            -- Apply logic or on a1 with a2.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_set (a1: POINTER; size, value: INTEGER) is
            -- Set all booleans to true if value = 1
            -- or false if value = 0.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_shiftl (a1, a2: POINTER; size, value: INTEGER) is
            -- Left shifted a1 by n positions.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_shiftr (a1, a2: POINTER; size, value: INTEGER) is
            -- Right shifted a1 by n positions.
        external
            "C | %"eif_boolstr.h%""
        end

    bl_str_xor (a1, a2, a3: POINTER; size: INTEGER) is
            -- Apply exclusive or on a1 with a2.
        external
            "C | %"eif_boolstr.h%""
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOL_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOL_STRING Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Packed boolean strings"
    status: "See notice at end of class"
    names: packed_booleans
    access: index
    representation: array
    size: fixed
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    BOOL_STRING

create

    make (n: INTEGER)
            -- Allocate area of n booleans.
        require
            non_negative_size: n >= 0
        ensure
            correct_allocation: count = n

feature -- Initialization

    make (n: INTEGER)
            -- Allocate area of n booleans.
        require
            non_negative_size: n >= 0
        ensure
            correct_allocation: count = n

feature -- Access

    item (i: INTEGER): BOOLEAN
            -- Boolean at i-th position,
            -- beginning at left, 1 origin
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count

feature -- Measurement

    count: INTEGER
            -- Number of boolean in the area.

feature -- Element change

    all_false
            -- Set all booleans to false.

    all_true
            -- Set all booleans to true.

    put (v: like item; i: INTEGER)
            -- Put boolean v at i-th position
            -- beginning at left, 1 origin.
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count

feature -- Basic operations

    left_shifted (n: INTEGER): like Current
            -- Left shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0

    right_shifted (n: INTEGER): like Current
            -- Right shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0

    infix "and" (other: like Current): like Current
            -- Logical and of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

    prefix "not": like Current
            -- Negation of 'Current'

    infix "or" (other: like Current): like Current
            -- Logical or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

    infix "xor" (other: like Current): like Current
            -- Logical exclusive or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOL_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOL_STRING Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    BOOL_STRING

Ancestors
    TO_SPECIAL [T]

Clients
    BOOL_STRING

Suppliers
    BOOL_STRING
    INTEGER
    SPECIAL [T]

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


BOOL_STRING Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Packed boolean strings"
    status: "See notice at end of class"
    names: packed_booleans
    access: index
    representation: array
    size: fixed
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    BOOL_STRING

create
    make

feature -- Initialization

    make (n: INTEGER)
            -- Allocate area of n booleans.
        require
            non_negative_size: n >= 0
        ensure
            correct_allocation: count = n

feature -- Access

    item (i: INTEGER): BOOLEAN
            -- Boolean at i-th position,
            -- beginning at left, 1 origin
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count

feature -- Measurement

    count: INTEGER
            -- Number of boolean in the area.

feature -- Element change

    put (v: like item; i: INTEGER)
            -- Put boolean v at i-th position
            -- beginning at left, 1 origin.
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count

    all_true
            -- Set all booleans to true.

    all_false
            -- Set all booleans to false.

feature -- Basic operations

    infix "and" (other: like Current): like Current
            -- Logical and of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

    infix "or" (other: like Current): like Current
            -- Logical or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

    infix "xor" (other: like Current): like Current
            -- Logical exclusive or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

    prefix "not": like Current
            -- Negation of 'Current'

    right_shifted (n: INTEGER): like Current
            -- Right shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0

    left_shifted (n: INTEGER): like Current
            -- Left shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOL_STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE_SEQUENCE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite sequences, indexed by integers"
    status: "See notice at end of class"
    names: countable_sequence, infinite_sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

deferred class
    COUNTABLE_SEQUENCE [G]

inherit
    COUNTABLE [G]
        rename
            item as i_th
        end

    ACTIVE [G]
        export
            {NONE} fill, prune_all, put, prune, wipe_out, replace, remove
        end

    LINEAR [G]
        redefine
            linear_representation
        end

feature -- Access

    i_th (i: INTEGER): G is
            -- Item of rank i
        deferred
        end

    index: INTEGER
            -- Index of current position

    item: G is
            -- Item at current position
        do
            Result := i_th (index)
        end

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)

feature -- Cursor movement

    forth is
            -- Move to next position.
        do
            index := index + 1
        end

    start is
            -- Move to first position.
        do
            index := 1
        end

feature {NONE} -- Inapplicable

    extend (v: G) is
            -- Add v at end.
        do
        end

    finish is
            -- Move to last position.
        do
        ensure then
            failure: False
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        do
        end

    prune (v: G) is
            -- Remove first occurrence of v, if any.
        do
        end

    put (v: G) is
            -- Add v to the right of current position.
        do
        end

    remove is
            -- Remove item to the right of current position.
        do
        end

    replace (v: G) is
            -- Replace by v item at current position.
        do
        end

    wipe_out is
            -- Remove all items.
        do
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE_SEQUENCE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COUNTABLE_SEQUENCE [G]

General
    cluster: base.support
    description: "Infinite sequences, indexed by integers"

Ancestors
    ACTIVE [G]
    COUNTABLE [G]
    LINEAR [G]

Queries
    After: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    forth
    search (v: [like item] G)
    start

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE_SEQUENCE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite sequences, indexed by integers"
    status: "See notice at end of class"
    names: countable_sequence, infinite_sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

deferred class
    COUNTABLE_SEQUENCE [G]

feature -- Access

    has (v: like item): BOOLEAN is
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            start
            if not off then
                search (v)
            end
            Result := not exhausted
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    i_th (i: INTEGER): G is
            -- Item of rank i
        require -- from COUNTABLE
            positive_argument: i > 0
        deferred
        end

    index: INTEGER
            -- Index of current position

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: G is
            -- Item at current position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := i_th (index)
        end

    occurrences (v: G): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: G): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Move to next position.
        require -- from LINEAR
            not_after: not after
        do
            index := index + 1
        end

    start is
            -- Move to first position.
        do
            index := 1
        end

feature {NONE} -- Element change

    fill (other: CONTAINER [G]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [G]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

feature {NONE} -- Removal

    prune_all (v: G) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature {NONE} -- Inapplicable

    extend (v: G) is
            -- Add v at end.
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    finish is
            -- Move to last position.
        do
        ensure then
            failure: False
        end

    linear_representation: LINEAR [G] is
            -- Representation as a linear structure
        do
        end

    prune (v: G) is
            -- Remove first occurrence of v, if any.
        require -- from COLLECTION
            prunable: prunable
        do
        end

    put (v: G) is
            -- Add v to the right of current position.
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove item to the right of current position.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

    replace (v: G) is
            -- Replace by v item at current position.
        require -- from ACTIVE
            writable: writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        end

    wipe_out is
            -- Remove all items.
        require -- from COLLECTION
            prunable
        do
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [G]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [G]
            c: CURSOR
            t: TUPLE [G]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE_SEQUENCE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite sequences, indexed by integers"
    status: "See notice at end of class"
    names: countable_sequence, infinite_sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COUNTABLE_SEQUENCE [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): G
            -- Item of rank i
        require -- from COUNTABLE
            positive_argument: i > 0

    index: INTEGER
            -- Index of current position

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE_SEQUENCE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

deferred class
    COUNTABLE_SEQUENCE [G]

Ancestors
    ACTIVE [G]
    COUNTABLE [G]
    LINEAR [G]

Descendants
    FIBONACCI
    PRIMES
    RANDOM

Clients
    COUNTABLE_SEQUENCE [G]

Suppliers
    COUNTABLE_SEQUENCE [G]
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


COUNTABLE_SEQUENCE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Infinite sequences, indexed by integers"
    status: "See notice at end of class"
    names: countable_sequence, infinite_sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COUNTABLE_SEQUENCE [G]

feature -- Access

    i_th (i: INTEGER): G
            -- Item of rank i

    index: INTEGER
            -- Index of current position

    item: G
            -- Item at current position

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)

feature -- Cursor movement

    forth
            -- Move to next position.

    start
            -- Move to first position.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE_SEQUENCE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster base.support

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


DOUBLE_MATH Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, double-precision.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    DOUBLE_MATH

inherit
    MATH_CONST
        export
            {NONE} all
        end

feature -- Access

    log_2 (v: DOUBLE): DOUBLE is
            -- Base 2 logarithm of v
        local
            a: DOUBLE
        do
            a := 2.0
            Result := log (v) / log (a)
        end

    cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]
        external
            "C | <math.h>"
        alias
            "cos"
        end

    arc_cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]
        external
            "C | <math.h>"
        alias
            "acos"
        end

    sine (v: DOUBLE): DOUBLE is
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]
        external
            "C | <math.h>"
        alias
            "sin"
        end

    arc_sine (v: DOUBLE): DOUBLE is
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]
        external
            "C | <math.h>"
        alias
            "asin"
        end

    tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]
        external
            "C | <math.h>"
        alias
            "tan"
        end

    arc_tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]
        external
            "C | <math.h>"
        alias
            "atan"
        end

    sqrt (v: DOUBLE): DOUBLE is
            -- Square root of v
        external
            "C | <math.h>"
        end

    exp (x: DOUBLE): DOUBLE is
            -- Exponential of v.
        external
            "C | <math.h>"
        end

    log (v: DOUBLE): DOUBLE is
            -- Natural logarithm of v
        external
            "C | <math.h>"
        end

    log10 (v: DOUBLE): DOUBLE is
            -- Base 10 logarithm of v
        external
            "C | <math.h>"
        end

    floor (v: DOUBLE): DOUBLE is
            -- Greatest integral less than or equal to v
        external
            "C | <math.h>"
        end

    ceiling (v: DOUBLE): DOUBLE is
            -- Least integral greater than or equal to v
        external
            "C | <math.h>"
        alias
            "ceil"
        end

    dabs (v: DOUBLE): DOUBLE is
            -- Absolute of v
        external
            "C | <math.h>"
        alias
            "fabs"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_MATH Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DOUBLE_MATH

General
    cluster: base.support
    description:
        "Basic mathematical operations, double-precision.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    MATH_CONST

Queries
    arc_cosine (v: DOUBLE): DOUBLE
    arc_sine (v: DOUBLE): DOUBLE
    arc_tangent (v: DOUBLE): DOUBLE
    ceiling (v: DOUBLE): DOUBLE
    cosine (v: DOUBLE): DOUBLE
    dabs (v: DOUBLE): DOUBLE
    exp (x: DOUBLE): DOUBLE
    floor (v: DOUBLE): DOUBLE
    log (v: DOUBLE): DOUBLE
    log10 (v: DOUBLE): DOUBLE
    log_2 (v: DOUBLE): DOUBLE
    sine (v: DOUBLE): DOUBLE
    sqrt (v: DOUBLE): DOUBLE
    tangent (v: DOUBLE): DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_MATH Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, double-precision.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    DOUBLE_MATH

feature -- Access

    arc_cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]
        external
            "C | <math.h>"
        alias
            "acos"
        end

    arc_sine (v: DOUBLE): DOUBLE is
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]
        external
            "C | <math.h>"
        alias
            "asin"
        end

    arc_tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]
        external
            "C | <math.h>"
        alias
            "atan"
        end

    ceiling (v: DOUBLE): DOUBLE is
            -- Least integral greater than or equal to v
        external
            "C | <math.h>"
        alias
            "ceil"
        end

    cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]
        external
            "C | <math.h>"
        alias
            "cos"
        end

    dabs (v: DOUBLE): DOUBLE is
            -- Absolute of v
        external
            "C | <math.h>"
        alias
            "fabs"
        end

    exp (x: DOUBLE): DOUBLE is
            -- Exponential of v.
        external
            "C | <math.h>"
        end

    floor (v: DOUBLE): DOUBLE is
            -- Greatest integral less than or equal to v
        external
            "C | <math.h>"
        end

    log (v: DOUBLE): DOUBLE is
            -- Natural logarithm of v
        external
            "C | <math.h>"
        end

    log10 (v: DOUBLE): DOUBLE is
            -- Base 10 logarithm of v
        external
            "C | <math.h>"
        end

    log_2 (v: DOUBLE): DOUBLE is
            -- Base 2 logarithm of v
        local
            a: DOUBLE
        do
            a := 2.0
            Result := log (v) / log (a)
        end

    sine (v: DOUBLE): DOUBLE is
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]
        external
            "C | <math.h>"
        alias
            "sin"
        end

    sqrt (v: DOUBLE): DOUBLE is
            -- Square root of v
        external
            "C | <math.h>"
        end

    tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]
        external
            "C | <math.h>"
        alias
            "tan"
        end

feature {NONE} -- Access

    Euler: DOUBLE is 2.7182818284590452354
            -- Logarithm base
            -- (from MATH_CONST)

    Pi: DOUBLE is 3.14159265358979323846
            -- (from MATH_CONST)

    Sqrt2: DOUBLE is 1.41421356237309504880
            -- Square root of 2
            -- (from MATH_CONST)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_MATH Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, double-precision.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    DOUBLE_MATH

feature -- Access

    arc_cosine (v: DOUBLE): DOUBLE
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]

    arc_sine (v: DOUBLE): DOUBLE
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]

    arc_tangent (v: DOUBLE): DOUBLE
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]

    ceiling (v: DOUBLE): DOUBLE
            -- Least integral greater than or equal to v

    cosine (v: DOUBLE): DOUBLE
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]

    dabs (v: DOUBLE): DOUBLE
            -- Absolute of v

    exp (x: DOUBLE): DOUBLE
            -- Exponential of v.

    floor (v: DOUBLE): DOUBLE
            -- Greatest integral less than or equal to v

    log (v: DOUBLE): DOUBLE
            -- Natural logarithm of v

    log10 (v: DOUBLE): DOUBLE
            -- Base 10 logarithm of v

    log_2 (v: DOUBLE): DOUBLE
            -- Base 2 logarithm of v

    sine (v: DOUBLE): DOUBLE
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]

    sqrt (v: DOUBLE): DOUBLE
            -- Square root of v

    tangent (v: DOUBLE): DOUBLE
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_MATH Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    DOUBLE_MATH

Ancestors
    MATH_CONST

Descendants
    FORMAT_DOUBLE
    RANDOM

Clients
    DOUBLE_MATH

Suppliers
    DOUBLE
    DOUBLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


DOUBLE_MATH Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, double-precision.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    DOUBLE_MATH

feature -- Access

    log_2 (v: DOUBLE): DOUBLE
            -- Base 2 logarithm of v

    cosine (v: DOUBLE): DOUBLE
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]

    arc_cosine (v: DOUBLE): DOUBLE
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]

    sine (v: DOUBLE): DOUBLE
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]

    arc_sine (v: DOUBLE): DOUBLE
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]

    tangent (v: DOUBLE): DOUBLE
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]

    arc_tangent (v: DOUBLE): DOUBLE
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]

    sqrt (v: DOUBLE): DOUBLE
            -- Square root of v

    exp (x: DOUBLE): DOUBLE
            -- Exponential of v.

    log (v: DOUBLE): DOUBLE
            -- Natural logarithm of v

    log10 (v: DOUBLE): DOUBLE
            -- Base 10 logarithm of v

    floor (v: DOUBLE): DOUBLE
            -- Greatest integral less than or equal to v

    ceiling (v: DOUBLE): DOUBLE
            -- Least integral greater than or equal to v

    dabs (v: DOUBLE): DOUBLE
            -- Absolute of v

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXECUTION_ENVIRONMENT Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the environment at time of execution"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    EXECUTION_ENVIRONMENT

feature -- Access

    command_line: ARGUMENTS is
            -- Command line that was used to start current execution
        once
            create Result
        end

    current_working_directory: STRING is
            -- Directory of current execution
        external
            "C | %"eif_dir.h%""
        alias
            "dir_current"
        end

    default_shell: STRING is
            -- Default shell
        once
            Result := get ("SHELL")
            if Result = void then
                Result := ""
            end
        end

    get (s: STRING): STRING is
            -- Value of s if it is an environment variable and has been set;
            -- void otherwise.
        require
            s_exists: s /= void
        local
            ext: ANY
            c_string: POINTER
            void_pointer: POINTER
        do
            ext := s.to_c
            c_string := eif_getenv ($ext)
            if c_string /= void_pointer then
                create Result.make_from_c (c_string)
            end
        end

    home_directory_name: STRING is
            -- Directory name corresponding to the home directory.
        require
            home_directory_supported: operating_environment.home_directory_supported
        do
            Result := eif_home_directory_name
        end

    root_directory_name: STRING is
            -- Directory name corresponding to the root directory.
        require
            root_directory_supported: operating_environment.root_directory_supported
        do
            Result := eif_home_directory_name
        end

feature -- Status

    return_code: INTEGER
            -- Status code set by last call to system or put

feature -- Status setting

    change_working_directory (path: STRING) is
            -- Set the current directory to path
        do
            return_code := eif_chdir (path.to_c)
        end

    put (value, key: STRING) is
            -- Set the environment variable key to value.
        require
            key_exists: key /= void
            key_meaningful: key.count > 0
            value_exists: value /= void
        local
            v_to_c, k_to_c: ANY
        do
            v_to_c := value.to_c
            k_to_c := key.to_c
            return_code := eif_putenv ($v_to_c, $k_to_c)
        ensure
            variable_set: (return_code = 0) implies (value.is_equal (get (key)))
        end

    system (s: STRING) is
            -- Pass to the operating system a request to execute s.
            -- If s is empty, use the default shell as command.
        require
            s_exists: s /= void
        local
            ext: ANY
        do
            if s.is_empty then
                ext := default_shell.to_c
            else
                ext := s.to_c
            end
            return_code := system_call ($ext)
        end

    launch (s: STRING) is
            -- Pass to the operating system an asynchronous request to
            -- execute s.
            -- If s is empty, use the default shell as command.
        require
            s_not_void: s /= void
        local
            ext: ANY
        do
            if s.is_empty then
                ext := default_shell.to_c
            else
                ext := s.to_c
            end
            asynchronous_system_call ($ext)
        end

feature {NONE} -- External

    eif_getenv (s: POINTER): POINTER is
            -- Value of environment variable s
        external
            "C | %"eif_misc.h%""
        end

    eif_putenv (v, k: POINTER): INTEGER is
            -- Set s in the environment.
        external
            "C | %"eif_misc.h%""
        end

    eif_chdir (s: ANY): INTEGER is
            -- Set the current directory to path
        external
            "C | %"eif_dir.h%""
        end

    system_call (s: POINTER): INTEGER is
            -- Pass to the operating system a request to execute s.
        external
            "C | %"eif_misc.h%""
        alias
            "eif_system"
        end

    asynchronous_system_call (s: POINTER) is
            -- Pass to the operating system an asynchronous request to execute s.
        external
            "C | %"eif_misc.h%""
        alias
            "eif_system_asynchronous"
        end

    eif_home_directory_name: STRING is
            -- Directory name corresponding to the home directory
        external
            "C | %"eif_path_name.h%""
        end

    eif_root_directory_name: STRING is
            -- Directory name corresponding to the root directory
        external
            "C | %"eif_path_name.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXECUTION_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXECUTION_ENVIRONMENT Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    EXECUTION_ENVIRONMENT

General
    cluster: base.support
    description: "The objects available from the environment at time of execution"

Ancestors
    ANY

Queries
    Command_line: ARGUMENTS
    current_working_directory: STRING
    Default_shell: STRING
    get (s: STRING): STRING
    home_directory_name: STRING
    return_code: INTEGER
    root_directory_name: STRING

Commands
    change_working_directory (path: STRING)
    launch (s: STRING)
    put (value, key: STRING)
    system (s: STRING)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXECUTION_ENVIRONMENT Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the environment at time of execution"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    EXECUTION_ENVIRONMENT

feature -- Access

    command_line: ARGUMENTS is
            -- Command line that was used to start current execution
        once
            create Result
        end

    current_working_directory: STRING is
            -- Directory of current execution
        external
            "C | %"eif_dir.h%""
        alias
            "dir_current"
        end

    default_shell: STRING is
            -- Default shell
        once
            Result := get ("SHELL")
            if Result = void then
                Result := ""
            end
        end

    get (s: STRING): STRING is
            -- Value of s if it is an environment variable and has been set;
            -- void otherwise.
        require
            s_exists: s /= void
        local
            ext: ANY
            c_string: POINTER
            void_pointer: POINTER
        do
            ext := s.to_c
            c_string := eif_getenv ($ext)
            if c_string /= void_pointer then
                create Result.make_from_c (c_string)
            end
        end

    home_directory_name: STRING is
            -- Directory name corresponding to the home directory.
        require
            home_directory_supported: operating_environment.home_directory_supported
        do
            Result := eif_home_directory_name
        end

    root_directory_name: STRING is
            -- Directory name corresponding to the root directory.
        require
            root_directory_supported: operating_environment.root_directory_supported
        do
            Result := eif_home_directory_name
        end

feature -- Status setting

    change_working_directory (path: STRING) is
            -- Set the current directory to path
        do
            return_code := eif_chdir (path.to_c)
        end

    launch (s: STRING) is
            -- Pass to the operating system an asynchronous request to
            -- execute s.
            -- If s is empty, use the default shell as command.
        require
            s_not_void: s /= void
        local
            ext: ANY
        do
            if s.is_empty then
                ext := default_shell.to_c
            else
                ext := s.to_c
            end
            asynchronous_system_call ($ext)
        end

    put (value, key: STRING) is
            -- Set the environment variable key to value.
        require
            key_exists: key /= void
            key_meaningful: key.count > 0
            value_exists: value /= void
        local
            v_to_c, k_to_c: ANY
        do
            v_to_c := value.to_c
            k_to_c := key.to_c
            return_code := eif_putenv ($v_to_c, $k_to_c)
        ensure
            variable_set: (return_code = 0) implies (value.is_equal (get (key)))
        end

    system (s: STRING) is
            -- Pass to the operating system a request to execute s.
            -- If s is empty, use the default shell as command.
        require
            s_exists: s /= void
        local
            ext: ANY
        do
            if s.is_empty then
                ext := default_shell.to_c
            else
                ext := s.to_c
            end
            return_code := system_call ($ext)
        end

feature {NONE} -- External

    asynchronous_system_call (s: POINTER) is
            -- Pass to the operating system an asynchronous request to execute s.
        external
            "C | %"eif_misc.h%""
        alias
            "eif_system_asynchronous"
        end

    eif_chdir (s: ANY): INTEGER is
            -- Set the current directory to path
        external
            "C | %"eif_dir.h%""
        end

    eif_getenv (s: POINTER): POINTER is
            -- Value of environment variable s
        external
            "C | %"eif_misc.h%""
        end

    eif_home_directory_name: STRING is
            -- Directory name corresponding to the home directory
        external
            "C | %"eif_path_name.h%""
        end

    eif_putenv (v, k: POINTER): INTEGER is
            -- Set s in the environment.
        external
            "C | %"eif_misc.h%""
        end

    eif_root_directory_name: STRING is
            -- Directory name corresponding to the root directory
        external
            "C | %"eif_path_name.h%""
        end

    system_call (s: POINTER): INTEGER is
            -- Pass to the operating system a request to execute s.
        external
            "C | %"eif_misc.h%""
        alias
            "eif_system"
        end

feature -- Status

    return_code: INTEGER
            -- Status code set by last call to system or put

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXECUTION_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXECUTION_ENVIRONMENT Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the environment at time of execution"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    EXECUTION_ENVIRONMENT

feature -- Access

    command_line: ARGUMENTS
            -- Command line that was used to start current execution

    current_working_directory: STRING
            -- Directory of current execution

    default_shell: STRING
            -- Default shell

    get (s: STRING): STRING
            -- Value of s if it is an environment variable and has been set;
            -- void otherwise.
        require
            s_exists: s /= void

    home_directory_name: STRING
            -- Directory name corresponding to the home directory.
        require
            home_directory_supported: operating_environment.home_directory_supported

    root_directory_name: STRING
            -- Directory name corresponding to the root directory.
        require
            root_directory_supported: operating_environment.root_directory_supported

feature -- Status setting

    change_working_directory (path: STRING)
            -- Set the current directory to path

    launch (s: STRING)
            -- Pass to the operating system an asynchronous request to
            -- execute s.
            -- If s is empty, use the default shell as command.
        require
            s_not_void: s /= void

    put (value, key: STRING)
            -- Set the environment variable key to value.
        require
            key_exists: key /= void
            key_meaningful: key.count > 0
            value_exists: value /= void
        ensure
            variable_set: (return_code = 0) implies (value.is_equal (get (key)))

    system (s: STRING)
            -- Pass to the operating system a request to execute s.
            -- If s is empty, use the default shell as command.
        require
            s_exists: s /= void

feature -- Status

    return_code: INTEGER
            -- Status code set by last call to system or put

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXECUTION_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXECUTION_ENVIRONMENT Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    EXECUTION_ENVIRONMENT

Ancestors
    ANY

Clients
    EXECUTION_ENVIRONMENT

Suppliers
    ARGUMENTS
    BOOLEAN
    EXECUTION_ENVIRONMENT
    INTEGER
    OPERATING_ENVIRONMENT
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


EXECUTION_ENVIRONMENT Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the environment at time of execution"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    EXECUTION_ENVIRONMENT

feature -- Access

    command_line: ARGUMENTS
            -- Command line that was used to start current execution

    current_working_directory: STRING
            -- Directory of current execution

    default_shell: STRING
            -- Default shell

    get (s: STRING): STRING
            -- Value of s if it is an environment variable and has been set;
            -- void otherwise.
        require
            s_exists: s /= void

    home_directory_name: STRING
            -- Directory name corresponding to the home directory.
        require
            home_directory_supported: operating_environment.home_directory_supported

    root_directory_name: STRING
            -- Directory name corresponding to the root directory.
        require
            root_directory_supported: operating_environment.root_directory_supported

feature -- Status

    return_code: INTEGER
            -- Status code set by last call to system or put

feature -- Status setting

    change_working_directory (path: STRING)
            -- Set the current directory to path

    put (value, key: STRING)
            -- Set the environment variable key to value.
        require
            key_exists: key /= void
            key_meaningful: key.count > 0
            value_exists: value /= void
        ensure
            variable_set: (return_code = 0) implies (value.is_equal (get (key)))

    system (s: STRING)
            -- Pass to the operating system a request to execute s.
            -- If s is empty, use the default shell as command.
        require
            s_exists: s /= void

    launch (s: STRING)
            -- Pass to the operating system an asynchronous request to
            -- execute s.
            -- If s is empty, use the default shell as command.
        require
            s_not_void: s /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXECUTION_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIBONACCI Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The Fibonacci number sequence"
    status: "See notice at end of class"
    names: fibonacci
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    FIBONACCI

inherit
    COUNTABLE_SEQUENCE [INTEGER]
        rename
            has as is_fibonacci
        redefine
            i_th,
            is_fibonacci
        end

feature -- Access

    First: INTEGER is 1

    Second: INTEGER is 1

    higher_fibonacci (n: INTEGER): INTEGER is
            -- Lowest Fibonacci number greater than or equal to n
        do
            if n <= first then
                Result := first
            else
                from
                    Result := n
                until
                    is_fibonacci (Result)
                loop
                    Result := Result + 1
                end
            end
        end

    lower_fibonacci (n: INTEGER): INTEGER is
            -- Greatest Fibonacci number lower than or equal to n
        require
            argument_big_enough: n >= second
        do
            if n = second then
                Result := second
            else
                from
                    Result := n - 1
                until
                    is_fibonacci (Result)
                loop
                    Result := Result - 1
                end
            end
        end

    all_lower_fibonacci (n: INTEGER): ARRAY [BOOLEAN] is
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is a Fibonacci number.
        local
            i, j: INTEGER
        do
            from
                create Result.make (1, n)
                j := 1
                i := i_th (j)
            until
                i > n
            loop
                Result.put (True, i)
                j := j + 1
                i := i_th (j)
            end
        end

    is_fibonacci (n: INTEGER): BOOLEAN is
            -- Is n a Fibonacci number?
        local
            to_test, count: INTEGER
        do
            if n <= first then
                Result := False
            elseif n = first then
                Result := True
            else
                from
                    count := first
                    to_test := i_th (count)
                until
                    to_test >= n
                loop
                    count := count + 1
                    to_test := i_th (count)
                end
                Result := to_test = n
            end
        end

    i_th (i: INTEGER): INTEGER is
            -- The i-th Fibonacci number
        local
            count: INTEGER
            last, second_last: INTEGER
        do
            if i = 1 then
                Result := first
            elseif i = 2 then
                Result := second
            else
                from
                    last := second
                    second_last := first
                    count := 2
                until
                    count = i
                loop
                    Result := last + second_last
                    second_last := last
                    last := Result
                    count := count + 1
                end
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIBONACCI

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIBONACCI Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FIBONACCI

General
    cluster: base.support
    description: "The Fibonacci number sequence"

Ancestors
    COUNTABLE_SEQUENCE [G]

Queries
    After: BOOLEAN
    all_lower_fibonacci (n: INTEGER): ARRAY [BOOLEAN]
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    First: INTEGER
    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    higher_fibonacci (n: INTEGER): INTEGER
    i_th (i: INTEGER): INTEGER
    index: INTEGER
    index_of (v: [like item] INTEGER; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_fibonacci (n: INTEGER): BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item: INTEGER
    lower_fibonacci (n: INTEGER): INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    Second: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
    forth
    search (v: [like item] INTEGER)
    start

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIBONACCI Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The Fibonacci number sequence"
    status: "See notice at end of class"
    names: fibonacci
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    FIBONACCI

feature -- Access

    all_lower_fibonacci (n: INTEGER): ARRAY [BOOLEAN] is
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is a Fibonacci number.
        local
            i, j: INTEGER
        do
            from
                create Result.make (1, n)
                j := 1
                i := i_th (j)
            until
                i > n
            loop
                Result.put (True, i)
                j := j + 1
                i := i_th (j)
            end
        end

    First: INTEGER is 1

    higher_fibonacci (n: INTEGER): INTEGER is
            -- Lowest Fibonacci number greater than or equal to n
        do
            if n <= first then
                Result := first
            else
                from
                    Result := n
                until
                    is_fibonacci (Result)
                loop
                    Result := Result + 1
                end
            end
        end

    i_th (i: INTEGER): INTEGER is
            -- The i-th Fibonacci number
        require -- from COUNTABLE
            positive_argument: i > 0
        local
            count: INTEGER
            last, second_last: INTEGER
        do
            if i = 1 then
                Result := first
            elseif i = 2 then
                Result := second
            else
                from
                    last := second
                    second_last := first
                    count := 2
                until
                    count = i
                loop
                    Result := last + second_last
                    second_last := last
                    last := Result
                    count := count + 1
                end
            end
        end

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    is_fibonacci (n: INTEGER): BOOLEAN is
            -- Is n a Fibonacci number?
        local
            to_test, count: INTEGER
        do
            if n <= first then
                Result := False
            elseif n = first then
                Result := True
            else
                from
                    count := first
                    to_test := i_th (count)
                until
                    to_test >= n
                loop
                    count := count + 1
                    to_test := i_th (count)
                end
                Result := to_test = n
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: INTEGER is
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := i_th (index)
        end

    lower_fibonacci (n: INTEGER): INTEGER is
            -- Greatest Fibonacci number lower than or equal to n
        require
            argument_big_enough: n >= second
        do
            if n = second then
                Result := second
            else
                from
                    Result := n - 1
                until
                    is_fibonacci (Result)
                loop
                    Result := Result - 1
                end
            end
        end

    occurrences (v: INTEGER): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    Second: INTEGER is 1

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := is_fibonacci (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after
        do
            index := index + 1
        end

    start is
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)
        do
            index := 1
        end

feature {NONE} -- Element change

    fill (other: CONTAINER [INTEGER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [INTEGER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

feature {NONE} -- Removal

    prune_all (v: INTEGER) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not is_fibonacci (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not is_fibonacci (v)
        end

feature {NONE} -- Inapplicable

    extend (v: INTEGER) is
            -- Add v at end.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    finish is
            -- Move to last position.
            -- (from COUNTABLE_SEQUENCE)
        do
        ensure then -- from COUNTABLE_SEQUENCE
            failure: False
        end

    linear_representation: LINEAR [INTEGER] is
            -- Representation as a linear structure
            -- (from COUNTABLE_SEQUENCE)
        do
        end

    prune (v: INTEGER) is
            -- Remove first occurrence of v, if any.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
        end

    put (v: INTEGER) is
            -- Add v to the right of current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove item to the right of current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

    replace (v: INTEGER) is
            -- Replace by v item at current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from ACTIVE
            writable: writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        end

    wipe_out is
            -- Remove all items.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            prunable
        do
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [INTEGER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [INTEGER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [INTEGER]
            c: CURSOR
            t: TUPLE [INTEGER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [INTEGER]
            c: CURSOR
            t: TUPLE [INTEGER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIBONACCI

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIBONACCI Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The Fibonacci number sequence"
    status: "See notice at end of class"
    names: fibonacci
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    FIBONACCI

feature -- Access

    all_lower_fibonacci (n: INTEGER): ARRAY [BOOLEAN]
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is a Fibonacci number.

    First: INTEGER is 1

    higher_fibonacci (n: INTEGER): INTEGER
            -- Lowest Fibonacci number greater than or equal to n

    i_th (i: INTEGER): INTEGER
            -- The i-th Fibonacci number
        require -- from COUNTABLE
            positive_argument: i > 0

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    is_fibonacci (n: INTEGER): BOOLEAN
            -- Is n a Fibonacci number?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: INTEGER
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    lower_fibonacci (n: INTEGER): INTEGER
            -- Greatest Fibonacci number lower than or equal to n
        require
            argument_big_enough: n >= second

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    Second: INTEGER is 1

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIBONACCI

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIBONACCI Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FIBONACCI

Ancestors
    COUNTABLE_SEQUENCE [G]

Clients
    FIBONACCI

Suppliers
    ARRAY [G]
    FIBONACCI
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FIBONACCI Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The Fibonacci number sequence"
    status: "See notice at end of class"
    names: fibonacci
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    FIBONACCI

feature -- Access

    First: INTEGER is 1

    Second: INTEGER is 1

    higher_fibonacci (n: INTEGER): INTEGER
            -- Lowest Fibonacci number greater than or equal to n

    lower_fibonacci (n: INTEGER): INTEGER
            -- Greatest Fibonacci number lower than or equal to n
        require
            argument_big_enough: n >= second

    all_lower_fibonacci (n: INTEGER): ARRAY [BOOLEAN]
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is a Fibonacci number.

    is_fibonacci (n: INTEGER): BOOLEAN
            -- Is n a Fibonacci number?

    i_th (i: INTEGER): INTEGER
            -- The i-th Fibonacci number

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIBONACCI

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_DOUBLE Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for non-integral numbers"
    status: "See notice at end of class"
    names: format_double
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    FORMAT_DOUBLE

inherit
    FORMAT_INTEGER
        rename
            make as set_defaults,
            split as split_integral,
            formatted as fm_formatted
        export
            {NONE} fm_formatted
        redefine
            comma_separate,
            underscore_separate,
            remove_separator
        end

    DOUBLE_MATH
        export
            {NONE} all
        end

create
    make

feature -- Initialization

    make (w, d: INTEGER) is
        require
            reasonable_field: w >= 1
            reasonable_decimals: d <= w
        do
            set_defaults (w)
            decimals := d
            decimal := '.'
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
            decimals_set: decimals = d
            decimal_point: decimal = '.'
        end

feature -- Access

    after_decimal_separate: BOOLEAN
            -- Use separators after the decimal?

    decimals: INTEGER
            -- Number of digits after the decimal point.

    zero_not_shown: BOOLEAN
            -- Show 0.5 as .5 or 0.5?

    decimal: CHARACTER
            -- What is used for the decimal

feature -- Status setting

    point_decimal is
            -- Use . as the decimal point.
        do
            decimal := '.'
        ensure
            decimal = '.'
        end

    comma_decimal is
            -- Use , as the decimal point.
        do
            decimal := ','
        ensure
            decimal = ','
        end

    set_decimals (d: INTEGER) is
            -- d decimals to be displayed.
        require
            d <= width
        do
            decimals := d
        ensure
            decimals = d
        end

    separate_after_decimal is
            -- Use separators after the decimal.
        do
            after_decimal_separate := True
        ensure
            after_decimal_separate
        end

    no_separate_after_decimal is
            -- Do not use separators after the decimal.
        do
            after_decimal_separate := False
        ensure
            not after_decimal_separate
        end

    underscore_separate is
            -- Set the separator to be underscore.
        do
            separator := '_'
            separate_after_decimal
        ensure then
            after_decimal_separate
        end

    comma_separate is
            -- Set the separator to be comma.
        do
            separator := ','
            separate_after_decimal
        ensure then
            after_decimal_separate
        end

    remove_separator is
            -- Remove the separator.
        do
            separator := '%U'
            no_separate_after_decimal
        ensure then
            not after_decimal_separate
        end

    show_zero is
            -- Show 0.5 as 0.5 .
        do
            zero_not_shown := False
        ensure
            not zero_not_shown
        end

    hide_zero is
            -- Show 0.5 as .5 .
        do
            zero_not_shown := True
        ensure
            zero_not_shown
        end

feature -- Conversion

    formatted (d: DOUBLE): STRING is
            -- Format d.
        local
            sign: INTEGER
            integral, fraction: DOUBLE
            ints, fracs: STRING
            value: DOUBLE
        do
            value := d
            sign := 1
            if d < 0 then
                sign := - 1
                value := - value
            end
            value := value + 5 * 10 ^ (- decimals - 1)
            integral := floor (value)
            fraction := floor ((value - integral) * 10 ^ (decimals + 1))
            if not no_separator then
                ints := split_integral (integral.out)
                if after_decimal_separate then
                    fracs := separate_fraction (pad_fraction (fraction))
                else
                    fracs := pad_fraction (fraction)
                end
            else
                ints := clone (integral.out)
                fracs := pad_fraction (fraction)
            end
            create Result.make (width)
            if integral /= 0 or else not zero_not_shown then
                Result.append (ints)
            end
            if not Result.has ('e') then
                Result.extend (decimal)
                if decimals > 0 then
                    Result.append (fracs)
                end
                if not ignore_sign then
                    Result := process_sign (Result, sign)
                end
            end
            if justification /= no_justification and then Result.count < width then
                Result := justify (Result)
            end
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width
        end

feature {NONE} -- Implementation

    pad_fraction (f: DOUBLE): STRING is
            -- Stretch or shrink f to length decimals .
        do
            Result := f.out
            Result.head (Result.count - 1)
            if Result.count > decimals then
                Result := Result.substring (1, decimals)
            else
                from
                until
                    Result.count = decimals
                loop
                    Result.precede ('0')
                end
            end
        ensure
            Result.count = decimals
        end

    separate_fraction (s: STRING): STRING is
            -- Apply separators to the fraction.
        require
            efficiency: separator /= '%U'
        local
            count, sep_length: INTEGER
        do
            from
                count := 1
                create Result.make (width)
            until
                count > s.count - 3
            loop
                from
                    sep_length := 0
                until
                    sep_length = 3
                loop
                    Result.extend (s.item (count))
                    count := count + 1
                    sep_length := sep_length + 1
                end
                Result.extend (separator)
            end
            from
            until
                count > s.count
            loop
                Result.extend (s.item (count))
                count := count + 1
            end
        end

invariant

    separate_all: no_separator implies not after_decimal_separate

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_DOUBLE Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FORMAT_DOUBLE

General
    cluster: base.support
    description: "Formatter for non-integral numbers"
    create: make

Ancestors
    DOUBLE_MATH
    FORMAT_INTEGER

Queries
    after_decimal_separate: BOOLEAN
    bracketted_negative: BOOLEAN
    centered: BOOLEAN
    decimal: CHARACTER
    decimals: INTEGER
    fill_character: CHARACTER
    formatted (d: DOUBLE): STRING
    ignore_sign: BOOLEAN
    justification: INTEGER
    leading_sign: BOOLEAN
    left_justified: BOOLEAN
    no_separator: BOOLEAN
    not_justified: BOOLEAN
    right_justified: BOOLEAN
    separator: CHARACTER
    show_sign: BOOLEAN
    show_sign_negative: BOOLEAN
    show_sign_positive: BOOLEAN
    sign_format: INTEGER
    sign_string: STRING
    trailing_sign: BOOLEAN
    width: INTEGER
    zero_not_shown: BOOLEAN

Commands
    asterisk_fill
    blank_fill
    bracket_negative
    center_justify
    comma_decimal
    comma_separate
    dollar_fill
    dot_separate
    hide_zero
    left_justify
    make (w, d: INTEGER)
    no_justify
    no_separate_after_decimal
    point_decimal
    remove_separator
    right_justify
    separate_after_decimal
    set_decimals (d: INTEGER)
    set_defaults (w: INTEGER)
    set_fill (c: CHARACTER)
    set_separator (c: CHARACTER)
    set_sign (s: STRING)
    set_width (w: INTEGER)
    show_zero
    sign_cr_dr
    sign_dr_cr
    sign_floating_dollar
    sign_floating_dollar_signed
    sign_ignore
    sign_leading
    sign_negative_only
    sign_normal
    sign_positive_only
    sign_show
    sign_trailing
    unbracket_negative
    underscore_separate
    zero_fill

Constraints
    separate all

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_DOUBLE Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for non-integral numbers"
    status: "See notice at end of class"
    names: format_double
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    FORMAT_DOUBLE

create
    make

feature -- Initialization

    make (w, d: INTEGER) is
        require
            reasonable_field: w >= 1
            reasonable_decimals: d <= w
        do
            set_defaults (w)
            decimals := d
            decimal := '.'
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
            decimals_set: decimals = d
            decimal_point: decimal = '.'
        end

    set_defaults (w: INTEGER) is
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            reasonable_field: w >= 1
        do
            blank_fill
            width := w
            sign_normal
            sign_negative_only
            right_justify
        ensure -- from FORMAT_INTEGER
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
        end

feature -- Access

    after_decimal_separate: BOOLEAN
            -- Use separators after the decimal?

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?
            -- (from FORMAT_INTEGER)

    decimal: CHARACTER
            -- What is used for the decimal

    decimals: INTEGER
            -- Number of digits after the decimal point.

    fill_character: CHARACTER
            -- Padding character.
            -- (from FORMAT_INTEGER)

    justification: INTEGER
            -- Where in the field the format goes.
            -- (from FORMAT_INTEGER)

    separator: CHARACTER
            -- Separator between 1000's of numbers.
            -- (from FORMAT_INTEGER)

    sign_format: INTEGER
            -- How the sign is formatted.
            -- (from FORMAT_INTEGER)

    sign_string: STRING
            -- Formatting details for the sign.
            -- (from FORMAT_INTEGER)

    trailing_sign: BOOLEAN
            -- Is the sign at the end?
            -- (from FORMAT_INTEGER)

    width: INTEGER
            -- Width of the field.
            -- (from FORMAT_INTEGER)

    zero_not_shown: BOOLEAN
            -- Show 0.5 as .5 or 0.5?

feature {NONE} -- Access

    arc_cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "acos"
        end

    arc_sine (v: DOUBLE): DOUBLE is
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "asin"
        end

    arc_tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "atan"
        end

    ceiling (v: DOUBLE): DOUBLE is
            -- Least integral greater than or equal to v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "ceil"
        end

    cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "cos"
        end

    dabs (v: DOUBLE): DOUBLE is
            -- Absolute of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "fabs"
        end

    Euler: DOUBLE is 2.7182818284590452354
            -- Logarithm base
            -- (from MATH_CONST)

    exp (x: DOUBLE): DOUBLE is
            -- Exponential of v.
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    floor (v: DOUBLE): DOUBLE is
            -- Greatest integral less than or equal to v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    log (v: DOUBLE): DOUBLE is
            -- Natural logarithm of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    log10 (v: DOUBLE): DOUBLE is
            -- Base 10 logarithm of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    log_2 (v: DOUBLE): DOUBLE is
            -- Base 2 logarithm of v
            -- (from DOUBLE_MATH)
        local
            a: DOUBLE
        do
            a := 2.0
            Result := log (v) / log (a)
        end

    Pi: DOUBLE is 3.14159265358979323846
            -- (from MATH_CONST)

    sine (v: DOUBLE): DOUBLE is
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "sin"
        end

    sqrt (v: DOUBLE): DOUBLE is
            -- Square root of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    Sqrt2: DOUBLE is 1.41421356237309504880
            -- Square root of 2
            -- (from MATH_CONST)

    tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "tan"
        end

feature -- Status report

    centered: BOOLEAN is
            -- Are numbers to be formatted centered?
            -- (from FORMAT_INTEGER)
        do
            Result := justification = center_justification
        ensure -- from FORMAT_INTEGER
            Result = (justification = center_justification)
        end

    ignore_sign: BOOLEAN is
            -- Ignore the sign of a number?
            -- (from FORMAT_INTEGER)
        do
            Result := sign_format = ignore_sign_value
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = ignore_sign_value)
        end

    leading_sign: BOOLEAN is
            -- Is the sign leading?
            -- (from FORMAT_INTEGER)
        do
            Result := not trailing_sign
        ensure -- from FORMAT_INTEGER
            Result = not trailing_sign
        end

    left_justified: BOOLEAN is
            -- Are numbers to be formatted with spaces on the right?
            -- (from FORMAT_INTEGER)
        do
            Result := justification = left_justification
        ensure -- from FORMAT_INTEGER
            Result = (justification = left_justification)
        end

    no_separator: BOOLEAN is
            -- Is there a separator?
            -- (from FORMAT_INTEGER)
        do
            Result := separator = '%U'
        ensure -- from FORMAT_INTEGER
            Result = (separator = '%U')
        end

    not_justified: BOOLEAN is
            -- Are numbers to be formatted in smallest string possible
            -- (from FORMAT_INTEGER)
        do
            Result := justification = no_justification
        ensure -- from FORMAT_INTEGER
            Result = (justification = no_justification)
        end

    right_justified: BOOLEAN is
            -- Are numbers to be formatted with spaces on the left?
            -- (from FORMAT_INTEGER)
        do
            Result := justification = right_justification
        ensure -- from FORMAT_INTEGER
            Result = (justification = right_justification)
        end

    show_sign: BOOLEAN is
            -- Are numbers to show sign whether positive or negative?
            -- (from FORMAT_INTEGER)
        do
            Result := sign_format = show_sign_value
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = show_sign_value)
        end

    show_sign_negative: BOOLEAN is
            -- Are numbers to show sign only when negative?
            -- (from FORMAT_INTEGER)
        do
            Result := sign_format = sign_negative_value
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = sign_negative_value)
        end

    show_sign_positive: BOOLEAN is
            -- Are numbers to show sign only when positive?
            -- (from FORMAT_INTEGER)
        do
            Result := sign_format = sign_positive_value
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = sign_positive_value)
        end

feature -- Status setting

    asterisk_fill is
            -- Fill numbers with asterisks.
            -- (from FORMAT_INTEGER)
        do
            fill_character := '*'
        ensure -- from FORMAT_INTEGER
            fill_character = '*'
        end

    blank_fill is
            -- Fill numbers with blanks.
            -- (from FORMAT_INTEGER)
        do
            fill_character := ' '
        ensure -- from FORMAT_INTEGER
            fill_character = ' '
        end

    bracket_negative is
            -- Bracket negative numbers.
            -- (from FORMAT_INTEGER)
        do
            bracketted_negative := True
        ensure -- from FORMAT_INTEGER
            bracketted_negative
        end

    center_justify is
            -- Put padding on right and left
            -- (from FORMAT_INTEGER)
        do
            justification := center_justification
        ensure -- from FORMAT_INTEGER
            centered
        end

    comma_decimal is
            -- Use , as the decimal point.
        do
            decimal := ','
        ensure
            decimal = ','
        end

    comma_separate is
            -- Set the separator to be comma.
        do
            separator := ','
            separate_after_decimal
        ensure -- from FORMAT_INTEGER
            separator = ','
        ensure then
            after_decimal_separate
        end

    dollar_fill is
            -- Fill numbers with dollars.
            -- (from FORMAT_INTEGER)
        do
            fill_character := '$'
        ensure -- from FORMAT_INTEGER
            fill_character = '$'
        end

    dot_separate is
            -- Set separator to period.
            -- (from FORMAT_INTEGER)
        do
            separator := '.'
        ensure -- from FORMAT_INTEGER
            separator = '.'
        end

    hide_zero is
            -- Show 0.5 as .5 .
        do
            zero_not_shown := True
        ensure
            zero_not_shown
        end

    left_justify is
            --Put padding on right
            -- (from FORMAT_INTEGER)
        do
            justification := left_justification
        ensure -- from FORMAT_INTEGER
            left_justified
        end

    no_justify is
            -- Always return the smallest string possible
            -- (from FORMAT_INTEGER)
        do
            justification := no_justification
        ensure -- from FORMAT_INTEGER
            not_justified
        end

    no_separate_after_decimal is
            -- Do not use separators after the decimal.
        do
            after_decimal_separate := False
        ensure
            not after_decimal_separate
        end

    point_decimal is
            -- Use . as the decimal point.
        do
            decimal := '.'
        ensure
            decimal = '.'
        end

    remove_separator is
            -- Remove the separator.
        do
            separator := '%U'
            no_separate_after_decimal
        ensure -- from FORMAT_INTEGER
            separator = '%U'
        ensure then
            not after_decimal_separate
        end

    right_justify is
            -- Put padding on left
            -- (from FORMAT_INTEGER)
        do
            justification := right_justification
        ensure -- from FORMAT_INTEGER
            right_justified
        end

    separate_after_decimal is
            -- Use separators after the decimal.
        do
            after_decimal_separate := True
        ensure
            after_decimal_separate
        end

    set_decimals (d: INTEGER) is
            -- d decimals to be displayed.
        require
            d <= width
        do
            decimals := d
        ensure
            decimals = d
        end

    set_fill (c: CHARACTER) is
            -- Fill numbers with c
            -- (from FORMAT_INTEGER)
        do
            fill_character := c
        ensure -- from FORMAT_INTEGER
            fill_character = c
        end

    set_separator (c: CHARACTER) is
            -- Set the separator to c
            -- (from FORMAT_INTEGER)
        do
            separator := c
        ensure -- from FORMAT_INTEGER
            separator = c
        end

    set_sign (s: STRING) is
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        do
            sign_string := clone (s)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal (s)
        end

    set_width (w: INTEGER) is
            -- Set width to w
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            wide_enough: w >= 1
        do
            width := w
        ensure -- from FORMAT_INTEGER
            width = w
        end

    show_zero is
            -- Show 0.5 as 0.5 .
        do
            zero_not_shown := False
        ensure
            not zero_not_shown
        end

    sign_cr_dr is
            -- Set sign for CR/DR
            -- (from FORMAT_INTEGER)
        do
            sign_string := "CR DR"
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("CR DR")
        end

    sign_dr_cr is
            -- Set sign for DR/CR
            -- (from FORMAT_INTEGER)
        do
            sign_string := "DR CR"
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("DR CR")
        end

    sign_floating_dollar is
            -- Set sign for floating dollar.
            -- (from FORMAT_INTEGER)
        do
            sign_string := "$$$"
            sign_leading
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("$$$")
        end

    sign_floating_dollar_signed is
            -- Set sign for floating dollar include sign.
            -- (from FORMAT_INTEGER)
        do
            sign_string := "-$ $+$"
            sign_leading
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("-$ $+$")
        end

    sign_ignore is
            -- Do not show sign.
            -- (from FORMAT_INTEGER)
        do
            sign_format := ignore_sign_value
        ensure -- from FORMAT_INTEGER
            ignore_sign
        end

    sign_leading is
            -- Set the sign to lead
            -- (from FORMAT_INTEGER)
        do
            trailing_sign := False
        ensure -- from FORMAT_INTEGER
            leading_sign
        end

    sign_negative_only is
            -- Show sign for negative numbers only.
            -- (from FORMAT_INTEGER)
        do
            sign_format := sign_negative_value
        ensure -- from FORMAT_INTEGER
            show_sign_negative
        end

    sign_normal is
            -- Set sign for - and +.
            -- (from FORMAT_INTEGER)
        do
            sign_string := "- +"
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("- +")
        end

    sign_positive_only is
            -- Show sign for positive numbers only.
            -- (from FORMAT_INTEGER)
        do
            sign_format := sign_positive_value
        ensure -- from FORMAT_INTEGER
            show_sign_positive
        end

    sign_show is
            -- Show sign for all numbers.
            -- (from FORMAT_INTEGER)
        do
            sign_format := show_sign_value
        ensure -- from FORMAT_INTEGER
            show_sign
        end

    sign_trailing is
            -- Set the sign to trail
            -- (from FORMAT_INTEGER)
        do
            trailing_sign := True
        ensure -- from FORMAT_INTEGER
            trailing_sign
        end

    unbracket_negative is
            -- Do not bracket negative numbers.
            -- (from FORMAT_INTEGER)
        do
            bracketted_negative := False
        ensure -- from FORMAT_INTEGER
            not bracketted_negative
        end

    underscore_separate is
            -- Set the separator to be underscore.
        do
            separator := '_'
            separate_after_decimal
        ensure -- from FORMAT_INTEGER
            separator = '_'
        ensure then
            after_decimal_separate
        end

    zero_fill is
            -- Fill numbers with zeros.
            -- (from FORMAT_INTEGER)
        do
            fill_character := '0'
        ensure -- from FORMAT_INTEGER
            fill_character = '0'
        end

feature -- Conversion

    formatted (d: DOUBLE): STRING is
            -- Format d.
        local
            sign: INTEGER
            integral, fraction: DOUBLE
            ints, fracs: STRING
            value: DOUBLE
        do
            value := d
            sign := 1
            if d < 0 then
                sign := - 1
                value := - value
            end
            value := value + 5 * 10 ^ (- decimals - 1)
            integral := floor (value)
            fraction := floor ((value - integral) * 10 ^ (decimals + 1))
            if not no_separator then
                ints := split_integral (integral.out)
                if after_decimal_separate then
                    fracs := separate_fraction (pad_fraction (fraction))
                else
                    fracs := pad_fraction (fraction)
                end
            else
                ints := clone (integral.out)
                fracs := pad_fraction (fraction)
            end
            create Result.make (width)
            if integral /= 0 or else not zero_not_shown then
                Result.append (ints)
            end
            if not Result.has ('e') then
                Result.extend (decimal)
                if decimals > 0 then
                    Result.append (fracs)
                end
                if not ignore_sign then
                    Result := process_sign (Result, sign)
                end
            end
            if justification /= no_justification and then Result.count < width then
                Result := justify (Result)
            end
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width
        end

feature {NONE} -- Conversion

    fm_formatted (i: INTEGER): STRING is
            -- Format the integer.
            -- (from FORMAT_INTEGER)
        local
            sign: INTEGER
            unsigned: INTEGER
        do
            if i < 0 then
                sign := - 1
                unsigned := - i
            elseif i > 0 then
                sign := 1;
                unsigned := i
            end
            if not no_separator then
                Result := split_integral (unsigned.out)
            else
                Result := clone (unsigned.out)
            end
            if not ignore_sign or bracketted_negative then
                Result := process_sign (Result, sign)
            end
            if justification /= no_justification and then Result.count < width then
                Result := justify (Result)
            end
        ensure -- from FORMAT_INTEGER
            exists: Result /= void
            correct_length: not_justified or Result.count >= width
        end

feature {NONE} -- Implementation

    Center_justification: INTEGER is 2
            -- (from FORMAT_INTEGER)

    Ignore_sign_value: INTEGER is 1
            -- (from FORMAT_INTEGER)

    justify (s: STRING): STRING is
            -- Justify s.
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            room: s.count < width
            justification: justification /= no_justification
        local
            l, r: STRING
            i, t: INTEGER
        do
            Result := s
            if not centered then
                create l.make (width - s.count)
                from
                    i := 1
                until
                    i > l.capacity
                loop
                    l.extend (fill_character)
                    i := i + 1
                end
                if left_justified then
                    Result.append (l)
                else
                    Result.prepend (l)
                end
            else
                t := (width - s.count) // 2
                if 2 * t + s.count < width then
                    create l.make (t + 1)
                else
                    create l.make (t)
                end
                create r.make (t)
                from
                    i := 1
                until
                    i > r.capacity
                loop
                    l.extend (fill_character)
                    r.extend (fill_character)
                    i := i + 1
                end
                if i = l.capacity then
                    l.extend (fill_character)
                end
                Result.prepend (l)
                Result.append (r)
            end
        end

    Left_justification: INTEGER is 1
            -- (from FORMAT_INTEGER)

    No_justification: INTEGER is 0
            -- (from FORMAT_INTEGER)

    pad_fraction (f: DOUBLE): STRING is
            -- Stretch or shrink f to length decimals .
        do
            Result := f.out
            Result.head (Result.count - 1)
            if Result.count > decimals then
                Result := Result.substring (1, decimals)
            else
                from
                until
                    Result.count = decimals
                loop
                    Result.precede ('0')
                end
            end
        ensure
            Result.count = decimals
        end

    process_sign (s: STRING; sn: INTEGER): STRING is
            -- Process sign related values.
            -- (from FORMAT_INTEGER)
        local
            sstring: STRING
        do
            Result := s
            if bracketted_negative and sn = - 1 then
                Result.precede ('(')
                Result.extend (')')
            end
            if ((show_sign_negative or show_sign) and sn = - 1) or else ((show_sign_positive or show_sign) and sn = 1) or else (show_sign and sn = 0) then
                sstring := sign_value (sn)
            end
            if sstring /= void then
                if trailing_sign then
                    Result.append (sstring)
                else
                    Result.prepend (sstring)
                end
            end
        end

    Right_justification: INTEGER is 3
            -- (from FORMAT_INTEGER)

    separate_fraction (s: STRING): STRING is
            -- Apply separators to the fraction.
        require
            efficiency: separator /= '%U'
        local
            count, sep_length: INTEGER
        do
            from
                count := 1
                create Result.make (width)
            until
                count > s.count - 3
            loop
                from
                    sep_length := 0
                until
                    sep_length = 3
                loop
                    Result.extend (s.item (count))
                    count := count + 1
                    sep_length := sep_length + 1
                end
                Result.extend (separator)
            end
            from
            until
                count > s.count
            loop
                Result.extend (s.item (count))
                count := count + 1
            end
        end

    Show_sign_value: INTEGER is 0
            -- (from FORMAT_INTEGER)

    Sign_negative_value: INTEGER is 3
            -- (from FORMAT_INTEGER)

    Sign_positive_value: INTEGER is 2
            -- (from FORMAT_INTEGER)

    sign_size: INTEGER is
            -- Size of the sign.
            -- (from FORMAT_INTEGER)
        do
            Result := sign_string.count // 3
        ensure -- from FORMAT_INTEGER
            Result * 3 = sign_string.count
        end

    sign_value (i: INTEGER): STRING is
            -- Value of the sign.
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            correct_sign: - 1 <= i and i <= 1
        local
            t: INTEGER
        do
            t := sign_size * (i + 1) + 1
            Result := sign_string.substring (t, t + sign_size - 1)
        end

    split_integral (s: STRING): STRING is
            -- Apply separators to an integer
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            efficiency: separator /= '%U'
        local
            count, sep_length: INTEGER
        do
            from
                count := s.count
                create Result.make (width)
            until
                count <= 3
            loop
                from
                    sep_length := 0
                until
                    sep_length = 3
                loop
                    Result.precede (s.item (count))
                    count := count - 1
                    sep_length := sep_length + 1
                end
                Result.precede (separator)
            end
            from
            until
                count = 0
            loop
                Result.precede (s.item (count))
                count := count - 1
            end
        end

invariant

    separate_all: no_separator implies not after_decimal_separate
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FORMAT_INTEGER
    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_DOUBLE Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for non-integral numbers"
    status: "See notice at end of class"
    names: format_double
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    FORMAT_DOUBLE

create

    make (w, d: INTEGER)
        require
            reasonable_field: w >= 1
            reasonable_decimals: d <= w
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
            decimals_set: decimals = d
            decimal_point: decimal = '.'

feature -- Initialization

    make (w, d: INTEGER)
        require
            reasonable_field: w >= 1
            reasonable_decimals: d <= w
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
            decimals_set: decimals = d
            decimal_point: decimal = '.'

    set_defaults (w: INTEGER)
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            reasonable_field: w >= 1
        ensure -- from FORMAT_INTEGER
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign

feature -- Access

    after_decimal_separate: BOOLEAN
            -- Use separators after the decimal?

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?
            -- (from FORMAT_INTEGER)

    decimal: CHARACTER
            -- What is used for the decimal

    decimals: INTEGER
            -- Number of digits after the decimal point.

    fill_character: CHARACTER
            -- Padding character.
            -- (from FORMAT_INTEGER)

    justification: INTEGER
            -- Where in the field the format goes.
            -- (from FORMAT_INTEGER)

    separator: CHARACTER
            -- Separator between 1000's of numbers.
            -- (from FORMAT_INTEGER)

    sign_format: INTEGER
            -- How the sign is formatted.
            -- (from FORMAT_INTEGER)

    sign_string: STRING
            -- Formatting details for the sign.
            -- (from FORMAT_INTEGER)

    trailing_sign: BOOLEAN
            -- Is the sign at the end?
            -- (from FORMAT_INTEGER)

    width: INTEGER
            -- Width of the field.
            -- (from FORMAT_INTEGER)

    zero_not_shown: BOOLEAN
            -- Show 0.5 as .5 or 0.5?

feature -- Status report

    centered: BOOLEAN
            -- Are numbers to be formatted centered?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = center_justification)

    ignore_sign: BOOLEAN
            -- Ignore the sign of a number?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = ignore_sign_value)

    leading_sign: BOOLEAN
            -- Is the sign leading?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = not trailing_sign

    left_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the right?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = left_justification)

    no_separator: BOOLEAN
            -- Is there a separator?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (separator = '%U')

    not_justified: BOOLEAN
            -- Are numbers to be formatted in smallest string possible
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = no_justification)

    right_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the left?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = right_justification)

    show_sign: BOOLEAN
            -- Are numbers to show sign whether positive or negative?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = show_sign_value)

    show_sign_negative: BOOLEAN
            -- Are numbers to show sign only when negative?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = sign_negative_value)

    show_sign_positive: BOOLEAN
            -- Are numbers to show sign only when positive?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = sign_positive_value)

feature -- Status setting

    asterisk_fill
            -- Fill numbers with asterisks.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = '*'

    blank_fill
            -- Fill numbers with blanks.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = ' '

    bracket_negative
            -- Bracket negative numbers.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            bracketted_negative

    center_justify
            -- Put padding on right and left
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            centered

    comma_decimal
            -- Use , as the decimal point.
        ensure
            decimal = ','

    comma_separate
            -- Set the separator to be comma.
        ensure -- from FORMAT_INTEGER
            separator = ','
        ensure then
            after_decimal_separate

    dollar_fill
            -- Fill numbers with dollars.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = '$'

    dot_separate
            -- Set separator to period.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            separator = '.'

    hide_zero
            -- Show 0.5 as .5 .
        ensure
            zero_not_shown

    left_justify
            --Put padding on right
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            left_justified

    no_justify
            -- Always return the smallest string possible
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            not_justified

    no_separate_after_decimal
            -- Do not use separators after the decimal.
        ensure
            not after_decimal_separate

    point_decimal
            -- Use . as the decimal point.
        ensure
            decimal = '.'

    remove_separator
            -- Remove the separator.
        ensure -- from FORMAT_INTEGER
            separator = '%U'
        ensure then
            not after_decimal_separate

    right_justify
            -- Put padding on left
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            right_justified

    separate_after_decimal
            -- Use separators after the decimal.
        ensure
            after_decimal_separate

    set_decimals (d: INTEGER)
            -- d decimals to be displayed.
        require
            d <= width
        ensure
            decimals = d

    set_fill (c: CHARACTER)
            -- Fill numbers with c
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = c

    set_separator (c: CHARACTER)
            -- Set the separator to c
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            separator = c

    set_sign (s: STRING)
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal (s)

    set_width (w: INTEGER)
            -- Set width to w
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            wide_enough: w >= 1
        ensure -- from FORMAT_INTEGER
            width = w

    show_zero
            -- Show 0.5 as 0.5 .
        ensure
            not zero_not_shown

    sign_cr_dr
            -- Set sign for CR/DR
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("CR DR")

    sign_dr_cr
            -- Set sign for DR/CR
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("DR CR")

    sign_floating_dollar
            -- Set sign for floating dollar.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("$$$")

    sign_floating_dollar_signed
            -- Set sign for floating dollar include sign.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("-$ $+$")

    sign_ignore
            -- Do not show sign.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            ignore_sign

    sign_leading
            -- Set the sign to lead
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            leading_sign

    sign_negative_only
            -- Show sign for negative numbers only.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            show_sign_negative

    sign_normal
            -- Set sign for - and +.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("- +")

    sign_positive_only
            -- Show sign for positive numbers only.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            show_sign_positive

    sign_show
            -- Show sign for all numbers.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            show_sign

    sign_trailing
            -- Set the sign to trail
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            trailing_sign

    unbracket_negative
            -- Do not bracket negative numbers.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            not bracketted_negative

    underscore_separate
            -- Set the separator to be underscore.
        ensure -- from FORMAT_INTEGER
            separator = '_'
        ensure then
            after_decimal_separate

    zero_fill
            -- Fill numbers with zeros.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = '0'

feature -- Conversion

    formatted (d: DOUBLE): STRING
            -- Format d.
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width

invariant

    separate_all: no_separator implies not after_decimal_separate
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FORMAT_INTEGER
    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_DOUBLE Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FORMAT_DOUBLE

Ancestors
    DOUBLE_MATH
    FORMAT_INTEGER

Clients
    FORMAT_DOUBLE

Suppliers
    BOOLEAN
    DOUBLE
    FORMAT_DOUBLE
    INTEGER
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_DOUBLE Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for non-integral numbers"
    status: "See notice at end of class"
    names: format_double
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    FORMAT_DOUBLE

create
    make

feature -- Initialization

    make (w, d: INTEGER)
        require
            reasonable_field: w >= 1
            reasonable_decimals: d <= w
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
            decimals_set: decimals = d
            decimal_point: decimal = '.'

feature -- Access

    after_decimal_separate: BOOLEAN
            -- Use separators after the decimal?

    decimals: INTEGER
            -- Number of digits after the decimal point.

    zero_not_shown: BOOLEAN
            -- Show 0.5 as .5 or 0.5?

    decimal: CHARACTER
            -- What is used for the decimal

feature -- Status setting

    point_decimal
            -- Use . as the decimal point.
        ensure
            decimal = '.'

    comma_decimal
            -- Use , as the decimal point.
        ensure
            decimal = ','

    set_decimals (d: INTEGER)
            -- d decimals to be displayed.
        require
            d <= width
        ensure
            decimals = d

    separate_after_decimal
            -- Use separators after the decimal.
        ensure
            after_decimal_separate

    no_separate_after_decimal
            -- Do not use separators after the decimal.
        ensure
            not after_decimal_separate

    underscore_separate
            -- Set the separator to be underscore.
        ensure then
            after_decimal_separate

    comma_separate
            -- Set the separator to be comma.
        ensure then
            after_decimal_separate

    remove_separator
            -- Remove the separator.
        ensure then
            not after_decimal_separate

    show_zero
            -- Show 0.5 as 0.5 .
        ensure
            not zero_not_shown

    hide_zero
            -- Show 0.5 as .5 .
        ensure
            zero_not_shown

feature -- Conversion

    formatted (d: DOUBLE): STRING
            -- Format d.
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width

invariant

    separate_all: no_separator implies not after_decimal_separate

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_DOUBLE

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_INTEGER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for integral numbers"
    status: "See notice at end of class"
    names: format_integer
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    FORMAT_INTEGER

create
    make

feature -- Initialization

    make (w: INTEGER) is
        require
            reasonable_field: w >= 1
        do
            blank_fill
            width := w
            sign_normal
            sign_negative_only
            right_justify
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
        end

feature -- Access

    fill_character: CHARACTER
            -- Padding character.

    width: INTEGER
            -- Width of the field.

    separator: CHARACTER
            -- Separator between 1000's of numbers.

    justification: INTEGER
            -- Where in the field the format goes.

    trailing_sign: BOOLEAN
            -- Is the sign at the end?

    sign_format: INTEGER
            -- How the sign is formatted.

    sign_string: STRING
            -- Formatting details for the sign.

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?

feature -- Status report

    centered: BOOLEAN is
            -- Are numbers to be formatted centered?
        do
            Result := justification = center_justification
        ensure
            Result = (justification = center_justification)
        end

    left_justified: BOOLEAN is
            -- Are numbers to be formatted with spaces on the right?
        do
            Result := justification = left_justification
        ensure
            Result = (justification = left_justification)
        end

    right_justified: BOOLEAN is
            -- Are numbers to be formatted with spaces on the left?
        do
            Result := justification = right_justification
        ensure
            Result = (justification = right_justification)
        end

    not_justified: BOOLEAN is
            -- Are numbers to be formatted in smallest string possible
        do
            Result := justification = no_justification
        ensure
            Result = (justification = no_justification)
        end

    show_sign_negative: BOOLEAN is
            -- Are numbers to show sign only when negative?
        do
            Result := sign_format = sign_negative_value
        ensure
            Result = (sign_format = sign_negative_value)
        end

    show_sign_positive: BOOLEAN is
            -- Are numbers to show sign only when positive?
        do
            Result := sign_format = sign_positive_value
        ensure
            Result = (sign_format = sign_positive_value)
        end

    show_sign: BOOLEAN is
            -- Are numbers to show sign whether positive or negative?
        do
            Result := sign_format = show_sign_value
        ensure
            Result = (sign_format = show_sign_value)
        end

    ignore_sign: BOOLEAN is
            -- Ignore the sign of a number?
        do
            Result := sign_format = ignore_sign_value
        ensure
            Result = (sign_format = ignore_sign_value)
        end

    no_separator: BOOLEAN is
            -- Is there a separator?
        do
            Result := separator = '%U'
        ensure
            Result = (separator = '%U')
        end

    leading_sign: BOOLEAN is
            -- Is the sign leading?
        do
            Result := not trailing_sign
        ensure
            Result = not trailing_sign
        end

feature -- Status setting

    blank_fill is
            -- Fill numbers with blanks.
        do
            fill_character := ' '
        ensure
            fill_character = ' '
        end

    zero_fill is
            -- Fill numbers with zeros.
        do
            fill_character := '0'
        ensure
            fill_character = '0'
        end

    dollar_fill is
            -- Fill numbers with dollars.
        do
            fill_character := '$'
        ensure
            fill_character = '$'
        end

    asterisk_fill is
            -- Fill numbers with asterisks.
        do
            fill_character := '*'
        ensure
            fill_character = '*'
        end

    set_fill (c: CHARACTER) is
            -- Fill numbers with c
        do
            fill_character := c
        ensure
            fill_character = c
        end

    set_width (w: INTEGER) is
            -- Set width to w
        require
            wide_enough: w >= 1
        do
            width := w
        ensure
            width = w
        end

    underscore_separate is
            -- Set separator to underscore.
        do
            separator := '_'
        ensure
            separator = '_'
        end

    comma_separate is
            -- Set separator to comma.
        do
            separator := ','
        ensure
            separator = ','
        end

    dot_separate is
            -- Set separator to period.
        do
            separator := '.'
        ensure
            separator = '.'
        end

    remove_separator is
            -- Remove the separator.
        do
            separator := '%U'
        ensure
            separator = '%U'
        end

    set_separator (c: CHARACTER) is
            -- Set the separator to c
        do
            separator := c
        ensure
            separator = c
        end

    left_justify is
            --Put padding on right
        do
            justification := left_justification
        ensure
            left_justified
        end

    center_justify is
            -- Put padding on right and left
        do
            justification := center_justification
        ensure
            centered
        end

    right_justify is
            -- Put padding on left
        do
            justification := right_justification
        ensure
            right_justified
        end

    no_justify is
            -- Always return the smallest string possible
        do
            justification := no_justification
        ensure
            not_justified
        end

    sign_leading is
            -- Set the sign to lead
        do
            trailing_sign := False
        ensure
            leading_sign
        end

    sign_trailing is
            -- Set the sign to trail
        do
            trailing_sign := True
        ensure
            trailing_sign
        end

    sign_positive_only is
            -- Show sign for positive numbers only.
        do
            sign_format := sign_positive_value
        ensure
            show_sign_positive
        end

    sign_negative_only is
            -- Show sign for negative numbers only.
        do
            sign_format := sign_negative_value
        ensure
            show_sign_negative
        end

    sign_show is
            -- Show sign for all numbers.
        do
            sign_format := show_sign_value
        ensure
            show_sign
        end

    sign_ignore is
            -- Do not show sign.
        do
            sign_format := ignore_sign_value
        ensure
            ignore_sign
        end

    sign_normal is
            -- Set sign for - and +.
        do
            sign_string := "- +"
        ensure
            sign_string.is_equal ("- +")
        end

    sign_cr_dr is
            -- Set sign for CR/DR
        do
            sign_string := "CR DR"
        ensure
            sign_string.is_equal ("CR DR")
        end

    sign_dr_cr is
            -- Set sign for DR/CR
        do
            sign_string := "DR CR"
        ensure
            sign_string.is_equal ("DR CR")
        end

    sign_floating_dollar is
            -- Set sign for floating dollar.
        do
            sign_string := "$$$"
            sign_leading
        ensure
            sign_string.is_equal ("$$$")
        end

    sign_floating_dollar_signed is
            -- Set sign for floating dollar include sign.
        do
            sign_string := "-$ $+$"
            sign_leading
        ensure
            sign_string.is_equal ("-$ $+$")
        end

    set_sign (s: STRING) is
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
        require
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        do
            sign_string := clone (s)
        ensure
            sign_string.is_equal (s)
        end

    bracket_negative is
            -- Bracket negative numbers.
        do
            bracketted_negative := True
        ensure
            bracketted_negative
        end

    unbracket_negative is
            -- Do not bracket negative numbers.
        do
            bracketted_negative := False
        ensure
            not bracketted_negative
        end

feature -- Conversion

    formatted (i: INTEGER): STRING is
            -- Format the integer.
        local
            sign: INTEGER
            unsigned: INTEGER
        do
            if i < 0 then
                sign := - 1
                unsigned := - i
            elseif i > 0 then
                sign := 1;
                unsigned := i
            end
            if not no_separator then
                Result := split (unsigned.out)
            else
                Result := clone (unsigned.out)
            end
            if not ignore_sign or bracketted_negative then
                Result := process_sign (Result, sign)
            end
            if justification /= no_justification and then Result.count < width then
                Result := justify (Result)
            end
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width
        end

feature {NONE} -- Implementation

    No_justification: INTEGER is 0

    Left_justification: INTEGER is 1

    Center_justification: INTEGER is 2

    Right_justification: INTEGER is 3

    Show_sign_value: INTEGER is 0

    Ignore_sign_value: INTEGER is 1

    Sign_positive_value: INTEGER is 2

    Sign_negative_value: INTEGER is 3

    split (s: STRING): STRING is
            -- Apply separators to an integer
        require
            efficiency: separator /= '%U'
        local
            count, sep_length: INTEGER
        do
            from
                count := s.count
                create Result.make (width)
            until
                count <= 3
            loop
                from
                    sep_length := 0
                until
                    sep_length = 3
                loop
                    Result.precede (s.item (count))
                    count := count - 1
                    sep_length := sep_length + 1
                end
                Result.precede (separator)
            end
            from
            until
                count = 0
            loop
                Result.precede (s.item (count))
                count := count - 1
            end
        end

    process_sign (s: STRING; sn: INTEGER): STRING is
            -- Process sign related values.
        local
            sstring: STRING
        do
            Result := s
            if bracketted_negative and sn = - 1 then
                Result.precede ('(')
                Result.extend (')')
            end
            if ((show_sign_negative or show_sign) and sn = - 1) or else ((show_sign_positive or show_sign) and sn = 1) or else (show_sign and sn = 0) then
                sstring := sign_value (sn)
            end
            if sstring /= void then
                if trailing_sign then
                    Result.append (sstring)
                else
                    Result.prepend (sstring)
                end
            end
        end

    sign_size: INTEGER is
            -- Size of the sign.
        do
            Result := sign_string.count // 3
        ensure
            Result * 3 = sign_string.count
        end

    sign_value (i: INTEGER): STRING is
            -- Value of the sign.
        require
            correct_sign: - 1 <= i and i <= 1
        local
            t: INTEGER
        do
            t := sign_size * (i + 1) + 1
            Result := sign_string.substring (t, t + sign_size - 1)
        end

    justify (s: STRING): STRING is
            -- Justify s.
        require
            room: s.count < width
            justification: justification /= no_justification
        local
            l, r: STRING
            i, t: INTEGER
        do
            Result := s
            if not centered then
                create l.make (width - s.count)
                from
                    i := 1
                until
                    i > l.capacity
                loop
                    l.extend (fill_character)
                    i := i + 1
                end
                if left_justified then
                    Result.append (l)
                else
                    Result.prepend (l)
                end
            else
                t := (width - s.count) // 2
                if 2 * t + s.count < width then
                    create l.make (t + 1)
                else
                    create l.make (t)
                end
                create r.make (t)
                from
                    i := 1
                until
                    i > r.capacity
                loop
                    l.extend (fill_character)
                    r.extend (fill_character)
                    i := i + 1
                end
                if i = l.capacity then
                    l.extend (fill_character)
                end
                Result.prepend (l)
                Result.append (r)
            end
        end

invariant

    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_INTEGER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FORMAT_INTEGER

General
    cluster: base.support
    description: "Formatter for integral numbers"
    create: make

Ancestors
    ANY

Queries
    bracketted_negative: BOOLEAN
    centered: BOOLEAN
    fill_character: CHARACTER
    formatted (i: INTEGER): STRING
    ignore_sign: BOOLEAN
    justification: INTEGER
    leading_sign: BOOLEAN
    left_justified: BOOLEAN
    no_separator: BOOLEAN
    not_justified: BOOLEAN
    right_justified: BOOLEAN
    separator: CHARACTER
    show_sign: BOOLEAN
    show_sign_negative: BOOLEAN
    show_sign_positive: BOOLEAN
    sign_format: INTEGER
    sign_string: STRING
    trailing_sign: BOOLEAN
    width: INTEGER

Commands
    asterisk_fill
    blank_fill
    bracket_negative
    center_justify
    comma_separate
    dollar_fill
    dot_separate
    left_justify
    make (w: INTEGER)
    no_justify
    remove_separator
    right_justify
    set_fill (c: CHARACTER)
    set_separator (c: CHARACTER)
    set_sign (s: STRING)
    set_width (w: INTEGER)
    sign_cr_dr
    sign_dr_cr
    sign_floating_dollar
    sign_floating_dollar_signed
    sign_ignore
    sign_leading
    sign_negative_only
    sign_normal
    sign_positive_only
    sign_show
    sign_trailing
    unbracket_negative
    underscore_separate
    zero_fill

Constraints
    sign string constraint
    wide enough

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_INTEGER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for integral numbers"
    status: "See notice at end of class"
    names: format_integer
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    FORMAT_INTEGER

create
    make

feature -- Initialization

    make (w: INTEGER) is
        require
            reasonable_field: w >= 1
        do
            blank_fill
            width := w
            sign_normal
            sign_negative_only
            right_justify
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
        end

feature -- Access

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?

    fill_character: CHARACTER
            -- Padding character.

    justification: INTEGER
            -- Where in the field the format goes.

    separator: CHARACTER
            -- Separator between 1000's of numbers.

    sign_format: INTEGER
            -- How the sign is formatted.

    sign_string: STRING
            -- Formatting details for the sign.

    trailing_sign: BOOLEAN
            -- Is the sign at the end?

    width: INTEGER
            -- Width of the field.

feature -- Status report

    centered: BOOLEAN is
            -- Are numbers to be formatted centered?
        do
            Result := justification = center_justification
        ensure
            Result = (justification = center_justification)
        end

    ignore_sign: BOOLEAN is
            -- Ignore the sign of a number?
        do
            Result := sign_format = ignore_sign_value
        ensure
            Result = (sign_format = ignore_sign_value)
        end

    leading_sign: BOOLEAN is
            -- Is the sign leading?
        do
            Result := not trailing_sign
        ensure
            Result = not trailing_sign
        end

    left_justified: BOOLEAN is
            -- Are numbers to be formatted with spaces on the right?
        do
            Result := justification = left_justification
        ensure
            Result = (justification = left_justification)
        end

    no_separator: BOOLEAN is
            -- Is there a separator?
        do
            Result := separator = '%U'
        ensure
            Result = (separator = '%U')
        end

    not_justified: BOOLEAN is
            -- Are numbers to be formatted in smallest string possible
        do
            Result := justification = no_justification
        ensure
            Result = (justification = no_justification)
        end

    right_justified: BOOLEAN is
            -- Are numbers to be formatted with spaces on the left?
        do
            Result := justification = right_justification
        ensure
            Result = (justification = right_justification)
        end

    show_sign: BOOLEAN is
            -- Are numbers to show sign whether positive or negative?
        do
            Result := sign_format = show_sign_value
        ensure
            Result = (sign_format = show_sign_value)
        end

    show_sign_negative: BOOLEAN is
            -- Are numbers to show sign only when negative?
        do
            Result := sign_format = sign_negative_value
        ensure
            Result = (sign_format = sign_negative_value)
        end

    show_sign_positive: BOOLEAN is
            -- Are numbers to show sign only when positive?
        do
            Result := sign_format = sign_positive_value
        ensure
            Result = (sign_format = sign_positive_value)
        end

feature -- Status setting

    asterisk_fill is
            -- Fill numbers with asterisks.
        do
            fill_character := '*'
        ensure
            fill_character = '*'
        end

    blank_fill is
            -- Fill numbers with blanks.
        do
            fill_character := ' '
        ensure
            fill_character = ' '
        end

    bracket_negative is
            -- Bracket negative numbers.
        do
            bracketted_negative := True
        ensure
            bracketted_negative
        end

    center_justify is
            -- Put padding on right and left
        do
            justification := center_justification
        ensure
            centered
        end

    comma_separate is
            -- Set separator to comma.
        do
            separator := ','
        ensure
            separator = ','
        end

    dollar_fill is
            -- Fill numbers with dollars.
        do
            fill_character := '$'
        ensure
            fill_character = '$'
        end

    dot_separate is
            -- Set separator to period.
        do
            separator := '.'
        ensure
            separator = '.'
        end

    left_justify is
            --Put padding on right
        do
            justification := left_justification
        ensure
            left_justified
        end

    no_justify is
            -- Always return the smallest string possible
        do
            justification := no_justification
        ensure
            not_justified
        end

    remove_separator is
            -- Remove the separator.
        do
            separator := '%U'
        ensure
            separator = '%U'
        end

    right_justify is
            -- Put padding on left
        do
            justification := right_justification
        ensure
            right_justified
        end

    set_fill (c: CHARACTER) is
            -- Fill numbers with c
        do
            fill_character := c
        ensure
            fill_character = c
        end

    set_separator (c: CHARACTER) is
            -- Set the separator to c
        do
            separator := c
        ensure
            separator = c
        end

    set_sign (s: STRING) is
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
        require
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        do
            sign_string := clone (s)
        ensure
            sign_string.is_equal (s)
        end

    set_width (w: INTEGER) is
            -- Set width to w
        require
            wide_enough: w >= 1
        do
            width := w
        ensure
            width = w
        end

    sign_cr_dr is
            -- Set sign for CR/DR
        do
            sign_string := "CR DR"
        ensure
            sign_string.is_equal ("CR DR")
        end

    sign_dr_cr is
            -- Set sign for DR/CR
        do
            sign_string := "DR CR"
        ensure
            sign_string.is_equal ("DR CR")
        end

    sign_floating_dollar is
            -- Set sign for floating dollar.
        do
            sign_string := "$$$"
            sign_leading
        ensure
            sign_string.is_equal ("$$$")
        end

    sign_floating_dollar_signed is
            -- Set sign for floating dollar include sign.
        do
            sign_string := "-$ $+$"
            sign_leading
        ensure
            sign_string.is_equal ("-$ $+$")
        end

    sign_ignore is
            -- Do not show sign.
        do
            sign_format := ignore_sign_value
        ensure
            ignore_sign
        end

    sign_leading is
            -- Set the sign to lead
        do
            trailing_sign := False
        ensure
            leading_sign
        end

    sign_negative_only is
            -- Show sign for negative numbers only.
        do
            sign_format := sign_negative_value
        ensure
            show_sign_negative
        end

    sign_normal is
            -- Set sign for - and +.
        do
            sign_string := "- +"
        ensure
            sign_string.is_equal ("- +")
        end

    sign_positive_only is
            -- Show sign for positive numbers only.
        do
            sign_format := sign_positive_value
        ensure
            show_sign_positive
        end

    sign_show is
            -- Show sign for all numbers.
        do
            sign_format := show_sign_value
        ensure
            show_sign
        end

    sign_trailing is
            -- Set the sign to trail
        do
            trailing_sign := True
        ensure
            trailing_sign
        end

    unbracket_negative is
            -- Do not bracket negative numbers.
        do
            bracketted_negative := False
        ensure
            not bracketted_negative
        end

    underscore_separate is
            -- Set separator to underscore.
        do
            separator := '_'
        ensure
            separator = '_'
        end

    zero_fill is
            -- Fill numbers with zeros.
        do
            fill_character := '0'
        ensure
            fill_character = '0'
        end

feature -- Conversion

    formatted (i: INTEGER): STRING is
            -- Format the integer.
        local
            sign: INTEGER
            unsigned: INTEGER
        do
            if i < 0 then
                sign := - 1
                unsigned := - i
            elseif i > 0 then
                sign := 1;
                unsigned := i
            end
            if not no_separator then
                Result := split (unsigned.out)
            else
                Result := clone (unsigned.out)
            end
            if not ignore_sign or bracketted_negative then
                Result := process_sign (Result, sign)
            end
            if justification /= no_justification and then Result.count < width then
                Result := justify (Result)
            end
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width
        end

feature {NONE} -- Implementation

    Center_justification: INTEGER is 2

    Ignore_sign_value: INTEGER is 1

    justify (s: STRING): STRING is
            -- Justify s.
        require
            room: s.count < width
            justification: justification /= no_justification
        local
            l, r: STRING
            i, t: INTEGER
        do
            Result := s
            if not centered then
                create l.make (width - s.count)
                from
                    i := 1
                until
                    i > l.capacity
                loop
                    l.extend (fill_character)
                    i := i + 1
                end
                if left_justified then
                    Result.append (l)
                else
                    Result.prepend (l)
                end
            else
                t := (width - s.count) // 2
                if 2 * t + s.count < width then
                    create l.make (t + 1)
                else
                    create l.make (t)
                end
                create r.make (t)
                from
                    i := 1
                until
                    i > r.capacity
                loop
                    l.extend (fill_character)
                    r.extend (fill_character)
                    i := i + 1
                end
                if i = l.capacity then
                    l.extend (fill_character)
                end
                Result.prepend (l)
                Result.append (r)
            end
        end

    Left_justification: INTEGER is 1

    No_justification: INTEGER is 0

    process_sign (s: STRING; sn: INTEGER): STRING is
            -- Process sign related values.
        local
            sstring: STRING
        do
            Result := s
            if bracketted_negative and sn = - 1 then
                Result.precede ('(')
                Result.extend (')')
            end
            if ((show_sign_negative or show_sign) and sn = - 1) or else ((show_sign_positive or show_sign) and sn = 1) or else (show_sign and sn = 0) then
                sstring := sign_value (sn)
            end
            if sstring /= void then
                if trailing_sign then
                    Result.append (sstring)
                else
                    Result.prepend (sstring)
                end
            end
        end

    Right_justification: INTEGER is 3

    Show_sign_value: INTEGER is 0

    Sign_negative_value: INTEGER is 3

    Sign_positive_value: INTEGER is 2

    sign_size: INTEGER is
            -- Size of the sign.
        do
            Result := sign_string.count // 3
        ensure
            Result * 3 = sign_string.count
        end

    sign_value (i: INTEGER): STRING is
            -- Value of the sign.
        require
            correct_sign: - 1 <= i and i <= 1
        local
            t: INTEGER
        do
            t := sign_size * (i + 1) + 1
            Result := sign_string.substring (t, t + sign_size - 1)
        end

    split (s: STRING): STRING is
            -- Apply separators to an integer
        require
            efficiency: separator /= '%U'
        local
            count, sep_length: INTEGER
        do
            from
                count := s.count
                create Result.make (width)
            until
                count <= 3
            loop
                from
                    sep_length := 0
                until
                    sep_length = 3
                loop
                    Result.precede (s.item (count))
                    count := count - 1
                    sep_length := sep_length + 1
                end
                Result.precede (separator)
            end
            from
            until
                count = 0
            loop
                Result.precede (s.item (count))
                count := count - 1
            end
        end

invariant

    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_INTEGER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for integral numbers"
    status: "See notice at end of class"
    names: format_integer
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    FORMAT_INTEGER

create

    make (w: INTEGER)
        require
            reasonable_field: w >= 1
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign

feature -- Initialization

    make (w: INTEGER)
        require
            reasonable_field: w >= 1
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign

feature -- Access

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?

    fill_character: CHARACTER
            -- Padding character.

    justification: INTEGER
            -- Where in the field the format goes.

    separator: CHARACTER
            -- Separator between 1000's of numbers.

    sign_format: INTEGER
            -- How the sign is formatted.

    sign_string: STRING
            -- Formatting details for the sign.

    trailing_sign: BOOLEAN
            -- Is the sign at the end?

    width: INTEGER
            -- Width of the field.

feature -- Status report

    centered: BOOLEAN
            -- Are numbers to be formatted centered?
        ensure
            Result = (justification = center_justification)

    ignore_sign: BOOLEAN
            -- Ignore the sign of a number?
        ensure
            Result = (sign_format = ignore_sign_value)

    leading_sign: BOOLEAN
            -- Is the sign leading?
        ensure
            Result = not trailing_sign

    left_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the right?
        ensure
            Result = (justification = left_justification)

    no_separator: BOOLEAN
            -- Is there a separator?
        ensure
            Result = (separator = '%U')

    not_justified: BOOLEAN
            -- Are numbers to be formatted in smallest string possible
        ensure
            Result = (justification = no_justification)

    right_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the left?
        ensure
            Result = (justification = right_justification)

    show_sign: BOOLEAN
            -- Are numbers to show sign whether positive or negative?
        ensure
            Result = (sign_format = show_sign_value)

    show_sign_negative: BOOLEAN
            -- Are numbers to show sign only when negative?
        ensure
            Result = (sign_format = sign_negative_value)

    show_sign_positive: BOOLEAN
            -- Are numbers to show sign only when positive?
        ensure
            Result = (sign_format = sign_positive_value)

feature -- Status setting

    asterisk_fill
            -- Fill numbers with asterisks.
        ensure
            fill_character = '*'

    blank_fill
            -- Fill numbers with blanks.
        ensure
            fill_character = ' '

    bracket_negative
            -- Bracket negative numbers.
        ensure
            bracketted_negative

    center_justify
            -- Put padding on right and left
        ensure
            centered

    comma_separate
            -- Set separator to comma.
        ensure
            separator = ','

    dollar_fill
            -- Fill numbers with dollars.
        ensure
            fill_character = '$'

    dot_separate
            -- Set separator to period.
        ensure
            separator = '.'

    left_justify
            --Put padding on right
        ensure
            left_justified

    no_justify
            -- Always return the smallest string possible
        ensure
            not_justified

    remove_separator
            -- Remove the separator.
        ensure
            separator = '%U'

    right_justify
            -- Put padding on left
        ensure
            right_justified

    set_fill (c: CHARACTER)
            -- Fill numbers with c
        ensure
            fill_character = c

    set_separator (c: CHARACTER)
            -- Set the separator to c
        ensure
            separator = c

    set_sign (s: STRING)
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
        require
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        ensure
            sign_string.is_equal (s)

    set_width (w: INTEGER)
            -- Set width to w
        require
            wide_enough: w >= 1
        ensure
            width = w

    sign_cr_dr
            -- Set sign for CR/DR
        ensure
            sign_string.is_equal ("CR DR")

    sign_dr_cr
            -- Set sign for DR/CR
        ensure
            sign_string.is_equal ("DR CR")

    sign_floating_dollar
            -- Set sign for floating dollar.
        ensure
            sign_string.is_equal ("$$$")

    sign_floating_dollar_signed
            -- Set sign for floating dollar include sign.
        ensure
            sign_string.is_equal ("-$ $+$")

    sign_ignore
            -- Do not show sign.
        ensure
            ignore_sign

    sign_leading
            -- Set the sign to lead
        ensure
            leading_sign

    sign_negative_only
            -- Show sign for negative numbers only.
        ensure
            show_sign_negative

    sign_normal
            -- Set sign for - and +.
        ensure
            sign_string.is_equal ("- +")

    sign_positive_only
            -- Show sign for positive numbers only.
        ensure
            show_sign_positive

    sign_show
            -- Show sign for all numbers.
        ensure
            show_sign

    sign_trailing
            -- Set the sign to trail
        ensure
            trailing_sign

    unbracket_negative
            -- Do not bracket negative numbers.
        ensure
            not bracketted_negative

    underscore_separate
            -- Set separator to underscore.
        ensure
            separator = '_'

    zero_fill
            -- Fill numbers with zeros.
        ensure
            fill_character = '0'

feature -- Conversion

    formatted (i: INTEGER): STRING
            -- Format the integer.
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width

invariant

    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_INTEGER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    FORMAT_INTEGER

Ancestors
    ANY

Descendants
    FORMAT_DOUBLE

Clients
    FORMAT_INTEGER

Suppliers
    BOOLEAN
    FORMAT_INTEGER
    INTEGER
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


FORMAT_INTEGER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Formatter for integral numbers"
    status: "See notice at end of class"
    names: format_integer
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    FORMAT_INTEGER

create
    make

feature -- Initialization

    make (w: INTEGER)
        require
            reasonable_field: w >= 1
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign

feature -- Access

    fill_character: CHARACTER
            -- Padding character.

    width: INTEGER
            -- Width of the field.

    separator: CHARACTER
            -- Separator between 1000's of numbers.

    justification: INTEGER
            -- Where in the field the format goes.

    trailing_sign: BOOLEAN
            -- Is the sign at the end?

    sign_format: INTEGER
            -- How the sign is formatted.

    sign_string: STRING
            -- Formatting details for the sign.

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?

feature -- Status report

    centered: BOOLEAN
            -- Are numbers to be formatted centered?
        ensure
            Result = (justification = center_justification)

    left_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the right?
        ensure
            Result = (justification = left_justification)

    right_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the left?
        ensure
            Result = (justification = right_justification)

    not_justified: BOOLEAN
            -- Are numbers to be formatted in smallest string possible
        ensure
            Result = (justification = no_justification)

    show_sign_negative: BOOLEAN
            -- Are numbers to show sign only when negative?
        ensure
            Result = (sign_format = sign_negative_value)

    show_sign_positive: BOOLEAN
            -- Are numbers to show sign only when positive?
        ensure
            Result = (sign_format = sign_positive_value)

    show_sign: BOOLEAN
            -- Are numbers to show sign whether positive or negative?
        ensure
            Result = (sign_format = show_sign_value)

    ignore_sign: BOOLEAN
            -- Ignore the sign of a number?
        ensure
            Result = (sign_format = ignore_sign_value)

    no_separator: BOOLEAN
            -- Is there a separator?
        ensure
            Result = (separator = '%U')

    leading_sign: BOOLEAN
            -- Is the sign leading?
        ensure
            Result = not trailing_sign

feature -- Status setting

    blank_fill
            -- Fill numbers with blanks.
        ensure
            fill_character = ' '

    zero_fill
            -- Fill numbers with zeros.
        ensure
            fill_character = '0'

    dollar_fill
            -- Fill numbers with dollars.
        ensure
            fill_character = '$'

    asterisk_fill
            -- Fill numbers with asterisks.
        ensure
            fill_character = '*'

    set_fill (c: CHARACTER)
            -- Fill numbers with c
        ensure
            fill_character = c

    set_width (w: INTEGER)
            -- Set width to w
        require
            wide_enough: w >= 1
        ensure
            width = w

    underscore_separate
            -- Set separator to underscore.
        ensure
            separator = '_'

    comma_separate
            -- Set separator to comma.
        ensure
            separator = ','

    dot_separate
            -- Set separator to period.
        ensure
            separator = '.'

    remove_separator
            -- Remove the separator.
        ensure
            separator = '%U'

    set_separator (c: CHARACTER)
            -- Set the separator to c
        ensure
            separator = c

    left_justify
            --Put padding on right
        ensure
            left_justified

    center_justify
            -- Put padding on right and left
        ensure
            centered

    right_justify
            -- Put padding on left
        ensure
            right_justified

    no_justify
            -- Always return the smallest string possible
        ensure
            not_justified

    sign_leading
            -- Set the sign to lead
        ensure
            leading_sign

    sign_trailing
            -- Set the sign to trail
        ensure
            trailing_sign

    sign_positive_only
            -- Show sign for positive numbers only.
        ensure
            show_sign_positive

    sign_negative_only
            -- Show sign for negative numbers only.
        ensure
            show_sign_negative

    sign_show
            -- Show sign for all numbers.
        ensure
            show_sign

    sign_ignore
            -- Do not show sign.
        ensure
            ignore_sign

    sign_normal
            -- Set sign for - and +.
        ensure
            sign_string.is_equal ("- +")

    sign_cr_dr
            -- Set sign for CR/DR
        ensure
            sign_string.is_equal ("CR DR")

    sign_dr_cr
            -- Set sign for DR/CR
        ensure
            sign_string.is_equal ("DR CR")

    sign_floating_dollar
            -- Set sign for floating dollar.
        ensure
            sign_string.is_equal ("$$$")

    sign_floating_dollar_signed
            -- Set sign for floating dollar include sign.
        ensure
            sign_string.is_equal ("-$ $+$")

    set_sign (s: STRING)
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
        require
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        ensure
            sign_string.is_equal (s)

    bracket_negative
            -- Bracket negative numbers.
        ensure
            bracketted_negative

    unbracket_negative
            -- Do not bracket negative numbers.
        ensure
            not bracketted_negative

feature -- Conversion

    formatted (i: INTEGER): STRING
            -- Format the integer.
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width

invariant

    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects identified, uniquely during any session, by an integer"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    IDENTIFIED

inherit
    MEMORY
        export
            {NONE} all
        redefine
            dispose,
            is_equal,
            copy
        end

    ANY
        redefine
            is_equal,
            copy
        end

feature -- Access

    frozen object_id: INTEGER is
            -- Unique for current object in any given session
        do
            if internal_id = 0 then
                internal_id := eif_object_id (Current)
            end
            Result := internal_id
        ensure
            valid_id: id_object (Result) = Current
        end

    frozen id_object (an_id: INTEGER): IDENTIFIED is
            -- Object associated with an_id (void if no such object)
        do
            Result := eif_id_object (an_id)
        ensure
            consistent: Result = void or else Result.object_id = an_id
        end

feature -- Status report

    frozen id_freed: BOOLEAN is
            -- Has Current been removed from the table?
        do
            Result := id_object (internal_id) = void
        end

feature -- Removal

    frozen free_id is
            -- Free the entry associated with object_id if any
        do
            if internal_id /= 0 then
                eif_object_id_free (internal_id)
            end
        ensure
            object_freed: id_freed
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object considered
            -- equal to current object?
        local
            int_id: INTEGER
        do
            int_id := internal_id
            internal_id := other.internal_id
            Result := standard_is_equal (other)
            internal_id := int_id
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        local
            int_id: INTEGER
        do
            int_id := internal_id
            standard_copy (other)
            internal_id := int_id
        end

feature {NONE} -- Removal

    dispose is
            -- Free the entry associated with object_id if any
        do
            free_id
        ensure then
            object_freed: id_freed
        end

feature {IDENTIFIED} -- Implementation

    internal_id: INTEGER
            -- Internal representation of object_id

feature {NONE} -- Externals

    eif_id_object (an_id: INTEGER): IDENTIFIED is
            -- Object associated with an_id
        external
            "C | %"eif_object_id.h%""
        end

    eif_object_id (an_object: IDENTIFIED): INTEGER is
            -- New identifier for an_object
        external
            "C | %"eif_object_id.h%""
        end

    eif_object_id_free (an_id: INTEGER) is
            -- Free the entry an_id
        external
            "C | %"eif_object_id.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    IDENTIFIED

General
    cluster: base.support
    description: "Objects identified, uniquely during any session, by an integer"

Ancestors
    ANY
    MEMORY

Queries
    id_freed: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    is_equal (other: [like Current] IDENTIFIED): BOOLEAN
    object_id: INTEGER

Commands
    copy (other: [like Current] IDENTIFIED)
    free_id

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED_CONTROLLER Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Externals for managing the object id stack (see identified.e)"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    IDENTIFIED_CONTROLLER

feature -- Measurement

    object_id_stack_size: INTEGER is
            -- Size of the object_id stack in chunks
        external
            "C | %"eif_object_id.h%""
        alias
            "eif_object_id_stack_size"
        end

feature -- Status setting

    extend_object_id_stack (nb_chunks: INTEGER) is
            -- Extend the object_id stack by nb_chunks chunks.
        require
            positive_nb: nb_chunks > 0
        external
            "C | %"eif_object_id.h%""
        alias
            "eif_extend_object_id_stack"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED_CONTROLLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED_CONTROLLER Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    IDENTIFIED_CONTROLLER

General
    cluster: base.support
    description: "Externals for managing the object id stack (see identified.e)"

Ancestors
    ANY

Queries
    object_id_stack_size: INTEGER

Commands
    extend_object_id_stack (nb_chunks: INTEGER)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED_CONTROLLER Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Externals for managing the object id stack (see identified.e)"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    IDENTIFIED_CONTROLLER

feature -- Measurement

    object_id_stack_size: INTEGER is
            -- Size of the object_id stack in chunks
        external
            "C | %"eif_object_id.h%""
        alias
            "eif_object_id_stack_size"
        end

feature -- Status setting

    extend_object_id_stack (nb_chunks: INTEGER) is
            -- Extend the object_id stack by nb_chunks chunks.
        require
            positive_nb: nb_chunks > 0
        external
            "C | %"eif_object_id.h%""
        alias
            "eif_extend_object_id_stack"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED_CONTROLLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED_CONTROLLER Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Externals for managing the object id stack (see identified.e)"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    IDENTIFIED_CONTROLLER

feature -- Measurement

    object_id_stack_size: INTEGER
            -- Size of the object_id stack in chunks

feature -- Status setting

    extend_object_id_stack (nb_chunks: INTEGER)
            -- Extend the object_id stack by nb_chunks chunks.
        require
            positive_nb: nb_chunks > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED_CONTROLLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED_CONTROLLER Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    IDENTIFIED_CONTROLLER

Ancestors
    ANY

Suppliers
    INTEGER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED_CONTROLLER Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Externals for managing the object id stack (see identified.e)"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    IDENTIFIED_CONTROLLER

feature -- Measurement

    object_id_stack_size: INTEGER
            -- Size of the object_id stack in chunks

feature -- Status setting

    extend_object_id_stack (nb_chunks: INTEGER)
            -- Extend the object_id stack by nb_chunks chunks.
        require
            positive_nb: nb_chunks > 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED_CONTROLLER

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects identified, uniquely during any session, by an integer"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    IDENTIFIED

feature -- Access

    frozen id_object (an_id: INTEGER): IDENTIFIED is
            -- Object associated with an_id (void if no such object)
        do
            Result := eif_id_object (an_id)
        ensure
            consistent: Result = void or else Result.object_id = an_id
        end

    frozen object_id: INTEGER is
            -- Unique for current object in any given session
        do
            if internal_id = 0 then
                internal_id := eif_object_id (Current)
            end
            Result := internal_id
        ensure
            valid_id: id_object (Result) = Current
        end

feature {NONE} -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature {NONE} -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO is
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector
        do
            create Result.make (collector_type)
        end

    memory_statistics (memory_type: INTEGER): MEM_INFO is
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory
        do
            create Result.make (memory_type)
        end

feature -- Comparison

    is_equal (other: like Current): BOOLEAN is
            -- Is other attached to an object considered
            -- equal to current object?
        require -- from ANY
            other_not_void: other /= void
        local
            int_id: INTEGER
        do
            int_id := internal_id
            internal_id := other.internal_id
            Result := standard_is_equal (other)
            internal_id := int_id
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        end

feature -- Status report

    frozen id_freed: BOOLEAN is
            -- Has Current been removed from the table?
        do
            Result := id_object (internal_id) = void
        end

feature {NONE} -- Status report

    chunk_size: INTEGER is
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_chunk_size"
        end

    coalesce_period: INTEGER is
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_coalesce_period"
        end

    collecting: BOOLEAN is
            -- Is garbage collection enabled?
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_ison"
        end

    collection_period: INTEGER is
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pget"
        end

    generation_object_limit: INTEGER is
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_generation_object_limit"
        end

    largest_coalesced_block: INTEGER is
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_largest"
        end

    max_mem: INTEGER is
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_get_max_mem"
        end

    memory_threshold: INTEGER is
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tget"
        end

    referers (an_object: ANY): ARRAY [ANY] is
            -- Objects that refer to an_object.
            -- (from MEMORY)
        local
            a: ANY
        do
            create Result.make (0, 200)
            a := Result.area
            find_referers ($an_object, $a, Result.count)
        end

    scavenge_zone_size: INTEGER is
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_scavenge_zone_size"
        end

    tenure: INTEGER is
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "eif_tenure"
        end

feature {NONE} -- Status setting

    allocate_compact is
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_slow"
        end

    allocate_fast is
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_speed"
        end

    allocate_tiny is
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tiny"
        end

    collection_off is
            -- Disable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_stop"
        end

    collection_on is
            -- Enable garbage collection.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "gc_run"
        end

    disable_time_accounting is
            -- Disable GC time accounting (default).
            -- (from MEMORY)
        do
            gc_monitoring (False)
        end

    enable_time_accounting is
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)
        do
            gc_monitoring (True)
        end

    set_coalesce_period (value: INTEGER) is
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_coalesce_period"
        end

    set_collection_period (value: INTEGER) is
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_pset"
        end

    set_max_mem (value: INTEGER) is
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "eif_set_max_mem"
        end

    set_memory_threshold (value: INTEGER) is
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0
        external
            "C | %"eif_memory.h%""
        alias
            "mem_tset"
        end

feature -- Removal

    frozen free_id is
            -- Free the entry associated with object_id if any
        do
            if internal_id /= 0 then
                eif_object_id_free (internal_id)
            end
        ensure
            object_freed: id_freed
        end

feature {NONE} -- Removal

    collect is
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_eiffel.h%""
        end

    dispose is
            -- Free the entry associated with object_id if any
        do
            free_id
        ensure then
            object_freed: id_freed
        end

    free (object: ANY) is
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)
        do
            mem_free ($object)
        end

    full_coalesce is
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "mem_coalesc"
        end

    full_collect is
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)
        external
            "C | %"eif_garcol.h%""
        alias
            "plsc"
        end

    mem_free (addr: POINTER) is
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        end

feature -- Duplication

    copy (other: like Current) is
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        local
            int_id: INTEGER
        do
            int_id := internal_id
            standard_copy (other)
            internal_id := int_id
        ensure -- from ANY
            is_equal: is_equal (other)
        end

feature {IDENTIFIED} -- Implementation

    internal_id: INTEGER
            -- Internal representation of object_id

feature {NONE} -- Implementation

    find_referers (target: POINTER; esult: POINTER; result_size: INTEGER) is
            -- (from MEMORY)
        external
            "C | %"eif_traverse.h%""
        end

    gc_monitoring (flag: BOOLEAN) is
            -- Set up GC monitoring according to flag
            -- (from MEMORY)
        external
            "C | %"eif_memory.h%""
        alias
            "gc_mon"
        end

feature {NONE} -- Externals

    eif_id_object (an_id: INTEGER): IDENTIFIED is
            -- Object associated with an_id
        external
            "C | %"eif_object_id.h%""
        end

    eif_object_id (an_object: IDENTIFIED): INTEGER is
            -- New identifier for an_object
        external
            "C | %"eif_object_id.h%""
        end

    eif_object_id_free (an_id: INTEGER) is
            -- Free the entry an_id
        external
            "C | %"eif_object_id.h%""
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects identified, uniquely during any session, by an integer"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    IDENTIFIED

feature -- Access

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
        ensure
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
        ensure
            valid_id: id_object (Result) = Current

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object considered
            -- equal to current object?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    frozen id_freed: BOOLEAN
            -- Has Current been removed from the table?

feature -- Removal

    frozen free_id
            -- Free the entry associated with object_id if any
        ensure
            object_freed: id_freed

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    IDENTIFIED

Ancestors
    ANY
    MEMORY

Clients
    IDENTIFIED

Suppliers
    BOOLEAN
    IDENTIFIED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


IDENTIFIED Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Objects identified, uniquely during any session, by an integer"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    IDENTIFIED

feature -- Access

    frozen object_id: INTEGER
            -- Unique for current object in any given session
        ensure
            valid_id: id_object (Result) = Current

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
        ensure
            consistent: Result = void or else Result.object_id = an_id

feature -- Status report

    frozen id_freed: BOOLEAN
            -- Has Current been removed from the table?

feature -- Removal

    frozen free_id
            -- Free the entry associated with object_id if any
        ensure
            object_freed: id_freed

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object considered
            -- equal to current object?

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERNAL Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to internal object properties.
        This class may be used as ancestor by classes needing its
        facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    INTERNAL

feature -- Conformance

    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN is
            -- Is object an instance of type type_id?
        require
            object_not_void: object /= void
        do
            Result := c_is_instance_of (type_id, $object)
        end

    type_conforms_to (type1, type2: INTEGER): BOOLEAN is
            -- Does type1 conform to type2?
        external
            "C | %"eif_gen_conf.h%""
        alias
            "eif_gen_conf"
        end

feature -- Creation

    dynamic_type_from_string (class_type: STRING): INTEGER is
            -- Dynamic type corresponding to class_type.
            -- If no dynamic type available, returns -1.
        require
            class_type_not_void: class_type /= void
        local
            a: ANY
        do
            a := class_type.to_c
            Result := c_type_id ($a)
        ensure
            valid_result: Result = - 1 or else Result >= 0
        end

    new_instance_of (type_id: INTEGER): ANY is
            -- New instance of dynamic type_id.
            -- Note: returned object is not initialized and may
            -- hence violate its invariant.
        external
            "C [macro %"eif_macros.h%"]"
        alias
            "RTLN"
        end

feature -- Access

    Pointer_type: INTEGER is 0

    Reference_type: INTEGER is 1

    Character_type: INTEGER is 2

    Boolean_type: INTEGER is 3

    Integer_type: INTEGER is 4

    Integer_32_type: INTEGER is 4

    Real_type: INTEGER is 5

    Double_type: INTEGER is 6

    Expanded_type: INTEGER is 7

    Bit_type: INTEGER is 8

    Integer_8_type: INTEGER is 9

    Integer_16_type: INTEGER is 10

    Integer_64_type: INTEGER is 11

    Wide_character_type: INTEGER is 12

    class_name (object: ANY): STRING is
            -- Name of the class associated with object
        require
            object_not_void: object /= void
        do
            Result := object.generator
        end

    dynamic_type (object: ANY): INTEGER is
            -- Dynamic type of object
        require
            object_not_void: object /= void
        do
            Result := c_dynamic_type ($object)
        end

    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER is
            -- Dynamic type of generic parameter of object at
            -- position i.
        do
            Result := eif_gen_param_id (- 1, $object, i)
        end

    field (i: INTEGER; object: ANY): ANY is
            -- Object attached to the i-th field of object
            -- (directly or through a reference)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        do
            Result := c_field (i - 1, $object)
        end

    field_name (i: INTEGER; object: ANY): STRING is
            -- Name of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        do
            create Result.make_from_c (c_field_name_of_type (i - 1, c_dynamic_type ($object)))
        ensure
            result_exists: Result /= void
        end

    field_name_of_type (i: INTEGER; type_id: INTEGER): STRING is
            -- Name of i-th field of dynamic type type_id.
        require
            index_large_enough: i >= 1
            index_small_enought: i <= field_count_of_type (type_id)
        do
            create Result.make_from_c (c_field_name_of_type (i - 1, type_id))
        end

    field_offset (i: INTEGER; object: ANY): INTEGER is
            -- Offset of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        do
            Result := c_field_offset (i - 1, $object)
        end

    field_type (i: INTEGER; object: ANY): INTEGER is
            -- Type of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
        do
            Result := c_field_type_of_type (i - 1, c_dynamic_type ($object))
        end

    field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER is
            -- Type of i-th field of dynamic type type_id
        require
            index_large_enough: i >= 1
            index_small_enough: i <= field_count_of_type (type_id)
        do
            Result := c_field_type_of_type (i - 1, type_id)
        end

    expanded_field_type (i: INTEGER; object: ANY): STRING is
            -- Class name associated with the i-th
            -- expanded field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_expanded: field_type (i, object) = expanded_type
        do
            Result := c_expanded_type (i - 1, $object)
        ensure
            result_exists: Result /= void
        end

    character_field (i: INTEGER; object: ANY): CHARACTER is
            -- Character value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type
        do
            Result := c_character_field (i - 1, $object)
        end

    boolean_field (i: INTEGER; object: ANY): BOOLEAN is
            -- Boolean value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type
        do
            Result := c_boolean_field (i - 1, $object)
        end

    integer_field (i: INTEGER; object: ANY): INTEGER is
            -- Integer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type
        do
            Result := c_integer_field (i - 1, $object)
        end

    real_field (i: INTEGER; object: ANY): REAL is
            -- Real value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type
        do
            Result := c_real_field (i - 1, $object)
        end

    pointer_field (i: INTEGER; object: ANY): POINTER is
            -- Pointer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type
        do
            Result := c_pointer_field (i - 1, $object)
        end

    double_field (i: INTEGER; object: ANY): DOUBLE is
            -- Double precision value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type
        do
            Result := c_double_field (i - 1, $object)
        end

feature -- Status report

    is_special (object: ANY): BOOLEAN is
            -- Is object a special object?
            -- It only recognized a special object
            -- initialized within a TO_SPECIAL object.
        require
            object_not_void: object /= void
        do
            Result := c_is_special ($object)
        end

feature -- Version

    compiler_version: INTEGER is
        external
            "C [macro %"eif_project.h%"]"
        alias
            "egc_compiler_tag"
        end

feature -- Element change

    set_reference_field (i: INTEGER; object: ANY; value: ANY) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            reference_field: field_type (i, object) = reference_type
        do
            c_set_reference_field (i - 1, $object, $value)
        end

    set_double_field (i: INTEGER; object: ANY; value: DOUBLE) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type
        do
            c_set_double_field (i - 1, $object, value)
        end

    set_character_field (i: INTEGER; object: ANY; value: CHARACTER) is
            -- Set character value of i-th field of object to value
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type
        do
            c_set_character_field (i - 1, $object, value)
        end

    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type
        do
            c_set_boolean_field (i - 1, $object, value)
        end

    set_integer_field (i: INTEGER; object: ANY; value: INTEGER) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type
        do
            c_set_integer_field (i - 1, $object, value)
        end

    set_real_field (i: INTEGER; object: ANY; value: REAL) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type
        do
            c_set_real_field (i - 1, $object, value)
        end

    set_pointer_field (i: INTEGER; object: ANY; value: POINTER) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type
        do
            c_set_pointer_field (i - 1, $object, value)
        end

feature -- Measurement

    field_count (object: ANY): INTEGER is
            -- Number of logical fields in object
        require
            object_not_void: object /= void
        do
            Result := field_count_of_type (c_dynamic_type ($object))
        end

    field_count_of_type (type_id: INTEGER): INTEGER is
            -- Number of logical fields in dynamic type type_id.
        external
            "C macro signature (EIF_INTEGER): EIF_INTEGER use %"eif_internal.h%""
        alias
            "ei_count_field_of_type"
        end

    bit_size (i: INTEGER; object: ANY): INTEGER is
            -- Size (in bit) of the i-th bit field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_bit: field_type (i, object) = bit_type
        do
            Result := c_bit_size (i - 1, $object)
        ensure
            positive_result: Result > 0
        end

    physical_size (object: ANY): INTEGER is
            -- Space occupied by object in bytes
        require
            object_not_void: object /= void
        do
            Result := c_size ($object)
        end

feature {NONE} -- Implementation

    c_is_instance_of (type1: INTEGER; obj: POINTER): BOOLEAN is
            -- Is obj an instance of type1?
        external
            "C [macro %"eif_macros.h%"]"
        alias
            "RTRA"
        end

    c_dynamic_type (object: POINTER): INTEGER is
            -- Dynamic type of object
        external
            "C macro signature (EIF_REFERENCE): EIF_INTEGER use %"eif_macros.h%""
        alias
            "Dftype"
        end

    c_field (i: INTEGER; object: POINTER): ANY is
            -- Object referenced by the i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_REFERENCE | %"eif_internal.h%""
        alias
            "ei_field"
        end

    c_field_name_of_type (i: INTEGER; type_id: INTEGER): POINTER is
            -- C pointer to name of i-th field of object
        external
            "C macro signature (EIF_INTEGER, EIF_INTEGER): EIF_POINTER use %"eif_internal.h%""
        alias
            "ei_field_name_of_type"
        end

    c_field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER is
            -- Type of i-th field of dynamic type type_id
        external
            "C signature (long, EIF_INTEGER): EIF_INTEGER use %"eif_internal.h%""
        alias
            "ei_field_type_of_type"
        end

    c_expanded_type (i: INTEGER; object: POINTER): STRING is
            -- Class name of the i-th expanded field of object
        external
            "C (long, EIF_REFERENCE): EIF_REFERENCE | %"eif_internal.h%""
        alias
            "ei_exp_type"
        end

    c_character_field (i: INTEGER; object: POINTER): CHARACTER is
            -- Character value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_CHARACTER | %"eif_internal.h%""
        alias
            "ei_char_field"
        end

    c_boolean_field (i: INTEGER; object: POINTER): BOOLEAN is
            -- Boolean value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_BOOLEAN | %"eif_internal.h%""
        alias
            "ei_bool_field"
        end

    c_integer_field (i: INTEGER; object: POINTER): INTEGER is
            -- Integer value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_int_field"
        end

    c_real_field (i: INTEGER; object: POINTER): REAL is
            -- Real value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_REAL | %"eif_internal.h%""
        alias
            "ei_float_field"
        end

    c_pointer_field (i: INTEGER; object: POINTER): POINTER is
            -- Pointer value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_POINTER | %"eif_internal.h%""
        alias
            "ei_ptr_field"
        end

    c_double_field (i: INTEGER; object: POINTER): DOUBLE is
            -- Double precision value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_DOUBLE | %"eif_internal.h%""
        alias
            "ei_double_field"
        end

    c_is_special (object: POINTER): BOOLEAN is
            -- Is object a special object?
        external
            "C (EIF_REFERENCE): EIF_BOOLEAN | %"eif_internal.h%""
        alias
            "ei_special"
        end

    c_field_offset (i: INTEGER; object: POINTER): INTEGER is
            -- Offset of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_offset"
        end

    c_bit_size (i: INTEGER; object: POINTER): INTEGER is
            -- Size (in bit) of the i-th bit field of object
        external
            "C (long, EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_bit_size"
        end

    c_size (object: POINTER): INTEGER is
            -- Physical size of object
        external
            "C (EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_size"
        end

    c_set_reference_field (i: INTEGER; object: POINTER; value: POINTER) is
        external
            "C (long, EIF_REFERENCE, EIF_REFERENCE) | %"eif_internal.h%""
        alias
            "ei_set_reference_field"
        end

    c_set_double_field (i: INTEGER; object: POINTER; value: DOUBLE) is
        external
            "C (long, EIF_REFERENCE, EIF_DOUBLE) | %"eif_internal.h%""
        alias
            "ei_set_double_field"
        end

    c_set_character_field (i: INTEGER; object: POINTER; value: CHARACTER) is
        external
            "C (long, EIF_REFERENCE, EIF_CHARACTER) | %"eif_internal.h%""
        alias
            "ei_set_char_field"
        end

    c_set_boolean_field (i: INTEGER; object: POINTER; value: BOOLEAN) is
        external
            "C (long, EIF_REFERENCE, EIF_BOOLEAN) | %"eif_internal.h%""
        alias
            "ei_set_boolean_field"
        end

    c_set_integer_field (i: INTEGER; object: POINTER; value: INTEGER) is
        external
            "C (long, EIF_REFERENCE, EIF_INTEGER) | %"eif_internal.h%""
        alias
            "ei_set_integer_field"
        end

    c_set_real_field (i: INTEGER; object: POINTER; value: REAL) is
        external
            "C (long, EIF_REFERENCE, EIF_REAL) | %"eif_internal.h%""
        alias
            "ei_set_float_field"
        end

    c_set_pointer_field (i: INTEGER; object: POINTER; value: POINTER) is
        external
            "C (long, EIF_REFERENCE, EIF_POINTER) | %"eif_internal.h%""
        alias
            "ei_set_pointer_field"
        end

    c_type_id (s: POINTER): INTEGER is
        external
            "C (char *): EIF_INTEGER | %"eif_cecil.h%""
        alias
            "eif_type_id"
        end

    eif_gen_param_id (stype: INTEGER; obj: POINTER; pos: INTEGER): INTEGER is
            -- Type of generic parameter in obj at position pos.
        external
            "C (int16, EIF_REFERENCE, int): EIF_INTEGER | %"eif_gen_conf.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERNAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERNAL Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTERNAL

General
    cluster: base.support
    description:
        "Access to internal object properties.
        This class may be used as ancestor by classes needing its
        facilities."

Ancestors
    ANY

Queries
    bit_size (i: INTEGER; object: ANY): INTEGER
    Bit_type: INTEGER
    boolean_field (i: INTEGER; object: ANY): BOOLEAN
    Boolean_type: INTEGER
    character_field (i: INTEGER; object: ANY): CHARACTER
    Character_type: INTEGER
    class_name (object: ANY): STRING
    compiler_version: INTEGER
    double_field (i: INTEGER; object: ANY): DOUBLE
    Double_type: INTEGER
    dynamic_type (object: ANY): INTEGER
    dynamic_type_from_string (class_type: STRING): INTEGER
    expanded_field_type (i: INTEGER; object: ANY): STRING
    Expanded_type: INTEGER
    field (i: INTEGER; object: ANY): ANY
    field_count (object: ANY): INTEGER
    field_count_of_type (type_id: INTEGER): INTEGER
    field_name (i: INTEGER; object: ANY): STRING
    field_name_of_type (i, type_id: INTEGER): STRING
    field_offset (i: INTEGER; object: ANY): INTEGER
    field_type (i: INTEGER; object: ANY): INTEGER
    field_type_of_type (i, type_id: INTEGER): INTEGER
    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
    Integer_16_type: INTEGER
    Integer_32_type: INTEGER
    Integer_64_type: INTEGER
    Integer_8_type: INTEGER
    integer_field (i: INTEGER; object: ANY): INTEGER
    Integer_type: INTEGER
    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
    is_special (object: ANY): BOOLEAN
    new_instance_of (type_id: INTEGER): ANY
    physical_size (object: ANY): INTEGER
    pointer_field (i: INTEGER; object: ANY): POINTER
    Pointer_type: INTEGER
    real_field (i: INTEGER; object: ANY): REAL
    Real_type: INTEGER
    Reference_type: INTEGER
    type_conforms_to (type1, type2: INTEGER): BOOLEAN
    Wide_character_type: INTEGER

Commands
    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
    set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
    set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
    set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
    set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
    set_real_field (i: INTEGER; object: ANY; value: REAL)
    set_reference_field (i: INTEGER; object, value: ANY)

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERNAL Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to internal object properties.
        This class may be used as ancestor by classes needing its
        facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    INTERNAL

feature -- Access

    Bit_type: INTEGER is 8

    boolean_field (i: INTEGER; object: ANY): BOOLEAN is
            -- Boolean value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type
        do
            Result := c_boolean_field (i - 1, $object)
        end

    Boolean_type: INTEGER is 3

    character_field (i: INTEGER; object: ANY): CHARACTER is
            -- Character value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type
        do
            Result := c_character_field (i - 1, $object)
        end

    Character_type: INTEGER is 2

    class_name (object: ANY): STRING is
            -- Name of the class associated with object
        require
            object_not_void: object /= void
        do
            Result := object.generator
        end

    double_field (i: INTEGER; object: ANY): DOUBLE is
            -- Double precision value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type
        do
            Result := c_double_field (i - 1, $object)
        end

    Double_type: INTEGER is 6

    dynamic_type (object: ANY): INTEGER is
            -- Dynamic type of object
        require
            object_not_void: object /= void
        do
            Result := c_dynamic_type ($object)
        end

    expanded_field_type (i: INTEGER; object: ANY): STRING is
            -- Class name associated with the i-th
            -- expanded field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_expanded: field_type (i, object) = expanded_type
        do
            Result := c_expanded_type (i - 1, $object)
        ensure
            result_exists: Result /= void
        end

    Expanded_type: INTEGER is 7

    field (i: INTEGER; object: ANY): ANY is
            -- Object attached to the i-th field of object
            -- (directly or through a reference)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        do
            Result := c_field (i - 1, $object)
        end

    field_name (i: INTEGER; object: ANY): STRING is
            -- Name of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        do
            create Result.make_from_c (c_field_name_of_type (i - 1, c_dynamic_type ($object)))
        ensure
            result_exists: Result /= void
        end

    field_name_of_type (i: INTEGER; type_id: INTEGER): STRING is
            -- Name of i-th field of dynamic type type_id.
        require
            index_large_enough: i >= 1
            index_small_enought: i <= field_count_of_type (type_id)
        do
            create Result.make_from_c (c_field_name_of_type (i - 1, type_id))
        end

    field_offset (i: INTEGER; object: ANY): INTEGER is
            -- Offset of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        do
            Result := c_field_offset (i - 1, $object)
        end

    field_type (i: INTEGER; object: ANY): INTEGER is
            -- Type of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
        do
            Result := c_field_type_of_type (i - 1, c_dynamic_type ($object))
        end

    field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER is
            -- Type of i-th field of dynamic type type_id
        require
            index_large_enough: i >= 1
            index_small_enough: i <= field_count_of_type (type_id)
        do
            Result := c_field_type_of_type (i - 1, type_id)
        end

    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER is
            -- Dynamic type of generic parameter of object at
            -- position i.
        do
            Result := eif_gen_param_id (- 1, $object, i)
        end

    Integer_16_type: INTEGER is 10

    Integer_32_type: INTEGER is 4

    Integer_64_type: INTEGER is 11

    Integer_8_type: INTEGER is 9

    integer_field (i: INTEGER; object: ANY): INTEGER is
            -- Integer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type
        do
            Result := c_integer_field (i - 1, $object)
        end

    Integer_type: INTEGER is 4

    pointer_field (i: INTEGER; object: ANY): POINTER is
            -- Pointer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type
        do
            Result := c_pointer_field (i - 1, $object)
        end

    Pointer_type: INTEGER is 0

    real_field (i: INTEGER; object: ANY): REAL is
            -- Real value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type
        do
            Result := c_real_field (i - 1, $object)
        end

    Real_type: INTEGER is 5

    Reference_type: INTEGER is 1

    Wide_character_type: INTEGER is 12

feature -- Measurement

    bit_size (i: INTEGER; object: ANY): INTEGER is
            -- Size (in bit) of the i-th bit field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_bit: field_type (i, object) = bit_type
        do
            Result := c_bit_size (i - 1, $object)
        ensure
            positive_result: Result > 0
        end

    field_count (object: ANY): INTEGER is
            -- Number of logical fields in object
        require
            object_not_void: object /= void
        do
            Result := field_count_of_type (c_dynamic_type ($object))
        end

    field_count_of_type (type_id: INTEGER): INTEGER is
            -- Number of logical fields in dynamic type type_id.
        external
            "C macro signature (EIF_INTEGER): EIF_INTEGER use %"eif_internal.h%""
        alias
            "ei_count_field_of_type"
        end

    physical_size (object: ANY): INTEGER is
            -- Space occupied by object in bytes
        require
            object_not_void: object /= void
        do
            Result := c_size ($object)
        end

feature -- Status report

    is_special (object: ANY): BOOLEAN is
            -- Is object a special object?
            -- It only recognized a special object
            -- initialized within a TO_SPECIAL object.
        require
            object_not_void: object /= void
        do
            Result := c_is_special ($object)
        end

feature -- Element change

    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type
        do
            c_set_boolean_field (i - 1, $object, value)
        end

    set_character_field (i: INTEGER; object: ANY; value: CHARACTER) is
            -- Set character value of i-th field of object to value
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type
        do
            c_set_character_field (i - 1, $object, value)
        end

    set_double_field (i: INTEGER; object: ANY; value: DOUBLE) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type
        do
            c_set_double_field (i - 1, $object, value)
        end

    set_integer_field (i: INTEGER; object: ANY; value: INTEGER) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type
        do
            c_set_integer_field (i - 1, $object, value)
        end

    set_pointer_field (i: INTEGER; object: ANY; value: POINTER) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type
        do
            c_set_pointer_field (i - 1, $object, value)
        end

    set_real_field (i: INTEGER; object: ANY; value: REAL) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type
        do
            c_set_real_field (i - 1, $object, value)
        end

    set_reference_field (i: INTEGER; object: ANY; value: ANY) is
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            reference_field: field_type (i, object) = reference_type
        do
            c_set_reference_field (i - 1, $object, $value)
        end

feature {NONE} -- Implementation

    c_bit_size (i: INTEGER; object: POINTER): INTEGER is
            -- Size (in bit) of the i-th bit field of object
        external
            "C (long, EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_bit_size"
        end

    c_boolean_field (i: INTEGER; object: POINTER): BOOLEAN is
            -- Boolean value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_BOOLEAN | %"eif_internal.h%""
        alias
            "ei_bool_field"
        end

    c_character_field (i: INTEGER; object: POINTER): CHARACTER is
            -- Character value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_CHARACTER | %"eif_internal.h%""
        alias
            "ei_char_field"
        end

    c_double_field (i: INTEGER; object: POINTER): DOUBLE is
            -- Double precision value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_DOUBLE | %"eif_internal.h%""
        alias
            "ei_double_field"
        end

    c_dynamic_type (object: POINTER): INTEGER is
            -- Dynamic type of object
        external
            "C macro signature (EIF_REFERENCE): EIF_INTEGER use %"eif_macros.h%""
        alias
            "Dftype"
        end

    c_expanded_type (i: INTEGER; object: POINTER): STRING is
            -- Class name of the i-th expanded field of object
        external
            "C (long, EIF_REFERENCE): EIF_REFERENCE | %"eif_internal.h%""
        alias
            "ei_exp_type"
        end

    c_field (i: INTEGER; object: POINTER): ANY is
            -- Object referenced by the i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_REFERENCE | %"eif_internal.h%""
        alias
            "ei_field"
        end

    c_field_name_of_type (i: INTEGER; type_id: INTEGER): POINTER is
            -- C pointer to name of i-th field of object
        external
            "C macro signature (EIF_INTEGER, EIF_INTEGER): EIF_POINTER use %"eif_internal.h%""
        alias
            "ei_field_name_of_type"
        end

    c_field_offset (i: INTEGER; object: POINTER): INTEGER is
            -- Offset of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_offset"
        end

    c_field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER is
            -- Type of i-th field of dynamic type type_id
        external
            "C signature (long, EIF_INTEGER): EIF_INTEGER use %"eif_internal.h%""
        alias
            "ei_field_type_of_type"
        end

    c_integer_field (i: INTEGER; object: POINTER): INTEGER is
            -- Integer value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_int_field"
        end

    c_is_instance_of (type1: INTEGER; obj: POINTER): BOOLEAN is
            -- Is obj an instance of type1?
        external
            "C [macro %"eif_macros.h%"]"
        alias
            "RTRA"
        end

    c_is_special (object: POINTER): BOOLEAN is
            -- Is object a special object?
        external
            "C (EIF_REFERENCE): EIF_BOOLEAN | %"eif_internal.h%""
        alias
            "ei_special"
        end

    c_pointer_field (i: INTEGER; object: POINTER): POINTER is
            -- Pointer value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_POINTER | %"eif_internal.h%""
        alias
            "ei_ptr_field"
        end

    c_real_field (i: INTEGER; object: POINTER): REAL is
            -- Real value of i-th field of object
        external
            "C (long, EIF_REFERENCE): EIF_REAL | %"eif_internal.h%""
        alias
            "ei_float_field"
        end

    c_set_boolean_field (i: INTEGER; object: POINTER; value: BOOLEAN) is
        external
            "C (long, EIF_REFERENCE, EIF_BOOLEAN) | %"eif_internal.h%""
        alias
            "ei_set_boolean_field"
        end

    c_set_character_field (i: INTEGER; object: POINTER; value: CHARACTER) is
        external
            "C (long, EIF_REFERENCE, EIF_CHARACTER) | %"eif_internal.h%""
        alias
            "ei_set_char_field"
        end

    c_set_double_field (i: INTEGER; object: POINTER; value: DOUBLE) is
        external
            "C (long, EIF_REFERENCE, EIF_DOUBLE) | %"eif_internal.h%""
        alias
            "ei_set_double_field"
        end

    c_set_integer_field (i: INTEGER; object: POINTER; value: INTEGER) is
        external
            "C (long, EIF_REFERENCE, EIF_INTEGER) | %"eif_internal.h%""
        alias
            "ei_set_integer_field"
        end

    c_set_pointer_field (i: INTEGER; object: POINTER; value: POINTER) is
        external
            "C (long, EIF_REFERENCE, EIF_POINTER) | %"eif_internal.h%""
        alias
            "ei_set_pointer_field"
        end

    c_set_real_field (i: INTEGER; object: POINTER; value: REAL) is
        external
            "C (long, EIF_REFERENCE, EIF_REAL) | %"eif_internal.h%""
        alias
            "ei_set_float_field"
        end

    c_set_reference_field (i: INTEGER; object: POINTER; value: POINTER) is
        external
            "C (long, EIF_REFERENCE, EIF_REFERENCE) | %"eif_internal.h%""
        alias
            "ei_set_reference_field"
        end

    c_size (object: POINTER): INTEGER is
            -- Physical size of object
        external
            "C (EIF_REFERENCE): EIF_INTEGER | %"eif_internal.h%""
        alias
            "ei_size"
        end

    c_type_id (s: POINTER): INTEGER is
        external
            "C (char *): EIF_INTEGER | %"eif_cecil.h%""
        alias
            "eif_type_id"
        end

    eif_gen_param_id (stype: INTEGER; obj: POINTER; pos: INTEGER): INTEGER is
            -- Type of generic parameter in obj at position pos.
        external
            "C (int16, EIF_REFERENCE, int): EIF_INTEGER | %"eif_gen_conf.h%""
        end

feature -- Conformance

    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN is
            -- Is object an instance of type type_id?
        require
            object_not_void: object /= void
        do
            Result := c_is_instance_of (type_id, $object)
        end

    type_conforms_to (type1, type2: INTEGER): BOOLEAN is
            -- Does type1 conform to type2?
        external
            "C | %"eif_gen_conf.h%""
        alias
            "eif_gen_conf"
        end

feature -- Creation

    dynamic_type_from_string (class_type: STRING): INTEGER is
            -- Dynamic type corresponding to class_type.
            -- If no dynamic type available, returns -1.
        require
            class_type_not_void: class_type /= void
        local
            a: ANY
        do
            a := class_type.to_c
            Result := c_type_id ($a)
        ensure
            valid_result: Result = - 1 or else Result >= 0
        end

    new_instance_of (type_id: INTEGER): ANY is
            -- New instance of dynamic type_id.
            -- Note: returned object is not initialized and may
            -- hence violate its invariant.
        external
            "C [macro %"eif_macros.h%"]"
        alias
            "RTLN"
        end

feature -- Version

    compiler_version: INTEGER is
        external
            "C [macro %"eif_project.h%"]"
        alias
            "egc_compiler_tag"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERNAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERNAL Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to internal object properties.
        This class may be used as ancestor by classes needing its
        facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    INTERNAL

feature -- Access

    Bit_type: INTEGER is 8

    boolean_field (i: INTEGER; object: ANY): BOOLEAN
            -- Boolean value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    Boolean_type: INTEGER is 3

    character_field (i: INTEGER; object: ANY): CHARACTER
            -- Character value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    Character_type: INTEGER is 2

    class_name (object: ANY): STRING
            -- Name of the class associated with object
        require
            object_not_void: object /= void

    double_field (i: INTEGER; object: ANY): DOUBLE
            -- Double precision value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

    Double_type: INTEGER is 6

    dynamic_type (object: ANY): INTEGER
            -- Dynamic type of object
        require
            object_not_void: object /= void

    expanded_field_type (i: INTEGER; object: ANY): STRING
            -- Class name associated with the i-th
            -- expanded field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_expanded: field_type (i, object) = expanded_type
        ensure
            result_exists: Result /= void

    Expanded_type: INTEGER is 7

    field (i: INTEGER; object: ANY): ANY
            -- Object attached to the i-th field of object
            -- (directly or through a reference)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_name (i: INTEGER; object: ANY): STRING
            -- Name of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        ensure
            result_exists: Result /= void

    field_name_of_type (i: INTEGER; type_id: INTEGER): STRING
            -- Name of i-th field of dynamic type type_id.
        require
            index_large_enough: i >= 1
            index_small_enought: i <= field_count_of_type (type_id)

    field_offset (i: INTEGER; object: ANY): INTEGER
            -- Offset of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_type (i: INTEGER; object: ANY): INTEGER
            -- Type of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)

    field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER
            -- Type of i-th field of dynamic type type_id
        require
            index_large_enough: i >= 1
            index_small_enough: i <= field_count_of_type (type_id)

    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
            -- Dynamic type of generic parameter of object at
            -- position i.

    Integer_16_type: INTEGER is 10

    Integer_32_type: INTEGER is 4

    Integer_64_type: INTEGER is 11

    Integer_8_type: INTEGER is 9

    integer_field (i: INTEGER; object: ANY): INTEGER
            -- Integer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    Integer_type: INTEGER is 4

    pointer_field (i: INTEGER; object: ANY): POINTER
            -- Pointer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

    Pointer_type: INTEGER is 0

    real_field (i: INTEGER; object: ANY): REAL
            -- Real value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    Real_type: INTEGER is 5

    Reference_type: INTEGER is 1

    Wide_character_type: INTEGER is 12

feature -- Measurement

    bit_size (i: INTEGER; object: ANY): INTEGER
            -- Size (in bit) of the i-th bit field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_bit: field_type (i, object) = bit_type
        ensure
            positive_result: Result > 0

    field_count (object: ANY): INTEGER
            -- Number of logical fields in object
        require
            object_not_void: object /= void

    field_count_of_type (type_id: INTEGER): INTEGER
            -- Number of logical fields in dynamic type type_id.

    physical_size (object: ANY): INTEGER
            -- Space occupied by object in bytes
        require
            object_not_void: object /= void

feature -- Status report

    is_special (object: ANY): BOOLEAN
            -- Is object a special object?
            -- It only recognized a special object
            -- initialized within a TO_SPECIAL object.
        require
            object_not_void: object /= void

feature -- Element change

    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
            -- Set character value of i-th field of object to value
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

    set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

    set_real_field (i: INTEGER; object: ANY; value: REAL)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    set_reference_field (i: INTEGER; object: ANY; value: ANY)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            reference_field: field_type (i, object) = reference_type

feature -- Conformance

    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
            -- Is object an instance of type type_id?
        require
            object_not_void: object /= void

    type_conforms_to (type1, type2: INTEGER): BOOLEAN
            -- Does type1 conform to type2?

feature -- Creation

    dynamic_type_from_string (class_type: STRING): INTEGER
            -- Dynamic type corresponding to class_type.
            -- If no dynamic type available, returns -1.
        require
            class_type_not_void: class_type /= void
        ensure
            valid_result: Result = - 1 or else Result >= 0

    new_instance_of (type_id: INTEGER): ANY
            -- New instance of dynamic type_id.
            -- Note: returned object is not initialized and may
            -- hence violate its invariant.

feature -- Version

    compiler_version: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERNAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERNAL Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    INTERNAL

Ancestors
    ANY

Clients
    INTERNAL
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Suppliers
    ANY
    BOOLEAN
    INTEGER
    INTERNAL
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


INTERNAL Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Access to internal object properties.
        This class may be used as ancestor by classes needing its
        facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    INTERNAL

feature -- Conformance

    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
            -- Is object an instance of type type_id?
        require
            object_not_void: object /= void

    type_conforms_to (type1, type2: INTEGER): BOOLEAN
            -- Does type1 conform to type2?

feature -- Creation

    dynamic_type_from_string (class_type: STRING): INTEGER
            -- Dynamic type corresponding to class_type.
            -- If no dynamic type available, returns -1.
        require
            class_type_not_void: class_type /= void
        ensure
            valid_result: Result = - 1 or else Result >= 0

    new_instance_of (type_id: INTEGER): ANY
            -- New instance of dynamic type_id.
            -- Note: returned object is not initialized and may
            -- hence violate its invariant.

feature -- Access

    Pointer_type: INTEGER is 0

    Reference_type: INTEGER is 1

    Character_type: INTEGER is 2

    Boolean_type: INTEGER is 3

    Integer_type: INTEGER is 4

    Integer_32_type: INTEGER is 4

    Real_type: INTEGER is 5

    Double_type: INTEGER is 6

    Expanded_type: INTEGER is 7

    Bit_type: INTEGER is 8

    Integer_8_type: INTEGER is 9

    Integer_16_type: INTEGER is 10

    Integer_64_type: INTEGER is 11

    Wide_character_type: INTEGER is 12

    class_name (object: ANY): STRING
            -- Name of the class associated with object
        require
            object_not_void: object /= void

    dynamic_type (object: ANY): INTEGER
            -- Dynamic type of object
        require
            object_not_void: object /= void

    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
            -- Dynamic type of generic parameter of object at
            -- position i.

    field (i: INTEGER; object: ANY): ANY
            -- Object attached to the i-th field of object
            -- (directly or through a reference)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_name (i: INTEGER; object: ANY): STRING
            -- Name of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        ensure
            result_exists: Result /= void

    field_name_of_type (i: INTEGER; type_id: INTEGER): STRING
            -- Name of i-th field of dynamic type type_id.
        require
            index_large_enough: i >= 1
            index_small_enought: i <= field_count_of_type (type_id)

    field_offset (i: INTEGER; object: ANY): INTEGER
            -- Offset of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_type (i: INTEGER; object: ANY): INTEGER
            -- Type of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)

    field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER
            -- Type of i-th field of dynamic type type_id
        require
            index_large_enough: i >= 1
            index_small_enough: i <= field_count_of_type (type_id)

    expanded_field_type (i: INTEGER; object: ANY): STRING
            -- Class name associated with the i-th
            -- expanded field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_expanded: field_type (i, object) = expanded_type
        ensure
            result_exists: Result /= void

    character_field (i: INTEGER; object: ANY): CHARACTER
            -- Character value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    boolean_field (i: INTEGER; object: ANY): BOOLEAN
            -- Boolean value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    integer_field (i: INTEGER; object: ANY): INTEGER
            -- Integer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    real_field (i: INTEGER; object: ANY): REAL
            -- Real value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    pointer_field (i: INTEGER; object: ANY): POINTER
            -- Pointer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

    double_field (i: INTEGER; object: ANY): DOUBLE
            -- Double precision value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

feature -- Status report

    is_special (object: ANY): BOOLEAN
            -- Is object a special object?
            -- It only recognized a special object
            -- initialized within a TO_SPECIAL object.
        require
            object_not_void: object /= void

feature -- Version

    compiler_version: INTEGER

feature -- Element change

    set_reference_field (i: INTEGER; object: ANY; value: ANY)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            reference_field: field_type (i, object) = reference_type

    set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

    set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
            -- Set character value of i-th field of object to value
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    set_real_field (i: INTEGER; object: ANY; value: REAL)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

feature -- Measurement

    field_count (object: ANY): INTEGER
            -- Number of logical fields in object
        require
            object_not_void: object /= void

    field_count_of_type (type_id: INTEGER): INTEGER
            -- Number of logical fields in dynamic type type_id.

    bit_size (i: INTEGER; object: ANY): INTEGER
            -- Size (in bit) of the i-th bit field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_bit: field_type (i, object) = bit_type
        ensure
            positive_result: Result > 0

    physical_size (object: ANY): INTEGER
            -- Space occupied by object in bytes
        require
            object_not_void: object /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERNAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MATH_CONST Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical constants.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    MATH_CONST

feature {NONE} -- Access

    Pi: DOUBLE is 3.14159265358979323846

    Sqrt2: DOUBLE is 1.41421356237309504880
            -- Square root of 2

    Euler: DOUBLE is 2.7182818284590452354
            -- Logarithm base

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MATH_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MATH_CONST Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MATH_CONST

General
    cluster: base.support
    description:
        "Basic mathematical constants.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MATH_CONST Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical constants.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    MATH_CONST

feature {NONE} -- Access

    Euler: DOUBLE is 2.7182818284590452354
            -- Logarithm base

    Pi: DOUBLE is 3.14159265358979323846

    Sqrt2: DOUBLE is 1.41421356237309504880
            -- Square root of 2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MATH_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MATH_CONST Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical constants.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    MATH_CONST

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MATH_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MATH_CONST Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    MATH_CONST

Ancestors
    ANY

Descendants
    DOUBLE_MATH
    SINGLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


MATH_CONST Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical constants.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    MATH_CONST

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MATH_CONST

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


OPERATING_ENVIRONMENT Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the operating system"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    OPERATING_ENVIRONMENT

feature

    directory_separator: CHARACTER is
            -- Character used to separate subdirectories in a path name on this platform.
        once
            Result := c_dir_separator
        end

    current_directory_name_representation: STRING is
            -- Representation of the current directory
        once
            Result := eif_current_dir_representation
        end

    home_directory_supported: BOOLEAN is
            -- Is the notion of home directory supported on this platform?
        external
            "C | %"eif_path_name.h%""
        alias
            "eif_home_dir_supported"
        end

    root_directory_supported: BOOLEAN is
            -- Is the notion of root directory supported on this platform?
        external
            "C | %"eif_path_name.h%""
        alias
            "eif_root_dir_supported"
        end

    case_sensitive_path_names: BOOLEAN is
            -- Are path names case sensitive?
        external
            "C | %"eif_path_name.h%""
        alias
            "eif_case_sensitive_path_names"
        end

feature {NONE} -- Implementation

    c_dir_separator: CHARACTER is
        external
            "C | %"eif_dir.h%""
        alias
            "eif_dir_separator"
        end

    eif_current_dir_representation: STRING is
        external
            "C | %"eif_path_name.h%""
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class OPERATING_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


OPERATING_ENVIRONMENT Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    OPERATING_ENVIRONMENT

General
    cluster: base.support
    description: "The objects available from the operating system"

Ancestors
    ANY

Queries
    case_sensitive_path_names: BOOLEAN
    Current_directory_name_representation: STRING
    Directory_separator: CHARACTER
    home_directory_supported: BOOLEAN
    root_directory_supported: BOOLEAN

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


OPERATING_ENVIRONMENT Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the operating system"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    OPERATING_ENVIRONMENT

feature {NONE} -- Implementation

    c_dir_separator: CHARACTER is
        external
            "C | %"eif_dir.h%""
        alias
            "eif_dir_separator"
        end

    eif_current_dir_representation: STRING is
        external
            "C | %"eif_path_name.h%""
        end

feature

    case_sensitive_path_names: BOOLEAN is
            -- Are path names case sensitive?
        external
            "C | %"eif_path_name.h%""
        alias
            "eif_case_sensitive_path_names"
        end

    current_directory_name_representation: STRING is
            -- Representation of the current directory
        once
            Result := eif_current_dir_representation
        end

    directory_separator: CHARACTER is
            -- Character used to separate subdirectories in a path name on this platform.
        once
            Result := c_dir_separator
        end

    home_directory_supported: BOOLEAN is
            -- Is the notion of home directory supported on this platform?
        external
            "C | %"eif_path_name.h%""
        alias
            "eif_home_dir_supported"
        end

    root_directory_supported: BOOLEAN is
            -- Is the notion of root directory supported on this platform?
        external
            "C | %"eif_path_name.h%""
        alias
            "eif_root_dir_supported"
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class OPERATING_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


OPERATING_ENVIRONMENT Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the operating system"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    OPERATING_ENVIRONMENT

feature

    case_sensitive_path_names: BOOLEAN
            -- Are path names case sensitive?

    current_directory_name_representation: STRING
            -- Representation of the current directory

    directory_separator: CHARACTER
            -- Character used to separate subdirectories in a path name on this platform.

    home_directory_supported: BOOLEAN
            -- Is the notion of home directory supported on this platform?

    root_directory_supported: BOOLEAN
            -- Is the notion of root directory supported on this platform?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class OPERATING_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


OPERATING_ENVIRONMENT Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    OPERATING_ENVIRONMENT

Ancestors
    ANY

Clients
    ANY
    EXECUTION_ENVIRONMENT
    OPERATING_ENVIRONMENT

Suppliers
    OPERATING_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


OPERATING_ENVIRONMENT Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "The objects available from the operating system"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    OPERATING_ENVIRONMENT

feature

    directory_separator: CHARACTER
            -- Character used to separate subdirectories in a path name on this platform.

    current_directory_name_representation: STRING
            -- Representation of the current directory

    home_directory_supported: BOOLEAN
            -- Is the notion of home directory supported on this platform?

    root_directory_supported: BOOLEAN
            -- Is the notion of root directory supported on this platform?

    case_sensitive_path_names: BOOLEAN
            -- Are path names case sensitive?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class OPERATING_ENVIRONMENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIMES Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Prime number properties"
    status: "See notice at end of class"
    names: primes
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    PRIMES

inherit
    COUNTABLE_SEQUENCE [INTEGER]
        rename
            has as is_prime
        redefine
            is_prime,
            i_th
        end

feature -- Access

    Smallest_prime: INTEGER is 2

    Smallest_odd_prime: INTEGER is 3

    higher_prime (n: INTEGER): INTEGER is
            -- Lowest prime greater than or equal to n
        do
            if n <= smallest_prime then
                Result := smallest_prime
            else
                check
                    n > smallest_prime
                end
                from
                    if n \\ smallest_prime = 0 then
                        Result := n + 1
                    else
                        Result := n
                    end
                until
                    is_prime (Result)
                loop
                    Result := Result + smallest_prime
                end
            end
        end

    lower_prime (n: INTEGER): INTEGER is
            -- Greatest prime lower than or equal to n
        require
            argument_big_enough: n >= smallest_prime
        do
            if n = smallest_prime then
                Result := smallest_prime
            else
                from
                    if n \\ smallest_prime = 0 then
                        Result := n - 1
                    else
                        Result := n
                    end
                until
                    is_prime (Result)
                loop
                    Result := Result - smallest_prime
                end
            end
        end

    all_lower_primes (n: INTEGER): ARRAY [BOOLEAN] is
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is prime.
        local
            i, j: INTEGER
        do
            from
                create Result.make (1, n)
                i := 3
            until
                i > n
            loop
                Result.put (True, i)
                i := i + smallest_prime
            end
            if n >= smallest_prime then
                Result.put (True, smallest_prime)
            end
            from
                i := smallest_odd_prime
            until
                i * i > n
            loop
                if Result.item (i) then
                    from
                        j := i * i
                    until
                        j > n
                    loop
                        Result.put (False, j)
                        j := j + smallest_prime * i
                    end
                end
                i := i + smallest_prime
            end
        end

    is_prime (n: INTEGER): BOOLEAN is
            -- Is n a prime number?
        local
            divisor: INTEGER
        do
            if n <= 1 then
                Result := False
            elseif n = smallest_prime then
                Result := True
            elseif n \\ smallest_prime /= 0 then
                from
                    divisor := smallest_odd_prime
                until
                    (n \\ divisor = 0) or else (divisor * divisor >= n)
                loop
                    divisor := divisor + smallest_prime
                end;
                if divisor * divisor > n then
                    Result := True
                end
            end
        end

    i_th (i: INTEGER): INTEGER is
            -- The i-th prime number
        local
            candidates: ARRAY [BOOLEAN]
            found: INTEGER
        do
            candidates := all_lower_primes (i * i)
            from
                Result := 2
                found := 1
            variant
                i * i - Result
            until
                found = i
            loop
                Result := Result + 1
                if candidates.item (Result) then
                    found := found + 1
                end
            end
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIMES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIMES Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PRIMES

General
    cluster: base.support
    description: "Prime number properties"

Ancestors
    COUNTABLE_SEQUENCE [G]

Queries
    After: BOOLEAN
    all_lower_primes (n: INTEGER): ARRAY [BOOLEAN]
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    higher_prime (n: INTEGER): INTEGER
    i_th (i: INTEGER): INTEGER
    index: INTEGER
    index_of (v: [like item] INTEGER; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    is_prime (n: INTEGER): BOOLEAN
    item: INTEGER
    lower_prime (n: INTEGER): INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    Smallest_odd_prime: INTEGER
    Smallest_prime: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
    forth
    search (v: [like item] INTEGER)
    start

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIMES Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Prime number properties"
    status: "See notice at end of class"
    names: primes
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    PRIMES

feature -- Access

    all_lower_primes (n: INTEGER): ARRAY [BOOLEAN] is
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is prime.
        local
            i, j: INTEGER
        do
            from
                create Result.make (1, n)
                i := 3
            until
                i > n
            loop
                Result.put (True, i)
                i := i + smallest_prime
            end
            if n >= smallest_prime then
                Result.put (True, smallest_prime)
            end
            from
                i := smallest_odd_prime
            until
                i * i > n
            loop
                if Result.item (i) then
                    from
                        j := i * i
                    until
                        j > n
                    loop
                        Result.put (False, j)
                        j := j + smallest_prime * i
                    end
                end
                i := i + smallest_prime
            end
        end

    higher_prime (n: INTEGER): INTEGER is
            -- Lowest prime greater than or equal to n
        do
            if n <= smallest_prime then
                Result := smallest_prime
            else
                check
                    n > smallest_prime
                end
                from
                    if n \\ smallest_prime = 0 then
                        Result := n + 1
                    else
                        Result := n
                    end
                until
                    is_prime (Result)
                loop
                    Result := Result + smallest_prime
                end
            end
        end

    i_th (i: INTEGER): INTEGER is
            -- The i-th prime number
        require -- from COUNTABLE
            positive_argument: i > 0
        local
            candidates: ARRAY [BOOLEAN]
            found: INTEGER
        do
            candidates := all_lower_primes (i * i)
            from
                Result := 2
                found := 1
            variant
                i * i - Result
            until
                found = i
            loop
                Result := Result + 1
                if candidates.item (Result) then
                    found := found + 1
                end
            end
        end

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    is_prime (n: INTEGER): BOOLEAN is
            -- Is n a prime number?
        local
            divisor: INTEGER
        do
            if n <= 1 then
                Result := False
            elseif n = smallest_prime then
                Result := True
            elseif n \\ smallest_prime /= 0 then
                from
                    divisor := smallest_odd_prime
                until
                    (n \\ divisor = 0) or else (divisor * divisor >= n)
                loop
                    divisor := divisor + smallest_prime
                end;
                if divisor * divisor > n then
                    Result := True
                end
            end
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        end

    item: INTEGER is
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := i_th (index)
        end

    lower_prime (n: INTEGER): INTEGER is
            -- Greatest prime lower than or equal to n
        require
            argument_big_enough: n >= smallest_prime
        do
            if n = smallest_prime then
                Result := smallest_prime
            else
                from
                    if n \\ smallest_prime = 0 then
                        Result := n - 1
                    else
                        Result := n
                    end
                until
                    is_prime (Result)
                loop
                    Result := Result - smallest_prime
                end
            end
        end

    occurrences (v: INTEGER): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    Smallest_odd_prime: INTEGER is 3

    Smallest_prime: INTEGER is 2

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := is_prime (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after
        do
            index := index + 1
        end

    start is
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)
        do
            index := 1
        end

feature {NONE} -- Element change

    fill (other: CONTAINER [INTEGER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [INTEGER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

feature {NONE} -- Removal

    prune_all (v: INTEGER) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not is_prime (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not is_prime (v)
        end

feature {NONE} -- Inapplicable

    extend (v: INTEGER) is
            -- Add v at end.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    finish is
            -- Move to last position.
            -- (from COUNTABLE_SEQUENCE)
        do
        ensure then -- from COUNTABLE_SEQUENCE
            failure: False
        end

    linear_representation: LINEAR [INTEGER] is
            -- Representation as a linear structure
            -- (from COUNTABLE_SEQUENCE)
        do
        end

    prune (v: INTEGER) is
            -- Remove first occurrence of v, if any.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
        end

    put (v: INTEGER) is
            -- Add v to the right of current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove item to the right of current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

    replace (v: INTEGER) is
            -- Replace by v item at current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from ACTIVE
            writable: writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        end

    wipe_out is
            -- Remove all items.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            prunable
        do
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [INTEGER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [INTEGER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [INTEGER]
            c: CURSOR
            t: TUPLE [INTEGER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [INTEGER]
            c: CURSOR
            t: TUPLE [INTEGER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIMES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIMES Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Prime number properties"
    status: "See notice at end of class"
    names: primes
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    PRIMES

feature -- Access

    all_lower_primes (n: INTEGER): ARRAY [BOOLEAN]
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is prime.

    higher_prime (n: INTEGER): INTEGER
            -- Lowest prime greater than or equal to n

    i_th (i: INTEGER): INTEGER
            -- The i-th prime number
        require -- from COUNTABLE
            positive_argument: i > 0

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    is_prime (n: INTEGER): BOOLEAN
            -- Is n a prime number?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: INTEGER
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    lower_prime (n: INTEGER): INTEGER
            -- Greatest prime lower than or equal to n
        require
            argument_big_enough: n >= smallest_prime

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    Smallest_odd_prime: INTEGER is 3

    Smallest_prime: INTEGER is 2

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIMES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIMES Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PRIMES

Ancestors
    COUNTABLE_SEQUENCE [G]

Clients
    HASH_TABLE [G, H -> HASHABLE]
    PRIMES

Suppliers
    ARRAY [G]
    BOOLEAN
    INTEGER
    PRIMES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PRIMES Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Prime number properties"
    status: "See notice at end of class"
    names: primes
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    PRIMES

feature -- Access

    Smallest_prime: INTEGER is 2

    Smallest_odd_prime: INTEGER is 3

    higher_prime (n: INTEGER): INTEGER
            -- Lowest prime greater than or equal to n

    lower_prime (n: INTEGER): INTEGER
            -- Greatest prime lower than or equal to n
        require
            argument_big_enough: n >= smallest_prime

    all_lower_primes (n: INTEGER): ARRAY [BOOLEAN]
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is prime.

    is_prime (n: INTEGER): BOOLEAN
            -- Is n a prime number?

    i_th (i: INTEGER): INTEGER
            -- The i-th prime number

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIMES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROFILING_SETTING Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Objects that manage the Eiffel profiler. You can start and
            stop the Eiffel profiler whenever you want to. It only works
            if `profile (yes)' is enabled in your Ace file.
    ]"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    PROFILING_SETTING

create
    make

feature -- Initialization

    make is
            -- Compute value of is_profiler_enabled for all instances of
            -- Current class.
        local
            tmp: BOOLEAN
        do
            tmp := is_profiler_enabled
        end

feature -- Status report

    is_profiling: BOOLEAN is
            -- Is profiler currently enabled?
        do
            Result := c_prof_enabled > 0
        end

feature -- Status setting

    start_profiling is
            -- Start profiling.
        do
            if is_profiler_enabled then
                set_prof_enabled
            end
        end

    stop_profiling is
            -- Stop profiling
        do
            if is_profiler_enabled then
                set_prof_disabled
            end
        end

feature -- Validity

    is_profiler_enabled: BOOLEAN is
            -- Is profiler enabled upon launch time?
        once
            Result := is_profiling
        end

feature {NONE} -- Implementation

    c_prof_enabled: INTEGER is
            -- C variables which gives the status on the profiler.
        external
            "C [macro %"eif_project.h%"]"
        alias
            "egc_prof_enabled"
        end

    set_prof_enabled is
            -- Enable profiler.
        external
            "C [macro %"eif_eiffel.h%"]"
        alias
            "egc_prof_enabled = 3"
        end

    set_prof_disabled is
            -- Disable profiler.
        external
            "C [macro %"eif_eiffel.h%"]"
        alias
            "egc_prof_enabled = 0"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROFILING_SETTING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROFILING_SETTING Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PROFILING_SETTING

General
    cluster: base.support
    description:
        "Objects that manage the Eiffel profiler. You can start and
        stop the Eiffel profiler whenever you want to. It only works
        if `profile (yes)' is enabled in your Ace file."
    create: make

Ancestors
    ANY

Queries
    Is_profiler_enabled: BOOLEAN
    is_profiling: BOOLEAN

Commands
    make
    start_profiling
    stop_profiling

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROFILING_SETTING Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Objects that manage the Eiffel profiler. You can start and
            stop the Eiffel profiler whenever you want to. It only works
            if `profile (yes)' is enabled in your Ace file.
    ]"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    PROFILING_SETTING

create
    make

feature -- Initialization

    make is
            -- Compute value of is_profiler_enabled for all instances of
            -- Current class.
        local
            tmp: BOOLEAN
        do
            tmp := is_profiler_enabled
        end

feature -- Status report

    is_profiling: BOOLEAN is
            -- Is profiler currently enabled?
        do
            Result := c_prof_enabled > 0
        end

feature -- Status setting

    start_profiling is
            -- Start profiling.
        do
            if is_profiler_enabled then
                set_prof_enabled
            end
        end

    stop_profiling is
            -- Stop profiling
        do
            if is_profiler_enabled then
                set_prof_disabled
            end
        end

feature {NONE} -- Implementation

    c_prof_enabled: INTEGER is
            -- C variables which gives the status on the profiler.
        external
            "C [macro %"eif_project.h%"]"
        alias
            "egc_prof_enabled"
        end

    set_prof_disabled is
            -- Disable profiler.
        external
            "C [macro %"eif_eiffel.h%"]"
        alias
            "egc_prof_enabled = 0"
        end

    set_prof_enabled is
            -- Enable profiler.
        external
            "C [macro %"eif_eiffel.h%"]"
        alias
            "egc_prof_enabled = 3"
        end

feature -- Validity

    is_profiler_enabled: BOOLEAN is
            -- Is profiler enabled upon launch time?
        once
            Result := is_profiling
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROFILING_SETTING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROFILING_SETTING Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Objects that manage the Eiffel profiler. You can start and
            stop the Eiffel profiler whenever you want to. It only works
            if `profile (yes)' is enabled in your Ace file.
    ]"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    PROFILING_SETTING

create

    make
            -- Compute value of is_profiler_enabled for all instances of
            -- Current class.

feature -- Initialization

    make
            -- Compute value of is_profiler_enabled for all instances of
            -- Current class.

feature -- Status report

    is_profiling: BOOLEAN
            -- Is profiler currently enabled?

feature -- Status setting

    start_profiling
            -- Start profiling.

    stop_profiling
            -- Stop profiling

feature -- Validity

    is_profiler_enabled: BOOLEAN
            -- Is profiler enabled upon launch time?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROFILING_SETTING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROFILING_SETTING Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PROFILING_SETTING

Ancestors
    ANY

Clients
    PROFILING_SETTING

Suppliers
    INTEGER
    PROFILING_SETTING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PROFILING_SETTING Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
            Objects that manage the Eiffel profiler. You can start and
            stop the Eiffel profiler whenever you want to. It only works
            if `profile (yes)' is enabled in your Ace file.
    ]"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    PROFILING_SETTING

create
    make

feature -- Initialization

    make
            -- Compute value of is_profiler_enabled for all instances of
            -- Current class.

feature -- Status report

    is_profiling: BOOLEAN
            -- Is profiler currently enabled?

feature -- Status setting

    start_profiling
            -- Start profiling.

    stop_profiling
            -- Stop profiling

feature -- Validity

    is_profiler_enabled: BOOLEAN
            -- Is profiler enabled upon launch time?

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROFILING_SETTING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RANDOM Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Pseudo-random number sequence, linear congruential method"
    status: "See notice at end of class"
    names: random
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    RANDOM

inherit
    COUNTABLE_SEQUENCE [INTEGER]
        redefine
            has
        end

    DOUBLE_MATH
        export
            {NONE} all
        end

create
    make,
    set_seed

feature -- Initialization

    make is
            -- Initialize structure using a default seed.
        do
            set_seed (default_seed)
        ensure
            seed_set: seed = default_seed
        end

    set_seed (s: INTEGER) is
            -- Initialize sequence using s as the seed.
        require
            non_negative: s >= 0
        do
            seed := s
            last_result := seed
            last_item := 0
        ensure
            seed_set: seed = s
        end

feature -- Access

    default_seed: INTEGER is
            -- Default value 123,457;
            -- may be redefined for a new generator.
        once
            Result := 123457
        end

    modulus: INTEGER is
            -- Default value 2^31 -1 = 2,147,483,647;
            -- may be redefined for a new generator.
        once
            Result := 2147483647
        end

    multiplier: INTEGER is
            -- Default value 7^5 = 16,807;
            -- may be redefined for a new generator.
        once
            Result := 16807
        end

    increment: INTEGER is
            -- Default value 0;
            -- may be redefined for a new generator.
        once
            Result := 0
        end

    seed: INTEGER
            -- Seed for sequence.

    next_random (n: INTEGER): INTEGER is
            -- Next random number after n
            -- in pseudo-random order
        require
            in_range: (n < modulus) and (n >= 0)
        do
            Result := randomize (n)
        ensure
            in_range: (Result < modulus) and (Result >= 0)
        end

    has (n: INTEGER): BOOLEAN is
            -- Will n be part of the random number sequence?
        do
            Result := (n < modulus) and (n >= 0)
        ensure then
            only_: Result = (n < modulus and n >= 0)
        end

    i_th (i: INTEGER): INTEGER is
            -- The i-th random number
        local
            count: INTEGER
        do
            if i >= last_item then
                Result := last_result
                count := last_item
            else
                Result := seed
            end
            from
            until
                count = i
            loop
                Result := randomize (Result)
                count := count + 1
            end
            last_result := Result
            last_item := i
        ensure then
            in_range: (Result < modulus) and (Result >= 0)
        end

    real_item: REAL is
            -- The current random number as a real between 0 and 1
        local
            r1, r2: REAL
        do
            r1 := item
            r2 := modulus
            Result := r1 / r2
        end

    double_item: DOUBLE is
            -- The current random number as a double between 0 and 1
        local
            d: DOUBLE
        do
            d := item
            Result := d / dmod
        end

    real_i_th (i: INTEGER): REAL is
            -- The i-th random number as a real between 0 and 1
        local
            r1, r2: REAL
        do
            r1 := i_th (i)
            r2 := modulus
            Result := r1 / r2
        end

    double_i_th (i: INTEGER): DOUBLE is
            -- The i-th random number as a double between 0 and 1
        local
            d: DOUBLE
        do
            d := i_th (i)
            Result := d / dmod
        end

feature {NONE} -- Implementation

    randomize (xn: INTEGER): INTEGER is
            -- Next item
        local
            x: DOUBLE
        do
            x := double_mod (dmul * xn + dinc, dmod)
            Result := x.truncated_to_integer
        end

    double_mod (x, m: DOUBLE): DOUBLE is
            -- x modulo m
        do
            Result := x - (floor (x / m) * m)
        end

    last_item: INTEGER
            -- Last item requested

    last_result: INTEGER
            -- Value from last call to item

    dmod: DOUBLE is
            -- Double value for modulus
        once
            Result := modulus
        end

    dmul: DOUBLE is
            -- Double value for multiplier
        once
            Result := multiplier
        end

    dinc: DOUBLE is
            -- Double value for increment
        once
            Result := increment
        end

invariant

    non_negative_seed: seed >= 0
    non_negative_increment: increment >= 0
    positive_multiplier: multiplier > 0
    modulus_constraint: modulus > 1

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RANDOM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RANDOM Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    RANDOM

General
    cluster: base.support
    description: "Pseudo-random number sequence, linear congruential method"
    create: set_seed, make

Ancestors
    COUNTABLE_SEQUENCE [G]
    DOUBLE_MATH

Queries
    After: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    Default_seed: INTEGER
    double_i_th (i: INTEGER): DOUBLE
    double_item: DOUBLE
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (n: INTEGER): BOOLEAN
    i_th (i: INTEGER): INTEGER
    Increment: INTEGER
    index: INTEGER
    index_of (v: [like item] INTEGER; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item: INTEGER
    Modulus: INTEGER
    Multiplier: INTEGER
    next_random (n: INTEGER): INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    real_i_th (i: INTEGER): REAL
    real_item: REAL
    seed: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
    forth
    make
    search (v: [like item] INTEGER)
    set_seed (s: INTEGER)
    start

Constraints
    non negative seed
    non negative increment
    positive multiplier
    modulus constraint

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RANDOM Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Pseudo-random number sequence, linear congruential method"
    status: "See notice at end of class"
    names: random
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    RANDOM

create
    make,
    set_seed

feature -- Initialization

    make is
            -- Initialize structure using a default seed.
        do
            set_seed (default_seed)
        ensure
            seed_set: seed = default_seed
        end

    set_seed (s: INTEGER) is
            -- Initialize sequence using s as the seed.
        require
            non_negative: s >= 0
        do
            seed := s
            last_result := seed
            last_item := 0
        ensure
            seed_set: seed = s
        end

feature -- Access

    default_seed: INTEGER is
            -- Default value 123,457;
            -- may be redefined for a new generator.
        once
            Result := 123457
        end

    double_i_th (i: INTEGER): DOUBLE is
            -- The i-th random number as a double between 0 and 1
        local
            d: DOUBLE
        do
            d := i_th (i)
            Result := d / dmod
        end

    double_item: DOUBLE is
            -- The current random number as a double between 0 and 1
        local
            d: DOUBLE
        do
            d := item
            Result := d / dmod
        end

    has (n: INTEGER): BOOLEAN is
            -- Will n be part of the random number sequence?
        do
            Result := (n < modulus) and (n >= 0)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then
            only_: Result = (n < modulus and n >= 0)
        end

    i_th (i: INTEGER): INTEGER is
            -- The i-th random number
        require -- from COUNTABLE
            positive_argument: i > 0
        local
            count: INTEGER
        do
            if i >= last_item then
                Result := last_result
                count := last_item
            else
                Result := seed
            end
            from
            until
                count = i
            loop
                Result := randomize (Result)
                count := count + 1
            end
            last_result := Result
            last_item := i
        ensure then
            in_range: (Result < modulus) and (Result >= 0)
        end

    increment: INTEGER is
            -- Default value 0;
            -- may be redefined for a new generator.
        once
            Result := 0
        end

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER is
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        local
            occur, pos: INTEGER
        do
            if object_comparison and v /= void then
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item /= void and then v.is_equal (item) then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            else
                from
                    start
                    pos := 1
                until
                    off or (occur = i)
                loop
                    if item = v then
                        occur := occur + 1
                    end
                    forth
                    pos := pos + 1
                end
            end
            if occur = i then
                Result := pos - 1
            end
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        end

    item: INTEGER is
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        do
            Result := i_th (index)
        end

    modulus: INTEGER is
            -- Default value 2^31 -1 = 2,147,483,647;
            -- may be redefined for a new generator.
        once
            Result := 2147483647
        end

    multiplier: INTEGER is
            -- Default value 7^5 = 16,807;
            -- may be redefined for a new generator.
        once
            Result := 16807
        end

    next_random (n: INTEGER): INTEGER is
            -- Next random number after n
            -- in pseudo-random order
        require
            in_range: (n < modulus) and (n >= 0)
        do
            Result := randomize (n)
        ensure
            in_range: (Result < modulus) and (Result >= 0)
        end

    occurrences (v: INTEGER): INTEGER is
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        do
            from
                start
                search (v)
            until
                exhausted
            loop
                Result := Result + 1
                forth
                search (v)
            end
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        end

    real_i_th (i: INTEGER): REAL is
            -- The i-th random number as a real between 0 and 1
        local
            r1, r2: REAL
        do
            r1 := i_th (i)
            r2 := modulus
            Result := r1 / r2
        end

    real_item: REAL is
            -- The current random number as a real between 0 and 1
        local
            r1, r2: REAL
        do
            r1 := item
            r2 := modulus
            Result := r1 / r2
        end

    search (v: like item) is
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        do
            if object_comparison and v /= void then
                from
                until
                    exhausted or else (item /= void and then v.is_equal (item))
                loop
                    forth
                end
            else
                from
                until
                    exhausted or else v = item
                loop
                    forth
                end
            end
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item
        end

    seed: INTEGER
            -- Seed for sequence.

feature {NONE} -- Access

    arc_cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "acos"
        end

    arc_sine (v: DOUBLE): DOUBLE is
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "asin"
        end

    arc_tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "atan"
        end

    ceiling (v: DOUBLE): DOUBLE is
            -- Least integral greater than or equal to v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "ceil"
        end

    cosine (v: DOUBLE): DOUBLE is
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "cos"
        end

    dabs (v: DOUBLE): DOUBLE is
            -- Absolute of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "fabs"
        end

    Euler: DOUBLE is 2.7182818284590452354
            -- Logarithm base
            -- (from MATH_CONST)

    exp (x: DOUBLE): DOUBLE is
            -- Exponential of v.
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    floor (v: DOUBLE): DOUBLE is
            -- Greatest integral less than or equal to v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    log (v: DOUBLE): DOUBLE is
            -- Natural logarithm of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    log10 (v: DOUBLE): DOUBLE is
            -- Base 10 logarithm of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    log_2 (v: DOUBLE): DOUBLE is
            -- Base 2 logarithm of v
            -- (from DOUBLE_MATH)
        local
            a: DOUBLE
        do
            a := 2.0
            Result := log (v) / log (a)
        end

    Pi: DOUBLE is 3.14159265358979323846
            -- (from MATH_CONST)

    sine (v: DOUBLE): DOUBLE is
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "sin"
        end

    sqrt (v: DOUBLE): DOUBLE is
            -- Square root of v
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        end

    Sqrt2: DOUBLE is 1.41421356237309504880
            -- Square root of 2
            -- (from MATH_CONST)

    tangent (v: DOUBLE): DOUBLE is
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)
        external
            "C | <math.h>"
        alias
            "tan"
        end

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN is
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        do
            Result := True
        end

    empty: BOOLEAN is
        obsolete "ELKS 2000: Use `is_empty' instead"
            -- Is there no element?
            -- (from CONTAINER)
        do
            Result := is_empty
        end

    exhausted: BOOLEAN is
            -- Has structure been completely explored?
            -- (from LINEAR)
        do
            Result := off
        ensure -- from LINEAR
            exhausted_when_off: off implies Result
        end

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN is
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)
        do
            Result := has (v)
        end

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN is
            -- Is there no current item?
            -- (from LINEAR)
        do
            Result := is_empty or after
        end

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects is
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := True
        ensure -- from CONTAINER
            object_comparison
        end

    compare_references is
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        do
            object_comparison := False
        ensure -- from CONTAINER
            reference_comparison: not object_comparison
        end

feature -- Cursor movement

    forth is
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after
        do
            index := index + 1
        end

    start is
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)
        do
            index := 1
        end

feature {NONE} -- Element change

    fill (other: CONTAINER [INTEGER]) is
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible
        local
            lin_rep: LINEAR [INTEGER]
        do
            lin_rep := other.linear_representation
            from
                lin_rep.start
            until
                not extendible or else lin_rep.off
            loop
                extend (lin_rep.item)
                lin_rep.forth
            end
        end

feature {NONE} -- Removal

    prune_all (v: INTEGER) is
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        do
            from
            until
                not has (v)
            loop
                prune (v)
            end
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        end

feature {NONE} -- Inapplicable

    extend (v: INTEGER) is
            -- Add v at end.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        end

    finish is
            -- Move to last position.
            -- (from COUNTABLE_SEQUENCE)
        do
        ensure then -- from COUNTABLE_SEQUENCE
            failure: False
        end

    linear_representation: LINEAR [INTEGER] is
            -- Representation as a linear structure
            -- (from COUNTABLE_SEQUENCE)
        do
        end

    prune (v: INTEGER) is
            -- Remove first occurrence of v, if any.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            prunable: prunable
        do
        end

    put (v: INTEGER) is
            -- Add v to the right of current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        do
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        end

    remove is
            -- Remove item to the right of current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        do
        end

    replace (v: INTEGER) is
            -- Replace by v item at current position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from ACTIVE
            writable: writable
        do
        ensure -- from ACTIVE
            item_replaced: item = v
        end

    wipe_out is
            -- Remove all items.
            -- (from COUNTABLE_SEQUENCE)
        require -- from COLLECTION
            prunable
        do
        ensure -- from COLLECTION
            wiped_out: is_empty
        end

feature {NONE} -- Implementation

    dinc: DOUBLE is
            -- Double value for increment
        once
            Result := increment
        end

    dmod: DOUBLE is
            -- Double value for modulus
        once
            Result := modulus
        end

    dmul: DOUBLE is
            -- Double value for multiplier
        once
            Result := multiplier
        end

    double_mod (x, m: DOUBLE): DOUBLE is
            -- x modulo m
        do
            Result := x - (floor (x / m) * m)
        end

    last_item: INTEGER
            -- Last item requested

    last_result: INTEGER
            -- Value from last call to item

    randomize (xn: INTEGER): INTEGER is
            -- Next item
        local
            x: DOUBLE
        do
            x := double_mod (dmul * xn + dinc, dmod)
            Result := x.truncated_to_integer
        end

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]]) is
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
        local
            t: TUPLE [INTEGER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                action.call (t)
                forth
            end
        end

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]) is
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void
        local
            t: TUPLE [INTEGER]
        do
            create t.make
            from
                start
            until
                after
            loop
                t.put (item, 1)
                if test.item (t) then
                    action.call (t)
                end
                forth
            end
        end

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [INTEGER]
            c: CURSOR
            t: TUPLE [INTEGER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
                Result := True
            until
                after or not Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN is
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void
        local
            cs: CURSOR_STRUCTURE [INTEGER]
            c: CURSOR
            t: TUPLE [INTEGER]
        do
            create t.make
            cs ?= Current
            if cs /= void then
                c := cs.cursor
            end
            from
                start
            until
                after or Result
            loop
                t.put (item, 1)
                Result := test.item (t)
                forth
            end
            if cs /= void then
                cs.go_to (c)
            end
        end

invariant

    non_negative_seed: seed >= 0
    non_negative_increment: increment >= 0
    positive_multiplier: multiplier > 0
    modulus_constraint: modulus > 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RANDOM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RANDOM Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Pseudo-random number sequence, linear congruential method"
    status: "See notice at end of class"
    names: random
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    RANDOM

create

    make
            -- Initialize structure using a default seed.
        ensure
            seed_set: seed = default_seed

    set_seed (s: INTEGER)
            -- Initialize sequence using s as the seed.
        require
            non_negative: s >= 0
        ensure
            seed_set: seed = s

feature -- Initialization

    make
            -- Initialize structure using a default seed.
        ensure
            seed_set: seed = default_seed

    set_seed (s: INTEGER)
            -- Initialize sequence using s as the seed.
        require
            non_negative: s >= 0
        ensure
            seed_set: seed = s

feature -- Access

    default_seed: INTEGER
            -- Default value 123,457;
            -- may be redefined for a new generator.

    double_i_th (i: INTEGER): DOUBLE
            -- The i-th random number as a double between 0 and 1

    double_item: DOUBLE
            -- The current random number as a double between 0 and 1

    has (n: INTEGER): BOOLEAN
            -- Will n be part of the random number sequence?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then
            only_: Result = (n < modulus and n >= 0)

    i_th (i: INTEGER): INTEGER
            -- The i-th random number
        require -- from COUNTABLE
            positive_argument: i > 0
        ensure then
            in_range: (Result < modulus) and (Result >= 0)

    increment: INTEGER
            -- Default value 0;
            -- may be redefined for a new generator.

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: INTEGER
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    modulus: INTEGER
            -- Default value 2^31 -1 = 2,147,483,647;
            -- may be redefined for a new generator.

    multiplier: INTEGER
            -- Default value 7^5 = 16,807;
            -- may be redefined for a new generator.

    next_random (n: INTEGER): INTEGER
            -- Next random number after n
            -- in pseudo-random order
        require
            in_range: (n < modulus) and (n >= 0)
        ensure
            in_range: (Result < modulus) and (Result >= 0)

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    real_i_th (i: INTEGER): REAL
            -- The i-th random number as a real between 0 and 1

    real_item: REAL
            -- The current random number as a real between 0 and 1

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    seed: INTEGER
            -- Seed for sequence.

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_seed: seed >= 0
    non_negative_increment: increment >= 0
    positive_multiplier: multiplier > 0
    modulus_constraint: modulus > 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RANDOM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RANDOM Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    RANDOM

Ancestors
    COUNTABLE_SEQUENCE [G]
    DOUBLE_MATH

Clients
    RANDOM

Suppliers
    BOOLEAN
    DOUBLE
    INTEGER
    RANDOM
    REAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


RANDOM Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "Pseudo-random number sequence, linear congruential method"
    status: "See notice at end of class"
    names: random
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    RANDOM

create
    make,
    set_seed

feature -- Initialization

    make
            -- Initialize structure using a default seed.
        ensure
            seed_set: seed = default_seed

    set_seed (s: INTEGER)
            -- Initialize sequence using s as the seed.
        require
            non_negative: s >= 0
        ensure
            seed_set: seed = s

feature -- Access

    default_seed: INTEGER
            -- Default value 123,457;
            -- may be redefined for a new generator.

    modulus: INTEGER
            -- Default value 2^31 -1 = 2,147,483,647;
            -- may be redefined for a new generator.

    multiplier: INTEGER
            -- Default value 7^5 = 16,807;
            -- may be redefined for a new generator.

    increment: INTEGER
            -- Default value 0;
            -- may be redefined for a new generator.

    seed: INTEGER
            -- Seed for sequence.

    next_random (n: INTEGER): INTEGER
            -- Next random number after n
            -- in pseudo-random order
        require
            in_range: (n < modulus) and (n >= 0)
        ensure
            in_range: (Result < modulus) and (Result >= 0)

    has (n: INTEGER): BOOLEAN
            -- Will n be part of the random number sequence?
        ensure then
            only_: Result = (n < modulus and n >= 0)

    i_th (i: INTEGER): INTEGER
            -- The i-th random number
        ensure then
            in_range: (Result < modulus) and (Result >= 0)

    real_item: REAL
            -- The current random number as a real between 0 and 1

    double_item: DOUBLE
            -- The current random number as a double between 0 and 1

    real_i_th (i: INTEGER): REAL
            -- The i-th random number as a real between 0 and 1

    double_i_th (i: INTEGER): DOUBLE
            -- The i-th random number as a double between 0 and 1

invariant

    non_negative_seed: seed >= 0
    non_negative_increment: increment >= 0
    positive_multiplier: multiplier > 0
    modulus_constraint: modulus > 1

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RANDOM

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SINGLE_MATH Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, single-precision.
        This class may be used as ancestor by classes needing its facilities
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    SINGLE_MATH

inherit
    MATH_CONST

feature -- Access

    log_2 (v: REAL): REAL is
            -- Base 2 logarithm of v
        require
            v > 0.0
        do
            Result := log (v) / log (2.0)
        end

    cosine (v: REAL): REAL is
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]
        do
            Result := math_rcos (v)
        end

    arc_cosine (v: REAL): REAL is
            -- Trigonometric arccosine of v
        do
            Result := math_racos (v)
        end

    sine (v: REAL): REAL is
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]
        do
            Result := math_rsin (v)
        end

    arc_sine (v: REAL): REAL is
            -- Trigonometric arcsine of v
        do
            Result := math_rasin (v)
        end

    tangent (v: REAL): REAL is
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]
        do
            Result := math_rtan (v)
        end

    arc_tangent (v: REAL): REAL is
            -- Trigonometric arctangent of v
        do
            Result := math_ratan (v)
        end

    sqrt (v: REAL): REAL is
            -- Square root of v
        require
            v >= 0.0
        do
            Result := math_rsqrt (v)
        end

    log (v: REAL): REAL is
            -- Natural logarithm of v
        require
            v > 0.0
        do
            Result := math_rlog (v)
        end

    log10 (v: REAL): REAL is
            -- Base 10 logarithm of v
        require
            v > 0.0
        do
            Result := math_rlog10 (v)
        end

    floor (v: REAL): REAL is
            -- Greatest integral value less than or equal to v
        do
            Result := math_rfloor (v)
        end

    ceiling (v: REAL): REAL is
            -- Least integral value greater than or equal to v
        do
            Result := math_rceil (v)
        end

feature {NONE} -- Implementation

    rabs (v: REAL): REAL is
            -- Absolute value of v
        do
            Result := math_rfabs (v)
        end

    math_rcos (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_cos"
        end

    math_racos (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_acos"
        end

    math_rfabs (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_fabs"
        end

    math_rceil (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_ceil"
        end

    math_rfloor (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_floor"
        end

    math_rlog10 (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_log10"
        end

    math_rlog (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_log"
        end

    math_rsqrt (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_sqrt"
        end

    math_rtan (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_tan"
        end

    math_ratan (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_atan"
        end

    math_rsin (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_sin"
        end

    math_rasin (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_asin"
        end

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SINGLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SINGLE_MATH Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SINGLE_MATH

General
    cluster: base.support
    description:
        "Basic mathematical operations, single-precision.
        This class may be used as ancestor by classes needing its facilities"

Ancestors
    MATH_CONST

Queries
    arc_cosine (v: REAL): REAL
    arc_sine (v: REAL): REAL
    arc_tangent (v: REAL): REAL
    ceiling (v: REAL): REAL
    cosine (v: REAL): REAL
    floor (v: REAL): REAL
    log (v: REAL): REAL
    log10 (v: REAL): REAL
    log_2 (v: REAL): REAL
    sine (v: REAL): REAL
    sqrt (v: REAL): REAL
    tangent (v: REAL): REAL

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SINGLE_MATH Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, single-precision.
        This class may be used as ancestor by classes needing its facilities
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class
    SINGLE_MATH

feature -- Access

    arc_cosine (v: REAL): REAL is
            -- Trigonometric arccosine of v
        do
            Result := math_racos (v)
        end

    arc_sine (v: REAL): REAL is
            -- Trigonometric arcsine of v
        do
            Result := math_rasin (v)
        end

    arc_tangent (v: REAL): REAL is
            -- Trigonometric arctangent of v
        do
            Result := math_ratan (v)
        end

    ceiling (v: REAL): REAL is
            -- Least integral value greater than or equal to v
        do
            Result := math_rceil (v)
        end

    cosine (v: REAL): REAL is
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]
        do
            Result := math_rcos (v)
        end

    floor (v: REAL): REAL is
            -- Greatest integral value less than or equal to v
        do
            Result := math_rfloor (v)
        end

    log (v: REAL): REAL is
            -- Natural logarithm of v
        require
            v > 0.0
        do
            Result := math_rlog (v)
        end

    log10 (v: REAL): REAL is
            -- Base 10 logarithm of v
        require
            v > 0.0
        do
            Result := math_rlog10 (v)
        end

    log_2 (v: REAL): REAL is
            -- Base 2 logarithm of v
        require
            v > 0.0
        do
            Result := log (v) / log (2.0)
        end

    sine (v: REAL): REAL is
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]
        do
            Result := math_rsin (v)
        end

    sqrt (v: REAL): REAL is
            -- Square root of v
        require
            v >= 0.0
        do
            Result := math_rsqrt (v)
        end

    tangent (v: REAL): REAL is
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]
        do
            Result := math_rtan (v)
        end

feature {NONE} -- Access

    Euler: DOUBLE is 2.7182818284590452354
            -- Logarithm base
            -- (from MATH_CONST)

    Pi: DOUBLE is 3.14159265358979323846
            -- (from MATH_CONST)

    Sqrt2: DOUBLE is 1.41421356237309504880
            -- Square root of 2
            -- (from MATH_CONST)

feature {NONE} -- Implementation

    math_racos (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_acos"
        end

    math_rasin (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_asin"
        end

    math_ratan (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_atan"
        end

    math_rceil (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_ceil"
        end

    math_rcos (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_cos"
        end

    math_rfabs (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_fabs"
        end

    math_rfloor (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_floor"
        end

    math_rlog (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_log"
        end

    math_rlog10 (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_log10"
        end

    math_rsin (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_sin"
        end

    math_rsqrt (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_sqrt"
        end

    math_rtan (v: REAL): REAL is
        external
            "C [macro %"eif_misc.h%"]"
        alias
            "float_tan"
        end

    rabs (v: REAL): REAL is
            -- Absolute value of v
        do
            Result := math_rfabs (v)
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SINGLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SINGLE_MATH Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, single-precision.
        This class may be used as ancestor by classes needing its facilities
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    SINGLE_MATH

feature -- Access

    arc_cosine (v: REAL): REAL
            -- Trigonometric arccosine of v

    arc_sine (v: REAL): REAL
            -- Trigonometric arcsine of v

    arc_tangent (v: REAL): REAL
            -- Trigonometric arctangent of v

    ceiling (v: REAL): REAL
            -- Least integral value greater than or equal to v

    cosine (v: REAL): REAL
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]

    floor (v: REAL): REAL
            -- Greatest integral value less than or equal to v

    log (v: REAL): REAL
            -- Natural logarithm of v
        require
            v > 0.0

    log10 (v: REAL): REAL
            -- Base 10 logarithm of v
        require
            v > 0.0

    log_2 (v: REAL): REAL
            -- Base 2 logarithm of v
        require
            v > 0.0

    sine (v: REAL): REAL
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]

    sqrt (v: REAL): REAL
            -- Square root of v
        require
            v >= 0.0

    tangent (v: REAL): REAL
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SINGLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SINGLE_MATH Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    SINGLE_MATH

Ancestors
    MATH_CONST

Clients
    SINGLE_MATH

Suppliers
    REAL
    SINGLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


SINGLE_MATH Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

indexing
    description: "[
        Basic mathematical operations, single-precision.
        This class may be used as ancestor by classes needing its facilities
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/07/15 05:36:39 $"
    revision: "$Revision: 1.2 $"

class interface
    SINGLE_MATH

feature -- Access

    log_2 (v: REAL): REAL
            -- Base 2 logarithm of v
        require
            v > 0.0

    cosine (v: REAL): REAL
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]

    arc_cosine (v: REAL): REAL
            -- Trigonometric arccosine of v

    sine (v: REAL): REAL
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]

    arc_sine (v: REAL): REAL
            -- Trigonometric arcsine of v

    tangent (v: REAL): REAL
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]

    arc_tangent (v: REAL): REAL
            -- Trigonometric arctangent of v

    sqrt (v: REAL): REAL
            -- Square root of v
        require
            v >= 0.0

    log (v: REAL): REAL
            -- Natural logarithm of v
        require
            v > 0.0

    log10 (v: REAL): REAL
            -- Base 10 logarithm of v
        require
            v > 0.0

    floor (v: REAL): REAL
            -- Greatest integral value less than or equal to v

    ceiling (v: REAL): REAL
            -- Least integral value greater than or equal to v

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/base/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SINGLE_MATH

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


simple class dictionary

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Classes
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
            -- A sequence of actions to be performed on call

    ACTIVE [G]
            -- `Active' data structures, which at every stage have
            -- a possibly undefined ``current item''.
            -- Basic access and modification operations apply to the current item.

    ACTIVE_INTEGER_INTERVAL
            -- Contiguous integer interval that calls an action sequence
            -- when it changes.

    ACTIVE_LIST [G]
            -- Sequential, one-way linked lists that call an action
            -- sequence when an item is removed or added.

    ANY
            -- Project-wide universal properties.
            -- This class is an ancestor to all developer-written classes.
            -- ANY may be customized for individual projects or teams.

    ARGUMENTS
            -- Access to command-line arguments. This class
            -- may be used as ancestor by classes needing its facilities.

    ARRAY [G]
            -- Sequences of values, all of the same type or of a conforming one,
            -- accessible through integer indices in a contiguous interval.

    ARRAY2 [G]
            -- Two-dimensional arrays

    ARRAYED_CIRCULAR [G]
            -- Circular chains implemented by resizable arrays

    ARRAYED_LIST [G]
            -- Lists implemented by resizable arrays

    ARRAYED_LIST_CURSOR
            -- Cursors for arrayed lists

    ARRAYED_QUEUE [G]
            -- Unbounded queues, implemented by resizable arrays

    ARRAYED_SET [G]
            -- Sets represented as arrayed lists

    ARRAYED_STACK [G]
            -- Stacks implemented by resizable arrays

    ARRAYED_TREE [G]
            -- Trees where the children of each node are kept in an array

    ASCII
            -- The ASCII character set.
            -- This class may be used as ancestor by classes needing its facilities.

    BAG [G]
            -- Collections of items, where each item may occur zero
            -- or more times, and the number of occurrences is meaningful.

    BASIC_ROUTINES
            -- Some useful facilities on objects of basic types

    BI_LINKABLE [G]
            -- Linkable cells with a reference to the left and right neighbors

    BILINEAR [G]
            -- Structures that may be traversed forward and backward

    BINARY_SEARCH_TREE [G -> COMPARABLE]
            -- Binary search trees; left child item is less than current item,
            -- right child item is greater

    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
            -- Sorted sets implemented as binary search trees

    BINARY_TREE [G]
            -- Binary tree: each node may have a left child and a right child

    BIT_REF
            -- Bit sequences of length count, with binary operations

    BOOL_STRING
            -- Packed boolean strings

    BOOLEAN
            -- Truth values, with the boolean operations

    BOOLEAN_REF
            -- References to objects containing a boolean value

    BOUNDED [G]
            -- Bounded data structures, with a notion of capacity.

    BOUNDED_QUEUE [G]
            -- Queues with a bounded physical size, implemented by arrays

    BOUNDED_STACK [G]
            -- Stacks with a bounded physical size, implemented by arrays

    BOX [G]
            -- Data structures of the most general kind,
            -- having the potential ability to become full,
            -- and characterized by their implementation properties.

    CELL [G]
            -- Cells containing an item

    CHAIN [G]
            -- Possibly circular sequences of items,
            -- without commitment to a particular representation

    CHARACTER
            -- Characters, with comparison operations and an ASCII code

    CHARACTER_REF
            -- References to objects containing a character value

    CIRCULAR [G]
            -- Circular chains, without commitment to a particular representation

    CIRCULAR_CURSOR
            -- Cursors for circular lists

    COLLECTION [G]
            -- General container data structures,
            -- characterized by the membership properties of their items.

    COMPACT_CURSOR_TREE [G]
            -- Compact trees as active structures that may be traversed using a cursor

    COMPACT_TREE_CURSOR
            -- Cursors for compact trees

    COMPARABLE
            -- Objects that may be compared according to a total order relation

    COMPARABLE_SET [G -> COMPARABLE]
            -- Sets whose items may be compared according to a total order relation

    COMPARABLE_STRUCT [G -> COMPARABLE]
            -- Data structures whose items may be compared
            -- according to a total order relation

    CONSOLE
            -- Commonly used console input and output mechanisms.
            -- This class may be used as ancestor by classes needing its facilities.

    CONTAINER [G]
            -- Data structures of the most general kind,
            -- used to hold zero or more items.

    COUNTABLE [G]
            -- Infinite containers whose items are in one-to-one
            -- correspondence with the integers.

    COUNTABLE_SEQUENCE [G]
            -- Infinite sequences, indexed by integers

    CURSOR
            -- Cursors for remembering positions in arbitrary data structures

    CURSOR_STRUCTURE [G]
            -- Active structures, which always have a current position
            -- accessible through a cursor.

    CURSOR_TREE [G]
            -- Trees as active structures that may be traversed using a cursor

    CURSOR_TREE_ITERATOR [G]
            -- Objects that are able to iterate over cursor trees,
            -- on which they can perform repeated actions and tests according
            -- to a number of predefined control structures such as `if',
            -- `until' and others.

    DECLARATOR
            -- Class used to ensure proper precompilation of EiffelBase.
            -- Not to be used otherwise."

    DIRECTORY
            -- Directories, in the Unix sense, with creation and exploration features

    DIRECTORY_NAME
            -- Directory name abstraction

    DISPENSER [G]
            -- Dispensers: containers for which clients have no say
            -- as to what item they can access at a given time.
            -- Examples include stacks and queues.

    DLL_32
            -- DLL for Win32

    DLL_32_ROUTINE
            -- 32 bit DLL routine for Windows

    DOUBLE
            -- Real values, double precision

    DOUBLE_MATH
            -- Basic mathematical operations, double-precision.
            -- This class may be used as ancestor by classes needing its facilities.

    DOUBLE_REF
            -- References to objects containing a double-precision real number

    DYNAMIC_CHAIN [G]
            -- Dynamically modifiable chains

    DYNAMIC_CIRCULAR [G]
            -- Dynamically modifiable circular chains

    DYNAMIC_LIST [G]
            -- Sequential, dynamically modifiable lists,
            -- without commitment to a particular representation

    DYNAMIC_TREE [G]
            -- Trees with a dynamically modifiable structure

    EXCEP_CONST
            -- Constants used for exception handling.
            -- This class may be used as ancestor by classes needing its facilities.

    EXCEPTIONS
            -- Facilities for adapting the exception handling mechanism.
            -- This class may be used as ancestor by classes needing its facilities.

    EXECUTION_ENVIRONMENT
            -- The objects available from the environment at time of execution

    FIBONACCI
            -- The Fibonacci number sequence

    FILE
            -- Sequential files, viewed as persistent sequences of characters

    FILE_NAME
            -- File name abstraction

    FINITE [G]
            -- Structures with a finite item count

    FIXED [G]
            -- Finite structures whose item count cannot be changed

    FIXED_LIST [G]
            -- Lists with fixed maximum numbers of items, implemented by arrays

    FIXED_TREE [G]
            -- Trees where each node has a fixed number of children
            -- (The number of children is arbitrary but cannot be
            -- changed once the node has been created

    FORMAT_DOUBLE
            -- Formatter for non-integral numbers

    FORMAT_INTEGER
            -- Formatter for integral numbers

    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
            -- Objects representing delayed calls to a function,
            -- with some arguments possibly still open.

    GC_INFO
            -- Garbage collector statistics.
            -- This class may be used as ancestor by classes needing its facilities.
            -- Time accounting is relevant only if enable_time_accounting
            -- (from MEMORY) has been called.

    HASH_TABLE [G, H -> HASHABLE]
            -- Hash tables, used to store items identified by hashable keys

    HASH_TABLE_CURSOR
            -- Cursors for hash table traversal

    HASHABLE
            -- Values that may be hashed into an integer index,
            -- for use as keys in hash tables

    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
            -- Priority queues implemented as heaps

    HEIR

    HIERARCHICAL [G]
            -- Hierarchical structures in which each item has zero or
            -- one immediate predecessor, and zero or more successors.

    IDENTIFIED
            -- Objects identified, uniquely during any session, by an integer

    IDENTIFIED_CONTROLLER
            -- Externals for managing the object id stack (see identified.e)

    INDEXABLE [G, H -> INTEGER]
            -- Tables whose keys are integers in a contiguous interval

    INFINITE [G]
            -- Infinite containers.

    INTEGER
            -- Integer values

    INTEGER_16
            -- Integer values coded on 16 bits

    INTEGER_16_REF
            -- References to objects containing an integer value coded on 16 bits

    INTEGER_64
            -- Integer values coded on 64 bits

    INTEGER_64_REF
            -- References to objects containing an integer value coded on 64 bits

    INTEGER_8
            -- Integer values coded on 8 bits

    INTEGER_8_REF
            -- References to objects containing an integer value coded on 8 bits

    INTEGER_INTERVAL
            -- Contiguous integer intervals

    INTEGER_REF
            -- References to objects containing an integer value

    INTERACTIVE_LIST [G]
            -- Sequential, one-way linked lists that call add/remove features
            -- when an item is removed or added.

    INTERNAL
            -- Access to internal object properties.
            -- This class may be used as ancestor by classes needing its
            -- facilities.

    IO_MEDIUM
            -- Any medium that can perform input and/or output

    ITERATOR [G]
            -- Objects that are able to iterate over traversable structures,
            -- on which they can perform repeated actions and tests according
            -- to a number of predefined control structures such as `if',
            -- `until' and others.

    LINEAR [G]
            -- Structures whose items may be accessed sequentially, one-way

    LINEAR_ITERATOR [G]
            -- Objects that are able to iterate over linear structures

    LINEAR_SUBSET [G]
            -- Subsets that are traversable linearly without commitment to a concrete
            -- implementation.

    LINKABLE [G]
            -- Linkable cells containing a reference to their right neighbor

    LINKED_CIRCULAR [G]
            -- Circular chains implemented as linked lists

    LINKED_CURSOR_TREE [G]
            -- Cursor trees in linked representation

    LINKED_LIST [G]
            -- Sequential, one-way linked lists

    LINKED_LIST_CURSOR [G]
            -- Cursors for linked lists

    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]
            -- Priority queues implemented as sorted lists

    LINKED_QUEUE [G]
            -- Unbounded queues implemented as linked lists

    LINKED_SET [G]
            -- Sets implemented by linked lists

    LINKED_STACK [G]
            -- Unbounded stacks implemented as linked lists

    LINKED_TREE [G]
            -- Trees implemented using a linked list representation

    LINKED_TREE_CURSOR [G]
            -- Cursors for linked trees

    LIST [G]
            -- Sequential lists, without commitment to a particular representation

    MATH_CONST
            -- Basic mathematical constants.
            -- This class may be used as ancestor by classes needing its facilities.

    MEM_CONST
            -- Constants used by memory management.
            -- This class may be used as ancestor by classes needing its facilities.

    MEM_INFO
            -- Properties of the memory management mechanism.
            -- This class may be used as ancestor by classes needing its facilities.

    MEMORY
            -- Facilities for tuning up the garbage collection mechanism.
            -- This class may be used as ancestor by classes needing its facilities.

    MULTAR_LIST_CURSOR [G]
            -- Cursors for multi-array trees

    MULTI_ARRAY_LIST [G]
            -- Lists implemented as sequences of arrays, the last of which may
            -- be non-full. No limit on size (a new array is allocated if list
            -- outgrows its initial allocation).

    NUMERIC
            -- Objects to which numerical operations are applicable

    OPERATING_ENVIRONMENT
            -- The objects available from the operating system

    PARENT

    PART_COMPARABLE
            -- Objects that may be compared according to a partial order relation

    PART_SORTED_LIST [G -> PART_COMPARABLE]
            -- Sequential lists whose items are sorted in ascending order
            -- according to the relational operators of PART_COMPARABLE

    PART_SORTED_SET [G -> PART_COMPARABLE]
            -- Sets whose items may be compared according to a partial order relation
            -- implemented as sorted two-way lists.

    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
            -- Two-way lists, kept sorted

    PATH_NAME
            -- Path name abstraction

    PLAIN_TEXT_FILE
            -- Files viewed as persistent sequences of ASCII characters

    PLATFORM
            -- Platform-dependent properties.
            -- This class is an ancestor to all developer-written classes.

    POINTER
            -- References to objects meant to be exchanged with non-Eiffel software.

    POINTER_REF
            -- References to objects containing reference to object
            -- meant to be exchanged with non-Eiffel software.

    PRIMES
            -- Prime number properties

    PRIORITY_QUEUE [G -> PART_COMPARABLE]
            -- Priority queues, without commitment to a particular representation

    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]
            -- Objects representing delayed calls to a procedure.
            -- with some operands possibly still open.

    PROFILING_SETTING
            -- Objects that manage the Eiffel profiler. You can start and
            -- stop the Eiffel profiler whenever you want to. It only works
            -- if `profile (yes)' is enabled in your Ace file.

    QUEUE [G]
            -- Queues (first-in, first-out dispensers), without commitment
            -- to a particular representation

    RANDOM
            -- Pseudo-random number sequence, linear congruential method

    RAW_FILE
            -- Files, viewed as persistent sequences of bytes

    REAL
            -- Real values, single precision

    REAL_REF
            -- References to objects containing a real value

    RECURSIVE_CURSOR_TREE [G]
            -- Cursor trees with a recursive structure

    RECURSIVE_TREE_CURSOR [G]
            -- Cursors for recursive trees

    RESIZABLE [G]
            -- Finite structures whose item count is subject to change

    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
            -- Objects representing delayed calls to a routine,
            -- with some operands possibly still open

    SEQ_STRING

    SEQUENCE [G]
            -- Finite sequences: structures where existing items are arranged
            -- and accessed sequentially, and new ones can be added at the end.

    SET [G]
            -- Collection, where each element must be unique.

    SHARED_LIBRARY
            -- Platform independent abstraction of a shared library

    SHARED_LIBRARY_CONSTANTS
            -- Constants used by DESC (Dynamic External Shared Call) mechanism

    SHARED_LIBRARY_ROUTINE
            -- Platform independent abstraction of a shared library routine

    SINGLE_MATH
            -- Basic mathematical operations, single-precision.
            -- This class may be used as ancestor by classes needing its facilities

    SORTED_LIST [G -> COMPARABLE]
            -- Sequential lists where the cells are sorted in ascending order
            -- according to the relational operators of PART_COMPARABLE

    SORTED_STRUCT [G -> COMPARABLE]
            -- Structures whose items are sorted according to a total order relation

    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
            -- Two-way lists, kept sorted.

    SPECIAL [T]
            -- Special objects: homogeneous sequences of values,
            -- used to represent arrays and strings

    STACK [G]
            -- Stacks (last-in, first-out dispensers), without commitment
            -- to a particular representation

    STD_FILES
            -- Commonly used input and output mechanisms.
            -- This class may be used as either ancestor or supplier
            -- by classes needing its facilities."

    STORABLE
            -- Objects that may be stored and retrieved along with all their dependents.
            -- This class may be used as ancestor by classes needing its facilities.

    STREAM
            -- Implementation of the STORABLE mechanism with streams.

    STRING
            -- Sequences of characters, accessible through integer indices
            -- in a contiguous range.

    STRING_HANDLER
            -- Objects that can access set_count from STRING

    SUBSET [G]
            -- Subsets with the associated operations,
            -- without commitment to a particular representation

    SUBSET_STRATEGY [G]
            -- Strategies for computing several features of subsets. The computing
            -- strategy is optimized depending on the type of elements contained in
            -- the set.

    SUBSET_STRATEGY_GENERIC [G]
            -- Strategies for calculating several features for subsets containing
            -- items of any type.

    SUBSET_STRATEGY_HASHABLE [G]
            -- Strategies for calculating several features for subsets containing
            -- HASHABLEs.

    SUBSET_STRATEGY_TREE [G -> COMPARABLE]
            -- Strategies for calculating several features for subsets represented
            -- by binary search trees. Contained items have to be COMPARABLE

    TABLE [G, H]
            -- Containers whose items are accessible through keys

    TESTROOT

    TO_SPECIAL [T]
            -- References to special objects, for direct access to arrays and strings

    TRAVERSABLE [G]
            -- Structures for which there exists a traversal policy
            -- that will visit every element exactly once.

    TRAVERSABLE_SUBSET [G]
            -- Subsets that are traversable sequentially

    TREE [G]
            -- Trees, without commitment to a particular representation

    TUPLE
            -- Implementation of TUPLE

    TWO_WAY_CHAIN_ITERATOR [G]
            -- Objects that are able to iterate over two-way chains,
            -- on which they can perform repeated actions and tests according
            -- to a number of predefined control structures such as `if',
            -- `until' and others.

    TWO_WAY_CIRCULAR [G]
            -- Circular chains implemented as two-way linked lists

    TWO_WAY_CURSOR_TREE [G]
            -- Cursor trees implemented in two-way linked representation

    TWO_WAY_LIST [G]
            -- Sequential, two-way linked lists

    TWO_WAY_SORTED_SET [G -> COMPARABLE]
            -- Sets whose items may be compared according to a total order relation;
            -- implemented as sorted two-way lists.

    TWO_WAY_TREE [G]
            -- Trees implemented using a two way linked list representation

    TWO_WAY_TREE_CURSOR [G]
            -- Cursors for two-way cursor trees

    UNBOUNDED [G]
            -- Finite structures whose item count is not bounded

    UNIX_FILE_INFO
            -- Internal file information

    UNIX_SIGNALS
            -- Constants used for signal handling.
            -- This class may be used as ancestor by classes needing its facilities.

    WIDE_CHARACTER
            -- Unicode characters, with comparison operations

    WIDE_CHARACTER_REF
            -- References to objects containing a character value

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


simple cluster hierarchy

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Clusters
    base
        base.desc
            base.desc.general
            base.desc.spec
                base.desc.spec.win32
        base.event
        base.kernel
        base.structures
            base.structures.access
            base.structures.cursors
            base.structures.cursor_tree
            base.structures.dispenser
            base.structures.iteration
            base.structures.list
            base.structures.set
                base.structures.set.strategies
            base.structures.sort
            base.structures.storage
            base.structures.table
            base.structures.traversing
            base.structures.tree
        base.support
    root_cluster

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


simple alphabetical cluster list

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Clusters
    root_cluster
    base
    base.desc
    base.desc.general
    base.desc.spec
    base.desc.spec.win32
    base.event
    base.kernel
    base.structures
    base.structures.access
    base.structures.cursor_tree
    base.structures.cursors
    base.structures.dispenser
    base.structures.iteration
    base.structures.list
    base.structures.set
    base.structures.set.strategies
    base.structures.sort
    base.structures.storage
    base.structures.table
    base.structures.traversing
    base.structures.tree
    base.support

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


cluster root_cluster

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Go to:

Cluster
    root_cluster	(diagram)

Classes
    HEIR
    PARENT
    TESTROOT

Classes
Clusters
Cluster hierarchy
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Cluster root_cluster

Automatic generation produced by ISE Eiffel

Classes Clusters Cluster hierarchy Go to:
Classes Clusters Cluster hierarchy Go to:

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


HEIR Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HEIR

inherit
    PARENT
        redefine
            display
        end

feature

    display is
            -- Output message saying where we are.
        do
            io.putstring ("In class HEIR")
            io.new_line
            io.putstring ("-------------------")
            io.new_line
            display_routine
            io.putstring (a_string)
            io.new_line
            io.new_line
        end

    display_routine is
            -- Output simple message.
        do
            io.putstring ("Calling a routine of class HEIR")
            io.new_line
        end

    a_string: STRING is
            -- Simple text string
        do
            create Result.make (0)
            Result.append ("Showing an attribute of class HEIR")
        end

end -- class HEIR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEIR Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HEIR

General
    cluster: root_cluster

Ancestors
    PARENT

Queries
    a_string: STRING

Commands
    display
    display_routine
    first_message

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEIR Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HEIR

feature

    a_string: STRING is
            -- Simple text string
        do
            create Result.make (0)
            Result.append ("Showing an attribute of class HEIR")
        end

    display is
            -- Output message saying where we are.
        do
            io.putstring ("In class HEIR")
            io.new_line
            io.putstring ("-------------------")
            io.new_line
            display_routine
            io.putstring (a_string)
            io.new_line
            io.new_line
        end

    display_routine is
            -- Output simple message.
        do
            io.putstring ("Calling a routine of class HEIR")
            io.new_line
        end

    first_message is
            -- Display a simple message.
            -- (from PARENT)
        do
            io.putstring ("Message number 1")
            io.new_line
            io.new_line
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HEIR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEIR Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class interface
    HEIR

feature

    a_string: STRING
            -- Simple text string

    display
            -- Output message saying where we are.

    display_routine
            -- Output simple message.

    first_message
            -- Display a simple message.
            -- (from PARENT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HEIR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEIR Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    HEIR

Ancestors
    PARENT

Clients
    HEIR
    TESTROOT

Suppliers
    HEIR
    STD_FILES
    STRING

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


HEIR Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class interface
    HEIR

feature

    display
            -- Output message saying where we are.

    display_routine
            -- Output simple message.

    a_string: STRING
            -- Simple text string

end -- class HEIR

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PARENT Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PARENT

feature

    display is
            -- Display basic information.
        do
            io.put_string ("THIS IS SOME ADDED TEXT")
            io.new_line
            io.put_string ("In class PARENT")
            io.new_line
            io.put_string ("---------------")
            io.new_line
            first_message
        end

    first_message is
            -- Display a simple message.
        do
            io.putstring ("Message number 1")
            io.new_line
            io.new_line
        end

end -- class PARENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PARENT Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PARENT

General
    cluster: root_cluster

Ancestors
    ANY

Commands
    display
    first_message

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PARENT Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PARENT

feature

    display is
            -- Display basic information.
        do
            io.put_string ("THIS IS SOME ADDED TEXT")
            io.new_line
            io.put_string ("In class PARENT")
            io.new_line
            io.put_string ("---------------")
            io.new_line
            first_message
        end

    first_message is
            -- Display a simple message.
        do
            io.putstring ("Message number 1")
            io.new_line
            io.new_line
        end

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class PARENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PARENT Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class interface
    PARENT

feature

    display
            -- Display basic information.

    first_message
            -- Display a simple message.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class PARENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PARENT Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    PARENT

Ancestors
    ANY

Descendants
    HEIR

Clients
    PARENT
    TESTROOT

Suppliers
    PARENT
    STD_FILES

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


PARENT Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class interface
    PARENT

feature

    display
            -- Display basic information.

    first_message
            -- Display a simple message.

end -- class PARENT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TESTROOT Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TESTROOT

create
    make

feature

    o1: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o2.

    o2: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o1.

    make is
            -- Output messages tracing what's going on.
        do
            display_demonstration_message
            create {HEIR} o1
            create o2
            o1.display
            o2.display
        end

    display_demonstration_message is
            -- Output a welcoming message.
        do
            io.put_new_line
            io.put_string (" ISE Eiffel spoken here")
            io.put_new_line
            io.put_string ("--------------------------------%N%N")
        end

end -- class TESTROOT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TESTROOT Chart

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TESTROOT

General
    cluster: root_cluster
    create: make

Ancestors
    ANY

Queries
    o1: PARENT
    o2: PARENT

Commands
    display_demonstration_message
    make

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TESTROOT Flat

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TESTROOT

create
    make

feature

    display_demonstration_message is
            -- Output a welcoming message.
        do
            io.put_new_line
            io.put_string (" ISE Eiffel spoken here")
            io.put_new_line
            io.put_string ("--------------------------------%N%N")
        end

    make is
            -- Output messages tracing what's going on.
        do
            display_demonstration_message
            create {HEIR} o1
            create o2
            o1.display
            o2.display
        end

    o1: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o2.

    o2: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o1.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TESTROOT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TESTROOT Flat contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class interface
    TESTROOT

create

    make
            -- Output messages tracing what's going on.

feature

    display_demonstration_message
            -- Output a welcoming message.

    make
            -- Output messages tracing what's going on.

    o1: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o2.

    o2: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o1.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TESTROOT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TESTROOT Relations

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class
    TESTROOT

Ancestors
    ANY

Clients
    TESTROOT

Suppliers
    HEIR
    PARENT
    STD_FILES
    TESTROOT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


TESTROOT Contracts

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

class interface
    TESTROOT

create
    make

feature

    o1: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o2.

    o2: PARENT
            -- Examples of attributes
            -- Was declared in TESTROOT as synonym of o1.

    make
            -- Output messages tracing what's going on.

    display_demonstration_message
            -- Output a welcoming message.

end -- class TESTROOT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Flat
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


9 BROWSING FEATURES

Let us get back to EiffelStudio. We won't need a browser any more for this Tour, so you may close any browser window (other than the current window if you are reading this in HTML!) opened to look up the generated documentation in the previous section.

Before studying the documentation generation we saw how to display properties of classes . It's also interesting to explore the properties of features . Let's look at this now, through the Feature View.

Your Development Window should still be targeted to class LIST , from the last view, Routines , that you displayed on it (page 38 ). If you've lost it, just retarget a Development Window to this class.

If the Features Tool is not visible, bring it back by clicking the Features button on the top toolbar, used earlier to remove it:

(Another way is through the menu entry View --> EiffelStudio bar .)

Targeting to a feature

The list of features, organized by feature clauses, appears on the left:

The class only has a few immediate features because most of its interesting features are inherited. Make sure the Editing Tool is tall enough (as on the above figure) and click the feature forth , the last one, in the Feature Tree on the left. This makes the feature the Editing Tool's current target, and scrolls the text to its declaration:

Note how both of the top target fields are now filled: the first one shows the target class, LIST , and the second one shows the target feature, forth .

Basic feature information

Now let's look at the feature views. Click the Feature Tab at the bottom of the Context Tool:

This brings up basic information on the selected feature in the Context Tool:

The bottom Context Tool shows one of the Feature views, by default Flat . The flat view of a feature, similar in concept to the flat view of a class (page 35 ), gives the full text of a feature, taking into account any inherited precondition or postcondition clauses. Here the feature as declared in the class appears in the top Editing Tool, with no precondition and an ensure then postcondition clause. But it's a redefinition of an inherited feature; the flat view in the bottom Context Tool shows the full precondition, inherited from the ancestor LINEAR , as well as the postcondition from LIST .

Flat is just one of the available Feature Views, shown by the buttons on the Feature View toolbar:

Text gives the feature text, fully clickable.

Who calls this feature?

Next to Flat is Callers . Try it now by clicking the corresponding button (the following figure and the next only show the Context Tool, where the views appear):

This view shows all the places in the system that call the routine, or one of its redefinitions. Such information can be invaluable for debugging in particular. The successive paragraphs correspond to the various versions of forth in class LIST , its ancestors and its descendants. Reading from the top we see that:

    + The version from LIST is called in LIST itself by the function is_equal .

    + The version from LIST's descendant ARRAYED_CIRCULAR is not called directly in this system, although it could be called through dynamic binding (on an entity declared of type LIST but dynamically attached to an instance of ARRAYED_CIRCULAR ).

    + About 60% down, forth from ARRAYED_LIST , a version in another descendant of LIST , is called by two routines of ARRAYED_CIRCULAR , one routine of ARRAYED_LIST , and two routines of MULTI_ARRAY_LIST .

    + Also note, in the following entry, that after renaming forth is called back in the descendant ARRAYED_STACK .

What happens to my feature through the inheritance hierarchy?

Now click the next view button, Implementers :

This is a very useful view, showing all the ancestors and descendants of LIST that provide a separate version of forth , including the original introduction of this feature in LINEAR and subsequent redeclarations (redefinitions or effectings). The mention (version from) signals the version applicable to the current class, here LIST .

Since all class and feature names on these views are hyperlinks, you can display any of the listed versions in a new Development Window by control-right-clicking it (we will see shortly how to display it in the same tool). Control-right-click on the feature name forth on the line that reads MULTI_ARRAY_LIST forth (line 4). This brings up a tool targeted to the routine forth from MULTI_ARRAY_LIST , so that you can see the implementation of the routine in that class:

You can get rid of this new Development Window (just close it, but don't exit EiffelStudio!) and come back to the original Development Window, where we still have two unexplored views, Ancestor versions and Descendant versions . Click the first of these to obtain the ancestor versions of forth from LIST :

The format is self-explanatory: for each ancestor of LIST that has a version of LIST 's forth feature, it indicates the name of that feature -- which could be something else than forth as a result of renaming, although here this happens only in descendants, not ancestors -- and the version of the feature applicable to the given class.

The list is labeled History branch #1 because in the case of feature merging (combining several features inherited from different parents, in conformance with the rules of the language) there could be more than one history branch.

The next button, Descendant versions , similarly tells you all that happens to a feature in the descendants of the current class.

Who has the same name?

The last button, Homonyms , displays all the features of the system which, related or not to the current feature by redeclaration, have the same name. You can then explore any such feature to see if the relationship is more than casual.

In any system or library that takes advantage of inheritance and its associated mechanisms -- renaming, redefinition, effecting, undefinition, multiple and repeated inheritance, polymorphism, dynamic binding -- the feature browsing facilities that we have just explored are invaluable to track what happens to features. What makes them even more precious is their connection with the rest of the browsing and documentation capabilities, especially the pick-and-drop which we will now study.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


10 RETARGETING THROUGH PICK-AND-DROP

You now know quite a few ways of retargeting a Development Window to a "development object" -- a class or a feature -- but haven't yet seen one of the most important: "Pick-and-Drop", which lets you pick a development object that you have spotted anywhere in the display, and retarget the current tool, or another, to it.

Trying Pick-and-Drop

We restart from the last state, with a Development Window target to feature forth of class LIST . The next figure shows the whole window; it should be exactly what you see as a result of the last operations. We'll use the Ancestor versions view of the Feature Tab.

If for some reason the window doesn't look like the next figure, it's easy to reconstruct it: make sure both the Cluster tree and the Feature tree are visible (if not, click the corresponding buttons as recalled on page 55 ); target the tool to class LIST ; target it further to its feature forth by clicking that feature name in the Feature tree; make sure both the top-right Editing Tool and the bottom-right Context Tool are visible; in the Context Tool, select the Feature Tab and its Ancestor versions format.

In the Context Tool at the bottom right, the second entry reads

    ARRAYED_CIRCULAR forth

referring to the version of feature forth in class ARRAYED_CIRCULAR . Let's assume you want to see what that version actually is. It suffices to retarget the tool to it. Of course you could type or copy-paste the class name ARRAYED_CIRCULAR in the Class field at the top of the window, and the feature name forth in the adjacent Feature field. But this is too much work; after all, you have just seen a reference to the feature, through its name as it appears in the Ancestors version format, so it's natural to use it directly from the graphical interface.

As we've seen before, you could control-right-click on the feature name at the place where it appears; this would create a new Development Window targeted to forth from ARRAYED_CIRCULAR . But you don't necessarily want a new window. Instead you can use Pick-and-Drop to retarget the current window.

Here is how it works. Position the cursor on the desired feature reference: the word forth in the line ARRAYED_CIRCULAR forth . Right-click, that is to say click the rightmost mouse button, and release the button immediately . That's right: you use a simple click, and do not maintain the button down.

Now move the mouse a trifle, without pressing any button :

The cursor has changed into a new shape, a cross representing the type of development object that you have picked, a feature. For a class, as you may have guessed, it would be a small ellipse ("bubble"). Each kind of development object that you may create and manipulate during your work with EiffelStudio has its distinctive icon.

The display reflects that you have " picked " the feature forth . Now you can drop it at any appropriate place to retarget the corresponding tool. In fact you can drop it right where it is, in the Context Tool of the current Development tool. To drop, just right-click again. (That is to say, as before, press the rightmost mouse button and release it immediately.) This achieves a "drop", and retargets the Development Window to the chosen feature, forth from ARRAYED_CIRCULAR . The retargeting affects both the Editing Tool and the Context Tool, which keeps its current view ( Ancestor versions in the Feature Tab). We'll see shortly how to give them separate targets if that's preferred.

How Pick-and-Drop works

The Pick-and-Drop mechanism is very simple. It consists of three steps:

    + Pick step: find the development object you want to pick, right-click it, release the mouse button.

    + Move step: move the mouse to the desired drop point, without pressing any button .

    + Drop step: right-click (again releasing the button immediately) at the drop position.

During the Move step, you can at any time cancel the whole operation simply through a left-click .

The Move step is actually optional: if the current position is a valid drop target, as explained next, you can drop immediately after the pick without moving the mouse.

Pebbles, holes, drop targets and type compatibility

The Pick-and-Drop mechanism relies on the metaphor of pebbles and holes . When you pick a development object, the cursor changes into a "pebble" whose shape represents the type of the development object: cluster, class, feature, run-time object … You may then drop it into a "hole", which can be a window, a tree view entry, or a hole-shaped icon. This performs the appropriate action such as retargeting a tool.

In the same way that Eiffel is a typed object-oriented language, the Pick-and-Drop mechanism is typed: you can only drop a pebble into a compatible hole. For example you may drop a class pebble into a Development Window, to retarget it to the chosen class.

In Eiffel, type compatibility is not necessarily type identity, but is governed by conformance , based on inheritance and polymorphism: to an entity of type POLYGON , you may assign not only an expression of that same type, but also one of type RECTANGLE , if class RECTANGLE inherits from -- conforms to -- class POLYGON . Similarly, EiffelStudio considers that the development type "feature" conforms to "class"; this means you may drop a feature into a Development Window targeted to a class; this will retarget the tool to the feature's class and the feature itself, with the text of the class scrolled to the position of the feature.

In the Pick-and-Drop example -- for forth of ARRAYED_CIRCULAR -- you did not have to go to a new target: the current window was a valid drop target, so you just dropped right away. In such a case you don't even have to move the mouse; Pick-and-Drop is just a matter of two right-clicks.

This is similar to a double-click , a commonly used interaction technique, but without the stress of the usual double-click, which requires you to wait no more than a specified time -- typically half a second or so -- between the two clicks. With Pick-and-Drop the effect is the same whether the second click follows the first after one tenth of a second or two days.

Multiple tools

In the previous example we pick-and-dropped a feature to its own tool. You can also pick-and-drop to a different tool.

Try this now. Bring up a new Development Window by choosing the menu entry File --> New window (unless you already have a second Development Window open, in which case you can simply reuse it). Make sure the two Development Window do not overlap too much, so that you can see enough of each. In the first Development Window, pick a class (right-click it). Move the mouse to the Editing Tool of the second Development Tool. Drop the class by right-clicking again. The tool retargets itself to the chosen class.

Many people like to take advantage of this possibility to keep two or more Development Windows open, and pick-and-drop frequently from one to the other when they see a development object of interest and want to know more about it, without losing its original context.

Clickable formats

A good deal of the power of Pick-and-Drop comes from its connection with the various views of the Context Tool -- Class Views, Feature Views, Diagram View. As was mentioned when we saw these views, all the feature and class names or other graphical representations that appear in these views are clickable ; this means that you can select any of them as the source of a Pick-and-Drop.

As a result, you can quickly traverse a system and get to its essential properties by displaying the information of a class in any of the many available views -- the contract and flat contract of a class, its routines, its attributes, its clients, its ancestors, the ancestor and descendant versions of a feature, and so on -- then wherever you see a feature or class name follow the corresponding link. This proximity-based form of browsing, combined with the other techniques seen earlier, provides considerable help when you are dealing with a large, possibly complex system, and want to master its intricacies, be it for development, testing, debugging, maintenance or revision.

Other places where you can pick development objects include the class bubbles in a Diagram View, and the icons representing classes and features in the Cluster Tree, Feature Tree and Favorites list.

Semantic consistency

An important property of the pick-and-drop mechanism, shared by its cousin the right-click mechanism, has already been mentioned in this chapter: semantic consistency, which guarantees that the operations you can perform on a class, such as pick-and-drop, only depend on the development object to which you are applying the operation. It doesn't matter where you picked the object -- in any development tool under any view -- and in what form: textual, as a class or feature name; graphical representation, as a class bubble in a Diagram View; or an icon, for example in the Cluster Tree, Feature Tree, Favorites list.

The pebble that you see during the Move step of Pick-and-Drop represents the underlying development object -- such as a class or a feature -- regardless of how you got to it.

Behind the Pick-and-Drop conventions

Pick-and-Drop works differently from the usual Drag-and-Drop present on many computing platforms. The usual Drag-and-Drop retains a role within EiffelStudio (to move class bubbles around in the Diagram view) and you may of course have to use it for operating system functions such as copying files. But the key EiffelStudio operation is Pick-and-Drop. This technique is motivated by careful consideration of ergonomics and user comfort. In particular:

    + Pick-and-Drop is much less stressful. Drag-and-Drop requires you to maintain pressure throughout the move, being careful not to drop on the wrong place. With Pick-and-Drop there is no stress: you click and release; get a drop from your coffee cup if you like (optional step); move the cursor with no pressure from your fingers or on your mind; make sure, at your leisure, to find the right drop place; and right-click again on it. At the end of the day, after many such operations, the stress reduction can make a real difference.

    + With Drag-and-Drop, it's easy to lessen the pressure involuntarily and drop on the wrong place. The consequences can be damaging, especially since in such a case you may well not know where you dropped the element; after all, that wasn't intentional. It is possible, for example, to lose files that way. With Pick-and-Drop this is much less likely to happen.

    + Pick-and-Drop makes it easy to cancel the operation if you change your mind: just left-click anywhere. With Drag-and-Drop you have to find an invalid place to drop; this may be difficult, or even impossible! (Sometimes pressing the Escape key works, but this is not universal.)

If you are new to ISE Eiffel you may find Pick-and-Drop surprising at first. We trust you will join the ranks of ISE Eiffel users who consistently rate it among the most convenient features of the environment.

Isolating the context

In all the examples so far, the Context Tool was targeted to the same target as the enclosing Development Window and its Editing Tool. You can retarget the Context Tool separately, for example by pick-and-dropping a class or feature into it; but the next time you retarget the Development Window as a whole the Context Tool will follow.

This is called merged behavior, meaning that the target of the Context Tool is merged with the target of the enclosing Development Window and Editing Tool. It's the default behavior, appropriate for your first steps with EiffelStudio.

As you become more proficient with the environment, you may not want this behavior any more: you might prefer the ability to retarget the window and its Editing Tool while keeping the Context targeted to its previous target. This enables you to see, in the same window, information on two different classes, and is called isolating the Context.

The choice between merged and isolated behavior is a matter of taste; let's see how you can change it, so that you can set your own preference.

To change the behavior, choose the menu entry

    View --> Isolate context tool

After this, the entry will change to View --> Merge context tool , so that you can later revert to merged behavior. Under isolation behavior, try pick-and-dropping a class or feature into the top Editing Tool; then pick-and-drop a class or feature into the bottom Context Tool. You will notice that each of these operations retargets the affected tool, but not the other.

Customizing the view

If you will often alternate between the merged and isolated behaviors, you can use the Merge/Isolate button of the top toolbar. This button is not present by default on the toolbar, so this is a good opportunity to take a quick look at the user interface customization mechanism, which you can use later to tailor the interface to the exact form you need. Select

    View --> Toolbars --> Customize standard toolbar

(The adjacent entry is Customize project toolbar which provides complementary capabilities under a similar form.) You see a list of available buttons:

The icons in the list on the right are currently displayed in the toolbar, but not those on the left. Among the latter you see (fourth from the bottom on the left-side list) Isolate/merge the context tool . Select it by clicking; this makes the Add -> button active. Click this button to move the Isolate/Merge icon to the list of displayed icons. It becomes the first item of the list, which is fine for the moment. (Later on you can change the order of buttons in the toolbar if you like, by using the Up and Down buttons.) Click OK . The toolbar of your development tool has a new button:

You can now use this button to switch, for the enclosing Development Window, between the isolated and merged behaviors of the Context Tool.

Context memory

If you start repeatedly retargeting the Context Tool -- especially under "isolated" behavior -- you will notice the following properties:

    + In most cases, pick-and-dropping a class to the Context switches the view to the Class Tab, and pick-and-dropping a feature switches to the Feature Tab.

    + The view displayed in each case -- for example Ancestors for the Class Tab and Flat for the Feature Tab -- is default view for the corresponding Tab.

The many paths to retargeting

As a conclusion to this review of Pick-and-Drop let's recapitulate the various ways we've seen for retargeting a whole Development Window or a tool to a class:

    How to retarget | Same window/ tool, or new? | Where described
Type class name, then Enter, in class field at top-left of tool | Same | "Retargeting by name", page 19
Choose class in Cluster tree | Same | "Retargeting from the Cluster Tree", page 23
Choose class in Favorites | Same | "Adding to Favorites", page 27
"Back" button | Same | "Moving back and forth", page 26
"Forth" button | Same | "Moving back and forth", page 26
Pick class from history list | Same | "The Target History", page 27
Pick-and-drop: right-click on class name or graphical representation found in any tool, then move, then right-click. | Existing window/tool (of drop target) | "How Pick-and-Drop works", page 64
Control-right-click on class name or graphical representation found in any tool | New | "Starting a new tool", page 28

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


11 RECOMPILING AND EDITING

Help reading this manual

So far we have relied on existing class texts. Fascinating as it may be to explore excellent software such as EiffelBase, you probably want to write your own too (with the help of the reusable components in the Eiffel libraries). EiffelStudio provides a built-in editor -- as well as the ability to use some other editor if you prefer -- and sophisticated compilation mechanisms.

Recompiling

When we started, we compiled the example system. Let's recompile it, just to see. We'll see compilation entries in the Project menu, but the easiest for the moment is to use the compilation button in the Project toolbar, the lower toolbar in the Development Window:

Click this button. You haven't changed anything in the project since it was compiled (you were not supposed to!), so EiffelStudio will very quickly detect this and finish compilation. On our test platform this takes less than a second. Now of course we should see what happens if you do change something.

Editing

We don't want to touch EiffelBase classes (and in fact can't, since it is used in precompiled form), so let's focus on classes of our small root cluster. In the Cluster tree on the left, expand cluster root_cluster and click class PARENT to retarget the Development Window to it.

Make sure that the Editing Tool is big enough to display the text of the class:

The Editing Tool hosts a text editor which you can use to change the class text. Here the routine display starts by outputting a simple message; let's precede it by another line of display to check that we affected the outcome. We'll want to add the following two lines just after the do , before the first two instructions of the routine:

    io . put_string (" THIS IS SOME ADDED TEXT ")

    io . new_line

They are very similar to the current first two lines of the routine, so you can just use copy-paste: select the first two lines with the mouse, copy them using CTRL- C (or Copy from the Edit menu), then paste them just after the do using CTRL- V (or Paste from the Edit menu). Add or remove tabs to align with the rest of the routine, and change the string to THIS IS SOME ADDED TEXT so that the result will look like what's shown on the next figure. This is all there is to change; the second line remains untouched. Please check the result and be careful not to introduce any mistakes; in the next section we'll study how EiffelStudio will report syntax and other errors, but right now we want to see what happens when everything is right!

Now save your changes; you may indifferently use CTRL- S , the Save entry from the Edit menu, or the Save button highlighted on the figure. (If you forget to save, the next compilation will tell you so, and ask you if from now on you want all non-saved class edits to be saved automatically.)

Recompiling and executing after a change

Next compile again, using the Compilation button (shown on the figure page 71 ). Some "degree" messages appear quickly; EiffelStudio has found out what class has changed and deduced what exactly to recompile -- only a subset of the whole system. So this again will proceed very quickly.

Execute the system again now, using one of the execution buttons (shown on the figure on page 13 ), with or without breakpoints, on the right in the bottom Project toolbar. You will see that the message output by the execution has changed to include the added string.

Views in the Editing Tool

In studying the Context Tool we discovered a number of views of a class text ( "CLASS VIEWS", 7, page 30 ). For convenience, you can also display a number of these views in the Editing Tool, although only the basic Text view is editable. A row of buttons next to the Class and Feature fields lets you choose between them:

You can try some of these view now, although there is nothing exciting to show about class PARENT . Make sure to come back to the Text view -- through the leftmost of these buttons -- so that we can continue exploring the editing facilities.

Basic editing facilities

The editing facilities in the Editing Tool are provided by the EiffelStudio Editor, a specialized tool supporting the development and update of Eiffel texts. As we'll see next, if you have a preferred editor you can use it instead, but the EiffelStudio Editor is worth knowing.

The online documentation provides many more details about editing functions. Here are the essentials.

First, the key property of any interactive system: Undo . You can cancel the latest editing command, or any earlier one performed during the current session, by choosing Undo from the Edit menu, or typing CTRL- Z . To cancel more than one command, apply Undo repetitively; there is no limit to the number of undoable commands within a session. (When you exit EiffelStudio, however, the editing history is lost.) To redo an undone command, use Redo from the Edit menu or CTRL- Y .

Since right now we don't need to do any actual editing to continue this Guided Tour, we suggest that you don't change the text of class PARENT but simply look up the menu entries described next, without actually selecting them. If you do make a change, voluntary or not, you should at the end of this editor discussion perform enough Undo commands to get the text of class PARENT back to its original state.

To copy , cut and paste use the corresponding entries in the Edit menu or the familiar keyboard shortcuts CTRL- C , CTRL- X and CTRL- V .

When you edit text, it will be automatically indented according to standard Eiffel style rules. If you prefer to remain in charge of your own indenting, you can disable this facility through Tools --> Preferences --> Editor .

To indent a sequence of lines, select the lines, then use Edit --> Advanced --> Indent selection . You can also use the Tab key, but only if the selection consists of one or more entire lines; otherwise typing Tab will simply replace the selected text with a Tab character. Shift-Tab will similarly decrease indentation by one step.

To comment out a sequence of lines, select them and use Edit --> Advanced --> Comment or CTRL- K . Conversely, CTRL-Shift- K will uncomment. Also in the Edit --> Advanced menu are "set to upper case", with the keyboard shortcut CTRL- U , and to lower case, CTRL-Shift- U .

Other useful facilities of the Edit --> Advanced menu are:

    + Embed in "if" , or CTRL- I , which will create a conditional instruction and include the selected instructions in it.

    + Embed in "debug" , CTRL- D , which will include the selected instructions in a debug … end instruction, so that their execution becomes conditional on a Debug compilation option.

Search and replace

The editor lets you search for text and replace occurrences, individually or globally. We assume you have seen a text search facility before, so we'll just emphasize some of the less obvious features.

To start a search, make sure the Search Tool is active by clicking the Search button in the top toolbar (this one we'll let you find), using the Edit --> Find menu entry, or type CTRL- F in a Text or Context Tool.

Note that although we are studying Search as part of the Editor, this function also applies to any textual form displayed in the Context Tool; make sure to start a Search from the tool that you want to search.

The Search Tool presents a number of self-explanatory options:

If you select Use wildcards , two characters will be treated specially in the Search for field: a question mark ? will match any character, and an asterisk ∗ will match any sequence of characters.

If you check the Replace with box, a replacement field will appear:

Having filled the two fields, you can elect to replace the last found occurrence, or all occurrences at once.

The Search for field has an associated menu, so that you can reuse a recently entered search string without retyping it.

Let the editor do the typing

Particularly interesting are the editor's automatic completion facilities. Well, particularly interesting for most people: maybe you like your editor to do the gruntwork for you, or maybe you don't. In the latter case -- if you prefer to be in control of all the details -- don't worry: through Tools --> Preferences --> Editor you can easily disable any facility that you don't like. The behavior described here is the default.

The EiffelStudio Editor knows about Eiffel syntax and will recognize syntactic elements as you type them. It will color them according to standard conventions: basic elements in black, keywords in blue, comments in dark red. You can change these conventions through Preferences.

If you start typing a control structure through its opening keyword, such as if , or from for a loop, the editor will automatically display the structure of the whole construct. Here for example is the result if you type the from followed by Return/Enter at the beginning of our example routine:

This has produced the structure of an Eiffel loop: from … until … loop … end . You can then fill in the blanks with the appropriate expression and instructions. The generated lines start with the appropriate number of Tab characters to support the standard Eiffel indenting conventions. If you want a more compact style, follow the from with a space rather than Return. Typing if followed by Return or a space will similarly produce the outline of a conditional instruction.

To start a routine, type the routine name followed by the keyword is and a Return. The editor generates the basic structure of a routine text:

This prompts you to enter the header comment (no self-respecting Eiffel developer even thinks of writing a feature without a header comment). At the end of the header comment, type Return if the header comment continues, otherwise type a down arrow to continue with the indentation for the beginning of the routine, with one of the keywords require , local , do , external , once . Once you type do , followed by a Return or space, the completion mechanism will insert the appropriate end , but other than that it doesn't try to produce an entire routine structure because there are too many syntactical choices (precondition or not, postcondition or not, locals or not etc.).

Also interesting is feature completion , using the CTRL-SPACE key. It works at two levels:

    + You can type the beginning of the name of a feature of the current class, then CTRL-SPACE to get possible completions.

    + Once you have typed the name of a query (attribute or function), either all by yourself or aided by the previous completion technique, you can type a period followed by CTRL-SPACE to get the list of possible features to be applied, deduced from the list of features in the corresponding class (the type of the query).

In both cases, if more than one completion is possible, you will get a menu of the possibilities. You can scroll through it with the up and down arrow keys, or the mouse, and select one through Enter or double-click. You can also or give up through the Escape key.

Here for example is the menu you will see in the body of our example routine if you type io . followed by CTRL-SPACE, where io is the feature, coming from class ANY , that provides access to standard input and output facilities:

The following properties enhance the convenience of the completion mechanisms:

    + If only one completion is possible, no menu appears; the completion is selected.

    + If the cursor is just after the name of a query (which you have fully typed, or obtained through completion), typing CTRL-SPACE once more will produce a period, as if you had typed it.

    + When a menu of possible completions is displayed, typing CTRL-SPACE will select the first of them.

The combination of these facilities means that you can often obtain what you want simply by typing CTRL-SPACE repeatedly.

Also note the following properties of automatic feature completion:

    + The mechanism will only work for queries that were present at the time of the last successful compilation. So if you add an attribute, say attr , to the current class, and do not recompile, typing a -CTRL-SPACE will not display attr . To make sure that it's included in completion proposals, save and recompile. (Remember, incremental compilation is fast in EiffelStudio, so there is nothing wrong in compiling early and often.) The same rule holds for features of other classes, those that will appear in proposed completions after a period.

    + Automatic completion is applicable to features, not local entities or formal arguments.

    + The features proposed for automatic completion include all features of the class: those declared in the class itself, or immediate features, and those inherited from proper ancestors, direct or indirect, with one exception: by default the list will not include features from the universal class ANY , which serves as ancestor to all classes and provides many features for comparison, copying, input-output, reflection etc. Including ANY's features would clutter all menus with too many features. So for example typing i followed by CTRL-SPACE will not suggest io among the possible completions. You can change this policy through Preferences. The policy does not apply to remote feature completion for an entity x declared of type ANY : typing CTRL-SPACE after x . will produce the list of ANY 's features.

Using your own editor

You may have a favorite editor and prefer to use it, at least in some cases. The EiffelStudio incremental compilation mechanism, to be studied shortly, recognizes that files have been modified outside of EiffelStudio (by checking their time stamps) and will without any fuss take their modified versions into account.

You can also call an outside editor on a class from within EiffelStudio. Just use File --> External Editor or the corresponding button in the top toolbar:

This will call the editor of your choice. The default is Notepad on Windows and Vi on Unix and Linux. You can easily change this to any editor by entering the desired editor command in Tools --> Preferences --> Global Preferences . In this command text you can use the two special notations $target and $line ; when EiffelStudio calls the selected command, it will replace any occurrence of $target by the name of the file where the current class resides, and $line by the line number at which the Editing Tool is currently scrolled. If you include one or both of these markers at the appropriate argument positions for the command, this will enable you -- assuming the editor supports the appropriate options -- to make sure it starts at exactly the right place. For example the default editor command under Unix is

    vi +$line $target

meaning: start the Vi editor on the $target file, initially positioned at line $line (the + line_number command-line option of Vi directs it to start at line line_number ).

If you start an external editor on a class, then exit the editor after possibly making changes, EiffelStudio will immediately update the class text in the Editing Tool. More generally, note that EiffelStudio will detect changes made separately on the same class, and warn you of possible conflicts.

Several important text editors from various providers have Eiffel modes , which support the syntax-directed editing of Eiffel texts. They include:

    + Vim , for Vi iMproved, an extension of Vi available on both Unix/Linux and Windows -- see www.vim.org

    + Emacs -- see www.emacs.org.

    + Editeur , a Windows syntax highlighting editor -- see www.studioware.com.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


12 HANDLING SYNTAX AND VALIDITY ERRORS

Help reading this manual

So far we have tried to make sure that everything went smoothly. But in actual software development you may encounter error situations, and it is useful to know what can happen then.

Levels of language description

Let's remind ourselves first of how the language is specified. The book Eiffel: The Language , the language reference, carefully distinguishes between three levels of description: syntax , validity and semantics . Their roles are clearly distinct:

    + Syntax defines the structure of software texts. A typical syntax rule states that an assignment starts with a Writable entity, continues with the symbol := , and ends with an Expression . This is a purely structural specification, saying nothing for example about the types of the Writable and the Expression .

    + Validity , applicable only to syntactically legal texts, defines required consistency conditions. A typical validity rule states that in an assignment the right-hand-side Expression must conform -- a property of its type, defined rigorously on the basis of inheritance -- to the left-hand-side Writable . Eiffel has about 75 validity rules; part of the language's originality is that these rules are of the " if and only if " form, not only telling you individual error cases ("this is valid only if … ") but also reassuring you that your text will in fact be valid if it satisfies the conditions listed exhaustively.

    + Semantics, applicable only to valid texts, defines the software's expected run-time behavior. A typical semantic rule states that an assignment replaces the value of its left-hand-side Writable by the value of the right-hand-side Expression at the time the assignment is executed, with precise rules on the different possible cases involving references, objects and simple values.

You may make an error at any of these levels:

    + Writing = instead of := for the assignment symbol is a syntax error.

    + Writing your_integer := your_real , with the types suggested by the names, is a validity error.

    + Calling a feature on a void target, violating a precondition, causing a division by zero, are semantic errors.

Syntax and validity errors will be detected by the compilation process. For semantic errors, you will rely on contract checking and on the debugging tools described later. Let's look now at examples of the first two cases.

A syntax error

To see what happens for a syntax error, replace the keyword is by ist in the first line of routine display of class PARENT (click the position immediately after the s and type a t .). Save the file by clicking the Save button or using CTRL- S . EiffelStudio parses the class as it is saving it, and finds the error:
The position of the error is highlighted in the class text.

To correct the error, just bring the mouse back to its location, remove the spurious t , and click Save again; also click Compile to make sure that the project is recompiled up-to-date.

You may wonder why the syntax error messages are not a little more verbose than just Syntax error . The reason is merely that Eiffel's syntax, being simple and regular, does not require sophisticated error messages; syntax errors usually result from trivial oversights. If you make a syntax error and the reason is not immediately clear, check the syntax summary in the appendix of Eiffel: The Language .

Avoiding "Gotcha" dialogs

This syntax error message also illustrates a user interface principle present throughout EiffelStudio. At ISE, we believe that you have better things to do than spending your days clicking on OK buttons. Almost all messages that may appear to signal errors, display warnings, or request confirmation are of one of two kinds:

    + Whenever possible, they give you two or more possibilities. A dialog with just one possibility is not much of a dialog. (We'll resist the temptation to be pompous here by recalling the original Greek meaning of " dia " in "dialog".)

    + If EiffelStudio cannot give two possibilities -- as in the case of an error message, for which it must let the user proceed after making sure the message has been seen -- EiffelStudio doesn't force you, like many of today's user interfaces, to acknowledge your sins by clicking an OK button. You simply correct the error and move on.

In the case of our syntax error there is an OK button and you may click it, but you don't have to. It is there mostly to avoid troubling people (almost everyone, that is) who are used to the "Gotcha!" dialogs of the dominant user interfaces. Once you get used to the EiffelStudio style, you won't bother clicking OK for a syntax error: you will correct the error, and when you click Save again the dialog will go away like a bad dream.

A validity error

A validity error is a violation of one of the validity constraints given in Eiffel: The Language . Every such constraint is identified by a four-letter code of the form V XXX (the first letter is always V ).

A validity error will produce a precise error message, which includes the validity code. Although short, the error message is usually sufficient to find out what the error is. If not, you can get the complete rule, straight from the book.

To see this mechanism at work, let us introduce a validity error. There is in fact one ready for you in class TESTROOT . Target a Development Window to this class; at the end of its text, just before the final end , you will find the following comment line:

    -- inv: INVALID

If uncommented, this is a declaration of a feature of type INVALID . A class called INVALID indeed exists in file invalid.e of the root cluster, but it contains a validity error. To see what it is, remove the initial double-dash -- in the above line from class TESTROOT so that it is not a comment any more.

Click Save , then Compile . Compilation starts but after a few degrees it stops with an error message that appears in the bottom Context Tool (you may have to do some resizing to see it in its entirety):

As the error message indicates, you have (shame on you) violated the validity rule VUAR , which requires the number and types of actual arguments in a routine call to match the number and types of formal arguments declared in the routine.

One of the interesting properties of the error message is that everything in color is clickable : class name, feature name, but also the error code. This means that you can start a Pick-and-Drop on any of these elements to find out more.

For example, to see the exact context of the error, pick-and-drop the name of the affected feature, display -- appearing on the fifth non-blank line, after Feature: -- and pick-and-drop it to the top Text window. (As you remember this means: right-click on it and release; move the mouse to the text window, without clicking any button; right-click again. During the move the cursor shows a cross, the symbol for features.) This displays the erroneous feature:

Note on this display a special property of Pick-and-Drop when its source is a feature name appearing in a validity error message: the instruction that causes the error is highlighted.

In the error message in the Context Tool, the error code itself, VUAR , is also clickable. Assuming the message was not sufficient to understand the error, you can use it to start a Pick-and-Drop. Do this now, by picking that code and starting to move the mouse, but not dropping yet:

The icon shape for such information elements is a question mark ? . If it is not on a droppable target, as in the bottom Context Tool, that icon will be crossed. In principle the place to drop is the Explanation hole in the Project toolbar, the only one that remains highlighted during the Move step of Pick-and-Drop:

As is often the case when dropping into a specific hole, you don't need to shoot straight; dropping the pebble anywhere in the Editing Tool has the same effect as dropping it into the Explanation hole:

The result is to display the complete text of the violated rule, straight from the pages of Eiffel: The Language .

The rule has several clauses, numbered. Since the error message showed the error code as VUAR(1) , the violated clause is the first; this convention of showing the clause number in parentheses applies to all multi-clause validity constraints.

To correct the error the easiest is to go back to class TESTROOT and reinstate the comment symbol - - (two consecutive dashes) on the erroneous line. Save and compile to continue with a valid system.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


13 DEBUGGING AND RUN-TIME MONITORING

Help reading this manual

The next set of EiffelStudio capabilities enable you to control and monitor the execution of your systems. The obvious immediate application is to debugging; but the more general goal is to let you follow the execution of your systems, explore the object structures, and gain a better understanding of the software.

A reminder about debugging in Eiffel

Before looking at debugging facilities don't forget that debugging in Eiffel is different. The presence of Design by Contract mechanisms gives the debugging process a clear sense of direction. The speed of the recompilation process makes it easy to recompile after a change; after getting rid of syntax and validity errors, you run the system again, and remaining errors are often caught as violations of contract clauses -- routine preconditions, routine postconditions, class invariants.

The facilities to be described now are also useful when you find such an error, as they will help you study its execution context. In fact, one of the characteristics of the debugging mechanism is that there is no "debugger" proper, no more than there is a "browser"; you have instead a set of facilities supporting controlled execution and debugging. This means for example that:

    + While debugging, you can access all the browsing capabilities to explore the features and classes surrounding the cause of an error.

    + While browsing, you can launch or resume execution, and follow its progress through the debugging facilities.

    + If execution stops on an exception -- assertion violation, arithmetic overflow, call on a void target … -- you have all the environment's facilities at your disposal to understand what happened.

Setting breakpoints

To control the execution you will set breakpoints, indicating places where you want to interrupt the execution. You may set a breakpoint on an individual instruction of a routine, on the routine's precondition or postcondition, or on the routine as a whole, meaning its first operation (precondition or instruction).

A group of icons on the Project Toolbar help control breakpoints. They are known in EiffelStudio terminology as " buttonholes ", meaning that they can serve both as buttons (you can click them to get some functions) and holes (you can pick-and-drop into them to get some other functions).

The labels correspond to the icons' use as buttons: enable all set breakpoints, disable them all, clear all, display information on current breakpoints. The difference between "disabling" and "removing" is that disabling turns off breakpoints until further notice but remembers them, so that you can later re-enable them, whereas "removing" clears them for good.

Target a Development Window to the class TESTROOT and pick-and-drop the name of the procedure make (the first routine, after the declaration of the two attributes o1 and o2 ) to the Enable all icon, used here as a hole. This sets and enables a breakpoint on the routine. Click the button labeled Display info above to get the list of breakpoints, as shown in the next figure.

If the Context Tool is not present, Display info will bring it up. You can get the same effect as that of Display info by selecting the Output Tab in the Context Tool.

This shows that so far you have enabled only one breakpoint. For a finer degree of control, let's look at the feature's flat form. Pick-and-drop make to the Context Tool -- from the Context Tool itself, since its name appears there, or the Editing Tool); this sets the Context to the Feature Tab. Select the Flat view if that wasn't the last one used:

The small circles on the left side of the Flat form indicate breakpoint positions. Empty ones are not set; enabled breakpoints are marked by a circle filled with red. At the moment only one is enabled, corresponding to the first instruction of the routine since, as noted, setting a breakpoint on a routine as a whole means setting it on its first operation.

By (left) clicking on a breakpoint mark, you toggle it between enabled and not set. You can also right-click on a mark to get a menu of possibilities. Try enabling and unsetting a few of these marks; you might get something like this:

The breakpoint mark for the routine's third instruction, create o2 , is red but not filled; this means it is set but not enabled. You can obtain this by right-clicking on the mark and choosing Disable breakpoint on the menu that comes up. Any potential breakpoint will be in one of three states: not set; enabled; set but disabled.

You can see the list of enabled and disabled breakpoints by clicking the Output Tab, or the Display info button in the Project Toolbar.

For the continuation of this tour it doesn't matter which exact breakpoints of make you've set, as long as the one on its first instruction is set and enabled (red-filled circle) as above. Please make sure this is the case before proceeding.

Executing with breakpoints

To execute, you will use the following Run buttons in the Project toolbar, or the corresponding entries in the Debug menu:

The buttons are shown here in full bloom, but at any times some of them will be grayed out. Terminate is only active when execution has started and not terminated; Interrupt is only active when the execution is active (not stopped at a breakpoint).

The Debug menu entries will also remind you of shortcuts: F10 for Step-by-step , F11 for Step into routine , Shift-F11 for Step out of routine , CTRL-F5 for Run without breakpoints , F5 for Run with breakpoints , CTRL-Shift-F5 for Interrupt , Shift-F5 for Terminate .

Start execution of the compiled system by clicking Run with breakpoints . The display automatically switches to accommodate supplementary tools providing debugging information. Execution stops on the breakpoint that you have enabled on the first instruction of procedure make :

The pane at the bottom left indicates that execution has stopped in make . The Context shows the flat form of that routine, with a new icon to indicate the stop point which execution has reached. At the bottom right is a new tool, the Object Editor , which shows the content of current object and (later) related objects. At the moment you can see that:

    + The current object is an instance of class TESTROOT .

    + The class (as you could also see from its text in a Development Window) has two attributes o1 and o2 , for which the corresponding fields in the current object are both void; this is as expected since you haven't yet executed the two creation instructions create { HEIR } o1 and create o2 , as they come after the breakpoint.

    + Along with attributes, an Eiffel class may have once functions , executed at most once -- the first time they are called -- in a given session, and from then on always returning the same value. Here the once function io has been called, returning an object of type STD_FILES , but operating_environment (coming, like io , from the top-level class ANY ) has not yet been called.

The execution-time objects that you may display in an Object Editor are our latest kind of EiffelStudio "development object", along with classes, features, explanations, clusters; notice their distinctive icon, a rectangular mesh suggestion an object's division into fields. It appears colored for actual objects, gray for void references such as operating_environment.

Monitoring progress

Click twice on Step-by-step (or press the function key F10 twice). Monitor, in the flat form of make , the marker that shows execution progress; note that the marker always points to the next operation to be executed. After the two steps, the Context and Object Tools look like this:

The last instruction that you executed is create { HEIR } o1 , meaning create an object and attach it to o1 , but instead of using the declared type PARENT of o1 use its proper descendant HEIR . As a result, the entry for o1 in the Object Tool no longer shows Void but an object of type HEIR . Note that all objects are identified by their addresses in hexadecimal; such an address is by itself meaningless, but enables you to see quickly whether two object references are attached to the same object. The addresses you see as you run the Guided Tour will -- except for some unlikely coincidence -- be different from the ones appearing here.

Note that since the ISE Eiffel garbage collector compacts memory and hence may move objects around, the address of a given object is not guaranteed to remain the same throughout a session.

To see the details of the object, pick-and-drop its identifier in place (that is to say, drop it in the Object Tool itself). A new object entry appears, showing the object:

From the instance to the class

Now try pick-and-dropping that same object, the instance of HEIR , to the Context Tool above the Object window . The effect is the same as if you had pick-and-dropped the class name HEIR : retarget the Context Tool to that class.

In the same way that you can drop a feature pebble into a tool that expects a class, you can also drop an object pebble, which will be understood as denoting the object's generating class.

Because the Context Tool is showing a class, it has switched to the default format for classes, Ancestors , and is showing the ancestors of HEIR . Click the Feature Tab of the Context Tool to set it back to feature information for the continuation of our debugging session. No feature is currently displayed.

Stepping into and out of a routine

Click Step-by-step once more to advance just before the call o1 . display :

Choosing Step-by-step again would execute the next step in the current routine, the call o1 . display , treating the entire execution of display from class HEIR as a single operation. Assume instead that you want to go into that routine and follow the details of its execution. For one thing, you might not know that it's a routine of class HEIR , since o1 is declared of type PARENT and it's only through polymorphism, o1 being dynamically of type HEIR at this point, and through dynamic binding, that the execution ends up calling a routine from HEIR . Of course here it's obvious because of the wording of the create a few lines up, but in many cases, especially all those for which polymorphism and dynamic binding are really interesting, the exact type won't be immediately clear from the neighboring software text.

Click the Step into routine button (or press F11). This brings execution to the beginning of the appropriate display routine in class HEIR :

You can also expand the Call stack pane on the left to see the full call stack, consisting here of only two levels. Minimize it to get the above display back.

Now click Step out of routine (Shift-F11) to finish the execution of display . This brings you back to the next instruction of the calling routine, make of TESTROOT .

Terminating

You may now click the Terminate button (Shift-F5) to end execution. The execution-specific tools go away and the display returns to what it was before execution.

Other debugging capabilities

In this little application nothing runs long enough to give you the time to interrupt it. In a longer-running application you may want to interrupt execution, without necessarily terminating it, while it's running (not stopped on a breakpoint). This is the purpose of the Interrupt button (CTRL-Shift-F5). It will interrupt execution at the closest potential breakpoint position, letting you -- as when execution stops because of an exception -- take advantage of all the debugging and browsing facilities to see what's going on inside the program. You may then restart execution -- with or without breakpoints, single-stepping, out of the current routine, into the next routine -- by choosing the appropriate Run button

In debugging sessions for more advanced applications, you will also find self-explanatory mechanisms enabling you, in addition to what we have seen, to examine all the objects on the "call stack": arguments and local entities of the current routine, its caller, caller's caller and so on.

The combination of these facilities provides you with a level of dynamic information on the execution of your system that matches the static information that the browsing mechanisms studied in preceding sections provide about the system's structure.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


14 COMPUTING PROJECT METRICS

Help reading this manual

In earlier sections we saw how EiffelStudio provides extensive documentation on your systems. That information was qualitative. Project managers and developers will also be interested in quantitative information about their projects. You can get such information through the Metrics Tab of the Context Tool, which enables you to perform a number of operations, detailed over the next few pages:

    + Apply predefined metrics -- number of classes, number of invariants, number of features, number of compilations so far and many others -- to components of a system at various levels including feature, class, cluster, entire system.

    + Define new metrics, through mathematical formulae or boolean selection, and apply them to your project.

    + Store measurement results, as well as metric definitions, into an XML archive that can be stored locally or made available on the Web for future reference.

    + Compare the measurements on a system to those on record locally or on a Web site. ISE has released on its own site an archive recording the metric properties of its basic libraries, available to any other project for comparison.

Methodological observations

Although the field of software metrics is a rich one with an abundant literature, its methodological basis is sometimes subject to question. One should resist the tendency to believe numbers just because they are numbers ("lies, damn lies, and metrics").

Software engineers and their managers expect, however, to reap at least some of the benefits that precise quantification has brought to other engineering fields. Such is the purpose of software metrics, defined as quantitative estimates of product and project properties . Object-oriented development, with the rich software structures that it induces, is a particularly amenable to metric analysis. Even when some of the measures do not seem to bring much by themselves, comparing them to those of other projects may reveal significant peculiarities of a system or of some of its parts.

The metrics capabilities of EiffelStudio were designed with these observations in mind. They result from a conservative approach, where no metric is provided without a credible assumption that it reflects some meaningful project or product attribute. For example, you will find a way to define a new metric as a linear combination of existing ones, but not a way to compute arbitrary arithmetic operations, since it isn't clear that -- say -- multiplying two metrics ever makes sense.

Metric terminology

The following terms are used in the presentation of EiffelStudio metric mechanisms.

A metric -- not to be confused with a measure -- is a quantitative property of software products or processes whose possible values are numbers. A measure is the value of a metric for a certain product or process.

For example, we can evaluate the metric "number of classes in the system", called just Classes , by counting the classes in our system. This yields a measure.

We may distinguish between product metrics , which measure properties of the elements being turned out (code, designs, documentation, bug reports...) and process metrics , which measure properties of the process used to turn them out (salaries, expenses, time spent, delays...). The current metric facilities of EiffelStudio are primarily product-oriented but include a process metric: "number of compilations".

Any metric should be relevant: related to some interesting property of the processes or products being measured, such as cost, estimated number of bugs, ease of maintenance... A metric theory is a set of metric definitions accompanied with a set of convincing arguments to show that the metrics are relevant. Neither EiffelStudio nor this manual provide a metric theory.

The numbers yielded by measures are meaningless unless we describe what they refer to. Every metric is relative to a certain unit , specified as part of its definition. For example the unit for a metric that counts classes, such as Classes , is called CLASS .

EiffelStudio provides a set of predefined units. Some simply serve to count occurrences of certain construct specimens in the software; examples include CLASS , CLUSTER , FEATURE , LINE , … The metric RATIO describes metrics whose values are divisions, for example "average number of classes per cluster", obtained by dividing the number of classes by the number of classes.

Any metric applies over one or more scope types . A scope type is a type of product or process over which the metric is measured; for product metric, examples include feature (meaning that we will compute a metric over a single feature), class , cluster , system . They obey an order relation corresponding to containment order: a feature belongs to a class, a class to a cluster and so on.

A scope is an instance of a scope type. For example a given cluster is an instance of the scope type cluster .

To compute a measure is to apply a certain metric over a certain scope of an applicable scope type. For example we may compute the value of the metric Classes over a certain system.

Kinds of metrics

The EiffelStudio metric framework provides a number of predefined metrics but also enables users to define their own metrics in terms of the predefined ones according to a taxonomy illustrated as follows:

Metrics are divided into elementary and composite:

    + An elementary metric measures the number of occurrences of a certain pattern in the product or process. An example is the number of precondition clauses in a class.

    + A composite metric, defined by a user of EiffelStudio, applies a mathematical or logical formula involving other metrics (elementary or previously defined metrics).

Among elementary metrics, we make a further distinction between raw and derived:

    + Raw metrics are simple counts, built-in into EiffelStudio, of occurrences of certain basic elements. For example Classes , the number of classes, is raw.

    + It is often useful to define a new metric by subjecting a raw metric to one or more selection criteria . For example a class may be either deferred (abstract) or effective (concrete, i.e. fully implemented). This is a selection criterion. Separately, a class may have an invariant, or not; this is another selection criterion, Invariant_equipped . You might want to know the number of classes that are deferred and have no invariant clause; if so, you may define a derived metric by submitting the raw metric Classes to both of these criteria connected by an "and".

The precise definition of selection criterion for a raw metric is: a property with a fixed set of possible values (two or more) characterizing the patterns being counted by the metric. Without the notions of selection criteria and derived metrics, EiffelStudio would need to have predefined (raw) metrics including all possible combinations, such as "deferred and no invariant". This would quickly grow out of hand.

Defining a derived metric

Let us define a new derived metric. In the Context Tool, choose the Metrics Tab. Click the Define new metric button:

In the dialog that comes up, the first tab, selected by default, is the one we want, Derived :

In the Raw Metric entry, currently set to Classes , bring up the menu and select Features . Note the large number of selection criteria applicable to the raw metric Features (number of features), reflecting the many angles under which it is possible to classify features:

Assume you want a metric called Public_functions_full_contracts that counts the number of features that are functions, are exported, and have both a precondition and a postcondition. Enter its name and check the selected criteria:

Click OK to add this new metric to the set of available metrics. It's actually been entered as the default metric to be computed, although we'll compute it only in a short while:

Note that the Unit field indicates the unit automatically assigned to this derived metric, Feature , the same as the unit for the raw metric Features from which you have derived it.

Composite metrics

A composite metrics applies one or more mathematical operators to a set of metrics, themselves either elementary (raw or derived) or already composite. In line with the conservative approach mentioned earlier, EiffelStudio permits only three kinds of mathematical operators:

    + Linear metrics of the form ∑ k i . m i , where the k i are real values and the m i existing metrics (either elementary or basic) with the same unit, other than RATIO . (It would be improper to add two RATIO values since they might be ratios of incompatible things.)

    + Ratio metrics of the form m 1 / m 2 where both m i are previously defined metrics, not necessarily with the same unit, neither of which a RATIO (again because RATIO is a catch-all category for all divisions, so you can't divide further without courting incoherence). The resulting unit is RATIO .

    + Scope comparison metrics that measure the ratio of the value of a given non-ratio metric over two different scope types. For example by choosing the metric Classes and the scope types "cluster" and "system" we can measure the proportion of classes in a system that belong to the current cluster.

Let's define a linear metric Direct_dependents that counts heirs (direct descendants) and direct clients of a class. Click Define new metric again and choose the tab Linear . Bring up the Metric menu:

To define the first term of the sum, select Clients . Do not click the button marked OK (we are not done yet as we need a second term) but instead click the + button next to Metric :

The field at the bottom reflects the current state of the linear combination, which only includes the term Clients , with the default coefficient 1. Now bring up the Metric menu again, choose Heirs this time, and click + again. The expression for the sum appears in the bottom field:

The name of our new linear metric will be Direct_dependents . Enter it into the top field, New_metric_name (if you forget, you will be reminded), and click OK . The name of the new metric and its unit become the defaults in the corresponding fields of the Context Tool.

Let's define one more metric, this time a ratio. We want to know the "branching factor": average number of heirs per class. It will be the ratio of metrics Heirs and Classes . Click Define new metric then Metric ratio :

Select Heirs in the Numerator menu on the left, Classes in the Denominator menu on the right; do not check the box "Display as percentage" at the bottom (we prefer to see the branching factor as a number); enter the metric name Average_heirs , more clear than "branching factor", in the field at the top, and click OK . You now have three user-defined metrics available in addition to predefined metrics, as you can check by bringing up the Metric menu on the Context Tool:

Applicable scope types

The reason Average_heirs is grayed out on the last figure is that it's not applicable to the current scope. Each metric indeed has a minimum "applicable scope type"; for example it doesn't make sense to compute the number of attributes in a feature, since the smallest construct in which attributes appear is a class, bigger than a feature. Similarly, the minimum scope type for Classes (the denominator of Average_heirs ) is Cluster , since we can only start counting classes at that level.

Computing measures

Let's now compute a few measures. These will all be relative to the entire system, so the first thing to do is to change the Scope field of the Context Tool (the second field from the left at the top on the preceding figure) to System , the next-to-last entry on the corresponding menu.

The measures that you get should be identical or very close to those shown next. Differences, if any, may result from changes in the EiffelStudio delivery, especially EiffelBase, or operations that you have performed on the Guided Tour system.

First let's use a predefined metric to compute the number of classes in our system. In the Metrics field bring up the menu and choose Classes --> All . The Unit field is updated to the unit of that metric:

For more clarity, change the name of the next measure in the leftmost top field, set by default to Result1 , to Class_count . Now compute that measure by clicking the Calculate metric button, at the place shown on the above figure. This displays the resulting measure in the field just below:

As you see, our system has 183 classes. Refining the measure -- for example by restricting the scope to certain clusters -- would show that all but a handful belong to the EiffelBase library. But you already know this, so don't perform these measures yet (you can do them later).

Saving measures

When you compute a measure, it's not kept anywhere, and the next measure will displace it. To keep the one you just made, click the button labeled Add measure to the list and save it on the last figure:

The operation has had two effects:

    + It has added the latest measure to the table of currently displayed measure.

    + The first time around, as here, it creates a metrics file; a messages tells us this:

Metric information will be kept in the subdirectory Metrics of the project directory. The generated metric_file.xml file contains both the metrics you have defined, and the measures you have performed. This makes it possible to use it both for:

    + Applying to a new project the metrics that you have defined for an existing one (so that, as you go, you can accumulate a portfolio of useful metrics).

    + Using existing measures as a comparison for new projects.

To obtain more measures, apply the three metrics that you defined earlier -- with names Public_functions_full_contracts , Direct_dependents and Average_heirs -- to the entire system and save the corresponding measures. You can use appropriate names for the results or use the EiffelStudio defaults. The result will be as follows:

Operations on metrics

Click the button labeled Manage metrics on the last figure. This brings up the metric management dialog:

You can use it to rearrange the order of the metrics you have defined (by selecting one of them and clicking Up or Down ) and delete any of them. The Formula field shows the definition -- arithmetic, or boolean -- of the selected metric. The Import button will let you, if you have defined metrics in another project, select the corresponding XML file to add them to those of your current project.

Here (possibly after having tried rearranging the metrics) just click Exit .

Metric archives

What does a measure mean? You don't necessarily know in the absolute, but you might want to compare your results to those of other projects. For example, if you have measured the average number of invariants in classes of your system, you might be curious to know how this compares to ISE's EiffelBase library.

The notion of metric archive addresses this need. You may:

    + As noted above, archive all current measures into an XML file, called a measurement archive.

    + Make this measurement archive available in a shared directory, or as a URL on the Internet.

At any time in a project, select any measurement archive, local or at a URL, as the reference archive; in that case all the measures you perform will be compared to those of the reference archive. You may select various comparison formats: percentage (the default), difference percentage, plain value.

ISE has established a Web site, http://metrics.eiffel.com , as a publicly available reference for metric collections on ISE's own libraries (EiffelBase, EiffelVision, ...). This provides an invaluable source of comparisons for other projects within and without ISE.

Let's see how this works. We'll compare the number of classes in our system to the number of classes in EiffelVision. Click the last button, Compare to archive , in the Context Tool:

This brings up the archive comparison dialog:

You can Browse … to select a local archive (a .xml file) for comparison, but if you have access to the Internet enter the following URL in the File or URL file:

    http://metrics.eiffel.com/vision.xml

If you do not have access to the Web, Browse … instead to the file vision.xml of the documentation directory, which has the same information, although possibly less up to date.

Click the Set button next to Ratio of computed measure to archive to select this format for displaying the comparisons.

Click Close . This updates the display of computed measures as shown by the following figure. All future measures that you perform will be immediately compared to the values in the selected archive if the metric is available on both sides.

The option that we saw in the Compare to archive dialog enables you to define an existing archive as reference for your current and future measurements.

The other two self-explanatory options, shown in the picture of the dialog on the previous page, enable you to create your own archive, and to update an existing one. You can then make this archive available, in a local file or on the Web, for other projects to perform comparisons.

An archive, stored as an XML file, includes both the project metrics and its current measures. The metrics will be made available for import to projects selecting the archive for comparison.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


15 GRAPHICS-BASED DESIGN

Help reading this manual

So far the project modifications that we have made used the text editor in the Editing Tool. We used graphics, but as a way to reflect system structures, not to build them ( "A peek at diagrams", page 21 , and subsequent discussions).

In line with the principles of seamlessness and reversibility recalled at the beginning of this Tour, EiffelStudio's text-diagram interaction is bi-directional. When you make a textual modification, the next incremental recompilation will update the diagram; but you can also work directly from the diagram, and the text will be generated or updated after each graphical operation.

Many people like to use the graphical mechanisms at the beginning of a project, to draft the overall structure of a system in "bubbles-and-arrows" style, then concentrate on text as they get closer to implementation. But there is really no such obligation. At any point in the development, just use the form that is more suited to your taste and to your needs of the moment.

Displaying a cluster view

We are going to play with the root cluster. Make sure the Cluster tree and the Context Tool are up. Also make sure that the Context tool is in Isolate rather than Merge behavior ( "Isolating the context", page 68 ); you can see this by going to the Edit menu : if there is an entry Isolate context tool , select it; otherwise (the corresponding entry reads "Merge context tool") don't do anything, you're fine. (You can also use the Merge/Isolate button added earlier to the Browsing toolbar for this very purpose.)

The earlier diagrams were "class views", giving a picture of the world around a class. For a change, we are now going to start working with cluster views , showing the content of a cluster. Select the Diagram Tab in the Context Tool; from the Cluster Tree, pick-and-drop root_cluster to the Context Tool. This displays the graphical view of the root cluster in the Context Tool:

Hiding a class

First we decide that we don't want to be bothered with class INVALID . We could delete it altogether from the system by pick-and-drop its bubble to the Delete hole. This is not what we want, but try this now to see the confirmation request:

Make sure to answer No to that confirmation request (you want to keep the class even though it wouldn't be a catastrophe to lose it) and instead pick-and-drop the INVALID bubble into the Hide hole. This time there is no confirmation request, since the operation is reversible -- it just affects what's displayed in the cluster view -- and the class is removed from the display:

You can try undoing this change, then redoing it:

You can also click History which, during the rest of the session, will display the list of executed operations, and let you undo or redo many operations at once by clicking the oldest to be kept or the youngest to be redone.

For the rest of this discussion we assume INVALID is hidden.

Adding a class

We are now going to add a class graphically to our system. This means you don't have to worry about creating and initializing a file; EiffelStudio will take care of the details.

The useful button here is New class :

This button is a pebble, meant to be dropped into the diagram. Drop it somewhere above the bubble for TESTROOT ; the exact place doesn't matter, but it has to be within the area of the cluster root_cluster because we'll want our class to part of it. You're asked to name the class:

Overwrite the default name being proposed, NEW_CLASS , by the name HEIR2 , as we are going to create a new heir of PARENT . Don't touch the file name in the second field; as you type the class name EiffelStudio automatically sets the file name to heir2 . e , so you would only set it if you wanted to override the default convention for names of class files.

The new class is now in the diagram, part of root_cluster :

Using conventional drag-and-drop (not pick-and-drop), move the class bubbles for HEIR2 , TESTROOT and PARENT so that the display looks approximately like the following. The double circle around TESTROOT is the BON convention to identify a system's root class.

Adding an inheritance link

Now we are going to make HEIR2 an heir of PARENT . To create inter-class relations, you will select a relation by clicking one of the "Create link" buttons, then use pick-and-drop from the source class to the target class. There are three possibilities:

Click the button marked heir above. Now pick-and-drop from the HEIR2 bubble to the PARENT bubble. (Now you see why conventional drag-and-drop is used to move bubbles: pick-and-drop on the diagram serves to add links between classes).

To convince yourself that the new class has been made an heir of PARENT , in its text and not just in the diagram, pick-and-drop HEIR2 bubble to the Editing Tool at the top to see its text. (You could also control-right-click to the bubble to bring up a new Development Window on this class.) All the code has been generated from your graphical operations: creating the class produced a class template with all the standard style and clauses, and the reparenting operation made HEIR2 inherit from PARENT .

In a moment we'll use this Editing Tool to see how, conversely, EiffelStudio will automatically reflect in the diagram a change made to the text. For the moment go back to the Development Window.

In the Cluster Tree in the top-left pane, you will notice that the name of HEIR2 appears grayed out; so does the name of INVALID :

This is EiffelStudio's way of telling us that these two classes, listed because they appear in one of the system's clusters, are not actually in the system because the root class doesn't reference them directly or indirectly.

Adding a client link

Let's add HEIR2 to the system by making TESTROOT a client of this class. Click the button that selects Client as the next relation to make links (the link creation buttons were shown on page 117 ). Pick-and-drop from the TESTROOT bubble to the HEIR2 bubble. This asks you what kind of client link you want:

This technique gives you many option and in fact is a convenient way to build your classes, whether at the analysis, design or implementation level. Here, fill the fields as follows. For the top choice, keep the default, Attribute ; we'll give class TESTROOT an attribute of type HEIR2 . In the feature clause, which will indicate its export status, replace the default choice NONE by ANY , so that the attribute will be public. For its feature category, keep the choice currently displayed, Access . For its name, replace the default, new_feature , by the name my_heir . In the invariant clause, enter

    my_heir /= Void

to specify the invariant property that this attribute should never be void. Finally, to see how EiffelStudio can generate the full accompaniment to an attribute, check the box Generate set procedure . Click OK .

The diagram -- shown below after a slight move of the bubble for TESTROOT for more readability -- shows that TESTROOT is now a client of HEIR2 . By default it only displays inheritance links; now it has switched automatically to a mode that shows client links as well, so that we also see that TESTROOT is (and always was) a client of PARENT through attributes including o2 .

Now pick-and-drop the class bubble TESTROOT to the top Editing Tool to see how the class has been modified. The situation here is different from what we saw earlier with HEIR2 , which had been generated from scratch by the diagram. Here TESTROOT existed before, in text form; so the diagram mechanisms have had to preserve the existing feature and feature clauses, and add the elements corresponding to what you have specified through the diagram mechanisms. Here is the beginning of class TESTROOT in its updated form:

Note how EiffelStudio has generated both the attribute and the associated "set" procedure, set_my_heir , complete with a precondition -- deduced from the invariant you have specified, my_heir /= Void -- and a postcondition. The unlabeled Feature clause of the existing class has been kept; the new features have been entered into clauses labeled Access and Element change , observing the Eiffel standard for common feature clauses in libraries.

If you look at the end of the class, you will see an invariant clause listing the invariant that you have entered.

Updating the diagram from the text

In this tour of the diagram facilities we have, so far, worked on the diagram and see the text updated immediately. Of course we want full reversibility. So let's make a change in the text and check the diagram.

The change will be very simple. We'll make TESTROOT a client of HEIR . In the top Editing Tool, use the editor to add an attribute declaration

    other: HEIR

without further ado, as this is just a simple check.

If you are concerned about the correctness of the class, you may with to update its creation procedure make to add a creation instruction create my_heir . Without it the just added invariant would be violated upon creation.

Nothing happens yet to the diagram. This is normal: EiffelStudio doesn't update the diagram every time you type some text (which, for one thing, might be syntactically incorrect, or invalid). You need to recompile first. Click the Compile button. Then on the Context Tool click Diagram ; the new relation appears:

If the label other of that relation doesn't appear in the exact place shown here, try moving it using conventional drag-and-drop. You can only move such a link label within a small area on either side of the link.

Creating a cluster

Earlier on, we saw how to create a class from the EiffelStudio diagram, letting EiffelStudio take care of creating and initializing the file. Similarly, you can create a new cluster graphically, and let EiffelStudio create the corresponding directory.

To create a cluster, you can go through Project --> Project settings , or you can click the little Cluster Creation button at the top of the Cluster Tree:

Click this button. The resulting dialog asks you for the cluster name, and the existing cluster (non-precompiled) of which you want to make it a subcluster, here leaving only one choice:

Instead of the NEW_CLUSTER default name, type my_cluster ; select the only possible supercluster, root_cluster , and click Create at the bottom of the dialog.

This technique only allows you to create a new cluster as a subcluster of an existing one. You can create a top-level cluster by going through Project --> Project settings

Recompile the project and bring up the cluster diagram again. It shows the subcluster:

Make sure that the display looks approximately like the above; you may have to resize either or both clusters (drag a corner), and move the small cluster (drag-and-drop).

Moving a class to a different cluster

Among the many operations you can do graphically is to move a class from one cluster to another. Drag-and-drop (again, using conventional drag and drop) the HEIR2 class bubble to the rounded rectangle for MY_CLUSTER . Make sure the bubble fits entirely (that's why we wanted the cluster rectangle to be big enough).

This graphical manipulation has caused a structural change: class HEIR2 is now part of MY_CLUSTER . Check this by expanding the Cluster Tree on the left:

If you like, you can also look into the project directory -- using the Windows Explorer, or cd and ls on Unix/Linux -- and check that it now has a subdirectory my_cluster with a file heir2 . e containing the text of class HEIR2 .

Clearly, it's much more convenient to use EiffelStudio for such manipulations than to move files around manually.

Changing a class name

Here is another operation that would be even more tedious if you had to perform it manually: changing a class name. You must make sure that every reference to the class in the system is updated; but that's difficult to do with a text editor since -- assuming we are changing the name of HEIR to HEIR1 -- you must check references one by one to avoid, for example, changing an occurrence of the word in a string.

Instead, find the icon whose tooltip reads "Change class name and generics":

This is not a button but a hole (as you'll be reminded if you try just clicking it). Pick-and-drop HEIR to it:

As you can see, this dialog also serves to change the name of formal generic parameters when the selected class is generic. Type HEIR1 (or heir1 , EiffelStudio always converts class names to upper case) under New name and click OK .

As EiffelStudio traverses the system to update all references to HEIR , a progress bar appears so that you know what's going on. Everything is updated, including the current cluster diagram, which displays the new name in the class bubble:

Adjusting the display

A number of buttons enable you to customize the display:

So far all class bubbles had the same default color (yellow). Try pick-and-dropping a bubble into the Color hole to get a color palette that enables you to select a different color. This is useful if you want to highlight classes possessing certain properties, for example classes that are part of a certain Design Pattern.

Relation depth enables you to select the depth at which inter-class relations will be displayed. (Don't change this setting now.) Extend to cluster is more useful for class diagrams than for the cluster diagram we have now, which by default included all classes of the cluster; if you click it here it will add the class INVALID that you removed earlier. There is no need to do this now.

Views

So far the top-right View field has always shown DEFAULT . You can define any number of views in your project, and apply them to various class and cluster diagrams.

For example, using the buttons to show and hide links of various kinds

you can produce diagrams that only show the inheritance links, and others that only show the client links. If you want to keep both kinds of diagram, simply define views by typing view names -- such as Inheritance , Client , All_links -- into the View field.

You can also use views to retain some of the choices seen just before, such as different colors and depths.

To load a previously defined view, just use the menu associated with the View field.

You may remember that when we generated HTML documentation, the dialog (page 46 ) asked you to select a view among the available ones. You can choose a different view for each cluster.

Class diagrams, cluster diagrams

Whereas our initial encounter with diagrams at the beginning of this Tour used class diagrams, in the present discussion we have used cluster diagrams. Both are interesting. To obtain a class diagram, you will target a Context Tool to a class, and select the Diagram Tab. By default, this shows the parents of the class. Do this now for TESTROOT :

It's for class diagrams that the Relation depth button is most interesting. It will let you select the exact depth that you wish displayed for every relation:

This will conclude our review of the Diagram facilities of EiffelStudio, although you'll surely discover some further riches by yourself and through the rest of the documentation. We hope the complete seamlessness between text and pictures will enable you to increase the effectiveness of your analysis work, or your design work, or your programming -- whatever level of system development you need to tackle.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


16 HOW EIFFELSTUDIO COMPILES

Help reading this manual

So far we have relied on the compiling capabilities of EiffelStudio without exploring them in any detail. We must now understand the principles behind ISE Eiffel's compiling strategy, in particular how it reconciles fast turnaround, efficient generated code, and strong typing.

Compilation is automatic

Any speed issue aside, the most important property of the compilation process is that it is entirely automatic.

You've seen it from the beginning of this Tour: all the information the compiler has -- obtained from an Ace file, as here, or generated automatically by the other options -- is the name of the root class and the list of directories holding Eiffel clusters. In fact it only needs these directories for non-precompiled clusters; here, since we are using precompiled EiffelBase, the only directory we are required to specify is the one containing the root cluster, denoted simply as " . " (current directory) since, to simplify things, we've started EiffelStudio from the Tour's own root cluster directory.

The compiler takes care of the rest, in particular of finding all the classes that must be compiled.

There is never any need, when compiling ISE Eiffel systems, to supply "Make files", "include files", or other manual descriptions of inter-module dependencies.

Compilation modes

EiffelStudio offers several forms of compilation, which you can see in the entries of the Compile menu (don't trigger any of them right now) as well as keyboard shortcuts and, in some cases, buttons:

    + Melt : quick incremental recompilation, doesn't optimize code for changed parts.

    + Freeze : incremental recompilation, not as fast as Melt, but generates more efficient code for changed parts.

    + Finalize : recompile entire system, generating highly optimized code.

    + Precompile (available both in the Project menu and through Tools --> Precompilation wizard ), to process an entire library, on which many systems can then rely without having to compile it.

You'll quickly learn to use each of these modes to suit your needs.

Criteria

EiffelStudio's Melting Ice Technology reconciles the following goals:

    + Security and efficiency of the generated code : compiling techniques for the strongly typed Eiffel language ensure that compilers can catch many errors before it is too late, and generate more efficient code. The "validity constraints" of the language, whose violations are caught as compilation errors, are particularly useful here, playing the role of enforceable design rules.

    + Quick turnaround : you should experience an almost immediate transition from the time you write or (more commonly) modify software to the time you can execute it.

    + C code generation : for portability, it is useful to take advantage of C in its proper role, that of a portable assembly language. C's closeness to machine concepts -- one of the very properties making it less suitable for human programming except in the case of short routines to access low-level mechanisms --, its almost universal availability, and its good level of standardization, make it an excellent target language for a code generator. This also enables the environment to benefit from the often extensive optimizations performed by good C compilers, and facilitates interfacing new software with the large body of existing C-based systems, tools and libraries. As the final output of Eiffel compilation, you can obtain a complete C package that you can either C-compile on the same machine or port to other platforms, making ISE Eiffel a tool of choice for cross-platform development : develop on one platform, deploy on one or more others.

The Melting Ice Principle

The idea of the melting ice is based on the observation that, for the practicing software developer, the crucial day-to-day compilation problem is not how to process an entire system but how best to process a changed system , of which an earlier state had previously been processed.

The change may be big or small; the system may be big or small. ("Small system" here means up to a few tens of thousands of lines.) This gives four possible cases, of which only one is really critical:

     | Small system | Large system
Small change |  | ∗∗∗
Big change |  |

If the system is small, as in both of the left column entries, speed of recompilation with a good compiler will be acceptable.

In the bottom-right box, the developers have spent days or weeks changing many classes in a large system, so they will not resent having to wait a little to see the results of the recompilation, as long as the time remains reasonable. In EiffelStudio this corresponds, as we'll see shortly, to finalization , which is in fact fairly fast anyway, but not as fast as the incremental modes.

In the day-to-day, minute-by-minute practice of building and modifying software, the case that recurs by far the most often -- and can cause most frustration -- is the one marked ∗∗∗: you change only a small share of a big system. Then the result should come quickly enough. More precisely:

    Melting Ice Principle

    The time to re-process a system after a change should be a function of the logical size of the change, not of the size of the system.

The "logical size" of a change may be different from its physical size because a small physical change in a class may have consequences in many others. Imagine for example that you add a feature to class ANY , although this is an extreme case and won't normally happen. Since every class is a descendant of ANY , the logical change may affect the entire system.

In practice, however, most small physical changes will also be small logical changes and will only cause minimal recompilation. In particular, EiffelStudio will detect that a change does not affect the interface of a class -- for example if it's only a change to non-exported features -- avoiding the need to re-process its clients.

Processing such incremental changes, in time proportional to the logical size of the changes, is known in ISE Eiffel as melting . The reason for this terminology is the metaphor illustrated on the following figure. Think of a compiled system as a block of ice; it may have taken some time to "freeze" -- compile. Now you start working on it again; the changes are like melted drops of water, dripping from the ice as a result of the heat generated by your work.

The Melting Ice Technology ensures that incremental compilation will only process the "melted" part, usually small, leaving alone the "frozen" part, which may be large. This is crucial to the incrementality of the mechanism.

The roles of the four compilation modes follow from this analysis:

    + Melting is the fastest mode: it processes the melted part without affecting the frozen part. With EiffelStudio, the melted elements will be interpreted while the rest is compiled.

    + Freezing is the process of putting back the melted parts into the "freezer": bringing them to the same compiled state as the parts that have not been modified.

    + Finalizing is the non-incremental process of producing a stand-alone C package and the resulting executable, extensively optimized, from the current system.

    + Precompiling is the process of compiling an entire set of reusable classes, once and for all, so that it can be shared by many systems and many users without duplicating the code or compiling it again for each project.

Properties of the compilation modes

The following table summarizes the differences between the four compilation modes:

     | Regenerate C code? | Incremental? | Compilation result shared between projects?
Melt | No | Yes (fast) | No
Freeze | Yes | Yes (but requires C compilation of changes & linking) | No
Finalize | Yes | No | No
Precompile | Yes | No | Yes

During the production and modification of your software, you will usually alternate between melting and freezing, since both of these modes are incremental. Most of the time, you will simply melt , since melting satisfies the Melting Ice Principle: the time to get back to a working system is very short -- proportional to the size of the changes. Note in particular that the unit of melting is the smallest possible one: each feature of a class -- attribute or routine -- may be melted separately.

The main difference between melting and freezing is that freezing implies re-generating C code for the changed elements, and hence relinking the system as well. In contrast, when you melt changes, you do not change any C code: it remains frozen.

As a consequence, melting can only process changes to Eiffel code. If you add new external code (in C, C++ or other languages whose modules will require linking), you must freeze. This is also true if you add new Eiffel agents. If you ask for a Melt in such cases, the operation will trigger a freeze anyway. More generally, the Compile button, which you have used a number of times to recompile the system in this Tour, triggers a Melt by default, and a Freeze when it has to.

EiffelStudio knows how to hide the differences and present you with a uniform view of the frozen parts (the C code) and the melted parts. Here indeed is the full view of the picture that was previously given in part:

When you examine a component of the system -- to edit a class, produce a view such as Contract or Flat Contract, enable a breakpoint on a routine, run the system, inspect a run-time object -- EiffelStudio automatically knows where to look for the corresponding information: melted or frozen part. If one of your actions requires melting or freezing more elements, EiffelStudio will also handle this automatically.

As suggested by the lower red arrow, successive melting operations "pour water into the bowl", corresponding to the elements that you have changed since the last freeze. Freezing, represented by the top red arrow, updates the C code so that it integrates all the latest changes, emptying the bowl in the process.

Because the difference between melted and frozen code is largely invisible to users of the environment, the term workbench code will cover both kinds; workbench code is code resulting from a succession of freezing and melting operations. As long as you are working within EiffelStudio, you are using workbench code.

When you are happy with the results of your development, you will normally finalize the system, thereby generating final code . Although not strictly required, this step is in most cases appropriate since final code is significantly more efficient than workbench code in both time and space: finalization performs a number of optimizations -- dead code removal, replacement of dynamic by static binding -- that wouldn't be justified in incremental development where, for example, some code element that is "dead" one minute may be resurrected the next moment through the addition of just one line of text. In addition, because finalized code is more efficient than frozen code, it is the natural choice if, using ISE Eiffel for cross-platform development, you wish to port the resulting C-package to other architectures.

If you have a set of reusable classes that may be useful to many applications, you can precompile them into a library. This set of classes must be self-contained in the sense that all the classes needed by any of them must be either in the library itself or in another library that you will include in the precompilation.

Bytecode

The result of melting operations -- the contents of the "bowl" -- is an internal software representation known as melted code or (for no particularly good reason) as bytecode . ISE Eiffel bytecode serves two complementary purposes:

    + It can be executed directly. This is what happens during melting: while the rest of your system, the frozen part, is executed in the form produced by Eiffel compilation generation and C-compilation of the result, the melted part is interpreted "as is" without further translation.

    + It can be compiled into C for further processing.

Internally, the melted code is in a file simple . melted (where simple is our project's name) in the subdirectory EIFGEN/W_CODE of the project directory. The file is not human-readable, but as you add elements to your software and melt you watch its size grow. Whenever you freeze, it's emptied.

On the Microsoft .NET implementation of EiffelStudio, bytecode is replaced by that platform's own internal code, MSIL.

Using EiffelStudio without a C compiler

Thanks to melting, it is possible to do Eiffel development without a C compiler. You will simply melt the Eiffel elements that you write. This is known as melt-only mode and assumes that:

    + You do not add new external C functions, which would require re-freezing and linking.

    + You rely on precompiled libraries (such as EiffelBase). The precompilation process itself requires a C compiler, but you can obtain precompiled libraries as part of the ISE Eiffel delivery or download them from eiffel.com .

Degrees

You can now see the reason behind the terminology used to describe compilation steps, called degrees on the messages that flash on the screen when you do a compilation. The names are inspired by the international temperature scale -- Celsius, also known as centigrade -- where water freezes at 0 (and boils at 100, but Eiffel software never reaches that). For EiffelStudio:

    + Compilation starts at degree 6, which examines the clusters of your system to determine what classes may have changed. In many cases the compilation can safely skip part of this degree.

    + Degree 5 parses modified classes. It's executed not only when you explicitly request a compilation, but also when you save a class from the EiffelStudio editor, or exit from an external editor, so that you can see and fix syntax errors without delay.

    + Degrees 4 down to 1 take care of melting.

    + Negative degrees only take place when you freeze or finalize.

    + After negative degrees comes C-compilation if needed.

Using melting and freezing

When should you melt, freeze, finalize or precompile? The answers are simple and follow directly from the preceding overview; they provide the key to getting the environment to work for you in the most effective way possible.

Melting is the bread and butter of the Eiffel developer. As you build your software, either from scratch or by modifying an existing system, you will regularly melt to benefit from the various checks that compilation performs and, of course, to generate executable code that you can test and debug immediately. During this process, there is no need to refreeze, since this operation (although still incremental) takes significantly more time than melting.

Only two operations, noted above, require freezing: the addition of external (non-Eiffel) routines, such as C functions or C++ classes, and the addition of agents. The reason is easy to understand: the EiffelStudio compiler knows how to melt Eiffel software, but not software written in C or other languages; agents similarly require special code generation.

For the first compilation of a system that does not use precompiled EiffelBase, a Freeze is needed since class ANY , from which all other classes inherit, uses some external routines. In this case the environment automatically starts a freeze even if you just click Melt. This does not apply if you have access to precompiled EiffelBase.

Except for the addition of external routines or agents, freezing is never strictly necessary. It is indeed possible to use melting throughout a development, never requesting a freeze after the first compilation. But as the melted-to-frozen ratio grows, you may detect a certain degradation in the performance of the system (determined by how big a share of your system is melted, not how many times you melt it). After a while, then, you may want to refreeze. Like melting, freezing is incremental: only those parts of a system that have been logically changed will be recompiled; as with melting, the determination of what needs to be recompiled is entirely performed by the environment, without any manual intervention on the developer's part.

The principal difference is that freezing takes longer than melting. Because of this you are requested to confirm the first time you freeze. Freeze the example system by choosing the menu entry Project --> Freeze . You get the following dialog:

Note the No option: by default, freezing will start a C compilation, but you can stop after C generation if you wish. This is useful for example if you want to generate a C package for cross-development, C-compiling the result on a different platform.

Click Yes to confirm freeze and C-compilation. Once the Eiffel compilation is complete, a message in the Development Window ( C compilation launched in background ) tells you when that C-compilation has started. C-compilation does not block EiffelStudio: at this point you can continue working with the environment. Any messages from C compiler will appear:

    + On Windows, in a new console that comes up for the occasion (minimize it if you don't want to see the messages).

    + On Unix/Linux and VMS, in the window from which you launched EiffelStudio.

You will be able to execute the frozen system as soon as the C compilation finishes.

You will note that freezing, although it takes more time than melting, is actually quite fast, both due to the speed of Eiffel compilation and to the structure of the generated C code, designed to optimize the operation of the C compiler.

Using finalizing

The main reason for finalizing a system is run-time performance of the generated system. Finalization enables you to generate the high-performance executables that are among the hallmarks of ISE Eiffel. As a consequence, finalized code is the best vehicle for cross-development: you can port the resulting C package to various target platforms and C-compile them on these platforms.

The optimizations performed by finalization affect both space and time:

    + Dead code removal strips the executable module of all the routines in the system that are not actually called, directly or indirectly, by the root's creation procedure. In a large system relying on many general-purpose classes, dead code removal can easily reduce an executable's size by one third or more.

    + Finalization also applies static binding to non-polymorphic calls, and inlines some routine calls.

As long as you continue changing, melting and freezing your system, the workbench compiling mechanisms cannot perform such optimizations: if a routine is "dead" today you may resurrect it tomorrow by adding a new call to it somewhere; and if a call is non-polymorphic a single additional assignment may require dynamic binding. Compilation can only generate optimal code by working on a full, stable system. This is the task of finalization.

Cross-development , the second reason for finalizing, is important if you are taking advantage of the portability of ISE Eiffel to develop your system on a certain platform and then run the result on target computers with possibly different architectures. A target machine may lack an ISE Eiffel compiler (unmistakably signaling its owner's backwardness) but include a C compiler. If the development and target platforms are of different architectures you will need to obtain a copy of the run-time system for the target architecture. The run-time system is also ANSI-C-based, so porting it is usually a straightforward matter.

Note that cross-development does not require finalization, since you can cross-compile a frozen version. In practice, however, the finalized version is usually the preferred form for porting a C package because of the performance advantage.

Finalize the example system now by selecting the menu entry Project --> Finalize . Here too you will be asked to confirm, although the dialog enables you to suppress that confirmation for later attempts, and you may skip C compilation. You will note that finalization is longer than freezing, but still remains quite reasonable thanks to the extensive optimization of the Eiffel compilation process and the structure of the generated C code.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


17 THE COMMAND-LINE COMPILER

Help reading this manual

Along with compilation from within EiffelStudio, it is possible to start compilation from a command line (shell). This is useful in particular to recompile your system automatically as part of a script.

To use the command-line compiler -- ec for Eiffel Compilation -- execute

    ec option … [ class_name ] [ feature_name ]

Specify class_name and feature_name only if you wish to produce information about a class or a feature. Otherwise ec will compile a system according to each specified option . Here is the set of supported options.

    OPTION | ARGUMENTS | EFFECT
-ace file_name |  | Use as Ace the file of name file_name . (Default: file Ace.ace in current directory.)
-ancestors | class_name | Print ancestors of class.
-aversions | class_name, feature_name | Print all versions of feature in ancestors of class.
-callers | class_name, feature_name | Print all routines that call feature.
-clients | class_name | Print clients of class.
-descendants | class_name | Print descendants of class.
-dversions | class_name, feature_name | Print all versions of feature in descendants of class.
-filter filter_name | class_name | Print text of class processed by filter_name .
-finalize |  | Produce finalized version of system (optimized ANSI C code and executable module).
-flat | class_name | Print flat form of class.
-flatshort | class_name | Print flat-contract form of class.
-freeze |  | Freeze system.
-help |  | Print short help message listing options of ec .
-implementers | class_name, feature_name | Print all classes that declare or redeclare feature.
-keep |  | Keep assertions in final mode (useful with -finalize only).
-loop |  | Enter interactive mode where you may repeatedly request ec operations without having to restart ec.
-precompile |  | Precompile system, treating it as a library.
-project file . epr |  | Use the project of which file . epr is the project file.
-project_path directory |  | Create project directory in directory . (Default: current directory.)
-short | class_name | Print contract form of class.
-stop |  | Stop on error. (Default: no.)
-suppliers | class_name | Print suppliers of class.
-version |  | Print EiffelStudio version.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


18 EXECUTING A SYSTEM WITHIN AND WITHOUT EIFFELSTUDIO

Help reading this manual

To complete this study of the compilation process let's see a few more properties of how you can execute an Eiffel system, both in EiffelStudio and as a compiled system that you deliver to its users, who may need to run it without EiffelStudio.

Arguments

Our example system is very simple and has no need for execution arguments. In more advanced cases you may want to pass values to the execution, such as a numeric parameter or a file name, so that you can have different executions without changing and recompiling the software.

In the Eiffel text, you can access such run-time arguments through the Kernel Library class ARGUMENTS . There is another technique -- using the arguments to the root creation procedure -- but using ARGUMENTS is the most general way. Any class of your system can inherit from ARGUMENTS and use queries argument_count to know the number of arguments passed to the execution, and argument ( i ) , for i between 1 and argument_count to access the i -th element. Class ARGUMENTS has more features; since you have EiffelStudio up, you can check the details if you wish (use the contract form).

There are 2 ways to specify execution arguments from within EiffelStudio. The first is through the Project --> Debug/Settings --> Program Execution tab. The second is through the argument dialog which can be opened by right-clicking on any of the debugging or program execution buttons on the main toolbar. The latter is more convenient for quick and easy access to execution arguments.

Executing from EiffelStudio

We have seen how to execute a compiled system from within EiffelStudio: choose one of the appropriate execution buttons, with or without breakpoints.

Executing a finalized system outside of EiffelStudio

A finalized system can be executed on any computer of the appropriate platform; it doesn't need EiffelStudio. The executable version is in the directory

    project_directory /EIFGEN/F_code

where project_directory is the project's directory. The name of the executable file is system_name .exe , where system_name is the name that you have assigned to your system in the project settings (reflected in the Ace file).

The name of our Guided Tour system is simple , so you can locate simple . exe in EIFGEN/F_code for your project, and run it stand-alone if you like.

If you run the system from a command line, and it requires arguments ( simple doesn't), you will provide the appropriate arguments after the command name:

    system_name . exe … arg … .

Because various platforms have different conventions, "relative paths" referenced in your system will mean something different under Unix/Linux, where they relate to the directory from which the command is launched, and under Windows, where they relate to the application's directory.

Executing a frozen or melted system outside of EiffelStudio

A system compiled in "Workbench mode" -- frozen or melted -- is normally meant for execution within EiffelStudio, not for outside delivery, since it is not optimized. If you need to execute it outside of EiffelStudio, make sure that you have access to the system_name . melted file in project_directory /EIFGEN/W_code .

Moving on

With this discussion of compilation and execution we have finished our review of the key capabilities of EiffelStudio. Not everything has been covered, but you are now familiar with the essentials and ready to discover the rest by yourself, both by trying out various capabilities -- most of which should be self-explanatory -- and examining the extensive online documentation that accompanies the product.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


19 APPENDIX: WRITING DOCUMENTATION FILTERS WITH EFF, THE EIFFEL FILTER FORMAT

Help reading this manual

This appendix provides reference information, not needed in simple uses of EiffelStudio.

We saw in the section on documentation ( 8, page 39 ) that you can output documentation about your system in many different formats. A number of predefined formats are available, from Postscript to Microsoft's Rich Text Format, FrameMaker, HTML with and without style sheets, TEX and others. There's nothing special about these formats: they just make their conventions known to EiffelStudio through a filter expressed in a simple notation called EFF, or Eiffel Filter Format. If you have a favorite format that you'd like EiffelStudio to use for producing documentation, you can define your own filter in EFF. Applications include:

    + Producing a variant of an existing format, to support some "house style" that you have defined, such as a different formatting or fonts.

    + Producing documentation for a text processing tool that's not among those supported by default.

    + Producing documentation that purposely omit some parts of Eiffel texts, in line with the ideas applied by the Contract and Flat Contract forms.

This appendix describes EFF and its conventions, enabling you to write filters. Note that in practice the best way to write an EFF filter is usually not from scratch, but by copying an existing filter -- one that seems closest to your needs -- and adapting the copy.

Where to put filters

When you choose to generate documentation, EiffelStudio will ask you to select a filter from a list it obtains by looking up the files of extension . fil in the directory

    $ISE_EIFFEL/examples/studio/filters

To make a new filter available to yourself and other users of this installation, just add the corresponding file name . fil to this directory. Make sure to choose the appropriate name , since this is what the menu of available filters will display.

Filter basics

An EFF filter follows a very simple structure. As with all other Eiffel-related notations (such as Eiffel itself and Lace, the control language for Eiffel systems), any line or part of a line beginning with two consecutive dashes - - is a comment, except if it immediately follows a percent sign since, as will be seen below, %- - is used to denote an Eiffel comment in the class text. Blank lines are also permitted. Comments and blank lines carry no semantic value.

Except for comments and blank lines, a filter is a sequence of entries, all of the form

    Construct | Replacement

where: Construct is one of a set of possible strings, most of which correspond to Eiffel constructs such as Class_declaration or Eiffel keywords such as class ; and Replacement is a string indicating how to format specimens of the Construct that appear in a class text.

For readability, there may be any number of blanks or tabs between the Construct and the vertical bar | , so that you can align all the bars if you wish. On the right of the bar, however, all characters including blanks and tabs are significant, since they are part of the replacement for the Construct .

The asterisk

In the Replacement part, you may use the symbol ∗ (asterisk) to denote the construct specimen itself. So for example the entry

    Feature_clause | %N%N*%N%N

specifies the following formatting for any Feature_clause : two successive blank lines (expressed as %N , New Line, a convention taken from Eiffel); the feature clause itself; two blank lines.

Similarly, in an HTML format, the entry

    External |<B> ∗ </B>

means that the Eiffel keyword external must appear in the filtered form immediately preceded by <B> , the HTML code for switching to boldface, and immediately followed by </B> , the code for reverting to the previous setup. Here you can also write the right-hand side without the asterisks, as <B>external</B> . If, however, all keywords are to use boldface, it is preferable to write a single entry

    Keyword |<B> ∗ </B>

which, thanks to the asterisk, will govern all construct specimens of the Keyword category. You can still override this specification for an individual keyword by including a specific entry for it.

Constructs

The following general syntactic constructs may appear as the left-hand side, Construct , of an entry:

    Class_declaration

    Class_end

    Class_header

    Class_name

    Comment

    Creators

    Escape

    Feature_clause

    Feature_declaration

    Features

    Formal_generics

    Indexing_clause

    Inheritance

    Invariant_clause

    Keyword

    New_line

    Obsolete_clause

    Suffix

    Symbol

    Tab

Most of these denote Eiffel constructs as they appear in the official language reference, the book Eiffel: The Language . Since the Eiffel construct names Feature , Invariant and Obsolete are also keywords and EFF, like Eiffel, is case-insensitive, the EFF construct names use the suffix _clause , for example Feature_clause .

The constructs corresponding to syntactic constructs are self-explanatory. The others are:

    + Class_end , denoting the final end of a class text.

    + Keyword , denoting any Eiffel keyword among those listed in boldface in the corresponding appendix in Eiffel: The Language

    + New_line , denoting any passage to a new line in the class text.

    + Suffix , used to introduce the file extension for the generated documentation files. If you don't specify this, EiffelStudio will use the filter's name as extension.

    + Symbol , denoting any of the Eiffel symbols listed in the corresponding appendix of Eiffel: The Language .

    + Escape , to protect special characters of the external tool, as explained below.

    + Tab , denoting any tab character appearing in the class text.

Keywords

A Construct part may consist of the name of an Eiffel keyword. To see the complete list of possible keywords, look at the template filter, file format.fil-template in the default filter directory $ISE_EIFFEL/studio/filters , which includes all of them with a single asterisk ∗ as the Replacement part.

If entries are present for both the Keyword construct and individual keywords, the individual keyword entries will override the general entry for the keywords listed; the general entry will apply to all other keywords. This makes it possible to have both a general convention for keywords and a special convention for some of them.

Symbols

A Construct part may consist of an Eiffel symbol, such as := , /= and many others. Again, you may see the complete list by looking at format.fil-template . Note the following conventions:

    + % ∗ represents an asterisk. for example as a multiplication operator; the % avoids the confusion with the special meaning of the asterisk for EFF. You can find examples of this convention in the EFF filters for troff and gtroff.

    + Similarly, the Eiffel comment symbol appears as %- - , since just writing - - would introduce a comment in the EFF filter itself.

As with keywords, you may specify a general convention for symbols, defined by an entry for the construct Symbol , and special conventions for certain individual symbols. Specific symbol entries will override the general Symbol convention.

Escape characters

A text processing system or other external tool may attach a special role to characters that may normally appear in Eiffel texts. For example, the braces { and } , used in Eiffel's Export clauses, have a special meaning for TEX. Including them without precaution in TEX input will cause trouble. Similarly, many text processing formats attach a special meaning to the backslash character \ which, although not special for Eiffel, may appear in an Eiffel string.

In such cases the filter must " escape " the special character, that is to say, protect it by other characters. For example troff and other text processing tools treat two successive backslash characters \\ as denoting a single backslash in the text to be output. The first backslash is the escape character, protecting the second one.

The Escape construct addresses such cases. The first character that follows Escape (after one or more blanks or tabs) is the character to be escaped. The string after the vertical bar is the replacement for that character.

Here for example is an escape entry for the backslash in tools that need to escape it through another backslash:

    Escape \|\\

Special characters and strings

EFF uses Eiffel-like conventions, based on the percent sign, for control characters appearing in Replacement parts of entries. Two of these conventions have just been noted: % ∗ to represent an asterisk and %- to represent a dash that does not introduce an Eiffel comment. In addition:

    + %| denotes a vertical bar. (This is necessary since EFF uses | by itself in each entry to separate the Construct from the corresponding Replacement .)

    + %N (recommended form) or %n denotes a new line.

    + %T (recommended form) or %t denotes a tab.

    + %% denotes a percent sign.

    + % (percent followed by a space) denotes a space. This is equivalent to just a space, but more visible.

If c is not one of the characters for which special conventions have been listed, % c denotes the character c itself.

A multi-line entry uses the Eiffel convention for string continuations: % at the end of a line to signal that there is a continuation; a continuation line begins with zero or more spaces and tabs followed by a % ; the characters after the % are the continuation of the string.

.

Previous sectionUp

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


MANUAL IDENTIFICATION AND COPYRIGHT

Title: EiffelStudio: A Guided Tour , ISE Technical Report TR-EI-68/GT. (Replaces TR-EI-38/EB.)

Publication history

First published 1993 as First Steps with EiffelBench (TR-EI-38/EB) and revised as a chapter of Eiffel: The Environment (TR-EI-39/IE), also available as An Object-Oriented Environment (Prentice Hall, 1994, ISBN 0-13-245-507-2.

Version 3.3.8, 1995.

Version 4.1, 1997

This version: July 2001. Corresponds to release 5.0 of the ISE Eiffel environment.

Author

Bertrand Meyer.

Software credits

Emmanuel Stapf, Arnaud Pichery, Xavier Rousselot, Raphael Simon; Étienne Amodeo, Jérôme Bou Aziz, Vincent Brendel, Gauthier Brillaud, Paul Colin de Verdière, Jocelyn Fiat, Pascal Freund, Savrak Sar, Patrick Schönbach, Zoran Simic, Jacques Sireude, Tanit Talbi, Emmanuel Texier, Guillaume Wong-So; EiffelVision 2: Leila Ait-Kaci, Sylvain Baron, Sami Kallio, Ian King, Sam O'Connor, Julian Rogers. See also acknowledgments for earlier versions in Eiffel: The Environment (TR-EI-39/IE)

Non-ISE: special thanks to Thomas Beale, Éric Bezault, Paul Cohen, Paul-Georges Crismer, Michael Gacsaly, Dave Hollenberg, Mark Howard, Randy John, Eirik Mangseth, Glenn Maughan, Jacques Silberstein.

Cover design

Rich Ayling.

Copyright notice and proprietary information

Copyright © Interactive Software Engineering Inc. (ISE), 2001. May not be reproduced in any form (including electronic storage) without the written permission of ISE. "Eiffel Power" and the Eiffel Power logo are trademarks of ISE.

All uses of the product documented here are subject to the terms and conditions of the ISE Eiffel user license. Any other use or duplication is a violation of the applicable laws on copyright, trade secrets and intellectual property.

Any third-party products mentioned in this document are hereby acknowledged as trademarks of their respective owners.

Special duplication permission for educational institutions

Degree-granting educational institutions using ISE Eiffel for teaching purposes as part of the Eiffel University Partnership Program may be permitted under certain conditions to copy specific parts of this book. Contact ISE for details.

    About ISE

    ISE (Interactive Software Engineering) helps you produce software better, faster and cheaper.

    ISE provides a wide range of products and services based on object technology, including ISE Eiffel, a complete development environment for the full system lifecycle. ISE's training courses, available worldwide, cover key management and technical topics. ISE's consultants are available to address your project needs at all levels.

    ISE's TOOLS (Technology of Object-Oriented Languages and Systems) conferences, http://www.tools-conferences.com , are the meeting point for anyone interested in the software technologies of the future.

    ISE originated one of the earliest .NET products and offers a full range of .NET services and training at http://www.dotnetexperts.com .

    For more information

    Interactive Software Engineering Inc.
    ISE Building, 360 Storke Road
    Goleta, CA 93117 USA
    Telephone 805-685-1006, Fax 805-685-6869

    Internet and e-mail

    ISE maintains a rich source of information at http://eiffel.com , with more than 1200 Web pages including online documentation, downloadable files, product descriptions, links to ISE partners, University Partnership program, mailing list archives, announcements, press coverage, Frequently Asked Questions, Support pages, and much more.

    Visit http://contact.eiffel.com to request information about products and services. To subscribe to the ISE Eiffel user list, go to www.talkitover.com/eiffel/users .

    Support programs

    ISE offers a variety of support options tailored to the diverse needs of its customers. See http://support.eiffel.com for details.

Previous, Up, Next Previous sectionUpNext section

Eiffel Home Page (Web) -- Getting started with Eiffel (local)

Copyright Interactive Software Engineering, 2001


Help reading the EiffelStudio Guided Tour

 Eiffel Home Page Eiffel Home Page

Help reading the EiffelStudio Guided Tour (HTML version)

The EiffelStudio Guided Tour uses a number of figures showing screenshots from the actual environment.

To avoid taking up all the space on the page, most screenshots appear in the text in the form of small thumbnails. To see the actual screenshot, just click the thumbnail. This will display the screenshot in a separate browser window.

The screenshot window is always the same one, so you can place it at any convenient position on the screen, and resize it to the appropriate size. We recommend you put the main text window on one side and the screenshot window next to it, so that you can conveniently read the text and see the screenshots as you encounter them.

Browser restrictions

At the moment the Guided Tour displays more accurately under Internet Explorer. We are working towards making it display better with Netscape.


Licenses

  • IFFEL
  • End user License Agreement


End user License Agreement

End user Licence Agreement for the ISE Eiffel Programming System

Carefully read all of the terms and conditions of this agreement prior to opening or downloading the software package, or starting its installation procedure. Opening or downloading the software package, or starting its installation procedure, indicates your acceptance of these terms and conditions.
This software agreement governs your use of THE ISE EIFFEL PROGRAMMING SYSTEM (hereinafter referred to as ISE EIFFEL) from Interactive Software Engineering, Inc., a California Corporation with offices in Goleta, California 93117 (hereinafter Interactive).
By using the enclosed ISE EIFFEL software package, you agree to the following terms and conditions; 1. GRANT OF LICENSE Interactive grants to you a nonexclusive, nontransferable temporary license to use ISE EIFFEL solely on the computer system(s) designated in your purchase order.
2. PERMITTED USES You may use the ISE EIFFEL software solely on the single computer system for which it is purchased. In addition, if the license is for a company of which you are an employee, you may use the ISE EIFFEL software on one personal (home or laptop) computer for each designated company computer system, provided that personal computer is used by the same user as the company computer, and not concurrently with it.
3. PROPERTY RIGHTS a. ISE EIFFEL is copyrighted by Interactive and proprietary to Interactive, and Interactive remains title and ownership of ISE EIFFEL, and all copies of ISE EIFFEL, including the copy of ISE EIFFEL recorded on delivery media.
b. This is not a sale of ISE EIFFEL or any copy. You agree to take all reasonable steps to protect ISE EIFFEL against unauthorized use or copy. You agree not to make copies of ISE EIFFEL or ISE EIFFEL documentation or part thereof other, except possibly as required by backup procedures compatible with industry standards and the enforcement of Interactive's proprietary rights. You must reproduce and include any copyrights, trademark notices and the legends on the backup copy. You must maintain an accurate record of the location of the backup copy at all times.
4. LIMITED WARRANTY a. The ISE EIFFEL software and user manuals are provided "as is" without warranty of any kind, either express or implied, including, but not limited to the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the ISE EIFFEL software and user manuals is with you.
5. EXPORT a. You shall not, without the prior written consent of Interactive, transmit ISE EIFFEL directly or indirectly to any company inside or outside the United States.
b. You hereby warrant to Interactive that you have no intention to and will not, without prior written consent, if required, of the Office of Export Administration of the United States Department of Commerce, Washington, D.C. 20230 transmit directly or indirectly (i) ISE EIFFEL, or (ii) any immediate product (including services produced directly by use of ISE EIFFEL). to countries as prohibited by the U.S. Federal government including without limitation: Afghanistan, The People's Republic of China, or to any Group S, W, Y or Z country specified in Supplement No.1 Section 370 of the Export Administration Regulations issued by the United States Department of Commerce.
6. TERM a. The license is effective until terminated. You may terminate the license at any time by destroying the software and its documentation with all copies or modifications in any form.
b. Upon providing you with thirty (30) days written notice, Interactive may terminate all rights provided under this agreement upon your failure to fulfill any one or more of the terms, conditions and/or obligations imposed by this agreement. Said notice to you shall breach of this agreement and you shall have a one (1) month period in which to cure any breach to the satisfaction of Interactive. In the event the breach is not cured by you, you shall deliver to Interactive all software and materials provided under this agreement, shall make all licensed software that may be stored in any storage unusable and shall certify to Interactive in writing that the same has been completed within that thirty (30) days period. Interactive shall have no obligation to refund any monies paid under this agreement.
7. NO OTHER RIGHTS a. Interactive warrants solely that it grants the rights as provided herein. No license or right relevant to any patent or trademark is herein to be construed as conferred upon you by Interactive by implication or estoppel or any other basis. This is regardless as to whether the rights granted hereunder utilizes invention within existing patent to be issued subsequent to the date of this agreement.
8. MISCELLANEOUS PROVISIONS a. All correspondence shall be directed to Interactive at the following address:
Customer Service Department
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
tel. (805) 685-1006, fax. (805) 685-6869 or through the world-wide Web at http://support.eiffel.com b. This agreement shall succeed any previous agreement relevant to the subject between the parties and shall be controlling.
c. The terms and conditions of this agreement shall be interpreted and enforced according to the laws of the State of California and shall be subject to the appropriate jurisdiction in and of the county of Santa Barbara, California, U.S.A. 9. ACKNOWLEDGEMENT By opening the software diskette, CD or tape package, or downloading the software package or starting the installation procedure, you acknowledge that you have read this agreement, understand it, and agree to be bound by its terms and conditions. You also agree that this agreement is the complete and exclusive statement of agreement between the parties and supersedes all proposals of prior agreements, oral or written, and any other communication between the parties relating to the subject matter of this agreement.


IFELL

The ISE Free Eiffel Library License (IFELL)

(This license describes the terms applicable to the open-source EiffelBase libraries. For the EiffelStudio and other libraries license terms, please refer to the ISE end-user license.)

On August 4, 1998 -- as part of the Eiffel Summit at TOOLS USA '98 -- Interactive Software Engineering (ISE) officially made its flagship EiffelBase library available for free to any organization that wants to use it, for either commercial or nonprofit purposes.

The terms of the new EiffelBase license are given below. Changes since the original version are recorded in the changes section.

We hope that others will be inspired by this example to release their own reusable Eiffel components to the public.

Preamble

(This Preamble is not part of the license.)

EiffelBase is one of the principal contributions of Eiffel: a library of fundamental structures and algorithms covering the basics of computing, and resulting from a "Linnaean" effort at a general-purpose taxonomy of computing structures. We believe that EiffelBase is one of the most carefully designed and extensively used libraries in the object-oriented industry. The library and its design principles are described in detail in the book Reusable Software: The Base Object-Oriented Component Libraries.

EiffelBase is at the center of ISE Eiffel and has been among the major factors attracting users to the technology. In spite of this competitive advantage, ISE officially announced in June of 1998 that it would release the library to the public in source form, under the terms of the license below. There are two main reasons for this initiative:

  • As the software industry seems poised to adopt the idea of reusable components, we feel that EiffelBase provides an ideal basis and are happy to contribute it to the community.
  • We are impressed by the quality of some public-domain software and the effectiveness of the "open source" movement. We hope that the public availability of EiffelBase in source form will encourage many people to take a close look at the classes of EiffelBase, criticize its weaker points, provide improvements, and add their own high-quality contributions.

About the license

After considering existing license contracts for publicly available software, we felt that the GPL (Gnu Public License) as well as LGPL, its variant for libraries, while useful and interesting, were not adequate since they are too restrictive.

In particular a crucial requirement was that the license should allow commercial companies to use EiffelBase (and other libraries that may use this license in the future) in for-profit developments without any fear (justified or not) that GPL-like requirements could cause proprietary elements of their products to come under the open source umbrella themselves.

The closest model was that of the Perl Artistic License, which significantly influenced the terms of the agreement as shown below. It too, however, was not applicable verbatim. EiffelBase was initially designed as a commercial product and then released as free software, a different situation from that of software that was never commercial.

You will note that there are few restrictions on the use of EiffelBase in the license given below. You can use EiffelBase in your academic work and re-publish the source; you can produce a commercial software product using EiffelBase and not owe a cent to ISE.

Ownership

EiffelBase remains an ISE product and will continue to be distributed as such to ISE customers. This means in particular that there is no lessening of our maintenance and support responsibility to our customers under maintenance. In fact, the increased scrutiny and outside contributions will mean an increase of our commitment to develop EiffelBase and of the quality of the product.

The License Text

This is the official license text.

Definitions

"ISE" refers to Interactive Software Engineering Inc.

"The Library" refers to the collection of software texts in the Eiffel language, originally written by ISE, and constituting the EiffelBase library of fundamental computing science structures, as well as any derivatives of these texts as may be created through textual modification (by people) or through translation to lower-level languages (by programs such as compilers).

"Standard Version" refers to the version of the Library maintained by ISE and distributed by ISE to its customers under maintenance.

"You" means any person interested in using, modifying or distributing the Library.

"Source form" means the text of the the Library's classes, in the Eiffel language.

"Object form" means the translation, as performed by a compiler or other program, of the Library or part of the Library into another, usually lower-level code (such as C, assembly language or machine language) intended for execution by a machine.

"Reference implementation" means the latest officially released version of ISE's implementation of the Eiffel language.

Statement of copyright and ownership

1. The Library is the property of ISE and bears ISE's copyright. Any use you make of the Library must respect ISE's proprietary rights.

Right of use

2. ISE hereby grants you permission to do any of the following without payment to ISE, under the conditions of sections 3 to 7 of this Agreement:
    2.1. Use the Library, in source form or object form, as part of any software you develop and distribute to other parties.
    2.2. Distribute the source of the Library to other parties.

Conditions

3. If you use (2.1) or distribute (2.2) the Library, you are encouraged, but not required, to provide to ISE and the rest of the Library's user community any bug fixes or other improvements that you make to the existing classes of the Library. Such changes may be communicated through any appropriate means; it is recommended that you deposit new classes in the FTP directory for contributions, currently

    ftp://ftp.eiffel.com/pub/incoming
and that you present and discuss the changes in the the Library discussion group
    http://talkitover.com/eiffelbase

4. If you produce new classes based on the Library or extending the Library, you are encouraged, but not required, to make them available in the same way.

5. If you use the Library (2.1) in source or object form for producing software that you distribute, you are encouraged, but not required, to include the following mention (or its translation into the language of the rest of the distribution, if other than English) in the documentation of your software, including textual documentation as well as online documentation such as "About..." entries:

    This product includes EiffelBase software from Interactive Software Engineering, used according to the terms of the ISE Free Eiffel Library License (IFELL). See http://eiffel.com and, for the license terms, http://eiffel.com/products/base/license.html.

6. If you distribute the source code of part or all of the Library (2.2) you must:

  • Distribute entire classes, not just extracts.
  • Retain, in the distributed version, the entire copyright notice of these classes.
  • If you need to make any modification to the classes, mark those modifications clearly in the class texts.
  • Ensure that the text remains valid Eiffel. Note that this license does not authorize you to distribute versions of the Library restated in other programming, analysis or design languages, except if mechanically translated from the source form by an Eiffel compiler, in which case they fall under "object form". For any non-mechanical adaptation to other languages you must obtain authorization from ISE. "Valid Eiffel" includes the language described in the latest edition or printing of the book Eiffel: The Language (Prentice Hall), plus any changes or extensions that have been approved by the Nonprofit International Consortium for Eiffel (NICE) or have been accepted for discussion by the Language Committee of NICE, provided they are accepted by the reference implementation.
  • If ISE releases a new version of the Library, you must, no later than six months after the release of that version, either: (A) update your distribution to the new version; (B) add the following notice to all files in your distribution: "This is an obsolete version of EiffelBase. The latest version is available from http://eiffel.com"; or (C) cease distributing your version.

You may not charge any fee for the distribution of the Library (source or binary), although you may charge for software that includes the Library in whole or in part as per the other provisions of this Agreement.

7. You may not use the name of ISE to endorse or promote products derived from the Library without specific prior written permission.

8. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Changes

(This list of changes is not part of the license.)

General note on changes: as usage of free EiffelBase grows and more people contribute to it, some terms of the license text may occasionally have to be changed in light of this accumulated experience and of comments received from users and contributors. It is our intention to ensure that

  • (1) Any such changes will be minor, affecting the details of the licensing rather than the spirit of IFELL.
  • (2) If they affect the substance of the license in any way, they go in the general direction of extending, not restricting, the rights of users of EiffelBase.

Should a question arise regarding use of EiffelBase, the terms to be applied are those in effect at the time of use, disregarding any later change.

28 June 2000: in response to comments by Joachim Durchholz through Patrick Schoenbach, replacement of most occurrences of the word "EiffelBase" by "the Library" to facilitate application to other libraries.

7 May 1999: in response to comments by David Broadfoot on the ISE Eiffel user list, rewording of the explanation of why we are applying more liberal terms than GPL-style licenses. regarding fears of contamination with the Gnu Public License.

6 May 1999: following comments by Ed Avis and Alexander Kjeldaas, we now permit distribution maintainers to continue distributing an old version as long as they mention clearly that it's obsolete.

7 April 1999: following comments by Loryn Jenkins and Ed Avis, removal of the requirement that bug fixes and improvements be provided back to the maintainers of the library. This requirement has been changed to a mere encouragement, facilitating use of the library. Of course it is in everyone's interest to report bugs and improvements.

7 April 1999: following comments by Loryn Jenkins, loosening of the definition of "valid Eiffel". This change also caused addition of the notion of reference implementation. The purpose is to avoid crippling EiffelBase by preventing it from utilizing innovative language constructs and corrections in the language contributions. Such language extensions are OK as long as they have been accepted for discussion by NICE and are supported by the reference implementation.

1 April 1999: following some comments by Richard Stallman, addition of a qualification ("justified or not") to the notes regarding fears of contamination with the Gnu Public License. Our intention is not to criticize the GPL but simply to note that the GPL does cause some fears, "justified or not", among commercial developers.


Libraries

ISE Eiffel is all about reuse. Thousands of reusable components help you develop your applications by standing on the shoulders of previous developers. Here is the documentation on the principal libraries:

  • EiffelBase: ISE's acclaimed open-source library covering the fundamental algorithms and data structures of computing science.
  • EiffelCOM: your tool of choice for building and using Microsoft COM components.
  • Eiffel2Java: Java interface library.
  • Lex&Parse: lexical analysis and parsing libraries.
  • Net: the client-server library for exchanging object structures across the network, between identical or different machine architectures.
  • Store: object-relational database interface library.
  • Thread: multi-threading library.
  • Time: time and date library.
  • Vision2: the extensive multi-platform graphical library for producing modern GUI applications that will run on Windows as well as Unix, Linux, VMS and other X-based platforms.
  • Web: Web interface library with support for easy development of CGI scripts in Eiffel.
  • WEL: powerful graphical library for Windows platforms.


EiffelBase

Type: Library
Platform: Any
Version: 5.0
Availability: Open Source, IFFEL License.

See:

  • Introduction
  • Content
  • Samples
  • Reference


EiffelBase Introduction

Overview

EiffelBase, covered by the open-source IFFEL License, is one of the principal contributions of Eiffel: a library of fundamental structures and algorithms covering the basics of computing, and resulting from a "Linnaean" effort at a general-purpose taxonomy of computing structures.

Components

  • The Kernel cluster include core classes used in all Eiffel systems. These include a universal class providing facilities potentially useful for all classes: ANY. Every class is a descendant of this classes. The kernel also defines classes needed for exception handling, standard arithmetic operations, hashable elements for use with hash tables and basic arithmetic conversions.
  • The Data Structure cluster provides implementations of fundamental data structures and algorithms: Abstract structures, describing broad categories; lists in their various forms; list elements; circular chains; sorted sets and lists; various trees and binary trees; cursor trees; hash tables (dictionaries); various stacks, queues and priority queues; and more.
  • The Support cluster provides helper classes for specific needs. These needs include basic math support, random numbers generation, and a few other topics such as the list of ASCII constants.
  • The Dynamic External Shared Call (DESC) cluster provides mechanisms to call DLL functions at runtime.


EiffelBase Content

EiffelBase Library Content

EiffelBase, covered by the open-source IFFEL license, is one of the principal contributions of Eiffel: a library of fundamental structures and algorithms covering the basics of computing, and resulting from a "Linnaean" effort at a general-purpose taxonomy of computing structures. EiffelBase is one of the most carefully designed and extensively used libraries in the object-oriented industry.

The EiffelBase library includes:

  • A Kernel that defines the core classes of all Eiffel systems.
  • A Data Structures cluster including classes for all the major data structures (sets, lists, tables etc...)
  • A Support cluster that provide access to the environment, basic math operations and a few other helper classes.
  • A Dynamic External Shared Call mechanism to call functions in DLL at runtime (Windows specific).


EiffelBase Kernel

The Kernel

In addition to basic concepts close to the language level, the Kernel covers such common needs as input and output, storage and retrieval of objects on persistent storage, fine control over exception handling and memory management, and access to operating system facilities. The kernel can be divided into 5 logical clusters of classes:

  • The first cluster contains the universal class defining facilities accessible to all other classes: ANY. Every developer-defined class is a descendant of this class.
  • The second cluster includes classes whose facilities are directly related to language concepts:
    • Classes describing the basic types: BOOLEAN, CHARACTER, INTEGER, REAL and DOUBLE
    • Arrays: class ARRAY
    • Tuples: class TUPLE
    • Strings: class STRING
    • Basic facilities: class BASIC_ROUTINES
  • The third cluster provides input and output facilities:
    • STD_FILES offers basic mechanisms, sufficient for simple input and output.
    • FILE describes the notion of sequential file, viewed as a sequence of characters and fully integrated in the data structure library.
    • DIRECTORY gives properties of directories (files serving as collections of other files).
  • The next cluster, through class STORABLE, makes it possible to store object structures on persistent storage and retrieve them later. This facility can also be used to transmit object structures through pipes or over a network.
  • The last cluster provides access to internal properties of the compiler and environment, useful for applications that need some fine-tuning of the basic mechanisms:
    • Class EXCEPTIONS (complemented by UNIX_SIGNALS for Unix-type platforms) provides control over the exception handling mechanism, in particular for applications that need to handle different types of exception in different ways.
    • Similarly, classes MEMORY and GC_INFO provide ways to control the garbage collector and tailor it to specific needs.
    • Class ARGUMENTS gives access to the command-line arguments.

UNIVERSAL CLASS AND ITS FEATURES

The Eiffel inheritance mechanism is set up in such a way that every class is a descendant of a Kernel Library class called ANY. The features of this class provide a number of generally applicable facilities covering such needs as comparison, copying and rudimentary input and output.

The structure of universal classes

Every class which has no inheritance clause is understood to have an inheritance clause of the form
inherit
   ANY

As a result, every developer-defined class is a descendant of ANY. You may introduce your own project specific features in ANY so that all the classes of your system will be able to use these features.

Using the universal classes

If you need to rename or redefine a feature inherited from one of the universal classes, you should include an explicit inheritance clause, as in
class
   C
inherit
   ANY
      rename
         out as basic_out
      redefine
         print
      end
   ...
feature
   ...
end

The features of ANY are usable in both qualified and unqualified form. For example, the argumentless function out, which produces a printable representation of any object, may be called under either of the forms
x := out
x := a.out
The first call yields a printable representation of the current object; the second, which assumes that a is not void, yields a printable representation of the object attached to a.

Input and output features

Some of the features of ANY cover common input and output needs.
Feature io, of type STD_FILES, gives access to standard input and output facilities. For example, io . input is the standard input file and io . new_line will print a line feed on the standard output. Feature io is declared as a once function which, when first called, returns the value of an instance of STD_FILES that provides access to the standard input, the standard output and the error output. As a result, io is never void, so that operations such as io . new_line are always possible.
Function out, of type STRING, is a universal mechanism for obtaining a simple external representation of any object. For non-void x of any type, the string x. out is a printable representation of x. This works for x of all types, reference or expanded. For example, if x is an integer expression, x. out is its string representation, such as -897; if n is a non-void reference, x. out is (recursively) the concatenation of the result of applying out to the successive fields of the attached object, each labeled by the name of the corresponding attribute. You may redefine out in any class to specify any suitable format for displaying instances of the class. To obtain the default representation regardless of any redefinition of out, use tagged_out, declared as a frozen synonym of the original out.
The call print (x) will output the value of x. out on the default output if x is not void, and do nothing otherwise.

Copy and comparison routines

Procedure copy copies the fields of an object onto those of another. It is used under the form
target.copy (source)
Here both target and source must be non-void; this means that copy is only good for copying onto an object that already exists. If you need both to allocate a new object and to initialize it as a copy of another, use the function clone. For non-void source, the assignment
target := clone (source)
starts by creating a new object. If source is void, target will be made void too. The boolean function equal compares two objects for field-by-field equality. This is different from the equality operators = and /= which, in the case of reference types, compare references, not objects.
The function deep_clone produces a duplicate of an entire object structure. The boolean function deep_equal determines whether two object structures are recursively identical. These routines are the deep counterparts of the shallow copy and equality tests provided by clone and equal.
A class that needs a specific notion of equality and the corresponding copy semantics may redefine copy and is_equal (from which equal follows, since equal (a, b) is defined as a. is_equal (b) for non-void a). You will find such redefinitions in a number of classes of the Base libraries. For example an instance of STRING is a string descriptor containing a reference to the actual character sequence, not that sequence itself, so that what the default equal compares and the default copy copies is the descriptor, not the string. Class STRING redefines these routines to yield the semantics normally expected by string clients; the frozen variants standard_copy and standard_equal, originally declared as synonyms to equal and copy, remain available with the default semantics.
The function clone is defined in terms of copy, and so will follow any redefinition of copy. This makes it impossible to change the semantics of one but not of the other, which would be a mistake. The variant standard_clone is defined in terms of standard_copy.

Type information

The string-valued query generator, applied to any object, returns the name of the object’s generating class: the class of which it is an instance. The boolean function conforms_to makes it possible to test dynamically whether the type of an object conforms to that of another - that is to say whether the first one’s generator is a descendant of the second one’s.
These two features enable clients to ascertain the dynamic type of an entity at runtime. They are only useful for low-level components; the normal mechanism for type-dependent operations is dynamic binding.

Miscellaneous

The query Void, of type NONE, denotes a reference that is always void - not attached to any object.
Procedure do_nothing does what its name implies.
Function default also has an empty body; its result type is like Current, so what it returns is the default value of the current type. This is mostly interesting for expanded types, since for reference types the default value is simply a void reference.

LANGUAGE-RELATED FACILITIES

A number of classes offer facilities which are very close to the language level. Here too the book Eiffel: The Language covers the classes in detail, so we can satisfy ourselves with a quick summary; the flat-short forms appear in part C.

Basic types

The basic types BOOLEAN, CHARACTER, INTEGER, REAL and DOUBLE are defined by classes of the Kernel library.
In reading the class specifications for the numeric types INTEGER, REAL and DOUBLE, you might think that the type declarations are too restrictive. For example the addition operation in class REAL reads
infix "+" (other: REAL): REAL

but there is actually no problem here. A language convention applicable to all arithmetic expressions, the Balancing rule, states that in any such expression all operands are considered to be converted to the heaviest type, where DOUBLE is heavier than REAL and REAL is heavier than INTEGER. So mixed-type arithmetic, consistent with common practice, is possible and indeed frequent.

Arrays

To create and manipulate one-dimensional arrays, use class ARRAY of the Kernel Library. Arrays are not primitive language elements; instead, they are handled through class ARRAY. This class is “normal” in the sense that it may be used just as any other class by client and descendant classes. It is also somewhat special, however, in that the Eiffel compiler knows about it and uses this knowledge to generate efficient code for array operations.
To create an instance of ARRAY, use the creation instruction
create my_array.make (1, u)
where the arguments indicate the lower and upper bounds. These bounds will then be accessible as my_array. lower and my_array. upper. The number of items is my_array. count; feature capacity is a synonym for count. The class invariant expresses the relation between count, lower and upper.
To access and change the item at index i in array a, you may use features item and put, as in
x := my_array.item (i)
my_array.put (new_value, i)
Function item has an infix synonym, infix " @ ", so that you may also write the first assignment above more concisely as
x := my_array @ i

Features item, infix " @ " and put have preconditions requiring the index (iin the above calls) to be within the bounds of the array. This means that you can detect bounds violations (which correspond to bugs in the client software) by using a version of class ARRAY compiled with precondition checking on. The bounds of an array may be changed dynamically through procedure resize. Previously entered elements are retained. Rather than an explicit resize, you may use calls to procedure force which has the same signature as put but no precondition; if the index is not within the current bounds force will perform a resize as necessary.

Optimizing array computations

CAUTION: Although ARRAY benefits from an efficient implementation, its more advanced facilities such as resizing do not come for free. For extensive computations on large arrays, an optimization may be desirable, bypassing these facilities. The technique yields loops that run at about the same speed as the corresponding loops written in C or Fortran (the usual references for array computations). It is of interest for advanced uses only, so that you may safely skip this section on first reading unless your domain of application is numerical computation or some other area requiring high-performance array manipulations.

The optimization relies on the class SPECIAL, used internally by ARRAY but of no direct interest to client developers in most common uses. With the declarations
my_array: ARRAY [SOME_TYPE]
direct_access: SPECIAL [SOME_TYPE]
you may use direct_access in lieu of my_array within a critical loop, provided none of the operations may resize the array. Typically, the operations should only include put and item. In such a case you can use the following scheme:
direct_access:= my_array.area
-- The critical loop:
from
   some_initialization
   index := some_initial_index
until
   index = some_final_index
loop
   ...
   x := direct_access.item (index)
   ...
   direct_access.put (some_value, index)
   ...
end

This replaces an original loop where the operations were on my_array. Feature area of ARRAY gives direct access to the special object, an instance of SPECIAL, containing the array values. Features put and item are available in SPECIAL as in ARRAY, but without the preconditions; in other words, you will not get any bounds checking. Instances of SPECIAL are always indexed from zero, in contrast with arrays, whose lower bound is arbitrary, 1 being the most common value. But rather than performing index translations (that is to say, subtracting my_array.lower from index throughout the loop) it is preferable to use the following simple technique: if the lower bound lb of my_array is 1 or another small integer, use 0 as lower bound instead when creating my_array, but only use the positions starting at lb. You will waste a few memory positions (0 to lb-1), but will not have to change anything in your algorithm and will avoid costly subtractions.
It is important to note that this optimization, if at all necessary, should at most affect a few loops in a large system. You should always begin by writing your software using the normal ARRAY facilities; then once you have the certainty that the software is correct, if you detect that a large array computation is hampering the efficiency of the system, you may apply the above technique to get the fastest performance out of that computation. The change to the software will be minimal - a few lines - and will be easy to undo if necessary.

Tuples

A new Kernel Library class is introduced: TUPLE.
Alone among all classes, class TUPLE has a variable number of generic parameters. TUPLE, TUPLE [X], TUPLE [X, Y], TUPLE [X, Y, Z] and so on are all valid types, assuming valid types X, Y, Z and so on.
Conformance rules:

[CONF1]
    For n >= 0
        TUPLE [U1, U2, ..., Un, Un+1] conforms to
        TUPLE [U1, U2, ..., Un]

      (and hence to TUPLE [T1, T2, ..., Tn] if each of the Ui conforms to each of the Ti for 1 <= i <= n.)

In particular all tuple types conform to TUPLE, with no parameter.

[CONF2]
    For n >= 0
        If *every* one of the types T1, T2, ..., Tn conforms
        to a type T, then TUPLE [T1, T2, ..., Tn] conforms
        to ARRAY [T].

Definition: a "tuple type" is any type based on class TUPLE, i.e. any type of the form TUPLE [T1, T2, ..., Tn] for any n (including 0, for which there is no generic parameter).

    (Note 1: CONF1 should be understood in terms of the underlying mathematical model. Mathematically, TUPLE [T1, T2, ..., Tn] is the set TUPLEn of all partial functions f from N+ (the set of non-negative integers) to T1 U T2 U ... Tn, such that:
    • The domain of f contains the interval 1..n (in other words, f is defined for any i such that 1 <= i <= n).
    • For 1 <= i <= n, f (i) is a member of Ti.

    With this definition, TUPLEn is indeed a subset of TUPLEn+1, and in particular TUPLE0, the empty set, is a subset of TUPLEn for any n.)

Semantics: an instance of TUPLE [T1, T2, ..., Tn] is a tuple whose first element is an instance of T1, the second element being an instance of T2 etc. (The precise definition is the mathematical one given in note 1.) Note that there can be more than n elements to the tuple: for example a tuple with first element 5 and second element "FOO" is an instance of all of the following tuple types: TUPLE; TUPLE [INTEGER]; TUPLE [INTEGER, STRING].

    (Note 2: It may seem restrictive at first to permit only one class, TUPLE, to have an arbitrary number of actual generic parameters. Why not have a general mechanism for declaring any class C so that all of C [X], C [X, Y] etc. are valid? But in fact this is not really a restriction. To obtain this effect without any complicated language convention, just declare C as
        C [G -> TUPLE]

    and then use the generic derivations

        C [TUPLE [X]]
    C [TUPLE [X, Y]]
    and so on. This also makes it possible to have the effect of some fixed parameters and some variable ones, as in
        C [G, H, I -> TUPLE]

    so we have all the necessary flexibility.)

Tuple expressions

Let e1, e2, ..., en be expressions of respective types T1, T2, ..., Tn. Then the expression
    [e1, e2, ..., en]

denotes an instance of TUPLE [T1, T2, ..., Tn], whose first element is e1, the second element being e2 etc.
Tuple expressions can be nested: whereas

    [1, 2, 3]

is a tuple with three elements (representing an instance of TUPLE [INTEGER, INTEGER, INTEGER]),

     [1, [2, 3]]

is a tuple with two elements, the second one itself a tuple; the overall expression represents an instance of TUPLE [INTEGER, TUPLE [INTEGER, INTEGER].
As a special case of tuple expression syntax, the delimiters [ and ] are replaced by parentheses for the tuple representing the actual argument list of a routine call (see section 4).

Tuple features

The exact specification of class TUPLE will be described in an addition to ELKS. The principal features are:

  • count (number of significant elements)
  • item (i), with the obvious precondition: the i-th element, of type ANY (since the value of i is not known at compile time); also first, second, third, fourth and fifth, of the appropriate types.
  • put (x, i), with the obvious precondition: replace i-th element with x. If argument x is not of the appropriate type Ti there is no effect.
  • is_equal: redefined to consider only the first n elements, where n is the smaller length.

Other features under consideration include:

  • stripped (i): a tuple of type TUPLE [T1, T2, Ti-1, Ti+1, ..., Tn], derived from the current one by removing the i-th component, again with the obvious precondition.
  • wedged (x, i): a tuple with one more element, inserted at position i.
  • infix "+": tuple concatenation
  • infix "++": element concatenation; t ++ x is the same thing as t.wedged (x, t.count + 1).

What have we gained?

First we have solved the only case in the Eiffel language in which an expression has no precisely defined type: polymorphic manifest arrays. We don't have manifest arrays any more, but manifest tuples, with a precisely defined type. No incompatibility is introduced thanks to rule CONF2. The original syntax for manifest arrays, Result := <<e1, e2, ..., en>>, will continue to be supported.
Second, we can define functions that return multiple results. This is a quite significant increase in expressive power. No common language has that. (You have to go to Lisp and functional languages.) Just define TUPLE [...] as the result type; in the function, you will write things like

     Result := [e1, e2, ..., en]

Also, from a theoretical viewpoint, feature calls are simpler and more homogeneous: every feature takes exactly one tuple as argument and returns exactly one tuple as a result. (Either of these tuples may be empty: the first for a feature with no argument, the second for a procedure.) The syntax for a call becomes

    Feature Arguments

with Arguments defined as

    Tuple_expression

where the Tuple_expression uses the form given in section 2 but with the outermost [ and ] delimiters replaced by parentheses to conform to usual practice. So the call

    f (a, b, c)

which we continue to think of as having three arguments a, b and c, formally has only one tuple argument [a, b, c]. This is of course not to be confused with a call of the form

    g ([a, b, c])tr

which has one argument (a tuple with three elements) in both the ordinary and the formal sense.

Active, iterators, numerical applications, introspection

For a set of important applications of tuples see the book chapter on agents and iterators which also covers aspects of numerical software and related topics following from the tuple mechanism.

Temporary limitations

The implementation of tuples has the following limitations:

  • Conformance of ARRAY types to TUPLE types is not yet fully supported.
  • Class TUPLE does not have features such as first and second. You must use item and, in most cases, an assignment attempt.

Strings

Strings are handled by class STRING, similar in many respects to ARRAY. Strings are of arbitrary size. The make creation procedure takes an integer argument, as in
s, s1, s2, s3: STRING
...
create s.make (30)
The argument indicates the number of characters for the initial allocation. This is not an absolute limit: the string will automatically grow or shrink as a result of future operations. You may always request a resizing explicitly by calling procedure resize.

String descriptor

The object attached at run-time to an entity such declared of type STRING is not the actual sequence of characters but a string descriptor, which contains a reference to the actual string contents.
As a result, four assignment or assignment-like operations are possible:

  • A1 s1 := s
  • A2 s2. share (s)
  • A3 s3 := clone (s)
  • A4 s4. copy (s)

As illustrated below, A1 is a reference assignment: s1 will be attached to the same descriptor as s. A2 keeps the descriptors distinct, but make them refer to the same sequence of characters. A3 uses the redefinition of clone for class STRING: s3 will be attached to a new string, completely distinct from the string attached to s1 although made of identical characters. A4 has almost the same effect as A3, but is only applicable if s4 was not void, and will override the existing descriptor rather than creating a new one.

fig. 1: Effect of string assignment and copy operations

BASIC_ROUTINES provides a number of conversion functions, such as charconv.

FILES, INPUT, OUTPUT

A few classes of the Kernel Library support file manipulation, input and output: STD_FILES, FILE, DIRECTORY and UNIX_FILE_INFO. For simple applications it suffices to use STD_FILES, but to understand the concepts better it is preferable to look first at the other two.

General files

FILE describes the notion of sequential file viewed as a data structure which fits in the general taxonomy of EiffelBase.
The class declaration defines files as unbounded sequences of characters. This means that you will find in FILE all the operations on sequential data structures that you have come to know and love by reading this documentation - at least, all that apply. Just as stacks and linked lists, files have put, extend, has, item and so on. More specific to files are the typed input and output operations. For output, you will find put_character, put_integer, put_real, put_double and put_string, as well as new_line. For input you will find read_integer and its co-conspirators.

Caution: Note the application to input features of the command-query separation principle.
The input features such as read_integer do not by themselves return a result; they set the values of queries such as last_integer. So the normal way to read is through two operations:

my_ file. read_integer
new_value := my_ file. last_integer

Queries are available to determine the status of a file, in particular exists, is_readable, is_executable, is_writable, is_creatable, is_closed, is_open_read and so on.

Caution: You will notice in the flat-short form that all these queries except the first have exists as a precondition. This precondition is good for efficiency since it saves an existence test - a relatively expensive operation - when you know that a certain file exists. But it also means that if you have any doubt about the file’s existence you must use the queries in the style

if my_ file. exists and then my_ file. is_readable then...

FILE is a deferred class. Various implementations are possible. A quite detailed one is PLAIN_TEXT_FILE, which adds many features for accessing reading and writing data from/to a file.
UNIX_FILE_INFO describes objects that contain internal information, such as protection mode and size, about a file.
The class DIRECTORY describes those files which are directories - nodes in the tree describing the file structure.

Basic input and output

Regardless of the operating system that you use, for simple input and output STD_FILES is sufficient. You may inherit from that class to gain direct access to its features; or you may declare an entity of type STD_FILES. But remember that a feature of this type is always available: io, from class ANY. Thanks to this feature you may include simple input and output in any class, with instructions such as
io.put_string ("My message")

STD_FILES defines three default files through features input, outputand error. These features are Once functions, so that the first reference to any one of them will automatically create the corresponding file descriptor and open the associated file.
To simplify the writing of common input and output operations, the most frequently used features of class FILE - for reading and writing integers, reals and so on, as discussed next - have been repeated in STD_FILES so as to apply to the default input and output. Procedure put_string in the example at the beginning of this section is typical: it writes its output on the standard output. More generally, STD_FILES has all the put_xxx, read_xxx and last_xxx features of FILE.

PERSISTENCE, STORAGE AND RETRIEVAL

Most object-oriented applications need the ability to store object structures on persistent storage for later retrieval, and to transfer such object structures to other applications.
Class STORABLE addresses this need.

Persistence completeness

A fundamental requirement on object persistence mechanisms is the Persistence Completeness rule, stated as follows in Eiffel: The Language:
Whenever a routine of class STORABLE stores an object into an external file, it stores with it the dependents of that object. Whenever one of the associated retrieval routines retrieves a previously stored object, it also retrieves all its dependents.
Storing an object just by itself would usually result in wrong semantics: most objects contain references to other objects, which must also be stored and retrieved with it. The persistence completeness rule ensures that this is always the case. It also means, of course, that the features of STORABLE must do much more than simple input and output; they must perform complete traversals of object structures.

Using the storage and retrieval facilities

Class STORABLE is meant to be used as ancestor. You can use its features in any descendant C; for example a routine of C may contain a call of the form basic_store (my_descriptor).
The effect of this call will be to store the current object and all its dependents into the file denoted by my_descriptor.
Although basic_store and other procedures of STORABLEwill in general process objects of many different types, only the generating class of the structure’s initial object, C in our example, needs to be a descendant of STORABLE.

Varieties of store operations

Two variants of the store operation are supported: basic store and general store. Basic store produces more compact structures in the resulting files, and is slightly faster; but the resulting structure is dependent on the system which executes the store operation (“System” is taken here, as elsewhere in this documentation, in its Eiffel sense of an executable assembly of classes, compiled together with the help of an Ace specification.) This means that you can use procedure basic_store to store an object structure during an execution of a system if you will only retrieve it later in that execution, or in a
subsequent execution of the same system. If you need to store objects from a certain system and then retrieve them from a different system, possibly running on a different computer, use general_store. The result of general_store is still platform-dependent; the representation of numbers, in particular, is determined by the underlying machine architecture. A third variant called independent_store will be added in the future to STORABLE, using an entirely platform-independent storage format; then a system running on a computer with a certain architecture will be able to retrieve, without any explicit conversion operation, object structures stored by a system running on a machine of a completely different architecture. With general_store the
storing and retrieving computers must have compatible architectures.

Retrieval

You only need to be aware of the difference between basic and general store at storage time. The stored structure will always be available through feature retrieved; this feature will figure out, from the format of the stored structure, whether it was stored by basic_store or general_store, and will decode it accordingly.
Feature retrieved returns a result of type STORABLE and is typically used through an assignment attempt of the form
x ?= retrieved (my_descriptor)

The assignment attempt is necessary because retrieved returns a result of type STORABLE whereas the type of x will be based on a proper descendant of STORABLE. If the structure in the file has been corrupted and retrieved is unable to do its job, it will trigger an exception. The code for that exception in class EXCEPTIONS (which inherits it from EXCEP_CONST and is discussed in the next section, together with the notion of exception code) is Retrieve_exception.

ACCESS TO INTERNAL PROPERTIES

In some applications you may need to fine-tune the exception handling and memory management mechanisms. You may also need a simple way to access command-line arguments. In less common cases you may require low-level access to internal properties of objects.

Exception handling

Class EXCEPTIONS enables you to control the handling of exceptions. UNIX_SIGNALS, discussed next, complements it for the special case of fine-grain signal handling on Unix or Unix-like platforms. Both are meant to be inherited by any class that needs their facilities.
The basic exception mechanism treats all exceptions in the same way. In some cases it may be useful to discriminate in a Rescue clause between the various possible causes.
Class EXCEPTIONS provides the features to do this. Each kind of exception has an integer code, which you can use through several features:

  • The integer-valued query exception which gives the code of the latest exception.
  • Queries which determine the general nature of the latest exception: is_signal which determines whether the exception was an operating system signal; is_developer_exception which determines whether it was explicitly caused by a raise, as explained next; assertion_violation.
  • Query recipient_name which gives the name of the exception’s recipient - the routine that was interrupted by the exception.

The class also provides a set of constant integer-valued attributes which denote the various possible codes, such as No_more_memory, Routine_ failure and Precondition_violation. So you can test the value of exception against these codes if you need to ascertain the precise nature of an exception. To keep EXCEPTIONS simple these constant attributes are declared in a class EXCEP_CONST, of which EXCEPTIONS is an heir.
Another occasional requirement is for a mechanism to trigger an exception explicitly. Procedure raise answers this needs; the argument, a string, is the tag chosen for the exception. The code in this case is Developer_exception; the query is_developer_exception will return true; and the tag is accessible through feature tag_name.
You will notice in the interface specification for EXCEPTIONS that for some properties of the latest exception there are two features, one with a name such as exception or recipient_name as seen above and the other with a name prefixed by original_: original_exception, original_r ecipient_name.

CAUTION: The reason for the presence of these pairs is that the immediately visible cause of a routine interruption may not be the real one. Assume that routine r from class C, which has a Rescue clause, calls s from D with no Rescue clause, and that some call executed by s causes a precondition violation. Because s has no Rescue clause of its own, s will fail. Up the call chain, the first routine that has a Rescue clause - r itself, or one of its own direct or indirect callers - may process the exception; but if it examines the exception code through attribute exception it will get the value of Routine_failure. This may be what you want; but to handle the situation in a finer way you will usually need to examine the code for the original exception, the one that interrupted s. This code will be accessible through the attribute original_exception, which in this case will have the value of Precondition, the exception code for precondition violations. So you have the choice between exploring the properties of the original exception, or those of the resulting routine failures. Just make sure you know what you are looking for.

As you will see from the header comments in the flat-short form of class EXCEPTIONS, the queries that return detailed information about an exception, such as assertion_violation, all give an answer determined by original_exception rather than exception, since when the two are different (that is to say, when you handle the exception in a routine other than the original recipient) the value of exception is always Routine_failure and there is nothing more to say about it.

Signal handling

The features of class EXCEPTIONS enable you to determine whether a certain exception is a signal - an operating system event such as may result from a child process that disappears, a window that is resized, a user that hits the Break key and many others. But they do not give you more details because the exact set of possible signals is highly platform-dependent.
Class UNIX_SIGNALS complements EXCEP_CONST by providing codes for the signals of Unix and similar systems, such as Sigkill for the “kill” signal and Sigbus for bus error.
Query is_defined (some_signal), where some_signal is an integer code, will determine whether some_signal is supported on the platform.
A class whose routines need to perform specific processing depending on the nature of signals received should inherit from UNIX_SIGNALS, or a similar class for another platform.
Because signal codes are platform-dependent, the features of UNIX_SIGNALS are implemented as once functions - computed on the first call - rather than constants, although this makes no difference to clients.

Memory management

Class MEMORY, like EXCEPTIONS, is meant to be used as an ancestor by classes that need its facilities. It offers a number of features for controlling memory management and fine-tuning the garbage collection mechanism, a key component of the ISE Eiffel environment.
One of the most useful features in this class is dispose. This procedure describes actions to be applied to an unreachable object just before the garbage collector reclaims it. By default, as declared in MEMORY, the procedure does nothing; but you may redefine it in a proper descendant of MEMORY to describe dispose actions. Normally such actions will involve freeing external resources: for example a class describing file descriptors may redefine dispose so that whenever a descriptor object is garbage-collected the corresponding file will be closed.

Caution: This example is typical of proper uses of dispose.In a dispose procedure you should not include any instruction that could modify the Eiffel object structure, especially if some objects in that structure may themselves have become unreachable: these instructions could conflict with the garbage collector’s operations and cause catastrophic behavior. The legitimate use of dispose redefinitions is for disposing of non-Eiffel resources.

Other features of MEMORY provide direct control over the operation of the garbage collector. You can in particular stop garbage collection through a call to collection_off, and restart it through a call to collection_on. By default, garbage collection is always on (a testimony to its authors’ trust in its efficiency). Garbage collection is normally incremental, so as not to disrupt the application in a perceptible way. To start a complete garbage collection mechanism - reclaiming all unused objects - call procedure full_collect. The remaining features of MEMORY enable finer control of the collection
mechanism and are useful in special cases only. You will even find a free procedure providing brave (and competent) developers with a mechanism for reclaiming individual objects manually.
MEM_INFO, the result type for query memory_statistics in MEMORY, describes objects containing information collected about memory usage. The features of GC_INFO provide statistics about the garbage collector’s operation.

Command-line arguments

Writing, assembling and compiling a system yields an executable command. The system’s users will call that command with arguments. These are normally provided in textual form on the command line, as in
your_system arg1 arg2 arg3
although one may conceive of other ways of entering the command arguments, such as tabular or graphical form-filling. In any case the software must be able to access the values passed as command arguments.
A language mechanism is available for that purpose: the Root Class rule indicates that the creation procedure of the root class may have a single argument (in the Eiffel sense of argument to a routine) of type ARRAY [STRING ]. The corresponding array of strings will be initialized at the beginning of the system’s execution with the values entered as arguments to that execution of the command.
Although this facility suffices in many cases, it is not always convenient if you suddenly need to access the command arguments in a class that is far-away from the root. An alternative mechanism, class ARGUMENTS, is available. Once again, this is a class from which you should inherit if you need its facilities. It has just two exported features:

  • argument_count, a non-negative integer, is the number of command arguments.
  • argument (i), a string, is the i-th command argument. Here i must be between 0 and argument_count; the convention is that for i = 0 the result is the name of the command itself.


EiffelBase Data Structures

Data Structures Overview

The data structures cluster of EiffelBase includes classes that cover a wide range of data structures classes for you to reuse in your systems. The cluster is divided into a number of subclusters. Each subcluster contains one or more deferred classes, which provide the general high-level abstractions; other classes in the cluster inherit from the deferred ones.

The highest-level class is CONTAINER, with the following heirs:

  • COLLECTION, which describes containers through their access properties (defining how to access a container's items, for example through an index or according to a last-in, first-out policy).
  • TRAVERSABLE, which considers their traversal properties, such as sequential or hierarchical.
  • BOX, which describes their storage properties, such as being bounded or unbounded.

The documentation further discusses:

  • The taxonomy of the abstract container structures.
  • The list-based structures hierarchy.
  • The dispenser-based structures hierarchy.
  • The tree-based structures hierarchy.
  • The set-based structures hierarchy.
  • The table-based structures hierarchy.
  • The iteration mechanisms.


EiffelBase Data Structures, Taxonomy

Abstract Container Structures: The Taxonomy

A container data structure (or container in the sequel) is an object which serves to store and access collections of objects, called the items of the container. All classes describing containers are descendants of the deferred class CONTAINER.

A container can be studied from three viewpoints: access, storage and traversal.

  • The access criterion affects how the clients of a container can access its items. For example, in a stack or queue, only one item is accessible at any given time, and clients do not choose that item; in contrast, clients of an array or hash table must provide an index, or more generally a key, to access an item.
  • The storage criterion affects how the items are put together. For example some containers are finite, others potentially infinite; among finite structures, some are bounded, others unbounded.
  • The traversal criterion affects how, if in any way, the items of a container can be traversed. A traversal is a mechanism which makes it possible to examine each item of a container once, in a clearly specified order. For example some containers can be traversed sequentially, in one direction or two; tree structures lend themselves to preorder, postorder and breadth-first traversals.

For each of these criteria the Base library offers a single-inheritance hierarchy of deferred classes. The top of the access hierarchy is class COLLECTION; the top of the storage hierarchy is class BOX; the top of the traversal hierarchy is class TRAVERSABLE. These three classes are heirs of the most general class, CONTAINER.


EiffelBase Data Structures, Lists

Lists

OVERVIEW

Many applications need sequential structures, also called linear structures, in particular lists and circular chains. Apart from three classes describing individual list cells, all the classes involved are descendants of class LINEAR, one of the deferred classes describing general traversal properties and introduced in the chapter that described the general data structure taxonomy. More precisely, all but one of the classes of interest for the present discussion are descendants, direct or indirect, from a class called CHAIN which describes general sequential structures possessing a cursor as well as insertion properties. The exception is class COUNTABLE_SEQUENCE, which describes infinite structures; all the others describe finite structures.
CHAIN is an heir of SEQUENCE, which describes a more general notion of sequence. SEQUENCE is a descendant of LINEAR. There are two main categories of sequential structures: some, called circular chains, are cyclic; others, called lists, are not. Another distinction exists between dynamic structures, which may be extended at will, and fixed ones, which have a bounded capacity.
In all of the structures under review you may insert two or more occurrences of a given item in such a way that the occurrences are distinguishable. In other words, the structures are bags rather than just sets, although it is possible to use them to implement sets.

HIGHER-LEVEL TRAVERSAL CLASSES

The list and chain classes are characterized, for their traversal properties, as being linear and, more precisely, bilinear. In the traversal hierarchy, the relevant deferred classes are LINEAR and BILINEAR, introduced in the discussion of the general taxonomy.

Linear structures

LINEAR describes sequential structures that may be traversed one way. It introduces in particular the following features, illustrated on the figure below:

  • after, a boolean-valued query which determines whether you have moved past
    the last position (a more precise specification is given below).
  • off, a boolean-valued query which is false if and only if there is no item at the current position; for LINEAR this is the same as:
    is_empty and not after
  • item, a query which returns the item at the current position - provided of course
    there is one, as expressed by the precondition:
    not off
  • start, a command to move to the first position if any (if is_empty is true the command has no effect).
  • forth, a command to advance by one position; the precondition is not after.
  • finish, a command to move to the last position; the precondition is:
    not is_empty.

fig.1: Linear Structure

There is also a procedure search with one argument, which determines whether the value of that argument appears in the structure at or after the current position, and if not makes after become true. This procedure is internally used by the default implementation of the has function (the general membership test) for linear structures. Like has for all containers, search uses object or reference equality depending on the value set for object_comparison.

An invariant property of LINEAR structures is that the current position may go off one step past the last item if any, but no further. The precondition of forth - not after - helps ensure this. The first item (if any) being at position 1, the maximum allowable position is count + 1, where count is the number of items.

Bilinear structures

BILINEAR describes linear structures which may be traversed both ways. It inherits from LINEAR and extends it with two new features which ensure complete symmetry between the two directions of movement:

  • before, a boolean-valued query which determines whether you have moved to the
    left of the first position (a more precise specification is given below).
  • back, a command to move backward by one position; the precondition is not
    before.

For bilinear structures the position can range between 0 (not just 1) and count + 1. Query off is accordingly redefined so as to yield the value of after or before.

fig.2: Bilinear Structure

Invariant properties for after, before and off

The redefinition of off illustrates a general methodological advice about invariants: be careful about not over-constraining the invariant by including properties that may be made more general in descendants. It might have been tempting to include in LINEAR an invariant clause of the form
off = is_empty or after
This property, however, would be too constraining. More precisely, it is always true that the right-hand side implies the left-hand-side: if a linear structure is either empty or after, then it is off. But the converse is not true, since certain kinds of linear structure, for example bilinear ones, may be off but neither empty nor after.
The actual invariant for class BILINEAR is obtained in three stages. In class TRAVERSABLE the feature off is deferred and a basic property of that feature is
expressed by the invariant clause
empty_constraint: is_empty implies off
In LINEAR, feature off is effected through an implementation which returns the value of the expression is_empty or after. The class adds an invariant clause which, however, says less than the implementation to leave some room for variation:
after_constraint: after implies off
Finally BILINEAR, an heir of LINEAR, redefines off to return the value of the expression
before or after
and adds the invariant clause
before_constraint: before implies off
The new implementation of off
after or before
would not guarantee the invariant clause inherited from TRAVERSABLE were it not for another clause introduced in BILINEAR:
empty_property: is_empty implies (after or before)
which indicates that an empty bilinear structure must always be after or before − but not both, however, as stated by the last new clause, the reason for which is discussed in detail below:
not_both: not (after and before)
The flat-short form of BILINEAR shows the complete reconstructed invariant:
not_both: not (after and before)
 empty_property: is_empty implies (after or before)
before_constraint: before implies off
after_constraint: after implies off
empty_constraint: is_empty implies off

Iteration patterns

For a more general form of this scheme, applicable to circular chains as well as other linear structures, replace off by exhausted. With the features shown above, a typical iteration mechanism on a non-empty linear structure lin is of the form:
from
   lin.start
   some_optional_initializing_operation (lin)
until
   lin.off
loop
   lin.some_action (lin.item)
   lin.forth
end
The value of lin. off is always true for an empty structure, so in this case the loop will, correctly, execute only its initialization actions if present.
This is a very common pattern, which you will find in the library classes themselves (for example has is implemented in this way) and many application clients. The iterator classes corresponding to linear structures (LINEAR_ITERATOR, TWO_WAY_CHAIN_ITERATOR) turn this pattern and several related ones into actual reusable routines.
For bilinear structures there is another traversal mechanism going backward rather than forward; it is the same as above except that finish replaces start and back replaces finish. The exit condition remains off since before, like after, implies off.

A precise view of after and before

Getting the specification of after and before right, so that it will handle all cases properly, requires some care.
For every one of the structures under discussion there is a notion of current position, which we may call the cursor position even though for the moment the cursor is a virtual notion only. (Actual cursor objects will come later when we combine LINEAR, BILINEAR and other classes from the traversal hierarchy with CURSOR_STRUCTURE and other classes from the collection hierarchy.) The informal definition is that after is true if and only if the cursor - in this informal sense of a fictitious marker signaling the current position - is one position after the last item, if any, and that before is true if and only if the cursor is one position before the first item. When the cursor is on any of the items, after and before are false; after holds when the cursor is to the right of the last item, and before when it is to the left of the first item. This leaves open the question of what conventions to take for an empty structure. If iteration schemes of the above type are to work, then after must be true for an empty structure. For a bilinear structure, however, we should have total symmetry between the two pairs of features

  • start, forth, after.
  • finish, back, before.

So for an empty list both before and after should be true. This scheme was used in early version of the Base libraries. It has some disadvantages, however; in particular it is not compatible with the simple, symmetric properties:
after = (index = count + 1)
before = (index = 0)
which express elementary definitions for after and before in terms of index, the current position, and count, the number of items (items being numbered from 1 to count). For an empty structure count is zero, so if we want after and before to be both true in this case we have to sacrifice one of the above properties, since the first would imply index to 1 and the second to 0. But again symmetry reigns supreme: we should either keep both properties or renounce both. The solution was to renounce both and replace them by slightly more complicated ones:
after = (is_empty or (index = count + 1))
before = (is_empty or (index = 0))
When a structure is created, some initializations will have to be made; the default initializations will usually lead to a value of 0 rather than 1 for index, although this dissymetry is not apparent in the assertions. Although acceptable, this solution leads to small but unpleasant complications, in particular frequent conditional instructions of the form
if after and not is_empty then...
The solution finally retained for the Base libraries uses a different technique, which has turned out to be preferable. The idea is to replace the conceptual picture by one in which there are always two fictitious sentinel items. The two sentinel items are only present conceptually. They are of course not taken into account for the computation of count and, although it is possible to conceive of an implementation which would actually reserve space for them (for example in an array representation), none of the implementations used in Base for the classes of this documentation and other descendants of LINEAR do. The only purpose of the sentinels is to provide two valid theoretical cursor positions, which exist regardless of the number of actual (non-sentinel) items in the structure.
The sentinel items always appear at positions 0 and count + 1; this property is true even if the structure is empty of items, in which case count is zero. As a result, the following properties are part of the invariant:
0 <= index
index <= count + 1
before = (index = 0)
after = (index = count + 1)
not (after and before)
The last property given indicates that a structure can never be both after and before, since even in an empty structure the two sentinels are still present, with the cursor on one of them. For an empty structure, index will be zero by convention, so that before will be true and after false. But this property is not reflected in any of the invariant clauses.

Some lessons

This discussion has illustrated some of the important patterns of reasoning that are frequently involved in serious object-oriented design. Among the lessons are four ideas which you may find useful in many different cases. First, consistency is once again the central principle. Throughout the design of a class library we must constantly ask ourselves:

  • “How do I make my next design decision compatible with the previous ones?”
  • “How do I take my next design decision so that it will be easy - or at least possible - to make future ones compatible with it?”
Another frequent concern, partly a consequence of consistency, is symmetry. To mathematicians and physicists, symmetry considerations are often important in guiding the search for a solution to a problem; if the problem exhibits a certain symmetry, a candidate solution will be rejected if it does not satisfy that symmetry. Such was the situation here: since the structure’s specification is symmetric with respect to the two possible directions of traversal, so too should the feature design be.
The third lesson is also well-known in mathematics and physics: the usefulness of looking at limit cases. To check that a design is sound it is often useful to examine what becomes of it when it is applied to extreme situations - in particular, as was done in this example, empty structures.
Finally, the only way to make delicate design decisions is to express the issues clearly through assertions, most notably invariants. To analyze the properties under discussion, and weigh the various alternatives, we need the precision of mathematical logic. Once again note that without assertions it would be impossible to build a good library; we would have no way to know precisely what we are talking about.

SEQUENCES AND CHAINS

Still deferred, classes SEQUENCE and CHAIN provide the basis for all list and chain classes, as well as for many trees and for dispensers.
SEQUENCE is constructed with the full extent of the technique described in the discussion of the taxonomy: using multiple inheritance to combine one class each from the access, traversal and storage hierarchy. SEQUENCE indeed has three parents:

  • ACTIVE gives the access properties. A sequence is an active structure with a notion of current item. Remember that active structures are a special case of bags.
  • BILINEAR, as studied above, indicates that a sequence may be traversed both ways.
  • FINITE, from the storage hierarchy, indicates that the class describes finite sequences. (A class COUNTABLE_SEQUENCE is also present, as described below.)

To the features of BILINEAR, SEQUENCE principally adds features for adding, changing and removing items. A few procedures in particular serve to insert items at the end:

  • s. put (v) adds v at the end of a sequence s.
  • extend and force, at the SEQUENCE level, do the same as put.
  • s. append (s1) adds to the end of s the items of s1 (another sequence), preserving their s1 order.

Other procedures work on the current position:

  • s. remove removes the item at current position.
  • s. replace (v) replaces by v the item at current position.

SEQUENCE, however, does not provide a procedure to insert an item at the current position, since not all implementations of sequences support this possibility; you will find it in descendants of SEQUENCE seen below.
Yet another group of features are based on the first occurrence of a certain item, or on all occurrences:

  • s. prune (v) removes the first occurrence of v in s, if any.
  • s. prune_all (v) removes all occurrences of v.

These procedures have various abstract preconditions: s. extendible for additions, s. writable for replacements, s. prunable for removals. Properties extendible and prunable characterize general categories of container structures rather than individual instances; for example extendible is always true for the “dynamic” structures seen below. In contrast, writable depends on the current status of each instance. In general writable will be true if there is an item at the current position.

Chains

Chains are sequences with a few more properties: items may be accessed through their indices, and it is possible to define cursor objects attached to individual items.
Class CHAIN is an heir of SEQUENCE. It gets its access properties from CURSOR_STRUCTURE (which adds the notion of cursor to the features of ACTIVE, already present in SEQUENCE) and is also an heir of INDEXABLE. This ancestry implies in particular the presence of the following features:

  • cursor, from CURSOR_STRUCTURE, which makes it possible to keep a reference to an item of the structure.
  • i_th and put_i_th from TABLE, via INDEXABLE, which make it possible to access and replace the value of an item given by its integer index.

These features were called item and put in TABLE, but are renamed here to remove the conflict with homonymous features from SEQUENCE.
Procedure put for chains is the version obtained from CURSOR_STRUCTURE, which has the same effect as replace - replacing the value of the item at cursor position. The put procedure from SEQUENCE is renamed sequence_ put. This feature is not exported by CHAIN, however, since its effect (adding an item at the end) may be obtained through the simpler name extend.

Dynamic chains

By default, chains can only be extended at the end, through extend and sequence_ put. Of particular interest are those chains where clients can insert and remove items at any position. Such chains are said to be dynamic, and described by CHAIN’s heir DYNAMIC_CHAIN. The new features are predictable:

  • Procedure put_front adds an item before the first. (As noted, the procedures to add an item after the last are already available in chains.)
  • Procedures put_left and put_right add an item at the left and right of the cursor position.
  • Procedures remove_left and remove_right remove an item at the left and right or the cursor position.
  • Procedures merge_left and merge_right are similar to put_left and put_right but insert another dynamic chain rather than a single item. As the word “merge” suggests, the merged structure, passed as argument, does not survive the process; it is emptied of its items. To preserve it, perform a clone or copy before the merge operation.

The class also provides implementations of prune, prune_all and wipe_out from COLLECTION. To make these implementations useful, it defines queries extendible and prunable so that they return the value true.

LISTS AND CIRCULAR STRUCTURES

A chain is a finite sequential structure. This property means that items are arranged in a linear order and may be traversed from the first to the last. To do this you may use a loop of the form shown above, based on procedures start and forth.
This property leaves room for several variants. In particular chains may be straight or circular.

  • A straight chain, which from now on will be called a list, has a beginning and an end.
  • A circular chain, as represented by class CIRCULAR and its descendants, has a much more flexible notion of first item. It is organized so that every item has a successor.
This representation is conceptual only; in fact the implementations of circular chains found in the Base libraries are based on lists, implemented in one of the ways described below (in particular linked and arrayed).
The major originality of circular chains is that unless the structure is empty procedure forth is always applicable: it will cycle past the last item, coming back to the
first. The symmetric property applies to back. The cyclic nature of forth and back for circular chains is expressed precisely by the assertions. The version of forth for class CHAIN, which comes from LINEAR, has precondition
not after
Similarly, the precondition for back is
not before
For lists, after becomes true when the cursor moves past the last item. For circular chains, however, after and before are never true except for an empty structure; this is expressed by the invariant clauses of class CIRCULAR:
not_before_unless_empty: before implies is_empty
not_after_unless_empty: after implies is_empty
not_off_unless_empty: off implies is_empty

For a non-empty circular chain, then, you can circle forever around the items, using forth or back.

Choosing the first item

For a list, the first and last items are fixed, and correspond to specific places in the physical representation.
A circular chain also needs a notion of first item, if only to enable a client to initiate a traversal through procedure start. Similarly, there is a last item - the one just before the first in a cyclic traversal. (If the chain has just one item, it is both first and last.)
For circular chains, however, there is no reason why the first item should always remain the same. One of the benefits that clients may expect from the use of a circular
structure is the ability to choose any item as the logical first. Class CIRCULAR offers for that purpose the procedure set_start which designates the current cursor position as the first in the circular chain. Subsequent calls to start will move the cursor to this position; calls to finish will move the cursor to the cyclically preceding position. With most implementations, there will then be two notions of first position: the logical first, which clients may freely choose through calls to set_start; and the physical first, which results from the implementation. In a representation using an array with indices from 1 to capacity, for example, the physical first is position 1, and the logical first may be any index in the permitted range. In a linked representation, there will be a cell first element corresponding to the physical first, but the logical first is any cell in the chain.
In such cases the circular chain classes have features called standard_first, standard_last, standard_start and so on, which are not exported (so that you will not see them in the flat-short forms) but serve to implement visible features such as first, last and forth. For example a possible implementation of forth for circular chains is
forth is
   -- Move cursor to next item, cyclically.
do
   standard_forth
   if standard_after then
      standard_start
   end
   if isfirst then
      exhausted := True
   end
end

Traversing a list or circular chain

The properties of forth for circular chains imply that a traversal loop written as
from
   lin.start
until
   lin.off
loop
   ...
   lin.forth
end
would not work if lin is a non-empty circular structure: off would never become true, so that the loop would forever cycle over the structure’s items. The same would apply to a loop using finish and back instead of start and forth. This behavior is the natural result of the semantics defined for off , forth and back for circular structures. But it prevents us from using these features to perform a single traversal which will visit every item once.
Using exhausted in lieu of off solves this problem. In class CIRCULAR, exhausted is an attribute which is set to false by start and finish, and is set to true by forth when advancing from the last item to the first and by back when backing up from the first item to the last. So you should write the loop as
from
   lin.start
   some_optional_initializing_operation (lin)
until
   lin.exhausted
loop
   ...
   lin.some_action (lin.item)
   lin.forth
end
This form is applicable to all linear structures, circular or not, since exhausted is introduced in class LINEAR as a function which returns the same value as off .Its redefinition into an attribute, modified by start, finish, forth and back, does not occur until class CIRCULAR.
Because exhausted is more general than off , the iteration scheme just given (and its equivalent going backwards) is preferable to the earlier one using off , especially if there is any chance that the iteration might one day be applied to a lin structure that is circular. Classes of the Iteration library, in particular LINEAR_ITERATOR, rely on this scheme for iterating over linear structures.

Dynamic structures

For both lists and circular chains, the most flexible variants, said to be dynamic, allow insertions and deletions at any position.
The corresponding classes are descendants of DYNAMIC_LIST and DYNAMIC_CIRCULAR, themselves heirs of DYNAMIC_CHAIN studied above.

Infinite sequences

Class COUNTABLE_SEQUENCES, built by inheritance from COUNTABLE, LINEAR and ACTIVE, is similar to SEQUENCE but describes infinite rather than finite sequences.

IMPLEMENTATIONS

We have by now seen the concepts underlying the linear structures of the Base libraries, especially lists and circular chains. Let us look at the techniques used to implement them.

Linked and arrayed implementations

Most of the implementations belong to one of four general categories, better described
as two categories with two subcategories each:

  • Linked implementations, which may be one-way or two-way.
  • Arrayed implementations, which may be resizable or fixed.

A linked implementation uses linked cells, each containing an item and a reference to the next cell. One-way structures are described by classes whose names begin with LINKED_, for example LINKED_LIST. Two-way structures use cells which, in addition to the reference to the next cell, also include a reference to the previous one. Their names begin with TWO_WAY_.
An arrayed implementation uses an array to represent a linear structure. If the array is resizable, the corresponding class name begins with ARRAYED_, for example
ARRAYED_LIST; if not, the prefix is FIXED_.

Linked structures

A linked structure requires two classes: one, such as LINKED_LIST, describes the list proper; the other, such as LINKABLE, describes the individual list cells. The figure should help understand the difference; it describes a linked list, but the implementation of linked circular chains is similar.

fig.3: Linked list and linked cells

The instance of type LINKED_LIST shown at the top contains general information about the list, such as the number of items (count) and a reference to the first element (first). Because lists are active structures with a notion of current position, there is also a reference active to the cell at the current position. An entity declared as
my_list: LINKED_LIST [SOME_TYPE]
will have as its run-time value (if not void) a reference to such an object, which is really a list header. The actual list content is given by the LINKABLE instances, each of which contains a value of type SOME_TYPE and a reference to the next item, called right.
Clearly, a header of type LINKED_LIST [SOME_TYPE] will be associated with cells of type LINKABLE [SOME_TYPE] for the same actual generic parameter SOME_TYPE.
Features such as active and first are used only for the implementation; they are not exported, and so you will not find them in the flat-short specifications, although the figures show them to illustrate the representation technique.
A similar implementation is used for two-way-linked structures such as two-way lists and two-way circular chains.

fig.4: Two way linked list

Linked cells

The classes describing list cells are descendants of a deferred class called CELL, whose features are:

  • item, the contents of the cell.
  • put (v: like item), which replaces the contents of the cell by a new value.

Class LINKABLE is an effective descendant of CELL, used for one-way linked structures. It introduces features right, a reference to another cell to which the current
cell will be linked. Two-way linked structures use BI_LINKABLE, an heir of LINKABLE which to the above features adds left, a reference to the preceding cell in the structure.

Caution: Do not confuse the item feature of CELL and its descendants, such as LINKABLE, with the item feature of the classes describing linear structures, such as LINKED_LIST. For a linked list, item returns the item at cursor position.

It may be implemented as
item: G is
   -- Current item
do
   Result := active.item
end
using the item feature of LINKABLE, applied to active.

One-way and two-way linked chains

If you look at the interfaces of one-way and two-way linked structures, you will notice that they are almost identical. This is because it is possible to implement features such as back for one-way structures such as described by LINKED_LIST and LINKED_CIRCULAR. A simple implementation of back stores away a reference to the current active item, executes start, and then performs forth until the item to the right of the cursor position is the previous active.
Although correct, such an implementation is of course rather inefficient since it requires a traversal of the list. In terms of algorithmic complexity, it is in O (count), meaning that its execution time is on the average proportional to the number of items in the structure. In contrast, forth is O (1), that is to say, takes an execution time bounded by a constant.

Caution: As a consequence, you should not use one-way linked structures if you need to execute more than occasional back operations (and other operations requiring access to previous items, such as remove_left).

Two-way linked structures, such as those described by TWO_WAY_LIST and TWO_WAY_CIRCULAR, treat the two directions symmetrically, so that back will be just as efficient as forth. Hence the following important advice: If you need to traverse a linked structure both ways, not just left to right, use the TWO_WAY_ classes, not the LINKED_ versions. The TWO_WAY_ structures will take up more space, since they use BI_LINKABLE rather than LINKABLE cells, but for most applications this space penalty is justified by the considerable gains in time that will result if right-to-left operations are frequently needed.

Arrayed chains

Arrayed structures as described by ARRAYED_LIST, FIXED_LIST and ARRAYED_CIRCULAR use arrays for their implementations. A list or circular chain of count items may be stored in positions 1 to count of an array of capacity items, where capacity >= count.
An instance of FIXED_LIST, as the name suggests, has a fixed number of items. In particular:

  • Query extendible has value false for FIXED_LIST: you may replace existing items, but not add any, even at the end. A FIXED_LIST is created with a certain number of items and retains that number.
  • As a result, FIXED_LIST joins the deferred feature count of LIST with the feature count of ARRAY, which satisfies the property count = capacity.
  • Query prunable has value false too: it is not possible to remove an item from a fixed list.

In contrast, ARRAYED_LIST has almost the same interface as LINKED_LIST. In particular, it is possible to add items at the end using procedure extend; if the call causes the list to grow beyond the current array’s capacity, it will trigger a resizing. This is achieved by using the procedure force of class ARRAY to implement extend. ARRAYED_LIST even has the insertion procedures (put_front, put_left, put_right) and removal procedures (prune, remove, remove_left, remove_right) that apply to arbitrary positions and appear in the linked implementations. These procedures, however, are rather inefficient, since they usually require moving a whole set of array items, an O (count) operation. (Procedure extend does not suffer from this problem, since it is easy to add an item to the end of an array, especially if there is still room so that no resizing is necessary.)

Caution: The situation of these features in ARRAYED_LIST is similar to the situation of back in classes describing one-way linked structures: it is convenient to include them because they may be needed once in a while and an implementation exists; but using them more than occasionally may result in serious inefficiencies. If you do need to perform arbitrary insertions and removal, use linked structures, not arrayed ones.

Arrayed structures, however, use up less space than linked representations. So they are appropriate for chains on which, except possibly for insertions at the end, few insertion and removal operations or none at all are expected after creation. FIXED_LIST offers few advantages over ARRAYED_LIST. FIXED_LIST may be useful, however, for cases in which the fixed number of items is part of the specification, and any attempt to add more items must be treated as an error. For circular chains only one variant is available, ARRAYED_CIRCULAR, although writing a FIXED_ version would be a simple exercise.

Multi-arrayed lists

For lists one more variant is available, combining some of the advantages of arrayed and linked implementations: MULTI_ARRAY_LIST. With this implementation a list is
divided into a number of blocks. Each block is an array, but the successive arrays are linked.

SORTED LINEAR STRUCTURES

The class COMPARABLE_STRUCT, an heir of BILINEAR, is declared as
deferred class
   COMPARABLE_STRUCT [G -> COMPARABLE]
inherit
   BILINEAR
feature
   ...

As indicated by the constrained generic parameter it describes bilinear structures whose items may be compared by a total order relation.

Caution: Note that the class name, chosen for brevity’s sake, is slightly misleading: it is not the structures that are comparable but their items.

COMPARABLE_STRUCT introduces the features min and max, giving access to the minimum and maximum elements of a structure; these are always present for a finite
structure with a total order relation. SORTED_STRUCT, an heir of COMPARABLE_STRUCT, describes structures that can be sorted; it introduces the query sorted and the command sort.
The deferred class PART_SORTED_LIST describes lists whose items are kept ordered in a way that is compatible with a partial order relation defined on them. The
class is declared as
deferred class
   PART_SORTED_LIST [G -> COMPARABLE]...

An implementation based on two-way linked lists is available through the effective heir SORTED_TWO_WAY_LIST.
The deferred class SORTED_LIST, which inherits from PART_SORTED_LIST, assumes that the order relation on G is a total order. As a result, the class is able to
introduce features min, max and median. Here too a a two-way linked list implementation is available, through the effective class SORTED_TWO_WAY_LIST


EiffelBase Data Structures, Dispensers

Dispensers

A dispenser is called that way because of the image of a vending machine (a dispenser) of a rather primitive nature, in which there is only one button. If you press the button and the dispenser is not empty, you get one of its items in the exit tray at the bottom, but you do not choose that item: the machine does. There is also an input slot at the top, into which you may deposit new items; but you have no control over the order in which successive button press operations will retrieve these items.

The deferred class DISPENSER provides the facilities which will be shared by all specialized classes. In fact, the interface of all dispenser classes is nearly identical, with the exception of a few extra possibilities offered by priority queues. Many kinds of dispenser are possible, each defined by the relation that the machine defines between the order in which items are inserted and the order in which they are returned. The Base libraries support three important categories - stacks, queues, and priority queues:

  • A stack is a dispenser with a last-in, first-out (LIFO) internal policy: items come out in the reverse order of their insertion. Each button press returns the last deposited item.
  • A queue is a dispenser with a first-in, first-out (FIFO) internal policy: items come out in the order of their insertion. Each button press returns the oldest item deposited and not yet removed.
  • In a priority queue, items have an associated notion of order; the element that comes out at any given time is the largest of those which are in the dispenser.

Stacks

Stacks - dispensers with a LIFO retrieval policy - are a ubiquitous structure in software development. Their most famous application is to parsing (syntactic analysis), but many other types of systems use one or more stacks. Class STACK describes general stacks, without commitment to a representation. This is a deferred class which may not be directly instantiated. The fundamental operations are put (add an element at end of queue), item (retrieve the oldest element, non-destructively), remove (remove the oldest element), is_empty (test for empty queue).
Three effective heirs are provided:

  • LINKED_STACK : stacks implemented as linked lists, with no limit on the number of items ( count).
  • BOUNDED_STACK : stacks implemented as arrays. For such stacks, the maximum number of items (capacity ) is set at creation time.
  • ARRAYED_STACK : also implemented as arrays, but in this case there is no limit on the number of items; the interface is the same as LINKED_STACK except for the creation procedure. If the number of elements exceeds the initially allocated capacity, the array will simply be resized.

Queues

Class QUEUE describes general queues, without commitment to a representation. This is a deferred class which may not be directly instantiated. Three non-deferred heirs are also provided, distinguished by the same properties as their stack counterparts:

  • LINKED_QUEUE.
  • BOUNDED_QUEUE.
  • ARRAYED_QUEUE.

Priority Queues

In a priority queue, each item has an associated priority value, and there is an order relation on these values. The item returned by item or removed by remove is the element with the highest priority. The most general class is PRIORITY_QUEUE , which is deferred. Two effective variants are provided:

  • LINKED_PRIORITY_QUEUE, a linked list implementation.
  • HEAP_PRIORITY_QUEUE which is more efficient and is to be preferred in most cases. A heap is organized like a binary tree, although physically stored in an array; elements with a high priority percolate towards the root.

Because it must be possible to compare priorities, the type of the items must conform to PART_COMPARABLE. Constrained genericity ensures this; all the priority queue classes have a formal generic parameter constrained by PART_COMPARABLE.


EiffelBase Data Structures, Trees

Trees

Trees and their immediate generalization, forests, are useful for any system that manipulates hierarchically organized information. The range of applications is broad, from abstract syntax trees in compilers through document structures in text processing systems to company organization charts in business software.
Trees, in particular binary trees and their variants, also provide convenient implementations of container data structures.

Basic Terminology

A tree consists of a set of nodes. Each node may have zero or more children, other nodes of which it is the parent. Each node has at most one parent, although it may have an arbitrary number of children.

A node with no parent, such as the node marked A on the figure, is called a root; a node with no children, such as E, F, G, H and I, is called a leaf. The length of a path from the root to a leaf (that is to say, the number of nodes on the path minus one) is the height of the tree; the average length of all such paths is the average height. On the figure the height is 2 and the average height is 11/6 since of the six paths five have length 2 and one has length 1.
The children of a common node are called siblings. For example G, H and I are siblings on the figure. The siblings of a node are usually considered to be ordered; the order corresponds to the direction from left to right on conventional figures such as this one.
The descendants of a node are the node itself and, recursively, the descendants of its children. The ancestors of a node are the node itself and, recursively, the ancestors of its parent. For example the descendants of A are all the tree’s nodes; and the ancestors of I are A, D and I.
To obtain a tree rather than a more general kind of graph, there is an extra requirement: in we start from an arbitrary node, go to the parent, to the parent’s parent and so on (for as long as there is a parent), we will never find the starting node again. In more precise terms the condition is that the “parent” relation must not have any cycles. (That relation is in fact a partial function, since every node has zero or one parent.) If we consider infinite as well as finite trees the above condition must be restated to express that if we start from an arbitrary node and repeatedly go to the parent we will eventually hit a root. This discussion, however, will only consider finite trees (those with a finite number of nodes), for which the two statements are equivalent.
The definition given so far properly defines forests rather than trees. A tree is a forest with at most one root (that is to say, with exactly one root unless it is empty), such as the example on the last figure. The discussion and the library classes will handle trees rather than forest, but this is not a very important difference since by using an obvious device you can treat any forest as a tree: simply add an extra node, and make it the parent of all the forest’s roots.
Another important observation is that there is a one-to-one correspondence between trees and nodes. To any node N of a tree T we can associate a tree: take T, remove all nodes that are not descendants of N, and use N as the new root. Conversely, to any tree we can associate a node - its root. This correspondence enables us to treat the two concepts of tree and node as essentially the same.

Recursive Trees

The closeness of the notions of tree and node yields an elegant definition of trees in terms of lists. If we look at trees or, equivalently, at tree nodes, we can consider each node as being both:

  • A list: the list of its children.
  • A list cell (similar to a LINKABLE or BI_LINKABLE for one-way and two-way linked lists), paired with the node’s siblings.
This yields a simple definition of trees by multiple inheritance from LIST and CELL.

Dynamic recursive trees

An example of dynamic tree structure is provided by class TWO_WA Y_TREE, an heir of both TWO_WAY_LIST and BI_LINKABLE. There is also LINKED_TREE, which inherits from LINKED_LIST and LINKABLE, but TWO_WA Y_TREE is generally preferable since children of a node often needs to be traversed both ways; the notion of order is usually less significant here than for lists. Such a form of definition is a particularly effective way of conveying the profoundly recursive nature of trees. The corresponding classes are useful in many different areas such as graphics, text processing and compilation. To create a one-way or two-way linked tree, use

create my_tree. make (root_value)

This will attach my_tree to a new one-node tree, with root_value at the root node. Here my_tree must be declared of type TWO_WA Y_TREE [MY_TYPE] for some type MY_TYPE, and root_value must be of type MY_TYPE.
A class with a similar interface but using arrays rather than lists to represent nodes is also available: ARRAYED_TREE . This class is more efficient in both time and space for trees whose nodes have many children that are accessed randomly, if relatively few child insertions occur after node creation. Here the creation procedure indicates the initial number of children:

create my_tree. make (max_estimated_children, root_value)

The integer argument max_estimated_children only serves for the initial allocation; the array will be resized if the number of children grows beyond the initial size. As with the previous kinds of tree, the newly created node initially has no children.

Fixed trees

TWO_WA Y_TREE is useful for fully dynamic trees, in which a node may get new children at any time. For some applications, the number of children of a tree, although still arbitrary, is set for each node when the node is created, and will not change after that. Of course, some children may be absent; the corresponding entries will be void references. Class FIXED_TREE provides the basic mechanism; as you may have guessed, the implementation associates with each node an array of its children, arrays usually being the right structure when a collection of objects is known not to change size after creation. To create a fixed tree, use

create my_tree. make (how_many_children, root_value)

The root will have the associated value root value and will have how_many_ children children, all initially void. Unlike the argument max_estimated_children for the creation procedure of ARRAYED_TREE , the value of how_many_children is the final arity of the newly created node; since it set separately for each node on creation, the various nodes of a tree can have different arities, as illustrated on the above figure.

Properties of recursive trees

Whether fixed or dynamic, recursive trees fully enjoy their dual origin. This means in particular that each node is viewed as a list of its children, and can apply to this list the features inherited from LIST, appropriately renamed; for example:
child_put_left
child_forth
child_put
and so on. Feature count, inherited from LIST, indicates the number of children; it is renamed arity to conform to accepted tree terminology. (The word is a substantived form of the “ary” adjective ending, as in “ternary”, “quaternary” and so on, which yielded the expression “n-ary”.)

BINARY TREES

Binary trees are a special case of fixed trees in which nodes always have two children, although either or both of these children may be void.

Basic binary trees

Class BINARY_TREE describes binary trees.

The children are represented by features left_childand right_child. Queries has_left and has_right indicate whether any of these is non-void; arity is redefined to yield the number of non-void children (0, 1 or 2).

Binary representations of trees

For any ordinary tree, there exists a standard representation as a binary tree, which is useful in some applications. The correspondence is one-to-one, so that the original tree may be reconstructed without ambiguity. It actually applies to forests rather than trees and works as follows, fr being the first root in a forest: the binary tree’s root corresponds to fr; its left subtree is obtained recursively from the forest made by the subtrees of fr; and its right subtree is obtained recursively from the original forest deprived of the tree rooted at fr. If you start from a tree rather than a forest the binary tree’s root will have no right child.
Function binary_representation, in TREE, creates a binary tree representation (the function’s result) obtained from the current tree.
Procedure fill_ from_binary, in DYNAMIC_TREE, reconstructs a tree from a binary tree representation passed as argument.

Binary search trees

Class BINARY_SEARCH_TREE describes binary search trees, an implementation of bags which is appropriate for comparable items.
Binary search trees rely for insertion on a policy whereby any item less than the root is inserted (recursively) into the left subtree, and any item greater than the root into the right subtree. So if the insertion order is reasonably random the items will distribute evenly among the various branches, This means that the average height of the tree will be not much more than the optimal: [log2 n] where n is the number of nodes and [x], for any x, is the integer part of x.
Since search operations will follow the same principle (search left if smaller than the root, and so on), the time to find an item or ascertain that it is not there is proportional to the average height. In normal cases this means about [log2 n] basic operations, rather than n with a linear structure such as a list, and hence much better performance for large n.

CURSOR TREES

Recursive trees, as described so far, are not active data structures: even though each node has its own cursor to traverse the list of its children, there is no global cursor on the tree as a whole. It is not hard to see that the notion of recursive tree is in fact incompatible with the presence of a global cursor. In situations where you need such a cursor, enabling you to move freely from a node to its children, siblings and parents, you may use class CURSOR_TREE and its descendants.

The conceptual model

With cursor trees the model is different from what we have seen earlier in this chapter: there is a clear distinction between the nodes and the tree itself. The manipulated object is a tree, and the notion of node is merely implicit. In the various operations presented below and illustrated on the following figure, “up” means towards the root and “down” towards the leaves. This, of course, is the reverse of the properties of trees of the other kind - those which grow towards the sun and serve to print books about software.

Operations on cursor trees

The cursor supported by instances of CURSOR_TREE has a position referring to a node of the tree, which is then considered to be the active node, or is off the tree. The different off positions are: above (above the root), below (below a leaf), before (before a leftmost sibling), after (after a rightmost sibling.) As with linear structures, fictitious sentinel elements are assumed to be present to the left, right, top and bottom.
Various procedures are available to move the cursor in all directions:

  • down (i) moves the cursor down to the i-th child of the active node. If i is equal to 0 the cursor ends up before; if i is equal to the arity of the current parent plus 1, the cursor ends up after. Calling down (i) when the cursor is on a leaf node results in setting below and before to true if i is equal to 0, or below and after to true if i is equal to arity+1.
  • forth and back move the cursor forward and backward between siblings and can cause the cursor to end up after or before.
  • up moves the cursor up one level. The call may be made even when the cursor is after or before. If the cursor is on the root of the tree or below in an empty tree, the cursor ends up above.

You can move the cursor in any one direction ( up, down, forth, back), repeatedly, until it is off (above, below, after, before respectively), but once it is off, further movement in the same direction is prohibited. For example the precondition of put_left requires before to be false, and the precondition of put_right requires after to be false.
It is possible to move down from an above position; in an empty tree this brings the cursor below. Similarly, it is possible to move up from below, left from after, right from before.
The sentinel element above the tree’s root is considered to be the root of a forest containing just one tree. This view justifies the convention for the result of arity when the cursor is above: 0 if the tree is_empty, 1 if it has a root (viewed as the child of the fictitious sentinel element).

Manipulating the cursor explicitly

The cursor attached to a cursor tree is not just a conceptual notion but an actual object, of type CURSOR. You may use the query cursor to obtain a reference to the current cursor. Procedure go_to takes a cursor as argument and brings the tree’s cursor to the node identified by the value of that argument.

Traversals

A useful notion associated with trees and particularly applicable to cursor trees is that of traversal.
A traversal is a certain policy for ordering all the nodes in a tree - usually to apply an operation to all these nodes in the resulting order. CURSOR_TREE and its descendants support three forms of traversal: preorder, postorder and breadth-first. They correspond to the most commonly used traversal policies on trees, illustrated on the figure (where the children of each node are assumed to be ordered from left to right):

  • Preorder is the traversal that visits the root first, then (recursively) traverses each subtree in order. On the figure we will visit node A first then, recursively, the subtrees rooted at B (which implies visiting E and F), C and D. The resulting order is: A B E F C D G H I.
  • Postorder first traverses (recursively) the subtrees, then visits the root. On the example this gives: E F B C G H I D A.
  • Breadth-first visits the nodes level by level, starting with the root: first the root, then all its children, then all their children and so on. Here the resulting order is: A B C D E F G H I.

For each of the traversals, procedures are available to move the cursor accordingly, for example breadth_start and breadth_ forth for breadth-first, and similar names for the others.


EiffelBase Data Structures, Sets

Sets

Sets are containers where successive occurrences of the same item are not distinguished: inserting the same item twice has the same observable effect as inserting it once.

Deferred classes

The most general class describing sets is SET. The usual operations of set theory such as union and intersection have been relegated to SUBSET, an heir of SET. This enables a class to inherit from SET without having to effect these operations if it satisfies the basic set property but has no convenient implementation of the subset operations.

Sets without a notion of order

LINKED_SET provides a basic implementation of SET by linked lists.

Sets of comparable elements and sorted sets

The deferred class COMPARABLE_SET, declared as

deferred class
COMPARABLE_SET [G -> COMPARABLE]

inherit
SUBSET [G]
COMPARABLE_STRUCT [G]
...

describes sets whose items may be compared by a total order relation. The class has the features min and max.
Two implementations of COMPARABLE_SET are provided. One, TWO_WAY_SORTED_SET, uses sorted two-way lists. The other, BINARY_SEARCH_TREE_SET, uses binary search trees.
If the items are partially rather than totally ordered, you may use the class PART_SORTED_SET [G -> PART_COMPARABLE], which uses a two-way sorted list implementation.


EiffelBase Data Structures, Tables

Hash Tables

Hash tables are a convenient mechanism to store and retrieve objects identified by unique keys.

Why use hash tables?

The main advantage of hash tables is the efficiency of the basic operations: store (put) and retrieve (item, remove).
The idea behind hash tables is to try to emulate the data structure that provides the ultimate in efficiency: the array. On an array a, for some integer i whose value lies within the bounds ofa, the basic operations are

a. put (x, i)
x := a. item (i)
x := a @ i

The first causes the value of a at index i to be x; the second (and the third, which is simply a syntactical variant) access the value at index i and assign it to x. With the usual computer architectures, these operations are very fast: because arrays items are stored contiguously in memory, a computer will need just one addition (base address plus index) and one memory access to perform a put or item.
Not only are the operation times small; they are constant (or more precisely bounded by a constant). This is a great advantage over structures such as lists or trees which you must traverse at least in part to retrieve an item, so that access and modification times grow with the number of items. With an array, disregarding the influence of other factors such as memory paging, the time for a put or item is for all practical purposes the same whether the array has five items or five hundred thousand. These properties make arrays excellent data structures for keeping objects. Unfortunately, they are only applicable if the objects satisfy three requirements:

  • A1. For each object there must be an associated integer, which for the purpose of this discussion we may call the object’s index (since it will serve as index for the object in the array.)
  • A2. No two objects may have the same index.
  • A3. If we want to avoid wasting huge amount of storage, all the indices must lie in a contiguous or almost contiguous range.

Hash tables may be viewed as a rehabilitation mechanism for objects that do not naturally possess these three properties. If we are unable to find a natural index, we can sometimes devise an artificial one. To do so we must be able to find a key. Each key must uniquely identify the corresponding object; this is the same as property A2, making keys similar to indices. But keys are not necessarily integers (violating property A1), although it must be possible to associate an integer with each key. The mechanism that maps keys to integers is called the hashing function.
Thanks to the hashing mechanism we will indeed be able to store suitable objects into arrays, approaching the optimal efficiency of this data structure. The efficiency will not be quite as good, however, for two reasons:

  • We must pay the price of computing the hash function whenever we store or retrieve an object.
  • Different keys may hash into the same integer value, requiring extra processing to find an acceptable index.

With good implementations, however, it is possible to use hash tables with a performance that is not much worse than that of arrays and, most importantly, may be treated as if the time for a put, an item or a remove were constant. This will mean that you can consider operations such as

h. put (x, k)
h := a. item (k)

where h is a hash-table and k is a key (for example a string) as conceptually equivalent to the array operations mentioned above.
The quality of a hashed implementation will depend both on the data structure that will store the objects, and on the choice of hashing function. Class HASH_TABLE attempts to address the first concern; for the second, client developers will be responsible for choosing the proper hashing function, although Base provides a few predefined functions, in particular for class STRING.

When hash tables are appropriate

You may keep objects in a hash table if for each one of these objects you can find a key that uniquely identifies it. The objects and their keys may be of many possible kinds:

  • H1. In a simple example, the objects are integers; each integer serves as its own key. (More precisely we will use its absolute value, since it is convenient to have non-negative keys only.) This case is of more than theoretical interest, since it makes hash tables appropriate for storing a set of integers with widely scattered values, for which simple array storage would be a waste of space (see requirement A3 above).
  • H2. Frequently, the objects will be composite, that is to say, instances of a developer-defined class, and one of the attributes of that class, of type STRING, can serve as the key. For example if you were writing an Eiffel compiler you would probably need to keep a data structure that includes information about classes of the system. Each class is represented by an object with several fields describing the properties of the class; one of these fields, the class name, corresponding to an attribute of type STRING, will serve as key.
  • H3. Instead of being the full object (as in case H1) or one of the object’s fields (as in case H2), the key may have to be computed through a function of the generating class, which will take into account several attributes of the class (that is to say, for each object, several fields).

What this practically means is that in all cases you will need, in the generating class of the objects to be stored, a query (attribute or function) that gives the key. The type of the key is highly variable but must in all cases be a descendant of HASHABLE. This is true of both INTEGER (case H1) and STRING (case H2). The requirements for being a HASHABLE are not harsh: all you need is a function hash_code that returns a non-negative integer.

Using hash tables

Class HASH_TABLE takes two generic parameters:

class HASH_TABLE [G, H -> HASHABLE] ...

G represents the type of the objects to be stored in the hash table, H the type of their keys.
When viewed as an implementation of containers, HASH_TABLE, in a strict sense, represents bags rather than sets: unlike the other classes in this chapter, it allows an object to have two or more distinct occurrences in a single container. But this is only true if we consider a hash table as a repository of objects of type G. In reality each item of the table is identified by a pair of values, one from G and one from H. Because the keys must uniquely identify objects, the hash table viewed as a container of such pairs is indeed a set. The creation procedure make takes an integer argument, as in

create my_table. make (n)

The value of n indicates how many items the hash table is expected to have to accommodate. This number of items is not a hardwired size, just information passed to the class. In particular:

  • The actual size of the underlying array representation will be higher than n since efficient operation of hash table algorithms require the presence of enough breathing space - unoccupied positions.
  • If the number of items in the table grows beyond the initial allocation, the table will automatically be resized.

It is useful, however, to use a reasonable n upon creation: not too large to avoid wasting space, but not too small to avoid frequent applications of resizing, an expensive operation.


EiffelBase Data Structures, Iteration

Iteration

The classes of the Iteration cluster encapsulate control structures representing common traversal operations.

Iterators and Agents

The recent introduction of the agents mechanism in ISE Eiffel offers an attractive alternative to the Iterator cluster of EiffelBase.

The Notion of iterator

Let us first explore the role of iterators in the architecture of a system.

Iterating over data structures

Client software that uses data structures of a certain type, for example lists or trees, often needs to traverse a data structure of that type in a predetermined order so as to apply a certain action to all the items of the structure, or to all items that satisfy a certain criterion. Such a systematic traversal is called an iteration.
Cases of iteration can be found in almost any system. Here are a few typical examples:

  • A text processing system may maintain a list of paragraphs. In response to a user command, such as a request to resize the column width, the system will iterate over the entire list so as to update all paragraphs.
  • A business system may maintain a list of customers. If the company decides that a special promotion will target all customers satisfying a certain criterion (for example all customers that have bought at least one product over the past six months), the system will iterate over the list, generating a mailing for every list item that satisfies the criterion.
  • An interactive development environment for a programming language may maintain a syntax tree. In response to a program change, the system will traverse the tree to determine what nodes are affected by the change and update them.

These examples illustrate the general properties of iteration. An iteration involves a data structure of a known general type and a particular ordering of the structure’s items. For some structures, more than one ordering will be available; for example a tree iteration may use preorder, postorder or breadth-first (as defined below). The iteration involves an operation, say item_action, to be applied to the selected items. It may also involve a boolean-valued query, say item_test, applicable to candidate items. Finally, it involves a certain policy, usually based on item_test, as to which items should be subjected to item_action. Typical example policies are:

  • Apply item_action to all the items in the structure. (In this case item_test is not relevant).
  • Apply item_action to all items that satisfy item_test.
  • Apply item_action to all items up to the first one that satisfies item_test.

The Iteration library provides many more, covering in particular all the standard control structures.

Iterations and control structures

You can perform iterations without any special iteration classes. For example if customers is declared as

customers: LIST [CUSTOMER]

then a class SPECIAL_PROMOTION of a text processing system may include in one of its routines a loop of the form

from
customers.start
until
customers.exhausted
loop
if recent_ purchases.has (customers.item) then
target_list.put (customers.item)
end
customers.forth
end

Such schemes are quite common. But it is precisely because they occur frequently that it is useful to rely on library classes to handle them. One of the principal tasks of object-oriented software development is to identify recurring patterns and build reusable classes that encapsulate them, so that future developers will be able to rely on ready-made solutions.
The classes of the Iteration library address this need. Using them offers two benefits:

  • You avoid writing loops, in which the definition of sub-components such as exit conditions, variants and invariants is often delicate or error-prone.
  • You can more easily adapt the resulting features in descendant classes. The rest of this chapter shows how to obtain these benefits.

Simple Examples

To get a first grasp of how one can work with the Iteration library, let us look at a typical iteration class and a typical iteration client.

An example iterator routine

Here, given with its full implementation, is a typical Iteration library routine: the procedure until_do from LINEAR_ITERATOR, the class defining iteration mechanisms on linear (sequential) structures.

until_do is
-- Apply action to every item of target,
-- up to but excluding first one satisfying test.
-- (Apply to full list if no item satisfies test.)
require
traversable_exists: target /= Void
do
from
target . start
invariant
invariant_value
until
target . exhausted or else test
loop
action
target . forth
end
ensure
achieved: target . exhausted or else test
invariant_satisfied: invariant_value
end

The precise form of the procedure in the class relies on a call to another procedure, until_continue, and on inherited assertions. Here everything has been unfolded for illustration purposes.
This procedure will traverse the linear structure identified by target and apply the procedure called action on every item up to but excluding the first one satisfying test.
The class similarly offers do_all, do_while, do_for, do_if and other procedures representing the common control structures. It also includes functions such as exists and forall, corresponding to the usual quantifiers.
These iteration schemes depend on the procedure action, defining the action to be applied to successive elements, and on the function test, defining the boolean query to be applied to these elements. These features are declared in class ITERATOR (the highest-level deferred class of the Iteration library); here is test:

test: BOOLEAN is
-- Test to be applied to item at current position in
-- target (default: value of item_test on item)
require
traversable_exists: target /= Void
not_off: not target . off
do
Result := item_test ( target . item )
ensure
not_off: not target . off
end

This indicates that the value of the boolean function test will be obtained by applying item_test to the item at the current position in the target structure. In ITERATOR, function item_test always return False; descendant classes will redefine it so as to describe the desired test. Similarly, action is declared in class ITERATOR as a call to item_action. Descendants will redefine item_action, which as initially declared in ITERATOR is a procedure with a null body.
Going through item_action and item_test provides an extra degree of flexibility. Normally the action and test performed at each step apply to target . itemitem, so that it suffices to redefine the item_features. This is the case will all examples studied in this chapter. In a more general setting, however, you might need to redefine action and test themselves.

An example use of iteration

Here now is an example illustrating the use of these mechanisms. The result will enable us to resize all the paragraphs of a text up to the first one that has been modified - as we might need to do, in a text processing system, to process an interactive user request. Assume a class TEXT that describes lists of paragraphs with certain additional features. The example will also assume a class PARAGRAPH with a procedure resize, and a boolean-valued attribute modified which indicates whether a paragraph has been modified. Class TEXT inherits from LINKED_LIST and so is a descendant of LINEAR:

class
TEXT

inherit
LINKED_LIST [PARAGRAPH]
...

feature
...

end

In a class TEXT_PROCESSOR, you can use an iteration procedure to write a very simple procedure resize_ paragraphs that will resize all paragraphs up to but excluding the first one that has been modified:

class
TEXT_PROCESSOR

inherit
LINEAR_ITERATOR [PARAGRAPH]
redefine
item_action, item_test
end

feature

resize_ paragraphs (t: TEXT) is
-- Resize all the paragraphs of t up to but excluding -- the first one that has been modified.
do
set (t)
until_do
end

feature {NONE}

item_test (p PARAGRAPH): BOOLEAN is
-- Has p been modified?
do
Result := p.modified
end

item_action (p: PARAGRAPH) is
-- Resize p.
do
p.resize
end

...
end

Thanks to the iteration mechanism, the procedure resize_ paragraphs simply needs two procedure calls:

  • To set its argument t as the iteration target, it uses procedure set. (This procedure is from class ITERATOR which passes it on to all iterator classes.)
  • Then it simply calls until_do as defined above.

Procedure item_action is redefined to describe the operation to be performed on each successive element. Function item_test is redefined to describe the exit test.
As presented so far, the mechanism seems to limit every descendant of an iteration class to just one form of iteration. As shown later in this chapter, it is in fact easy to generalize the technique to allow a class to use an arbitrary number of iteration schemes.
What is interesting here is that the redefinitions of item_test and item_action take care of all the details. There is no need to write any loop or other control structure. We are at the very heart of the object-oriented method, enjoying the ability to encapsulate useful and common software schemes so that client developers will only need to fill in what is specific to their application.

Using the Iteration Library

Let us now explore the classes of the Iteration library and the different ways of using them.

Overview of the classes

There are only four Iteration classes, whose simple inheritance structure appeared at the beginning of this chapter.

  • ITERATOR, a deferred class which describes the most general notion.
  • LINEAR_ITERATOR, for iterating over linear structures and chains.
  • TWO_WAY_CHAIN_ITERATOR, a repeated heir of LINEAR_ITERATOR, for iterating in either direction over a bilinear structure.
  • CURSOR_TREE_ITERATOR, for iterating over trees.

As you will remember from the presentation of the abstract overall taxonomy, the traversal hierarchy describes how data structures can be traversed; its most general class is TRAVERSABLE.
Each one of the iterator classes is paired with a traversal class (or two in one case):

ITERATOR | TRAVERSABLE
LINEAR_ITERATOR | LINEAR
TWO_WAY_CHAIN_ITERATOR | TWO_WAY_LIST
TWO_WAY_CHAIN_ITERATOR | TWO_WAY_LIST, TWO_WAY_CIRCULAR
CURSOR_TREE_ITERATOR | CURSOR_TREE

Each iterator class relies on the corresponding traversal class to provide the features for traversing the corresponding data structures, such as start, forth and exhausted for linear structures.
Of course the data structure class used in connection with a given iterator class does not need to be the iterator’s exact correspondent as given by the above table; it may be any one of its descendants. For example you may use LINEAR_ITERATOR to iterate over data structures described not just by LINEAR but also by such descendants as LIST, LINKED_LIST, ARRAYED_LIST, or even TWO_WAY_LIST if you do not need the backward iteration features (for which you will have to use TWO_WAY_CHAIN_ITERATOR ).

General iteration facilities

Class ITERATOR defines the features that apply to all forms of iterator.
An iterator will always apply to a certain target structure. The target is introduced in ITERATOR by the feature target: TRAVERSABLE [G]
Both the iterator classes and the traversal classes are generic, with a formal generic parameter G. The actual generic parameters will be matched through the choice of iteration target: for a generic derivation of the form SOME_ITERATOR [ACTUAL_TYPE] the target can only be of type SOME_TRAVERSABLE [ACTUAL_TYPE] for the same ACTUAL_TYPE, where SOME_TRAVERSABLE is the traversal class matching SOME_ITERATOR according to the preceding table (LINEAR for LINEAR_ITERATOR and so on), or one of its proper descendants.
Each of the proper descendants of ITERATOR redefines the type of target to the matching proper descendant of TRAVERSABLE, to cover more specific variants of the iteration target, For example in LINEAR_ITERATOR the feature is redefined to be of type LINEAR. ITERATOR also introduces the procedure for selecting a target:

set (s: like target ) is
-- Make s the new target of iterations.
require
s /= Void
do
target := s
ensure
target = s
target /= Void
end

Next ITERATOR introduces the routines describing the elementary action and test that will be applied to items of the iteration targets:

action is
-- Action to be applied to item at current position in
-- target.
-- (default: item_action on item at current position.)
-- Note: for iterators to work properly, redefined
-- versions of this feature should not change the
-- traversable structure.
require
traversable_exists: target /= Void
not_off: not target . off
invariant_satisfied: invariant_value
do
item_action ( target . item)
ensure
not_off: not target . off
invariant_satisfied: invariant_value
end

test : BOOLEAN is
-- Test to be applied to item at current position in
-- target (default: value of item_test on item)
require
traversable_exists: target /= Void
not_off: not target . off
do
Result := item_test ( target . item )
ensure
not target . off
end

These routines rely on two others, item_action and item_test, which both take an argument of type G, the formal generic parameter. The reason, already noted above, is that in a vast majority of cases the iterated action and test solely depend, at each step of the traversal, on the item (of type G) at the current position. To define an iteration process, then, it suffices to redefine item_action and item_test in a descendant of the appropriate iteration class. Only in complex cases will it be necessary to redefine action and test themselves.
If you encounter such a case, note the caveat about action changing the target’s structure. Understandably enough, an iterator that attempts to change the data structure while traversing it may engage in strange behavior. No such risk exists if you only redefine item_action, which may change the contents of items but not the structure itself.
Another feature introduced in ITERATOR is the query invariant_value, describing invariant properties that must be ensured at the beginning of any iteration and preserved by every iteration step. As declared in ITERATOR this query always returns true, but proper descendants can redefine it to describe more interesting invariant properties.
Finally, ITERATOR introduces in deferred form the general iteration routines applicable to all iteration variants. They include two queries corresponding to the quantifiers of first-order predicate calculus:

  • for_all will return true if all items of the target structure satisfy test.
  • exists will return true if at least one item satisfies test.

The other routines are commands which will traverse the target structure and apply action to items selected through test:

  • do_all applies action to all items.
  • do_if, to those items which satisfy test.
  • until_do, to all items up to but excluding the first one that satisfies test.
  • do_until, to all items up to and including the first one that satisfies test.
  • while_do and do_while, to all items up to the first one that does not satisfy test. (This can also be achieved with until_do or do_until by choosing the opposite test.)

All these features, and most of the other iteration features introduced in proper descendants of ITERATOR and described next, have no argument. Information about the target of iteration comes from feature target, set by procedure set; information about what needs to be done for each item of the target structure comes from item_action and item_test.

Linear and chain iteration

LINEAR_ITERATOR, an effective class, refines the iteration mechanisms for cases in which the target is a linear structure, such as a list in any implementation or a circular chain.
The class effects all the deferred features inherited from ITERATOR, taking advantage of the linear traversal mechanisms present in the corresponding traversal class, LINEAR. Here for example is the effecting of do_if:

do_if is
-- Apply action to every item of target satisfying -- test.
do
from
target . start
invariant
invariant_value
until
target . exhausted
loop
if test then
action
end
forth
end
end

This routine text relies on features start, forth and exhausted which, together with off, have for convenience been carried over to LINEAR_ITERATOR from their counterparts in LINEAR, with feature declarations such as

off : BOOLEAN is
-- Is position of target off?
require
traversable_exists: target /= Void
do
Result := target . off
end

and similarly for the others.
In addition to effecting the general iteration features from ITERATOR, class LINEAR_ITERATOR introduces iteration features that apply to the specific case of linear structures:

  • search (b: BOOLEAN) moves the iteration to the first position satisfying test if b is true, or not satisfying test if b is false. This use of a boolean argument to switch between two opposite semantics is not part of the recommended style, and you will find few if any other examples in the Base libraries. Here, however, it was deemed preferable to the alternative, which would have involved four separate procedures (if together with search we consider continue_search discussed next).
  • With a linear structure we can implement an iteration corresponding to the “for” loop of traditional programming languages, defined by three integers: the starting position, the number of items to be traversed, and the step between consecutive items. This is provided by procedure do_for (starting, number, step: INTEGER).
  • Since with a linear target the iterator can advance the cursor step by step, the basic iteration operations are complemented by variants which pick up from the position reached by the last call: continue_until, until_continue, continue_while, while_continue, continue_search, continue_for.

Two-way iteration

Class TWO_WAY_CHAIN_ITERATOR has all the features of LINEAR_ITERATOR, to which it adds features for iterating backward as well as forward.
The class introduces commands finish and back, applying the corresponding operations to the two-way target. It also has a backward variant for every iteration feature. The name of each such variant is the name of the forward feature followed by _back: do_all_back, until_do_back and so on.
An alternative design would have kept just one set of features and added two features: a command reverse to reverse the direction of future iteration operations, and a query backward to find out the direction currently in force.
Contrary to what one might at first imagine, class TWO_WAY_CHAIN_ITERATOR is extremely short and simple; its Feature clause only contains the declarations of two features, finish and back.
The trick is to use repeated inheritance. TWO_WAY_CHAIN_ITERATOR inherits twice from LINEAR_ITERATOR; the first inheritance branch yields the forward iteration features, the second yields those for backward iteration. There is no need for any explicit declaration or redeclaration of iteration features. Here is the entire class text that yields this result:

class
TWO_WAY_CHAIN_ITERATOR [G]

inherit
LINEAR_ITERATOR [G]
redefine
target
select
start,
forth ,
do_all ,
until_do ,
do_until ,
do_if ,
do_for ,
search ,
forall ,
exists ,
until_continue ,
continue_until ,
continue_for ,
continue_search
end

LINEAR_ITERATOR [G]
rename
start as finish,
forth as back,
do_all as do_all_back,
until_do as until_do_back,
do_until as do_until_back,
do_if as do_if_back,
do_for as do_ for_back,
search as search_back,
forall as forall_back,
exists as exists_back,
until_continue as until_continue_back,
continue_until as continue_until_back,
continue_for as continue_for_back,
continue_search as continue_search_back
redefine
target
end

feature -- Status report

target : BILINEAR [G]
-- The structure to which iteration features will
-- apply

feature -- Cursor movement

finish is
-- Move cursor of target to last position.
do
target . finish
end

back is
-- Move cursor of target backward one position.
do
target . back
end
end

This class provides a good example of the economy of expression that the full inheritance mechanism affords through the combination of renaming, redefinition, repeated inheritance rules and selection, without sacrificing clarity and maintainability.

Tree iteration

Tree iterations, provided by class CURSOR_TREE_ITERATOR, work on trees of the cursor tree form; only with this form of tree are traversal operations possible. Three forms of iteration are provided: preorder, postorder and breadth-first. They correspond to the three traversal policies described in the discussion of trees. Here too it would seem that a rather lengthy class is needed, but repeated inheritance works wonders.
CURSOR_TREE_ITERATOR simply inherits three times from LINEAR_ITERATOR, renaming the features appropriately in each case:

  • pre_do_all, pre_until and so on.
  • post_do_all, post_until and so on.
  • breadth_do_all, breadth_until and so on.

All it needs to do then is to redefine the type of target to be CURSOR_TREE [G], and to redefine six features: the three renamed start (pre_start etc.) and the three forth (pre_ forth and so on). These seven redefinitions give us a full-fledged battery of tree iteration mechanisms.

Building and Using Iterators

To conclude this discussion, let us now put together the various mechanisms studied so far, to see how authors of client software can use the Iteration library to perform possibly complex iterations on various data structures without ever writing a single loop or test. The basic ideas were sketched above but now we have all the elements for the full view.
An application class may use one of the iteration classes in either of two ways: as a descendant (single or repeated) or as a client. The descendant technique is extremely simple but less versatile.

The single descendant technique

Assume an application class PROCESSOR that is a proper descendant of one of the effective iteration classes studied in this chapter. Then a routine of PROCESSOR, say iterate, may iterate a certain action over a data structure, subject to a certain test. First, class PROCESSOR must specify the action by redefining item_action and item_test (or, in the most general case, action and test). Then routine iterate must specify the target data structure through a call of the form set (t) where t represents the selected target data structure. The type of t must correspond to the iteration class selected as ancestor of PROCESSOR: for LINEAR_ITERATOR it must be a descendant of LINEAR (such as LINKED_LIST, ARRAYED_LIST, LINKED_CIRCULAR or any other list or circular chain classes); for TWO_WAY_CHAIN_ITERATOR it must be a descendant of BILINEAR such as TWO_WAY_LIST or TWO_WAY_CIRCULAR; for CURSOR_TREE_ITERATOR it must be a descendant of CURSOR_TREE. In all cases the actual generic parameters of the iterator class and of the data structure class must be compatible. Then the iteration proper is obtained simply by calling the appropriate procedure, without any qualification or arguments, for example: do_ if
It is hard to imagine a simpler scheme: no loops, no initialization, no arguments. Feature item_action may need to rely on some variable values. Because it does not take any argument, such values will have to be treated as attributes, with the corresponding set_... procedures to set and change their values. This also applies to the two schemes set next.
The single descendant technique has one drawback: it provides the iterating class, PROCESSOR, with only one set of iteration particulars. This limitation does not affect the number of targets: you may use as many targets as you wish, as long as they are of compatible types, by calling a routine such as iterate several times, or calling several such routines, each call being preceded by a call to set to define a new target. The limitation also does not affect the iterating scheme: one iteration could use do_if, the next do_all and so on. But it does require the action and test to be the same in all cases.
The next two techniques will remove this limitation.

Using repeated inheritance

One way to obtain several iteration schemes is a simple extension to the single descendant technique. You can use repeated inheritance to provide two or more variants. We have in fact already encountered the technique when studying how to derive TWO_WAY_CHAIN_ITERATOR and CURSOR_TREE_ITERATOR from LINEAR_ITERATOR. The general pattern, applied here to just two iteration schemes but easily generalized to more, is straightforward:

class
DUAL_PROCESSOR

inherit
LINEAR_ITERATOR [SOME_TYPE]
rename
item_action as action1,
item_test as test1,
do_if as do_if1,
redefine
action1, test1
select
action1, test1
end

LINEAR_ITERATOR [SOME_TYPE]
rename
item_action as action2,
item_test as test2,
do_if as do_if2,
redefine
action2, test2
end

feature

action1 is
-- Action for the first scheme
do
...
end

test1: BOOLEAN is
-- Test for the first scheme
do
...
end

action2 is
-- Action for the second scheme
do
...
end

test2: BOOLEAN is
-- Test for the second scheme
do
...
end

iterate1 is
-- Execute iteration of first kind.
do
set (...)
do_if1
end

iterate2 is
-- Execute iteration of second kind.
do
set (...)
do_if2
end

...

The repeated inheritance machinery takes care of the rest.

Using explicit iterator objects

To obtain maximum flexibility, classes that need iteration facilities should be clients rather than descendants of the iteration classes. The resulting scheme is completely dynamic: to perform iterations you use iterator objects as discussed earlier.
The following example illustrates the technique. Consider a deferred class FIGURE describing the notion of graphical figure, with many effective descendants (POLYGON, CIRCLE and so on). It is useful to define COMPLEX_FIGURE, describing figures that are recursively composed of sub-figures. This is a remarkable example of multiple inheritance:

class
COMPLEX_FIGURE

inherit
FIGURE,
LINKED_LIST [FIGURE]

feature
... end

In the feature clause we want to provide the appropriate effectings for the deferred features of class FIGURE: display, hide, translate and all other basic figure operations.
We can use loops for that purpose, for example

display is
-- Recursively display all components of the complex
-- figure
do
from
start
until
exhausted
loop
item .display
forth
end
end

Although acceptable and even elegant, this scheme will cause significant duplication: all the FIGURE features - not just display but also hide, rotate, move and others - will have the same structure, with a loop. We can use iterators to avoid this duplication. The repeated inheritance technique would work, but given the large number of FIGURE features the amount of repeated inheritance that would be needed seems unwieldy. It is also not very desirable to have to change the inheritance structure of the system just to add a new feature to FIGURE. The more dynamic approach using iterator objects seems preferable.
To implement this approach, define a class for iterating on complex figures:

class
COMPLEX_FIGURE_ITERATOR

inherit
LINEAR_ITERATOR
redefine
target
end

create
set

feature
target: COMPLEX_FIGURE

end

Then for each operation to be iterated define a small class. For example:

class
FIGURE_DISPLAYER

inherit
COMPLEX_FIGURE_ITERATOR
redefine
item_action
end

create
set

feature

item_action (f: FIGURE) is
-- Action to be applied to each figure: display
-- it.
do
f.display
end
end

Similarly, you may define FIGURE_HIDER, FIGURE_MOVER and others. Then the features of COMPLEX_FIGURE are written almost trivially, without any explicit loops; for example:

display is
-- Recursively display all components of the complex
-- figure
local
disp: FIGURE_DISPLAYER
do
create disp.set (Current)
disp.do_all
end

and similarly for all the others.
Note the use of set as creation procedure, which is more convenient than requiring the clients first to create an iterator object and then to call set. This is also safer, since with set as a creation procedure the client cannot forget to initialize the target. (If a class C has a creation clause, the creation instruction create x with no creation call is invalid for x of type C.)


EiffelBase Support Cluster

The Support Cluster

The support cluster offers some commonly needed functionality that do not belong to the kernel.

Conversions, mathematical properties and ASCII characters

A few utility classes complement the kernel facilities. PRIMES, RANDOM and FIBONACCI are part of the data structure taxonomy; the others are meant to be used as ancestors by classes needing their features.
Two classes provide basic mathematical functions such as logarithms and trigonometric functions: SINGLE_MATH for single precision and DOUBLE_MATH for the double-precision variants. MATH_CONST contains mathematical constants: p, the square root of two, Euler’s constant e.
PRIMES, RANDOM and FIBONACCI are data structure classes - heirs of COUNTABLE_SEQUENCE. In all of these classes function i_th takes an integer argument i and will return the i-th element of the sequence under consideration - prime numbers, pseudo-random numbers or Fibonacci numbers. These sequences are active structures, on which forth will advance the current position and item will return the value at the current position. A few other features are specific to each case: for example higher_prime will yield the smallest prime greater than or equal to a certain value, and set_seed will define the seed to be used for starting the pseudo-random sequence.

Internal object structures

Class INTERNAL provides low-level access to internal object structures. It, too, is meant to be used as ancestor by classes needing its features.
Here are some of the most useful calls and what they yield, obj being an entity attached to an object O and i an integer:

  • class_name (obj): the name of the generator class for O.
  • dynamic_type (obj): the integer code for the type of O, where each type in a system is identified by a unique code.
  • field_count (obj): the number of fields in O.
  • physical_size (obj): the space occupied by O, in bytes.
  • field_xx (i, obj) where xx is name or offset: name or offset of the i-th field of O.
  • field (i, obj): the value of the i-th field of O, if a reference; declared of type ANY in the class.
  • yy_field (i, obj) where yy is boolean, character, integer, real or double: the value of the i-th field of O, if of the corresponding type; each declared of the appropriate type in the class.
  • is_special (obj), a boolean query which indicates whether O is a special object (the sequence of values representing the elements of an array or the characters of a string).

CAUTION: Only very special cases justify the use of this class. Unless you are writing the lowest level of an interface between an Eiffel application and external tools (such as a database management system), and this requires passing to those tools information about the internals of Eiffel objects, you almost certainly should not use INTERNAL.


Dynamic External Shared Call (DESC) Overview

DESC Overview

The DESC mechanism enables you to construct objects representing external routines determined at execution time through their name and libraries, and call these routines with the appropriate arguments.

Two classes, DLL_32 and DLL_32_ROUTINE , supported by an auxiliary class SHARED_LIBRARY_CONSTANTS provide the basis for DESC under Windows:

  • An instance of class DLL_32 describes a 32-bit Dynamically Linked Library. This class is a descendant of the deferred class SHARED_LIBRARY, covering the platform-independent notion of shared library.
  • An instance of class DLL_32_ROUTINE describes a routine from a 32-bit DLL. Predictably, this class has an attribute of type DLL_32 describing the library to which the routine belongs. It has a deferred ancestor SHARED_LIBRARY_ROUTINE capturing the platform-independent notion of shared library routine.
  • SHARED_LIBRARY_CONSTANTS introduces a few declarations useful for dealing with shared libraries and routines, in particular a few integer constants describing error codes and type codes. It is an ancestor to both of the preceding classes; application classes using DESC can also inherit from it to gain access to its facilities.

The basic sequence of instructions to use the DESC mechanism is the following:

  1. Create a library object (an instance of DLL_32, providing the library's name as argument to the creation procedure.
  2. Create a routine object (an instance of DLL_32_ROUTINE ), providing the library object, the routine's name or index in the library, and the routine's signature - number of arguments, types of arguments, type of result if any - as arguments to the creation procedure.
  3. Apply procedure call to the routine object, passing an array that contains the actual arguments required by the external routine.

Each of these steps may be repeated as often as necessary to use multiple libraries, multiple routines in a library, or multiple calls to a given routine.


DESC, Creating a Library Object

Creating a Library Object

To Create a DESC object representing a library and load that library, use a declaration such as:

your_dll: DLL_32

where your_dll should be replaced by whatever name you have chosen to denote the library in your software, and execute a creation instruction of the form:

create your_dll.make ("your_lib_name")

where your_lib_name is the name of the file containing the library.

After this call has been executed, the boolean value your_dll.meaningful will be true if and only if the creation has been successful, that is to say, the given name did correspond to an available library, and it was possible to load it.

If your_dll.meaningful is false, you can have more details about the error by comparing the value of your_dll.error_code, an integer, to those of constant attributes defined in class DLL_32 and DLL_32_ROUTINE , supported by an auxiliary class SHARED_LIBRARY_CONSTANTS. As expressed by an invariant of class DLL_32, the value of meaningful is true if an only if error_code = 0.


DESC, Creating a Routine Object

Creating a Routine Object

To create a DESC object representing a routine from a DLL, use a declaration such as:

your_routine: DLL_32_ROUTINE

where your_routine should be replaced by whatever name you have chosen to denote the routine in your software, and execute a creation instruction of the form:

create your_routine.make_by_name (
your_dll,
"your_routine_name",
<<argtyp1, argtyp2, ...>>,
res_type)

or, if you prefer for faster access to identify the routine by an integer index rather than a name:

create your_routine.make_by_index (
your_dll,
your_routine_index, -- The only differing line
<<argtyp1, argtyp2, ...>>,
res_type)

where your_dll is the library object created previously.

After either call has been executed, the boolean value your_routine.meaningful will be true if and only if the creation has been successful, that is to say, the given name or index did correspond to a routine of the library, and it was possible to open it. If the value is false, you can have more details about the error by comparing the value of your_routine.error_code, an integer, to those of constants attributes defined in class SHARED_LIBRARY_CONSTANTS.


DESC, Calling a Routine

Calling a Routine

Having created the object representing the external routine and attached it to entity your_routine, you may now call the routine with arbitrary actual arguments through the procedure call, a feature of class DLL_32_ROUTINE.

The procedure takes a single argument, of type ARRAY [ANY], containing the successive actual arguments to be passed to the external routine. The easiest technique is to use a manifest array, as in:

your_routine.call (<<-325, 67.2, x, a+b>>)


cluster base

Cluster
    base

indexing
    description: "EiffelBase: Library of reusable components for Eiffel"
    copyright: "Copyright (C) 1986-2000 Interactive Software Engineering, Inc. (ISE)"
    notice: "[
        For ISE customers the original versions are an ISE product
        covered by the ISE Eiffel license and support agreements.
        EiffelBase may now be used by anyone as FREE SOFTWARE to
        develop any product, public-domain or commercial, without
        payment to ISE, under the terms of the ISE Free Eiffel Library
        License (IFELL) at http://eiffel.com/products/../base/reference/license.html
    ]"
    information: "[
        Interactive Software Engineering Inc.
        ISE Building, 2nd floor
        270 Storke Road, Goleta, CA 93117 USA
        Telephone 805-685-1006, Fax 805-685-6869
        Electronic mail <info@eiffel.com>%N
        Customer support e-mail <support@eiffel.com>%N
        For latest info see award-winning pages: http://eiffel.com
    ]"

Subclusters
    base.desc
    base.event
    base.kernel
    base.structures
    base.support


cluster base.desc

Cluster
    base.desc

Supercluster
    base

Subclusters
    base.desc.general
    base.desc.spec


cluster base.desc.general

Cluster
    base.desc.general

Supercluster
    base.desc

Classes
    SHARED_LIBRARY
    SHARED_LIBRARY_CONSTANTS
    SHARED_LIBRARY_ROUTINE


SHARED_LIBRARY_CONSTANTS Chart

class
    SHARED_LIBRARY_CONSTANTS

General
    cluster: base.desc.general
    description: "Constants used by DESC (Dynamic External Shared Call) mechanism"

Ancestors
    ANY

Queries
    Library_freed: INTEGER
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER


SHARED_LIBRARY_CONSTANTS Flat contracts

indexing
    description: "Constants used by DESC (Dynamic External Shared Call) mechanism"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    SHARED_LIBRARY_CONSTANTS

feature -- Access

    T_array: INTEGER is 0

    T_boolean: INTEGER is 1

    T_character: INTEGER is 2

    T_double: INTEGER is 3

    T_integer: INTEGER is 4

    T_no_type: INTEGER is 10

    T_pointer: INTEGER is 5

    T_real: INTEGER is 6

    T_reference: INTEGER is 7

    T_short_integer: INTEGER is 8

    T_string: INTEGER is 9

feature -- Status report

    Library_freed: INTEGER is 3

    No_error: INTEGER is 0

    No_library: INTEGER is 1

    No_routine: INTEGER is 2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_CONSTANTS


SHARED_LIBRARY Chart

deferred class
    SHARED_LIBRARY

General
    cluster: base.desc.general
    description: "Platform independent abstraction of a shared library"

Ancestors
    SHARED_LIBRARY_CONSTANTS

Queries
    error_code: INTEGER
    Library_freed: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER

Constraints
    meaningful definition


SHARED_LIBRARY Flat contracts

indexing
    description: "Platform independent abstraction of a shared library"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    SHARED_LIBRARY

feature -- Access

    library_name: STRING
            -- Name of shared library

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the library currently loaded?

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

invariant

    meaningful_definition: meaningful = (error_code = no_error)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY


SHARED_LIBRARY_ROUTINE Chart

deferred class
    SHARED_LIBRARY_ROUTINE

General
    cluster: base.desc.general
    description: "Platform independent abstraction of a shared library routine"

Ancestors
    SHARED_LIBRARY_CONSTANTS

Queries
    argument_count: INTEGER
    argument_types: ARRAY [INTEGER]
    boolean_result: BOOLEAN
    character_result: CHARACTER
    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
    double_result: DOUBLE
    error_code: INTEGER
    function_name: STRING
    integer_result: INTEGER
    Library_freed: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    pointer_result: POINTER
    real_result: REAL
    reference_result: ANY
    return_type: INTEGER
    routine_called: BOOLEAN
    shared_library: SHARED_LIBRARY
    string_result: STRING
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER
    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
    valid_return_type (ret_type: INTEGER): BOOLEAN

Commands
    call (args: ARRAY [ANY])
    make_by_name (lib: SHARED_LIBRARY; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)

Constraints
    library exists
    meaningful only if no error
    meaningful library


SHARED_LIBRARY_ROUTINE Flat contracts

indexing
    description: "Platform independent abstraction of a shared library routine"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    SHARED_LIBRARY_ROUTINE

feature -- Initialization

    make_by_name (lib: SHARED_LIBRARY; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments

    function_name: STRING
            -- Name of the routine in the library

    library_name: STRING
            -- Name of the associated library for the routine

    return_type: INTEGER
            -- Expected return type

    shared_library: SHARED_LIBRARY
            -- Associated library for the routine

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    argument_count: INTEGER
            -- Number of arguments required

    boolean_result: BOOLEAN
            -- Value when the routine returns a boolean
        require
            routine_called: routine_called
            valid_return_type: return_type = t_boolean

    character_result: CHARACTER
            -- Value when the routine returns a character
        require
            routine_called: routine_called
            valid_return_type: return_type = t_character

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
            -- Do the actual arguments arguments conform to the signature?
        require
            valid_array: arguments /= void

    double_result: DOUBLE
            -- Value when the routine returns a double
        require
            routine_called: routine_called
            valid_return_type: return_type = t_double

    error_code: INTEGER
            -- Current status of the routine

    integer_result: INTEGER
            -- Value when the routine returns an integer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the routine currently callable?

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    pointer_result: POINTER
            -- Value when the routine returns a pointer
        require
            routine_called: routine_called
            valid_return_type: return_type = t_pointer

    real_result: REAL
            -- Value when the routine returns a real
        require
            routine_called: routine_called
            valid_return_type: return_type = t_real

    reference_result: ANY
            -- Value when the routine returns a reference
        require
            routine_called: routine_called
            valid_return_type: return_type = t_reference

    routine_called: BOOLEAN
            -- Has the routine already been called?

    string_result: STRING
            -- Value when the routine returns a string
        require
            routine_called: routine_called
            valid_return_type: return_type = t_string

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
            -- Are all the argument types in args valid?

    valid_return_type (ret_type: INTEGER): BOOLEAN
            -- Is ret_type valid as a return type?

feature -- Basic operations

    call (args: ARRAY [ANY])
            -- Call the routine with actual arguments args
        require
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        ensure
            routine_called: routine_called

invariant

    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SHARED_LIBRARY_ROUTINE


cluster base.desc.spec

Cluster
    base.desc.spec

Supercluster
    base.desc

Subclusters
    base.desc.spec.win32


cluster base.desc.spec.win32

Cluster
    base.desc.spec.win32

Supercluster
    base.desc.spec

Classes
    DLL_32
    DLL_32_ROUTINE


DLL_32 Chart

class
    DLL_32

General
    cluster: base.desc.spec.win32
    description: "DLL for Win32"
    create: make

Ancestors
    MEMORY
    SHARED_LIBRARY

Queries
    error_code: INTEGER
    Library_freed: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER

Commands
    free


DLL_32 Flat contracts

indexing
    description: "DLL for Win32"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    DLL_32

create

    make (lib_name: STRING)
            -- Load DLL lib_name
        require -- from SHARED_LIBRARY
            non_void: lib_name /= void
            non_empty: not lib_name.is_empty
        ensure -- from SHARED_LIBRARY
            consistent: lib_name.is_equal (library_name)

feature -- Access

    library_name: STRING
            -- Name of shared library

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    error_code: INTEGER
            -- Current status of the library

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the library currently loaded?
            -- (from SHARED_LIBRARY)

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Removal

    free
            -- Release the library
        require
            meaningful: meaningful
        ensure
            not_meaningful: not meaningful

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from SHARED_LIBRARY
    meaningful_definition: meaningful = (error_code = no_error)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32


DLL_32_ROUTINE Chart

class
    DLL_32_ROUTINE

General
    cluster: base.desc.spec.win32
    description: "32 bit DLL routine for Windows"
    create: make_by_name, make_by_index

Ancestors
    SHARED_LIBRARY_ROUTINE

Queries
    argument_count: INTEGER
    argument_types: ARRAY [INTEGER]
    boolean_result: BOOLEAN
    character_result: CHARACTER
    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
    double_result: DOUBLE
    error_code: INTEGER
    function_name: STRING
    integer_result: INTEGER
    Library_freed: INTEGER
    library_index: INTEGER
    library_name: STRING
    meaningful: BOOLEAN
    No_error: INTEGER
    No_library: INTEGER
    No_routine: INTEGER
    pointer_result: POINTER
    real_result: REAL
    reference_result: ANY
    return_type: INTEGER
    routine_called: BOOLEAN
    shared_library: DLL_32
    string_result: STRING
    T_array: INTEGER
    T_boolean: INTEGER
    T_character: INTEGER
    T_double: INTEGER
    T_integer: INTEGER
    T_no_type: INTEGER
    T_pointer: INTEGER
    T_real: INTEGER
    T_reference: INTEGER
    T_short_integer: INTEGER
    T_string: INTEGER
    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
    valid_return_type (ret_type: INTEGER): BOOLEAN

Commands
    call (args: ARRAY [ANY])
    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)


DLL_32_ROUTINE Flat contracts

indexing
    description: "32 bit DLL routine for Windows"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    DLL_32_ROUTINE

create

    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib
        require -- from SHARED_LIBRARY_ROUTINE
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure -- from SHARED_LIBRARY_ROUTINE
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine of index r_index in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            valid_index: r_index > 0
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_index: library_index = r_index
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

feature -- Access

    argument_types: ARRAY [INTEGER]
            -- Expected types of the actual arguments
            -- (from SHARED_LIBRARY_ROUTINE)

    function_name: STRING
            -- Name of the routine in the library
            -- (from SHARED_LIBRARY_ROUTINE)

    library_index: INTEGER
            -- Index of the routine in shared_library

    library_name: STRING
            -- Name of the associated library for the routine
            -- (from SHARED_LIBRARY_ROUTINE)

    return_type: INTEGER
            -- Expected return type
            -- (from SHARED_LIBRARY_ROUTINE)

    shared_library: DLL_32
            -- Associated library for the routine

    T_array: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_boolean: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_character: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_double: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_integer: INTEGER is 4
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_no_type: INTEGER is 10
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_pointer: INTEGER is 5
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_real: INTEGER is 6
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_reference: INTEGER is 7
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_short_integer: INTEGER is 8
            -- (from SHARED_LIBRARY_CONSTANTS)

    T_string: INTEGER is 9
            -- (from SHARED_LIBRARY_CONSTANTS)

feature -- Status report

    argument_count: INTEGER
            -- Number of arguments required
            -- (from SHARED_LIBRARY_ROUTINE)

    boolean_result: BOOLEAN
            -- Value when the routine returns a boolean
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_boolean

    character_result: CHARACTER
            -- Value when the routine returns a character
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_character

    conforms_to_signature (arguments: ARRAY [ANY]): BOOLEAN
            -- Do the actual arguments arguments conform to the signature?
            -- (from SHARED_LIBRARY_ROUTINE)
        require -- from SHARED_LIBRARY_ROUTINE
            valid_array: arguments /= void

    double_result: DOUBLE
            -- Value when the routine returns a double
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_double

    error_code: INTEGER
            -- Current status of the routine
            -- (from SHARED_LIBRARY_ROUTINE)

    integer_result: INTEGER
            -- Value when the routine returns an integer
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_integer or return_type = t_short_integer

    Library_freed: INTEGER is 3
            -- (from SHARED_LIBRARY_CONSTANTS)

    meaningful: BOOLEAN
            -- Is the routine currently callable?
            -- (from SHARED_LIBRARY_ROUTINE)

    No_error: INTEGER is 0
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_library: INTEGER is 1
            -- (from SHARED_LIBRARY_CONSTANTS)

    No_routine: INTEGER is 2
            -- (from SHARED_LIBRARY_CONSTANTS)

    pointer_result: POINTER
            -- Value when the routine returns a pointer
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_pointer

    real_result: REAL
            -- Value when the routine returns a real
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_real

    reference_result: ANY
            -- Value when the routine returns a reference
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_reference

    routine_called: BOOLEAN
            -- Has the routine already been called?
            -- (from SHARED_LIBRARY_ROUTINE)

    string_result: STRING
            -- Value when the routine returns a string
        require -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called
            valid_return_type: return_type = t_string

    valid_argument_types (args: ARRAY [INTEGER]): BOOLEAN
            -- Are all the argument types in args valid?
            -- (from SHARED_LIBRARY_ROUTINE)

    valid_return_type (ret_type: INTEGER): BOOLEAN
            -- Is ret_type valid as a return type?
            -- (from SHARED_LIBRARY_ROUTINE)

feature -- Basic operations

    call (args: ARRAY [ANY])
            -- Call the routine with actual arguments args
        require -- from SHARED_LIBRARY_ROUTINE
            meaningful: meaningful
            valid_array: args /= void
            conformant: conforms_to_signature (args)
        ensure -- from SHARED_LIBRARY_ROUTINE
            routine_called: routine_called

feature

    make_by_index (lib: DLL_32; r_index: INTEGER; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine of index r_index in library lib
        require
            library_exists: lib /= void
            meaningful: lib.meaningful
            valid_index: r_index > 0
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure
            consistent_index: library_index = r_index
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

    make_by_name (lib: DLL_32; f_name: STRING; arg_types: ARRAY [INTEGER]; ret_type: INTEGER)
            -- Connect to the routine f_name in library lib
        require -- from SHARED_LIBRARY_ROUTINE
            library_exists: lib /= void
            meaningful: lib.meaningful
            function_name_non_void: f_name /= void
            function_name_non_empty: not f_name.is_empty
            valid_argument_array: arg_types /= void
            valid_argument_types: valid_argument_types (arg_types)
            valid_return_type: valid_return_type (ret_type)
        ensure -- from SHARED_LIBRARY_ROUTINE
            consistent_f_name: f_name.is_equal (function_name)
            consistent_lib: lib = shared_library
            routine_not_called: not routine_called

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from SHARED_LIBRARY_ROUTINE
    library_exists: shared_library /= void
    meaningful_only_if_no_error: meaningful implies (error_code = no_error)
    meaningful_library: meaningful implies shared_library.meaningful

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DLL_32_ROUTINE


cluster base.event

Cluster
    base.event

Supercluster
    base

Classes
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    ACTIVE_INTEGER_INTERVAL
    ACTIVE_LIST [G]
    INTERACTIVE_LIST [G]


ACTION_SEQUENCE Chart

class
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

General
    cluster: base.event
    description: "A sequence of actions to be performed on `call'"
    keywords: "event, action"
    create: make, default_create

Ancestors
    ARRAYED_LIST [G]

Action sequences
    duplicate (n: INTEGER): [like Current] ACTION_SEQUENCE [EVENT_DATA]

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: EVENT_DATA
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, EVENT_DATA]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, EVENT_DATA]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ACTION_SEQUENCE [EVENT_DATA]): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, EVENT_DATA]
    last: [like first] PROCEDURE [ANY, EVENT_DATA]
    linear_representation: LINEAR [PROCEDURE [ANY, EVENT_DATA]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, EVENT_DATA]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, EVENT_DATA]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, EVENT_DATA]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: EVENT_DATA)
    compare_objects
    compare_references
    copy (other: [like Current] ACTION_SEQUENCE [EVENT_DATA])
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    fill (other: CONTAINER [PROCEDURE [ANY, EVENT_DATA]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, EVENT_DATA]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    prune_all (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, EVENT_DATA])
    put (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_front (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_i_th (v: [like item] PROCEDURE [ANY, EVENT_DATA]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_right (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, EVENT_DATA])
    resume
    search (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    is aborted stack not void
    call buffer not void
    not has void
    valid state
    call buffer consistent
    not empty actions not void
    empty actions not void


ACTION_SEQUENCE Flat contracts

indexing
    description: "A sequence of actions to be performed on `call'"
    instructions: "[
        Use features inherited from LIST to add/remove actions.
        An action is a procedure of ANY class that takes EVENT_DATA.
        When `call' is called the actions in the list will be executed
        in order stating at `first'.
        An action may call `abort' which will cause `call' to stop executing
        actions in the sequence. (Until the next call to `call').
        Descendants may redefine `initialize' to arrange for `call' to
        be called by an event source.
        Use `block', `pause', `flush' and `resume' to change the behavior
        of `call'.
        eg.
         birthday_data: TUPLE [INTEGER, STRING] -- (age, name)
         birthday_actions: ACTIONS_SEQUENCE [like birthday_data]
         create birthday_actions.make ("birthday", <<"age","name">>)
         send_card (age: INTEGER, name, from: STRING) is ...
         buy_gift (age: INTEGER, name, gift, from: STRING) is ...
         birthday_actions.extend (agent send_card (?, ?, "Sam")
         birthday_actions.extend (agent buy_gift (?, ?, "Wine", "Sam")
         birthday_actions.call ([35, "Julia"])
         causes call to: send_card (35, "Julia", "Sam")
                         buy_gift (35, "Julia", "Wine", "Sam")
    ]"
    status: "See notice at end of class"
    keywords: "event, action"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

create

    default_create
            -- Begin in Normal_state.

    make

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, EVENT_DATA]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: EVENT_DATA
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
        ensure
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, EVENT_DATA]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
        ensure
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, EVENT_DATA]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
        ensure
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
        require
            call_is_underway: call_is_underway
        ensure
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
        ensure
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
        ensure
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
        ensure
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
        ensure
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, EVENT_DATA]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [PROCEDURE [ANY, EVENT_DATA]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, EVENT_DATA]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: EVENT_DATA)
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
        ensure
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
        require
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTION_SEQUENCE


ACTIVE_INTEGER_INTERVAL Chart

class
    ACTIVE_INTEGER_INTERVAL

General
    cluster: base.event
    description:
        "Contiguous integer interval that calls an action sequence
        when it changes."
    keywords: "event, action, linked, list"
    create: make

Ancestors
    INTEGER_INTERVAL

Action sequences
    change_actions: ACTION_SEQUENCE [TUPLE]

Queries
    infix "@" (i: INTEGER): INTEGER
    additional_space: INTEGER
    all_cleared: BOOLEAN
    as_array: ARRAY [INTEGER]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    extendible: BOOLEAN
    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: INTEGER): BOOLEAN
    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ACTIVE_INTEGER_INTERVAL): BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item (i: INTEGER): INTEGER
    linear_representation: LINEAR [INTEGER]
    lower: INTEGER
    lower_defined: BOOLEAN
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    subinterval (start_pos, end_pos: INTEGER): [like Current] ACTIVE_INTEGER_INTERVAL
    upper: INTEGER
    upper_defined: BOOLEAN
    valid_index (v: INTEGER): BOOLEAN

Commands
    adapt (other: INTEGER_INTERVAL)
    automatic_grow
    compare_objects
    compare_references
    copy (other: [like Current] ACTIVE_INTEGER_INTERVAL)
    extend (v: INTEGER)
    fill (other: CONTAINER [INTEGER])
    grow (i: INTEGER)
    prune_all (v: INTEGER)
    put (v: INTEGER)
    resize (min_index, max_index: INTEGER)
    resize_exactly (min_index, max_index: INTEGER)
    wipe_out


ACTIVE_INTEGER_INTERVAL Flat contracts

indexing
    description: "[
        Contiguous integer interval that calls an action sequence
        when it changes.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    ACTIVE_INTEGER_INTERVAL

create

    make (min_index, max_index: INTEGER)
            -- Set up interval to have bounds min_index and
            -- max_index (empty if min_index > max_index)
            -- (from INTEGER_INTERVAL)
        ensure -- from INTEGER_INTERVAL
            lower_defined: lower_defined
            upper_defined: upper_defined
            set_if_non_empty: (min_index <= max_index) implies ((lower = min_index) and (upper = max_index))
            empty_if_not_in_order: (min_index > max_index) implies is_empty

feature -- Initialization

    adapt (other: INTEGER_INTERVAL)
            -- Reset to be the same interval as other.
        require -- from INTEGER_INTERVAL
            other_not_void: other /= void
        ensure -- from INTEGER_INTERVAL
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

feature -- Access

    has (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
            -- (from INTEGER_INTERVAL)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then -- from INTEGER_INTERVAL
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    item (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.
            -- (from INTEGER_INTERVAL)
        require -- from TABLE
            valid_key: valid_index (k)

    lower: INTEGER
            -- Smallest value in interval
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            lower_defined: lower_defined

    lower_defined: BOOLEAN
            -- Is there a lower bound?
            -- (from INTEGER_INTERVAL)

    upper: INTEGER
            -- Largest value in interval
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            upper_defined: upper_defined

    upper_defined: BOOLEAN
            -- Is there an upper bound?
            -- (from INTEGER_INTERVAL)

    valid_index (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
            -- (from INTEGER_INTERVAL)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from INTEGER_INTERVAL
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    infix "@" (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.
            -- (from INTEGER_INTERVAL)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Maximum number of items in interval
            -- (here the same thing as count)
            -- (from INTEGER_INTERVAL)

    count: INTEGER
            -- Number of items in interval
            -- (from INTEGER_INTERVAL)
        ensure then -- from INTEGER_INTERVAL
            definition: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (here: the interval itself)
            -- (from INTEGER_INTERVAL)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from INTEGER_INTERVAL
            index_set_is_range: equal (Result, Current)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears in structure
            -- (from INTEGER_INTERVAL)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        ensure then -- from INTEGER_INTERVAL
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from INTEGER_INTERVAL)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from INTEGER_INTERVAL
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))

feature -- Status report

    all_cleared: BOOLEAN
            -- Are all items set to default values?
            -- (from INTEGER_INTERVAL)
        ensure then -- from INTEGER_INTERVAL
            iff_at_zero: Result = ((lower = 0) and (upper = 0))

    extendible: BOOLEAN
            -- May new items be added?
            -- Answer: yes
            -- (from INTEGER_INTERVAL)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May individual items be removed?
            -- Answer: no
            -- (from INTEGER_INTERVAL)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from INTEGER_INTERVAL
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

    fill (other: CONTAINER [INTEGER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
        require -- from  INTEGER_INTERVAL
            True
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from INTEGER_INTERVAL
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune_all (v: INTEGER)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from INTEGER_INTERVAL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
            -- (from INTEGER_INTERVAL)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        ensure then -- from INTEGER_INTERVAL
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper

    resize (min_index, max_index: INTEGER)
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.

    resize_exactly (min_index, max_index: INTEGER)
            -- Rearrange interval to go from
            -- min_index to max_index.

feature -- Conversion

    as_array: ARRAY [INTEGER]
            -- Plain array containing interval's items
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper

    linear_representation: LINEAR [INTEGER]
            -- Representation as a linear structure
            -- (from INTEGER_INTERVAL)

feature -- Duplication

    copy (other: like Current)
            -- Reset to be the same interval as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from INTEGER_INTERVAL
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

    subinterval (start_pos, end_pos: INTEGER): like Current
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from INTEGER_INTERVAL)

feature -- Event handling

    change_actions: ACTION_SEQUENCE [TUPLE]
            -- Actions performed when interval changes.
        ensure
            not_void: Result /= void

feature -- Iteration

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does at least one of  interval's values
            -- satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) > 0)

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does exactly one of  interval's values
            -- satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) = 1)

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Do all interval's values satisfy condition?
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            consistent_with_count: Result = (hold_count (condition) = count)

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
            -- Number of  interval's values that
            -- satisfy condition
            -- (from INTEGER_INTERVAL)
        require -- from INTEGER_INTERVAL
            finite: upper_defined and lower_defined
        ensure -- from INTEGER_INTERVAL
            non_negative: Result >= 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_INTERVAL
    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_INTEGER_INTERVAL


ACTIVE_LIST Chart

class
    ACTIVE_LIST [G]

General
    cluster: base.event
    description:
        "Sequential, one-way linked lists that call an action
        sequence when an item is removed or added."
    keywords: "event, action, linked, list"
    create: default_create

Ancestors
    INTERACTIVE_LIST [G]

Action sequences
    add_actions: ACTION_SEQUENCE [TUPLE [G]]
    remove_actions: ACTION_SEQUENCE [TUPLE [G]]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] ACTIVE_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ACTIVE_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] ACTIVE_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] ACTIVE_LIST [G])
    merge_right (other: [like Current] ACTIVE_LIST [G])
    move (i: INTEGER)
    on_item_added (an_item: G)
    on_item_removed (an_item: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    add actions not void
    remove actions not void


ACTIVE_LIST Flat contracts

indexing
    description: "[
        Sequential, one-way linked lists that call an action
        sequence when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, action, linked, list"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    ACTIVE_LIST [G]

create

    default_create
            -- Initialize

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    add_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been added.

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    remove_actions: ACTION_SEQUENCE [TUPLE [G]]
            -- Actions performed when an item has just been removed.

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Miscellaneous

    on_item_added (an_item: G)
            -- an_item has just been added.
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void

    on_item_removed (an_item: G)
            -- an_item has just been removed.
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void

feature -- Element Change

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    add_actions_not_void: add_actions /= void
    remove_actions_not_void: remove_actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTERACTIVE_LIST
    consistency_count_equal_to_count: consistency_count = count
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE_LIST


INTERACTIVE_LIST Chart

deferred class
    INTERACTIVE_LIST [G]

General
    cluster: base.event
    description:
        "Sequential, one-way linked lists that call add/remove features
        when an item is removed or added."
    keywords: "event, linked, list"

Ancestors
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] INTERACTIVE_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] INTERACTIVE_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] INTERACTIVE_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] INTERACTIVE_LIST [G])
    merge_right (other: [like Current] INTERACTIVE_LIST [G])
    move (i: INTEGER)
    on_item_added (an_item: G)
    on_item_removed (an_item: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    consistency count equal to count


INTERACTIVE_LIST Flat contracts

indexing
    description: "[
        Sequential, one-way linked lists that call add/remove features
        when an item is removed or added.
    ]"
    status: "See notice at end of class"
    keywords: "event, linked, list"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    INTERACTIVE_LIST [G]

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Miscellaneous

    on_item_added (an_item: G)
            -- an_item has just been added.
        require
            an_item_not_void: an_item /= void

    on_item_removed (an_item: G)
            -- an_item has been removed.
        require
            an_item_not_void: an_item /= void

feature -- Element Change

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    consistency_count_equal_to_count: consistency_count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERACTIVE_LIST


cluster base.kernel

Cluster
    base.kernel

Supercluster
    base

Classes
    ANY
    ARGUMENTS
    ARRAY [G]
    BASIC_ROUTINES
    BIT_REF
    BOOLEAN
    BOOLEAN_REF
    CHARACTER
    CHARACTER_REF
    COMPARABLE
    CONSOLE
    DECLARATOR
    DIRECTORY
    DIRECTORY_NAME
    DOUBLE
    DOUBLE_REF
    EXCEP_CONST
    EXCEPTIONS
    FILE
    FILE_NAME
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]
    GC_INFO
    HASHABLE
    INTEGER
    INTEGER_16
    INTEGER_16_REF
    INTEGER_64
    INTEGER_64_REF
    INTEGER_8
    INTEGER_8_REF
    INTEGER_INTERVAL
    INTEGER_REF
    IO_MEDIUM
    MEM_CONST
    MEM_INFO
    MEMORY
    NUMERIC
    PART_COMPARABLE
    PATH_NAME
    PLAIN_TEXT_FILE
    PLATFORM
    POINTER
    POINTER_REF
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    RAW_FILE
    REAL
    REAL_REF
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]
    SEQ_STRING
    SPECIAL [T]
    STD_FILES
    STORABLE
    STREAM
    STRING
    STRING_HANDLER
    TO_SPECIAL [T]
    TUPLE
    UNIX_FILE_INFO
    UNIX_SIGNALS
    WIDE_CHARACTER
    WIDE_CHARACTER_REF


ANY Chart

class
    ANY

General
    cluster: base.kernel
    description:
        "Project-wide universal properties.
        This class is an ancestor to all developer-written classes.
        ANY may be customized for individual projects or teams."

Queries
    clone (other: ANY): [like other] ANY
    conforms_to (other: ANY): BOOLEAN
    deep_clone (other: ANY): [like other] ANY
    deep_equal (some: ANY; other: [like some] ANY): BOOLEAN
    default: [like Current] ANY
    default_pointer: POINTER
    equal (some: ANY; other: [like some] ANY): BOOLEAN
    generating_type: STRING
    generator: STRING
    Io: STD_FILES
    is_equal (other: [like Current] ANY): BOOLEAN
    Operating_environment: OPERATING_ENVIRONMENT
    out: STRING
    same_type (other: ANY): BOOLEAN
    standard_clone (other: ANY): [like other] ANY
    standard_equal (some: ANY; other: [like some] ANY): BOOLEAN
    standard_is_equal (other: [like Current] ANY): BOOLEAN
    tagged_out: STRING
    void: NONE

Commands
    copy (other: [like Current] ANY)
    deep_copy (other: [like Current] ANY)
    default_create
    default_rescue
    do_nothing
    print (some: ANY)
    standard_copy (other: [like Current] ANY)

Constraints
    reflexive equality
    reflexive conformance


ANY Flat contracts

indexing
    description: "[
        Project-wide universal properties.
        This class is an ancestor to all developer-written classes.
        ANY may be customized for individual projects or teams.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    ANY

feature -- Access

    generating_type: STRING
            -- Name of current object's generating type
            -- (type of which it is a direct instance)

    generator: STRING
            -- Name of current object's generating class
            -- (base class of the type of which it is a direct instance)

feature -- Comparison

    frozen deep_equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void
            -- or attached to isomorphic object structures?
        ensure
            shallow_implies_deep: standard_equal (some, other) implies Result
            both_or_none_void: (some = void) implies (Result = (other = void))
            same_type: (Result and (some /= void)) implies some.same_type (other)
            symmetric: Result implies deep_equal (other, some)

    frozen equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void or attached
            -- to objects considered equal?
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.is_equal (other))

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object considered
            -- equal to current object?
        require
            other_not_void: other /= void
        ensure
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    frozen standard_equal (some: ANY; other: like some): BOOLEAN
            -- Are some and other either both void or attached to
            -- field-by-field identical objects of the same type?
            -- Always uses default object comparison criterion.
        ensure
            definition: Result = (some = void and other = void) or else ((some /= void and other /= void) and then some.standard_is_equal (other))

    frozen standard_is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object, and field-by-field identical to it?
        require
            other_not_void: other /= void
        ensure
            same_type: Result implies same_type (other)
            symmetric: Result implies other.standard_is_equal (Current)

feature -- Status report

    conforms_to (other: ANY): BOOLEAN
            -- Does type of current object conform to type
            -- of other (as per Eiffel: The Language, chapter 13)?
        require
            other_not_void: other /= void

    same_type (other: ANY): BOOLEAN
            -- Is type of current object identical to type of other?
        require
            other_not_void: other /= void
        ensure
            definition: Result = (conforms_to (other) and other.conforms_to (Current))

feature -- Duplication

    frozen clone (other: ANY): like other
            -- Void if other is void; otherwise new object
            -- equal to other
            --
            -- For non-void other, clone calls copy;
            -- to change copying/cloning semantics, redefine copy.
        ensure
            equal: equal (Result, other)

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure
            is_equal: is_equal (other)

    frozen deep_clone (other: ANY): like other
            -- Void if other is void: otherwise, new object structure
            -- recursively duplicated from the one attached to other
        ensure
            deep_equal: deep_equal (other, Result)

    frozen deep_copy (other: like Current)
            -- Effect equivalent to that of:
            -- 		temp := deep_clone (other);
            --		copy (temp)
        require
            other_not_void: other /= void
        ensure
            deep_equal: deep_equal (Current, other)

    frozen standard_clone (other: ANY): like other
            -- Void if other is void; otherwise new object
            -- field-by-field identical to other.
            -- Always uses default copying semantics.
        ensure
            equal: standard_equal (Result, other)

    frozen standard_copy (other: like Current)
            -- Copy every field of other onto corresponding field
            -- of current object.
        require
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure
            is_standard_equal: standard_is_equal (other)

feature -- Basic operations

    frozen default: like Current
            -- Default value of object's type

    default_create
            -- Process instances of classes with no creation clause.
            -- (Default: do nothing.)

    frozen default_pointer: POINTER
            -- Default value of type POINTER
            -- (Avoid the need to write p.default for
            -- some p of type POINTER.)

    default_rescue
            -- Process exception for routines with no Rescue clause.
            -- (Default: do nothing.)

    frozen do_nothing
            -- Execute a null action.

    frozen void: NONE
            -- Void reference

feature -- Output

    io: STD_FILES
            -- Handle to standard file setup

    out: STRING
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of tagged_out.

    print (some: ANY)
            -- Write terse external representation of some
            -- on standard output.

    frozen tagged_out: STRING
            -- New string containing terse printable representation
            -- of current object
            -- Was declared in ANY as synonym of out.

feature -- Platform

    operating_environment: OPERATING_ENVIRONMENT
            -- Objects available from the operating system

invariant

    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ANY


ARGUMENTS Chart

class
    ARGUMENTS

General
    cluster: base.kernel
    description:
        "Access to command-line arguments. This class
        may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    argument (i: INTEGER): STRING
    Argument_array: ARRAY [STRING]
    Argument_count: INTEGER
    coalesced_character_option_value (o: CHARACTER): STRING
    coalesced_word_option_value (opt: STRING): STRING
    Command_line: STRING
    Command_name: STRING
    index_of_beginning_with_word_option (opt: STRING): INTEGER
    index_of_character_option (o: CHARACTER): INTEGER
    index_of_word_option (opt: STRING): INTEGER
    Option_sign: CHARACTER_REF
    separate_character_option_value (o: CHARACTER): STRING
    separate_word_option_value (opt: STRING): STRING

Commands
    set_option_sign (c: CHARACTER)


ARGUMENTS Flat contracts

indexing
    description: "[
        Access to command-line arguments. This class
        may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    ARGUMENTS

feature -- Access

    argument (i: INTEGER): STRING
            -- i-th argument of command that started system execution
            -- (the command name if i = 0)
        require
            index_large_enough: i >= 0
            index_small_enough: i <= argument_count

    argument_array: ARRAY [STRING]
            -- Array containing command name (position 0) and arguments

    command_line: STRING
            -- Total command line
        ensure
            Result.count >= command_name.count

    command_name: STRING
            -- Name of command that started system execution
        ensure
            definition: Result.is_equal (argument (0))

feature -- Measurement

    argument_count: INTEGER
            -- Number of arguments given to command that started
            -- system execution (command name does not count)
        ensure
            Result >= 0

feature -- Status report

    coalesced_character_option_value (o: CHARACTER): STRING
            -- The value, if any, specified for character option o on
            -- the command line.
            -- Defined as follows (where 'X' is the current 'option_sign' and
            -- 'xx' is an arbitrary, possibly empty sequence of characters):
            --   val if command line includes an argument of the form Xxxoval
            --	   (this may be an empty string if argument is just Xxxo).
            --   Void otherwise.
        require
            o_non_null: o /= '%U'

    coalesced_word_option_value (opt: STRING): STRING
            -- The value, if any, specified for word option opt on the
            -- command line.
            -- Defined as follows (where X is the current option_sign):
            --   val if command line includes an argument of the form Xoptval
            --	   (this may be an empty string if argument is just Xopt).
            --   Void otherwise.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    index_of_beginning_with_word_option (opt: STRING): INTEGER
            -- Does command line specify argument beginning with word
            -- option opt and, if so, at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xoptxx, where X is the current option_sign, 'xx'
            -- is arbitrary, possibly empty sequence of characters,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    index_of_character_option (o: CHARACTER): INTEGER
            -- Does command line specify character option o and, if so,
            -- at what position?
            -- If one of the space-separated arguments is of the form Xxxoyy,
            -- where X is the current option_sign, xx and yy
            -- are arbitrary, possibly empty sequences of characters,
            -- then index of this argument in list of arguments;
            -- else 0.
        require
            o_non_null: o /= '%U'

    index_of_word_option (opt: STRING): INTEGER
            -- Does command line specify word option opt and, if so,
            -- at what position?
            -- If one of the arguments in list of space-separated arguments
            -- is Xopt, where X is the current option_sign,
            -- then index of this argument in list;
            -- else 0.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

    option_sign: CHARACTER_REF
            -- The character used to signal options on the command line.
            -- This can be '%U' if no sign is necesary for the argument
            -- to be an option
            -- Default is '-'

    separate_character_option_value (o: CHARACTER): STRING
            -- The value, if any, specified after character option o on
            -- the command line.
            -- This is one of the following (where X is the current
            -- option_sign, xx and 'yy' are arbitrary, possibly empty
            -- sequences of characters):
            --   val if command line includes two consecutive arguments
            --	   of the form Xxxoyy and val respectively.
            --   Empty string if command line includes argument Xxxoyy, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if there is no argument of the form Xxxoyy.
        require
            o_non_null: o /= '%U'

    separate_word_option_value (opt: STRING): STRING
            -- The value, if any, specified after word option opt on the
            -- command line.
            -- This is one of the following (where X is the current option_sign):
            --   val if command line includes two consecutive arguments
            --	   of the form Xopt and val respectively.
            --   Empty string if command line includes argument Xopt, which is
            --	   either last argument or followed by argument starting with X.
            --   Void if no Xopt argument.
        require
            opt_non_void: opt /= void
            opt_meaningful: not opt.is_empty

feature -- Status setting

    set_option_sign (c: CHARACTER)
            -- Make c the option sign.
            -- Use'%U' if no sign is necesary for the argument to
            -- be an option

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARGUMENTS


ARRAY Chart

class
    ARRAY [G]

General
    cluster: base.kernel
    description:
        "Sequences of values, all of the same type or of a conforming one,
        accessible through integer indices in a contiguous interval."
    create: make_from_array, make

Ancestors
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    TO_SPECIAL [T]

Queries
    infix "@" (i: INTEGER): G
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): G
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAY [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (i: INTEGER): G
    linear_representation: LINEAR [G]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] ARRAY [G]): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] ARRAY [G]
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] ARRAY [G])
    discard_items
    enter (v: [like item] G; i: INTEGER)
    fill (other: CONTAINER [G])
    force (v: [like item] G; i: INTEGER)
    grow (i: INTEGER)
    make (min_index, max_index: INTEGER)
    make_from_array (a: ARRAY [G])
    prune_all (v: G)
    put (v: [like item] G; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    subcopy (other: [like Current] ARRAY [G]; start_pos, end_pos, index_pos: INTEGER)

Constraints
    area exists
    consistent size
    non negative count
    index set has same count


ARRAY Flat contracts

indexing
    description: "[
        Sequences of values, all of the same type or of a conforming one,
        accessible through integer indices in a contiguous interval.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAY [G]

create

    make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
        require
            valid_bounds: min_index <= max_index + 1
        ensure
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [G])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
        require
            array_exists: a /= void

feature -- Initialization

    make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
        require
            valid_bounds: min_index <= max_index + 1
        ensure
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [G])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
        require
            array_exists: a /= void

feature -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): G
            -- Entry at index i, if in index interval
        require
            valid_key: valid_index (i)

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
        ensure then
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
        ensure then
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
        ensure
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
        require
            other_not_void: other /= void
        ensure
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
        require
            valid_key: valid_index (i)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
        ensure
            inserted: item (i) = v
            higher_count: count >= old count

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
        ensure
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
        ensure
            default_items: all_default

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
        require
            good_indices: min_index <= max_index
        ensure
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
        require
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY


BASIC_ROUTINES Chart

class
    BASIC_ROUTINES

General
    cluster: base.kernel
    description: "Some useful facilities on objects of basic types"

Ancestors
    ANY

Queries
    abs (n: INTEGER): INTEGER
    bottom_int_div (n1, n2: INTEGER): INTEGER
    charconv (i: INTEGER): CHARACTER
    rsign (r: REAL): INTEGER
    sign (n: INTEGER): INTEGER
    up_int_div (n1, n2: INTEGER): INTEGER


BASIC_ROUTINES Flat contracts

indexing
    description: "Some useful facilities on objects of basic types"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    BASIC_ROUTINES

feature -- Conversion

    charconv (i: INTEGER): CHARACTER
            -- Character corresponding to ascii code i

feature -- Basic operations

    abs (n: INTEGER): INTEGER
            -- Absolute value of n
        ensure
            non_negative_result: Result >= 0

    bottom_int_div (n1, n2: INTEGER): INTEGER
            -- Greatest lower bound of the integer division of n1 by n2

    rsign (r: REAL): INTEGER
            -- Sign of r:
            -- -1 if r < 0
            --  0 if r = 0
            -- +1 if r > 0
        ensure
            correct_negative: (r < 0) = (Result = - 1)
            correct_zero: (r = 0) = (Result = 0)
            correct_positive: (r > 0) = (Result = + 1)

    sign (n: INTEGER): INTEGER
            -- Sign of n:
            -- -1 if n < 0
            --  0 if n = 0
            -- +1 if n > 0
        ensure
            correct_negative: (n < 0) = (Result = - 1)
            correct_zero: (n = 0) = (Result = 0)
            correct_positive: (n > 0) = (Result = + 1)

    up_int_div (n1, n2: INTEGER): INTEGER
            -- Least upper bound of the integer division
            -- of n1 by n2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BASIC_ROUTINES


BIT_REF Chart

class
    BIT_REF

General
    cluster: base.kernel
    description: "Bit sequences of length `count', with binary operations"

Ancestors
    ANY

Queries
    infix "#" (s: INTEGER): [like Current] BIT_REF
    infix "@" (i: INTEGER): BOOLEAN
    infix "and" (other: BIT_REF): BIT_REF
    infix "implies" (other: BIT_REF): BIT_REF
    infix "or" (other: BIT_REF): BIT_REF
    infix "^" (s: INTEGER): [like Current] BIT_REF
    infix "xor" (other: BIT_REF): BIT_REF
    infix "|" (other: BIT_REF): BIT_REF
    prefix "not": [like Current] BIT_REF
    conforms_to (other: BIT_REF): BOOLEAN
    count: INTEGER
    generator: STRING
    item (i: INTEGER): BOOLEAN
    out: STRING

Commands
    put (value: BOOLEAN; i: INTEGER)

Constraints
    valid count


BIT_REF Flat contracts

indexing
    description: "Bit sequences of length `count', with binary operations"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    BIT_REF

create

feature -- Access

    conforms_to (other: BIT_REF): BOOLEAN
            -- Is dynamic type of current object a descendant of
            -- dynamic type of other?
        require -- from ANY
            other_not_void: other /= void

    generator: STRING
            -- Name of the current object's generating class.

    item (i: INTEGER): BOOLEAN
            -- i-th bit
            -- Was declared in BIT_REF as synonym of @.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count

    infix "@" (i: INTEGER): BOOLEAN
            -- i-th bit
            -- Was declared in BIT_REF as synonym of item.
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count

feature -- Measurement

    count: INTEGER
            -- Size of the current bit object

feature -- Element change

    put (value: BOOLEAN; i: INTEGER)
            -- Set the i-th bit to 1 if value is True, 0 if False
        require
            index_large_enough: i >= 1
            index_small_enough: i <= count
        ensure
            value_inserted: item (i) = value

feature -- Basic operations

    infix "#" (s: INTEGER): like Current
            -- Result of rotating bit sequence by s positions
            -- (Positive s rotates right, negative s rotates left.)

    infix "^" (s: INTEGER): like Current
            -- Result of shifting bit sequence by s positions
            -- (Positive s shifts right, negative s shifts left;
            -- bits falling off the sequence's bounds are lost.)

    infix "and" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean conjunction with other
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "implies" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean implication of other
        require
            other_exists: other /= void
            conformance: other.count <= count

    prefix "not": like Current
            -- Bit-by-bit negation

    infix "or" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean disjunction with other
            -- Was declared in BIT_REF as synonym of |.
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "xor" (other: BIT_REF): BIT_REF
            -- Bit-by-bit exclusive or with other
        require
            other_exists: other /= void
            conformance: other.count <= count

    infix "|" (other: BIT_REF): BIT_REF
            -- Bit-by-bit boolean disjunction with other
            -- Was declared in BIT_REF as synonym of or.
        require
            other_exists: other /= void
            conformance: other.count <= count

feature -- Output

    out: STRING
            -- Tagged printable representation.

invariant

    valid_count: count > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BIT_REF


BOOLEAN Chart

expanded class
    BOOLEAN

General
    cluster: base.kernel
    description: "Truth values, with the boolean operations"

Ancestors
    BOOLEAN_REF

Queries
    infix "and" (other: [like Current] BOOLEAN): BOOLEAN
    infix "and then" (other: [like Current] BOOLEAN): BOOLEAN
    infix "implies" (other: [like Current] BOOLEAN): BOOLEAN
    infix "or" (other: [like Current] BOOLEAN): BOOLEAN
    infix "or else" (other: [like Current] BOOLEAN): BOOLEAN
    infix "xor" (other: [like Current] BOOLEAN): BOOLEAN
    prefix "not": [like Current] BOOLEAN
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: BOOLEAN
    out: STRING
    to_integer: INTEGER

Commands
    set_item (b: BOOLEAN)


BOOLEAN Flat contracts

indexing
    description: "Truth values, with the boolean operations"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    BOOLEAN

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from BOOLEAN_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: BOOLEAN
            -- Boolean value
            -- (from BOOLEAN_REF)

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from BOOLEAN_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (b: BOOLEAN)
            -- Make b the item value.
            -- (from BOOLEAN_REF)

feature -- Conversion

    to_integer: INTEGER
            -- 1 if True
            -- 0 if False
            -- (from BOOLEAN_REF)
        ensure -- from BOOLEAN_REF
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN
            -- Boolean conjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)

    infix "and then" (other: like Current): BOOLEAN
            -- Boolean semi-strict conjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current or else not other)

    infix "implies" (other: like Current): BOOLEAN
            -- Boolean implication of other
            -- (semi-strict)
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            definition: Result = (not Current or else other)

    prefix "not": like Current
            -- Negation
            -- (from BOOLEAN_REF)

    infix "or" (other: like Current): BOOLEAN
            -- Boolean disjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)

    infix "or else" (other: like Current): BOOLEAN
            -- Boolean semi-strict disjunction with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            de_morgan: Result = not (not Current and then not other)

    infix "xor" (other: like Current): BOOLEAN
            -- Boolean exclusive or with other
            -- (from BOOLEAN_REF)
        require -- from BOOLEAN_REF
            other_exists: other /= void
        ensure -- from BOOLEAN_REF
            definition: Result = ((Current or other) and not (Current and other))

feature -- Output

    out: STRING
            -- Printable representation of boolean
            -- (from BOOLEAN_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOOLEAN_REF
    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN


BOOLEAN_REF Chart

class
    BOOLEAN_REF

General
    cluster: base.kernel
    description: "References to objects containing a boolean value"

Ancestors
    HASHABLE

Queries
    infix "and" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "and then" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "implies" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "or" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "or else" (other: [like Current] BOOLEAN_REF): BOOLEAN
    infix "xor" (other: [like Current] BOOLEAN_REF): BOOLEAN
    prefix "not": [like Current] BOOLEAN_REF
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: BOOLEAN
    out: STRING
    to_integer: INTEGER

Commands
    set_item (b: BOOLEAN)

Constraints
    involutive negation
    non contradiction
    completeness


BOOLEAN_REF Flat contracts

indexing
    description: "References to objects containing a boolean value"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

class interface
    BOOLEAN_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: BOOLEAN
            -- Boolean value

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (b: BOOLEAN)
            -- Make b the item value.

feature -- Conversion

    to_integer: INTEGER
            -- 1 if True
            -- 0 if False
        ensure
            zero_or_one: Result = 0 or Result = 1
            item_implies_one: item implies Result = 1

feature -- Basic operations

    infix "and" (other: like Current): BOOLEAN
            -- Boolean conjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current or not other)
            commutative: Result = (other and Current)
            consistent_with_semi_strict: Result implies (Current and then other)

    infix "and then" (other: like Current): BOOLEAN
            -- Boolean semi-strict conjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current or else not other)

    infix "implies" (other: like Current): BOOLEAN
            -- Boolean implication of other
            -- (semi-strict)
        require
            other_exists: other /= void
        ensure
            definition: Result = (not Current or else other)

    prefix "not": like Current
            -- Negation

    infix "or" (other: like Current): BOOLEAN
            -- Boolean disjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current and not other)
            commutative: Result = (other or Current)
            consistent_with_semi_strict: Result implies (Current or else other)

    infix "or else" (other: like Current): BOOLEAN
            -- Boolean semi-strict disjunction with other
        require
            other_exists: other /= void
        ensure
            de_morgan: Result = not (not Current and then not other)

    infix "xor" (other: like Current): BOOLEAN
            -- Boolean exclusive or with other
        require
            other_exists: other /= void
        ensure
            definition: Result = ((Current or other) and not (Current and other))

feature -- Output

    out: STRING
            -- Printable representation of boolean

invariant

    involutive_negation: is_equal (not (not Current))
    non_contradiction: not (Current and (not Current))
    completeness: Current or else (not Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOLEAN_REF


CHARACTER Chart

expanded class
    CHARACTER

General
    cluster: base.kernel
    description: "Characters, with comparison operations and an ASCII code"

Ancestors
    CHARACTER_REF

Queries
    infix ">=" (other: [like Current] CHARACTER): BOOLEAN
    infix ">" (other: [like Current] CHARACTER): BOOLEAN
    infix "<=" (other: [like Current] CHARACTER): BOOLEAN
    infix "<" (other: [like Current] CHARACTER): BOOLEAN
    infix "-" (decr: INTEGER): CHARACTER
    infix "+" (incr: INTEGER): CHARACTER
    infix "|-|" (other: CHARACTER): INTEGER
    code: INTEGER
    hash_code: INTEGER
    is_alpha: BOOLEAN
    is_digit: BOOLEAN
    is_equal (other: [like Current] CHARACTER): BOOLEAN
    is_hashable: BOOLEAN
    is_lower: BOOLEAN
    is_upper: BOOLEAN
    item: CHARACTER
    lower: CHARACTER
    max (other: [like Current] CHARACTER): [like Current] CHARACTER
    Max_value: INTEGER
    min (other: [like Current] CHARACTER): [like Current] CHARACTER
    Min_value: INTEGER
    next: CHARACTER
    out: STRING
    previous: CHARACTER
    three_way_comparison (other: CHARACTER_REF): INTEGER
    upper: CHARACTER

Commands
    set_item (c: CHARACTER)


CHARACTER Flat contracts

indexing
    description: "Characters, with comparison operations and an ASCII code"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:41 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    CHARACTER

feature -- Access

    code: INTEGER
            -- Associated integer value
            -- (from CHARACTER_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from CHARACTER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: CHARACTER
            -- Character value
            -- (from CHARACTER_REF)

    Max_value: INTEGER is 255
            -- Bounds for integer representation of characters (ASCII)
            -- (from CHARACTER_REF)

    Min_value: INTEGER is 0
            -- (from CHARACTER_REF)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from CHARACTER_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from CHARACTER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
            -- (from CHARACTER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        ensure then -- from CHARACTER_REF
            definition: Result = (code < other.code)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    is_alpha: BOOLEAN
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower
            -- (from CHARACTER_REF)

    is_digit: BOOLEAN
            -- Is item a digit?
            -- A digit is one of 0123456789
            -- (from CHARACTER_REF)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from CHARACTER_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_lower: BOOLEAN
            -- Is item lowercase?
            -- (from CHARACTER_REF)

    is_upper: BOOLEAN
            -- Is item uppercase?
            -- (from CHARACTER_REF)

feature -- Element change

    set_item (c: CHARACTER)
            -- Make c the item value.
            -- (from CHARACTER_REF)

feature -- Conversion

    lower: CHARACTER
            -- Lowercase value of item
            -- Returns item if not is_upper
            -- (from CHARACTER_REF)

    upper: CHARACTER
            -- Uppercase value of item
            -- Returns item if not is_lower
            -- (from CHARACTER_REF)

feature -- Basic routines

    next: CHARACTER
            -- Next character
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_character: (item.code + 1).is_valid_character_code
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = 1

    previous: CHARACTER
            -- Previous character
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_character: (item.code - 1).is_valid_character_code
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = - 1

    infix "+" (incr: INTEGER): CHARACTER
            -- Add incr to the code of item
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_increment: (item.code + incr).is_valid_character_code
        ensure -- from CHARACTER_REF
            valid_result: Result |-| item = incr

    infix "-" (decr: INTEGER): CHARACTER
            -- Subtract decr to the code of item
            -- (from CHARACTER_REF)
        require -- from CHARACTER_REF
            valid_decrement: (item.code - decr).is_valid_character_code
        ensure -- from CHARACTER_REF
            valid_result: item |-| Result = decr

    infix "|-|" (other: CHARACTER): INTEGER
            -- Difference between the codes of item and other
            -- (from CHARACTER_REF)
        ensure -- from CHARACTER_REF
            valid_result: other + Result = item

feature -- Output

    out: STRING
            -- Printable representation of character
            -- (from CHARACTER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER


CHARACTER_REF Chart

class
    CHARACTER_REF

General
    cluster: base.kernel
    description: "References to objects containing a character value"

Ancestors
    COMPARABLE
    HASHABLE

Queries
    infix ">=" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix ">" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix "<=" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix "<" (other: [like Current] CHARACTER_REF): BOOLEAN
    infix "-" (decr: INTEGER): CHARACTER
    infix "+" (incr: INTEGER): CHARACTER
    infix "|-|" (other: CHARACTER): INTEGER
    code: INTEGER
    hash_code: INTEGER
    is_alpha: BOOLEAN
    is_digit: BOOLEAN
    is_equal (other: [like Current] CHARACTER_REF): BOOLEAN
    is_hashable: BOOLEAN
    is_lower: BOOLEAN
    is_upper: BOOLEAN
    item: CHARACTER
    lower: CHARACTER
    max (other: [like Current] CHARACTER_REF): [like Current] CHARACTER_REF
    Max_value: INTEGER
    min (other: [like Current] CHARACTER_REF): [like Current] CHARACTER_REF
    Min_value: INTEGER
    next: CHARACTER
    out: STRING
    previous: CHARACTER
    three_way_comparison (other: CHARACTER_REF): INTEGER
    upper: CHARACTER

Commands
    set_item (c: CHARACTER)


CHARACTER_REF Flat contracts

indexing
    description: "References to objects containing a character value"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    CHARACTER_REF

feature -- Access

    code: INTEGER
            -- Associated integer value

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: CHARACTER
            -- Character value

    Max_value: INTEGER is 255
            -- Bounds for integer representation of characters (ASCII)

    Min_value: INTEGER is 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)
        ensure then
            definition: Result = (code < other.code)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    is_alpha: BOOLEAN
            -- Is item alphabetic?
            -- Alphabetic is is_upper or is_lower

    is_digit: BOOLEAN
            -- Is item a digit?
            -- A digit is one of 0123456789

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_lower: BOOLEAN
            -- Is item lowercase?

    is_upper: BOOLEAN
            -- Is item uppercase?

feature -- Element change

    set_item (c: CHARACTER)
            -- Make c the item value.

feature -- Conversion

    lower: CHARACTER
            -- Lowercase value of item
            -- Returns item if not is_upper

    upper: CHARACTER
            -- Uppercase value of item
            -- Returns item if not is_lower

feature -- Basic routines

    next: CHARACTER
            -- Next character
        require
            valid_character: (item.code + 1).is_valid_character_code
        ensure
            valid_result: Result |-| item = 1

    previous: CHARACTER
            -- Previous character
        require
            valid_character: (item.code - 1).is_valid_character_code
        ensure
            valid_result: Result |-| item = - 1

    infix "+" (incr: INTEGER): CHARACTER
            -- Add incr to the code of item
        require
            valid_increment: (item.code + incr).is_valid_character_code
        ensure
            valid_result: Result |-| item = incr

    infix "-" (decr: INTEGER): CHARACTER
            -- Subtract decr to the code of item
        require
            valid_decrement: (item.code - decr).is_valid_character_code
        ensure
            valid_result: item |-| Result = decr

    infix "|-|" (other: CHARACTER): INTEGER
            -- Difference between the codes of item and other
        ensure
            valid_result: other + Result = item

feature -- Output

    out: STRING
            -- Printable representation of character

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHARACTER_REF


COMPARABLE Chart

deferred class
    COMPARABLE

General
    cluster: base.kernel
    description: "Objects that may be compared according to a total order relation"

Ancestors
    PART_COMPARABLE

Queries
    infix ">=" (other: [like Current] COMPARABLE): BOOLEAN
    infix ">" (other: [like Current] COMPARABLE): BOOLEAN
    infix "<=" (other: [like Current] COMPARABLE): BOOLEAN
    infix "<" (other: [like Current] COMPARABLE): BOOLEAN
    is_equal (other: [like Current] COMPARABLE): BOOLEAN
    max (other: [like Current] COMPARABLE): [like Current] COMPARABLE
    min (other: [like Current] COMPARABLE): [like Current] COMPARABLE
    three_way_comparison (other: [like Current] COMPARABLE): INTEGER

Constraints
    irreflexive comparison


COMPARABLE Flat contracts

indexing
    description: "Objects that may be compared according to a total order relation"
    note: "The basic operation is `<' (less than); others are defined in terms of this operation and `is_equal'."
    status: "See notice at end of class"
    names: comparable, comparison
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    COMPARABLE

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
        require
            other_exists: other /= void
        ensure
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
        require
            other_exists: other /= void
        ensure
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require
            other_exists: other /= void
        ensure
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current object less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            definition: Result = (other <= Current)

invariant

    irreflexive_comparison: not (Current < Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE


CONSOLE Chart

class
    CONSOLE

General
    cluster: base.kernel
    description:
        "Commonly used console input and output mechanisms.
        This class may be used as ancestor by classes needing its facilities."
    create: make_open_stdin, make_open_stdout, make_open_stderr

Ancestors
    PLAIN_TEXT_FILE

Queries
    end_of_file: BOOLEAN
    exists: BOOLEAN
    file_pointer: POINTER
    file_readable: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    separator: CHARACTER

Commands
    append (f: [like Current] CONSOLE)
    dispose
    make_open_stderr (fn: STRING)
    make_open_stdin (fn: STRING)
    make_open_stdout (fn: STRING)
    new_line
    next_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword


CONSOLE Flat contracts

indexing
    description: "[
        Commonly used console input and output mechanisms.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    CONSOLE

create

feature -- Initialization

    make_open_stderr (fn: STRING)
            -- Create an unix standard error file.

    make_open_stdin (fn: STRING)
            -- Create an unix standard input file.
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_stdout (fn: STRING)
            -- Create an unix standard output file.
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature  -- Access

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

feature -- Status report

    end_of_file: BOOLEAN
            -- Have we reached the end of file?
        require -- from FILE
            opened: not is_closed

    exists: BOOLEAN
            -- Does file exist?
        ensure then -- from FILE
            unchanged_mode: mode = old mode

feature  -- Status report

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature  -- Element change

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

feature -- Removal

    dispose
            -- This is closed by the operating system at completion.

feature  -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Input

    next_line
            -- Move to next input line on standard input.
        require -- from FILE
            is_readable: file_readable

    read_character
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        require else
            is_readable: file_readable

    read_real
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of readword.
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in CONSOLE as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in CONSOLE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in CONSOLE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in CONSOLE as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable
        require else
            is_readable: file_readable

    readreal
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in CONSOLE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in CONSOLE as synonym of read_word.
        require -- from FILE
            is_readable: file_readable

feature -- Output

    new_line
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put_boolean (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write line feed at end of default output.
            -- Was declared in CONSOLE as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in CONSOLE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in CONSOLE as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in CONSOLE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in CONSOLE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write r at end of default output.
            -- Was declared in CONSOLE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at end of default output.
            -- Was declared in CONSOLE as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from PLAIN_TEXT_FILE
    plain_text: is_plain_text
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONSOLE


DECLARATOR Chart

class
    DECLARATOR

General
    cluster: base.kernel
    description:
        "Class used to ensure proper precompilation of EiffelBase.
        Not to be used otherwise.""

Ancestors
    ANY


DIRECTORY Chart

class
    DIRECTORY

General
    cluster: base.kernel
    description: "Directories, in the Unix sense, with creation and exploration features"
    create: make_open_read, make

Ancestors
    MEMORY

Queries
    count: INTEGER
    exists: BOOLEAN
    has_entry (entry_name: STRING): BOOLEAN
    is_closed: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_readable: BOOLEAN
    is_writable: BOOLEAN
    lastentry: STRING
    linear_representation: ARRAYED_LIST [STRING]
    name: STRING

Commands
    change_name (new_name: STRING)
    close
    create_dir
    delete
    delete_content
    delete_content_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
    dispose
    make (dn: STRING)
    make_open_read (dn: STRING)
    open_read
    readentry
    recursive_delete
    recursive_delete_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
    start


DIRECTORY Flat contracts

indexing
    description: "Directories, in the Unix sense, with creation and exploration features"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    DIRECTORY

create

    make (dn: STRING)
            -- Create directory object for the directory
            -- of name dn.
        require
            string_exists: dn /= void

    make_open_read (dn: STRING)
            -- Create directory object for the directory
            -- of name dn and open it for reading.
        require
            string_exists: dn /= void

feature -- Initialization

    create_dir
            -- Create a physical directory.
        require
            physical_not_exists: not exists

    make (dn: STRING)
            -- Create directory object for the directory
            -- of name dn.
        require
            string_exists: dn /= void

    make_open_read (dn: STRING)
            -- Create directory object for the directory
            -- of name dn and open it for reading.
        require
            string_exists: dn /= void

feature -- Access

    change_name (new_name: STRING)
            -- Change file name to new_name
        require
            not_new_name_void: new_name /= void
            file_exists: exists
        ensure
            name_changed: name.is_equal (new_name)

    close
            -- Close directory.
        require
            is_open: not is_closed

    has_entry (entry_name: STRING): BOOLEAN
            -- Has directory the entry entry_name?
            -- The use of dir_temp is required not
            -- to change the position in the current
            -- directory entries list.
        require
            string_exists: entry_name /= void

    name: STRING
            -- Directory name

    open_read
            -- Open directory name for reading.

    readentry
            -- Read next directory entry
            -- make result available in lastentry.
            -- Make result void if all entries have been read.
        require
            is_opened: not is_closed

    start
            -- Go to first entry of directory.
        require
            is_opened: not is_closed

feature -- Measurement

    count: INTEGER
            -- Number of entries in directory.
        require
            directory_exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the directory exist?

    is_closed: BOOLEAN
            -- Is current directory closed?

    is_empty: BOOLEAN
            -- Is directory empty?
        require
            directory_exists: exists

    is_executable: BOOLEAN
            -- Is the directory executable?
        require
            directory_exists: exists

    is_readable: BOOLEAN
            -- Is the directory readable?
        require
            directory_exists: exists

    is_writable: BOOLEAN
            -- Is the directory writable?
        require
            directory_exists: exists

    lastentry: STRING
            -- Last entry read by readentry

feature -- Removal

    delete
            -- Delete directory if empty
        require
            directory_exists: exists
            empty_directory: is_empty

    delete_content
            -- Delete all files located in current directory and its
            -- subdirectories.
        require
            directory_exists: exists

    delete_content_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
            -- Delete all files located in current directory and its
            -- subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
            -- action may be set to Void if you don't need it.
            --
            -- Same for is_cancel_requested.
            -- Make it return True to cancel the operation.
            -- is_cancel_requested may be set to Void if you don't need it.
        require
            directory_exists: exists
            valid_file_number: file_number > 0

    dispose
            -- Ensure this medium is closed when garbage collected.

    recursive_delete
            -- Delete directory, its files and its subdirectories.
        require
            directory_exists: exists

    recursive_delete_with_action (action: PROCEDURE [ANY, TUPLE]; is_cancel_requested: FUNCTION [ANY, TUPLE, BOOLEAN]; file_number: INTEGER)
            -- Delete directory, its files and its subdirectories.
            --
            -- action is called each time file_number files has
            -- been deleted and before the function exits.
        require
            directory_exists: exists

feature -- Conversion

    linear_representation: ARRAYED_LIST [STRING]
            -- The entries, in sequential format.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY


DIRECTORY_NAME Chart

class
    DIRECTORY_NAME

General
    cluster: base.kernel
    description: "Directory name abstraction"
    create: make_from_string, make

Ancestors
    PATH_NAME

Queries
    is_directory_name_valid (dir_name: STRING): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] DIRECTORY_NAME): BOOLEAN
    is_valid: BOOLEAN
    is_volume_name_valid (vol_name: STRING): BOOLEAN
    to_c: ANY

Commands
    extend (directory_name: STRING)
    extend_from_array (directories: ARRAY [STRING])
    make
    make_from_string (p: STRING)
    set_directory (directory_name: STRING)
    set_subdirectory (directory_name: STRING)
    set_volume (volume_name: STRING)
    wipe_out


DIRECTORY_NAME Flat contracts

indexing
    description: "Directory name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    DIRECTORY_NAME

create

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature -- Initialization

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the path name equal to other?
            -- (from PATH_NAME)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN
            -- Is dir_name a valid subdirectory part for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: dir_name /= void

    is_volume_name_valid (vol_name: STRING): BOOLEAN
            -- Is vol_name a valid volume name for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: vol_name /= void

feature  -- Status report

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

feature -- Status setting

    extend (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    extend_from_array (directories: ARRAY [STRING])
            -- Append the subdirectories from directories to the path name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            array_exists: directories /= void and then not (directories.is_empty)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_directory (directory_name: STRING)
            -- Set the absolute directory part of the path name to directory_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_subdirectory (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_volume (volume_name: STRING)
            -- Set the volume part of the path name to volume_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature  -- Removal

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature  -- Conversion

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

feature

    is_valid: BOOLEAN
            -- Is the directory name valid?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DIRECTORY_NAME


DOUBLE Chart

expanded class
    DOUBLE

General
    cluster: base.kernel
    description: "Real values, double precision"

Ancestors
    DOUBLE_REF

Queries
    infix ">=" (other: [like Current] DOUBLE): BOOLEAN
    infix ">" (other: [like Current] DOUBLE): BOOLEAN
    infix "<=" (other: [like Current] DOUBLE): BOOLEAN
    infix "<" (other: [like Current] DOUBLE): BOOLEAN
    infix "-" (other: [like Current] DOUBLE): [like Current] DOUBLE
    infix "+" (other: [like Current] DOUBLE): [like Current] DOUBLE
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] DOUBLE): [like Current] DOUBLE
    infix "*" (other: [like Current] DOUBLE): [like Current] DOUBLE
    prefix "-": [like Current] DOUBLE
    prefix "+": [like Current] DOUBLE
    abs: DOUBLE
    ceiling: INTEGER
    divisible (other: DOUBLE_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] DOUBLE): BOOLEAN
    is_hashable: BOOLEAN
    item: DOUBLE
    max (other: [like Current] DOUBLE): [like Current] DOUBLE
    min (other: [like Current] DOUBLE): [like Current] DOUBLE
    one: [like Current] DOUBLE
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: DOUBLE_REF): INTEGER
    truncated_to_integer: INTEGER
    truncated_to_real: REAL
    zero: [like Current] DOUBLE

Commands
    set_item (d: DOUBLE)


DOUBLE Flat contracts

indexing
    description: "Real values, double precision"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    DOUBLE

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from DOUBLE_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: DOUBLE
            -- Numeric double value
            -- (from DOUBLE_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from DOUBLE_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: DOUBLE_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from DOUBLE_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current double?
            -- (from DOUBLE_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from DOUBLE_REF
            not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from DOUBLE_REF
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from DOUBLE_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (d: DOUBLE)
            -- Make d the item value.
            -- (from DOUBLE_REF)

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)
            -- (from DOUBLE_REF)

    truncated_to_real: REAL
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)
            -- (from DOUBLE_REF)

feature -- Basic operations

    abs: DOUBLE
            -- Absolute value
            -- (from DOUBLE_REF)
        ensure -- from DOUBLE_REF
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product with other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from DOUBLE_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
            -- (from DOUBLE_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current double to the power other
            -- (from DOUBLE_REF)

feature -- Output

    out: STRING
            -- Printable representation of double value
            -- (from DOUBLE_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DOUBLE_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE


DOUBLE_REF Chart

class
    DOUBLE_REF

General
    cluster: base.kernel
    description: "References to objects containing a double-precision real number"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix ">=" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix ">" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix "<=" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix "<" (other: [like Current] DOUBLE_REF): BOOLEAN
    infix "-" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    infix "+" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    infix "*" (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    prefix "-": [like Current] DOUBLE_REF
    prefix "+": [like Current] DOUBLE_REF
    abs: DOUBLE
    ceiling: INTEGER
    divisible (other: DOUBLE_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] DOUBLE_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: DOUBLE
    max (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    min (other: [like Current] DOUBLE_REF): [like Current] DOUBLE_REF
    one: [like Current] DOUBLE_REF
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: DOUBLE_REF): INTEGER
    truncated_to_integer: INTEGER
    truncated_to_real: REAL
    zero: [like Current] DOUBLE_REF

Commands
    set_item (d: DOUBLE)

Constraints
    sign times abs


DOUBLE_REF Flat contracts

indexing
    description: "References to objects containing a double-precision real number"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    DOUBLE_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: DOUBLE
            -- Numeric double value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: DOUBLE_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current double?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: DOUBLE_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (d: DOUBLE)
            -- Make d the item value.

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
        ensure
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (Same sign, largest absolute
            -- value no greater than current object's)

    truncated_to_real: REAL
            -- Real part (Same sign, largest absolute
            -- value no greater than current object's)

feature -- Basic operations

    abs: DOUBLE
            -- Absolute value
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current double to the power other

feature -- Output

    out: STRING
            -- Printable representation of double value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_REF


EXCEPTIONS Chart

class
    EXCEPTIONS

General
    cluster: base.kernel
    description:
        "Facilities for adapting the exception handling mechanism.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    EXCEP_CONST

Queries
    assertion_violation: BOOLEAN
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    Postcondition: INTEGER
    Precondition: INTEGER
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    tag_name: STRING
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Commands
    catch (code: INTEGER)
    die (code: INTEGER)
    ignore (code: INTEGER)
    message_on_failure
    no_message_on_failure
    raise (name: STRING)


EXCEPTIONS Flat contracts

indexing
    description: "[
        Facilities for adapting the exception handling mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    EXCEPTIONS

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception

    developer_exception_name: STRING
            -- Name of last developer-raised exception
        require
            applicable: is_developer_exception

    exception: INTEGER
            -- Code of last exception that occurred

    exception_trace: STRING
            -- String representation of the exception trace

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception

    tag_name: STRING
            -- Tag of last violated assertion clause

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.

    raise (name: STRING)
            -- Raise a developer exception of name name.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEPTIONS


EXCEP_CONST Chart

class
    EXCEP_CONST

General
    cluster: base.kernel
    description:
        "Constants used for exception handling.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    Com_exception: INTEGER
    Developer_exception: INTEGER
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    Postcondition: INTEGER
    Precondition: INTEGER
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER


EXCEP_CONST Flat contracts

indexing
    description: "[
        Constants used for exception handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    EXCEP_CONST

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part

    Io_exception: INTEGER is 21
            -- Exception code for I/O error

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition

    Precondition: INTEGER is 3
            -- Exception code for violated precondition

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXCEP_CONST


FILE Chart

deferred class
    FILE

General
    cluster: base.kernel
    description: "Sequential files, viewed as persistent sequences of characters"

Ancestors
    IO_MEDIUM
    SEQUENCE [G]
    UNBOUNDED [G]

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index: INTEGER
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] FILE)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] FILE)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make (fn: STRING)
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out

Constraints
    valid mode
    name exists
    name not empty


FILE Flat contracts

indexing
    description: "Sequential files, viewed as persistent sequences of characters"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    FILE

feature -- Initialization

    make (fn: STRING)
            -- Create file object with fn as file name.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
        require
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
        require
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
        require
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else
            file_opened: not is_closed

    descriptor_available: BOOLEAN

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.

    file_pointer: POINTER
            -- File pointer as required in C

    group_id: INTEGER
            -- Group identification of owner
        require
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
        require
            file_exists: exists

    item: CHARACTER
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
        require
            file_exists: exists

    name: STRING
            -- File name

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
        require
            file_exists: exists

    position: INTEGER
            -- Current cursor position.

    protection: INTEGER
            -- Protection mode, in decimal value
        require
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read

    user_id: INTEGER
            -- User identification of owner
        require
            file_exists: exists

feature -- Measurement

    count: INTEGER
            -- Size in bytes (0 if no associated physical file)

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
        require
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
        ensure then
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?

    file_prunable: BOOLEAN
            -- May items be removed?

    file_readable: BOOLEAN
            -- Is there a current item that may be read?

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?

    Full: BOOLEAN is False
            -- Is structure filled to capacity?

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
        require
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
        require
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
        require
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
        require
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
        require
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
        require
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)

    is_device: BOOLEAN
            -- Is file a device?
        require
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
        require
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
        require
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?

    is_open_read: BOOLEAN
            -- Is file open for reading?

    is_open_write: BOOLEAN
            -- Is file open for writing?

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
        require
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
        require
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
        require
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
        require
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
        require
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
        require
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
        require
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel object?
            -- (from IO_MEDIUM)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
        ensure
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
        ensure
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
        ensure
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
        require
            is_closed: is_closed
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
        ensure
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
        require
            is_open: not is_closed
            valid_name: fname /= void
        ensure
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
        require -- from  LINEAR
            True
        require else
            file_opened: not is_closed

    forth
            -- Go to next position.
        require -- from LINEAR
            not_after: not after
        require else
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
        require
            file_opened: not is_closed

    next_line
            -- Move to next input line.
        require
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
        require
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
        require -- from  TRAVERSABLE
            True
        require else
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
        require
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
        require
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
        require
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
        require
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
        require
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
        require
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
        require
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_boolean (b: BOOLEAN)
            -- Write b at current position.
            -- Was declared in FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d at current position.
            -- Was declared in FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i at current position.
            -- Was declared in FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write r at current position.
            -- Was declared in FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b at current position.
            -- Was declared in FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d at current position.
            -- Was declared in FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write i at current position.
            -- Was declared in FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write r at current position.
            -- Was declared in FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
        require
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
        require
            file_exists: exists
        ensure
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
        require
            file_exists: exists
        ensure
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
        require
            file_exists: exists
        ensure
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
        require
            file_exists: exists
        ensure
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
        require
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
        require
            valid_file_name: fn /= void
        ensure
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        require else
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
        require
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
        require
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
        require
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE


FILE_NAME Chart

class
    FILE_NAME

General
    cluster: base.kernel
    description: "File name abstraction"
    create: make_temporary_name, make_from_string, make

Ancestors
    PATH_NAME

Queries
    is_directory_name_valid (dir_name: STRING): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] FILE_NAME): BOOLEAN
    is_extension_valid (ext: STRING): BOOLEAN
    is_file_name_valid (f_name: STRING): BOOLEAN
    is_valid: BOOLEAN
    is_volume_name_valid (vol_name: STRING): BOOLEAN
    to_c: ANY

Commands
    add_extension (ext: STRING)
    extend (directory_name: STRING)
    extend_from_array (directories: ARRAY [STRING])
    make
    make_from_string (p: STRING)
    set_directory (directory_name: STRING)
    set_file_name (file_name: STRING)
    set_subdirectory (directory_name: STRING)
    set_volume (volume_name: STRING)
    wipe_out


FILE_NAME Flat contracts

indexing
    description: "File name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    FILE_NAME

create

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    make_temporary_name
            -- Create a temporary filename.

feature -- Initialization

    make
            -- Create path name object.
            -- (from PATH_NAME)

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
            -- (from PATH_NAME)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the path name equal to other?
            -- (from PATH_NAME)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN
            -- Is dir_name a valid subdirectory part for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: dir_name /= void

    is_extension_valid (ext: STRING): BOOLEAN
            -- Is ext a valid extension for the operating system?

    is_file_name_valid (f_name: STRING): BOOLEAN
            -- Is f_name a valid file name part for the operating system?

    is_valid: BOOLEAN
            -- Is the file name valid for the operating system?

    is_volume_name_valid (vol_name: STRING): BOOLEAN
            -- Is vol_name a valid volume name for the operating system?
            -- (from PATH_NAME)
        require -- from PATH_NAME
            exists: vol_name /= void

feature  -- Status report

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

feature -- Status setting

    add_extension (ext: STRING)
            -- Append the extension ext to the file name
        require
            string_exists: ext /= void
            non_empty_extension: not ext.is_empty
            valid_extension: is_extension_valid (ext)

    extend (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    extend_from_array (directories: ARRAY [STRING])
            -- Append the subdirectories from directories to the path name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            array_exists: directories /= void and then not (directories.is_empty)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_directory (directory_name: STRING)
            -- Set the absolute directory part of the path name to directory_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_file_name (file_name: STRING)
            -- Set the value of the file name part.
        require
            string_exists: file_name /= void
            valid_file_name: is_file_name_valid (file_name)
        ensure
            valid_file_name: is_valid

    set_subdirectory (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure -- from PATH_NAME
            valid_file_name: is_valid

    set_volume (volume_name: STRING)
            -- Set the volume part of the path name to volume_name.
            -- (from PATH_NAME)
        require -- from PATH_NAME
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        ensure -- from PATH_NAME
            valid_file_name: is_valid

feature  -- Removal

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature  -- Conversion

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FILE_NAME


FUNCTION Chart

class
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

General
    cluster: base.kernel
    description:
        "Objects representing delayed calls to a function,
        with some arguments possibly still open."

Ancestors
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Queries
    callable: BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] FUNCTION [BASE_TYPE, OPEN_ARGS, RESULT_TYPE]): BOOLEAN
    is_hashable: BOOLEAN
    item (args: OPEN_ARGS): RESULT_TYPE
    last_result: RESULT_TYPE
    open_count: INTEGER
    open_operand_type (i: INTEGER): INTEGER
    operands: OPEN_ARGS
    postcondition (args: [like operands] OPEN_ARGS): BOOLEAN
    precondition (args: [like operands] OPEN_ARGS): BOOLEAN
    target: ANY
    valid_operands (args: OPEN_ARGS): BOOLEAN

Commands
    adapt (other: ROUTINE [ANY, OPEN_ARGS])
    apply
    call (args: OPEN_ARGS)
    copy (other: [like Current] FUNCTION [BASE_TYPE, OPEN_ARGS, RESULT_TYPE])
    set_operands (args: OPEN_ARGS)


FUNCTION Flat contracts

indexing
    description: "[
        Objects representing delayed calls to a function,
        with some arguments possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and the addition
        of `last_result' and `item'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    FUNCTION [BASE_TYPE, OPEN_ARGS -> TUPLE, RESULT_TYPE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS])
            -- Initialize from other.
            -- Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Access

    hash_code: INTEGER
            -- Hash code value.
            -- (from ROUTINE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item (args: OPEN_ARGS): RESULT_TYPE
            -- Result of calling function with args as operands.
        require
            valid_operands: valid_operands (args)
            callable: callable

    last_result: RESULT_TYPE
            -- Result of last call, if any.

    open_operand_type (i: INTEGER): INTEGER
            -- Type of ith open operand.
            -- (from ROUTINE)
        require -- from ROUTINE
            positive: i >= 1
            within_bounds: i <= open_count

    operands: OPEN_ARGS
            -- Open operands.
            -- (from ROUTINE)

    postcondition (args: like operands): BOOLEAN
            -- Does current state satisfy routine's
            -- postcondition for args?
            -- (from ROUTINE)

    precondition (args: like operands): BOOLEAN
            -- Do args satisfy routine's precondition
            -- in current state?
            -- (from ROUTINE)

    target: ANY
            -- Target of call.
            -- (from ROUTINE)

feature -- Measurement

    open_count: INTEGER
            -- Number of open operands.
            -- (from ROUTINE)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is associated function the same as the one
            -- associated with other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    callable: BOOLEAN
            -- Can routine be called on current object?
            -- (from ROUTINE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    valid_operands (args: OPEN_ARGS): BOOLEAN
            -- Are args valid operands for this routine?
            -- (from ROUTINE)

feature -- Element change

    set_operands (args: OPEN_ARGS)
            -- Use args as operands for next call.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)

feature -- Duplication

    copy (other: like Current)
            -- Use same function as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Basic operations

    apply
            -- Call function with operands as last set.
        require -- from ROUTINE
            valid_operands: valid_operands (operands)
            callable: callable

    call (args: OPEN_ARGS)
            -- Call routine with operands args.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
            callable: callable

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FUNCTION


GC_INFO Chart

class
    GC_INFO

General
    cluster: base.kernel
    description:
        "Garbage collector statistics.
        This class may be used as ancestor by classes needing its facilities.
        Time accounting is relevant only if `enable_time_accounting'
        (from MEMORY) has been called."
    create: make

Ancestors
    MEM_CONST

Queries
    C_memory: INTEGER
    collected: INTEGER
    collected_average: INTEGER
    cpu_interval_time: DOUBLE
    cpu_interval_time_average: DOUBLE
    cpu_time: DOUBLE
    cpu_time_average: DOUBLE
    cycle_count: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    Incremental_collector: INTEGER
    memory_used: INTEGER
    real_interval_time: INTEGER
    real_interval_time_average: INTEGER
    real_time: INTEGER
    real_time_average: INTEGER
    sys_interval_time: DOUBLE
    sys_interval_time_average: DOUBLE
    sys_time: DOUBLE
    sys_time_average: DOUBLE
    Total_memory: INTEGER
    type: INTEGER

Commands
    make (memory: INTEGER)
    update (memory: INTEGER)


GC_INFO Flat contracts

indexing
    description: "[
            Garbage collector statistics.
            This class may be used as ancestor by classes needing its facilities.
            Time accounting is relevant only if `enable_time_accounting'
            (from MEMORY) has been called.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    GC_INFO

create

    make (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of update.

feature -- Initialization

    make (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of update.

    update (memory: INTEGER)
            -- Fill in statistics for memory type
            -- Was declared in GC_INFO as synonym of make.

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    collected: INTEGER
            -- Number of bytes collected by the last cycle,
            -- for type before last call to update

    collected_average: INTEGER
            -- Average number of bytes collected by a cycle,
            -- for type before last call to update

    cpu_interval_time: DOUBLE
            -- Amount of CPU time elapsed since between last
            -- and penultimate cycles for type before
            -- last call to update

    cpu_interval_time_average: DOUBLE
            -- Average amount of CPU time between two cycles,
            -- for type before last call to update

    cpu_time: DOUBLE
            -- Amount of CPU time, in seconds, spent in cycle,
            -- for type before last call to update

    cpu_time_average: DOUBLE
            -- Average amount of CPU time spent in cycle,
            -- in seconds, for type before last call to update

    cycle_count: INTEGER
            -- Number of collection cycles for type
            -- before last call to update

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    memory_used: INTEGER
            -- Total number of bytes used (counting overhead)
            -- after last cycle for type before last
            -- call to update

    real_interval_time: INTEGER
            -- Real interval time (as opposed to CPU time) between
            -- two automatically raised cycles, in centi-seconds,
            -- for type before last call to update

    real_interval_time_average: INTEGER
            -- Average real interval time between two automatic
            -- cycles, in centi-seconds,
            -- for type before last call to update

    real_time: INTEGER
            -- Real time in centi-seconds used by last cycle
            -- for type, before last call to update;
            -- this may not be accurate on systems which do not
            -- provide a sub-second accuracy clock (typically
            -- provided on BSD).

    real_time_average: INTEGER
            -- Average amount of real time, in centi-seconds,
            -- spent in collection cycle,
            -- for type before last call to update

    sys_interval_time: DOUBLE
            -- Amount of kernel time elapsed since between
            -- the last and the penultimate cycle,
            -- for type before last call to update

    sys_interval_time_average: DOUBLE
            -- Average amount of kernel time between two cycles,
            -- for type before last call to update

    sys_time: DOUBLE
            -- Amount of kernel time, in seconds, spent in cycle,
            -- for type before last call to update

    sys_time_average: DOUBLE
            -- Average amount of kernel time spent in cycle,
            -- for type before last call to update

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    type: INTEGER
            -- Collector type (Full, Collect),
            -- for type before last call to update

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class GC_INFO


HASHABLE Chart

deferred class
    HASHABLE

General
    cluster: base.kernel
    description:
        "Values that may be hashed into an integer index,
        for use as keys in hash tables"

Ancestors
    ANY

Queries
    hash_code: INTEGER
    is_hashable: BOOLEAN


HASHABLE Flat contracts

indexing
    description: "[
        Values that may be hashed into an integer index,
        for use as keys in hash tables
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    HASHABLE

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure
            good_hash_value: Result >= 0

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure
            ok_if_not_default: Result implies (Current /= default)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASHABLE


INTEGER_16 Chart

expanded class
    INTEGER_16

General
    cluster: base.kernel
    description: "Integer values coded on 16 bits"

Ancestors
    INTEGER_16_REF

Queries
    infix "&" (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "//" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix ">=" (other: [like Current] INTEGER_16): BOOLEAN
    infix ">" (other: [like Current] INTEGER_16): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_16): BOOLEAN
    infix "<" (other: [like Current] INTEGER_16): BOOLEAN
    infix "-" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "\\" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "+" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_16): DOUBLE
    infix "*" (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "|" (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_16
    infix "|>>" (n: INTEGER): [like Current] INTEGER_16
    prefix "-": [like Current] INTEGER_16
    prefix "+": [like Current] INTEGER_16
    abs: INTEGER_16
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    bit_not: [like Current] INTEGER_16
    bit_or (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    bit_shift (n: INTEGER): [like Current] INTEGER_16
    bit_shift_left (n: INTEGER): [like Current] INTEGER_16
    bit_shift_right (n: INTEGER): [like Current] INTEGER_16
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_16): [like Current] INTEGER_16
    divisible (other: INTEGER_16_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_16): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_16
    max (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    min (other: [like Current] INTEGER_16): [like Current] INTEGER_16
    one: [like Current] INTEGER_16
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_16_REF): INTEGER
    to_integer: INTEGER
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_16

Commands
    set_item (i: INTEGER_16)


INTEGER_16 Flat contracts

indexing
    description: "Integer values coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    INTEGER_16

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_16_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_16_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_16
            -- Integer value
            -- (from INTEGER_16_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_16_REF)
        ensure -- from INTEGER_16_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_16_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_16_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_16_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_16_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_16_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_16_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_16_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_16)
            -- Make i the item value.
            -- (from INTEGER_16_REF)

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_16_REF)

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_16_REF)

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_16
            -- Absolute value
            -- (from INTEGER_16_REF)
        ensure -- from INTEGER_16_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_16_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_16_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_16_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_16_REF)

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_16_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.
            -- (from INTEGER_16_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_16_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.
            -- (from INTEGER_16_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_than_16: n < 16

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_16_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.
            -- (from INTEGER_16_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.
            -- (from INTEGER_16_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
            -- (from INTEGER_16_REF)
        require -- from INTEGER_16_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_16_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_16_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16


INTEGER_16_REF Chart

class
    INTEGER_16_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value coded on 16 bits"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "//" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix ">=" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_16_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "\\" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "+" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_16_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "|" (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_16_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_16_REF
    prefix "-": [like Current] INTEGER_16_REF
    prefix "+": [like Current] INTEGER_16_REF
    abs: INTEGER_16
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    bit_not: [like Current] INTEGER_16_REF
    bit_or (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_16_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_16_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_16_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    divisible (other: INTEGER_16_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_16_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_16
    max (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    min (other: [like Current] INTEGER_16_REF): [like Current] INTEGER_16_REF
    one: [like Current] INTEGER_16_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_16_REF): INTEGER
    to_integer: INTEGER
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_16_REF

Commands
    set_item (i: INTEGER_16)

Constraints
    sign times abs


INTEGER_16_REF Flat contracts

indexing
    description: "References to objects containing an integer value coded on 16 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    INTEGER_16_REF

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_16
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_16_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_16_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_16)
            -- Make i the item value.

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_16
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER_16): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_16: n <= 16
            n_greater_or_equal_to_minus_16: n >= - 16

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_16: n < 16

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_16_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_16_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_16: n <= 16

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_16_REF


INTEGER_64 Chart

expanded class
    INTEGER_64

General
    cluster: base.kernel
    description: "Integer values coded on 64 bits"

Ancestors
    INTEGER_64_REF

Queries
    infix "&" (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "//" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix ">=" (other: [like Current] INTEGER_64): BOOLEAN
    infix ">" (other: [like Current] INTEGER_64): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_64): BOOLEAN
    infix "<" (other: [like Current] INTEGER_64): BOOLEAN
    infix "-" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "\\" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "+" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_64): DOUBLE
    infix "*" (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "|" (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    infix "|<<" (n: INTEGER): [like Current] INTEGER_64
    infix "|>>" (n: INTEGER): [like Current] INTEGER_64
    prefix "-": [like Current] INTEGER_64
    prefix "+": [like Current] INTEGER_64
    abs: INTEGER_64
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    bit_not: [like Current] INTEGER_64
    bit_or (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    bit_shift (n: INTEGER): [like Current] INTEGER_64
    bit_shift_left (n: INTEGER): [like Current] INTEGER_64
    bit_shift_right (n: INTEGER): [like Current] INTEGER_64
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_64): [like Current] INTEGER_64
    divisible (other: INTEGER_64_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_64): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_64
    max (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    min (other: [like Current] INTEGER_64): [like Current] INTEGER_64
    one: [like Current] INTEGER_64
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_64_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_32: INTEGER
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_64

Commands
    set_item (i: INTEGER_64)


INTEGER_64 Flat contracts

indexing
    description: "Integer values coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    INTEGER_64

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_64_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_64_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_64
            -- Integer value
            -- (from INTEGER_64_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_64_REF)
        ensure -- from INTEGER_64_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_64_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_64_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_64_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_64_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_64_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_64_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_64_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_64)
            -- Make i the item value.
            -- (from INTEGER_64_REF)

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- Was declared in INTEGER_64_REF as synonym of to_integer_32.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_32: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- Was declared in INTEGER_64_REF as synonym of to_integer.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_64
            -- Absolute value
            -- (from INTEGER_64_REF)
        ensure -- from INTEGER_64_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_64_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_64_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_64_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_64_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.
            -- (from INTEGER_64_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_64_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.
            -- (from INTEGER_64_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_than_64: n < 64

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_64_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.
            -- (from INTEGER_64_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.
            -- (from INTEGER_64_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
            -- (from INTEGER_64_REF)
        require -- from INTEGER_64_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_64_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_64_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64


INTEGER_64_REF Chart

class
    INTEGER_64_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value coded on 64 bits"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "//" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix ">=" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_64_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "\\" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "+" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_64_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "|" (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    infix "|<<" (n: INTEGER): [like Current] INTEGER_64_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_64_REF
    prefix "-": [like Current] INTEGER_64_REF
    prefix "+": [like Current] INTEGER_64_REF
    abs: INTEGER_64
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    bit_not: [like Current] INTEGER_64_REF
    bit_or (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_64_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_64_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_64_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    divisible (other: INTEGER_64_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_64_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_64
    max (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    min (other: [like Current] INTEGER_64_REF): [like Current] INTEGER_64_REF
    one: [like Current] INTEGER_64_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_64_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_32: INTEGER
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_64_REF

Commands
    set_item (i: INTEGER_64)

Constraints
    sign times abs


INTEGER_64_REF Flat contracts

indexing
    description: "References to objects containing an integer value coded on 64 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    INTEGER_64_REF

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_64
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_64_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_64_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_64)
            -- Make i the item value.

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- Was declared in INTEGER_64_REF as synonym of to_integer_32.
        require
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_32: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- Was declared in INTEGER_64_REF as synonym of to_integer.
        require
            not_too_small: item >= - -2147483648
            not_too_big: item <= 2147483647

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER_64
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_64: n <= 64
            n_greater_or_equal_to_minus_64: n >= - 64

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_64: n < 64

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_64_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_64_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_64: n <= 64

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_64_REF


INTEGER_8 Chart

expanded class
    INTEGER_8

General
    cluster: base.kernel
    description: "Integer values coded on 8 bits"

Ancestors
    INTEGER_8_REF

Queries
    infix "&" (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "//" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix ">=" (other: [like Current] INTEGER_8): BOOLEAN
    infix ">" (other: [like Current] INTEGER_8): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_8): BOOLEAN
    infix "<" (other: [like Current] INTEGER_8): BOOLEAN
    infix "-" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "\\" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "+" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_8): DOUBLE
    infix "*" (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "|" (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_8
    infix "|>>" (n: INTEGER): [like Current] INTEGER_8
    prefix "-": [like Current] INTEGER_8
    prefix "+": [like Current] INTEGER_8
    abs: INTEGER_8
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    bit_not: [like Current] INTEGER_8
    bit_or (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    bit_shift (n: INTEGER): [like Current] INTEGER_8
    bit_shift_left (n: INTEGER): [like Current] INTEGER_8
    bit_shift_right (n: INTEGER): [like Current] INTEGER_8
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_8): [like Current] INTEGER_8
    divisible (other: INTEGER_8_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_8): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_8
    max (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    min (other: [like Current] INTEGER_8): [like Current] INTEGER_8
    one: [like Current] INTEGER_8
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_8_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    zero: [like Current] INTEGER_8

Commands
    set_item (i: INTEGER_8)


INTEGER_8 Flat contracts

indexing
    description: "Integer values coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    INTEGER_8

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_8_REF)

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_8_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_8
            -- Integer value
            -- (from INTEGER_8_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_8_REF)
        ensure -- from INTEGER_8_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_8_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_8_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_8_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_8_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_8_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_8_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_8_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_8)
            -- Make i the item value.
            -- (from INTEGER_8_REF)

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.
            -- (from INTEGER_8_REF)

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_8_REF)

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_8_REF)

feature -- Basic operations

    abs: INTEGER_8
            -- Absolute value
            -- (from INTEGER_8_REF)
        ensure -- from INTEGER_8_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_8_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_8_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_8_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_8_REF)

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_8_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.
            -- (from INTEGER_8_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_8_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.
            -- (from INTEGER_8_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_than_8: n < 8

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_8_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.
            -- (from INTEGER_8_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.
            -- (from INTEGER_8_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
            -- (from INTEGER_8_REF)
        require -- from INTEGER_8_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_8_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_8_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8


INTEGER_8_REF Chart

class
    INTEGER_8_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value coded on 8 bits"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "//" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix ">=" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_8_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "\\" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "+" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_8_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "|" (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_8_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_8_REF
    prefix "-": [like Current] INTEGER_8_REF
    prefix "+": [like Current] INTEGER_8_REF
    abs: INTEGER_8
    ascii_char: CHARACTER
    bit_and (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    bit_not: [like Current] INTEGER_8_REF
    bit_or (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_8_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_8_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_8_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    divisible (other: INTEGER_8_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_8_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: INTEGER_8
    max (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    min (other: [like Current] INTEGER_8_REF): [like Current] INTEGER_8_REF
    one: [like Current] INTEGER_8_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_8_REF): INTEGER
    to_integer: INTEGER
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    zero: [like Current] INTEGER_8_REF

Commands
    set_item (i: INTEGER_8)

Constraints
    sign times abs


INTEGER_8_REF Flat contracts

indexing
    description: "References to objects containing an integer value coded on 8 bits"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    INTEGER_8_REF

feature -- Access

    ascii_char: CHARACTER
            -- Returns corresponding ASCII character to item value.

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER_8
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_8_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_8_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (i: INTEGER_8)
            -- Make i the item value.

feature -- Conversion

    to_integer: INTEGER
            -- Convert item into an INTEGER_32 value.

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

feature -- Basic operations

    abs: INTEGER_8
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER_8): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_8: n <= 8
            n_greater_or_equal_to_minus_8: n >= - 8

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_8: n < 8

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_8_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_8_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_8: n <= 8

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_8_REF


INTEGER Chart

expanded class
    INTEGER

General
    cluster: base.kernel
    description: "Integer values"

Ancestors
    INTEGER_REF

Queries
    infix "&" (i: [like Current] INTEGER): [like Current] INTEGER
    infix "//" (other: [like Current] INTEGER): [like Current] INTEGER
    infix ">=" (other: [like Current] INTEGER): BOOLEAN
    infix ">" (other: [like Current] INTEGER): BOOLEAN
    infix "<=" (other: [like Current] INTEGER): BOOLEAN
    infix "<" (other: [like Current] INTEGER): BOOLEAN
    infix "-" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "\\" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "+" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER): DOUBLE
    infix "*" (other: [like Current] INTEGER): [like Current] INTEGER
    infix "|" (i: [like Current] INTEGER): [like Current] INTEGER
    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER
    infix "|>>" (n: INTEGER): [like Current] INTEGER
    prefix "-": [like Current] INTEGER
    prefix "+": [like Current] INTEGER
    abs: INTEGER
    bit_and (i: [like Current] INTEGER): [like Current] INTEGER
    bit_not: [like Current] INTEGER
    bit_or (i: [like Current] INTEGER): [like Current] INTEGER
    bit_shift (n: INTEGER): [like Current] INTEGER
    bit_shift_left (n: INTEGER): [like Current] INTEGER
    bit_shift_right (n: INTEGER): [like Current] INTEGER
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER): [like Current] INTEGER
    divisible (other: INTEGER_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER): BOOLEAN
    is_hashable: BOOLEAN
    is_valid_character_code: BOOLEAN
    item: INTEGER
    max (other: [like Current] INTEGER): [like Current] INTEGER
    min (other: [like Current] INTEGER): [like Current] INTEGER
    one: [like Current] INTEGER
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_REF): INTEGER
    to_boolean: BOOLEAN
    to_character: CHARACTER
    to_hex_character: CHARACTER
    to_hex_string: STRING
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER

Commands
    set_item (i: INTEGER)


INTEGER Flat contracts

indexing
    description: "Integer values"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    INTEGER

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from INTEGER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER
            -- Integer value
            -- (from INTEGER_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from INTEGER_REF)
        ensure -- from INTEGER_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from INTEGER_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
            -- (from INTEGER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
            -- (from INTEGER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_REF
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from INTEGER_REF
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from INTEGER_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_valid_character_code: BOOLEAN
            -- Does current object represent a character?
            -- (from INTEGER_REF)

feature -- Element change

    set_item (i: INTEGER)
            -- Make i the item value.
            -- (from INTEGER_REF)

feature -- Conversion

    to_boolean: BOOLEAN
            -- True if not zero.
            -- (from INTEGER_REF)

    to_character: CHARACTER
            -- Returns corresponding ASCII character to item value.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            valid_character: is_valid_character_code

    to_hex_character: CHARACTER
            -- Convert item into an hexadecimal character.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            in_bounds: 0 <= item and item <= 15
        ensure -- from INTEGER_REF
            valid_character: ("0123456789ABCDEF").has (Result)

    to_hex_string: STRING
            -- Convert item into an hexadecimal string.
            -- (from INTEGER_REF)
        ensure -- from INTEGER_REF
            result_not_void: Result /= void
            result_valid_count: Result.count = (create {PLATFORM}).integer_bits // 4

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.
            -- (from INTEGER_REF)

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER
            -- Absolute value
            -- (from INTEGER_REF)
        ensure -- from INTEGER_REF
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from INTEGER_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
            -- (from INTEGER_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from INTEGER_REF
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other
            -- (from INTEGER_REF)

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)
            -- (from INTEGER_REF)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.
            -- (from INTEGER_REF)

    bit_not: like Current
            -- One's complement of Current.
            -- (from INTEGER_REF)

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.
            -- (from INTEGER_REF)

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_than_32: n < 32

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.
            -- (from INTEGER_REF)

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.
            -- (from INTEGER_REF)

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.
            -- (from INTEGER_REF)

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
            -- (from INTEGER_REF)
        require -- from INTEGER_REF
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

feature -- Output

    out: STRING
            -- Printable representation of integer value
            -- (from INTEGER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INTEGER_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER


INTEGER_INTERVAL Chart

class
    INTEGER_INTERVAL

General
    cluster: base.kernel
    description: "Contiguous integer intervals"
    create: make

Ancestors
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    SET [G]

Queries
    infix "@" (i: INTEGER): INTEGER
    additional_space: INTEGER
    all_cleared: BOOLEAN
    as_array: ARRAY [INTEGER]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    extendible: BOOLEAN
    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: INTEGER): BOOLEAN
    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] INTEGER_INTERVAL): BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item (i: INTEGER): INTEGER
    linear_representation: LINEAR [INTEGER]
    lower: INTEGER
    lower_defined: BOOLEAN
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    subinterval (start_pos, end_pos: INTEGER): [like Current] INTEGER_INTERVAL
    upper: INTEGER
    upper_defined: BOOLEAN
    valid_index (v: INTEGER): BOOLEAN

Commands
    adapt (other: INTEGER_INTERVAL)
    automatic_grow
    compare_objects
    compare_references
    copy (other: [like Current] INTEGER_INTERVAL)
    extend (v: INTEGER)
    fill (other: CONTAINER [INTEGER])
    grow (i: INTEGER)
    prune_all (v: INTEGER)
    put (v: INTEGER)
    resize (min_index, max_index: INTEGER)
    resize_exactly (min_index, max_index: INTEGER)
    wipe_out

Constraints
    count definition
    index set is range
    not infinite


INTEGER_INTERVAL Flat contracts

indexing
    description: "Contiguous integer intervals"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    INTEGER_INTERVAL

create

    make (min_index, max_index: INTEGER)
            -- Set up interval to have bounds min_index and
            -- max_index (empty if min_index > max_index)
        ensure
            lower_defined: lower_defined
            upper_defined: upper_defined
            set_if_non_empty: (min_index <= max_index) implies ((lower = min_index) and (upper = max_index))
            empty_if_not_in_order: (min_index > max_index) implies is_empty

feature -- Initialization

    adapt (other: INTEGER_INTERVAL)
            -- Reset to be the same interval as other.
        require
            other_not_void: other /= void
        ensure
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

feature -- Access

    has (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of valid_index.
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    item (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    lower: INTEGER
            -- Smallest value in interval
        require
            lower_defined: lower_defined

    lower_defined: BOOLEAN
            -- Is there a lower bound?

    upper: INTEGER
            -- Largest value in interval
        require
            upper_defined: upper_defined

    upper_defined: BOOLEAN
            -- Is there an upper bound?

    valid_index (v: INTEGER): BOOLEAN
            -- Does v appear in interval?
            -- Was declared in INTEGER_INTERVAL as synonym of has.
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then
            iff_within_bounds: Result = ((upper_defined implies v <= upper) and (lower_defined implies v >= lower))

    infix "@" (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in INTEGER_INTERVAL as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Maximum number of items in interval
            -- (here the same thing as count)

    count: INTEGER
            -- Number of items in interval
        ensure then
            definition: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (here: the interval itself)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            index_set_is_range: equal (Result, Current)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears in structure
        ensure -- from BAG
            non_negative_occurrences: Result >= 0
        ensure then
            one_iff_in_bounds: Result = 1 implies has (v)
            zero_otherwise: Result /= 1 implies Result = 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            iff_same_bounds: Result = ((lower_defined implies (other.lower_defined and lower = other.lower)) and (upper_defined implies (other.upper_defined and upper = other.upper)))

feature -- Status report

    all_cleared: BOOLEAN
            -- Are all items set to default values?
        ensure then
            iff_at_zero: Result = ((lower = 0) and (upper = 0))

    extendible: BOOLEAN
            -- May new items be added?
            -- Answer: yes

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May individual items be removed?
            -- Answer: no

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

    fill (other: CONTAINER [INTEGER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: INTEGER)
            -- Make sure that interval goes all the way
            -- to v (up or down).
            -- Was declared in INTEGER_INTERVAL as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then
            extended_down: lower = (old lower).min (v)
            extended_up: upper = (old upper).max (v)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune_all (v: INTEGER)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
        ensure -- from RESIZABLE
            new_capacity: capacity >= i
        ensure then
            no_loss_from_bottom: lower <= old lower
            no_loss_from_top: upper >= old upper

    resize (min_index, max_index: INTEGER)
            -- Rearrange interval to go from at most
            -- min_index to at least max_index,
            -- encompassing previous bounds.

    resize_exactly (min_index, max_index: INTEGER)
            -- Rearrange interval to go from
            -- min_index to max_index.

feature -- Conversion

    as_array: ARRAY [INTEGER]
            -- Plain array containing interval's items
        require
            finite: upper_defined and lower_defined
        ensure
            same_lower: Result.lower = lower
            same_upper: Result.upper = upper

    linear_representation: LINEAR [INTEGER]
            -- Representation as a linear structure

feature -- Duplication

    copy (other: like Current)
            -- Reset to be the same interval as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            same_lower: lower = other.lower
            same_upper: upper = other.upper
            same_lower_defined: lower_defined = other.lower_defined
            same_upper_defined: upper_defined = other.upper_defined

    subinterval (start_pos, end_pos: INTEGER): like Current
            -- Interval made of items of current array within
            -- bounds start_pos and end_pos.

feature -- Iteration

    exists (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does at least one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) > 0)

    exists1 (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Does exactly one of  interval's values
            -- satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) = 1)

    for_all (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Do all interval's values satisfy condition?
        require
            finite: upper_defined and lower_defined
        ensure
            consistent_with_count: Result = (hold_count (condition) = count)

    hold_count (condition: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): INTEGER
            -- Number of  interval's values that
            -- satisfy condition
        require
            finite: upper_defined and lower_defined
        ensure
            non_negative: Result >= 0

invariant

    count_definition: upper_defined and lower_defined implies count = upper - lower + 1
    index_set_is_range: equal (index_set, Current)
    not_infinite: upper_defined and lower_defined
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_INTERVAL


INTEGER_REF Chart

class
    INTEGER_REF

General
    cluster: base.kernel
    description: "References to objects containing an integer value"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix "&" (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "//" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix ">=" (other: [like Current] INTEGER_REF): BOOLEAN
    infix ">" (other: [like Current] INTEGER_REF): BOOLEAN
    infix "<=" (other: [like Current] INTEGER_REF): BOOLEAN
    infix "<" (other: [like Current] INTEGER_REF): BOOLEAN
    infix "-" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "\\" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "+" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] INTEGER_REF): DOUBLE
    infix "*" (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "|" (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
    infix "|<<" (n: INTEGER): [like Current] INTEGER_REF
    infix "|>>" (n: INTEGER): [like Current] INTEGER_REF
    prefix "-": [like Current] INTEGER_REF
    prefix "+": [like Current] INTEGER_REF
    abs: INTEGER
    bit_and (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    bit_not: [like Current] INTEGER_REF
    bit_or (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    bit_shift (n: INTEGER): [like Current] INTEGER_REF
    bit_shift_left (n: INTEGER): [like Current] INTEGER_REF
    bit_shift_right (n: INTEGER): [like Current] INTEGER_REF
    bit_test (n: INTEGER): BOOLEAN
    bit_xor (i: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    divisible (other: INTEGER_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] INTEGER_REF): BOOLEAN
    is_hashable: BOOLEAN
    is_valid_character_code: BOOLEAN
    item: INTEGER
    max (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    min (other: [like Current] INTEGER_REF): [like Current] INTEGER_REF
    one: [like Current] INTEGER_REF
    out: STRING
    sign: INTEGER
    three_way_comparison (other: INTEGER_REF): INTEGER
    to_boolean: BOOLEAN
    to_character: CHARACTER
    to_hex_character: CHARACTER
    to_hex_string: STRING
    to_integer_16: INTEGER_16
    to_integer_64: INTEGER_64
    to_integer_8: INTEGER_8
    zero: [like Current] INTEGER_REF

Commands
    set_item (i: INTEGER)

Constraints
    sign times abs


INTEGER_REF Flat contracts

indexing
    description: "References to objects containing an integer value"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    INTEGER_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: INTEGER
            -- Integer value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: INTEGER_REF): INTEGER
            -- If current object equal to other, 0
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is current integer less than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: INTEGER_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            value: Result = (other.item /= 0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0) or (other.conforms_to (0.0) and item > 0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_valid_character_code: BOOLEAN
            -- Does current object represent a character?

feature -- Element change

    set_item (i: INTEGER)
            -- Make i the item value.

feature -- Conversion

    to_boolean: BOOLEAN
            -- True if not zero.

    to_character: CHARACTER
            -- Returns corresponding ASCII character to item value.
        require
            valid_character: is_valid_character_code

    to_hex_character: CHARACTER
            -- Convert item into an hexadecimal character.
        require
            in_bounds: 0 <= item and item <= 15
        ensure
            valid_character: ("0123456789ABCDEF").has (Result)

    to_hex_string: STRING
            -- Convert item into an hexadecimal string.
        ensure
            result_not_void: Result /= void
            result_valid_count: Result.count = (create {PLATFORM}).integer_bits // 4

    to_integer_16: INTEGER_16
            -- Convert item into an INTEGER_16 value.
        require
            not_too_small: item >= - 32768
            not_too_big: item <= 32767

    to_integer_64: INTEGER_64
            -- Convert item into an INTEGER_64 value.

    to_integer_8: INTEGER_8
            -- Convert item into an INTEGER_8 value.
        require
            not_too_small: item >= - 128
            not_too_big: item <= 127

feature -- Basic operations

    abs: INTEGER
            -- Absolute value
        ensure
            non_negative: Result >= 0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): DOUBLE
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)

    infix "//" (other: like Current): like Current
            -- Integer division of Current by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "\\" (other: like Current): like Current
            -- Remainder of the integer division of Current by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Integer power of Current by other

    infix "|..|" (other: INTEGER): INTEGER_INTERVAL
            -- Interval from current element to other
            -- (empty if other less than current integer)

feature -- Bit operations

    bit_and (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of &.

    bit_not: like Current
            -- One's complement of Current.

    bit_or (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of |.

    bit_shift (n: INTEGER): like Current
            -- Shift Current from n position to right if n positive,
            -- to left otherwise.
        require
            n_less_or_equal_to_32: n <= 32
            n_greater_or_equal_to_minus_32: n >= - 32

    bit_shift_left (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of `|<<'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_shift_right (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of `|>>'.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    bit_test (n: INTEGER): BOOLEAN
            -- Test n-th position of Current.
        require
            n_nonnegative: n >= 0
            n_less_than_32: n < 32

    bit_xor (i: like Current): like Current
            -- Bitwise xor between Current' and i.

    infix "&" (i: like Current): like Current
            -- Bitwise and between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_and.

    infix "|" (i: like Current): like Current
            -- Bitwise or between Current' and i.
            -- Was declared in INTEGER_REF as synonym of bit_or.

    infix "|<<" (n: INTEGER): like Current
            -- Shift Current from n position to left.
            -- Was declared in INTEGER_REF as synonym of bit_shift_left.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

    infix "|>>" (n: INTEGER): like Current
            -- Shift Current from n position to right.
            -- Was declared in INTEGER_REF as synonym of bit_shift_right.
        require
            n_nonnegative: n >= 0
            n_less_or_equal_to_32: n <= 32

feature -- Output

    out: STRING
            -- Printable representation of integer value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTEGER_REF


IO_MEDIUM Chart

deferred class
    IO_MEDIUM

General
    cluster: base.kernel
    description: "Any medium that can perform input and/or output"

Ancestors
    MEMORY
    STRING_HANDLER

Queries
    exists: BOOLEAN
    extendible: BOOLEAN
    handle: INTEGER
    handle_available: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_writable: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    readable: BOOLEAN
    retrieved: ANY
    support_storable: BOOLEAN

Commands
    basic_store (object: ANY)
    close
    dispose
    general_store (object: ANY)
    independent_store (object: ANY)
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)


IO_MEDIUM Flat contracts

indexing
    description: "Any medium that can perform input and/or output"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    IO_MEDIUM

feature -- Access

    name: STRING
            -- Medium name

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure
            result_exists: Result /= void

feature -- Status report

    exists: BOOLEAN
            -- Does medium exist?

    extendible: BOOLEAN
            -- May new items be added?

    handle: INTEGER
            -- Handle to medium
        require
            valid_handle: handle_available

    handle_available: BOOLEAN
            -- Is the handle available after class has been
            -- created?

    is_closed: BOOLEAN
            -- Is the I/O medium open

    is_executable: BOOLEAN
            -- Is medium executable?
        require
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is this medium opened for input

    is_open_write: BOOLEAN
            -- Is this medium opened for output

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?

    is_readable: BOOLEAN
            -- Is medium readable?
        require
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is medium writable?
        require
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character

    last_double: DOUBLE
            -- Last double read by read_double

    last_integer: INTEGER
            -- Last integer read by read_integer

    last_real: REAL
            -- Last real read by read_real

    last_string: STRING
            -- Last string read

    readable: BOOLEAN
            -- Is there a current item that may be read?
        require
            handle_exists: exists

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel object?

feature -- Status setting

    close
            -- Close medium.
        require
            medium_is_open: not is_closed

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character

    lastdouble: DOUBLE
            -- Last double read by read_double

    lastint: INTEGER
            -- Last integer read by read_integer

    lastreal: REAL
            -- Last real read by read_real

    laststring: STRING
            -- Last string read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of readchar.
        require
            is_readable: readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of readdouble.
        require
            is_readable: readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of readint.
        require
            is_readable: readable

    read_line
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readline.
        require
            is_readable: readable

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of readreal.
        require
            is_readable: readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of readstream.
        require
            is_readable: readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in IO_MEDIUM as synonym of read_character.
        require
            is_readable: readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in IO_MEDIUM as synonym of read_double.
        require
            is_readable: readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in IO_MEDIUM as synonym of read_integer.
        require
            is_readable: readable

    readline
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_line.
        require
            is_readable: readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in IO_MEDIUM as synonym of read_real.
        require
            is_readable: readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in IO_MEDIUM as synonym of read_stream.
        require
            is_readable: readable

feature -- Output

    new_line
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of put_new_line.
        require
            extendible: extendible

    put_boolean (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of putbool.
        require
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of putchar.
        require
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of putdouble.
        require
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of putint.
        require
            extendible: extendible

    put_new_line
            -- Write a new line character to medium
            -- Was declared in IO_MEDIUM as synonym of new_line.
        require
            extendible: extendible

    put_real (r: REAL)
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of putreal.
        require
            extendible: extendible

    put_string (s: STRING)
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of putstring.
        require
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in IO_MEDIUM as synonym of put_boolean.
        require
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in IO_MEDIUM as synonym of put_character.
        require
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in IO_MEDIUM as synonym of put_double.
        require
            extendible: extendible

    putint (i: INTEGER)
            -- Write i to medium.
            -- Was declared in IO_MEDIUM as synonym of put_integer.
        require
            extendible: extendible

    putreal (r: REAL)
            -- Write r to medium.
            -- Was declared in IO_MEDIUM as synonym of put_real.
        require
            extendible: extendible

    putstring (s: STRING)
            -- Write s to medium.
            -- Was declared in IO_MEDIUM as synonym of put_string.
        require
            extendible: extendible
            non_void: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IO_MEDIUM


MEMORY Chart

class
    MEMORY

General
    cluster: base.kernel
    description:
        "Facilities for tuning up the garbage collection mechanism.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    MEM_CONST

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    Total_memory: INTEGER

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    disable_time_accounting
    dispose
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    mem_free (addr: POINTER)
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)


MEMORY Flat contracts

indexing
    description: "[
        Facilities for tuning up the garbage collection mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    MEMORY

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
        require
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
        require
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.

    collecting: BOOLEAN
            -- Is garbage collection enabled?

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.

    collection_off
            -- Disable garbage collection.

    collection_on
            -- Enable garbage collection.

    disable_time_accounting
            -- Disable GC time accounting (default).

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
        require
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
        require
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
        require
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
        require
            positive_value: value > 0

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.

    dispose
            -- Action to be executed just before garbage collection
            -- reclaims an object.
            -- Default version does nothing; redefine in descendants
            -- to perform specific dispose actions. Those actions
            -- should only take care of freeing external resources;
            -- they should not perform remote calls on other objects
            -- since these may also be dead and reclaimed.

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEMORY


MEM_CONST Chart

class
    MEM_CONST

General
    cluster: base.kernel
    description:
        "Constants used by memory management.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    C_memory: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    Incremental_collector: INTEGER
    Total_memory: INTEGER


MEM_CONST Flat contracts

indexing
    description: "[
        Constants used by memory management.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    MEM_CONST

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector

    Full_collector: INTEGER is 0
            -- Statistics for full collections

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_CONST


MEM_INFO Chart

class
    MEM_INFO

General
    cluster: base.kernel
    description:
        "Properties of the memory management mechanism.
        This class may be used as ancestor by classes needing its facilities."
    create: make

Ancestors
    MEM_CONST

Queries
    C_memory: INTEGER
    Eiffel_memory: INTEGER
    free: INTEGER
    Full_collector: INTEGER
    Incremental_collector: INTEGER
    overhead: INTEGER
    total: INTEGER
    Total_memory: INTEGER
    type: INTEGER
    used: INTEGER

Commands
    make (memory: INTEGER)
    update (memory: INTEGER)

Constraints
    consistent memory


MEM_INFO Flat contracts

indexing
    description: "[
        Properties of the memory management mechanism.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    MEM_INFO

create

    make (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of update.
        ensure
            type_updated: type = memory

feature -- Initialization

    make (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of update.
        ensure
            type_updated: type = memory

    update (memory: INTEGER)
            -- Update Current for memory type.
            -- Was declared in MEM_INFO as synonym of make.
        ensure
            type_updated: type = memory

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    type: INTEGER
            -- Memory type (Total, Eiffel, C)

feature -- Measurement

    free: INTEGER
            -- Number of bytes still free for type
            -- before last call to update
        ensure
            computed: Result = total - used - overhead

    overhead: INTEGER
            -- Number of bytes used by memory management
            -- scheme for type before last call to update

    total: INTEGER
            -- Total number of bytes allocated for type
            -- before last call to update

    used: INTEGER
            -- Number of bytes used for type
            -- before last call to update

invariant

    consistent_memory: total = free + used + overhead
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MEM_INFO


NUMERIC Chart

deferred class
    NUMERIC

General
    cluster: base.kernel
    description: "Objects to which numerical operations are applicable"

Ancestors
    ANY

Queries
    infix "-" (other: [like Current] NUMERIC): [like Current] NUMERIC
    infix "+" (other: [like Current] NUMERIC): [like Current] NUMERIC
    infix "/" (other: [like Current] NUMERIC): [like Current] NUMERIC
    infix "*" (other: [like Current] NUMERIC): [like Current] NUMERIC
    prefix "-": [like Current] NUMERIC
    prefix "+": [like Current] NUMERIC
    divisible (other: [like Current] NUMERIC): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    one: [like Current] NUMERIC
    zero: [like Current] NUMERIC


NUMERIC Flat contracts

indexing
    description: "Objects to which numerical operations are applicable"
    note: "The model is that of a commutative ring."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    NUMERIC

feature -- Access

    one: like Current
            -- Neutral element for "*" and "/"
        ensure
            result_exists: Result /= void

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure
            result_exists: Result /= void

feature -- Status report

    divisible (other: like Current): BOOLEAN
            -- May current object be divided by other?
        require
            other_exists: other /= void

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require
            other_exists: other /= void

feature -- Basic operations

    infix "*" (other: like Current): like Current
            -- Product by other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other (commutative).
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
        require
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure
            result_exists: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class NUMERIC


PART_COMPARABLE Chart

deferred class
    PART_COMPARABLE

General
    cluster: base.kernel
    description: "Objects that may be compared according to a partial order relation"

Ancestors
    ANY

Queries
    infix ">=" (other: [like Current] PART_COMPARABLE): BOOLEAN
    infix ">" (other: [like Current] PART_COMPARABLE): BOOLEAN
    infix "<=" (other: [like Current] PART_COMPARABLE): BOOLEAN
    infix "<" (other: [like Current] PART_COMPARABLE): BOOLEAN


PART_COMPARABLE Flat contracts

indexing
    description: "Objects that may be compared according to a partial order relation"
    status: "See notice at end of class"
    names: part_comparable, comparison
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    PART_COMPARABLE

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current object less than other?
        require
            other_exists: other /= void

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
        require
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
        require
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
        require
            other_exists: other /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_COMPARABLE


PATH_NAME Chart

deferred class
    PATH_NAME

General
    cluster: base.kernel
    description: "Path name abstraction"

Ancestors
    STRING

Queries
    is_directory_name_valid (dir_name: STRING): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] PATH_NAME): BOOLEAN
    is_valid: BOOLEAN
    is_volume_name_valid (vol_name: STRING): BOOLEAN
    to_c: ANY

Commands
    extend (directory_name: STRING)
    extend_from_array (directories: ARRAY [STRING])
    make
    make_from_string (p: STRING)
    set_directory (directory_name: STRING)
    set_subdirectory (directory_name: STRING)
    set_volume (volume_name: STRING)
    wipe_out


PATH_NAME Flat contracts

indexing
    description: "Path name abstraction"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    PATH_NAME

feature -- Initialization

    make
            -- Create path name object.

    make_from_string (p: STRING)
            -- Create path name object and initialize it with the
            -- path name p
        ensure
            valid_file_name: is_valid

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the path name equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

feature -- Status report

    is_directory_name_valid (dir_name: STRING): BOOLEAN
            -- Is dir_name a valid subdirectory part for the operating system?
        require
            exists: dir_name /= void

    is_valid: BOOLEAN
            -- Is the path name valid for the operating system?

    is_volume_name_valid (vol_name: STRING): BOOLEAN
            -- Is vol_name a valid volume name for the operating system?
        require
            exists: vol_name /= void

feature  -- Status report

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

feature -- Status setting

    extend (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of set_subdirectory.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    extend_from_array (directories: ARRAY [STRING])
            -- Append the subdirectories from directories to the path name.
        require
            array_exists: directories /= void and then not (directories.is_empty)
        ensure
            valid_file_name: is_valid

    set_directory (directory_name: STRING)
            -- Set the absolute directory part of the path name to directory_name.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    set_subdirectory (directory_name: STRING)
            -- Append the subdirectory directory_name to the path name.
            -- Was declared in PATH_NAME as synonym of extend.
        require
            string_exists: directory_name /= void
            valid_directory_name: is_directory_name_valid (directory_name)
        ensure
            valid_file_name: is_valid

    set_volume (volume_name: STRING)
            -- Set the volume part of the path name to volume_name.
        require
            string_exists: volume_name /= void
            valid_volume_name: is_volume_name_valid (volume_name)
            empty_path_name: is_empty
        ensure
            valid_file_name: is_valid

feature  -- Removal

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature  -- Conversion

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PATH_NAME


PLAIN_TEXT_FILE Chart

class
    PLAIN_TEXT_FILE

General
    cluster: base.kernel
    description: "Files viewed as persistent sequences of ASCII characters"
    create: make, make_open_read, make_open_append, make_open_read_append, make_open_write, make_open_read_write, make_create_read_write

Ancestors
    FILE

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    Support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] PLAIN_TEXT_FILE)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] PLAIN_TEXT_FILE)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make (fn: STRING)
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out

Constraints
    plain text


PLAIN_TEXT_FILE Flat contracts

indexing
    description: "Files viewed as persistent sequences of ASCII characters"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    PLAIN_TEXT_FILE

create

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

feature -- Initialization

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.
            -- (from FILE)

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    item: CHARACTER
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    position: INTEGER
            -- Current cursor position.
            -- (from FILE)

    protection: INTEGER
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

feature -- Measurement

    count: INTEGER
            -- Size in bytes (0 if no associated physical file)
            -- (from FILE)

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        ensure then -- from FILE
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?
            -- (from FILE)

    file_prunable: BOOLEAN
            -- May items be removed?
            -- (from FILE)

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from FILE)

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?
            -- (from FILE)

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)

    is_device: BOOLEAN
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?
            -- (from FILE)

    is_open_read: BOOLEAN
            -- Is file open for reading?
            -- (from FILE)

    is_open_write: BOOLEAN
            -- Is file open for writing?
            -- (from FILE)

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)? (Yes)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?
            -- (from FILE)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
            -- (from FILE)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then -- from FILE
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed

    forth
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed

    next_line
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure -- from FILE
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_real
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readreal
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    put_boolean (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    putbool (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

invariant

    plain_text: is_plain_text
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLAIN_TEXT_FILE


PLATFORM Chart

class
    PLATFORM

General
    cluster: base.kernel
    description:
        "Platform-dependent properties.
        This class is an ancestor to all developer-written classes."

Ancestors
    ANY

Queries
    boolean_bits: INTEGER
    boolean_bytes: INTEGER
    character_bits: INTEGER
    character_bytes: INTEGER
    double_bits: INTEGER
    double_bytes: INTEGER
    integer_16_bytes: INTEGER
    integer_64_bytes: INTEGER
    integer_8_bytes: INTEGER
    integer_bits: INTEGER
    integer_bytes: INTEGER
    pointer_bits: INTEGER
    pointer_bytes: INTEGER
    real_bits: INTEGER
    real_bytes: INTEGER
    wide_character_bytes: INTEGER


PLATFORM Flat contracts

indexing
    description: "[
        Platform-dependent properties.
        This class is an ancestor to all developer-written classes.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    PLATFORM

feature -- Access bits size

    boolean_bits: INTEGER
            -- Number of bits in a value of type BOOLEAN

    character_bits: INTEGER
            -- Number of bits in a value of type CHARACTER

    double_bits: INTEGER
            -- Number of bits in a value of type DOUBLE

    integer_bits: INTEGER
            -- Number of bits in a value of type INTEGER

    pointer_bits: INTEGER
            -- Number of bits in a value of type POINTER

    real_bits: INTEGER
            -- Number of bits in a value of type REAL

feature -- Access bytes size

    boolean_bytes: INTEGER
            -- Number of bytes in a value of type BOOLEAN

    character_bytes: INTEGER
            -- Number of bytes in a value of type CHARACTER

    double_bytes: INTEGER
            -- Number of bytes in a value of type DOUBLE

    integer_16_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_16

    integer_64_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_64

    integer_8_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER_8

    integer_bytes: INTEGER
            -- Number of bytes in a value of type INTEGER

    pointer_bytes: INTEGER
            -- Number of bytes in a value of type POINTER

    real_bytes: INTEGER
            -- Number of bytes in a value of type REAL

    wide_character_bytes: INTEGER
            -- Number of bytes in a value of type WIDE_CHARACTER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PLATFORM


POINTER Chart

expanded class
    POINTER

General
    cluster: base.kernel
    description: "References to objects meant to be exchanged with non-Eiffel software."

Ancestors
    POINTER_REF

Queries
    infix "+" (offset: INTEGER): [like Current] POINTER
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: POINTER
    memory_alloc (a_size: INTEGER): POINTER
    out: STRING

Commands
    memory_copy (a_source: POINTER; a_size: INTEGER)
    memory_free
    memory_move (a_source: POINTER; a_size: INTEGER)
    memory_set (val, n: INTEGER)
    set_item (p: POINTER)


POINTER Flat contracts

indexing
    description: "References to objects meant to be exchanged with non-Eiffel software."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    POINTER

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from POINTER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: POINTER
            -- Pointer value
            -- (from POINTER_REF)

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from POINTER_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    frozen set_item (p: POINTER)
            -- Make p the item value.
            -- (from POINTER_REF)

feature -- Allocation/free

    memory_alloc (a_size: INTEGER): POINTER
            -- Allocated size bytes using malloc.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_size: a_size >= 0

    memory_free
            -- Free allocated memory with malloc.
            -- (from POINTER_REF)

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_move (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_set (val, n: INTEGER)
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
            -- (from POINTER_REF)
        require -- from POINTER_REF
            valid_val: val >= 0
            valid_n: n >= 0

feature -- Operations

    infix "+" (offset: INTEGER): like Current
            -- Pointer moved by an offset of offset bytes.
            -- (from POINTER_REF)

feature -- Output

    out: STRING
            -- Printable representation of pointer value
            -- (from POINTER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER


POINTER_REF Chart

class
    POINTER_REF

General
    cluster: base.kernel
    description:
        "References to objects containing reference to object
        meant to be exchanged with non-Eiffel software."

Ancestors
    HASHABLE

Queries
    infix "+" (offset: INTEGER): [like Current] POINTER_REF
    hash_code: INTEGER
    is_hashable: BOOLEAN
    item: POINTER
    memory_alloc (a_size: INTEGER): POINTER
    out: STRING

Commands
    memory_copy (a_source: POINTER; a_size: INTEGER)
    memory_free
    memory_move (a_source: POINTER; a_size: INTEGER)
    memory_set (val, n: INTEGER)
    set_item (p: POINTER)


POINTER_REF Flat contracts

indexing
    description: "[
        References to objects containing reference to object
        meant to be exchanged with non-Eiffel software.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    POINTER_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: POINTER
            -- Pointer value

feature -- Status report

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    frozen set_item (p: POINTER)
            -- Make p the item value.

feature -- Allocation/free

    memory_alloc (a_size: INTEGER): POINTER
            -- Allocated size bytes using malloc.
        require
            valid_size: a_size >= 0

    memory_free
            -- Free allocated memory with malloc.

feature -- Memory copy

    memory_copy (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current should not overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_move (a_source: POINTER; a_size: INTEGER)
            -- Copy a_size bytes from a_source to Current.
            -- a_source and Current can overlap.
        require
            valid_size: a_size >= 0
            valid_source: a_source /= default_pointer

    memory_set (val, n: INTEGER)
            -- Fill first n bytes of the memory pointed by Current
            -- with constant val.
        require
            valid_val: val >= 0
            valid_n: n >= 0

feature -- Operations

    infix "+" (offset: INTEGER): like Current
            -- Pointer moved by an offset of offset bytes.

feature -- Output

    out: STRING
            -- Printable representation of pointer value

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class POINTER_REF


PROCEDURE Chart

class
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

General
    cluster: base.kernel
    description:
        "Objects representing delayed calls to a procedure.
        with some operands possibly still open."

Ancestors
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

Queries
    callable: BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] PROCEDURE [BASE_TYPE, OPEN_ARGS]): BOOLEAN
    is_hashable: BOOLEAN
    open_count: INTEGER
    open_operand_type (i: INTEGER): INTEGER
    operands: OPEN_ARGS
    postcondition (args: [like operands] OPEN_ARGS): BOOLEAN
    precondition (args: [like operands] OPEN_ARGS): BOOLEAN
    target: ANY
    valid_operands (args: OPEN_ARGS): BOOLEAN

Commands
    adapt (other: ROUTINE [ANY, OPEN_ARGS])
    apply
    call (args: OPEN_ARGS)
    copy (other: [like Current] PROCEDURE [BASE_TYPE, OPEN_ARGS])
    set_operands (args: OPEN_ARGS)


PROCEDURE Flat contracts

indexing
    description: "[
        Objects representing delayed calls to a procedure.
        with some operands possibly still open.
    ]"
    note: "[
        Features are the same as those of ROUTINE,
        with `apply' made effective, and no further
        redefinition of `is_equal' and `copy'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    PROCEDURE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS])
            -- Initialize from other.
            -- Useful in descendants.
            -- (from ROUTINE)
        require -- from ROUTINE
            other_exists: other /= void
            conforming: conforms_to (other)
        ensure -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Access

    hash_code: INTEGER
            -- Hash code value.
            -- (from ROUTINE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    open_operand_type (i: INTEGER): INTEGER
            -- Type of ith open operand.
            -- (from ROUTINE)
        require -- from ROUTINE
            positive: i >= 1
            within_bounds: i <= open_count

    operands: OPEN_ARGS
            -- Open operands.
            -- (from ROUTINE)

    postcondition (args: like operands): BOOLEAN
            -- Does current state satisfy routine's
            -- postcondition for args?
            -- (from ROUTINE)

    precondition (args: like operands): BOOLEAN
            -- Do args satisfy routine's precondition
            -- in current state?
            -- (from ROUTINE)

    target: ANY
            -- Target of call.
            -- (from ROUTINE)

feature -- Measurement

    open_count: INTEGER
            -- Number of open operands.
            -- (from ROUTINE)

feature -- Status report

    callable: BOOLEAN
            -- Can routine be called on current object?
            -- (from ROUTINE)

    is_equal (other: like Current): BOOLEAN
            -- Is associated routine the same as the one
            -- associated with other.
            -- (from ROUTINE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    valid_operands (args: OPEN_ARGS): BOOLEAN
            -- Are args valid operands for this routine?
            -- (from ROUTINE)

feature -- Element change

    set_operands (args: OPEN_ARGS)
            -- Use args as operands for next call.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)

feature -- Duplication

    copy (other: like Current)
            -- Use same routine as other.
            -- (from ROUTINE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ROUTINE
            same_call_status: other.callable implies callable

feature -- Basic operations

    call (args: OPEN_ARGS)
            -- Call routine with operands args.
            -- (from ROUTINE)
        require -- from ROUTINE
            valid_operands: valid_operands (args)
            callable: callable

feature -- Calls

    apply
            -- Call procedure with operands as last set.
        require -- from ROUTINE
            valid_operands: valid_operands (operands)
            callable: callable

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROCEDURE


RAW_FILE Chart

class
    RAW_FILE

General
    cluster: base.kernel
    description: "Files, viewed as persistent sequences of bytes"
    create: make, make_open_read, make_open_append, make_open_read_append, make_open_write, make_open_read_write, make_create_read_write

Ancestors
    FILE

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    Support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] RAW_FILE)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] RAW_FILE)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make (fn: STRING)
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out

Constraints
    not plain text


RAW_FILE Flat contracts

indexing
    description: "Files, viewed as persistent sequences of bytes"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    RAW_FILE

create

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

feature -- Initialization

    make (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.
            -- (from FILE)

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    item: CHARACTER
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    position: INTEGER
            -- Current cursor position.
            -- (from FILE)

    protection: INTEGER
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

feature -- Measurement

    count: INTEGER
            -- Size in bytes (0 if no associated physical file)
            -- (from FILE)

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        ensure then -- from FILE
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?
            -- (from FILE)

    file_prunable: BOOLEAN
            -- May items be removed?
            -- (from FILE)

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from FILE)

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?
            -- (from FILE)

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)

    is_device: BOOLEAN
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?
            -- (from FILE)

    is_open_read: BOOLEAN
            -- Is file open for reading?
            -- (from FILE)

    is_open_write: BOOLEAN
            -- Is file open for writing?
            -- (from FILE)

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?
            -- (from FILE)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is True
            -- Can medium be used to an Eiffel structure?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
            -- (from FILE)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then -- from FILE
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed

    forth
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed

    next_line
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure -- from FILE
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_real
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read the binary representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in RAW_FILE as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read the binary representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in RAW_FILE as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readreal
            -- Read the binary representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in RAW_FILE as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    put_boolean (b: BOOLEAN)
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    putbool (b: BOOLEAN)
            -- Write binary value of b at current position.
            -- Was declared in RAW_FILE as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write binary value d at current position.
            -- Was declared in RAW_FILE as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write binary value of i at current position.
            -- Was declared in RAW_FILE as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write binary value of r at current position.
            -- Was declared in RAW_FILE as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

invariant

    not_plain_text: not is_plain_text
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RAW_FILE


REAL Chart

expanded class
    REAL

General
    cluster: base.kernel
    description: "Real values, single precision"

Ancestors
    REAL_REF

Queries
    infix ">=" (other: [like Current] REAL): BOOLEAN
    infix ">" (other: [like Current] REAL): BOOLEAN
    infix "<=" (other: [like Current] REAL): BOOLEAN
    infix "<" (other: [like Current] REAL): BOOLEAN
    infix "-" (other: [like Current] REAL): [like Current] REAL
    infix "+" (other: [like Current] REAL): [like Current] REAL
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] REAL): [like Current] REAL
    infix "*" (other: [like Current] REAL): [like Current] REAL
    prefix "-": [like Current] REAL
    prefix "+": [like Current] REAL
    abs: REAL
    ceiling: INTEGER
    divisible (other: REAL_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] REAL): BOOLEAN
    is_hashable: BOOLEAN
    item: REAL
    max (other: [like Current] REAL): [like Current] REAL
    min (other: [like Current] REAL): [like Current] REAL
    one: [like Current] REAL
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: REAL_REF): INTEGER
    truncated_to_integer: INTEGER
    zero: [like Current] REAL

Commands
    set_item (r: REAL)


REAL Flat contracts

indexing
    description: "Real values, single precision"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    REAL

feature -- Access

    hash_code: INTEGER
            -- Hash code value
            -- (from REAL_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: REAL
            -- Numeric real value
            -- (from REAL_REF)

    one: like Current
            -- Neutral element for "*" and "/"
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
            -- (from REAL_REF)
        ensure -- from REAL_REF
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from REAL_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: REAL_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from REAL_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current real?
            -- (from REAL_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN
            -- May current object be divided by other?
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from REAL_REF
            ref_not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure then -- from REAL_REF
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from REAL_REF)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (r: REAL)
            -- Make r the value of item.
            -- (from REAL_REF)

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
            -- (from REAL_REF)
        ensure -- from REAL_REF
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
            -- (from REAL_REF)
        ensure -- from REAL_REF
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
            -- (from REAL_REF)
        ensure -- from REAL_REF
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)
            -- (from REAL_REF)

feature -- Basic operations

    abs: REAL
            -- Absolute value
            -- (from REAL_REF)
        ensure -- from REAL_REF
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from REAL_REF)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
            -- (from REAL_REF)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current real to the power other
            -- (from REAL_REF)

feature -- Output

    out: STRING
            -- Printable representation of real value
            -- (from REAL_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from REAL_REF
    sign_times_abs: sign * abs = item
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL


REAL_REF Chart

class
    REAL_REF

General
    cluster: base.kernel
    description: "References to objects containing a real value"

Ancestors
    COMPARABLE
    HASHABLE
    NUMERIC

Queries
    infix ">=" (other: [like Current] REAL_REF): BOOLEAN
    infix ">" (other: [like Current] REAL_REF): BOOLEAN
    infix "<=" (other: [like Current] REAL_REF): BOOLEAN
    infix "<" (other: [like Current] REAL_REF): BOOLEAN
    infix "-" (other: [like Current] REAL_REF): [like Current] REAL_REF
    infix "+" (other: [like Current] REAL_REF): [like Current] REAL_REF
    infix "^" (other: NUMERIC): DOUBLE
    infix "/" (other: [like Current] REAL_REF): [like Current] REAL_REF
    infix "*" (other: [like Current] REAL_REF): [like Current] REAL_REF
    prefix "-": [like Current] REAL_REF
    prefix "+": [like Current] REAL_REF
    abs: REAL
    ceiling: INTEGER
    divisible (other: REAL_REF): BOOLEAN
    exponentiable (other: NUMERIC): BOOLEAN
    floor: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] REAL_REF): BOOLEAN
    is_hashable: BOOLEAN
    item: REAL
    max (other: [like Current] REAL_REF): [like Current] REAL_REF
    min (other: [like Current] REAL_REF): [like Current] REAL_REF
    one: [like Current] REAL_REF
    out: STRING
    rounded: INTEGER
    sign: INTEGER
    three_way_comparison (other: REAL_REF): INTEGER
    truncated_to_integer: INTEGER
    zero: [like Current] REAL_REF

Commands
    set_item (r: REAL)

Constraints
    sign times abs


REAL_REF Flat contracts

indexing
    description: "References to objects containing a real value"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    REAL_REF

feature -- Access

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: REAL
            -- Numeric real value

    one: like Current
            -- Neutral element for "*" and "/"
        ensure -- from NUMERIC
            result_exists: Result /= void

    sign: INTEGER
            -- Sign value (0, -1 or 1)
        ensure
            three_way: Result = three_way_comparison (zero)

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: REAL_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current real?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    divisible (other: REAL_REF): BOOLEAN
            -- May current object be divided by other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            ref_not_exact_zero: Result implies (other.item /= 0.0)

    exponentiable (other: NUMERIC): BOOLEAN
            -- May current object be elevated to the power other?
        require -- from NUMERIC
            other_exists: other /= void
        ensure then
            safe_values: ((other.conforms_to (0) and item /= 0.0) or (other.conforms_to (0.0) and item > 0.0)) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

feature -- Element change

    set_item (r: REAL)
            -- Make r the value of item.

feature -- Conversion

    ceiling: INTEGER
            -- Smallest integral value no smaller than current object
        ensure
            result_no_smaller: Result >= item
            close_enough: Result - item < item.one

    floor: INTEGER
            -- Greatest integral value no greater than current object
        ensure
            result_no_greater: Result <= item
            close_enough: item - Result < Result.one

    rounded: INTEGER
            -- Rounded integral value
        ensure
            definition: Result = sign * ((abs + 0.5).floor)

    truncated_to_integer: INTEGER
            -- Integer part (same sign, largest absolute
            -- value no greater than current object's)

feature -- Basic operations

    abs: REAL
            -- Absolute value
        ensure
            non_negative: Result >= 0.0
            same_absolute_value: (Result = item) or (Result = - item)

    infix "*" (other: like Current): like Current
            -- Product by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": like Current
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: like Current): like Current
            -- Division by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): DOUBLE
            -- Current real to the power other

feature -- Output

    out: STRING
            -- Printable representation of real value

invariant

    sign_times_abs: sign * abs = item
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class REAL_REF


ROUTINE Chart

deferred class
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

General
    cluster: base.kernel
    description:
        "Objects representing delayed calls to a routine,
        with some operands possibly still open"

Ancestors
    HASHABLE
    MEMORY

Queries
    callable: BOOLEAN
    hash_code: INTEGER
    is_equal (other: [like Current] ROUTINE [BASE_TYPE, OPEN_ARGS]): BOOLEAN
    is_hashable: BOOLEAN
    open_count: INTEGER
    open_operand_type (i: INTEGER): INTEGER
    operands: OPEN_ARGS
    postcondition (args: [like operands] OPEN_ARGS): BOOLEAN
    precondition (args: [like operands] OPEN_ARGS): BOOLEAN
    target: ANY
    valid_operands (args: OPEN_ARGS): BOOLEAN

Commands
    adapt (other: ROUTINE [ANY, OPEN_ARGS])
    apply
    call (args: OPEN_ARGS)
    copy (other: [like Current] ROUTINE [BASE_TYPE, OPEN_ARGS])
    set_operands (args: OPEN_ARGS)


ROUTINE Flat contracts

indexing
    description: "[
        Objects representing delayed calls to a routine,
        with some operands possibly still open
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ROUTINE [BASE_TYPE, OPEN_ARGS -> TUPLE]

feature -- Initialization

    adapt (other: ROUTINE [ANY, OPEN_ARGS])
            -- Initialize from other.
            -- Useful in descendants.
        require
            other_exists: other /= void
            conforming: conforms_to (other)
        ensure
            same_call_status: other.callable implies callable

feature -- Access

    hash_code: INTEGER
            -- Hash code value.
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    open_operand_type (i: INTEGER): INTEGER
            -- Type of ith open operand.
        require
            positive: i >= 1
            within_bounds: i <= open_count

    operands: OPEN_ARGS
            -- Open operands.

    postcondition (args: like operands): BOOLEAN
            -- Does current state satisfy routine's
            -- postcondition for args?

    precondition (args: like operands): BOOLEAN
            -- Do args satisfy routine's precondition
            -- in current state?

    target: ANY
            -- Target of call.

feature -- Measurement

    open_count: INTEGER
            -- Number of open operands.

feature -- Status report

    callable: BOOLEAN
            -- Can routine be called on current object?

    is_equal (other: like Current): BOOLEAN
            -- Is associated routine the same as the one
            -- associated with other.
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    valid_operands (args: OPEN_ARGS): BOOLEAN
            -- Are args valid operands for this routine?

feature -- Element change

    set_operands (args: OPEN_ARGS)
            -- Use args as operands for next call.
        require
            valid_operands: valid_operands (args)

feature -- Duplication

    copy (other: like Current)
            -- Use same routine as other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            same_call_status: other.callable implies callable

feature -- Basic operations

    apply
            -- Call routine with operands as last set.
        require
            valid_operands: valid_operands (operands)
            callable: callable

    call (args: OPEN_ARGS)
            -- Call routine with operands args.
        require
            valid_operands: valid_operands (args)
            callable: callable

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ROUTINE


SEQ_STRING Chart

class
    SEQ_STRING

General
    cluster: base.kernel
    create: make

Ancestors
    SEQUENCE [G]
    STRING

Queries
    infix "@" (i: INTEGER): CHARACTER
    infix ">=" (other: [like Current] SEQ_STRING): BOOLEAN
    infix ">" (other: [like Current] SEQ_STRING): BOOLEAN
    infix "<=" (other: [like Current] SEQ_STRING): BOOLEAN
    infix "<" (other: [like Current] SEQ_STRING): BOOLEAN
    infix "+" (s: STRING): STRING
    adapt (s: STRING): [like Current] SEQ_STRING
    additional_space: INTEGER
    after: BOOLEAN
    area: SPECIAL [CHARACTER]
    before: BOOLEAN
    capacity: INTEGER
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    current_item: CHARACTER
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    False_constant: STRING
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    fuzzy_index (other: STRING; start, fuzz: INTEGER): INTEGER
    Growth_percentage: INTEGER
    has (c: CHARACTER): BOOLEAN
    hash_code: INTEGER
    index: INTEGER
    index_of (c: CHARACTER; start: INTEGER): INTEGER
    index_of_occurrence (c: CHARACTER; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_boolean: BOOLEAN
    is_double: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] SEQ_STRING): BOOLEAN
    is_hashable: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_integer: BOOLEAN
    is_real: BOOLEAN
    item (i: INTEGER): CHARACTER
    item_code (i: INTEGER): INTEGER
    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
    linear_representation: LINEAR [CHARACTER]
    max (other: [like Current] SEQ_STRING): [like Current] SEQ_STRING
    min (other: [like Current] SEQ_STRING): [like Current] SEQ_STRING
    Minimal_increase: INTEGER
    mirrored: [like Current] SEQ_STRING
    object_comparison: BOOLEAN
    occurrences (c: CHARACTER): INTEGER
    off: BOOLEAN
    out: [like Current] SEQ_STRING
    prunable: BOOLEAN
    readable: BOOLEAN
    resizable: BOOLEAN
    shared_with (other: [like Current] SEQ_STRING): BOOLEAN
    split (a_separator: CHARACTER): LIST [STRING]
    string_mirrored: [like Current] SEQ_STRING
    substring (n1, n2: INTEGER): [like Current] SEQ_STRING
    substring_index (other: STRING; start: INTEGER): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    three_way_comparison (other: [like Current] SEQ_STRING): INTEGER
    to_boolean: BOOLEAN
    to_c: ANY
    to_double: DOUBLE
    to_integer: INTEGER
    to_real: REAL
    True_constant: STRING
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    adapt_size
    append (s: STRING)
    append_boolean (b: BOOLEAN)
    append_character (c: CHARACTER)
    append_double (d: DOUBLE)
    append_integer (i: INTEGER)
    append_real (r: REAL)
    append_string (s: STRING)
    automatic_grow
    back
    center_justify
    character_justify (pivot: CHARACTER; position: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] SEQ_STRING)
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (c: CHARACTER)
    fill (other: CONTAINER [CHARACTER])
    fill_blank
    fill_character (c: CHARACTER)
    finish
    force (v: [like item] CHARACTER)
    forth
    from_c (c_string: POINTER)
    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
    grow (newsize: INTEGER)
    head (n: INTEGER)
    insert (s: STRING; i: INTEGER)
    left_adjust
    left_justify
    make_from_c (c_string: POINTER)
    make_from_string (s: STRING)
    mirror
    multiply (n: INTEGER)
    precede (c: CHARACTER)
    prepend (s: STRING)
    prepend_boolean (b: BOOLEAN)
    prepend_character (c: CHARACTER)
    prepend_double (d: DOUBLE)
    prepend_integer (i: INTEGER)
    prepend_real (r: REAL)
    prepend_string (s: STRING)
    prune (c: CHARACTER)
    prune_all (c: CHARACTER)
    prune_all_leading (c: CHARACTER)
    prune_all_trailing (c: CHARACTER)
    put (c: CHARACTER; i: INTEGER)
    remove (i: INTEGER)
    remove_current_item
    replace (c: CHARACTER)
    replace_blank
    replace_character (c: CHARACTER)
    replace_substring (s: [like Current] SEQ_STRING; start_pos, end_pos: INTEGER)
    replace_substring_all (original, new: [like Current] SEQ_STRING)
    resize (newsize: INTEGER)
    right_adjust
    right_justify
    search (v: [like item] CHARACTER)
    search_after (c: CHARACTER)
    search_before (c: CHARACTER)
    search_string_after (s: STRING; fuzzy: INTEGER)
    search_string_before (s: STRING; fuzzy: INTEGER)
    set (t: [like Current] SEQ_STRING; n1, n2: INTEGER)
    share (other: [like Current] SEQ_STRING)
    start
    string_mirror
    string_precede (c: CHARACTER)
    string_prepend (s: STRING)
    string_share (other: [like Current] SEQ_STRING)
    string_wipe_out
    subcopy (other: [like Current] SEQ_STRING; start_pos, end_pos, index_pos: INTEGER)
    tail (n: INTEGER)
    to_lower
    to_upper
    wipe_out


SEQ_STRING Flat contracts

indexing
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    SEQ_STRING

create

    make (n: INTEGER)
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n

feature -- Initialization

    adapt (s: STRING): like Current
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)

    from_c (c_string: POINTER)
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        ensure -- from STRING
            no_zero_byte: not has ('%U')

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        ensure -- from STRING
            shared_implementation: shared_with (s)

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    current_item: CHARACTER
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    hash_code: INTEGER
            -- Hash code value
            -- (from STRING)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    index: INTEGER
            -- Index of current_item, if valid
            -- Valid values are between 1 and count (if count > 0).

    index_of (c: CHARACTER; start: INTEGER): INTEGER
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    index_of_occurrence (c: CHARACTER; i: INTEGER): INTEGER
            -- Index of i-th occurrence of c.
            -- 0 if none.
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then
            index_value: (Result = 0) or item (Result) = c

    item (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

    item_code (i: INTEGER): INTEGER
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
            -- Position of last occurrence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    off: BOOLEAN
            -- Is there no current item?
            -- (from BILINEAR)

    search_after (c: CHARACTER)
            -- Move cursor to first position
            -- (at or after current cursor position)
            -- where current_item and c are identical.

    search_before (c: CHARACTER)
            -- Move cursor to greatest position at or before cursor
            -- where current_item and c are identical;
            -- go before if unsuccessful.

    search_string_after (s: STRING; fuzzy: INTEGER)
            -- Move cursor to first position
            -- (at or after cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go after if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.

    search_string_before (s: STRING; fuzzy: INTEGER)
            -- Move cursor to first position
            -- (at or before cursor position) where `substring
            -- (index, index + s.count)' and s are identical.
            -- Go before if unsuccessful.
            -- The 'fuzzy' parameter is the maximum allowed number
            -- of mismatches within the pattern. A 0 means an exact match.

    shared_with (other: like Current): BOOLEAN
            -- Does string share the text of other?
            -- (from STRING)

    substring_index (other: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Allocated space
            -- (from STRING)

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from STRING)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER
            -- Number of times c appears in the string
            -- (from STRING)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_boolean: BOOLEAN
            -- Does Current represent a BOOLEAN?
            -- (from STRING)

    is_double: BOOLEAN
            -- Does Current represent a DOUBLE?
            -- (from STRING)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_integer: BOOLEAN
            -- Does Current represent an INTEGER?
            -- (from STRING)

    is_real: BOOLEAN
            -- Does Current represent a REAL?
            -- (from STRING)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from STRING)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the string?
            -- (from STRING)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move to last position.

    forth
            -- Move to next position.
        require -- from LINEAR
            not_after: not after

    search (v: like current_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, current_item)
            item_found: (not exhausted and not object_comparison) implies v = current_item

    start
            -- Move to first position.

feature -- Element change

    append (s: STRING)
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + old s.count

    append_boolean (b: BOOLEAN)
            -- Append the string representation of b at end.
            -- (from STRING)

    append_character (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    append_double (d: DOUBLE)
            -- Append the string representation of d at end.
            -- (from STRING)

    append_integer (i: INTEGER)
            -- Append the string representation of i at end.
            -- (from STRING)

    append_real (r: REAL)
            -- Append the string representation of r at end.
            -- (from STRING)

    append_string (s: STRING)
            -- Append a copy of s, if not void, at end.
            -- (from STRING)

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count

    extend (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_blank
            -- Fill with capacity blank characters.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    fill_character (c: CHARACTER)
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    force (v: like current_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    head (n: INTEGER)
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    insert (s: STRING; i: INTEGER)
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count + s.count

    left_adjust
            -- Remove leading whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '   ') and (item (1) /= '%R') and (item (1) /= ''))

    string_precede (c: CHARACTER)
            -- Add c at front.
            -- Was declared in STRING as synonym of prepend_character.
            -- (from STRING)
        ensure -- from STRING
            new_count: count = old count + 1

    precede (c: CHARACTER)
            -- Add c at front.
        ensure
            new_index: index = old index + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        ensure
            new_index: index = old index + s.count

    string_prepend (s: STRING)
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + s.count

    prepend_boolean (b: BOOLEAN)
            -- Prepend the string representation of b at front.
            -- (from STRING)

    prepend_character (c: CHARACTER)
            -- Add c at front.
            -- Was declared in STRING as synonym of precede.
            -- (from STRING)
        ensure -- from STRING
            new_count: count = old count + 1

    prepend_double (d: DOUBLE)
            -- Prepend the string representation of d at front.
            -- (from STRING)

    prepend_integer (i: INTEGER)
            -- Prepend the string representation of i at front.
            -- (from STRING)

    prepend_real (r: REAL)
            -- Prepend the string representation of r at front.
            -- (from STRING)

    prepend_string (s: STRING)
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)

    put (c: CHARACTER; i: INTEGER)
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    replace (c: CHARACTER)
            -- Replace current item by c.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: current_item = v

    replace_blank
            -- Replace all current characters with blanks.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_character (c: CHARACTER)
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_substring (s: like Current; start_pos, end_pos: INTEGER)
            -- Replace characters from start_pos to end_pos with s.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1

    replace_substring_all (original, new: like Current)
            -- Replace every occurrence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty

    right_adjust
            -- Remove trailing whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '   ') and (item (count) /= '%R') and (item (count) /= ''))

    set (t: like Current; n1, n2: INTEGER)
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))

    share (other: like Current)
            -- Make string share the text of other.
        require
            argument_not_void: other /= void
        ensure
            shared_index: other.index = index

    string_share (other: like Current)
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        ensure -- from STRING
            shared_count: other.count = count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)

    tail (n: INTEGER)
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    infix "+" (s: STRING): STRING
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count

feature -- Removal

    clear_all
            -- Reset all characters.
            -- (from STRING)
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity

    prune (c: CHARACTER)
            -- Remove first occurrence of c.
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True

    prune_all (c: CHARACTER)
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))

    prune_all_leading (c: CHARACTER)
            -- Remove all leading occurrences of c.
            -- (from STRING)

    prune_all_trailing (c: CHARACTER)
            -- Remove all trailing occurrences of c.
            -- (from STRING)

    remove (i: INTEGER)
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count - 1

    remove_current_item
            -- Remove current item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Clear out all characters.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

    string_wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature -- Resizing

    adapt_size
            -- Adapt the size to accommodate count characters.
            -- (from STRING)

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (newsize: INTEGER)
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (newsize: INTEGER)
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0

feature -- Conversion

    center_justify
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)

    character_justify (pivot: CHARACTER; position: INTEGER)
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty

    left_justify
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

    string_mirror
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: count = old count

    string_mirrored: like Current
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: Result.count = count

    right_justify
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)

    split (a_separator: CHARACTER): LIST [STRING]
            -- Split on a_separator.
            -- (from STRING)
        ensure -- from STRING
            Result /= void

    to_boolean: BOOLEAN
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

    to_double: DOUBLE
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double

    to_integer: INTEGER
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer

    to_lower
            -- Convert to lower case.
            -- (from STRING)

    to_real: REAL
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real

    to_upper
            -- Convert to upper case.
            -- (from STRING)

feature -- Duplication

    mirror
            -- Reverse the characters order.
            -- "Hello world" -> "dlrow olleH".
            -- The current position will be on the same item
            -- as before.
        ensure
            same_count: count = old count
            mirrored_index: index = count - old index + 1

    mirrored: like Current
            -- Current string read from right to left.
            -- The result string has the same capacity and the
            -- same current position (i.e. the cursor is pointing
            -- at the same item)
        ensure
            mirrored_index: Result.index = count - index + 1
            same_count: Result.count = count

    multiply (n: INTEGER)
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1

    substring (n1, n2: INTEGER): like Current
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    out: like Current
            -- Printable representation
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQ_STRING


SPECIAL Chart

class
    SPECIAL [T]

General
    cluster: base.kernel
    description:
        "Special objects: homogeneous sequences of values,
        used to represent arrays and strings"
    create: make

Ancestors
    ANY

Queries
    all_default (upper: INTEGER): BOOLEAN
    count: INTEGER
    index_of (v: T; start_position: INTEGER): INTEGER
    item (i: INTEGER): T
    resized_area (n: INTEGER): [like Current] SPECIAL [T]
    same_items (other: [like Current] SPECIAL [T]; upper: INTEGER): BOOLEAN

Commands
    clear_all
    put (v: T; i: INTEGER)


SPECIAL Flat contracts

indexing
    description: "[
        Special objects: homogeneous sequences of values,
        used to represent arrays and strings
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    SPECIAL [T]

create

    make (n: INTEGER)
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        ensure
            area_allocated: count = n

feature -- Access

    index_of (v: T; start_position: INTEGER): INTEGER
            -- Index of first occurrence of item identical to v.
            -- -1 if none.
        require
            valid_start_position: start_position >= 0
        ensure
            found_or_not_found: Result = - 1 or else (Result >= 0 and then Result < count)

    item (i: INTEGER): T
            -- Item at i-th position
            -- (indices begin at 0)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count

feature -- Measurement

    count: INTEGER
            -- Count of the special area

feature -- Status report

    all_default (upper: INTEGER): BOOLEAN
            -- Are all items between index 0 and upper
            -- set to default values?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
        ensure
            valid_on_empty_area: upper = - 1 implies Result

    same_items (other: like Current; upper: INTEGER): BOOLEAN
            -- Do all items between index 0 and upper have
            -- same value?
        require
            min_upper: upper >= - 1
            max_upper: upper < count
            other_not_void: other /= void
            other_has_enough_items: upper < other.count
        ensure
            valid_on_empty_area: upper = - 1 implies Result

feature -- Element change

    put (v: T; i: INTEGER)
            -- Replace i-th item by v.
            -- (Indices begin at 0.)
        require
            index_big_enough: i >= 0
            index_small_enough: i < count

feature -- Removal

    clear_all
            -- Reset all items to default values.

feature -- Resizing

    resized_area (n: INTEGER): like Current
            -- Create a copy of Current with a count of n.
        require
            valid_new_count: n > count
        ensure
            result_not_void: Result /= void
            result_different_from_current: Result /= Current
            new_count: Result.count = n

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SPECIAL


STD_FILES Chart

class
    STD_FILES

General
    cluster: base.kernel
    description:
        "Commonly used input and output mechanisms.
        This class may be used as either ancestor or supplier
        by classes needing its facilities.""

Ancestors
    ANY

Queries
    default_output: PLAIN_TEXT_FILE
    Error: PLAIN_TEXT_FILE
    Input: PLAIN_TEXT_FILE
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    Output: PLAIN_TEXT_FILE
    standard_default: PLAIN_TEXT_FILE

Commands
    new_line
    next_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    set_error_default
    set_file_default (f: PLAIN_TEXT_FILE)
    set_output_default
    to_next_line


STD_FILES Flat contracts

indexing
    description: "[
        Commonly used input and output mechanisms.
        This class may be used as either ancestor or supplier
        by classes needing its facilities."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/21 04:25:32 $"
    revision: "$Revision: 1.4 $"

class interface
    STD_FILES

feature -- Access

    default_output: PLAIN_TEXT_FILE
            -- Default output

    error: PLAIN_TEXT_FILE
            -- Standard error file

    input: PLAIN_TEXT_FILE
            -- Standard input file

    output: PLAIN_TEXT_FILE
            -- Standard output file

    standard_default: PLAIN_TEXT_FILE
            -- Return the default_output or output
            -- if default_output is Void.

feature -- Status report

    last_character: CHARACTER
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of lastchar.

    last_double: DOUBLE
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of lastdouble.

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of lastint.

    last_real: REAL
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of lastreal.

    last_string: STRING
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of laststring.

    lastchar: CHARACTER
            -- Last character read by read_character
            -- Was declared in STD_FILES as synonym of last_character.

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- Was declared in STD_FILES as synonym of last_double.

    lastint: INTEGER
            -- Last integer read by read_integer
            -- Was declared in STD_FILES as synonym of last_integer.

    lastreal: REAL
            -- Last real read by read_real
            -- Was declared in STD_FILES as synonym of last_real.

    laststring: STRING
            -- Last string read by read_line,
            -- read_stream, or read_word
            -- Was declared in STD_FILES as synonym of last_string.

feature -- Element change

    new_line
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of put_new_line.

    put_boolean (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of putbool.

    put_character (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of putchar.

    put_double (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of putdouble.

    put_integer (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of putint.

    put_new_line
            -- Write line feed at end of default output.
            -- Was declared in STD_FILES as synonym of new_line.

    put_real (r: REAL)
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of putreal.

    put_string (s: STRING)
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of putstring.
        require
            string_not_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b at end of default output.
            -- Was declared in STD_FILES as synonym of put_boolean.

    putchar (c: CHARACTER)
            -- Write c at end of default output.
            -- Was declared in STD_FILES as synonym of put_character.

    putdouble (d: DOUBLE)
            -- Write d at end of default output.
            -- Was declared in STD_FILES as synonym of put_double.

    putint (i: INTEGER)
            -- Write i at end of default output.
            -- Was declared in STD_FILES as synonym of put_integer.

    putreal (r: REAL)
            -- Write r at end of default output.
            -- Was declared in STD_FILES as synonym of put_real.

    putstring (s: STRING)
            -- Write s at end of default output.
            -- Was declared in STD_FILES as synonym of put_string.
        require
            string_not_void: s /= void

    set_error_default
            -- Use standard error as default output.

    set_file_default (f: PLAIN_TEXT_FILE)
            -- Use f as default output.
        require
            valid_argument: f /= void
            file_open_write: f.is_open_write

    set_output_default
            -- Use standard output as default output.

feature -- Input

    next_line
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of to_next_line.

    read_character
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of readchar.

    read_double
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of readdouble.

    read_integer
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of readint.

    read_line
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readline.

    read_real
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of readreal.

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readstream.

    read_word
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of readword.

    readchar
            -- Read a new character from standard input.
            -- Make result available in last_character.
            -- Was declared in STD_FILES as synonym of read_character.

    readdouble
            -- Read a new double from standard input.
            -- Make result available in last_double.
            -- Was declared in STD_FILES as synonym of read_double.

    readint
            -- Read a new integer from standard input.
            -- Make result available in last_integer.
            -- Was declared in STD_FILES as synonym of read_integer.

    readline
            -- Read a line from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_line.

    readreal
            -- Read a new real from standard input.
            -- Make result available in last_real.
            -- Was declared in STD_FILES as synonym of read_real.

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_stream.

    readword
            -- Read a new word from standard input.
            -- Make result available in last_string.
            -- Was declared in STD_FILES as synonym of read_word.

    to_next_line
            -- Move to next input line on standard input.
            -- Was declared in STD_FILES as synonym of next_line.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STD_FILES


STORABLE Chart

class
    STORABLE

General
    cluster: base.kernel
    description:
        "Objects that may be stored and retrieved along with all their dependents.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    EXCEPTIONS

Queries
    assertion_violation: BOOLEAN
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    Postcondition: INTEGER
    Precondition: INTEGER
    recipient_name: STRING
    Rescue_exception: INTEGER
    retrieve_by_name (file_name: STRING): ANY
    Retrieve_exception: INTEGER
    retrieved (medium: IO_MEDIUM): ANY
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    tag_name: STRING
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Commands
    basic_store (medium: IO_MEDIUM)
    catch (code: INTEGER)
    die (code: INTEGER)
    general_store (medium: IO_MEDIUM)
    ignore (code: INTEGER)
    independent_store (medium: IO_MEDIUM)
    message_on_failure
    no_message_on_failure
    raise (name: STRING)
    set_discard_pointers (v: BOOLEAN)
    set_new_independent_format (v: BOOLEAN)
    store_by_name (file_name: STRING)


STORABLE Flat contracts

indexing
    description: "[
        Objects that may be stored and retrieved along with all their dependents.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    STORABLE

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    retrieve_by_name (file_name: STRING): ANY
            -- Retrieve object structure, from external
            -- representation previously stored in a file
            -- called file_name.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if file content is not a stored Eiffel structure.
            -- Will return Void if the file does not exist or
            -- is not readable.
        require
            file_name_exists: file_name /= void
            file_name_meaningful: not file_name.is_empty

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    retrieved (medium: IO_MEDIUM): ANY
            -- Retrieved object structure, from external
            -- representation previously stored in medium.
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if medium content is not a stored Eiffel structure.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_read: medium.is_open_read
            medium_supports_storable: medium.support_storable
        ensure
            result_exists: Result /= void

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

feature -- Element change

    basic_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable within current system only.
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    general_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    independent_store (medium: IO_MEDIUM)
            -- Produce on medium an external representation of the
            -- entire object structure reachable from current object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require
            medium_not_void: medium /= void
            medium_exists: medium.exists
            medium_is_open_write: medium.is_open_write
            medium_supports_storable: medium.support_storable

    store_by_name (file_name: STRING)
            -- Produce on file called file_name an external
            -- representation of the entire object structure
            -- reachable from current object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require
            file_name_not_void: file_name /= void
            file_name_meaningful: not file_name.is_empty

feature -- Setting

    set_discard_pointers (v: BOOLEAN)
            -- If v it will discard POINTER values and replace them by
            -- the default_pointer pointer. Otherwise it keeps the original value.

    set_new_independent_format (v: BOOLEAN)
            -- If v it will use ISE Eiffel 5.0 storable format for
            -- storing.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STORABLE


STREAM Chart

class
    STREAM

General
    cluster: base.kernel
    description: "Implementation of the STORABLE mechanism with streams."
    create: make_with_size, make

Ancestors
    IO_MEDIUM

Queries
    buffer: POINTER
    buffer_size: INTEGER
    Exists: BOOLEAN
    extendible: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    Is_open_read: BOOLEAN
    Is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    Is_readable: BOOLEAN
    Is_writable: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    object_stored_size: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    Support_storable: BOOLEAN

Commands
    basic_store (object: ANY)
    close
    create_c_buffer
    dispose
    general_store (object: ANY)
    independent_store (object: ANY)
    make
    make_with_size (n: INTEGER)
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    set_additional_size (new_size: INTEGER)


STREAM Flat contracts

indexing
    description: "Implementation of the STORABLE mechanism with streams."
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    STREAM

create

    make
            -- Create stream object with a default_size of 100 bytes

    make_with_size (n: INTEGER)
            -- Create stream object with a default_size of n bytes

feature -- Initialization

    make
            -- Create stream object with a default_size of 100 bytes

    make_with_size (n: INTEGER)
            -- Create stream object with a default_size of n bytes

feature -- Access

    buffer: POINTER
            -- C buffer correspond to the Eiffel STREAM.

    buffer_size: INTEGER
            -- Buffer's size.

    create_c_buffer
            -- Create the C memory corresponding to the C
            -- buffer.

    object_stored_size: INTEGER
            -- Size of last stored object.

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    Exists: BOOLEAN is True
            -- Stream exists in any cases.

    extendible: BOOLEAN
            -- May new items be added?

    is_closed: BOOLEAN
            -- Is the I/O medium open

    is_executable: BOOLEAN
            -- Is stream executable?
        require -- from IO_MEDIUM
            handle_exists: exists

    Is_open_read: BOOLEAN is True
            -- Stream opens for input.

    Is_open_write: BOOLEAN is True
            -- Stream opens for output.

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    Is_readable: BOOLEAN is True

    Is_writable: BOOLEAN is True
            -- Stream is writable.

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    readable: BOOLEAN
            -- Is there a current item that may be read?
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?

feature -- Status setting

    close
            -- Close medium.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    set_additional_size (new_size: INTEGER)
            -- Set new_size to BUFFER_SIZE, internal value used to
            -- increment buffer_size during storable operations.

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable

    read_line
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in STREAM as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in STREAM as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in STREAM as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable

    readline
            -- Read characters until a new line or
            -- end of medium.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in STREAM as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of medium is encountered.
            -- Make result available in last_string.
            -- Was declared in STREAM as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable

feature -- Output

    new_line
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            stream_exists: exists

    put_boolean (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in STREAM as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible

    put_character (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in STREAM as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in STREAM as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write i to medium.
            -- Was declared in STREAM as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character to medium
            -- Was declared in STREAM as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            stream_exists: exists

    put_real (r: REAL)
            -- Write r to medium.
            -- Was declared in STREAM as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s to medium.
            -- Was declared in STREAM as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putbool (b: BOOLEAN)
            -- Write b to medium.
            -- Was declared in STREAM as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible

    putchar (c: CHARACTER)
            -- Write c to medium.
            -- Was declared in STREAM as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write d to medium.
            -- Was declared in STREAM as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write i to medium.
            -- Was declared in STREAM as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write r to medium.
            -- Was declared in STREAM as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s to medium.
            -- Was declared in STREAM as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STREAM


STRING Chart

class
    STRING

General
    cluster: base.kernel
    description:
        "Sequences of characters, accessible through integer indices
        in a contiguous range."
    create: make_from_c, make_from_string, make

Ancestors
    COMPARABLE
    HASHABLE
    INDEXABLE [G, H -> INTEGER]
    RESIZABLE [G]
    STRING_HANDLER
    TO_SPECIAL [T]

Queries
    infix "@" (i: INTEGER): CHARACTER
    infix ">=" (other: [like Current] STRING): BOOLEAN
    infix ">" (other: [like Current] STRING): BOOLEAN
    infix "<=" (other: [like Current] STRING): BOOLEAN
    infix "<" (other: [like Current] STRING): BOOLEAN
    infix "+" (s: STRING): STRING
    adapt (s: STRING): [like Current] STRING
    additional_space: INTEGER
    area: SPECIAL [CHARACTER]
    capacity: INTEGER
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    False_constant: STRING
    full: BOOLEAN
    fuzzy_index (other: STRING; start, fuzz: INTEGER): INTEGER
    Growth_percentage: INTEGER
    has (c: CHARACTER): BOOLEAN
    hash_code: INTEGER
    index_of (c: CHARACTER; start: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_boolean: BOOLEAN
    is_double: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] STRING): BOOLEAN
    is_hashable: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_integer: BOOLEAN
    is_real: BOOLEAN
    item (i: INTEGER): CHARACTER
    item_code (i: INTEGER): INTEGER
    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
    linear_representation: LINEAR [CHARACTER]
    max (other: [like Current] STRING): [like Current] STRING
    min (other: [like Current] STRING): [like Current] STRING
    Minimal_increase: INTEGER
    mirrored: [like Current] STRING
    object_comparison: BOOLEAN
    occurrences (c: CHARACTER): INTEGER
    out: [like Current] STRING
    prunable: BOOLEAN
    resizable: BOOLEAN
    shared_with (other: [like Current] STRING): BOOLEAN
    split (a_separator: CHARACTER): LIST [STRING]
    substring (n1, n2: INTEGER): [like Current] STRING
    substring_index (other: STRING; start: INTEGER): INTEGER
    three_way_comparison (other: [like Current] STRING): INTEGER
    to_boolean: BOOLEAN
    to_c: ANY
    to_double: DOUBLE
    to_integer: INTEGER
    to_real: REAL
    True_constant: STRING
    valid_index (i: INTEGER): BOOLEAN

Commands
    adapt_size
    append (s: STRING)
    append_boolean (b: BOOLEAN)
    append_character (c: CHARACTER)
    append_double (d: DOUBLE)
    append_integer (i: INTEGER)
    append_real (r: REAL)
    append_string (s: STRING)
    automatic_grow
    center_justify
    character_justify (pivot: CHARACTER; position: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] STRING)
    extend (c: CHARACTER)
    fill (other: CONTAINER [CHARACTER])
    fill_blank
    fill_character (c: CHARACTER)
    from_c (c_string: POINTER)
    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
    grow (newsize: INTEGER)
    head (n: INTEGER)
    insert (s: STRING; i: INTEGER)
    left_adjust
    left_justify
    make_from_c (c_string: POINTER)
    make_from_string (s: STRING)
    mirror
    multiply (n: INTEGER)
    precede (c: CHARACTER)
    prepend (s: STRING)
    prepend_boolean (b: BOOLEAN)
    prepend_character (c: CHARACTER)
    prepend_double (d: DOUBLE)
    prepend_integer (i: INTEGER)
    prepend_real (r: REAL)
    prepend_string (s: STRING)
    prune (c: CHARACTER)
    prune_all (c: CHARACTER)
    prune_all_leading (c: CHARACTER)
    prune_all_trailing (c: CHARACTER)
    put (c: CHARACTER; i: INTEGER)
    remove (i: INTEGER)
    replace_blank
    replace_character (c: CHARACTER)
    replace_substring (s: [like Current] STRING; start_pos, end_pos: INTEGER)
    replace_substring_all (original, new: [like Current] STRING)
    resize (newsize: INTEGER)
    right_adjust
    right_justify
    set (t: [like Current] STRING; n1, n2: INTEGER)
    share (other: [like Current] STRING)
    subcopy (other: [like Current] STRING; start_pos, end_pos, index_pos: INTEGER)
    tail (n: INTEGER)
    to_lower
    to_upper
    wipe_out

Constraints
    extendible
    compare character
    index set has same count


STRING Flat contracts

indexing
    description: "[
        Sequences of characters, accessible through integer indices
        in a contiguous range.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    STRING

create

    make (n: INTEGER)
            -- Allocate space for at least n characters.
        require
            non_negative_size: n >= 0
        ensure
            empty_string: count = 0
            area_allocated: capacity >= n

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
        require
            string_exists: s /= void
        ensure
            shared_implementation: shared_with (s)

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
        require
            c_string_exists: c_string /= default_pointer

feature -- Initialization

    adapt (s: STRING): like Current
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s

    from_c (c_string: POINTER)
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
        ensure
            no_zero_byte: not has ('%U')

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
        require
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        ensure
            valid_count: count = end_pos - start_pos + 1

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
        require
            c_string_exists: c_string /= default_pointer

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
        require
            string_exists: s /= void
        ensure
            shared_implementation: shared_with (s)

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    False_constant: STRING is "false"
            -- Constant string "false"

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
        require
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    hash_code: INTEGER
            -- Hash code value
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    index_of (c: CHARACTER; start: INTEGER): INTEGER
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
        require
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        ensure
            correct_place: Result > 0 implies item (Result) = c

    item (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    item_code (i: INTEGER): INTEGER
            -- Numeric code of character at position i
        require
            index_small_enough: i <= count
            index_large_enough: i > 0

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
            -- Position of last occurrence of c.
            -- 0 if none
        require
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        ensure
            correct_place: Result > 0 implies item (Result) = c

    shared_with (other: like Current): BOOLEAN
            -- Does string share the text of other?

    substring_index (other: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
        require
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        ensure
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)

    True_constant: STRING is "true"
            -- Constant string "true"

    infix "@" (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of item.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Allocated space

    count: INTEGER
            -- Actual number of characters making up the string

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            Result.count = count

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER
            -- Number of times c appears in the string
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is string lexicographically lower than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Changeable_comparison_criterion: BOOLEAN is False

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_boolean: BOOLEAN
            -- Does Current represent a BOOLEAN?

    is_double: BOOLEAN
            -- Does Current represent a DOUBLE?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_integer: BOOLEAN
            -- Does Current represent an INTEGER?

    is_real: BOOLEAN
            -- Does Current represent a REAL?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the string?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: STRING)
            -- Append a copy of s at end.
        require
            argument_not_void: s /= void
        ensure
            new_count: count = old count + old s.count

    append_boolean (b: BOOLEAN)
            -- Append the string representation of b at end.

    append_character (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1

    append_double (d: DOUBLE)
            -- Append the string representation of d at end.

    append_integer (i: INTEGER)
            -- Append the string representation of i at end.

    append_real (r: REAL)
            -- Append the string representation of r at end.

    append_string (s: STRING)
            -- Append a copy of s, if not void, at end.

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            new_result_count: count = other.count

    extend (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            item_inserted: item (count) = c
            new_count: count = old count + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_blank
            -- Fill with capacity blank characters.
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    fill_character (c: CHARACTER)
            -- Fill with capacity characters all equal to c.
        ensure
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    head (n: INTEGER)
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        ensure
            new_count: count = n.min (old count)

    insert (s: STRING; i: INTEGER)
            -- Add s to the left of position i in current string.
        require
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure
            new_count: count = old count + s.count

    left_adjust
            -- Remove leading whitespace.
        ensure
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '   ') and (item (1) /= '%R') and (item (1) /= ''))

    precede (c: CHARACTER)
            -- Add c at front.
            -- Was declared in STRING as synonym of prepend_character.
        ensure
            new_count: count = old count + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
        require
            argument_not_void: s /= void
        ensure
            new_count: count = old count + s.count

    prepend_boolean (b: BOOLEAN)
            -- Prepend the string representation of b at front.

    prepend_character (c: CHARACTER)
            -- Add c at front.
            -- Was declared in STRING as synonym of precede.
        ensure
            new_count: count = old count + 1

    prepend_double (d: DOUBLE)
            -- Prepend the string representation of d at front.

    prepend_integer (i: INTEGER)
            -- Prepend the string representation of i at front.

    prepend_real (r: REAL)
            -- Prepend the string representation of r at front.

    prepend_string (s: STRING)
            -- Prepend a copy of s, if not void, at front.

    put (c: CHARACTER; i: INTEGER)
            -- Replace character at position i by c.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    replace_blank
            -- Replace all current characters with blanks.
        ensure
            same_size: (count = old count) and (capacity = old capacity)

    replace_character (c: CHARACTER)
            -- Replace all current characters with characters all equal to c.
        ensure
            same_size: (count = old count) and (capacity = old capacity)

    replace_substring (s: like Current; start_pos, end_pos: INTEGER)
            -- Replace characters from start_pos to end_pos with s.
        require
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        ensure
            new_count: count = old count + s.count - end_pos + start_pos - 1

    replace_substring_all (original, new: like Current)
            -- Replace every occurrence of original with new.
        require
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty

    right_adjust
            -- Remove trailing whitespace.
        ensure
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '   ') and (item (count) /= '%R') and (item (count) /= ''))

    set (t: like Current; n1, n2: INTEGER)
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
        require
            argument_not_void: t /= void
        ensure
            is_substring: is_equal (t.substring (n1, n2))

    share (other: like Current)
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
        require
            argument_not_void: other /= void
        ensure
            shared_count: other.count = count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
        require
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)

    tail (n: INTEGER)
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
        require
            non_negative_argument: n >= 0
        ensure
            new_count: count = n.min (old count)

    infix "+" (s: STRING): STRING
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
        require
            argument_not_void: s /= void
        ensure
            result_exists: Result /= void
            new_count: Result.count = count + s.count

feature -- Removal

    clear_all
            -- Reset all characters.
        ensure
            is_empty: count = 0
            same_capacity: capacity = old capacity

    prune (c: CHARACTER)
            -- Remove first occurrence of c, if any.
        require -- from COLLECTION
            prunable: prunable
        require else
            True

    prune_all (c: CHARACTER)
            -- Remove all occurrences of c.
        require -- from COLLECTION
            prunable
        require else
            True
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then
            changed_count: count = (old count) - (old occurrences (c))

    prune_all_leading (c: CHARACTER)
            -- Remove all leading occurrences of c.

    prune_all_trailing (c: CHARACTER)
            -- Remove all trailing occurrences of c.

    remove (i: INTEGER)
            -- Remove i-th character.
        require
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure
            new_count: count = old count - 1

    wipe_out
            -- Remove all characters.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            is_empty: count = 0
            empty_capacity: capacity = 0

feature -- Resizing

    adapt_size
            -- Adapt the size to accommodate count characters.

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (newsize: INTEGER)
            -- Ensure that the capacity is at least newsize.
        require -- from  RESIZABLE
            True
        require else
            new_size_non_negative: newsize >= 0
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (newsize: INTEGER)
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
        require
            new_size_non_negative: newsize >= 0

feature -- Conversion

    center_justify
            -- Center justify the string using
            -- the capacity as the width

    character_justify (pivot: CHARACTER; position: INTEGER)
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
        require
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty

    left_justify
            -- Left justify the string using
            -- the capacity as the width

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure

    mirror
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
        ensure
            same_count: count = old count

    mirrored: like Current
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
        ensure
            same_count: Result.count = count

    right_justify
            -- Right justify the string using
            -- the capacity as the width

    split (a_separator: CHARACTER): LIST [STRING]
            -- Split on a_separator.
        ensure
            Result /= void

    to_boolean: BOOLEAN
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
        require
            is_boolean: is_boolean

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.

    to_double: DOUBLE
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
        require
            represents_a_double: is_double

    to_integer: INTEGER
            -- Integer value;
            -- for example, when applied to "123", will yield 123
        require
            is_integer: is_integer

    to_lower
            -- Convert to lower case.

    to_real: REAL
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
        require
            represents_a_real: is_real

    to_upper
            -- Convert to upper case.

feature -- Duplication

    multiply (n: INTEGER)
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
        require
            meaningful_multiplier: n >= 1

    substring (n1, n2: INTEGER): like Current
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
        ensure
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0

feature -- Output

    out: like Current
            -- Printable representation

invariant

    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING


STRING_HANDLER Chart

class
    STRING_HANDLER

General
    cluster: base.kernel
    description: "Objects that can access `set_count' from STRING"

Ancestors
    ANY


TO_SPECIAL Chart

class
    TO_SPECIAL [T]

General
    cluster: base.kernel
    description: "References to special objects, for direct access to arrays and strings"
    create: make_area

Ancestors
    ANY

Queries
    area: SPECIAL [T]


TO_SPECIAL Flat contracts

indexing
    description: "References to special objects, for direct access to arrays and strings"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    TO_SPECIAL [T]

create

    make_area (n: INTEGER)
            -- Creates a special object for n entries.
        require
            non_negative_argument: n >= 0
        ensure
            area_allocated: area /= void and then area.count = n

feature -- Access

    area: SPECIAL [T]
            -- Special data zone

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TO_SPECIAL


TUPLE Chart

class
    TUPLE

General
    cluster: base.kernel
    description: "Implementation of TUPLE"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): ANY
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [ANY]
    arrayed: ARRAY [ANY]
    boolean_arrayed: ARRAY [BOOLEAN]
    boolean_item (index: INTEGER): BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    character_arrayed: ARRAY [CHARACTER]
    character_item (index: INTEGER): CHARACTER
    convertible_to_double: BOOLEAN
    convertible_to_real: BOOLEAN
    count: INTEGER
    double_arrayed: ARRAY [DOUBLE]
    double_item (index: INTEGER): DOUBLE
    entry (i: INTEGER): ANY
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: ANY): BOOLEAN
    index_set: INTEGER_INTERVAL
    integer_arrayed: ARRAY [INTEGER]
    integer_item (index: INTEGER): INTEGER
    is_boolean_item (index: INTEGER): BOOLEAN
    is_character_item (index: INTEGER): BOOLEAN
    is_double_item (index: INTEGER): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] TUPLE): BOOLEAN
    is_inserted (v: ANY): BOOLEAN
    is_integer_item (index: INTEGER): BOOLEAN
    is_numeric_item (index: INTEGER): BOOLEAN
    is_pointer_item (index: INTEGER): BOOLEAN
    is_real_item (index: INTEGER): BOOLEAN
    is_reference_item (index: INTEGER): BOOLEAN
    is_uniform: BOOLEAN
    is_uniform_boolean: BOOLEAN
    is_uniform_character: BOOLEAN
    is_uniform_double: BOOLEAN
    is_uniform_integer: BOOLEAN
    is_uniform_pointer: BOOLEAN
    is_uniform_real: BOOLEAN
    is_uniform_reference: BOOLEAN
    item (i: INTEGER): ANY
    linear_representation: LINEAR [ANY]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: ANY): INTEGER
    pointer_arrayed: ARRAY [POINTER]
    pointer_item (index: INTEGER): POINTER
    prunable: BOOLEAN
    real_arrayed: ARRAY [REAL]
    real_item (index: INTEGER): REAL
    resizable: BOOLEAN
    same_items (other: [like Current] TUPLE): BOOLEAN
    string_arrayed: ARRAY [STRING]
    subarray (start_pos, end_pos: INTEGER): [like Current] TUPLE
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    array_make (min_index, max_index: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] TUPLE)
    discard_items
    enter (v: [like item] ANY; i: INTEGER)
    fill (other: CONTAINER [ANY])
    force (v: [like item] ANY; i: INTEGER)
    grow (i: INTEGER)
    make
    make_from_array (a: ARRAY [ANY])
    prune_all (v: ANY)
    put (v: [like item] ANY; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    subcopy (other: [like Current] TUPLE; start_pos, end_pos, index_pos: INTEGER)


TUPLE Flat contracts

indexing
    description: "Implementation of TUPLE"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    TUPLE

create

    make

feature -- Initialization

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [ANY])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    area: SPECIAL [ANY]
            -- Special data zone
            -- (from TO_SPECIAL)

    boolean_item (index: INTEGER): BOOLEAN
            -- Boolean item at index.
        require
            valid_index: valid_index (index)
            is_boolean: is_boolean_item (index)

    character_item (index: INTEGER): CHARACTER
            -- Character item at index.
        require
            valid_index: valid_index (index)
            is_character: is_character_item (index)

    double_item (index: INTEGER): DOUBLE
            -- Double item at index.
        require
            valid_index: valid_index (index)
            is_numeric: is_numeric_item (index)

    entry (i: INTEGER): ANY
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: ANY): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    integer_item (index: INTEGER): INTEGER
            -- Integer item at index.
        require
            valid_index: valid_index (index)
            is_integer: is_integer_item (index)

    item (i: INTEGER): ANY
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    pointer_item (index: INTEGER): POINTER
            -- Pointer item at index.
        require
            valid_index: valid_index (index)
            is_pointer: is_pointer_item (index)

    real_item (index: INTEGER): REAL
            -- real item at index.
        require
            valid_index: valid_index (index)
            is_real_or_integer: is_real_item (index) or else is_integer_item (index)

    infix "@" (i: INTEGER): ANY
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: ANY): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: ANY): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [ANY])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: ANY)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    arrayed: ARRAY [ANY]
            -- Items of Current as array
        ensure
            exists: Result /= void
            same_count: Result.count = count

    boolean_arrayed: ARRAY [BOOLEAN]
            -- Items of Current as array
        require
            is_uniform_boolean: is_uniform_boolean
        ensure
            exists: Result /= void
            same_count: Result.count = count

    character_arrayed: ARRAY [CHARACTER]
            -- Items of Current as array
        require
            is_uniform_character: is_uniform_character
        ensure
            exists: Result /= void
            same_count: Result.count = count

    double_arrayed: ARRAY [DOUBLE]
            -- Items of Current as array
        require
            convertible: convertible_to_double
        ensure
            exists: Result /= void
            same_count: Result.count = count

    integer_arrayed: ARRAY [INTEGER]
            -- Items of Current as array
        require
            is_uniform_integer: is_uniform_integer
        ensure
            exists: Result /= void
            same_count: Result.count = count

    linear_representation: LINEAR [ANY]
            -- Representation as a linear structure
            -- (from ARRAY)

    pointer_arrayed: ARRAY [POINTER]
            -- Items of Current as array
        require
            is_uniform_pointer: is_uniform_pointer
        ensure
            exists: Result /= void
            same_count: Result.count = count

    real_arrayed: ARRAY [REAL]
            -- Items of Current as array
        require
            convertible: convertible_to_real
        ensure
            exists: Result /= void
            same_count: Result.count = count

    string_arrayed: ARRAY [STRING]
            -- Items of Current as array
            -- NOTE: Items with a type not cconforming to
            --       type STRING are set to Void.
        ensure
            exists: Result /= void
            same_count: Result.count = count

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Creation

    make

feature -- Type conversion queries

    convertible_to_double: BOOLEAN
            -- Is current convertible to an array of doubles?
        ensure
            yes_if_empty: (count = 0) implies Result

    convertible_to_real: BOOLEAN
            -- Is current convertible to an array of reals?
        ensure
            yes_if_empty: (count = 0) implies Result

feature -- Type queries

    is_boolean_item (index: INTEGER): BOOLEAN
            -- Is item at index a BOOLEAN?
        require
            valid_index: valid_index (index)

    is_character_item (index: INTEGER): BOOLEAN
            -- Is item at index a CHARACTER?
        require
            valid_index: valid_index (index)

    is_double_item (index: INTEGER): BOOLEAN
            -- Is item at index a DOUBLE?
        require
            valid_index: valid_index (index)

    is_integer_item (index: INTEGER): BOOLEAN
            -- Is item at index an INTEGER?
        require
            valid_index: valid_index (index)

    is_numeric_item (index: INTEGER): BOOLEAN
            -- Is item at index a number?
        require
            valid_index: valid_index (index)

    is_pointer_item (index: INTEGER): BOOLEAN
            -- Is item at index a POINTER?
        require
            valid_index: valid_index (index)

    is_real_item (index: INTEGER): BOOLEAN
            -- Is item at index a REAL?
        require
            valid_index: valid_index (index)

    is_reference_item (index: INTEGER): BOOLEAN
            -- Is item at index a REFERENCE?
        require
            valid_index: valid_index (index)

    is_uniform: BOOLEAN
            -- Are all items of the same basic type or all of reference type?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_boolean: BOOLEAN
            -- Are all items of type BOOLEAN?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_character: BOOLEAN
            -- Are all items of type CHARACTER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_double: BOOLEAN
            -- Are all items of type DOUBLE?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_integer: BOOLEAN
            -- Are all items of type INTEGER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_pointer: BOOLEAN
            -- Are all items of type POINTER?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_real: BOOLEAN
            -- Are all items of type REAL?
        ensure
            yes_if_empty: (count = 0) implies Result

    is_uniform_reference: BOOLEAN
            -- Are all items of reference type?
        ensure
            yes_if_empty: (count = 0) implies Result

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TUPLE


UNIX_FILE_INFO Chart

class
    UNIX_FILE_INFO

General
    cluster: base.kernel
    description: "Internal file information"
    create: make

Ancestors
    TO_SPECIAL [T]

Queries
    access_date: INTEGER
    buffered_file_info: SPECIAL [CHARACTER]
    change_date: INTEGER
    date: INTEGER
    device: INTEGER
    device_type: INTEGER
    file_name: STRING
    group_id: INTEGER
    group_name: STRING
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    links: INTEGER
    owner_name: STRING
    protection: INTEGER
    size: INTEGER
    type: INTEGER
    user_id: INTEGER

Commands
    make
    update (f_name: STRING)


UNIX_FILE_INFO Flat contracts

indexing
    description: "Internal file information"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    UNIX_FILE_INFO

create

    make
            -- Creation procedure

feature -- Initialization

    make
            -- Creation procedure

feature -- Access

    access_date: INTEGER
            -- Date of last access

    buffered_file_info: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    change_date: INTEGER
            -- Date of last status change

    date: INTEGER
            -- Last modification date

    device: INTEGER
            -- Device number on which inode resides

    device_type: INTEGER
            -- Device type on which inode resides

    file_name: STRING
            -- File name to which information applies.

    group_id: INTEGER
            -- GID of the file

    group_name: STRING
            -- Name of the file group, if available from /etc/group.
            -- Otherwise, the GID

    inode: INTEGER
            -- Inode number

    links: INTEGER
            -- Number of links

    owner_name: STRING
            -- Name of the file owner, if available from /etc/passwd.
            -- Otherwise, the UID

    protection: INTEGER
            -- Protection mode of file (12 lower bits)

    size: INTEGER
            -- File size, in bytes

    type: INTEGER
            -- File type (4 bits, 12 lowest bits zeroed)

    user_id: INTEGER
            -- UID of the file owner

feature -- Status report

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?

    is_block: BOOLEAN
            -- Is file a device block special file?

    is_character: BOOLEAN
            -- Is file a character block special file?

    is_device: BOOLEAN
            -- Is file a device?

    is_directory: BOOLEAN
            -- Is file a directory?

    is_executable: BOOLEAN
            -- Is file executable by effective UID?

    is_fifo: BOOLEAN
            -- Is file a named pipe?

    is_owner: BOOLEAN
            -- Is file owned by effective UID?

    is_plain: BOOLEAN
            -- Is file a plain file?

    is_readable: BOOLEAN
            -- Is file readable by effective UID?

    is_setgid: BOOLEAN
            -- Is file setgid?

    is_setuid: BOOLEAN
            -- Is file setuid?

    is_socket: BOOLEAN
            -- Is file a named socket?

    is_sticky: BOOLEAN
            -- Is file sticky?

    is_symlink: BOOLEAN
            -- Is file a symbolic link?

    is_writable: BOOLEAN
            -- Is file writable by effective UID?

feature -- Element change

    update (f_name: STRING)
            -- Update information buffer: fill it in with information
            -- from the inode of f_name.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_FILE_INFO


UNIX_SIGNALS Chart

class
    UNIX_SIGNALS

General
    cluster: base.kernel
    description:
        "Constants used for signal handling.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    is_defined (sig: INTEGER): BOOLEAN
    is_ignored (sig: INTEGER): BOOLEAN
    meaning (sig: INTEGER): STRING
    Sigabrt: INTEGER
    Sigalrm: INTEGER
    Sigbus: INTEGER
    Sigchld: INTEGER
    Sigcld: INTEGER
    Sigcont: INTEGER
    Sigemt: INTEGER
    Sigfpe: INTEGER
    Sighup: INTEGER
    Sigill: INTEGER
    Sigint: INTEGER
    Sigio: INTEGER
    Sigiot: INTEGER
    Sigkill: INTEGER
    Siglost: INTEGER
    signal: INTEGER
    Sigphone: INTEGER
    Sigpipe: INTEGER
    Sigpoll: INTEGER
    Sigprof: INTEGER
    Sigpwr: INTEGER
    Sigquit: INTEGER
    Sigsegv: INTEGER
    Sigstop: INTEGER
    Sigsys: INTEGER
    Sigterm: INTEGER
    Sigtrap: INTEGER
    Sigtstp: INTEGER
    Sigttin: INTEGER
    Sigttou: INTEGER
    Sigurg: INTEGER
    Sigusr1: INTEGER
    Sigusr2: INTEGER
    Sigvtalarm: INTEGER
    Sigwinch: INTEGER
    Sigwind: INTEGER
    Sigxcpu: INTEGER
    Sigxfsz: INTEGER

Commands
    catch (sig: INTEGER)
    ignore (sig: INTEGER)
    reset_all_default
    reset_default (sig: INTEGER)


UNIX_SIGNALS Flat contracts

indexing
    description: "[
        Constants used for signal handling.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    UNIX_SIGNALS

feature -- Access

    is_defined (sig: INTEGER): BOOLEAN
            -- Is sig a signal defined for this platform?

    is_ignored (sig: INTEGER): BOOLEAN
            -- Is sig currently set to be ignored?

    meaning (sig: INTEGER): STRING
            -- A message in English describing what sig is

    sigabrt: INTEGER
            -- Code for `Abort' signal

    sigalrm: INTEGER
            -- Code for ``Alarm clock'' signal

    sigbus: INTEGER
            -- Code for ``Bus error'' signal

    sigchld: INTEGER
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default

    sigcld: INTEGER
            -- Code for ``Death of a child'' signal.
            -- Signal ignored by default

    sigcont: INTEGER
            -- Code for ``Continue after stop'' signal.
            -- Signal ignored by default

    sigemt: INTEGER
            -- Code for ``EMT instruction'' signal

    sigfpe: INTEGER
            -- Code for ``Floating point exception'' signal

    sighup: INTEGER
            -- Code for `Hangup' signal

    sigill: INTEGER
            -- Code for ``Illegal instruction'' signal

    sigint: INTEGER
            -- Code for `Interrupt' signal

    sigio: INTEGER
            -- Code for ``Pending I/O on a descriptor'' signal.
            -- Signal ignored by default

    sigiot: INTEGER
            -- Code for ``IOT instruction'' signal

    sigkill: INTEGER
            -- Code for `Terminator' signal

    siglost: INTEGER
            -- Code for ``Resource lost'' signal

    sigphone: INTEGER
            -- Code for ``Line status change'' signal

    sigpipe: INTEGER
            -- Code for ``Broken pipe'' signal

    sigpoll: INTEGER
            -- Code for ``Selectable event pending'' signal

    sigprof: INTEGER
            -- Code for ``Profiling timer alarm'' signal

    sigpwr: INTEGER
            -- Code for `Power-fail' signal

    sigquit: INTEGER
            -- Code for `Quit' signal

    sigsegv: INTEGER
            -- Code for ``Segmentation violation'' signal

    sigstop: INTEGER
            -- Code for `Stop' signal

    sigsys: INTEGER
            -- Code for ``Bad argument to system call'' signal

    sigterm: INTEGER
            -- Code for ``Software termination'' signal

    sigtrap: INTEGER
            -- Code for ``Trace trap'' signal

    sigtstp: INTEGER
            -- Code for ``Stop from tty'' signal

    sigttin: INTEGER
            -- Code for ``Tty input from background'' signal.
            -- Signal ignored by default

    sigttou: INTEGER
            -- Code for ``Tty output from background'' signal.
            -- Signal ignored by default

    sigurg: INTEGER
            -- Code for ``Urgent condition on socket'' signal.
            -- Signal ignored by default

    sigusr1: INTEGER
            -- Code for ``User-defined signal #1''

    sigusr2: INTEGER
            -- Code for ``User-defined signal #2''

    sigvtalarm: INTEGER
            -- Code for ``Virtual time alarm'' signal

    sigwinch: INTEGER
            -- Code for ``Window size changed'' signal.
            -- Signal ignored by default

    sigwind: INTEGER
            -- Code for ``Window change'' signal

    sigxcpu: INTEGER
            -- Code for ``Cpu time limit exceeded'' signal

    sigxfsz: INTEGER
            -- Code for ``File size limit exceeded'' signal

feature -- Status report

    signal: INTEGER
            -- Code of last signal

feature -- Status setting

    catch (sig: INTEGER)
            -- Make sure that future occurrences of sig
            -- will be treated as exceptions.
            -- (This is the default for all signals.)
            -- No effect if signal not defined.

    ignore (sig: INTEGER)
            -- Make sure that future occurrences of sig
            -- will be ignored. (This is not the default.)
            -- No effect if signal not defined.

    reset_all_default
            -- Make sure that all exceptions will lead to their
            -- default handling.

    reset_default (sig: INTEGER)
            -- Make sure that exception of code code will lead
            -- to its default action.
        require
            is_defined (sig)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNIX_SIGNALS


WIDE_CHARACTER Chart

expanded class
    WIDE_CHARACTER

General
    cluster: base.kernel
    description: "Unicode characters, with comparison operations"

Ancestors
    WIDE_CHARACTER_REF

Queries
    infix ">=" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    infix ">" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    infix "<=" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    infix "<" (other: [like Current] WIDE_CHARACTER): BOOLEAN
    code: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] WIDE_CHARACTER): BOOLEAN
    Is_hashable: BOOLEAN
    item: WIDE_CHARACTER
    max (other: [like Current] WIDE_CHARACTER): [like Current] WIDE_CHARACTER
    min (other: [like Current] WIDE_CHARACTER): [like Current] WIDE_CHARACTER
    out: STRING
    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER

Commands
    set_item (c: WIDE_CHARACTER)


WIDE_CHARACTER Flat contracts

indexing
    description: "Unicode characters, with comparison operations"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

expanded class interface
    WIDE_CHARACTER

feature -- Access

    code: INTEGER
            -- Associated integer value and hash code value
            -- Was declared in WIDE_CHARACTER_REF as synonym of hash_code.
            -- (from WIDE_CHARACTER_REF)

    hash_code: INTEGER
            -- Associated integer value and hash code value
            -- Was declared in WIDE_CHARACTER_REF as synonym of code.
            -- (from WIDE_CHARACTER_REF)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: WIDE_CHARACTER
            -- Unicde character value
            -- (from WIDE_CHARACTER_REF)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from WIDE_CHARACTER_REF)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from WIDE_CHARACTER_REF)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
            -- (from WIDE_CHARACTER_REF)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?
            -- (from WIDE_CHARACTER_REF)

feature -- Element change

    set_item (c: WIDE_CHARACTER)
            -- Make c the item value.
            -- (from WIDE_CHARACTER_REF)

feature -- Output

    out: STRING
            -- Printable representation of wide character
            -- (from WIDE_CHARACTER_REF)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER


WIDE_CHARACTER_REF Chart

class
    WIDE_CHARACTER_REF

General
    cluster: base.kernel
    description: "References to objects containing a unicode character value"

Ancestors
    COMPARABLE
    HASHABLE

Queries
    infix ">=" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    infix ">" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    infix "<=" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    infix "<" (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    code: INTEGER
    hash_code: INTEGER
    is_equal (other: [like Current] WIDE_CHARACTER_REF): BOOLEAN
    Is_hashable: BOOLEAN
    item: WIDE_CHARACTER
    max (other: [like Current] WIDE_CHARACTER_REF): [like Current] WIDE_CHARACTER_REF
    min (other: [like Current] WIDE_CHARACTER_REF): [like Current] WIDE_CHARACTER_REF
    out: STRING
    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER

Commands
    set_item (c: WIDE_CHARACTER)


WIDE_CHARACTER_REF Flat contracts

indexing
    description: "References to objects containing a unicode character value"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    WIDE_CHARACTER_REF

feature -- Access

    code: INTEGER
            -- Associated integer value and hash code value
            -- Was declared in WIDE_CHARACTER_REF as synonym of hash_code.

    hash_code: INTEGER
            -- Associated integer value and hash code value
            -- Was declared in WIDE_CHARACTER_REF as synonym of code.
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    item: WIDE_CHARACTER
            -- Unicde character value

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: WIDE_CHARACTER_REF): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is other greater than current character?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Is_hashable: BOOLEAN is True
            -- May current object be hashed?

feature -- Element change

    set_item (c: WIDE_CHARACTER)
            -- Make c the item value.

feature -- Output

    out: STRING
            -- Printable representation of wide character

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class WIDE_CHARACTER_REF


cluster base.structures

Cluster
    base.structures

Supercluster
    base

Subclusters
    base.structures.access
    base.structures.cursors
    base.structures.cursor_tree
    base.structures.dispenser
    base.structures.iteration
    base.structures.list
    base.structures.set
    base.structures.sort
    base.structures.storage
    base.structures.table
    base.structures.traversing
    base.structures.tree


cluster base.structures.access

Cluster
    base.structures.access

Supercluster
    base.structures

Classes
    ACTIVE [G]
    BAG [G]
    COLLECTION [G]
    CONTAINER [G]
    CURSOR_STRUCTURE [G]
    INDEXABLE [G, H -> INTEGER]
    TABLE [G, H]


ACTIVE Chart

deferred class
    ACTIVE [G]

General
    cluster: base.structures.access
    description:
        "``Active'' data structures, which at every stage have
        a possibly undefined ``current item''.
        Basic access and modification operations apply to the current item."

Ancestors
    BAG [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    remove
    replace (v: G)
    wipe_out

Constraints
    writable constraint
    empty constraint


ACTIVE Flat contracts

indexing
    description: "[
        ``Active'' data structures, which at every stage have
        a possibly undefined ``current item''.
        Basic access and modification operations apply to the current item.
    ]"
    status: "See notice at end of class"
    names: active, access
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ACTIVE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
        require
            readable: readable

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
        require
            writable: writable
        ensure
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
        require
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ACTIVE


BAG Chart

deferred class
    BAG [G]

General
    cluster: base.structures.access
    description:
        "Collections of items, where each item may occur zero
        or more times, and the number of occurrences is meaningful."

Ancestors
    COLLECTION [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    wipe_out


BAG Flat contracts

indexing
    description: "[
        Collections of items, where each item may occur zero
        or more times, and the number of occurrences is meaningful.
    ]"
    status: "See notice at end of class"
    names: bag, access
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    BAG [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BAG


COLLECTION Chart

deferred class
    COLLECTION [G]

General
    cluster: base.structures.access
    description:
        "General container data structures,
        characterized by the membership properties of their items."

Ancestors
    CONTAINER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    wipe_out


COLLECTION Flat contracts

indexing
    description: "[
        General container data structures,
        characterized by the membership properties of their items.
    ]"
    status: "See notice at end of class"
    names: collection, access
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    COLLECTION [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of put.
        require
            extendible: extendible
        ensure
            item_inserted: is_inserted (v)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
        require
            extendible: extendible
        ensure
            item_inserted: is_inserted (v)

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            prunable
        ensure
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
        require
            prunable
        ensure
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COLLECTION


CONTAINER Chart

deferred class
    CONTAINER [G]

General
    cluster: base.structures.access
    description:
        "Data structures of the most general kind,
        used to hold zero or more items."

Ancestors
    ANY

Queries
    changeable_comparison_criterion: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references


CONTAINER Flat contracts

indexing
    description: "[
        Data structures of the most general kind,
        used to hold zero or more items.
    ]"
    status: "See notice at end of class"
    names: access
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CONTAINER [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)

    is_empty: BOOLEAN
            -- Is there no element?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
        require
            changeable_comparison_criterion
        ensure
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
        require
            changeable_comparison_criterion
        ensure
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CONTAINER


CURSOR_STRUCTURE Chart

deferred class
    CURSOR_STRUCTURE [G]

General
    cluster: base.structures.access
    description:
        "Active structures, which always have a current position
        accessible through a cursor."

Ancestors
    ACTIVE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    cursor: CURSOR
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    writable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    go_to (p: CURSOR)
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    remove
    replace (v: G)
    wipe_out


CURSOR_STRUCTURE Flat contracts

indexing
    description: "[
        Active structures, which always have a current position
        accessible through a cursor.
    ]"
    status: "See notice at end of class"
    names: cursor_structure, access
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CURSOR_STRUCTURE [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from ACTIVE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from ACTIVE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require
            cursor_position_valid: valid_cursor (p)

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in COLLECTION as synonym of extend.
            -- (from COLLECTION)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_STRUCTURE


INDEXABLE Chart

deferred class
    INDEXABLE [G, H -> INTEGER]

General
    cluster: base.structures.access
    description: "Tables whose keys are integers in a contiguous interval"

Ancestors
    TABLE [G, H]

Queries
    infix "@" (k: H): G
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (k: H): G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    valid_index (i: H): BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G; k: H)
    wipe_out

Constraints
    index set not void


INDEXABLE Flat contracts

indexing
    description: "Tables whose keys are integers in a contiguous interval"
    status: "See notice at end of class"
    names: indexable, access
    access: index, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    INDEXABLE [G, H -> INTEGER]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

    infix "@" (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure
            not_void: Result /= void

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    valid_index (i: H): BOOLEAN
            -- Is i a valid index?
        ensure then
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G; k: H)
            -- Associate value v with key k.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then
            insertion_done: item (k) = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    index_set_not_void: index_set /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INDEXABLE


TABLE Chart

deferred class
    TABLE [G, H]

General
    cluster: base.structures.access
    description: "Containers whose items are accessible through keys"

Ancestors
    BAG [G]

Queries
    infix "@" (k: H): G
    changeable_comparison_criterion: BOOLEAN
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (k: H): G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    valid_key (k: H): BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G; k: H)
    wipe_out


TABLE Flat contracts

indexing
    description: "Containers whose items are accessible through keys"
    status: "See notice at end of class"
    names: table, access
    access: key, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    TABLE [G, H]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
        require
            valid_key: valid_key (k)

    infix "@" (k: H): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
        require
            valid_key: valid_key (k)

feature -- Measurement

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    valid_key (k: H): BOOLEAN
            -- Is k a valid key?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G; k: H)
            -- Associate value v with key k.
        require
            valid_key: valid_key (k)

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TABLE


cluster base.structures.cursors

Cluster
    base.structures.cursors

Supercluster
    base.structures

Classes
    ARRAYED_LIST_CURSOR
    CIRCULAR_CURSOR
    COMPACT_TREE_CURSOR
    CURSOR
    HASH_TABLE_CURSOR
    LINKED_LIST_CURSOR [G]
    LINKED_TREE_CURSOR [G]
    MULTAR_LIST_CURSOR [G]
    RECURSIVE_TREE_CURSOR [G]
    TWO_WAY_TREE_CURSOR [G]


ARRAYED_LIST_CURSOR Chart

class
    ARRAYED_LIST_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for arrayed lists"
    create: make

Ancestors
    CURSOR


CIRCULAR_CURSOR Chart

class
    CIRCULAR_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for circular lists"
    create: make

Ancestors
    CURSOR


COMPACT_TREE_CURSOR Chart

class
    COMPACT_TREE_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for compact trees"
    create: make

Ancestors
    CURSOR


CURSOR Chart

class
    CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for remembering positions in arbitrary data structures"

Ancestors
    ANY


HASH_TABLE_CURSOR Chart

class
    HASH_TABLE_CURSOR

General
    cluster: base.structures.cursors
    description: "Cursors for hash table traversal"
    create: make

Ancestors
    CURSOR


LINKED_LIST_CURSOR Chart

class
    LINKED_LIST_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for linked lists"
    create: make

Ancestors
    CURSOR

Constraints
    not both
    no active not on


LINKED_TREE_CURSOR Chart

class
    LINKED_TREE_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for linked trees"

Ancestors
    RECURSIVE_TREE_CURSOR [G]


MULTAR_LIST_CURSOR Chart

class
    MULTAR_LIST_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for multi-array trees"
    create: make

Ancestors
    CURSOR


RECURSIVE_TREE_CURSOR Chart

class
    RECURSIVE_TREE_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for recursive trees"
    create: make

Ancestors
    CURSOR


TWO_WAY_TREE_CURSOR Chart

class
    TWO_WAY_TREE_CURSOR [G]

General
    cluster: base.structures.cursors
    description: "Cursors for two-way cursor trees"

Ancestors
    RECURSIVE_TREE_CURSOR [G]


cluster base.structures.cursor_tree

Cluster
    base.structures.cursor_tree

Supercluster
    base.structures

Classes
    COMPACT_CURSOR_TREE [G]
    CURSOR_TREE [G]
    LINKED_CURSOR_TREE [G]
    RECURSIVE_CURSOR_TREE [G]
    TWO_WAY_CURSOR_TREE [G]


COMPACT_CURSOR_TREE Chart

class
    COMPACT_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Compact trees as active structures that may be traversed using a cursor"
    create: make

Ancestors
    CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] COMPACT_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] COMPACT_CURSOR_TREE [G]
    prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] COMPACT_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    make (i: INTEGER)
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_front (v: G)
    put_left (v: G)
    put_parent (v: G)
    put_right (v: G)
    remove
    remove_node
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out


COMPACT_CURSOR_TREE Flat contracts

indexing
    description: "Compact trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: compact_cursor_tree, cursor_tree
    representation: array
    access: cursor, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    COMPACT_CURSOR_TREE [G]

create

    make (i: INTEGER)
            -- Create an empty tree.
            -- i is an estimate of the number of nodes.
        ensure
            is_above: above
            is_empty: is_empty

feature -- Initialization

    make (i: INTEGER)
            -- Create an empty tree.
            -- i is an estimate of the number of nodes.
        ensure
            is_above: above
            is_empty: is_empty

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children
        require -- from HIERARCHICAL
            not_off: not off

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in subtree

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above the cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from CURSOR_TREE)

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Is cursor on a leaf?
            -- (from CURSOR_TREE)

    is_root: BOOLEAN
            -- Is cursor on root?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    prunable: BOOLEAN

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        require else
            True
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward, to parent
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    extend (v: G)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_front (v: G)
            -- Add a leaf v as first child.
            -- If above and is_empty, make v the root value

    put_left (v: G)
            -- Add v to the left of current position.
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty
        require else
            not_above: not above

    put_parent (v: G)
            -- insert a new node, with value v, as parent of
            -- current node and
            -- with the same position
            --if above or on root, add a new root
        require
            not after
            not before

    put_right (v: G)
            -- Add a leaf v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    replace (v: G)
            -- Replace current item by v
        require -- from ACTIVE
            writable: writable
        require else
            is_writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding subtree).
            -- Move cursor to next sibling, or after if none.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then
            not_before: not before

    remove_node
            -- Remove node at cursor position; insert children into
            -- parent's children at current position; move cursor up.
            -- If node is root, it must not have more than one child.
        require
            not_off: not off
            is_root implies arity <= 1

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_CURSOR_TREE


CURSOR_TREE Chart

deferred class
    CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Trees as active structures that may be traversed using a cursor"

Ancestors
    CURSOR_STRUCTURE [G]
    HIERARCHICAL [G]
    LINEAR [G]
    LINEAR [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] CURSOR_TREE [G]
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] CURSOR_TREE [G]
    prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_left (v: G)
    put_right (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out

Constraints
    non negative depth
    non negative breadth
    is leaf definition
    above property
    on tree
    off definition
    below constraint
    above constraint
    after constraint
    before constaint
    empty below constraint


CURSOR_TREE Flat contracts

indexing
    description: "Trees as active structures that may be traversed using a cursor"
    status: "See notice at end of class"
    names: cursor_tree, tree
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CURSOR_TREE [G]

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
        require
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    arity: INTEGER
            -- Number of successors of current element
            -- (from HIERARCHICAL)
        require -- from HIERARCHICAL
            not_off: not off

feature -- Measurement

    breadth: INTEGER
            -- Breadth of current level

    depth: INTEGER
            -- Depth of the tree

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Is cursor on a leaf?

    is_root: BOOLEAN
            -- Is cursor on root?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
        require
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
        require -- from  LINEAR
            True
        require else
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.

    level_forth
            -- Move cursor to next position of current level.

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
        require
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
        ensure then
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
        require
            argument_within_bounds: l >= 1 and then depth >= l
        ensure
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else
            not_above: not above
        ensure then
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
        require
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
        require
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
        require
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
        require
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_left (v: G)
            -- Add v to the left of cursor position.
        require
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
        require
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
        require
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
        require
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
        require
            not_off: not off

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE


LINKED_CURSOR_TREE Chart

class
    LINKED_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Cursor trees in linked representation"
    create: make_root, make

Ancestors
    RECURSIVE_CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] LINKED_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] LINKED_CURSOR_TREE [G]
    Prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] LINKED_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    make
    make_root (v: G)
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_child (v: G)
    put_left (v: G)
    put_right (v: G)
    put_root (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out


LINKED_CURSOR_TREE Flat contracts

indexing
    description: "Cursor trees in linked representation"
    status: "See notice at end of class"
    names: linked_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_CURSOR_TREE [G]

create

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Initialization

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position
            -- (from RECURSIVE_CURSOR_TREE)

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- (from CURSOR_TREE)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from RECURSIVE_CURSOR_TREE
            valid_cursor: not off or else above

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in the tree
            -- (from RECURSIVE_CURSOR_TREE)

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added on current level?
            -- (from RECURSIVE_CURSOR_TREE)

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is the tree empty?
            -- (from RECURSIVE_CURSOR_TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN

    is_root: BOOLEAN
            -- Is cursor on tree root?
            -- (from RECURSIVE_CURSOR_TREE)

    isfirst: BOOLEAN
            -- Is cursor on first sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    islast: BOOLEAN
            -- Is cursor on last sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from RECURSIVE_CURSOR_TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from RECURSIVE_CURSOR_TREE)

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.
            -- (from RECURSIVE_CURSOR_TREE)

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_child (v: G)
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf

    put_left (v: G)
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_root (v: G)
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        ensure
            is_root: is_root
            count = 1

    replace (v: G)
            -- Replace current item by v.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from RECURSIVE_CURSOR_TREE
            not_off_unless_empty: is_empty or else not off

    wipe_out
            -- Remove all items.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from RECURSIVE_CURSOR_TREE
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

feature -- Insert element

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RECURSIVE_CURSOR_TREE
    coherency: not above implies active_parent.child = active
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CURSOR_TREE


RECURSIVE_CURSOR_TREE Chart

deferred class
    RECURSIVE_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Cursor trees with a recursive structure"

Ancestors
    CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] RECURSIVE_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] RECURSIVE_CURSOR_TREE [G]
    prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] RECURSIVE_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_left (v: G)
    put_right (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out

Constraints
    coherency


RECURSIVE_CURSOR_TREE Flat contracts

indexing
    description: "Cursor trees with a recursive structure"
    status: "See notice at end of class"
    names: recursive_cursor_tree, cursor_tree, tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    RECURSIVE_CURSOR_TREE [G]

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- (from CURSOR_TREE)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
        require -- from HIERARCHICAL
            not_off: not off
        require else
            valid_cursor: not off or else above

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in the tree

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added on current level?

    is_empty: BOOLEAN
            -- Is the tree empty?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Is cursor on a leaf?
            -- (from CURSOR_TREE)

    is_root: BOOLEAN
            -- Is cursor on tree root?

    isfirst: BOOLEAN
            -- Is cursor on first sibling?

    islast: BOOLEAN
            -- Is cursor on last sibling?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_left (v: G)
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    replace (v: G)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then
            not_off_unless_empty: is_empty or else not off

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

feature -- Insert element

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    coherency: not above implies active_parent.child = active
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_CURSOR_TREE


TWO_WAY_CURSOR_TREE Chart

class
    TWO_WAY_CURSOR_TREE [G]

General
    cluster: base.structures.cursor_tree
    description: "Cursor trees implemented in two-way linked representation"
    create: make_root, make

Ancestors
    RECURSIVE_CURSOR_TREE [G]

Queries
    above: BOOLEAN
    after: BOOLEAN
    arity: INTEGER
    before: BOOLEAN
    below: BOOLEAN
    breadth: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child_item (i: INTEGER): G
    child_tree (i: INTEGER): [like Current] TWO_WAY_CURSOR_TREE [G]
    count: INTEGER
    cursor: CURSOR
    depth: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    level: INTEGER
    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    linear_representation: LINEAR [G]
    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    parent_item: G
    parent_tree: [like Current] TWO_WAY_CURSOR_TREE [G]
    Prunable: BOOLEAN
    readable: BOOLEAN
    subtree: [like Current] TWO_WAY_CURSOR_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    back
    breadth_forth
    compare_objects
    compare_references
    container_fill (other: CONTAINER [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    extend (v: G)
    fill (other: CURSOR_TREE [G])
    fill_from_active (other: CURSOR_TREE [G])
    forth
    go_last_child
    go_to (p: CURSOR)
    level_back
    level_forth
    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    make
    make_root (v: G)
    merge_left (other: CURSOR_TREE [G])
    merge_right (other: CURSOR_TREE [G])
    postorder_forth
    postorder_start
    preorder_forth
    put (v: G)
    put_child (v: G)
    put_left (v: G)
    put_right (v: G)
    put_root (v: G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    start_on_level (l: INTEGER)
    up
    wipe_out


TWO_WAY_CURSOR_TREE Flat contracts

indexing
    description: "Cursor trees implemented in two-way linked representation"
    status: "See notice at end of class"
    names: two_way_cursor_tree, cursor_tree
    access: cursor, membership
    representation: recursive, linked
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    TWO_WAY_CURSOR_TREE [G]

create

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Initialization

    make
            -- Create an empty tree.
        ensure
            is_above: above
            is_empty: is_empty

    make_root (v: G)
            -- Create a tree with v as root.

feature -- Access

    child_item (i: INTEGER): G
            -- Item in i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    cursor: CURSOR
            -- Current cursor position
            -- (from RECURSIVE_CURSOR_TREE)

    has (v: G): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CURSOR_TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- (from CURSOR_TREE)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent_item: G
            -- Item in parent.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Measurement

    arity: INTEGER
            -- Number of children of active node.
            -- If cursor is above, 0 if tree is empty, 1 otherwise.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from RECURSIVE_CURSOR_TREE
            valid_cursor: not off or else above

    breadth: INTEGER
            -- Breadth of current level
            -- (from CURSOR_TREE)

    count: INTEGER
            -- Number of items in the tree
            -- (from RECURSIVE_CURSOR_TREE)

    depth: INTEGER
            -- Depth of the tree
            -- (from CURSOR_TREE)

    level: INTEGER
            -- Level of current node in tree
            -- (Root is on level 1)
            -- (from CURSOR_TREE)

feature -- Status report

    above: BOOLEAN
            -- Is there no valid cursor position above cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from RECURSIVE_CURSOR_TREE)

    below: BOOLEAN
            -- Is there no valid cursor position below cursor?
            -- (from CURSOR_TREE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added on current level?
            -- (from RECURSIVE_CURSOR_TREE)

    Full: BOOLEAN is False
            -- Is tree filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is the tree empty?
            -- (from RECURSIVE_CURSOR_TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN

    is_root: BOOLEAN
            -- Is cursor on tree root?
            -- (from RECURSIVE_CURSOR_TREE)

    isfirst: BOOLEAN
            -- Is cursor on first sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    islast: BOOLEAN
            -- Is cursor on last sibling?
            -- (from RECURSIVE_CURSOR_TREE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (True if is_empty)
            -- (from CURSOR_TREE)

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from CURSOR_TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from RECURSIVE_CURSOR_TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Can cursor be moved to i-th child?
            -- 0 is before and arity + 1 is after.
            -- (from CURSOR_TREE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from CURSOR_TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from RECURSIVE_CURSOR_TREE)

    breadth_forth
            -- Move cursor to next position in breadth-first order.
            -- If the active node is the last in
            -- breadth-first order, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    down (i: INTEGER)
            -- Move cursor one level downward:
            -- to i-th child if there is one,
            -- or after if i = arity + 1,
            -- or before if i = 0.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
            argument_within_bounds: i >= 1 and i <= arity
        require else -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            valid_cursor_index: (above and i = 0) or else valid_cursor_index (i)
        ensure then -- from CURSOR_TREE
            gone_before: (i = 0) implies before

    forth
            -- Move cursor one position forward.
            -- (from RECURSIVE_CURSOR_TREE)

    go_last_child
            -- Go to the last child of current parent.
            -- No effect if below
            -- (from CURSOR_TREE)
        require -- from  LINEAR
            True
        require else -- from CURSOR_TREE
            not_above: not above

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    level_back
            -- Move cursor to previous position of current level.
            -- (from CURSOR_TREE)

    level_forth
            -- Move cursor to next position of current level.
            -- (from CURSOR_TREE)

    postorder_forth
            -- Move cursor to next position in postorder.
            -- If the active node is the last in
            -- postorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_off: not off

    postorder_start
            -- Move cursor to first position in postorder.
            -- Leave cursor off if tree is empty.
            -- (from CURSOR_TREE)

    preorder_forth
            -- Move cursor to next position in preorder.
            -- If the active node is the last in
            -- preorder, the cursor ends up off.
            -- (from CURSOR_TREE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move cursor to root.
            -- Leave cursor off if is_empty.
            -- (from CURSOR_TREE)
        ensure then -- from CURSOR_TREE
            on_root_unless_empty: not is_empty implies is_root

    start_on_level (l: INTEGER)
            -- Move the cursor to the first position
            -- of the l-th level counting from root.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: l >= 1 and then depth >= l
        ensure -- from CURSOR_TREE
            level_expected: level = l
            is_first: isfirst

    up
            -- Move cursor one level upward to parent,
            -- or above if is_root holds.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from HIERARCHICAL
            not_off: not off
        require else -- from CURSOR_TREE
            not_above: not above
        ensure then -- from CURSOR_TREE
            not_before: not before
            not_after: not after
            not_below: not below
            coherency: (not old off and above) = (old is_root)

feature -- Element change

    fill (other: CURSOR_TREE [G])
            -- Fill with as many items of other
            -- as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            is_empty: is_empty

    container_fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_from_active (other: CURSOR_TREE [G])
            -- Copy subtree of other's active node
            -- onto active node of current tree.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            cursor_on_leaf: is_leaf

    merge_left (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    merge_right (other: CURSOR_TREE [G])
            -- Merge the items of other into current structure to
            -- the right of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            other_exists: other /= void
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put (v: G)
            -- Put v at cursor position.
            -- (Synonym for replace)
            -- (from CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    put_child (v: G)
            -- Put v as child of a leaf.
        require
            is_leaf: is_leaf

    put_left (v: G)
            -- Add v to the left of cursor position.
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_before: not before
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_right (v: G)
            -- Add v to the right of cursor position.
        require -- from CURSOR_TREE
            not_after: not after
            not_above: not above
            only_one_root: (level = 1) implies is_empty

    put_root (v: G)
            -- Put v as root of an empty tree.
        require
            is_empty: is_empty
        ensure
            is_root: is_root
            count = 1

    replace (v: G)
            -- Replace current item by v.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove node at cursor position
            -- (and consequently the corresponding
            -- subtree). Cursor moved up one level.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from RECURSIVE_CURSOR_TREE
            not_off_unless_empty: is_empty or else not off

    wipe_out
            -- Remove all items.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from RECURSIVE_CURSOR_TREE
            cursor_above: above

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    child_tree (i: INTEGER): like Current
            -- Subtree rooted at i-th child
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            argument_within_bounds: i >= 1 and then i <= arity
            not_off: not off

    parent_tree: like Current
            -- Subtree rooted at parent
            -- (from CURSOR_TREE)
        require -- from CURSOR_TREE
            not_on_root: not is_root
            not_off: not off

    subtree: like Current
            -- Subtree rooted at current node.
        require -- from CURSOR_TREE
            not_off: not off

feature -- Insert element

    extend (v: G)
            -- Add v after last child.
            -- Make v the first_child if below and place
            -- cursor before.
            -- (from RECURSIVE_CURSOR_TREE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    linear_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    linear_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    linear_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from RECURSIVE_CURSOR_TREE
    coherency: not above implies active_parent.child = active
        -- from CURSOR_TREE
    non_negative_depth: depth >= 0
    non_negative_breadth: breadth >= 0
    is_leaf_definition: not off implies is_leaf = (arity = 0)
    above_property: above implies (arity <= 1)
    on_tree: (isfirst or islast or is_leaf or is_root) implies not off
    off_definition: off = after or before or above or below
    below_constraint: below implies ((after or before) and not above)
    above_constraint: above implies not (before or after or below)
    after_constraint: after implies not (before or above)
    before_constaint: before implies not (after or above)
    empty_below_constraint: (is_empty and (after or before)) implies below
        -- from HIERARCHICAL
    non_negative_successor_count: arity >= 0
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CURSOR_TREE


cluster base.structures.dispenser

Cluster
    base.structures.dispenser

Supercluster
    base.structures

Classes
    ARRAYED_QUEUE [G]
    ARRAYED_STACK [G]
    BOUNDED_QUEUE [G]
    BOUNDED_STACK [G]
    DISPENSER [G]
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]
    LINKED_QUEUE [G]
    LINKED_STACK [G]
    PRIORITY_QUEUE [G -> PART_COMPARABLE]
    QUEUE [G]
    STACK [G]


ARRAYED_QUEUE Chart

class
    ARRAYED_QUEUE [G]

General
    cluster: base.structures.dispenser
    description: "Unbounded queues, implemented by resizable arrays"
    create: make

Ancestors
    ARRAY [G]
    QUEUE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_QUEUE [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    force (v: G)
    make (n: INTEGER)
    put (v: G)
    remove
    replace (v: [like item] G)
    wipe_out

Constraints
    not full
    extendible
    prunable
    empty means storage empty


ARRAYED_QUEUE Flat contracts

indexing
    description: "Unbounded queues, implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAYED_QUEUE [G]

create

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Initialization

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Access

    has (v: like item): BOOLEAN
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Oldest item.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items.

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        ensure then
            count_definition: Result.count = count

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added? (Answer: yes.)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (Answer: no.)

    is_empty: BOOLEAN
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of off.

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is the structure empty?
            -- Was declared in ARRAYED_QUEUE as synonym of is_empty.

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and put.

    put (v: G)
            -- Add v as newest item.
            -- Was declared in ARRAYED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: like item)
            -- Replace oldest item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove oldest item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the original insertion order)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

invariant

    not_full: not full
    extendible: extendible
    prunable: prunable
    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_QUEUE


ARRAYED_STACK Chart

class
    ARRAYED_STACK [G]

General
    cluster: base.structures.dispenser
    description: "Stacks implemented by resizable arrays"
    create: make

Ancestors
    ARRAYED_LIST [G]
    STACK [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_STACK [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: [like first] G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_STACK [G])
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    make (n: INTEGER)
    put (v: [like item] G)
    remove
    replace (v: [like first] G)
    wipe_out


ARRAYED_STACK Flat contracts

indexing
    description: "Stacks implemented by resizable arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAYED_STACK [G]

create

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: after

feature  -- Initialization

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: after

feature -- Access

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and put.
        ensure then -- from STACK
            item_pushed: item = v

    put (v: like item)
            -- Push v on top.
            -- Was declared in ARRAYED_STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove top item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else
            not_empty: count /= 0

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: after

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: after = (index = 0)
    after_definition: before = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from BILINEAR
    not_both: not (before and after)
    before_constraint: after implies off
        -- from LINEAR
    after_constraint: before implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_STACK


BOUNDED_QUEUE Chart

class
    BOUNDED_QUEUE [G]

General
    cluster: base.structures.dispenser
    description: "Queues with a bounded physical size, implemented by arrays"
    create: make

Ancestors
    BOUNDED [G]
    QUEUE [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    readable: BOOLEAN
    Resizable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: G)
    forth
    make (n: INTEGER)
    prune (v: [like item] G)
    put (v: G)
    remove
    replace (v: [like item] G)
    start
    wipe_out

Constraints
    extendible definition


BOUNDED_QUEUE Flat contracts

indexing
    description: "Queues with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, fifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    BOUNDED_QUEUE [G]

create

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Initialization

    make (n: INTEGER)
            -- Create queue for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            capacity_expected: capacity = n

feature -- Access

    has (v: like item): BOOLEAN
            -- Does queue include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Oldest item.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be kept.

    count: INTEGER
            -- Number of items.

    occurrences (v: G): INTEGER
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    Resizable: BOOLEAN is True

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    finish
            -- Move cursor to last position.

    forth
            -- Move cursor to next position.

    start
            -- Move cursor to first position.

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and put.

    put (v: G)
            -- Add v as newest element.
            -- Was declared in BOUNDED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: like item)
            -- Replace oldest item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
        require -- from COLLECTION
            prunable: prunable

    remove
            -- Remove oldest item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the original insertion order)

invariant

    extendible_definition: extendible = not full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_QUEUE


BOUNDED_STACK Chart

class
    BOUNDED_STACK [G]

General
    cluster: base.structures.dispenser
    description: "Stacks with a bounded physical size, implemented by arrays"
    create: make

Ancestors
    BOUNDED [G]
    STACK [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    Prunable: BOOLEAN
    readable: BOOLEAN
    Resizable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    make (n: INTEGER)
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out

Constraints
    count small enough
    extendible definition


BOUNDED_STACK Flat contracts

indexing
    description: "Stacks with a bounded physical size, implemented by arrays"
    status: "See notice at end of class"
    names: dispenser, array
    representation: array
    access: fixed, lifo, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    BOUNDED_STACK [G]

create

    make (n: INTEGER)
            -- Create a stack for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            stack_allocated: capacity = n
            empty_stack: count = 0

feature -- Initialization

    make (n: INTEGER)
            -- Create a stack for at most n items.
        require
            non_negative_argument: n >= 0
        ensure
            stack_allocated: capacity = n
            empty_stack: count = 0

feature -- Access

    has (v: G): BOOLEAN
            -- Does v appear in stack?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Last item pushed (i.e. top)
        require -- from ACTIVE
            readable: readable
        require else
            not_empty: count > 0

feature -- Measurement

    capacity: INTEGER

    count: INTEGER

    occurrences (v: G): INTEGER
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
        ensure then
            Result = not full

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Prunable: BOOLEAN is True

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    Resizable: BOOLEAN is True

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and put.
        ensure then -- from STACK
            item_pushed: item = v

    put (v: like item)
            -- Push v on top.
            -- Was declared in BOUNDED_STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v

    replace (v: like item)
            -- Replace top item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove top item.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require else
            not_empty: count /= 0

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (in the reverse order of original insertion)

invariant

    count_small_enough: count <= capacity
    extendible_definition: extendible = not full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED_STACK


DISPENSER Chart

deferred class
    DISPENSER [G]

General
    cluster: base.structures.dispenser
    description:
        "Dispensers: containers for which clients have no say
        as to what item they can access at a given time.
        Examples include stacks and queues."

Ancestors
    ACTIVE [G]
    FINITE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    prune (v: G)
    prune_all (v: G)
    put (v: [like item] G)
    remove
    replace (v: G)
    wipe_out

Constraints
    readable definition
    writable definition


DISPENSER Flat contracts

indexing
    description: "[
            Dispensers: containers for which clients have no say
            as to what item they can access at a given time.
            Examples include stacks and queues.
    ]"
    status: "See notice at end of class"
    names: dispenser, active
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    DISPENSER [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)

    extend (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.

    put (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DISPENSER


HEAP_PRIORITY_QUEUE Chart

class
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

General
    cluster: base.structures.dispenser
    description: "Priority queues implemented as heaps"
    create: make

Ancestors
    ARRAY [G]
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] HEAP_PRIORITY_QUEUE [G]
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] HEAP_PRIORITY_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    Prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] HEAP_PRIORITY_QUEUE [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    make (n: INTEGER)
    prune (v: G)
    prune_all (v: G)
    put (v: [like item] G)
    remove

Constraints
    empty means storage empty


HEAP_PRIORITY_QUEUE Flat contracts

indexing
    description: "Priority queues implemented as heaps"
    status: "See notice at end of class"
    names: sorted_priority_queue, dispenser, heap
    representation: heap
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    HEAP_PRIORITY_QUEUE [G -> COMPARABLE]

create

    make (n: INTEGER)
            -- Allocate heap space.

feature -- Initialization

    make (n: INTEGER)
            -- Allocate heap space.

feature -- Access

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Entry at top of heap.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))
        ensure then
            count_definition: Result.count = count

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Prunable: BOOLEAN is True
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of put.

    put (v: like item)
            -- Insert item v at its proper position.
            -- Was declared in HEAP_PRIORITY_QUEUE as synonym of force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

feature -- Removal

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove item of highest value.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (Sorted according to decreasing priority)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- New priority queue containing the n greatest items

feature -- Inapplicable

    extend (v: G)
            -- Add v to structure.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    prune (v: G)
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable

invariant

    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HEAP_PRIORITY_QUEUE


LINKED_PRIORITY_QUEUE Chart

class
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

General
    cluster: base.structures.dispenser
    description: "Priority queues implemented as sorted lists"
    create: make

Ancestors
    PRIORITY_QUEUE [G -> PART_COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_PRIORITY_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    make
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out


LINKED_PRIORITY_QUEUE Flat contracts

indexing
    description: "Priority queues implemented as sorted lists"
    status: "See notice at end of class"
    names: priority_queue, queue
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_PRIORITY_QUEUE [G -> COMPARABLE]

create

    make
            -- Allocate heap space.

feature -- Initialization

    make
            -- Allocate heap space.

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Entry at top of heap.
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like sl_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like sl_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like sl_item)
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: sl_item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like sl_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Insert item v at its proper position.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: like sl_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like sl_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like sl_item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item of highest value.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (sl_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_PRIORITY_QUEUE


LINKED_QUEUE Chart

class
    LINKED_QUEUE [G]

General
    cluster: base.structures.dispenser
    description: "Unbounded queues implemented as linked lists"
    create: make

Ancestors
    LINKED_LIST [G]
    QUEUE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] LINKED_QUEUE [G]
    Extendible: BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_QUEUE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_QUEUE [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    force (v: G)
    make
    put (v: G)
    remove
    replace (v: [like item] G)
    wipe_out

Constraints
    is always after


LINKED_QUEUE Flat contracts

indexing
    description: "Unbounded queues implemented as linked lists"
    status: "See notice at end of class"
    names: linked_queue, dispenser, linked_list
    representation: linked
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_QUEUE [G]

create

    make
            -- Create linked queue.

feature -- Initialization

    make
            -- Create linked queue.

feature -- Access

    has (v: like ll_item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Oldest item
        require -- from ACTIVE
            readable: readable
        ensure then
            last_element_if_not_empty: not is_empty implies (active = last_element)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of put and extend.
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    put (v: G)
            -- Add v as newest item.
            -- Was declared in LINKED_QUEUE as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            single_item_constraint: (old is_empty) implies (item = v)

    replace (v: like ll_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (order is same as original order of insertion)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- New queue containing the n oldest items in current queue.
            -- If n is greater than count, identical to current queue.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

invariant

    is_always_after: not is_empty implies after
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (ll_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_QUEUE


LINKED_STACK Chart

class
    LINKED_STACK [G]

General
    cluster: base.structures.dispenser
    description: "Unbounded stacks implemented as linked lists"
    create: make

Ancestors
    LINKED_LIST [G]
    STACK [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] LINKED_STACK [G]
    Extendible: BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_STACK [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: ARRAYED_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_STACK [G])
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    make
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out


LINKED_STACK Flat contracts

indexing
    description: "Unbounded stacks implemented as linked lists"
    status: "See notice at end of class"
    names: linked_stack, dispenser, linked_list
    representation: linked
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_STACK [G]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature  -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    has (v: like ll_item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Item at the first position
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like ll_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Push v onto top.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STACK
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from STACK)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v onto top.
        require -- from  DISPENSER
            True
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from STACK
            item_pushed: item = v
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from STACK
            item_pushed: item = v

    replace (v: like ll_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove item on top.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
            -- (order is reverse of original order of insertion)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- New stack containing the n latest items inserted
            -- in current stack.
            -- If n is greater than count, identical to current stack.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require else
            positive_argument: n > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (ll_item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_STACK


PRIORITY_QUEUE Chart

deferred class
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

General
    cluster: base.structures.dispenser
    description: "Priority queues, without commitment to a particular representation"

Ancestors
    DISPENSER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    prune (v: G)
    prune_all (v: G)
    put (v: [like item] G)
    remove
    replace (v: G)
    wipe_out


PRIORITY_QUEUE Flat contracts

indexing
    description: "Priority queues, without commitment to a particular representation"
    status: "See notice at end of class"
    names: priority_queue, dispenser
    access: fixed, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    PRIORITY_QUEUE [G -> PART_COMPARABLE]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and put.
            -- (from DISPENSER)

    put (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIORITY_QUEUE


QUEUE Chart

deferred class
    QUEUE [G]

General
    cluster: base.structures.dispenser
    description:
        "Queues (first-in, first-out dispensers), without commitment
        to a particular representation"

Ancestors
    DISPENSER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    force (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: G)
    wipe_out


QUEUE Flat contracts

indexing
    description: "[
        Queues (first-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: queue, dispenser
    access: fixed, fifo, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    QUEUE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of force and put.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v as newest item.

    put (v: like item)
            -- Add item v.
            -- Was declared in DISPENSER as synonym of extend and force.
            -- (from DISPENSER)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class QUEUE


STACK Chart

deferred class
    STACK [G]

General
    cluster: base.structures.dispenser
    description:
        "Stacks (last-in, first-out dispensers), without commitment
        to a particular representation"

Ancestors
    DISPENSER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: LINEAR [G])
    force (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: [like item] G)
    wipe_out


STACK Flat contracts

indexing
    description: "[
        Stacks (last-in, first-out dispensers), without commitment
        to a particular representation
    ]"
    status: "See notice at end of class"
    names: stack, dispenser
    access: fixed, lifo, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    STACK [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
            -- (from ACTIVE)
        require -- from ACTIVE
            readable: readable

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BAG)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from DISPENSER)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from DISPENSER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (Synonym for fill)
            -- (from DISPENSER)

    extend (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of force and put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            item_pushed: item = v

    fill (other: LINEAR [G])
            -- Fill with as many items of other as possible.
            -- Fill items with greatest index from other first.
            -- Items inserted with lowest index (from other) will
            -- always be on the top of stack.
            -- The representations of other and current structure
            -- need not be the same.
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and put.
        ensure then
            item_pushed: item = v

    put (v: like item)
            -- Push v onto top.
            -- Was declared in STACK as synonym of extend and force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            item_pushed: item = v

    replace (v: like item)
            -- Replace top item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DISPENSER
    readable_definition: readable = not is_empty
    writable_definition: writable = not is_empty
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STACK


cluster base.structures.iteration

Cluster
    base.structures.iteration

Supercluster
    base.structures

Classes
    CURSOR_TREE_ITERATOR [G]
    ITERATOR [G]
    LINEAR_ITERATOR [G]
    TWO_WAY_CHAIN_ITERATOR [G]


CURSOR_TREE_ITERATOR Chart

class
    CURSOR_TREE_ITERATOR [G]

General
    cluster: base.structures.iteration
    description:
        "Objects that are able to iterate over cursor trees,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others."

Ancestors
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]

Queries
    breadth_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    breadth_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    exhausted: BOOLEAN
    internal_item_tuple: TUPLE [G]
    invariant_value: BOOLEAN
    item: G
    item_tuple: TUPLE [G]
    off: BOOLEAN
    post_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    post_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    pre_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    pre_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    target: CURSOR_TREE [G]

Commands
    breadth_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    breadth_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    breadth_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    breadth_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    breadth_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_forth
    breadth_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    breadth_start
    breadth_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    breadth_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    post_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    post_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    post_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    post_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_forth
    post_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    post_start
    post_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    post_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    pre_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    pre_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_do_all (action: PROCEDURE [ANY, TUPLE [G]])
    pre_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    pre_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_forth
    pre_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    pre_start
    pre_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    pre_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    set (s: [like target] CURSOR_TREE [G])
    start
    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])


CURSOR_TREE_ITERATOR Flat contracts

indexing
    description: "[
        Objects that are able to iterate over cursor trees,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, cursor_tree_iterators, cursor_tree_iteration, tree_iterators, tree_iteration
    exploration: depth_first, breadth_first
    traversal: preorder, postorder, inorder
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    CURSOR_TREE_ITERATOR [G]

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Access

    item: G
            -- The item at cursor position in target
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            traversable_exists: target /= void

    item_tuple: TUPLE [G]
            -- Tuple containing a single element,
            -- the item at cursor position in target''
            -- (from LINEAR_ITERATOR)

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)

    target: CURSOR_TREE [G]
            -- The structure to which iteration features will apply

feature -- Cursor movement

    breadth_forth
            -- Move cursor of target to next position in breadth-first.

    breadth_start
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of pre_start.

    exhausted: BOOLEAN
            -- Is target exhausted?
            -- (from LINEAR_ITERATOR)

    off: BOOLEAN
            -- Is position of target off?
            -- (from LINEAR_ITERATOR)

    post_forth
            -- Move cursor of target to next position in postorder.

    post_start
            -- Move cursor of target to first position in postorder.

    pre_forth
            -- Move cursor of target to next position in preorder.

    pre_start
            -- Move cursor of target to root position
            -- (first position in preorder and breadth-first).
            -- Was declared in CURSOR_TREE_ITERATOR as synonym of breadth_start.

    start
            -- Move to first position of target.
            -- (from LINEAR_ITERATOR)

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target
            -- (from LINEAR_ITERATOR)

feature -- Iteration

    post_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    breadth_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    pre_continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    post_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    breadth_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    pre_continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    breadth_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    post_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    post_continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    post_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    pre_do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    pre_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    post_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    breadth_do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    breadth_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    pre_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    post_do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    post_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    breadth_do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    post_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    pre_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    post_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    breadth_for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    post_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    breadth_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    pre_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    breadth_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    post_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    pre_there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    post_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    pre_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    breadth_until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    post_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    pre_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    post_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    pre_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    breadth_while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_ITERATOR
    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ITERATOR
    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR_TREE_ITERATOR


ITERATOR Chart

deferred class
    ITERATOR [G]

General
    cluster: base.structures.iteration
    description:
        "Objects that are able to iterate over traversable structures,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others."

Ancestors
    ANY

Queries
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    invariant_value: BOOLEAN
    target: TRAVERSABLE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    set (s: [like target] TRAVERSABLE [G])
    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])

Constraints
    traversable exists


ITERATOR Flat contracts

indexing
    description: "[
        Objects that are able to iterate over traversable structures,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ITERATOR [G]

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
        require
            target_exists: s /= void
        ensure
            target = s
            target /= void

feature -- Access

    target: TRAVERSABLE [G]
            -- The structure to which iteration features will apply

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
        require
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
        require
            action_exists: action /= void
            test_exists: test /= void

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (Apply to full list if no item satisfies test).
        require
            action_exists: action /= void
            test_exists: test /= void

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (Apply to full list if all items satisfy test).
        require
            action_exists: action /= void
            test_exists: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items of target?
        require
            test_exists: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item of target?
        require
            test_exists: test /= void

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying not test.
            -- (Apply to full list if all items satisfy test.)
        require
            action_exists: action /= void
            test_exists: test /= void

invariant

    traversable_exists: target /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ITERATOR


LINEAR_ITERATOR Chart

class
    LINEAR_ITERATOR [G]

General
    cluster: base.structures.iteration
    description: "Objects that are able to iterate over linear structures"
    create: set

Ancestors
    ITERATOR [G]

Queries
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    internal_item_tuple: TUPLE [G]
    invariant_value: BOOLEAN
    item: G
    item_tuple: TUPLE [G]
    off: BOOLEAN
    target: LINEAR [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    forth
    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    set (s: [like target] LINEAR [G])
    start
    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])

Constraints
    target exists
    item tuple exists
    internal item tuple exists


LINEAR_ITERATOR Flat contracts

indexing
    description: "Objects that are able to iterate over linear structures"
    status: "See notice at end of class"
    names: iterators, iteration, linear_iterators, linear_iteration
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    LINEAR_ITERATOR [G]

create

    set (s: like target)
            -- Make s the new target of iterations.
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Access

    item: G
            -- The item at cursor position in target
        require
            traversable_exists: target /= void

    item_tuple: TUPLE [G]
            -- Tuple containing a single element,
            -- the item at cursor position in target''

    target: LINEAR [G]
            -- The structure to which iteration features will apply.

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)

feature -- Cursor movement

    exhausted: BOOLEAN
            -- Is target exhausted?

    forth
            -- Move to next position of target.

    off: BOOLEAN
            -- Is position of target off?

    start
            -- Move to first position of target.

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target

feature -- Iteration

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
        require
            valid_repetition: n >= 0
            valid_skip: k >= 1

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
        ensure then
            found: not exhausted = (b = test.item (item_tuple))

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
        require
            invariant_satisfied: invariant_value
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
        require else
            invariant_satisfied: invariant_value
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
        require
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
        require -- from ITERATOR
            test_exists: test /= void

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
        require -- from ITERATOR
            test_exists: test /= void

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
        require
            invariant_satisfied: invariant_value
        ensure
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            achieved: not exhausted implies test.item (item_tuple)

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
        ensure
            finished: not exhausted implies not test.item (item_tuple)

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then
            finished: not exhausted implies not test.item (item_tuple)

invariant

    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ITERATOR
    traversable_exists: target /= void

end -- class LINEAR_ITERATOR


TWO_WAY_CHAIN_ITERATOR Chart

class
    TWO_WAY_CHAIN_ITERATOR [G]

General
    cluster: base.structures.iteration
    description:
        "Objects that are able to iterate over two-way chains,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others."

Ancestors
    LINEAR_ITERATOR [G]
    LINEAR_ITERATOR [G]

Queries
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    for_all_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    internal_item_tuple: TUPLE [G]
    invariant_value: BOOLEAN
    item: G
    item_tuple: TUPLE [G]
    off: BOOLEAN
    target: CHAIN [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    there_exists_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    back
    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    continue_for_back (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    continue_search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    continue_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_all_back (action: PROCEDURE [ANY, TUPLE [G]])
    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    do_for_back (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_if_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    do_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
    set (s: [like target] CHAIN [G])
    start
    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    until_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    while_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])


TWO_WAY_CHAIN_ITERATOR Flat contracts

indexing
    description: "[
        Objects that are able to iterate over two-way chains,
        on which they can perform repeated actions and tests according
        to a number of predefined control structures such as ``if'',
        ``until'' and others.
    ]"
    status: "See notice at end of class"
    names: iterators, iteration, two_way_chain_iterators, two_way_chain_iteration
    traversal: sequential
    exploration: forward, backward
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    TWO_WAY_CHAIN_ITERATOR [G]

feature -- Initialization

    set (s: like target)
            -- Make s the new target of iterations.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            target_exists: s /= void
        ensure -- from ITERATOR
            target = s
            target /= void

feature -- Access

    item: G
            -- The item at cursor position in target
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            traversable_exists: target /= void

    item_tuple: TUPLE [G]
            -- Tuple containing a single element,
            -- the item at cursor position in target''
            -- (from LINEAR_ITERATOR)

    target: CHAIN [G]

feature -- Status report

    invariant_value: BOOLEAN
            -- Is the invariant satisfied?
            -- (Redefinitions of this feature will usually involve
            -- target; if so, make sure that the result is defined
            -- when `target = Void'.)
            -- (from ITERATOR)

feature -- Cursor movement

    back
            -- Move cursor of target backward one position.

    exhausted: BOOLEAN
            -- Is target exhausted?
            -- (from LINEAR_ITERATOR)

    finish
            -- Move cursor of target to last position.

    forth
            -- Move to next position of target.
            -- (from LINEAR_ITERATOR)

    off: BOOLEAN
            -- Is position of target off?
            -- (from LINEAR_ITERATOR)

    start
            -- Move to first position of target.
            -- (from LINEAR_ITERATOR)

feature -- Implementation

    internal_item_tuple: TUPLE [G]
            -- Field holding the last item of target
            -- (from LINEAR_ITERATOR)

feature -- Iteration

    continue_for_back (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    continue_for (action: PROCEDURE [ANY, TUPLE [G]]; n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_repetition: n >= 0
            valid_skip: k >= 1

    continue_search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    continue_search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target
            -- satisfying: test equals to b
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        ensure then -- from LINEAR_ITERATOR
            found: not exhausted = (b = test.item (item_tuple))

    continue_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    continue_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    continue_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    continue_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test
            -- (from the current position of target).
            -- (from LINEAR_ITERATOR)
        require else -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    do_all_back (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item of target.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void

    do_for_back (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    do_for (action: PROCEDURE [ANY, TUPLE [G]]; i, n, k: INTEGER)
            -- Apply action to every k-th item,
            -- n times if possible, starting from i-th.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            valid_start: i >= 1
            valid_repetition: n >= 0
            valid_skip: k >= 1

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    do_if_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target satisfying test.
            -- (from ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void

    do_until_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    do_until (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    do_while (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    do_while_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- and including first one not satisfying test.
            -- (from the start of target)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    for_all_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- all items of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    search (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    search_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]; b: BOOLEAN)
            -- Search the first item of target for which test
            -- has the same value as b (both true or both false).
            -- (from LINEAR_ITERATOR)

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    there_exists_back (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Does test return true for
            -- at least one item of target?
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            test_exists: test /= void

    until_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    until_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target from current
            -- position, up to but excluding first one satisfying test.
            -- (from LINEAR_ITERATOR)
        require -- from LINEAR_ITERATOR
            invariant_satisfied: invariant_value
        ensure -- from LINEAR_ITERATOR
            achieved: exhausted or else test.item (item_tuple)
            invariant_satisfied: invariant_value

    until_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    until_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one satisfying test.
            -- (Apply to full list if no item satisfies test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            achieved: not exhausted implies test.item (item_tuple)

    while_continue (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    while_continue_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (from LINEAR_ITERATOR)
        ensure -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    while_do_back (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

    while_do (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item of target up to
            -- but excluding first one not satisfying test.
            -- (Apply to full list if all items satisfy test.)
            -- (from LINEAR_ITERATOR)
        require -- from ITERATOR
            action_exists: action /= void
            test_exists: test /= void
        ensure then -- from LINEAR_ITERATOR
            finished: not exhausted implies not test.item (item_tuple)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_ITERATOR
    target_exists: target /= void
    item_tuple_exists: item_tuple /= void
    internal_item_tuple_exists: internal_item_tuple /= void
        -- from ITERATOR
    traversable_exists: target /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CHAIN_ITERATOR


cluster base.structures.list

Cluster
    base.structures.list

Supercluster
    base.structures

Classes
    ARRAYED_CIRCULAR [G]
    ARRAYED_LIST [G]
    BI_LINKABLE [G]
    CELL [G]
    CHAIN [G]
    CIRCULAR [G]
    DYNAMIC_CHAIN [G]
    DYNAMIC_CIRCULAR [G]
    DYNAMIC_LIST [G]
    FIXED_LIST [G]
    LINKABLE [G]
    LINKED_CIRCULAR [G]
    LINKED_LIST [G]
    LIST [G]
    MULTI_ARRAY_LIST [G]
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]
    SEQUENCE [G]
    SORTED_LIST [G -> COMPARABLE]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]
    TWO_WAY_CIRCULAR [G]
    TWO_WAY_LIST [G]


ARRAYED_CIRCULAR Chart

class
    ARRAYED_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains implemented by resizable arrays"
    create: make

Ancestors
    DYNAMIC_CIRCULAR [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] ARRAYED_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_CIRCULAR [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (n: INTEGER)
    merge_left (other: [like Current] ARRAYED_CIRCULAR [G])
    merge_right (other: [like Current] ARRAYED_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    non negative count
    valid starter


ARRAYED_CIRCULAR Flat contracts

indexing
    description: "Circular chains implemented by resizable arrays"
    status: "See notice at end of class"
    names: arrayed_circular, ring, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAYED_CIRCULAR [G]

create

    make (n: INTEGER)
            -- Create a circular chain with n items.
        require
            at_least_one: n >= 1

feature -- Initialization

    make (n: INTEGER)
            -- Create a circular chain with n items.
        require
            at_least_one: n >= 1

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor on first item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor on last item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be written?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Select current item as the first.
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move to position currently selected as first.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor except if it was off.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_count: count >= 0
    valid_starter: starter >= 0 and starter <= count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_CIRCULAR


ARRAYED_LIST Chart

class
    ARRAYED_LIST [G]

General
    cluster: base.structures.list
    description: "Lists implemented by resizable arrays"
    create: make_from_array, make_filled, make

Ancestors
    ARRAY [G]
    DYNAMIC_LIST [G]

Queries
    infix "@" (i: INTEGER): G
    after: BOOLEAN
    before: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] ARRAYED_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (n: INTEGER)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [G])
    merge_left (other: ARRAYED_LIST [G])
    merge_right (other: ARRAYED_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like first] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    prunable
    starts from one
    empty means storage empty


ARRAYED_LIST Flat contracts

indexing
    description: "Lists implemented by resizable arrays"
    status: "See notice at end of class"
    names: sequence
    representation: array
    access: index, cursor, membership
    size: fixed
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAYED_LIST [G]

create

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [G])
            -- Create list from array a.
        require -- from ARRAY
            array_exists: a /= void

feature -- Initialization

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
        require
            valid_number_of_items: n >= 0
        ensure
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [G])
            -- Create list from array a.
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor one position backward.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [G])
            -- Merge other into current structure before cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [G])
            -- Merge other into current structure after cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST


BI_LINKABLE Chart

class
    BI_LINKABLE [G]

General
    cluster: base.structures.list
    description: "Linkable cells with a reference to the left and right neighbors"

Ancestors
    LINKABLE [G]

Queries
    item: G
    left: [like Current] BI_LINKABLE [G]
    right: [like Current] BI_LINKABLE [G]

Commands
    replace (v: [like item] G)

Constraints
    right symmetry
    left symmetry


BI_LINKABLE Flat contracts

indexing
    description: "Linkable cells with a reference to the left and right neighbors"
    status: "See notice at end of class"
    names: bi_linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    BI_LINKABLE [G]

feature -- Access

    left: like Current
            -- Left neighbor

    right: like Current
            -- Right neighbor
            -- (from LINKABLE)

feature  -- Access

    item: G
            -- Content of cell.
            -- (from CELL)

feature -- Element change

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        ensure -- from CELL
            item_inserted: item = v

invariant

    right_symmetry: (right /= void) implies (right.left = Current)
    left_symmetry: (left /= void) implies (left.right = Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BI_LINKABLE


CELL Chart

class
    CELL [G]

General
    cluster: base.structures.list
    description: "Cells containing an item"
    create: put

Ancestors
    ANY

Queries
    item: G

Commands
    put (v: [like item] G)
    replace (v: [like item] G)


CELL Flat contracts

indexing
    description: "Cells containing an item"
    status: "See notice at end of class"
    names: cell
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    CELL [G]

create

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
        ensure
            item_inserted: item = v

feature -- Access

    item: G
            -- Content of cell.

feature -- Element change

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
        ensure
            item_inserted: item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
        ensure
            item_inserted: item = v

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CELL


CHAIN Chart

deferred class
    CHAIN [G]

General
    cluster: base.structures.list
    description:
        "Possibly circular sequences of items,
        without commitment to a particular representation"

Ancestors
    CURSOR_STRUCTURE [G]
    INDEXABLE [G, H -> INTEGER]
    SEQUENCE [G]
    SEQUENCE [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] CHAIN [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    non negative index
    index small enough
    off definition
    isfirst definition
    islast definition
    item corresponds to index
    index set has same count


CHAIN Flat contracts

indexing
    description: "[
        Possibly circular sequences of items,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CHAIN [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
        require
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
        require
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
        ensure
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
        ensure
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
        ensure
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
        ensure then
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require
            valid_cursor_index: valid_cursor_index (i)
        ensure
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
        ensure
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
        ensure then
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
        require
            not_off: not off
            valid_index: valid_index (i)
        ensure
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CHAIN


CIRCULAR Chart

deferred class
    CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains, without commitment to a particular representation"

Ancestors
    CHAIN [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] CIRCULAR [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    not before unless empty
    not after unless empty
    not off unless empty


CIRCULAR Flat contracts

indexing
    description: "Circular chains, without commitment to a particular representation"
    status: "See notice at end of class"
    names: circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CIRCULAR [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: G
            -- Item at position currently defined as first
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
        ensure then
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
        ensure then
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
        ensure then
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
        require -- from LINEAR
            not_after: not after
        ensure then
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Define current position as the first.
        require
            not_empty: not is_empty

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR


DYNAMIC_CHAIN Chart

deferred class
    DYNAMIC_CHAIN [G]

General
    cluster: base.structures.list
    description: "Dynamically modifiable chains"

Ancestors
    CHAIN [G]
    UNBOUNDED [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] DYNAMIC_CHAIN [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] DYNAMIC_CHAIN [G])
    merge_right (other: [like Current] DYNAMIC_CHAIN [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    extendible


DYNAMIC_CHAIN Flat contracts

indexing
    description: "Dynamically modifiable chains"
    status: "See notice at end of class"
    names: dynamic_chain, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    DYNAMIC_CHAIN [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning.
            -- Do not move cursor.
        ensure
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_before: not before
        ensure
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require
            extendible: extendible
            not_after: not after
        ensure
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            left_exists: index > 1
        ensure
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            right_exists: index < count
        ensure
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature  -- Inapplicable

    remove
            -- Remove current item.
            -- (from CHAIN)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    extendible: extendible
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CHAIN


DYNAMIC_CIRCULAR Chart

deferred class
    DYNAMIC_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Dynamically modifiable circular chains"

Ancestors
    CIRCULAR [G]
    DYNAMIC_CHAIN [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] DYNAMIC_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] DYNAMIC_CIRCULAR [G])
    merge_right (other: [like Current] DYNAMIC_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out


DYNAMIC_CIRCULAR Flat contracts

indexing
    description: "Dynamically modifiable circular chains"
    status: "See notice at end of class"
    names: dynamic_circular, ring, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    DYNAMIC_CIRCULAR [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Define current position as the first.
            -- (from CIRCULAR)
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_CIRCULAR


DYNAMIC_LIST Chart

deferred class
    DYNAMIC_LIST [G]

General
    cluster: base.structures.list
    description:
        "Sequential, dynamically modifiable lists,
        without commitment to a particular representation"

Ancestors
    DYNAMIC_CHAIN [G]
    DYNAMIC_CHAIN [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] DYNAMIC_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] DYNAMIC_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] DYNAMIC_LIST [G])
    merge_right (other: [like Current] DYNAMIC_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out


DYNAMIC_LIST Flat contracts

indexing
    description: "[
        Sequential, dynamically modifiable lists,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: dynamic_list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    DYNAMIC_LIST [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning.
            -- Do not move cursor.
            -- (from DYNAMIC_CHAIN)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_LIST


FIXED_LIST Chart

class
    FIXED_LIST [G]

General
    cluster: base.structures.list
    description: "Lists with fixed maximum numbers of items, implemented by arrays"
    create: make_filled, make

Ancestors
    ARRAY [G]
    FIXED [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): G
    after: BOOLEAN
    area: SPECIAL [G]
    before: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] FIXED_LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] FIXED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    Resizable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] FIXED_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    finish
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (n: INTEGER)
    make_filled (n: INTEGER)
    move (i: INTEGER)
    put (v: [like first] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove
    replace (v: [like first] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)

Constraints
    empty means storage empty


FIXED_LIST Flat contracts

indexing
    description: "Lists with fixed maximum numbers of items, implemented by arrays"
    status: "See notice at end of class"
    names: fixed, sequence
    representation: array
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    FIXED_LIST [G]

create

    make (n: INTEGER)
            -- Create an empty list.
        ensure
            is_before: before
            new_count: count = 0

    make_filled (n: INTEGER)
            -- Create a list with n void elements.
        ensure
            is_before: before
            new_count: count = n

feature -- Initialization

    make (n: INTEGER)
            -- Create an empty list.
        ensure
            is_before: before
            new_count: count = 0

    make_filled (n: INTEGER)
            -- Create a list with n void elements.
        ensure
            is_before: before
            new_count: count = n

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Current position in the list

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    i_th (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    last: like first
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?

    full: BOOLEAN
            -- Is the list full?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)
            -- (from FIXED)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Is p a valid cursor?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to element remembered in p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Move index to the current item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like first)
            -- Replace current item by v.
            -- (Synonym for replace)
        require -- from COLLECTION
            extendible: extendible
        require else
            True
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    replace (v: like first)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    empty_means_storage_empty: is_empty implies all_default
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FIXED
    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_LIST


LINKABLE Chart

class
    LINKABLE [G]

General
    cluster: base.structures.list
    description: "Linkable cells containing a reference to their right neighbor"

Ancestors
    CELL [G]

Queries
    item: G
    right: [like Current] LINKABLE [G]

Commands
    replace (v: [like item] G)


LINKABLE Flat contracts

indexing
    description: "Linkable cells containing a reference to their right neighbor"
    status: "See notice at end of class"
    names: linkable, cell
    representation: linked
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKABLE [G]

feature -- Access

    right: like Current
            -- Right neighbor

feature  -- Access

    item: G
            -- Content of cell.
            -- (from CELL)

feature -- Element change

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        ensure -- from CELL
            item_inserted: item = v

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKABLE


LINKED_CIRCULAR Chart

class
    LINKED_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains implemented as linked lists"
    create: make

Ancestors
    DYNAMIC_CIRCULAR [G]
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LINKED_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_CIRCULAR [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] LINKED_CIRCULAR [G])
    merge_right (other: [like Current] LINKED_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out


LINKED_CIRCULAR Flat contracts

indexing
    description: "Circular chains implemented as linked lists"
    status: "See notice at end of class"
    names: linked_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_CIRCULAR [G]

create

    make
            -- Create an empty list

feature -- Initialization

    make
            -- Create an empty list

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor on first item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor on last item?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be written?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Select current item as the first.
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move to position currently selected as first.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_CIRCULAR


LINKED_LIST Chart

class
    LINKED_LIST [G]

General
    cluster: base.structures.list
    description: "Sequential, one-way linked lists"
    create: make

Ancestors
    DYNAMIC_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LINKED_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] LINKED_LIST [G])
    merge_right (other: [like Current] LINKED_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    prunable
    empty constraint
    not void unless empty
    before constraint
    after constraint


LINKED_LIST Flat contracts

indexing
    description: "Sequential, one-way linked lists"
    status: "See notice at end of class"
    names: linked_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_LIST [G]

create

    make
            -- Create an empty list.
        ensure
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
        ensure
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position

    first: like item
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?

    isfirst: BOOLEAN
            -- Is cursor at first position?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST


LIST Chart

deferred class
    LIST [G]

General
    cluster: base.structures.list
    description: "Sequential lists, without commitment to a particular representation"

Ancestors
    CHAIN [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    before definition
    after definition


LIST Flat contracts

indexing
    description: "Sequential lists, without commitment to a particular representation"
    status: "See notice at end of class"
    names: list, sequence
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    LIST [G]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require -- from LINEAR
            not_after: not after
        ensure then
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LIST


MULTI_ARRAY_LIST Chart

class
    MULTI_ARRAY_LIST [G]

General
    cluster: base.structures.list
    description:
        "Lists implemented as sequences of arrays, the last of which may
        be non-full. No limit on size (a new array is allocated if list
        outgrows its initial allocation)."
    create: make

Ancestors
    DYNAMIC_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    block_size: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] MULTI_ARRAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [ARRAYED_LIST [G]]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] MULTI_ARRAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: BI_LINKABLE [ARRAYED_LIST [G]]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make (b: INTEGER)
    merge_left (other: [like Current] MULTI_ARRAY_LIST [G])
    merge_right (other: [like Current] MULTI_ARRAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    writable definition
    readable definition
    extendible definition


MULTI_ARRAY_LIST Flat contracts

indexing
    description: "[
        Lists implemented as sequences of arrays, the last of which may
        be non-full. No limit on size (a new array is allocated if list
        outgrows its initial allocation).
    ]"
    status: "See notice at end of class"
    names: list, sequence
    representation: array, linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    MULTI_ARRAY_LIST [G]

create

    make (b: INTEGER)
            -- Create an empty list, setting block_size to b

feature -- Initialization

    make (b: INTEGER)
            -- Create an empty list, setting block_size to b

feature -- Access

    block_size: INTEGER

    cursor: CURSOR
            -- Current cursor position

    first: like item
            -- Item at first position
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- First array_sequence element of the list

    has (v: like item): BOOLEAN
            -- Does list include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at cursor position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
        require -- from CHAIN
            not_empty: not is_empty

    last_element: BI_LINKABLE [ARRAYED_LIST [G]]
            -- Last array_sequence element of the list

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move cursor to first position (at or after current
            -- cursor position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at the beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    writable_definition: writable = not off
    readable_definition: readable = not off
    extendible_definition: extendible
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTI_ARRAY_LIST


PART_SORTED_LIST Chart

deferred class
    PART_SORTED_LIST [G -> PART_COMPARABLE]

General
    cluster: base.structures.list
    description:
        "Sequential lists whose items are sorted in ascending order
        according to the relational operators of PART_COMPARABLE"

Ancestors
    LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] PART_SORTED_LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] PART_SORTED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge (other: LINEAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out


PART_SORTED_LIST Flat contracts

indexing
    description: "[
        Sequential lists whose items are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    PART_SORTED_LIST [G -> PART_COMPARABLE]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
        ensure
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
        ensure
            (not off) implies (item <= v)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    sorted: BOOLEAN

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
        ensure then
            remains_sorted: (old sorted) implies sorted

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_LIST


PART_SORTED_TWO_WAY_LIST Chart

class
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

General
    cluster: base.structures.list
    description: "Two-way lists, kept sorted"
    create: make

Ancestors
    PART_SORTED_LIST [G -> PART_COMPARABLE]
    TWO_WAY_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] PART_SORTED_TWO_WAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] PART_SORTED_TWO_WAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    sublist: [like Current] PART_SORTED_TWO_WAY_LIST [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] PART_SORTED_TWO_WAY_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge (other: LINEAR [G])
    merge_left (other: [like Current] PART_SORTED_TWO_WAY_LIST [G])
    merge_right (other: [like Current] PART_SORTED_TWO_WAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    sort
    split (n: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out


PART_SORTED_TWO_WAY_LIST Flat contracts

indexing
    description: "Two-way lists, kept sorted"
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    sorted: BOOLEAN
            -- is the structures topologically sorted
            -- i.e i < j implies not i_th (i) > i_th (j)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    sort
            -- sort the list
            -- Has O(count * log (count)) complexity.

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_TWO_WAY_LIST


SEQUENCE Chart

deferred class
    SEQUENCE [G]

General
    cluster: base.structures.list
    description:
        "Finite sequences: structures where existing items are arranged
        and accessed sequentially, and new ones can be added at the end."

Ancestors
    ACTIVE [G]
    BILINEAR [G]
    FINITE [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: G)
    search (v: [like item] G)
    start
    wipe_out


SEQUENCE Flat contracts

indexing
    description: "[
        Finite sequences: structures where existing items are arranged
        and accessed sequentially, and new ones can be added at the end.
    ]"
    status: "See notice at end of class"
    names: sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    SEQUENCE [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    off: BOOLEAN
            -- Is there no current item?
            -- (from BILINEAR)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?

    writable: BOOLEAN
            -- Is there a current item that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
        require
            argument_not_void: s /= void
        ensure
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
        require
            extendible: extendible
        ensure then
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Add v to end.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            new_count: count = old count + 1

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SEQUENCE


SORTED_LIST Chart

deferred class
    SORTED_LIST [G -> COMPARABLE]

General
    cluster: base.structures.list
    description:
        "Sequential lists where the cells are sorted in ascending order
        according to the relational operators of PART_COMPARABLE"

Ancestors
    PART_SORTED_LIST [G -> PART_COMPARABLE]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] SORTED_LIST [G]
    exhausted: BOOLEAN
    extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] SORTED_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge (other: LINEAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    replace (v: G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    start
    swap (i: INTEGER)
    wipe_out


SORTED_LIST Flat contracts

indexing
    description: "[
        Sequential lists where the cells are sorted in ascending order
        according to the relational operators of PART_COMPARABLE
    ]"
    status: "See notice at end of class"
    names: sorted_list, sorted_struct, sequence
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    SORTED_LIST [G -> COMPARABLE]

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from CURSOR_STRUCTURE)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index
            -- (from CHAIN)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    max: like item
            -- Maximum item
        require
            not_empty: not is_empty
        ensure
            max_is_last: Result = last

    median: like item
            -- Median item
        require
            not_empty: not is_empty
        ensure
            median_definition: Result = i_th ((count + 1) // 2)

    min: like item
            -- Minimum item
        require
            not_empty: not is_empty
        ensure
            min_is_first: Result = first

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    sorted: BOOLEAN
            -- (from PART_SORTED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from CURSOR_STRUCTURE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from CHAIN)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from CURSOR_STRUCTURE)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the absolute value of i
            -- is too big.
            -- (from CHAIN)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- The cursor ends up on the newly inserted
            -- item.
            -- (from PART_SORTED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_LIST


SORTED_TWO_WAY_LIST Chart

class
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

General
    cluster: base.structures.list
    description: "Two-way lists, kept sorted."
    create: make

Ancestors
    SORTED_LIST [G -> COMPARABLE]
    TWO_WAY_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] SORTED_TWO_WAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] SORTED_TWO_WAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    sublist: [like Current] SORTED_TWO_WAY_LIST [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge (other: LINEAR [G])
    merge_left (other: [like Current] SORTED_TWO_WAY_LIST [G])
    merge_right (other: [like Current] SORTED_TWO_WAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    sort
    split (n: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out


SORTED_TWO_WAY_LIST Flat contracts

indexing
    description: "Two-way lists, kept sorted."
    status: "See notice at end of class"
    names: sorted_two_way_list, sorted_struct, sequence
    representation: linked
    access: index, cursor, membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    max: like item
            -- Maximum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            max_is_last: Result = last

    median: like item
            -- Median item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            median_definition: Result = i_th ((count + 1) // 2)

    min: like item
            -- Minimum item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            min_is_first: Result = first

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    sorted: BOOLEAN
            -- Is the structure sorted?

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Put v at proper position in list.
            -- Move cursor to newly inserted item.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted
            item_inserted: item = v

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: LINEAR [G])
            -- Add all items from other at their proper positions.
            -- (from PART_SORTED_LIST)
        ensure then -- from PART_SORTED_LIST
            remains_sorted: (old sorted) implies sorted

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    sort
            -- Sort all items.
            -- Has O(count * log (count)) complexity.

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_TWO_WAY_LIST


TWO_WAY_CIRCULAR Chart

class
    TWO_WAY_CIRCULAR [G]

General
    cluster: base.structures.list
    description: "Circular chains implemented as two-way linked lists"
    create: make

Ancestors
    LINKED_CIRCULAR [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] TWO_WAY_CIRCULAR [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_CIRCULAR [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like first] G
    linear_representation: LINEAR [G]
    list: TWO_WAY_LIST [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] TWO_WAY_CIRCULAR [G])
    merge_right (other: [like Current] TWO_WAY_CIRCULAR [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: G)
    search (v: [like item] G)
    set_start
    start
    swap (i: INTEGER)
    wipe_out


TWO_WAY_CIRCULAR Flat contracts

indexing
    description: "Circular chains implemented as two-way linked lists"
    status: "See notice at end of class"
    names: two_way_circular, ring, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    TWO_WAY_CIRCULAR [G]

create

    make
            -- Create an empty list
            -- (from LINKED_CIRCULAR)

feature -- Initialization

    make
            -- Create an empty list
            -- (from LINKED_CIRCULAR)

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_CIRCULAR)

    first: G
            -- Item at position currently defined as first
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Current cursor index, with respect to position
            -- currently defined as first
            -- (from CIRCULAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_CIRCULAR)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like first
            -- Item at position currently defined as last
            -- (from CIRCULAR)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_CIRCULAR)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_after: Result = (is_empty and standard_after)

    before: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            empty_and_std_before: Result = (is_empty and standard_before)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from CIRCULAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_CIRCULAR)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor on first item?
            -- (from LINKED_CIRCULAR)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor on last item?
            -- (from LINKED_CIRCULAR)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CIRCULAR)
        ensure then -- from CIRCULAR
            only_when_empty: Result = is_empty

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_CIRCULAR)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_CIRCULAR)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i a possible cursor position?
            -- (from CIRCULAR)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))
        ensure then -- from CIRCULAR
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be written?
            -- (from LINKED_CIRCULAR)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous item, cyclically.
            -- (from CIRCULAR)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next item, cyclically.
            -- (from CIRCULAR)
        require -- from LINEAR
            not_after: not after
        ensure then -- from CIRCULAR
            moved_forth_at_end: (old index = count) implies (index = 1)

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position from current start, cyclically.
            -- (from CIRCULAR)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from CIRCULAR
            index_big_enough: i >= 1
            not_empty: not is_empty
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_CIRCULAR)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor to i-th item from current position,
            -- cyclically.
            -- (from CIRCULAR)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_start
            -- Select current item as the first.
            -- (from LINKED_CIRCULAR)
        require -- from CIRCULAR
            not_empty: not is_empty

    start
            -- Move to position currently selected as first.
            -- (from LINKED_CIRCULAR)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: G)
            -- Replace current item by v.
            -- (from LINKED_CIRCULAR)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove item at cursor position.
            -- Move cursor to right neighbor (cyclically).
            -- If removed item was at current starting position,
            -- move starting position to right neighbor.
            -- (from CIRCULAR)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from LINKED_CIRCULAR
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_CIRCULAR)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        require else -- from LINKED_CIRCULAR
            count > 1
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, count) items.
            -- (from DYNAMIC_CIRCULAR)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Implementation

    list: TWO_WAY_LIST [G]

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from CIRCULAR
    not_before_unless_empty: before implies is_empty
    not_after_unless_empty: after implies is_empty
    not_off_unless_empty: off implies is_empty
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_CIRCULAR


TWO_WAY_LIST Chart

class
    TWO_WAY_LIST [G]

General
    cluster: base.structures.list
    description: "Sequential, two-way linked lists"
    create: make_sublist, make

Ancestors
    LINKED_LIST [G]
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] TWO_WAY_LIST [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sublist: [like Current] TWO_WAY_LIST [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] TWO_WAY_LIST [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] TWO_WAY_LIST [G])
    merge_right (other: [like Current] TWO_WAY_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    split (n: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    non empty list has two endpoints
    first element constraint
    last element constraint


TWO_WAY_LIST Flat contracts

indexing
    description: "Sequential, two-way linked lists"
    status: "See notice at end of class"
    names: two_way_list, sequence
    representation: linked
    access: index, cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    TWO_WAY_LIST [G]

create

    make_sublist (first_item, last_item: like first_element; n: INTEGER)
            -- Create sublist

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    sublist: like Current
            -- Result produced by last split

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous position, if any.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then
            not_after: not after

    forth
            -- Move cursor to next position, if any.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
        require
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_LIST


cluster base.structures.set

Cluster
    base.structures.set

Supercluster
    base.structures

Subclusters
    base.structures.set.strategies

Classes
    ARRAYED_SET [G]
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]
    COMPARABLE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]
    LINKED_SET [G]
    PART_SORTED_SET [G -> PART_COMPARABLE]
    SET [G]
    SUBSET [G]
    TRAVERSABLE_SUBSET [G]
    TWO_WAY_SORTED_SET [G -> COMPARABLE]


ARRAYED_SET Chart

class
    ARRAYED_SET [G]

General
    cluster: base.structures.set
    description: "Sets represented as arrayed lists"
    create: make

Ancestors
    ARRAYED_LIST [G]
    LINEAR_SUBSET [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] ARRAYED_SET [G]
    Extendible: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    islast: BOOLEAN
    item: [like first] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN
    valid_index (i: INTEGER): BOOLEAN

Commands
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_SET [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    forth
    go_i_th (i: INTEGER)
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: CONTAINER [G])
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_left (v: [like item] G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out


ARRAYED_SET Flat contracts

indexing
    description: "Sets represented as arrayed lists"
    status: "See notice at end of class"
    names: arrayed_set, set, arrayed_list
    representation: array
    size: fixed
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.1 $"

class interface
    ARRAYED_SET [G]

create

    make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

feature -- Access

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    extend (v: G)
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Insert v if not present.
            -- Was declared in ARRAYED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_SET


BINARY_SEARCH_TREE_SET Chart

class
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

General
    cluster: base.structures.set
    description: "Sorted sets implemented as binary search trees"
    create: make

Ancestors
    COMPARABLE_SET [G -> COMPARABLE]
    TRAVERSABLE_SUBSET [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): BINARY_SEARCH_TREE_SET [G]
    Extendible: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    max: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    off: BOOLEAN
    Prunable: BOOLEAN

Commands
    back
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    forth
    intersect (other: TRAVERSABLE_SUBSET [G])
    make
    merge (other: CONTAINER [G])
    prune (v: [like item] G)
    prune_all (v: G)
    put (v: [like item] G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Constraints
    comparison mode equal


BINARY_SEARCH_TREE_SET Flat contracts

indexing
    description: "Sorted sets implemented as binary search trees"
    status: "See notice at end of class"
    names: binary_search_tree_set, set, binary_search_tree
    representation: recursive, array
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    BINARY_SEARCH_TREE_SET [G -> COMPARABLE]

create

    make
            -- Create set.

feature -- Initialization

    make
            -- Create set.

feature -- Measurement

    count: INTEGER
            -- Number of items in tree

    item: G
            -- Current item
        require -- from TRAVERSABLE
            not_off: not off
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    max: like item
            -- Maximum item in tree
        require -- from COMPARABLE_SET
            not_empty: not is_empty

    min: like item
            -- Minimum item in tree
        require -- from COMPARABLE_SET
            not_empty: not is_empty

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?

    Extendible: BOOLEAN is True
            -- Can new items be added? (Answer: yes.)

    has (v: like item): BOOLEAN
            -- Is there a node with item v in tree?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    is_empty: BOOLEAN
            -- Is set empty?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- off only if tree is_empty or if
            -- it is before or after.

    Prunable: BOOLEAN is True
            -- Can items be removed? (Answer: yes.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move cursor to previous node.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last node.

    forth
            -- Move cursor to next node.
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after

    start
            -- Move cursor to first node.

feature -- Element change

    extend (v: like item)
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        require else
            item_exists: v /= void
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: like item)
            -- Put v at proper position in set
            -- (unless one already exists).
            -- Was declared in BINARY_SEARCH_TREE_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        require else
            item_exists: v /= void
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): BINARY_SEARCH_TREE_SET [G]
            -- New structure containing min (n, count)
            -- items from current structure
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

    comparison_mode_equal: tree /= void implies object_comparison = tree.object_comparison
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE_SET


COMPARABLE_SET Chart

deferred class
    COMPARABLE_SET [G -> COMPARABLE]

General
    cluster: base.structures.set
    description: "Sets whose items may be compared according to a total order relation"

Ancestors
    COMPARABLE_STRUCT [G -> COMPARABLE]
    SUBSET [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] COMPARABLE_SET [G]
    extendible: BOOLEAN
    has (v: [like item] G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    linear_representation: LINEAR [G]
    max: G
    min: G
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    intersect (other: SUBSET [G])
    merge (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    subtract (other: SUBSET [G])
    symdif (other: SUBSET [G])
    wipe_out


COMPARABLE_SET Flat contracts

indexing
    description: "Sets whose items may be compared according to a total order relation"
    status: "See notice at end of class"
    names: comparable_set, comparable_struct
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    COMPARABLE_SET [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from SET)

    max: G
            -- Maximum item
        require
            not_empty: not is_empty

    min: G
            -- Minimum item
        require
            not_empty: not is_empty

feature -- Comparison

    disjoint (other: SUBSET [G]): BOOLEAN
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: SUBSET [G])
            -- Remove all items not in other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: SUBSET [G])
            -- Remove all items also in other.
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_SET


LINEAR_SUBSET Chart

deferred class
    LINEAR_SUBSET [G]

General
    cluster: base.structures.set
    description:
        "Subsets that are traversable linearly without commitment to a concrete
        implementation."

Ancestors
    TRAVERSABLE_SUBSET [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] LINEAR_SUBSET [G]
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    index: INTEGER
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    islast: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN
    valid_index (n: INTEGER): BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    forth
    go_i_th (i: INTEGER)
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: CONTAINER [G])
    move_item (v: G)
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    put_left (v: G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Constraints
    before definition


LINEAR_SUBSET Flat contracts

indexing
    description: "[
        Subsets that are traversable linearly without commitment to a concrete
        implementation.
    ]"
    status: "See notice at end of class"
    names: linear_subset, subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    LINEAR_SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Current index

    item: G
            -- Current item
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from TRAVERSABLE_SUBSET)

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is cursor behind last item?
            -- (from TRAVERSABLE_SUBSET)

    before: BOOLEAN
            -- Is cursor at left from first item?

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is container empty?
            -- (from TRAVERSABLE_SUBSET)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    islast: BOOLEAN
            -- Is cursor at last item?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is cursor off the active items?
            -- (from TRAVERSABLE_SUBSET)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    valid_index (n: INTEGER): BOOLEAN
            -- Is n a valid index?
        ensure
            index_valid: 0 <= n and n <= count + 1

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor to next element.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_after: not after

    go_i_th (i: INTEGER)
            -- Move cursor to i-th item.
        require
            valid_index: valid_index (i)
        ensure
            cursor_moved: index = i

    start
            -- Move cursor to first item.
            -- (from TRAVERSABLE_SUBSET)

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    move_item (v: G)
            -- Move v to the left of cursor.
        require
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_left (v: G)
            -- Insert v before the cursor.
        require
            item_exists: v /= void
            not_before: not before
        ensure
            cursor_position_unchanged: index = old index + 1

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from TRAVERSABLE_SUBSET)
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

    before_definition: before = (index = 0)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR_SUBSET


LINKED_SET Chart

class
    LINKED_SET [G]

General
    cluster: base.structures.set
    description: "Sets implemented by linked lists"
    create: make

Ancestors
    LINEAR_SUBSET [G]
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] LINKED_SET [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_SET [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    intersect (other: TRAVERSABLE_SUBSET [G])
    make
    merge (other: CONTAINER [G])
    merge_left (other: [like Current] LINKED_SET [G])
    merge_right (other: [like Current] LINKED_SET [G])
    move (i: INTEGER)
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    swap (i: INTEGER)
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out


LINKED_SET Flat contracts

indexing
    description: "Sets implemented by linked lists"
    status: "See notice at end of class"
    names: linked_set, set, linked_list
    representation: linked
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:44 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_SET [G]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: CONTAINER [G])
            -- Add all items of other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in LINKED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_SET


PART_SORTED_SET Chart

class
    PART_SORTED_SET [G -> PART_COMPARABLE]

General
    cluster: base.structures.set
    description:
        "Sets whose items may be compared according to a partial order relation
        implemented as sorted two-way lists."
    create: make

Ancestors
    LINEAR_SUBSET [G]
    PART_SORTED_TWO_WAY_LIST [G -> PART_COMPARABLE]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] PART_SORTED_SET [G]
    Extendible: BOOLEAN
    has (v: G): BOOLEAN
    index: INTEGER
    is_empty: BOOLEAN
    is_equal (other: [like Current] PART_SORTED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    islast: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN
    valid_index (i: INTEGER): BOOLEAN

Commands
    compare_objects
    compare_references
    copy (other: [like Current] PART_SORTED_SET [G])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    forth
    go_i_th (i: INTEGER)
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: TRAVERSABLE_SUBSET [G])
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_left (v: [like item] G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out


PART_SORTED_SET Flat contracts

indexing
    description: "[
        Sets whose items may be compared according to a partial order relation
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

class interface
    PART_SORTED_SET [G -> PART_COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature  -- Cursor movement

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

feature -- Element change

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: TRAVERSABLE_SUBSET [G])
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in PART_SORTED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1

feature -- Removal

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from PART_SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PART_SORTED_SET


SET Chart

deferred class
    SET [G]

General
    cluster: base.structures.set
    description: "Collection, where each element must be unique."

Ancestors
    COLLECTION [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    wipe_out


SET Flat contracts

indexing
    description: "Collection, where each element must be unique."
    status: "See notice at end of class"
    names: set
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    SET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
        ensure then
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SET


cluster base.structures.set.strategies

Cluster
    base.structures.set.strategies

Supercluster
    base.structures.set

Classes
    SUBSET_STRATEGY [G]
    SUBSET_STRATEGY_GENERIC [G]
    SUBSET_STRATEGY_HASHABLE [G]
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]


SUBSET_STRATEGY Chart

deferred class
    SUBSET_STRATEGY [G]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for computing several features of subsets. The computing
        strategy is optimized depending on the type of elements contained in
        the set."

Ancestors
    ANY

Queries
    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN

Commands
    symdif (set1, set2: TRAVERSABLE_SUBSET [G])


SUBSET_STRATEGY Flat contracts

indexing
    description: "[
        Strategies for computing several features of subsets. The computing
        strategy is optimized depending on the type of elements contained in
        the set.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    SUBSET_STRATEGY [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY


SUBSET_STRATEGY_GENERIC Chart

class
    SUBSET_STRATEGY_GENERIC [G]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for calculating several features for subsets containing
        items of any type."

Ancestors
    SUBSET_STRATEGY [G]

Queries
    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN

Commands
    symdif (set1, set2: TRAVERSABLE_SUBSET [G])


SUBSET_STRATEGY_GENERIC Flat contracts

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        items of any type.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.1 $"

class interface
    SUBSET_STRATEGY_GENERIC [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_GENERIC


SUBSET_STRATEGY_HASHABLE Chart

class
    SUBSET_STRATEGY_HASHABLE [G]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for calculating several features for subsets containing
        HASHABLEs."

Ancestors
    SUBSET_STRATEGY [G]

Queries
    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN

Commands
    symdif (set1, set2: TRAVERSABLE_SUBSET [G])


SUBSET_STRATEGY_HASHABLE Flat contracts

indexing
    description: "[
        Strategies for calculating several features for subsets containing
        HASHABLEs.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.1 $"

class interface
    SUBSET_STRATEGY_HASHABLE [G]

feature -- Comparison

    disjoint (set1, set2: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: TRAVERSABLE_SUBSET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_HASHABLE


SUBSET_STRATEGY_TREE Chart

class
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

General
    cluster: base.structures.set.strategies
    description:
        "Strategies for calculating several features for subsets represented
        by binary search trees. Contained items have to be COMPARABLE"

Ancestors
    SUBSET_STRATEGY [G]

Queries
    disjoint (set1, set2: BINARY_SEARCH_TREE_SET [G]): BOOLEAN

Commands
    symdif (set1, set2: BINARY_SEARCH_TREE_SET [G])


SUBSET_STRATEGY_TREE Flat contracts

indexing
    description: "[
        Strategies for calculating several features for subsets represented
        by binary search trees. Contained items have to be COMPARABLE
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.1 $"

class interface
    SUBSET_STRATEGY_TREE [G -> COMPARABLE]

feature -- Comparison

    disjoint (set1, set2: BINARY_SEARCH_TREE_SET [G]): BOOLEAN
            -- Are set1 and set2 disjoint?
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

feature -- Basic operations

    symdif (set1, set2: BINARY_SEARCH_TREE_SET [G])
            -- Remove all items of set1 that are also in set2, and add all
            -- items of set2 not already present in set1.
        require -- from SUBSET_STRATEGY
            sets_exist: set1 /= void and set2 /= void
            same_rule: set1.object_comparison = set2.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET_STRATEGY_TREE


SUBSET Chart

deferred class
    SUBSET [G]

General
    cluster: base.structures.set
    description:
        "Subsets with the associated operations,
        without commitment to a particular representation"

Ancestors
    SET [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] SUBSET [G]
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    intersect (other: SUBSET [G])
    merge (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    subtract (other: SUBSET [G])
    symdif (other: SUBSET [G])
    wipe_out


SUBSET Flat contracts

indexing
    description: "[
        Subsets with the associated operations,
        without commitment to a particular representation
    ]"
    status: "See notice at end of class"
    names: subset, set
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from SET)

feature -- Comparison

    disjoint (other: SUBSET [G]): BOOLEAN
            -- Do current set and other have no items in common?
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
        require
            non_negative: n >= 0
        ensure
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: SUBSET [G])
            -- Remove all items not in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure
            is_subset_other: is_subset (other)

    subtract (other: SUBSET [G])
            -- Remove all items also in other.
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure
            is_disjoint: disjoint (other)

    symdif (other: SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (This feature is redefined in all descendants. The default
            -- implementation given here is only to stay backward-compatible
            -- with older versions of EiffelBase.)
        require
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SUBSET


TRAVERSABLE_SUBSET Chart

deferred class
    TRAVERSABLE_SUBSET [G]

General
    cluster: base.structures.set
    description: "Subsets that are traversable sequentially"

Ancestors
    SUBSET [G]

Queries
    after: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] TRAVERSABLE_SUBSET [G]
    extendible: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    prunable: BOOLEAN

Commands
    compare_objects
    compare_references
    extend (v: G)
    fill (other: CONTAINER [G])
    forth
    intersect (other: TRAVERSABLE_SUBSET [G])
    merge (other: CONTAINER [G])
    prune (v: G)
    prune_all (v: G)
    put (v: G)
    remove
    start
    subtract (other: TRAVERSABLE_SUBSET [G])
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out

Constraints
    empty definition
    count range


TRAVERSABLE_SUBSET Flat contracts

indexing
    description: "Subsets that are traversable sequentially"
    status: "See notice at end of class"
    names: traversable_subset, set, subset
    access: sequential
    contents: generic
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    TRAVERSABLE_SUBSET [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Current item
        require
            not_off: not off

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is cursor behind last item?

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is container empty?

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is cursor off the active items?

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move cursor to next element.
        require
            not_after: not after

    start
            -- Move cursor to first item.

feature -- Element change

    extend (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of put.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    merge (other: CONTAINER [G])
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    put (v: G)
            -- Ensure that set includes v.
            -- Was declared in SET as synonym of extend.
            -- (from SET)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: G)
            -- Remove v if present.
            -- (from SET)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
        require
            not_off: not off

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- New structure containing min (n, count)
            -- items from current structure
            -- (from SUBSET)
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items not in other.
            -- No effect if other is_empty.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

invariant

    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE_SUBSET


TWO_WAY_SORTED_SET Chart

class
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

General
    cluster: base.structures.set
    description:
        "Sets whose items may be compared according to a total order relation;
        implemented as sorted two-way lists."
    create: make

Ancestors
    COMPARABLE_SET [G -> COMPARABLE]
    LINEAR_SUBSET [G]
    SORTED_TWO_WAY_LIST [G -> COMPARABLE]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    duplicate (n: INTEGER): [like Current] TWO_WAY_SORTED_SET [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_element: BI_LINKABLE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_SORTED_SET [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
    is_superset (other: SUBSET [G]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    last_element: [like first_element] BI_LINKABLE [G]
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: G): INTEGER
    sorted: BOOLEAN
    sublist: [like Current] TWO_WAY_SORTED_SET [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    intersect (other: [like Current] TWO_WAY_SORTED_SET [G])
    make
    merge (other: TRAVERSABLE_SUBSET [G])
    merge_left (other: [like Current] TWO_WAY_SORTED_SET [G])
    merge_right (other: [like Current] TWO_WAY_SORTED_SET [G])
    move (i: INTEGER)
    move_item (v: G)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    remove_sublist
    replace (v: [like item] G)
    search (v: [like item] G)
    search_after (v: [like item] G)
    search_before (v: [like item] G)
    sort
    split (n: INTEGER)
    start
    subtract (other: [like Current] TWO_WAY_SORTED_SET [G])
    swap (i: INTEGER)
    symdif (other: TRAVERSABLE_SUBSET [G])
    wipe_out


TWO_WAY_SORTED_SET Flat contracts

indexing
    description: "[
        Sets whose items may be compared according to a total order relation;
        implemented as sorted two-way lists.
    ]"
    status: "See notice at end of class"
    names: sorted_set, set, two_way_list
    representation: linked
    access: membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

class interface
    TWO_WAY_SORTED_SET [G -> COMPARABLE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    first_element: BI_LINKABLE [G]
            -- Head of list
            -- (Anchor redefinition)
            -- (from TWO_WAY_LIST)

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from PART_SORTED_LIST)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    last_element: like first_element
            -- Tail of the list
            -- (from TWO_WAY_LIST)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search_after (v: like item)
            -- Go to first position with item greater
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            argument_less_than_item: (not after) implies (v <= item)

    search_before (v: like item)
            -- Go to last position with item less
            -- than or equal to v.
            -- (from PART_SORTED_LIST)
        ensure -- from PART_SORTED_LIST
            (not off) implies (item <= v)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    max: like item
            -- Maximum item
            -- (from SORTED_LIST)
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            max_is_last: Result = last

    median: like item
            -- Median item
            -- (from SORTED_LIST)
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            median_definition: Result = i_th ((count + 1) // 2)

    min: like item
            -- Minimum item
            -- (from SORTED_LIST)
        require -- from COMPARABLE_SET
            not_empty: not is_empty
        require -- from SORTED_LIST
            not_empty: not is_empty
        ensure -- from SORTED_LIST
            min_is_first: Result = first

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    disjoint (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Do current set and other have no
            -- items in common?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

    is_subset (other: TRAVERSABLE_SUBSET [G]): BOOLEAN
            -- Is current set a subset of other?
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    is_superset (other: SUBSET [G]): BOOLEAN
            -- Is current set a superset of other?
            -- (from SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    sorted: BOOLEAN
            -- Is the structure sorted?
            -- (from SORTED_TWO_WAY_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure -- from LINEAR_SUBSET
            index_valid: 0 <= n and n <= count + 1
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature  -- Cursor movement

    back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before
        ensure then -- from TWO_WAY_LIST
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Cursor movement

    forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from LINEAR
            not_after: not after
        require -- from TRAVERSABLE_SUBSET
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from LINEAR_SUBSET
            valid_index: valid_index (i)
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from LINEAR_SUBSET
            cursor_moved: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of put.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge (other: TRAVERSABLE_SUBSET [G])
            -- Add all items of other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    move_item (v: G)
            -- Move v to the left of cursor.
            -- (from LINEAR_SUBSET)
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            item_in_set: has (v)

    put (v: G)
            -- Ensure that structure includes v.
            -- Was declared in TWO_WAY_SORTED_SET as synonym of extend.
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        require -- from LINEAR_SUBSET
            item_exists: v /= void
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v
        ensure -- from LINEAR_SUBSET
            cursor_position_unchanged: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: only if set empty; otherwise insertions might
            -- introduce duplicates, destroying the set property.)
            -- (from SET)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    prune (v: like item)
            -- Remove v if present.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)

    prune_all (v: like item)
            -- Remove all items identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave cursor off.
            -- (from SORTED_TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        require -- from TRAVERSABLE_SUBSET
            not_off: not off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    sort
            -- Sort all items.
            -- Has O(count * log (count)) complexity.
            -- (from SORTED_TWO_WAY_LIST)

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-set beginning at cursor position
            -- and having min (n, count - index + 1) items
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0
        require -- from SUBSET
            non_negative: n >= 0
        ensure -- from SUBSET
            correct_count_1: n <= count implies Result.count = n
            correct_count_2: n >= count implies Result.count = count

feature -- Basic operations

    intersect (other: like Current)
            -- Remove all items not in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_subset_other: is_subset (other)

    subtract (other: like Current)
            -- Remove all items also in other.
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison
        ensure -- from SUBSET
            is_disjoint: disjoint (other)

    symdif (other: TRAVERSABLE_SUBSET [G])
            -- Remove all items also in other, and add all
            -- items of other not already present.
            -- (from TRAVERSABLE_SUBSET)
        require -- from SUBSET
            set_exists: other /= void
            same_rule: object_comparison = other.object_comparison

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from LINEAR_SUBSET
    before_definition: before = (index = 0)
        -- from TRAVERSABLE_SUBSET
    empty_definition: is_empty = (count = 0)
    count_range: count >= 0
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_empty implies (first_element /= void and last_element /= void)
    first_element_constraint: first_element /= void implies first_element.left = void
    last_element_constraint: last_element /= void implies last_element.right = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_SORTED_SET


cluster base.structures.sort

Cluster
    base.structures.sort

Supercluster
    base.structures

Classes
    COMPARABLE_STRUCT [G -> COMPARABLE]
    SORTED_STRUCT [G -> COMPARABLE]


COMPARABLE_STRUCT Chart

deferred class
    COMPARABLE_STRUCT [G -> COMPARABLE]

General
    cluster: base.structures.sort
    description:
        "Data structures whose items may be compared
        according to a total order relation"

Ancestors
    BILINEAR [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    max: [like item] G
    min: [like item] G
    min_max_available: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (v: [like item] G)
    start

Constraints
    empty constraint


COMPARABLE_STRUCT Flat contracts

indexing
    description: "[
        Data structures whose items may be compared
        according to a total order relation
    ]"
    status: "See notice at end of class"
    names: comparable_struct
    access: min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    COMPARABLE_STRUCT [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)

    off: BOOLEAN
            -- Is there no current item?
            -- (from BILINEAR)

feature -- Measurement

    max: like item
            -- Maximum item
        require
            min_max_available

    min: like item
            -- Minimum item
        require
            min_max_available

    min_max_available: BOOLEAN
            -- Can min and max be computed?
        ensure
            Result implies not is_empty

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    empty_constraint: min_max_available implies not is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPARABLE_STRUCT


SORTED_STRUCT Chart

deferred class
    SORTED_STRUCT [G -> COMPARABLE]

General
    cluster: base.structures.sort
    description: "Structures whose items are sorted according to a total order relation"

Ancestors
    COMPARABLE_STRUCT [G -> COMPARABLE]
    INDEXABLE [G, H -> INTEGER]
    LINEAR [G]

Queries
    infix "@" (k: INTEGER): G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (k: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    max: [like item] G
    median: [like item] G
    min: [like item] G
    min_max_available: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    sorted: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN

Commands
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    forth
    prune (v: G)
    prune_all (v: G)
    put_i_th (v: G; k: INTEGER)
    search (v: [like item] G)
    sort
    start
    wipe_out


SORTED_STRUCT Flat contracts

indexing
    description: "Structures whose items are sorted according to a total order relation"
    status: "See notice at end of class"
    names: sorted_struct, comparable_struct
    access: index, membership, min, max
    contents: generic
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    SORTED_STRUCT [G -> COMPARABLE]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    i_th (k: INTEGER): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of @.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    infix "@" (k: INTEGER): G
            -- Entry of key k.
            -- Was declared in TABLE as synonym of item.
            -- (from TABLE)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from INDEXABLE)
        ensure -- from INDEXABLE
            not_void: Result /= void

    max: like item
            -- Maximum item
        require -- from COMPARABLE_STRUCT
            min_max_available
        require else
            is_sorted: sorted

    median: like item
            -- Median element
        ensure
            median_present: has (Result)

    min: like item
            -- Minimum item
        require -- from COMPARABLE_STRUCT
            min_max_available
        require else
            is_sorted: sorted

    min_max_available: BOOLEAN
            -- Can min and max be computed?
            -- (from COMPARABLE_STRUCT)
        ensure -- from COMPARABLE_STRUCT
            Result implies not is_empty

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    sorted: BOOLEAN
            -- Is structure sorted?

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from INDEXABLE)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Element change

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put_i_th (v: G; k: INTEGER)
            -- Associate value v with key k.
            -- (from INDEXABLE)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

feature -- Removal

    prune (v: G)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Transformation

    sort
            -- Sort structure.
        ensure
            is_sorted: sorted

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Inapplicable

    index: INTEGER
            -- (from COMPARABLE_STRUCT)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE_STRUCT
    empty_constraint: min_max_available implies not is_empty
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SORTED_STRUCT


cluster base.structures.storage

Cluster
    base.structures.storage

Supercluster
    base.structures

Classes
    BOUNDED [G]
    BOX [G]
    COUNTABLE [G]
    FINITE [G]
    FIXED [G]
    INFINITE [G]
    RESIZABLE [G]
    UNBOUNDED [G]


BOUNDED Chart

deferred class
    BOUNDED [G]

General
    cluster: base.structures.storage
    description: "Bounded data structures, with a notion of capacity."

Ancestors
    FINITE [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    resizable: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    valid count
    full definition


BOUNDED Flat contracts

indexing
    description: "Bounded data structures, with a notion of capacity."
    status: "See notice at end of class"
    names: bounded, storage
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    BOUNDED [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure full?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    resizable: BOOLEAN
            -- May capacity be changed?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOUNDED


BOX Chart

deferred class
    BOX [G]

General
    cluster: base.structures.storage
    description:
        "Data structures of the most general kind,
        having the potential ability to become full,
        and characterized by their implementation properties."

Ancestors
    CONTAINER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references


BOX Flat contracts

indexing
    description: "[
        Data structures of the most general kind,
        having the potential ability to become full,
        and characterized by their implementation properties.
    ]"
    status: "See notice at end of class"
    names: storage
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    BOX [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure filled to capacity?

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOX


COUNTABLE Chart

deferred class
    COUNTABLE [G]

General
    cluster: base.structures.storage
    description:
        "Infinite containers whose items are in one-to-one
        correspondence with the integers."

Ancestors
    INFINITE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    Is_empty: BOOLEAN
    item (i: INTEGER): G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references


COUNTABLE Flat contracts

indexing
    description: "[
        Infinite containers whose items are in one-to-one
        correspondence with the integers.
    ]"
    status: "See notice at end of class"
    names: countable, infinite, storage
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    COUNTABLE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (i: INTEGER): G
            -- The i-th item
        require
            positive_argument: i > 0

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE


FINITE Chart

deferred class
    FINITE [G]

General
    cluster: base.structures.storage
    description: "Structures with a finite item count"

Ancestors
    BOX [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    empty definition
    non negative count


FINITE Flat contracts

indexing
    description: "Structures with a finite item count"
    status: "See notice at end of class"
    names: finite, storage
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    FINITE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FINITE


FIXED Chart

deferred class
    FIXED [G]

General
    cluster: base.structures.storage
    description: "Finite structures whose item count cannot be changed"

Ancestors
    BOUNDED [G]

Queries
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    Resizable: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    not resizable


FIXED Flat contracts

indexing
    description: "Finite structures whose item count cannot be changed"
    status: "See notice at end of class"
    names: fixed, storage
    size: fixed
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    FIXED [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored
            -- (from BOUNDED)

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    not_resizable: not resizable
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED


INFINITE Chart

deferred class
    INFINITE [G]

General
    cluster: base.structures.storage
    description: "Infinite containers."

Ancestors
    BOX [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    Is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references

Constraints
    never empty
    always full


INFINITE Flat contracts

indexing
    description: "Infinite containers."
    status: "See notice at end of class"
    names: infinite, storage
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    INFINITE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    Full: BOOLEAN is True
            -- The structure is complete

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    never_empty: not is_empty
    always_full: full
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INFINITE


RESIZABLE Chart

deferred class
    RESIZABLE [G]

General
    cluster: base.structures.storage
    description: "Finite structures whose item count is subject to change"

Ancestors
    BOUNDED [G]

Queries
    additional_space: INTEGER
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    resizable: BOOLEAN

Commands
    automatic_grow
    compare_objects
    compare_references
    grow (i: INTEGER)

Constraints
    increase by at least one


RESIZABLE Flat contracts

indexing
    description: "Finite structures whose item count is subject to change"
    status: "See notice at end of class"
    names: storage
    size: resizable
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    RESIZABLE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
        ensure
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of items that may be stored
            -- (from BOUNDED)

    count: INTEGER
            -- Number of items
            -- (from FINITE)

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
        ensure
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Ensure that capacity is at least i.
        ensure
            new_capacity: capacity >= i

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

    increase_by_at_least_one: minimal_increase >= 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RESIZABLE


UNBOUNDED Chart

deferred class
    UNBOUNDED [G]

General
    cluster: base.structures.storage
    description: "Finite structures whose item count is not bounded"

Ancestors
    FINITE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    full: BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN

Commands
    compare_objects
    compare_references


UNBOUNDED Flat contracts

indexing
    description: "Finite structures whose item count is not bounded"
    status: "See notice at end of class"
    names: unbounded, storage
    date: "$Date: 2001/11/12 17:57:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    UNBOUNDED [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from FINITE)

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class UNBOUNDED


cluster base.structures.table

Cluster
    base.structures.table

Supercluster
    base.structures

Classes
    ARRAY2 [G]
    HASH_TABLE [G, H -> HASHABLE]


ARRAY2 Chart

class
    ARRAY2 [G]

General
    cluster: base.structures.table
    description: "Two-dimensional arrays"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): G
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): G
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: G): BOOLEAN
    height: INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAY2 [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (row, column: INTEGER): G
    linear_representation: LINEAR [G]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] ARRAY2 [G]): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] ARRAY2 [G]
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    width: INTEGER

Commands
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] ARRAY2 [G])
    discard_items
    enter (v: [like item] G; i: INTEGER)
    fill (other: CONTAINER [G])
    force (v: [like item] G; row, column: INTEGER)
    grow (i: INTEGER)
    initialize (v: G)
    make (nb_rows, nb_columns: INTEGER)
    make_from_array (a: ARRAY [G])
    prune_all (v: G)
    put (v: [like item] G; row, column: INTEGER)
    resize (nb_rows, nb_columns: INTEGER)
    subcopy (other: [like Current] ARRAY2 [G]; start_pos, end_pos, index_pos: INTEGER)
    wipe_out

Constraints
    items number


ARRAY2 Flat contracts

indexing
    description: "Two-dimensional arrays"
    status: "See notice at end of class"
    names: array2, matrix, table
    representation: array
    access: index, row_and_column, membership
    size: resizable
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAY2 [G]

create

    make (nb_rows, nb_columns: INTEGER)
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
        require
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        ensure
            new_count: count = height * width

feature -- Initialization

    initialize (v: G)
            -- Make each entry have value v.

    make (nb_rows, nb_columns: INTEGER)
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
        require
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        ensure
            new_count: count = height * width

    make_from_array (a: ARRAY [G])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    entry (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: G): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (row, column: INTEGER): G
            -- Entry at coordinates (row, column)
        require
            valid_row: (1 <= row) and (row <= height)
            valid_column: (1 <= column) and (column <= width)

    infix "@" (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    height: INTEGER
            -- Number of rows

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: G): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

    width: INTEGER
            -- Number of columns

feature  -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((array_item (upper) = void or else array_item (upper) = array_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (array_item (upper) = other.array_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
            -- Resize if necessary.
        require
            row_large_enough: 1 <= row
            column_large_enough: 1 <= column

    put (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
        require
            valid_row: 1 <= row and row <= height
            valid_column: 1 <= column and column <= width

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: G)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (nb_rows, nb_columns: INTEGER)
            -- Rearrange array so that it can accommodate
            -- nb_rows rows and nb_columns columns,
            -- without losing any previously
            -- entered items, nor changing their coordinates;
            -- do nothing if not possible.
        require
            valid_row: nb_rows >= 1
            valid_column: nb_columns >= 1

feature  -- Conversion

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from ARRAY)

feature  -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

feature -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

    items_number: count = width * height
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAY2


HASH_TABLE Chart

class
    HASH_TABLE [G, H -> HASHABLE]

General
    cluster: base.structures.table
    description: "Hash tables, used to store items identified by hashable keys"
    create: make

Ancestors
    TABLE [G, H]
    UNBOUNDED [G]

Queries
    infix "@" (key: H): G
    after: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    conflict: BOOLEAN
    count: INTEGER
    current_keys: ARRAY [H]
    cursor: CURSOR
    Extendible: BOOLEAN
    found: BOOLEAN
    found_item: G
    Full: BOOLEAN
    has (key: H): BOOLEAN
    has_item (v: G): BOOLEAN
    inserted: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] HASH_TABLE [G, H]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    item (key: H): G
    item_for_iteration: G
    key_for_iteration: H
    linear_representation: ARRAYED_LIST [G]
    not_found: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    removed: BOOLEAN
    replaced: BOOLEAN
    valid_cursor (c: CURSOR): BOOLEAN
    valid_key (k: H): BOOLEAN

Commands
    accommodate (n: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] HASH_TABLE [G, H])
    extend (new: G; key: H)
    fill (other: CONTAINER [G])
    force (new: G; key: H)
    forth
    go_to (c: CURSOR)
    make (n: INTEGER)
    put (new: G; key: H)
    remove (key: H)
    replace (new: G; key: H)
    replace_key (new_key, old_key: H)
    search (key: H)
    start

Constraints
    keys not void
    content not void
    keys same capacity plus one
    content same capacity plus one
    deleted same capacity
    keys starts at zero
    content starts at zero
    deleted starts at zero
    valid iteration position
    control non negative
    special status
    max occupation meaningful
    initial occupation meaningful
    sized generously enough
    count big enough
    count small enough
    breathing space
    count no more than slot count
    slot count big enough
    slot count small enough
    extra space non negative


HASH_TABLE Flat contracts

indexing
    description: "Hash tables, used to store items identified by hashable keys"
    instructions: "[
        Several procedures are provided for inserting an item
        with a given key.

        Here is how to choose between them:

            - Use `put' if you want to do an insertion only if
              there was no item with the given key, doing nothing
              otherwise. (You can find out on return if there was one,
              and what it was.)

            - Use `force' if you always want to insert the item;
              if there was one for the given key it will be removed,
              (and you can find out on return what it was).

            - Use `extend' if you are sure there is no item with
              the given key, enabling faster insertion (but
              unpredictable behavior if this assumption is not true).

            - Use `replace' if you want to replace an already present
              item with the given key, and do nothing if there is none.

        In addition you can use `replace_key' to change the key of an
        already present item, identified by its previous key, or
        do nothing if there is nothing for that previous key.
        You can find out on return.
    ]"
    instructions: "[
        To find out whether a key appears in the table, use `has'.
        To find out the item, if any, associated with a certain key,
        use `item'.

        Both of these routines perform a search. If you need
        both pieces of information (does a key appear? And, if so,
        what is the associated item?), you can avoid performing
        two redundant traversals by using instead the combination
        of `search', `found' and `found_item' as follows:

            your_table.search (your_key)
            if your_table.found then
                what_you_where_looking_for := your_table.found_item
                ... Do whatever is needed to `what_you_were_looking_for' ...
            else
                ... No item was present for `your_key' ...
            end
    ]"
    compatibility: "[
        This version of the class accepts any value of type H as key.
        Previous versions did not accept the default value as a key;
        this restriction no longer applies. Most clients of the old version
        should work correctly with this one; a client that explicitly relied
        on the default value not being hashable should use the old version
        available in the EiffelBase 3.3 compatibility cluster.

        Also, `force' now sets either `found' or `not_found'.
        (Previously it would always set `inserted'.)
    ]"
    storable_compatibility: "[
        Persistent instances of the old version of this class will not be
         retrievable with the present version.
    ]"
    warning: "[
        Modifying an object used as a key by an item present in a table will
        cause incorrect behavior. If you will be modifying key objects,
        pass a clone, not the object itself, as key argument to
        `put' and `replace_key'.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

class interface
    HASH_TABLE [G, H -> HASHABLE]

create

    make (n: INTEGER)
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
        ensure
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status

feature -- Initialization

    accommodate (n: INTEGER)
            -- Reallocate table with enough space for n items;
            -- keep all current items.
        require
            n >= 0
        ensure
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation

    make (n: INTEGER)
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
        ensure
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status

feature -- Access

    current_keys: ARRAY [H]
            -- New array containing actually used keys, from 1 to count
        ensure
            good_count: Result.count = count

    cursor: CURSOR
            -- Current cursor position
        ensure
            cursor_not_void: Result /= void

    found_item: G
            -- Item, if any, yielded by last search operation

    has (key: H): BOOLEAN
            -- Is there an item in the table with key key?
        ensure then
            default_case: (key = computed_default_key) implies (Result = has_default)

    has_item (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (key: H): G
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of @.
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

    item_for_iteration: G
            -- Element at current iteration position
        require
            not_off: not off

    key_for_iteration: H
            -- Key at current iteration position
        require
            not_off: not off
        ensure
            at_iteration_position: Result = key_at (iteration_position)

    infix "@" (key: H): G
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of item.
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored.

    count: INTEGER
            -- Number of items in table

    occurrences (v: G): INTEGER
            -- Number of table items equal to v.
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does table contain the same information as other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    after: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of off.
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    conflict: BOOLEAN
            -- Did last operation cause a conflict?

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)

    found: BOOLEAN
            -- Did last operation find the item sought?

    Full: BOOLEAN is False
            -- Is structure filled to capacity? (Answer: no.)

    inserted: BOOLEAN
            -- Did last operation insert an item?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    not_found: BOOLEAN
            -- Did last operation fail to find the item sought?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of after.
        ensure
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)

    removed: BOOLEAN
            -- Did last operation remove an item?

    replaced: BOOLEAN
            -- Did last operation replace an item?

    valid_cursor (c: CURSOR): BOOLEAN
            -- Can cursor be moved to position c?
        require
            c_not_void: c /= void

    valid_key (k: H): BOOLEAN
            -- Is k a valid key?
            -- (Answer: always yes for hash tables in this version)
        ensure then
            Result

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Advance cursor to next occupied position,
            -- or off if no such position remains.
        require
            not_off: not off

    go_to (c: CURSOR)
            -- Move to position c.
        require
            c_not_void: c /= void
            valid_cursor: valid_cursor (c)

    search (key: H)
            -- Search for item of key key.
            -- If found, set found to true, and set
            -- found_item to item associated with key.
        ensure
            found_or_not_found: found or not_found
            item_if_found: found implies (found_item = content.item (position))

    start
            -- Bring cursor to first position.

feature -- Element change

    extend (new: G; key: H)
            -- Assuming there is no item of key key,
            -- insert new with key.
            -- Set inserted.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require
            not_present: not has (key)
        ensure
            inserted: inserted
            insertion_done: item (key) = new
            one_more: count = old count + 1
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            default_property: has_default = ((key = computed_default_key) or (old has_default))

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (new: G; key: H)
            -- Update table so that new will be the item associated
            -- with key.
            -- If there was an item for that key, set found
            -- and set found_item to that item.
            -- If there was none, set not_found and set
            -- found_item to the default value.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require else
            True
        ensure then
            insertion_done: item (key) = new
            now_present: has (key)
            found_or_not_found: found or not_found
            not_found_if_was_not_present: not_found = not (old has (key))
            same_count_or_one_more: (count = old count) or (count = old count + 1)
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            found_item_is_old_item: found implies (found_item = old (item (key)))
            default_value_if_not_found: not_found implies (found_item = computed_default_value)
            default_property: has_default = ((key = computed_default_key) or ((key /= computed_default_key) and (old has_default)))

    put (new: G; key: H)
            -- Insert new with key if there is no other item
            -- associated with the same key.
            -- Set inserted if and only if an insertion has
            -- been made (i.e. key was not present).
            -- If so, set position to the insertion position.
            -- If not, set conflict.
            -- In either case, set found_item to the item
            -- now associated with key (previous item if
            -- there was one, new otherwise).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then
            conflict_or_inserted: conflict or inserted
            insertion_done: inserted implies item (key) = new
            now_present: inserted implies has (key)
            one_more_if_inserted: inserted implies (count = old count + 1)
            one_more_slot_if_inserted_unless_reallocated: inserted implies ((used_slot_count = old used_slot_count + 1) or (used_slot_count = count))
            unchanged_if_conflict: conflict implies (count = old count)
            same_item_if_conflict: conflict implies (item (key) = old (item (key)))
            slot_count_unchanged_if_conflict: conflict implies (used_slot_count = old used_slot_count)
            found_item_associated_with_key: found_item = item (key)
            new_item_if_inserted: inserted implies (found_item = new)
            old_item_if_conflict: conflict implies (found_item = old (item (key)))
            default_property: has_default = ((inserted and (key = computed_default_key)) or ((conflict or (key /= computed_default_key)) and (old has_default)))

    replace (new: G; key: H)
            -- Replace item at key, if present,
            -- with new; do not change associated key.
            -- Set replaced if and only if a replacement has been made
            -- (i.e. key was present); otherwise set not_found.
            -- Set found_item to the item previously associated
            -- with key (default value if there was none).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        ensure
            replaced_or_not_found: replaced or not_found
            insertion_done: replaced implies item (key) = new
            no_change_if_not_found: not_found implies item (key) = old (item (key))
            found_item_is_old_item: found_item = old (item (key))

    replace_key (new_key: H; old_key: H)
            -- If there is an item of key old_key and no item of key
            -- new_key, replace the former's key by new_key,
            -- set replaced, and set found_item to the item
            -- previously associated with old_key.
            -- Otherwise set not_found or conflict respectively.
            -- If conflict, set found_item to the item previously
            -- associated with new_key.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
        ensure
            same_count: count = old count
            same_slot_count: used_slot_count = old used_slot_count
            replaced_or_conflict_or_not_found: replaced or conflict or not_found
            old_absent: (replaced and not equal (new_key, old_key)) implies (not has (old_key))
            new_present: (replaced or conflict) = has (new_key)
            new_item: replaced implies (item (new_key) = old (item (old_key)))
            not_found_iff_no_old_key: not_found = old (not has (old_key))
            conflict_iff_already_present: conflict = old (has (new_key))
            not_inserted_if_conflict: conflict implies (item (new_key) = old (item (new_key)))
            default_property: has_default = ((new_key = computed_default_key) or ((new_key /= computed_default_key) and (old has_default)))

feature -- Removal

    clear_all
            -- Reset all items to default values; reset status.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then
            position_equal_to_zero: position = 0
            count_equal_to_zero: count = 0
            used_slot_count_equal_to_zero: used_slot_count = 0
            has_default_set: not has_default
            no_status: not special_status

    remove (key: H)
            -- Remove item associated with key, if present.
            -- Set removed if and only if an item has been
            -- removed (i.e. key was present);
            -- if so, set position to index of removed element.
            -- If not, set not_found.
        ensure
            removed_or_not_found: removed or not_found
            not_present: not has (key)
            one_less: found implies (count = old count - 1)
            same_slot_count: used_slot_count = old used_slot_count
            default_case: (key = computed_default_key) implies (not has_default)
            non_default_case: (key /= computed_default_key) implies (has_default = old has_default)

feature -- Conversion

    linear_representation: ARRAYED_LIST [G]
            -- Representation as a linear structure
        ensure then
            result_exists: Result /= void
            good_count: Result.count = count

feature -- Duplication

    copy (other: like Current)
            -- Re-initialize from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

invariant

    keys_not_void: keys /= void
    content_not_void: content /= void
    keys_same_capacity_plus_one: keys.count = capacity + 1
    content_same_capacity_plus_one: content.count = capacity + 1
    deleted_same_capacity: deleted_marks.count = capacity
    keys_starts_at_zero: keys.lower = 0
    content_starts_at_zero: content.lower = 0
    deleted_starts_at_zero: deleted_marks.lower = 0
    valid_iteration_position: off or truly_occupied (iteration_position)
    control_non_negative: control >= 0
    special_status: special_status = (conflict or inserted or replaced or removed or found or not_found)
    max_occupation_meaningful: (max_occupation > 0) and (max_occupation < 100)
    initial_occupation_meaningful: (initial_occupation > 0) and (initial_occupation < 100)
    sized_generously_enough: initial_occupation < max_occupation
    count_big_enough: 0 <= count
    count_small_enough: count <= capacity
    breathing_space: count * 100 <= capacity * max_occupation
    count_no_more_than_slot_count: count <= used_slot_count
    slot_count_big_enough: 0 <= count
    slot_count_small_enough: used_slot_count <= capacity
    extra_space_non_negative: extra_space >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE


cluster base.structures.traversing

Cluster
    base.structures.traversing

Supercluster
    base.structures

Classes
    BILINEAR [G]
    HIERARCHICAL [G]
    LINEAR [G]
    TRAVERSABLE [G]


BILINEAR Chart

deferred class
    BILINEAR [G]

General
    cluster: base.structures.traversing
    description: "Structures that may be traversed forward and backward"

Ancestors
    LINEAR [G]
    LINEAR [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    back
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (v: [like item] G)
    start

Constraints
    not both
    before constraint


BILINEAR Flat contracts

indexing
    description: "Structures that may be traversed forward and backward"
    status: "See notice at end of class"
    names: bidirectional, traversing
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    BILINEAR [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)

    off: BOOLEAN
            -- Is there no current item?

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
        require
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    not_both: not (after and before)
    before_constraint: before implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BILINEAR


HIERARCHICAL Chart

deferred class
    HIERARCHICAL [G]

General
    cluster: base.structures.traversing
    description:
        "Hierarchical structures in which each item has zero or
        one immediate predecessor, and zero or more successors."

Ancestors
    TRAVERSABLE [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    successor_count: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    down (i: INTEGER)
    start
    up

Constraints
    non negative successor count


HIERARCHICAL Flat contracts

indexing
    description: "[
        Hierarchical structures in which each item has zero or
        one immediate predecessor, and zero or more successors.
    ]"
    status: "See notice at end of class"
    names: hierarchical, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    HIERARCHICAL [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    successor_count: INTEGER
            -- Number of successors of current element
        require
            not_off: not off

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from TRAVERSABLE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    down (i: INTEGER)
            -- Move to i-th successor.
        require
            not_off: not off
            argument_within_bounds: i >= 1 and i <= successor_count

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

    up
            -- Move to predecessor.
        require
            not_off: not off

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_successor_count: successor_count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HIERARCHICAL


LINEAR Chart

deferred class
    LINEAR [G]

General
    cluster: base.structures.traversing
    description: "Structures whose items may be accessed sequentially, one-way"

Ancestors
    TRAVERSABLE [G]

Queries
    after: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    finish
    forth
    search (v: [like item] G)
    start

Constraints
    after constraint


LINEAR Flat contracts

indexing
    description: "Structures whose items may be accessed sequentially, one-way"
    status: "See notice at end of class"
    names: sequential, traversing
    access: membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    LINEAR [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
        require
            positive_occurrences: i > 0
        ensure
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
        ensure
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
        ensure
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    finish
            -- Move to last position.

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require
            not_after: not after

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    after_constraint: after implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINEAR


TRAVERSABLE Chart

deferred class
    TRAVERSABLE [G]

General
    cluster: base.structures.traversing
    description:
        "Structures for which there exists a traversal policy
        that will visit every element exactly once."

Ancestors
    CONTAINER [G]

Queries
    changeable_comparison_criterion: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    start

Constraints
    empty constraint


TRAVERSABLE Flat contracts

indexing
    description: "[
        Structures for which there exists a traversal policy
        that will visit every element exactly once.
    ]"
    status: "See notice at end of class"
    names: traversable, traversing
    access: cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    TRAVERSABLE [G]

feature -- Access

    has (v: G): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Item at current position
        require
            not_off: not off

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    start
            -- Move to first position if any.

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
        require
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
        require
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
        require
            test_exits: test /= void

invariant

    empty_constraint: is_empty implies off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TRAVERSABLE


cluster base.structures.tree

Cluster
    base.structures.tree

Supercluster
    base.structures

Classes
    ARRAYED_TREE [G]
    BINARY_SEARCH_TREE [G -> COMPARABLE]
    BINARY_TREE [G]
    DYNAMIC_TREE [G]
    FIXED_TREE [G]
    LINKED_TREE [G]
    TREE [G]
    TWO_WAY_TREE [G]


ARRAYED_TREE Chart

class
    ARRAYED_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees where the children of each node are kept in an array"
    create: make

Ancestors
    ARRAYED_LIST [G]
    CELL [G]
    DYNAMIC_TREE [G]

Queries
    infix "@" (i: INTEGER): ARRAYED_TREE [G]
    Al_extendible: BOOLEAN
    arity: INTEGER
    array_item (i: INTEGER): ARRAYED_TREE [G]
    binary_representation: BINARY_TREE [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child: [like first] ARRAYED_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] ARRAYED_TREE [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first_child: ARRAYED_TREE [G]
    for_all (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] ARRAYED_TREE [G]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ARRAYED_TREE [G]): BOOLEAN
    is_inserted (v: ARRAYED_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] ARRAYED_TREE [G]): BOOLEAN
    item: G
    last_child: [like first] ARRAYED_TREE [G]
    left_sibling: [like parent] ARRAYED_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] ARRAYED_TREE [G]): INTEGER
    parent: ARRAYED_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like parent] ARRAYED_TREE [G]
    sequential_occurrences (v: ARRAYED_TREE [G]): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [ARRAYED_TREE [G]])
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] ARRAYED_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]])
    do_if (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN])
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    force (v: [like item] ARRAYED_TREE [G])
    make (n: INTEGER; v: G)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [ARRAYED_TREE [G]])
    merge_tree_after (other: [like first_child] ARRAYED_TREE [G])
    merge_tree_before (other: [like first_child] ARRAYED_TREE [G])
    move (i: INTEGER)
    prune (v: [like item] ARRAYED_TREE [G])
    prune_all (v: [like item] ARRAYED_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] ARRAYED_TREE [G])
    put_child_left (n: [like parent] ARRAYED_TREE [G])
    put_child_right (n: [like parent] ARRAYED_TREE [G])
    put_front (v: [like item] ARRAYED_TREE [G])
    put_i_th (v: [like item] ARRAYED_TREE [G]; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] ARRAYED_TREE [G])
    search_child (v: [like item] ARRAYED_TREE [G])
    sprout
    swap (i: INTEGER)
    wipe_out


ARRAYED_TREE Flat contracts

indexing
    description: "Trees where the children of each node are kept in an array"
    status: "See notice at end of class"
    names: tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAYED_TREE [G]

create

    make (n: INTEGER; v: G)
            -- Create node with item v.
            -- Allocate space for n children.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v

feature -- Initialization

    make (n: INTEGER; v: G)
            -- Create node with item v.
            -- Allocate space for n children.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: child_before
            filled: al_full

    make_from_array (a: ARRAY [ARRAYED_TREE [G]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    child_cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    first_child: ARRAYED_TREE [G]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    child_index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like child; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Content of cell.
            -- (from CELL)

    child: like first_child
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: readable_child
        require -- from TREE
            readable: readable_child
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (child_index)

    array_item (i: INTEGER): ARRAYED_TREE [G]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last_child: like first_child
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    sequential_occurrences (v: ARRAYED_TREE [G]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: ARRAYED_TREE [G]
            -- Parent of current node

    right_sibling: like parent
            -- Right neighbor if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

    infix "@" (i: INTEGER): ARRAYED_TREE [G]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Al_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: ARRAYED_TREE [G]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_leaf implies child_before

    child_forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)

    search_child (v: like child)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child

    child_start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [ARRAYED_TREE [G]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    child_extend (v: like item)
            -- Add v at end.
            -- Do not move child cursor.

    child_put (v: like item)
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before

    child_put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after

    child_replace (v: like item)
            -- Replace current child item with v.
            -- Was declared in ARRAYED_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: al_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    put_i_th (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: array_item (k) = v

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of the cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first_child = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Make n the node's current child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n
        ensure then
            child_replaced: n.parent = Current

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    prune (v: like child)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    prune_all (v: like child)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: child_after

    remove_child
            -- Remove child at cursor position.
            -- Move cursor to the next sibling, or after if none.
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not child_off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child = old array_item (i)
            swapped_from_item: array_item (i) = old child

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [ARRAYED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [ARRAYED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_leaf implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: arity >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: arity <= capacity
    full_definition: al_full = (arity = capacity)
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child = array_item (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: writable_child implies readable_child
    empty_constraint: is_leaf implies (not readable_child) and (not writable_child)
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from DYNAMIC_CHAIN
    extendible: al_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_TREE


BINARY_SEARCH_TREE Chart

class
    BINARY_SEARCH_TREE [G -> COMPARABLE]

General
    cluster: base.structures.tree
    description:
        "Binary search trees; left child item is less than current item,
        right child item is greater"
    create: make

Ancestors
    BINARY_TREE [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] BINARY_SEARCH_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] BINARY_SEARCH_TREE [G]
    duplicate_all: [like Current] BINARY_SEARCH_TREE [G]
    first_child: [like parent] BINARY_SEARCH_TREE [G]
    has (v: [like item] G): BOOLEAN
    has_both: BOOLEAN
    has_left: BOOLEAN
    has_none: BOOLEAN
    has_right: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] BINARY_SEARCH_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] BINARY_SEARCH_TREE [G]): BOOLEAN
    item: G
    last_child: [like parent] BINARY_SEARCH_TREE [G]
    left_child: [like parent] BINARY_SEARCH_TREE [G]
    left_item: [like item] G
    left_sibling: [like parent] BINARY_SEARCH_TREE [G]
    linear_representation: LINEAR [G]
    max: [like item] G
    min: [like item] G
    object_comparison: BOOLEAN
    parent: BINARY_SEARCH_TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_child: [like parent] BINARY_SEARCH_TREE [G]
    right_item: [like item] G
    right_sibling: [like parent] BINARY_SEARCH_TREE [G]
    sorted: BOOLEAN
    sorted_and_less (i: [like item] G): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    bt_make (v: [like item] G)
    bt_put (v: [like item] G)
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: ARRAYED_LIST_CURSOR)
    child_put (v: [like item] G)
    child_remove
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] BINARY_SEARCH_TREE [G])
    extend (v: [like item] G)
    fill (other: TREE [G])
    i_infix
    make (v: [like item] G)
    node_action (v: [like item] G)
    postorder
    preorder
    prune (n: [like parent] BINARY_SEARCH_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] BINARY_SEARCH_TREE [G])
    replace (v: [like item] G)
    replace_child (n: [like parent] BINARY_SEARCH_TREE [G])
    sort
    sprout


BINARY_SEARCH_TREE Flat contracts

indexing
    description: "[
        Binary search trees; left child item is less than current item,
        right child item is greater
    ]"
    status: "See notice at end of class"
    names: binary_search_tree, tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

class interface
    BINARY_SEARCH_TREE [G -> COMPARABLE]

create

    make (v: like item)
            -- Create single node with item v.
        require
            item_exists: v /= void
        ensure
            node_item: item = v
            no_child: (left_child = void) and (right_child = void)

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.
        require
            item_exists: v /= void
        ensure
            node_item: item = v
            no_child: (left_child = void) and (right_child = void)

    bt_make (v: like item)
            -- Create a root node with value v.
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            is_root: is_root
            is_leaf: is_leaf

feature -- Access

    child: like parent
            -- Child at cursor position
            -- (from BINARY_TREE)
        require -- from TREE
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position
            -- (from BINARY_TREE)

    child_index: INTEGER
            -- Index of cursor position
            -- (from BINARY_TREE)

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    first_child: like parent
            -- Left child
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    has (v: like item): BOOLEAN
            -- Does tree contain a node whose item
            -- is equal to v (object comparison)?
        require -- from  CONTAINER
            True
        require else
            argument_not_void: v /= void
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: G
            -- Content of cell.
            -- (from CELL)

    last_child: like parent
            -- Right child
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    left_child: like parent
            -- Left child, if any
            -- (from BINARY_TREE)

    left_item: like item
            -- Value of left child
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            has_left: left_child /= void

    left_sibling: like parent
            -- Left neighbor, if any
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: BINARY_SEARCH_TREE [G]
            -- Parent of current node

    right_child: like parent
            -- Right child, if any
            -- (from BINARY_TREE)

    right_item: like item
            -- Value of right child
            -- (from BINARY_TREE)
        require -- from BINARY_TREE
            has_right: right_child /= void

    right_sibling: like parent
            -- Right neighbor, if any
            -- (from BINARY_TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children
            -- (from BINARY_TREE)
        ensure then -- from BINARY_TREE
            valid_arity: Result <= 2

    count: INTEGER
            -- Number of items
            -- (from TREE)

    max: like item
            -- Maximum item in tree
        ensure
            maximum_present: has (Result)

    min: like item
            -- Minimum item in tree
        ensure
            minimum_present: has (Result)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?
            -- (from BINARY_TREE)

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?
            -- (from TREE)

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    has_both: BOOLEAN
            -- Has current node two children?
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            Result = (has_left and has_right)

    has_left: BOOLEAN
            -- Has current node a left child?
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            Result = (left_child /= void)

    has_none: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.
            -- (from BINARY_TREE)

    has_right: BOOLEAN
            -- Has current node a right child?
            -- (from BINARY_TREE)
        ensure -- from BINARY_TREE
            Result = (right_child /= void)

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.
            -- (from BINARY_TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    sorted: BOOLEAN
            -- Is tree sorted?

    sorted_and_less (i: like item): BOOLEAN
            -- Is tree sorted and all its elements less then i

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.
            -- (from BINARY_TREE)

    child_finish
            -- Move cursor to last child.
            -- (from BINARY_TREE)
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.
            -- (from BINARY_TREE)

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
            -- (from BINARY_TREE)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: ARRAYED_LIST_CURSOR)
            -- Move cursor to child remembered by p.
            -- (from BINARY_TREE)

    child_start
            -- Move to first child.
            -- (from BINARY_TREE)
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

    i_infix
            -- Apply node_action to every node's item
            -- in tree, using infix order.

    node_action (v: like item)
            -- Operation on node item,
            -- to be defined by descendant classes.
            -- Here it is defined as an empty operation.
            -- Redefine this procedure in descendant classes if useful
            -- operations are to be performed during traversals.

    postorder
            -- Apply node_action to every node's item
            -- in tree, using post-order.

    preorder
            -- Apply node_action to every node's item
            -- in tree, using pre-order.

feature -- Element change

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.
            -- (from BINARY_TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.
            -- (from BINARY_TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    extend (v: like item)
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of put.
        require
            new_item_exists: v /= void
        ensure
            item_inserted: has (v)

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    put (v: like item)
            -- Put v at proper position in tree
            -- (unless v exists already).
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Was declared in BINARY_SEARCH_TREE as synonym of extend.
        require
            new_item_exists: v /= void
        ensure
            item_inserted: has (v)

    bt_put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.
            -- (from BINARY_TREE)

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.
            -- (from BINARY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    child_remove
            -- Remove current child.
            -- (from BINARY_TREE)

    prune (n: like parent)
            -- Prune n from child nodes.
            -- (from BINARY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

feature -- Transformation

    sort
            -- Sort tree.
        ensure
            is_sorted: sorted

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from BINARY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
            -- (from BINARY_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

    duplicate_all: like Current
            -- (from BINARY_TREE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from BINARY_TREE
    tree_is_binary: child_capacity = 2
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_SEARCH_TREE


BINARY_TREE Chart

class
    BINARY_TREE [G]

General
    cluster: base.structures.tree
    description: "Binary tree: each node may have a left child and a right child"
    create: make

Ancestors
    CELL [G]
    TREE [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] BINARY_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] BINARY_TREE [G]
    duplicate_all: [like Current] BINARY_TREE [G]
    first_child: [like parent] BINARY_TREE [G]
    has (v: G): BOOLEAN
    has_both: BOOLEAN
    has_left: BOOLEAN
    has_none: BOOLEAN
    has_right: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] BINARY_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] BINARY_TREE [G]): BOOLEAN
    item: G
    last_child: [like parent] BINARY_TREE [G]
    left_child: [like parent] BINARY_TREE [G]
    left_item: [like item] G
    left_sibling: [like parent] BINARY_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    parent: BINARY_TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_child: [like parent] BINARY_TREE [G]
    right_item: [like item] G
    right_sibling: [like parent] BINARY_TREE [G]
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: ARRAYED_LIST_CURSOR)
    child_put (v: [like item] G)
    child_remove
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] BINARY_TREE [G])
    fill (other: TREE [G])
    make (v: [like item] G)
    prune (n: [like parent] BINARY_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] BINARY_TREE [G])
    put_left_child (n: [like parent] BINARY_TREE [G])
    put_right_child (n: [like parent] BINARY_TREE [G])
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] BINARY_TREE [G])
    sprout

Constraints
    tree is binary


BINARY_TREE Flat contracts

indexing
    description: "Binary tree: each node may have a left child and a right child"
    status: "See notice at end of class"
    names: binary_tree, tree, fixed_tree
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

class interface
    BINARY_TREE [G]

create

    make (v: like item)
            -- Create a root node with value v.
        ensure
            is_root: is_root
            is_leaf: is_leaf

feature -- Initialization

    make (v: like item)
            -- Create a root node with value v.
        ensure
            is_root: is_root
            is_leaf: is_leaf

feature -- Access

    child: like parent
            -- Child at cursor position
        require -- from TREE
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position

    child_index: INTEGER
            -- Index of cursor position

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    first_child: like parent
            -- Left child
        require -- from TREE
            is_not_leaf: not is_leaf

    item: G
            -- Content of cell.
            -- (from CELL)

    last_child: like parent
            -- Right child
        require -- from TREE
            is_not_leaf: not is_leaf

    left_child: like parent
            -- Left child, if any

    left_item: like item
            -- Value of left child
        require
            has_left: left_child /= void

    left_sibling: like parent
            -- Left neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: BINARY_TREE [G]
            -- Parent of current node

    right_child: like parent
            -- Right child, if any

    right_item: like item
            -- Value of right child
        require
            has_right: right_child /= void

    right_sibling: like parent
            -- Right neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children
        ensure then
            valid_arity: Result <= 2

    count: INTEGER
            -- Number of items
            -- (from TREE)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?
            -- (from TREE)

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_both: BOOLEAN
            -- Has current node two children?
        ensure
            Result = (has_left and has_right)

    has_left: BOOLEAN
            -- Has current node a left child?
        ensure
            Result = (left_child /= void)

    has_none: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of is_leaf.

    has_right: BOOLEAN
            -- Has current node a right child?
        ensure
            Result = (right_child /= void)

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- Was declared in BINARY_TREE as synonym of has_none.

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.

    child_finish
            -- Move cursor to last child.
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: ARRAYED_LIST_CURSOR)
            -- Move cursor to child remembered by p.

    child_start
            -- Move to first child.
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in BINARY_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of replace_child.

    put_left_child (n: like parent)
            -- Set left_child to n.
        require
            no_parent: n = void or else n.is_root

    put_right_child (n: like parent)
            -- Set right_child to n.
        require
            no_parent: n = void or else n.is_root

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
            -- Was declared in BINARY_TREE as synonym of put_child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    child_remove
            -- Remove current child.

    prune (n: like parent)
            -- Prune n from child nodes.
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    remove_left_child
            -- Remove left child.
        ensure
            not has_left

    remove_right_child
            -- Remove right child.
        ensure
            not has_right

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

    duplicate_all: like Current

invariant

    tree_is_binary: child_capacity = 2
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BINARY_TREE


DYNAMIC_TREE Chart

deferred class
    DYNAMIC_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees with a dynamically modifiable structure"

Ancestors
    TREE [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] DYNAMIC_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] DYNAMIC_TREE [G]
    Extendible: BOOLEAN
    first_child: [like parent] DYNAMIC_TREE [G]
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] DYNAMIC_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] DYNAMIC_TREE [G]): BOOLEAN
    item: G
    last_child: [like first_child] DYNAMIC_TREE [G]
    left_sibling: [like parent] DYNAMIC_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    parent: DYNAMIC_TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like parent] DYNAMIC_TREE [G]
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    extend (v: [like item] G)
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    merge_tree_after (other: [like first_child] DYNAMIC_TREE [G])
    merge_tree_before (other: [like first_child] DYNAMIC_TREE [G])
    prune (n: [like parent] DYNAMIC_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] DYNAMIC_TREE [G])
    put_child_left (n: [like parent] DYNAMIC_TREE [G])
    put_child_right (n: [like parent] DYNAMIC_TREE [G])
    remove_child
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] DYNAMIC_TREE [G])
    sprout
    wipe_out

Constraints
    extendible definition
    child after definition


DYNAMIC_TREE Flat contracts

indexing
    description: "Trees with a dynamically modifiable structure"
    status: "See notice at end of class"
    names: dynamic_tree, tree
    representation: recursive
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    DYNAMIC_TREE [G]

feature -- Access

    child: like parent
            -- Current child node
            -- (from TREE)
        require -- from TREE
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position
            -- (from TREE)

    child_index: INTEGER
            -- Index of current child
            -- (from TREE)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    child_item: like item
            -- Item in current child node
            -- (from TREE)
        require -- from TREE
            readable: child_readable

    first_child: like parent
            -- Leftmost child
            -- (from TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    item: G
            -- Item in current node
            -- (from TREE)

    last_child: like first_child
            -- Right most child
            -- (from TREE)
        require -- from TREE
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor (if any)
            -- (from TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: DYNAMIC_TREE [G]
            -- Parent of current node.

    right_sibling: like parent
            -- Right neighbor (if any)
            -- (from TREE)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children
            -- (from TREE)

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?
            -- (from TREE)

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?
            -- (from TREE)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?
            -- (from TREE)

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    Extendible: BOOLEAN is True
            -- May new items be added?

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.
            -- (from TREE)

    child_finish
            -- Move cursor to last child.
            -- (from TREE)
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.
            -- (from TREE)

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
            -- (from TREE)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from TREE)

    child_start
            -- Move cursor to first child.
            -- (from TREE)
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    child_extend (v: like item)
            -- Add v to the list of children.
            -- Do not move child cursor.

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
            -- (from TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move child cursor.
        require
            not_child_before: not child_before

    child_put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move child cursor.
        require
            not_child_after: not child_after

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
            -- (from TREE)
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    extend (v: like item)
            -- Add v as new child.

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure
            other_is_leaf: other.is_leaf

    prune (n: like parent)
            -- Remove n from the children.
            -- (from TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    put (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
            -- (from TREE)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require
            not_child_after: not child_after
            non_void_argument: n /= void

    replace (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
            -- (from TREE)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
            -- (from TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    remove_child
            -- Remove child at cursor position.
            -- Move cursor to next sibling, or after if none.
        require
            child_not_off: not child_off
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            is_not_first: not child_isfirst
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
        require
            is_not_last: not child_islast
        ensure
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    wipe_out
            -- Remove all child

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

invariant

    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DYNAMIC_TREE


FIXED_TREE Chart

class
    FIXED_TREE [G]

General
    cluster: base.structures.tree
    description:
        "Trees where each node has a fixed number of children
        (The number of children is arbitrary but cannot be
        changed once the node has been created"
    create: make

Ancestors
    CELL [G]
    FIXED_LIST [G]
    TREE [G]

Queries
    infix "@" (i: INTEGER): FIXED_TREE [G]
    area: SPECIAL [FIXED_TREE [G]]
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    child: FIXED_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_contractable: BOOLEAN
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] FIXED_TREE [G]
    exhausted: BOOLEAN
    first_child: [like parent] FIXED_TREE [G]
    fl_changeable_object_criterion: BOOLEAN
    fl_object_comparison: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: G): BOOLEAN
    index_of (v: [like item] FIXED_TREE [G]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] FIXED_TREE [G]): BOOLEAN
    is_inserted (v: FIXED_TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] FIXED_TREE [G]): BOOLEAN
    item: G
    last_child: [like first] FIXED_TREE [G]
    left_sibling: [like parent] FIXED_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: FIXED_TREE [G]): INTEGER
    parent: FIXED_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    Resizable: BOOLEAN
    right_sibling: [like parent] FIXED_TREE [G]
    sequential_occurrences (v: FIXED_TREE [G]): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [FIXED_TREE [G]])
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] FIXED_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]])
    do_if (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN])
    extend (v: [like item] FIXED_TREE [G])
    fill (other: TREE [G])
    make (n: INTEGER; v: G)
    move (i: INTEGER)
    prune (v: FIXED_TREE [G])
    put (v: [like item] G)
    put_child (n: [like parent] FIXED_TREE [G])
    put_i_th (v: [like item] FIXED_TREE [G]; i: INTEGER)
    put_left (v: [like item] G)
    put_left_sibling (other: [like parent] FIXED_TREE [G])
    put_right (v: [like item] G)
    put_right_sibling (other: [like parent] FIXED_TREE [G])
    remove_child
    replace (v: [like item] G)
    replace_child (n: [like parent] FIXED_TREE [G])
    search_child (v: [like item] FIXED_TREE [G])
    sprout
    swap (i: INTEGER)


FIXED_TREE Flat contracts

indexing
    description: "[
        Trees where each node has a fixed number of children
        (The number of children is arbitrary but cannot be
        changed once the node has been created
    ]"
    names: fixed_tree, tree, fixed_list
    representation: recursive, array
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:46 $"
    revision: "$Revision: 1.3 $"

class interface
    FIXED_TREE [G]

create

    make (n: INTEGER; v: G)
            -- Create node with n void children and item v.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v
            node_arity: arity = n

feature -- Initialization

    make (n: INTEGER; v: G)
            -- Create node with n void children and item v.
        require
            valid_number_of_children: n >= 0
        ensure
            node_item: item = v
            node_arity: arity = n

feature -- Access

    child_item: like item
            -- Item of active child
        require -- from TREE
            readable: child_readable

    child_cursor: CURSOR
            -- Current cursor position
            -- (from FIXED_LIST)

    first_child: like parent
            -- Leftmost child
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    child_index: INTEGER
            -- Current position in the list
            -- (from FIXED_LIST)

    index_of (v: like child; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Content of cell.
            -- (from CELL)

    child: FIXED_TREE [G]
            -- Current item
            -- (from FIXED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: fl_readable
        require -- from TREE
            readable: readable_child

    last_child: like first_child
            -- Item at last position
            -- (from FIXED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf
        require -- from TREE
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    sequential_occurrences (v: FIXED_TREE [G]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: FIXED_TREE [G]
            -- Parent of current node

    right_sibling: like parent
            -- Right neighbor, if any
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

    infix "@" (i: INTEGER): FIXED_TREE [G]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [FIXED_TREE [G]]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- (from FIXED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: FIXED_TREE [G]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    fl_changeable_object_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_contractable: BOOLEAN
            -- May items be removed?
        ensure
            Result = not child_off

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Full: BOOLEAN is True
            -- Is tree full?

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: FIXED_TREE [G]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    fl_object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from FIXED_LIST)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    Resizable: BOOLEAN is False
            -- May capacity be changed? (Answer: no.)
            -- (from FIXED)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Is p a valid cursor?
            -- (from FIXED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (from FIXED_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next position, if any.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from FIXED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to element remembered in p.
            -- (from FIXED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from FIXED_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)

    search_child (v: like child)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child)
            item_found: (not exhausted and not object_comparison) implies v = child

    child_start
            -- Move cursor to first position.
            -- (from FIXED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    append (s: SEQUENCE [FIXED_TREE [G]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    child_put (v: like item)
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_replace.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Replace current child item with v
            -- Was declared in FIXED_TREE as synonym of child_put.
        require -- from TREE
            child_writable: child_writable
        ensure -- from TREE
            item_inserted: child_item = v

    extend (v: like child)
            -- Add v to end.
            -- Move index to the current item.
            -- (from FIXED_LIST)
        require -- from COLLECTION
            extendible: fl_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    put_i_th (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: array_item (k) = v

    put_child (n: like parent)
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of replace_child.
        ensure then
            child_replaced: n.parent = Current

    put_left (v: like item)
            -- Add v to the left of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        ensure
            item_put: left_sibling.item = v

    put_left_sibling (other: like parent)
            -- Make other the left sibling of current node.
        require
            is_not_root: not is_root
            has_left_sibling: left_sibling /= void
        ensure
            left_sibling_replaced: left_sibling = other

    put_right (v: like item)
            -- Add v to the right of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        ensure
            item_put: right_sibling.item = v

    put_right_sibling (other: like parent)
            -- Make other the right sibling of current node.
        require
            is_not_root: not is_root
            has_right_sibling: right_sibling /= void
        ensure
            right_sibling_replaced: right_sibling = other

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    replace_child (n: like parent)
            -- Make n the node's child.
            -- Was declared in FIXED_TREE as synonym of put_child.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n
        ensure then
            child_replaced: n.parent = Current

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    remove_child
            -- Remove active child.
        ensure then
            child_removed: child = void

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from FIXED_LIST)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child = old array_item (i)
            swapped_from_item: array_item (i) = old child

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require -- from CHAIN
            not_off_unless_after: child_off implies child_after
            valid_subchain: n >= 0
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Inapplicable

    prune (v: FIXED_TREE [G])
            -- Remove first occurrence of v if any.
            -- (Precondition is False.)
            -- (from ARRAY)
        require -- from COLLECTION
            prunable: prunable
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [FIXED_TREE [G]]]; test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [FIXED_TREE [G]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from FIXED_LIST
    empty_means_storage_empty: is_leaf implies all_default
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child = array_item (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: fl_writable implies fl_readable
    empty_constraint: is_leaf implies (not fl_readable) and (not fl_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: arity >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: arity <= capacity
    full_definition: fl_full = (arity = capacity)
        -- from FIXED
    not_resizable: not resizable

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIXED_TREE


LINKED_TREE Chart

class
    LINKED_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees implemented using a linked list representation"
    create: make

Ancestors
    DYNAMIC_TREE [G]
    LINKABLE [G]
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] LINKED_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] LINKED_TREE [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_child: [like parent] LINKED_TREE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_TREE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] LINKED_TREE [G]): BOOLEAN
    item: G
    last: [like item] G
    last_child: [like first_element] LINKED_TREE [G]
    left_sibling: [like parent] LINKED_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    parent: LINKED_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] LINKED_TREE [G]
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    force (v: [like item] G)
    ll_prune (v: [like item] G)
    make (v: [like item] G)
    merge_tree_after (other: [like first_child] LINKED_TREE [G])
    merge_tree_before (other: [like first_child] LINKED_TREE [G])
    move (i: INTEGER)
    prune (n: [like first_child] LINKED_TREE [G])
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_child (n: [like parent] LINKED_TREE [G])
    put_child_left (n: [like parent] LINKED_TREE [G])
    put_child_right (n: [like parent] LINKED_TREE [G])
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    replace (v: [like item] G)
    replace_child (n: [like parent] LINKED_TREE [G])
    search_child (v: [like item] G)
    sprout
    swap (i: INTEGER)
    wipe_out

Constraints
    no void child


LINKED_TREE Flat contracts

indexing
    description: "Trees implemented using a linked list representation"
    status: "See notice at end of class"
    names: linked_tree, tree, linked_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_TREE [G]

create

    make (v: like item)
            -- Create single node with item v.
        ensure
            is_root
            is_leaf

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.
        ensure
            is_root
            is_leaf

feature -- Access

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    first_child: like parent
            -- Leftmost child

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    child_item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    item: G
            -- Content of cell.
            -- (from CELL)

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    left_sibling: like parent
            -- Left neighbor (if any)
        require -- from TREE
            is_not_root: not is_root
        ensure -- from TREE
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: LINKED_TREE [G]
            -- Parent of current node

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before

    child_forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    prune (n: like first_child)
            -- Prune n from children.
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    ll_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

    last_child: like first_child
            -- Tail of list
            -- (from LINKED_LIST)
        require -- from TREE
            is_not_leaf: not is_leaf

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    no_void_child: readable_child = child_readable
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE


TREE Chart

deferred class
    TREE [G]

General
    cluster: base.structures.tree
    description: "Trees, without commitment to a particular representation"

Ancestors
    CONTAINER [G]

Queries
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like parent] TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: [like item] G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] TREE [G]
    first_child: [like parent] TREE [G]
    has (v: G): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] TREE [G]): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] TREE [G]): BOOLEAN
    item: G
    last_child: [like first_child] TREE [G]
    left_sibling: [like parent] TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    parent: TREE [G]
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like parent] TREE [G]
    valid_cursor_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    child_back
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    fill (other: TREE [G])
    prune (n: [like parent] TREE [G])
    put (v: [like item] G)
    replace (v: [like item] G)
    replace_child (n: [like parent] TREE [G])
    sprout

Constraints
    leaf definition
    child off definition
    child before definition
    child isfirst definition
    child islast definition
    child after definition
    child consistency


TREE Flat contracts

indexing
    description: "Trees, without commitment to a particular representation"
    status: "See notice at end of class"
    names: tree
    access: cursor, membership
    representation: recursive
    contents: generic
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    TREE [G]

feature -- Access

    child: like parent
            -- Current child node
        require
            readable: readable_child

    child_cursor: CURSOR
            -- Current cursor position

    child_index: INTEGER
            -- Index of current child
        ensure
            valid_index: Result >= 0 and Result <= arity + 1

    child_item: like item
            -- Item in current child node
        require
            readable: child_readable

    first_child: like parent
            -- Leftmost child
        require
            is_not_leaf: not is_leaf

    item: G
            -- Item in current node

    last_child: like first_child
            -- Right most child
        require
            is_not_leaf: not is_leaf

    left_sibling: like parent
            -- Left neighbor (if any)
        require
            is_not_root: not is_root
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            right_is_current: (Result /= void) implies (Result.right_sibling = Current)

    parent: TREE [G]
            -- Parent of current node

    right_sibling: like parent
            -- Right neighbor (if any)
        require
            is_not_root: not is_root
        ensure
            is_sibling: Result /= void implies is_sibling (Result)
            left_is_current: (Result /= void) implies (Result.left_sibling = Current)

feature -- Measurement

    arity: INTEGER
            -- Number of children

    child_capacity: INTEGER
            -- Maximal number of children

    count: INTEGER
            -- Number of items

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_after: BOOLEAN
            -- Is there no valid child position to the right of cursor?

    child_before: BOOLEAN
            -- Is there no valid child position to the left of cursor?

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
        ensure
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
        ensure
            not_is_leaf: Result implies not is_leaf

    child_off: BOOLEAN
            -- Is there no current child?

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    is_empty: BOOLEAN
            -- Is structure empty of items?

    is_leaf: BOOLEAN
            -- Are there no children?

    is_root: BOOLEAN
            -- Is there no parent?

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
        require
            other_exists: other /= void
        ensure
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    Readable: BOOLEAN is True

    readable_child: BOOLEAN
            -- Is there a current child to be read?

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
        ensure
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous child.

    child_finish
            -- Move cursor to last child.
        ensure then
            is_last_child: not is_leaf implies child_islast

    child_forth
            -- Move cursor to next child.

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th child.
        require else
            valid_cursor_index: valid_cursor_index (i)
        ensure then
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.

    child_start
            -- Move cursor to first child.
        ensure then
            is_first_child: not is_leaf implies child_isfirst

feature -- Element change

    child_put (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_replace.
        require
            child_writable: child_writable
        ensure
            item_inserted: child_item = v

    child_replace (v: like item)
            -- Put v at current child position.
            -- Was declared in TREE as synonym of child_put.
        require
            child_writable: child_writable
        ensure
            item_inserted: child_item = v

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.

    prune (n: like parent)
            -- Remove n from the children.
        require
            is_child: n.parent = Current
        ensure
            n_is_root: n.is_root

    put (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of replace.
        require
            is_writable: writable
        ensure
            item_inserted: item = v

    replace (v: like item)
            -- Replace element at cursor position by v.
            -- Was declared in TREE as synonym of put.
        require
            is_writable: writable
        ensure
            item_inserted: item = v

    replace_child (n: like parent)
            -- Put n at current child position.
        require
            writable_child: writable_child
            was_root: n.is_root
        ensure
            child_replaced: child = n

    sprout
            -- Make current node a root.

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
        ensure
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    linear_representation: LINEAR [G]
            -- Representation as a linear structure

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children.
        require
            not_child_off: not child_off
            valid_sublist: n >= 0

invariant

    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TREE


TWO_WAY_TREE Chart

class
    TWO_WAY_TREE [G]

General
    cluster: base.structures.tree
    description: "Trees implemented using a two way linked list representation"
    create: make

Ancestors
    BI_LINKABLE [G]
    DYNAMIC_TREE [G]
    TWO_WAY_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    arity: INTEGER
    binary_representation: BINARY_TREE [G]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] TWO_WAY_TREE [G]
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: G
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    count: INTEGER
    duplicate (n: INTEGER): [like Current] TWO_WAY_TREE [G]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    first_child: [like parent] TWO_WAY_TREE [G]
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    has (v: G): BOOLEAN
    i_th (i: INTEGER): [like item] G
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TWO_WAY_TREE [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_leaf: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] TWO_WAY_TREE [G]): BOOLEAN
    item: G
    last: [like item] G
    last_child: [like parent] TWO_WAY_TREE [G]
    left_sibling: [like Current] TWO_WAY_TREE [G]
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    parent: TWO_WAY_TREE [G]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] TWO_WAY_TREE [G]
    sequential_occurrences (v: G): INTEGER
    sublist: [like Current] TWO_WAY_TREE [G]
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    child_back
    child_extend (v: [like item] G)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] G)
    child_put_left (v: [like item] G)
    child_put_right (v: [like item] G)
    child_replace (v: [like item] G)
    child_start
    compare_objects
    compare_references
    copy (other: [like Current] TWO_WAY_TREE [G])
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: TREE [G])
    fill_from_binary (b: BINARY_TREE [G])
    force (v: [like item] G)
    make (v: [like item] G)
    merge_tree_after (other: [like first_child] TWO_WAY_TREE [G])
    merge_tree_before (other: [like first_child] TWO_WAY_TREE [G])
    move (i: INTEGER)
    prune (n: [like first_child] TWO_WAY_TREE [G])
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_child (n: [like parent] TWO_WAY_TREE [G])
    put_child_left (n: [like parent] TWO_WAY_TREE [G])
    put_child_right (n: [like parent] TWO_WAY_TREE [G])
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] G)
    replace_child (n: [like parent] TWO_WAY_TREE [G])
    search_child (v: [like item] G)
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] TWO_WAY_TREE [G])
    twl_merge_right (other: [like Current] TWO_WAY_TREE [G])
    twl_prune (v: [like item] G)
    wipe_out

Constraints
    off constraint


TWO_WAY_TREE Flat contracts

indexing
    description: "Trees implemented using a two way linked list representation"
    status: "See notice at end of class"
    names: two_way_tree, tree, two_way_list
    representation: recursive, linked
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    TWO_WAY_TREE [G]

create

    make (v: like item)
            -- Create single node with item v.

feature -- Initialization

    make (v: like item)
            -- Create single node with item v.

feature -- Access

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    first_child: like parent
            -- Leftmost child

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    child_item: G
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    item: G
            -- Content of cell.
            -- (from CELL)

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    last_child: like parent

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: TWO_WAY_TREE [G]
            -- Parent node

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: G): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
            -- Prune n from children.
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    put (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of replace.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [G]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [G])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    off_constraint: (child = void) implies child_off
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_leaf implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE


cluster base.support

Cluster
    base.support

Supercluster
    base

Classes
    ASCII
    BOOL_STRING
    COUNTABLE_SEQUENCE [G]
    DOUBLE_MATH
    EXECUTION_ENVIRONMENT
    FIBONACCI
    FORMAT_DOUBLE
    FORMAT_INTEGER
    IDENTIFIED
    IDENTIFIED_CONTROLLER
    INTERNAL
    MATH_CONST
    OPERATING_ENVIRONMENT
    PRIMES
    PROFILING_SETTING
    RANDOM
    SINGLE_MATH


ASCII Chart

class
    ASCII

General
    cluster: base.support
    description:
        "The ASCII character set.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY

Queries
    Ack: INTEGER
    Ampersand: INTEGER
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    Eot: INTEGER
    Equal_sign: INTEGER
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    Gs: INTEGER
    Home_arrow: INTEGER
    Ht: INTEGER
    Last_ascii: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    Line_feed: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    Percent: INTEGER
    Plus: INTEGER
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    Right_arrow: INTEGER
    Rs: INTEGER
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    Vt: INTEGER
    Zero: INTEGER


ASCII Flat contracts

indexing
    description: "[
        The ASCII character set.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    ASCII

feature -- Access

    Ack: INTEGER is 6

    Ampersand: INTEGER is 38

    Back_space: INTEGER is 8

    Backslash: INTEGER is 92

    Bar: INTEGER is 124

    Bel: INTEGER is 7

    Blank: INTEGER is 32

    Break: INTEGER is -7

    Bs: INTEGER is 8

    Buf_overflow: INTEGER is -9

    Can: INTEGER is 24

    Carriage_return: INTEGER is 13

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a

    Character_set_size: INTEGER is 128

    Circumflex: INTEGER is 94

    Closing_brace: INTEGER is 125

    Colon: INTEGER is 58

    Comma: INTEGER is 44

    Commercial_at: INTEGER is 64

    Cr: INTEGER is 13

    Ctrl_a: INTEGER is 1

    Ctrl_b: INTEGER is 2

    Ctrl_backslash: INTEGER is 28

    Ctrl_c: INTEGER is 3

    Ctrl_circumflex: INTEGER is 30

    Ctrl_d: INTEGER is 4

    Ctrl_e: INTEGER is 5

    Ctrl_f: INTEGER is 6

    Ctrl_g: INTEGER is 7

    Ctrl_h: INTEGER is 8

    Ctrl_i: INTEGER is 9

    Ctrl_j: INTEGER is 10

    Ctrl_k: INTEGER is 11

    Ctrl_l: INTEGER is 12

    Ctrl_lbracket: INTEGER is 27

    Ctrl_m: INTEGER is 13

    Ctrl_n: INTEGER is 14

    Ctrl_o: INTEGER is 15

    Ctrl_p: INTEGER is 16

    Ctrl_q: INTEGER is 17

    Ctrl_questmark: INTEGER is 127

    Ctrl_r: INTEGER is 18

    Ctrl_rbracket: INTEGER is 29

    Ctrl_s: INTEGER is 19

    Ctrl_t: INTEGER is 20

    Ctrl_u: INTEGER is 21

    Ctrl_underlined: INTEGER is 31

    Ctrl_v: INTEGER is 22

    Ctrl_w: INTEGER is 23

    Ctrl_x: INTEGER is 24

    Ctrl_y: INTEGER is 25

    Ctrl_z: INTEGER is 26

    Dc1: INTEGER is 17

    Dc2: INTEGER is 18

    Dc3: INTEGER is 19

    Dc4: INTEGER is 20

    Del: INTEGER is 127

    Dle: INTEGER is 16

    Dollar: INTEGER is 36

    Dot: INTEGER is 46

    Doublequote: INTEGER is 34

    Down_arrow: INTEGER is -3

    Eight: INTEGER is 56

    Em: INTEGER is 25

    Enq: INTEGER is 5

    Eot: INTEGER is 4

    Equal_sign: INTEGER is 61

    Esc: INTEGER is 27

    Etb: INTEGER is 23

    Etx: INTEGER is 3

    Exclamation: INTEGER is 33

    First_printable: INTEGER is 32

    Five: INTEGER is 53

    Four: INTEGER is 52

    Fs: INTEGER is 28

    Grave_accent: INTEGER is 96

    Greaterthan: INTEGER is 62

    Gs: INTEGER is 29

    Home_arrow: INTEGER is -6

    Ht: INTEGER is 9

    Last_ascii: INTEGER is 127

    Last_printable: INTEGER is 126

    Lbracket: INTEGER is 91

    Lcurly: INTEGER is 40

    Left_arrow: INTEGER is -4

    Lessthan: INTEGER is 60

    Letter_layout: INTEGER is 70

    Line_feed: INTEGER is 10

    Lower_a: INTEGER is 97

    Lower_b: INTEGER is 98

    Lower_c: INTEGER is 99

    Lower_d: INTEGER is 100

    Lower_e: INTEGER is 101

    Lower_f: INTEGER is 102

    Lower_g: INTEGER is 103

    Lower_h: INTEGER is 104

    Lower_i: INTEGER is 105

    Lower_j: INTEGER is 106

    Lower_k: INTEGER is 107

    Lower_l: INTEGER is 108

    Lower_m: INTEGER is 109

    Lower_n: INTEGER is 110

    Lower_o: INTEGER is 111

    Lower_p: INTEGER is 112

    Lower_q: INTEGER is 113

    Lower_r: INTEGER is 114

    Lower_s: INTEGER is 115

    Lower_t: INTEGER is 116

    Lower_u: INTEGER is 117

    Lower_v: INTEGER is 118

    Lower_w: INTEGER is 119

    Lower_x: INTEGER is 120

    Lower_y: INTEGER is 121

    Lower_z: INTEGER is 122

    Minus: INTEGER is 45

    Nak: INTEGER is 21

    Nine: INTEGER is 57

    Nl: INTEGER is 10

    Np: INTEGER is 12

    Nul: INTEGER is 0

    Number_sign: INTEGER is 35

    One: INTEGER is 49

    Opening_brace: INTEGER is 123

    Overflow: INTEGER is -8

    Percent: INTEGER is 37

    Plus: INTEGER is 43

    Questmark: INTEGER is 63

    Rbracket: INTEGER is 93

    Rcurly: INTEGER is 41

    Right_arrow: INTEGER is -5

    Rs: INTEGER is 30

    Semicolon: INTEGER is 59

    Seven: INTEGER is 55

    Si: INTEGER is 15

    Singlequote: INTEGER is 39

    Six: INTEGER is 54

    Slash: INTEGER is 47

    So: INTEGER is 14

    Soh: INTEGER is 1

    Sp: INTEGER is 32

    Star: INTEGER is 42

    Stx: INTEGER is 2

    Sub: INTEGER is 26

    Syn: INTEGER is 22

    Tabulation: INTEGER is 9

    Three: INTEGER is 51

    Tilde: INTEGER is 126

    Two: INTEGER is 50

    Underlined: INTEGER is 95

    Up_arrow: INTEGER is -2

    Upper_a: INTEGER is 65

    Upper_b: INTEGER is 66

    Upper_c: INTEGER is 67

    Upper_d: INTEGER is 68

    Upper_e: INTEGER is 69

    Upper_f: INTEGER is 70

    Upper_g: INTEGER is 71

    Upper_h: INTEGER is 72

    Upper_i: INTEGER is 73

    Upper_j: INTEGER is 74

    Upper_k: INTEGER is 75

    Upper_l: INTEGER is 76

    Upper_m: INTEGER is 77

    Upper_n: INTEGER is 78

    Upper_o: INTEGER is 79

    Upper_p: INTEGER is 80

    Upper_q: INTEGER is 81

    Upper_r: INTEGER is 82

    Upper_s: INTEGER is 83

    Upper_t: INTEGER is 84

    Upper_u: INTEGER is 85

    Upper_v: INTEGER is 86

    Upper_w: INTEGER is 87

    Upper_x: INTEGER is 88

    Upper_y: INTEGER is 89

    Upper_z: INTEGER is 90

    Us: INTEGER is 31

    Vt: INTEGER is 11

    Zero: INTEGER is 48

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ASCII


BOOL_STRING Chart

class
    BOOL_STRING

General
    cluster: base.support
    description: "Packed boolean strings"
    create: make

Ancestors
    TO_SPECIAL [T]

Queries
    infix "and" (other: [like Current] BOOL_STRING): [like Current] BOOL_STRING
    infix "or" (other: [like Current] BOOL_STRING): [like Current] BOOL_STRING
    infix "xor" (other: [like Current] BOOL_STRING): [like Current] BOOL_STRING
    prefix "not": [like Current] BOOL_STRING
    count: INTEGER
    item (i: INTEGER): BOOLEAN
    left_shifted (n: INTEGER): [like Current] BOOL_STRING
    right_shifted (n: INTEGER): [like Current] BOOL_STRING

Commands
    all_false
    all_true
    make (n: INTEGER)
    put (v: [like item] BOOLEAN; i: INTEGER)


BOOL_STRING Flat contracts

indexing
    description: "Packed boolean strings"
    status: "See notice at end of class"
    names: packed_booleans
    access: index
    representation: array
    size: fixed
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    BOOL_STRING

create

    make (n: INTEGER)
            -- Allocate area of n booleans.
        require
            non_negative_size: n >= 0
        ensure
            correct_allocation: count = n

feature -- Initialization

    make (n: INTEGER)
            -- Allocate area of n booleans.
        require
            non_negative_size: n >= 0
        ensure
            correct_allocation: count = n

feature -- Access

    item (i: INTEGER): BOOLEAN
            -- Boolean at i-th position,
            -- beginning at left, 1 origin
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count

feature -- Measurement

    count: INTEGER
            -- Number of boolean in the area.

feature -- Element change

    all_false
            -- Set all booleans to false.

    all_true
            -- Set all booleans to true.

    put (v: like item; i: INTEGER)
            -- Put boolean v at i-th position
            -- beginning at left, 1 origin.
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count

feature -- Basic operations

    left_shifted (n: INTEGER): like Current
            -- Left shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0

    right_shifted (n: INTEGER): like Current
            -- Right shifted 'Current' set, by n positions
        require
            non_negative_shift: n >= 0

    infix "and" (other: like Current): like Current
            -- Logical and of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

    prefix "not": like Current
            -- Negation of 'Current'

    infix "or" (other: like Current): like Current
            -- Logical or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

    infix "xor" (other: like Current): like Current
            -- Logical exclusive or of 'Current' and other
        require
            other_not_void: other /= void
            same_size: other.count = count

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class BOOL_STRING


COUNTABLE_SEQUENCE Chart

deferred class
    COUNTABLE_SEQUENCE [G]

General
    cluster: base.support
    description: "Infinite sequences, indexed by integers"

Ancestors
    ACTIVE [G]
    COUNTABLE [G]
    LINEAR [G]

Queries
    After: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    forth
    search (v: [like item] G)
    start


COUNTABLE_SEQUENCE Flat contracts

indexing
    description: "Infinite sequences, indexed by integers"
    status: "See notice at end of class"
    names: countable_sequence, infinite_sequence
    access: cursor, membership
    contents: generic
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    COUNTABLE_SEQUENCE [G]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): G
            -- Item of rank i
        require -- from COUNTABLE
            positive_argument: i > 0

    index: INTEGER
            -- Index of current position

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COUNTABLE_SEQUENCE


DOUBLE_MATH Chart

class
    DOUBLE_MATH

General
    cluster: base.support
    description:
        "Basic mathematical operations, double-precision.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    MATH_CONST

Queries
    arc_cosine (v: DOUBLE): DOUBLE
    arc_sine (v: DOUBLE): DOUBLE
    arc_tangent (v: DOUBLE): DOUBLE
    ceiling (v: DOUBLE): DOUBLE
    cosine (v: DOUBLE): DOUBLE
    dabs (v: DOUBLE): DOUBLE
    exp (x: DOUBLE): DOUBLE
    floor (v: DOUBLE): DOUBLE
    log (v: DOUBLE): DOUBLE
    log10 (v: DOUBLE): DOUBLE
    log_2 (v: DOUBLE): DOUBLE
    sine (v: DOUBLE): DOUBLE
    sqrt (v: DOUBLE): DOUBLE
    tangent (v: DOUBLE): DOUBLE


DOUBLE_MATH Flat contracts

indexing
    description: "[
        Basic mathematical operations, double-precision.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    DOUBLE_MATH

feature -- Access

    arc_cosine (v: DOUBLE): DOUBLE
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]

    arc_sine (v: DOUBLE): DOUBLE
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]

    arc_tangent (v: DOUBLE): DOUBLE
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]

    ceiling (v: DOUBLE): DOUBLE
            -- Least integral greater than or equal to v

    cosine (v: DOUBLE): DOUBLE
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]

    dabs (v: DOUBLE): DOUBLE
            -- Absolute of v

    exp (x: DOUBLE): DOUBLE
            -- Exponential of v.

    floor (v: DOUBLE): DOUBLE
            -- Greatest integral less than or equal to v

    log (v: DOUBLE): DOUBLE
            -- Natural logarithm of v

    log10 (v: DOUBLE): DOUBLE
            -- Base 10 logarithm of v

    log_2 (v: DOUBLE): DOUBLE
            -- Base 2 logarithm of v

    sine (v: DOUBLE): DOUBLE
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]

    sqrt (v: DOUBLE): DOUBLE
            -- Square root of v

    tangent (v: DOUBLE): DOUBLE
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DOUBLE_MATH


EXECUTION_ENVIRONMENT Chart

class
    EXECUTION_ENVIRONMENT

General
    cluster: base.support
    description: "The objects available from the environment at time of execution"

Ancestors
    ANY

Queries
    Command_line: ARGUMENTS
    current_working_directory: STRING
    Default_shell: STRING
    get (s: STRING): STRING
    home_directory_name: STRING
    return_code: INTEGER
    root_directory_name: STRING

Commands
    change_working_directory (path: STRING)
    launch (s: STRING)
    put (value, key: STRING)
    system (s: STRING)


EXECUTION_ENVIRONMENT Flat contracts

indexing
    description: "The objects available from the environment at time of execution"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EXECUTION_ENVIRONMENT

feature -- Access

    command_line: ARGUMENTS
            -- Command line that was used to start current execution

    current_working_directory: STRING
            -- Directory of current execution
        ensure
            result_not_void: Result /= void

    default_shell: STRING
            -- Default shell

    get (s: STRING): STRING
            -- Value of s if it is an environment variable and has been set;
            -- void otherwise.
        require
            s_exists: s /= void

    home_directory_name: STRING
            -- Directory name corresponding to the home directory.
        require
            home_directory_supported: operating_environment.home_directory_supported

    root_directory_name: STRING
            -- Directory name corresponding to the root directory.
        require
            root_directory_supported: operating_environment.root_directory_supported
        ensure
            result_not_void: Result /= void

feature -- Status setting

    change_working_directory (path: STRING)
            -- Set the current directory to path

    launch (s: STRING)
            -- Pass to the operating system an asynchronous request to
            -- execute s.
            -- If s is empty, use the default shell as command.
        require
            s_not_void: s /= void

    put (value, key: STRING)
            -- Set the environment variable key to value.
        require
            key_exists: key /= void
            key_meaningful: key.count > 0
            value_exists: value /= void
        ensure
            variable_set: (return_code = 0) implies (value.is_equal (get (key)))

    system (s: STRING)
            -- Pass to the operating system a request to execute s.
            -- If s is empty, use the default shell as command.
        require
            s_exists: s /= void

feature -- Status

    return_code: INTEGER
            -- Status code set by last call to system or put

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class EXECUTION_ENVIRONMENT


FIBONACCI Chart

class
    FIBONACCI

General
    cluster: base.support
    description: "The Fibonacci number sequence"

Ancestors
    COUNTABLE_SEQUENCE [G]

Queries
    After: BOOLEAN
    all_lower_fibonacci (n: INTEGER): ARRAY [BOOLEAN]
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    First: INTEGER
    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    higher_fibonacci (n: INTEGER): INTEGER
    i_th (i: INTEGER): INTEGER
    index: INTEGER
    index_of (v: [like item] INTEGER; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_fibonacci (n: INTEGER): BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item: INTEGER
    lower_fibonacci (n: INTEGER): INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    Second: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
    forth
    search (v: [like item] INTEGER)
    start


FIBONACCI Flat contracts

indexing
    description: "The Fibonacci number sequence"
    status: "See notice at end of class"
    names: fibonacci
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    FIBONACCI

feature -- Access

    all_lower_fibonacci (n: INTEGER): ARRAY [BOOLEAN]
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is a Fibonacci number.

    First: INTEGER is 1

    higher_fibonacci (n: INTEGER): INTEGER
            -- Lowest Fibonacci number greater than or equal to n

    i_th (i: INTEGER): INTEGER
            -- The i-th Fibonacci number
        require -- from COUNTABLE
            positive_argument: i > 0

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    is_fibonacci (n: INTEGER): BOOLEAN
            -- Is n a Fibonacci number?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: INTEGER
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    lower_fibonacci (n: INTEGER): INTEGER
            -- Greatest Fibonacci number lower than or equal to n
        require
            argument_big_enough: n >= second

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    Second: INTEGER is 1

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FIBONACCI


FORMAT_DOUBLE Chart

class
    FORMAT_DOUBLE

General
    cluster: base.support
    description: "Formatter for non-integral numbers"
    create: make

Ancestors
    DOUBLE_MATH
    FORMAT_INTEGER

Queries
    after_decimal_separate: BOOLEAN
    bracketted_negative: BOOLEAN
    centered: BOOLEAN
    decimal: CHARACTER
    decimals: INTEGER
    fill_character: CHARACTER
    formatted (d: DOUBLE): STRING
    ignore_sign: BOOLEAN
    justification: INTEGER
    leading_sign: BOOLEAN
    left_justified: BOOLEAN
    no_separator: BOOLEAN
    not_justified: BOOLEAN
    right_justified: BOOLEAN
    separator: CHARACTER
    show_sign: BOOLEAN
    show_sign_negative: BOOLEAN
    show_sign_positive: BOOLEAN
    sign_format: INTEGER
    sign_string: STRING
    trailing_sign: BOOLEAN
    width: INTEGER
    zero_not_shown: BOOLEAN

Commands
    asterisk_fill
    blank_fill
    bracket_negative
    center_justify
    comma_decimal
    comma_separate
    dollar_fill
    dot_separate
    hide_zero
    left_justify
    make (w, d: INTEGER)
    no_justify
    no_separate_after_decimal
    point_decimal
    remove_separator
    right_justify
    separate_after_decimal
    set_decimals (d: INTEGER)
    set_defaults (w: INTEGER)
    set_fill (c: CHARACTER)
    set_separator (c: CHARACTER)
    set_sign (s: STRING)
    set_width (w: INTEGER)
    show_zero
    sign_cr_dr
    sign_dr_cr
    sign_floating_dollar
    sign_floating_dollar_signed
    sign_ignore
    sign_leading
    sign_negative_only
    sign_normal
    sign_positive_only
    sign_show
    sign_trailing
    unbracket_negative
    underscore_separate
    zero_fill

Constraints
    separate all


FORMAT_DOUBLE Flat contracts

indexing
    description: "Formatter for non-integral numbers"
    status: "See notice at end of class"
    names: format_double
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    FORMAT_DOUBLE

create

    make (w, d: INTEGER)
        require
            reasonable_field: w >= 1
            reasonable_decimals: d <= w
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
            decimals_set: decimals = d
            decimal_point: decimal = '.'

feature -- Initialization

    make (w, d: INTEGER)
        require
            reasonable_field: w >= 1
            reasonable_decimals: d <= w
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign
            decimals_set: decimals = d
            decimal_point: decimal = '.'

    set_defaults (w: INTEGER)
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            reasonable_field: w >= 1
        ensure -- from FORMAT_INTEGER
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign

feature -- Access

    after_decimal_separate: BOOLEAN
            -- Use separators after the decimal?

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?
            -- (from FORMAT_INTEGER)

    decimal: CHARACTER
            -- What is used for the decimal

    decimals: INTEGER
            -- Number of digits after the decimal point.

    fill_character: CHARACTER
            -- Padding character.
            -- (from FORMAT_INTEGER)

    justification: INTEGER
            -- Where in the field the format goes.
            -- (from FORMAT_INTEGER)

    separator: CHARACTER
            -- Separator between 1000's of numbers.
            -- (from FORMAT_INTEGER)

    sign_format: INTEGER
            -- How the sign is formatted.
            -- (from FORMAT_INTEGER)

    sign_string: STRING
            -- Formatting details for the sign.
            -- (from FORMAT_INTEGER)

    trailing_sign: BOOLEAN
            -- Is the sign at the end?
            -- (from FORMAT_INTEGER)

    width: INTEGER
            -- Width of the field.
            -- (from FORMAT_INTEGER)

    zero_not_shown: BOOLEAN
            -- Show 0.5 as .5 or 0.5?

feature -- Status report

    centered: BOOLEAN
            -- Are numbers to be formatted centered?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = center_justification)

    ignore_sign: BOOLEAN
            -- Ignore the sign of a number?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = ignore_sign_value)

    leading_sign: BOOLEAN
            -- Is the sign leading?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = not trailing_sign

    left_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the right?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = left_justification)

    no_separator: BOOLEAN
            -- Is there a separator?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (separator = '%U')

    not_justified: BOOLEAN
            -- Are numbers to be formatted in smallest string possible
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = no_justification)

    right_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the left?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (justification = right_justification)

    show_sign: BOOLEAN
            -- Are numbers to show sign whether positive or negative?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = show_sign_value)

    show_sign_negative: BOOLEAN
            -- Are numbers to show sign only when negative?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = sign_negative_value)

    show_sign_positive: BOOLEAN
            -- Are numbers to show sign only when positive?
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            Result = (sign_format = sign_positive_value)

feature -- Status setting

    asterisk_fill
            -- Fill numbers with asterisks.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = '*'

    blank_fill
            -- Fill numbers with blanks.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = ' '

    bracket_negative
            -- Bracket negative numbers.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            bracketted_negative

    center_justify
            -- Put padding on right and left
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            centered

    comma_decimal
            -- Use , as the decimal point.
        ensure
            decimal = ','

    comma_separate
            -- Set the separator to be comma.
        ensure -- from FORMAT_INTEGER
            separator = ','
        ensure then
            after_decimal_separate

    dollar_fill
            -- Fill numbers with dollars.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = '$'

    dot_separate
            -- Set separator to period.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            separator = '.'

    hide_zero
            -- Show 0.5 as .5 .
        ensure
            zero_not_shown

    left_justify
            --Put padding on right
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            left_justified

    no_justify
            -- Always return the smallest string possible
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            not_justified

    no_separate_after_decimal
            -- Do not use separators after the decimal.
        ensure
            not after_decimal_separate

    point_decimal
            -- Use . as the decimal point.
        ensure
            decimal = '.'

    remove_separator
            -- Remove the separator.
        ensure -- from FORMAT_INTEGER
            separator = '%U'
        ensure then
            not after_decimal_separate

    right_justify
            -- Put padding on left
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            right_justified

    separate_after_decimal
            -- Use separators after the decimal.
        ensure
            after_decimal_separate

    set_decimals (d: INTEGER)
            -- d decimals to be displayed.
        require
            d <= width
        ensure
            decimals = d

    set_fill (c: CHARACTER)
            -- Fill numbers with c
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = c

    set_separator (c: CHARACTER)
            -- Set the separator to c
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            separator = c

    set_sign (s: STRING)
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal (s)

    set_width (w: INTEGER)
            -- Set width to w
            -- (from FORMAT_INTEGER)
        require -- from FORMAT_INTEGER
            wide_enough: w >= 1
        ensure -- from FORMAT_INTEGER
            width = w

    show_zero
            -- Show 0.5 as 0.5 .
        ensure
            not zero_not_shown

    sign_cr_dr
            -- Set sign for CR/DR
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("CR DR")

    sign_dr_cr
            -- Set sign for DR/CR
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("DR CR")

    sign_floating_dollar
            -- Set sign for floating dollar.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("$$$")

    sign_floating_dollar_signed
            -- Set sign for floating dollar include sign.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("-$ $+$")

    sign_ignore
            -- Do not show sign.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            ignore_sign

    sign_leading
            -- Set the sign to lead
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            leading_sign

    sign_negative_only
            -- Show sign for negative numbers only.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            show_sign_negative

    sign_normal
            -- Set sign for - and +.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            sign_string.is_equal ("- +")

    sign_positive_only
            -- Show sign for positive numbers only.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            show_sign_positive

    sign_show
            -- Show sign for all numbers.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            show_sign

    sign_trailing
            -- Set the sign to trail
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            trailing_sign

    unbracket_negative
            -- Do not bracket negative numbers.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            not bracketted_negative

    underscore_separate
            -- Set the separator to be underscore.
        ensure -- from FORMAT_INTEGER
            separator = '_'
        ensure then
            after_decimal_separate

    zero_fill
            -- Fill numbers with zeros.
            -- (from FORMAT_INTEGER)
        ensure -- from FORMAT_INTEGER
            fill_character = '0'

feature -- Conversion

    formatted (d: DOUBLE): STRING
            -- Format d.
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width

invariant

    separate_all: no_separator implies not after_decimal_separate
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from FORMAT_INTEGER
    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_DOUBLE


FORMAT_INTEGER Chart

class
    FORMAT_INTEGER

General
    cluster: base.support
    description: "Formatter for integral numbers"
    create: make

Ancestors
    ANY

Queries
    bracketted_negative: BOOLEAN
    centered: BOOLEAN
    fill_character: CHARACTER
    formatted (i: INTEGER): STRING
    ignore_sign: BOOLEAN
    justification: INTEGER
    leading_sign: BOOLEAN
    left_justified: BOOLEAN
    no_separator: BOOLEAN
    not_justified: BOOLEAN
    right_justified: BOOLEAN
    separator: CHARACTER
    show_sign: BOOLEAN
    show_sign_negative: BOOLEAN
    show_sign_positive: BOOLEAN
    sign_format: INTEGER
    sign_string: STRING
    trailing_sign: BOOLEAN
    width: INTEGER

Commands
    asterisk_fill
    blank_fill
    bracket_negative
    center_justify
    comma_separate
    dollar_fill
    dot_separate
    left_justify
    make (w: INTEGER)
    no_justify
    remove_separator
    right_justify
    set_fill (c: CHARACTER)
    set_separator (c: CHARACTER)
    set_sign (s: STRING)
    set_width (w: INTEGER)
    sign_cr_dr
    sign_dr_cr
    sign_floating_dollar
    sign_floating_dollar_signed
    sign_ignore
    sign_leading
    sign_negative_only
    sign_normal
    sign_positive_only
    sign_show
    sign_trailing
    unbracket_negative
    underscore_separate
    zero_fill

Constraints
    sign string constraint
    wide enough


FORMAT_INTEGER Flat contracts

indexing
    description: "Formatter for integral numbers"
    status: "See notice at end of class"
    names: format_integer
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    FORMAT_INTEGER

create

    make (w: INTEGER)
        require
            reasonable_field: w >= 1
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign

feature -- Initialization

    make (w: INTEGER)
        require
            reasonable_field: w >= 1
        ensure
            blank_fill: fill_character = ' '
            show_sign_negative: show_sign_negative
            no_separator: no_separator
            width_set: width = w
            right_justified: right_justified
            leading_sign: leading_sign

feature -- Access

    bracketted_negative: BOOLEAN
            -- Enclose negative numbers in brackets?

    fill_character: CHARACTER
            -- Padding character.

    justification: INTEGER
            -- Where in the field the format goes.

    separator: CHARACTER
            -- Separator between 1000's of numbers.

    sign_format: INTEGER
            -- How the sign is formatted.

    sign_string: STRING
            -- Formatting details for the sign.

    trailing_sign: BOOLEAN
            -- Is the sign at the end?

    width: INTEGER
            -- Width of the field.

feature -- Status report

    centered: BOOLEAN
            -- Are numbers to be formatted centered?
        ensure
            Result = (justification = center_justification)

    ignore_sign: BOOLEAN
            -- Ignore the sign of a number?
        ensure
            Result = (sign_format = ignore_sign_value)

    leading_sign: BOOLEAN
            -- Is the sign leading?
        ensure
            Result = not trailing_sign

    left_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the right?
        ensure
            Result = (justification = left_justification)

    no_separator: BOOLEAN
            -- Is there a separator?
        ensure
            Result = (separator = '%U')

    not_justified: BOOLEAN
            -- Are numbers to be formatted in smallest string possible
        ensure
            Result = (justification = no_justification)

    right_justified: BOOLEAN
            -- Are numbers to be formatted with spaces on the left?
        ensure
            Result = (justification = right_justification)

    show_sign: BOOLEAN
            -- Are numbers to show sign whether positive or negative?
        ensure
            Result = (sign_format = show_sign_value)

    show_sign_negative: BOOLEAN
            -- Are numbers to show sign only when negative?
        ensure
            Result = (sign_format = sign_negative_value)

    show_sign_positive: BOOLEAN
            -- Are numbers to show sign only when positive?
        ensure
            Result = (sign_format = sign_positive_value)

feature -- Status setting

    asterisk_fill
            -- Fill numbers with asterisks.
        ensure
            fill_character = '*'

    blank_fill
            -- Fill numbers with blanks.
        ensure
            fill_character = ' '

    bracket_negative
            -- Bracket negative numbers.
        ensure
            bracketted_negative

    center_justify
            -- Put padding on right and left
        ensure
            centered

    comma_separate
            -- Set separator to comma.
        ensure
            separator = ','

    dollar_fill
            -- Fill numbers with dollars.
        ensure
            fill_character = '$'

    dot_separate
            -- Set separator to period.
        ensure
            separator = '.'

    left_justify
            --Put padding on right
        ensure
            left_justified

    no_justify
            -- Always return the smallest string possible
        ensure
            not_justified

    remove_separator
            -- Remove the separator.
        ensure
            separator = '%U'

    right_justify
            -- Put padding on left
        ensure
            right_justified

    set_fill (c: CHARACTER)
            -- Fill numbers with c
        ensure
            fill_character = c

    set_separator (c: CHARACTER)
            -- Set the separator to c
        ensure
            separator = c

    set_sign (s: STRING)
            -- Set sign values for positive, zero, negative
            -- All values must be the same length.
            -- Stored as negative, zero, positive.
        require
            s /= void
            s.count >= 3
            s.count \\ 3 = 0
        ensure
            sign_string.is_equal (s)

    set_width (w: INTEGER)
            -- Set width to w
        require
            wide_enough: w >= 1
        ensure
            width = w

    sign_cr_dr
            -- Set sign for CR/DR
        ensure
            sign_string.is_equal ("CR DR")

    sign_dr_cr
            -- Set sign for DR/CR
        ensure
            sign_string.is_equal ("DR CR")

    sign_floating_dollar
            -- Set sign for floating dollar.
        ensure
            sign_string.is_equal ("$$$")

    sign_floating_dollar_signed
            -- Set sign for floating dollar include sign.
        ensure
            sign_string.is_equal ("-$ $+$")

    sign_ignore
            -- Do not show sign.
        ensure
            ignore_sign

    sign_leading
            -- Set the sign to lead
        ensure
            leading_sign

    sign_negative_only
            -- Show sign for negative numbers only.
        ensure
            show_sign_negative

    sign_normal
            -- Set sign for - and +.
        ensure
            sign_string.is_equal ("- +")

    sign_positive_only
            -- Show sign for positive numbers only.
        ensure
            show_sign_positive

    sign_show
            -- Show sign for all numbers.
        ensure
            show_sign

    sign_trailing
            -- Set the sign to trail
        ensure
            trailing_sign

    unbracket_negative
            -- Do not bracket negative numbers.
        ensure
            not bracketted_negative

    underscore_separate
            -- Set separator to underscore.
        ensure
            separator = '_'

    zero_fill
            -- Fill numbers with zeros.
        ensure
            fill_character = '0'

feature -- Conversion

    formatted (i: INTEGER): STRING
            -- Format the integer.
        ensure
            exists: Result /= void
            correct_length: not_justified or Result.count >= width

invariant

    sign_string_constraint: sign_string /= void
    wide_enough: width >= 1
    no_justification <= justification and justification <= right_justification
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class FORMAT_INTEGER


IDENTIFIED_CONTROLLER Chart

class
    IDENTIFIED_CONTROLLER

General
    cluster: base.support
    description: "Externals for managing the object id stack (see identified.e)"

Ancestors
    ANY

Queries
    object_id_stack_size: INTEGER

Commands
    extend_object_id_stack (nb_chunks: INTEGER)


IDENTIFIED_CONTROLLER Flat contracts

indexing
    description: "Externals for managing the object id stack (see identified.e)"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    IDENTIFIED_CONTROLLER

feature -- Measurement

    object_id_stack_size: INTEGER
            -- Size of the object_id stack in chunks

feature -- Status setting

    extend_object_id_stack (nb_chunks: INTEGER)
            -- Extend the object_id stack by nb_chunks chunks.
        require
            positive_nb: nb_chunks > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED_CONTROLLER


IDENTIFIED Chart

class
    IDENTIFIED

General
    cluster: base.support
    description: "Objects identified, uniquely during any session, by an integer"

Ancestors
    ANY
    MEMORY

Queries
    id_freed: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    is_equal (other: [like Current] IDENTIFIED): BOOLEAN
    object_id: INTEGER

Commands
    copy (other: [like Current] IDENTIFIED)
    free_id


IDENTIFIED Flat contracts

indexing
    description: "Objects identified, uniquely during any session, by an integer"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    IDENTIFIED

feature -- Access

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
        ensure
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
        ensure
            valid_id: id_object (Result) = Current

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object considered
            -- equal to current object?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    frozen id_freed: BOOLEAN
            -- Has Current been removed from the table?

feature -- Removal

    frozen free_id
            -- Free the entry associated with object_id if any
        ensure
            object_freed: id_freed

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class IDENTIFIED


INTERNAL Chart

class
    INTERNAL

General
    cluster: base.support
    description:
        "Access to internal object properties.
        This class may be used as ancestor by classes needing its
        facilities."

Ancestors
    ANY

Queries
    bit_size (i: INTEGER; object: ANY): INTEGER
    Bit_type: INTEGER
    boolean_field (i: INTEGER; object: ANY): BOOLEAN
    Boolean_type: INTEGER
    character_field (i: INTEGER; object: ANY): CHARACTER
    Character_type: INTEGER
    class_name (object: ANY): STRING
    compiler_version: INTEGER
    double_field (i: INTEGER; object: ANY): DOUBLE
    Double_type: INTEGER
    dynamic_type (object: ANY): INTEGER
    dynamic_type_from_string (class_type: STRING): INTEGER
    expanded_field_type (i: INTEGER; object: ANY): STRING
    Expanded_type: INTEGER
    field (i: INTEGER; object: ANY): ANY
    field_count (object: ANY): INTEGER
    field_count_of_type (type_id: INTEGER): INTEGER
    field_name (i: INTEGER; object: ANY): STRING
    field_name_of_type (i, type_id: INTEGER): STRING
    field_offset (i: INTEGER; object: ANY): INTEGER
    field_type (i: INTEGER; object: ANY): INTEGER
    field_type_of_type (i, type_id: INTEGER): INTEGER
    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
    Integer_16_type: INTEGER
    Integer_32_type: INTEGER
    Integer_64_type: INTEGER
    Integer_8_type: INTEGER
    integer_field (i: INTEGER; object: ANY): INTEGER
    Integer_type: INTEGER
    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
    is_special (object: ANY): BOOLEAN
    new_instance_of (type_id: INTEGER): ANY
    physical_size (object: ANY): INTEGER
    pointer_field (i: INTEGER; object: ANY): POINTER
    Pointer_type: INTEGER
    real_field (i: INTEGER; object: ANY): REAL
    Real_type: INTEGER
    Reference_type: INTEGER
    type_conforms_to (type1, type2: INTEGER): BOOLEAN
    Wide_character_type: INTEGER

Commands
    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
    set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
    set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
    set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
    set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
    set_real_field (i: INTEGER; object: ANY; value: REAL)
    set_reference_field (i: INTEGER; object, value: ANY)


INTERNAL Flat contracts

indexing
    description: "[
        Access to internal object properties.
        This class may be used as ancestor by classes needing its
        facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    INTERNAL

feature -- Access

    Bit_type: INTEGER is 8

    boolean_field (i: INTEGER; object: ANY): BOOLEAN
            -- Boolean value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    Boolean_type: INTEGER is 3

    character_field (i: INTEGER; object: ANY): CHARACTER
            -- Character value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    Character_type: INTEGER is 2

    class_name (object: ANY): STRING
            -- Name of the class associated with object
        require
            object_not_void: object /= void

    double_field (i: INTEGER; object: ANY): DOUBLE
            -- Double precision value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

    Double_type: INTEGER is 6

    dynamic_type (object: ANY): INTEGER
            -- Dynamic type of object
        require
            object_not_void: object /= void

    expanded_field_type (i: INTEGER; object: ANY): STRING
            -- Class name associated with the i-th
            -- expanded field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_expanded: field_type (i, object) = expanded_type
        ensure
            result_exists: Result /= void

    Expanded_type: INTEGER is 7

    field (i: INTEGER; object: ANY): ANY
            -- Object attached to the i-th field of object
            -- (directly or through a reference)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_name (i: INTEGER; object: ANY): STRING
            -- Name of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        ensure
            result_exists: Result /= void

    field_name_of_type (i: INTEGER; type_id: INTEGER): STRING
            -- Name of i-th field of dynamic type type_id.
        require
            index_large_enough: i >= 1
            index_small_enought: i <= field_count_of_type (type_id)

    field_offset (i: INTEGER; object: ANY): INTEGER
            -- Offset of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_type (i: INTEGER; object: ANY): INTEGER
            -- Type of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)

    field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER
            -- Type of i-th field of dynamic type type_id
        require
            index_large_enough: i >= 1
            index_small_enough: i <= field_count_of_type (type_id)

    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
            -- Dynamic type of generic parameter of object at
            -- position i.

    Integer_16_type: INTEGER is 10

    Integer_32_type: INTEGER is 4

    Integer_64_type: INTEGER is 11

    Integer_8_type: INTEGER is 9

    integer_field (i: INTEGER; object: ANY): INTEGER
            -- Integer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    Integer_type: INTEGER is 4

    pointer_field (i: INTEGER; object: ANY): POINTER
            -- Pointer value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

    Pointer_type: INTEGER is 0

    real_field (i: INTEGER; object: ANY): REAL
            -- Real value of i-th field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    Real_type: INTEGER is 5

    Reference_type: INTEGER is 1

    Wide_character_type: INTEGER is 12

feature -- Measurement

    bit_size (i: INTEGER; object: ANY): INTEGER
            -- Size (in bit) of the i-th bit field of object
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_bit: field_type (i, object) = bit_type
        ensure
            positive_result: Result > 0

    field_count (object: ANY): INTEGER
            -- Number of logical fields in object
        require
            object_not_void: object /= void

    field_count_of_type (type_id: INTEGER): INTEGER
            -- Number of logical fields in dynamic type type_id.

    physical_size (object: ANY): INTEGER
            -- Space occupied by object in bytes
        require
            object_not_void: object /= void

feature -- Status report

    is_special (object: ANY): BOOLEAN
            -- Is object a special object?
            -- It only recognized a special object
            -- initialized within a TO_SPECIAL object.
        require
            object_not_void: object /= void

feature -- Element change

    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
            -- Set character value of i-th field of object to value
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

    set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

    set_real_field (i: INTEGER; object: ANY; value: REAL)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    set_reference_field (i: INTEGER; object: ANY; value: ANY)
        require
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            reference_field: field_type (i, object) = reference_type

feature -- Conformance

    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
            -- Is object an instance of type type_id?
        require
            object_not_void: object /= void

    type_conforms_to (type1, type2: INTEGER): BOOLEAN
            -- Does type1 conform to type2?

feature -- Creation

    dynamic_type_from_string (class_type: STRING): INTEGER
            -- Dynamic type corresponding to class_type.
            -- If no dynamic type available, returns -1.
        require
            class_type_not_void: class_type /= void
        ensure
            valid_result: Result = - 1 or else Result >= 0

    new_instance_of (type_id: INTEGER): ANY
            -- New instance of dynamic type_id.
            -- Note: returned object is not initialized and may
            -- hence violate its invariant.

feature -- Version

    compiler_version: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class INTERNAL


MATH_CONST Chart

class
    MATH_CONST

General
    cluster: base.support
    description:
        "Basic mathematical constants.
        This class may be used as ancestor by classes needing its facilities."

Ancestors
    ANY


OPERATING_ENVIRONMENT Chart

class
    OPERATING_ENVIRONMENT

General
    cluster: base.support
    description: "The objects available from the operating system"

Ancestors
    ANY

Queries
    case_sensitive_path_names: BOOLEAN
    Current_directory_name_representation: STRING
    Directory_separator: CHARACTER
    home_directory_supported: BOOLEAN
    root_directory_supported: BOOLEAN


OPERATING_ENVIRONMENT Flat contracts

indexing
    description: "The objects available from the operating system"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:48 $"
    revision: "$Revision: 1.3 $"

class interface
    OPERATING_ENVIRONMENT

feature

    case_sensitive_path_names: BOOLEAN
            -- Are path names case sensitive?

    current_directory_name_representation: STRING
            -- Representation of the current directory

    directory_separator: CHARACTER
            -- Character used to separate subdirectories in a path name on this platform.

    home_directory_supported: BOOLEAN
            -- Is the notion of home directory supported on this platform?

    root_directory_supported: BOOLEAN
            -- Is the notion of root directory supported on this platform?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class OPERATING_ENVIRONMENT


PRIMES Chart

class
    PRIMES

General
    cluster: base.support
    description: "Prime number properties"

Ancestors
    COUNTABLE_SEQUENCE [G]

Queries
    After: BOOLEAN
    all_lower_primes (n: INTEGER): ARRAY [BOOLEAN]
    changeable_comparison_criterion: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    higher_prime (n: INTEGER): INTEGER
    i_th (i: INTEGER): INTEGER
    index: INTEGER
    index_of (v: [like item] INTEGER; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    is_prime (n: INTEGER): BOOLEAN
    item: INTEGER
    lower_prime (n: INTEGER): INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    Smallest_odd_prime: INTEGER
    Smallest_prime: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
    forth
    search (v: [like item] INTEGER)
    start


PRIMES Flat contracts

indexing
    description: "Prime number properties"
    status: "See notice at end of class"
    names: primes
    date: "$Date: 2001/11/12 17:57:48 $"
    revision: "$Revision: 1.3 $"

class interface
    PRIMES

feature -- Access

    all_lower_primes (n: INTEGER): ARRAY [BOOLEAN]
            -- Array of n boolean values, where the
            -- value at index i is true if and only if
            -- i is prime.

    higher_prime (n: INTEGER): INTEGER
            -- Lowest prime greater than or equal to n

    i_th (i: INTEGER): INTEGER
            -- The i-th prime number
        require -- from COUNTABLE
            positive_argument: i > 0

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    is_prime (n: INTEGER): BOOLEAN
            -- Is n a prime number?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item: INTEGER
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    lower_prime (n: INTEGER): INTEGER
            -- Greatest prime lower than or equal to n
        require
            argument_big_enough: n >= smallest_prime

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    Smallest_odd_prime: INTEGER is 3

    Smallest_prime: INTEGER is 2

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PRIMES


PROFILING_SETTING Chart

class
    PROFILING_SETTING

General
    cluster: base.support
    description:
        "Objects that manage the Eiffel profiler. You can start and
        stop the Eiffel profiler whenever you want to. It only works
        if `profile (yes)' is enabled in your Ace file."
    create: make

Ancestors
    ANY

Queries
    Is_profiler_enabled: BOOLEAN
    is_profiling: BOOLEAN

Commands
    make
    start_profiling
    stop_profiling


PROFILING_SETTING Flat contracts

indexing
    description: "[
            Objects that manage the Eiffel profiler. You can start and
            stop the Eiffel profiler whenever you want to. It only works
            if `profile (yes)' is enabled in your Ace file.
    ]"
    date: "$Date: 2001/11/12 17:57:48 $"
    revision: "$Revision: 1.3 $"

class interface
    PROFILING_SETTING

create

    make
            -- Compute value of is_profiler_enabled for all instances of
            -- Current class.

feature -- Initialization

    make
            -- Compute value of is_profiler_enabled for all instances of
            -- Current class.

feature -- Status report

    is_profiling: BOOLEAN
            -- Is profiler currently enabled?

feature -- Status setting

    start_profiling
            -- Start profiling.

    stop_profiling
            -- Stop profiling

feature -- Validity

    is_profiler_enabled: BOOLEAN
            -- Is profiler enabled upon launch time?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class PROFILING_SETTING


RANDOM Chart

class
    RANDOM

General
    cluster: base.support
    description: "Pseudo-random number sequence, linear congruential method"
    create: set_seed, make

Ancestors
    COUNTABLE_SEQUENCE [G]
    DOUBLE_MATH

Queries
    After: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    Default_seed: INTEGER
    double_i_th (i: INTEGER): DOUBLE
    double_item: DOUBLE
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (n: INTEGER): BOOLEAN
    i_th (i: INTEGER): INTEGER
    Increment: INTEGER
    index: INTEGER
    index_of (v: [like item] INTEGER; i: INTEGER): INTEGER
    Is_empty: BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item: INTEGER
    Modulus: INTEGER
    Multiplier: INTEGER
    next_random (n: INTEGER): INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    off: BOOLEAN
    Prunable: BOOLEAN
    Readable: BOOLEAN
    real_i_th (i: INTEGER): REAL
    real_item: REAL
    seed: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
    Writable: BOOLEAN

Commands
    compare_objects
    compare_references
    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
    forth
    make
    search (v: [like item] INTEGER)
    set_seed (s: INTEGER)
    start

Constraints
    non negative seed
    non negative increment
    positive multiplier
    modulus constraint


RANDOM Flat contracts

indexing
    description: "Pseudo-random number sequence, linear congruential method"
    status: "See notice at end of class"
    names: random
    date: "$Date: 2001/11/12 17:57:48 $"
    revision: "$Revision: 1.3 $"

class interface
    RANDOM

create

    make
            -- Initialize structure using a default seed.
        ensure
            seed_set: seed = default_seed

    set_seed (s: INTEGER)
            -- Initialize sequence using s as the seed.
        require
            non_negative: s >= 0
        ensure
            seed_set: seed = s

feature -- Initialization

    make
            -- Initialize structure using a default seed.
        ensure
            seed_set: seed = default_seed

    set_seed (s: INTEGER)
            -- Initialize sequence using s as the seed.
        require
            non_negative: s >= 0
        ensure
            seed_set: seed = s

feature -- Access

    default_seed: INTEGER
            -- Default value 123,457;
            -- may be redefined for a new generator.

    double_i_th (i: INTEGER): DOUBLE
            -- The i-th random number as a double between 0 and 1

    double_item: DOUBLE
            -- The current random number as a double between 0 and 1

    has (n: INTEGER): BOOLEAN
            -- Will n be part of the random number sequence?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty
        ensure then
            only_: Result = (n < modulus and n >= 0)

    i_th (i: INTEGER): INTEGER
            -- The i-th random number
        require -- from COUNTABLE
            positive_argument: i > 0
        ensure then
            in_range: (Result < modulus) and (Result >= 0)

    increment: INTEGER
            -- Default value 0;
            -- may be redefined for a new generator.

    index: INTEGER
            -- Index of current position
            -- (from COUNTABLE_SEQUENCE)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: INTEGER
            -- Item at current position
            -- (from COUNTABLE_SEQUENCE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    modulus: INTEGER
            -- Default value 2^31 -1 = 2,147,483,647;
            -- may be redefined for a new generator.

    multiplier: INTEGER
            -- Default value 7^5 = 16,807;
            -- may be redefined for a new generator.

    next_random (n: INTEGER): INTEGER
            -- Next random number after n
            -- in pseudo-random order
        require
            in_range: (n < modulus) and (n >= 0)
        ensure
            in_range: (Result < modulus) and (Result >= 0)

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    real_i_th (i: INTEGER): REAL
            -- The i-th random number as a real between 0 and 1

    real_item: REAL
            -- The current random number as a real between 0 and 1

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    seed: INTEGER
            -- Seed for sequence.

feature -- Status report

    After: BOOLEAN is False
            -- Is current position past last item? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is False
            -- May items be added? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Full: BOOLEAN is True
            -- The structure is complete
            -- (from INFINITE)

    Is_empty: BOOLEAN is False
            -- Is structure empty? (Answer: no.)
            -- (from INFINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

    Prunable: BOOLEAN is False
            -- May items be removed? (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

    Readable: BOOLEAN is True
            -- Is there a current item that may be read?
            -- (Answer: yes.)
            -- (from COUNTABLE_SEQUENCE)

    Writable: BOOLEAN is False
            -- Is there a current item that may be written?
            -- (Answer: no.)
            -- (from COUNTABLE_SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Move to next position.
            -- (from COUNTABLE_SEQUENCE)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position.
            -- (from COUNTABLE_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [INTEGER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [INTEGER]]; test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    non_negative_seed: seed >= 0
    non_negative_increment: increment >= 0
    positive_multiplier: multiplier > 0
    modulus_constraint: modulus > 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from INFINITE
    never_empty: not is_empty
    always_full: full
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RANDOM


SINGLE_MATH Chart

class
    SINGLE_MATH

General
    cluster: base.support
    description:
        "Basic mathematical operations, single-precision.
        This class may be used as ancestor by classes needing its facilities"

Ancestors
    MATH_CONST

Queries
    arc_cosine (v: REAL): REAL
    arc_sine (v: REAL): REAL
    arc_tangent (v: REAL): REAL
    ceiling (v: REAL): REAL
    cosine (v: REAL): REAL
    floor (v: REAL): REAL
    log (v: REAL): REAL
    log10 (v: REAL): REAL
    log_2 (v: REAL): REAL
    sine (v: REAL): REAL
    sqrt (v: REAL): REAL
    tangent (v: REAL): REAL


SINGLE_MATH Flat contracts

indexing
    description: "[
        Basic mathematical operations, single-precision.
        This class may be used as ancestor by classes needing its facilities
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:48 $"
    revision: "$Revision: 1.3 $"

class interface
    SINGLE_MATH

feature -- Access

    arc_cosine (v: REAL): REAL
            -- Trigonometric arccosine of v

    arc_sine (v: REAL): REAL
            -- Trigonometric arcsine of v

    arc_tangent (v: REAL): REAL
            -- Trigonometric arctangent of v

    ceiling (v: REAL): REAL
            -- Least integral value greater than or equal to v

    cosine (v: REAL): REAL
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]

    floor (v: REAL): REAL
            -- Greatest integral value less than or equal to v

    log (v: REAL): REAL
            -- Natural logarithm of v
        require
            v > 0.0

    log10 (v: REAL): REAL
            -- Base 10 logarithm of v
        require
            v > 0.0

    log_2 (v: REAL): REAL
            -- Base 2 logarithm of v
        require
            v > 0.0

    sine (v: REAL): REAL
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]

    sqrt (v: REAL): REAL
            -- Square root of v
        require
            v >= 0.0

    tangent (v: REAL): REAL
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class SINGLE_MATH


EiffelBase Samples

Description

Version: 5.0

Availability: Basic Package.


Calculator

The Calculator Sample

This sample consists of a command line reverse Polish notation (RPN) calculator.

Note: A RPN calculator works slightly differently from standard calculators. It consists of a stack of numbers. Operations are applied to the two numbers on top of the stack. The result is then put on top of the stack so that it can be used in the next operation. This sample refers to the top of the stack as Accumulator.

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\base\calculator\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

After you launch the sample, the following text appears in a console:

*********************************
Calculator in reverse Polish form
*********************************
Allowable operations are:
        '/': Divide top two numbers on the stack.
        '0': Empty the stack.
        'a': Enter operand onto stack.
        '?': Help.
        '*': Multiply top two numbers on the stack.
        '+': Add top two numbers on the stack
        'q': Quit.
        '-': Subtract top two numbers on the stack.
Enter a number, followed by :

Enter the first number to be put onto the stack, for example 3.

Note: Failing to enter a number at this stage will cause the sample to stop. This sample was designed to showcase the use of EiffelBase data structures and is not protected against unexpected entries.

You may then add another number on the stack by entering the character a:

*********************************
Calculator in reverse Polish form
*********************************
Allowable operations are:
        '/': Divide top two numbers on the stack.
        '0': Empty the stack.
        'a': Enter operand onto stack.
        '?': Help.
        '*': Multiply top two numbers on the stack.
        '+': Add top two numbers on the stack
        'q': Quit.
        '-': Subtract top two numbers on the stack.
Enter a number, followed by : 3

Accumulator = 3

Next operation? a
Enter a number, followed by :

Enter a second number, for example 2. You can then apply any operation to the two operands such as minus:

...
Next operation? a
Enter a number, followed by : 2

Accumulator = 2

Next operation? -

Accumulator = 1

Next operation?

You may use the operation 0 to clear the stack at any time. You may use q to quit the program.

Tip: You can use the command ? to display the list of available operations.

Under the Hood

This sample shows how to leverage EiffelBase data structures in a simple Eiffel system. The root class CALCULATOR first instantiates all state objects, each corresponding to one possible operation. The state classes all inherit from STATE. They are:

  • PLUS: Add stack's two top numbers.
  • MINUS: Substract stack's two top numbers.
  • MULTIPLY: Multiply stack's two top numbers.
  • DIVIDE: Divide stack's two top numbers.
  • EMPTY: Empty stack.
  • HELP: Prints available commands.
  • QUESTION: Get number from user.
  • QUIT: Close application.
Each of these classes implement the feature do_one_state from STATE which performs the operation associated with the state. The initial state is QUESTION which asks for the initial number to put in the accumulator. Following states depend on the user input.
Every descendant of STATE implement the feature operation which performs the corresponding stack transformation.

See the reference for the class interfaces.


cluster root_cluster

 Cluster
root_cluster

Classes
CALCULATOR
DIVIDE
EMPTY
HELP
INTERFACE
MINUS
MULTIPLY
PLUS
QUESTION
QUIT
SET_UP
STATE

-- Generated by ISE Eiffel --


CALCULATOR Chart

 class
CALCULATOR

General
cluster: root_cluster
create: make

Ancestors
SET_UP

Queries
Associated_operator : HASH_TABLE [ INTERFACE , STRING ]

Commands
enter_operator (k, m: STRING ; c: STATE )
make

-- Generated by ISE Eiffel --


CALCULATOR Flat contracts

 class interface
CALCULATOR

create

make

feature

associated_operator : HASH_TABLE [ INTERFACE , STRING ]
-- Hash-table of operations with name and help messages.
-- (from SET_UP )

enter_operator (k, m: STRING ; c: STATE )
-- Enter a command c associated with a key k
-- and an help message m.
-- (from SET_UP )

feature -- creation

make

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class CALCULATOR

-- Generated by ISE Eiffel --


DIVIDE Chart

 class
DIVIDE

General
cluster: root_cluster

Ancestors
STATE

Queries
next_choice : STRING

Commands
do_one_state
operation
read

-- Generated by ISE Eiffel --


DIVIDE Flat contracts

 class interface
DIVIDE

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.
-- (from STATE )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation
-- Divide top element of stack with register.

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DIVIDE

-- Generated by ISE Eiffel --


EMPTY Chart

 class
EMPTY

General
cluster: root_cluster

Ancestors
STATE

Queries
next_choice : STRING

Commands
do_one_state
operation
read

-- Generated by ISE Eiffel --


EMPTY Flat contracts

 class interface
EMPTY

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.
-- (from STATE )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation
-- Empty the stack and set accumulator and register to 0.
ensure then
register = 0.0
operand_stack . count = 1
operand_stack . item = 0.0

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class EMPTY

-- Generated by ISE Eiffel --


HELP Chart

 class
HELP

General
cluster: root_cluster

Ancestors
SET_UP
STATE

Queries
Associated_operator : HASH_TABLE [ INTERFACE , STRING ]
next_choice : STRING

Commands
do_one_state
enter_operator (k, m: STRING ; c: STATE )
operation
read

-- Generated by ISE Eiffel --


HELP Flat contracts

 class interface
HELP

feature

associated_operator : HASH_TABLE [ INTERFACE , STRING ]
-- Hash-table of operations with name and help messages.
-- (from SET_UP )

do_one_state
-- Print help header.

enter_operator (k, m: STRING ; c: STATE )
-- Enter a command c associated with a key k
-- and an help message m.
-- (from SET_UP )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HELP

-- Generated by ISE Eiffel --


INTERFACE Chart

 class
INTERFACE

General
cluster: root_cluster

Ancestors
ANY

Queries
associated_command : STATE
help_message : STRING
operator_key : STRING

Commands
set_interface (k, m: STRING ; c: STATE )

-- Generated by ISE Eiffel --


INTERFACE Flat contracts

 class interface
INTERFACE

feature

associated_command : STATE
-- Associated state.

help_message : STRING
-- Help message.

operator_key : STRING
-- Letter key associated to an operation.

set_interface (k, m: STRING ; c: STATE )
-- Fill out key with k, command with c and message with m.
ensure
operator_key = k
associated_command = c
help_message = m

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class INTERFACE

-- Generated by ISE Eiffel --


MINUS Chart

 class
MINUS

General
cluster: root_cluster

Ancestors
STATE

Queries
next_choice : STRING

Commands
do_one_state
operation
read

-- Generated by ISE Eiffel --


MINUS Flat contracts

 class interface
MINUS

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.
-- (from STATE )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation
-- Subtract top element of stack with register.
ensure then
register = operand_stack . item - old register

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MINUS

-- Generated by ISE Eiffel --


MULTIPLY Chart

 class
MULTIPLY

General
cluster: root_cluster

Ancestors
STATE

Queries
next_choice : STRING

Commands
do_one_state
operation
read

-- Generated by ISE Eiffel --


MULTIPLY Flat contracts

 class interface
MULTIPLY

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.
-- (from STATE )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation
-- Multiply register with top element of stack.
ensure then
register = old register * operand_stack . item

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MULTIPLY

-- Generated by ISE Eiffel --


PLUS Chart

 class
PLUS

General
cluster: root_cluster

Ancestors
STATE

Queries
next_choice : STRING

Commands
do_one_state
operation
read

-- Generated by ISE Eiffel --


PLUS Flat contracts

 class interface
PLUS

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.
-- (from STATE )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation
-- Add register with top element of stack.
ensure then
register = old register + operand_stack . item

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class PLUS

-- Generated by ISE Eiffel --


QUESTION Chart

 class
QUESTION

General
cluster: root_cluster

Ancestors
STATE

Queries
next_choice : STRING

Commands
do_one_state
operation
process
read

-- Generated by ISE Eiffel --


QUESTION Flat contracts

 class interface
QUESTION

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.
-- (from STATE )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation
-- Useless.

process
-- Get a number from user input.

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class QUESTION

-- Generated by ISE Eiffel --


QUIT Chart

 class
QUIT

General
cluster: root_cluster

Ancestors
STATE

Queries
next_choice : STRING

Commands
do_one_state
operation
process
read

-- Generated by ISE Eiffel --


QUIT Flat contracts

 class interface
QUIT

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.
-- (from STATE )

next_choice : STRING
-- Last user's choice.
-- (from STATE )

operation
-- Useless.

process
-- Useless.

read
-- Read next operation.
-- (from STATE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class QUIT

-- Generated by ISE Eiffel --


SET_UP Chart

 class
SET_UP

General
cluster: root_cluster

Ancestors
ANY

Queries
Associated_operator : HASH_TABLE [ INTERFACE , STRING ]

Commands
enter_operator (k, m: STRING ; c: STATE )

-- Generated by ISE Eiffel --


SET_UP Flat contracts

 class interface
SET_UP

feature

associated_operator : HASH_TABLE [ INTERFACE , STRING ]
-- Hash-table of operations with name and help messages.

enter_operator (k, m: STRING ; c: STATE )
-- Enter a command c associated with a key k
-- and an help message m.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SET_UP

-- Generated by ISE Eiffel --


STATE Chart

 deferred class
STATE

General
cluster: root_cluster

Ancestors
ANY

Queries
next_choice : STRING

Commands
do_one_state
operation
read

-- Generated by ISE Eiffel --


STATE Flat contracts

 deferred class interface
STATE

feature

do_one_state
-- Perform operation associated with the current state
-- and display result.

next_choice : STRING
-- Last user's choice.

operation
-- Effective register operation.

read
-- Read next operation.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class STATE

-- Generated by ISE Eiffel --


EiffelCOM

Type: Library
Platform: Windows
Version: 5.0

See:

  • Introduction
  • Content
  • Reference

See Also: The Component Object Model, EiffelCOM wizard


EiffelCOM Introduction

Overview

The EiffelCOM library provides support classes for the code generated by the EiffelCOM wizard. It has wrappings for standard COM data types such as VARIANT, SAFEARRAY, CURRENCY, DECIMAL, IUnknown, IDispatch, etc.


EiffelCOM Content

Content

The EiffelCOM library includes the following clusters:

  • A Constants cluster provides standard COM contants and enumerations.
  • A Interfaces cluster includes wrappers for standard interfaces that the EiffelCOM wizard does not generate and deferred classes: ECOM_INTERFACE, ECOM_QUERIABLE, and ECOM_STUB.
  • A Structures cluster includes wrappers for COM structures and additional data structures.
  • A Support cluster provides access to helper classes.

See Also: The Component Object Model, EiffelCOM wizard


Interfaces

COM interfaces have several facets. First, an interface is a deferred, or an abstract, class. This means that an interface is a specification of a type. Second, an interface pointer represents a COM object, which is callable by a client application. An object can expose several interfaces, or represent several types.

ECOM_INTERFACE

For each interface referenced in a type library, the EiffelCOM wizard generates a deferred class and two effective classes: a proxy of an interface pointer, or a client side class, and a stub of an interface pointer, or a server side class. The deferred interface class inherits from ECOM_INTERFACE and has a deferred feature per each interface function. Both effective classes, or implemented interfaces, inherit from the deferred class and implement its functions. The functions of the interface proxy call underlying C layer, which calls a COM component. The functions of the interface stub implement the component functionality.

ECOM_INTERFACE holds a pointer to the underlining COM interface.

ECOM_QUERIABLE

Different languages handle the type coercion in dissimilar ways. C has a type cast; C++ introduces several type casting mechanisms; Eiffel has an assignment attempt, etc. Every COM interface exposes QueryInterface function that allows a client to query the COM component for the interfaces it exposes and receive a pointer to another interface. Querying a component for an interface is similar to using an assignment attempt in Eiffel. The Eiffel implementation of the assignment attempt relies on the runtime data. Since we could not change the Eiffel runtime and the implementation of the assignment attempt, we have created a library class ECOM_QUERIABLE, which has a creation routine

make_from_other (other: ECOM_INTERFACE)

that queries a COM component internally. Every interface proxy class inherits from ECOM_QUERIABLE.

ECOM_STUB

ECOM_STUB inherits from ECOM_INTERFACE, and has feature create_item, which allows to create a COM object corresponding to an Eiffel object.


Structures

A Structures cluster includes wrappers for COM structures and additional data structures.

ECOM_ARRAY

ECOM_ARRAY is multidimensional, resizable array. It is converted to SAFEARRAY at the COM runtime level. Most languages support only SAFEARRAYs of OLE automation types.

ECOM_EXCEPTION

ECOM_EXCEPTION provides support for triggering and catching exceptions. According to the COM specification, every feature of a COM interface should return a status code of type HRESULT. HRESULT is a 32 bit integer. The COM specification defines possible exception codes and corresponding human-readable descriptions.

The status code is mapped by the EiffelCOM runtime to Eiffel exceptions. To raise COM-specific exceptions, the class ECOM_EXCEPTION provides feature trigger:

trigger (code: INTEGER)
-- Raise exception with code `code'.
-- See class ECOM_EXCEPTION_CODES for possible values.

The class also has several features that help to interpret exceptions and error codes received from the COM runtime.

hresult: INTEGER
-- Original HRESULT.
require
applicable: is_developer_exception

hresult_code: INTEGER
-- Status code.
require
applicable: is_developer_exception

hresult_facility: INTEGER
-- Facility code.
require
applicable: is_developer_exception

hresult_message: STRING
-- Error message.
require
applicable: is_developer_exception

Every call to the COM layer should be wrapped into the rescue-clause as following:

some_feature is
local
retried: BOOLEAN
...
do
if not retried then
-- Call to COM.
end
rescue
if is_developer_exception then
-- Compare `hresult' to some predefined value
-- and handle various cases,
-- or display a dialog box with an error message
-- `hresult_message'.
end
retried := True
retry
end

ECOM_STRUCTURE

ECOM_STRUCTURE is a deferred class, which inherit from WEL_STRUCTURE. All wrappers of COM structures inherit from ECOM_STRUCTURE.

ECOM_VARIANT

ECOM_VARIANT is a wrapper of the VARIANT structure. VARIANT is Visual Basic equivalent of ANY. In Visual Basic variable of any type conforms to VARIANT. Since semantics and binary layout of Visual Basic is different from those of Eiffel, there is no simple way to map VARIANT to ANY. Instead, we created a simple wrapper of the VARIANT structure.

It has the feature

variable_type : INTEGER
-- Variable type. See class ECOM_VAR_TYPE for possible values.

which specifies the type of the wrapped variable. The class has multiple feature for typed access and setting of variables.


cluster com

Cluster
    com

Subclusters
    com.Constants
    com.Interfaces
    com.Structures
    com.Support


cluster com.Constants

Cluster
    com.Constants

Supercluster
    com

Classes
    ECOM_EXCEPTION_CODES
    ECOM_FLAGS
    ECOM_LOAD_PICTURE_CONSTANTS_ENUM
    ECOM_LOCK_TYPES
    ECOM_OLE_TRISTATE_ENUM
    ECOM_STAT_FLAGS
    ECOM_STGC
    ECOM_STGM
    ECOM_STGMOVE
    ECOM_STGTY
    ECOM_STREAM_SEEK
    ECOM_VAR_TYPE


ECOM_EXCEPTION_CODES Chart

class
    ECOM_EXCEPTION_CODES

General
    cluster: com.Constants
    description: "Definition of COM error codes"

Ancestors
    ANY

Queries
    cache_e_first: INTEGER
    cache_e_last: INTEGER
    cache_e_nocache_updated: INTEGER
    cache_s_first: INTEGER
    cache_s_formatetc_notsupported: INTEGER
    cache_s_last: INTEGER
    cache_s_samecache: INTEGER
    cache_s_somecaches_notupdated: INTEGER
    class_e_classnotavailable: INTEGER
    class_e_noaggregation: INTEGER
    classfactory_e_first: INTEGER
    classfactory_e_last: INTEGER
    classfactory_s_first: INTEGER
    classfactory_s_last: INTEGER
    clientsite_e_first: INTEGER
    clientsite_e_last: INTEGER
    clientsite_s_first: INTEGER
    clientsite_s_last: INTEGER
    clipbrd_e_bad_data: INTEGER
    clipbrd_e_cant_close: INTEGER
    clipbrd_e_cant_empty: INTEGER
    clipbrd_e_cant_open: INTEGER
    clipbrd_e_cant_set: INTEGER
    clipbrd_e_first: INTEGER
    clipbrd_e_last: INTEGER
    clipbrd_s_first: INTEGER
    clipbrd_s_last: INTEGER
    co_e_alreadyinitialized: INTEGER
    co_e_appdidntreg: INTEGER
    co_e_appnotfound: INTEGER
    co_e_appsingleuse: INTEGER
    co_e_bad_path: INTEGER
    co_e_cantdetermineclass: INTEGER
    co_e_class_create_failed: INTEGER
    co_e_classstring: INTEGER
    co_e_dllnotfound: INTEGER
    co_e_errorinapp: INTEGER
    co_e_errorindll: INTEGER
    co_e_first: INTEGER
    co_e_iidstring: INTEGER
    co_e_init_class_cache: INTEGER
    co_e_init_memory_allocator: INTEGER
    co_e_init_only_single_threaded: INTEGER
    co_e_init_rpc_channel: INTEGER
    co_e_init_scm_exec_failure: INTEGER
    co_e_init_scm_file_mapping_exists: INTEGER
    co_e_init_scm_map_view_of_file: INTEGER
    co_e_init_scm_mutex_exists: INTEGER
    co_e_init_shared_allocator: INTEGER
    co_e_init_tls: INTEGER
    co_e_init_tls_channel_control: INTEGER
    co_e_init_tls_set_channel_control: INTEGER
    co_e_init_unaccepted_user_allocator: INTEGER
    co_e_last: INTEGER
    co_e_notinitialized: INTEGER
    co_e_objisreg: INTEGER
    co_e_objnotconnected: INTEGER
    co_e_objnotreg: INTEGER
    co_e_objsrv_rpc_failure: INTEGER
    co_e_released: INTEGER
    co_e_scm_error: INTEGER
    co_e_scm_rpc_failure: INTEGER
    co_e_server_exec_failure: INTEGER
    co_e_server_stopping: INTEGER
    co_e_wrongosforapp: INTEGER
    co_s_first: INTEGER
    co_s_last: INTEGER
    convert10_e_first: INTEGER
    convert10_e_last: INTEGER
    convert10_e_olestream_bitmap_to_dib: INTEGER
    convert10_e_olestream_fmt: INTEGER
    convert10_e_olestream_get: INTEGER
    convert10_e_olestream_put: INTEGER
    convert10_e_stg_dib_to_bitmap: INTEGER
    convert10_e_stg_fmt: INTEGER
    convert10_e_stg_no_std_stream: INTEGER
    convert10_s_first: INTEGER
    convert10_s_last: INTEGER
    convert10_s_no_presentation: INTEGER
    data_e_first: INTEGER
    data_e_last: INTEGER
    data_s_first: INTEGER
    data_s_last: INTEGER
    data_s_sameformatetc: INTEGER
    disp_e_arrayislocked: INTEGER
    disp_e_badcallee: INTEGER
    disp_e_badindex: INTEGER
    disp_e_badparamcount: INTEGER
    disp_e_badvartype: INTEGER
    disp_e_exception: INTEGER
    disp_e_membernotfound: INTEGER
    disp_e_nonamedargs: INTEGER
    disp_e_notacollection: INTEGER
    disp_e_overflow: INTEGER
    disp_e_paramnotfound: INTEGER
    disp_e_paramnotoptional: INTEGER
    disp_e_typemismatch: INTEGER
    disp_e_unknowninterface: INTEGER
    disp_e_unknownlcid: INTEGER
    disp_e_unknownname: INTEGER
    dragdrop_e_alreadyregistered: INTEGER
    dragdrop_e_first: INTEGER
    dragdrop_e_invalidhwnd: INTEGER
    dragdrop_e_last: INTEGER
    dragdrop_e_notregistered: INTEGER
    dragdrop_s_cancel: INTEGER
    dragdrop_s_drop: INTEGER
    dragdrop_s_first: INTEGER
    dragdrop_s_last: INTEGER
    dragdrop_s_usedefaultcursors: INTEGER
    dv_e_clipformat: INTEGER
    dv_e_dvaspect: INTEGER
    dv_e_dvtargetdevice: INTEGER
    dv_e_dvtargetdevice_size: INTEGER
    dv_e_formatetc: INTEGER
    dv_e_lindex: INTEGER
    dv_e_noiviewobject: INTEGER
    dv_e_statdata: INTEGER
    dv_e_stgmedium: INTEGER
    dv_e_tymed: INTEGER
    e_abort: INTEGER
    e_accessdenied: INTEGER
    e_advf: INTEGER
    e_advisenotsupported: INTEGER
    e_blank: INTEGER
    e_cant_bindtosource: INTEGER
    e_cant_getmoniker: INTEGER
    e_cantconvert: INTEGER
    e_classdiff: INTEGER
    E_end_of_stream: INTEGER
    e_enum_nomore: INTEGER
    e_fail: INTEGER
    e_handle: INTEGER
    e_invalidarg: INTEGER
    e_invalidhwnd: INTEGER
    e_invalidrect: INTEGER
    e_nocache: INTEGER
    e_noconnection: INTEGER
    e_nointerface: INTEGER
    e_nostorage: INTEGER
    e_not_inplaceactive: INTEGER
    e_notimpl: INTEGER
    e_notrunning: INTEGER
    e_oleverb: INTEGER
    e_outofmemory: INTEGER
    e_pointer: INTEGER
    e_promptsavecancelled: INTEGER
    e_static: INTEGER
    e_unexpected: INTEGER
    e_wrongcompobj: INTEGER
    enum_e_first: INTEGER
    enum_e_last: INTEGER
    enum_s_first: INTEGER
    enum_s_last: INTEGER
    inplace_e_first: INTEGER
    inplace_e_last: INTEGER
    inplace_e_notoolspace: INTEGER
    inplace_e_notundoable: INTEGER
    inplace_s_first: INTEGER
    inplace_s_last: INTEGER
    inplace_s_truncated: INTEGER
    marshal_e_first: INTEGER
    marshal_e_last: INTEGER
    marshal_s_first: INTEGER
    marshal_s_last: INTEGER
    mem_e_invalid_link: INTEGER
    mem_e_invalid_root: INTEGER
    mem_e_invalid_size: INTEGER
    mk_e_cantopenfile: INTEGER
    mk_e_connectmanually: INTEGER
    mk_e_enumeration_failed: INTEGER
    mk_e_exceededdeadline: INTEGER
    mk_e_first: INTEGER
    mk_e_intermediateinterfacenotsupported: INTEGER
    mk_e_invalidextension: INTEGER
    mk_e_last: INTEGER
    mk_e_mustbotheruser: INTEGER
    mk_e_needgeneric: INTEGER
    mk_e_no_normalized: INTEGER
    mk_e_noinverse: INTEGER
    mk_e_noobject: INTEGER
    mk_e_noprefix: INTEGER
    mk_e_nostorage: INTEGER
    mk_e_notbindable: INTEGER
    mk_e_notbound: INTEGER
    mk_e_syntax: INTEGER
    mk_e_unavailable: INTEGER
    mk_s_first: INTEGER
    mk_s_him: INTEGER
    mk_s_last: INTEGER
    mk_s_me: INTEGER
    mk_s_monikeralreadyregistered: INTEGER
    mk_s_reduced_to_self: INTEGER
    mk_s_us: INTEGER
    noerror: INTEGER
    ole_e_first: INTEGER
    ole_e_last: INTEGER
    ole_s_first: INTEGER
    ole_s_last: INTEGER
    ole_s_mac_clipformat: INTEGER
    ole_s_static: INTEGER
    ole_s_usereg: INTEGER
    oleobj_e_first: INTEGER
    oleobj_e_invalidverb: INTEGER
    oleobj_e_last: INTEGER
    oleobj_e_noverbs: INTEGER
    oleobj_s_cannot_doverb_now: INTEGER
    oleobj_s_first: INTEGER
    oleobj_s_invalidhwnd: INTEGER
    oleobj_s_invalidverb: INTEGER
    oleobj_s_last: INTEGER
    regdb_e_classnotreg: INTEGER
    regdb_e_first: INTEGER
    regdb_e_iidnotreg: INTEGER
    regdb_e_invalidvalue: INTEGER
    regdb_e_keymissing: INTEGER
    regdb_e_last: INTEGER
    regdb_e_readregdb: INTEGER
    regdb_e_writeregdb: INTEGER
    regdb_s_first: INTEGER
    regdb_s_last: INTEGER
    rpc_e_attempted_multithread: INTEGER
    rpc_e_call_canceled: INTEGER
    rpc_e_call_rejected: INTEGER
    rpc_e_cantcallout_again: INTEGER
    rpc_e_cantcallout_inasynccall: INTEGER
    rpc_e_cantcallout_inexternalcall: INTEGER
    rpc_e_cantcallout_ininputsynccall: INTEGER
    rpc_e_cantpost_insendcall: INTEGER
    rpc_e_canttransmit_call: INTEGER
    rpc_e_changed_mode: INTEGER
    rpc_e_client_cantmarshal_data: INTEGER
    rpc_e_client_cantunmarshal_data: INTEGER
    rpc_e_client_died: INTEGER
    rpc_e_connection_terminated: INTEGER
    rpc_e_disconnected: INTEGER
    rpc_e_fault: INTEGER
    rpc_e_invalid_calldata: INTEGER
    rpc_e_invalid_data: INTEGER
    rpc_e_invalid_datapacket: INTEGER
    rpc_e_invalid_parameter: INTEGER
    rpc_e_invalidmethod: INTEGER
    rpc_e_not_registered: INTEGER
    rpc_e_out_of_resources: INTEGER
    rpc_e_retry: INTEGER
    rpc_e_server_cantmarshal_data: INTEGER
    rpc_e_server_cantunmarshal_data: INTEGER
    rpc_e_server_died: INTEGER
    rpc_e_server_died_dne: INTEGER
    rpc_e_servercall_rejected: INTEGER
    rpc_e_servercall_retrylater: INTEGER
    rpc_e_serverfault: INTEGER
    rpc_e_sys_call_failed: INTEGER
    rpc_e_thread_not_init: INTEGER
    rpc_e_unexpected: INTEGER
    rpc_e_wrong_thread: INTEGER
    s_false: INTEGER
    s_ok: INTEGER
    stg_e_abnormalapiexit: INTEGER
    stg_e_accessdenied: INTEGER
    stg_e_cantsave: INTEGER
    stg_e_diskiswriteprotected: INTEGER
    stg_e_extantmarshallings: INTEGER
    stg_e_filealreadyexists: INTEGER
    stg_e_filenotfound: INTEGER
    stg_e_insufficientmemory: INTEGER
    stg_e_inuse: INTEGER
    stg_e_invalidflag: INTEGER
    stg_e_invalidfunction: INTEGER
    stg_e_invalidhandle: INTEGER
    stg_e_invalidheader: INTEGER
    stg_e_invalidname: INTEGER
    stg_e_invalidparameter: INTEGER
    stg_e_invalidpointer: INTEGER
    stg_e_lockviolation: INTEGER
    stg_e_mediumfull: INTEGER
    stg_e_nomorefiles: INTEGER
    stg_e_notcurrent: INTEGER
    stg_e_notfilebasedstorage: INTEGER
    stg_e_olddll: INTEGER
    stg_e_oldformat: INTEGER
    stg_e_pathnotfound: INTEGER
    stg_e_readfault: INTEGER
    stg_e_reverted: INTEGER
    stg_e_seekerror: INTEGER
    stg_e_sharerequired: INTEGER
    stg_e_shareviolation: INTEGER
    stg_e_toomanyopenfiles: INTEGER
    stg_e_unimplementedfunction: INTEGER
    stg_e_unknown: INTEGER
    stg_e_writefault: INTEGER
    stg_s_converted: INTEGER
    type_e_ambiguousname: INTEGER
    type_e_badmodulekind: INTEGER
    type_e_buffertoosmall: INTEGER
    type_e_cantcreatetmpfile: INTEGER
    type_e_cantloadlibrary: INTEGER
    type_e_circulartype: INTEGER
    type_e_dllfunctionnotfound: INTEGER
    type_e_duplicateid: INTEGER
    type_e_elementnotfound: INTEGER
    type_e_inconsistentpropfuncs: INTEGER
    type_e_invalidid: INTEGER
    type_e_invalidstate: INTEGER
    type_e_invdataread: INTEGER
    type_e_ioerror: INTEGER
    type_e_libnotregistered: INTEGER
    type_e_nameconflict: INTEGER
    type_e_outofbounds: INTEGER
    type_e_qualifiednamedisallowed: INTEGER
    type_e_registryaccess: INTEGER
    type_e_sizetoobig: INTEGER
    type_e_typemismatch: INTEGER
    type_e_undefinedtype: INTEGER
    type_e_unknownlcid: INTEGER
    type_e_unsupformat: INTEGER
    type_e_wrongtypekind: INTEGER
    view_e_draw: INTEGER
    view_e_first: INTEGER
    view_e_last: INTEGER
    view_s_already_frozen: INTEGER
    view_s_first: INTEGER
    view_s_last: INTEGER


ECOM_EXCEPTION_CODES Flat contracts

indexing
    description: "Definition of COM error codes"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_EXCEPTION_CODES

feature -- Access

    cache_e_first: INTEGER
            -- Caching error

    cache_e_last: INTEGER
            -- Caching error

    cache_e_nocache_updated: INTEGER
            --  Cache not updated

    cache_s_first: INTEGER
            -- Caching error

    cache_s_formatetc_notsupported: INTEGER
            -- FORMATETC not supported

    cache_s_last: INTEGER
            -- Caching error

    cache_s_samecache: INTEGER
            -- Same cache

    cache_s_somecaches_notupdated: INTEGER
            -- Some cache(s) not updated

    class_e_classnotavailable: INTEGER
            -- ClassFactory cannot supply requested class

    class_e_noaggregation: INTEGER
            -- Class does not support aggregation (or class object is remote)

    classfactory_e_first: INTEGER
            -- Class factory interfaces support

    classfactory_e_last: INTEGER
            -- Class factory interfaces support

    classfactory_s_first: INTEGER
            -- Class factory interfaces support

    classfactory_s_last: INTEGER
            -- Class factory interfaces support

    clientsite_e_first: INTEGER
            -- Client site error code

    clientsite_e_last: INTEGER
            -- Client site error code

    clientsite_s_first: INTEGER
            -- Client site error code

    clientsite_s_last: INTEGER
            -- Client site error code

    clipbrd_e_bad_data: INTEGER
            -- Data on clipboard is invalid

    clipbrd_e_cant_close: INTEGER
            -- CloseClipboard Failed

    clipbrd_e_cant_empty: INTEGER
            -- EmptyClipboard Failed

    clipbrd_e_cant_open: INTEGER
            -- OpenClipboard Failed

    clipbrd_e_cant_set: INTEGER
            -- SetClipboard Failed

    clipbrd_e_first: INTEGER
            -- Clipboard related error

    clipbrd_e_last: INTEGER
            -- Clipboard related error

    clipbrd_s_first: INTEGER
            -- Clipboard related error

    clipbrd_s_last: INTEGER
            -- Clipboard related error

    co_e_alreadyinitialized: INTEGER
            -- CoInitialize has already been called.

    co_e_appdidntreg: INTEGER
            -- Application was launched but it didn't register a class factory

    co_e_appnotfound: INTEGER
            -- Application not found

    co_e_appsingleuse: INTEGER
            -- Application cannot be run more than once

    co_e_bad_path: INTEGER
            -- Bad path to object

    co_e_cantdetermineclass: INTEGER
            -- Class of object cannot be determined

    co_e_class_create_failed: INTEGER
            --  Attempt to create a class object failed

    co_e_classstring: INTEGER
            -- Invalid class string

    co_e_dllnotfound: INTEGER
            -- DLL for class not found

    co_e_errorinapp: INTEGER
            -- Some error in application program

    co_e_errorindll: INTEGER
            -- Error in the DLL

    co_e_first: INTEGER
            -- Common object model DLL related error

    co_e_iidstring: INTEGER
            -- Invalid interface string

    co_e_init_class_cache: INTEGER
            -- Unable to initialize class cache

    co_e_init_memory_allocator: INTEGER
            -- Get memory allocator failure

    co_e_init_only_single_threaded: INTEGER
            -- There was an attempt to call CoInitialize a second time while single threaded

    co_e_init_rpc_channel: INTEGER
            -- Unable to initialize RPC services

    co_e_init_scm_exec_failure: INTEGER
            -- Failure attempting to launch OLE service

    co_e_init_scm_file_mapping_exists: INTEGER
            -- The OLE service file mapping already exists

    co_e_init_scm_map_view_of_file: INTEGER
            -- Unable to map view of file for OLE service

    co_e_init_scm_mutex_exists: INTEGER
            -- The OLE service mutex already exists

    co_e_init_shared_allocator: INTEGER
            -- Get shared memory allocator failure

    co_e_init_tls: INTEGER
            -- Thread local storage failure

    co_e_init_tls_channel_control: INTEGER
            -- Could not allocate thread local storage channel control

    co_e_init_tls_set_channel_control: INTEGER
            -- Cannot set thread local storage channel control

    co_e_init_unaccepted_user_allocator: INTEGER
            -- The user supplied memory allocator is unacceptable

    co_e_last: INTEGER
            -- Common object model DLL related error

    co_e_notinitialized: INTEGER
            -- CoInitialize has not been called.

    co_e_objisreg: INTEGER
            -- Object is already registered

    co_e_objnotconnected: INTEGER
            -- Object is not connected to server

    co_e_objnotreg: INTEGER
            -- Object is not registered

    co_e_objsrv_rpc_failure: INTEGER
            -- OLE service could not communicate with the object server

    co_e_released: INTEGER
            -- Object has been released

    co_e_scm_error: INTEGER
            -- OLE service could not bind object

    co_e_scm_rpc_failure: INTEGER
            -- RPC communication failed with OLE service

    co_e_server_exec_failure: INTEGER
            -- Server execution failed

    co_e_server_stopping: INTEGER
            --0x80080007
            -- Object server is stopping when OLE service contacts it

    co_e_wrongosforapp: INTEGER
            -- Wrong OS or OS version for application

    co_s_first: INTEGER
            -- Common object model DLL related error

    co_s_last: INTEGER
            -- Common object model DLL related error

    convert10_e_first: INTEGER
            -- Conversion related error

    convert10_e_last: INTEGER
            -- Conversion related error

    convert10_e_olestream_bitmap_to_dib: INTEGER
            -- There was an error in a Windows GDI call while converting the bitmap to a DIB

    convert10_e_olestream_fmt: INTEGER
            -- Contents of the OLESTREAM not in correct format

    convert10_e_olestream_get: INTEGER
            -- OLESTREAM Get method failed

    convert10_e_olestream_put: INTEGER
            -- OLESTREAM Put method failed

    convert10_e_stg_dib_to_bitmap: INTEGER
            -- There was an error in a Windows GDI call while converting the DIB to a bitmap.

    convert10_e_stg_fmt: INTEGER
            -- Contents of the IStorage not in correct format

    convert10_e_stg_no_std_stream: INTEGER
            -- Contents of IStorage is missing one of the standard streams

    convert10_s_first: INTEGER
            -- Conversion related error

    convert10_s_last: INTEGER
            -- Conversion related error

    convert10_s_no_presentation: INTEGER
            -- Unable to convert OLESTREAM to IStorage

    data_e_first: INTEGER
            -- Error code boundaries

    data_e_last: INTEGER
            -- Error code boundaries

    data_s_first: INTEGER
            -- Error code boundaries

    data_s_last: INTEGER
            -- Error code boundaries

    data_s_sameformatetc: INTEGER
            -- Data has same FORMATETC

    disp_e_arrayislocked: INTEGER
            -- Memory is locked.

    disp_e_badcallee: INTEGER
            -- Invalid callee.

    disp_e_badindex: INTEGER
            -- Invalid index.

    disp_e_badparamcount: INTEGER
            -- Invalid number of parameters.

    disp_e_badvartype: INTEGER
            -- Bad variable type.

    disp_e_exception: INTEGER
            -- Exception occurred.

    disp_e_membernotfound: INTEGER
            -- Member not found.

    disp_e_nonamedargs: INTEGER
            -- No named arguments.

    disp_e_notacollection: INTEGER
            -- Does not support a collection.

    disp_e_overflow: INTEGER
            -- Out of present range.

    disp_e_paramnotfound: INTEGER
            -- Parameter not found.

    disp_e_paramnotoptional: INTEGER
            -- Parameter not optional.

    disp_e_typemismatch: INTEGER
            -- Type mismatch.

    disp_e_unknowninterface: INTEGER
            -- Unknown interface.

    disp_e_unknownlcid: INTEGER
            -- Unknown language.

    disp_e_unknownname: INTEGER
            -- Unknown name.

    dragdrop_e_alreadyregistered: INTEGER
            -- This window has already been registered as a drop target

    dragdrop_e_first: INTEGER
            -- Drag-and-drop interfaces error support

    dragdrop_e_invalidhwnd: INTEGER
            -- Invalid window handle

    dragdrop_e_last: INTEGER
            -- Drag-and-drop interfaces error support

    dragdrop_e_notregistered: INTEGER
            -- Trying to revoke a drop target that has not been registered

    dragdrop_s_cancel: INTEGER
            -- Drag-drop operation canceled

    dragdrop_s_drop: INTEGER
            -- Successful drop took place

    dragdrop_s_first: INTEGER
            -- Drag-and-drop interfaces error support

    dragdrop_s_last: INTEGER
            -- Drag-and-drop interfaces error support

    dragdrop_s_usedefaultcursors: INTEGER
            -- Use the default cursor

    dv_e_clipformat: INTEGER
            -- Invalid clipboard format

    dv_e_dvaspect: INTEGER
            -- Invalid aspect(s)

    dv_e_dvtargetdevice: INTEGER
            -- Invalid DVTARGETDEVICE structure

    dv_e_dvtargetdevice_size: INTEGER
            -- tdSize parameter of the DVTARGETDEVICE structure is invalid

    dv_e_formatetc: INTEGER
            -- Invalid FORMATETC structure

    dv_e_lindex: INTEGER
            -- Invalid lindex

    dv_e_noiviewobject: INTEGER
            -- Object doesn't support IViewObject interface

    dv_e_statdata: INTEGER
            -- Invalid STATDATA structure

    dv_e_stgmedium: INTEGER
            -- Invalid STDGMEDIUM structure

    dv_e_tymed: INTEGER
            -- Invalid tymed

    e_abort: INTEGER
            -- Operation aborted

    e_accessdenied: INTEGER
            -- General access denied error

    e_advf: INTEGER
            -- Invalid advise flags

    e_advisenotsupported: INTEGER
            -- This implementation doesn't take advises

    e_blank: INTEGER
            -- Uninitialized object

    e_cant_bindtosource: INTEGER
            -- Not able to bind to the source

    e_cant_getmoniker: INTEGER
            -- Not able to get the moniker of the object

    e_cantconvert: INTEGER
            -- Not able to convert object

    e_classdiff: INTEGER
            -- Linked object's source class has changed

    E_end_of_stream: INTEGER is 114
            -- End of stream has been reached while reading

    e_enum_nomore: INTEGER
            -- Can't enumerate any more, because the associated data is missing

    e_fail: INTEGER
            -- Unspecified error

    e_handle: INTEGER
            -- Invalid handle

    e_invalidarg: INTEGER
            -- One or more arguments are invalid

    e_invalidhwnd: INTEGER
            -- Invalid window handle

    e_invalidrect: INTEGER
            -- Invalid rectangle

    e_nocache: INTEGER
            -- There is no cache to operate on

    e_noconnection: INTEGER
            -- There is no connection for this connection ID

    e_nointerface: INTEGER
            -- No such interface supported

    e_nostorage: INTEGER
            -- Not able to perform the operation because object is not given storage yet

    e_not_inplaceactive: INTEGER
            -- Object is not in any of the inplace active states

    e_notimpl: INTEGER
            -- Not implemented

    e_notrunning: INTEGER
            -- Need to run the object to perform this operation

    e_oleverb: INTEGER
            --Invalid OLEVERB structure

    e_outofmemory: INTEGER
            -- Ran out of memory

    e_pointer: INTEGER
            -- Invalid pointer

    e_promptsavecancelled: INTEGER
            --0x8004000B
            -- User cancelled out of save dialog

    e_static: INTEGER
            -- Object is static operation not allowed

    e_unexpected: INTEGER
            -- Unexpected failure

    e_wrongcompobj: INTEGER
            -- compobj.dll is too old for the ole2.dll initialized

    enum_e_first: INTEGER
            -- Enumerator related error

    enum_e_last: INTEGER
            -- Enumerator related error

    enum_s_first: INTEGER
            -- Enumerator related error

    enum_s_last: INTEGER
            -- Enumerator related error

    inplace_e_first: INTEGER
            -- Inplace activation related error

    inplace_e_last: INTEGER
            -- Inplace activation related error

    inplace_e_notoolspace: INTEGER
            --  Space for tools is not available

    inplace_e_notundoable: INTEGER
            --  Undo is not available

    inplace_s_first: INTEGER
            -- Inplace activation related error

    inplace_s_last: INTEGER
            -- Inplace activation related error

    inplace_s_truncated: INTEGER
            -- Message is too long some of it had to be truncated before displaying

    marshal_e_first: INTEGER
            -- Error code boundaries

    marshal_e_last: INTEGER
            -- Error code boundaries

    marshal_s_first: INTEGER
            -- Error code boundaries

    marshal_s_last: INTEGER
            -- Error code boundaries

    mem_e_invalid_link: INTEGER
            -- An allocation chain contained an invalid link pointer

    mem_e_invalid_root: INTEGER
            -- An invalid root block pointer was specified

    mem_e_invalid_size: INTEGER
            -- The requested allocation size was too large

    mk_e_cantopenfile: INTEGER
            -- Moniker cannot open file

    mk_e_connectmanually: INTEGER
            -- Moniker needs to be connected manually

    mk_e_enumeration_failed: INTEGER
            -- Moniker could not be enumerated

    mk_e_exceededdeadline: INTEGER
            -- Operation exceeded deadline

    mk_e_first: INTEGER
            -- Moniker related error

    mk_e_intermediateinterfacenotsupported: INTEGER
            -- Intermediate operation failed

    mk_e_invalidextension: INTEGER
            -- Bad extension for file

    mk_e_last: INTEGER
            -- Moniker related error

    mk_e_mustbotheruser: INTEGER
            -- User input required for operation to succeed

    mk_e_needgeneric: INTEGER
            -- Moniker needs to be generic

    mk_e_no_normalized: INTEGER
            -- Moniker path could not be normalized

    mk_e_noinverse: INTEGER
            -- Moniker class has no inverse

    mk_e_noobject: INTEGER
            -- No object for moniker

    mk_e_noprefix: INTEGER
            -- No common prefix

    mk_e_nostorage: INTEGER
            -- Moniker does not refer to storage

    mk_e_notbindable: INTEGER
            -- Moniker is not bindable

    mk_e_notbound: INTEGER
            -- Moniker is not bound

    mk_e_syntax: INTEGER
            -- Invalid syntax

    mk_e_unavailable: INTEGER
            -- Operation unavailable

    mk_s_first: INTEGER
            -- Moniker related error

    mk_s_him: INTEGER
            -- Common prefix is input moniker

    mk_s_last: INTEGER
            -- Moniker related error

    mk_s_me: INTEGER
            -- Common prefix is this moniker

    mk_s_monikeralreadyregistered: INTEGER
            -- Moniker is already registered in running object table

    mk_s_reduced_to_self: INTEGER
            -- Moniker reduced to itself

    mk_s_us: INTEGER
            -- Common prefix is both monikers

    noerror: INTEGER
            -- Success code

    ole_e_first: INTEGER
            -- Generic OLE error/success code

    ole_e_last: INTEGER
            -- Generic OLE error/success code

    ole_s_first: INTEGER
            -- Generic OLE error/success code

    ole_s_last: INTEGER
            -- Generic OLE error/success code

    ole_s_mac_clipformat: INTEGER
            -- Macintosh clipboard format

    ole_s_static: INTEGER
            -- Success, but static

    ole_s_usereg: INTEGER
            -- Use the registry database to provide the requested information

    oleobj_e_first: INTEGER
            -- Ole object error code

    oleobj_e_invalidverb: INTEGER
            --  Invalid verb for OLE object

    oleobj_e_last: INTEGER
            -- Ole object error code

    oleobj_e_noverbs: INTEGER
            --  No verbs for OLE object

    oleobj_s_cannot_doverb_now: INTEGER
            -- Verb number is valid but verb cannot be done now

    oleobj_s_first: INTEGER
            -- Ole object error code

    oleobj_s_invalidhwnd: INTEGER
            -- Invalid window handle passed

    oleobj_s_invalidverb: INTEGER
            -- Invalid verb for OLE object

    oleobj_s_last: INTEGER
            -- Ole object error code

    regdb_e_classnotreg: INTEGER
            --  Class not registered

    regdb_e_first: INTEGER
            -- Registry operations error code

    regdb_e_iidnotreg: INTEGER
            --  Interface not registered

    regdb_e_invalidvalue: INTEGER
            --  Invalid value for registry

    regdb_e_keymissing: INTEGER
            --  Could not find the key in the registry

    regdb_e_last: INTEGER
            -- Registry operations error code

    regdb_e_readregdb: INTEGER
            -- Could not read key from registry

    regdb_e_writeregdb: INTEGER
            -- Could not write key to registry

    regdb_s_first: INTEGER
            -- Registry operations error code

    regdb_s_last: INTEGER
            -- Registry operations error code

    rpc_e_attempted_multithread: INTEGER
            -- Attempted to make calls on more than one thread in single threaded mode.

    rpc_e_call_canceled: INTEGER
            -- Call was canceled by the message filter.

    rpc_e_call_rejected: INTEGER
            -- Remote procedure call errors
            -- Call was rejected by callee.

    rpc_e_cantcallout_again: INTEGER
            -- There is no second outgoing call on same channel in DDE conversation.

    rpc_e_cantcallout_inasynccall: INTEGER
            -- The caller is dispatching an asynchronous call and cannot
            -- make an outgoing call on behalf of this call.

    rpc_e_cantcallout_inexternalcall: INTEGER
            -- It is illegal to call out while inside message filter.

    rpc_e_cantcallout_ininputsynccall: INTEGER
            -- An outgoing call cannot be made since the application is dispatching an input-synchronous call.

    rpc_e_cantpost_insendcall: INTEGER
            -- The caller is dispatching an intertask SendMessage call and
            -- cannot call out via PostMessage.

    rpc_e_canttransmit_call: INTEGER
            -- The call was not transmitted properly the message queue
            -- was full and was not emptied after yielding.

    rpc_e_changed_mode: INTEGER
            -- Cannot change thread mode after it is set.

    rpc_e_client_cantmarshal_data: INTEGER
            -- The client (caller) cannot marshall the parameter data - low memory, etc.

    rpc_e_client_cantunmarshal_data: INTEGER
            -- The client (caller) cannot unmarshall the return data - low memory, etc.

    rpc_e_client_died: INTEGER
            -- The caller (client) disappeared while the callee (server) was
            -- processing a call.

    rpc_e_connection_terminated: INTEGER
            -- The connection terminated or is in a bogus state
            -- and cannot be used any more. Other connections
            -- are still valid.

    rpc_e_disconnected: INTEGER
            -- The object invoked has disconnected from its clients.

    rpc_e_fault: INTEGER
            -- RPC could not call the server or could not return the results of calling the server.

    rpc_e_invalid_calldata: INTEGER
            -- A call control interfaces was called with invalid data.

    rpc_e_invalid_data: INTEGER
            -- Received data is invalid could be server or client data.

    rpc_e_invalid_datapacket: INTEGER
            -- The data packet with the marshalled parameter data is incorrect.

    rpc_e_invalid_parameter: INTEGER
            -- A particular parameter is invalid and cannot be (un)marshalled.

    rpc_e_invalidmethod: INTEGER
            -- The method called does not exist on the server.

    rpc_e_not_registered: INTEGER
            -- The requested interface is not registered on the server object.

    rpc_e_out_of_resources: INTEGER
            -- Could not allocate some required resource (memory, events, ...)

    rpc_e_retry: INTEGER
            -- The object invoked chose not to process the call now.  Try again later.

    rpc_e_server_cantmarshal_data: INTEGER
            -- The server (callee) cannot marshall the return data - low memory, etc.

    rpc_e_server_cantunmarshal_data: INTEGER
            -- The server (callee) cannot unmarshall the parameter data - low memory, etc.

    rpc_e_server_died: INTEGER
            -- The callee (server [not server application]) is not available
            -- and disappeared all connections are invalid.  The call may
            -- have executed.

    rpc_e_server_died_dne: INTEGER
            -- The callee (server [not server application]) is not available
            -- and disappeared all connections are invalid.  The call did not execute.

    rpc_e_servercall_rejected: INTEGER
            -- The message filter rejected the call.

    rpc_e_servercall_retrylater: INTEGER
            -- The message filter indicated that the application is busy.

    rpc_e_serverfault: INTEGER
            -- The server threw an exception.

    rpc_e_sys_call_failed: INTEGER
            -- System call failed.

    rpc_e_thread_not_init: INTEGER
            -- CoInitialize has not been called on the current thread.

    rpc_e_unexpected: INTEGER
            -- An internal error occurred.

    rpc_e_wrong_thread: INTEGER
            -- The application called an interface that was marshalled for a different thread.

    s_false: INTEGER
            -- Success code

    s_ok: INTEGER
            -- Success code

    stg_e_abnormalapiexit: INTEGER
            -- An API call exited abnormally.

    stg_e_accessdenied: INTEGER
            -- Access Denied.

    stg_e_cantsave: INTEGER
            -- Can't save.

    stg_e_diskiswriteprotected: INTEGER
            -- Disk is write-protected.

    stg_e_extantmarshallings: INTEGER
            -- Illegal operation called on object with extant marshallings.

    stg_e_filealreadyexists: INTEGER
            -- %1 already exists.

    stg_e_filenotfound: INTEGER
            --  %1 could not be found.

    stg_e_insufficientmemory: INTEGER
            -- There is insufficient memory available to complete operation.

    stg_e_inuse: INTEGER
            -- Attempted to use an object that is busy.

    stg_e_invalidflag: INTEGER
            -- Invalid flag error.

    stg_e_invalidfunction: INTEGER
            -- Storage related errors
            -- Unable to perform requested operation.

    stg_e_invalidhandle: INTEGER
            -- Attempted an operation on an invalid object.

    stg_e_invalidheader: INTEGER
            -- The file %1 is not a valid compound file.

    stg_e_invalidname: INTEGER
            -- The name %1 is not valid.

    stg_e_invalidparameter: INTEGER
            -- Invalid parameter error.

    stg_e_invalidpointer: INTEGER
            -- Invalid pointer error.

    stg_e_lockviolation: INTEGER
            -- A lock violation has occurred.

    stg_e_mediumfull: INTEGER
            -- There is insufficient disk space to complete operation.

    stg_e_nomorefiles: INTEGER
            -- There are no more entries to return.

    stg_e_notcurrent: INTEGER
            -- The storage has been changed since the last commit.

    stg_e_notfilebasedstorage: INTEGER
            -- Illegal operation called on non-file based storage.

    stg_e_olddll: INTEGER
            -- The compound file %1 was produced with a newer version of storage.

    stg_e_oldformat: INTEGER
            -- The compound file %1 was produced with an incompatible version of storage.

    stg_e_pathnotfound: INTEGER
            -- The path %1 could not be found.

    stg_e_readfault: INTEGER
            -- A disk error occurred during a read operation.

    stg_e_reverted: INTEGER
            -- Attempted to use an object that has ceased to exist.

    stg_e_seekerror: INTEGER
            -- An error occurred during a seek operation.

    stg_e_sharerequired: INTEGER
            -- Share.exe or equivalent is required for operation.

    stg_e_shareviolation: INTEGER
            -- A share violation has occurred.

    stg_e_toomanyopenfiles: INTEGER
            -- There are insufficient resources to open another file.

    stg_e_unimplementedfunction: INTEGER
            -- That function is not implemented.

    stg_e_unknown: INTEGER
            -- An unexpected error occurred.

    stg_e_writefault: INTEGER
            -- A disk error occurred during a write operation.

    stg_s_converted: INTEGER
            -- The underlying file was converted to compound file format.

    type_e_ambiguousname: INTEGER
            -- Ambiguous name.

    type_e_badmodulekind: INTEGER
            -- Wrong module kind for the operation.

    type_e_buffertoosmall: INTEGER
            --  Buffer too small.

    type_e_cantcreatetmpfile: INTEGER
            -- Error creating unique tmp file.

    type_e_cantloadlibrary: INTEGER
            -- Error loading type library/DLL.

    type_e_circulartype: INTEGER
            -- Circular dependency between types/modules.

    type_e_dllfunctionnotfound: INTEGER
            -- Function not defined in specified DLL.

    type_e_duplicateid: INTEGER
            -- Duplicate ID in inheritance hierarchy.

    type_e_elementnotfound: INTEGER
            -- Element not found.

    type_e_inconsistentpropfuncs: INTEGER
            -- Inconsistent property functions.

    type_e_invalidid: INTEGER
            -- Incorrect inheritance depth in standard OLE hmember.

    type_e_invalidstate: INTEGER
            -- Invalid forward reference, or reference to uncompiled type.

    type_e_invdataread: INTEGER
            -- Old format or invalid type library.

    type_e_ioerror: INTEGER
            -- I/O Error.

    type_e_libnotregistered: INTEGER
            -- Library not registered.

    type_e_nameconflict: INTEGER
            -- Name already exists in the library.

    type_e_outofbounds: INTEGER
            -- Invalid number of arguments.

    type_e_qualifiednamedisallowed: INTEGER
            -- Qualified name disallowed.

    type_e_registryaccess: INTEGER
            -- Error accessing the OLE registry.

    type_e_sizetoobig: INTEGER
            -- Size may not exceed 64K.

    type_e_typemismatch: INTEGER
            -- Type mismatch.

    type_e_undefinedtype: INTEGER
            -- Bound to unknown type.

    type_e_unknownlcid: INTEGER
            -- Unknown LCID.

    type_e_unsupformat: INTEGER
            -- Old format or invalid type library.

    type_e_wrongtypekind: INTEGER
            -- Type mismatch.

    view_e_draw: INTEGER
            -- Error drawing view

    view_e_first: INTEGER
            -- Error code boundaries

    view_e_last: INTEGER
            -- Error code boundaries

    view_s_already_frozen: INTEGER
            -- View is already frozen

    view_s_first: INTEGER
            -- Error code boundaries

    view_s_last: INTEGER
            -- Error code boundaries

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_EXCEPTION_CODES


ECOM_FLAGS Chart

class
    ECOM_FLAGS

General
    cluster: com.Constants
    description: "Generic flags class."

Ancestors
    ANY


ECOM_LOAD_PICTURE_CONSTANTS_ENUM Chart

class
    ECOM_LOAD_PICTURE_CONSTANTS_ENUM

General
    cluster: com.Constants
    description: "OLE Automation."

Ancestors
    ANY

Queries
    Color: INTEGER
    Default1: INTEGER
    Monochrome: INTEGER
    Vga_color: INTEGER


ECOM_LOAD_PICTURE_CONSTANTS_ENUM Flat contracts

indexing
    description: "OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    ECOM_LOAD_PICTURE_CONSTANTS_ENUM

feature -- Access

    Color: INTEGER is 4
            -- No description available.

    Default1: INTEGER is 0
            -- No description available.

    Monochrome: INTEGER is 1
            -- No description available.

    Vga_color: INTEGER is 2
            -- No description available.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_LOAD_PICTURE_CONSTANTS_ENUM


ECOM_LOCK_TYPES Chart

class
    ECOM_LOCK_TYPES

General
    cluster: com.Constants
    description: "IStorage and Istream lock types flags"

Ancestors
    ANY

Queries
    is_valid_lock (lock: INTEGER): BOOLEAN
    lock_exclusive: INTEGER
    lock_onlyonce: INTEGER
    lock_write: INTEGER


ECOM_LOCK_TYPES Flat contracts

indexing
    description: "IStorage and Istream lock types flags"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_LOCK_TYPES

feature -- Access

    is_valid_lock (lock: INTEGER): BOOLEAN
            -- Is lock a valid locktype?

    lock_exclusive: INTEGER
            -- Attempts to read or write this stream by other stream openings
            -- return error EOLE_STG_E_ACCESSDENIED.

    lock_onlyonce: INTEGER
            -- If lock is granted, no other EOLE_LOCK_ONLYONCE lock can be
            -- obtained on bytes in given region. Usually this lock type
            -- is an alias for some other lock type and other semantics might occur
            -- as a side effect.

    lock_write: INTEGER
            -- If lock is granted, specified region of stream
            -- can be read by calling IStream.Read from any opening of
            -- this stream. Attempts to write to this region from any opening
            -- of this stream other than the one to which lock was granted
            -- returns error EOLE_STG_E_ACCESSDENIED.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_LOCK_TYPES


ECOM_OLE_TRISTATE_ENUM Chart

class
    ECOM_OLE_TRISTATE_ENUM

General
    cluster: com.Constants
    description: "OLE Automation."

Ancestors
    ANY

Queries
    Checked: INTEGER
    Gray: INTEGER
    Unchecked: INTEGER


ECOM_OLE_TRISTATE_ENUM Flat contracts

indexing
    description: "OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    ECOM_OLE_TRISTATE_ENUM

feature -- Access

    Checked: INTEGER is 1
            -- No description available.

    Gray: INTEGER is 2
            -- No description available.

    Unchecked: INTEGER is 0
            -- No description available.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_OLE_TRISTATE_ENUM


ECOM_STAT_FLAGS Chart

class
    ECOM_STAT_FLAGS

General
    cluster: com.Constants
    description: "Stat flags, used in feature `stat' of EOLE_STREAM"

Ancestors
    ANY

Queries
    is_valid_stat_flag (flag: INTEGER): BOOLEAN
    statflag_default: INTEGER
    statflag_noname: INTEGER


ECOM_STAT_FLAGS Flat contracts

indexing
    description: "Stat flags, used in feature `stat' of EOLE_STREAM"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STAT_FLAGS

feature -- Access

    is_valid_stat_flag (flag: INTEGER): BOOLEAN
            -- Is flag a valid stat flag?

    statflag_default: INTEGER
            -- Indicate that this is not used for property

    statflag_noname: INTEGER
            -- Indicate that this is not used for property

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STAT_FLAGS


ECOM_STGC Chart

class
    ECOM_STGC

General
    cluster: com.Constants
    description: "SToraGe Commit mode flags"

Ancestors
    ANY

Queries
    is_valid_stgc (stgc: INTEGER): BOOLEAN
    stgc_dangerouslycommitmerelytodiskcache: INTEGER
    stgc_default: INTEGER
    stgc_onlyifcurrent: INTEGER
    stgc_overwrite: INTEGER


ECOM_STGC Flat contracts

indexing
    description: "SToraGe Commit mode flags"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STGC

feature -- Access

    is_valid_stgc (stgc: INTEGER): BOOLEAN
            -- Is stgc a valid storage commit mode flag?

    stgc_dangerouslycommitmerelytodiskcache: INTEGER
            -- EOLE_STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE commits the changes,
            -- but does not save them to the disk cache.

    stgc_default: INTEGER
            -- OLE 2 default commit mode

    stgc_onlyifcurrent: INTEGER
            -- EOLE_STGC_ONLYIFCURRENT prevents multiple users of an IStorage
            -- from overwriting the other's changes. EOLE_STGC_ONLYIFCURRENT
            -- commits changes only if no one else has made changes since the
            -- last time this user opened the IStorage or committed. If other
            -- changes have been made, EOLE_STG_E_NOTCURRENT is returned.
            -- If the caller chooses to overwrite the changes, IStorage.Commit
            -- can be called with commit mode set to EOLE_STGC_DEFAULT.

    stgc_overwrite: INTEGER
            -- EOLE_STGC_OVERWRITE allows new data to overwrite the old data,
            -- reducing space requirements. EOLE_STGC_OVERWRITE is not recommended
            -- for usual operation, but it could be useful in the following
            -- situations:
            --    1. A commit was tried and EOLE_STG_E_MEDIUMFULL was returned.
            --    2. The user has somehow specified a willingness to risk
            --       overwriting the old data.
            --    3. A low-memory save sequence is being used to end up with a
            --       smaller file.
            -- The commit operation obtains all the disk space it needs before
            -- attempting to store the new data, whether or not EOLE_STGC_OVERWRITE
            -- is specified. If space requirements prohibit the save, the old
            -- data will be intact, including all uncommitted changes. However,
            -- if the commit fails due to reasons other than lack of disk space
            -- and EOLE_STGC_OVERWRITE was specified, it is possible that neither
            -- the old nor the new version of the data will be intact.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STGC


ECOM_STGMOVE Chart

class
    ECOM_STGMOVE

General
    cluster: com.Constants
    description: "SToraGe MOVE flags"

Ancestors
    ANY

Queries
    is_valid_stgmove (stgmove: INTEGER): BOOLEAN
    stgmove_copy: INTEGER
    stgmove_move: INTEGER


ECOM_STGMOVE Flat contracts

indexing
    description: "SToraGe MOVE flags"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STGMOVE

feature -- Access

    is_valid_stgmove (stgmove: INTEGER): BOOLEAN
            -- Is stgmove a valid storage move flag?

    stgmove_copy: INTEGER
            -- Carry out the first part of the move operation but do
            -- not remove the original element.

    stgmove_move: INTEGER
            -- Carry out the move operation, as expected.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STGMOVE


ECOM_STGM Chart

class
    ECOM_STGM

General
    cluster: com.Constants
    description: "SToraGe Mode flags"

Ancestors
    ANY

Queries
    is_valid_stgm (stgm: INTEGER): BOOLEAN
    stgm_convert: INTEGER
    stgm_create: INTEGER
    stgm_deleteonrelease: INTEGER
    stgm_direct: INTEGER
    stgm_failifthere: INTEGER
    stgm_priority: INTEGER
    stgm_read: INTEGER
    stgm_readwrite: INTEGER
    stgm_share_deny_none: INTEGER
    stgm_share_deny_read: INTEGER
    stgm_share_deny_write: INTEGER
    stgm_share_exclusive: INTEGER
    stgm_transacted: INTEGER
    stgm_write: INTEGER


ECOM_STGM Flat contracts

indexing
    description: "SToraGe Mode flags"
    note: "Priority mode not supported"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STGM

feature -- Access

    is_valid_stgm (stgm: INTEGER): BOOLEAN
            -- Is stgm a valid storage mode flag?

    stgm_convert: INTEGER
            -- This flag is applicable only to the creation of IStorage objects.
            -- Stgm_convert allows the creation to proceed while preserving
            -- existing data. The old data is saved to a stream named CONTENTS
            -- containing the same data that was in the old IStorage or IStream
            -- instance. In the IStorage case, the data is flattened to a
            -- stream regardless of whether the existing file currently contains
            -- a layered storage object.

    stgm_create: INTEGER
            -- Stgm_create indicates an existing IStorage or IStream object
            -- should be removed before the new one replaces it. A new object
            -- is created when this flag is specified only if the existing
            -- IStorage or IStream has been successfully removed.

    stgm_deleteonrelease: INTEGER
            -- The Stgm_deleteonrelease flag indicates that the underlying
            -- file is to be automatically destroyed when the root IStorage
            -- object is released. This capability is most useful for
            -- creating temporary files.

    stgm_direct: INTEGER
            -- Stgm_DIrect is always specified for IStream objects.
            -- Stgm_transacted is not supported in the compound file
            -- implementation of IStream. Other implementations can choose
            -- to support it.

    stgm_failifthere: INTEGER
            -- Stgm_failifthere causes the create operation to fail if an
            -- existing object with the specified name exists. In this case,
            -- Stg_e_filealreadyexists is returned. Stgm_failifthere
            -- applies to both IStorage and IStream objects.

    stgm_priority: INTEGER
            -- The Stgm_priority flag allows an IStorage object to be opened
            -- so that a subsequent copy operation can be done at reduced cost.
            -- Stgm_priority allows an application to read certain streams
            -- from storage before opening the storage object in a mode that would
            -- require a snapshot copy to be made. Priority mode has exclusive
            -- access to the committed version of the IStorage object.
            -- While a compound file is open in priority mode, no other opening
            -- of the compound file can commit changes even one that was opened
            -- before the priority mode opening. Therefore, applications should
            -- keep IStorage objects open in priority mode for as short a time
            -- as possible.

    stgm_read: INTEGER
            -- When applied to an IStream object, Stgm_READ enables
            -- applications to successfully call IStream.Read. If Stgm_read
            -- is omitted, IStream.Read will return an error. When applied to an
            -- IStorage, Stgm_READ allows the enumeration of the storage
            -- object's elements and enables applications to open these elements
            -- in read mode. Parents of storage objects to be opened in read mode
            -- must also have been opened in read mode otherwise, an error is
            -- returned.

    stgm_readwrite: INTEGER
            -- Stgm_readwrite is the logical combination of the
            -- Stgm_read and Stgm_write. However, the defined value
            -- of Stgm_readwrite is not equal to
            -- (Stgm_read or Stgm_write).

    stgm_share_deny_none: INTEGER
            -- 0x00000040L
            -- Stgm_SHARE_DENY_NONE indicates that neither read access nor
            -- write access should be denied to subsequent openings. This is the
            -- default sharing mode and if no Stgm_SHARE_* flag is explicitly
            -- given, Stgm_SHARE_DENY_NONE is implied.

    stgm_share_deny_read: INTEGER
            -- 0x00000030L
            -- When successfully applied to a root IStorage, the
            -- Stgm_SHARE_DENY_READ flag prevents others from opening the
            -- object in read mode. The open call fails and returns an error if
            -- the object is presently open in deny-read mode.
            -- Stgm_SHARE_DENY_READ is most useful when opening root storage
            -- objects. Deny modes on inner elements are still useful if some
            -- component is coordinating the opening of these inner elements, as
            -- might happen in a Copy/Paste operation. However, inner elements
            -- always require Stgm_SHARE_EXCLUSIVE. Opening a parent storage
            -- object with Stgm_SHARE_DENY_READ applies only to that opening,
            -- not the network-wide set of openings of the parent.

    stgm_share_deny_write: INTEGER
            -- When successfully applied the Stgm_share_deny_write flag
            -- prevents subsequent openings of either a storage or a stream from
            -- specifying write mode. The open call fails and returns an error
            -- if the storage or stream is presently open in write mode.
            -- For information about the interaction of this flag with nested
            -- openings, see the earlier discussion about Stgm_share_deny_read.

    stgm_share_exclusive: INTEGER
            -- The compound files implementation requires that all inner elements
            -- be opened Stgm_share_exclusive. It is the logical combination
            -- of the Stgm_share_deny_read and Stgm_share_deny_write.
            -- All root storage objects, as well as child storage and stream
            -- objects must be opened with Stgm_share_exclusive.

    stgm_transacted: INTEGER
            -- The transaction for each open object is nested in the transaction
            -- for its parent storage object. Therefore, committing changes at the
            -- child level is dependent on committing changes in the parent and
            -- a commit of the root storage object (top-level parent) is necessary
            -- before changes to an object are actually written to disk.
            -- The changes percolate upward: inner objects publish changes to the
            -- transaction of the next object outwards. Outermost objects publish
            -- changes permanently into the file system. Transacted mode is not
            -- required on the parent storage object in order to use transacted
            -- mode on a contained object.The scope of changes that are buffered
            -- in transacted mode is very broad. A storage or stream object can
            -- be opened, have arbitrary changes made to it, and then have the
            -- changes reverted, preserving the object as it was when it was
            -- first opened. The creation and destruction of elements within a
            -- storage object are scoped by its transaction.

    stgm_write: INTEGER
            -- Stgm_write lets an object commit changes to the storage.
            -- Specifically, unless this flag has been given, IStorage.Commit
            -- and IStream.Commit will fail. An open object whose changes cannot
            -- be committed can save its changes by copying the storage or stream
            -- with IStorage.CopyTo or IStream.CopyTo. In direct mode,
            -- changes are committed after every change operation. Thus, write
            -- permissions are needed to call any function that causes a change.
            -- On streams, this includes IStream.Write and IStream.SetSize.
            -- If a parent storage is opened in direct mode without write
            -- permission, any attempt to open a child stream within it in direct
            -- mode with write permission will fail, because it causes an implicit
            -- commit to be made on the storage. Similarly, trying to create or
            -- destroy a contained element in this storage object also causes an
            -- implicit commit, resulting in an error.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STGM


ECOM_STGTY Chart

class
    ECOM_STGTY

General
    cluster: com.Constants
    description: "SToraGe TYpe flags"

Ancestors
    ANY

Queries
    is_valid_stgty (stgty: INTEGER): BOOLEAN
    stgty_lockbytes: INTEGER
    stgty_storage: INTEGER
    stgty_stream: INTEGER


ECOM_STGTY Flat contracts

indexing
    description: "SToraGe TYpe flags"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STGTY

feature -- Access

    is_valid_stgty (stgty: INTEGER): BOOLEAN
            -- Is stgty a valid storage type flag?

    stgty_lockbytes: INTEGER
            -- Byte array object

    stgty_storage: INTEGER
            -- Storage object

    stgty_stream: INTEGER
            -- Stream object

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STGTY


ECOM_STREAM_SEEK Chart

class
    ECOM_STREAM_SEEK

General
    cluster: com.Constants
    description: "IStorage and IStream Seek flags"

Ancestors
    ANY

Queries
    is_valid_seek (seek: INTEGER): BOOLEAN
    stream_seek_cur: INTEGER
    stream_seek_end: INTEGER
    stream_seek_set: INTEGER


ECOM_STREAM_SEEK Flat contracts

indexing
    description: "IStorage and IStream Seek flags"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STREAM_SEEK

feature -- Access

    is_valid_seek (seek: INTEGER): BOOLEAN
            -- Is seek a valid IStorage and IStream seek flag?

    stream_seek_cur: INTEGER
            -- Sets seek position relative to
            -- current position of stream

    stream_seek_end: INTEGER
            -- Sets seek position relative to
            -- current end of stream

    stream_seek_set: INTEGER
            -- Sets seek position relative to
            -- beginning of stream

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STREAM_SEEK


ECOM_VAR_TYPE Chart

class
    ECOM_VAR_TYPE

General
    cluster: com.Constants
    description: "VARTYPE constants"

Ancestors
    ECOM_FLAGS

Queries
    is_array (variable_type: INTEGER): BOOLEAN
    is_basic (a_type: INTEGER): BOOLEAN
    is_boolean (variable_type: INTEGER): BOOLEAN
    is_bstr (variable_type: INTEGER): BOOLEAN
    is_byref (variable_type: INTEGER): BOOLEAN
    is_carray (variable_type: INTEGER): BOOLEAN
    is_character (variable_type: INTEGER): BOOLEAN
    is_currency (variable_type: INTEGER): BOOLEAN
    is_date (variable_type: INTEGER): BOOLEAN
    is_decimal (variable_type: INTEGER): BOOLEAN
    is_dispatch (variable_type: INTEGER): BOOLEAN
    is_error (variable_type: INTEGER): BOOLEAN
    is_hresult (variable_type: INTEGER): BOOLEAN
    is_int (variable_type: INTEGER): BOOLEAN
    is_integer2 (variable_type: INTEGER): BOOLEAN
    is_integer4 (variable_type: INTEGER): BOOLEAN
    is_long_long (variable_type: INTEGER): BOOLEAN
    is_lpstr (variable_type: INTEGER): BOOLEAN
    is_lpwstr (variable_type: INTEGER): BOOLEAN
    is_ptr (variable_type: INTEGER): BOOLEAN
    is_real4 (variable_type: INTEGER): BOOLEAN
    is_real8 (variable_type: INTEGER): BOOLEAN
    is_safearray (variable_type: INTEGER): BOOLEAN
    is_unknown (variable_type: INTEGER): BOOLEAN
    is_unsigned_char (variable_type: INTEGER): BOOLEAN
    is_unsigned_int (variable_type: INTEGER): BOOLEAN
    is_unsigned_long (variable_type: INTEGER): BOOLEAN
    is_unsigned_long_long (variable_type: INTEGER): BOOLEAN
    is_unsigned_short (variable_type: INTEGER): BOOLEAN
    is_user_defined (variable_type: INTEGER): BOOLEAN
    is_variant (variable_type: INTEGER): BOOLEAN
    is_void (variable_type: INTEGER): BOOLEAN
    valid_var_type (a_var_type: INTEGER): BOOLEAN
    vt_array: INTEGER
    vt_bool: INTEGER
    vt_bstr: INTEGER
    vt_byref: INTEGER
    vt_carray: INTEGER
    vt_cy: INTEGER
    vt_date: INTEGER
    vt_decimal: INTEGER
    vt_dispatch: INTEGER
    vt_empty: INTEGER
    vt_error: INTEGER
    vt_hresult: INTEGER
    vt_i1: INTEGER
    vt_i2: INTEGER
    vt_i4: INTEGER
    vt_i8: INTEGER
    vt_int: INTEGER
    vt_lpstr: INTEGER
    vt_lpwstr: INTEGER
    vt_null: INTEGER
    vt_ptr: INTEGER
    vt_r4: INTEGER
    vt_r8: INTEGER
    vt_record: INTEGER
    vt_reserved: INTEGER
    vt_safearray: INTEGER
    vt_typemask: INTEGER
    vt_ui1: INTEGER
    vt_ui2: INTEGER
    vt_ui4: INTEGER
    vt_ui8: INTEGER
    vt_uint: INTEGER
    vt_unknown: INTEGER
    vt_userdefined: INTEGER
    vt_variant: INTEGER
    vt_void: INTEGER


ECOM_VAR_TYPE Flat contracts

indexing
    description: "VARTYPE constants"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_VAR_TYPE

feature -- Access

    vt_array: INTEGER
            -- A Safe array of data is passed

    vt_bool: INTEGER
            -- Boolean: True = -1 False = 0

    vt_bstr: INTEGER
            -- Binary string

    vt_byref: INTEGER
            -- Pointer to data is passed

    vt_carray: INTEGER
            -- array
            -- may appear in TYPEDESC only

    vt_cy: INTEGER
            -- Currency

    vt_date: INTEGER
            -- Date

    vt_decimal: INTEGER
            -- 16 byte fixed point

    vt_dispatch: INTEGER
            -- IDispatch*

    vt_empty: INTEGER
            -- Not specified

    vt_error: INTEGER
            -- SCODE

    vt_hresult: INTEGER
            -- HRESULT
            -- may appear in TYPEDESC only

    vt_i1: INTEGER
            -- Character

    vt_i2: INTEGER
            -- 2-byte signed integer

    vt_i4: INTEGER
            -- 4-byte signed integer

    vt_i8: INTEGER
            -- 8-byte signed integer
            -- may appear in TYPEDESC only

    vt_int: INTEGER
            -- integer
            -- may appear in TYPEDESC only

    vt_lpstr: INTEGER
            -- LPSTR
            -- may appear in TYPEDESC only

    vt_lpwstr: INTEGER
            -- LPWSTR
            -- may appear in TYPEDESC only

    vt_null: INTEGER
            -- SQL style Null

    vt_ptr: INTEGER
            -- pointer
            -- may appear in TYPEDESC only

    vt_r4: INTEGER
            -- 4-byte real

    vt_r8: INTEGER
            -- 8-byte real

    vt_record: INTEGER
            -- Record
            -- may appear in TYPEDESC only

    vt_reserved: INTEGER
            -- Reserverd for Microsoft use

    vt_safearray: INTEGER
            -- Safearray
            -- may appear in TYPEDESC only

    vt_typemask: INTEGER
            -- Typemask.

    vt_ui1: INTEGER
            -- Unsigned character

    vt_ui2: INTEGER
            -- 2-bytes unsigned integer
            -- may appear in TYPEDESC only

    vt_ui4: INTEGER
            -- 4-bytes unsigned integer
            -- may appear in TYPEDESC only

    vt_ui8: INTEGER
            -- 8-bytes unsigned integer
            -- may appear in TYPEDESC only

    vt_uint: INTEGER
            -- unsigned integer
            -- may appear in TYPEDESC only

    vt_unknown: INTEGER
            -- IUnknown*

    vt_userdefined: INTEGER
            -- User defined
            -- may appear in TYPEDESC only

    vt_variant: INTEGER
            -- VARIANT*

    vt_void: INTEGER
            -- NULL
            -- may appear in TYPEDESC only

feature -- Status report

    is_array (variable_type: INTEGER): BOOLEAN
            -- Is variable array?

    is_basic (a_type: INTEGER): BOOLEAN
            -- Is a_type basic type?

    is_boolean (variable_type: INTEGER): BOOLEAN
            -- Is variable boolen?

    is_bstr (variable_type: INTEGER): BOOLEAN
            -- Is variable BSTR?

    is_byref (variable_type: INTEGER): BOOLEAN
            -- Is variable passed by reference?

    is_carray (variable_type: INTEGER): BOOLEAN
            -- Is variable C ARRAY?

    is_character (variable_type: INTEGER): BOOLEAN
            -- Is variable character?

    is_currency (variable_type: INTEGER): BOOLEAN
            -- Is variable currency?

    is_date (variable_type: INTEGER): BOOLEAN
            -- Is variable date?

    is_decimal (variable_type: INTEGER): BOOLEAN
            -- Is decimal variable?

    is_dispatch (variable_type: INTEGER): BOOLEAN
            -- Is dispatch interface?

    is_error (variable_type: INTEGER): BOOLEAN
            -- Is variable error?

    is_hresult (variable_type: INTEGER): BOOLEAN
            -- Is variable int?

    is_int (variable_type: INTEGER): BOOLEAN
            -- Is variable int?

    is_integer2 (variable_type: INTEGER): BOOLEAN
            -- Is variable short integer?

    is_integer4 (variable_type: INTEGER): BOOLEAN
            -- Is variable long integer?

    is_long_long (variable_type: INTEGER): BOOLEAN
            -- Is variable long long?

    is_lpstr (variable_type: INTEGER): BOOLEAN
            -- Is variable LPSTR?

    is_lpwstr (variable_type: INTEGER): BOOLEAN
            -- Is variable LPWSTR?

    is_ptr (variable_type: INTEGER): BOOLEAN
            -- Is variable ptr?

    is_real4 (variable_type: INTEGER): BOOLEAN
            -- Is variable real?

    is_real8 (variable_type: INTEGER): BOOLEAN
            -- Is variable double?

    is_safearray (variable_type: INTEGER): BOOLEAN
            -- Is variable SAFEARRAY?

    is_unknown (variable_type: INTEGER): BOOLEAN
            -- Is IUnknown interface?

    is_unsigned_char (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned char?

    is_unsigned_int (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned int?

    is_unsigned_long (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned long?

    is_unsigned_long_long (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned long long?

    is_unsigned_short (variable_type: INTEGER): BOOLEAN
            -- Is Ivariable unsigned short?

    is_user_defined (variable_type: INTEGER): BOOLEAN
            -- Is variable user defined?

    is_variant (variable_type: INTEGER): BOOLEAN
            -- Is variable variant?

    is_void (variable_type: INTEGER): BOOLEAN
            -- Is variable void?

    valid_var_type (a_var_type: INTEGER): BOOLEAN
            -- Is a_var_type a valid variant type?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_VAR_TYPE


cluster com.Interfaces

Cluster
    com.Interfaces

Supercluster
    com

Classes
    ECOM_AUTOMATION_INTERFACE
    ECOM_ENUM_STATSTG
    ECOM_INTERFACE
    ECOM_QUERIABLE
    ECOM_ROOT_STORAGE
    ECOM_STORAGE
    ECOM_STORAGE_ROUTINES
    ECOM_STREAM
    ECOM_STUB
    ECOM_UNKNOWN_INTERFACE
    FONT_EVENTS_INTERFACE
    FONT_IMPL_PROXY
    FONT_INTERFACE
    IENUM_IMPL [G]
    IENUM_VARIANT_IMPL_PROXY
    IENUM_VARIANT_INTERFACE
    IFONT_IMPL_PROXY
    IFONT_INTERFACE
    IPICTURE_INTERFACE
    PICTURE_IMPL_PROXY
    PICTURE_INTERFACE


ECOM_AUTOMATION_INTERFACE Chart

class
    ECOM_AUTOMATION_INTERFACE

General
    cluster: com.Interfaces
    description: "Automation interface."
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_QUERIABLE

Queries
    exists: BOOLEAN
    item: POINTER

Commands
    make_from_pointer (other_pointer: POINTER)


ECOM_AUTOMATION_INTERFACE Flat contracts

indexing
    description: "Automation interface."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_AUTOMATION_INTERFACE

create

    make_from_pointer (other_pointer: POINTER)
            -- Create interface from other interface pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Initialization

    make_from_pointer (other_pointer: POINTER)
            -- Create interface from other interface pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class ECOM_AUTOMATION_INTERFACE


ECOM_ENUM_STATSTG Chart

class
    ECOM_ENUM_STATSTG

General
    cluster: com.Interfaces
    description: "Wrapper of IEnumSTATSTG interface, used to enumerate through an array of STATSTG structures, which contains statistical information about an open storage, stream, or byte array object."
    create: make_from_pointer

Ancestors
    ECOM_WRAPPER

Queries
    access_time (a_name: STRING): WEL_FILE_TIME
    clone_enum: [like Current] ECOM_ENUM_STATSTG
    creation_time (a_name: STRING): WEL_FILE_TIME
    exists: BOOLEAN
    is_valid_name (name: STRING): BOOLEAN
    item: POINTER
    modification_time (a_name: STRING): WEL_FILE_TIME
    next_item: ECOM_STATSTG

Commands
    make_from_pointer (a_pointer: POINTER)
    reset
    skip (n: INTEGER)


ECOM_ENUM_STATSTG Flat contracts

indexing
    description: "Wrapper of IEnumSTATSTG interface, used to enumerate through an array of STATSTG structures, which contains statistical information about an open storage, stream, or byte array object."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_ENUM_STATSTG

create

    make_from_pointer (a_pointer: POINTER)
            -- Initialize
            -- (from ECOM_WRAPPER)
        require -- from ECOM_WRAPPER
            valid_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_WRAPPER
            wrapper_exist: initializer /= default_pointer and then exists
            valid_item: item = a_pointer

feature -- Initialization

    make_from_pointer (a_pointer: POINTER)
            -- Initialize
            -- (from ECOM_WRAPPER)
        require -- from ECOM_WRAPPER
            valid_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_WRAPPER
            wrapper_exist: initializer /= default_pointer and then exists
            valid_item: item = a_pointer

feature -- Access

    access_time (a_name: STRING): WEL_FILE_TIME
            -- Access time of element a_name
            -- Change position in enumeration.
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
        ensure
            non_void_result: Result /= void

    creation_time (a_name: STRING): WEL_FILE_TIME
            -- Creation time of element a_name
            -- Change position in enumeration.
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
        ensure
            non_void_result: Result /= void

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_WRAPPER)

    is_valid_name (name: STRING): BOOLEAN
            -- Is object with name name part of storage object?
            -- Change position in enumeration.
        require
            non_void_name: name /= void
            valid_name: not name.is_empty

    item: POINTER
            -- Pointer to COM structure
            -- (from ECOM_WRAPPER)

    modification_time (a_name: STRING): WEL_FILE_TIME
            -- Modification time of element a_name
            -- Change position in enumeration.
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
        ensure
            non_void_result: Result /= void

    next_item: ECOM_STATSTG
            -- Next item in enumeration sequence
            -- Void if there is no next_item item

feature -- Basic Operations

    clone_enum: like Current
            -- Creates another enumerator that has
            -- same enumeration state as Current.
        ensure
            Result /= void

    reset
            -- Resets enumeration sequence to beginning.

    skip (n: INTEGER)
            -- Skips over n items in enumeration sequence.
        require
            valid_skip_count: n >= 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_WRAPPER
    wrapper_invariant: initializer /= default_pointer and then exists

end -- class ECOM_ENUM_STATSTG


ECOM_INTERFACE Chart

deferred class
    ECOM_INTERFACE

General
    cluster: com.Interfaces
    description: "COM interface."

Ancestors
    ANY

Queries
    item: POINTER


ECOM_INTERFACE Flat contracts

indexing
    description: "COM interface."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ECOM_INTERFACE

feature -- Access

    item: POINTER
            -- Pointer to COM interface.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_INTERFACE


ECOM_QUERIABLE Chart

deferred class
    ECOM_QUERIABLE

General
    cluster: com.Interfaces
    description: "COM Queriable"

Ancestors
    ECOM_INTERFACE
    MEMORY

Queries
    exists: BOOLEAN
    item: POINTER

Constraints
    queriable invariant


ECOM_QUERIABLE Flat contracts

indexing
    description: "COM Queriable"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ECOM_QUERIABLE

feature -- Access

    exists: BOOLEAN
            -- Is wrapped structure initialized?

    item: POINTER
            -- Pointer to COM object wrapper.

invariant

    queriable_invariant: initializer /= default_pointer and then exists
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_QUERIABLE


ECOM_ROOT_STORAGE Chart

class
    ECOM_ROOT_STORAGE

General
    cluster: com.Interfaces
    description: "Implementation of IRootStorage interface"
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_QUERIABLE

Queries
    exists: BOOLEAN
    item: POINTER

Commands
    swith_to_file (a_name: STRING)


ECOM_ROOT_STORAGE Flat contracts

indexing
    description: "Implementation of IRootStorage interface"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_ROOT_STORAGE

create

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_pointer (cpp_obj: POINTER)
            -- Make from pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

feature -- Basic Operations

    swith_to_file (a_name: STRING)
            -- Copy current file associated with storage object
            -- to new file a_name. New file is then used for storage
            -- object and any uncommitted changes.
        require
            non_void_name: a_name /= void
            valid_name: not a_name.is_empty

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class ECOM_ROOT_STORAGE


ECOM_STORAGE Chart

class
    ECOM_STORAGE

General
    cluster: com.Interfaces
    description: "implementation of IStorage interface"
    create: make_temporary_doc_file, make_open_file, make_from_pointer, make_new_doc_file, make_from_other

Ancestors
    ECOM_QUERIABLE
    ECOM_STAT_FLAGS
    ECOM_STGC
    ECOM_STGM
    ECOM_STGMOVE
    ECOM_STORAGE_ROUTINES

Queries
    access_time: WEL_FILE_TIME
    class_id: POINTER
    creation_time: WEL_FILE_TIME
    element_access_time (a_name: STRING): WEL_FILE_TIME
    element_creation_time (a_name: STRING): WEL_FILE_TIME
    element_modification_time (a_name: STRING): WEL_FILE_TIME
    elements: ECOM_ENUM_STATSTG
    exists: BOOLEAN
    Guid_routines: ECOM_GUID_ROUTINES
    is_compound_file (a_name: STRING): BOOLEAN
    is_same_name (a_name: STRING): BOOLEAN
    is_valid_name (a_name: STRING): BOOLEAN
    is_valid_stat_flag (flag: INTEGER): BOOLEAN
    is_valid_stgc (stgc: INTEGER): BOOLEAN
    is_valid_stgm (stgm: INTEGER): BOOLEAN
    is_valid_stgmove (stgmove: INTEGER): BOOLEAN
    item: POINTER
    mode: INTEGER
    modification_time: WEL_FILE_TIME
    name: STRING
    new_stream (a_name: STRING; a_mode: INTEGER): ECOM_STREAM
    new_substorage (a_name: STRING; a_mode: INTEGER): ECOM_STORAGE
    retrieved_stream (a_name: STRING; a_mode: INTEGER): ECOM_STREAM
    retrieved_substorage (a_name: STRING; a_mode: INTEGER): ECOM_STORAGE
    root_storage: ECOM_ROOT_STORAGE
    statflag_default: INTEGER
    statflag_noname: INTEGER
    stgc_dangerouslycommitmerelytodiskcache: INTEGER
    stgc_default: INTEGER
    stgc_onlyifcurrent: INTEGER
    stgc_overwrite: INTEGER
    stgm_convert: INTEGER
    stgm_create: INTEGER
    stgm_deleteonrelease: INTEGER
    stgm_direct: INTEGER
    stgm_failifthere: INTEGER
    stgm_priority: INTEGER
    stgm_read: INTEGER
    stgm_readwrite: INTEGER
    stgm_share_deny_none: INTEGER
    stgm_share_deny_read: INTEGER
    stgm_share_deny_write: INTEGER
    stgm_share_exclusive: INTEGER
    stgm_transacted: INTEGER
    stgm_write: INTEGER
    stgmove_copy: INTEGER
    stgmove_move: INTEGER

Commands
    commit (a_flags: INTEGER)
    copy_all_to (dest_storage: ECOM_STORAGE)
    destroy_element (a_name: STRING)
    move_element_to (a_element_name: STRING; dest_storage: ECOM_STORAGE; new_name: STRING; a_mode: INTEGER)
    rename_element (old_name, new_name: STRING)
    revert
    set_access_time (an_access_time: WEL_FILE_TIME)
    set_class (a_class_id: POINTER)
    set_creation_time (a_creation_time: WEL_FILE_TIME)
    set_element_access_time (a_element_name: STRING; an_access_time: WEL_FILE_TIME)
    set_element_creation_time (a_element_name: STRING; a_creation_time: WEL_FILE_TIME)
    set_element_modification_time (a_element_name: STRING; a_modification_time: WEL_FILE_TIME)
    set_modification_time (a_modification_time: WEL_FILE_TIME)


ECOM_STORAGE Flat contracts

indexing
    description: "implementation of IStorage interface"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STORAGE

create

    make_new_doc_file (filename: FILE_NAME; a_mode: INTEGER)
            -- Create new compound file with path filename
            -- and mode a_mode in file system.
            -- See class ECOM_STGM for mode values.
        require
            valid_filename: filename /= void
            valid_mode: is_valid_stgm (a_mode)
        ensure
            compound_file_created: exists

    make_temporary_doc_file (a_mode: INTEGER)
            -- Create temporary compound file with mode mode
            -- See class ECOM_STGM for a_mode values.
        require
            valid_mode: is_valid_stgm (a_mode)
        ensure
            compound_file_created: exists

    make_open_file (filename: FILE_NAME; a_mode: INTEGER)
            -- Open existing root compound file with path filename
            -- and mode mode in file system.
            -- excluding block pointed by exclude (can be default_pointer)
            -- See class ECOM_STGM for a_mode values.
        require
            valid_file: filename /= void and then is_compound_file (filename)
            valid_mode: is_valid_stgm (a_mode)
        ensure
            compound_file_open: exists

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_pointer (cpp_obj: POINTER)
            -- Make from pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    access_time: WEL_FILE_TIME
            -- Access time

    class_id: POINTER
            -- Class identifier

    creation_time: WEL_FILE_TIME
            -- Creation time

    element_access_time (a_name: STRING): WEL_FILE_TIME
            -- Access time of element a_name
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
        ensure
            non_void_access_time: Result /= void

    element_creation_time (a_name: STRING): WEL_FILE_TIME
            -- Creation time of element a_name
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
        ensure
            non_void_creation_time: Result /= void

    element_modification_time (a_name: STRING): WEL_FILE_TIME
            -- Modification time of element a_name
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
        ensure
            non_void_modification_time: Result /= void

    elements: ECOM_ENUM_STATSTG
            -- Substorages and substreams enumerator
        ensure
            Result /= void

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    is_same_name (a_name: STRING): BOOLEAN
            -- is a_name equal to name of Current storage

    is_valid_name (a_name: STRING): BOOLEAN
            -- is object with name a_name
            -- part of Current storage
        require
            valid_name: a_name /= void

    is_valid_stat_flag (flag: INTEGER): BOOLEAN
            -- Is flag a valid stat flag?
            -- (from ECOM_STAT_FLAGS)

    is_valid_stgc (stgc: INTEGER): BOOLEAN
            -- Is stgc a valid storage commit mode flag?
            -- (from ECOM_STGC)

    is_valid_stgm (stgm: INTEGER): BOOLEAN
            -- Is stgm a valid storage mode flag?
            -- (from ECOM_STGM)

    is_valid_stgmove (stgmove: INTEGER): BOOLEAN
            -- Is stgmove a valid storage move flag?
            -- (from ECOM_STGMOVE)

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

    mode: INTEGER
            -- Access mode

    modification_time: WEL_FILE_TIME
            -- Modufication time

    name: STRING
            -- Name

    new_stream (a_name: STRING; a_mode: INTEGER): ECOM_STREAM
            -- Newly created stream with name a_name
            -- and mode a_mode nested within Current storage
            -- Opening the same stream more than once from the
            -- same storage is not supported.
            -- STGM_SHARE_EXCLUSIVE flag must be specified.
        require
            non_void_storage_name: a_name /= void
            valid_storage_name: not a_name.is_empty
            valid_mode: is_valid_stgm (a_mode)
        ensure
            non_void_stream: Result /= void
            valid_stream: Result.exists

    new_substorage (a_name: STRING; a_mode: INTEGER): ECOM_STORAGE
            -- Newly created storage with name a_name
            -- and mode a_mode
            -- nested within Current storage
        require
            non_void_storage_name: a_name /= void
            valid_storage_name: not a_name.is_empty
            valid_mode: is_valid_stgm (a_mode)
        ensure
            non_void_storage: Result /= void
            valid_storage: Result.exists

    retrieved_stream (a_name: STRING; a_mode: INTEGER): ECOM_STREAM
            -- Retrieved nested stream with name a_name
            -- and mode a_mode
            -- same storage is not supported.
            -- STGM_SHARE_EXCLUSIVE flag must be specified.
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
            valid_mode: is_valid_stgm (a_mode)
        ensure
            non_void_stream: Result /= void
            valid_stream: Result.exists

    retrieved_substorage (a_name: STRING; a_mode: INTEGER): ECOM_STORAGE
            -- Retrieved storage with name a_name and mode a_mode
            -- nested within Current storage
            -- Opening the same storage object more than once from the same
            -- parent storage is not supported.
            -- STGM_SHARE_EXCLUSIVE flag must be specified.
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
            valid_mode: is_valid_stgm (a_mode)
        ensure
            non_void_storage: Result /= void
            valid_storage: Result.exists

    root_storage: ECOM_ROOT_STORAGE
            -- IRootStorage interface

    statflag_default: INTEGER
            -- Indicate that this is not used for property
            -- (from ECOM_STAT_FLAGS)

    statflag_noname: INTEGER
            -- Indicate that this is not used for property
            -- (from ECOM_STAT_FLAGS)

    stgc_dangerouslycommitmerelytodiskcache: INTEGER
            -- EOLE_STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE commits the changes,
            -- but does not save them to the disk cache.
            -- (from ECOM_STGC)

    stgc_default: INTEGER
            -- OLE 2 default commit mode
            -- (from ECOM_STGC)

    stgc_onlyifcurrent: INTEGER
            -- EOLE_STGC_ONLYIFCURRENT prevents multiple users of an IStorage
            -- from overwriting the other's changes. EOLE_STGC_ONLYIFCURRENT
            -- commits changes only if no one else has made changes since the
            -- last time this user opened the IStorage or committed. If other
            -- changes have been made, EOLE_STG_E_NOTCURRENT is returned.
            -- If the caller chooses to overwrite the changes, IStorage.Commit
            -- can be called with commit mode set to EOLE_STGC_DEFAULT.
            -- (from ECOM_STGC)

    stgc_overwrite: INTEGER
            -- EOLE_STGC_OVERWRITE allows new data to overwrite the old data,
            -- reducing space requirements. EOLE_STGC_OVERWRITE is not recommended
            -- for usual operation, but it could be useful in the following
            -- situations:
            --    1. A commit was tried and EOLE_STG_E_MEDIUMFULL was returned.
            --    2. The user has somehow specified a willingness to risk
            --       overwriting the old data.
            --    3. A low-memory save sequence is being used to end up with a
            --       smaller file.
            -- The commit operation obtains all the disk space it needs before
            -- attempting to store the new data, whether or not EOLE_STGC_OVERWRITE
            -- is specified. If space requirements prohibit the save, the old
            -- data will be intact, including all uncommitted changes. However,
            -- if the commit fails due to reasons other than lack of disk space
            -- and EOLE_STGC_OVERWRITE was specified, it is possible that neither
            -- the old nor the new version of the data will be intact.
            -- (from ECOM_STGC)

    stgm_convert: INTEGER
            -- This flag is applicable only to the creation of IStorage objects.
            -- Stgm_convert allows the creation to proceed while preserving
            -- existing data. The old data is saved to a stream named CONTENTS
            -- containing the same data that was in the old IStorage or IStream
            -- instance. In the IStorage case, the data is flattened to a
            -- stream regardless of whether the existing file currently contains
            -- a layered storage object.
            -- (from ECOM_STGM)

    stgm_create: INTEGER
            -- Stgm_create indicates an existing IStorage or IStream object
            -- should be removed before the new one replaces it. A new object
            -- is created when this flag is specified only if the existing
            -- IStorage or IStream has been successfully removed.
            -- (from ECOM_STGM)

    stgm_deleteonrelease: INTEGER
            -- The Stgm_deleteonrelease flag indicates that the underlying
            -- file is to be automatically destroyed when the root IStorage
            -- object is released. This capability is most useful for
            -- creating temporary files.
            -- (from ECOM_STGM)

    stgm_direct: INTEGER
            -- Stgm_DIrect is always specified for IStream objects.
            -- Stgm_transacted is not supported in the compound file
            -- implementation of IStream. Other implementations can choose
            -- to support it.
            -- (from ECOM_STGM)

    stgm_failifthere: INTEGER
            -- Stgm_failifthere causes the create operation to fail if an
            -- existing object with the specified name exists. In this case,
            -- Stg_e_filealreadyexists is returned. Stgm_failifthere
            -- applies to both IStorage and IStream objects.
            -- (from ECOM_STGM)

    stgm_priority: INTEGER
            -- The Stgm_priority flag allows an IStorage object to be opened
            -- so that a subsequent copy operation can be done at reduced cost.
            -- Stgm_priority allows an application to read certain streams
            -- from storage before opening the storage object in a mode that would
            -- require a snapshot copy to be made. Priority mode has exclusive
            -- access to the committed version of the IStorage object.
            -- While a compound file is open in priority mode, no other opening
            -- of the compound file can commit changes even one that was opened
            -- before the priority mode opening. Therefore, applications should
            -- keep IStorage objects open in priority mode for as short a time
            -- as possible.
            -- (from ECOM_STGM)

    stgm_read: INTEGER
            -- When applied to an IStream object, Stgm_READ enables
            -- applications to successfully call IStream.Read. If Stgm_read
            -- is omitted, IStream.Read will return an error. When applied to an
            -- IStorage, Stgm_READ allows the enumeration of the storage
            -- object's elements and enables applications to open these elements
            -- in read mode. Parents of storage objects to be opened in read mode
            -- must also have been opened in read mode otherwise, an error is
            -- returned.
            -- (from ECOM_STGM)

    stgm_readwrite: INTEGER
            -- Stgm_readwrite is the logical combination of the
            -- Stgm_read and Stgm_write. However, the defined value
            -- of Stgm_readwrite is not equal to
            -- (Stgm_read or Stgm_write).
            -- (from ECOM_STGM)

    stgm_share_deny_none: INTEGER
            -- 0x00000040L
            -- Stgm_SHARE_DENY_NONE indicates that neither read access nor
            -- write access should be denied to subsequent openings. This is the
            -- default sharing mode and if no Stgm_SHARE_* flag is explicitly
            -- given, Stgm_SHARE_DENY_NONE is implied.
            -- (from ECOM_STGM)

    stgm_share_deny_read: INTEGER
            -- 0x00000030L
            -- When successfully applied to a root IStorage, the
            -- Stgm_SHARE_DENY_READ flag prevents others from opening the
            -- object in read mode. The open call fails and returns an error if
            -- the object is presently open in deny-read mode.
            -- Stgm_SHARE_DENY_READ is most useful when opening root storage
            -- objects. Deny modes on inner elements are still useful if some
            -- component is coordinating the opening of these inner elements, as
            -- might happen in a Copy/Paste operation. However, inner elements
            -- always require Stgm_SHARE_EXCLUSIVE. Opening a parent storage
            -- object with Stgm_SHARE_DENY_READ applies only to that opening,
            -- not the network-wide set of openings of the parent.
            -- (from ECOM_STGM)

    stgm_share_deny_write: INTEGER
            -- When successfully applied the Stgm_share_deny_write flag
            -- prevents subsequent openings of either a storage or a stream from
            -- specifying write mode. The open call fails and returns an error
            -- if the storage or stream is presently open in write mode.
            -- For information about the interaction of this flag with nested
            -- openings, see the earlier discussion about Stgm_share_deny_read.
            -- (from ECOM_STGM)

    stgm_share_exclusive: INTEGER
            -- The compound files implementation requires that all inner elements
            -- be opened Stgm_share_exclusive. It is the logical combination
            -- of the Stgm_share_deny_read and Stgm_share_deny_write.
            -- All root storage objects, as well as child storage and stream
            -- objects must be opened with Stgm_share_exclusive.
            -- (from ECOM_STGM)

    stgm_transacted: INTEGER
            -- The transaction for each open object is nested in the transaction
            -- for its parent storage object. Therefore, committing changes at the
            -- child level is dependent on committing changes in the parent and
            -- a commit of the root storage object (top-level parent) is necessary
            -- before changes to an object are actually written to disk.
            -- The changes percolate upward: inner objects publish changes to the
            -- transaction of the next object outwards. Outermost objects publish
            -- changes permanently into the file system. Transacted mode is not
            -- required on the parent storage object in order to use transacted
            -- mode on a contained object.The scope of changes that are buffered
            -- in transacted mode is very broad. A storage or stream object can
            -- be opened, have arbitrary changes made to it, and then have the
            -- changes reverted, preserving the object as it was when it was
            -- first opened. The creation and destruction of elements within a
            -- storage object are scoped by its transaction.
            -- (from ECOM_STGM)

    stgm_write: INTEGER
            -- Stgm_write lets an object commit changes to the storage.
            -- Specifically, unless this flag has been given, IStorage.Commit
            -- and IStream.Commit will fail. An open object whose changes cannot
            -- be committed can save its changes by copying the storage or stream
            -- with IStorage.CopyTo or IStream.CopyTo. In direct mode,
            -- changes are committed after every change operation. Thus, write
            -- permissions are needed to call any function that causes a change.
            -- On streams, this includes IStream.Write and IStream.SetSize.
            -- If a parent storage is opened in direct mode without write
            -- permission, any attempt to open a child stream within it in direct
            -- mode with write permission will fail, because it causes an implicit
            -- commit to be made on the storage. Similarly, trying to create or
            -- destroy a contained element in this storage object also causes an
            -- implicit commit, resulting in an error.
            -- (from ECOM_STGM)

    stgmove_copy: INTEGER
            -- Carry out the first part of the move operation but do
            -- not remove the original element.
            -- (from ECOM_STGMOVE)

    stgmove_move: INTEGER
            -- Carry out the move operation, as expected.
            -- (from ECOM_STGMOVE)

feature -- Access
--	com_api: ECOM_COM is
--		once
--			create Result
--		end

    guid_routines: ECOM_GUID_ROUTINES
            -- (from ECOM_ROUTINES)

feature -- Basic Operations

    commit (a_flags: INTEGER)
            -- Commit any changes.
            -- Notify parent storage.
        require
            valid_flags: is_valid_stgc (a_flags)

    copy_all_to (dest_storage: ECOM_STORAGE)
            -- Copy entire contents to dest_storage.
        require
            non_void_destination: dest_storage /= void
            valid_destination: dest_storage.exists

    destroy_element (a_name: STRING)
            -- Remove element with name a_name from storage.
        require
            non_void_name: a_name /= void
            valid_name: is_valid_name (a_name)
        ensure
            element_removed: not is_valid_name (a_name)

    is_compound_file (a_name: STRING): BOOLEAN
            -- Does file a_name contain a storage object?
            -- (from ECOM_STORAGE_ROUTINES)

    rename_element (old_name: STRING; new_name: STRING)
            -- Rename element old_name into new_name
        require
            non_void_old_name: old_name /= void
            valid_old_name: is_valid_name (old_name)
            non_void_new_name: new_name /= void
            valid_new_name: is_valid_name (new_name)
        ensure
            not_valid_old_name: not is_valid_name (old_name)
            valid_new_name: is_valid_name (new_name)

    revert
            -- Discard all changes made to storage object
            -- since the last commit

feature -- Element Change

    move_element_to (a_element_name: STRING; dest_storage: ECOM_STORAGE; new_name: STRING; a_mode: INTEGER)
            -- Copy or move (depending on mode) element a_element_name
            -- of root storage to dest_storage.
            -- Create new element in dest_storage with new_name.
            -- See class ECOM_STGM for a_mode values.
            -- Before calling this method, the element to be moved must
            -- be closed, and the destination storage must be open.
        require
            non_void_element_name: a_element_name /= void
            valid_element_name: is_valid_name (a_element_name)
            non_void_dest_storage: dest_storage /= void
            valid_dest_storage: dest_storage.exists
            non_void_new_name: new_name /= void
            valid_new_name: not new_name.is_empty
            valid_mode: is_valid_stgmove (a_mode)
        ensure
            element_moved: dest_storage.is_valid_name (new_name)

    set_access_time (an_access_time: WEL_FILE_TIME)
            -- Set access time with an_access_time.
        require
            non_void_access_time: an_access_time /= void
        ensure
            access_time_set: access_time.is_equal (an_access_time)

    set_class (a_class_id: POINTER)
            -- Associate storage with COM component with class id a_class-id
        require
            valid_clsid: a_class_id /= default_pointer

    set_creation_time (a_creation_time: WEL_FILE_TIME)
            -- Set creation time with creation_time.
        require
            non_void_creation_time: a_creation_time /= void
        ensure
            creation_time_set: creation_time.is_equal (a_creation_time)

    set_element_access_time (a_element_name: STRING; an_access_time: WEL_FILE_TIME)
            -- Set access time of element a_element_name with an_access_time.
        require
            non_void_element_name: a_element_name /= void
            valid_element_name: is_valid_name (a_element_name)
            valid_access_time: an_access_time /= void
        ensure
            element_access_time_set: element_access_time (a_element_name).is_equal (an_access_time)

    set_element_creation_time (a_element_name: STRING; a_creation_time: WEL_FILE_TIME)
            -- Set creation time of element a_element_name with a_creation_time.
        require
            non_void_element_name: a_element_name /= void
            valid_element_name: is_valid_name (a_element_name)
            valid_creation_time: a_creation_time /= void
        ensure
            element_creation_time_set: element_creation_time (a_element_name).is_equal (a_creation_time)

    set_element_modification_time (a_element_name: STRING; a_modification_time: WEL_FILE_TIME)
            -- Set modification time of element a_element_name with a_modification_time.
        require
            non_void_element_name: a_element_name /= void
            valid_element_name: is_valid_name (a_element_name)
            valid_modification_time: a_modification_time /= void
        ensure
            element_access_time_set: element_modification_time (a_element_name).is_equal (a_modification_time)

    set_modification_time (a_modification_time: WEL_FILE_TIME)
            -- Set modification time with a_modification_time.
        require
            non_void_modification_time: a_modification_time /= void
        ensure
            modification_time_set: modification_time.is_equal (a_modification_time)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class ECOM_STORAGE


ECOM_STORAGE_ROUTINES Chart

class
    ECOM_STORAGE_ROUTINES

General
    cluster: com.Interfaces
    description: "Storage Routines."

Ancestors
    ECOM_ROUTINES

Queries
    Guid_routines: ECOM_GUID_ROUTINES
    is_compound_file (a_name: STRING): BOOLEAN


ECOM_STORAGE_ROUTINES Flat contracts

indexing
    description: "Storage Routines."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STORAGE_ROUTINES

feature -- Access
--	com_api: ECOM_COM is
--		once
--			create Result
--		end

    guid_routines: ECOM_GUID_ROUTINES
            -- (from ECOM_ROUTINES)

feature -- Basic Operations

    is_compound_file (a_name: STRING): BOOLEAN
            -- Does file a_name contain a storage object?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STORAGE_ROUTINES


ECOM_STREAM Chart

class
    ECOM_STREAM

General
    cluster: com.Interfaces
    description: "Encapsulation of standard implementation of IStream interface."
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_EXCEPTION
    ECOM_LOCK_TYPES
    ECOM_QUERIABLE
    ECOM_STAT_FLAGS
    ECOM_STAT_FLAGS
    ECOM_STREAM_SEEK

Queries
    access_time: WEL_FILE_TIME
    assertion_violation: BOOLEAN
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    clone_stream: ECOM_STREAM
    Com_exception: INTEGER
    creation_time: WEL_FILE_TIME
    description (stat_flag: INTEGER): ECOM_STATSTG
    Developer_exception: INTEGER
    developer_exception_name: STRING
    end_of_stream: BOOLEAN
    exception: INTEGER
    exception_trace: STRING
    exists: BOOLEAN
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    hresult: INTEGER
    hresult_code: INTEGER
    hresult_facility: INTEGER
    hresult_message: STRING
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    is_valid_lock (lock: INTEGER): BOOLEAN
    is_valid_seek (seek: INTEGER): BOOLEAN
    is_valid_stat_flag (flag: INTEGER): BOOLEAN
    item: POINTER
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lock_exclusive: INTEGER
    lock_onlyonce: INTEGER
    lock_write: INTEGER
    locks_supported: INTEGER
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    modification_time: WEL_FILE_TIME
    name: STRING
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    Postcondition: INTEGER
    Precondition: INTEGER
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    size: ECOM_ULARGE_INTEGER
    statflag_default: INTEGER
    statflag_noname: INTEGER
    stream_seek_cur: INTEGER
    stream_seek_end: INTEGER
    stream_seek_set: INTEGER
    tag_name: STRING
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Commands
    catch (code: INTEGER)
    copy_to (destination: ECOM_STREAM; bytes: ECOM_ULARGE_INTEGER)
    die (code: INTEGER)
    finish
    ignore (code: INTEGER)
    lock_region (offset, count: ECOM_ULARGE_INTEGER; lock: INTEGER)
    message_on_failure
    no_message_on_failure
    raise (name: STRING)
    read (buffer: POINTER; bytes: INTEGER)
    read_boolean
    read_character
    read_integer
    read_real
    read_string
    seek (displacement: ECOM_LARGE_INTEGER; origin: INTEGER)
    set_size (new_size: ECOM_ULARGE_INTEGER)
    start
    trigger (code: INTEGER)
    unlock_region (offset, count: ECOM_ULARGE_INTEGER; lock: INTEGER)
    update_end_of_stream
    write (buffer: POINTER; bytes: INTEGER)
    write_boolean (boolean: BOOLEAN)
    write_character (character: CHARACTER)
    write_integer (integer: INTEGER)
    write_real (real: REAL)
    write_string (string: STRING)


ECOM_STREAM Flat contracts

indexing
    description: "Encapsulation of standard implementation of IStream interface."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STREAM

create

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_pointer (cpp_obj: POINTER)
            -- Make from pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature --  Access

    hresult: INTEGER
            -- Original HRESULT.
            -- (from ECOM_EXCEPTION)
        require -- from ECOM_EXCEPTION
            applicable: is_developer_exception

    hresult_code: INTEGER
            -- Status code.
            -- (from ECOM_EXCEPTION)
        require -- from ECOM_EXCEPTION
            applicable: is_developer_exception

    hresult_facility: INTEGER
            -- Facility code.
            -- (from ECOM_EXCEPTION)
        require -- from ECOM_EXCEPTION
            applicable: is_developer_exception

    hresult_message: STRING
            -- Error message.
            -- (from ECOM_EXCEPTION)
        require -- from ECOM_EXCEPTION
            applicable: is_developer_exception
        ensure -- from ECOM_EXCEPTION
            non_void_message: Result /= void

feature -- Access

    access_time: WEL_FILE_TIME
            -- Access time

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    creation_time: WEL_FILE_TIME
            -- Creation time

    description (stat_flag: INTEGER): ECOM_STATSTG
            -- STATSTG structure
            -- See class ECOM_STAT_FLAGS for stat_flag values.
        require
            valid_stat_flag: is_valid_stat_flag (stat_flag)
        ensure
            Result /= void

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    end_of_stream: BOOLEAN
            -- Is current seek pointer at end of stream?
            -- Valid only after read ,update_end_of_stream, start, or finish.

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    is_valid_lock (lock: INTEGER): BOOLEAN
            -- Is lock a valid locktype?
            -- (from ECOM_LOCK_TYPES)

    is_valid_seek (seek: INTEGER): BOOLEAN
            -- Is seek a valid IStorage and IStream seek flag?
            -- (from ECOM_STREAM_SEEK)

    is_valid_stat_flag (flag: INTEGER): BOOLEAN
            -- Is flag a valid stat flag?
            -- (from ECOM_STAT_FLAGS)

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

    last_boolean: BOOLEAN
            -- last read BOOLEAN

    last_character: CHARACTER
            -- last read CHARACTER

    last_integer: INTEGER
            -- last read INTEGER

    last_real: REAL
            -- last read REAL

    last_string: STRING
            -- last read STRING

    lock_exclusive: INTEGER
            -- Attempts to read or write this stream by other stream openings
            -- return error EOLE_STG_E_ACCESSDENIED.
            -- (from ECOM_LOCK_TYPES)

    lock_onlyonce: INTEGER
            -- If lock is granted, no other EOLE_LOCK_ONLYONCE lock can be
            -- obtained on bytes in given region. Usually this lock type
            -- is an alias for some other lock type and other semantics might occur
            -- as a side effect.
            -- (from ECOM_LOCK_TYPES)

    lock_write: INTEGER
            -- If lock is granted, specified region of stream
            -- can be read by calling IStream.Read from any opening of
            -- this stream. Attempts to write to this region from any opening
            -- of this stream other than the one to which lock was granted
            -- returns error EOLE_STG_E_ACCESSDENIED.
            -- (from ECOM_LOCK_TYPES)

    locks_supported: INTEGER
            -- Types of region locking supported by stream

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    modification_time: WEL_FILE_TIME
            -- Modification time

    name: STRING
            -- Name

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    size: ECOM_ULARGE_INTEGER
            -- Size in bytes

    statflag_default: INTEGER
            -- Indicate that this is not used for property
            -- (from ECOM_STAT_FLAGS)

    statflag_noname: INTEGER
            -- Indicate that this is not used for property
            -- (from ECOM_STAT_FLAGS)

    stream_seek_cur: INTEGER
            -- Sets seek position relative to
            -- current position of stream
            -- (from ECOM_STREAM_SEEK)

    stream_seek_end: INTEGER
            -- Sets seek position relative to
            -- current end of stream
            -- (from ECOM_STREAM_SEEK)

    stream_seek_set: INTEGER
            -- Sets seek position relative to
            -- beginning of stream
            -- (from ECOM_STREAM_SEEK)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

feature -- Basic Operations

    clone_stream: ECOM_STREAM
            -- New stream referencing
            -- the same bytes as Current
            -- Seek pointer is also cloned
        ensure
            clone_created: Result /= void and then Result.exists

    copy_to (destination: ECOM_STREAM; bytes: ECOM_ULARGE_INTEGER)
            -- Copy bytes number of bytes from current seek pointer
            -- in stream to current seek pointer in
            -- destination.
        require
            valid_destination: destination /= void and then destination.exists
            valid_bytes_number: bytes /= void and then bytes.exists

    finish
            -- Set seek pointer to end of stream.
        ensure
            at_end: end_of_stream

    lock_region (offset, count: ECOM_ULARGE_INTEGER; lock: INTEGER)
            -- Restricts access to range of bytes defined by
            -- offset and count.
        require
            valid_offset: offset /= void and then offset.exists
            valid_count: count /= void and then count.exists
            valid_lock: is_valid_lock (lock)

    read (buffer: POINTER; bytes: INTEGER)
            -- Reads bytes number of bytes from stream
            -- into buffer starting at current seek pointer.
        require
            valid_buffer: buffer /= default_pointer
            valid_bytes: bytes >= 0

    read_boolean
            -- Read boolean from stream.

    read_character
            -- Read character from stream.

    read_integer
            -- Read integer from stream.

    read_real
            -- Read real from stream.

    read_string
            -- Read string from stream.

    seek (displacement: ECOM_LARGE_INTEGER; origin: INTEGER)
            -- Move seek pointer by displacement
            -- relative to origin.
            -- See class ECOM_STREAM_SEEK for origin values.
        require
            non_void_displacement: displacement /= void
            valid_displacement: displacement.exists
            valid_seek_origin: is_valid_seek (origin)

    set_size (new_size: ECOM_ULARGE_INTEGER)
            -- Change size of stream to new_size.
        require
            valid_new_size: new_size /= void and then new_size.exists
        ensure
            size = new_size

    start
            -- Set seek pointer to beginning of stream.
        ensure
            not_end: not end_of_stream

    unlock_region (offset, count: ECOM_ULARGE_INTEGER; lock: INTEGER)
            -- Removes access restriction to range of bytes defined by
            -- offset and count.
        require
            valid_offset: offset /= void and then offset.exists
            valid_count: count /= void and then count.exists
            valid_lock: is_valid_lock (lock)

    update_end_of_stream
            -- Update value of end_of_stream.

    write (buffer: POINTER; bytes: INTEGER)
            -- Writes bytes number of bytes into stream
            -- starting at current seek pointer.
        require
            valid_buffer: buffer /= default_pointer

    write_boolean (boolean: BOOLEAN)
            -- Write boolean into stream.

    write_character (character: CHARACTER)
            -- Write character into stream.

    write_integer (integer: INTEGER)
            -- Write integer into stream.

    write_real (real: REAL)
            -- Write real into stream.

    write_string (string: STRING)
            -- Write string into stream.
        require
            string /= void

feature -- Element Change

    trigger (code: INTEGER)
            -- Raise exception with code code.
            -- See class ECOM_EXCEPTION_CODES for possible values.
            -- (from ECOM_EXCEPTION)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class ECOM_STREAM


ECOM_STUB Chart

deferred class
    ECOM_STUB

General
    cluster: com.Interfaces
    description: "COM Stub."

Ancestors
    ECOM_INTERFACE

Queries
    exists: BOOLEAN
    item: POINTER

Commands
    create_item
    set_item (an_item: POINTER)


ECOM_STUB Flat contracts

indexing
    description: "COM Stub."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ECOM_STUB

feature -- Access

    exists: BOOLEAN
            -- Is stub initialized?

    item: POINTER
            -- Pointer to COM object stub.

feature -- Basic operations

    create_item
            -- Create COM stub.
        require
            not_exists: not exists
        ensure
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item.
        ensure
            valid_item: item = an_item

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STUB


ECOM_UNKNOWN_INTERFACE Chart

class
    ECOM_UNKNOWN_INTERFACE

General
    cluster: com.Interfaces
    description: "COM generic interface."
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_QUERIABLE

Queries
    exists: BOOLEAN
    item: POINTER

Commands
    make_from_pointer (other_pointer: POINTER)


ECOM_UNKNOWN_INTERFACE Flat contracts

indexing
    description: "COM generic interface."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_UNKNOWN_INTERFACE

create

    make_from_pointer (other_pointer: POINTER)
            -- Create interface from other interface pointer.
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Initialization

    make_from_pointer (other_pointer: POINTER)
            -- Create interface from other interface pointer.
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class ECOM_UNKNOWN_INTERFACE


FONT_EVENTS_INTERFACE Chart

deferred class
    FONT_EVENTS_INTERFACE

General
    cluster: com.Interfaces
    description: "Event interface for the Font object. OLE Automation."

Ancestors
    ECOM_INTERFACE

Queries
    font_changed_user_precondition (property_name: STRING): BOOLEAN
    item: POINTER

Commands
    font_changed (property_name: STRING)


FONT_EVENTS_INTERFACE Flat contracts

indexing
    description: "Event interface for the Font object. OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

deferred class interface
    FONT_EVENTS_INTERFACE

feature -- Access

    item: POINTER
            -- Pointer to COM interface.
            -- (from ECOM_INTERFACE)

feature -- Basic Operations

    font_changed (property_name: STRING)
            -- No description available.
            -- property_name [in].
        require
            font_changed_user_precondition: font_changed_user_precondition (property_name)

feature -- Status Report

    font_changed_user_precondition (property_name: STRING): BOOLEAN
            -- User-defined preconditions for font_changed.
            -- Redefine in descendants if needed.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class FONT_EVENTS_INTERFACE


FONT_IMPL_PROXY Chart

class
    FONT_IMPL_PROXY

General
    cluster: com.Interfaces
    description: "Implemented `Font' Interface."
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_QUERIABLE
    FONT_INTERFACE

Queries
    bold: BOOLEAN
    bold_user_precondition: BOOLEAN
    charset: INTEGER
    charset_user_precondition: BOOLEAN
    exists: BOOLEAN
    italic: BOOLEAN
    italic_user_precondition: BOOLEAN
    item: POINTER
    last_error_code: INTEGER
    last_error_description: STRING
    last_error_help_file: STRING
    last_source_of_exception: STRING
    name: STRING
    name_user_precondition: BOOLEAN
    set_bold_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_charset_user_precondition (a_value: INTEGER): BOOLEAN
    set_italic_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_name_user_precondition (a_value: STRING): BOOLEAN
    set_size_user_precondition (a_value: ECOM_CURRENCY): BOOLEAN
    set_strikethrough_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_underline_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_weight_user_precondition (a_value: INTEGER): BOOLEAN
    size: ECOM_CURRENCY
    size_user_precondition: BOOLEAN
    strikethrough: BOOLEAN
    strikethrough_user_precondition: BOOLEAN
    underline: BOOLEAN
    underline_user_precondition: BOOLEAN
    weight: INTEGER
    weight_user_precondition: BOOLEAN

Commands
    set_bold (a_value: BOOLEAN)
    set_charset (a_value: INTEGER)
    set_italic (a_value: BOOLEAN)
    set_name (a_value: STRING)
    set_size (a_value: ECOM_CURRENCY)
    set_strikethrough (a_value: BOOLEAN)
    set_underline (a_value: BOOLEAN)
    set_weight (a_value: INTEGER)


FONT_IMPL_PROXY Flat contracts

indexing
    description: "Implemented `Font' Interface."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    FONT_IMPL_PROXY

create

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_pointer (cpp_obj: POINTER)
            -- Make from pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    bold: BOOLEAN
            -- No description available.
        require -- from FONT_INTERFACE
            bold_user_precondition: bold_user_precondition

    charset: INTEGER
            -- No description available.
        require -- from FONT_INTERFACE
            charset_user_precondition: charset_user_precondition

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    italic: BOOLEAN
            -- No description available.
        require -- from FONT_INTERFACE
            italic_user_precondition: italic_user_precondition

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

    name: STRING
            -- No description available.
        require -- from FONT_INTERFACE
            name_user_precondition: name_user_precondition

    size: ECOM_CURRENCY
            -- No description available.
        require -- from FONT_INTERFACE
            size_user_precondition: size_user_precondition

    strikethrough: BOOLEAN
            -- No description available.
        require -- from FONT_INTERFACE
            strikethrough_user_precondition: strikethrough_user_precondition

    underline: BOOLEAN
            -- No description available.
        require -- from FONT_INTERFACE
            underline_user_precondition: underline_user_precondition

    weight: INTEGER
            -- No description available.
        require -- from FONT_INTERFACE
            weight_user_precondition: weight_user_precondition

feature -- Element Change

    set_bold (a_value: BOOLEAN)
            -- Set bold with a_value.
        require -- from FONT_INTERFACE
            set_bold_user_precondition: set_bold_user_precondition (a_value)

    set_charset (a_value: INTEGER)
            -- Set charset with a_value.
        require -- from FONT_INTERFACE
            set_charset_user_precondition: set_charset_user_precondition (a_value)

    set_italic (a_value: BOOLEAN)
            -- Set italic with a_value.
        require -- from FONT_INTERFACE
            set_italic_user_precondition: set_italic_user_precondition (a_value)

    set_name (a_value: STRING)
            -- Set name with a_value.
        require -- from FONT_INTERFACE
            set_name_user_precondition: set_name_user_precondition (a_value)

    set_size (a_value: ECOM_CURRENCY)
            -- Set size with a_value.
        require -- from FONT_INTERFACE
            non_void_a_value: a_value /= void
            valid_a_value: a_value.item /= default_pointer
            set_size_user_precondition: set_size_user_precondition (a_value)

    set_strikethrough (a_value: BOOLEAN)
            -- Set strikethrough with a_value.
        require -- from FONT_INTERFACE
            set_strikethrough_user_precondition: set_strikethrough_user_precondition (a_value)

    set_underline (a_value: BOOLEAN)
            -- Set underline with a_value.
        require -- from FONT_INTERFACE
            set_underline_user_precondition: set_underline_user_precondition (a_value)

    set_weight (a_value: INTEGER)
            -- Set weight with a_value.
        require -- from FONT_INTERFACE
            set_weight_user_precondition: set_weight_user_precondition (a_value)

feature -- Status Report

    bold_user_precondition: BOOLEAN
            -- User-defined preconditions for bold.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    charset_user_precondition: BOOLEAN
            -- User-defined preconditions for charset.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    italic_user_precondition: BOOLEAN
            -- User-defined preconditions for italic.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    last_error_code: INTEGER
            -- Last error code.

    last_error_description: STRING
            -- Last error description.

    last_error_help_file: STRING
            -- Last error help file.

    last_source_of_exception: STRING
            -- Last source of exception.

    name_user_precondition: BOOLEAN
            -- User-defined preconditions for name.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_bold_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_bold.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_charset_user_precondition (a_value: INTEGER): BOOLEAN
            -- User-defined preconditions for set_charset.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_italic_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_italic.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_name_user_precondition (a_value: STRING): BOOLEAN
            -- User-defined preconditions for set_name.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_size_user_precondition (a_value: ECOM_CURRENCY): BOOLEAN
            -- User-defined preconditions for set_size.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_strikethrough_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_strikethrough.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_underline_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_underline.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    set_weight_user_precondition (a_value: INTEGER): BOOLEAN
            -- User-defined preconditions for set_weight.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    size_user_precondition: BOOLEAN
            -- User-defined preconditions for size.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    strikethrough_user_precondition: BOOLEAN
            -- User-defined preconditions for strikethrough.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    underline_user_precondition: BOOLEAN
            -- User-defined preconditions for underline.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

    weight_user_precondition: BOOLEAN
            -- User-defined preconditions for weight.
            -- Redefine in descendants if needed.
            -- (from FONT_INTERFACE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class FONT_IMPL_PROXY


FONT_INTERFACE Chart

deferred class
    FONT_INTERFACE

General
    cluster: com.Interfaces
    description: "OLE Automation."

Ancestors
    ECOM_INTERFACE

Queries
    bold: BOOLEAN
    bold_user_precondition: BOOLEAN
    charset: INTEGER
    charset_user_precondition: BOOLEAN
    italic: BOOLEAN
    italic_user_precondition: BOOLEAN
    item: POINTER
    name: STRING
    name_user_precondition: BOOLEAN
    set_bold_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_charset_user_precondition (a_value: INTEGER): BOOLEAN
    set_italic_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_name_user_precondition (a_value: STRING): BOOLEAN
    set_size_user_precondition (a_value: ECOM_CURRENCY): BOOLEAN
    set_strikethrough_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_underline_user_precondition (a_value: BOOLEAN): BOOLEAN
    set_weight_user_precondition (a_value: INTEGER): BOOLEAN
    size: ECOM_CURRENCY
    size_user_precondition: BOOLEAN
    strikethrough: BOOLEAN
    strikethrough_user_precondition: BOOLEAN
    underline: BOOLEAN
    underline_user_precondition: BOOLEAN
    weight: INTEGER
    weight_user_precondition: BOOLEAN

Commands
    set_bold (a_value: BOOLEAN)
    set_charset (a_value: INTEGER)
    set_italic (a_value: BOOLEAN)
    set_name (a_value: STRING)
    set_size (a_value: ECOM_CURRENCY)
    set_strikethrough (a_value: BOOLEAN)
    set_underline (a_value: BOOLEAN)
    set_weight (a_value: INTEGER)


FONT_INTERFACE Flat contracts

indexing
    description: "OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

deferred class interface
    FONT_INTERFACE

feature -- Access

    bold: BOOLEAN
            -- No description available.
        require
            bold_user_precondition: bold_user_precondition

    charset: INTEGER
            -- No description available.
        require
            charset_user_precondition: charset_user_precondition

    italic: BOOLEAN
            -- No description available.
        require
            italic_user_precondition: italic_user_precondition

    item: POINTER
            -- Pointer to COM interface.
            -- (from ECOM_INTERFACE)

    name: STRING
            -- No description available.
        require
            name_user_precondition: name_user_precondition

    size: ECOM_CURRENCY
            -- No description available.
        require
            size_user_precondition: size_user_precondition

    strikethrough: BOOLEAN
            -- No description available.
        require
            strikethrough_user_precondition: strikethrough_user_precondition

    underline: BOOLEAN
            -- No description available.
        require
            underline_user_precondition: underline_user_precondition

    weight: INTEGER
            -- No description available.
        require
            weight_user_precondition: weight_user_precondition

feature -- Element Change

    set_bold (a_value: BOOLEAN)
            -- Set 'bold' with 'a_value'
        require
            set_bold_user_precondition: set_bold_user_precondition (a_value)

    set_charset (a_value: INTEGER)
            -- Set 'charset' with 'a_value'
        require
            set_charset_user_precondition: set_charset_user_precondition (a_value)

    set_italic (a_value: BOOLEAN)
            -- Set 'italic' with 'a_value'
        require
            set_italic_user_precondition: set_italic_user_precondition (a_value)

    set_name (a_value: STRING)
            -- Set 'name' with 'a_value'
        require
            set_name_user_precondition: set_name_user_precondition (a_value)

    set_size (a_value: ECOM_CURRENCY)
            -- Set 'size' with 'a_value'
        require
            non_void_a_value: a_value /= void
            valid_a_value: a_value.item /= default_pointer
            set_size_user_precondition: set_size_user_precondition (a_value)

    set_strikethrough (a_value: BOOLEAN)
            -- Set 'strikethrough' with 'a_value'
        require
            set_strikethrough_user_precondition: set_strikethrough_user_precondition (a_value)

    set_underline (a_value: BOOLEAN)
            -- Set 'underline' with 'a_value'
        require
            set_underline_user_precondition: set_underline_user_precondition (a_value)

    set_weight (a_value: INTEGER)
            -- Set 'weight' with 'a_value'
        require
            set_weight_user_precondition: set_weight_user_precondition (a_value)

feature -- Status Report

    bold_user_precondition: BOOLEAN
            -- User-defined preconditions for bold.
            -- Redefine in descendants if needed.

    charset_user_precondition: BOOLEAN
            -- User-defined preconditions for charset.
            -- Redefine in descendants if needed.

    italic_user_precondition: BOOLEAN
            -- User-defined preconditions for italic.
            -- Redefine in descendants if needed.

    name_user_precondition: BOOLEAN
            -- User-defined preconditions for name.
            -- Redefine in descendants if needed.

    set_bold_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_bold.
            -- Redefine in descendants if needed.

    set_charset_user_precondition (a_value: INTEGER): BOOLEAN
            -- User-defined preconditions for set_charset.
            -- Redefine in descendants if needed.

    set_italic_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_italic.
            -- Redefine in descendants if needed.

    set_name_user_precondition (a_value: STRING): BOOLEAN
            -- User-defined preconditions for set_name.
            -- Redefine in descendants if needed.

    set_size_user_precondition (a_value: ECOM_CURRENCY): BOOLEAN
            -- User-defined preconditions for set_size.
            -- Redefine in descendants if needed.

    set_strikethrough_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_strikethrough.
            -- Redefine in descendants if needed.

    set_underline_user_precondition (a_value: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_underline.
            -- Redefine in descendants if needed.

    set_weight_user_precondition (a_value: INTEGER): BOOLEAN
            -- User-defined preconditions for set_weight.
            -- Redefine in descendants if needed.

    size_user_precondition: BOOLEAN
            -- User-defined preconditions for size.
            -- Redefine in descendants if needed.

    strikethrough_user_precondition: BOOLEAN
            -- User-defined preconditions for strikethrough.
            -- Redefine in descendants if needed.

    underline_user_precondition: BOOLEAN
            -- User-defined preconditions for underline.
            -- Redefine in descendants if needed.

    weight_user_precondition: BOOLEAN
            -- User-defined preconditions for weight.
            -- Redefine in descendants if needed.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class FONT_INTERFACE


IENUM_IMPL Chart

class
    IENUM_IMPL [G]

General
    cluster: com.Interfaces
    description: "Implementation of `IEnumXXXX' Interface."
    create: make

Ancestors
    ANY

Commands
    clone1 (ppenum: CELL [[like Current] IENUM_IMPL [G]])
    next (celt: INTEGER; rgelt: ARRAY [G]; pcelt_fetched: INTEGER_REF)
    reset
    skip (celt: INTEGER)

Constraints
    implementation exists


IENUM_IMPL Flat contracts

indexing
    description: "Implementation of `IEnumXXXX' Interface."
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.2 $"

class interface
    IENUM_IMPL [G]

create

    make (enumeration: like implementation)
            -- Initialization.
        require
            non_void_enumeration: enumeration /= void

feature -- Basic Operations

    clone1 (ppenum: CELL [like Current])
            -- Creates another enumerator that contains the
            -- same enumeration state as the current one.
            -- Using this function, a client can record a
            -- particular point in the enumeration sequence
            -- and then return to that point at a later time.
            -- The new enumerator supports the same interface
            -- as the original one.
            -- ppenum [out].

    next (celt: INTEGER; rgelt: ARRAY [G]; pcelt_fetched: INTEGER_REF)
            -- Retrieves the next celt items in
            -- the enumeration sequence.
            -- If there are fewer than the requested number
            -- of elements left in the sequence, it retrieves
            -- the remaining elements. The number of elements
            -- actually retrieved is returned through
            -- pcelt_fetched (unless the caller passed in
            -- Void for that parameter).
            --
            -- celt [in] Number of elements being requested.
            -- rgelt [out] Array of size celt (or larger)
            -- of the elements of interest. The type of this
            -- parameter depends on the item being enumerated.
            -- Array index starts from 1.
            -- pcelt_fetched [out] Reference to the number of
            -- elements actually supplied in rgelt. Caller can
            -- pass in Void if celt is one.

    reset
            -- Resets the enumeration sequence to the beginning.

    skip (celt: INTEGER)
            -- Skips over the next specified number of
            -- elements in the enumeration sequence.
            -- celt [in] Number of elements to be skipped.

invariant

    implementation_exists: implementation_exists
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class IENUM_IMPL


IENUM_VARIANT_IMPL_PROXY Chart

class
    IENUM_VARIANT_IMPL_PROXY

General
    cluster: com.Interfaces
    description: "Implemented `IEnumVARIANT' Interface."
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_QUERIABLE
    IENUM_VARIANT_INTERFACE

Queries
    clone1_user_precondition (ppenum: CELL [IENUM_VARIANT_INTERFACE]): BOOLEAN
    exists: BOOLEAN
    item: POINTER
    next_user_precondition (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF): BOOLEAN
    reset_user_precondition: BOOLEAN
    skip_user_precondition (celt: INTEGER): BOOLEAN

Commands
    clone1 (ppenum: CELL [IENUM_VARIANT_INTERFACE])
    next (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF)
    reset
    skip (celt: INTEGER)


IENUM_VARIANT_IMPL_PROXY Flat contracts

indexing
    description: "Implemented `IEnumVARIANT' Interface."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    IENUM_VARIANT_IMPL_PROXY

create

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_pointer (cpp_obj: POINTER)
            -- Make from pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

feature -- Basic Operations

    clone1 (ppenum: CELL [IENUM_VARIANT_INTERFACE])
            -- No description available.
            -- ppenum [out].
        require -- from IENUM_VARIANT_INTERFACE
            non_void_ppenum: ppenum /= void
            clone1_user_precondition: clone1_user_precondition (ppenum)
        ensure -- from IENUM_VARIANT_INTERFACE
            valid_ppenum: ppenum.item /= void

    next (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF)
            -- No description available.
            -- celt [in].
            -- rgvar [in].
            -- pcelt_fetched [out].
        require -- from IENUM_VARIANT_INTERFACE
            non_void_rgvar: rgvar /= void
            non_void_pcelt_fetched: pcelt_fetched /= void
            next_user_precondition: next_user_precondition (celt, rgvar, pcelt_fetched)

    reset
            -- No description available.
        require -- from IENUM_VARIANT_INTERFACE
            reset_user_precondition: reset_user_precondition

    skip (celt: INTEGER)
            -- No description available.
            -- celt [in].
        require -- from IENUM_VARIANT_INTERFACE
            skip_user_precondition: skip_user_precondition (celt)

feature -- Status Report

    clone1_user_precondition (ppenum: CELL [IENUM_VARIANT_INTERFACE]): BOOLEAN
            -- User-defined preconditions for clone1.
            -- Redefine in descendants if needed.
            -- (from IENUM_VARIANT_INTERFACE)

    next_user_precondition (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF): BOOLEAN
            -- User-defined preconditions for next.
            -- Redefine in descendants if needed.
            -- (from IENUM_VARIANT_INTERFACE)

    reset_user_precondition: BOOLEAN
            -- User-defined preconditions for reset.
            -- Redefine in descendants if needed.
            -- (from IENUM_VARIANT_INTERFACE)

    skip_user_precondition (celt: INTEGER): BOOLEAN
            -- User-defined preconditions for skip.
            -- Redefine in descendants if needed.
            -- (from IENUM_VARIANT_INTERFACE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class IENUM_VARIANT_IMPL_PROXY


IENUM_VARIANT_INTERFACE Chart

deferred class
    IENUM_VARIANT_INTERFACE

General
    cluster: com.Interfaces
    description: "OLE Automation. "

Ancestors
    ECOM_INTERFACE

Queries
    clone1_user_precondition (ppenum: CELL [IENUM_VARIANT_INTERFACE]): BOOLEAN
    item: POINTER
    next_user_precondition (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF): BOOLEAN
    reset_user_precondition: BOOLEAN
    skip_user_precondition (celt: INTEGER): BOOLEAN

Commands
    clone1 (ppenum: CELL [IENUM_VARIANT_INTERFACE])
    next (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF)
    reset
    skip (celt: INTEGER)


IENUM_VARIANT_INTERFACE Flat contracts

indexing
    description: "OLE Automation. "
    note: "Automatically generated by the EiffelCOM Wizard."

deferred class interface
    IENUM_VARIANT_INTERFACE

feature -- Access

    item: POINTER
            -- Pointer to COM interface.
            -- (from ECOM_INTERFACE)

feature -- Basic Operations

    clone1 (ppenum: CELL [IENUM_VARIANT_INTERFACE])
            -- No description available.
            -- ppenum [out].
        require
            non_void_ppenum: ppenum /= void
            clone1_user_precondition: clone1_user_precondition (ppenum)
        ensure
            valid_ppenum: ppenum.item /= void

    next (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF)
            -- No description available.
            -- celt [in].
            -- rgvar [in].
            -- pcelt_fetched [out].
        require
            non_void_rgvar: rgvar /= void
            non_void_pcelt_fetched: pcelt_fetched /= void
            next_user_precondition: next_user_precondition (celt, rgvar, pcelt_fetched)

    reset
            -- No description available.
        require
            reset_user_precondition: reset_user_precondition

    skip (celt: INTEGER)
            -- No description available.
            -- celt [in].
        require
            skip_user_precondition: skip_user_precondition (celt)

feature -- Status Report

    clone1_user_precondition (ppenum: CELL [IENUM_VARIANT_INTERFACE]): BOOLEAN
            -- User-defined preconditions for clone1.
            -- Redefine in descendants if needed.

    next_user_precondition (celt: INTEGER; rgvar: ARRAY [ECOM_VARIANT]; pcelt_fetched: INTEGER_REF): BOOLEAN
            -- User-defined preconditions for next.
            -- Redefine in descendants if needed.

    reset_user_precondition: BOOLEAN
            -- User-defined preconditions for reset.
            -- Redefine in descendants if needed.

    skip_user_precondition (celt: INTEGER): BOOLEAN
            -- User-defined preconditions for skip.
            -- Redefine in descendants if needed.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class IENUM_VARIANT_INTERFACE


IFONT_IMPL_PROXY Chart

class
    IFONT_IMPL_PROXY

General
    cluster: com.Interfaces
    description: "Implemented `IFont' Interface."
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_QUERIABLE
    IFONT_INTERFACE

Queries
    add_ref_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
    bold: BOOLEAN
    bold_user_precondition: BOOLEAN
    charset: INTEGER
    charset_user_precondition: BOOLEAN
    clone1_user_precondition (ppfont: CELL [IFONT_INTERFACE]): BOOLEAN
    exists: BOOLEAN
    h_font: INTEGER
    h_font_user_precondition: BOOLEAN
    is_equal1_user_precondition (pfont_other: IFONT_INTERFACE): BOOLEAN
    italic: BOOLEAN
    italic_user_precondition: BOOLEAN
    item: POINTER
    name: STRING
    name_user_precondition: BOOLEAN
    release_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
    set_bold_user_precondition (pbold: BOOLEAN): BOOLEAN
    set_charset_user_precondition (pcharset: INTEGER): BOOLEAN
    set_italic_user_precondition (pitalic: BOOLEAN): BOOLEAN
    set_name_user_precondition (pname: STRING): BOOLEAN
    set_ratio_user_precondition (cy_logical, cy_himetric: INTEGER): BOOLEAN
    set_size_user_precondition (psize: ECOM_CURRENCY): BOOLEAN
    set_strikethrough_user_precondition (pstrikethrough: BOOLEAN): BOOLEAN
    set_underline_user_precondition (punderline: BOOLEAN): BOOLEAN
    set_weight_user_precondition (pweight: INTEGER): BOOLEAN
    size: ECOM_CURRENCY
    size_user_precondition: BOOLEAN
    strikethrough: BOOLEAN
    strikethrough_user_precondition: BOOLEAN
    underline: BOOLEAN
    underline_user_precondition: BOOLEAN
    weight: INTEGER
    weight_user_precondition: BOOLEAN

Commands
    add_ref_hfont (a_h_font: INTEGER)
    clone1 (ppfont: CELL [IFONT_INTERFACE])
    is_equal1 (pfont_other: IFONT_INTERFACE)
    release_hfont (a_h_font: INTEGER)
    set_bold (pbold: BOOLEAN)
    set_charset (pcharset: INTEGER)
    set_italic (pitalic: BOOLEAN)
    set_name (pname: STRING)
    set_ratio (cy_logical, cy_himetric: INTEGER)
    set_size (psize: ECOM_CURRENCY)
    set_strikethrough (pstrikethrough: BOOLEAN)
    set_underline (punderline: BOOLEAN)
    set_weight (pweight: INTEGER)


IFONT_IMPL_PROXY Flat contracts

indexing
    description: "Implemented `IFont' Interface."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    IFONT_IMPL_PROXY

create

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_pointer (cpp_obj: POINTER)
            -- Make from pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    bold: BOOLEAN
            -- No description available.
        require -- from IFONT_INTERFACE
            bold_user_precondition: bold_user_precondition

    charset: INTEGER
            -- No description available.
        require -- from IFONT_INTERFACE
            charset_user_precondition: charset_user_precondition

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    h_font: INTEGER
            -- No description available.
        require -- from IFONT_INTERFACE
            h_font_user_precondition: h_font_user_precondition

    italic: BOOLEAN
            -- No description available.
        require -- from IFONT_INTERFACE
            italic_user_precondition: italic_user_precondition

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

    name: STRING
            -- No description available.
        require -- from IFONT_INTERFACE
            name_user_precondition: name_user_precondition
        ensure -- from IFONT_INTERFACE
            non_void_name: Result /= void

    size: ECOM_CURRENCY
            -- No description available.
        require -- from IFONT_INTERFACE
            size_user_precondition: size_user_precondition
        ensure -- from IFONT_INTERFACE
            non_void_size: Result /= void
            valid_size: Result.item /= default_pointer

    strikethrough: BOOLEAN
            -- No description available.
        require -- from IFONT_INTERFACE
            strikethrough_user_precondition: strikethrough_user_precondition

    underline: BOOLEAN
            -- No description available.
        require -- from IFONT_INTERFACE
            underline_user_precondition: underline_user_precondition

    weight: INTEGER
            -- No description available.
        require -- from IFONT_INTERFACE
            weight_user_precondition: weight_user_precondition

feature -- Basic Operations

    add_ref_hfont (a_h_font: INTEGER)
            -- No description available.
            -- a_h_font [in].
        require -- from IFONT_INTERFACE
            add_ref_hfont_user_precondition: add_ref_hfont_user_precondition (a_h_font)

    clone1 (ppfont: CELL [IFONT_INTERFACE])
            -- No description available.
            -- ppfont [out].
        require -- from IFONT_INTERFACE
            non_void_ppfont: ppfont /= void
            clone1_user_precondition: clone1_user_precondition (ppfont)
        ensure -- from IFONT_INTERFACE
            valid_ppfont: ppfont.item /= void

    is_equal1 (pfont_other: IFONT_INTERFACE)
            -- No description available.
            -- pfont_other [in].
        require -- from IFONT_INTERFACE
            non_void_pfont_other: pfont_other /= void
            valid_pfont_other: pfont_other.item /= default_pointer
            is_equal1_user_precondition: is_equal1_user_precondition (pfont_other)

    release_hfont (a_h_font: INTEGER)
            -- No description available.
            -- a_h_font [in].
        require -- from IFONT_INTERFACE
            release_hfont_user_precondition: release_hfont_user_precondition (a_h_font)

    set_bold (pbold: BOOLEAN)
            -- No description available.
            -- pbold [in].
        require -- from IFONT_INTERFACE
            set_bold_user_precondition: set_bold_user_precondition (pbold)

    set_charset (pcharset: INTEGER)
            -- No description available.
            -- pcharset [in].
        require -- from IFONT_INTERFACE
            set_charset_user_precondition: set_charset_user_precondition (pcharset)

    set_italic (pitalic: BOOLEAN)
            -- No description available.
            -- pitalic [in].
        require -- from IFONT_INTERFACE
            set_italic_user_precondition: set_italic_user_precondition (pitalic)

    set_name (pname: STRING)
            -- No description available.
            -- pname [in].
        require -- from IFONT_INTERFACE
            set_name_user_precondition: set_name_user_precondition (pname)

    set_ratio (cy_logical: INTEGER; cy_himetric: INTEGER)
            -- No description available.
            -- cy_logical [in].
            -- cy_himetric [in].
        require -- from IFONT_INTERFACE
            set_ratio_user_precondition: set_ratio_user_precondition (cy_logical, cy_himetric)

    set_size (psize: ECOM_CURRENCY)
            -- No description available.
            -- psize [in].
        require -- from IFONT_INTERFACE
            non_void_psize: psize /= void
            valid_psize: psize.item /= default_pointer
            set_size_user_precondition: set_size_user_precondition (psize)

    set_strikethrough (pstrikethrough: BOOLEAN)
            -- No description available.
            -- pstrikethrough [in].
        require -- from IFONT_INTERFACE
            set_strikethrough_user_precondition: set_strikethrough_user_precondition (pstrikethrough)

    set_underline (punderline: BOOLEAN)
            -- No description available.
            -- punderline [in].
        require -- from IFONT_INTERFACE
            set_underline_user_precondition: set_underline_user_precondition (punderline)

    set_weight (pweight: INTEGER)
            -- No description available.
            -- pweight [in].
        require -- from IFONT_INTERFACE
            set_weight_user_precondition: set_weight_user_precondition (pweight)

feature -- Status Report

    add_ref_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
            -- User-defined preconditions for add_ref_hfont.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    bold_user_precondition: BOOLEAN
            -- User-defined preconditions for bold.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    charset_user_precondition: BOOLEAN
            -- User-defined preconditions for charset.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    clone1_user_precondition (ppfont: CELL [IFONT_INTERFACE]): BOOLEAN
            -- User-defined preconditions for clone1.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    h_font_user_precondition: BOOLEAN
            -- User-defined preconditions for h_font.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    is_equal1_user_precondition (pfont_other: IFONT_INTERFACE): BOOLEAN
            -- User-defined preconditions for is_equal1.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    italic_user_precondition: BOOLEAN
            -- User-defined preconditions for italic.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    name_user_precondition: BOOLEAN
            -- User-defined preconditions for name.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    release_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
            -- User-defined preconditions for release_hfont.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_bold_user_precondition (pbold: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_bold.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_charset_user_precondition (pcharset: INTEGER): BOOLEAN
            -- User-defined preconditions for set_charset.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_italic_user_precondition (pitalic: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_italic.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_name_user_precondition (pname: STRING): BOOLEAN
            -- User-defined preconditions for set_name.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_ratio_user_precondition (cy_logical: INTEGER; cy_himetric: INTEGER): BOOLEAN
            -- User-defined preconditions for set_ratio.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_size_user_precondition (psize: ECOM_CURRENCY): BOOLEAN
            -- User-defined preconditions for set_size.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_strikethrough_user_precondition (pstrikethrough: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_strikethrough.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_underline_user_precondition (punderline: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_underline.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    set_weight_user_precondition (pweight: INTEGER): BOOLEAN
            -- User-defined preconditions for set_weight.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    size_user_precondition: BOOLEAN
            -- User-defined preconditions for size.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    strikethrough_user_precondition: BOOLEAN
            -- User-defined preconditions for strikethrough.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    underline_user_precondition: BOOLEAN
            -- User-defined preconditions for underline.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

    weight_user_precondition: BOOLEAN
            -- User-defined preconditions for weight.
            -- Redefine in descendants if needed.
            -- (from IFONT_INTERFACE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class IFONT_IMPL_PROXY


IFONT_INTERFACE Chart

deferred class
    IFONT_INTERFACE

General
    cluster: com.Interfaces
    description: "Font Object. OLE Automation."

Ancestors
    ECOM_INTERFACE

Queries
    add_ref_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
    bold: BOOLEAN
    bold_user_precondition: BOOLEAN
    charset: INTEGER
    charset_user_precondition: BOOLEAN
    clone1_user_precondition (ppfont: CELL [IFONT_INTERFACE]): BOOLEAN
    h_font: INTEGER
    h_font_user_precondition: BOOLEAN
    is_equal1_user_precondition (pfont_other: IFONT_INTERFACE): BOOLEAN
    italic: BOOLEAN
    italic_user_precondition: BOOLEAN
    item: POINTER
    name: STRING
    name_user_precondition: BOOLEAN
    release_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
    set_bold_user_precondition (pbold: BOOLEAN): BOOLEAN
    set_charset_user_precondition (pcharset: INTEGER): BOOLEAN
    set_italic_user_precondition (pitalic: BOOLEAN): BOOLEAN
    set_name_user_precondition (pname: STRING): BOOLEAN
    set_ratio_user_precondition (cy_logical, cy_himetric: INTEGER): BOOLEAN
    set_size_user_precondition (psize: ECOM_CURRENCY): BOOLEAN
    set_strikethrough_user_precondition (pstrikethrough: BOOLEAN): BOOLEAN
    set_underline_user_precondition (punderline: BOOLEAN): BOOLEAN
    set_weight_user_precondition (pweight: INTEGER): BOOLEAN
    size: ECOM_CURRENCY
    size_user_precondition: BOOLEAN
    strikethrough: BOOLEAN
    strikethrough_user_precondition: BOOLEAN
    underline: BOOLEAN
    underline_user_precondition: BOOLEAN
    weight: INTEGER
    weight_user_precondition: BOOLEAN

Commands
    add_ref_hfont (a_h_font: INTEGER)
    clone1 (ppfont: CELL [IFONT_INTERFACE])
    is_equal1 (pfont_other: IFONT_INTERFACE)
    release_hfont (a_h_font: INTEGER)
    set_bold (pbold: BOOLEAN)
    set_charset (pcharset: INTEGER)
    set_italic (pitalic: BOOLEAN)
    set_name (pname: STRING)
    set_ratio (cy_logical, cy_himetric: INTEGER)
    set_size (psize: ECOM_CURRENCY)
    set_strikethrough (pstrikethrough: BOOLEAN)
    set_underline (punderline: BOOLEAN)
    set_weight (pweight: INTEGER)


IFONT_INTERFACE Flat contracts

indexing
    description: "Font Object. OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

deferred class interface
    IFONT_INTERFACE

feature -- Access

    item: POINTER
            -- Pointer to COM interface.
            -- (from ECOM_INTERFACE)

feature -- Basic Operations

    add_ref_hfont (a_h_font: INTEGER)
            -- No description available.
            -- a_h_font [in].
        require
            add_ref_hfont_user_precondition: add_ref_hfont_user_precondition (a_h_font)

    bold: BOOLEAN
            -- No description available.
        require
            bold_user_precondition: bold_user_precondition

    charset: INTEGER
            -- No description available.
        require
            charset_user_precondition: charset_user_precondition

    clone1 (ppfont: CELL [IFONT_INTERFACE])
            -- No description available.
            -- ppfont [out].
        require
            non_void_ppfont: ppfont /= void
            clone1_user_precondition: clone1_user_precondition (ppfont)
        ensure
            valid_ppfont: ppfont.item /= void

    h_font: INTEGER
            -- No description available.
        require
            h_font_user_precondition: h_font_user_precondition

    is_equal1 (pfont_other: IFONT_INTERFACE)
            -- No description available.
            -- pfont_other [in].
        require
            non_void_pfont_other: pfont_other /= void
            valid_pfont_other: pfont_other.item /= default_pointer
            is_equal1_user_precondition: is_equal1_user_precondition (pfont_other)

    italic: BOOLEAN
            -- No description available.
        require
            italic_user_precondition: italic_user_precondition

    name: STRING
            -- No description available.
        require
            name_user_precondition: name_user_precondition
        ensure
            non_void_name: Result /= void

    release_hfont (a_h_font: INTEGER)
            -- No description available.
            -- a_h_font [in].
        require
            release_hfont_user_precondition: release_hfont_user_precondition (a_h_font)

    set_bold (pbold: BOOLEAN)
            -- No description available.
            -- pbold [in].
        require
            set_bold_user_precondition: set_bold_user_precondition (pbold)

    set_charset (pcharset: INTEGER)
            -- No description available.
            -- pcharset [in].
        require
            set_charset_user_precondition: set_charset_user_precondition (pcharset)

    set_italic (pitalic: BOOLEAN)
            -- No description available.
            -- pitalic [in].
        require
            set_italic_user_precondition: set_italic_user_precondition (pitalic)

    set_name (pname: STRING)
            -- No description available.
            -- pname [in].
        require
            set_name_user_precondition: set_name_user_precondition (pname)

    set_ratio (cy_logical: INTEGER; cy_himetric: INTEGER)
            -- No description available.
            -- cy_logical [in].
            -- cy_himetric [in].
        require
            set_ratio_user_precondition: set_ratio_user_precondition (cy_logical, cy_himetric)

    set_size (psize: ECOM_CURRENCY)
            -- No description available.
            -- psize [in].
        require
            non_void_psize: psize /= void
            valid_psize: psize.item /= default_pointer
            set_size_user_precondition: set_size_user_precondition (psize)

    set_strikethrough (pstrikethrough: BOOLEAN)
            -- No description available.
            -- pstrikethrough [in].
        require
            set_strikethrough_user_precondition: set_strikethrough_user_precondition (pstrikethrough)

    set_underline (punderline: BOOLEAN)
            -- No description available.
            -- punderline [in].
        require
            set_underline_user_precondition: set_underline_user_precondition (punderline)

    set_weight (pweight: INTEGER)
            -- No description available.
            -- pweight [in].
        require
            set_weight_user_precondition: set_weight_user_precondition (pweight)

    size: ECOM_CURRENCY
            -- No description available.
        require
            size_user_precondition: size_user_precondition
        ensure
            non_void_size: Result /= void
            valid_size: Result.item /= default_pointer

    strikethrough: BOOLEAN
            -- No description available.
        require
            strikethrough_user_precondition: strikethrough_user_precondition

    underline: BOOLEAN
            -- No description available.
        require
            underline_user_precondition: underline_user_precondition

    weight: INTEGER
            -- No description available.
        require
            weight_user_precondition: weight_user_precondition

feature -- Status Report

    add_ref_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
            -- User-defined preconditions for add_ref_hfont.
            -- Redefine in descendants if needed.

    bold_user_precondition: BOOLEAN
            -- User-defined preconditions for bold.
            -- Redefine in descendants if needed.

    charset_user_precondition: BOOLEAN
            -- User-defined preconditions for charset.
            -- Redefine in descendants if needed.

    clone1_user_precondition (ppfont: CELL [IFONT_INTERFACE]): BOOLEAN
            -- User-defined preconditions for clone1.
            -- Redefine in descendants if needed.

    h_font_user_precondition: BOOLEAN
            -- User-defined preconditions for h_font.
            -- Redefine in descendants if needed.

    is_equal1_user_precondition (pfont_other: IFONT_INTERFACE): BOOLEAN
            -- User-defined preconditions for is_equal1.
            -- Redefine in descendants if needed.

    italic_user_precondition: BOOLEAN
            -- User-defined preconditions for italic.
            -- Redefine in descendants if needed.

    name_user_precondition: BOOLEAN
            -- User-defined preconditions for name.
            -- Redefine in descendants if needed.

    release_hfont_user_precondition (a_h_font: INTEGER): BOOLEAN
            -- User-defined preconditions for release_hfont.
            -- Redefine in descendants if needed.

    set_bold_user_precondition (pbold: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_bold.
            -- Redefine in descendants if needed.

    set_charset_user_precondition (pcharset: INTEGER): BOOLEAN
            -- User-defined preconditions for set_charset.
            -- Redefine in descendants if needed.

    set_italic_user_precondition (pitalic: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_italic.
            -- Redefine in descendants if needed.

    set_name_user_precondition (pname: STRING): BOOLEAN
            -- User-defined preconditions for set_name.
            -- Redefine in descendants if needed.

    set_ratio_user_precondition (cy_logical: INTEGER; cy_himetric: INTEGER): BOOLEAN
            -- User-defined preconditions for set_ratio.
            -- Redefine in descendants if needed.

    set_size_user_precondition (psize: ECOM_CURRENCY): BOOLEAN
            -- User-defined preconditions for set_size.
            -- Redefine in descendants if needed.

    set_strikethrough_user_precondition (pstrikethrough: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_strikethrough.
            -- Redefine in descendants if needed.

    set_underline_user_precondition (punderline: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_underline.
            -- Redefine in descendants if needed.

    set_weight_user_precondition (pweight: INTEGER): BOOLEAN
            -- User-defined preconditions for set_weight.
            -- Redefine in descendants if needed.

    size_user_precondition: BOOLEAN
            -- User-defined preconditions for size.
            -- Redefine in descendants if needed.

    strikethrough_user_precondition: BOOLEAN
            -- User-defined preconditions for strikethrough.
            -- Redefine in descendants if needed.

    underline_user_precondition: BOOLEAN
            -- User-defined preconditions for underline.
            -- Redefine in descendants if needed.

    weight_user_precondition: BOOLEAN
            -- User-defined preconditions for weight.
            -- Redefine in descendants if needed.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class IFONT_INTERFACE


IPICTURE_INTERFACE Chart

deferred class
    IPICTURE_INTERFACE

General
    cluster: com.Interfaces
    description: "Picture Object OLE Automation."

Ancestors
    ECOM_INTERFACE

Queries
    attributes: INTEGER
    attributes_user_precondition: BOOLEAN
    cur_dc: INTEGER
    cur_dc_user_precondition: BOOLEAN
    h_pal: INTEGER
    h_pal_user_precondition: BOOLEAN
    handle: INTEGER
    handle_user_precondition: BOOLEAN
    height: INTEGER
    height_user_precondition: BOOLEAN
    item: POINTER
    keep_original_format: BOOLEAN
    keep_original_format_user_precondition: BOOLEAN
    picture_changed_user_precondition: BOOLEAN
    render_user_precondition (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src: INTEGER; prc_wbounds: POINTER): BOOLEAN
    save_as_file_user_precondition (pstm: POINTER; f_save_mem_copy: BOOLEAN; pcb_size: INTEGER_REF): BOOLEAN
    select_picture_user_precondition (hdc_in: INTEGER; phdc_out, phbmp_out: INTEGER_REF): BOOLEAN
    set_h_pal_user_precondition (phpal: INTEGER): BOOLEAN
    set_hdc_user_precondition (hdc: INTEGER): BOOLEAN
    set_keep_original_format_user_precondition (pfkeep: BOOLEAN): BOOLEAN
    type: INTEGER
    type_user_precondition: BOOLEAN
    width: INTEGER
    width_user_precondition: BOOLEAN

Commands
    picture_changed
    render (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src: INTEGER; prc_wbounds: POINTER)
    save_as_file (pstm: POINTER; f_save_mem_copy: BOOLEAN; pcb_size: INTEGER_REF)
    select_picture (hdc_in: INTEGER; phdc_out, phbmp_out: INTEGER_REF)
    set_h_pal (phpal: INTEGER)
    set_hdc (hdc: INTEGER)
    set_keep_original_format (pfkeep: BOOLEAN)


IPICTURE_INTERFACE Flat contracts

indexing
    description: "Picture Object OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

deferred class interface
    IPICTURE_INTERFACE

feature -- Access

    item: POINTER
            -- Pointer to COM interface.
            -- (from ECOM_INTERFACE)

feature -- Basic Operations

    attributes: INTEGER
            -- No description available.
        require
            attributes_user_precondition: attributes_user_precondition

    cur_dc: INTEGER
            -- No description available.
        require
            cur_dc_user_precondition: cur_dc_user_precondition

    h_pal: INTEGER
            -- No description available.
        require
            h_pal_user_precondition: h_pal_user_precondition

    handle: INTEGER
            -- No description available.
        require
            handle_user_precondition: handle_user_precondition

    height: INTEGER
            -- No description available.
        require
            height_user_precondition: height_user_precondition

    keep_original_format: BOOLEAN
            -- No description available.
        require
            keep_original_format_user_precondition: keep_original_format_user_precondition

    picture_changed
            -- No description available.
        require
            picture_changed_user_precondition: picture_changed_user_precondition

    render (hdc: INTEGER; x: INTEGER; y: INTEGER; cx: INTEGER; cy: INTEGER; x_src: INTEGER; y_src: INTEGER; cx_src: INTEGER; cy_src: INTEGER; prc_wbounds: POINTER)
            -- No description available.
            -- hdc [in].
            -- x [in].
            -- y [in].
            -- cx [in].
            -- cy [in].
            -- x_src [in].
            -- y_src [in].
            -- cx_src [in].
            -- cy_src [in].
            -- prc_wbounds [in].
        require
            render_user_precondition: render_user_precondition (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src, prc_wbounds)

    save_as_file (pstm: POINTER; f_save_mem_copy: BOOLEAN; pcb_size: INTEGER_REF)
            -- No description available.
            -- pstm [in].
            -- f_save_mem_copy [in].
            -- pcb_size [out].
        require
            non_void_pcb_size: pcb_size /= void
            save_as_file_user_precondition: save_as_file_user_precondition (pstm, f_save_mem_copy, pcb_size)

    select_picture (hdc_in: INTEGER; phdc_out: INTEGER_REF; phbmp_out: INTEGER_REF)
            -- No description available.
            -- hdc_in [in].
            -- phdc_out [out].
            -- phbmp_out [out].
        require
            non_void_phdc_out: phdc_out /= void
            non_void_phbmp_out: phbmp_out /= void
            select_picture_user_precondition: select_picture_user_precondition (hdc_in, phdc_out, phbmp_out)

    set_h_pal (phpal: INTEGER)
            -- No description available.
            -- phpal [in].
        require
            set_h_pal_user_precondition: set_h_pal_user_precondition (phpal)

    set_hdc (hdc: INTEGER)
            -- No description available.
            -- hdc [in].
        require
            set_hdc_user_precondition: set_hdc_user_precondition (hdc)

    set_keep_original_format (pfkeep: BOOLEAN)
            -- No description available.
            -- pfkeep [in].
        require
            set_keep_original_format_user_precondition: set_keep_original_format_user_precondition (pfkeep)

    type: INTEGER
            -- No description available.
        require
            type_user_precondition: type_user_precondition

    width: INTEGER
            -- No description available.
        require
            width_user_precondition: width_user_precondition

feature -- Status Report

    attributes_user_precondition: BOOLEAN
            -- User-defined preconditions for attributes.
            -- Redefine in descendants if needed.

    cur_dc_user_precondition: BOOLEAN
            -- User-defined preconditions for cur_dc.
            -- Redefine in descendants if needed.

    h_pal_user_precondition: BOOLEAN
            -- User-defined preconditions for h_pal.
            -- Redefine in descendants if needed.

    handle_user_precondition: BOOLEAN
            -- User-defined preconditions for handle.
            -- Redefine in descendants if needed.

    height_user_precondition: BOOLEAN
            -- User-defined preconditions for height.
            -- Redefine in descendants if needed.

    keep_original_format_user_precondition: BOOLEAN
            -- User-defined preconditions for keep_original_format.
            -- Redefine in descendants if needed.

    picture_changed_user_precondition: BOOLEAN
            -- User-defined preconditions for picture_changed.
            -- Redefine in descendants if needed.

    render_user_precondition (hdc: INTEGER; x: INTEGER; y: INTEGER; cx: INTEGER; cy: INTEGER; x_src: INTEGER; y_src: INTEGER; cx_src: INTEGER; cy_src: INTEGER; prc_wbounds: POINTER): BOOLEAN
            -- User-defined preconditions for render.
            -- Redefine in descendants if needed.

    save_as_file_user_precondition (pstm: POINTER; f_save_mem_copy: BOOLEAN; pcb_size: INTEGER_REF): BOOLEAN
            -- User-defined preconditions for save_as_file.
            -- Redefine in descendants if needed.

    select_picture_user_precondition (hdc_in: INTEGER; phdc_out: INTEGER_REF; phbmp_out: INTEGER_REF): BOOLEAN
            -- User-defined preconditions for select_picture.
            -- Redefine in descendants if needed.

    set_h_pal_user_precondition (phpal: INTEGER): BOOLEAN
            -- User-defined preconditions for set_h_pal.
            -- Redefine in descendants if needed.

    set_hdc_user_precondition (hdc: INTEGER): BOOLEAN
            -- User-defined preconditions for set_hdc.
            -- Redefine in descendants if needed.

    set_keep_original_format_user_precondition (pfkeep: BOOLEAN): BOOLEAN
            -- User-defined preconditions for set_keep_original_format.
            -- Redefine in descendants if needed.

    type_user_precondition: BOOLEAN
            -- User-defined preconditions for type.
            -- Redefine in descendants if needed.

    width_user_precondition: BOOLEAN
            -- User-defined preconditions for width.
            -- Redefine in descendants if needed.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class IPICTURE_INTERFACE


PICTURE_IMPL_PROXY Chart

class
    PICTURE_IMPL_PROXY

General
    cluster: com.Interfaces
    description: "Implemented `Picture' Interface."
    create: make_from_pointer, make_from_other

Ancestors
    ECOM_QUERIABLE
    PICTURE_INTERFACE

Queries
    exists: BOOLEAN
    h_pal: INTEGER
    h_pal_user_precondition: BOOLEAN
    handle: INTEGER
    handle_user_precondition: BOOLEAN
    height: INTEGER
    height_user_precondition: BOOLEAN
    item: POINTER
    last_error_code: INTEGER
    last_error_description: STRING
    last_error_help_file: STRING
    last_source_of_exception: STRING
    render_user_precondition (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src: INTEGER; prc_wbounds: POINTER): BOOLEAN
    set_h_pal_user_precondition (a_value: INTEGER): BOOLEAN
    type: INTEGER
    type_user_precondition: BOOLEAN
    width: INTEGER
    width_user_precondition: BOOLEAN

Commands
    render (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src: INTEGER; prc_wbounds: POINTER)
    set_h_pal (a_value: INTEGER)


PICTURE_IMPL_PROXY Flat contracts

indexing
    description: "Implemented `Picture' Interface."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    PICTURE_IMPL_PROXY

create

    make_from_other (other: ECOM_INTERFACE)
            -- Make from other Queriable.
            -- (from ECOM_QUERIABLE)
        require -- from ECOM_QUERIABLE
            non_void_other: other /= void
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

    make_from_pointer (cpp_obj: POINTER)
            -- Make from pointer
        require -- from ECOM_QUERIABLE
            non_default_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_QUERIABLE
            valid_initializer: initializer /= default_pointer
            exists: exists

feature -- Access

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_QUERIABLE)

    h_pal: INTEGER
            -- No description available.
        require -- from PICTURE_INTERFACE
            h_pal_user_precondition: h_pal_user_precondition

    handle: INTEGER
            -- No description available.
        require -- from PICTURE_INTERFACE
            handle_user_precondition: handle_user_precondition

    height: INTEGER
            -- No description available.
        require -- from PICTURE_INTERFACE
            height_user_precondition: height_user_precondition

    item: POINTER
            -- Pointer to COM object wrapper.
            -- (from ECOM_QUERIABLE)

    type: INTEGER
            -- No description available.
        require -- from PICTURE_INTERFACE
            type_user_precondition: type_user_precondition

    width: INTEGER
            -- No description available.
        require -- from PICTURE_INTERFACE
            width_user_precondition: width_user_precondition

feature -- Basic Operations

    render (hdc: INTEGER; x: INTEGER; y: INTEGER; cx: INTEGER; cy: INTEGER; x_src: INTEGER; y_src: INTEGER; cx_src: INTEGER; cy_src: INTEGER; prc_wbounds: POINTER)
            -- No description available.
            -- hdc [out].
            -- x [out].
            -- y [out].
            -- cx [out].
            -- cy [out].
            -- x_src [out].
            -- y_src [out].
            -- cx_src [out].
            -- cy_src [out].
            -- prc_wbounds [out].
        require -- from PICTURE_INTERFACE
            render_user_precondition: render_user_precondition (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src, prc_wbounds)

feature -- Element Change

    set_h_pal (a_value: INTEGER)
            -- Set h_pal with a_value.
        require -- from PICTURE_INTERFACE
            set_h_pal_user_precondition: set_h_pal_user_precondition (a_value)

feature -- Status Report

    h_pal_user_precondition: BOOLEAN
            -- User-defined preconditions for h_pal.
            -- Redefine in descendants if needed.
            -- (from PICTURE_INTERFACE)

    handle_user_precondition: BOOLEAN
            -- User-defined preconditions for handle.
            -- Redefine in descendants if needed.
            -- (from PICTURE_INTERFACE)

    height_user_precondition: BOOLEAN
            -- User-defined preconditions for height.
            -- Redefine in descendants if needed.
            -- (from PICTURE_INTERFACE)

    last_error_code: INTEGER
            -- Last error code.

    last_error_description: STRING
            -- Last error description.

    last_error_help_file: STRING
            -- Last error help file.

    last_source_of_exception: STRING
            -- Last source of exception.

    render_user_precondition (hdc: INTEGER; x: INTEGER; y: INTEGER; cx: INTEGER; cy: INTEGER; x_src: INTEGER; y_src: INTEGER; cx_src: INTEGER; cy_src: INTEGER; prc_wbounds: POINTER): BOOLEAN
            -- User-defined preconditions for render.
            -- Redefine in descendants if needed.
            -- (from PICTURE_INTERFACE)

    set_h_pal_user_precondition (a_value: INTEGER): BOOLEAN
            -- User-defined preconditions for set_h_pal.
            -- Redefine in descendants if needed.
            -- (from PICTURE_INTERFACE)

    type_user_precondition: BOOLEAN
            -- User-defined preconditions for type.
            -- Redefine in descendants if needed.
            -- (from PICTURE_INTERFACE)

    width_user_precondition: BOOLEAN
            -- User-defined preconditions for width.
            -- Redefine in descendants if needed.
            -- (from PICTURE_INTERFACE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_QUERIABLE
    queriable_invariant: initializer /= default_pointer and then exists

end -- class PICTURE_IMPL_PROXY


PICTURE_INTERFACE Chart

deferred class
    PICTURE_INTERFACE

General
    cluster: com.Interfaces
    description: "OLE Automation."

Ancestors
    ECOM_INTERFACE

Queries
    h_pal: INTEGER
    h_pal_user_precondition: BOOLEAN
    handle: INTEGER
    handle_user_precondition: BOOLEAN
    height: INTEGER
    height_user_precondition: BOOLEAN
    item: POINTER
    render_user_precondition (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src: INTEGER; prc_wbounds: POINTER): BOOLEAN
    set_h_pal_user_precondition (a_value: INTEGER): BOOLEAN
    type: INTEGER
    type_user_precondition: BOOLEAN
    width: INTEGER
    width_user_precondition: BOOLEAN

Commands
    render (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src: INTEGER; prc_wbounds: POINTER)
    set_h_pal (a_value: INTEGER)


PICTURE_INTERFACE Flat contracts

indexing
    description: "OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

deferred class interface
    PICTURE_INTERFACE

feature -- Access

    h_pal: INTEGER
            -- No description available.
        require
            h_pal_user_precondition: h_pal_user_precondition

    handle: INTEGER
            -- No description available.
        require
            handle_user_precondition: handle_user_precondition

    height: INTEGER
            -- No description available.
        require
            height_user_precondition: height_user_precondition

    item: POINTER
            -- Pointer to COM interface.
            -- (from ECOM_INTERFACE)

    type: INTEGER
            -- No description available.
        require
            type_user_precondition: type_user_precondition

    width: INTEGER
            -- No description available.
        require
            width_user_precondition: width_user_precondition

feature -- Basic Operations

    render (hdc: INTEGER; x: INTEGER; y: INTEGER; cx: INTEGER; cy: INTEGER; x_src: INTEGER; y_src: INTEGER; cx_src: INTEGER; cy_src: INTEGER; prc_wbounds: POINTER)
            -- No description available.
            -- hdc [out].
            -- x [out].
            -- y [out].
            -- cx [out].
            -- cy [out].
            -- x_src [out].
            -- y_src [out].
            -- cx_src [out].
            -- cy_src [out].
            -- prc_wbounds [out].
        require
            render_user_precondition: render_user_precondition (hdc, x, y, cx, cy, x_src, y_src, cx_src, cy_src, prc_wbounds)

feature -- Element Change

    set_h_pal (a_value: INTEGER)
            -- Set 'h_pal' with 'an_item'
        require
            set_h_pal_user_precondition: set_h_pal_user_precondition (a_value)

feature -- Status Report

    h_pal_user_precondition: BOOLEAN
            -- User-defined preconditions for h_pal.
            -- Redefine in descendants if needed.

    handle_user_precondition: BOOLEAN
            -- User-defined preconditions for handle.
            -- Redefine in descendants if needed.

    height_user_precondition: BOOLEAN
            -- User-defined preconditions for height.
            -- Redefine in descendants if needed.

    render_user_precondition (hdc: INTEGER; x: INTEGER; y: INTEGER; cx: INTEGER; cy: INTEGER; x_src: INTEGER; y_src: INTEGER; cx_src: INTEGER; cy_src: INTEGER; prc_wbounds: POINTER): BOOLEAN
            -- User-defined preconditions for render.
            -- Redefine in descendants if needed.

    set_h_pal_user_precondition (a_value: INTEGER): BOOLEAN
            -- User-defined preconditions for set_h_pal.
            -- Redefine in descendants if needed.

    type_user_precondition: BOOLEAN
            -- User-defined preconditions for type.
            -- Redefine in descendants if needed.

    width_user_precondition: BOOLEAN
            -- User-defined preconditions for width.
            -- Redefine in descendants if needed.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class PICTURE_INTERFACE


cluster com.Structures

Cluster
    com.Structures

Supercluster
    com

Classes
    ECOM_ARRAY [G]
    ECOM_CURRENCY
    ECOM_DECIMAL
    ECOM_DISP_PARAMS
    ECOM_EXCEP_INFO
    ECOM_EXCEPTION
    ECOM_GUID
    ECOM_HRESULT
    ECOM_LARGE_INTEGER
    ECOM_STATSTG
    ECOM_STRUCTURE
    ECOM_ULARGE_INTEGER
    ECOM_VARIANT
    ECOM_WIDE_STRING
    FONTNAME_ALIAS
    FONTSIZE_ALIAS
    HRESULT_FORMATTER


ECOM_ARRAY Chart

class
    ECOM_ARRAY [G]

General
    cluster: com.Structures
    description: "Multi-dimensional array"
    create: make_from_array, make_empty, make

Ancestors
    ANY
    ARRAY [G]

Queries
    are_element_counts_consistent: BOOLEAN
    are_element_counts_valid (some_element_counts: ARRAY [INTEGER]): BOOLEAN
    are_indices_large_enough (some_indices: ARRAY [INTEGER]): BOOLEAN
    are_indices_valid (some_indices: ARRAY [INTEGER]): BOOLEAN
    area: SPECIAL [G]
    array_item (i: INTEGER): G
    count: INTEGER
    dimension_count: INTEGER
    element_counts: ARRAY [INTEGER]
    is_equal (other: [like Current] ECOM_ARRAY [G]): BOOLEAN
    item (some_indices: ARRAY [INTEGER]): G
    lower_indices: ARRAY [INTEGER]
    total_count (some_element_counts: ARRAY [INTEGER]): INTEGER
    upper_indices: ARRAY [INTEGER]

Commands
    copy (other: [like Current] ECOM_ARRAY [G])
    discard_items
    force (v: [like item] G; some_indices: ARRAY [INTEGER])
    initialize (v: G)
    put (v: [like item] G; some_indices: ARRAY [INTEGER])
    resize (n_upper_indices: ARRAY [INTEGER])

Constraints
    consistent upper indices
    consistent lower indices
    consistent element counts
    consistent size
    non negative count


ECOM_ARRAY Flat contracts

indexing
    description: "Multi-dimensional array"
    status: "See notice at end of class"
    representation: array
    access: multi_dimensional_index
    size: resizable
    contents: generic
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_ARRAY [G]

create

    make (a_dimension_count: INTEGER; some_lower_indices, some_element_counts: ARRAY [INTEGER])
            -- Create a_dimensional_count dimensional array
            -- with lower indices in each dimension as described by some_lower_indices
            -- and element count in each dimension as described by some_element_counts.
        require
            valid_dimension_count: a_dimension_count >= 0
            valid_lower_indices: some_lower_indices /= void and then some_lower_indices.count = a_dimension_count and (a_dimension_count > 0 implies some_lower_indices.lower = 1)
            valid_element_count: some_element_counts /= void and then some_element_counts.count = a_dimension_count and (a_dimension_count > 0 implies some_element_counts.lower = 1) and then are_element_counts_valid (some_element_counts)
        ensure
            valid_dimension_count: dimension_count >= 0
            valid_element_counts: element_counts /= void and then element_counts.count = dimension_count
            valid_lower_indices: lower_indices /= void and then lower_indices.count = dimension_count
            valid_upper_indices: upper_indices /= void and then upper_indices.count = dimension_count

    make_from_array (a: ARRAY [G]; a_dimension_count: INTEGER; some_lower_indices, some_element_counts: ARRAY [INTEGER])
            -- Create a_dimensional_count dimensional array
            -- with lower indices in each dimension as described by some_lower_indices
            -- and element count in each dimension as described by some_element_counts.
        require
            valid_dimension_count: a_dimension_count >= 0
            valid_lower_indices: some_lower_indices /= void and then some_lower_indices.count = a_dimension_count and (a_dimension_count > 0 implies some_lower_indices.lower = 1)
            valid_element_count: some_element_counts /= void and then some_element_counts.count = a_dimension_count and (a_dimension_count > 0 implies some_element_counts.lower = 1) and then are_element_counts_valid (some_element_counts)
            valid_array_size: a.count >= total_count (some_element_counts)
        ensure
            valid_dimension_count: dimension_count >= 0
            valid_element_counts: element_counts /= void and then element_counts.count = dimension_count
            valid_lower_indices: lower_indices /= void and then lower_indices.count = dimension_count
            valid_upper_indices: upper_indices /= void and then upper_indices.count = dimension_count

    make_empty
            -- Create empty array.

feature -- Initialization

    initialize (v: G)
            -- Make each entry have value v

feature -- Access

    item (some_indices: ARRAY [INTEGER]): G
            -- Entry at some_indices
        require
            valid_indices: are_indices_valid (some_indices)

feature  -- Access

    area: SPECIAL [G]
            -- Special data zone
            -- (from TO_SPECIAL)

    array_item (i: INTEGER): G
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    dimension_count: INTEGER
            -- Number of dimensions

    element_counts: ARRAY [INTEGER]
            -- Element count in each dimension

    lower_indices: ARRAY [INTEGER]
            -- Lower indedeces in each dimension

    upper_indices: ARRAY [INTEGER]
            -- Upper indices in each dimension

feature  -- Measurement

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    are_element_counts_consistent: BOOLEAN
            -- Are element_counts consistent?

    are_element_counts_valid (some_element_counts: ARRAY [INTEGER]): BOOLEAN
            -- Are some_element_counts valid element counts?
        require
            non_void_element_counts: some_element_counts /= void
            valid_element_counts: (some_element_counts.count > 0 implies some_element_counts.lower = 1)

    are_indices_large_enough (some_indices: ARRAY [INTEGER]): BOOLEAN
            -- Are some_indices large enough?

    are_indices_valid (some_indices: ARRAY [INTEGER]): BOOLEAN
            -- Are some_indices valid indices?

    total_count (some_element_counts: ARRAY [INTEGER]): INTEGER
            -- Total number of elements
        require
            valid_counts: are_element_counts_valid (some_element_counts)
        ensure
            valid_count: Result >= 0

feature -- Element change

    force (v: like item; some_indices: ARRAY [INTEGER])
            -- Assign item v at indices some_indices.
            -- Resize if necesary.
        require
            valid_indices: are_indices_large_enough (some_indices)
        ensure
            element_inserted: item (some_indices) = v

    put (v: like item; some_indices: ARRAY [INTEGER])
            -- Assign item v at indices some_indices.
        require
            valid_indices: are_indices_valid (some_indices)
        ensure
            element_inserted: item (some_indices) = v

feature -- Removal

    discard_items
            -- Remove all elements
        ensure -- from ARRAY
            default_items: all_default

feature -- Resizing

    resize (n_upper_indices: ARRAY [INTEGER])
            -- Rearrange array so that it can accommodate n_upper_indices
            -- without losing any previously entered items
            -- or changing their indices;
            -- do nothing if possible.
        require
            are_indices_large_enough (n_upper_indices)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

invariant

    consistent_upper_indices: upper_indices.count = dimension_count
    consistent_lower_indices: lower_indices.count = dimension_count
    consistent_element_counts: are_element_counts_consistent
    consistent_size: capacity = total_count (element_counts)
    non_negative_count: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class ECOM_ARRAY


ECOM_CURRENCY Chart

class
    ECOM_CURRENCY

General
    cluster: com.Structures
    description: "COM Currency Structure"
    create: make_from_decimal, make_from_pointer, make

Ancestors
    ECOM_STRUCTURE
    NUMERIC

Queries
    infix "-" (other: ECOM_CURRENCY): ECOM_CURRENCY
    infix "+" (other: ECOM_CURRENCY): ECOM_CURRENCY
    infix "^" (other: NUMERIC): NUMERIC
    infix "/" (other: ECOM_CURRENCY): ECOM_CURRENCY
    infix "*" (other: ECOM_CURRENCY): ECOM_CURRENCY
    prefix "-": ECOM_CURRENCY
    prefix "+": ECOM_CURRENCY
    absolute: ECOM_CURRENCY
    ceiled_integer_portion: ECOM_CURRENCY
    divisible (other: ECOM_CURRENCY): BOOLEAN
    exists: BOOLEAN
    exponentiable (other: ECOM_CURRENCY): BOOLEAN
    high_bits: INTEGER
    is_equal (other: [like Current] ECOM_CURRENCY): BOOLEAN
    item: POINTER
    low_bits: INTEGER
    multiply_integer (an_integer: INTEGER): ECOM_CURRENCY
    one: ECOM_CURRENCY
    rounded (value: INTEGER): ECOM_CURRENCY
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER
    truncated_to_double: DOUBLE
    truncated_to_integer_portion: ECOM_CURRENCY
    zero: ECOM_CURRENCY

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make
    make_from_decimal (dec_value: ECOM_DECIMAL)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_high_bits (an_integer: INTEGER)
    set_low_bits (an_integer: INTEGER)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_CURRENCY)


ECOM_CURRENCY Flat contracts

indexing
    description: "COM Currency Structure"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_CURRENCY

create

    make

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

    make_from_decimal (dec_value: ECOM_DECIMAL)
            -- Create with value 'dec_value'

feature -- Initialization

    make

    make_from_decimal (dec_value: ECOM_DECIMAL)
            -- Create with value 'dec_value'

feature -- Access

    high_bits: INTEGER
            -- High 32 bits of currency.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    low_bits: INTEGER
            -- Low 32 bits of currency.

    one: ECOM_CURRENCY
            -- Neutral element for * operation
        ensure -- from NUMERIC
            result_exists: Result /= void

    zero: ECOM_CURRENCY
            -- Neutral element for + operation
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size of CY (CURRENCY) structure.
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    absolute: ECOM_CURRENCY
            -- Absolute value of currency
        ensure
            valid_result: Result /= void

    ceiled_integer_portion: ECOM_CURRENCY
            -- Integer portion of currency value. The first negative
            -- integer >= to the value is returned if the value is negative.
        ensure
            valid_result: Result /= void

    rounded (value: INTEGER): ECOM_CURRENCY
            -- Round value with value decimal places
        require
            valid_value: value >= 0
        ensure
            valid_result: Result /= void

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

    truncated_to_double: DOUBLE
            -- Truncated to DOUBLE
        require
            valid_item: item /= default_pointer

    truncated_to_integer_portion: ECOM_CURRENCY
            -- Integer portion of a currency value. The first negative integer
            -- <= to the value is returned if the value is negative.
        ensure
            valid_result: Result /= void

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    multiply_integer (an_integer: INTEGER): ECOM_CURRENCY
            -- Multiply by an_integer
        ensure
            valid_result: Result /= void

    infix "*" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Multiply by other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Add with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "+": ECOM_CURRENCY
            -- Unary plus
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Subtract with other
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "-": ECOM_CURRENCY
            -- Negative value of currency
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Division by 'other'
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): NUMERIC
            -- Current objects to the power 'other'

feature -- Basic Operations

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

feature -- Element Change

    set_high_bits (an_integer: INTEGER)
            -- Set high_bits with an_integer.
        ensure
            high_bits_set: high_bits = an_integer

    set_low_bits (an_integer: INTEGER)
            -- Set 'low_bits' with 'an_integer'.
        ensure
            low_bits_set: low_bits = an_integer

feature -- status report

    divisible (other: ECOM_CURRENCY): BOOLEAN
            -- Is divisible by other?
        require -- from NUMERIC
            other_exists: other /= void

    exponentiable (other: ECOM_CURRENCY): BOOLEAN
            -- Is exponentiable by other?
        require -- from NUMERIC
            other_exists: other /= void

    is_equal (other: like Current): BOOLEAN
            -- Is 'other' the same as Current object?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_CURRENCY


ECOM_DECIMAL Chart

class
    ECOM_DECIMAL

General
    cluster: com.Structures
    description: "COM Decimal Structure.  Wrapping COM DECIMAL type"
    create: make_from_double, make_from_pointer, make

Ancestors
    ECOM_STRUCTURE
    NUMERIC

Queries
    infix "-" (other: ECOM_DECIMAL): ECOM_DECIMAL
    infix "+" (other: ECOM_DECIMAL): ECOM_DECIMAL
    infix "^" (other: NUMERIC): NUMERIC
    infix "/" (other: ECOM_DECIMAL): ECOM_DECIMAL
    infix "*" (other: ECOM_DECIMAL): ECOM_DECIMAL
    prefix "-": ECOM_DECIMAL
    prefix "+": ECOM_DECIMAL
    absolute: ECOM_DECIMAL
    ceiled_integer_portion: ECOM_DECIMAL
    divisible (other: ECOM_DECIMAL): BOOLEAN
    exists: BOOLEAN
    exponentiable (other: ECOM_DECIMAL): BOOLEAN
    is_equal (other: [like Current] ECOM_DECIMAL): BOOLEAN
    item: POINTER
    one: ECOM_DECIMAL
    rounded (value: INTEGER): ECOM_DECIMAL
    scale: INTEGER
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER
    truncated_to_double: DOUBLE
    truncated_to_integer_portion: ECOM_DECIMAL
    zero: ECOM_DECIMAL

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make
    make_from_double (dbl_value: DOUBLE)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_DECIMAL)


ECOM_DECIMAL Flat contracts

indexing
    description: "COM Decimal Structure.  Wrapping COM DECIMAL type"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_DECIMAL

create

    make

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

    make_from_double (dbl_value: DOUBLE)
            -- Create with value 'dbl_value'

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    one: ECOM_DECIMAL
            -- Neutral element for * operation
        ensure -- from NUMERIC
            result_exists: Result /= void

    scale: INTEGER
            -- Scale of value.  e.g. 123.45 has a scale of 2
        require
            non_void_item: item /= void
            valid_item: item /= default_pointer

    zero: ECOM_DECIMAL
            -- Neutral element for + operation
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size of DECIMAL (DECIMAL) structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    absolute: ECOM_DECIMAL
            -- Absolute value of decimal
        require
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure
            non_void_result: Result /= void

    ceiled_integer_portion: ECOM_DECIMAL
            -- Integer portion of decimal value.
            -- The first negative integer >= to the value is returned if the value is negative.
        require
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure
            non_void_result: Result /= void

    rounded (value: INTEGER): ECOM_DECIMAL
            -- Round value with value decimal places
        require
            valid_value: value >= 0
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure
            non_void_result: Result /= void

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

    truncated_to_double: DOUBLE
            -- Double value

    truncated_to_integer_portion: ECOM_DECIMAL
            -- Integer portion of a decimal value. The first negative integer
            -- <= to the value is returned if the value is negative.
        require
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure
            valid_result: Result /= void

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    infix "*" (other: ECOM_DECIMAL): ECOM_DECIMAL
            -- Multiply by other
        require -- from NUMERIC
            other_exists: other /= void
        require else
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "+": ECOM_DECIMAL
            -- Unary plus
        require -- from  NUMERIC
            True
        require else
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: ECOM_DECIMAL): ECOM_DECIMAL
            -- Add with other
        require -- from NUMERIC
            other_exists: other /= void
        require else
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    infix "-" (other: ECOM_DECIMAL): ECOM_DECIMAL
            -- Subtract with other
        require -- from NUMERIC
            other_exists: other /= void
        require else
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "-": ECOM_DECIMAL
            -- Negative value of decimal
        require -- from  NUMERIC
            True
        require else
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: ECOM_DECIMAL): ECOM_DECIMAL
            -- Multiply by other
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        require else
            non_void_item: item /= void
            valid_item: item /= default_pointer
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): NUMERIC
            -- Current objects to the power 'other'
        require else
            non_void_item: item /= void
            valid_item: item /= default_pointer

feature -- Basic Operations

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

feature -- Initialiazation

    make

    make_from_double (dbl_value: DOUBLE)
            -- Create with value 'dbl_value'

feature -- status report

    divisible (other: ECOM_DECIMAL): BOOLEAN
            -- Is divisible by other?
        require -- from NUMERIC
            other_exists: other /= void

    exponentiable (other: ECOM_DECIMAL): BOOLEAN
            -- Is exponentiable by other?
        require -- from NUMERIC
            other_exists: other /= void

    is_equal (other: like Current): BOOLEAN
            -- Is 'other' equal to Current object?
            -- Not implemented yet.
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_DECIMAL


ECOM_DISP_PARAMS Chart

class
    ECOM_DISP_PARAMS

General
    cluster: com.Structures
    description: "Encapsulation of DISPPARAMS structure"
    create: make_from_pointer, make

Ancestors
    ECOM_STRUCTURE

Queries
    c_args: INTEGER
    c_named_args: INTEGER
    exists: BOOLEAN
    item: POINTER
    rgdispid_named_args: INTEGER_REF
    rgvarg: ECOM_VARIANT
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_c_args (a_c_args: INTEGER)
    set_c_named_args (a_c_named_args: INTEGER)
    set_rgdispid_named_args (a_rgdispid_named_args: INTEGER_REF)
    set_rgvarg (a_rgvarg: ECOM_VARIANT)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_DISP_PARAMS)


ECOM_DISP_PARAMS Flat contracts

indexing
    description: "Encapsulation of DISPPARAMS structure"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_DISP_PARAMS

create

    make
            -- Allocate item
            -- (from ECOM_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

feature -- Access

    c_args: INTEGER
            -- No description available.

    c_named_args: INTEGER
            -- No description available.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    rgdispid_named_args: INTEGER_REF
            -- No description available.
        ensure
            non_void_rgdispid_named_args: Result /= void

    rgvarg: ECOM_VARIANT
            -- No description available.

feature -- Measurement

    structure_size: INTEGER
            -- Size of DISPPARAMS structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    set_c_args (a_c_args: INTEGER)
            -- Set c_args with a_c_args.

    set_c_named_args (a_c_named_args: INTEGER)
            -- Set c_named_args with a_c_named_args.

    set_rgdispid_named_args (a_rgdispid_named_args: INTEGER_REF)
            -- Set rgdispid_named_args with a_rgdispid_named_args.
        require
            non_void_a_rgdispid_named_args: a_rgdispid_named_args /= void

    set_rgvarg (a_rgvarg: ECOM_VARIANT)
            -- Set rgvarg with a_rgvarg.
        require
            non_void_a_rgvarg: a_rgvarg /= void
            valid_a_rgvarg: a_rgvarg.item /= default_pointer

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_DISP_PARAMS


ECOM_EXCEPTION Chart

class
    ECOM_EXCEPTION

General
    cluster: com.Structures
    description: "EiffelCOM exception"

Ancestors
    ECOM_EXCEPTION_CODES
    EXCEPTIONS
    HRESULT_FORMATTER

Queries
    assertion_violation: BOOLEAN
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    hresult: INTEGER
    hresult_code: INTEGER
    hresult_facility: INTEGER
    hresult_message: STRING
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    Postcondition: INTEGER
    Precondition: INTEGER
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    tag_name: STRING
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Commands
    catch (code: INTEGER)
    die (code: INTEGER)
    ignore (code: INTEGER)
    message_on_failure
    no_message_on_failure
    raise (name: STRING)
    trigger (code: INTEGER)


ECOM_EXCEPTION Flat contracts

indexing
    description: "EiffelCOM exception"
    status: "See notice at end of class."
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_EXCEPTION

feature --  Access

    hresult: INTEGER
            -- Original HRESULT.
        require
            applicable: is_developer_exception

    hresult_code: INTEGER
            -- Status code.
        require
            applicable: is_developer_exception

    hresult_facility: INTEGER
            -- Facility code.
        require
            applicable: is_developer_exception

    hresult_message: STRING
            -- Error message.
        require
            applicable: is_developer_exception
        ensure
            non_void_message: Result /= void

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

feature -- Element Change

    trigger (code: INTEGER)
            -- Raise exception with code code.
            -- See class ECOM_EXCEPTION_CODES for possible values.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_EXCEPTION


ECOM_EXCEP_INFO Chart

class
    ECOM_EXCEP_INFO

General
    cluster: com.Structures
    description: "Encapsulation of EXEPTINFO structure"
    create: make_from_pointer, make

Ancestors
    ECOM_STRUCTURE

Queries
    bstr_description: STRING
    bstr_help_file: STRING
    bstr_source: STRING
    dw_help_context: INTEGER
    exists: BOOLEAN
    item: POINTER
    pv_reserved: POINTER
    scode: ECOM_HRESULT
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER
    w_code: INTEGER
    w_reserved: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bstr_description (a_bstr_description: STRING)
    set_bstr_help_file (a_bstr_help_file: STRING)
    set_bstr_source (a_bstr_source: STRING)
    set_dw_help_context (a_dw_help_context: INTEGER)
    set_pv_reserved (a_pv_reserved: POINTER)
    set_scode (a_scode: ECOM_HRESULT)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_EXCEP_INFO)
    set_w_code (a_w_code: INTEGER)
    set_w_reserved (a_w_reserved: INTEGER)


ECOM_EXCEP_INFO Flat contracts

indexing
    description: "Encapsulation of EXEPTINFO structure"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_EXCEP_INFO

create

    make
            -- Allocate item
            -- (from ECOM_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

feature -- Access

    bstr_description: STRING
            -- No description available.
        ensure
            non_void_bstr_description: Result /= void

    bstr_help_file: STRING
            -- No description available.
        ensure
            non_void_bstr_help_file: Result /= void

    bstr_source: STRING
            -- No description available.
        ensure
            non_void_bstr_source: Result /= void

    dw_help_context: INTEGER
            -- No description available.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    pv_reserved: POINTER
            -- No description available.

    scode: ECOM_HRESULT
            -- No description available.
        ensure
            non_void_scode: Result /= void

    w_code: INTEGER
            -- No description available.

    w_reserved: INTEGER
            -- No description available.

feature -- Measurement

    structure_size: INTEGER
            -- Size of EXCEPINFO structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    set_bstr_description (a_bstr_description: STRING)
            -- Set bstr_description with a_bstr_description.

    set_bstr_help_file (a_bstr_help_file: STRING)
            -- Set bstr_help_file with a_bstr_help_file.

    set_bstr_source (a_bstr_source: STRING)
            -- Set bstr_source with a_bstr_source.

    set_dw_help_context (a_dw_help_context: INTEGER)
            -- Set dw_help_context with a_dw_help_context.

    set_pv_reserved (a_pv_reserved: POINTER)
            -- Set pv_reserved with a_pv_reserved.

    set_scode (a_scode: ECOM_HRESULT)
            -- Set scode with a_scode.
        require
            non_void_a_scode: a_scode /= void

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

    set_w_code (a_w_code: INTEGER)
            -- Set w_code with a_w_code.

    set_w_reserved (a_w_reserved: INTEGER)
            -- Set w_reserved with a_w_reserved.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_EXCEP_INFO


ECOM_GUID Chart

class
    ECOM_GUID

General
    cluster: com.Structures
    description: "COM GUID structure"
    create: make_from_guid, make_from_pointer, make_from_string, make

Ancestors
    ECOM_ROUTINES
    ECOM_STRUCTURE

Queries
    exists: BOOLEAN
    Guid_routines: ECOM_GUID_ROUTINES
    is_equal (a_guid: ECOM_GUID): BOOLEAN
    item: POINTER
    out: STRING
    shared: BOOLEAN
    structure_size: INTEGER
    to_definition_string: STRING
    to_integer: INTEGER
    to_string: STRING

Commands
    dispose
    generate
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_GUID)


ECOM_GUID Flat contracts

indexing
    description: "COM GUID structure"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_GUID

create

    make
            -- Allocate item
            -- (from ECOM_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

    make_from_string (string: STRING)
            -- Create GUID from string string.
        require
            non_void_string: string /= void
            valid_guid_string: guid_routines.is_valid_guid_string (string)
        ensure
            valid_item: item /= default_pointer

    make_from_guid (other: ECOM_GUID)
            -- Create new structure with same GUID as other.
        require
            valid_guid: other /= void and then other.item /= default_pointer
        ensure
            valid_item: item /= default_pointer

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Access
--	com_api: ECOM_COM is
--		once
--			create Result
--		end

    guid_routines: ECOM_GUID_ROUTINES
            -- (from ECOM_ROUTINES)

feature -- Measurement

    structure_size: INTEGER
            -- Size of GUID structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    out: STRING
            -- String representation

    to_definition_string: STRING
            -- String representation needed for code generation.
        require
            valid_item: item /= default_pointer
        ensure
            non_void_representation: Result /= void

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

    to_string: STRING
            -- String representation
        require
            valid_item: item /= default_pointer
        ensure
            non_void_representation: Result /= void

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

feature -- Basic operation

    generate
            -- Generate a new GUID

feature -- Status Report

    is_equal (a_guid: ECOM_GUID): BOOLEAN
            -- Is a_guid equal to Current?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_GUID


ECOM_HRESULT Chart

class
    ECOM_HRESULT

General
    cluster: com.Structures
    description: "ECOM_HRESULT"
    create: make_from_integer, make

Ancestors
    HRESULT_FORMATTER

Queries
    error_code: INTEGER
    facility_code: INTEGER
    item: INTEGER
    message: STRING
    severity_bit: INTEGER
    succeeded: BOOLEAN

Commands
    make
    make_from_integer (an_integer: INTEGER)
    set_error_code (a_code: [like error_code] INTEGER)
    set_facility_code (a_code: [like facility_code] INTEGER)
    set_failed
    set_item (an_item: [like item] INTEGER)
    set_succeeded

Constraints
    valid severity value


ECOM_HRESULT Flat contracts

indexing
    description: "ECOM_HRESULT"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_HRESULT

create

    make
            -- Set 'severity_bit' to 1.

    make_from_integer (an_integer: INTEGER)
            -- Initialize hresult according to 'an_integer'.

feature -- Initialization

    make
            -- Set 'severity_bit' to 1.

    make_from_integer (an_integer: INTEGER)
            -- Initialize hresult according to 'an_integer'.

feature -- Access

    error_code: INTEGER
            -- Error code

    facility_code: INTEGER
            -- Facility code

    item: INTEGER
            -- HRESULT

    message: STRING
            -- Human-readable string.
        ensure
            non_void_message: Result /= void

    severity_bit: INTEGER
            -- Severity bit

feature -- Status report

    succeeded: BOOLEAN
            -- Does hresult correspond to success?

feature -- Element change

    set_error_code (a_code: like error_code)
            -- Set error code
        require
            valid_error_code: a_code >= 0
        ensure
            facility_code_set: error_code = a_code

    set_facility_code (a_code: like facility_code)
            -- Set facility code
        require
            valid_facility_code: a_code >= 0
        ensure
            facility_code_set: facility_code = a_code

    set_failed
            -- Set severity bit to indicate failure

    set_item (an_item: like item)
            -- Set value of item to 'an_item'
        ensure
            item_set: item = an_item

    set_succeeded
            -- Set severity bit to indicate succeeded

invariant

    valid_severity_value: severity_bit = 0 or severity_bit = 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_HRESULT


ECOM_LARGE_INTEGER Chart

class
    ECOM_LARGE_INTEGER

General
    cluster: com.Structures
    description: "COM LARGE_INTEGER 64-bit integer"
    create: make_from_pointer, make_from_integer, make

Ancestors
    ECOM_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    quad_part: INTEGER_64
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_quad_part (a_quad_part: INTEGER_64)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_LARGE_INTEGER)


ECOM_LARGE_INTEGER Flat contracts

indexing
    description: "COM LARGE_INTEGER 64-bit integer"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_LARGE_INTEGER

create

    make
            -- Make.
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

    make_from_integer (integer: INTEGER)
            -- Creation routine
        ensure
            exists

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    quad_part: INTEGER_64
            -- QuadPart field.

feature -- Measurement

    structure_size: INTEGER
            -- Size of structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    set_quad_part (a_quad_part: INTEGER_64)
            -- Set quad_part with a_quad_part.

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_LARGE_INTEGER


ECOM_STATSTG Chart

class
    ECOM_STATSTG

General
    cluster: com.Structures
    description: "Encapsulation of STATSTG structure"
    create: make_from_pointer

Ancestors
    ECOM_LOCK_TYPES
    ECOM_STGM
    ECOM_STGTY
    ECOM_WRAPPER

Queries
    access_time: WEL_FILE_TIME
    clsid: POINTER
    creation_time: WEL_FILE_TIME
    exists: BOOLEAN
    is_same_name (other_name: STRING): BOOLEAN
    item: POINTER
    locks_supported: INTEGER
    mode: INTEGER
    modification_time: WEL_FILE_TIME
    name: STRING
    size: ECOM_ULARGE_INTEGER
    type: INTEGER

Commands
    make_from_pointer (a_pointer: POINTER)


ECOM_STATSTG Flat contracts

indexing
    description: "Encapsulation of STATSTG structure"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_STATSTG

create

    make_from_pointer (a_pointer: POINTER)
            -- Initialize
            -- (from ECOM_WRAPPER)
        require -- from ECOM_WRAPPER
            valid_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_WRAPPER
            wrapper_exist: initializer /= default_pointer and then exists
            valid_item: item = a_pointer

feature -- Initialization

    make_from_pointer (a_pointer: POINTER)
            -- Initialize
            -- (from ECOM_WRAPPER)
        require -- from ECOM_WRAPPER
            valid_pointer: a_pointer /= default_pointer
        ensure -- from ECOM_WRAPPER
            wrapper_exist: initializer /= default_pointer and then exists
            valid_item: item = a_pointer

feature -- Access

    access_time: WEL_FILE_TIME
            -- Last access time
        ensure
            Result /= void

    clsid: POINTER
            -- Class identifier for storage object;
            -- set to CLSID_NULL for new storage objects. This member
            -- is not used for streams or byte arrays.

    creation_time: WEL_FILE_TIME
            -- Creation time
        ensure
            Result /= void

    exists: BOOLEAN
            -- Is wrapped structure initialized?
            -- (from ECOM_WRAPPER)

    is_same_name (other_name: STRING): BOOLEAN
        require
            valid_other_name: other_name /= void

    item: POINTER
            -- Pointer to COM structure
            -- (from ECOM_WRAPPER)

    locks_supported: INTEGER
            -- Types of region locking supported
            -- by stream or byte array. See the LOCKTYPES
            -- enumeration for the values available. This member
            -- is not used for storage objects.

    mode: INTEGER
            -- Access mode specified when the
            -- object was opened.
        ensure
            valid_mode: is_valid_stgm (Result)

    modification_time: WEL_FILE_TIME
            -- Last modification time
        ensure
            Result /= void

    name: STRING
            -- name

    size: ECOM_ULARGE_INTEGER
            -- Size in bytes of stream or byte array.
        ensure
            Result /= void and Result.item /= default_pointer

    type: INTEGER
            -- Type of object
            -- Returns one of the values from the STGTY enumeration.
            -- See class ECOM_STGTY for values
        ensure
            valid_type: is_valid_stgty (Result)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ECOM_WRAPPER
    wrapper_invariant: initializer /= default_pointer and then exists

end -- class ECOM_STATSTG


ECOM_STRUCTURE Chart

deferred class
    ECOM_STRUCTURE

General
    cluster: com.Structures
    description: "Abstract notions of a COM data structure."

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_STRUCTURE)


ECOM_STRUCTURE Flat contracts

indexing
    description: "Abstract notions of a COM data structure."
    note: "If allocated by Client, may be deallocated by Server, and the opposite."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ECOM_STRUCTURE

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    set_value (source: like Current)
            -- Set Current to 'source'.
        require
            non_void: source /= void
            valid_source: source.item /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_STRUCTURE


ECOM_ULARGE_INTEGER Chart

class
    ECOM_ULARGE_INTEGER

General
    cluster: com.Structures
    description: "COM ULARGE_INTEGER 64-bit integer"
    create: make_from_pointer, make_from_integer, make

Ancestors
    ECOM_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    quad_part: INTEGER_64
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_quad_part (a_quad_part: INTEGER_64)
    set_shared
    set_unshared
    set_value (source: [like Current] ECOM_ULARGE_INTEGER)


ECOM_ULARGE_INTEGER Flat contracts

indexing
    description: "COM ULARGE_INTEGER 64-bit integer"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_ULARGE_INTEGER

create

    make
            -- Make.
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_integer (integer: INTEGER)
            -- Creation routine
        ensure
            exists

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    quad_part: INTEGER_64
            -- QuadPart field.

feature -- Measurement

    structure_size: INTEGER
            -- Size of structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    set_quad_part (a_quad_part: INTEGER_64)
            -- Set quad_part with a_quad_part.

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_ULARGE_INTEGER


ECOM_VARIANT Chart

class
    ECOM_VARIANT

General
    cluster: com.Structures
    description: "COM VARIANT structure"
    create: make_from_pointer, make

Ancestors
    ECOM_STRUCTURE
    ECOM_VAR_TYPE

Queries
    boolean_array: ECOM_ARRAY [BOOLEAN]
    boolean_array_reference: CELL [ECOM_ARRAY [BOOLEAN]]
    boolean_reference: BOOLEAN_REF
    boolean_value: BOOLEAN
    char_array: ECOM_ARRAY [CHARACTER]
    char_array_reference: CELL [ECOM_ARRAY [CHARACTER]]
    character_reference: CHARACTER_REF
    character_value: CHARACTER
    currency: ECOM_CURRENCY
    currency_array: ECOM_ARRAY [ECOM_CURRENCY]
    currency_array_reference: CELL [ECOM_ARRAY [ECOM_CURRENCY]]
    currency_reference: ECOM_CURRENCY
    date_array: ECOM_ARRAY [DATE_TIME]
    date_array_reference: CELL [ECOM_ARRAY [DATE_TIME]]
    date_reference: CELL [DATE_TIME]
    date_value: DATE_TIME
    decimal: ECOM_DECIMAL
    decimal_array: ECOM_ARRAY [ECOM_DECIMAL]
    decimal_array_reference: CELL [ECOM_ARRAY [ECOM_DECIMAL]]
    decimal_reference: ECOM_DECIMAL
    dispatch_interface: ECOM_AUTOMATION_INTERFACE
    dispatch_interface_array: ECOM_ARRAY [ECOM_AUTOMATION_INTERFACE]
    dispatch_interface_array_reference: CELL [ECOM_ARRAY [ECOM_AUTOMATION_INTERFACE]]
    dispatch_interface_reference: CELL [ECOM_AUTOMATION_INTERFACE]
    double_array: ECOM_ARRAY [DOUBLE]
    double_array_reference: CELL [ECOM_ARRAY [DOUBLE]]
    error: ECOM_HRESULT
    error_array: ECOM_ARRAY [ECOM_HRESULT]
    error_array_reference: CELL [ECOM_ARRAY [ECOM_HRESULT]]
    error_reference: ECOM_HRESULT
    exists: BOOLEAN
    integer2: INTEGER
    integer2_reference: INTEGER_REF
    integer4: INTEGER
    integer4_array: ECOM_ARRAY [INTEGER]
    integer4_array_reference: CELL [ECOM_ARRAY [INTEGER]]
    integer4_reference: INTEGER_REF
    integer_array: ECOM_ARRAY [INTEGER]
    integer_array_reference: CELL [ECOM_ARRAY [INTEGER]]
    integer_reference: INTEGER_REF
    integer_value: INTEGER
    is_array (variable_type: INTEGER): BOOLEAN
    is_basic (a_type: INTEGER): BOOLEAN
    is_boolean (variable_type: INTEGER): BOOLEAN
    is_bstr (variable_type: INTEGER): BOOLEAN
    is_byref (variable_type: INTEGER): BOOLEAN
    is_carray (variable_type: INTEGER): BOOLEAN
    is_character (variable_type: INTEGER): BOOLEAN
    is_currency (variable_type: INTEGER): BOOLEAN
    is_date (variable_type: INTEGER): BOOLEAN
    is_decimal (variable_type: INTEGER): BOOLEAN
    is_dispatch (variable_type: INTEGER): BOOLEAN
    is_error (variable_type: INTEGER): BOOLEAN
    is_hresult (variable_type: INTEGER): BOOLEAN
    is_int (variable_type: INTEGER): BOOLEAN
    is_integer2 (variable_type: INTEGER): BOOLEAN
    is_integer4 (variable_type: INTEGER): BOOLEAN
    is_long_long (variable_type: INTEGER): BOOLEAN
    is_lpstr (variable_type: INTEGER): BOOLEAN
    is_lpwstr (variable_type: INTEGER): BOOLEAN
    is_ptr (variable_type: INTEGER): BOOLEAN
    is_real4 (variable_type: INTEGER): BOOLEAN
    is_real8 (variable_type: INTEGER): BOOLEAN
    is_safearray (variable_type: INTEGER): BOOLEAN
    is_unknown (variable_type: INTEGER): BOOLEAN
    is_unsigned_char (variable_type: INTEGER): BOOLEAN
    is_unsigned_int (variable_type: INTEGER): BOOLEAN
    is_unsigned_long (variable_type: INTEGER): BOOLEAN
    is_unsigned_long_long (variable_type: INTEGER): BOOLEAN
    is_unsigned_short (variable_type: INTEGER): BOOLEAN
    is_user_defined (variable_type: INTEGER): BOOLEAN
    is_variant (variable_type: INTEGER): BOOLEAN
    is_void (variable_type: INTEGER): BOOLEAN
    item: POINTER
    out: STRING
    real4: REAL
    real4_reference: REAL_REF
    real8: DOUBLE
    real8_reference: DOUBLE_REF
    real_array: ECOM_ARRAY [REAL]
    real_array_reference: CELL [ECOM_ARRAY [REAL]]
    shared: BOOLEAN
    short_array: ECOM_ARRAY [INTEGER]
    short_array_reference: CELL [ECOM_ARRAY [INTEGER]]
    string_array: ECOM_ARRAY [STRING]
    string_array_reference: CELL [ECOM_ARRAY [STRING]]
    string_reference: CELL [STRING]
    string_value: STRING
    structure_size: INTEGER
    to_integer: INTEGER
    unknown_interface: ECOM_UNKNOWN_INTERFACE
    unknown_interface_array: ECOM_ARRAY [ECOM_UNKNOWN_INTERFACE]
    unknown_interface_array_reference: CELL [ECOM_ARRAY [ECOM_UNKNOWN_INTERFACE]]
    unknown_interface_reference: CELL [ECOM_UNKNOWN_INTERFACE]
    unsigned_character_array: ECOM_ARRAY [CHARACTER]
    unsigned_character_array_reference: CELL [ECOM_ARRAY [CHARACTER]]
    unsigned_character_reference: CHARACTER_REF
    unsigned_character_value: CHARACTER
    unsigned_integer: INTEGER
    unsigned_integer2: INTEGER
    unsigned_integer2_reference: INTEGER_REF
    unsigned_integer4: INTEGER
    unsigned_integer4_array: ECOM_ARRAY [INTEGER]
    unsigned_integer4_array_reference: CELL [ECOM_ARRAY [INTEGER]]
    unsigned_integer4_reference: INTEGER_REF
    unsigned_integer_array: ECOM_ARRAY [INTEGER]
    unsigned_integer_array_reference: CELL [ECOM_ARRAY [INTEGER]]
    unsigned_integer_reference: INTEGER_REF
    unsigned_short_array: ECOM_ARRAY [INTEGER]
    unsigned_short_array_reference: CELL [ECOM_ARRAY [INTEGER]]
    valid_var_type (a_var_type: INTEGER): BOOLEAN
    variable_type: INTEGER
    variant_array: ECOM_ARRAY [ECOM_VARIANT]
    variant_array_reference: CELL [ECOM_ARRAY [ECOM_VARIANT]]
    variant_value: ECOM_VARIANT
    vt_array: INTEGER
    vt_bool: INTEGER
    vt_bstr: INTEGER
    vt_byref: INTEGER
    vt_carray: INTEGER
    vt_cy: INTEGER
    vt_date: INTEGER
    vt_decimal: INTEGER
    vt_dispatch: INTEGER
    vt_empty: INTEGER
    vt_error: INTEGER
    vt_hresult: INTEGER
    vt_i1: INTEGER
    vt_i2: INTEGER
    vt_i4: INTEGER
    vt_i8: INTEGER
    vt_int: INTEGER
    vt_lpstr: INTEGER
    vt_lpwstr: INTEGER
    vt_null: INTEGER
    vt_ptr: INTEGER
    vt_r4: INTEGER
    vt_r8: INTEGER
    vt_record: INTEGER
    vt_reserved: INTEGER
    vt_safearray: INTEGER
    vt_typemask: INTEGER
    vt_ui1: INTEGER
    vt_ui2: INTEGER
    vt_ui4: INTEGER
    vt_ui8: INTEGER
    vt_uint: INTEGER
    vt_unknown: INTEGER
    vt_userdefined: INTEGER
    vt_variant: INTEGER
    vt_void: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make
    make_from_pointer (a_pointer: POINTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set (a: ANY)
    set_array (a_value: ECOM_ARRAY [ECOM_VARIANT])
    set_boolean (a_value: BOOLEAN)
    set_boolean_array (a_value: ECOM_ARRAY [BOOLEAN])
    set_boolean_array_reference (a_value: CELL [ECOM_ARRAY [BOOLEAN]])
    set_boolean_reference (a_value: BOOLEAN_REF)
    set_char_array (a_value: ECOM_ARRAY [CHARACTER])
    set_char_array_reference (a_value: CELL [ECOM_ARRAY [CHARACTER]])
    set_character (a_char: CHARACTER)
    set_character_reference (a_char: CHARACTER_REF)
    set_currency (a_value: ECOM_CURRENCY)
    set_currency_array (a_value: ECOM_ARRAY [ECOM_CURRENCY])
    set_currency_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_CURRENCY]])
    set_currency_reference (a_value: ECOM_CURRENCY)
    set_date (a_value: DATE_TIME)
    set_date_array (a_value: ECOM_ARRAY [DATE_TIME])
    set_date_array_reference (a_value: CELL [ECOM_ARRAY [DATE_TIME]])
    set_date_reference (a_value: CELL [DATE_TIME])
    set_decimal (a_value: ECOM_DECIMAL)
    set_decimal_array (a_value: ECOM_ARRAY [ECOM_DECIMAL])
    set_decimal_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_DECIMAL]])
    set_decimal_reference (a_value: ECOM_DECIMAL)
    set_dispatch_array (a_value: ECOM_ARRAY [ECOM_INTERFACE])
    set_dispatch_interface (a_value: ECOM_INTERFACE)
    set_dispatch_interface_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_INTERFACE]])
    set_dispatch_interface_reference (a_value: CELL [ECOM_INTERFACE])
    set_double_array (a_value: ECOM_ARRAY [DOUBLE])
    set_double_array_reference (a_value: CELL [ECOM_ARRAY [DOUBLE]])
    set_empty
    set_error (a_value: ECOM_HRESULT)
    set_error_array (a_value: ECOM_ARRAY [ECOM_HRESULT])
    set_error_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_HRESULT]])
    set_error_reference (a_value: ECOM_HRESULT)
    set_integer (a_value: INTEGER)
    set_integer2 (a_value: INTEGER)
    set_integer2_reference (a_value: INTEGER_REF)
    set_integer4 (a_value: INTEGER)
    set_integer4_array (a_value: ECOM_ARRAY [INTEGER])
    set_integer4_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
    set_integer4_reference (a_value: INTEGER_REF)
    set_integer_array (a_value: ECOM_ARRAY [INTEGER])
    set_integer_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
    set_integer_reference (a_value: INTEGER_REF)
    set_real4 (a_value: REAL)
    set_real4_reference (a_value: REAL_REF)
    set_real8 (a_value: DOUBLE)
    set_real8_reference (a_value: DOUBLE_REF)
    set_real_array (a_value: ECOM_ARRAY [REAL])
    set_real_array_reference (a_value: CELL [ECOM_ARRAY [REAL]])
    set_shared
    set_short_array (a_value: ECOM_ARRAY [INTEGER])
    set_short_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
    set_string (a_value: STRING)
    set_string_array (a_value: ECOM_ARRAY [STRING])
    set_string_array_reference (a_value: CELL [ECOM_ARRAY [STRING]])
    set_string_reference (a_value: CELL [STRING])
    set_unknown_array (a_value: ECOM_ARRAY [ECOM_INTERFACE])
    set_unknown_interface (a_value: ECOM_INTERFACE)
    set_unknown_interface_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_INTERFACE]])
    set_unknown_interface_reference (a_value: CELL [ECOM_INTERFACE])
    set_unshared
    set_unsigned_character (a_value: CHARACTER)
    set_unsigned_character_array (a_value: ECOM_ARRAY [CHARACTER])
    set_unsigned_character_array_reference (a_value: CELL [ECOM_ARRAY [CHARACTER]])
    set_unsigned_character_reference (a_value: CHARACTER_REF)
    set_unsigned_integer (a_value: INTEGER)
    set_unsigned_integer2 (a_value: INTEGER)
    set_unsigned_integer2_reference (a_value: INTEGER_REF)
    set_unsigned_integer4 (a_value: INTEGER)
    set_unsigned_integer4_array (a_value: ECOM_ARRAY [INTEGER])
    set_unsigned_integer4_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
    set_unsigned_integer4_reference (a_value: INTEGER_REF)
    set_unsigned_integer_array (a_value: ECOM_ARRAY [INTEGER])
    set_unsigned_integer_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
    set_unsigned_integer_reference (a_value: INTEGER_REF)
    set_unsigned_short_array (a_value: ECOM_ARRAY [INTEGER])
    set_unsigned_short_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
    set_value (source: [like Current] ECOM_VARIANT)
    set_variant (a_value: ECOM_VARIANT)
    set_variant_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_VARIANT]])


ECOM_VARIANT Flat contracts

indexing
    description: "COM VARIANT structure"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_VARIANT

create

    make
            -- Create new variant.
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

feature -- Initialization

    make
            -- Create new variant.
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_pointer (a_pointer: POINTER)
            -- Make from pointer.
        require -- from ECOM_STRUCTURE
            valid_pointer: a_pointer /= default_pointer

feature -- Access

    boolean_array: ECOM_ARRAY [BOOLEAN]
            -- ARRAY of BOOLEAN.
        require
            is_boolean: is_boolean (variable_type)
            is_array: is_array (variable_type)

    boolean_array_reference: CELL [ECOM_ARRAY [BOOLEAN]]
            -- ARRAY of BOOLEAN.
        require
            is_boolean: is_boolean (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    boolean_reference: BOOLEAN_REF
            -- Reference boolean value
        require
            is_boolean_ref: is_boolean (variable_type) and is_byref (variable_type)

    boolean_value: BOOLEAN
            -- Boolean value
        require
            is_boolean: variable_type = vt_bool

    char_array: ECOM_ARRAY [CHARACTER]
            -- ARRAY of characters
        require
            is_character: is_character (variable_type)
            is_array: is_array (variable_type)

    char_array_reference: CELL [ECOM_ARRAY [CHARACTER]]
            -- ARRAY of characters
        require
            is_character: is_character (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    character_reference: CHARACTER_REF
            -- Reference character value
        require
            is_character_ref: is_character (variable_type) and is_byref (variable_type)

    character_value: CHARACTER
            -- Character value
        require
            is_character: variable_type = vt_i1

    currency: ECOM_CURRENCY
            -- Currency value
        require
            is_currency: variable_type = vt_cy

    currency_array: ECOM_ARRAY [ECOM_CURRENCY]
            -- ARRAY of CURRENCY
        require
            is_currency: is_currency (variable_type)
            is_array: is_array (variable_type)

    currency_array_reference: CELL [ECOM_ARRAY [ECOM_CURRENCY]]
            -- ARRAY of CURRENCY
        require
            is_currency: is_currency (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    currency_reference: ECOM_CURRENCY
            -- Reference currency value
        require
            is_currency_ref: is_currency (variable_type) and is_byref (variable_type)

    date_array: ECOM_ARRAY [DATE_TIME]
            -- ARRAY of DATE
        require
            is_date: is_date (variable_type)
            is_array: is_array (variable_type)

    date_array_reference: CELL [ECOM_ARRAY [DATE_TIME]]
            -- ARRAY of DATE
        require
            is_date: is_date (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    date_reference: CELL [DATE_TIME]
            -- Date reference value
        require
            is_date_ref: is_date (variable_type) and is_byref (variable_type)

    date_value: DATE_TIME
            -- Date value
        require
            is_date: variable_type = vt_date

    decimal: ECOM_DECIMAL
            -- Decimal value

    decimal_array: ECOM_ARRAY [ECOM_DECIMAL]
            -- ARRAY of ECOM_DECIMALs.
        require
            is_decimal: is_decimal (variable_type)
            is_array: is_array (variable_type)

    decimal_array_reference: CELL [ECOM_ARRAY [ECOM_DECIMAL]]
            -- ARRAY of ECOM_DECIMALs.
        require
            is_decimal: is_decimal (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    decimal_reference: ECOM_DECIMAL
            -- Decimal reference value
        require
            is_decimal_ref: is_decimal (variable_type) and is_byref (variable_type)

    dispatch_interface: ECOM_AUTOMATION_INTERFACE
            -- IDispatch interface value
        require
            is_dispatch_ref: variable_type = vt_dispatch

    dispatch_interface_array: ECOM_ARRAY [ECOM_AUTOMATION_INTERFACE]
            -- ARRAY of ECOM_AUTOMATION_INTERFACEs.
        require
            is_dispatch: is_dispatch (variable_type)
            is_array: is_array (variable_type)

    dispatch_interface_array_reference: CELL [ECOM_ARRAY [ECOM_AUTOMATION_INTERFACE]]
            -- ARRAY of ECOM_AUTOMATION_INTERFACEs.
        require
            is_dispatch: is_dispatch (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    dispatch_interface_reference: CELL [ECOM_AUTOMATION_INTERFACE]
            -- IDispatch interface reference value
        require
            is_dispatch_ref: is_dispatch (variable_type) and is_byref (variable_type)

    double_array: ECOM_ARRAY [DOUBLE]
            -- ARRAY of doubles
        require
            is_real8: is_real8 (variable_type)
            is_array: is_array (variable_type)

    double_array_reference: CELL [ECOM_ARRAY [DOUBLE]]
            -- ARRAY of doubles
        require
            is_real8: is_real8 (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    error: ECOM_HRESULT
            -- Error value
        require
            is_error: variable_type = vt_error

    error_array: ECOM_ARRAY [ECOM_HRESULT]
            -- ARRAY of HRESULTs
        require
            is_error: is_error (variable_type)
            is_array: is_array (variable_type)

    error_array_reference: CELL [ECOM_ARRAY [ECOM_HRESULT]]
            -- ARRAY of HRESULTs
        require
            is_error: is_error (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    error_reference: ECOM_HRESULT
            -- Error reference value
        require
            is_error_ref: is_error (variable_type) and is_byref (variable_type)

    integer2: INTEGER
            -- Short value
        require
            is_integer2: variable_type = vt_i2

    integer2_reference: INTEGER_REF
            -- Reference short value
        require
            is_integer2_ref: is_integer2 (variable_type) and is_byref (variable_type)

    integer4: INTEGER
            -- Long value
        require
            is_integer4: variable_type = vt_i4

    integer4_array: ECOM_ARRAY [INTEGER]
            -- Integer ARRAY value
        require
            is_integer4: is_integer4 (variable_type)
            is_array: is_array (variable_type)

    integer4_array_reference: CELL [ECOM_ARRAY [INTEGER]]
            -- Reference integer ARRAY value
        require
            is_integer4: is_integer4 (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    integer4_reference: INTEGER_REF
            -- Reference long value
        require
            is_integer4_ref: is_integer4 (variable_type) and is_byref (variable_type)

    integer_array: ECOM_ARRAY [INTEGER]
            -- Array of integers
        require
            is_int: is_int (variable_type)
            is_array: is_array (variable_type)

    integer_array_reference: CELL [ECOM_ARRAY [INTEGER]]
            -- Array of integers
        require
            is_int: is_int (variable_type)
            is_array: is_array (variable_type)

    integer_reference: INTEGER_REF
            -- Reference integer value
        require
            is_integer_ref: is_int (variable_type) and is_byref (variable_type)

    integer_value: INTEGER
            -- Integer value
        require
            is_integer: variable_type = vt_int

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    real4: REAL
            -- Real value
        require
            is_real4: variable_type = vt_r4

    real4_reference: REAL_REF
            -- Reference real value
        require
            is_real4_ref: is_real4 (variable_type) and is_byref (variable_type)

    real8: DOUBLE
            -- Double value
        require
            is_real8: variable_type = vt_r8

    real8_reference: DOUBLE_REF
            -- Reference double value
        require
            is_real8_ref: is_real8 (variable_type) and is_byref (variable_type)

    real_array: ECOM_ARRAY [REAL]
            -- ARRAY of reals
        require
            is_real4: is_real4 (variable_type)
            is_array: is_array (variable_type)

    real_array_reference: CELL [ECOM_ARRAY [REAL]]
            -- ARRAY of reals
        require
            is_real4: is_real4 (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    short_array: ECOM_ARRAY [INTEGER]
            -- Integer ARRAY value
        require
            is_integer2: is_integer2 (variable_type)
            is_array: is_array (variable_type)

    short_array_reference: CELL [ECOM_ARRAY [INTEGER]]
            -- Integer ARRAY value
        require
            is_integer2: is_integer2 (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    string_array: ECOM_ARRAY [STRING]
            -- ARRAY of STRING.
        require
            is_bstr: is_bstr (variable_type)
            is_array: is_array (variable_type)

    string_array_reference: CELL [ECOM_ARRAY [STRING]]
            -- ARRAY of STRING.
        require
            is_bstr: is_bstr (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    string_reference: CELL [STRING]
            -- Reference BSTR value
        require
            is_bstr_ref: is_bstr (variable_type) and is_byref (variable_type)

    string_value: STRING
            -- BSTR value
        require
            is_bstr: variable_type = vt_bstr

    unknown_interface: ECOM_UNKNOWN_INTERFACE
            -- IUnknown interface value
        require
            is_unknown_ref: variable_type = vt_unknown

    unknown_interface_array: ECOM_ARRAY [ECOM_UNKNOWN_INTERFACE]
            -- ARRAY of ECOM_UNKNOWN_INTERFACEs.
        require
            is_unknown: is_unknown (variable_type)
            is_array: is_array (variable_type)

    unknown_interface_array_reference: CELL [ECOM_ARRAY [ECOM_UNKNOWN_INTERFACE]]
            -- ARRAY of ECOM_UNKNOWN_INTERFACEs.
        require
            is_unknown: is_unknown (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    unknown_interface_reference: CELL [ECOM_UNKNOWN_INTERFACE]
            -- IUnknown interface reference value
        require
            is_unknown_ref: is_unknown (variable_type) and is_byref (variable_type)

    unsigned_character_array: ECOM_ARRAY [CHARACTER]
            -- Array of unsigned character
        require
            is_unsigned_char: is_unsigned_char (variable_type)
            is_array: is_array (variable_type)

    unsigned_character_array_reference: CELL [ECOM_ARRAY [CHARACTER]]
            -- Array of unsigned character
        require
            is_unsigned_char: is_unsigned_char (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    unsigned_character_reference: CHARACTER_REF
            -- Reference byte value
        require
            is_byte_ref: is_unsigned_char (variable_type) and is_byref (variable_type)

    unsigned_character_value: CHARACTER
            -- Byte value
        require
            is_byte: is_unsigned_char (variable_type)

    unsigned_integer: INTEGER
            -- Unsigned integer value
        require
            is_unsigned_integer: variable_type = vt_uint

    unsigned_integer2: INTEGER
            -- Unsigned short value
        require
            is_unsigned_short: variable_type = vt_ui2

    unsigned_integer2_reference: INTEGER_REF
            -- Reference unsigned short value
        require
            is_unsigned_integer2_ref: is_unsigned_short (variable_type) and is_byref (variable_type)

    unsigned_integer4: INTEGER
            -- Unsigned long value
        require
            is_unsigned_long: variable_type = vt_ui4

    unsigned_integer4_array: ECOM_ARRAY [INTEGER]
            -- Array of unsigned long
        require
            is_unsigned_long: is_unsigned_long (variable_type)
            is_array: is_array (variable_type)

    unsigned_integer4_array_reference: CELL [ECOM_ARRAY [INTEGER]]
            -- Array of unsigned long
        require
            is_unsigned_long: is_unsigned_long (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    unsigned_integer4_reference: INTEGER_REF
            -- Reference unsigned long value
        require
            is_unsigned_long_ref: is_unsigned_long (variable_type) and is_byref (variable_type)

    unsigned_integer_array: ECOM_ARRAY [INTEGER]
            -- Array of unsigned int
        require
            is_unsigned_int: is_unsigned_int (variable_type)
            is_array: is_array (variable_type)

    unsigned_integer_array_reference: CELL [ECOM_ARRAY [INTEGER]]
            -- Array of unsigned int
        require
            is_unsigned_int: is_unsigned_int (variable_type)
            is_array: is_array (variable_type)

    unsigned_integer_reference: INTEGER_REF
            -- Reference unsigned integer value
        require
            is_unsigned_int_ref: is_unsigned_int (variable_type) and is_byref (variable_type)

    unsigned_short_array: ECOM_ARRAY [INTEGER]
            -- Array of unsigned short
        require
            is_unsigned_short: is_unsigned_short (variable_type)
            is_array: is_array (variable_type)

    unsigned_short_array_reference: CELL [ECOM_ARRAY [INTEGER]]
            -- Array of unsigned short
        require
            is_unsigned_short: is_unsigned_short (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    variable_type: INTEGER
            -- Variable type

    variant_array: ECOM_ARRAY [ECOM_VARIANT]
            -- ARRAY of ECOM_VARIANTs.
        require
            is_variant: is_variant (variable_type)
            is_array: is_array (variable_type)

    variant_array_reference: CELL [ECOM_ARRAY [ECOM_VARIANT]]
            -- ARRAY of ECOM_VARIANTs.
        require
            is_variant: is_variant (variable_type)
            is_array: is_array (variable_type)
            is_byref: is_byref (variable_type)

    variant_value: ECOM_VARIANT
            -- Variant value
        require
            is_variant: is_variant (variable_type)

    vt_array: INTEGER
            -- A Safe array of data is passed
            -- (from ECOM_VAR_TYPE)

    vt_bool: INTEGER
            -- Boolean: True = -1 False = 0
            -- (from ECOM_VAR_TYPE)

    vt_bstr: INTEGER
            -- Binary string
            -- (from ECOM_VAR_TYPE)

    vt_byref: INTEGER
            -- Pointer to data is passed
            -- (from ECOM_VAR_TYPE)

    vt_carray: INTEGER
            -- array
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_cy: INTEGER
            -- Currency
            -- (from ECOM_VAR_TYPE)

    vt_date: INTEGER
            -- Date
            -- (from ECOM_VAR_TYPE)

    vt_decimal: INTEGER
            -- 16 byte fixed point
            -- (from ECOM_VAR_TYPE)

    vt_dispatch: INTEGER
            -- IDispatch*
            -- (from ECOM_VAR_TYPE)

    vt_empty: INTEGER
            -- Not specified
            -- (from ECOM_VAR_TYPE)

    vt_error: INTEGER
            -- SCODE
            -- (from ECOM_VAR_TYPE)

    vt_hresult: INTEGER
            -- HRESULT
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_i1: INTEGER
            -- Character
            -- (from ECOM_VAR_TYPE)

    vt_i2: INTEGER
            -- 2-byte signed integer
            -- (from ECOM_VAR_TYPE)

    vt_i4: INTEGER
            -- 4-byte signed integer
            -- (from ECOM_VAR_TYPE)

    vt_i8: INTEGER
            -- 8-byte signed integer
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_int: INTEGER
            -- integer
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_lpstr: INTEGER
            -- LPSTR
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_lpwstr: INTEGER
            -- LPWSTR
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_null: INTEGER
            -- SQL style Null
            -- (from ECOM_VAR_TYPE)

    vt_ptr: INTEGER
            -- pointer
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_r4: INTEGER
            -- 4-byte real
            -- (from ECOM_VAR_TYPE)

    vt_r8: INTEGER
            -- 8-byte real
            -- (from ECOM_VAR_TYPE)

    vt_record: INTEGER
            -- Record
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_reserved: INTEGER
            -- Reserverd for Microsoft use
            -- (from ECOM_VAR_TYPE)

    vt_safearray: INTEGER
            -- Safearray
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_typemask: INTEGER
            -- Typemask.
            -- (from ECOM_VAR_TYPE)

    vt_ui1: INTEGER
            -- Unsigned character
            -- (from ECOM_VAR_TYPE)

    vt_ui2: INTEGER
            -- 2-bytes unsigned integer
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_ui4: INTEGER
            -- 4-bytes unsigned integer
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_ui8: INTEGER
            -- 8-bytes unsigned integer
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_uint: INTEGER
            -- unsigned integer
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_unknown: INTEGER
            -- IUnknown*
            -- (from ECOM_VAR_TYPE)

    vt_userdefined: INTEGER
            -- User defined
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

    vt_variant: INTEGER
            -- VARIANT*
            -- (from ECOM_VAR_TYPE)

    vt_void: INTEGER
            -- NULL
            -- may appear in TYPEDESC only
            -- (from ECOM_VAR_TYPE)

feature -- Measurement

    structure_size: INTEGER
            -- Size of VARIANT structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    is_array (variable_type: INTEGER): BOOLEAN
            -- Is variable array?
            -- (from ECOM_VAR_TYPE)

    is_basic (a_type: INTEGER): BOOLEAN
            -- Is a_type basic type?
            -- (from ECOM_VAR_TYPE)

    is_boolean (variable_type: INTEGER): BOOLEAN
            -- Is variable boolen?
            -- (from ECOM_VAR_TYPE)

    is_bstr (variable_type: INTEGER): BOOLEAN
            -- Is variable BSTR?
            -- (from ECOM_VAR_TYPE)

    is_byref (variable_type: INTEGER): BOOLEAN
            -- Is variable passed by reference?
            -- (from ECOM_VAR_TYPE)

    is_carray (variable_type: INTEGER): BOOLEAN
            -- Is variable C ARRAY?
            -- (from ECOM_VAR_TYPE)

    is_character (variable_type: INTEGER): BOOLEAN
            -- Is variable character?
            -- (from ECOM_VAR_TYPE)

    is_currency (variable_type: INTEGER): BOOLEAN
            -- Is variable currency?
            -- (from ECOM_VAR_TYPE)

    is_date (variable_type: INTEGER): BOOLEAN
            -- Is variable date?
            -- (from ECOM_VAR_TYPE)

    is_decimal (variable_type: INTEGER): BOOLEAN
            -- Is decimal variable?
            -- (from ECOM_VAR_TYPE)

    is_dispatch (variable_type: INTEGER): BOOLEAN
            -- Is dispatch interface?
            -- (from ECOM_VAR_TYPE)

    is_error (variable_type: INTEGER): BOOLEAN
            -- Is variable error?
            -- (from ECOM_VAR_TYPE)

    is_hresult (variable_type: INTEGER): BOOLEAN
            -- Is variable int?
            -- (from ECOM_VAR_TYPE)

    is_int (variable_type: INTEGER): BOOLEAN
            -- Is variable int?
            -- (from ECOM_VAR_TYPE)

    is_integer2 (variable_type: INTEGER): BOOLEAN
            -- Is variable short integer?
            -- (from ECOM_VAR_TYPE)

    is_integer4 (variable_type: INTEGER): BOOLEAN
            -- Is variable long integer?
            -- (from ECOM_VAR_TYPE)

    is_long_long (variable_type: INTEGER): BOOLEAN
            -- Is variable long long?
            -- (from ECOM_VAR_TYPE)

    is_lpstr (variable_type: INTEGER): BOOLEAN
            -- Is variable LPSTR?
            -- (from ECOM_VAR_TYPE)

    is_lpwstr (variable_type: INTEGER): BOOLEAN
            -- Is variable LPWSTR?
            -- (from ECOM_VAR_TYPE)

    is_ptr (variable_type: INTEGER): BOOLEAN
            -- Is variable ptr?
            -- (from ECOM_VAR_TYPE)

    is_real4 (variable_type: INTEGER): BOOLEAN
            -- Is variable real?
            -- (from ECOM_VAR_TYPE)

    is_real8 (variable_type: INTEGER): BOOLEAN
            -- Is variable double?
            -- (from ECOM_VAR_TYPE)

    is_safearray (variable_type: INTEGER): BOOLEAN
            -- Is variable SAFEARRAY?
            -- (from ECOM_VAR_TYPE)

    is_unknown (variable_type: INTEGER): BOOLEAN
            -- Is IUnknown interface?
            -- (from ECOM_VAR_TYPE)

    is_unsigned_char (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned char?
            -- (from ECOM_VAR_TYPE)

    is_unsigned_int (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned int?
            -- (from ECOM_VAR_TYPE)

    is_unsigned_long (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned long?
            -- (from ECOM_VAR_TYPE)

    is_unsigned_long_long (variable_type: INTEGER): BOOLEAN
            -- Is variable unsigned long long?
            -- (from ECOM_VAR_TYPE)

    is_unsigned_short (variable_type: INTEGER): BOOLEAN
            -- Is Ivariable unsigned short?
            -- (from ECOM_VAR_TYPE)

    is_user_defined (variable_type: INTEGER): BOOLEAN
            -- Is variable user defined?
            -- (from ECOM_VAR_TYPE)

    is_variant (variable_type: INTEGER): BOOLEAN
            -- Is variable variant?
            -- (from ECOM_VAR_TYPE)

    is_void (variable_type: INTEGER): BOOLEAN
            -- Is variable void?
            -- (from ECOM_VAR_TYPE)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    valid_var_type (a_var_type: INTEGER): BOOLEAN
            -- Is a_var_type a valid variant type?
            -- (from ECOM_VAR_TYPE)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set (a: ANY)
            -- Set VARIANT with ANY.

    set_array (a_value: ECOM_ARRAY [ECOM_VARIANT])
            -- Set ARRAY of ECOM_VARIANTs.
        require
            non_void_value: a_value /= void

    set_boolean (a_value: BOOLEAN)
            -- Set boolean value.

    set_boolean_array (a_value: ECOM_ARRAY [BOOLEAN])
            -- Set ARRAY of BOOLEAN.
        require
            non_void_value: a_value /= void

    set_boolean_array_reference (a_value: CELL [ECOM_ARRAY [BOOLEAN]])
            -- Set ARRAY of BOOLEAN.
        require
            non_void_value: a_value /= void

    set_boolean_reference (a_value: BOOLEAN_REF)
            -- Set reference boolean value.
        require
            non_void: a_value /= void

    set_char_array (a_value: ECOM_ARRAY [CHARACTER])
            -- Set ARRAY of characters
        require
            non_void_value: a_value /= void

    set_char_array_reference (a_value: CELL [ECOM_ARRAY [CHARACTER]])
            -- Set ARRAY of characters
        require
            non_void_value: a_value /= void

    set_character (a_char: CHARACTER)
            -- Set character value.

    set_character_reference (a_char: CHARACTER_REF)
            -- Set reference character value
        require
            non_void: a_char /= void

    set_currency (a_value: ECOM_CURRENCY)
            -- Set currency value.
        require
            non_void_currency: a_value /= void
            valid: a_value.item /= default_pointer

    set_currency_array (a_value: ECOM_ARRAY [ECOM_CURRENCY])
            -- Set ARRAY of CURRENCY
        require
            non_void_value: a_value /= void

    set_currency_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_CURRENCY]])
            -- Set ARRAY of CURRENCY
        require
            non_void_value: a_value /= void

    set_currency_reference (a_value: ECOM_CURRENCY)
            -- Set reference currency value.
        require
            non_void_currency: a_value /= void
            valid: a_value.item /= default_pointer

    set_date (a_value: DATE_TIME)
            -- Set date value.
        require
            non_void: a_value /= void

    set_date_array (a_value: ECOM_ARRAY [DATE_TIME])
            -- Set ARRAY of DATE
        require
            non_void_value: a_value /= void

    set_date_array_reference (a_value: CELL [ECOM_ARRAY [DATE_TIME]])
            -- Set ARRAY of DATE
        require
            non_void_value: a_value /= void

    set_date_reference (a_value: CELL [DATE_TIME])
            -- Set date reference value.
        require
            non_void: a_value /= void
            valid_value: a_value.item /= void

    set_decimal (a_value: ECOM_DECIMAL)
            -- Set decimal value.
        require
            non_void_decimal: a_value /= void
            valid: a_value.item /= default_pointer

    set_decimal_array (a_value: ECOM_ARRAY [ECOM_DECIMAL])
            -- Set ARRAY of ECOM_DECIMALs.
        require
            non_void_value: a_value /= void

    set_decimal_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_DECIMAL]])
            -- Set ARRAY of ECOM_DECIMALs.
        require
            non_void_value: a_value /= void

    set_decimal_reference (a_value: ECOM_DECIMAL)
            -- Set decimal reference value.
        require
            non_void_decimal: a_value /= void
            valid: a_value.item /= default_pointer

    set_dispatch_array (a_value: ECOM_ARRAY [ECOM_INTERFACE])
            -- Set ARRAY of ECOM_AUTOMATION_INTERFACEs.
        require
            non_void_value: a_value /= void

    set_dispatch_interface (a_value: ECOM_INTERFACE)
            -- Set IDispatch interface value.
        require
            non_void: a_value /= void

    set_dispatch_interface_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_INTERFACE]])
            -- Set ARRAY of ECOM_AUTOMATION_INTERFACEs.
        require
            non_void_value: a_value /= void

    set_dispatch_interface_reference (a_value: CELL [ECOM_INTERFACE])
            -- Set IDispatch interface reference value.
        require
            non_void: a_value /= void

    set_double_array (a_value: ECOM_ARRAY [DOUBLE])
            -- Set ARRAY of doubles
        require
            non_void_value: a_value /= void

    set_double_array_reference (a_value: CELL [ECOM_ARRAY [DOUBLE]])
            -- Set ARRAY of doubles
        require
            non_void_value: a_value /= void

    set_empty
            -- Set empty VARIANT.

    set_error (a_value: ECOM_HRESULT)
            -- Set error value.
        require
            non_void: a_value /= void

    set_error_array (a_value: ECOM_ARRAY [ECOM_HRESULT])
            -- Set ARRAY of HRESULTs
        require
            non_void_value: a_value /= void

    set_error_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_HRESULT]])
            -- Set ARRAY of HRESULTs
        require
            non_void_value: a_value /= void

    set_error_reference (a_value: ECOM_HRESULT)
            -- Set error reference value.
        require
            non_void: a_value /= void

    set_integer (a_value: INTEGER)
            -- Set integer value.

    set_integer2 (a_value: INTEGER)
            -- Set short value

    set_integer2_reference (a_value: INTEGER_REF)
            -- Set reference short value
        require
            non_void: a_value /= void

    set_integer4 (a_value: INTEGER)
            -- Set long value

    set_integer4_array (a_value: ECOM_ARRAY [INTEGER])
            -- Set integer ARRAY value
        require
            non_void_value: a_value /= void

    set_integer4_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
            -- Set integer ARRAY value
        require
            non_void_value: a_value /= void

    set_integer4_reference (a_value: INTEGER_REF)
            -- Set reference long value
        require
            non_void: a_value /= void

    set_integer_array (a_value: ECOM_ARRAY [INTEGER])
            -- Set Array of integers
        require
            non_void_value: a_value /= void

    set_integer_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
            -- Set Array of integers
        require
            non_void_value: a_value /= void

    set_integer_reference (a_value: INTEGER_REF)
            -- Set reference integer value.
        require
            non_void: a_value /= void

    set_real4 (a_value: REAL)
            -- Set real value.

    set_real4_reference (a_value: REAL_REF)
            -- Set reference real value.
        require
            non_void: a_value /= void

    set_real8 (a_value: DOUBLE)
            -- Set double value.

    set_real8_reference (a_value: DOUBLE_REF)
            -- Set reference double value.
        require
            non_void: a_value /= void

    set_real_array (a_value: ECOM_ARRAY [REAL])
            -- Set ARRAY of reals
        require
            non_void_value: a_value /= void

    set_real_array_reference (a_value: CELL [ECOM_ARRAY [REAL]])
            -- Set ARRAY of reals
        require
            non_void_value: a_value /= void

    set_short_array (a_value: ECOM_ARRAY [INTEGER])
            -- Set integer ARRAY value
        require
            non_void_value: a_value /= void

    set_short_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
            -- Set integer ARRAY value
        require
            non_void_value: a_value /= void

    set_string (a_value: STRING)
            -- Set BSTR value.
        require
            non_void_string: a_value /= void

    set_string_array (a_value: ECOM_ARRAY [STRING])
            -- Set ARRAY of STRING.
        require
            non_void_value: a_value /= void

    set_string_array_reference (a_value: CELL [ECOM_ARRAY [STRING]])
            -- Set ARRAY of STRING.
        require
            non_void_value: a_value /= void

    set_string_reference (a_value: CELL [STRING])
            -- Set reference BSTR value.
        require
            non_void_string: a_value /= void
            valid_value: a_value.item /= void

    set_unknown_array (a_value: ECOM_ARRAY [ECOM_INTERFACE])
            -- Set ARRAY of ECOM_INTERFACEs.
        require
            non_void_value: a_value /= void

    set_unknown_interface (a_value: ECOM_INTERFACE)
            -- Set IUnknown interface value.
        require
            non_void: a_value /= void

    set_unknown_interface_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_INTERFACE]])
            -- Set ARRAY of ECOM_UNKNOWN_INTERFACEs.
        require
            non_void_value: a_value /= void

    set_unknown_interface_reference (a_value: CELL [ECOM_INTERFACE])
            -- Set IUnknown interface reference value.
        require
            non_void: a_value /= void

    set_unsigned_character (a_value: CHARACTER)
            -- Set unsigned character value

    set_unsigned_character_array (a_value: ECOM_ARRAY [CHARACTER])
            -- Set Array of unsigned character
        require
            non_void_value: a_value /= void

    set_unsigned_character_array_reference (a_value: CELL [ECOM_ARRAY [CHARACTER]])
            -- Set Array of unsigned character
        require
            non_void_value: a_value /= void

    set_unsigned_character_reference (a_value: CHARACTER_REF)
            -- Set reference byte value
        require
            non_void: a_value /= void

    set_unsigned_integer (a_value: INTEGER)
            -- Set unsigned integer value.

    set_unsigned_integer2 (a_value: INTEGER)
            -- Set unsigned short value

    set_unsigned_integer2_reference (a_value: INTEGER_REF)
            -- Set reference unsigned short value
        require
            non_void: a_value /= void

    set_unsigned_integer4 (a_value: INTEGER)
            -- Set unsigned long value

    set_unsigned_integer4_array (a_value: ECOM_ARRAY [INTEGER])
            -- Set Array of unsigned long
        require
            non_void_value: a_value /= void

    set_unsigned_integer4_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
            -- Set Array of unsigned long
        require
            non_void_value: a_value /= void

    set_unsigned_integer4_reference (a_value: INTEGER_REF)
            -- Set reference unsigned long value
        require
            non_void: a_value /= void

    set_unsigned_integer_array (a_value: ECOM_ARRAY [INTEGER])
            -- Set Array of unsigned int
        require
            non_void_value: a_value /= void

    set_unsigned_integer_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
            -- Set Array of unsigned int
        require
            non_void_value: a_value /= void

    set_unsigned_integer_reference (a_value: INTEGER_REF)
            -- Set reference unsigned integer value.
        require
            non_void: a_value /= void

    set_unsigned_short_array (a_value: ECOM_ARRAY [INTEGER])
            -- Set Array of unsigned short
        require
            non_void_value: a_value /= void

    set_unsigned_short_array_reference (a_value: CELL [ECOM_ARRAY [INTEGER]])
            -- Set Array of unsigned short
        require
            non_void_value: a_value /= void

    set_variant (a_value: ECOM_VARIANT)
            -- Set variant value.
        require
            non_void_variant: a_value /= void
            valid: a_value.item /= default_pointer

    set_variant_array_reference (a_value: CELL [ECOM_ARRAY [ECOM_VARIANT]])
            -- Set ARRAY of ECOM_VARIANTs.
        require
            non_void_value: a_value /= void

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

feature -- Output

    out: STRING
            -- Printable representation of  value.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_VARIANT


ECOM_WIDE_STRING Chart

class
    ECOM_WIDE_STRING

General
    cluster: com.Structures
    description: "wrapping of LPWSTR"
    create: make_from_pointer, make_from_string

Ancestors
    MEMORY

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    exists: BOOLEAN
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    item: POINTER
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    shared: BOOLEAN
    tenure: INTEGER
    to_string: STRING
    Total_memory: INTEGER

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    disable_time_accounting
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    mem_free (addr: POINTER)
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)
    set_shared
    set_unshared

Constraints
    exists


ECOM_WIDE_STRING Flat contracts

indexing
    description: "wrapping of LPWSTR"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_WIDE_STRING

create

    make_from_string (string: STRING)
            -- Create wide string from string
        require
            nonvoid_string: string /= void
        ensure
            non_default_item: exists
            not_shared: not shared

    make_from_pointer (a_wide_string: POINTER)
            -- Creation procedure
            -- Set item to a_wide_string
        require
            valid_pointer: a_wide_string /= default_pointer
        ensure
            valid_item: item = a_wide_string
            shared: shared

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)

    collecting: BOOLEAN
            -- Is garbage collection enabled?
            -- (from MEMORY)

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.
            -- (from MEMORY)

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.
            -- (from MEMORY)

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)

    collection_off
            -- Disable garbage collection.
            -- (from MEMORY)

    collection_on
            -- Enable garbage collection.
            -- (from MEMORY)

    disable_time_accounting
            -- Disable GC time accounting (default).
            -- (from MEMORY)

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)

feature -- Accsess

    exists: BOOLEAN
            -- Does the item exist?
        ensure
            Result = (item /= default_pointer)

    item: POINTER
            -- Pointer to wide string

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.

feature -- Basic Operations

    set_shared
            -- Set shared to True.
        ensure
            shared: shared

    set_unshared
            -- Set shared to False.
        ensure
            not_shared: not shared

    to_string: STRING
            -- Convert wide string to string
        ensure
            nonvoid_result: Result /= void

invariant

    exists: exists
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_WIDE_STRING


FONTNAME_ALIAS Chart

class
    FONTNAME_ALIAS

General
    cluster: com.Structures
    description: "OLE Automation."
    create: make_from_alias, make_from_string, make

Ancestors
    STRING

Queries
    infix "@" (i: INTEGER): CHARACTER
    infix ">=" (other: [like Current] FONTNAME_ALIAS): BOOLEAN
    infix ">" (other: [like Current] FONTNAME_ALIAS): BOOLEAN
    infix "<=" (other: [like Current] FONTNAME_ALIAS): BOOLEAN
    infix "<" (other: [like Current] FONTNAME_ALIAS): BOOLEAN
    infix "+" (s: STRING): STRING
    adapt (s: STRING): [like Current] FONTNAME_ALIAS
    additional_space: INTEGER
    area: SPECIAL [CHARACTER]
    capacity: INTEGER
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    False_constant: STRING
    full: BOOLEAN
    fuzzy_index (other: STRING; start, fuzz: INTEGER): INTEGER
    Growth_percentage: INTEGER
    has (c: CHARACTER): BOOLEAN
    hash_code: INTEGER
    index_of (c: CHARACTER; start: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_boolean: BOOLEAN
    is_double: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] FONTNAME_ALIAS): BOOLEAN
    is_hashable: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_integer: BOOLEAN
    is_real: BOOLEAN
    item (i: INTEGER): CHARACTER
    item_code (i: INTEGER): INTEGER
    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
    linear_representation: LINEAR [CHARACTER]
    max (other: [like Current] FONTNAME_ALIAS): [like Current] FONTNAME_ALIAS
    min (other: [like Current] FONTNAME_ALIAS): [like Current] FONTNAME_ALIAS
    Minimal_increase: INTEGER
    mirrored: [like Current] FONTNAME_ALIAS
    object_comparison: BOOLEAN
    occurrences (c: CHARACTER): INTEGER
    out: [like Current] FONTNAME_ALIAS
    prunable: BOOLEAN
    resizable: BOOLEAN
    shared_with (other: [like Current] FONTNAME_ALIAS): BOOLEAN
    split (a_separator: CHARACTER): LIST [STRING]
    substring (n1, n2: INTEGER): [like Current] FONTNAME_ALIAS
    substring_index (other: STRING; start: INTEGER): INTEGER
    three_way_comparison (other: [like Current] FONTNAME_ALIAS): INTEGER
    to_boolean: BOOLEAN
    to_c: ANY
    to_double: DOUBLE
    to_integer: INTEGER
    to_real: REAL
    True_constant: STRING
    valid_index (i: INTEGER): BOOLEAN

Commands
    adapt_size
    append (s: STRING)
    append_boolean (b: BOOLEAN)
    append_character (c: CHARACTER)
    append_double (d: DOUBLE)
    append_integer (i: INTEGER)
    append_real (r: REAL)
    append_string (s: STRING)
    automatic_grow
    center_justify
    character_justify (pivot: CHARACTER; position: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] FONTNAME_ALIAS)
    extend (c: CHARACTER)
    fill (other: CONTAINER [CHARACTER])
    fill_blank
    fill_character (c: CHARACTER)
    from_c (c_string: POINTER)
    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
    grow (newsize: INTEGER)
    head (n: INTEGER)
    insert (s: STRING; i: INTEGER)
    left_adjust
    left_justify
    make_from_c (c_string: POINTER)
    make_from_string (s: STRING)
    mirror
    multiply (n: INTEGER)
    precede (c: CHARACTER)
    prepend (s: STRING)
    prepend_boolean (b: BOOLEAN)
    prepend_character (c: CHARACTER)
    prepend_double (d: DOUBLE)
    prepend_integer (i: INTEGER)
    prepend_real (r: REAL)
    prepend_string (s: STRING)
    prune (c: CHARACTER)
    prune_all (c: CHARACTER)
    prune_all_leading (c: CHARACTER)
    prune_all_trailing (c: CHARACTER)
    put (c: CHARACTER; i: INTEGER)
    remove (i: INTEGER)
    replace_blank
    replace_character (c: CHARACTER)
    replace_substring (s: [like Current] FONTNAME_ALIAS; start_pos, end_pos: INTEGER)
    replace_substring_all (original, new: [like Current] FONTNAME_ALIAS)
    resize (newsize: INTEGER)
    right_adjust
    right_justify
    set (t: [like Current] FONTNAME_ALIAS; n1, n2: INTEGER)
    share (other: [like Current] FONTNAME_ALIAS)
    subcopy (other: [like Current] FONTNAME_ALIAS; start_pos, end_pos, index_pos: INTEGER)
    tail (n: INTEGER)
    to_lower
    to_upper
    wipe_out


FONTNAME_ALIAS Flat contracts

indexing
    description: "OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    FONTNAME_ALIAS

create

    make (n: INTEGER)
            -- Allocate space for at least n characters.
            -- (from STRING)
        require -- from STRING
            non_negative_size: n >= 0
        ensure -- from STRING
            empty_string: count = 0
            area_allocated: capacity >= n

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        ensure -- from STRING
            shared_implementation: shared_with (s)

    make_from_alias (an_alias: STRING)
            -- Create from alias
        require
            non_void_alias: an_alias /= void

feature -- Initialization

    adapt (s: STRING): like Current
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)

    from_c (c_string: POINTER)
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        ensure -- from STRING
            no_zero_byte: not has ('%U')

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        ensure -- from STRING
            shared_implementation: shared_with (s)

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?
            -- (from STRING)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    hash_code: INTEGER
            -- Hash code value
            -- (from STRING)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    index_of (c: CHARACTER; start: INTEGER): INTEGER
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    item (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

    item_code (i: INTEGER): INTEGER
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
            -- Position of last occurrence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    shared_with (other: like Current): BOOLEAN
            -- Does string share the text of other?
            -- (from STRING)

    substring_index (other: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Allocated space
            -- (from STRING)

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from STRING)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER
            -- Number of times c appears in the string
            -- (from STRING)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_boolean: BOOLEAN
            -- Does Current represent a BOOLEAN?
            -- (from STRING)

    is_double: BOOLEAN
            -- Does Current represent a DOUBLE?
            -- (from STRING)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_integer: BOOLEAN
            -- Does Current represent an INTEGER?
            -- (from STRING)

    is_real: BOOLEAN
            -- Does Current represent a REAL?
            -- (from STRING)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from STRING)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the string?
            -- (from STRING)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: STRING)
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + old s.count

    append_boolean (b: BOOLEAN)
            -- Append the string representation of b at end.
            -- (from STRING)

    append_character (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    append_double (d: DOUBLE)
            -- Append the string representation of d at end.
            -- (from STRING)

    append_integer (i: INTEGER)
            -- Append the string representation of i at end.
            -- (from STRING)

    append_real (r: REAL)
            -- Append the string representation of r at end.
            -- (from STRING)

    append_string (s: STRING)
            -- Append a copy of s, if not void, at end.
            -- (from STRING)

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count

    extend (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_blank
            -- Fill with capacity blank characters.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    fill_character (c: CHARACTER)
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    head (n: INTEGER)
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    insert (s: STRING; i: INTEGER)
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count + s.count

    left_adjust
            -- Remove leading whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '   ') and (item (1) /= '%R') and (item (1) /= ''))

    precede (c: CHARACTER)
            -- Add c at front.
            -- Was declared in STRING as synonym of prepend_character.
            -- (from STRING)
        ensure -- from STRING
            new_count: count = old count + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + s.count

    prepend_boolean (b: BOOLEAN)
            -- Prepend the string representation of b at front.
            -- (from STRING)

    prepend_character (c: CHARACTER)
            -- Add c at front.
            -- Was declared in STRING as synonym of precede.
            -- (from STRING)
        ensure -- from STRING
            new_count: count = old count + 1

    prepend_double (d: DOUBLE)
            -- Prepend the string representation of d at front.
            -- (from STRING)

    prepend_integer (i: INTEGER)
            -- Prepend the string representation of i at front.
            -- (from STRING)

    prepend_real (r: REAL)
            -- Prepend the string representation of r at front.
            -- (from STRING)

    prepend_string (s: STRING)
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)

    put (c: CHARACTER; i: INTEGER)
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    replace_blank
            -- Replace all current characters with blanks.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_character (c: CHARACTER)
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_substring (s: like Current; start_pos, end_pos: INTEGER)
            -- Replace characters from start_pos to end_pos with s.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1

    replace_substring_all (original, new: like Current)
            -- Replace every occurrence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty

    right_adjust
            -- Remove trailing whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '   ') and (item (count) /= '%R') and (item (count) /= ''))

    set (t: like Current; n1, n2: INTEGER)
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))

    share (other: like Current)
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        ensure -- from STRING
            shared_count: other.count = count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)

    tail (n: INTEGER)
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    infix "+" (s: STRING): STRING
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count

feature -- Removal

    clear_all
            -- Reset all characters.
            -- (from STRING)
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity

    prune (c: CHARACTER)
            -- Remove first occurrence of c, if any.
            -- (from STRING)
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True

    prune_all (c: CHARACTER)
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))

    prune_all_leading (c: CHARACTER)
            -- Remove all leading occurrences of c.
            -- (from STRING)

    prune_all_trailing (c: CHARACTER)
            -- Remove all trailing occurrences of c.
            -- (from STRING)

    remove (i: INTEGER)
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count - 1

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature -- Resizing

    adapt_size
            -- Adapt the size to accommodate count characters.
            -- (from STRING)

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (newsize: INTEGER)
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (newsize: INTEGER)
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0

feature -- Conversion

    center_justify
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)

    character_justify (pivot: CHARACTER; position: INTEGER)
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty

    left_justify
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from STRING)

    mirror
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: count = old count

    mirrored: like Current
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: Result.count = count

    right_justify
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)

    split (a_separator: CHARACTER): LIST [STRING]
            -- Split on a_separator.
            -- (from STRING)
        ensure -- from STRING
            Result /= void

    to_boolean: BOOLEAN
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

    to_double: DOUBLE
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double

    to_integer: INTEGER
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer

    to_lower
            -- Convert to lower case.
            -- (from STRING)

    to_real: REAL
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real

    to_upper
            -- Convert to upper case.
            -- (from STRING)

feature -- Duplication

    multiply (n: INTEGER)
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1

    substring (n1, n2: INTEGER): like Current
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0

feature -- Output

    out: like Current
            -- Printable representation
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

end -- class FONTNAME_ALIAS


FONTSIZE_ALIAS Chart

class
    FONTSIZE_ALIAS

General
    cluster: com.Structures
    description: "OLE Automation."
    create: make_by_pointer, make_from_alias, make

Ancestors
    ECOM_CURRENCY

Queries
    infix "-" (other: ECOM_CURRENCY): ECOM_CURRENCY
    infix "+" (other: ECOM_CURRENCY): ECOM_CURRENCY
    infix "^" (other: NUMERIC): NUMERIC
    infix "/" (other: ECOM_CURRENCY): ECOM_CURRENCY
    infix "*" (other: ECOM_CURRENCY): ECOM_CURRENCY
    prefix "-": ECOM_CURRENCY
    prefix "+": ECOM_CURRENCY
    absolute: ECOM_CURRENCY
    ceiled_integer_portion: ECOM_CURRENCY
    divisible (other: ECOM_CURRENCY): BOOLEAN
    exists: BOOLEAN
    exponentiable (other: ECOM_CURRENCY): BOOLEAN
    high_bits: INTEGER
    is_equal (other: [like Current] FONTSIZE_ALIAS): BOOLEAN
    item: POINTER
    low_bits: INTEGER
    multiply_integer (an_integer: INTEGER): ECOM_CURRENCY
    one: ECOM_CURRENCY
    rounded (value: INTEGER): ECOM_CURRENCY
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER
    truncated_to_double: DOUBLE
    truncated_to_integer_portion: ECOM_CURRENCY
    zero: ECOM_CURRENCY

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make
    make_from_decimal (dec_value: ECOM_DECIMAL)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_high_bits (an_integer: INTEGER)
    set_low_bits (an_integer: INTEGER)
    set_shared
    set_unshared
    set_value (source: [like Current] FONTSIZE_ALIAS)


FONTSIZE_ALIAS Flat contracts

indexing
    description: "OLE Automation."
    note: "Automatically generated by the EiffelCOM Wizard."

class interface
    FONTSIZE_ALIAS

create

    make
            -- (from ECOM_CURRENCY)

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_from_alias (an_alias: ECOM_CURRENCY)
            -- Create from alias
        require
            non_void_alias: an_alias /= void

feature -- Initialization

    make
            -- (from ECOM_CURRENCY)

    make_from_decimal (dec_value: ECOM_DECIMAL)
            -- Create with value 'dec_value'
            -- (from ECOM_CURRENCY)

feature -- Access

    high_bits: INTEGER
            -- High 32 bits of currency.
            -- (from ECOM_CURRENCY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    low_bits: INTEGER
            -- Low 32 bits of currency.
            -- (from ECOM_CURRENCY)

    one: ECOM_CURRENCY
            -- Neutral element for * operation
            -- (from ECOM_CURRENCY)
        ensure -- from NUMERIC
            result_exists: Result /= void

    zero: ECOM_CURRENCY
            -- Neutral element for + operation
            -- (from ECOM_CURRENCY)
        ensure -- from NUMERIC
            result_exists: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size of CY (CURRENCY) structure.
            -- (from ECOM_CURRENCY)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    absolute: ECOM_CURRENCY
            -- Absolute value of currency
            -- (from ECOM_CURRENCY)
        ensure -- from ECOM_CURRENCY
            valid_result: Result /= void

    ceiled_integer_portion: ECOM_CURRENCY
            -- Integer portion of currency value. The first negative
            -- integer >= to the value is returned if the value is negative.
            -- (from ECOM_CURRENCY)
        ensure -- from ECOM_CURRENCY
            valid_result: Result /= void

    rounded (value: INTEGER): ECOM_CURRENCY
            -- Round value with value decimal places
            -- (from ECOM_CURRENCY)
        require -- from ECOM_CURRENCY
            valid_value: value >= 0
        ensure -- from ECOM_CURRENCY
            valid_result: Result /= void

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

    truncated_to_double: DOUBLE
            -- Truncated to DOUBLE
            -- (from ECOM_CURRENCY)
        require -- from ECOM_CURRENCY
            valid_item: item /= default_pointer

    truncated_to_integer_portion: ECOM_CURRENCY
            -- Integer portion of a currency value. The first negative integer
            -- <= to the value is returned if the value is negative.
            -- (from ECOM_CURRENCY)
        ensure -- from ECOM_CURRENCY
            valid_result: Result /= void

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    multiply_integer (an_integer: INTEGER): ECOM_CURRENCY
            -- Multiply by an_integer
            -- (from ECOM_CURRENCY)
        ensure -- from ECOM_CURRENCY
            valid_result: Result /= void

    infix "*" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Multiply by other
            -- (from ECOM_CURRENCY)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "+" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Add with other
            -- (from ECOM_CURRENCY)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void
            commutative: equal (Result, other + Current)

    prefix "+": ECOM_CURRENCY
            -- Unary plus
            -- (from ECOM_CURRENCY)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "-" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Subtract with other
            -- (from ECOM_CURRENCY)
        require -- from NUMERIC
            other_exists: other /= void
        ensure -- from NUMERIC
            result_exists: Result /= void

    prefix "-": ECOM_CURRENCY
            -- Negative value of currency
            -- (from ECOM_CURRENCY)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "/" (other: ECOM_CURRENCY): ECOM_CURRENCY
            -- Division by 'other'
            -- (from ECOM_CURRENCY)
        require -- from NUMERIC
            other_exists: other /= void
            good_divisor: divisible (other)
        ensure -- from NUMERIC
            result_exists: Result /= void

    infix "^" (other: NUMERIC): NUMERIC
            -- Current objects to the power 'other'
            -- (from ECOM_CURRENCY)

feature -- Basic Operations

    set_value (source: like Current)
            -- Set Current to 'source'.
            -- (from ECOM_STRUCTURE)
        require -- from ECOM_STRUCTURE
            non_void: source /= void
            valid_source: source.item /= default_pointer

feature -- Element Change

    set_high_bits (an_integer: INTEGER)
            -- Set high_bits with an_integer.
            -- (from ECOM_CURRENCY)
        ensure -- from ECOM_CURRENCY
            high_bits_set: high_bits = an_integer

    set_low_bits (an_integer: INTEGER)
            -- Set 'low_bits' with 'an_integer'.
            -- (from ECOM_CURRENCY)
        ensure -- from ECOM_CURRENCY
            low_bits_set: low_bits = an_integer

feature -- status report

    divisible (other: ECOM_CURRENCY): BOOLEAN
            -- Is divisible by other?
            -- (from ECOM_CURRENCY)
        require -- from NUMERIC
            other_exists: other /= void

    exponentiable (other: ECOM_CURRENCY): BOOLEAN
            -- Is exponentiable by other?
            -- (from ECOM_CURRENCY)
        require -- from NUMERIC
            other_exists: other /= void

    is_equal (other: like Current): BOOLEAN
            -- Is 'other' the same as Current object?
            -- (from ECOM_CURRENCY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class FONTSIZE_ALIAS


HRESULT_FORMATTER Chart

class
    HRESULT_FORMATTER

General
    cluster: com.Structures
    description: "HRESULT_FORMATTER"

Ancestors
    MEMORY


cluster com.Support

Cluster
    com.Support

Supercluster
    com

Classes
    ECOM_COOKIE_GENERATOR
    ECOM_GUID_ROUTINES
    ECOM_ROUTINES
    ECOM_WRAPPER


ECOM_COOKIE_GENERATOR Chart

class
    ECOM_COOKIE_GENERATOR

General
    cluster: com.Support
    description: "Cookie generator."
    create: default_create

Ancestors
    ANY

Queries
    available_key_pool: LINKED_LIST [INTEGER]
    counter: INTEGER
    next_key: INTEGER

Commands
    add_key_to_pool (a_key: INTEGER)


ECOM_COOKIE_GENERATOR Flat contracts

indexing
    description: "Cookie generator."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_COOKIE_GENERATOR

create

feature -- Access

    available_key_pool: LINKED_LIST [INTEGER]
            -- Pool of available keys.

    counter: INTEGER
            -- Current biggest key.

feature -- Basic operations

    add_key_to_pool (a_key: INTEGER)
            -- Add a_key to available key pool.
        require
            valid_key: a_key >= 0 and a_key <= counter
        ensure
            non_void_pool: available_key_pool /= void
            pool_extended: available_key_pool.has (a_key)

    next_key: INTEGER
            -- Next available key.
        ensure
            valid_counter: 0 < counter
            valid_key: Result <= counter

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_COOKIE_GENERATOR


ECOM_GUID_ROUTINES Chart

class
    ECOM_GUID_ROUTINES

General
    cluster: com.Support
    description: "COM GUID routines"

Ancestors
    ANY

Queries
    is_valid_guid_string (s: STRING): BOOLEAN


ECOM_GUID_ROUTINES Flat contracts

indexing
    description: "COM GUID routines"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_GUID_ROUTINES

feature -- Status report

    is_valid_guid_string (s: STRING): BOOLEAN
            -- Is s a valid GUID?
        require
            valid_string: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_GUID_ROUTINES


ECOM_ROUTINES Chart

class
    ECOM_ROUTINES

General
    cluster: com.Support
    description: "COM Routines"

Ancestors
    ANY

Queries
    Guid_routines: ECOM_GUID_ROUTINES


ECOM_ROUTINES Flat contracts

indexing
    description: "COM Routines"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_ROUTINES

feature -- Access
--	com_api: ECOM_COM is
--		once
--			create Result
--		end

    guid_routines: ECOM_GUID_ROUTINES

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_ROUTINES


ECOM_WRAPPER Chart

deferred class
    ECOM_WRAPPER

General
    cluster: com.Support
    description: "Wrapper of C structures and Interfaces"

Ancestors
    ANY
    ECOM_EXCEPTION_CODES
    MEMORY

Queries
    exists: BOOLEAN
    item: POINTER

Commands
    make_from_pointer (a_pointer: POINTER)

Constraints
    wrapper invariant


ECOM_WRAPPER Flat contracts

indexing
    description: "Wrapper of C structures and Interfaces"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    ECOM_WRAPPER

feature -- Initialization

    make_from_pointer (a_pointer: POINTER)
            -- Initialize
        require
            valid_pointer: a_pointer /= default_pointer
        ensure
            wrapper_exist: initializer /= default_pointer and then exists
            valid_item: item = a_pointer

feature -- Access

    exists: BOOLEAN
            -- Is wrapped structure initialized?

    item: POINTER
            -- Pointer to COM structure

invariant

    wrapper_invariant: initializer /= default_pointer and then exists
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_WRAPPER


Eiffel2Java

Type: Library
Platform: Any
Version: 5.0

See:

  • Content
  • Samples
  • Reference


Eiffel to Java Interface

Introduction

The Java interface allows you to call Java routines or attributes from your Eiffel code. It uses the Java Native Interface (JNI) provided by the Java Development Kit (JDK) 1.1.8. You can get more information about the JNI at:

http://java.sun.com/products/jdk/1.1/docs/guide/jni/index.html

Requirements

  • JDK 1.1.8 should be correctly set up (download it at http://java.sun.com/products/jdk/1.1/index.html)
  • The environment variable CLASSPATH should defined (check with the JDK documentation on how to do so) and that it contains the Java classes you want to access.
  • The environment variable JDK_HOME should be set to the installation directory of the JDK (e.g. D:\apps\jdk1.1.8).

Borland users

On Windows, the JDK includes a set of C libraries which have been compiled for the Microsoft C compiler. Before being able to use the JDK from Eiffel you need to perform the following operation:

  1. In $JDK_HOME\lib, rename javai.lib into javai.lib.microsoft
  2. From the DOS command prompt and in the directory $JDK_HOME\lib, launch the following command
    %ISE_EIFFEL%\bcc55\bin\implib javai.lib..\bin\javai.dll

Limitations

  • In this version, you can only use one JNI environment.
  • Only one thread can interact with the Java Virtual Machine (JVM).
  • It is not possible to call Eiffel features from Java program.
  • The Eifffel feature `destroy_vm' of `JAVA_VM' calls a C function of the Java Native Interface that is not fully implemented in jdk 1.1.8. This function, called DestroyJavaVM, always returns -1 in jdk 1.1.8. For further information, go on the JNI pages at the address above.

Interface classes

JNI_ENVIRONMENT

Holds information about JNI environment. Potentially many JNI environments can exists at once, but more than one was never tested. This class provide the facilities to interact with the JVM:

  • creation of instances of Java Classes
  • exceptions mechanism
  • destruction of the JVM

SHARED_JNI_ENVIRONMENT

Shared JNI environment. Since one JNI is needed per thread we limit Eiffel to having one thread that deals with Java. The class that calls Java routines or attributes must inherit from this class.

JAVA_VM

This class is used to initially load the JVM into the running program. This is the Eiffel representation of the JVM.

JAVA_CLASS

Access to Java classes. Static methods and attributes are accessed via this class.This is the Eiffel representation of a Java Class.

JAVA_OBJECT

This class gives Eiffel access to Java objects. You can use it directly or inherit from to and create a more convienient Eiffel class that makes the Java object look like an Eiffel object. The Eiffel representation of a Java Object.

Warning: to access the static fields or routines of a Java Class, you have to use the features of a JAVA_CLASS instance!!

JAVA_EXTERNALS

JNI external declarations. Don't use this class directly.

JAVA_***_ARRAY

Access to Java array of "***". "***" can be all the usual types of Java (byte, short, int, float, double, char, boolean) or object if it is an array of Java Object (a String is considered as an object)

JAVA_ARGS

Class representing the arguments that can be passed to a Java method. See below about the signature of the methods

JAVA_OBJECT_TABLE

This class provides a mapping between Java and Eiffel objects

Mapping the Eiffel classes and the Java types:

The following table describes the mapping of Java primitive types and classes to Eiffel classes.

Java type/class | Eiffel class
boolean | BOOLEAN
char, byte | CHARACTER
short, int | INTEGER
long | INTEGER_64
float | REAL
double | DOUBLE
String | STRING
void | Void

The interface does the mapping automatically. For example, if you call a Java method that returns a 'float', by using float_method you will get a REAL.

The signature of Java methods and attributes:

When you want to call a Java method or access a field, you need to specify its signature. The Eiffel to Java interface follows the JNI specifications. The table below summarizes the encoding for the Java type signatures:

Signature | Java Type
Z | boolean
B | byte
C | char
S | short
I | int
J | long
F | float
D | double
V | void
[type | type []

The signature for a Java class has the following form:

L fully-qualified-class ;

For example, class String:
Ljava/lang/String;

The signature for a method has the following form:

( arguments-types ) returned-types

For example, the signature of a method that takes as arguments an integer and a string and return void is:
(ILjava/lang/String;)V


cluster eiffel2java

Cluster
    eiffel2java

Classes
    JAVA_ARGS
    JAVA_ARRAY
    JAVA_BOOLEAN_ARRAY
    JAVA_BYTE_ARRAY
    JAVA_CHAR_ARRAY
    JAVA_CLASS
    JAVA_DOUBLE_ARRAY
    JAVA_EXTERNALS
    JAVA_FLOAT_ARRAY
    JAVA_INT_ARRAY
    JAVA_LONG_ARRAY
    JAVA_OBJECT
    JAVA_OBJECT_ARRAY
    JAVA_OBJECT_TABLE
    JAVA_SHORT_ARRAY
    JAVA_VM
    JNI_ENVIRONMENT
    SHARED_JNI_ENVIRONMENT


JAVA_ARGS Chart

class
    JAVA_ARGS

General
    cluster: eiffel2java
    description: "Argument list for calls to Java methods"
    create: make

Ancestors
    MEMORY
    SHARED_JNI_ENVIRONMENT

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    count: INTEGER
    Eiffel_memory: INTEGER
    full: BOOLEAN
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    Jni: JNI_ENVIRONMENT
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    Total_memory: INTEGER

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    disable_time_accounting
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    make (ncount: INTEGER)
    mem_free (addr: POINTER)
    push_array (value: JAVA_ARRAY)
    push_boolean (value: BOOLEAN)
    push_char (value: CHARACTER)
    push_double (value: DOUBLE)
    push_float (value: REAL)
    push_int (value: INTEGER)
    push_object (value: JAVA_OBJECT)
    push_short (value: INTEGER)
    push_string (value: STRING)
    reset
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)


JAVA_ARGS Flat contracts

indexing
    description: "Argument list for calls to Java methods"

class interface
    JAVA_ARGS

create

    make (ncount: INTEGER)
            -- make an argument list for at most "ncount" arguments
        require
            ncount >= 1
        ensure
            java_args_array /= default_pointer
            count = ncount

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)

    collecting: BOOLEAN
            -- Is garbage collection enabled?
            -- (from MEMORY)

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.
            -- (from MEMORY)

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.
            -- (from MEMORY)

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)

    collection_off
            -- Disable garbage collection.
            -- (from MEMORY)

    collection_on
            -- Enable garbage collection.
            -- (from MEMORY)

    disable_time_accounting
            -- Disable GC time accounting (default).
            -- (from MEMORY)

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)

feature

    count: INTEGER
            -- number of positions in the arg list

    full: BOOLEAN
            -- true if argument list is full

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (ncount: INTEGER)
            -- make an argument list for at most "ncount" arguments
        require
            ncount >= 1
        ensure
            java_args_array /= default_pointer
            count = ncount

    push_array (value: JAVA_ARRAY)
            -- add a "array" argument (Void allowed)
        require
            not full

    push_boolean (value: BOOLEAN)
            -- add a "boolean" argment
        require
            not full

    push_char (value: CHARACTER)
            -- add a "character" argument
        require
            not full

    push_double (value: DOUBLE)
            -- add a "double" argument
        require
            not full

    push_float (value: REAL)
            -- add a "float" argument
        require
            not full

    push_int (value: INTEGER)
            -- add "integer" argument
        require
            not full

    push_object (value: JAVA_OBJECT)
            -- add an "object" argument (Void allowed)
        require
            not full

    push_short (value: INTEGER)
            -- add a "short" argument
        require
            not full

    push_string (value: STRING)
            -- add "string" argument
        require
            not full

    reset
            -- reset the argument list

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class JAVA_ARGS


JAVA_ARRAY Chart

class
    JAVA_ARRAY

General
    cluster: eiffel2java
    description: "parent of all Java array classes that contains the common routines to all arrays. Not to be used directly, instead use the class with array of specific type."
    create: make_from_pointer

Ancestors
    JAVA_EXTERNALS
    SHARED_JNI_ENVIRONMENT

Queries
    count: INTEGER
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make_from_pointer (p: POINTER)

Constraints


JAVA_ARRAY Flat contracts

indexing
    description: "parent of all Java array classes that contains the common routines to all arrays. Not to be used directly, instead use the class with array of specific type."

class interface
    JAVA_ARRAY

create

feature

    count: INTEGER
            -- number of cells in this array

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
        require
            valid: p /= default_pointer

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

    jarray /= default_pointer
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class JAVA_ARRAY


JAVA_BOOLEAN_ARRAY Chart

class
    JAVA_BOOLEAN_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of booleans. In Java it would be declared as 'boolean arr[]'"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): BOOLEAN
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem: BOOLEAN; index: INTEGER)


JAVA_BOOLEAN_ARRAY Flat contracts

indexing
    description: "Access to Java array of booleans. In Java it would be declared as 'boolean arr[]'"

class interface
    JAVA_BOOLEAN_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): BOOLEAN
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: BOOLEAN; index: INTEGER)
            -- replace the item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_BOOLEAN_ARRAY


JAVA_BYTE_ARRAY Chart

class
    JAVA_BYTE_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of bytes. Bytes are represented as CHARACTER in Eiffel."
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): CHARACTER
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem: CHARACTER; index: INTEGER)


JAVA_BYTE_ARRAY Flat contracts

indexing
    description: "Access to Java array of bytes. Bytes are represented as CHARACTER in Eiffel."

class interface
    JAVA_BYTE_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): CHARACTER
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: CHARACTER; index: INTEGER)
            -- put new item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_BYTE_ARRAY


JAVA_CHAR_ARRAY Chart

class
    JAVA_CHAR_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of characters"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): CHARACTER
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem: CHARACTER; index: INTEGER)


JAVA_CHAR_ARRAY Flat contracts

indexing
    description: "Access to Java array of characters"

class interface
    JAVA_CHAR_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): CHARACTER
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: CHARACTER; index: INTEGER)
            -- put item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_CHAR_ARRAY


JAVA_CLASS Chart

class
    JAVA_CLASS

General
    cluster: eiffel2java
    description: "Access to Java classes. Static methods and attributes are accessed via this class"
    create: make

Ancestors
    JAVA_OBJECT

Queries
    boolean_attribute (fid: POINTER): BOOLEAN
    boolean_method (mid: POINTER; args: JAVA_ARGS): BOOLEAN
    byte_attribute (fid: POINTER): CHARACTER
    byte_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
    char_attribute (fid: POINTER): CHARACTER
    char_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
    double_attribute (fid: POINTER): DOUBLE
    double_method (mid: POINTER; args: JAVA_ARGS): DOUBLE
    field_id (fname, sig: STRING): POINTER
    float_attribute (fid: POINTER): REAL
    float_method (mid: POINTER; args: JAVA_ARGS): REAL
    integer_attribute (fid: POINTER): INTEGER
    integer_method (mid: POINTER; args: JAVA_ARGS): INTEGER
    Jni: JNI_ENVIRONMENT
    method_id (mname, sig: STRING): POINTER
    name: STRING
    object_attribute (fid: POINTER): JAVA_OBJECT
    object_method (lmethod_id: POINTER; args: JAVA_ARGS): JAVA_OBJECT
    short_attribute (fid: POINTER): INTEGER
    short_method (mid: POINTER; args: JAVA_ARGS): INTEGER
    string_attribute (fid: POINTER): STRING
    string_method (lmethod_id: POINTER; args: JAVA_ARGS): STRING

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    long_method (mid: POINTER; args: JAVA_ARGS)
    make_from_pointer (jobject: POINTER)
    set_boolean_attribute (fid: POINTER; value: BOOLEAN)
    set_byte_attribute (fid: POINTER; value: CHARACTER)
    set_char_attribute (fid: POINTER; value: CHARACTER)
    set_double_attribute (fid: POINTER; value: DOUBLE)
    set_float_attribute (fid: POINTER; value: REAL)
    set_integer_attribute (fid: POINTER; value: INTEGER)
    set_object_attribute (fid: POINTER; value: JAVA_OBJECT)
    set_short_attribute (fid: POINTER; value: INTEGER)
    set_string_attribute (fid: POINTER; value: STRING)
    void_method (lmethod_id: POINTER; args: JAVA_ARGS)


JAVA_CLASS Flat contracts

indexing
    description: "Access to Java classes. Static methods and attributes are accessed via this class"

class interface
    JAVA_CLASS

create

feature

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    name: STRING
            -- name of this class

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

feature -- Setting static attributes

    set_boolean_attribute (fid: POINTER; value: BOOLEAN)
            -- set a 'boolean' attribute to 'value'

    set_byte_attribute (fid: POINTER; value: CHARACTER)
            -- set a 'byte' attribute to 'value'

    set_char_attribute (fid: POINTER; value: CHARACTER)
            -- set a 'char' attribute to 'value'

    set_double_attribute (fid: POINTER; value: DOUBLE)
            -- set a 'double' attribute to 'value'

    set_float_attribute (fid: POINTER; value: REAL)
            -- set a 'float' attribute to 'value'

    set_integer_attribute (fid: POINTER; value: INTEGER)
            -- set an 'integer' attribute to 'value'

    set_object_attribute (fid: POINTER; value: JAVA_OBJECT)
            -- set a java object attribute to 'value'

    set_short_attribute (fid: POINTER; value: INTEGER)
            -- set a 'short' attribute to 'value'

    set_string_attribute (fid: POINTER; value: STRING)
            -- set a 'String' attribute to 'value'

feature -- access to static attributes

    boolean_attribute (fid: POINTER): BOOLEAN
            -- access to a boolean attribute

    byte_attribute (fid: POINTER): CHARACTER
            -- access to a 'byte' attribute, returns a CHARACTER

    char_attribute (fid: POINTER): CHARACTER
            -- access to a 'char' attribute

    double_attribute (fid: POINTER): DOUBLE
            -- access to a double attribute

    float_attribute (fid: POINTER): REAL
            -- access to a 'float' attribute, returns a REAL

    integer_attribute (fid: POINTER): INTEGER
            -- get a value of an integer static field

    object_attribute (fid: POINTER): JAVA_OBJECT
            -- get the value of OBJECT static field

    short_attribute (fid: POINTER): INTEGER
            -- access to a 'short' attribute, returns a INTEGER

    string_attribute (fid: POINTER): STRING
            -- get the value of STRING static field

feature -- attribute ids

    field_id (fname: STRING; sig: STRING): POINTER
            -- Get the java field id of a static field, used to set/get this field
        require -- from JAVA_OBJECT
            (lname /= void) and (sig /= void)
        require else
            (fname /= void) and (sig /= void)

feature -- call object's methods

    long_method (mid: POINTER; args: JAVA_ARGS)
            -- Call an instance function that returns an Long. This
            -- function is not implemented.
            -- (from JAVA_OBJECT)

feature -- calling static methods

    boolean_method (mid: POINTER; args: JAVA_ARGS): BOOLEAN
            -- Call a static function that returns a BOOLEAN.
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    byte_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
            -- Call a static function that returns a byte
            -- (represented as CHARACTER in Eiffel)
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    char_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
            -- Call a static function that returns a CHARACTER.
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    double_method (mid: POINTER; args: JAVA_ARGS): DOUBLE
            -- Call a static function that returns a DOUBLE.
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    float_method (mid: POINTER; args: JAVA_ARGS): REAL
            -- Call a static function that returns a REAL.
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    integer_method (mid: POINTER; args: JAVA_ARGS): INTEGER
            -- Call a static function that returns an INTEGER.
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    object_method (lmethod_id: POINTER; args: JAVA_ARGS): JAVA_OBJECT
            -- Call a static function that returns a JAVA_OBJECT. An
            -- Eiffl proxy object is returned.
        require -- from JAVA_OBJECT
            valid_method_id: lmethod_id /= default_pointer

    short_method (mid: POINTER; args: JAVA_ARGS): INTEGER
            -- Call a static function that returns a short
            -- (represented as INTEGER in Eiffel)
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    string_method (lmethod_id: POINTER; args: JAVA_ARGS): STRING
            -- Call static routine that returns a string
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

    void_method (lmethod_id: POINTER; args: JAVA_ARGS)
            -- call static method with specific ID, passing arguments
        require -- from JAVA_OBJECT
            valid_method: mid /= default_pointer

feature -- creation

    make_from_pointer (jobject: POINTER)
            -- Create an Eiffel proxy, give a pointer to a Java object
            -- (Java object already exists)
            -- (from JAVA_OBJECT)
        require -- from JAVA_OBJECT
            valid_java_id: jobject /= default_pointer

feature -- method ids - in a Java class these are all static

    method_id (mname: STRING; sig: STRING): POINTER
            -- Return "method_id" for a static method with "mname" and
            -- signature "sig" that belongs to this class.
        require -- from JAVA_OBJECT
            (method_name /= void) and (signature /= void)
        ensure -- from JAVA_OBJECT
            method_exists: Result /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_OBJECT
    valid_proxy: java_class_id /= default_pointer

end -- class JAVA_CLASS


JAVA_DOUBLE_ARRAY Chart

class
    JAVA_DOUBLE_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of doubles"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): DOUBLE
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem: DOUBLE; index: INTEGER)


JAVA_DOUBLE_ARRAY Flat contracts

indexing
    description: "Access to Java array of doubles"

class interface
    JAVA_DOUBLE_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): DOUBLE
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: DOUBLE; index: INTEGER)
            -- replace item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_DOUBLE_ARRAY


JAVA_EXTERNALS Chart

class
    JAVA_EXTERNALS

General
    cluster: eiffel2java
    description: "JNI external declarations"

Ancestors
    ANY

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)


JAVA_EXTERNALS Flat contracts

indexing
    description: "JNI external declarations"

class interface
    JAVA_EXTERNALS

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class JAVA_EXTERNALS


JAVA_FLOAT_ARRAY Chart

class
    JAVA_FLOAT_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of floats"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): REAL
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem: REAL; index: INTEGER)


JAVA_FLOAT_ARRAY Flat contracts

indexing
    description: "Access to Java array of floats"

class interface
    JAVA_FLOAT_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): REAL
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: REAL; index: INTEGER)
            -- replace item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_FLOAT_ARRAY


JAVA_INT_ARRAY Chart

class
    JAVA_INT_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of 'int'"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): INTEGER
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem, index: INTEGER)


JAVA_INT_ARRAY Flat contracts

indexing
    description: "Access to Java array of 'int'"

class interface
    JAVA_INT_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): INTEGER
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: INTEGER; index: INTEGER)
            -- put item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_INT_ARRAY


JAVA_LONG_ARRAY Chart

class
    JAVA_LONG_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of 'long'"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): INTEGER_64
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem, index: INTEGER_64)


JAVA_LONG_ARRAY Flat contracts

indexing
    description: "Access to Java array of 'long'"

class interface
    JAVA_LONG_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): INTEGER_64
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: INTEGER_64; index: INTEGER)
            -- put item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_LONG_ARRAY


JAVA_OBJECT_ARRAY Chart

class
    JAVA_OBJECT_ARRAY

General
    cluster: eiffel2java
    description: "Access to array of Java objects"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): JAVA_OBJECT
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER; element_name: STRING)
    make_from_pointer (p: POINTER)
    put (litem: JAVA_OBJECT; index: INTEGER)


JAVA_OBJECT_ARRAY Flat contracts

indexing
    description: "Access to array of Java objects"

class interface
    JAVA_OBJECT_ARRAY

create

    make (size: INTEGER; element_name: STRING)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
            element_ok: element_name /= void
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): JAVA_OBJECT
            -- object at index-th position
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER; element_name: STRING)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
            element_ok: element_name /= void
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: JAVA_OBJECT; index: INTEGER)
            -- put an object at index
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_OBJECT_ARRAY


JAVA_OBJECT Chart

class
    JAVA_OBJECT

General
    cluster: eiffel2java
    description: "This class gives Eiffel access to Java objects. You can use it directly or inherit from to and create a more convienient Eiffel class that makes the Java object look like an Eiffel object"
    create: create_instance, make_from_pointer

Ancestors
    JAVA_EXTERNALS
    SHARED_JNI_ENVIRONMENT

Queries
    boolean_attribute (fid: POINTER): BOOLEAN
    boolean_method (mid: POINTER; args: JAVA_ARGS): BOOLEAN
    byte_attribute (fid: POINTER): CHARACTER
    byte_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
    char_attribute (fid: POINTER): CHARACTER
    char_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
    double_attribute (fid: POINTER): DOUBLE
    double_method (mid: POINTER; args: JAVA_ARGS): DOUBLE
    field_id (lname, sig: STRING): POINTER
    float_attribute (fid: POINTER): REAL
    float_method (mid: POINTER; args: JAVA_ARGS): REAL
    integer_attribute (fid: POINTER): INTEGER
    integer_method (mid: POINTER; args: JAVA_ARGS): INTEGER
    Jni: JNI_ENVIRONMENT
    method_id (method_name, signature: STRING): POINTER
    object_attribute (fid: POINTER): JAVA_OBJECT
    object_method (lmethod_id: POINTER; args: JAVA_ARGS): JAVA_OBJECT
    short_attribute (fid: POINTER): INTEGER
    short_method (mid: POINTER; args: JAVA_ARGS): INTEGER
    string_attribute (fid: POINTER): STRING
    string_method (mid: POINTER; args: JAVA_ARGS): STRING

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    create_instance (my_cls: JAVA_CLASS; sig: STRING; args: JAVA_ARGS)
    long_method (mid: POINTER; args: JAVA_ARGS)
    make_from_pointer (jobject: POINTER)
    set_boolean_attribute (fid: POINTER; value: BOOLEAN)
    set_byte_attribute (fid: POINTER; value: CHARACTER)
    set_char_attribute (fid: POINTER; value: CHARACTER)
    set_double_attribute (fid: POINTER; value: DOUBLE)
    set_float_attribute (fid: POINTER; value: REAL)
    set_integer_attribute (fid: POINTER; value: INTEGER)
    set_object_attribute (fid: POINTER; value: JAVA_OBJECT)
    set_short_attribute (fid: POINTER; value: INTEGER)
    set_string_attribute (fid: POINTER; value: STRING)
    void_method (mid: POINTER; args: JAVA_ARGS)

Constraints
    valid proxy


JAVA_OBJECT Flat contracts

indexing
    description: "This class gives Eiffel access to Java objects. You can use it directly or inherit from to and create a more convienient Eiffel class that makes the Java object look like an Eiffel object"

class interface
    JAVA_OBJECT

create

    create_instance (my_cls: JAVA_CLASS; sig: STRING; args: JAVA_ARGS)
            -- Create an instance of the class by calling the
            -- constructor with the specified arguments. If "sig" is
            -- void then we assume that the contructor has no
            -- arguments. In that case "args" can be void
        require
            class_valid: my_cls /= void
            sig_and_args_consistent: (sig = void) implies (args = void)
        ensure
            created: java_object_id /= default_pointer

    make_from_pointer (jobject: POINTER)
            -- Create an Eiffel proxy, give a pointer to a Java object
            -- (Java object already exists)
        require
            valid_java_id: jobject /= default_pointer

feature

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

feature -- access object's attributes

    boolean_attribute (fid: POINTER): BOOLEAN
            -- access to a boolean attribute

    byte_attribute (fid: POINTER): CHARACTER
            -- access to a 'byte' attribute, returns a CHARACTER

    char_attribute (fid: POINTER): CHARACTER
            -- access to a 'char' attribute

    double_attribute (fid: POINTER): DOUBLE
            -- access to a double attribute

    float_attribute (fid: POINTER): REAL
            -- access to a 'float' attribute, returns a REAL

    integer_attribute (fid: POINTER): INTEGER
            -- access to an integer attribute

    object_attribute (fid: POINTER): JAVA_OBJECT
            -- access to a java object attribute

    short_attribute (fid: POINTER): INTEGER
            -- access to a 'short' attribute, returns a INTEGER

    string_attribute (fid: POINTER): STRING
            -- access to a String attribute

feature -- attribute IDs

    field_id (lname: STRING; sig: STRING): POINTER
            -- Get the java field id used to set/get this field
        require
            (lname /= void) and (sig /= void)

feature -- call object's methods

    boolean_method (mid: POINTER; args: JAVA_ARGS): BOOLEAN
            -- Call an instance function that returns a boolean
        require
            valid_method: mid /= default_pointer

    byte_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
            -- Call an instance function that return a byte
            -- ( 8-bit integer (signed) ), in Eiffel return
            -- a CHARACTER
        require
            valid_method: mid /= default_pointer

    char_method (mid: POINTER; args: JAVA_ARGS): CHARACTER
            -- Call an instance function that returns a char
        require
            valid_method: mid /= default_pointer

    double_method (mid: POINTER; args: JAVA_ARGS): DOUBLE
            -- Call an instance function that returns a DOUBLE.
        require
            valid_method: mid /= default_pointer

    float_method (mid: POINTER; args: JAVA_ARGS): REAL
            -- Call an instance function that returns a REAL.
        require
            valid_method: mid /= default_pointer

    integer_method (mid: POINTER; args: JAVA_ARGS): INTEGER
            -- Call an instance function that returns an INTEGER.
        require
            valid_method: mid /= default_pointer

    long_method (mid: POINTER; args: JAVA_ARGS)
            -- Call an instance function that returns an Long. This
            -- function is not implemented.

    object_method (lmethod_id: POINTER; args: JAVA_ARGS): JAVA_OBJECT
            -- Call an instance function that returns a java object
        require
            valid_method_id: lmethod_id /= default_pointer

    short_method (mid: POINTER; args: JAVA_ARGS): INTEGER
            -- Call an instance function that returns a Short (in
            -- Eiffel we still return an INTEGER).
        require
            valid_method: mid /= default_pointer

    string_method (mid: POINTER; args: JAVA_ARGS): STRING
            -- Call an instance function that returns a STRING.
        require
            valid_method: mid /= default_pointer

    void_method (mid: POINTER; args: JAVA_ARGS)
            -- Call a Java procedure with method_id "mid" and
            -- arguments "args.
        require
            valid_method: mid /= default_pointer

feature -- creation

    create_instance (my_cls: JAVA_CLASS; sig: STRING; args: JAVA_ARGS)
            -- Create an instance of the class by calling the
            -- constructor with the specified arguments. If "sig" is
            -- void then we assume that the contructor has no
            -- arguments. In that case "args" can be void
        require
            class_valid: my_cls /= void
            sig_and_args_consistent: (sig = void) implies (args = void)
        ensure
            created: java_object_id /= default_pointer

    make_from_pointer (jobject: POINTER)
            -- Create an Eiffel proxy, give a pointer to a Java object
            -- (Java object already exists)
        require
            valid_java_id: jobject /= default_pointer

feature -- method id's

    method_id (method_name: STRING; signature: STRING): POINTER
            -- Find the method_id for "method_name" with signature
            -- encoded by "signature"
        require
            (method_name /= void) and (signature /= void)
        ensure
            method_exists: Result /= default_pointer

feature -- setting object's attribute

    set_boolean_attribute (fid: POINTER; value: BOOLEAN)
            -- set a 'boolean' attribute to 'value'

    set_byte_attribute (fid: POINTER; value: CHARACTER)
            -- set a 'byte' attribute to 'value'

    set_char_attribute (fid: POINTER; value: CHARACTER)
            -- set a 'char' attribute to 'value'

    set_double_attribute (fid: POINTER; value: DOUBLE)
            -- set a 'double' attribute to 'value'

    set_float_attribute (fid: POINTER; value: REAL)
            -- set a 'float' attribute to 'value'

    set_integer_attribute (fid: POINTER; value: INTEGER)
            -- set an 'integer' attribute to 'value'

    set_object_attribute (fid: POINTER; value: JAVA_OBJECT)
            -- set a java object attribute to 'value'

    set_short_attribute (fid: POINTER; value: INTEGER)
            -- set a 'short' attribute to 'value'

    set_string_attribute (fid: POINTER; value: STRING)
            -- set a 'String' attribute to 'value'

invariant

    valid_proxy: java_object_id /= default_pointer
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class JAVA_OBJECT


JAVA_OBJECT_TABLE Chart

class
    JAVA_OBJECT_TABLE

General
    cluster: eiffel2java
    description: "This class provides a mapping between Java and Eiffel objects"
    create: make

Ancestors
    ANY

Queries
    item (jobject: POINTER): JAVA_OBJECT

Commands
    put (object: JAVA_OBJECT)


JAVA_OBJECT_TABLE Flat contracts

indexing
    description: "This class provides a mapping between Java and Eiffel objects"

class interface
    JAVA_OBJECT_TABLE

create

    make
            -- create a table for Eiffel proxies of Java object

feature

    item (jobject: POINTER): JAVA_OBJECT
            -- find a Eiffel proxy for an Java object
        require
            jobject_not_void: jobject /= default_pointer

    put (object: JAVA_OBJECT)
            -- Add a new object to the table
        require
            jobject_not_void: (object /= void) and then (object.java_object_id /= default_pointer)
        ensure
            inserted: table.has (object.java_object_id.hash_code)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class JAVA_OBJECT_TABLE


JAVA_SHORT_ARRAY Chart

class
    JAVA_SHORT_ARRAY

General
    cluster: eiffel2java
    description: "Access to Java array of shorts (in Eiffel shorts are respresente as INTEGER)"
    create: make

Ancestors
    JAVA_ARRAY

Queries
    count: INTEGER
    item (index: INTEGER): INTEGER
    Jni: JNI_ENVIRONMENT
    valid_index (index: INTEGER): BOOLEAN

Commands
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    make (size: INTEGER)
    make_from_pointer (p: POINTER)
    put (litem, index: INTEGER)


JAVA_SHORT_ARRAY Flat contracts

indexing
    description: "Access to Java array of shorts (in Eiffel shorts are respresente as INTEGER)"

class interface
    JAVA_SHORT_ARRAY

create

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

feature

    count: INTEGER
            -- number of cells in this array
            -- (from JAVA_ARRAY)

    item (index: INTEGER): INTEGER
            -- item at "index"
        require
            valid_index (index)

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
            -- (from SHARED_JNI_ENVIRONMENT)
        ensure -- from SHARED_JNI_ENVIRONMENT
            Result /= void

    make (size: INTEGER)
            -- create a new Java array and an Eiffel accessor object
            -- Note: Java arrays are indexed from zero
        require
            size_ok: size > 0
        ensure
            array_ok: jarray /= default_pointer

    make_from_pointer (p: POINTER)
            -- make an Eiffel array accessor out of a pointer to a
            -- Java array
            -- (from JAVA_ARRAY)
        require -- from JAVA_ARRAY
            valid: p /= default_pointer

    put (litem: INTEGER; index: INTEGER)
            -- put item at "index"
        require
            valid_index (index)

    valid_index (index: INTEGER): BOOLEAN
            -- index is valid if it's between 0..count-1
            -- (from JAVA_ARRAY)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from JAVA_ARRAY
    jarray /= default_pointer

end -- class JAVA_SHORT_ARRAY


JAVA_VM Chart

class
    JAVA_VM

General
    cluster: eiffel2java
    description: "This class is used to initially load the JVM into the running program"
    create: make

Ancestors
    EXCEPTIONS

Queries
    assertion_violation: BOOLEAN
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    create_vm (class_path: STRING): JNI_ENVIRONMENT
    Developer_exception: INTEGER
    developer_exception_name: STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    Postcondition: INTEGER
    Precondition: INTEGER
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    Signal_exception: INTEGER
    tag_name: STRING
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER

Commands
    attach_current_thread
    catch (code: INTEGER)
    destroy_vm
    detach_current_thread
    die (code: INTEGER)
    ignore (code: INTEGER)
    make
    message_on_failure
    no_message_on_failure
    raise (name: STRING)


JAVA_VM Flat contracts

indexing
    description: "This class is used to initially load the JVM into the running program"

class interface
    JAVA_VM

create

    make
            -- Create a Java VM

feature -- Access

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Status report

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

feature

    attach_current_thread

    create_vm (class_path: STRING): JNI_ENVIRONMENT
            -- Create a JVM execution environment and specify a CLASSPATH
        require
            class_path_valid: class_path /= void

    destroy_vm
            -- destroy the JVM

    detach_current_thread

    make
            -- Create a Java VM

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class JAVA_VM


JNI_ENVIRONMENT Chart

class
    JNI_ENVIRONMENT

General
    cluster: eiffel2java
    description: "Holds information abouy JNI environment. Potentially many JNI environments can exists at once, but more than one was never tested"
    create: make

Ancestors
    JAVA_EXTERNALS

Queries
    find_class (name: STRING): JAVA_CLASS
    find_class_by_pointer (classp: POINTER): JAVA_CLASS
    find_class_pointer (name: STRING): POINTER

Commands
    attach_current_thread
    c_check_for_exceptions (lenv: POINTER)
    c_throw_custom_exception (lenv, jclass_id, msg: POINTER)
    c_throw_java_exception (lenv, jthrowable: POINTER)
    check_for_exceptions
    destroy_vm
    detach_current_thread
    throw_custom_exception (jclass: JAVA_CLASS; msg: STRING)
    throw_java_exception (jthrowable: JAVA_OBJECT)


JNI_ENVIRONMENT Flat contracts

indexing
    description: "Holds information abouy JNI environment. Potentially many JNI environments can exists at once, but more than one was never tested"

class interface
    JNI_ENVIRONMENT

create

feature

    destroy_vm
            -- destroy the JVM and reclaim its ressources
            -- !! can only be used in the main thread when it is the
            -- last remaining thread

    find_class (name: STRING): JAVA_CLASS
            -- Load in the Java class with the given name
        require
            name_valid: name /= void

    find_class_by_pointer (classp: POINTER): JAVA_CLASS
            -- Get a Java class Eiffel proxy given pointer to the
            -- Java class. Create a new one if needed
        require
            classp /= default_pointer

    find_class_pointer (name: STRING): POINTER
            -- find class pointer only (used during creation in descendants)

feature -- Exception mechanism

    check_for_exceptions
            -- Check if a Java exception occurred, raise Java exception occurred

    throw_custom_exception (jclass: JAVA_CLASS; msg: STRING)
            -- Constructs an exception object from the specified class 'jclass'
            -- with the message specified by 'msg' and causes that exception
            -- to be thrown.

    throw_java_exception (jthrowable: JAVA_OBJECT)
            -- throw the exception 'jthrowable' (must be a java.lang.Throwable object)

feature -- Java exception mechanism

    c_check_for_exceptions (lenv: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_custom_exception (lenv: POINTER; jclass_id: POINTER; msg: POINTER)
            -- (from JAVA_EXTERNALS)

    c_throw_java_exception (lenv: POINTER; jthrowable: POINTER)
            -- (from JAVA_EXTERNALS)

feature -- Thread Mechanism

    attach_current_thread

    detach_current_thread

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class JNI_ENVIRONMENT


SHARED_JNI_ENVIRONMENT Chart

class
    SHARED_JNI_ENVIRONMENT

General
    cluster: eiffel2java
    description: "Shared JNI environment. Since one JNI is needed per thread we limit Eiffel to having one thread that deals with Java."

Ancestors
    ANY

Queries
    Jni: JNI_ENVIRONMENT


SHARED_JNI_ENVIRONMENT Flat contracts

indexing
    description: "Shared JNI environment. Since one JNI is needed per thread we limit Eiffel to having one thread that deals with Java."

class interface
    SHARED_JNI_ENVIRONMENT

feature

    jni: JNI_ENVIRONMENT
            -- returns the standard JNI enviroment. It uses the value of
            -- CLASS_PATH environment variable to initialize the JVM
        ensure
            Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SHARED_JNI_ENVIRONMENT


Eiffel2Java Sample

Eiffel2Java

This example shows how to create an instance of the Java Virtual Machine and the creation of an object of type test, a java class reproduced below:

## Java ##

        class test {

    test () {
        my_integer = 10;
    }

    public int my_integer;

    public static int my_static_integer;

    public void my_method (int arg_int, String arg_string) {
        my_static_integer = arg_int;
        my_integer = arg_int;

    }
}

In order to run properly you need to read the library requirement.

Compiling the example

Since the example is using the `test.java' class, the first step is to compile the java class using the `javac' command line utility from the JDK. Once it is done, copy the `test.class' either in $ISE_EIFFEL\examples\Eiffel2Java\EIFGEN\W_code or in $ISE_EIFFEL\examples\Eiffel2Java\EIFGEN\F_code depending on your compilation mode (freezing vs. finalizing).

Running the example

One the example is compiled, you can run it and here is the expected output:

$ sample
Creating instance of class `test'
Value of `my_integer' is 10
Value of `my_static_integer' is 0
Calling `my_method' with (2, "String test")
Value of `my_integer' after call to `my_method' is 2

Code description

## Eiffel ##

class
    EIFFEL_TO_JAVA
inherit
    SHARED_JNI_ENVIRONMENT

creation
    make

feature -- Creation

    make is
        local
            class_test: JAVA_CLASS
            instance_of_class_test: JAVA_OBJECT
            fid: POINTER
            value: INTEGER
            j_args: JAVA_ARGS
        do
                --| Creation of the Java object
            class_test := jni.find_class ("test")
            create instance_of_class_test.create_instance (class_test, "()V", Void)

                --| Access to a public attribute
            fid := instance_of_class_test.field_id ("my_integer", "I")

                -- 'fid' contains the id of the field 'my_integer'
                -- 'value' contains the value of the field referenced
                -- by 'fid'
             value := instance_of_class_test.integer_attribute (fid)
            ...

                --| Access to a static attribute using directly the JAVA_CLASS
            fid := class_test.field_id ("my_static_integer", "I")
            value := class_test.integer_attribute (fid)
            ...

                --| Access to a static attribute using the attribute 'jclass'
            fid := instance_of_class_test.jclass.field_id ("my_static_integer", "I")
            value := instance_of_class_test.jclass.integer_attribute (fid)
            ...

                --| Access to the method 'my_method'
                -- Get the id of 'my_method'
            fid := instance_of_class_test.method_id ("my_method", "(ILjava/lang/String;)V")

            create j_args.make(2)
            j_args.push_int (2)
            j_args.push_string("String test")
                -- Create the set of arguments for 'my_method'
            instance_of_class_test.void_method (fid, j_args)
                -- Call to the void method referenced by 'fid'
            ...
        end -- make

end -- class EIFFEL_TO_JAVA


EiffelLex & EiffelParse

Type: Library
Platform: Any
Version: 5.0

See:

  • Content
  • Samples
  • Reference


The Lex & Parse Library Content

  • Lexical analysis
  • Parsing


Lexical analysis: the Lex library

OVERVIEW

When analyzing a text by computer, it is usually necessary to split it into individual components or tokens. In human languages, the tokens are the words; in programming languages, tokens are the basic constituents of software texts, such as identifiers, constants and special symbols.

The process of recognizing the successive tokens of a text is called lexical analysis. This chapter describes the Lex library, a set of classes which make it possible to build and apply lexical analyzers to many different languages.

Besides recognizing the tokens, it is usually necessary to recognize the deeper syntactic structure of the text. This process is called parsing or syntax analysis and is studied in the next chapter.

Figure 1 shows the inheritance structure of the classes discussed in this chapter. Class L_INTERFACE has also been included although we will only study it in the next chapter; it belongs to the Parse library, where it takes care of the interface between parsing and lexical analysis.

Figure 1: Lexical classes

AIMS AND SCOPE OF THE LEX LIBRARY

To use the Lex library it is necessary to understand the basic concepts and terminology of lexical analysis.

Basic terminology

The set of tokens accepted by a lexical analyzer is called a lexical grammar. For example, the basic constructs of Eiffel (identifiers, keywords, constants, special symbols) constitute a lexical grammar. For reasons that will be clear below, a lexical grammar is also known as a regular grammar.

A lexical grammar defines a number of token types, such as Identifier and Integer for Eiffel. A token that conforms to the structure defined for a certain token type is called a specimen of that token type. For example, the token my_identifier, which satisfies the rules for Eiffel tokens, is a specimen of the token type Identifier; 201 is a specimen of the token type Integer.

To define a lexical grammar is to specify a number of token types by describing precisely, for each token type, the form of the corresponding specimens. For example a lexical grammar for Eiffel will specify that Identifier is the token type whose specimens are sequences of one or more characters, of which the first must be a letter (lower-case or upper-case) and any subsequent one is a letter, a digit (0 to 9) or an underscore. Actual grammar descriptions use a less verbose and more formal approach, studied below: regular expressions.

A lexical analyzer is an object equipped with operations that enable it to read a text according to a known lexical grammar and to identify the text’s successive tokens.

The classes of the Lex library make it possible to define lexical grammars for many different applications, and to produce lexical analyzers for these grammars.

Overview of the classes

For the user of the Lex libraries, the classes of most direct interest are TOKEN, LEXICAL, METALEX and SCANNING.

An instance of TOKEN describes a token read from an input file being analyzed, with such properties as the token type, the corresponding string and the position in the text (line, column) where it was found.

An instance of LEXICAL is a lexical analyzer for a certain lexical grammar. Given a reference to such an instance, say analyzer, you may analyze an input text through calls to the features of class LEXICAL, for example:

analyzer.get_token

Class METALEX defines facilities for building such lexical analyzers. In particular, it provides features for reading the grammar from a file and building the corresponding analyzer. Classes that need to build and use lexical analyzers may be written as descendants of METALEX to benefit from its general-purpose facilities.

Class SCANNING is one such descendant of METALEX. It contains all the facilities needed to build an ordinary lexical analyzer and apply it to the analysis of input texts. Because these facilities are simpler to use and are in most cases sufficient, SCANNING will be discussed first; the finer-grain facilities of METALEX are described towards the end of this chapter.

These classes internally rely on others, some of which may be useful for more advanced applications. LEX_BUILDER, one of the supporting classes, will be introduced after METALEX.

Library example

The [BENCH] delivery includes (in the examples/library/lex subdirectory) a simple example using the Lexical Library classes. The example applies Lex library facilities to the analysis of a language which is none other than Eiffel itself.

The root class of that example, EIFFEL_SCAN, is only a few lines long; it relies on the general mechanism provided by SCANNING (see below). The actual lexical grammar is given by a lexical grammar file (a concept explained below): the file of name eiffel_regular in the same directory.

Dealing with finite automata

Lexical analysis relies on the theory of finite automata. The most advanced of the classes discussed in this chapter, LEX_BUILDER, relies on classes describing various forms of automata:

  • DFA: deterministic finite automata.
  • PDFA: partially deterministic finite automata.
  • NDFA: non-deterministic finite automata.
  • AUTOMATON, the most general: finite automata.
  • FIXED_AUTOMATON, LINKED_AUTOMATON.

These classes may also be useful for systems that need to manipulate finite automata for applications other than lexical analysis. The interface of LEX_BUILDER, which includes the features from AUTOMATON, NDFA and PDFA, will provide the essential information.

TOKENS

A lexical analyzer built through any of the techniques described in the rest of this chapter will return tokens - instances of class TOKEN. Here are the most important features of this class:

  • string_value: a string giving the token’s contents.
  • type: an integer giving the code of the token’s type. The possible token types and associated integer codes are specified during the process of building the lexical analyzer in one of the ways described below.
  • is_keyword: a boolean indicating whether the token is a keyword.
  • keyword_code: an integer, meaningful only if is_keyword is true, and identifying the keyword by the code that was given to it during the process of building the analyzer.
  • line_number, column_number: two integers indicating where the token appeared in the input text.

BUILDING AND USING LEXICAL ANALYZERS

The general method for performing lexical analysis is the following.

  1. Create an instance of LEXICAL, giving a lexical analyzer for the desired grammar.
  2. Store the analyzer into a file.
  3. Retrieve the analyzer from the file.
  4. Use the analyzer to analyze the tokens of one or more input texts by calling the various features of class LEXICAL on this object.

Steps 2 and 3 are obviously unnecessary if this process is applied as a single sequence. But in almost all practical cases you will want to use the same grammar to analyze many different input texts. Then steps 1 and 2 will be performed once and for all as soon as the lexical grammar is known, yielding an instance of LEXICAL that step 2 stores into a file; then in every case that requires analyzing a text you will simply retrieve the analyzer and apply it, performing steps 3 and 4 only.

The simplest way to store and retrieve the instance of LEXICAL and all related objects is to use the facilities of class STORABLE: procedure store and one of the retrieval procedures. To facilitate this process, LEXICAL inherits from STORABLE.

The next sections explain how to perform these various steps. In the most common case, the best technique is to inherit from class SCANNING, which provides a framework for retrieving an analyzer file if it exists, creating it from a grammar description otherwise, and proceed with the lexical analysis of one or more input texts.

LEXICAL GRAMMAR FILES AND CLASS SCANNING

Class SCANNING may be used as an ancestor by classes that need to perform lexical analysis. When using SCANNING you will need a lexical grammar file that contains the description of the lexical grammar. Since it is easy to edit and adapt a file without modifying the software proper, this technique provides flexibility and supports the incremental development and testing of lexical analyzers.

The build procedure

To obtain a lexical analyzer in a descendant of class SCANNING, use the procedure

build (store_file_name, grammar_file_name: STRING)

If no file of name store_file_name exists, then build reads the lexical grammar from the file of name grammar_file_name, builds the corresponding lexical analyzer, and stores it into store_file_name.

If there already exists a file of name grammar_file_name, build uses it to recreate an analyzer without using the grammar_file_name.

Lexical grammar files

A lexical grammar file (to be used as second argument to build, corresponding to grammar_file_name) should conform to a simple structure, of which the file eiffel_regular in the examples directory provides a good illustration.

Here is the general form:

Token_type_1   Regular_expression_1
Token_type_2   Regular_expression_2
...
Token_type_m   Regular_expression_m

-- Keywords

Keyword_1
Keyword_2
...
Keyword_n

In other words: one or more lines, each containing the name of a token type and a regular expression; a line beginning with two dashes -- (the word Keywords may follow them to signal that this is the beginning of keywords); and one or more lines containing one keyword each.

Each Token_type_i is the name of a token type, such as Identifier or Decimal_constant. Each Regular_expression_i is a regular expression, built according to a precisely specified format. That format is defined later in this chapter, but even without having seen that definition it is not hard to understand the following small and typical example of lexical grammar file without keywords:

Decimal   '0'..'9'
Natural   +('0'..'9')
Integer   ['+'|'-'] '1'..'9' *('0'..'9')

The first expression describes a token type whose specimens are tokens made of a single-letter decimal digit (any character between 0 and 9). In the second, the + sign denotes repetition (one or more); the specimens of the corresponding token type are all non-empty sequences of decimal digits - in other words, natural numbers, with leading zeroes permitted. In the third, the | symbol denotes alternation, and the asterisk denotes repetition (zero or more); the corresponding tokens are possibly signed integer constants, with no leading zeroes.

As explained below, keywords are regular expressions which are treated separately for convenience and efficiency. If you are using lexical grammar files of the above form, all keywords must be specimens of the last regular expression given (Regular_expression_m above). More details below.

Using a lexical analyzer

Once build has given you an analyzer, you may use it to analyze input texts through calls to the procedure

analyze (input_file_name: STRING)

This will read in and process successive input tokens. Procedure analyze will apply to each of these tokens the action of procedure do_a_token. As defined in SCANNING, this procedure prints out information on the token: its string value, its type, whether it is a keyword and if so its code. You may redefine it in any descendant class so as to perform specific actions on each token.

The initial action begin_analysis, which by default prints a header, and the terminal action end_analysis, which by default does nothing, may also be redefined.

To build lexical analyzers which provide a higher degree of flexibility, use METALEX or LEX_BUILDER, as described in the last part of this chapter.

ANALYZING INPUT

Let us look more precisely at how we can use a lexical analyzer to analyze an input text.

Class LEXICAL

Procedure analyze takes care of the most common needs of lexical analysis. But if you need more advanced lexical analysis facilities you will need an instance of class LEXICAL (a direct instance of LEXICAL itself or of one of its proper descendants). If you are using class SCANNING as described above, you will have access to such an instance through the attribute analyzer.

This discussion will indeed assume that you have an entity attached to an instance of LEXICAL. The name of that entity is assumed to be analyzer, although it does not need to be the attribute from SCANNING. You can apply to that analyzer the various exported features features of class LEXICAL, explained below. All the calls described below should use analyzer as their target, as in

analyzer.set_file ("my_file_name")

Creating, retrieving and storing an analyzer

To create a new analyzer, use

create analyzer.make_new

You may also retrieve an analyzer from a previous session. LEXICAL is a descendant from STORABLE, so you can use feature retrieved for that purpose. In a descendant of STORABLE, simply write

analyzer ?= retrieved

If you do not want to make the class a descendant of STORABLE, use the creation procedure make of LEXICAL, not to be confused with make_new above:

create analyzer.make
analyzer ?= analyzer.retrieved

Choosing a document

To analyze a text, call set_file or set_string to specify the document to be parsed. With the first call, the analysis will be applied to a file; with the second, to a string.

Note: if you use procedure analyze of SCANNING, you do not need any such call, since analyze calls set_file on the file name passed as argument.

Obtaining the tokens

The basic procedure for analyzing successive tokens in the text is get_token, which reads in one token and sets up various attributes of the analyzer to record properties of that token:

  • last_token, a function of type TOKEN, which provides all necessary information on the last token read.
  • token_line_number and token_column_number, to know where the token is in the text. These queries return results of type INTEGER.
  • token_type, giving the regular expression type, identified by its integer number (which is the value No_token if no correct token was recognized).
  • other_possible_tokens, an array giving all the other possible token types of the last token. (If token_type is No_token the array is empty.)
  • end_of_text, a boolean attribute used to record whether the end of text has been reached. If so, subsequent calls to get_token will have no effect.

Procedure get_token recognizes the longest possible token. So if <, = and <= are all regular expressions in the grammar, the analyzer recognizes <= as one token, rather than < followed by =. You can use other_possible_tokens to know what shorter tokens were recognized but not retained.

If it fails to recognize a regular expression, get_token sets token_type to No_token and advances the input cursor by one character.

The basic scheme

Here is the most common way of using the preceding facilities:

from
      set_file ("text_directory/text_to_be_parsed")
            -- Or: set_string ("string to parse")
      begin_analysis
until
      end_of_text
loop
      analyzer.get_token
      if analyzer.token_type = No_token then
            go_on
      end
      do_a_token (lexical.last_token)
end
end_analysis

This scheme is used by procedure analyze of class SCANNING, so that in standard cases you may simply inherit from that class and redefine procedures begin_analysis, do_a_token and end_analysis. If you are not inheriting from SCANNING, these names simply denote procedures that you must provide.

REGULAR EXPRESSIONS

The Lex library supports a powerful set of construction mechanisms for describing the various types of tokens present in common languages such as programming languages, specification languages or just text formats. These mechanisms are called regular expressions; any regular expression describes a set of possible tokens, called the specimens of the regular expression.

Let us now study the format of regular expressions. This format is used in particular for the lexical grammar files needed by class SCANNING and (as seen below) by procedure read_grammar of class METALEX. The eiffel_regular grammar file in the examples directory provides an extensive example.

Each regular expression denotes a set of tokens. For example, the first regular expression seen above,
'0'..'9'
denotes a set of ten tokens, each consisting of a single digit.

Basic expressions

A character expression, written 'character' where character is a single character, describes a set of tokens with just one element: the one-character token character. For example, '0' describes the set containing the single-digit single token 0.

Cases in which character is not a printable character use the following conventions:
'\ooo' | Character given by its three-digit octal code ooo.
'\xx' | Character given by its two-digit hexadecimal code xx. (Both lower- and upper-case may be used for letters in xx.)
'\r' | Carriage return
'\'' | Single quote
'\\' | Backslash
'\t' | Tabulation
'\n' | New line
'\b' | Backspace
'\f' | Form feed

Intervals

An interval, written lower..upper where lower and upper are character expressions, describes a set of one-character tokens: all the characters whose ASCII code is between the codes for the characters in lower and upper. For example, '0'..'9' contains all tokens made of a single decimal digit.

Basic operator expressions

A parenthesized expression, written (exp) where exp is a regular expression, describes the same set of tokens as exp. This serves to remove ambiguities in complex regular expressions. For example, the parenthesized expression ('0'..'9') also describes all single-decimal-digit tokens.

A difference, written interval - char, where interval is an interval expression and char is a character expression, describes the set of tokens which are in exp but not in char. For example, the difference '0'..'9' - '4' describes all single-decimal-digit tokens except those made of the digit 4.

Caution: a difference may only apply to an interval and a single character.

Iterations

An unbounded iteration, written *exp or +exp where exp is a regular expression, describes the set of tokens made of sequences of zero or more specimens of exp (in the first form, using the asterisk), or of one or more specimens of exp (in the second form, using the plus sign). For example, the iteration +('0'..'9') describes the set of tokens made of one or more consecutive decimal digits.

A fixed iteration, written n exp where n is a natural integer constant and exp is a regular expression, describes the set of tokens made of sequences of exactly n specimens of exp. For example, 3 ('A'..'Z') describes the set of all three-letter upper-case tokens.

Other operator expressions

A concatenation, written exp1 exp2 ... expn, describes the set of tokens made of a specimen of exp1 followed by a specimen of exp2 etc. For example, the concatenation '1'..'9' * ('0'..'9') describes the set of tokens made of one or more decimal digits, not beginning with a zero - in other words, integer constants in the usual notation.

An optional component, written [exp] where exp is a regular expression, describes the set of tokens that includes the empty token and all specimens of exp. Optional components usually appear in concatenations.

Concatenations may be inconvenient when the concatenated elements are simply characters, as in 'A' ' ' 'T' 'e' 'x' 't'. In this case you may use a string in double quotes, as in
"A Text"

More generally, a string is written "a1 a2 ... an" for n >= 0, where the ai are characters, and is an abbreviation for the concatenation 'a1' 'a2' ... 'an', representing a set containing a single token. In a string, the double quote character " is written \" and the backslash character \ is written \\. No other special characters are permitted; if you need special characters, use explicit concatenation. As a special case, "" represents the set containing a single empty token.

A union, written exp1 | exp2 | ... | expn, describes the set of tokens which are specimens of exp1, or of exp2 etc. For example, the union ('a'..'z') | ('A'..'Z') describes the set of single-letter tokens (lower-case or upper-case).

Predefined expressions

A joker, written $•, describes the set of all tokens made of exactly one character. A joker is considered to be an interval expression, so that it may be the first operand of a difference operation.

A printable, written $P, describes the set of all tokens made of exactly one printable character.

A blank, written $B, describes the set of all tokens made of one or more specimens of the characters blank, new-line, carriage-return and tabulation.

The following non-elementary forms are abbreviations for commonly needed regular expressions:

Code | Equivalent expression | Role
$L | '\n' | New-line character
$N | +('0'..'9') | Natural integer constants
$R | ['+'|'-'] +('0'..'9') '.' *('0'..'9') ['e'|'E' ['+'|'-'] +('0'..'9')] | Floating point constants
$W | +($P - ' ' - '\t' - '\n' - '\r') | Words
$Z | ['+'|'-'] +('0'..'9') | Possibly signed integer constants

A delimited string, written ->string, where string is of the form, "a1 a2 ... an", represents the set of tokens made of any number of printable characters and terminated by string.

One more form of regular expression, case-sensitive expressions, using the ~ symbol, will be introduced below.

Combining expression-building mechanisms

You may freely combine the various construction mechanisms to describe complex regular expressions. Below are a few examples.

'a'..'z' - 'c' - 'e' | Single-lower-case-letter tokens, except c and e.
$• - '\007' | Any single-character token except ASCII 007.
+('a'..'z') | One or more lower-case letters.
['+'|'-'] '1'..'9' *('0'..'9') | Integer constants, optional sign, no leading zero.
->"*/" | Any string up to and including an occurrence of */ (the closing symbol of a PL/I or C comment).
"\"" ->"\"" | Eiffel strings.

Dealing with keywords

Many languages to be analyzed have keywords - or, more generally, "reserved words". Eiffel, for example, has reserved words such as class and Result.

Note: in Eiffel terminology reserved words include keywords; a keyword is a marker playing a purely syntactical role, such as class. Predefined entities and expressions such as Result and Current, which have an associated value, are considered reserved words but not keywords. The present discussion uses the term "keyword" although it can be applied to all reserved words.

In principle, keywords could be handled just as other token types. In Eiffel, for example, one might treat each reserved words as a token type with only one specimen; these token types would have names such as Class or Then and would be defined in the lexical grammar file:

Class 'c' 'l' 'a' 's' 's'
Then 't' 'h' 'e' 'n'
...

This would be inconvenient. To simplify the task of language description, and also to improve the efficiency of the lexical analysis process, it is usually preferable to treat keywords as a separate category.

If you are using class SCANNING and hence a lexical grammar file, the list of keywords, if any, must appear at the end of the file, one per line, preceded by a line that simply reads

-- Keywords

For example the final part of the example Eiffel lexical grammar file appears as:

... Other token type definitions ...
Identifier     ~('a'..'z') *(~('a'..'z') | '_' | ('0'..'9'))
-- Keywords
alias
all
and
as
BIT
BOOLEAN
 ... Other reserved words ...

Caution: every keyword in the keyword section must be a specimen of one of the token types defined for the grammar, and that token type must be the last one defined in the lexical grammar file, just before the Keywords line. So in Eiffel where the keywords have the same lexical structure as identifiers, the last line before the keywords must be the definition of the token type Identifier, as shown above.

Note: the rule that all keywords must be specimens of one token type is a matter of convenience and simplicity, and only applies if you are using SCANNING and lexical grammar files. There is no such restriction if you rely directly on the more general facilities provided by METALEX or LEX_BUILDER. Then different keywords may be specimens of different regular expressions; you will have to specify the token type of every keyword, as explained later in this chapter.

Case sensitivity

By default, letter case is not significant for regular expressions and keywords. So if yes matches a token type defined by a regular expression, or is a keyword, the input values Yes, yEs and yES will all yield the same token or keyword. This also means that 'a'..'z' and 'a'..'z' | 'A'..'Z' describe the same set of tokens.

The regular expression syntax introduced above offers a special notation to specify that a particular expression is case-sensitive: ~exp, where exp is a regular expression. For example, ~('A'..'Z') only covers single-upper-case-letter tokens. But for all other kinds of expression letter case is not taken into account.

You may change this default behavior through a set of procedures introduced in class LEX_BUILDER and hence available in its descendants METALEX and SCANNING.

To make subsequent regular expressions case-sensitive, call the procedure

ignore_case

To revert to the default mode where case is not significant, call the procedure

distinguish_case

Each of these procedures remains in effect until the other one is called, so that you only need one call to define the desired behavior.

For keywords, the policy is less tolerant. A single rule is applied to the entire grammar: keywords are either all case-sensitive or all case-insensitive. To make all keywords case-sensitive, call

keywords_distinguish_case

The inverse call, corresponding to the default rule, is

keywords_ignore_case

Either of these calls must be executed before you define any keywords; if you are using SCANNING, this means before calling procedure build. Once set, the keyword case-sensitivity policy cannot be changed.

USING METALEX TO BUILD A LEXICAL ANALYZER

(You may skip the rest of this chapter if you only need simple lexical facilities.)

Class SCANNING, as studied above, relies on a class METALEX. In some cases, you may prefer to use the features of METALEX directly. Since SCANNING inherits from METALEX, anything you do with METALEX can in fact be done with SCANNING, but you may wish to stay with just METALEX if you do not need the additional features of SCANNING.

Steps in using METALEX

METALEX has an attribute analyzer which will be attached to a lexical analyzer. This class provides tools for building a lexical analyzer incrementally through explicit feature calls; you can still use a lexical grammar file, but do not have to.

The following extract from a typical descendant of METALEX illustrates the process of building a lexical analyzer in this way:

Upper_identifier, Lower_identifier, Decimal_constant, Octal_constant, Word: INTEGER is unique
...
distinguish_case
keywords_distinguish_case
put_expression ("+('0'..'7'"), Octal_constant, "Octal")
put_expression ("'a'..'z' *('a'..'z'|'0'..'9'|'_')", Lower_identifier, "Lower")
put_expression ("'A'..'Z' *('A'..'Z'|'0'..'9'|'_' )", Upper_identifier, "Upper")
dollar_w (Word)
...
put_keyword ("begin", Lower_identifier)
put_keyword ("end", Lower_identifier)
put_keyword ("THROUGH", Upper_identifier)
...
make_analyzer

This example follows the general scheme of building a lexical analyzer with the features of METALEX, in a class that will normally be a descendant of METALEX:

  1. Set options, such as case sensitivity.
  2. Record regular expressions.
  3. Record keywords (this may be interleaved with step 2.)
  4. "Freeze" the analyzer by a call to make_analyzer.

To perform steps 2 to 4 in a single shot and generate a lexical analyzer from a lexical grammar file, as with SCANNING, you may use the procedure

read_grammar (grammar_file_name: STRING)

In this case all the expressions and keywords are taken from the file of name grammar_file_name rather than passed explicitly as arguments to the procedures of the class. You do not need to call make_analyzer, since read_grammar includes such a call.

The rest of this discussion assumes that the four steps are executed individually as shown above, rather than as a whole using read_grammar.

Recording token types and regular expressions

As shown by the example, each token type, defined by a regular expression, must be assigned an integer code. Here the developer has chosen to use Unique constant values so as not to worry about selecting values for these codes manually, but you may select any values that are convenient or mnemonic. The values have no effect other than enabling you to keep track of the various lexical categories. Rather than using literal values directly, it is preferable to rely on symbolic constants, Unique or not, which will be more mnemonic.

Procedure put_expression records a regular expression. The first argument is the expression itself, given as a string built according to the rules seen earlier in this chapter. The second argument is the integer code for the expression. The third argument is a string which gives a name identifying the expression. This is useful mostly for debugging purposes; there is also a procedure put_nameless_expression which does not have this argument and is otherwise identical to put_expression.

Procedure dollar_w corresponds to the $W syntax for regular expressions. Here an equivalent call would have been

put_nameless_expression ("$W", Word)

Procedure declare_keyword records a keyword. The first argument is a string containing the keyword; the second argument is the regular expression of which the keyword must be a specimen. The example shows that here - in contrast with the rule enforced by SCANNING - not all keywords need be specimens of the same regular expression.

The calls seen so far record a number of regular expressions and keywords, but do not give us a lexical analyzer yet. To obtain a usable lexical analyzer, you must call

make_analyzer

After that call, you may not record any new regular expression or keyword. The analyzer is usable through attribute analyzer.

Note: for readers knowledgeable in the theory of lexical analysis: one of the most important effects of the call to make_analyzer is to transform the non-deterministic finite automaton resulting from calls such as the ones above into a deterministic finite automaton.

Remember that if you use procedure read_grammar, you need not worry about make_analyzer, as the former procedure calls the latter.

Another important feature of class METALEX is procedure store_analyzer, which stores the analyzer into a file whose name is passed as argument, for use by later lexical analysis sessions. To retrieve the analyzer, simply use procedure retrieve_analyzer, again with a file name as argument.

BUILDING A LEXICAL ANALYZER WITH LEX_BUILDER

To have access to the most general set of lexical analysis mechanisms, you may use class LEX_BUILDER, which gives you an even finer grain of control than METALEX. This is not necessary in simple applications.

Building a lexical analyzer

LEX_BUILDER enables you to build a lexical analyzer by describing successive token types and keywords. This is normally done in a descendant of LEX_BUILDER. For each token type, you call a procedure that builds an object, or tool, representing the associated regular expression.

For the complete list of available procedures, refer to the flat-short form of the class; there is one procedure for every category of regular expression studied earlier in this chapter. Two typical examples of calls are:

interval ('a', 'z')
      -- Create an interval tool

union (Letter, Underlined)
      -- Create a union tool

Every such procedure call also assigns an integer index to the tool it creates; this number is available through the attribute last_created_tool. You will need to record it into an integer entity, for example Identifier or Letter.

An example

The following extract from a typical descendant of LEX_BUILDER illustrates how to create a tool representing the identifiers of an Eiffel-like language.

        Identifier, Letter, Digit, Underlined, Suffix, Suffix_list: INTEGER

build_identifier is
do
interval ('a', 'z');
        Letter := last_created_tool
interval ('0', '9');
        Digit := last_created_tool
interval ('_', '_');
        Underlined := last_created_tool
union (Digit, Underlined);
        Suffix := last_created_tool
iteration (Suffix);
        Suffix_list := last_created_tool
append (Letter, Suffix_list);
        Identifier := last_created_tool
end

Each token type is characterized by a number in the tool_list. Each tool has a name, recorded in tool_names, which gives a readable form of the corresponding regular expression. You can use it to check that you are building the right tool.

Selecting visible tools

In the preceding example, only some of the tools, such as Identifier, are of interest to the clients. Others, such as Suffix and Suffix_list, only play an auxiliary role.

When you create a tool, it is by default invisible to clients. To make it visible, use procedure select_tool. Clients will need a number identifying it; to set this number, use procedure associate. For example the above extract may be followed by:

select_tool (Identifier)
associate (Identifier, 34)
put_keyword ("class", Identifier)
put_keyword ("end", Identifier)
put_keyword ("feature", Identifier)

If the analysis encounters a token that belongs to two or more different selected regular expressions, the one entered last takes over. Others are recorded in the array other_possible_tokens.

If you do not explicitly give an integer value to a regular expression, its default value is its rank in tool_list.


Parsing: The Parse Library

OVERVIEW

Parsing is the task of analyzing the structure of documents such as programs, specifications or other structured texts.

Many systems need to parse documents. The best-known examples are compilers, interpreters and other software development tools; but as soon as a system provides its users with a command language, or processes input data with a non-trivial structure, it will need parsing facilities.

This chapter describes the Parse library, which you can use to process documents of many different types. It provides a simple and flexible parsing scheme, resulting from the full application of object-oriented principles.

Because it concentrates on the higher-level structure, the Parse library requires auxiliary mechanisms for identifying a document’s lexical components: words, numbers and other such elementary units. To address this need it is recommended, although not required, to complement Parse with the Lex library studied in the previous chapter.

Figure 1 shows the inheritance structure of the classes discussed in this chapter.

Figure 1: Parse class structure

WHY USE THE PARSE LIBRARY

Let us fist look at the circumstances under which you may want - or not want - to use the Parse library.

The Parse library vs. parser generators

Parsing is a heavily researched area of computing science and many tools are available to generate parsers. In particular, the popular Yacc tool, originally developed for Unix, is widely used to produce parsers.

In some cases Yacc or similar tools are perfectly adequate. It is also sometimes desirable to write a special-purpose parser for a language, not relying on any parser generator. Several circumstances may, however, make the Parse library attractive:

  • The need to interface the parsing tasks with the rest of an object-oriented system (such as a compiler or more generally a "document processor" as defined below) in the simplest and most convenient way.
  • The desire to apply object-oriented principles as fully as possible to all aspects of a system, including parsing, so as to gain the method’s many benefits, in particular reliability, reusability and extendibility.
  • The need to tackle languages whose structure is not easily reconciled with the demands of common parser generator, which usually require the grammar to be LALR (1). (The Parse library uses a more tolerant LL scheme, whose only significant constraint is absence of left-recursivity; the library provides mechanisms to detect this condition, which is easy to correct.)
  • The need to define several possible semantic treatments on the same syntactic structure.

The last reason may be the most significant practical argument in favor of using Parse. Particularly relevant is the frequent case of a software development environment in which a variety of tools all work on the same basic syntactic structure. For example an environment supporting a programming language such as Pascal or Eiffel may include a compiler, an interpreter, a pretty-printer, software documentation tools (such as Eiffel’s short and flat-short facilities), browsing tools and several other mechanisms that all need to perform semantic actions on software texts that have the same syntactic structure. With common parser generators such as Yacc, the descriptions of syntactic structure and semantic processing are inextricably mixed, so that you normally need one new specification for each tool. This makes design, evolution and reuse of specifications difficult and error-prone.

In contrast, the Parse library promotes a specification style whereby syntax and semantics are kept separate, and uses inheritance to allow many different semantic descriptions to rely on the same syntactic stem. This will make Parse particularly appropriate in such cases.

A word of caution

At the time of publication the Parse library has not reached the same degree of maturity as the other libraries presented in this book. It should thus be used with some care. You will find at the end of this chapter a few comments about the work needed to bring the library to its full realization.

AIMS AND SCOPE OF THE PARSE LIBRARY

To understand the Parse library it is necessary to appreciate the role of parsing and its place in the more general task of processing documents of various kinds.

Basic terminology

First, some elementary conventions. The word document will denote the texts to be parsed. The software systems which perform parsing as part of their processing will be called document processors.

Typical document processors are compilers, interpreters, program checkers, specification analyzers and documentation tools. For example the [BENCH] environment contains a number of document processors, used for compiling, documentation and browsing; the language to which they apply is either Eiffel itself or the Lace control language.

Parsing, grammars and semantics

Parsing is seldom an end in itself; rather, it serves as an intermediate step for document processors which perform various other actions.

Parsing takes care of one of the basic tasks of a document processor: reconstructing the logical organization of a document, which must conform to a certain syntax (or structure), defined by a grammar.

Note: the more complete name syntactic grammar avoids any confusion with the lexical grammars discussed in the previous chapter. By default, "grammar" with no further qualification will always denote a syntactic grammar. A syntactic grammar normally relies on a lexical grammar, which gives the form of the most elementary components - the tokens - appearing in the syntactic structure.

Once parsing has reconstructed the structure of a document, the document processor will perform various operations on the basis of that structure. For example a compiler will generate target code corresponding to the original text; a command language interpreter will execute the operations requested in the commands; and a documentation tool such as the short and flat-short commands for Eiffel will produce some information on the parsed document. Such operations are called semantic actions. One of the principal requirements on a good parsing mechanism is that it should make it easy to graft semantics onto syntax, by adding semantic actions of many possible kinds to the grammar.

The Parse library provides predefined classes which handle the parsing aspect automatically and provide the hooks for adding semantic actions in a straightforward way. This enables developers to write full document processors - handling both syntax and semantics - simply and efficiently.

As noted at the beginning of this chapter, it is possible to build a single syntactic base and use it for several processors (such as a compiler and a documentation tool) with semantically different goals, such as compilation and documentation. In the Parse library the semantic hooks take the form of deferred routines, or of routines with default implementations which you may redefine in descendants.

LIBRARY CLASSES

The Parse library contains a small number of classes which cover common document processing applications. The classes, whose inheritance structure was shown at the beginning of this chapter, are:

  • CONSTRUCT, describing the general notion of syntactical construct.
  • AGGREGATE, describing constructs of the "aggregate" form.
  • CHOICE, describing constructs of the "choice" form.
  • REPETITION, describing constructs of the "repetition" form.
  • TERMINAL, describing "terminal" constructs with no further structure.
  • KEYWORD, describing how to handle keywords.
  • L_INTERFACE, providing a simple interface with the lexical analysis process and the Lex library.
  • INPUT, describing how to handle the input document.

EXAMPLES

The [BENCH] delivery includes (in the examples/library/parse subdirectory) a simple example using the Parse Library classes. The example is a processor for "documents" which describe computations involving polynomials with variables. The corresponding processor is a system which obtains polynomial specifications and variable values from a user, and computes the corresponding polynomials.

This example illustrates the most important mechanisms of the Parsing Library and provides a guide for using the facilities described in this chapter. The components of its grammar appear as illustrations in the next sections.

CONSTRUCTS AND PRODUCTIONS

A set of documents possessing common properties, such as the set of all valid Eiffel classes or the set of all valid polynomial descriptions, is called a language.

In addition to its lexical aspects, the description of a language includes both syntactic and semantic properties. The grammar - the syntactic specification - describes the structure of the language (for example how an Eiffel class is organized into a number of clauses); the semantic specification defines the meaning of documents written in the language (for example the run-time properties of instances of the class, and the effect of feature calls).

To discuss the Parse library, it is simpler to consider "language' as a purely syntactic notion; in other words, a language is simply the set of documents conforming to a certain syntactic grammar (taken here to include the supporting lexical grammar). Any semantic aspect will be considered to belong to the province of a specific document processor for the language, although the technique used for specifying the grammar will make it easy to add the specification of the semantics, or several alternative semantic specifications if desired.

This section explains how you may define the syntactic base - the grammar.

Constructs

A grammar consists of a number of constructs, each representing the structure of documents, or document components, called the specimens of the construct. For example, a grammar for Eiffel will contain constructs such as Class, Feature_clause and Instruction. A particular class text is a specimen of construct Class.

Each construct will be defined by a production, which gives the structure of the construct’s specimens. For example, a production for Class in an Eiffel grammar should express that a class (a specimen of the Class construct) is made of an optional Indexing part, a Class_header, an optional Formal_generics part and so on. The production for Indexing will indicate that any specimen of this construct - any Indexing part - consists of the keyword indexing followed by zero or more specimens of Index_clause.

Although some notations for syntax descriptions such as BNF allow more than one production per construct, the Parse library relies on the convention that every construct is defined by at most one production. Depending on whether there is indeed such a production, the construct is either non-terminal or terminal:

  • A non-terminal construct (so called because it is defined in terms of others) is specified by a production, which may be of one of three types: aggregate, choice and repetition. The construct will accordingly be called an aggregate, choice or repetition construct.
  • A terminal construct has no defining production. This means that it must be defined outside of the syntactical grammar. Terminals indeed come from the lexical grammar. Every terminal construct corresponds to a token type (regular expression or keyword) of the lexical grammar, for which the parsing duty will be delegated to lexical mechanisms, assumed in the rest of this chapter to be provided by the Lex library although others may be substituted if appropriate.

All specimens of terminal constructs are instances of class TERMINAL. A special case is that of keyword constructs, which have a single specimen corresponding to a keyword of the language. For example, if is a keyword of Eiffel. Keywords are described by class KEYWORD, an heir of TERMINAL.

The rest of this section concentrates on the parsing-specific part: non-terminal constructs and productions. Terminals will be studied in the discussion of how to interface parsing with lexical analysis.

Varieties of non-terminal constructs and productions

An aggregate production defines a construct whose specimens are obtained by concatenating ("aggregating") specimens of a list of specified constructs, some of which may be optional. For example, the production for construct Conditional in an Eiffel grammar may read:

Conditional [=] if Then_part_list [Else_part] end

This means that a specimen of Conditional (a conditional instruction) is made of the keyword if, followed by a specimen of Then_part_list, followed by zero or one specimen of Else_part (the square brackets represent an optional component), followed by the keyword end.

Note: this notation for productions uses conventions similar to those of the book Eiffel: The Language. Keywords are written in boldface italics and stand for themselves. Special symbols, such as the semicolon, are written in double quotes, as in ";". The [=] symbol means "is defined as" and is more accurate mathematically than plain =, which, however, is often used for this purpose (see Introduction to the Theory of Programming Languages, Prentice Hall, 1991, for a more complete discussion of this issue).

A choice production defines a construct whose specimens are specimens of one among a number of specified constructs. For example, the production for construct Type in an Eiffel grammar may read:

Type [=] Class_type | Class_type_expanded | Formal_generic_name | Anchored | Bit_type

This means that a specimen of Type is either a specimen of Class_type, or a specimen of Class_type_expanded etc.

Finally, a repetition production defines a construct whose specimens are sequences of zero or more specimens of a given construct (called the base of the repetition construct), separated from each other by a separator. For example, the production for construct Compound in an Eiffel grammar may read

Compound [=] {Instruction ";" ...}

This means that a specimen of Compound is made of zero or more specimens of Instruction, each separated from the next (if any) by a semicolon.

These three mechanisms - aggregate, choice and repetition - suffice to describe the structure of a wide array of practical languages. Properties which cannot be handled by them should be dealt with through semantic actions, as explained below.

An example grammar

The example directory included in the delivery implements a processor for a grammar describing a simple language for expressing polynomials. A typical "document" in this language is the line

x; y: x * (y + 8 - (2 * x))

The beginning of the line, separated from the rest by a colon, is the list of variables used in the polynomial, separated by semicolons. The rest of the line is the expression defining the polynomial.

Using the conventions defined above, the grammar may be written as:

Line       [=] Variables ":" Sum
Variables  [=] {Identifier ";" ...}
Sum        [=] {Diff "+" ...}
Diff       [=] {Product "-" ...}
Product    [=] {Term " * " ...}
Term       [=] Simple_var Int_constant Nested
Nested     [=] "(" Sum ")"

This grammar assumes a terminal Identifier, which must be defined as a token type in the lexical grammar. The other terminals are keywords, shown as strings appearing in double quotes, for example "+".

PARSING CONCEPTS

The Parse library supports a parsing mechanism based on the concepts of object-oriented software construction.

Class CONSTRUCT

The deferred class CONSTRUCT describes the general notion of construct; instances of this class and its descendants are specimens of the constructs of a grammar.

Deferred though it may be, CONSTRUCT defines some useful general patterns; for example, its procedure process appears as:
parse
if parsed then
     semantics
end

where procedures parse and semantics are expressed in terms of some more specific procedures, which are deferred. This defines a general scheme while leaving the details to descendants of the class.

Such descendants, given in the library, are classes AGGREGATE, CHOICE, REPETITION and TERMINAL. They describe the corresponding types of construct, with features providing the operations for parsing their specimens and applying the associated semantic actions.

Building a processor

To build a processor for a given grammar, you write a class, called a construct class, for every construct of the grammar, terminal or non-terminal. The class should inherit from AGGREGATE, CHOICE, REPETITION or TERMINAL depending on the nature of the construct. It describes the production for the construct and any associated semantic actions.

To complete the processor, you must choose a "top construct" for that particular processor, and write a root class. In accordance with the object-oriented method, which implies that "roots" and "tops" should be chosen last, these steps are explained at the end of this chapter.

The next sections explain how to write construct classes, how to handle semantics, and how to interface parsing with the lexical analysis process. All these tasks rely on a fundamental data abstraction, the notion of abstract syntax tree.

Abstract syntax trees

The effect of processing a document with a processor built from a combination of construct classes is to build an abstract syntax tree for that document, and to apply any requested semantic actions to that tree.

The syntax tree is said to be abstract because it only includes important structural information and does not retain the concrete information such as keywords and separators. Such concrete information, sometimes called "syntactic sugar", serves only external purposes but is of no use for semantic processing.

The combination of Eiffel techniques and libraries yields a very simple approach to building and processing abstract syntax trees. Class CONSTRUCT is a descendant of the Data Structure Library class TWO_WAY_TREE, describing a versatile implementation of trees; so, as a consequence, are CONSTRUCT’s own descendants. The effect of parsing any specimen of a construct is therefore to create an instance of the corresponding construct class. This instance is (among other things) a tree node, and is automatically inserted at its right place in the abstract syntax tree.

As noted in the discussion of trees, class TWO_WAY_TREE makes no formal distinction between the notions of tree and tree node. So you may identify the abstract syntax tree with the object (instance of CONSTRUCT) representing the topmost construct specimen in the structure of the document being analyzed.

The production function

A construct class describes the syntax of a given construct through a function called production, which is a direct representation of the corresponding production. This function is declared in CONSTRUCT as

production: LINKED_LIST [CONSTRUCT] is
           -- Right-hand side of the production for the construct
      deferred
      end

Function production remains deferred in classes AGGREGATE, CHOICE and REPETITION. Every effective construct class that you write must provide an effecting of that function. It is important for the efficiency of the parsing process that every effective version of production be a Once function. Several examples of such effectings are given below.

Classes AGGREGATE, CHOICE, REPETITION and TERMINAL also have a deferred function construct_name of type STRING, useful for tracing and debugging. This function should be effected in every construct class to return the string name of the construct, such as "INSTRUCTION" or "CLASS" for construct classes in a grammar of Eiffel. For efficiency reasons, the construct_name function should also be a Once function. The form of such a function will always be the same, as illustrated by the following example which may appear in the construct class INSTRUCTION in a processor for Eiffel:

construct_name: STRING is
            -- Symbolic name of the construct
      once
            Result := "INSTRUCTION"
      end

The examples of the next few sections, which explain how to write construct classes, are borrowed from the small "Polynomial" language mentioned above, which may be found in the examples directory in the ISE Eiffel delivery.

PREPARING GRAMMARS

Having studied the Parse library principles, let us see how to write grammar productions for various kinds of construct. The main task is to write the production function for each construct class.

The production function for a descendant of AGGREGATE will describe how to build a specimen of the corresponding function from a sequence of specimens of each of the constituent constructs. Writing this function from the corresponding production is straightforward.

As an example, consider the production function of class LINE for the Polynomial example language. The corresponding production is
Line [=] Variables ":" Sum
where Variables and Sum are other constructs, and the colon ":" is a terminal. This means that every specimen of Line consists of a specimen of Variables, followed by a colon, followed by a specimen of Sum.

Here is the corresponding production function as it appears in class LINE:

production: LINKED_LIST [CONSTRUCT] is
     local
           var: VARIABLES
           sum: SUM
     once
           create Result.make
           Result.forth
           create var.make
           put (var)
           keyword (":")
           create sum.make
           put (sum)
     end

As shown by this example, the production function for an aggregate construct class should declare a local entity (here var and sum) for each non-keyword component of the right-hand side, the type of each entity being the corresponding construct class (here VARIABLES and SUM).

The body of the function should begin with
create Result.make
Result.forth
to create the object containing the result. Then for each non-keyword component, represented by the local entity component (this applies to var and sum in the example), there should be a sequence of two instructions, of the form

create component.make
put (component)

For any keyword of associated string symbol, such as the colon ":" in the example, there should be a call to keyword (symbol)

The order of the various calls to put (for non-keywords) and keyword (for keywords) must be the order of the components in the production. Also, every create component. make instruction must occur before the corresponding call to put (symbol).

All components in the above example are required. In the general case an aggregate production may have optional components. To signal that a component component of the right-hand side is optional, include a call of the form

component.set_optional

This call may appear anywhere after the corresponding create component instruction. The recommended place is just after the call to put, as in

create component
put (symbol)
component.set_optional

Choices

The production function for a descendant of CHOICE will describe how to build a specimen of the corresponding function as a specimen of one of the alternative constructs.

As an example, consider the production function of class TERM for the Polynomial example language. The corresponding production is
Term [=] Simple_var Poly_integer Nested
where Simple_var, Poly_integer and Nested are other constructs. This means that every specimen of Term consists of one specimen of any one of these three constructs. Here is the corresponding production function as it appears in class TERM: production: LINKED_LIST [CONSTRUCT] is
     local
           id: SIMPLE_VAR
           val: POLY_INTEGER
           nest: NESTED
     once
           create Result.make
           Result.forth
           create id.make
           put (id)
           create val.make
           put (val)
           create nest.make
           put (nest)
     end

As shown by this example, the production function for a choice construct class must declare a local entity - here id, val and nest - for each alternative component of the right-hand side. The type of each entity is the corresponding construct class - here SIMPLE_VAR, POLY_INTEGER and NESTED.

The body of the function must begin by

create Result.make
Result.forth

Then for each alternative component represented by a local entity component (in the example this applies to id, val and nest) there should be two instructions of the form

create component.make
put (component)

Caution: the order of the various calls to put is irrelevant in principle. When a document is parsed, however, the choices will be tried in the order given; so if you know that certain choices occur more frequently than others it is preferable to list them first to speed up the parsing process.

Repetitions

The production function for a descendant of REPETITION will describe how to build a specimen of the corresponding function as a sequence or zero or more (or, depending on the grammar, one or more) specimens of the base construct. The class must also effect a feature separator of type STRING, usually as a constant attribute. (This feature is introduced as deferred in class REPETITION.)

As an example, consider the construct Variables in the Polynomial example language. The right-hand side of the corresponding production is
Variables [=] {Identifier ";" ...}
where Identifier is another construct, and the semicolon ";" is a terminal. This means that every specimen of Variables consists of zero or more specimens of Identifier, separated from each other (if more than one) by semicolons.

Here are the corresponding production function and separator attribute as they appear in class VARIABLES:

production: LINKED_LIST [IDENTIFIER] is
     local
           base: VAR
     once
           create Result.make
           Result.forth
           create base.make
           put (base)
     end

As shown by this example, function production is built along the same ideas as for aggregates and choices, except that here only one component, base, is required; its type must be the class corresponding to the construct serving as the base of the repetition, VAR in the example.

INTERFACE TO LEXICAL ANALYSIS

One more type of construct class remains to be discussed: terminal construct classes. Since terminal constructs serve to elevate lexical tokens (regular expressions and keywords) to the dignity of syntactical construct, we must first take a look at how the Parse library classes collaborate with their counterparts in the Lex library.

The notion of lexical interface class

To parse a document, you need to get tokens from a lexical analyzer. This is achieved by making some construct classes, in particular those describing terminals, descendants of one of the lexical classes.

The best technique is usually to write a class covering the lexical needs of the language at hand, from which all construct classes that have some lexical business will inherit. Such a class is called a lexical interface class.

Lexical interface classes usually follow a common pattern. To take advantage of this uniformity, the Parse library includes a deferred class L_INTERFACE which describes that pattern. Specific lexical interface classes may be written as descendants of L_INTERFACE.

L_INTERFACE is a simple deferred class, with a deferred procedure obtain_analyzer. It is an heir of METALEX.

Obtaining a lexical analyzer

An effective descendant of L_INTERFACE must define procedure obtain_analyzer so that it records into the lexical analyzer the regular expressions and keywords of the language at hand. In writing obtain_analyzer you may use any one of three different techniques, each of which may be the most convenient depending on the precise context, to obtain the required lexical analyzer:

  • You may build the lexical analyzer by defining its regular expressions one by one, using the procedures described in the presentation of METALEX, in particular put_expression and put_keyword.
  • You may use use procedure retrieve_analyzer from METALEX to retrieve an analyzer which a previous session saved into a file.
  • Finally, you may write a lexical grammar file (or reuse an existing one) and process it on the spot by using procedure read_grammar from METALEX.

A lexical interface class

An example of a lexical interface class is POLY_LEX for the Polynomial example language. Here is the complete text of that class:

indexing
     description: "Lexical interface class for the Polynomial language"

class
     POLY_LEX

inherit
     L_INTERFACE

     CONSTANTS
           undefine
                 consistent,
                 copy,
                 is_equal,
                 setup
           end

feature {NONE}

     obtain_analyzer is
                 -- Create lexical analyzer for the Polynomial language
           do
                 ignore_case
                 keywords_ignore_case
                 build_expressions
                 build_keywords
                 set_separator_type (blanks)
           end

     build_expressions is
                 -- Define regular expressions
                 -- for the Polynomial language
           do
                 put_expression (special_expression, special, "Special")
                 put_expression ("*('a'..'z')", simple_identifier, "Simple_identifier")
                 put_expression ("+('0'..'9')", integer_constant, "Integer_constant")
                 put_expression ("+('\t'|'\n'|' ')", blanks, "Blanks")
           end

     special_expression: STRING is
                 -- Regular expression describing Special
           once
                 create Result.make (80)
                 Result.append ("('\050'..'\057')|")
                 Result.append ("('\072'..'\076')|")
                 Result.append ("'['|']'|'|'|'{'|'}'|%"->%"|%":=%"")
           end

     build_keywords is
                 -- Define keywords (special symbols)
                 -- for the Polynomial language
           do
                 put_keyword ("+", special)
                 put_keyword ("-", special)
                 put_keyword (";", special)
                 put_keyword (":", special)
                 put_keyword ("(", special)
                 put_keyword (")", special)
                 put_keyword ("*", special)
           end
end

This class illustrates the straightforward scheme for writing lexical interface classes. It introduces constants such as Special to represent the regular expressions supported, and effects procedure obtain_analyzer. The role of this procedure is to define lexical conventions (here through calls to ignore_case and keywords_ignore_case), to record the regular expressions (through calls to put_expression, packaged in a procedure build_expressions for clarity), and records the keywords (through calls to put_keyword, packaged in build_keywords).

All the classes of a document processor that need to interact with the lexical analysis should inherit from a lexical interface class such as POLY_LEX. This is true in particular of the root class of a processor, as discussed below.

More on terminal constructs

Terminal construct classes are examples of classes that need to interact with the lexical analysis, and should thus inherit from the lexical interface class.

Class TERMINAL includes a deferred function token_type of type INTEGER. Every effective descendant of TERMINAL should effect this feature as a constant attribute, whose value is the code for the associated regular expression, obtained from the lexical interface class. As every other construct class, such a descendant should also effect construct_name as a Once function. For example, in the Polynomial language, class INT_CONSTANT has the following text: class
     INT_CONSTANT

inherit
     TERMINAL

     CONSTANTS

feature

     token_type: INTEGER is
           do
                 Result := integer_constant
           end

feature {NONE}

     construct_name: STRING is
           once
                 Result := "INT_CONSTANT"
           end
end

SPECIFYING THE SEMANTICS

As mentioned at the beginning of this chapter, parsing is usually done not for itself but as a way to perform some semantic processing. The Parsing Library classes define the general framework for grafting such semantics onto a syntactical stem.

Semantic procedures

The principal procedures for defining semantic actions are pre_action and post_action. These are features of class CONSTRUCT. Procedure pre_action describes the actions to be performed before a construct has been recognized; post_action, the actions to be performed after a construct has been recognized.

As defined in CONSTRUCT, both and post_action do nothing by default. Any construct class which is a descendant of CONSTRUCT may redefine one or both so that they will perform the semantic actions that the document processor must apply to specimens of the corresponding construct. These procedures are called automatically during processing, before and after the corresponding structures have been parsed.

For TERMINAL, only one semantic action makes sense. To avoid any confusion, post_action is renamed action in that class and pre_action is renamed unused_pre_action to indicate that it is irrelevant.

Often, the semantic procedures need to compute various elements of information. These may be recorded using appropriate attributes of the corresponding construct classes.

Note: readers familiar with the theory of parsing and compiling will see that this scheme, using the attributes of Eiffel classes, provides a direct implementation of the "attribute grammar" mechanism.

Polynomial semantics

As an example let us examine the semantics of the Product construct for the polynomial language. It is a repetition construct, with Term as the base construct; in other words a specimen of Product is a sequence of one or more terms, representing the product term1 * term2 ... * termn. Here is the post_action procedure in the corresponding class PRODUCT:

post_action is
     local
           int_value: INTEGER
     do
           if not no_components then
                 from
                       child_start
                       if not child_after then
                             int_value := 1
                       end
                 until
                       child_after
                 loop
                       child.post_action
                       int_value := int_value * info.child_value
                       child_forth
                 end
                 info.set_child_value (int_value)
           end
     end

Here each relevant construct class has an attribute info used to record the semantic information associated with polynomials and their components, such as child_value, an INTEGER. The post_action takes care of computing the product of all child_values for the children. First, of course, post_action must recursively be applied to each child, to compute its own child_value.

Note: recall that an instance of CONSTRUCT is also a node of the abstract syntax tree, so that all the TWO_WAY_TREE features such as child_value, child_start, child_after and many others are automatically available to access the syntactical structure.

Keeping syntax and semantics separate

For simple examples such as the Polynomial language, it is convenient to use a single class to describe both the syntax of a construct (through the production function and associated features) and its semantics (action routines and associated features).

For more ambitious languages and processors, however, it is often preferable to keep the two aspects separate. Such separation of syntax and semantics, and in particular the sharing of the same syntax for different processors with different semantic actions, is hard or impossible to obtain with traditional document processing tools such as Yacc on Unix. Here is how to achieve it with the Parse library:

  • First write purely syntactic classes, that is to say construct classes which only effect the syntactical part (in particular function production). As a consequence, these classes usually remain deferred. The recommended convention for such syntactic classes is to use names beginning with S_, for example S_INSTRUCTION or S_LOOP.
  • Then for each construct for which a processor defines a certain semantics, define another class, called a semantic class, which inherits from the corresponding syntactic class. The recommended convention for semantic classes is to give them names which directly reflect the corresponding construct name, as in INSTRUCTION or LOOP.

To build a semantic class in in step 2 it is often convenient to use multiple inheritance from a syntactic class and a "semantics-only" class. For example in a processor for Eiffel class INSTRUCTION may inherit from both IS_INSTRUCTION and from a semantics-only class INSTRUCTION_PROPERTIES which introduces the required semantic features.

One of the advantages of this scheme is that it makes it easy to associate two or more types of processing with a single construct, by keeping the same syntactic class (such as IS_INSTRUCTION) but choosing a different pure-semantics class each time.

As noted earlier in this chapter, this is particularly useful in an environment where different processors need to perform differents actions on specimens of the same construct. In an Eiffel environment, for example, processors that manipulate classes and other Eiffel construct specimens may include a compiler, an interpreter, a flattener (producing the flat form), a class abstracter (producing the short or flat-short form), and various browsing tools such as those of ISE Eiffel.

For obvious reasons of convenience and ease of maintenance, it is desirable to let these processors share the same syntactic descriptions. The method just described, relying on multiple inheritance, achieves this goal.

HOW PARSING WORKS

Classes AGGREGATE, CHOICE, TERMINAL and REPETITION are written in such a way that you do not need to take care of the parsing process. They make it possible to parse any language built according to the rules given - with one limitation, left recursion, discussed below. You can then concentrate on writing the interesting part - semantic processing.

To derive the maximum benefit from the Parse library, however, it is useful to gain a little more insight into the way parsing works. Let us raise the veil just enough to see any remaining property that is relevant to the building of parsers and document processors.

The parsing technique

The Parse library relies on a general approach known as recursive descent, meaning that various choices will be tried in sequence and recursively to recognize a certain specimen.

If a choice is attempted and fails (because it encounters input that does not conform to what is expected), the algorithm will try remaining choices, after having moved the input cursor back to where it was before the choice that failed. This process is called backtracking. It is handled by the parsing algorithms in an entirely automatic fashion, without programmer intervention.

Left recursion

Recursive descent implies the danger of infinite looping when parsing is attempted for left-recursive productions of the form
A [=] A ...
or, more generally, cases in which the left recursion is indirect, as in
A [=] B ...
B [=] C ...
...
L [=] A ...

Direct left recursion is easy to avoid, but indirect recursion may sneak in in less trivial ways.

To determine whether the production for a construct is directly or indirectly left-recursive, use the query left_recursion from class CONSTRUCT.

Backtracking and the commit procedure

Another potential problem may arise from too much backtracking. In contrast with left recursion, this is a performance issue, not a threat to the correctness of the parsing algorithm. Automatic backtracking is in fact essential to the generality and flexibility of the recursive descent parsing algorithm; but too much of it may degrade the efficiency of the parsing mechanism.

Two techniques are available to minimize backtracking. One, mentioned above, is to organize the production functions for choice construct classes so that they list the most frequent cases first. The other is to use the commit procedure in the production functions for aggregate constructs.

A call to commit in an aggregate A is a hint to the parser, which means:

"If you get to this point in trying to recognize a specimen of A as one among several possible choices for a choice construct C, and you later fail to obtain an A, then forget about other choices for C: you won’t be able to find a C here.
You may go back to the next higher-level choice before C - or admit failure if there is no such choice left."

Such a hint is useful when you want to let the parser benefit from some higher-level knowledge about the grammar, which is not directly deducible from the way the productions have been written.

Here is an example. The production function for NESTED in the Polynomial language, which attempts to parse specimens of the form
(s)
where s is a specimen of SUM, is written as

production: LINKED_LIST [CONSTRUCT] is
     local
           expression: SUM
     once
           create Result.make
           Result.forth
           keyword ("(")
           commit
           create expression.make
           put (expression)
           keyword (")")
     end

The commit after the recognition of the keyword "(" is there to use the following piece of higher-level knowledge:

No choice production of the grammar that has NESTED as one of its alternatives has another alternative construct whose specimens could begin with an opening parenthesis "(".

Because of this property, if the parser goes so far as to recognize an opening parenthesis as part of parsing any construct C for which NESTED is an alternative, but further tokens do not match the structure of NESTED specimens, then we will have failed to recognize not only a NESTED but also a C.

Note: some readers will have recognized commit as being close to the Prolog "cut" mechanism.

In this example, NESTED is used in only one right-hand side production: the choice production for TERM, for which the other alternatives are SIMPLE_VAR and POLY_INTEGER, none of whose specimens can include an opening parenthesis.

The use of commit assumes global knowledge about the grammar and its future extensions, which is somewhat at odds with the evolutionary approach suggested by the Eiffel method. Applied improperly, this mechanism could lead to the rejection of valid texts as invalid. Used with care, however, it helps in obtaining high-performance parsing without impairing too much the simplicity of preparing parsers and other document processors.

BUILDING A DOCUMENT PROCESSOR

We are ready now to put together the various elements required to build a document processor based on the Parse library.

The overall picture

The documents to be processed will be specimens of a certain construct. This construct is called the top construct for that particular processing.

Caution: be sure to note that with the Parse library there is no room for a concept of top construct of a grammar: the top construct is only defined with respect to a particular processor for that grammar.
Attempting to define the top of a grammar would be contrary to the object-oriented approach, which de-emphasizes any notion of top component of a system.
Different processors for the same grammar may use different top constructs.

A document processor will be a particular system made of construct classes, complemented by semantic classes, and usually by other auxiliary classes. One of the construct classes corresponds to the top construct and is called the top construct class.

Note: this notion of top construct class has a natural connection to the notion of root class of a system, as needed to get executable software. The top construct class could indeed be used as root of the processor system. In line with the previous discussion, however, it appears preferable to keep the top construct class (which only depends on the syntax and remains independent of any particular processor) separate from the system’s root class. With this approach the root class will often be a descendant of the top construct class.
This policy was adopted for the Polynomial language example as it appears in the delivery: the processor defined for this example uses LINE as the top construct class; the root of the processor system is a class PROCESS, which inherits from LINE.

Steps in the execution of a document processor

As any root class of a system, the root of a document processor must have a creation procedure which starts the execution. Here the task of this class is the following:

  1. Define an object representing the input document to be processed; this will be an instance of class INPUT.
  2. Obtain a lexical analyzer applicable to the language, and connect it with the document.
  3. Select an input file, containing the actual document to be processed.
  4. Process the document: in other words, parse it and, if parsing is successful, apply the semantics.
  5. To execute these steps in a simple and convenient fashion, it is useful to declare the root class as a descendant of the lexical interface class. The root class, being an heir to the top construct class, will also be a descendant of CONSTRUCT.

Connecting with lexical analysis

To achieve the effect of steps 1 and 2, a simple call instruction suffices: just call the procedure build, inherited from L_INTERFACE, using as argument document, a feature of type INPUT, obtained from METALEX (the lexical analyzer generator class) through L_INTERFACE. The call, then, is just:

build (document)

Although you may use this line as a recipe with no need for further justification, it is interesting to see what build does. Feature document describes the input document to be processed; it is introduced as a Once function in class CONSTRUCT to ensure that all instances of CONSTRUCT share a single document - in other words, that all processing actions apply to the same document. The text of build is:

build (doc: INPUT) is
           -- Create lexical analyzer and set doc
           -- to be the input document.
     require
           document_exists: doc /= void
     do
           metalex_make
           obtain_analyzer
           make_analyzer
           doc.set_lexical (analyzer)
     end

The call to obtain_analyzer defines the regular grammar for the language at hand. Recall that obtain_analyzer is deferred in L_INTERFACE; its definition for the POLY_LEX example was given above. The call to make_analyzer freezes the regular grammar and produces a usable lexical analyzer, available through the attribute analyzer obtained from METALEX. Finally, the call to set_lexical, a procedure of class INPUT, ensures that all lexical analysis operations will use analyzer as the lexical analyzer.

Starting the actual processing

The call build ( document ) takes care of steps 1 and 2 of the root’s creation procedure. Step 3 selects the file containing the input document; this is achieved through the call
document.set_input_file (some_file_name)
where set_input_file, from class INPUT, has a self-explanatory effect.

Finally, step 4 (processing the document) is simply a call to procedure process, obtained from CONSTRUCT. Recall that this procedure simply executes
parse
if parsed then
     semantics
end

The structure of a full example

The polynomial example provides a simple example of a full document processor, which you may use as a guide for your own processors. The root class of that example is PROCESS. Its creation procedure, make, follows the above scheme precisely; here is its general form: root_line: LINE

make is
     local
           text_name: STRING
     do
           create root_line.make
           build (root_line.document)

           ... Instructions prompting the user for the name of the
           file to be parsed, and assigning it to text_name ...

           root_line.document.set_input_file (text_name)
           root_line.process
     end

Although it covers a small language, this example may serve as a blueprint for most applications of the Parse library.

FUTURE WORK

It was mentioned at the beginning of this chapter that further work is desirable to make the Parse library reach its full bloom. Here is a glimpse of future improvements.

Expressions

Many languages include an expression construct having the properties of traditional arithmetic expressions:

  • An expression is a succession of basic operands and operators.
  • The basic operands are lexical elements, such as identifiers and constants.
  • Operators are used in prefix mode (as in - a) or infix mode (as in b - a).
  • Each operator has a precedence level; precedence levels determine the abstract syntactic structure of expressions and consequently their semantics. For example the abstract structure of a + b * c shows this expression to be the application of the operator + to a and to the application of the operator * to b and c. That this is the correct interpretation of the instruction follows from the property that * has a higher precedence ("binds more tightly") than +.
  • Parentheses pairs, such as ( ) or [ ], can be used to enforce a structure different from what the precedence rules would imply, as in (a + b) * c.
  • Some infix operators may be applied to more than two arguments; in this case it must be clear whether they are right-associative (in other words, a ^ b ^ c means a ^ (b ^ c), the conventional interpretation if ^ denotes the power operator) or left-associative.

It is of course possible to apply the Parse library in its current state to support expressions, as illustrated by this extract from the Polynomial grammar given in full above:

Variables [=] {Identifier ";" ...}
Sum       [=] {Diff "+" ...}
Diff      [=] {Product "-" ...}
Product   [=] {Term "*" ...}

The problem then is not expressiveness but efficiency. For such expressions the recursive descent technique, however well adapted to the higher-level structures of a language, takes too much time and generates too many tree nodes. Efficient bottom-up parsing techniques are available for this case.

The solution is straightforward: write a new heir EXPRESSION to class CONSTRUCT. The preceding discussion of expressions and their properties suggests what kinds of feature this class will offer: define a certain terminal as operator, define a terminal as operand type, set the precedence of an operator, set an operator as left-associative or right-associative and so on. Writing this class based on this discussion is indeed a relatively straightforward task, which can be used as a programming exercise.

Beyond the addition of an EXPRESSION class, some changes in the data structures used by Parse may also help improve the efficiency of the parsing process.

Yooc

To describe the syntax of a language, it is convenient to use a textual format such as the one that has served in this chapter to illustrate the various forms of production. The correspondence between such a format and the construct classes is straightforward; for example, as explained above, the production
Line [=] Variables ":" Sum
will yield the class class LINE inherit
     AGGREGATE
feature
     production: LINKED_LIST [CONSTRUCT] is
           local
                 var: VARIABLES
                 sum: SUM
           once
                 create Result.make
                 Result.forth
                 create var.make
                 put (var)
                 keyword (":")
                 create sum.make
                 put (sum)
           end
     ...
end

This transformation of the textual description of the grammar into its equivalent Eiffel form is simple and unambiguous; but it is somewhat annoying to have to perform it manually.

A tool complementing the Parse library and known as YOOC ("Yes! an Object-Oriented Compiler", a name meant as an homage to the venerable Yacc) has been planned for future releases of Parse. Yooc, a translator, will take a grammar specification as input and transform it into a set of parsing classes, all descendants of CONSTRUCT and built according to the rules defined above. The input format for syntax specification, similar to the conventions used throughout this chapter, is a variant of LDL (Language Description Language), a component of the ArchiText structural document processing system.

Further reading

The following article describes some advanced uses of the Parse library as well as a Yooc-like translator called PG: Per Grape and Kim Walden: Automating the Development of Syntax Tree Generators for an Evolving Language, in Proceedings of TOOLS 8 (Technology of Object-Oriented Languages and Systems), Prentice Hall, 1992, pages 185-195.


cluster lex

Cluster
    lex

Subclusters
    lex.lex
    lex.parse


cluster lex.lex

Cluster
    lex.lex

Supercluster
    lex

Classes
    AUTOMATON
    DFA
    ERROR_LIST
    FIXED_AUTOMATON [S -> STATE]
    FIXED_DFA
    FIXED_INTEGER_SET
    HIGH_BUILDER
    LEX_ARRAY [T]
    LEX_BUILDER
    LEXICAL
    LINKED_AUTOMATON [S -> STATE]
    LINKED_DFA
    METALEX
    NDFA
    PDFA
    SCANNING
    STATE
    STATE_OF_DFA
    TEXT_FILLER
    TOKEN


AUTOMATON Chart

deferred class
    AUTOMATON

General
    cluster: lex.lex
    description: "General finite-state automata"

Ancestors
    ANY

Queries
    greatest_input: INTEGER
    nb_states: INTEGER
    start_number: INTEGER

Commands
    set_final (state, f: INTEGER)
    set_start (n: INTEGER)
    set_state
    set_transition (source, input_doc, target: INTEGER)


AUTOMATON Flat contracts

indexing
    description: "General finite-state automata"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:53 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    AUTOMATON

feature -- Access

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation

feature -- Measurement

    nb_states: INTEGER
            -- Number of states in the automaton

feature -- Status setting

    set_final (state, f: INTEGER)
            -- Make state final for regular expression f.

    set_start (n: INTEGER)
            -- Select state n as the starting state.
        require
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_state
            -- Make a new state.

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class AUTOMATON


DFA Chart

deferred class
    DFA

General
    cluster: lex.lex
    description: "General deterministic finite automata"

Ancestors
    AUTOMATON

Queries
    find_successor (source, input_doc: INTEGER): STATE_OF_DFA
    greatest_input: INTEGER
    nb_states: INTEGER
    possible_tokens (l: LINKED_LIST [INTEGER]): ARRAY [INTEGER]
    recognize (l: LINKED_LIST [INTEGER]): INTEGER
    start_number: INTEGER

Commands
    set_final (state, f: INTEGER)
    set_start (n: INTEGER)
    set_state
    set_transition (source, input_doc, target: INTEGER)


DFA Flat contracts

indexing
    description: "General deterministic finite automata"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:53 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    DFA

feature -- Access

    find_successor (source, input_doc: INTEGER): STATE_OF_DFA
            -- Successor of source on input_doc;
            -- void if no successor

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    possible_tokens (l: LINKED_LIST [INTEGER]): ARRAY [INTEGER]
            -- Attribute `final_array' of the state reached in Current after
            -- making transitions from state to state on the
            -- inputs listed in l; empty if not recognized

    recognize (l: LINKED_LIST [INTEGER]): INTEGER
            -- final value for the state reached after
            -- making transitions from state to state on the
            -- inputs listed in l; 0 if not recognized.

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

feature -- Measurement

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

feature -- Status setting

    set_final (state, f: INTEGER)
            -- Make state final for regular expression f.
            -- (from AUTOMATON)

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_state
            -- Make a new state.
            -- (from AUTOMATON)

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
        require -- from  AUTOMATON
            True
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DFA


ERROR_LIST Chart

class
    ERROR_LIST

General
    cluster: lex.lex
    description: "Lists of error messages for screen display"
    create: make

Ancestors
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] STRING
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] ERROR_LIST
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] STRING
    for_all (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] STRING): BOOLEAN
    i_th (i: INTEGER): [like item] STRING
    index: INTEGER
    index_of (v: [like item] STRING; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] ERROR_LIST): BOOLEAN
    is_inserted (v: STRING): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: STRING
    last: [like item] STRING
    linear_representation: LINEAR [STRING]
    object_comparison: BOOLEAN
    occurrences (v: [like item] STRING): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: STRING): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    add_message (message: STRING)
    append (s: SEQUENCE [STRING])
    back
    compare_objects
    compare_references
    copy (other: [like Current] ERROR_LIST)
    display_message
    do_all (action: PROCEDURE [ANY, TUPLE [STRING]])
    do_if (action: PROCEDURE [ANY, TUPLE [STRING]]; test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN])
    do_not_display_message
    extend (v: [like item] STRING)
    fill (other: CONTAINER [STRING])
    finish
    force (v: [like item] STRING)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    linked_list_make
    make
    merge_left (other: [like Current] ERROR_LIST)
    merge_right (other: [like Current] ERROR_LIST)
    move (i: INTEGER)
    prune (v: [like item] STRING)
    prune_all (v: [like item] STRING)
    put (v: [like item] STRING)
    put_front (v: [like item] STRING)
    put_i_th (v: [like item] STRING; i: INTEGER)
    put_left (v: [like item] STRING)
    put_right (v: [like item] STRING)
    remove
    remove_left
    remove_right
    replace (v: [like item] STRING)
    search (v: [like item] STRING)
    start
    swap (i: INTEGER)
    wipe_out


ERROR_LIST Flat contracts

indexing
    description: "Lists of error messages for screen display"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:53 $"
    revision: "$Revision: 1.3 $"

class interface
    ERROR_LIST

create

    make
            -- Create list.
        ensure
            display_enabled: display

feature -- Initialization

    make
            -- Create list.
        ensure
            display_enabled: display

    linked_list_make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: STRING
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: STRING): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: STRING): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    display_message
            -- From now, display new messages on standard output.
        ensure
            display_enabled: display

    do_not_display_message
            -- From now, do not display new messages on standard output.
        ensure
            display_disabled: not display

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    add_message (message: STRING)
            -- Add message in list and display it or not.

    append (s: SEQUENCE [STRING])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [STRING])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [STRING]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [STRING]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [STRING]]; test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class ERROR_LIST


FIXED_AUTOMATON Chart

class
    FIXED_AUTOMATON [S -> STATE]

General
    cluster: lex.lex
    description: "General finite-state automata, implemented by arrays"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): S
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [S]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): S
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: S): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] FIXED_AUTOMATON [S]): BOOLEAN
    is_inserted (v: S): BOOLEAN
    item (i: INTEGER): S
    last_position: INTEGER
    linear_representation: LINEAR [S]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: S): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] FIXED_AUTOMATON [S]): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] FIXED_AUTOMATON [S]
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    add_right (s: S)
    array_make (min_index, max_index: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] FIXED_AUTOMATON [S])
    discard_items
    enter (v: [like item] S; i: INTEGER)
    fill (other: CONTAINER [S])
    force (v: [like item] S; i: INTEGER)
    grow (i: INTEGER)
    make (i, s: INTEGER)
    make_from_array (a: ARRAY [S])
    prune_all (v: S)
    put (v: [like item] S; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    set_final (state, f: INTEGER)
    subcopy (other: [like Current] FIXED_AUTOMATON [S]; start_pos, end_pos, index_pos: INTEGER)


FIXED_AUTOMATON Flat contracts

indexing
    description: "General finite-state automata, implemented by arrays"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    FIXED_AUTOMATON [S -> STATE]

create

    make (i, s: INTEGER)
            -- Make an automaton including at most s states,
            -- with transitions 0 to i.
        require
            s_large_enough: s > 0
            i_large_enough: i >= 0

feature -- Initialization

    make (i, s: INTEGER)
            -- Make an automaton including at most s states,
            -- with transitions 0 to i.
        require
            s_large_enough: s > 0
            i_large_enough: i >= 0

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [S])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    area: SPECIAL [S]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): S
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: S): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    last_position: INTEGER
            -- Position of last state inserted

    infix "@" (i: INTEGER): S
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    item (i: INTEGER): S
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Measurement

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: S): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: S): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_final (state, f: INTEGER)
            -- Make state final for regular expression f.
        require
            is_in_automaton: state <= upper and state >= lower

feature -- Element change

    add_right (s: S)
            -- Assign s to the first possible item.
        require
            not_full: last_position < count

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [S])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature  -- Element change

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: S)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [S]
            -- Representation as a linear structure
            -- (from ARRAY)

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class FIXED_AUTOMATON


FIXED_DFA Chart

class
    FIXED_DFA

General
    cluster: lex.lex
    description: "Deterministic finite automata"
    create: make

Ancestors
    DFA
    FIXED_AUTOMATON [S -> STATE]

Queries
    infix "@" (i: INTEGER): STATE_OF_DFA
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [STATE_OF_DFA]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): STATE_OF_DFA
    extendible: BOOLEAN
    find_successor (source, input_doc: INTEGER): STATE_OF_DFA
    full: BOOLEAN
    greatest_input: INTEGER
    Growth_percentage: INTEGER
    has (v: STATE_OF_DFA): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] FIXED_DFA): BOOLEAN
    is_inserted (v: STATE_OF_DFA): BOOLEAN
    item (i: INTEGER): STATE_OF_DFA
    last_position: INTEGER
    linear_representation: LINEAR [STATE_OF_DFA]
    lower: INTEGER
    Minimal_increase: INTEGER
    nb_states: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: STATE_OF_DFA): INTEGER
    possible_tokens (l: LINKED_LIST [INTEGER]): ARRAY [INTEGER]
    prunable: BOOLEAN
    recognize (l: LINKED_LIST [INTEGER]): INTEGER
    resizable: BOOLEAN
    same_items (other: [like Current] FIXED_DFA): BOOLEAN
    start_number: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] FIXED_DFA
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    add_right (s: STATE_OF_DFA)
    array_make (min_index, max_index: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] FIXED_DFA)
    discard_items
    enter (v: [like item] STATE_OF_DFA; i: INTEGER)
    f_set_final (state, f: INTEGER)
    fill (other: CONTAINER [STATE_OF_DFA])
    fixed_make (i, s: INTEGER)
    force (v: [like item] STATE_OF_DFA; i: INTEGER)
    grow (i: INTEGER)
    make (i, s: INTEGER)
    make_from_array (a: ARRAY [STATE_OF_DFA])
    prune_all (v: STATE_OF_DFA)
    put (v: [like item] STATE_OF_DFA; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    set_final (state, f: INTEGER)
    set_start (n: INTEGER)
    set_state
    set_transition (source, input_doc, target: INTEGER)
    subcopy (other: [like Current] FIXED_DFA; start_pos, end_pos, index_pos: INTEGER)
    trace


FIXED_DFA Flat contracts

indexing
    description: "Deterministic finite automata"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    FIXED_DFA

create

    make (i, s: INTEGER)
            -- Make a dfa with 0 to i possible inputs
            -- and s possible states.

feature -- Initialization

    make (i, s: INTEGER)
            -- Make a dfa with 0 to i possible inputs
            -- and s possible states.

    fixed_make (i, s: INTEGER)
            -- Make an automaton including at most s states,
            -- with transitions 0 to i.
            -- (from FIXED_AUTOMATON)
        require -- from FIXED_AUTOMATON
            s_large_enough: s > 0
            i_large_enough: i >= 0

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [STATE_OF_DFA])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    area: SPECIAL [STATE_OF_DFA]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): STATE_OF_DFA
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    find_successor (source, input_doc: INTEGER): STATE_OF_DFA
            -- Successor of source on input_doc;
            -- void if no successor
        require -- from  DFA
            True
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    has (v: STATE_OF_DFA): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    possible_tokens (l: LINKED_LIST [INTEGER]): ARRAY [INTEGER]
            -- Attribute `final_array' of the state reached in Current after
            -- making transitions from state to state on the
            -- inputs listed in l; empty if not recognized
            -- (from DFA)

    recognize (l: LINKED_LIST [INTEGER]): INTEGER
            -- final value for the state reached after
            -- making transitions from state to state on the
            -- inputs listed in l; 0 if not recognized.
            -- (from DFA)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    infix "@" (i: INTEGER): STATE_OF_DFA
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    item (i: INTEGER): STATE_OF_DFA
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    last_position: INTEGER
            -- Position of last state inserted
            -- (from FIXED_AUTOMATON)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: STATE_OF_DFA): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

feature  -- Measurement

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: STATE_OF_DFA): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    f_set_final (state, f: INTEGER)
            -- Make state final for regular expression f.
            -- (from FIXED_AUTOMATON)
        require -- from FIXED_AUTOMATON
            is_in_automaton: state <= upper and state >= lower

    set_final (state, f: INTEGER)
            -- Make state final for regular expression f.

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_state
            -- Make a new state.

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
        require -- from  AUTOMATON
            True
        require else -- from DFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input

feature  -- Element change

    add_right (s: STATE_OF_DFA)
            -- Assign s to the first possible item.
            -- (from FIXED_AUTOMATON)
        require -- from FIXED_AUTOMATON
            not_full: last_position < count

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

feature -- Element change

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [STATE_OF_DFA])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: STATE_OF_DFA)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [STATE_OF_DFA]
            -- Representation as a linear structure
            -- (from ARRAY)

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Output

    trace
            -- Print information about the automaton's states.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class FIXED_DFA


FIXED_INTEGER_SET Chart

class
    FIXED_INTEGER_SET

General
    cluster: lex.lex
    description: "Sets of integers with a finite number of items"
    create: make

Ancestors
    BOOL_STRING

Queries
    infix "and" (other: [like Current] FIXED_INTEGER_SET): [like Current] FIXED_INTEGER_SET
    infix "or" (other: [like Current] FIXED_INTEGER_SET): [like Current] FIXED_INTEGER_SET
    infix "xor" (other: [like Current] FIXED_INTEGER_SET): [like Current] FIXED_INTEGER_SET
    prefix "not": [like Current] FIXED_INTEGER_SET
    count: INTEGER
    has (i: INTEGER): BOOLEAN
    is_empty: BOOLEAN
    item (i: INTEGER): BOOLEAN
    largest: INTEGER
    left_shifted (n: INTEGER): [like Current] FIXED_INTEGER_SET
    next (p: INTEGER): INTEGER
    right_shifted (n: INTEGER): [like Current] FIXED_INTEGER_SET
    smallest: INTEGER
    to_c: ANY

Commands
    all_false
    all_true
    bool_string_put (v: [like item] BOOLEAN; i: INTEGER)
    boolean_set_make (n: INTEGER)
    make (n: INTEGER)
    print
    put (i: INTEGER)
    remove (i: INTEGER)

Constraints
    positive size


FIXED_INTEGER_SET Flat contracts

indexing
    description: "Sets of integers with a finite number of items"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    FIXED_INTEGER_SET

create

    make (n: INTEGER)
            -- Make set for at most n integers from 1 to n.
        require
            n_positive: n > 0
        ensure
            set_empty: is_empty

feature -- Initialization

    make (n: INTEGER)
            -- Make set for at most n integers from 1 to n.
        require
            n_positive: n > 0
        ensure
            set_empty: is_empty

    boolean_set_make (n: INTEGER)
            -- Allocate area of n booleans.
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            non_negative_size: n >= 0
        ensure -- from BOOL_STRING
            correct_allocation: count = n

feature -- Access

    has (i: INTEGER): BOOLEAN
            -- Is i in set?
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count

    is_empty: BOOLEAN
            -- Is current set empty?

    item (i: INTEGER): BOOLEAN
            -- Boolean at i-th position,
            -- beginning at left, 1 origin
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            index_large_enough: 1 <= i
            index_small_enough: i <= count

    largest: INTEGER
            -- Largest integer in set;
            -- 0 if set empty

    next (p: INTEGER): INTEGER
            -- Next integer in set following p;
            -- count + 1 if p equals largest
        require
            p_in_set: p >= 1 and p <= count

    smallest: INTEGER
            -- Smallest integer in set;
            -- count + 1 if set empty

feature -- Measurement

    count: INTEGER
            -- Number of boolean in the area.
            -- (from BOOL_STRING)

feature -- Element change

    all_false
            -- Set all booleans to false.
            -- (from BOOL_STRING)

    all_true
            -- Set all booleans to true.
            -- (from BOOL_STRING)

    put (i: INTEGER)
            -- Insert i into set.
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count
        ensure
            is_in_set: has (i)

    bool_string_put (v: like item; i: INTEGER)
            -- Put boolean v at i-th position
            -- beginning at left, 1 origin.
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            index_large_enough: 1 <= i
            index_small_enough: i <= count

feature -- Removal

    remove (i: INTEGER)
            -- Delete i from set.
        require
            index_large_enough: 1 <= i
            index_small_enough: i <= count
        ensure
            is_not_in_set: not has (i)

feature -- Conversion

    to_c: ANY

feature -- Basic operations

    left_shifted (n: INTEGER): like Current
            -- Left shifted 'Current' set, by n positions
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            non_negative_shift: n >= 0

    right_shifted (n: INTEGER): like Current
            -- Right shifted 'Current' set, by n positions
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            non_negative_shift: n >= 0

    infix "and" (other: like Current): like Current
            -- Logical and of 'Current' and other
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            other_not_void: other /= void
            same_size: other.count = count

    prefix "not": like Current
            -- Negation of 'Current'
            -- (from BOOL_STRING)

    infix "or" (other: like Current): like Current
            -- Logical or of 'Current' and other
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            other_not_void: other /= void
            same_size: other.count = count

    infix "xor" (other: like Current): like Current
            -- Logical exclusive or of 'Current' and other
            -- (from BOOL_STRING)
        require -- from BOOL_STRING
            other_not_void: other /= void
            same_size: other.count = count

feature -- Output

    print
            -- List all items in set.

invariant

    positive_size: count > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class FIXED_INTEGER_SET


HIGH_BUILDER Chart

class
    HIGH_BUILDER

General
    cluster: lex.lex
    description: "Mechanisms for building lexical analyzers from regular expressions. This class may be used as ancestor by classes needing its facilities."
    create: make_extended, make

Ancestors
    BASIC_ROUTINES
    LEX_BUILDER

Queries
    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
    Ack: INTEGER
    additional_space: INTEGER
    all_default: BOOLEAN
    Ampersand: INTEGER
    analyzer: LEXICAL
    area: SPECIAL [LINKED_LIST [INTEGER]]
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    capacity: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    case_sensitive: BOOLEAN
    categories_table: ARRAY [INTEGER]
    changeable_comparison_criterion: BOOLEAN
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    count: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    description: STRING
    dfa: FIXED_DFA
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    entry (i: INTEGER): LINKED_LIST [INTEGER]
    Eot: INTEGER
    Equal_sign: INTEGER
    Error_list: ERROR_LIST
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    extendible: BOOLEAN
    final_array: ARRAY [INTEGER]
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    full: BOOLEAN
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    greatest_input: INTEGER
    Growth_percentage: INTEGER
    Gs: INTEGER
    has (v: LINKED_LIST [INTEGER]): BOOLEAN
    has_letters: BOOLEAN
    Home_arrow: INTEGER
    Ht: INTEGER
    index_set: INTEGER_INTERVAL
    initialized: BOOLEAN
    input_array: ARRAY [FIXED_INTEGER_SET]
    is_empty: BOOLEAN
    is_equal (other: [like Current] HIGH_BUILDER): BOOLEAN
    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
    keyword_h_table: HASH_TABLE [INTEGER, STRING]
    keywords_case_sensitive: BOOLEAN
    keywords_list: LINKED_LIST [STRING]
    Last_ascii: INTEGER
    last_character_code: INTEGER
    last_created_tool: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    lexical_frozen: BOOLEAN
    Line_feed: INTEGER
    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
    lower: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minimal_increase: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    nb_states: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
    Percent: INTEGER
    Plus: INTEGER
    prunable: BOOLEAN
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    recognize (s: STRING): INTEGER
    resizable: BOOLEAN
    Right_arrow: INTEGER
    Rs: INTEGER
    same_items (other: [like Current] HIGH_BUILDER): BOOLEAN
    selected_tools: LINKED_LIST [INTEGER]
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    start_number: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] HIGH_BUILDER
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    token_type_list: LINKED_LIST [INTEGER]
    tool_list: LINKED_LIST [PDFA]
    tool_names: LINKED_LIST [STRING]
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    upper: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    Vt: INTEGER
    Zero: INTEGER

Commands
    add_keyword (word: STRING)
    any_character
    any_printable
    append (p, s: INTEGER)
    append_optional (p, s: INTEGER)
    array_make (min_index, max_index: INTEGER)
    associate (t, n: INTEGER)
    automatic_grow
    build_dollar_any
    build_dollar_b
    build_dollar_n
    build_dollar_p
    build_dollar_r
    build_dollar_z
    case_insensitive (c: INTEGER)
    clear_all
    compare_objects
    compare_references
    construct_dfa
    copy (other: [like Current] HIGH_BUILDER)
    delete_transition (source, input_doc, target: INTEGER)
    difference (r: INTEGER; c: CHARACTER)
    discard_items
    distinguish_case
    enter (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
    force (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    grow (i: INTEGER)
    ignore_case
    include (fa: PDFA; shift: INTEGER)
    initialize
    interval (b, e: CHARACTER)
    iteration (c: INTEGER)
    iteration1 (c: INTEGER)
    iteration_n (n, c: INTEGER)
    keywords_distinguish_case
    keywords_ignore_case
    make
    make_extended (char_code: INTEGER)
    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
    optional (c: INTEGER)
    pdfa_make (n, i: INTEGER)
    pdfa_put (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    prepend_optional (p, s: INTEGER)
    prune_all (v: LINKED_LIST [INTEGER])
    put_keyword (s: STRING; exp: INTEGER)
    put_nameless_expression (s: STRING; n: INTEGER)
    remove
    remove_case_sensitiveness
    resize (min_index, max_index: INTEGER)
    retrieve_analyzer (file_name: STRING)
    select_tool (i: INTEGER)
    set_e_transition (source, target: INTEGER)
    set_final (s, r: INTEGER)
    set_letters
    set_start (n: INTEGER)
    set_transition (source, input_doc, target: INTEGER)
    set_word (word: STRING)
    store_analyzer (file_name: STRING)
    subcopy (other: [like Current] HIGH_BUILDER; start_pos, end_pos, index_pos: INTEGER)
    trace
    union (a, b: INTEGER)
    union2 (a, b: INTEGER)
    up_to (word: STRING)

Constraints
    cursor not too far


HIGH_BUILDER Flat contracts

indexing
    description: "Mechanisms for building lexical analyzers from regular expressions. This class may be used as ancestor by classes needing its facilities."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    HIGH_BUILDER

create

    make
            -- Set up the analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = last_ascii

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            valid_char_code: char_code > 0
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = char_code

feature -- Initialization

    initialize
            -- Set up attributes of analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            initialized

    pdfa_make (n, i: INTEGER)
            -- Make a PDFA with n states, and i + 1 inputs.
            -- (from PDFA)

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make
            -- Set up the analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = last_ascii

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            valid_char_code: char_code > 0
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = char_code

    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    Ack: INTEGER is 6
            -- (from ASCII)

    Ampersand: INTEGER is 38
            -- (from ASCII)

    analyzer: LEXICAL
            -- The lexical analyzer built so far
            -- (from LEX_BUILDER)

    area: SPECIAL [LINKED_LIST [INTEGER]]
            -- Special data zone
            -- (from TO_SPECIAL)

    Back_space: INTEGER is 8
            -- (from ASCII)

    Backslash: INTEGER is 92
            -- (from ASCII)

    Bar: INTEGER is 124
            -- (from ASCII)

    Bel: INTEGER is 7
            -- (from ASCII)

    Blank: INTEGER is 32
            -- (from ASCII)

    Break: INTEGER is -7
            -- (from ASCII)

    Bs: INTEGER is 8
            -- (from ASCII)

    Buf_overflow: INTEGER is -9
            -- (from ASCII)

    Can: INTEGER is 24
            -- (from ASCII)

    Carriage_return: INTEGER is 13
            -- (from ASCII)

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a
            -- (from ASCII)

    case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive?
            -- (from LEX_BUILDER)

    categories_table: ARRAY [INTEGER]
            -- Table of category numbers for each input
            -- (from LEX_BUILDER)

    Character_set_size: INTEGER is 128
            -- (from ASCII)

    Circumflex: INTEGER is 94
            -- (from ASCII)

    Closing_brace: INTEGER is 125
            -- (from ASCII)

    Colon: INTEGER is 58
            -- (from ASCII)

    Comma: INTEGER is 44
            -- (from ASCII)

    Commercial_at: INTEGER is 64
            -- (from ASCII)

    Cr: INTEGER is 13
            -- (from ASCII)

    Ctrl_a: INTEGER is 1
            -- (from ASCII)

    Ctrl_b: INTEGER is 2
            -- (from ASCII)

    Ctrl_backslash: INTEGER is 28
            -- (from ASCII)

    Ctrl_c: INTEGER is 3
            -- (from ASCII)

    Ctrl_circumflex: INTEGER is 30
            -- (from ASCII)

    Ctrl_d: INTEGER is 4
            -- (from ASCII)

    Ctrl_e: INTEGER is 5
            -- (from ASCII)

    Ctrl_f: INTEGER is 6
            -- (from ASCII)

    Ctrl_g: INTEGER is 7
            -- (from ASCII)

    Ctrl_h: INTEGER is 8
            -- (from ASCII)

    Ctrl_i: INTEGER is 9
            -- (from ASCII)

    Ctrl_j: INTEGER is 10
            -- (from ASCII)

    Ctrl_k: INTEGER is 11
            -- (from ASCII)

    Ctrl_l: INTEGER is 12
            -- (from ASCII)

    Ctrl_lbracket: INTEGER is 27
            -- (from ASCII)

    Ctrl_m: INTEGER is 13
            -- (from ASCII)

    Ctrl_n: INTEGER is 14
            -- (from ASCII)

    Ctrl_o: INTEGER is 15
            -- (from ASCII)

    Ctrl_p: INTEGER is 16
            -- (from ASCII)

    Ctrl_q: INTEGER is 17
            -- (from ASCII)

    Ctrl_questmark: INTEGER is 127
            -- (from ASCII)

    Ctrl_r: INTEGER is 18
            -- (from ASCII)

    Ctrl_rbracket: INTEGER is 29
            -- (from ASCII)

    Ctrl_s: INTEGER is 19
            -- (from ASCII)

    Ctrl_t: INTEGER is 20
            -- (from ASCII)

    Ctrl_u: INTEGER is 21
            -- (from ASCII)

    Ctrl_underlined: INTEGER is 31
            -- (from ASCII)

    Ctrl_v: INTEGER is 22
            -- (from ASCII)

    Ctrl_w: INTEGER is 23
            -- (from ASCII)

    Ctrl_x: INTEGER is 24
            -- (from ASCII)

    Ctrl_y: INTEGER is 25
            -- (from ASCII)

    Ctrl_z: INTEGER is 26
            -- (from ASCII)

    Dc1: INTEGER is 17
            -- (from ASCII)

    Dc2: INTEGER is 18
            -- (from ASCII)

    Dc3: INTEGER is 19
            -- (from ASCII)

    Dc4: INTEGER is 20
            -- (from ASCII)

    Del: INTEGER is 127
            -- (from ASCII)

    dfa: FIXED_DFA
            -- DFA built by routine construct_dfa,
            -- which recognizes the same language.
            -- (from NDFA)

    Dle: INTEGER is 16
            -- (from ASCII)

    Dollar: INTEGER is 36
            -- (from ASCII)

    Dot: INTEGER is 46
            -- (from ASCII)

    Doublequote: INTEGER is 34
            -- (from ASCII)

    Down_arrow: INTEGER is -3
            -- (from ASCII)

    Eight: INTEGER is 56
            -- (from ASCII)

    Em: INTEGER is 25
            -- (from ASCII)

    Enq: INTEGER is 5
            -- (from ASCII)

    entry (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    Eot: INTEGER is 4
            -- (from ASCII)

    Equal_sign: INTEGER is 61
            -- (from ASCII)

    error_list: ERROR_LIST
            -- List of error messages
            -- (from LEX_BUILDER)

    Esc: INTEGER is 27
            -- (from ASCII)

    Etb: INTEGER is 23
            -- (from ASCII)

    Etx: INTEGER is 3
            -- (from ASCII)

    Exclamation: INTEGER is 33
            -- (from ASCII)

    final_array: ARRAY [INTEGER]
            -- The final value for each state
            -- (regular expression, if any, for which it is final).
            -- (from PDFA)

    First_printable: INTEGER is 32
            -- (from ASCII)

    Five: INTEGER is 53
            -- (from ASCII)

    Four: INTEGER is 52
            -- (from ASCII)

    Fs: INTEGER is 28
            -- (from ASCII)

    Grave_accent: INTEGER is 96
            -- (from ASCII)

    Greaterthan: INTEGER is 62
            -- (from ASCII)

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    Gs: INTEGER is 29
            -- (from ASCII)

    has (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_letters: BOOLEAN
            -- Are there any letters among the active transitions?
            -- (from PDFA)

    Home_arrow: INTEGER is -6
            -- (from ASCII)

    Ht: INTEGER is 9
            -- (from ASCII)

    input_array: ARRAY [FIXED_INTEGER_SET]
            -- For each input, set of the states which have
            -- a transition on this input to the following state
            -- (from PDFA)

    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    keyword_h_table: HASH_TABLE [INTEGER, STRING]
            -- Keyword table
            -- (from LEX_BUILDER)

    keywords_case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive for keywords?
            -- (from LEX_BUILDER)

    keywords_list: LINKED_LIST [STRING]
            -- Keywords associated with current automaton.
            -- (from PDFA)

    Last_ascii: INTEGER is 127
            -- (from ASCII)

    last_character_code: INTEGER
            -- Last character code recognized by the language
            -- (from LEX_BUILDER)

    last_created_tool: INTEGER
            -- Identification number of the last
            -- regular expression put in tool_list
            -- (from LEX_BUILDER)

    Last_printable: INTEGER is 126
            -- (from ASCII)

    Lbracket: INTEGER is 91
            -- (from ASCII)

    Lcurly: INTEGER is 40
            -- (from ASCII)

    Left_arrow: INTEGER is -4
            -- (from ASCII)

    Lessthan: INTEGER is 60
            -- (from ASCII)

    Letter_layout: INTEGER is 70
            -- (from ASCII)

    lexical_frozen: BOOLEAN
            -- Has the lexical grammar been finalized?
            -- | (in other words: has the DFA been built?)
            -- (from LEX_BUILDER)

    Line_feed: INTEGER is 10
            -- (from ASCII)

    Lower_a: INTEGER is 97
            -- (from ASCII)

    Lower_b: INTEGER is 98
            -- (from ASCII)

    Lower_c: INTEGER is 99
            -- (from ASCII)

    Lower_d: INTEGER is 100
            -- (from ASCII)

    Lower_e: INTEGER is 101
            -- (from ASCII)

    Lower_f: INTEGER is 102
            -- (from ASCII)

    Lower_g: INTEGER is 103
            -- (from ASCII)

    Lower_h: INTEGER is 104
            -- (from ASCII)

    Lower_i: INTEGER is 105
            -- (from ASCII)

    Lower_j: INTEGER is 106
            -- (from ASCII)

    Lower_k: INTEGER is 107
            -- (from ASCII)

    Lower_l: INTEGER is 108
            -- (from ASCII)

    Lower_m: INTEGER is 109
            -- (from ASCII)

    Lower_n: INTEGER is 110
            -- (from ASCII)

    Lower_o: INTEGER is 111
            -- (from ASCII)

    Lower_p: INTEGER is 112
            -- (from ASCII)

    Lower_q: INTEGER is 113
            -- (from ASCII)

    Lower_r: INTEGER is 114
            -- (from ASCII)

    Lower_s: INTEGER is 115
            -- (from ASCII)

    Lower_t: INTEGER is 116
            -- (from ASCII)

    Lower_u: INTEGER is 117
            -- (from ASCII)

    Lower_v: INTEGER is 118
            -- (from ASCII)

    Lower_w: INTEGER is 119
            -- (from ASCII)

    Lower_x: INTEGER is 120
            -- (from ASCII)

    Lower_y: INTEGER is 121
            -- (from ASCII)

    Lower_z: INTEGER is 122
            -- (from ASCII)

    Minus: INTEGER is 45
            -- (from ASCII)

    Nak: INTEGER is 21
            -- (from ASCII)

    Nine: INTEGER is 57
            -- (from ASCII)

    Nl: INTEGER is 10
            -- (from ASCII)

    Np: INTEGER is 12
            -- (from ASCII)

    Nul: INTEGER is 0
            -- (from ASCII)

    Number_sign: INTEGER is 35
            -- (from ASCII)

    One: INTEGER is 49
            -- (from ASCII)

    Opening_brace: INTEGER is 123
            -- (from ASCII)

    Overflow: INTEGER is -8
            -- (from ASCII)

    Percent: INTEGER is 37
            -- (from ASCII)

    Plus: INTEGER is 43
            -- (from ASCII)

    Questmark: INTEGER is 63
            -- (from ASCII)

    Rbracket: INTEGER is 93
            -- (from ASCII)

    Rcurly: INTEGER is 41
            -- (from ASCII)

    Right_arrow: INTEGER is -5
            -- (from ASCII)

    Rs: INTEGER is 30
            -- (from ASCII)

    selected_tools: LINKED_LIST [INTEGER]
            -- Regular expressions included in the main one
            -- (from LEX_BUILDER)

    Semicolon: INTEGER is 59
            -- (from ASCII)

    Seven: INTEGER is 55
            -- (from ASCII)

    Si: INTEGER is 15
            -- (from ASCII)

    Singlequote: INTEGER is 39
            -- (from ASCII)

    Six: INTEGER is 54
            -- (from ASCII)

    Slash: INTEGER is 47
            -- (from ASCII)

    So: INTEGER is 14
            -- (from ASCII)

    Soh: INTEGER is 1
            -- (from ASCII)

    Sp: INTEGER is 32
            -- (from ASCII)

    Star: INTEGER is 42
            -- (from ASCII)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    Stx: INTEGER is 2
            -- (from ASCII)

    Sub: INTEGER is 26
            -- (from ASCII)

    Syn: INTEGER is 22
            -- (from ASCII)

    Tabulation: INTEGER is 9
            -- (from ASCII)

    Three: INTEGER is 51
            -- (from ASCII)

    Tilde: INTEGER is 126
            -- (from ASCII)

    token_type_list: LINKED_LIST [INTEGER]
            -- Token types of the selected tools.
            -- Indexed by tool numbers.
            -- (from LEX_BUILDER)

    tool_list: LINKED_LIST [PDFA]
            -- Regular expressions used as auxiliary tools
            -- (from LEX_BUILDER)

    tool_names: LINKED_LIST [STRING]
            -- Names of regular expressions in tool list
            -- (from LEX_BUILDER)

    Two: INTEGER is 50
            -- (from ASCII)

    Underlined: INTEGER is 95
            -- (from ASCII)

    Up_arrow: INTEGER is -2
            -- (from ASCII)

    Upper_a: INTEGER is 65
            -- (from ASCII)

    Upper_b: INTEGER is 66
            -- (from ASCII)

    Upper_c: INTEGER is 67
            -- (from ASCII)

    Upper_d: INTEGER is 68
            -- (from ASCII)

    Upper_e: INTEGER is 69
            -- (from ASCII)

    Upper_f: INTEGER is 70
            -- (from ASCII)

    Upper_g: INTEGER is 71
            -- (from ASCII)

    Upper_h: INTEGER is 72
            -- (from ASCII)

    Upper_i: INTEGER is 73
            -- (from ASCII)

    Upper_j: INTEGER is 74
            -- (from ASCII)

    Upper_k: INTEGER is 75
            -- (from ASCII)

    Upper_l: INTEGER is 76
            -- (from ASCII)

    Upper_m: INTEGER is 77
            -- (from ASCII)

    Upper_n: INTEGER is 78
            -- (from ASCII)

    Upper_o: INTEGER is 79
            -- (from ASCII)

    Upper_p: INTEGER is 80
            -- (from ASCII)

    Upper_q: INTEGER is 81
            -- (from ASCII)

    Upper_r: INTEGER is 82
            -- (from ASCII)

    Upper_s: INTEGER is 83
            -- (from ASCII)

    Upper_t: INTEGER is 84
            -- (from ASCII)

    Upper_u: INTEGER is 85
            -- (from ASCII)

    Upper_v: INTEGER is 86
            -- (from ASCII)

    Upper_w: INTEGER is 87
            -- (from ASCII)

    Upper_x: INTEGER is 88
            -- (from ASCII)

    Upper_y: INTEGER is 89
            -- (from ASCII)

    Upper_z: INTEGER is 90
            -- (from ASCII)

    Us: INTEGER is 31
            -- (from ASCII)

    Vt: INTEGER is 11
            -- (from ASCII)

    Zero: INTEGER is 48
            -- (from ASCII)

    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((pdfa_item (upper) = void or else pdfa_item (upper) = pdfa_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (pdfa_item (upper) = other.pdfa_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    distinguish_case
            -- Make letter case significant in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            case_sensitive

    ignore_case
            -- Make letter case not significant in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            not case_sensitive

    keywords_distinguish_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tool_built: tool_list.is_empty
        ensure -- from LEX_BUILDER
            keywords_case_sensitive

    keywords_ignore_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tools_built: tool_list = void or else tool_list.is_empty
        ensure -- from LEX_BUILDER
            not keywords_case_sensitive

    set_e_transition (source, target: INTEGER)
            -- Set epsilon transition from source to target.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states

    set_final (s, r: INTEGER)
            -- Make s the final state of regular expression r.
            -- (from PDFA)

    set_letters
            -- Direct the active transitions to include letters.
            -- (from PDFA)

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
            -- (from PDFA)
        require -- from  AUTOMATON
            True
        require else -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

feature -- Element change

    add_keyword (word: STRING)
            -- Insert word in the keyword list.
            -- (from PDFA)

    any_character
            -- Create regular expression $. matching all characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    any_printable
            -- Create regular expression $P matching all
            -- printable characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    append (p, s: INTEGER)
            -- Create regular expression ps:
            -- s appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    append_optional (p, s: INTEGER)
            -- Create regular expression p[s]:
            -- s optionally appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    associate (t, n: INTEGER)
            -- Associate the t-th tool with token type n.
            -- If this routine is not used, the default value is t.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            t_selected: selected_tools.has (t)
            n_not_zero: n /= 0
            n_not_minus_one: n /= - 1

    build_dollar_any
            -- Build $., matching any character.
        require
            good_first_character: description.item (cursor) = '.'

    build_dollar_b
            -- Build $B, matching any number of break characters:
            -- blank, new-line, tabulation, carriage-return.

    build_dollar_n
            -- Build $N, matching natural integer constants.
            -- +('0'..'9')

    build_dollar_p
            -- Build $P, matching any printable character.
        require
            good_first_character: description.item (cursor) = 'P'

    build_dollar_r
            -- Build $R, matching floating point constants.
            -- ['+' | '-'] +('0'..'9') '.' *('0'..'9') ['e' | 'E' ['+' | '-']
            -- +('0'..'9')]

    build_dollar_z
            -- Build $Z, matching possibly signed integer constants.
            -- ['+' | '-'] +('0'..'9')

    case_insensitive (c: INTEGER)
            -- Create regular expression ~(c):
            -- like c, but case-insensitive.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            z_possible: last_character_code >= lower_z
            c_in_tool: c >= 1 and c <= last_created_tool

    difference (r: INTEGER; c: CHARACTER)
            -- Create regular expression representing
            -- the difference r - c.
            -- r must be a simple category, such as a..z,
            -- or a union of simple categories,
            -- such as a..z | 0..9.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            r_exists: r >= 1 and r <= last_created_tool
            r_simple_category: tool_list.i_th (r).nb_states = 2

    enter (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like pdfa_item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: pdfa_item (i) = v
            higher_count: count >= old count

    include (fa: PDFA; shift: INTEGER)
            -- Copy fa with state numbers shifted
            -- by shift positions in the transitions.
            -- Do not preserve the final values.
            -- (from PDFA)
        require -- from PDFA
            same_inputs: greatest_input = fa.greatest_input
            nb_states_large_enough: nb_states >= fa.nb_states + shift

    interval (b, e: CHARACTER)
            -- Create regular expression b..e, or b if b = e.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_built: not lexical_frozen
            e_code_small_enough: e.code <= last_character_code
            b_code_large_enough: b.code >= 0
            b_before_e: b.code <= e.code

    iteration (c: INTEGER)
            -- Create regular expression *(c): zero or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration1 (c: INTEGER)
            -- Create regular expression +(c): one or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration_n (n, c: INTEGER)
            -- Create regular expression n(c):
            -- exactly n consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            n_large_enough: n > 0
            c_in_tool: c >= 1 and c <= last_created_tool

    optional (c: INTEGER)
            -- Create regular expression [c]:
            -- optional c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    prepend_optional (p, s: INTEGER)
            -- Create regular expression [p]s:
            -- s appended to optional p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    pdfa_put (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: pdfa_item (k) = v

    put_keyword (s: STRING; exp: INTEGER)
            -- Declare s as a keyword described by
            -- the regular expression of code exp.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            exp_selected: token_type_list /= void and then token_type_list.has (exp)

    put_nameless_expression (s: STRING; n: INTEGER)
            -- Record the regular expression described
            -- by s, and associate it with token type n.
        require
            source_long_enough: s.count > 0

    recognize (s: STRING): INTEGER
            -- Token_type of s; 0 if not recognized
            -- (from LEX_BUILDER)

    remove_case_sensitiveness
            -- Remove case sensitiveness.
            -- (from PDFA)
        require -- from PDFA
            z_possible: greatest_input >= lower_z

    select_tool (i: INTEGER)
            -- Select the i_th tool for inclusion in the main
            -- regular expression.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            i_exist: i > 0 and i <= last_created_tool
        ensure -- from LEX_BUILDER
            i_selected: selected_tools.has (i)

    set_word (word: STRING)
            -- Create regular expression for word:
            -- synonym for concatenation (w o r d).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count >= 1

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

    union (a, b: INTEGER)
            -- Create regular expression for the multiple union
            -- a | a+1 | .. | b: matches any occurrence of
            -- a, or a+1, .., or b.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_not_too_small: a >= 1
            b_not_too_large: b <= last_created_tool
            a_smaller_than_b: a <= b

    union2 (a, b: INTEGER)
            -- Create regular expression a | b: union of
            -- a and b (matches an occurrence of a or b)).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_in_tool: a >= 1 and a <= last_created_tool
            b_in_tool: b >= 1 and b <= last_created_tool

    up_to (word: STRING)
            -- Create regular expression ->"word", which is a
            -- set of any number of any characters ended by "word".
            -- Example: "/* C comment */" matches (->"*/").
            -- The difference between (+$. '*' '/') and
            -- (->"*/") is that "*/..*/..*/" matches
            -- the first but not the second.
            -- The difference between
            -- ((($.-'*') | ('*'($.-'/'))) +('*' '/') )
            -- and "(->"*/")" is that "..**/" matches
            -- the second but not the first.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count > 0
            not_frozen: not lexical_frozen

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    delete_transition (source, input_doc, target: INTEGER)
            -- Delete transition from source to target on input_doc.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: LINKED_LIST [INTEGER])
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove the last regular expression
            -- from the tool list.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            at_least_one_regular: last_created_tool >= 1

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Transformation

    construct_dfa
            -- Create an equivalent deterministic finite automaton.
            -- (from NDFA)
        require -- from NDFA
            start_number_designated: start_number > 0

feature -- Conversion

    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Implementation

    description: STRING
            -- Description of the regular expression

    initialized: BOOLEAN
            -- Is analyzer initialized?
            -- (from LEX_BUILDER)

feature  -- Input

    retrieve_analyzer (file_name: STRING)
            -- Retrieve analyzer from file named file_name.
            -- (from LEX_BUILDER)

feature  -- Output

    store_analyzer (file_name: STRING)
            -- Store analyzer in file named file_name.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            initialized: initialized

feature -- Output

    trace
            -- Output an internal representation
            -- of the current automaton.
            -- (from PDFA)

invariant

    cursor_not_too_far: cursor <= description_length
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LEX_BUILDER
    last_created: tool_list = void or else last_created_tool = tool_list.count
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class HIGH_BUILDER


LEXICAL Chart

class
    LEXICAL

General
    cluster: lex.lex
    description: "Lexical analyzers"
    create: make_new, make

Ancestors
    TEXT_FILLER

Queries
    buffer: STRING
    buffer_item_code (c: INTEGER): INTEGER
    buffer_size: INTEGER
    char_buffered_number: INTEGER
    column_nb_array: LEX_ARRAY [INTEGER]
    dfa: FIXED_DFA
    end_of_text: BOOLEAN
    file_name: STRING
    keyword_code (word: STRING): INTEGER
    keyword_string (n: INTEGER): STRING
    last_is_keyword: BOOLEAN
    last_keyword_code: INTEGER
    last_keyword_text: STRING
    last_string_read: STRING
    last_token: TOKEN
    line_nb_array: LEX_ARRAY [INTEGER]
    No_token: INTEGER
    other_possible_tokens: ARRAY [INTEGER]
    token_column_number: INTEGER
    token_line_number: INTEGER
    token_type: INTEGER

Commands
    close_file
    create_buffers (buf, lin: INTEGER)
    exclude (i, j: INTEGER)
    fill_buffer (b: INTEGER)
    fill_whole_buffer
    get_any_token
    get_fixed_token (l: INTEGER)
    get_short_token
    get_token
    make
    make_new
    resize_and_fill_buffer (buf, b: INTEGER)
    set_file (f_name: STRING)
    set_separator_type (type: INTEGER)
    set_string (s: STRING)
    trace


LEXICAL Flat contracts

indexing
    description: "Lexical analyzers"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    LEXICAL

create

    make
            -- Set up lexical analyzer for retrieval.

    make_new
            -- Set up a new lexical analyzer

feature -- Initialization

    make
            -- Set up lexical analyzer for retrieval.

    make_new
            -- Set up a new lexical analyzer

feature -- Access

    buffer: STRING
            -- Buffer filled by fill_buffer
            -- (from TEXT_FILLER)

    char_buffered_number: INTEGER
            -- Number of characters read and written
            -- in buffer since the beginning
            -- (from TEXT_FILLER)

    column_nb_array: LEX_ARRAY [INTEGER]
            -- Array recording the column numbers of each buffered
            -- character (the column number of the i-th character in the
            -- buffer is the i-th entry of column_nb_array)
            -- (from TEXT_FILLER)

    end_of_text: BOOLEAN
            -- Has end of input been reached?

    file_name: STRING
            -- Name of input file
            -- (from TEXT_FILLER)

    keyword_code (word: STRING): INTEGER
            -- Keyword code for word.
            -- -1 if not a keyword.

    keyword_string (n: INTEGER): STRING
            -- Keyword corresponding to keyword code n
        ensure
            keyword_found: Result /= void

    last_is_keyword: BOOLEAN
            -- Is the last read token a keyword?
        ensure
            Result = is_keyword (last_string_read)

    last_keyword_code: INTEGER
            -- Keyword code for last token.
            -- -1 if not a keyword.

    last_keyword_text: STRING
            -- Last read string if recognized as a keyword;
            -- void otherwise.

    last_string_read: STRING
            -- String value of last token read

    last_token: TOKEN
            -- Last token read

    line_nb_array: LEX_ARRAY [INTEGER]
            -- Array recording the line numbers of each buffered
            -- character (the line number of the i-th character in the
            -- buffer is the i-th entry of line_nb_array)
            -- (from TEXT_FILLER)

    No_token: INTEGER is 0
            -- Token type for no token recognized.

    other_possible_tokens: ARRAY [INTEGER]
            -- Other candidate types for last recognized token

    token_column_number: INTEGER
            -- Column number of last token read
        ensure
            Result >= 1

    token_line_number: INTEGER
            -- Line number of last token read
        ensure
            Result >= 1

    token_type: INTEGER
            -- Type of last token read

feature -- Status setting

    close_file
            -- Close input file if any.
            -- (from TEXT_FILLER)
        ensure -- from TEXT_FILLER
            file_is_void: file = void

    create_buffers (buf, lin: INTEGER)
            -- Create buffers and mask.
            -- (from TEXT_FILLER)
        ensure -- from TEXT_FILLER
            buffer_size = buf
            line_length = lin

    exclude (i, j: INTEGER)
            -- Discard columns i to j from the input.
            -- A zero value for j means all the way to the
            -- end of the line.
            -- (from TEXT_FILLER)
        require -- from TEXT_FILLER
            i_positive: i > 0
            j_null_or_greater_than_i: j = 0 or j >= i

    fill_buffer (b: INTEGER)
            -- Copy the characters from the b+1-st to the last one in
            -- the beginning of the buffer and then fill the end of
            -- the buffer with the text. This routine skips the columns
            -- forbidden by exclude, but always puts '\n' at the end
            -- of a line; the line and column numbers are those of
            -- the characters in the real file.
            -- (from TEXT_FILLER)
        require -- from TEXT_FILLER
            buffer_created: buffer /= void
            c_buffer_created: column_nb_array /= void
            l_buffer_created: line_nb_array /= void
            b_not_too_large: b <= buffer_size
            b_positive: b >= 0

    fill_whole_buffer
            -- Fill with new characters.
            -- (from TEXT_FILLER)

    resize_and_fill_buffer (buf, b: INTEGER)
            -- When increasing buffer_size: resize the buffer and then
            -- fill the new buffer.
            -- When decreasing buffer_size: fill the buffer and then
            -- resize it.
            -- When filling the buffer: Copy the characters from the
            -- b+1-st to the last one (of the buffer before resizing) in
            -- the beginning of the buffer and then fill
            -- the end of the buffer (after resizing) with the text.
            -- This routine skips the columns
            -- forbidden by exclude, but always puts '\n' at the end
            -- of a line; the line and column numbers are those of
            -- the characters in the real file.
            -- (from TEXT_FILLER)
        require -- from TEXT_FILLER
            buffer_created: buffer /= void
            c_buffer_created: column_nb_array /= void
            l_buffer_created: line_nb_array /= void
            b_not_too_large: b <= buffer_size
            b_positive: b >= 0
        ensure -- from TEXT_FILLER
            buffer_size = buf

    set_file (f_name: STRING)
            -- Use f_name as input file.
            -- (from TEXT_FILLER)
        require -- from TEXT_FILLER
            file_name_not_void: f_name /= void

    set_separator_type (type: INTEGER)
            -- Set type to be the type of tokens
            -- used as separators.
        ensure
            separator_token_type = type

    set_string (s: STRING)
            -- Use s as the input string.
            -- (from TEXT_FILLER)
        require -- from TEXT_FILLER
            string_not_void: s /= void

feature -- Implementation

    buffer_size: INTEGER
            -- Buffer size
            -- (from TEXT_FILLER)

    dfa: FIXED_DFA
            -- Automaton used for the parsing

feature -- Input

    buffer_item_code (c: INTEGER): INTEGER

    get_any_token
            -- Try to read a new token.
            -- Recognize longest possible string.
        require
            dfa_not_void: dfa /= void
            not_end_of_text: not end_of_text
            buffers_created: buffer /= void

    get_fixed_token (l: INTEGER)
            -- Read new token that matches one of the
            -- lexical grammar's regular expressions.
            -- Recognize longest possible string with
            -- length less than or equal to l.
        require
            dfa_not_void: dfa /= void
            not_end_of_text: not end_of_text
            buffers_created: buffer /= void

    get_short_token
            -- Read shortest token that matches one of the
            -- lexical grammar's regular expressions.
        require
            dfa_not_void: dfa /= void
            not_end_of_text: not end_of_text
            buffers_created: buffer /= void

    get_token
            -- Read new token matching one of the regular
            -- expressions of the lexical grammar.
            -- Recognize longest possible string;
            -- ignore unrecognized tokens and separators.
        ensure
            end_of_text or (token_type /= separator_token_type and token_type /= 0)

feature -- Output

    trace
            -- Output information about the analyzer's
            -- current status.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class LEXICAL


LEX_ARRAY Chart

class
    LEX_ARRAY [T]

General
    cluster: lex.lex
    description: "One-dimensional arrays for lexical analysis"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): T
    additional_space: INTEGER
    all_default: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): T
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: T): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LEX_ARRAY [T]): BOOLEAN
    is_inserted (v: T): BOOLEAN
    item (i: INTEGER): T
    linear_representation: LINEAR [T]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: T): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] LEX_ARRAY [T]): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] LEX_ARRAY [T]
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    array_make (min_index, max_index: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] LEX_ARRAY [T])
    discard_items
    enter (v: [like item] T; i: INTEGER)
    fill (other: CONTAINER [T])
    force (v: [like item] T; i: INTEGER)
    grow (i: INTEGER)
    make (lower_index, upper_index: INTEGER)
    make_from_array (a: ARRAY [T])
    prune_all (v: T)
    put (v: [like item] T; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    subcopy (other: [like Current] LEX_ARRAY [T]; start_pos, end_pos, index_pos: INTEGER)


LEX_ARRAY Flat contracts

indexing
    description: "One-dimensional arrays for lexical analysis"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    LEX_ARRAY [T]

create

    make (lower_index, upper_index: INTEGER)

feature -- Initialization

    make (lower_index, upper_index: INTEGER)

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [T])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature  -- Access

    item (i: INTEGER): T
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Access

    entry (i: INTEGER): T
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: T): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    infix "@" (i: INTEGER): T
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Measurement

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: T): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: T): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature  -- Element change

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

feature -- Element change

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [T])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: T)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

feature  -- Resizing

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [T]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class LEX_ARRAY


LEX_BUILDER Chart

class
    LEX_BUILDER

General
    cluster: lex.lex
    description: "General mechanisms for building lexical analyzers"
    create: make_extended, make

Ancestors
    PDFA

Queries
    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
    Ack: INTEGER
    additional_space: INTEGER
    all_default: BOOLEAN
    Ampersand: INTEGER
    analyzer: LEXICAL
    area: SPECIAL [LINKED_LIST [INTEGER]]
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    capacity: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    case_sensitive: BOOLEAN
    categories_table: ARRAY [INTEGER]
    changeable_comparison_criterion: BOOLEAN
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    count: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    dfa: FIXED_DFA
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    entry (i: INTEGER): LINKED_LIST [INTEGER]
    Eot: INTEGER
    Equal_sign: INTEGER
    Error_list: ERROR_LIST
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    extendible: BOOLEAN
    final_array: ARRAY [INTEGER]
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    full: BOOLEAN
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    greatest_input: INTEGER
    Growth_percentage: INTEGER
    Gs: INTEGER
    has (v: LINKED_LIST [INTEGER]): BOOLEAN
    has_letters: BOOLEAN
    Home_arrow: INTEGER
    Ht: INTEGER
    index_set: INTEGER_INTERVAL
    initialized: BOOLEAN
    input_array: ARRAY [FIXED_INTEGER_SET]
    is_empty: BOOLEAN
    is_equal (other: [like Current] LEX_BUILDER): BOOLEAN
    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
    keyword_h_table: HASH_TABLE [INTEGER, STRING]
    keywords_case_sensitive: BOOLEAN
    keywords_list: LINKED_LIST [STRING]
    Last_ascii: INTEGER
    last_character_code: INTEGER
    last_created_tool: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    lexical_frozen: BOOLEAN
    Line_feed: INTEGER
    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
    lower: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minimal_increase: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    nb_states: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
    Percent: INTEGER
    Plus: INTEGER
    prunable: BOOLEAN
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    recognize (s: STRING): INTEGER
    resizable: BOOLEAN
    Right_arrow: INTEGER
    Rs: INTEGER
    same_items (other: [like Current] LEX_BUILDER): BOOLEAN
    selected_tools: LINKED_LIST [INTEGER]
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    start_number: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] LEX_BUILDER
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    token_type_list: LINKED_LIST [INTEGER]
    tool_list: LINKED_LIST [PDFA]
    tool_names: LINKED_LIST [STRING]
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    upper: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    Vt: INTEGER
    Zero: INTEGER

Commands
    add_keyword (word: STRING)
    any_character
    any_printable
    append (p, s: INTEGER)
    append_optional (p, s: INTEGER)
    array_make (min_index, max_index: INTEGER)
    associate (t, n: INTEGER)
    automatic_grow
    case_insensitive (c: INTEGER)
    clear_all
    compare_objects
    compare_references
    construct_dfa
    copy (other: [like Current] LEX_BUILDER)
    delete_transition (source, input_doc, target: INTEGER)
    difference (r: INTEGER; c: CHARACTER)
    discard_items
    distinguish_case
    enter (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
    force (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    grow (i: INTEGER)
    ignore_case
    include (fa: PDFA; shift: INTEGER)
    initialize
    interval (b, e: CHARACTER)
    iteration (c: INTEGER)
    iteration1 (c: INTEGER)
    iteration_n (n, c: INTEGER)
    keywords_distinguish_case
    keywords_ignore_case
    make
    make_extended (char_code: INTEGER)
    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
    optional (c: INTEGER)
    pdfa_make (n, i: INTEGER)
    pdfa_put (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    prepend_optional (p, s: INTEGER)
    prune_all (v: LINKED_LIST [INTEGER])
    put_keyword (s: STRING; exp: INTEGER)
    remove
    remove_case_sensitiveness
    resize (min_index, max_index: INTEGER)
    retrieve_analyzer (file_name: STRING)
    select_tool (i: INTEGER)
    set_e_transition (source, target: INTEGER)
    set_final (s, r: INTEGER)
    set_letters
    set_start (n: INTEGER)
    set_transition (source, input_doc, target: INTEGER)
    set_word (word: STRING)
    store_analyzer (file_name: STRING)
    subcopy (other: [like Current] LEX_BUILDER; start_pos, end_pos, index_pos: INTEGER)
    trace
    union (a, b: INTEGER)
    union2 (a, b: INTEGER)
    up_to (word: STRING)

Constraints
    last created


LEX_BUILDER Flat contracts

indexing
    description: "General mechanisms for building lexical analyzers"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    LEX_BUILDER

create

    make
            -- Set up the analyzer.
        ensure
            last_character_set: last_character_code = last_ascii

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
        require
            valid_char_code: char_code > 0
        ensure
            last_character_set: last_character_code = char_code

feature -- Initialization

    initialize
            -- Set up attributes of analyzer.
        ensure
            initialized

    pdfa_make (n, i: INTEGER)
            -- Make a PDFA with n states, and i + 1 inputs.
            -- (from PDFA)

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make
            -- Set up the analyzer.
        ensure
            last_character_set: last_character_code = last_ascii

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
        require
            valid_char_code: char_code > 0
        ensure
            last_character_set: last_character_code = char_code

    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    Ack: INTEGER is 6
            -- (from ASCII)

    Ampersand: INTEGER is 38
            -- (from ASCII)

    analyzer: LEXICAL
            -- The lexical analyzer built so far

    area: SPECIAL [LINKED_LIST [INTEGER]]
            -- Special data zone
            -- (from TO_SPECIAL)

    Back_space: INTEGER is 8
            -- (from ASCII)

    Backslash: INTEGER is 92
            -- (from ASCII)

    Bar: INTEGER is 124
            -- (from ASCII)

    Bel: INTEGER is 7
            -- (from ASCII)

    Blank: INTEGER is 32
            -- (from ASCII)

    Break: INTEGER is -7
            -- (from ASCII)

    Bs: INTEGER is 8
            -- (from ASCII)

    Buf_overflow: INTEGER is -9
            -- (from ASCII)

    Can: INTEGER is 24
            -- (from ASCII)

    Carriage_return: INTEGER is 13
            -- (from ASCII)

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a
            -- (from ASCII)

    case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive?

    categories_table: ARRAY [INTEGER]
            -- Table of category numbers for each input

    Character_set_size: INTEGER is 128
            -- (from ASCII)

    Circumflex: INTEGER is 94
            -- (from ASCII)

    Closing_brace: INTEGER is 125
            -- (from ASCII)

    Colon: INTEGER is 58
            -- (from ASCII)

    Comma: INTEGER is 44
            -- (from ASCII)

    Commercial_at: INTEGER is 64
            -- (from ASCII)

    Cr: INTEGER is 13
            -- (from ASCII)

    Ctrl_a: INTEGER is 1
            -- (from ASCII)

    Ctrl_b: INTEGER is 2
            -- (from ASCII)

    Ctrl_backslash: INTEGER is 28
            -- (from ASCII)

    Ctrl_c: INTEGER is 3
            -- (from ASCII)

    Ctrl_circumflex: INTEGER is 30
            -- (from ASCII)

    Ctrl_d: INTEGER is 4
            -- (from ASCII)

    Ctrl_e: INTEGER is 5
            -- (from ASCII)

    Ctrl_f: INTEGER is 6
            -- (from ASCII)

    Ctrl_g: INTEGER is 7
            -- (from ASCII)

    Ctrl_h: INTEGER is 8
            -- (from ASCII)

    Ctrl_i: INTEGER is 9
            -- (from ASCII)

    Ctrl_j: INTEGER is 10
            -- (from ASCII)

    Ctrl_k: INTEGER is 11
            -- (from ASCII)

    Ctrl_l: INTEGER is 12
            -- (from ASCII)

    Ctrl_lbracket: INTEGER is 27
            -- (from ASCII)

    Ctrl_m: INTEGER is 13
            -- (from ASCII)

    Ctrl_n: INTEGER is 14
            -- (from ASCII)

    Ctrl_o: INTEGER is 15
            -- (from ASCII)

    Ctrl_p: INTEGER is 16
            -- (from ASCII)

    Ctrl_q: INTEGER is 17
            -- (from ASCII)

    Ctrl_questmark: INTEGER is 127
            -- (from ASCII)

    Ctrl_r: INTEGER is 18
            -- (from ASCII)

    Ctrl_rbracket: INTEGER is 29
            -- (from ASCII)

    Ctrl_s: INTEGER is 19
            -- (from ASCII)

    Ctrl_t: INTEGER is 20
            -- (from ASCII)

    Ctrl_u: INTEGER is 21
            -- (from ASCII)

    Ctrl_underlined: INTEGER is 31
            -- (from ASCII)

    Ctrl_v: INTEGER is 22
            -- (from ASCII)

    Ctrl_w: INTEGER is 23
            -- (from ASCII)

    Ctrl_x: INTEGER is 24
            -- (from ASCII)

    Ctrl_y: INTEGER is 25
            -- (from ASCII)

    Ctrl_z: INTEGER is 26
            -- (from ASCII)

    Dc1: INTEGER is 17
            -- (from ASCII)

    Dc2: INTEGER is 18
            -- (from ASCII)

    Dc3: INTEGER is 19
            -- (from ASCII)

    Dc4: INTEGER is 20
            -- (from ASCII)

    Del: INTEGER is 127
            -- (from ASCII)

    dfa: FIXED_DFA
            -- DFA built by routine construct_dfa,
            -- which recognizes the same language.
            -- (from NDFA)

    Dle: INTEGER is 16
            -- (from ASCII)

    Dollar: INTEGER is 36
            -- (from ASCII)

    Dot: INTEGER is 46
            -- (from ASCII)

    Doublequote: INTEGER is 34
            -- (from ASCII)

    Down_arrow: INTEGER is -3
            -- (from ASCII)

    Eight: INTEGER is 56
            -- (from ASCII)

    Em: INTEGER is 25
            -- (from ASCII)

    Enq: INTEGER is 5
            -- (from ASCII)

    entry (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    Eot: INTEGER is 4
            -- (from ASCII)

    Equal_sign: INTEGER is 61
            -- (from ASCII)

    error_list: ERROR_LIST
            -- List of error messages

    Esc: INTEGER is 27
            -- (from ASCII)

    Etb: INTEGER is 23
            -- (from ASCII)

    Etx: INTEGER is 3
            -- (from ASCII)

    Exclamation: INTEGER is 33
            -- (from ASCII)

    final_array: ARRAY [INTEGER]
            -- The final value for each state
            -- (regular expression, if any, for which it is final).
            -- (from PDFA)

    First_printable: INTEGER is 32
            -- (from ASCII)

    Five: INTEGER is 53
            -- (from ASCII)

    Four: INTEGER is 52
            -- (from ASCII)

    Fs: INTEGER is 28
            -- (from ASCII)

    Grave_accent: INTEGER is 96
            -- (from ASCII)

    Greaterthan: INTEGER is 62
            -- (from ASCII)

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    Gs: INTEGER is 29
            -- (from ASCII)

    has (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_letters: BOOLEAN
            -- Are there any letters among the active transitions?
            -- (from PDFA)

    Home_arrow: INTEGER is -6
            -- (from ASCII)

    Ht: INTEGER is 9
            -- (from ASCII)

    input_array: ARRAY [FIXED_INTEGER_SET]
            -- For each input, set of the states which have
            -- a transition on this input to the following state
            -- (from PDFA)

    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    keyword_h_table: HASH_TABLE [INTEGER, STRING]
            -- Keyword table

    keywords_case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive for keywords?

    keywords_list: LINKED_LIST [STRING]
            -- Keywords associated with current automaton.
            -- (from PDFA)

    Last_ascii: INTEGER is 127
            -- (from ASCII)

    last_character_code: INTEGER
            -- Last character code recognized by the language

    last_created_tool: INTEGER
            -- Identification number of the last
            -- regular expression put in tool_list

    Last_printable: INTEGER is 126
            -- (from ASCII)

    Lbracket: INTEGER is 91
            -- (from ASCII)

    Lcurly: INTEGER is 40
            -- (from ASCII)

    Left_arrow: INTEGER is -4
            -- (from ASCII)

    Lessthan: INTEGER is 60
            -- (from ASCII)

    Letter_layout: INTEGER is 70
            -- (from ASCII)

    lexical_frozen: BOOLEAN
            -- Has the lexical grammar been finalized?
            -- | (in other words: has the DFA been built?)

    Line_feed: INTEGER is 10
            -- (from ASCII)

    Lower_a: INTEGER is 97
            -- (from ASCII)

    Lower_b: INTEGER is 98
            -- (from ASCII)

    Lower_c: INTEGER is 99
            -- (from ASCII)

    Lower_d: INTEGER is 100
            -- (from ASCII)

    Lower_e: INTEGER is 101
            -- (from ASCII)

    Lower_f: INTEGER is 102
            -- (from ASCII)

    Lower_g: INTEGER is 103
            -- (from ASCII)

    Lower_h: INTEGER is 104
            -- (from ASCII)

    Lower_i: INTEGER is 105
            -- (from ASCII)

    Lower_j: INTEGER is 106
            -- (from ASCII)

    Lower_k: INTEGER is 107
            -- (from ASCII)

    Lower_l: INTEGER is 108
            -- (from ASCII)

    Lower_m: INTEGER is 109
            -- (from ASCII)

    Lower_n: INTEGER is 110
            -- (from ASCII)

    Lower_o: INTEGER is 111
            -- (from ASCII)

    Lower_p: INTEGER is 112
            -- (from ASCII)

    Lower_q: INTEGER is 113
            -- (from ASCII)

    Lower_r: INTEGER is 114
            -- (from ASCII)

    Lower_s: INTEGER is 115
            -- (from ASCII)

    Lower_t: INTEGER is 116
            -- (from ASCII)

    Lower_u: INTEGER is 117
            -- (from ASCII)

    Lower_v: INTEGER is 118
            -- (from ASCII)

    Lower_w: INTEGER is 119
            -- (from ASCII)

    Lower_x: INTEGER is 120
            -- (from ASCII)

    Lower_y: INTEGER is 121
            -- (from ASCII)

    Lower_z: INTEGER is 122
            -- (from ASCII)

    Minus: INTEGER is 45
            -- (from ASCII)

    Nak: INTEGER is 21
            -- (from ASCII)

    Nine: INTEGER is 57
            -- (from ASCII)

    Nl: INTEGER is 10
            -- (from ASCII)

    Np: INTEGER is 12
            -- (from ASCII)

    Nul: INTEGER is 0
            -- (from ASCII)

    Number_sign: INTEGER is 35
            -- (from ASCII)

    One: INTEGER is 49
            -- (from ASCII)

    Opening_brace: INTEGER is 123
            -- (from ASCII)

    Overflow: INTEGER is -8
            -- (from ASCII)

    Percent: INTEGER is 37
            -- (from ASCII)

    Plus: INTEGER is 43
            -- (from ASCII)

    Questmark: INTEGER is 63
            -- (from ASCII)

    Rbracket: INTEGER is 93
            -- (from ASCII)

    Rcurly: INTEGER is 41
            -- (from ASCII)

    Right_arrow: INTEGER is -5
            -- (from ASCII)

    Rs: INTEGER is 30
            -- (from ASCII)

    selected_tools: LINKED_LIST [INTEGER]
            -- Regular expressions included in the main one

    Semicolon: INTEGER is 59
            -- (from ASCII)

    Seven: INTEGER is 55
            -- (from ASCII)

    Si: INTEGER is 15
            -- (from ASCII)

    Singlequote: INTEGER is 39
            -- (from ASCII)

    Six: INTEGER is 54
            -- (from ASCII)

    Slash: INTEGER is 47
            -- (from ASCII)

    So: INTEGER is 14
            -- (from ASCII)

    Soh: INTEGER is 1
            -- (from ASCII)

    Sp: INTEGER is 32
            -- (from ASCII)

    Star: INTEGER is 42
            -- (from ASCII)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    Stx: INTEGER is 2
            -- (from ASCII)

    Sub: INTEGER is 26
            -- (from ASCII)

    Syn: INTEGER is 22
            -- (from ASCII)

    Tabulation: INTEGER is 9
            -- (from ASCII)

    Three: INTEGER is 51
            -- (from ASCII)

    Tilde: INTEGER is 126
            -- (from ASCII)

    token_type_list: LINKED_LIST [INTEGER]
            -- Token types of the selected tools.
            -- Indexed by tool numbers.

    tool_list: LINKED_LIST [PDFA]
            -- Regular expressions used as auxiliary tools

    tool_names: LINKED_LIST [STRING]
            -- Names of regular expressions in tool list

    Two: INTEGER is 50
            -- (from ASCII)

    Underlined: INTEGER is 95
            -- (from ASCII)

    Up_arrow: INTEGER is -2
            -- (from ASCII)

    Upper_a: INTEGER is 65
            -- (from ASCII)

    Upper_b: INTEGER is 66
            -- (from ASCII)

    Upper_c: INTEGER is 67
            -- (from ASCII)

    Upper_d: INTEGER is 68
            -- (from ASCII)

    Upper_e: INTEGER is 69
            -- (from ASCII)

    Upper_f: INTEGER is 70
            -- (from ASCII)

    Upper_g: INTEGER is 71
            -- (from ASCII)

    Upper_h: INTEGER is 72
            -- (from ASCII)

    Upper_i: INTEGER is 73
            -- (from ASCII)

    Upper_j: INTEGER is 74
            -- (from ASCII)

    Upper_k: INTEGER is 75
            -- (from ASCII)

    Upper_l: INTEGER is 76
            -- (from ASCII)

    Upper_m: INTEGER is 77
            -- (from ASCII)

    Upper_n: INTEGER is 78
            -- (from ASCII)

    Upper_o: INTEGER is 79
            -- (from ASCII)

    Upper_p: INTEGER is 80
            -- (from ASCII)

    Upper_q: INTEGER is 81
            -- (from ASCII)

    Upper_r: INTEGER is 82
            -- (from ASCII)

    Upper_s: INTEGER is 83
            -- (from ASCII)

    Upper_t: INTEGER is 84
            -- (from ASCII)

    Upper_u: INTEGER is 85
            -- (from ASCII)

    Upper_v: INTEGER is 86
            -- (from ASCII)

    Upper_w: INTEGER is 87
            -- (from ASCII)

    Upper_x: INTEGER is 88
            -- (from ASCII)

    Upper_y: INTEGER is 89
            -- (from ASCII)

    Upper_z: INTEGER is 90
            -- (from ASCII)

    Us: INTEGER is 31
            -- (from ASCII)

    Vt: INTEGER is 11
            -- (from ASCII)

    Zero: INTEGER is 48
            -- (from ASCII)

    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((pdfa_item (upper) = void or else pdfa_item (upper) = pdfa_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (pdfa_item (upper) = other.pdfa_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    distinguish_case
            -- Make letter case significant in future tools.
            -- Default is ignore case.
        ensure
            case_sensitive

    ignore_case
            -- Make letter case not significant in future tools.
            -- This is the default.
        ensure
            not case_sensitive

    keywords_distinguish_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- Default is ignore case.
        require
            no_tool_built: tool_list.is_empty
        ensure
            keywords_case_sensitive

    keywords_ignore_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- This is the default.
        require
            no_tools_built: tool_list = void or else tool_list.is_empty
        ensure
            not keywords_case_sensitive

    set_e_transition (source, target: INTEGER)
            -- Set epsilon transition from source to target.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states

    set_final (s, r: INTEGER)
            -- Make s the final state of regular expression r.
            -- (from PDFA)

    set_letters
            -- Direct the active transitions to include letters.
            -- (from PDFA)

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
            -- (from PDFA)
        require -- from  AUTOMATON
            True
        require else -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

feature -- Element change

    add_keyword (word: STRING)
            -- Insert word in the keyword list.
            -- (from PDFA)

    any_character
            -- Create regular expression $. matching all characters.
        require
            not_frozen: not lexical_frozen

    any_printable
            -- Create regular expression $P matching all
            -- printable characters.
        require
            not_frozen: not lexical_frozen

    append (p, s: INTEGER)
            -- Create regular expression ps:
            -- s appended to p.
        require
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    append_optional (p, s: INTEGER)
            -- Create regular expression p[s]:
            -- s optionally appended to p.
        require
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    associate (t, n: INTEGER)
            -- Associate the t-th tool with token type n.
            -- If this routine is not used, the default value is t.
        require
            t_selected: selected_tools.has (t)
            n_not_zero: n /= 0
            n_not_minus_one: n /= - 1

    case_insensitive (c: INTEGER)
            -- Create regular expression ~(c):
            -- like c, but case-insensitive.
        require
            not_frozen: not lexical_frozen
            z_possible: last_character_code >= lower_z
            c_in_tool: c >= 1 and c <= last_created_tool

    difference (r: INTEGER; c: CHARACTER)
            -- Create regular expression representing
            -- the difference r - c.
            -- r must be a simple category, such as a..z,
            -- or a union of simple categories,
            -- such as a..z | 0..9.
        require
            not_frozen: not lexical_frozen
            r_exists: r >= 1 and r <= last_created_tool
            r_simple_category: tool_list.i_th (r).nb_states = 2

    enter (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like pdfa_item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: pdfa_item (i) = v
            higher_count: count >= old count

    include (fa: PDFA; shift: INTEGER)
            -- Copy fa with state numbers shifted
            -- by shift positions in the transitions.
            -- Do not preserve the final values.
            -- (from PDFA)
        require -- from PDFA
            same_inputs: greatest_input = fa.greatest_input
            nb_states_large_enough: nb_states >= fa.nb_states + shift

    interval (b, e: CHARACTER)
            -- Create regular expression b..e, or b if b = e.
        require
            not_built: not lexical_frozen
            e_code_small_enough: e.code <= last_character_code
            b_code_large_enough: b.code >= 0
            b_before_e: b.code <= e.code

    iteration (c: INTEGER)
            -- Create regular expression *(c): zero or more
            -- consecutive occurrences of c.
        require
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration1 (c: INTEGER)
            -- Create regular expression +(c): one or more
            -- consecutive occurrences of c.
        require
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration_n (n, c: INTEGER)
            -- Create regular expression n(c):
            -- exactly n consecutive occurrences of c.
        require
            not_frozen: not lexical_frozen
            n_large_enough: n > 0
            c_in_tool: c >= 1 and c <= last_created_tool

    optional (c: INTEGER)
            -- Create regular expression [c]:
            -- optional c.
        require
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    prepend_optional (p, s: INTEGER)
            -- Create regular expression [p]s:
            -- s appended to optional p.
        require
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    pdfa_put (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: pdfa_item (k) = v

    put_keyword (s: STRING; exp: INTEGER)
            -- Declare s as a keyword described by
            -- the regular expression of code exp.
        require
            not_frozen: not lexical_frozen
            exp_selected: token_type_list /= void and then token_type_list.has (exp)

    recognize (s: STRING): INTEGER
            -- Token_type of s; 0 if not recognized

    remove_case_sensitiveness
            -- Remove case sensitiveness.
            -- (from PDFA)
        require -- from PDFA
            z_possible: greatest_input >= lower_z

    select_tool (i: INTEGER)
            -- Select the i_th tool for inclusion in the main
            -- regular expression.
        require
            not_frozen: not lexical_frozen
            i_exist: i > 0 and i <= last_created_tool
        ensure
            i_selected: selected_tools.has (i)

    set_word (word: STRING)
            -- Create regular expression for word:
            -- synonym for concatenation (w o r d).
        require
            word_not_empty: word.count >= 1

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

    union (a, b: INTEGER)
            -- Create regular expression for the multiple union
            -- a | a+1 | .. | b: matches any occurrence of
            -- a, or a+1, .., or b.
        require
            not_frozen: not lexical_frozen
            a_not_too_small: a >= 1
            b_not_too_large: b <= last_created_tool
            a_smaller_than_b: a <= b

    union2 (a, b: INTEGER)
            -- Create regular expression a | b: union of
            -- a and b (matches an occurrence of a or b)).
        require
            not_frozen: not lexical_frozen
            a_in_tool: a >= 1 and a <= last_created_tool
            b_in_tool: b >= 1 and b <= last_created_tool

    up_to (word: STRING)
            -- Create regular expression ->"word", which is a
            -- set of any number of any characters ended by "word".
            -- Example: "/* C comment */" matches (->"*/").
            -- The difference between (+$. '*' '/') and
            -- (->"*/") is that "*/..*/..*/" matches
            -- the first but not the second.
            -- The difference between
            -- ((($.-'*') | ('*'($.-'/'))) +('*' '/') )
            -- and "(->"*/")" is that "..**/" matches
            -- the second but not the first.
        require
            word_not_empty: word.count > 0
            not_frozen: not lexical_frozen

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    delete_transition (source, input_doc, target: INTEGER)
            -- Delete transition from source to target on input_doc.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: LINKED_LIST [INTEGER])
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove the last regular expression
            -- from the tool list.
        require
            not_frozen: not lexical_frozen
            at_least_one_regular: last_created_tool >= 1

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Transformation

    construct_dfa
            -- Create an equivalent deterministic finite automaton.
            -- (from NDFA)
        require -- from NDFA
            start_number_designated: start_number > 0

feature -- Conversion

    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Implementation

    initialized: BOOLEAN
            -- Is analyzer initialized?

feature -- Input

    retrieve_analyzer (file_name: STRING)
            -- Retrieve analyzer from file named file_name.

feature -- Output

    store_analyzer (file_name: STRING)
            -- Store analyzer in file named file_name.
        require
            initialized: initialized

    trace
            -- Output an internal representation
            -- of the current automaton.
            -- (from PDFA)

invariant

    last_created: tool_list = void or else last_created_tool = tool_list.count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class LEX_BUILDER


LINKED_AUTOMATON Chart

class
    LINKED_AUTOMATON [S -> STATE]

General
    cluster: lex.lex
    description: "General finite state automata, implemented as lists"
    create: make

Ancestors
    LINKED_LIST [G]

Queries
    infix "@" (i: INTEGER): [like item] S
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LINKED_AUTOMATON [S]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] S
    for_all (test: FUNCTION [ANY, TUPLE [S], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] S): BOOLEAN
    i_th (i: INTEGER): [like item] S
    index: INTEGER
    index_of (v: [like item] S; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_AUTOMATON [S]): BOOLEAN
    is_inserted (v: S): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: S
    last: [like item] S
    linear_representation: LINEAR [S]
    object_comparison: BOOLEAN
    occurrences (v: [like item] S): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: S): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [S], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [S])
    back
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_AUTOMATON [S])
    do_all (action: PROCEDURE [ANY, TUPLE [S]])
    do_if (action: PROCEDURE [ANY, TUPLE [S]]; test: FUNCTION [ANY, TUPLE [S], BOOLEAN])
    extend (v: [like item] S)
    fill (other: CONTAINER [S])
    finish
    force (v: [like item] S)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] LINKED_AUTOMATON [S])
    merge_right (other: [like Current] LINKED_AUTOMATON [S])
    move (i: INTEGER)
    prune (v: [like item] S)
    prune_all (v: [like item] S)
    put (v: [like item] S)
    put_front (v: [like item] S)
    put_i_th (v: [like item] S; i: INTEGER)
    put_left (v: [like item] S)
    put_right (v: [like item] S)
    remove
    remove_left
    remove_right
    replace (v: [like item] S)
    search (v: [like item] S)
    set_final (state, f: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out


LINKED_AUTOMATON Flat contracts

indexing
    description: "General finite state automata, implemented as lists"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_AUTOMATON [S -> STATE]

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: S
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: S): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: S): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_final (state, f: INTEGER)
            -- Make state a final state for regular expression f.
        require
            is_in_automaton: state <= count and state >= 1
        ensure
            same_index: index = old index

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [S])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [S])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [S]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [S]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [S]]; test: FUNCTION [ANY, TUPLE [S], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [S], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [S], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class LINKED_AUTOMATON


LINKED_DFA Chart

class
    LINKED_DFA

General
    cluster: lex.lex
    description: "Deterministic finite automata, implemented as lists"
    create: make

Ancestors
    DFA
    LINKED_AUTOMATON [S -> STATE]

Queries
    infix "@" (i: INTEGER): [like item] STATE_OF_DFA
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] LINKED_DFA
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    find_successor (source, input_doc: INTEGER): STATE_OF_DFA
    first: [like item] STATE_OF_DFA
    for_all (test: FUNCTION [ANY, TUPLE [STATE_OF_DFA], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    greatest_input: INTEGER
    has (v: [like item] STATE_OF_DFA): BOOLEAN
    i_th (i: INTEGER): [like item] STATE_OF_DFA
    index: INTEGER
    index_of (v: [like item] STATE_OF_DFA; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] LINKED_DFA): BOOLEAN
    is_inserted (v: STATE_OF_DFA): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: STATE_OF_DFA
    last: [like item] STATE_OF_DFA
    lcopy: FIXED_DFA
    linear_representation: LINEAR [STATE_OF_DFA]
    nb_states: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: [like item] STATE_OF_DFA): INTEGER
    off: BOOLEAN
    possible_tokens (l: LINKED_LIST [INTEGER]): ARRAY [INTEGER]
    prunable: BOOLEAN
    readable: BOOLEAN
    recognize (l: LINKED_LIST [INTEGER]): INTEGER
    sequential_occurrences (v: STATE_OF_DFA): INTEGER
    start_number: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [STATE_OF_DFA], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [STATE_OF_DFA])
    back
    compare_objects
    compare_references
    copy (other: [like Current] LINKED_DFA)
    do_all (action: PROCEDURE [ANY, TUPLE [STATE_OF_DFA]])
    do_if (action: PROCEDURE [ANY, TUPLE [STATE_OF_DFA]]; test: FUNCTION [ANY, TUPLE [STATE_OF_DFA], BOOLEAN])
    extend (v: [like item] STATE_OF_DFA)
    fill (other: CONTAINER [STATE_OF_DFA])
    finish
    force (v: [like item] STATE_OF_DFA)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    l_set_final (state, f: INTEGER)
    link_make
    make (i: INTEGER)
    merge_left (other: [like Current] LINKED_DFA)
    merge_right (other: [like Current] LINKED_DFA)
    move (i: INTEGER)
    prune (v: [like item] STATE_OF_DFA)
    prune_all (v: [like item] STATE_OF_DFA)
    put (v: [like item] STATE_OF_DFA)
    put_front (v: [like item] STATE_OF_DFA)
    put_i_th (v: [like item] STATE_OF_DFA; i: INTEGER)
    put_left (v: [like item] STATE_OF_DFA)
    put_right (v: [like item] STATE_OF_DFA)
    remove
    remove_left
    remove_right
    replace (v: [like item] STATE_OF_DFA)
    search (v: [like item] STATE_OF_DFA)
    set_final (state, f: INTEGER)
    set_start (n: INTEGER)
    set_state
    set_transition (source, input_doc, target: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    nb states right


LINKED_DFA Flat contracts

indexing
    description: "Deterministic finite automata, implemented as lists"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_DFA

create

    make (i: INTEGER)
            -- Create automaton, enabling 0 to i inputs.
        require
            i_positive: i >= 0

feature -- Initialization

    make (i: INTEGER)
            -- Create automaton, enabling 0 to i inputs.
        require
            i_positive: i >= 0

    link_make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    find_successor (source, input_doc: INTEGER): STATE_OF_DFA
            -- Successor of source for input_doc;
            -- void if no successor
        require -- from  DFA
            True
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        ensure then
            same_index: old index = index

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    sequential_occurrences (v: STATE_OF_DFA): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    possible_tokens (l: LINKED_LIST [INTEGER]): ARRAY [INTEGER]
            -- Attribute `final_array' of the state reached in Current after
            -- making transitions from state to state on the
            -- inputs listed in l; empty if not recognized
            -- (from DFA)

    recognize (l: LINKED_LIST [INTEGER]): INTEGER
            -- final value for the state reached after
            -- making transitions from state to state on the
            -- inputs listed in l; 0 if not recognized.
            -- (from DFA)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    item: STATE_OF_DFA
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_inserted (v: STATE_OF_DFA): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature  -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    l_set_final (state, f: INTEGER)
            -- Make state a final state for regular expression f.
            -- (from LINKED_AUTOMATON)
        require -- from LINKED_AUTOMATON
            is_in_automaton: state <= count and state >= 1
        ensure -- from LINKED_AUTOMATON
            same_index: index = old index

    set_final (state, f: INTEGER)
            -- Make state a final state for regular expression f.

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_state
            -- Create a new state.
        ensure then
            current_state_is_last: islast

    set_transition (source, input_doc, target: INTEGER)
            -- Make a transition from source to target
            -- for input_doc.
        require -- from  AUTOMATON
            True
        require else -- from DFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        ensure then
            same_index: old index = index

feature  -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Cursor movement

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Element change

    append (s: SEQUENCE [STATE_OF_DFA])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [STATE_OF_DFA])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [STATE_OF_DFA]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

    lcopy: FIXED_DFA
            -- Copy of Current in a fixed_dfa

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [STATE_OF_DFA]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [STATE_OF_DFA]]; test: FUNCTION [ANY, TUPLE [STATE_OF_DFA], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [STATE_OF_DFA], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [STATE_OF_DFA], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    nb_states_right: nb_states = count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class LINKED_DFA


METALEX Chart

class
    METALEX

General
    cluster: lex.lex
    description: "Mechanisms for building lexical analyzers from regular expressions."
    create: make_extended, make

Ancestors
    HIGH_BUILDER

Queries
    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
    Ack: INTEGER
    additional_space: INTEGER
    all_default: BOOLEAN
    Ampersand: INTEGER
    analyzer: LEXICAL
    area: SPECIAL [LINKED_LIST [INTEGER]]
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    capacity: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    case_sensitive: BOOLEAN
    categories_table: ARRAY [INTEGER]
    changeable_comparison_criterion: BOOLEAN
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    count: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    description: STRING
    dfa: FIXED_DFA
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    entry (i: INTEGER): LINKED_LIST [INTEGER]
    Eot: INTEGER
    Equal_sign: INTEGER
    Error_list: ERROR_LIST
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    extendible: BOOLEAN
    final_array: ARRAY [INTEGER]
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    full: BOOLEAN
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    greatest_input: INTEGER
    Growth_percentage: INTEGER
    Gs: INTEGER
    has (v: LINKED_LIST [INTEGER]): BOOLEAN
    has_letters: BOOLEAN
    Home_arrow: INTEGER
    Ht: INTEGER
    index_set: INTEGER_INTERVAL
    initialized: BOOLEAN
    input_array: ARRAY [FIXED_INTEGER_SET]
    is_empty: BOOLEAN
    is_equal (other: [like Current] METALEX): BOOLEAN
    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
    keyword_h_table: HASH_TABLE [INTEGER, STRING]
    keywords_case_sensitive: BOOLEAN
    keywords_list: LINKED_LIST [STRING]
    Last_ascii: INTEGER
    last_character_code: INTEGER
    last_created_tool: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    lexical_frozen: BOOLEAN
    Line_feed: INTEGER
    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
    lower: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minimal_increase: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    nb_states: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    No_token: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
    Percent: INTEGER
    Plus: INTEGER
    prunable: BOOLEAN
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    recognize (s: STRING): INTEGER
    resizable: BOOLEAN
    Right_arrow: INTEGER
    Rs: INTEGER
    same_items (other: [like Current] METALEX): BOOLEAN
    selected_tools: LINKED_LIST [INTEGER]
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    start_number: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] METALEX
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    token_type_list: LINKED_LIST [INTEGER]
    tool_list: LINKED_LIST [PDFA]
    tool_names: LINKED_LIST [STRING]
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    upper: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    Vt: INTEGER
    Zero: INTEGER

Commands
    add_keyword (word: STRING)
    add_word (s: STRING; n: INTEGER)
    any_character
    any_printable
    append (p, s: INTEGER)
    append_optional (p, s: INTEGER)
    array_make (min_index, max_index: INTEGER)
    associate (t, n: INTEGER)
    automatic_grow
    build_dollar_any
    build_dollar_b
    build_dollar_n
    build_dollar_p
    build_dollar_r
    build_dollar_z
    case_insensitive (c: INTEGER)
    clear_all
    compare_objects
    compare_references
    construct_dfa
    copy (other: [like Current] METALEX)
    delete_transition (source, input_doc, target: INTEGER)
    difference (r: INTEGER; c: CHARACTER)
    discard_items
    distinguish_case
    enter (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
    force (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    grow (i: INTEGER)
    ignore_case
    include (fa: PDFA; shift: INTEGER)
    initialize
    interval (b, e: CHARACTER)
    iteration (c: INTEGER)
    iteration1 (c: INTEGER)
    iteration_n (n, c: INTEGER)
    keywords_distinguish_case
    keywords_ignore_case
    make
    make_analyzer
    make_extended (char_code: INTEGER)
    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
    optional (c: INTEGER)
    pdfa_make (n, i: INTEGER)
    pdfa_put (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    prepend_optional (p, s: INTEGER)
    prune_all (v: LINKED_LIST [INTEGER])
    put_expression (s: STRING; n: INTEGER; c: STRING)
    put_keyword (s: STRING; exp: INTEGER)
    put_nameless_expression (s: STRING; n: INTEGER)
    read_grammar (token_file_name: STRING)
    remove
    remove_case_sensitiveness
    resize (min_index, max_index: INTEGER)
    retrieve_analyzer (file_name: STRING)
    select_tool (i: INTEGER)
    set_e_transition (source, target: INTEGER)
    set_final (s, r: INTEGER)
    set_letters
    set_start (n: INTEGER)
    set_transition (source, input_doc, target: INTEGER)
    set_word (word: STRING)
    store_analyzer (file_name: STRING)
    subcopy (other: [like Current] METALEX; start_pos, end_pos, index_pos: INTEGER)
    trace
    union (a, b: INTEGER)
    union2 (a, b: INTEGER)
    up_to (word: STRING)


METALEX Flat contracts

indexing
    description: "Mechanisms for building lexical analyzers from regular expressions."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:54 $"
    revision: "$Revision: 1.3 $"

class interface
    METALEX

create

    make
            -- Set up the analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = last_ascii

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            valid_char_code: char_code > 0
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = char_code

feature -- Initialization

    initialize
            -- Set up attributes of analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            initialized

    make
            -- Set up the analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = last_ascii

    pdfa_make (n, i: INTEGER)
            -- Make a PDFA with n states, and i + 1 inputs.
            -- (from PDFA)

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_analyzer
            -- Create analyzer (if Void) and initialize it.
        require
            not_initialized: not initialized
        ensure
            initialized
            analyzer_created: analyzer /= void
            lexical_frozen

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            valid_char_code: char_code > 0
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = char_code

    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    Ack: INTEGER is 6
            -- (from ASCII)

    Ampersand: INTEGER is 38
            -- (from ASCII)

    analyzer: LEXICAL
            -- The lexical analyzer built so far
            -- (from LEX_BUILDER)

    area: SPECIAL [LINKED_LIST [INTEGER]]
            -- Special data zone
            -- (from TO_SPECIAL)

    Back_space: INTEGER is 8
            -- (from ASCII)

    Backslash: INTEGER is 92
            -- (from ASCII)

    Bar: INTEGER is 124
            -- (from ASCII)

    Bel: INTEGER is 7
            -- (from ASCII)

    Blank: INTEGER is 32
            -- (from ASCII)

    Break: INTEGER is -7
            -- (from ASCII)

    Bs: INTEGER is 8
            -- (from ASCII)

    Buf_overflow: INTEGER is -9
            -- (from ASCII)

    Can: INTEGER is 24
            -- (from ASCII)

    Carriage_return: INTEGER is 13
            -- (from ASCII)

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a
            -- (from ASCII)

    case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive?
            -- (from LEX_BUILDER)

    categories_table: ARRAY [INTEGER]
            -- Table of category numbers for each input
            -- (from LEX_BUILDER)

    Character_set_size: INTEGER is 128
            -- (from ASCII)

    Circumflex: INTEGER is 94
            -- (from ASCII)

    Closing_brace: INTEGER is 125
            -- (from ASCII)

    Colon: INTEGER is 58
            -- (from ASCII)

    Comma: INTEGER is 44
            -- (from ASCII)

    Commercial_at: INTEGER is 64
            -- (from ASCII)

    Cr: INTEGER is 13
            -- (from ASCII)

    Ctrl_a: INTEGER is 1
            -- (from ASCII)

    Ctrl_b: INTEGER is 2
            -- (from ASCII)

    Ctrl_backslash: INTEGER is 28
            -- (from ASCII)

    Ctrl_c: INTEGER is 3
            -- (from ASCII)

    Ctrl_circumflex: INTEGER is 30
            -- (from ASCII)

    Ctrl_d: INTEGER is 4
            -- (from ASCII)

    Ctrl_e: INTEGER is 5
            -- (from ASCII)

    Ctrl_f: INTEGER is 6
            -- (from ASCII)

    Ctrl_g: INTEGER is 7
            -- (from ASCII)

    Ctrl_h: INTEGER is 8
            -- (from ASCII)

    Ctrl_i: INTEGER is 9
            -- (from ASCII)

    Ctrl_j: INTEGER is 10
            -- (from ASCII)

    Ctrl_k: INTEGER is 11
            -- (from ASCII)

    Ctrl_l: INTEGER is 12
            -- (from ASCII)

    Ctrl_lbracket: INTEGER is 27
            -- (from ASCII)

    Ctrl_m: INTEGER is 13
            -- (from ASCII)

    Ctrl_n: INTEGER is 14
            -- (from ASCII)

    Ctrl_o: INTEGER is 15
            -- (from ASCII)

    Ctrl_p: INTEGER is 16
            -- (from ASCII)

    Ctrl_q: INTEGER is 17
            -- (from ASCII)

    Ctrl_questmark: INTEGER is 127
            -- (from ASCII)

    Ctrl_r: INTEGER is 18
            -- (from ASCII)

    Ctrl_rbracket: INTEGER is 29
            -- (from ASCII)

    Ctrl_s: INTEGER is 19
            -- (from ASCII)

    Ctrl_t: INTEGER is 20
            -- (from ASCII)

    Ctrl_u: INTEGER is 21
            -- (from ASCII)

    Ctrl_underlined: INTEGER is 31
            -- (from ASCII)

    Ctrl_v: INTEGER is 22
            -- (from ASCII)

    Ctrl_w: INTEGER is 23
            -- (from ASCII)

    Ctrl_x: INTEGER is 24
            -- (from ASCII)

    Ctrl_y: INTEGER is 25
            -- (from ASCII)

    Ctrl_z: INTEGER is 26
            -- (from ASCII)

    Dc1: INTEGER is 17
            -- (from ASCII)

    Dc2: INTEGER is 18
            -- (from ASCII)

    Dc3: INTEGER is 19
            -- (from ASCII)

    Dc4: INTEGER is 20
            -- (from ASCII)

    Del: INTEGER is 127
            -- (from ASCII)

    dfa: FIXED_DFA
            -- DFA built by routine construct_dfa,
            -- which recognizes the same language.
            -- (from NDFA)

    Dle: INTEGER is 16
            -- (from ASCII)

    Dollar: INTEGER is 36
            -- (from ASCII)

    Dot: INTEGER is 46
            -- (from ASCII)

    Doublequote: INTEGER is 34
            -- (from ASCII)

    Down_arrow: INTEGER is -3
            -- (from ASCII)

    Eight: INTEGER is 56
            -- (from ASCII)

    Em: INTEGER is 25
            -- (from ASCII)

    Enq: INTEGER is 5
            -- (from ASCII)

    entry (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    Eot: INTEGER is 4
            -- (from ASCII)

    Equal_sign: INTEGER is 61
            -- (from ASCII)

    error_list: ERROR_LIST
            -- List of error messages
            -- (from LEX_BUILDER)

    Esc: INTEGER is 27
            -- (from ASCII)

    Etb: INTEGER is 23
            -- (from ASCII)

    Etx: INTEGER is 3
            -- (from ASCII)

    Exclamation: INTEGER is 33
            -- (from ASCII)

    final_array: ARRAY [INTEGER]
            -- The final value for each state
            -- (regular expression, if any, for which it is final).
            -- (from PDFA)

    First_printable: INTEGER is 32
            -- (from ASCII)

    Five: INTEGER is 53
            -- (from ASCII)

    Four: INTEGER is 52
            -- (from ASCII)

    Fs: INTEGER is 28
            -- (from ASCII)

    Grave_accent: INTEGER is 96
            -- (from ASCII)

    Greaterthan: INTEGER is 62
            -- (from ASCII)

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    Gs: INTEGER is 29
            -- (from ASCII)

    has (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_letters: BOOLEAN
            -- Are there any letters among the active transitions?
            -- (from PDFA)

    Home_arrow: INTEGER is -6
            -- (from ASCII)

    Ht: INTEGER is 9
            -- (from ASCII)

    input_array: ARRAY [FIXED_INTEGER_SET]
            -- For each input, set of the states which have
            -- a transition on this input to the following state
            -- (from PDFA)

    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    keyword_h_table: HASH_TABLE [INTEGER, STRING]
            -- Keyword table
            -- (from LEX_BUILDER)

    keywords_case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive for keywords?
            -- (from LEX_BUILDER)

    keywords_list: LINKED_LIST [STRING]
            -- Keywords associated with current automaton.
            -- (from PDFA)

    Last_ascii: INTEGER is 127
            -- (from ASCII)

    last_character_code: INTEGER
            -- Last character code recognized by the language
            -- (from LEX_BUILDER)

    last_created_tool: INTEGER
            -- Identification number of the last
            -- regular expression put in tool_list
            -- (from LEX_BUILDER)

    Last_printable: INTEGER is 126
            -- (from ASCII)

    Lbracket: INTEGER is 91
            -- (from ASCII)

    Lcurly: INTEGER is 40
            -- (from ASCII)

    Left_arrow: INTEGER is -4
            -- (from ASCII)

    Lessthan: INTEGER is 60
            -- (from ASCII)

    Letter_layout: INTEGER is 70
            -- (from ASCII)

    lexical_frozen: BOOLEAN
            -- Has the lexical grammar been finalized?
            -- | (in other words: has the DFA been built?)
            -- (from LEX_BUILDER)

    Line_feed: INTEGER is 10
            -- (from ASCII)

    Lower_a: INTEGER is 97
            -- (from ASCII)

    Lower_b: INTEGER is 98
            -- (from ASCII)

    Lower_c: INTEGER is 99
            -- (from ASCII)

    Lower_d: INTEGER is 100
            -- (from ASCII)

    Lower_e: INTEGER is 101
            -- (from ASCII)

    Lower_f: INTEGER is 102
            -- (from ASCII)

    Lower_g: INTEGER is 103
            -- (from ASCII)

    Lower_h: INTEGER is 104
            -- (from ASCII)

    Lower_i: INTEGER is 105
            -- (from ASCII)

    Lower_j: INTEGER is 106
            -- (from ASCII)

    Lower_k: INTEGER is 107
            -- (from ASCII)

    Lower_l: INTEGER is 108
            -- (from ASCII)

    Lower_m: INTEGER is 109
            -- (from ASCII)

    Lower_n: INTEGER is 110
            -- (from ASCII)

    Lower_o: INTEGER is 111
            -- (from ASCII)

    Lower_p: INTEGER is 112
            -- (from ASCII)

    Lower_q: INTEGER is 113
            -- (from ASCII)

    Lower_r: INTEGER is 114
            -- (from ASCII)

    Lower_s: INTEGER is 115
            -- (from ASCII)

    Lower_t: INTEGER is 116
            -- (from ASCII)

    Lower_u: INTEGER is 117
            -- (from ASCII)

    Lower_v: INTEGER is 118
            -- (from ASCII)

    Lower_w: INTEGER is 119
            -- (from ASCII)

    Lower_x: INTEGER is 120
            -- (from ASCII)

    Lower_y: INTEGER is 121
            -- (from ASCII)

    Lower_z: INTEGER is 122
            -- (from ASCII)

    Minus: INTEGER is 45
            -- (from ASCII)

    Nak: INTEGER is 21
            -- (from ASCII)

    Nine: INTEGER is 57
            -- (from ASCII)

    Nl: INTEGER is 10
            -- (from ASCII)

    Np: INTEGER is 12
            -- (from ASCII)

    Nul: INTEGER is 0
            -- (from ASCII)

    Number_sign: INTEGER is 35
            -- (from ASCII)

    One: INTEGER is 49
            -- (from ASCII)

    Opening_brace: INTEGER is 123
            -- (from ASCII)

    Overflow: INTEGER is -8
            -- (from ASCII)

    Percent: INTEGER is 37
            -- (from ASCII)

    Plus: INTEGER is 43
            -- (from ASCII)

    Questmark: INTEGER is 63
            -- (from ASCII)

    Rbracket: INTEGER is 93
            -- (from ASCII)

    Rcurly: INTEGER is 41
            -- (from ASCII)

    Right_arrow: INTEGER is -5
            -- (from ASCII)

    Rs: INTEGER is 30
            -- (from ASCII)

    selected_tools: LINKED_LIST [INTEGER]
            -- Regular expressions included in the main one
            -- (from LEX_BUILDER)

    Semicolon: INTEGER is 59
            -- (from ASCII)

    Seven: INTEGER is 55
            -- (from ASCII)

    Si: INTEGER is 15
            -- (from ASCII)

    Singlequote: INTEGER is 39
            -- (from ASCII)

    Six: INTEGER is 54
            -- (from ASCII)

    Slash: INTEGER is 47
            -- (from ASCII)

    So: INTEGER is 14
            -- (from ASCII)

    Soh: INTEGER is 1
            -- (from ASCII)

    Sp: INTEGER is 32
            -- (from ASCII)

    Star: INTEGER is 42
            -- (from ASCII)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    Stx: INTEGER is 2
            -- (from ASCII)

    Sub: INTEGER is 26
            -- (from ASCII)

    Syn: INTEGER is 22
            -- (from ASCII)

    Tabulation: INTEGER is 9
            -- (from ASCII)

    Three: INTEGER is 51
            -- (from ASCII)

    Tilde: INTEGER is 126
            -- (from ASCII)

    token_type_list: LINKED_LIST [INTEGER]
            -- Token types of the selected tools.
            -- Indexed by tool numbers.
            -- (from LEX_BUILDER)

    tool_list: LINKED_LIST [PDFA]
            -- Regular expressions used as auxiliary tools
            -- (from LEX_BUILDER)

    tool_names: LINKED_LIST [STRING]
            -- Names of regular expressions in tool list
            -- (from LEX_BUILDER)

    Two: INTEGER is 50
            -- (from ASCII)

    Underlined: INTEGER is 95
            -- (from ASCII)

    Up_arrow: INTEGER is -2
            -- (from ASCII)

    Upper_a: INTEGER is 65
            -- (from ASCII)

    Upper_b: INTEGER is 66
            -- (from ASCII)

    Upper_c: INTEGER is 67
            -- (from ASCII)

    Upper_d: INTEGER is 68
            -- (from ASCII)

    Upper_e: INTEGER is 69
            -- (from ASCII)

    Upper_f: INTEGER is 70
            -- (from ASCII)

    Upper_g: INTEGER is 71
            -- (from ASCII)

    Upper_h: INTEGER is 72
            -- (from ASCII)

    Upper_i: INTEGER is 73
            -- (from ASCII)

    Upper_j: INTEGER is 74
            -- (from ASCII)

    Upper_k: INTEGER is 75
            -- (from ASCII)

    Upper_l: INTEGER is 76
            -- (from ASCII)

    Upper_m: INTEGER is 77
            -- (from ASCII)

    Upper_n: INTEGER is 78
            -- (from ASCII)

    Upper_o: INTEGER is 79
            -- (from ASCII)

    Upper_p: INTEGER is 80
            -- (from ASCII)

    Upper_q: INTEGER is 81
            -- (from ASCII)

    Upper_r: INTEGER is 82
            -- (from ASCII)

    Upper_s: INTEGER is 83
            -- (from ASCII)

    Upper_t: INTEGER is 84
            -- (from ASCII)

    Upper_u: INTEGER is 85
            -- (from ASCII)

    Upper_v: INTEGER is 86
            -- (from ASCII)

    Upper_w: INTEGER is 87
            -- (from ASCII)

    Upper_x: INTEGER is 88
            -- (from ASCII)

    Upper_y: INTEGER is 89
            -- (from ASCII)

    Upper_z: INTEGER is 90
            -- (from ASCII)

    Us: INTEGER is 31
            -- (from ASCII)

    Vt: INTEGER is 11
            -- (from ASCII)

    Zero: INTEGER is 48
            -- (from ASCII)

    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((pdfa_item (upper) = void or else pdfa_item (upper) = pdfa_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (pdfa_item (upper) = other.pdfa_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    distinguish_case
            -- Make letter case significant in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            case_sensitive

    ignore_case
            -- Make letter case not significant in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            not case_sensitive

    keywords_distinguish_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tool_built: tool_list.is_empty
        ensure -- from LEX_BUILDER
            keywords_case_sensitive

    keywords_ignore_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tools_built: tool_list = void or else tool_list.is_empty
        ensure -- from LEX_BUILDER
            not keywords_case_sensitive

    set_e_transition (source, target: INTEGER)
            -- Set epsilon transition from source to target.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states

    set_final (s, r: INTEGER)
            -- Make s the final state of regular expression r.
            -- (from PDFA)

    set_letters
            -- Direct the active transitions to include letters.
            -- (from PDFA)

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
            -- (from PDFA)
        require -- from  AUTOMATON
            True
        require else -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

feature -- Element change

    add_keyword (word: STRING)
            -- Insert word in the keyword list.
            -- (from PDFA)

    add_word (s: STRING; n: INTEGER)
            -- Record the word s and
            -- associate it with token type n.
        require
            s_not_void: s /= void
            s_not_empty: s.capacity >= 1

    any_character
            -- Create regular expression $. matching all characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    any_printable
            -- Create regular expression $P matching all
            -- printable characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    append (p, s: INTEGER)
            -- Create regular expression ps:
            -- s appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    append_optional (p, s: INTEGER)
            -- Create regular expression p[s]:
            -- s optionally appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    associate (t, n: INTEGER)
            -- Associate the t-th tool with token type n.
            -- If this routine is not used, the default value is t.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            t_selected: selected_tools.has (t)
            n_not_zero: n /= 0
            n_not_minus_one: n /= - 1

    build_dollar_any
            -- Build $., matching any character.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            good_first_character: description.item (cursor) = '.'

    build_dollar_b
            -- Build $B, matching any number of break characters:
            -- blank, new-line, tabulation, carriage-return.
            -- (from HIGH_BUILDER)

    build_dollar_n
            -- Build $N, matching natural integer constants.
            -- +('0'..'9')
            -- (from HIGH_BUILDER)

    build_dollar_p
            -- Build $P, matching any printable character.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            good_first_character: description.item (cursor) = 'P'

    build_dollar_r
            -- Build $R, matching floating point constants.
            -- ['+' | '-'] +('0'..'9') '.' *('0'..'9') ['e' | 'E' ['+' | '-']
            -- +('0'..'9')]
            -- (from HIGH_BUILDER)

    build_dollar_z
            -- Build $Z, matching possibly signed integer constants.
            -- ['+' | '-'] +('0'..'9')
            -- (from HIGH_BUILDER)

    case_insensitive (c: INTEGER)
            -- Create regular expression ~(c):
            -- like c, but case-insensitive.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            z_possible: last_character_code >= lower_z
            c_in_tool: c >= 1 and c <= last_created_tool

    difference (r: INTEGER; c: CHARACTER)
            -- Create regular expression representing
            -- the difference r - c.
            -- r must be a simple category, such as a..z,
            -- or a union of simple categories,
            -- such as a..z | 0..9.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            r_exists: r >= 1 and r <= last_created_tool
            r_simple_category: tool_list.i_th (r).nb_states = 2

    enter (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like pdfa_item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: pdfa_item (i) = v
            higher_count: count >= old count

    include (fa: PDFA; shift: INTEGER)
            -- Copy fa with state numbers shifted
            -- by shift positions in the transitions.
            -- Do not preserve the final values.
            -- (from PDFA)
        require -- from PDFA
            same_inputs: greatest_input = fa.greatest_input
            nb_states_large_enough: nb_states >= fa.nb_states + shift

    interval (b, e: CHARACTER)
            -- Create regular expression b..e, or b if b = e.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_built: not lexical_frozen
            e_code_small_enough: e.code <= last_character_code
            b_code_large_enough: b.code >= 0
            b_before_e: b.code <= e.code

    iteration (c: INTEGER)
            -- Create regular expression *(c): zero or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration1 (c: INTEGER)
            -- Create regular expression +(c): one or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration_n (n, c: INTEGER)
            -- Create regular expression n(c):
            -- exactly n consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            n_large_enough: n > 0
            c_in_tool: c >= 1 and c <= last_created_tool

    optional (c: INTEGER)
            -- Create regular expression [c]:
            -- optional c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    prepend_optional (p, s: INTEGER)
            -- Create regular expression [p]s:
            -- s appended to optional p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    pdfa_put (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: pdfa_item (k) = v

    put_expression (s: STRING; n: INTEGER; c: STRING)
            -- Record the regular expression described by s
            -- and associate it with token type n and name c.
        require
            source_long_enough: s.capacity > 0

    put_keyword (s: STRING; exp: INTEGER)
            -- Declare s as a keyword described by
            -- the regular expression of code exp.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            exp_selected: token_type_list /= void and then token_type_list.has (exp)

    put_nameless_expression (s: STRING; n: INTEGER)
            -- Record the regular expression described
            -- by s, and associate it with token type n.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            source_long_enough: s.count > 0

    recognize (s: STRING): INTEGER
            -- Token_type of s; 0 if not recognized
            -- (from LEX_BUILDER)

    remove_case_sensitiveness
            -- Remove case sensitiveness.
            -- (from PDFA)
        require -- from PDFA
            z_possible: greatest_input >= lower_z

    select_tool (i: INTEGER)
            -- Select the i_th tool for inclusion in the main
            -- regular expression.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            i_exist: i > 0 and i <= last_created_tool
        ensure -- from LEX_BUILDER
            i_selected: selected_tools.has (i)

    set_word (word: STRING)
            -- Create regular expression for word:
            -- synonym for concatenation (w o r d).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count >= 1

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

    union (a, b: INTEGER)
            -- Create regular expression for the multiple union
            -- a | a+1 | .. | b: matches any occurrence of
            -- a, or a+1, .., or b.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_not_too_small: a >= 1
            b_not_too_large: b <= last_created_tool
            a_smaller_than_b: a <= b

    union2 (a, b: INTEGER)
            -- Create regular expression a | b: union of
            -- a and b (matches an occurrence of a or b)).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_in_tool: a >= 1 and a <= last_created_tool
            b_in_tool: b >= 1 and b <= last_created_tool

    up_to (word: STRING)
            -- Create regular expression ->"word", which is a
            -- set of any number of any characters ended by "word".
            -- Example: "/* C comment */" matches (->"*/").
            -- The difference between (+$. '*' '/') and
            -- (->"*/") is that "*/..*/..*/" matches
            -- the first but not the second.
            -- The difference between
            -- ((($.-'*') | ('*'($.-'/'))) +('*' '/') )
            -- and "(->"*/")" is that "..**/" matches
            -- the second but not the first.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count > 0
            not_frozen: not lexical_frozen

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    delete_transition (source, input_doc, target: INTEGER)
            -- Delete transition from source to target on input_doc.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: LINKED_LIST [INTEGER])
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove the last regular expression
            -- from the tool list.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            at_least_one_regular: last_created_tool >= 1

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Transformation

    construct_dfa
            -- Create an equivalent deterministic finite automaton.
            -- (from NDFA)
        require -- from NDFA
            start_number_designated: start_number > 0

feature -- Conversion

    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Implementation

    description: STRING
            -- Description of the regular expression
            -- (from HIGH_BUILDER)

    initialized: BOOLEAN
            -- Is analyzer initialized?
            -- (from LEX_BUILDER)

feature -- Input

    No_token: INTEGER is 0

    read_grammar (token_file_name: STRING)
            -- Create lexical analyzer for grammar in file of name
            -- token_file_name. File structure:
            -- One or more lines of the form
            -- name  regular_expression
            -- then a line beginning with two dashes --
            -- then zero or more lines containing one keyword each.
        ensure
            analyzer_exists: analyzer /= void

feature  -- Input

    retrieve_analyzer (file_name: STRING)
            -- Retrieve analyzer from file named file_name.
            -- (from LEX_BUILDER)

feature  -- Output

    store_analyzer (file_name: STRING)
            -- Store analyzer in file named file_name.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            initialized: initialized

feature -- Output

    trace
            -- Output an internal representation
            -- of the current automaton.
            -- (from PDFA)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from HIGH_BUILDER
    cursor_not_too_far: cursor <= description_length
        -- from LEX_BUILDER
    last_created: tool_list = void or else last_created_tool = tool_list.count
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class METALEX


NDFA Chart

deferred class
    NDFA

General
    cluster: lex.lex
    description: "Non-deterministic finite state automata"

Ancestors
    AUTOMATON

Queries
    dfa: FIXED_DFA
    find_e_successors (source: INTEGER): LINKED_LIST [INTEGER]
    find_successors (source, input_doc: INTEGER): LINKED_LIST [INTEGER]
    greatest_input: INTEGER
    nb_states: INTEGER
    start_number: INTEGER

Commands
    construct_dfa
    delete_transition (source, input_doc, target: INTEGER)
    set_e_transition (source, target: INTEGER)
    set_final (state, f: INTEGER)
    set_start (n: INTEGER)
    set_state
    set_transition (source, input_doc, target: INTEGER)


NDFA Flat contracts

indexing
    description: "Non-deterministic finite state automata"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    NDFA

feature -- Access

    dfa: FIXED_DFA
            -- DFA built by routine construct_dfa,
            -- which recognizes the same language.

    find_e_successors (source: INTEGER): LINKED_LIST [INTEGER]
            -- Epsilon successors of source.
            -- Void if no successor.
        require
            source_in_automaton: source >= 1 and source <= nb_states

    find_successors (source, input_doc: INTEGER): LINKED_LIST [INTEGER]
            -- Successors of source on input_doc;
            -- Void if no successor
        require
            source_in_automaton: source >= 1 and source <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

feature -- Measurement

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

feature -- Status setting

    set_final (state, f: INTEGER)
            -- Make state final for regular expression f.
            -- (from AUTOMATON)

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_state
            -- Make a new state.
            -- (from AUTOMATON)

feature -- Element change

    set_e_transition (source, target: INTEGER)
            -- Set epsilon transition from source to target.
        require
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target for input_doc.
        require -- from  AUTOMATON
            True
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input

feature -- Removal

    delete_transition (source, input_doc, target: INTEGER)
            -- Delete transition from source to target on input_doc.
        require
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input

feature -- Transformation

    construct_dfa
            -- Create an equivalent deterministic finite automaton.
        require
            start_number_designated: start_number > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class NDFA


PDFA Chart

class
    PDFA

General
    cluster: lex.lex
    description: "Partially deterministic finite state automata"
    create: make

Ancestors
    ARRAY [G]
    ASCII
    NDFA

Queries
    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
    Ack: INTEGER
    additional_space: INTEGER
    all_default: BOOLEAN
    Ampersand: INTEGER
    area: SPECIAL [LINKED_LIST [INTEGER]]
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    capacity: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    changeable_comparison_criterion: BOOLEAN
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    count: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    dfa: FIXED_DFA
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    entry (i: INTEGER): LINKED_LIST [INTEGER]
    Eot: INTEGER
    Equal_sign: INTEGER
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    extendible: BOOLEAN
    final_array: ARRAY [INTEGER]
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    full: BOOLEAN
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    greatest_input: INTEGER
    Growth_percentage: INTEGER
    Gs: INTEGER
    has (v: LINKED_LIST [INTEGER]): BOOLEAN
    has_letters: BOOLEAN
    Home_arrow: INTEGER
    Ht: INTEGER
    index_set: INTEGER_INTERVAL
    input_array: ARRAY [FIXED_INTEGER_SET]
    is_empty: BOOLEAN
    is_equal (other: [like Current] PDFA): BOOLEAN
    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
    item (i: INTEGER): LINKED_LIST [INTEGER]
    keywords_list: LINKED_LIST [STRING]
    Last_ascii: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    Line_feed: INTEGER
    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
    lower: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minimal_increase: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    nb_states: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    Percent: INTEGER
    Plus: INTEGER
    prunable: BOOLEAN
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    resizable: BOOLEAN
    Right_arrow: INTEGER
    Rs: INTEGER
    same_items (other: [like Current] PDFA): BOOLEAN
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    start_number: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] PDFA
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    upper: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    Vt: INTEGER
    Zero: INTEGER

Commands
    add_keyword (word: STRING)
    array_make (min_index, max_index: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    construct_dfa
    copy (other: [like Current] PDFA)
    delete_transition (source, input_doc, target: INTEGER)
    discard_items
    enter (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
    force (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    grow (i: INTEGER)
    include (fa: PDFA; shift: INTEGER)
    make (n, i: INTEGER)
    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
    prune_all (v: LINKED_LIST [INTEGER])
    put (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    remove_case_sensitiveness
    resize (min_index, max_index: INTEGER)
    set_e_transition (source, target: INTEGER)
    set_final (s, r: INTEGER)
    set_letters
    set_start (n: INTEGER)
    set_transition (source, input_doc, target: INTEGER)
    subcopy (other: [like Current] PDFA; start_pos, end_pos, index_pos: INTEGER)
    trace


PDFA Flat contracts

indexing
    description: "Partially deterministic finite state automata"
    comment: "See comment at end of class"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

class interface
    PDFA

create

    make (n, i: INTEGER)
            -- Make a PDFA with n states, and i + 1 inputs.

feature -- Initialization

    make (n, i: INTEGER)
            -- Make a PDFA with n states, and i + 1 inputs.

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    Ack: INTEGER is 6
            -- (from ASCII)

    Ampersand: INTEGER is 38
            -- (from ASCII)

    area: SPECIAL [LINKED_LIST [INTEGER]]
            -- Special data zone
            -- (from TO_SPECIAL)

    Back_space: INTEGER is 8
            -- (from ASCII)

    Backslash: INTEGER is 92
            -- (from ASCII)

    Bar: INTEGER is 124
            -- (from ASCII)

    Bel: INTEGER is 7
            -- (from ASCII)

    Blank: INTEGER is 32
            -- (from ASCII)

    Break: INTEGER is -7
            -- (from ASCII)

    Bs: INTEGER is 8
            -- (from ASCII)

    Buf_overflow: INTEGER is -9
            -- (from ASCII)

    Can: INTEGER is 24
            -- (from ASCII)

    Carriage_return: INTEGER is 13
            -- (from ASCII)

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a
            -- (from ASCII)

    Character_set_size: INTEGER is 128
            -- (from ASCII)

    Circumflex: INTEGER is 94
            -- (from ASCII)

    Closing_brace: INTEGER is 125
            -- (from ASCII)

    Colon: INTEGER is 58
            -- (from ASCII)

    Comma: INTEGER is 44
            -- (from ASCII)

    Commercial_at: INTEGER is 64
            -- (from ASCII)

    Cr: INTEGER is 13
            -- (from ASCII)

    Ctrl_a: INTEGER is 1
            -- (from ASCII)

    Ctrl_b: INTEGER is 2
            -- (from ASCII)

    Ctrl_backslash: INTEGER is 28
            -- (from ASCII)

    Ctrl_c: INTEGER is 3
            -- (from ASCII)

    Ctrl_circumflex: INTEGER is 30
            -- (from ASCII)

    Ctrl_d: INTEGER is 4
            -- (from ASCII)

    Ctrl_e: INTEGER is 5
            -- (from ASCII)

    Ctrl_f: INTEGER is 6
            -- (from ASCII)

    Ctrl_g: INTEGER is 7
            -- (from ASCII)

    Ctrl_h: INTEGER is 8
            -- (from ASCII)

    Ctrl_i: INTEGER is 9
            -- (from ASCII)

    Ctrl_j: INTEGER is 10
            -- (from ASCII)

    Ctrl_k: INTEGER is 11
            -- (from ASCII)

    Ctrl_l: INTEGER is 12
            -- (from ASCII)

    Ctrl_lbracket: INTEGER is 27
            -- (from ASCII)

    Ctrl_m: INTEGER is 13
            -- (from ASCII)

    Ctrl_n: INTEGER is 14
            -- (from ASCII)

    Ctrl_o: INTEGER is 15
            -- (from ASCII)

    Ctrl_p: INTEGER is 16
            -- (from ASCII)

    Ctrl_q: INTEGER is 17
            -- (from ASCII)

    Ctrl_questmark: INTEGER is 127
            -- (from ASCII)

    Ctrl_r: INTEGER is 18
            -- (from ASCII)

    Ctrl_rbracket: INTEGER is 29
            -- (from ASCII)

    Ctrl_s: INTEGER is 19
            -- (from ASCII)

    Ctrl_t: INTEGER is 20
            -- (from ASCII)

    Ctrl_u: INTEGER is 21
            -- (from ASCII)

    Ctrl_underlined: INTEGER is 31
            -- (from ASCII)

    Ctrl_v: INTEGER is 22
            -- (from ASCII)

    Ctrl_w: INTEGER is 23
            -- (from ASCII)

    Ctrl_x: INTEGER is 24
            -- (from ASCII)

    Ctrl_y: INTEGER is 25
            -- (from ASCII)

    Ctrl_z: INTEGER is 26
            -- (from ASCII)

    Dc1: INTEGER is 17
            -- (from ASCII)

    Dc2: INTEGER is 18
            -- (from ASCII)

    Dc3: INTEGER is 19
            -- (from ASCII)

    Dc4: INTEGER is 20
            -- (from ASCII)

    Del: INTEGER is 127
            -- (from ASCII)

    dfa: FIXED_DFA
            -- DFA built by routine construct_dfa,
            -- which recognizes the same language.
            -- (from NDFA)

    Dle: INTEGER is 16
            -- (from ASCII)

    Dollar: INTEGER is 36
            -- (from ASCII)

    Dot: INTEGER is 46
            -- (from ASCII)

    Doublequote: INTEGER is 34
            -- (from ASCII)

    Down_arrow: INTEGER is -3
            -- (from ASCII)

    Eight: INTEGER is 56
            -- (from ASCII)

    Em: INTEGER is 25
            -- (from ASCII)

    Enq: INTEGER is 5
            -- (from ASCII)

    entry (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    Eot: INTEGER is 4
            -- (from ASCII)

    Equal_sign: INTEGER is 61
            -- (from ASCII)

    Esc: INTEGER is 27
            -- (from ASCII)

    Etb: INTEGER is 23
            -- (from ASCII)

    Etx: INTEGER is 3
            -- (from ASCII)

    Exclamation: INTEGER is 33
            -- (from ASCII)

    final_array: ARRAY [INTEGER]
            -- The final value for each state
            -- (regular expression, if any, for which it is final).

    First_printable: INTEGER is 32
            -- (from ASCII)

    Five: INTEGER is 53
            -- (from ASCII)

    Four: INTEGER is 52
            -- (from ASCII)

    Fs: INTEGER is 28
            -- (from ASCII)

    Grave_accent: INTEGER is 96
            -- (from ASCII)

    Greaterthan: INTEGER is 62
            -- (from ASCII)

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    Gs: INTEGER is 29
            -- (from ASCII)

    has (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_letters: BOOLEAN
            -- Are there any letters among the active transitions?

    Home_arrow: INTEGER is -6
            -- (from ASCII)

    Ht: INTEGER is 9
            -- (from ASCII)

    input_array: ARRAY [FIXED_INTEGER_SET]
            -- For each input, set of the states which have
            -- a transition on this input to the following state

    item (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    keywords_list: LINKED_LIST [STRING]
            -- Keywords associated with current automaton.

    Last_ascii: INTEGER is 127
            -- (from ASCII)

    Last_printable: INTEGER is 126
            -- (from ASCII)

    Lbracket: INTEGER is 91
            -- (from ASCII)

    Lcurly: INTEGER is 40
            -- (from ASCII)

    Left_arrow: INTEGER is -4
            -- (from ASCII)

    Lessthan: INTEGER is 60
            -- (from ASCII)

    Letter_layout: INTEGER is 70
            -- (from ASCII)

    Line_feed: INTEGER is 10
            -- (from ASCII)

    Lower_a: INTEGER is 97
            -- (from ASCII)

    Lower_b: INTEGER is 98
            -- (from ASCII)

    Lower_c: INTEGER is 99
            -- (from ASCII)

    Lower_d: INTEGER is 100
            -- (from ASCII)

    Lower_e: INTEGER is 101
            -- (from ASCII)

    Lower_f: INTEGER is 102
            -- (from ASCII)

    Lower_g: INTEGER is 103
            -- (from ASCII)

    Lower_h: INTEGER is 104
            -- (from ASCII)

    Lower_i: INTEGER is 105
            -- (from ASCII)

    Lower_j: INTEGER is 106
            -- (from ASCII)

    Lower_k: INTEGER is 107
            -- (from ASCII)

    Lower_l: INTEGER is 108
            -- (from ASCII)

    Lower_m: INTEGER is 109
            -- (from ASCII)

    Lower_n: INTEGER is 110
            -- (from ASCII)

    Lower_o: INTEGER is 111
            -- (from ASCII)

    Lower_p: INTEGER is 112
            -- (from ASCII)

    Lower_q: INTEGER is 113
            -- (from ASCII)

    Lower_r: INTEGER is 114
            -- (from ASCII)

    Lower_s: INTEGER is 115
            -- (from ASCII)

    Lower_t: INTEGER is 116
            -- (from ASCII)

    Lower_u: INTEGER is 117
            -- (from ASCII)

    Lower_v: INTEGER is 118
            -- (from ASCII)

    Lower_w: INTEGER is 119
            -- (from ASCII)

    Lower_x: INTEGER is 120
            -- (from ASCII)

    Lower_y: INTEGER is 121
            -- (from ASCII)

    Lower_z: INTEGER is 122
            -- (from ASCII)

    Minus: INTEGER is 45
            -- (from ASCII)

    Nak: INTEGER is 21
            -- (from ASCII)

    Nine: INTEGER is 57
            -- (from ASCII)

    Nl: INTEGER is 10
            -- (from ASCII)

    Np: INTEGER is 12
            -- (from ASCII)

    Nul: INTEGER is 0
            -- (from ASCII)

    Number_sign: INTEGER is 35
            -- (from ASCII)

    One: INTEGER is 49
            -- (from ASCII)

    Opening_brace: INTEGER is 123
            -- (from ASCII)

    Overflow: INTEGER is -8
            -- (from ASCII)

    Percent: INTEGER is 37
            -- (from ASCII)

    Plus: INTEGER is 43
            -- (from ASCII)

    Questmark: INTEGER is 63
            -- (from ASCII)

    Rbracket: INTEGER is 93
            -- (from ASCII)

    Rcurly: INTEGER is 41
            -- (from ASCII)

    Right_arrow: INTEGER is -5
            -- (from ASCII)

    Rs: INTEGER is 30
            -- (from ASCII)

    Semicolon: INTEGER is 59
            -- (from ASCII)

    Seven: INTEGER is 55
            -- (from ASCII)

    Si: INTEGER is 15
            -- (from ASCII)

    Singlequote: INTEGER is 39
            -- (from ASCII)

    Six: INTEGER is 54
            -- (from ASCII)

    Slash: INTEGER is 47
            -- (from ASCII)

    So: INTEGER is 14
            -- (from ASCII)

    Soh: INTEGER is 1
            -- (from ASCII)

    Sp: INTEGER is 32
            -- (from ASCII)

    Star: INTEGER is 42
            -- (from ASCII)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    Stx: INTEGER is 2
            -- (from ASCII)

    Sub: INTEGER is 26
            -- (from ASCII)

    Syn: INTEGER is 22
            -- (from ASCII)

    Tabulation: INTEGER is 9
            -- (from ASCII)

    Three: INTEGER is 51
            -- (from ASCII)

    Tilde: INTEGER is 126
            -- (from ASCII)

    Two: INTEGER is 50
            -- (from ASCII)

    Underlined: INTEGER is 95
            -- (from ASCII)

    Up_arrow: INTEGER is -2
            -- (from ASCII)

    Upper_a: INTEGER is 65
            -- (from ASCII)

    Upper_b: INTEGER is 66
            -- (from ASCII)

    Upper_c: INTEGER is 67
            -- (from ASCII)

    Upper_d: INTEGER is 68
            -- (from ASCII)

    Upper_e: INTEGER is 69
            -- (from ASCII)

    Upper_f: INTEGER is 70
            -- (from ASCII)

    Upper_g: INTEGER is 71
            -- (from ASCII)

    Upper_h: INTEGER is 72
            -- (from ASCII)

    Upper_i: INTEGER is 73
            -- (from ASCII)

    Upper_j: INTEGER is 74
            -- (from ASCII)

    Upper_k: INTEGER is 75
            -- (from ASCII)

    Upper_l: INTEGER is 76
            -- (from ASCII)

    Upper_m: INTEGER is 77
            -- (from ASCII)

    Upper_n: INTEGER is 78
            -- (from ASCII)

    Upper_o: INTEGER is 79
            -- (from ASCII)

    Upper_p: INTEGER is 80
            -- (from ASCII)

    Upper_q: INTEGER is 81
            -- (from ASCII)

    Upper_r: INTEGER is 82
            -- (from ASCII)

    Upper_s: INTEGER is 83
            -- (from ASCII)

    Upper_t: INTEGER is 84
            -- (from ASCII)

    Upper_u: INTEGER is 85
            -- (from ASCII)

    Upper_v: INTEGER is 86
            -- (from ASCII)

    Upper_w: INTEGER is 87
            -- (from ASCII)

    Upper_x: INTEGER is 88
            -- (from ASCII)

    Upper_y: INTEGER is 89
            -- (from ASCII)

    Upper_z: INTEGER is 90
            -- (from ASCII)

    Us: INTEGER is 31
            -- (from ASCII)

    Vt: INTEGER is 11
            -- (from ASCII)

    Zero: INTEGER is 48
            -- (from ASCII)

    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_e_transition (source, target: INTEGER)
            -- Set epsilon transition from source to target.
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states

    set_final (s, r: INTEGER)
            -- Make s the final state of regular expression r.

    set_letters
            -- Direct the active transitions to include letters.

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
        require -- from  AUTOMATON
            True
        require else -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

feature -- Element change

    add_keyword (word: STRING)
            -- Insert word in the keyword list.

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count

    include (fa: PDFA; shift: INTEGER)
            -- Copy fa with state numbers shifted
            -- by shift positions in the transitions.
            -- Do not preserve the final values.
        require
            same_inputs: greatest_input = fa.greatest_input
            nb_states_large_enough: nb_states >= fa.nb_states + shift

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    remove_case_sensitiveness
            -- Remove case sensitiveness.
        require
            z_possible: greatest_input >= lower_z

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    delete_transition (source, input_doc, target: INTEGER)
            -- Delete transition from source to target on input_doc.
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: LINKED_LIST [INTEGER])
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Transformation

    construct_dfa
            -- Create an equivalent deterministic finite automaton.
            -- (from NDFA)
        require -- from NDFA
            start_number_designated: start_number > 0

feature -- Conversion

    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Output

    trace
            -- Output an internal representation
            -- of the current automaton.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class PDFA


SCANNING Chart

class
    SCANNING

General
    cluster: lex.lex
    description: "Mechanisms for building and using lexical analyzers. This class may be used as ancestor by classes needing its facilities."
    create: make_extended, make

Ancestors
    METALEX

Queries
    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
    Ack: INTEGER
    additional_space: INTEGER
    all_default: BOOLEAN
    Ampersand: INTEGER
    analyzer: LEXICAL
    area: SPECIAL [LINKED_LIST [INTEGER]]
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    capacity: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    case_sensitive: BOOLEAN
    categories_table: ARRAY [INTEGER]
    changeable_comparison_criterion: BOOLEAN
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    count: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    description: STRING
    dfa: FIXED_DFA
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    entry (i: INTEGER): LINKED_LIST [INTEGER]
    Eot: INTEGER
    Equal_sign: INTEGER
    Error_list: ERROR_LIST
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    extendible: BOOLEAN
    final_array: ARRAY [INTEGER]
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    full: BOOLEAN
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    greatest_input: INTEGER
    Growth_percentage: INTEGER
    Gs: INTEGER
    has (v: LINKED_LIST [INTEGER]): BOOLEAN
    has_letters: BOOLEAN
    Home_arrow: INTEGER
    Ht: INTEGER
    index_set: INTEGER_INTERVAL
    initialized: BOOLEAN
    input_array: ARRAY [FIXED_INTEGER_SET]
    is_empty: BOOLEAN
    is_equal (other: [like Current] SCANNING): BOOLEAN
    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
    keyword_h_table: HASH_TABLE [INTEGER, STRING]
    keywords_case_sensitive: BOOLEAN
    keywords_list: LINKED_LIST [STRING]
    Last_ascii: INTEGER
    last_character_code: INTEGER
    last_created_tool: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    lexical_frozen: BOOLEAN
    Line_feed: INTEGER
    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
    lower: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minimal_increase: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    nb_states: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    No_token: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
    Percent: INTEGER
    Plus: INTEGER
    prunable: BOOLEAN
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    recognize (s: STRING): INTEGER
    resizable: BOOLEAN
    Right_arrow: INTEGER
    Rs: INTEGER
    same_items (other: [like Current] SCANNING): BOOLEAN
    selected_tools: LINKED_LIST [INTEGER]
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    start_number: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] SCANNING
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    token_type_list: LINKED_LIST [INTEGER]
    tool_list: LINKED_LIST [PDFA]
    tool_names: LINKED_LIST [STRING]
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    upper: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    Vt: INTEGER
    Zero: INTEGER

Commands
    add_keyword (word: STRING)
    add_word (s: STRING; n: INTEGER)
    analyze (input_file_name: STRING)
    any_character
    any_printable
    append (p, s: INTEGER)
    append_optional (p, s: INTEGER)
    array_make (min_index, max_index: INTEGER)
    associate (t, n: INTEGER)
    automatic_grow
    begin_analysis
    build (store_file_name, grammar_file_name: STRING)
    build_dollar_any
    build_dollar_b
    build_dollar_n
    build_dollar_p
    build_dollar_r
    build_dollar_z
    case_insensitive (c: INTEGER)
    clear_all
    compare_objects
    compare_references
    construct_dfa
    copy (other: [like Current] SCANNING)
    delete_transition (source, input_doc, target: INTEGER)
    difference (r: INTEGER; c: CHARACTER)
    discard_items
    distinguish_case
    do_a_token (read_token: TOKEN)
    end_analysis
    enter (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
    force (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    grow (i: INTEGER)
    ignore_case
    include (fa: PDFA; shift: INTEGER)
    initialize
    interval (b, e: CHARACTER)
    iteration (c: INTEGER)
    iteration1 (c: INTEGER)
    iteration_n (n, c: INTEGER)
    keywords_distinguish_case
    keywords_ignore_case
    make
    make_analyzer
    make_extended (char_code: INTEGER)
    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
    optional (c: INTEGER)
    pdfa_make (n, i: INTEGER)
    pdfa_put (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    prepend_optional (p, s: INTEGER)
    prune_all (v: LINKED_LIST [INTEGER])
    put_expression (s: STRING; n: INTEGER; c: STRING)
    put_keyword (s: STRING; exp: INTEGER)
    put_nameless_expression (s: STRING; n: INTEGER)
    read_grammar (token_file_name: STRING)
    remove
    remove_case_sensitiveness
    resize (min_index, max_index: INTEGER)
    retrieve_analyzer (file_name: STRING)
    select_tool (i: INTEGER)
    set_e_transition (source, target: INTEGER)
    set_final (s, r: INTEGER)
    set_letters
    set_start (n: INTEGER)
    set_transition (source, input_doc, target: INTEGER)
    set_word (word: STRING)
    store_analyzer (file_name: STRING)
    subcopy (other: [like Current] SCANNING; start_pos, end_pos, index_pos: INTEGER)
    trace
    union (a, b: INTEGER)
    union2 (a, b: INTEGER)
    up_to (word: STRING)


SCANNING Flat contracts

indexing
    description: "Mechanisms for building and using lexical analyzers. This class may be used as ancestor by classes needing its facilities."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

class interface
    SCANNING

create

    make
            -- Set up the analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = last_ascii

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            valid_char_code: char_code > 0
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = char_code

feature -- Initialization

    build (store_file_name, grammar_file_name: STRING)
            -- Create a lexical analyzer.
            -- If store_file_name is the name of an existing file,
            -- use  analyzer stored in that file.
            -- Otherwise read grammar from grammar_file_name,
            -- create an analyzer, and store it in store_file_name.
        require
            store_file_name /= void
        ensure
            analyzer_exists: analyzer /= void

    initialize
            -- Set up attributes of analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            initialized

    make
            -- Set up the analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = last_ascii

    pdfa_make (n, i: INTEGER)
            -- Make a PDFA with n states, and i + 1 inputs.
            -- (from PDFA)

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_analyzer
            -- Create analyzer (if Void) and initialize it.
            -- (from METALEX)
        require -- from METALEX
            not_initialized: not initialized
        ensure -- from METALEX
            initialized
            analyzer_created: analyzer /= void
            lexical_frozen

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            valid_char_code: char_code > 0
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = char_code

    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    Ack: INTEGER is 6
            -- (from ASCII)

    Ampersand: INTEGER is 38
            -- (from ASCII)

    analyzer: LEXICAL
            -- The lexical analyzer built so far
            -- (from LEX_BUILDER)

    area: SPECIAL [LINKED_LIST [INTEGER]]
            -- Special data zone
            -- (from TO_SPECIAL)

    Back_space: INTEGER is 8
            -- (from ASCII)

    Backslash: INTEGER is 92
            -- (from ASCII)

    Bar: INTEGER is 124
            -- (from ASCII)

    Bel: INTEGER is 7
            -- (from ASCII)

    Blank: INTEGER is 32
            -- (from ASCII)

    Break: INTEGER is -7
            -- (from ASCII)

    Bs: INTEGER is 8
            -- (from ASCII)

    Buf_overflow: INTEGER is -9
            -- (from ASCII)

    Can: INTEGER is 24
            -- (from ASCII)

    Carriage_return: INTEGER is 13
            -- (from ASCII)

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a
            -- (from ASCII)

    case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive?
            -- (from LEX_BUILDER)

    categories_table: ARRAY [INTEGER]
            -- Table of category numbers for each input
            -- (from LEX_BUILDER)

    Character_set_size: INTEGER is 128
            -- (from ASCII)

    Circumflex: INTEGER is 94
            -- (from ASCII)

    Closing_brace: INTEGER is 125
            -- (from ASCII)

    Colon: INTEGER is 58
            -- (from ASCII)

    Comma: INTEGER is 44
            -- (from ASCII)

    Commercial_at: INTEGER is 64
            -- (from ASCII)

    Cr: INTEGER is 13
            -- (from ASCII)

    Ctrl_a: INTEGER is 1
            -- (from ASCII)

    Ctrl_b: INTEGER is 2
            -- (from ASCII)

    Ctrl_backslash: INTEGER is 28
            -- (from ASCII)

    Ctrl_c: INTEGER is 3
            -- (from ASCII)

    Ctrl_circumflex: INTEGER is 30
            -- (from ASCII)

    Ctrl_d: INTEGER is 4
            -- (from ASCII)

    Ctrl_e: INTEGER is 5
            -- (from ASCII)

    Ctrl_f: INTEGER is 6
            -- (from ASCII)

    Ctrl_g: INTEGER is 7
            -- (from ASCII)

    Ctrl_h: INTEGER is 8
            -- (from ASCII)

    Ctrl_i: INTEGER is 9
            -- (from ASCII)

    Ctrl_j: INTEGER is 10
            -- (from ASCII)

    Ctrl_k: INTEGER is 11
            -- (from ASCII)

    Ctrl_l: INTEGER is 12
            -- (from ASCII)

    Ctrl_lbracket: INTEGER is 27
            -- (from ASCII)

    Ctrl_m: INTEGER is 13
            -- (from ASCII)

    Ctrl_n: INTEGER is 14
            -- (from ASCII)

    Ctrl_o: INTEGER is 15
            -- (from ASCII)

    Ctrl_p: INTEGER is 16
            -- (from ASCII)

    Ctrl_q: INTEGER is 17
            -- (from ASCII)

    Ctrl_questmark: INTEGER is 127
            -- (from ASCII)

    Ctrl_r: INTEGER is 18
            -- (from ASCII)

    Ctrl_rbracket: INTEGER is 29
            -- (from ASCII)

    Ctrl_s: INTEGER is 19
            -- (from ASCII)

    Ctrl_t: INTEGER is 20
            -- (from ASCII)

    Ctrl_u: INTEGER is 21
            -- (from ASCII)

    Ctrl_underlined: INTEGER is 31
            -- (from ASCII)

    Ctrl_v: INTEGER is 22
            -- (from ASCII)

    Ctrl_w: INTEGER is 23
            -- (from ASCII)

    Ctrl_x: INTEGER is 24
            -- (from ASCII)

    Ctrl_y: INTEGER is 25
            -- (from ASCII)

    Ctrl_z: INTEGER is 26
            -- (from ASCII)

    Dc1: INTEGER is 17
            -- (from ASCII)

    Dc2: INTEGER is 18
            -- (from ASCII)

    Dc3: INTEGER is 19
            -- (from ASCII)

    Dc4: INTEGER is 20
            -- (from ASCII)

    Del: INTEGER is 127
            -- (from ASCII)

    dfa: FIXED_DFA
            -- DFA built by routine construct_dfa,
            -- which recognizes the same language.
            -- (from NDFA)

    Dle: INTEGER is 16
            -- (from ASCII)

    Dollar: INTEGER is 36
            -- (from ASCII)

    Dot: INTEGER is 46
            -- (from ASCII)

    Doublequote: INTEGER is 34
            -- (from ASCII)

    Down_arrow: INTEGER is -3
            -- (from ASCII)

    Eight: INTEGER is 56
            -- (from ASCII)

    Em: INTEGER is 25
            -- (from ASCII)

    Enq: INTEGER is 5
            -- (from ASCII)

    entry (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    Eot: INTEGER is 4
            -- (from ASCII)

    Equal_sign: INTEGER is 61
            -- (from ASCII)

    error_list: ERROR_LIST
            -- List of error messages
            -- (from LEX_BUILDER)

    Esc: INTEGER is 27
            -- (from ASCII)

    Etb: INTEGER is 23
            -- (from ASCII)

    Etx: INTEGER is 3
            -- (from ASCII)

    Exclamation: INTEGER is 33
            -- (from ASCII)

    final_array: ARRAY [INTEGER]
            -- The final value for each state
            -- (regular expression, if any, for which it is final).
            -- (from PDFA)

    First_printable: INTEGER is 32
            -- (from ASCII)

    Five: INTEGER is 53
            -- (from ASCII)

    Four: INTEGER is 52
            -- (from ASCII)

    Fs: INTEGER is 28
            -- (from ASCII)

    Grave_accent: INTEGER is 96
            -- (from ASCII)

    Greaterthan: INTEGER is 62
            -- (from ASCII)

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    Gs: INTEGER is 29
            -- (from ASCII)

    has (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_letters: BOOLEAN
            -- Are there any letters among the active transitions?
            -- (from PDFA)

    Home_arrow: INTEGER is -6
            -- (from ASCII)

    Ht: INTEGER is 9
            -- (from ASCII)

    input_array: ARRAY [FIXED_INTEGER_SET]
            -- For each input, set of the states which have
            -- a transition on this input to the following state
            -- (from PDFA)

    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    keyword_h_table: HASH_TABLE [INTEGER, STRING]
            -- Keyword table
            -- (from LEX_BUILDER)

    keywords_case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive for keywords?
            -- (from LEX_BUILDER)

    keywords_list: LINKED_LIST [STRING]
            -- Keywords associated with current automaton.
            -- (from PDFA)

    Last_ascii: INTEGER is 127
            -- (from ASCII)

    last_character_code: INTEGER
            -- Last character code recognized by the language
            -- (from LEX_BUILDER)

    last_created_tool: INTEGER
            -- Identification number of the last
            -- regular expression put in tool_list
            -- (from LEX_BUILDER)

    Last_printable: INTEGER is 126
            -- (from ASCII)

    Lbracket: INTEGER is 91
            -- (from ASCII)

    Lcurly: INTEGER is 40
            -- (from ASCII)

    Left_arrow: INTEGER is -4
            -- (from ASCII)

    Lessthan: INTEGER is 60
            -- (from ASCII)

    Letter_layout: INTEGER is 70
            -- (from ASCII)

    lexical_frozen: BOOLEAN
            -- Has the lexical grammar been finalized?
            -- | (in other words: has the DFA been built?)
            -- (from LEX_BUILDER)

    Line_feed: INTEGER is 10
            -- (from ASCII)

    Lower_a: INTEGER is 97
            -- (from ASCII)

    Lower_b: INTEGER is 98
            -- (from ASCII)

    Lower_c: INTEGER is 99
            -- (from ASCII)

    Lower_d: INTEGER is 100
            -- (from ASCII)

    Lower_e: INTEGER is 101
            -- (from ASCII)

    Lower_f: INTEGER is 102
            -- (from ASCII)

    Lower_g: INTEGER is 103
            -- (from ASCII)

    Lower_h: INTEGER is 104
            -- (from ASCII)

    Lower_i: INTEGER is 105
            -- (from ASCII)

    Lower_j: INTEGER is 106
            -- (from ASCII)

    Lower_k: INTEGER is 107
            -- (from ASCII)

    Lower_l: INTEGER is 108
            -- (from ASCII)

    Lower_m: INTEGER is 109
            -- (from ASCII)

    Lower_n: INTEGER is 110
            -- (from ASCII)

    Lower_o: INTEGER is 111
            -- (from ASCII)

    Lower_p: INTEGER is 112
            -- (from ASCII)

    Lower_q: INTEGER is 113
            -- (from ASCII)

    Lower_r: INTEGER is 114
            -- (from ASCII)

    Lower_s: INTEGER is 115
            -- (from ASCII)

    Lower_t: INTEGER is 116
            -- (from ASCII)

    Lower_u: INTEGER is 117
            -- (from ASCII)

    Lower_v: INTEGER is 118
            -- (from ASCII)

    Lower_w: INTEGER is 119
            -- (from ASCII)

    Lower_x: INTEGER is 120
            -- (from ASCII)

    Lower_y: INTEGER is 121
            -- (from ASCII)

    Lower_z: INTEGER is 122
            -- (from ASCII)

    Minus: INTEGER is 45
            -- (from ASCII)

    Nak: INTEGER is 21
            -- (from ASCII)

    Nine: INTEGER is 57
            -- (from ASCII)

    Nl: INTEGER is 10
            -- (from ASCII)

    Np: INTEGER is 12
            -- (from ASCII)

    Nul: INTEGER is 0
            -- (from ASCII)

    Number_sign: INTEGER is 35
            -- (from ASCII)

    One: INTEGER is 49
            -- (from ASCII)

    Opening_brace: INTEGER is 123
            -- (from ASCII)

    Overflow: INTEGER is -8
            -- (from ASCII)

    Percent: INTEGER is 37
            -- (from ASCII)

    Plus: INTEGER is 43
            -- (from ASCII)

    Questmark: INTEGER is 63
            -- (from ASCII)

    Rbracket: INTEGER is 93
            -- (from ASCII)

    Rcurly: INTEGER is 41
            -- (from ASCII)

    Right_arrow: INTEGER is -5
            -- (from ASCII)

    Rs: INTEGER is 30
            -- (from ASCII)

    selected_tools: LINKED_LIST [INTEGER]
            -- Regular expressions included in the main one
            -- (from LEX_BUILDER)

    Semicolon: INTEGER is 59
            -- (from ASCII)

    Seven: INTEGER is 55
            -- (from ASCII)

    Si: INTEGER is 15
            -- (from ASCII)

    Singlequote: INTEGER is 39
            -- (from ASCII)

    Six: INTEGER is 54
            -- (from ASCII)

    Slash: INTEGER is 47
            -- (from ASCII)

    So: INTEGER is 14
            -- (from ASCII)

    Soh: INTEGER is 1
            -- (from ASCII)

    Sp: INTEGER is 32
            -- (from ASCII)

    Star: INTEGER is 42
            -- (from ASCII)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    Stx: INTEGER is 2
            -- (from ASCII)

    Sub: INTEGER is 26
            -- (from ASCII)

    Syn: INTEGER is 22
            -- (from ASCII)

    Tabulation: INTEGER is 9
            -- (from ASCII)

    Three: INTEGER is 51
            -- (from ASCII)

    Tilde: INTEGER is 126
            -- (from ASCII)

    token_type_list: LINKED_LIST [INTEGER]
            -- Token types of the selected tools.
            -- Indexed by tool numbers.
            -- (from LEX_BUILDER)

    tool_list: LINKED_LIST [PDFA]
            -- Regular expressions used as auxiliary tools
            -- (from LEX_BUILDER)

    tool_names: LINKED_LIST [STRING]
            -- Names of regular expressions in tool list
            -- (from LEX_BUILDER)

    Two: INTEGER is 50
            -- (from ASCII)

    Underlined: INTEGER is 95
            -- (from ASCII)

    Up_arrow: INTEGER is -2
            -- (from ASCII)

    Upper_a: INTEGER is 65
            -- (from ASCII)

    Upper_b: INTEGER is 66
            -- (from ASCII)

    Upper_c: INTEGER is 67
            -- (from ASCII)

    Upper_d: INTEGER is 68
            -- (from ASCII)

    Upper_e: INTEGER is 69
            -- (from ASCII)

    Upper_f: INTEGER is 70
            -- (from ASCII)

    Upper_g: INTEGER is 71
            -- (from ASCII)

    Upper_h: INTEGER is 72
            -- (from ASCII)

    Upper_i: INTEGER is 73
            -- (from ASCII)

    Upper_j: INTEGER is 74
            -- (from ASCII)

    Upper_k: INTEGER is 75
            -- (from ASCII)

    Upper_l: INTEGER is 76
            -- (from ASCII)

    Upper_m: INTEGER is 77
            -- (from ASCII)

    Upper_n: INTEGER is 78
            -- (from ASCII)

    Upper_o: INTEGER is 79
            -- (from ASCII)

    Upper_p: INTEGER is 80
            -- (from ASCII)

    Upper_q: INTEGER is 81
            -- (from ASCII)

    Upper_r: INTEGER is 82
            -- (from ASCII)

    Upper_s: INTEGER is 83
            -- (from ASCII)

    Upper_t: INTEGER is 84
            -- (from ASCII)

    Upper_u: INTEGER is 85
            -- (from ASCII)

    Upper_v: INTEGER is 86
            -- (from ASCII)

    Upper_w: INTEGER is 87
            -- (from ASCII)

    Upper_x: INTEGER is 88
            -- (from ASCII)

    Upper_y: INTEGER is 89
            -- (from ASCII)

    Upper_z: INTEGER is 90
            -- (from ASCII)

    Us: INTEGER is 31
            -- (from ASCII)

    Vt: INTEGER is 11
            -- (from ASCII)

    Zero: INTEGER is 48
            -- (from ASCII)

    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((pdfa_item (upper) = void or else pdfa_item (upper) = pdfa_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (pdfa_item (upper) = other.pdfa_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    analyze (input_file_name: STRING)
            -- Perform lexical analysis on file
            -- of name input_file_name.

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    distinguish_case
            -- Make letter case significant in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            case_sensitive

    ignore_case
            -- Make letter case not significant in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            not case_sensitive

    keywords_distinguish_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tool_built: tool_list.is_empty
        ensure -- from LEX_BUILDER
            keywords_case_sensitive

    keywords_ignore_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tools_built: tool_list = void or else tool_list.is_empty
        ensure -- from LEX_BUILDER
            not keywords_case_sensitive

    set_e_transition (source, target: INTEGER)
            -- Set epsilon transition from source to target.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states

    set_final (s, r: INTEGER)
            -- Make s the final state of regular expression r.
            -- (from PDFA)

    set_letters
            -- Direct the active transitions to include letters.
            -- (from PDFA)

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
            -- (from PDFA)
        require -- from  AUTOMATON
            True
        require else -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

feature -- Element change

    add_keyword (word: STRING)
            -- Insert word in the keyword list.
            -- (from PDFA)

    add_word (s: STRING; n: INTEGER)
            -- Record the word s and
            -- associate it with token type n.
            -- (from METALEX)
        require -- from METALEX
            s_not_void: s /= void
            s_not_empty: s.capacity >= 1

    any_character
            -- Create regular expression $. matching all characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    any_printable
            -- Create regular expression $P matching all
            -- printable characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    append (p, s: INTEGER)
            -- Create regular expression ps:
            -- s appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    append_optional (p, s: INTEGER)
            -- Create regular expression p[s]:
            -- s optionally appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    associate (t, n: INTEGER)
            -- Associate the t-th tool with token type n.
            -- If this routine is not used, the default value is t.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            t_selected: selected_tools.has (t)
            n_not_zero: n /= 0
            n_not_minus_one: n /= - 1

    build_dollar_any
            -- Build $., matching any character.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            good_first_character: description.item (cursor) = '.'

    build_dollar_b
            -- Build $B, matching any number of break characters:
            -- blank, new-line, tabulation, carriage-return.
            -- (from HIGH_BUILDER)

    build_dollar_n
            -- Build $N, matching natural integer constants.
            -- +('0'..'9')
            -- (from HIGH_BUILDER)

    build_dollar_p
            -- Build $P, matching any printable character.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            good_first_character: description.item (cursor) = 'P'

    build_dollar_r
            -- Build $R, matching floating point constants.
            -- ['+' | '-'] +('0'..'9') '.' *('0'..'9') ['e' | 'E' ['+' | '-']
            -- +('0'..'9')]
            -- (from HIGH_BUILDER)

    build_dollar_z
            -- Build $Z, matching possibly signed integer constants.
            -- ['+' | '-'] +('0'..'9')
            -- (from HIGH_BUILDER)

    case_insensitive (c: INTEGER)
            -- Create regular expression ~(c):
            -- like c, but case-insensitive.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            z_possible: last_character_code >= lower_z
            c_in_tool: c >= 1 and c <= last_created_tool

    difference (r: INTEGER; c: CHARACTER)
            -- Create regular expression representing
            -- the difference r - c.
            -- r must be a simple category, such as a..z,
            -- or a union of simple categories,
            -- such as a..z | 0..9.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            r_exists: r >= 1 and r <= last_created_tool
            r_simple_category: tool_list.i_th (r).nb_states = 2

    enter (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like pdfa_item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: pdfa_item (i) = v
            higher_count: count >= old count

    include (fa: PDFA; shift: INTEGER)
            -- Copy fa with state numbers shifted
            -- by shift positions in the transitions.
            -- Do not preserve the final values.
            -- (from PDFA)
        require -- from PDFA
            same_inputs: greatest_input = fa.greatest_input
            nb_states_large_enough: nb_states >= fa.nb_states + shift

    interval (b, e: CHARACTER)
            -- Create regular expression b..e, or b if b = e.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_built: not lexical_frozen
            e_code_small_enough: e.code <= last_character_code
            b_code_large_enough: b.code >= 0
            b_before_e: b.code <= e.code

    iteration (c: INTEGER)
            -- Create regular expression *(c): zero or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration1 (c: INTEGER)
            -- Create regular expression +(c): one or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration_n (n, c: INTEGER)
            -- Create regular expression n(c):
            -- exactly n consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            n_large_enough: n > 0
            c_in_tool: c >= 1 and c <= last_created_tool

    optional (c: INTEGER)
            -- Create regular expression [c]:
            -- optional c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    prepend_optional (p, s: INTEGER)
            -- Create regular expression [p]s:
            -- s appended to optional p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    pdfa_put (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: pdfa_item (k) = v

    put_expression (s: STRING; n: INTEGER; c: STRING)
            -- Record the regular expression described by s
            -- and associate it with token type n and name c.
            -- (from METALEX)
        require -- from METALEX
            source_long_enough: s.capacity > 0

    put_keyword (s: STRING; exp: INTEGER)
            -- Declare s as a keyword described by
            -- the regular expression of code exp.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            exp_selected: token_type_list /= void and then token_type_list.has (exp)

    put_nameless_expression (s: STRING; n: INTEGER)
            -- Record the regular expression described
            -- by s, and associate it with token type n.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            source_long_enough: s.count > 0

    recognize (s: STRING): INTEGER
            -- Token_type of s; 0 if not recognized
            -- (from LEX_BUILDER)

    remove_case_sensitiveness
            -- Remove case sensitiveness.
            -- (from PDFA)
        require -- from PDFA
            z_possible: greatest_input >= lower_z

    select_tool (i: INTEGER)
            -- Select the i_th tool for inclusion in the main
            -- regular expression.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            i_exist: i > 0 and i <= last_created_tool
        ensure -- from LEX_BUILDER
            i_selected: selected_tools.has (i)

    set_word (word: STRING)
            -- Create regular expression for word:
            -- synonym for concatenation (w o r d).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count >= 1

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

    union (a, b: INTEGER)
            -- Create regular expression for the multiple union
            -- a | a+1 | .. | b: matches any occurrence of
            -- a, or a+1, .., or b.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_not_too_small: a >= 1
            b_not_too_large: b <= last_created_tool
            a_smaller_than_b: a <= b

    union2 (a, b: INTEGER)
            -- Create regular expression a | b: union of
            -- a and b (matches an occurrence of a or b)).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_in_tool: a >= 1 and a <= last_created_tool
            b_in_tool: b >= 1 and b <= last_created_tool

    up_to (word: STRING)
            -- Create regular expression ->"word", which is a
            -- set of any number of any characters ended by "word".
            -- Example: "/* C comment */" matches (->"*/").
            -- The difference between (+$. '*' '/') and
            -- (->"*/") is that "*/..*/..*/" matches
            -- the first but not the second.
            -- The difference between
            -- ((($.-'*') | ('*'($.-'/'))) +('*' '/') )
            -- and "(->"*/")" is that "..**/" matches
            -- the second but not the first.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count > 0
            not_frozen: not lexical_frozen

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    delete_transition (source, input_doc, target: INTEGER)
            -- Delete transition from source to target on input_doc.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: LINKED_LIST [INTEGER])
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove the last regular expression
            -- from the tool list.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            at_least_one_regular: last_created_tool >= 1

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Transformation

    construct_dfa
            -- Create an equivalent deterministic finite automaton.
            -- (from NDFA)
        require -- from NDFA
            start_number_designated: start_number > 0

feature -- Conversion

    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Implementation

    description: STRING
            -- Description of the regular expression
            -- (from HIGH_BUILDER)

    initialized: BOOLEAN
            -- Is analyzer initialized?
            -- (from LEX_BUILDER)

feature -- Input

    No_token: INTEGER is 0
            -- (from METALEX)

    read_grammar (token_file_name: STRING)
            -- Create lexical analyzer for grammar in file of name
            -- token_file_name. File structure:
            -- One or more lines of the form
            -- name  regular_expression
            -- then a line beginning with two dashes --
            -- then zero or more lines containing one keyword each.
            -- (from METALEX)
        ensure -- from METALEX
            analyzer_exists: analyzer /= void

feature  -- Input

    retrieve_analyzer (file_name: STRING)
            -- Retrieve analyzer from file named file_name.
            -- (from LEX_BUILDER)

feature -- Output

    begin_analysis
            -- Initialize lexical analysis.
            -- This default version of the procedure
            -- simply prints header information.
            -- It may be redefined in descendants
            -- for specific processing.

    do_a_token (read_token: TOKEN)
            -- Handle read_token.
            -- This default version of the procedure
            -- simply prints information on read_token.
            -- It may be redefined in descendants
            -- for specific processing.
        require
            argument_not_void: read_token /= void

    end_analysis
            -- Terminate lexical analysis.
            -- This default version of the procedure
            -- does nothing.
            -- It may be redefined in descendants
            -- for specific processing.

    trace
            -- Output an internal representation
            -- of the current automaton.
            -- (from PDFA)

feature  -- Output

    store_analyzer (file_name: STRING)
            -- Store analyzer in file named file_name.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            initialized: initialized

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from HIGH_BUILDER
    cursor_not_too_far: cursor <= description_length
        -- from LEX_BUILDER
    last_created: tool_list = void or else last_created_tool = tool_list.count
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class SCANNING


STATE Chart

class
    STATE

General
    cluster: lex.lex
    description: "States of finite automata"

Ancestors
    ANY

Queries
    final: INTEGER
    final_array: ARRAY [INTEGER]

Commands
    set_final (i: INTEGER)

Constraints
    lower entry is final


STATE Flat contracts

indexing
    description: "States of finite automata"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

class interface
    STATE

feature -- Access

    final: INTEGER
            -- Number of the regular expression of which Current
            -- is a final state; 0 if not final.
            -- (When you go from state to state
            -- in an automaton, at the end of the course the
            -- attribute final of the current state is the
            -- identification number of the regular expression
            -- recognized. 0 means that nothing has been recognized.)

    final_array: ARRAY [INTEGER]
            -- Array of all the possible final states (useful
            -- in the case of several possible final attributes)

feature -- Status setting

    set_final (i: INTEGER)
            -- Make current state final for i-th regular expression.
        ensure
            final_is_i: final = i
            lower_entry_is_i: final_array.item (final_array.lower) = i

invariant

    lower_entry_is_final: (final = 0 and final_array = void) or else final_array.item (final_array.lower) = final
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class STATE


STATE_OF_DFA Chart

class
    STATE_OF_DFA

General
    cluster: lex.lex
    description: "States of deterministic finite automata"
    create: make

Ancestors
    ARRAY [G]
    STATE

Queries
    infix "@" (i: INTEGER): STATE_OF_DFA
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [STATE_OF_DFA]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): STATE_OF_DFA
    extendible: BOOLEAN
    final: INTEGER
    final_array: ARRAY [INTEGER]
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: STATE_OF_DFA): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] STATE_OF_DFA): BOOLEAN
    is_inserted (v: STATE_OF_DFA): BOOLEAN
    item (i: INTEGER): STATE_OF_DFA
    linear_representation: LINEAR [STATE_OF_DFA]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: STATE_OF_DFA): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] STATE_OF_DFA): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] STATE_OF_DFA
    successor (i: INTEGER): STATE_OF_DFA
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    append_transition (i: INTEGER; t: STATE_OF_DFA)
    array_make (min_index, max_index: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] STATE_OF_DFA)
    discard_items
    enter (v: [like item] STATE_OF_DFA; i: INTEGER)
    fill (other: CONTAINER [STATE_OF_DFA])
    force (v: [like item] STATE_OF_DFA; i: INTEGER)
    grow (i: INTEGER)
    make (s: INTEGER)
    make_from_array (a: ARRAY [STATE_OF_DFA])
    prune_all (v: STATE_OF_DFA)
    put (v: [like item] STATE_OF_DFA; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    set_final (i: INTEGER)
    subcopy (other: [like Current] STATE_OF_DFA; start_pos, end_pos, index_pos: INTEGER)


STATE_OF_DFA Flat contracts

indexing
    description: "States of deterministic finite automata"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

class interface
    STATE_OF_DFA

create

    make (s: INTEGER)
            -- Make state with 0 to s possibles inputs.

feature -- Initialization

    make (s: INTEGER)
            -- Make state with 0 to s possibles inputs.

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [STATE_OF_DFA])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    area: SPECIAL [STATE_OF_DFA]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): STATE_OF_DFA
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    final: INTEGER
            -- Number of the regular expression of which Current
            -- is a final state; 0 if not final.
            -- (When you go from state to state
            -- in an automaton, at the end of the course the
            -- attribute final of the current state is the
            -- identification number of the regular expression
            -- recognized. 0 means that nothing has been recognized.)
            -- (from STATE)

    final_array: ARRAY [INTEGER]
            -- Array of all the possible final states (useful
            -- in the case of several possible final attributes)
            -- (from STATE)

    has (v: STATE_OF_DFA): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (i: INTEGER): STATE_OF_DFA
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    infix "@" (i: INTEGER): STATE_OF_DFA
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: STATE_OF_DFA): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item (upper) = void or else item (upper) = item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: STATE_OF_DFA): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item (upper) = other.item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_final (i: INTEGER)
            -- Make current state final for i-th regular expression.
            -- (from STATE)
        ensure -- from STATE
            final_is_i: final = i
            lower_entry_is_i: final_array.item (final_array.lower) = i

feature -- Cursor movement

    successor (i: INTEGER): STATE_OF_DFA
            -- Successor of current state for input i;
            -- Void if no successor
        require
            possible_input: i <= upper and i >= 0

feature -- Element change

    append_transition (i: INTEGER; t: STATE_OF_DFA)
            -- Append transition from current state to state t on input i.
        require
            no_other_transition: item (i) = void
            possible_input: i <= upper and i >= 0

    enter (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [STATE_OF_DFA])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item (i) = v
            higher_count: count >= old count

    put (v: like item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: STATE_OF_DFA)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [STATE_OF_DFA]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STATE
    lower_entry_is_final: (final = 0 and final_array = void) or else final_array.item (final_array.lower) = final
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class STATE_OF_DFA


TEXT_FILLER Chart

deferred class
    TEXT_FILLER

General
    cluster: lex.lex
    description: "Buffered files or strings for lexical analysis"

Ancestors
    ANY

Queries
    buffer: STRING
    buffer_size: INTEGER
    char_buffered_number: INTEGER
    column_nb_array: LEX_ARRAY [INTEGER]
    file_name: STRING
    line_nb_array: LEX_ARRAY [INTEGER]

Commands
    close_file
    create_buffers (buf, lin: INTEGER)
    exclude (i, j: INTEGER)
    fill_buffer (b: INTEGER)
    fill_whole_buffer
    resize_and_fill_buffer (buf, b: INTEGER)
    set_file (f_name: STRING)
    set_string (s: STRING)


TEXT_FILLER Flat contracts

indexing
    description: "Buffered files or strings for lexical analysis"
    comment: "See detailed comment at end of class"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    TEXT_FILLER

feature -- Access

    buffer: STRING
            -- Buffer filled by fill_buffer

    char_buffered_number: INTEGER
            -- Number of characters read and written
            -- in buffer since the beginning

    column_nb_array: LEX_ARRAY [INTEGER]
            -- Array recording the column numbers of each buffered
            -- character (the column number of the i-th character in the
            -- buffer is the i-th entry of column_nb_array)

    file_name: STRING
            -- Name of input file

    line_nb_array: LEX_ARRAY [INTEGER]
            -- Array recording the line numbers of each buffered
            -- character (the line number of the i-th character in the
            -- buffer is the i-th entry of line_nb_array)

feature -- Status setting

    close_file
            -- Close input file if any.
        ensure
            file_is_void: file = void

    create_buffers (buf, lin: INTEGER)
            -- Create buffers and mask.
        ensure
            buffer_size = buf
            line_length = lin

    exclude (i, j: INTEGER)
            -- Discard columns i to j from the input.
            -- A zero value for j means all the way to the
            -- end of the line.
        require
            i_positive: i > 0
            j_null_or_greater_than_i: j = 0 or j >= i

    fill_buffer (b: INTEGER)
            -- Copy the characters from the b+1-st to the last one in
            -- the beginning of the buffer and then fill the end of
            -- the buffer with the text. This routine skips the columns
            -- forbidden by exclude, but always puts '\n' at the end
            -- of a line; the line and column numbers are those of
            -- the characters in the real file.
        require
            buffer_created: buffer /= void
            c_buffer_created: column_nb_array /= void
            l_buffer_created: line_nb_array /= void
            b_not_too_large: b <= buffer_size
            b_positive: b >= 0

    fill_whole_buffer
            -- Fill with new characters.

    resize_and_fill_buffer (buf, b: INTEGER)
            -- When increasing buffer_size: resize the buffer and then
            -- fill the new buffer.
            -- When decreasing buffer_size: fill the buffer and then
            -- resize it.
            -- When filling the buffer: Copy the characters from the
            -- b+1-st to the last one (of the buffer before resizing) in
            -- the beginning of the buffer and then fill
            -- the end of the buffer (after resizing) with the text.
            -- This routine skips the columns
            -- forbidden by exclude, but always puts '\n' at the end
            -- of a line; the line and column numbers are those of
            -- the characters in the real file.
        require
            buffer_created: buffer /= void
            c_buffer_created: column_nb_array /= void
            l_buffer_created: line_nb_array /= void
            b_not_too_large: b <= buffer_size
            b_positive: b >= 0
        ensure
            buffer_size = buf

    set_file (f_name: STRING)
            -- Use f_name as input file.
        require
            file_name_not_void: f_name /= void

    set_string (s: STRING)
            -- Use s as the input string.
        require
            string_not_void: s /= void

feature -- Implementation

    buffer_size: INTEGER
            -- Buffer size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TEXT_FILLER


TOKEN Chart

class
    TOKEN

General
    cluster: lex.lex
    description: "Individual elements of lexical analysis"

Ancestors
    ANY

Queries
    column_number: INTEGER
    is_keyword (i: INTEGER): BOOLEAN
    keyword_code: INTEGER
    line_number: INTEGER
    string_value: STRING
    type: INTEGER

Commands
    set (typ, lin, col, key: INTEGER; str: STRING)


TOKEN Flat contracts

indexing
    description: "Individual elements of lexical analysis"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

class interface
    TOKEN

feature -- Access

    column_number: INTEGER
            -- Column number in the parsed text

    is_keyword (i: INTEGER): BOOLEAN
            -- If the token is a keyword,
            -- is i its identification number?

    keyword_code: INTEGER
            -- Identification number if the token is a keyword

    line_number: INTEGER
            -- Line number in the parsed text

    string_value: STRING
            -- The token's character string

    type: INTEGER
            -- Type of the token

feature -- Status setting

    set (typ, lin, col, key: INTEGER; str: STRING)
            -- Reset the contents of the token:
            -- type type, line number lin,
            -- column number col, keyword value key.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TOKEN


cluster lex.parse

Cluster
    lex.parse

Supercluster
    lex

Classes
    AGGREGATE
    CHOICE
    CONSTRUCT
    INPUT
    KEYWORD
    L_INTERFACE
    REPETITION
    TERMINAL


AGGREGATE Chart

deferred class
    AGGREGATE

General
    cluster: lex.parse
    description: "Constructs whose specimens are obtained by concatenating specimens of constructs of zero or more specified constructs"

Ancestors
    CONSTRUCT

Queries
    infix "@" (i: INTEGER): [like item] CONSTRUCT
    arity: INTEGER
    binary_representation: BINARY_TREE [CONSTRUCT]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] CONSTRUCT
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: CONSTRUCT
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    committed: BOOLEAN
    construct_name: STRING
    count: INTEGER
    Document: INPUT
    duplicate (n: INTEGER): [like Current] AGGREGATE
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] CONSTRUCT
    first_child: [like parent] CONSTRUCT
    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    has (v: CONSTRUCT): BOOLEAN
    has_commit: BOOLEAN
    i_th (i: INTEGER): [like item] CONSTRUCT
    index_of (v: [like item] CONSTRUCT; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] AGGREGATE): BOOLEAN
    is_inserted (v: CONSTRUCT): BOOLEAN
    is_optional: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] CONSTRUCT): BOOLEAN
    item: CONSTRUCT
    last: [like item] CONSTRUCT
    last_child: [like parent] CONSTRUCT
    left_recursion: BOOLEAN
    left_sibling: [like Current] AGGREGATE
    linear_representation: LINEAR [CONSTRUCT]
    no_components: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: [like item] CONSTRUCT): INTEGER
    parsed: BOOLEAN
    Print_mode: CELL [BOOLEAN]
    production: LINKED_LIST [CONSTRUCT]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] AGGREGATE
    sequential_occurrences (v: CONSTRUCT): INTEGER
    sublist: [like Current] AGGREGATE
    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [CONSTRUCT])
    child_back
    child_extend (v: [like item] CONSTRUCT)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] CONSTRUCT)
    child_put_left (v: [like item] CONSTRUCT)
    child_put_right (v: [like item] CONSTRUCT)
    child_replace (v: [like item] CONSTRUCT)
    child_start
    commit
    compare_objects
    compare_references
    copy (other: [like Current] AGGREGATE)
    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
    extend (v: [like item] CONSTRUCT)
    fill (other: TREE [CONSTRUCT])
    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
    force (v: [like item] CONSTRUCT)
    make
    merge_tree_after (other: [like first_child] CONSTRUCT)
    merge_tree_before (other: [like first_child] CONSTRUCT)
    move (i: INTEGER)
    parse
    post_action
    pre_action
    print_name
    process
    prune (n: [like first_child] CONSTRUCT)
    prune_all (v: [like item] CONSTRUCT)
    put_child (n: [like parent] CONSTRUCT)
    put_child_left (n: [like parent] CONSTRUCT)
    put_child_right (n: [like parent] CONSTRUCT)
    put_front (v: [like item] CONSTRUCT)
    put_i_th (v: [like item] CONSTRUCT; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] CONSTRUCT)
    replace_child (n: [like parent] CONSTRUCT)
    search_child (v: [like item] CONSTRUCT)
    semantics
    set_optional
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] AGGREGATE)
    twl_merge_right (other: [like Current] AGGREGATE)
    twl_prune (v: [like item] CONSTRUCT)
    wipe_out


AGGREGATE Flat contracts

indexing
    description: "Constructs whose specimens are obtained by concatenating specimens of constructs of zero or more specified constructs"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    AGGREGATE

feature -- Initialization

    make
            -- Set up construct.
            -- (from CONSTRUCT)

feature -- Access

    construct_name: STRING
            -- Name of the construct in the grammar
            -- (from CONSTRUCT)

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    document: INPUT
            -- The document to be parsed
            -- (from CONSTRUCT)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not no_components

    first_child: like parent
            -- Leftmost child
            -- (from TWO_WAY_TREE)

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    child_item: CONSTRUCT
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    item: CONSTRUCT
            -- Content of cell.
            -- (from CELL)

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not no_components

    last_child: like parent
            -- (from TWO_WAY_TREE)

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: CONSTRUCT): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    production: LINKED_LIST [CONSTRUCT]
            -- Right-hand side of the production for the construct
            -- (from CONSTRUCT)

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not no_components
        ensure -- from TREE
            not_is_leaf: Result implies not no_components

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not no_components
        ensure -- from TREE
            not_is_leaf: Result implies not no_components

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    committed: BOOLEAN
            -- Have enough productions been recognized to interpret
            -- failure of parsing as a syntax error in this construct?
            -- (Otherwise the parsing process will backtrack, trying
            -- other possible interpretations of the part already read.)
            -- (from CONSTRUCT)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: CONSTRUCT): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not no_components

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: CONSTRUCT): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    no_components: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_optional: BOOLEAN
            -- Is construct optional?
            -- (from CONSTRUCT)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    left_recursion: BOOLEAN
            -- Is the construct's definition left-recursive?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    parsed: BOOLEAN
            -- Has construct been successfully parsed?
            -- (True for optional components not present)
            -- (from CONSTRUCT)

    print_mode: CELL [BOOLEAN]
            -- Must the left-recursion test also print the production?
            -- (Default: no.)
            -- (from CONSTRUCT)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_optional
            -- Define this construct as optional.
            -- (from CONSTRUCT)
        ensure -- from CONSTRUCT
            optional_construct: is_optional

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not no_components implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: no_components implies child_before
        ensure then -- from TREE
            is_last_child: not no_components implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not no_components implies child_isfirst
        ensure then -- from TREE
            is_first_child: not no_components implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: no_components implies child_after

feature -- Element change

    append (s: SEQUENCE [CONSTRUCT])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [CONSTRUCT])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.no_components
        ensure then -- from DYNAMIC_LIST
            other_empty: other.no_components

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.no_components
        ensure then -- from DYNAMIC_LIST
            other_empty: other.no_components

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
            -- Prune n from children.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
            -- (from TWO_WAY_TREE)
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: no_components implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: no_components
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    commit
            -- If this construct is one among several possible ones,
            -- discard the others.
        require -- from  CONSTRUCT
            True
        require else
            only_commit_once: not has_commit

    has_commit: BOOLEAN
            -- Is current aggregate committed?

    parse
            -- Attempt to analyze incoming lexical
            -- tokens according to current construct.
            -- Set parsed to true if successful;
            -- return to original position in input otherwise.
            -- (from CONSTRUCT)

    post_action
            -- Semantic action executed after construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    pre_action
            -- Semantic action executed before construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    process
            -- Parse a specimen of the construct, then apply
            -- semantic actions if parsing successful.
            -- (from CONSTRUCT)

    semantics
            -- Apply semantic actions in order:
            -- pre_action, in_action, post_action.
            -- (from CONSTRUCT)

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [CONSTRUCT]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [CONSTRUCT]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from TWO_WAY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    print_name
            -- Print the construct name on standard output.
            -- (from CONSTRUCT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_TREE
    off_constraint: (child = void) implies child_off
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: no_components = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not no_components and child_index = 1)
    child_islast_definition: child_islast = (not no_components and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not no_components implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: no_components implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies no_components
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not no_components) and (child_index = 1))
    islast_definition: child_islast = ((not no_components) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: no_components implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: no_components implies child_off
        -- from FINITE
    empty_definition: no_components = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

end -- class AGGREGATE


CHOICE Chart

deferred class
    CHOICE

General
    cluster: lex.parse
    description: "Constructs whose specimens are specimens of constructs chosen among a specified list."

Ancestors
    CONSTRUCT

Queries
    infix "@" (i: INTEGER): [like item] CONSTRUCT
    arity: INTEGER
    binary_representation: BINARY_TREE [CONSTRUCT]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] CONSTRUCT
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: CONSTRUCT
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    committed: BOOLEAN
    construct_name: STRING
    count: INTEGER
    Document: INPUT
    duplicate (n: INTEGER): [like Current] CHOICE
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] CONSTRUCT
    first_child: [like parent] CONSTRUCT
    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    has (v: CONSTRUCT): BOOLEAN
    i_th (i: INTEGER): [like item] CONSTRUCT
    index_of (v: [like item] CONSTRUCT; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] CHOICE): BOOLEAN
    is_inserted (v: CONSTRUCT): BOOLEAN
    is_optional: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] CONSTRUCT): BOOLEAN
    item: CONSTRUCT
    last: [like item] CONSTRUCT
    last_child: [like parent] CONSTRUCT
    left_recursion: BOOLEAN
    left_sibling: [like Current] CHOICE
    linear_representation: LINEAR [CONSTRUCT]
    no_components: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: [like item] CONSTRUCT): INTEGER
    parsed: BOOLEAN
    Print_mode: CELL [BOOLEAN]
    production: LINKED_LIST [CONSTRUCT]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    retained: CONSTRUCT
    right_sibling: [like Current] CHOICE
    sequential_occurrences (v: CONSTRUCT): INTEGER
    sublist: [like Current] CHOICE
    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [CONSTRUCT])
    child_back
    child_extend (v: [like item] CONSTRUCT)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] CONSTRUCT)
    child_put_left (v: [like item] CONSTRUCT)
    child_put_right (v: [like item] CONSTRUCT)
    child_replace (v: [like item] CONSTRUCT)
    child_start
    commit
    compare_objects
    compare_references
    copy (other: [like Current] CHOICE)
    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
    extend (v: [like item] CONSTRUCT)
    fill (other: TREE [CONSTRUCT])
    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
    force (v: [like item] CONSTRUCT)
    make
    merge_tree_after (other: [like first_child] CONSTRUCT)
    merge_tree_before (other: [like first_child] CONSTRUCT)
    move (i: INTEGER)
    parse
    post_action
    pre_action
    print_name
    process
    prune (n: [like first_child] CONSTRUCT)
    prune_all (v: [like item] CONSTRUCT)
    put_child (n: [like parent] CONSTRUCT)
    put_child_left (n: [like parent] CONSTRUCT)
    put_child_right (n: [like parent] CONSTRUCT)
    put_front (v: [like item] CONSTRUCT)
    put_i_th (v: [like item] CONSTRUCT; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] CONSTRUCT)
    replace_child (n: [like parent] CONSTRUCT)
    search_child (v: [like item] CONSTRUCT)
    semantics
    set_optional
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] CHOICE)
    twl_merge_right (other: [like Current] CHOICE)
    twl_prune (v: [like item] CONSTRUCT)
    wipe_out


CHOICE Flat contracts

indexing
    description: "Constructs whose specimens are specimens of constructs chosen among a specified list."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CHOICE

feature -- Initialization

    make
            -- Set up construct.
            -- (from CONSTRUCT)

feature -- Access

    construct_name: STRING
            -- Name of the construct in the grammar
            -- (from CONSTRUCT)

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    document: INPUT
            -- The document to be parsed
            -- (from CONSTRUCT)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not no_components

    first_child: like parent
            -- Leftmost child
            -- (from TWO_WAY_TREE)

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: CONSTRUCT
            -- Content of cell.
            -- (from CELL)

    child_item: CONSTRUCT
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not no_components

    last_child: like parent
            -- (from TWO_WAY_TREE)

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: CONSTRUCT): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    production: LINKED_LIST [CONSTRUCT]
            -- Right-hand side of the production for the construct
            -- (from CONSTRUCT)

    retained: CONSTRUCT
            -- Child which matches the input document;
            -- Void if none.

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not no_components
        ensure -- from TREE
            not_is_leaf: Result implies not no_components

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not no_components
        ensure -- from TREE
            not_is_leaf: Result implies not no_components

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    committed: BOOLEAN
            -- Have enough productions been recognized to interpret
            -- failure of parsing as a syntax error in this construct?
            -- (Otherwise the parsing process will backtrack, trying
            -- other possible interpretations of the part already read.)
            -- (from CONSTRUCT)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: CONSTRUCT): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not no_components

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: CONSTRUCT): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    no_components: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_optional: BOOLEAN
            -- Is construct optional?
            -- (from CONSTRUCT)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    left_recursion: BOOLEAN
            -- Is the construct's definition left-recursive?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    parsed: BOOLEAN
            -- Has construct been successfully parsed?
            -- (True for optional components not present)
            -- (from CONSTRUCT)

    print_mode: CELL [BOOLEAN]
            -- Must the left-recursion test also print the production?
            -- (Default: no.)
            -- (from CONSTRUCT)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_optional
            -- Define this construct as optional.
            -- (from CONSTRUCT)
        ensure -- from CONSTRUCT
            optional_construct: is_optional

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not no_components implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: no_components implies child_before
        ensure then -- from TREE
            is_last_child: not no_components implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not no_components implies child_isfirst
        ensure then -- from TREE
            is_first_child: not no_components implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: no_components implies child_after

feature -- Element change

    append (s: SEQUENCE [CONSTRUCT])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [CONSTRUCT])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.no_components
        ensure then -- from DYNAMIC_LIST
            other_empty: other.no_components

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.no_components
        ensure then -- from DYNAMIC_LIST
            other_empty: other.no_components

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
            -- Prune n from children.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
            -- (from TWO_WAY_TREE)
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: no_components implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: no_components
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    commit
            -- If this construct is one among several possible ones,
            -- discard the others.
            -- By default this does nothing.
            -- (from CONSTRUCT)

    parse
            -- Attempt to analyze incoming lexical
            -- tokens according to current construct.
            -- Set parsed to true if successful;
            -- return to original position in input otherwise.
            -- (from CONSTRUCT)

    post_action
            -- Semantic action executed after construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    pre_action
            -- Semantic action executed before construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    process
            -- Parse a specimen of the construct, then apply
            -- semantic actions if parsing successful.
            -- (from CONSTRUCT)

    semantics
            -- Apply semantic actions in order:
            -- pre_action, in_action, post_action.
            -- (from CONSTRUCT)

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [CONSTRUCT]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [CONSTRUCT]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from TWO_WAY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    print_name
            -- Print the construct name on standard output.
            -- (from CONSTRUCT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_TREE
    off_constraint: (child = void) implies child_off
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: no_components = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not no_components and child_index = 1)
    child_islast_definition: child_islast = (not no_components and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not no_components implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: no_components implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies no_components
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not no_components) and (child_index = 1))
    islast_definition: child_islast = ((not no_components) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: no_components implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: no_components implies child_off
        -- from FINITE
    empty_definition: no_components = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

end -- class CHOICE


CONSTRUCT Chart

deferred class
    CONSTRUCT

General
    cluster: lex.parse
    description: "The general notion of language construct,  characterized by a grammatical production and associated semantic actions"

Ancestors
    TWO_WAY_TREE [G]

Queries
    infix "@" (i: INTEGER): [like item] CONSTRUCT
    arity: INTEGER
    binary_representation: BINARY_TREE [CONSTRUCT]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] CONSTRUCT
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: CONSTRUCT
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    committed: BOOLEAN
    construct_name: STRING
    count: INTEGER
    Document: INPUT
    duplicate (n: INTEGER): [like Current] CONSTRUCT
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] CONSTRUCT
    first_child: [like parent] CONSTRUCT
    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    has (v: CONSTRUCT): BOOLEAN
    i_th (i: INTEGER): [like item] CONSTRUCT
    index_of (v: [like item] CONSTRUCT; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] CONSTRUCT): BOOLEAN
    is_inserted (v: CONSTRUCT): BOOLEAN
    is_leaf: BOOLEAN
    is_optional: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] CONSTRUCT): BOOLEAN
    item: CONSTRUCT
    last: [like item] CONSTRUCT
    last_child: [like parent] CONSTRUCT
    left_recursion: BOOLEAN
    left_sibling: [like Current] CONSTRUCT
    linear_representation: LINEAR [CONSTRUCT]
    object_comparison: BOOLEAN
    occurrences (v: [like item] CONSTRUCT): INTEGER
    parsed: BOOLEAN
    Print_mode: CELL [BOOLEAN]
    production: LINKED_LIST [CONSTRUCT]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] CONSTRUCT
    sequential_occurrences (v: CONSTRUCT): INTEGER
    sublist: [like Current] CONSTRUCT
    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [CONSTRUCT])
    child_back
    child_extend (v: [like item] CONSTRUCT)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] CONSTRUCT)
    child_put_left (v: [like item] CONSTRUCT)
    child_put_right (v: [like item] CONSTRUCT)
    child_replace (v: [like item] CONSTRUCT)
    child_start
    commit
    compare_objects
    compare_references
    copy (other: [like Current] CONSTRUCT)
    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
    extend (v: [like item] CONSTRUCT)
    fill (other: TREE [CONSTRUCT])
    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
    force (v: [like item] CONSTRUCT)
    make
    merge_tree_after (other: [like first_child] CONSTRUCT)
    merge_tree_before (other: [like first_child] CONSTRUCT)
    move (i: INTEGER)
    parse
    post_action
    pre_action
    print_name
    process
    prune (n: [like first_child] CONSTRUCT)
    prune_all (v: [like item] CONSTRUCT)
    put_child (n: [like parent] CONSTRUCT)
    put_child_left (n: [like parent] CONSTRUCT)
    put_child_right (n: [like parent] CONSTRUCT)
    put_front (v: [like item] CONSTRUCT)
    put_i_th (v: [like item] CONSTRUCT; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] CONSTRUCT)
    replace_child (n: [like parent] CONSTRUCT)
    search_child (v: [like item] CONSTRUCT)
    semantics
    set_optional
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] CONSTRUCT)
    twl_merge_right (other: [like Current] CONSTRUCT)
    twl_prune (v: [like item] CONSTRUCT)
    wipe_out


CONSTRUCT Flat contracts

indexing
    description: "The general notion of language construct,  characterized by a grammatical production and associated semantic actions"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:55 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CONSTRUCT

feature -- Initialization

    make
            -- Set up construct.

feature -- Access

    construct_name: STRING
            -- Name of the construct in the grammar

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    document: INPUT
            -- The document to be parsed

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    first_child: like parent
            -- Leftmost child
            -- (from TWO_WAY_TREE)

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    child_item: CONSTRUCT
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    item: CONSTRUCT
            -- Content of cell.
            -- (from CELL)

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    last_child: like parent
            -- (from TWO_WAY_TREE)

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: CONSTRUCT): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    production: LINKED_LIST [CONSTRUCT]
            -- Right-hand side of the production for the construct

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    committed: BOOLEAN
            -- Have enough productions been recognized to interpret
            -- failure of parsing as a syntax error in this construct?
            -- (Otherwise the parsing process will backtrack, trying
            -- other possible interpretations of the part already read.)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    has (v: CONSTRUCT): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: CONSTRUCT): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_optional: BOOLEAN
            -- Is construct optional?

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    left_recursion: BOOLEAN
            -- Is the construct's definition left-recursive?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    parsed: BOOLEAN
            -- Has construct been successfully parsed?
            -- (True for optional components not present)

    print_mode: CELL [BOOLEAN]
            -- Must the left-recursion test also print the production?
            -- (Default: no.)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_optional
            -- Define this construct as optional.
        ensure
            optional_construct: is_optional

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [CONSTRUCT])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [CONSTRUCT])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
            -- Prune n from children.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
            -- (from TWO_WAY_TREE)
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    commit
            -- If this construct is one among several possible ones,
            -- discard the others.
            -- By default this does nothing.

    parse
            -- Attempt to analyze incoming lexical
            -- tokens according to current construct.
            -- Set parsed to true if successful;
            -- return to original position in input otherwise.

    post_action
            -- Semantic action executed after construct is parsed
            -- (nothing by default; may be redefined in descendants).

    pre_action
            -- Semantic action executed before construct is parsed
            -- (nothing by default; may be redefined in descendants).

    process
            -- Parse a specimen of the construct, then apply
            -- semantic actions if parsing successful.

    semantics
            -- Apply semantic actions in order:
            -- pre_action, in_action, post_action.

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [CONSTRUCT]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [CONSTRUCT]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from TWO_WAY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    print_name
            -- Print the construct name on standard output.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_TREE
    off_constraint: (child = void) implies child_off
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_leaf implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

end -- class CONSTRUCT


INPUT Chart

class
    INPUT

General
    cluster: lex.parse
    description: "Handling of input documents through a lexical analyzer"
    create: make

Ancestors
    ARRAYED_LIST [G]

Queries
    infix "@" (i: INTEGER): TOKEN
    after: BOOLEAN
    analyzer: LEXICAL
    before: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] INPUT
    end_of_document: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: TOKEN
    for_all (test: FUNCTION [ANY, TUPLE [TOKEN], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] TOKEN): BOOLEAN
    i_th (i: INTEGER): TOKEN
    index: INTEGER
    index_of (v: [like item] TOKEN; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] INPUT): BOOLEAN
    is_inserted (v: TOKEN): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    keyword_code (s: STRING): INTEGER
    keyword_string (code: INTEGER): STRING
    last: [like first] TOKEN
    linear_representation: LINEAR [TOKEN]
    object_comparison: BOOLEAN
    occurrences (v: [like item] TOKEN): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: TOKEN): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [TOKEN], BOOLEAN]): BOOLEAN
    token: [like first] TOKEN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [TOKEN])
    arrayed_list_make (n: INTEGER)
    back
    compare_objects
    compare_references
    copy (other: [like Current] INPUT)
    do_all (action: PROCEDURE [ANY, TUPLE [TOKEN]])
    do_if (action: PROCEDURE [ANY, TUPLE [TOKEN]]; test: FUNCTION [ANY, TUPLE [TOKEN], BOOLEAN])
    extend (v: [like item] TOKEN)
    fill (other: CONTAINER [TOKEN])
    finish
    force (v: [like item] TOKEN)
    forth
    get_token
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [TOKEN])
    merge_left (other: ARRAYED_LIST [TOKEN])
    merge_right (other: ARRAYED_LIST [TOKEN])
    move (i: INTEGER)
    out_list
    prune (v: [like item] TOKEN)
    prune_all (v: [like item] TOKEN)
    put (v: [like item] TOKEN)
    put_front (v: [like item] TOKEN)
    put_i_th (v: [like item] TOKEN; i: INTEGER)
    put_left (v: [like item] TOKEN)
    put_right (v: [like item] TOKEN)
    raise_error (s: STRING)
    remove
    remove_left
    remove_right
    replace (v: [like first] TOKEN)
    retrieve_lex (filename: STRING)
    search (v: [like item] TOKEN)
    set_input_file (filename: STRING)
    set_input_string (stringname: STRING)
    set_lexical (lexical: LEXICAL)
    start
    swap (i: INTEGER)
    wipe_out


INPUT Flat contracts

indexing
    description: "Handling of input documents through a lexical analyzer"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:56 $"
    revision: "$Revision: 1.3 $"

class interface
    INPUT

create

    make
            -- Create an empty document

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [TOKEN])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    analyzer: LEXICAL
            -- Lexical analyzer used

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    first: TOKEN
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like token): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like token; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    token: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): TOKEN
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    keyword_code (s: STRING): INTEGER
            -- Keyword code corresponding to s;
            -- -1 if no specimen of s is found.
        require
            lex_not_void: analyzer /= void

    keyword_string (code: INTEGER): STRING
            -- Keyword string corresponding to code
        require
            lex_not_void: analyzer /= void

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: TOKEN): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    set_lexical (lexical: LEXICAL)
            -- Designate lexical as the analyzer to be used.
        require
            lex_not_void: lexical /= void

    infix "@" (i: INTEGER): TOKEN
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like token): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like token): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_document: BOOLEAN
            -- Has end of document been reached?

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: TOKEN): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_input_file (filename: STRING)
            -- Set the name of the input file to be read
            -- by the lexical analyzer.
        require
            lex_not_void: analyzer /= void
            name_not_void: filename /= void

    set_input_string (stringname: STRING)
            -- Set the name of the input string to be read
            -- by the lexical analyzer.

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like token)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, token)
            item_found: (not exhausted and not object_comparison) implies v = token

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [TOKEN])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like token)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [TOKEN])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like token)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [TOKEN])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [TOKEN])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like token)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_front (v: like token)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like token)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like token)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: token = v

feature -- Removal

    prune (v: like token)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like token)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: token = old i_th (i)
            swapped_from_item: i_th (i) = old token

feature -- Conversion

    linear_representation: LINEAR [TOKEN]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Initialisation

    make
            -- Create an empty document

feature -- Input

    get_token
            -- Make next token accessible with `token'

    retrieve_lex (filename: STRING)
            -- Retrieve analyzer from filename if exists.
        require
            name_not_void: filename /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [TOKEN]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [TOKEN]]; test: FUNCTION [ANY, TUPLE [TOKEN], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [TOKEN], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [TOKEN], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    out_list
            -- Output tokens recognized so far.

    raise_error (s: STRING)
            -- Print error message s.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (token = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class INPUT


KEYWORD Chart

class
    KEYWORD

General
    cluster: lex.parse
    description: "Terminal constructs with just one specimen, representing a language keyword or special symbol"
    create: make

Ancestors
    TERMINAL

Queries
    infix "@" (i: INTEGER): [like item] CONSTRUCT
    arity: INTEGER
    binary_representation: BINARY_TREE [CONSTRUCT]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] CONSTRUCT
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: CONSTRUCT
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    committed: BOOLEAN
    construct_name: STRING
    count: INTEGER
    Document: INPUT
    duplicate (n: INTEGER): [like Current] KEYWORD
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] CONSTRUCT
    first_child: [like parent] CONSTRUCT
    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    has (v: CONSTRUCT): BOOLEAN
    i_th (i: INTEGER): [like item] CONSTRUCT
    index_of (v: [like item] CONSTRUCT; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] KEYWORD): BOOLEAN
    is_inserted (v: CONSTRUCT): BOOLEAN
    is_leaf: BOOLEAN
    is_optional: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] CONSTRUCT): BOOLEAN
    item: CONSTRUCT
    last: [like item] CONSTRUCT
    last_child: [like parent] CONSTRUCT
    left_sibling: [like Current] KEYWORD
    lex_code: INTEGER
    linear_representation: LINEAR [CONSTRUCT]
    object_comparison: BOOLEAN
    occurrences (v: [like item] CONSTRUCT): INTEGER
    parsed: BOOLEAN
    Print_mode: CELL [BOOLEAN]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] KEYWORD
    sequential_occurrences (v: CONSTRUCT): INTEGER
    sublist: [like Current] KEYWORD
    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    token: TOKEN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [CONSTRUCT])
    child_back
    child_extend (v: [like item] CONSTRUCT)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] CONSTRUCT)
    child_put_left (v: [like item] CONSTRUCT)
    child_put_right (v: [like item] CONSTRUCT)
    child_replace (v: [like item] CONSTRUCT)
    child_start
    commit
    compare_objects
    compare_references
    construct_make
    copy (other: [like Current] KEYWORD)
    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
    extend (v: [like item] CONSTRUCT)
    fill (other: TREE [CONSTRUCT])
    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
    force (v: [like item] CONSTRUCT)
    make (s: STRING)
    merge_tree_after (other: [like first_child] CONSTRUCT)
    merge_tree_before (other: [like first_child] CONSTRUCT)
    move (i: INTEGER)
    parse
    print_name
    process
    prune (n: [like first_child] CONSTRUCT)
    prune_all (v: [like item] CONSTRUCT)
    put_child (n: [like parent] CONSTRUCT)
    put_child_left (n: [like parent] CONSTRUCT)
    put_child_right (n: [like parent] CONSTRUCT)
    put_front (v: [like item] CONSTRUCT)
    put_i_th (v: [like item] CONSTRUCT; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] CONSTRUCT)
    replace_child (n: [like parent] CONSTRUCT)
    search_child (v: [like item] CONSTRUCT)
    semantics
    set_optional
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] KEYWORD)
    twl_merge_right (other: [like Current] KEYWORD)
    twl_prune (v: [like item] CONSTRUCT)
    unused_pre_action
    wipe_out


KEYWORD Flat contracts

indexing
    description: "Terminal constructs with just one specimen, representing a language keyword or special symbol"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:56 $"
    revision: "$Revision: 1.3 $"

class interface
    KEYWORD

create

    make (s: STRING)
            -- Set up terminal to represent s.
        ensure
            construct_name = s
            lex_code = document.keyword_code (s)

feature -- Initialization

    make (s: STRING)
            -- Set up terminal to represent s.
        ensure
            construct_name = s
            lex_code = document.keyword_code (s)

    construct_make
            -- Set up construct.
            -- (from CONSTRUCT)

feature -- Access

    construct_name: STRING
            -- Name of the keyword

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    document: INPUT
            -- The document to be parsed
            -- (from CONSTRUCT)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    first_child: like parent
            -- Leftmost child
            -- (from TWO_WAY_TREE)

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: CONSTRUCT
            -- Content of cell.
            -- (from CELL)

    child_item: CONSTRUCT
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    last_child: like parent
            -- (from TWO_WAY_TREE)

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    lex_code: INTEGER
            -- Code of keyword in the lexical anayser

    sequential_occurrences (v: CONSTRUCT): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    token: TOKEN
            -- Token associated with terminal
            -- (from TERMINAL)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    committed: BOOLEAN
            -- Have enough productions been recognized to interpret
            -- failure of parsing as a syntax error in this construct?
            -- (Otherwise the parsing process will backtrack, trying
            -- other possible interpretations of the part already read.)
            -- (from CONSTRUCT)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    has (v: CONSTRUCT): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: CONSTRUCT): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_optional: BOOLEAN
            -- Is construct optional?
            -- (from CONSTRUCT)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    parsed: BOOLEAN
            -- Has construct been successfully parsed?
            -- (True for optional components not present)
            -- (from CONSTRUCT)

    print_mode: CELL [BOOLEAN]
            -- Must the left-recursion test also print the production?
            -- (Default: no.)
            -- (from CONSTRUCT)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_optional
            -- Define this construct as optional.
            -- (from CONSTRUCT)
        ensure -- from CONSTRUCT
            optional_construct: is_optional

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [CONSTRUCT])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [CONSTRUCT])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
            -- Prune n from children.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
            -- (from TWO_WAY_TREE)
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    commit
            -- If this construct is one among several possible ones,
            -- discard the others.
            -- By default this does nothing.
            -- (from CONSTRUCT)

    parse
            -- Attempt to analyze incoming lexical
            -- tokens according to current construct.
            -- Set parsed to true if successful;
            -- return to original position in input otherwise.
            -- (from CONSTRUCT)

    unused_pre_action
            -- Semantic action executed before construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    process
            -- Parse a specimen of the construct, then apply
            -- semantic actions if parsing successful.
            -- (from CONSTRUCT)

    semantics
            -- Apply semantic actions in order:
            -- pre_action, in_action, post_action.
            -- (from CONSTRUCT)

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [CONSTRUCT]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [CONSTRUCT]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from TWO_WAY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    print_name
            -- Print the construct name on standard output.
            -- (from CONSTRUCT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_TREE
    off_constraint: (child = void) implies child_off
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_leaf implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

end -- class KEYWORD


L_INTERFACE Chart

deferred class
    L_INTERFACE

General
    cluster: lex.parse
    description: "Interface with the Lexical Library classes"

Ancestors
    METALEX

Queries
    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
    Ack: INTEGER
    additional_space: INTEGER
    all_default: BOOLEAN
    Ampersand: INTEGER
    analyzer: LEXICAL
    area: SPECIAL [LINKED_LIST [INTEGER]]
    Back_space: INTEGER
    Backslash: INTEGER
    Bar: INTEGER
    Bel: INTEGER
    Blank: INTEGER
    Break: INTEGER
    Bs: INTEGER
    Buf_overflow: INTEGER
    Can: INTEGER
    capacity: INTEGER
    Carriage_return: INTEGER
    Case_diff: INTEGER
    case_sensitive: BOOLEAN
    categories_table: ARRAY [INTEGER]
    changeable_comparison_criterion: BOOLEAN
    Character_set_size: INTEGER
    Circumflex: INTEGER
    Closing_brace: INTEGER
    Colon: INTEGER
    Comma: INTEGER
    Commercial_at: INTEGER
    count: INTEGER
    Cr: INTEGER
    Ctrl_a: INTEGER
    Ctrl_b: INTEGER
    Ctrl_backslash: INTEGER
    Ctrl_c: INTEGER
    Ctrl_circumflex: INTEGER
    Ctrl_d: INTEGER
    Ctrl_e: INTEGER
    Ctrl_f: INTEGER
    Ctrl_g: INTEGER
    Ctrl_h: INTEGER
    Ctrl_i: INTEGER
    Ctrl_j: INTEGER
    Ctrl_k: INTEGER
    Ctrl_l: INTEGER
    Ctrl_lbracket: INTEGER
    Ctrl_m: INTEGER
    Ctrl_n: INTEGER
    Ctrl_o: INTEGER
    Ctrl_p: INTEGER
    Ctrl_q: INTEGER
    Ctrl_questmark: INTEGER
    Ctrl_r: INTEGER
    Ctrl_rbracket: INTEGER
    Ctrl_s: INTEGER
    Ctrl_t: INTEGER
    Ctrl_u: INTEGER
    Ctrl_underlined: INTEGER
    Ctrl_v: INTEGER
    Ctrl_w: INTEGER
    Ctrl_x: INTEGER
    Ctrl_y: INTEGER
    Ctrl_z: INTEGER
    Dc1: INTEGER
    Dc2: INTEGER
    Dc3: INTEGER
    Dc4: INTEGER
    Del: INTEGER
    description: STRING
    dfa: FIXED_DFA
    Dle: INTEGER
    Dollar: INTEGER
    Dot: INTEGER
    Doublequote: INTEGER
    Down_arrow: INTEGER
    Eight: INTEGER
    Em: INTEGER
    Enq: INTEGER
    entry (i: INTEGER): LINKED_LIST [INTEGER]
    Eot: INTEGER
    Equal_sign: INTEGER
    Error_list: ERROR_LIST
    Esc: INTEGER
    Etb: INTEGER
    Etx: INTEGER
    Exclamation: INTEGER
    extendible: BOOLEAN
    final_array: ARRAY [INTEGER]
    First_printable: INTEGER
    Five: INTEGER
    Four: INTEGER
    Fs: INTEGER
    full: BOOLEAN
    Grave_accent: INTEGER
    Greaterthan: INTEGER
    greatest_input: INTEGER
    Growth_percentage: INTEGER
    Gs: INTEGER
    has (v: LINKED_LIST [INTEGER]): BOOLEAN
    has_letters: BOOLEAN
    Home_arrow: INTEGER
    Ht: INTEGER
    index_set: INTEGER_INTERVAL
    initialized: BOOLEAN
    input_array: ARRAY [FIXED_INTEGER_SET]
    is_empty: BOOLEAN
    is_equal (other: [like Current] L_INTERFACE): BOOLEAN
    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
    keyword_h_table: HASH_TABLE [INTEGER, STRING]
    keywords_case_sensitive: BOOLEAN
    keywords_list: LINKED_LIST [STRING]
    Last_ascii: INTEGER
    last_character_code: INTEGER
    last_created_tool: INTEGER
    Last_printable: INTEGER
    Lbracket: INTEGER
    Lcurly: INTEGER
    Left_arrow: INTEGER
    Lessthan: INTEGER
    Letter_layout: INTEGER
    lexical_frozen: BOOLEAN
    Line_feed: INTEGER
    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
    lower: INTEGER
    Lower_a: INTEGER
    Lower_b: INTEGER
    Lower_c: INTEGER
    Lower_d: INTEGER
    Lower_e: INTEGER
    Lower_f: INTEGER
    Lower_g: INTEGER
    Lower_h: INTEGER
    Lower_i: INTEGER
    Lower_j: INTEGER
    Lower_k: INTEGER
    Lower_l: INTEGER
    Lower_m: INTEGER
    Lower_n: INTEGER
    Lower_o: INTEGER
    Lower_p: INTEGER
    Lower_q: INTEGER
    Lower_r: INTEGER
    Lower_s: INTEGER
    Lower_t: INTEGER
    Lower_u: INTEGER
    Lower_v: INTEGER
    Lower_w: INTEGER
    Lower_x: INTEGER
    Lower_y: INTEGER
    Lower_z: INTEGER
    Minimal_increase: INTEGER
    Minus: INTEGER
    Nak: INTEGER
    nb_states: INTEGER
    Nine: INTEGER
    Nl: INTEGER
    No_token: INTEGER
    Np: INTEGER
    Nul: INTEGER
    Number_sign: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
    One: INTEGER
    Opening_brace: INTEGER
    Overflow: INTEGER
    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
    Percent: INTEGER
    Plus: INTEGER
    prunable: BOOLEAN
    Questmark: INTEGER
    Rbracket: INTEGER
    Rcurly: INTEGER
    recognize (s: STRING): INTEGER
    resizable: BOOLEAN
    Right_arrow: INTEGER
    Rs: INTEGER
    same_items (other: [like Current] L_INTERFACE): BOOLEAN
    selected_tools: LINKED_LIST [INTEGER]
    Semicolon: INTEGER
    Seven: INTEGER
    Si: INTEGER
    Singlequote: INTEGER
    Six: INTEGER
    Slash: INTEGER
    So: INTEGER
    Soh: INTEGER
    Sp: INTEGER
    Star: INTEGER
    start_number: INTEGER
    Stx: INTEGER
    Sub: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] L_INTERFACE
    Syn: INTEGER
    Tabulation: INTEGER
    Three: INTEGER
    Tilde: INTEGER
    token_type_list: LINKED_LIST [INTEGER]
    tool_list: LINKED_LIST [PDFA]
    tool_names: LINKED_LIST [STRING]
    Two: INTEGER
    Underlined: INTEGER
    Up_arrow: INTEGER
    upper: INTEGER
    Upper_a: INTEGER
    Upper_b: INTEGER
    Upper_c: INTEGER
    Upper_d: INTEGER
    Upper_e: INTEGER
    Upper_f: INTEGER
    Upper_g: INTEGER
    Upper_h: INTEGER
    Upper_i: INTEGER
    Upper_j: INTEGER
    Upper_k: INTEGER
    Upper_l: INTEGER
    Upper_m: INTEGER
    Upper_n: INTEGER
    Upper_o: INTEGER
    Upper_p: INTEGER
    Upper_q: INTEGER
    Upper_r: INTEGER
    Upper_s: INTEGER
    Upper_t: INTEGER
    Upper_u: INTEGER
    Upper_v: INTEGER
    Upper_w: INTEGER
    Upper_x: INTEGER
    Upper_y: INTEGER
    Upper_z: INTEGER
    Us: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    Vt: INTEGER
    Zero: INTEGER

Commands
    add_keyword (word: STRING)
    add_word (s: STRING; n: INTEGER)
    any_character
    any_printable
    append (p, s: INTEGER)
    append_optional (p, s: INTEGER)
    array_make (min_index, max_index: INTEGER)
    associate (t, n: INTEGER)
    automatic_grow
    build (doc: INPUT)
    build_dollar_any
    build_dollar_b
    build_dollar_n
    build_dollar_p
    build_dollar_r
    build_dollar_z
    case_insensitive (c: INTEGER)
    clear_all
    compare_objects
    compare_references
    construct_dfa
    copy (other: [like Current] L_INTERFACE)
    delete_transition (source, input_doc, target: INTEGER)
    difference (r: INTEGER; c: CHARACTER)
    discard_items
    distinguish_case
    enter (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
    force (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    grow (i: INTEGER)
    ignore_case
    include (fa: PDFA; shift: INTEGER)
    initialize
    interval (b, e: CHARACTER)
    iteration (c: INTEGER)
    iteration1 (c: INTEGER)
    iteration_n (n, c: INTEGER)
    keywords_distinguish_case
    keywords_ignore_case
    make_analyzer
    make_extended (char_code: INTEGER)
    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
    metalex_make
    obtain_analyzer
    optional (c: INTEGER)
    pdfa_make (n, i: INTEGER)
    pdfa_put (v: [like item] LINKED_LIST [INTEGER]; i: INTEGER)
    prepend_optional (p, s: INTEGER)
    prune_all (v: LINKED_LIST [INTEGER])
    put_expression (s: STRING; n: INTEGER; c: STRING)
    put_keyword (s: STRING; exp: INTEGER)
    put_nameless_expression (s: STRING; n: INTEGER)
    read_grammar (token_file_name: STRING)
    remove
    remove_case_sensitiveness
    resize (min_index, max_index: INTEGER)
    retrieve_analyzer (file_name: STRING)
    select_tool (i: INTEGER)
    set_e_transition (source, target: INTEGER)
    set_final (s, r: INTEGER)
    set_letters
    set_start (n: INTEGER)
    set_transition (source, input_doc, target: INTEGER)
    set_word (word: STRING)
    store_analyzer (file_name: STRING)
    subcopy (other: [like Current] L_INTERFACE; start_pos, end_pos, index_pos: INTEGER)
    trace
    union (a, b: INTEGER)
    union2 (a, b: INTEGER)
    up_to (word: STRING)


L_INTERFACE Flat contracts

indexing
    description: "Interface with the Lexical Library classes"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:56 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    L_INTERFACE

feature -- Initialization

    build (doc: INPUT)
            -- Create lexical analyzer and set doc
            -- to be the input document.
        require
            document_exists: doc /= void

    initialize
            -- Set up attributes of analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            initialized

    metalex_make
            -- Set up the analyzer.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = last_ascii

    pdfa_make (n, i: INTEGER)
            -- Make a PDFA with n states, and i + 1 inputs.
            -- (from PDFA)

    array_make (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_analyzer
            -- Create analyzer (if Void) and initialize it.
            -- (from METALEX)
        require -- from METALEX
            not_initialized: not initialized
        ensure -- from METALEX
            initialized
            analyzer_created: analyzer /= void
            lexical_frozen

    make_extended (char_code: INTEGER)
            -- Set up the analyzer with char_code as 'last_character_code'.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            valid_char_code: char_code > 0
        ensure -- from LEX_BUILDER
            last_character_set: last_character_code = char_code

    make_from_array (a: ARRAY [LINKED_LIST [INTEGER]])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

    obtain_analyzer
            -- Build lexical analyzer.
        ensure
            analyzer /= void

feature -- Access

    Ack: INTEGER is 6
            -- (from ASCII)

    Ampersand: INTEGER is 38
            -- (from ASCII)

    analyzer: LEXICAL
            -- The lexical analyzer built so far
            -- (from LEX_BUILDER)

    area: SPECIAL [LINKED_LIST [INTEGER]]
            -- Special data zone
            -- (from TO_SPECIAL)

    Back_space: INTEGER is 8
            -- (from ASCII)

    Backslash: INTEGER is 92
            -- (from ASCII)

    Bar: INTEGER is 124
            -- (from ASCII)

    Bel: INTEGER is 7
            -- (from ASCII)

    Blank: INTEGER is 32
            -- (from ASCII)

    Break: INTEGER is -7
            -- (from ASCII)

    Bs: INTEGER is 8
            -- (from ASCII)

    Buf_overflow: INTEGER is -9
            -- (from ASCII)

    Can: INTEGER is 24
            -- (from ASCII)

    Carriage_return: INTEGER is 13
            -- (from ASCII)

    Case_diff: INTEGER is 32
            -- Lower_a - Upper_a
            -- (from ASCII)

    case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive?
            -- (from LEX_BUILDER)

    categories_table: ARRAY [INTEGER]
            -- Table of category numbers for each input
            -- (from LEX_BUILDER)

    Character_set_size: INTEGER is 128
            -- (from ASCII)

    Circumflex: INTEGER is 94
            -- (from ASCII)

    Closing_brace: INTEGER is 125
            -- (from ASCII)

    Colon: INTEGER is 58
            -- (from ASCII)

    Comma: INTEGER is 44
            -- (from ASCII)

    Commercial_at: INTEGER is 64
            -- (from ASCII)

    Cr: INTEGER is 13
            -- (from ASCII)

    Ctrl_a: INTEGER is 1
            -- (from ASCII)

    Ctrl_b: INTEGER is 2
            -- (from ASCII)

    Ctrl_backslash: INTEGER is 28
            -- (from ASCII)

    Ctrl_c: INTEGER is 3
            -- (from ASCII)

    Ctrl_circumflex: INTEGER is 30
            -- (from ASCII)

    Ctrl_d: INTEGER is 4
            -- (from ASCII)

    Ctrl_e: INTEGER is 5
            -- (from ASCII)

    Ctrl_f: INTEGER is 6
            -- (from ASCII)

    Ctrl_g: INTEGER is 7
            -- (from ASCII)

    Ctrl_h: INTEGER is 8
            -- (from ASCII)

    Ctrl_i: INTEGER is 9
            -- (from ASCII)

    Ctrl_j: INTEGER is 10
            -- (from ASCII)

    Ctrl_k: INTEGER is 11
            -- (from ASCII)

    Ctrl_l: INTEGER is 12
            -- (from ASCII)

    Ctrl_lbracket: INTEGER is 27
            -- (from ASCII)

    Ctrl_m: INTEGER is 13
            -- (from ASCII)

    Ctrl_n: INTEGER is 14
            -- (from ASCII)

    Ctrl_o: INTEGER is 15
            -- (from ASCII)

    Ctrl_p: INTEGER is 16
            -- (from ASCII)

    Ctrl_q: INTEGER is 17
            -- (from ASCII)

    Ctrl_questmark: INTEGER is 127
            -- (from ASCII)

    Ctrl_r: INTEGER is 18
            -- (from ASCII)

    Ctrl_rbracket: INTEGER is 29
            -- (from ASCII)

    Ctrl_s: INTEGER is 19
            -- (from ASCII)

    Ctrl_t: INTEGER is 20
            -- (from ASCII)

    Ctrl_u: INTEGER is 21
            -- (from ASCII)

    Ctrl_underlined: INTEGER is 31
            -- (from ASCII)

    Ctrl_v: INTEGER is 22
            -- (from ASCII)

    Ctrl_w: INTEGER is 23
            -- (from ASCII)

    Ctrl_x: INTEGER is 24
            -- (from ASCII)

    Ctrl_y: INTEGER is 25
            -- (from ASCII)

    Ctrl_z: INTEGER is 26
            -- (from ASCII)

    Dc1: INTEGER is 17
            -- (from ASCII)

    Dc2: INTEGER is 18
            -- (from ASCII)

    Dc3: INTEGER is 19
            -- (from ASCII)

    Dc4: INTEGER is 20
            -- (from ASCII)

    Del: INTEGER is 127
            -- (from ASCII)

    dfa: FIXED_DFA
            -- DFA built by routine construct_dfa,
            -- which recognizes the same language.
            -- (from NDFA)

    Dle: INTEGER is 16
            -- (from ASCII)

    Dollar: INTEGER is 36
            -- (from ASCII)

    Dot: INTEGER is 46
            -- (from ASCII)

    Doublequote: INTEGER is 34
            -- (from ASCII)

    Down_arrow: INTEGER is -3
            -- (from ASCII)

    Eight: INTEGER is 56
            -- (from ASCII)

    Em: INTEGER is 25
            -- (from ASCII)

    Enq: INTEGER is 5
            -- (from ASCII)

    entry (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    Eot: INTEGER is 4
            -- (from ASCII)

    Equal_sign: INTEGER is 61
            -- (from ASCII)

    error_list: ERROR_LIST
            -- List of error messages
            -- (from LEX_BUILDER)

    Esc: INTEGER is 27
            -- (from ASCII)

    Etb: INTEGER is 23
            -- (from ASCII)

    Etx: INTEGER is 3
            -- (from ASCII)

    Exclamation: INTEGER is 33
            -- (from ASCII)

    final_array: ARRAY [INTEGER]
            -- The final value for each state
            -- (regular expression, if any, for which it is final).
            -- (from PDFA)

    First_printable: INTEGER is 32
            -- (from ASCII)

    Five: INTEGER is 53
            -- (from ASCII)

    Four: INTEGER is 52
            -- (from ASCII)

    Fs: INTEGER is 28
            -- (from ASCII)

    Grave_accent: INTEGER is 96
            -- (from ASCII)

    Greaterthan: INTEGER is 62
            -- (from ASCII)

    greatest_input: INTEGER
            -- Greatest input used for the transitions from state
            -- to state (the smallest one is zero)
            -- (from AUTOMATON)

    Gs: INTEGER is 29
            -- (from ASCII)

    has (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_letters: BOOLEAN
            -- Are there any letters among the active transitions?
            -- (from PDFA)

    Home_arrow: INTEGER is -6
            -- (from ASCII)

    Ht: INTEGER is 9
            -- (from ASCII)

    input_array: ARRAY [FIXED_INTEGER_SET]
            -- For each input, set of the states which have
            -- a transition on this input to the following state
            -- (from PDFA)

    pdfa_item (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    keyword_h_table: HASH_TABLE [INTEGER, STRING]
            -- Keyword table
            -- (from LEX_BUILDER)

    keywords_case_sensitive: BOOLEAN
            -- Will future tools be case-sensitive for keywords?
            -- (from LEX_BUILDER)

    keywords_list: LINKED_LIST [STRING]
            -- Keywords associated with current automaton.
            -- (from PDFA)

    Last_ascii: INTEGER is 127
            -- (from ASCII)

    last_character_code: INTEGER
            -- Last character code recognized by the language
            -- (from LEX_BUILDER)

    last_created_tool: INTEGER
            -- Identification number of the last
            -- regular expression put in tool_list
            -- (from LEX_BUILDER)

    Last_printable: INTEGER is 126
            -- (from ASCII)

    Lbracket: INTEGER is 91
            -- (from ASCII)

    Lcurly: INTEGER is 40
            -- (from ASCII)

    Left_arrow: INTEGER is -4
            -- (from ASCII)

    Lessthan: INTEGER is 60
            -- (from ASCII)

    Letter_layout: INTEGER is 70
            -- (from ASCII)

    lexical_frozen: BOOLEAN
            -- Has the lexical grammar been finalized?
            -- | (in other words: has the DFA been built?)
            -- (from LEX_BUILDER)

    Line_feed: INTEGER is 10
            -- (from ASCII)

    Lower_a: INTEGER is 97
            -- (from ASCII)

    Lower_b: INTEGER is 98
            -- (from ASCII)

    Lower_c: INTEGER is 99
            -- (from ASCII)

    Lower_d: INTEGER is 100
            -- (from ASCII)

    Lower_e: INTEGER is 101
            -- (from ASCII)

    Lower_f: INTEGER is 102
            -- (from ASCII)

    Lower_g: INTEGER is 103
            -- (from ASCII)

    Lower_h: INTEGER is 104
            -- (from ASCII)

    Lower_i: INTEGER is 105
            -- (from ASCII)

    Lower_j: INTEGER is 106
            -- (from ASCII)

    Lower_k: INTEGER is 107
            -- (from ASCII)

    Lower_l: INTEGER is 108
            -- (from ASCII)

    Lower_m: INTEGER is 109
            -- (from ASCII)

    Lower_n: INTEGER is 110
            -- (from ASCII)

    Lower_o: INTEGER is 111
            -- (from ASCII)

    Lower_p: INTEGER is 112
            -- (from ASCII)

    Lower_q: INTEGER is 113
            -- (from ASCII)

    Lower_r: INTEGER is 114
            -- (from ASCII)

    Lower_s: INTEGER is 115
            -- (from ASCII)

    Lower_t: INTEGER is 116
            -- (from ASCII)

    Lower_u: INTEGER is 117
            -- (from ASCII)

    Lower_v: INTEGER is 118
            -- (from ASCII)

    Lower_w: INTEGER is 119
            -- (from ASCII)

    Lower_x: INTEGER is 120
            -- (from ASCII)

    Lower_y: INTEGER is 121
            -- (from ASCII)

    Lower_z: INTEGER is 122
            -- (from ASCII)

    Minus: INTEGER is 45
            -- (from ASCII)

    Nak: INTEGER is 21
            -- (from ASCII)

    Nine: INTEGER is 57
            -- (from ASCII)

    Nl: INTEGER is 10
            -- (from ASCII)

    Np: INTEGER is 12
            -- (from ASCII)

    Nul: INTEGER is 0
            -- (from ASCII)

    Number_sign: INTEGER is 35
            -- (from ASCII)

    One: INTEGER is 49
            -- (from ASCII)

    Opening_brace: INTEGER is 123
            -- (from ASCII)

    Overflow: INTEGER is -8
            -- (from ASCII)

    Percent: INTEGER is 37
            -- (from ASCII)

    Plus: INTEGER is 43
            -- (from ASCII)

    Questmark: INTEGER is 63
            -- (from ASCII)

    Rbracket: INTEGER is 93
            -- (from ASCII)

    Rcurly: INTEGER is 41
            -- (from ASCII)

    Right_arrow: INTEGER is -5
            -- (from ASCII)

    Rs: INTEGER is 30
            -- (from ASCII)

    selected_tools: LINKED_LIST [INTEGER]
            -- Regular expressions included in the main one
            -- (from LEX_BUILDER)

    Semicolon: INTEGER is 59
            -- (from ASCII)

    Seven: INTEGER is 55
            -- (from ASCII)

    Si: INTEGER is 15
            -- (from ASCII)

    Singlequote: INTEGER is 39
            -- (from ASCII)

    Six: INTEGER is 54
            -- (from ASCII)

    Slash: INTEGER is 47
            -- (from ASCII)

    So: INTEGER is 14
            -- (from ASCII)

    Soh: INTEGER is 1
            -- (from ASCII)

    Sp: INTEGER is 32
            -- (from ASCII)

    Star: INTEGER is 42
            -- (from ASCII)

    start_number: INTEGER
            -- Unique start state used for the beginning of
            -- the automaton's operation
            -- (from AUTOMATON)

    Stx: INTEGER is 2
            -- (from ASCII)

    Sub: INTEGER is 26
            -- (from ASCII)

    Syn: INTEGER is 22
            -- (from ASCII)

    Tabulation: INTEGER is 9
            -- (from ASCII)

    Three: INTEGER is 51
            -- (from ASCII)

    Tilde: INTEGER is 126
            -- (from ASCII)

    token_type_list: LINKED_LIST [INTEGER]
            -- Token types of the selected tools.
            -- Indexed by tool numbers.
            -- (from LEX_BUILDER)

    tool_list: LINKED_LIST [PDFA]
            -- Regular expressions used as auxiliary tools
            -- (from LEX_BUILDER)

    tool_names: LINKED_LIST [STRING]
            -- Names of regular expressions in tool list
            -- (from LEX_BUILDER)

    Two: INTEGER is 50
            -- (from ASCII)

    Underlined: INTEGER is 95
            -- (from ASCII)

    Up_arrow: INTEGER is -2
            -- (from ASCII)

    Upper_a: INTEGER is 65
            -- (from ASCII)

    Upper_b: INTEGER is 66
            -- (from ASCII)

    Upper_c: INTEGER is 67
            -- (from ASCII)

    Upper_d: INTEGER is 68
            -- (from ASCII)

    Upper_e: INTEGER is 69
            -- (from ASCII)

    Upper_f: INTEGER is 70
            -- (from ASCII)

    Upper_g: INTEGER is 71
            -- (from ASCII)

    Upper_h: INTEGER is 72
            -- (from ASCII)

    Upper_i: INTEGER is 73
            -- (from ASCII)

    Upper_j: INTEGER is 74
            -- (from ASCII)

    Upper_k: INTEGER is 75
            -- (from ASCII)

    Upper_l: INTEGER is 76
            -- (from ASCII)

    Upper_m: INTEGER is 77
            -- (from ASCII)

    Upper_n: INTEGER is 78
            -- (from ASCII)

    Upper_o: INTEGER is 79
            -- (from ASCII)

    Upper_p: INTEGER is 80
            -- (from ASCII)

    Upper_q: INTEGER is 81
            -- (from ASCII)

    Upper_r: INTEGER is 82
            -- (from ASCII)

    Upper_s: INTEGER is 83
            -- (from ASCII)

    Upper_t: INTEGER is 84
            -- (from ASCII)

    Upper_u: INTEGER is 85
            -- (from ASCII)

    Upper_v: INTEGER is 86
            -- (from ASCII)

    Upper_w: INTEGER is 87
            -- (from ASCII)

    Upper_x: INTEGER is 88
            -- (from ASCII)

    Upper_y: INTEGER is 89
            -- (from ASCII)

    Upper_z: INTEGER is 90
            -- (from ASCII)

    Us: INTEGER is 31
            -- (from ASCII)

    Vt: INTEGER is 11
            -- (from ASCII)

    Zero: INTEGER is 48
            -- (from ASCII)

    infix "@" (i: INTEGER): LINKED_LIST [INTEGER]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    nb_states: INTEGER
            -- Number of states in the automaton
            -- (from AUTOMATON)

    occurrences (v: LINKED_LIST [INTEGER]): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((pdfa_item (upper) = void or else pdfa_item (upper) = pdfa_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: LINKED_LIST [INTEGER]): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (pdfa_item (upper) = other.pdfa_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    distinguish_case
            -- Make letter case significant in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            case_sensitive

    ignore_case
            -- Make letter case not significant in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        ensure -- from LEX_BUILDER
            not case_sensitive

    keywords_distinguish_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- Default is ignore case.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tool_built: tool_list.is_empty
        ensure -- from LEX_BUILDER
            keywords_case_sensitive

    keywords_ignore_case
            -- Make letter case not significant for keywords
            -- in future tools.
            -- This is the default.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            no_tools_built: tool_list = void or else tool_list.is_empty
        ensure -- from LEX_BUILDER
            not keywords_case_sensitive

    set_e_transition (source, target: INTEGER)
            -- Set epsilon transition from source to target.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states

    set_final (s, r: INTEGER)
            -- Make s the final state of regular expression r.
            -- (from PDFA)

    set_letters
            -- Direct the active transitions to include letters.
            -- (from PDFA)

    set_start (n: INTEGER)
            -- Select state n as the starting state.
            -- (from AUTOMATON)
        require -- from AUTOMATON
            no_other_start: start_number = 0 or start_number = n
            is_in_automaton: n <= nb_states and n >= 1

    set_transition (source, input_doc, target: INTEGER)
            -- Set transition from source to target on input_doc.
            -- (from PDFA)
        require -- from  AUTOMATON
            True
        require else -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

feature -- Element change

    add_keyword (word: STRING)
            -- Insert word in the keyword list.
            -- (from PDFA)

    add_word (s: STRING; n: INTEGER)
            -- Record the word s and
            -- associate it with token type n.
            -- (from METALEX)
        require -- from METALEX
            s_not_void: s /= void
            s_not_empty: s.capacity >= 1

    any_character
            -- Create regular expression $. matching all characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    any_printable
            -- Create regular expression $P matching all
            -- printable characters.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen

    append (p, s: INTEGER)
            -- Create regular expression ps:
            -- s appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    append_optional (p, s: INTEGER)
            -- Create regular expression p[s]:
            -- s optionally appended to p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    associate (t, n: INTEGER)
            -- Associate the t-th tool with token type n.
            -- If this routine is not used, the default value is t.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            t_selected: selected_tools.has (t)
            n_not_zero: n /= 0
            n_not_minus_one: n /= - 1

    build_dollar_any
            -- Build $., matching any character.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            good_first_character: description.item (cursor) = '.'

    build_dollar_b
            -- Build $B, matching any number of break characters:
            -- blank, new-line, tabulation, carriage-return.
            -- (from HIGH_BUILDER)

    build_dollar_n
            -- Build $N, matching natural integer constants.
            -- +('0'..'9')
            -- (from HIGH_BUILDER)

    build_dollar_p
            -- Build $P, matching any printable character.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            good_first_character: description.item (cursor) = 'P'

    build_dollar_r
            -- Build $R, matching floating point constants.
            -- ['+' | '-'] +('0'..'9') '.' *('0'..'9') ['e' | 'E' ['+' | '-']
            -- +('0'..'9')]
            -- (from HIGH_BUILDER)

    build_dollar_z
            -- Build $Z, matching possibly signed integer constants.
            -- ['+' | '-'] +('0'..'9')
            -- (from HIGH_BUILDER)

    case_insensitive (c: INTEGER)
            -- Create regular expression ~(c):
            -- like c, but case-insensitive.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            z_possible: last_character_code >= lower_z
            c_in_tool: c >= 1 and c <= last_created_tool

    difference (r: INTEGER; c: CHARACTER)
            -- Create regular expression representing
            -- the difference r - c.
            -- r must be a simple category, such as a..z,
            -- or a union of simple categories,
            -- such as a..z | 0..9.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            r_exists: r >= 1 and r <= last_created_tool
            r_simple_category: tool_list.i_th (r).nb_states = 2

    enter (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [LINKED_LIST [INTEGER]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like pdfa_item; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: pdfa_item (i) = v
            higher_count: count >= old count

    include (fa: PDFA; shift: INTEGER)
            -- Copy fa with state numbers shifted
            -- by shift positions in the transitions.
            -- Do not preserve the final values.
            -- (from PDFA)
        require -- from PDFA
            same_inputs: greatest_input = fa.greatest_input
            nb_states_large_enough: nb_states >= fa.nb_states + shift

    interval (b, e: CHARACTER)
            -- Create regular expression b..e, or b if b = e.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_built: not lexical_frozen
            e_code_small_enough: e.code <= last_character_code
            b_code_large_enough: b.code >= 0
            b_before_e: b.code <= e.code

    iteration (c: INTEGER)
            -- Create regular expression *(c): zero or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration1 (c: INTEGER)
            -- Create regular expression +(c): one or more
            -- consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    iteration_n (n, c: INTEGER)
            -- Create regular expression n(c):
            -- exactly n consecutive occurrences of c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            n_large_enough: n > 0
            c_in_tool: c >= 1 and c <= last_created_tool

    optional (c: INTEGER)
            -- Create regular expression [c]:
            -- optional c.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            c_in_tool: c >= 1 and c <= last_created_tool

    prepend_optional (p, s: INTEGER)
            -- Create regular expression [p]s:
            -- s appended to optional p.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            p_in_tool: p >= 1 and p <= last_created_tool
            s_in_tool: s >= 1 and s <= last_created_tool

    pdfa_put (v: like pdfa_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: pdfa_item (k) = v

    put_expression (s: STRING; n: INTEGER; c: STRING)
            -- Record the regular expression described by s
            -- and associate it with token type n and name c.
            -- (from METALEX)
        require -- from METALEX
            source_long_enough: s.capacity > 0

    put_keyword (s: STRING; exp: INTEGER)
            -- Declare s as a keyword described by
            -- the regular expression of code exp.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            exp_selected: token_type_list /= void and then token_type_list.has (exp)

    put_nameless_expression (s: STRING; n: INTEGER)
            -- Record the regular expression described
            -- by s, and associate it with token type n.
            -- (from HIGH_BUILDER)
        require -- from HIGH_BUILDER
            source_long_enough: s.count > 0

    recognize (s: STRING): INTEGER
            -- Token_type of s; 0 if not recognized
            -- (from LEX_BUILDER)

    remove_case_sensitiveness
            -- Remove case sensitiveness.
            -- (from PDFA)
        require -- from PDFA
            z_possible: greatest_input >= lower_z

    select_tool (i: INTEGER)
            -- Select the i_th tool for inclusion in the main
            -- regular expression.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            i_exist: i > 0 and i <= last_created_tool
        ensure -- from LEX_BUILDER
            i_selected: selected_tools.has (i)

    set_word (word: STRING)
            -- Create regular expression for word:
            -- synonym for concatenation (w o r d).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count >= 1

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

    union (a, b: INTEGER)
            -- Create regular expression for the multiple union
            -- a | a+1 | .. | b: matches any occurrence of
            -- a, or a+1, .., or b.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_not_too_small: a >= 1
            b_not_too_large: b <= last_created_tool
            a_smaller_than_b: a <= b

    union2 (a, b: INTEGER)
            -- Create regular expression a | b: union of
            -- a and b (matches an occurrence of a or b)).
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            a_in_tool: a >= 1 and a <= last_created_tool
            b_in_tool: b >= 1 and b <= last_created_tool

    up_to (word: STRING)
            -- Create regular expression ->"word", which is a
            -- set of any number of any characters ended by "word".
            -- Example: "/* C comment */" matches (->"*/").
            -- The difference between (+$. '*' '/') and
            -- (->"*/") is that "*/..*/..*/" matches
            -- the first but not the second.
            -- The difference between
            -- ((($.-'*') | ('*'($.-'/'))) +('*' '/') )
            -- and "(->"*/")" is that "..**/" matches
            -- the second but not the first.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            word_not_empty: word.count > 0
            not_frozen: not lexical_frozen

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    delete_transition (source, input_doc, target: INTEGER)
            -- Delete transition from source to target on input_doc.
            -- (from PDFA)
        require -- from NDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
        require else -- from PDFA
            source_in_automaton: source >= 1 and source <= nb_states
            target_in_automaton: target >= 1 and target <= nb_states
            possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
            good_successor: target = source + 1

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: LINKED_LIST [INTEGER])
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove the last regular expression
            -- from the tool list.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            not_frozen: not lexical_frozen
            at_least_one_regular: last_created_tool >= 1

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Transformation

    construct_dfa
            -- Create an equivalent deterministic finite automaton.
            -- (from NDFA)
        require -- from NDFA
            start_number_designated: start_number > 0

feature -- Conversion

    linear_representation: LINEAR [LINKED_LIST [INTEGER]]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Implementation

    description: STRING
            -- Description of the regular expression
            -- (from HIGH_BUILDER)

    initialized: BOOLEAN
            -- Is analyzer initialized?
            -- (from LEX_BUILDER)

feature -- Input

    No_token: INTEGER is 0
            -- (from METALEX)

    read_grammar (token_file_name: STRING)
            -- Create lexical analyzer for grammar in file of name
            -- token_file_name. File structure:
            -- One or more lines of the form
            -- name  regular_expression
            -- then a line beginning with two dashes --
            -- then zero or more lines containing one keyword each.
            -- (from METALEX)
        ensure -- from METALEX
            analyzer_exists: analyzer /= void

feature  -- Input

    retrieve_analyzer (file_name: STRING)
            -- Retrieve analyzer from file named file_name.
            -- (from LEX_BUILDER)

feature  -- Output

    store_analyzer (file_name: STRING)
            -- Store analyzer in file named file_name.
            -- (from LEX_BUILDER)
        require -- from LEX_BUILDER
            initialized: initialized

feature -- Output

    trace
            -- Output an internal representation
            -- of the current automaton.
            -- (from PDFA)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from HIGH_BUILDER
    cursor_not_too_far: cursor <= description_length
        -- from LEX_BUILDER
    last_created: tool_list = void or else last_created_tool = tool_list.count
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class L_INTERFACE


REPETITION Chart

deferred class
    REPETITION

General
    cluster: lex.parse
    description: "Constructs whose specimens are sequences of specimens of a specified base construct, delimited by a specified separator"

Ancestors
    CONSTRUCT

Queries
    infix "@" (i: INTEGER): [like item] CONSTRUCT
    arity: INTEGER
    binary_representation: BINARY_TREE [CONSTRUCT]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] CONSTRUCT
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: CONSTRUCT
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    committed: BOOLEAN
    construct_name: STRING
    count: INTEGER
    Document: INPUT
    duplicate (n: INTEGER): [like Current] REPETITION
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] CONSTRUCT
    first_child: [like parent] CONSTRUCT
    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    has (v: CONSTRUCT): BOOLEAN
    i_th (i: INTEGER): [like item] CONSTRUCT
    index_of (v: [like item] CONSTRUCT; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] REPETITION): BOOLEAN
    is_inserted (v: CONSTRUCT): BOOLEAN
    is_optional: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] CONSTRUCT): BOOLEAN
    item: CONSTRUCT
    last: [like item] CONSTRUCT
    last_child: [like parent] CONSTRUCT
    left_recursion: BOOLEAN
    left_sibling: [like Current] REPETITION
    linear_representation: LINEAR [CONSTRUCT]
    no_components: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: [like item] CONSTRUCT): INTEGER
    parsed: BOOLEAN
    Print_mode: CELL [BOOLEAN]
    production: LINKED_LIST [CONSTRUCT]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] REPETITION
    sequential_occurrences (v: CONSTRUCT): INTEGER
    sublist: [like Current] REPETITION
    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [CONSTRUCT])
    child_back
    child_extend (v: [like item] CONSTRUCT)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] CONSTRUCT)
    child_put_left (v: [like item] CONSTRUCT)
    child_put_right (v: [like item] CONSTRUCT)
    child_replace (v: [like item] CONSTRUCT)
    child_start
    commit
    compare_objects
    compare_references
    copy (other: [like Current] REPETITION)
    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
    extend (v: [like item] CONSTRUCT)
    fill (other: TREE [CONSTRUCT])
    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
    force (v: [like item] CONSTRUCT)
    make
    merge_tree_after (other: [like first_child] CONSTRUCT)
    merge_tree_before (other: [like first_child] CONSTRUCT)
    move (i: INTEGER)
    parse
    post_action
    pre_action
    print_name
    process
    prune (n: [like first_child] CONSTRUCT)
    prune_all (v: [like item] CONSTRUCT)
    put_child (n: [like parent] CONSTRUCT)
    put_child_left (n: [like parent] CONSTRUCT)
    put_child_right (n: [like parent] CONSTRUCT)
    put_front (v: [like item] CONSTRUCT)
    put_i_th (v: [like item] CONSTRUCT; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] CONSTRUCT)
    replace_child (n: [like parent] CONSTRUCT)
    search_child (v: [like item] CONSTRUCT)
    semantics
    set_optional
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] REPETITION)
    twl_merge_right (other: [like Current] REPETITION)
    twl_prune (v: [like item] CONSTRUCT)
    wipe_out


REPETITION Flat contracts

indexing
    description: "Constructs whose specimens are sequences of specimens of a specified base construct, delimited by a specified separator"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:56 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    REPETITION

feature -- Initialization

    make
            -- Set up construct.
            -- (from CONSTRUCT)

feature -- Access

    construct_name: STRING
            -- Name of the construct in the grammar
            -- (from CONSTRUCT)

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    document: INPUT
            -- The document to be parsed
            -- (from CONSTRUCT)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not no_components

    first_child: like parent
            -- Leftmost child
            -- (from TWO_WAY_TREE)

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    child_item: CONSTRUCT
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    item: CONSTRUCT
            -- Content of cell.
            -- (from CELL)

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not no_components

    last_child: like parent
            -- (from TWO_WAY_TREE)

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: CONSTRUCT): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    production: LINKED_LIST [CONSTRUCT]
            -- Right-hand side of the production for the construct
            -- (from CONSTRUCT)

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not no_components
        ensure -- from TREE
            not_is_leaf: Result implies not no_components

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not no_components
        ensure -- from TREE
            not_is_leaf: Result implies not no_components

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    committed: BOOLEAN
            -- Have enough productions been recognized to interpret
            -- failure of parsing as a syntax error in this construct?
            -- (Otherwise the parsing process will backtrack, trying
            -- other possible interpretations of the part already read.)
            -- (from CONSTRUCT)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: CONSTRUCT): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not no_components

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: CONSTRUCT): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    no_components: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_optional: BOOLEAN
            -- Is construct optional?
            -- (from CONSTRUCT)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    left_recursion: BOOLEAN
            -- Is the construct's definition left-recursive?

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    parsed: BOOLEAN
            -- Has construct been successfully parsed?
            -- (True for optional components not present)
            -- (from CONSTRUCT)

    print_mode: CELL [BOOLEAN]
            -- Must the left-recursion test also print the production?
            -- (Default: no.)
            -- (from CONSTRUCT)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_optional
            -- Define this construct as optional.
            -- (from CONSTRUCT)
        ensure -- from CONSTRUCT
            optional_construct: is_optional

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not no_components implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: no_components implies child_before
        ensure then -- from TREE
            is_last_child: not no_components implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not no_components implies child_isfirst
        ensure then -- from TREE
            is_first_child: not no_components implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: no_components implies child_after

feature -- Element change

    append (s: SEQUENCE [CONSTRUCT])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [CONSTRUCT])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.no_components
        ensure then -- from DYNAMIC_LIST
            other_empty: other.no_components

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.no_components
        ensure then -- from DYNAMIC_LIST
            other_empty: other.no_components

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
            -- Prune n from children.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
            -- (from TWO_WAY_TREE)
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: no_components implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: no_components
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    commit
            -- If this construct is one among several possible ones,
            -- discard the others.
            -- By default this does nothing.
            -- (from CONSTRUCT)

    parse
            -- Attempt to analyze incoming lexical
            -- tokens according to current construct.
            -- Set parsed to true if successful;
            -- return to original position in input otherwise.
            -- (from CONSTRUCT)

    post_action
            -- Semantic action executed after construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    pre_action
            -- Semantic action executed before construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    process
            -- Parse a specimen of the construct, then apply
            -- semantic actions if parsing successful.
            -- (from CONSTRUCT)

    semantics
            -- Apply semantic actions in order:
            -- pre_action, in_action, post_action.
            -- (from CONSTRUCT)

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [CONSTRUCT]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [CONSTRUCT]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from TWO_WAY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    print_name
            -- Print the construct name on standard output.
            -- (from CONSTRUCT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_TREE
    off_constraint: (child = void) implies child_off
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: no_components = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not no_components and child_index = 1)
    child_islast_definition: child_islast = (not no_components and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not no_components implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: no_components implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies no_components
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not no_components) and (child_index = 1))
    islast_definition: child_islast = ((not no_components) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: no_components implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: no_components implies child_off
        -- from FINITE
    empty_definition: no_components = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

end -- class REPETITION


TERMINAL Chart

deferred class
    TERMINAL

General
    cluster: lex.parse
    description: "Constructs to be parsed by lexical analysis classes"

Ancestors
    CONSTRUCT

Queries
    infix "@" (i: INTEGER): [like item] CONSTRUCT
    arity: INTEGER
    binary_representation: BINARY_TREE [CONSTRUCT]
    changeable_comparison_criterion: BOOLEAN
    child: [like first_element] CONSTRUCT
    child_after: BOOLEAN
    child_before: BOOLEAN
    child_capacity: INTEGER
    child_cursor: CURSOR
    Child_extendible: BOOLEAN
    child_index: INTEGER
    child_isfirst: BOOLEAN
    child_islast: BOOLEAN
    child_item: CONSTRUCT
    child_off: BOOLEAN
    child_readable: BOOLEAN
    child_writable: BOOLEAN
    committed: BOOLEAN
    construct_name: STRING
    count: INTEGER
    Document: INPUT
    duplicate (n: INTEGER): [like Current] TERMINAL
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] CONSTRUCT
    first_child: [like parent] CONSTRUCT
    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    has (v: CONSTRUCT): BOOLEAN
    i_th (i: INTEGER): [like item] CONSTRUCT
    index_of (v: [like item] CONSTRUCT; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TERMINAL): BOOLEAN
    is_inserted (v: CONSTRUCT): BOOLEAN
    is_leaf: BOOLEAN
    is_optional: BOOLEAN
    is_root: BOOLEAN
    is_sibling (other: [like parent] CONSTRUCT): BOOLEAN
    item: CONSTRUCT
    last: [like item] CONSTRUCT
    last_child: [like parent] CONSTRUCT
    left_sibling: [like Current] TERMINAL
    linear_representation: LINEAR [CONSTRUCT]
    object_comparison: BOOLEAN
    occurrences (v: [like item] CONSTRUCT): INTEGER
    parsed: BOOLEAN
    Print_mode: CELL [BOOLEAN]
    prunable: BOOLEAN
    Readable: BOOLEAN
    readable_child: BOOLEAN
    right_sibling: [like Current] TERMINAL
    sequential_occurrences (v: CONSTRUCT): INTEGER
    sublist: [like Current] TERMINAL
    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
    token: TOKEN
    token_type: INTEGER
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    Writable: BOOLEAN
    writable_child: BOOLEAN

Commands
    append (s: SEQUENCE [CONSTRUCT])
    child_back
    child_extend (v: [like item] CONSTRUCT)
    child_finish
    child_forth
    child_go_i_th (i: INTEGER)
    child_go_to (p: CURSOR)
    child_put (v: [like item] CONSTRUCT)
    child_put_left (v: [like item] CONSTRUCT)
    child_put_right (v: [like item] CONSTRUCT)
    child_replace (v: [like item] CONSTRUCT)
    child_start
    commit
    compare_objects
    compare_references
    copy (other: [like Current] TERMINAL)
    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
    extend (v: [like item] CONSTRUCT)
    fill (other: TREE [CONSTRUCT])
    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
    force (v: [like item] CONSTRUCT)
    make
    merge_tree_after (other: [like first_child] CONSTRUCT)
    merge_tree_before (other: [like first_child] CONSTRUCT)
    move (i: INTEGER)
    parse
    print_name
    process
    prune (n: [like first_child] CONSTRUCT)
    prune_all (v: [like item] CONSTRUCT)
    put_child (n: [like parent] CONSTRUCT)
    put_child_left (n: [like parent] CONSTRUCT)
    put_child_right (n: [like parent] CONSTRUCT)
    put_front (v: [like item] CONSTRUCT)
    put_i_th (v: [like item] CONSTRUCT; i: INTEGER)
    remove_child
    remove_left_child
    remove_right_child
    remove_sublist
    replace (v: [like item] CONSTRUCT)
    replace_child (n: [like parent] CONSTRUCT)
    search_child (v: [like item] CONSTRUCT)
    semantics
    set_optional
    split (n: INTEGER)
    sprout
    swap (i: INTEGER)
    twl_merge_left (other: [like Current] TERMINAL)
    twl_merge_right (other: [like Current] TERMINAL)
    twl_prune (v: [like item] CONSTRUCT)
    unused_pre_action
    wipe_out


TERMINAL Flat contracts

indexing
    description: "Constructs to be parsed by lexical analysis classes"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:56 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    TERMINAL

feature -- Initialization

    make
            -- Set up construct.
            -- (from CONSTRUCT)

feature -- Access

    construct_name: STRING
            -- Name of the construct in the grammar
            -- (from CONSTRUCT)

    child_cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    document: INPUT
            -- The document to be parsed
            -- (from CONSTRUCT)

    first: like child_item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    first_child: like parent
            -- Leftmost child
            -- (from TWO_WAY_TREE)

    i_th (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    child_index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)
        ensure -- from TREE
            valid_index: Result >= 0 and Result <= arity + 1

    index_of (v: like child_item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: CONSTRUCT
            -- Content of cell.
            -- (from CELL)

    child_item: CONSTRUCT
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not child_off
        require -- from ACTIVE
            readable: child_readable
        require -- from TREE
            readable: child_readable

    last: like child_item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_leaf

    last_child: like parent
            -- (from TWO_WAY_TREE)

    left_sibling: like Current
            -- Left neighbor
            -- (from BI_LINKABLE)

    sequential_occurrences (v: CONSTRUCT): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    right_sibling: like Current
            -- Right neighbor
            -- (from LINKABLE)

    sublist: like Current
            -- Result produced by last split
            -- (from TWO_WAY_LIST)

    token: TOKEN
            -- Token associated with terminal

    infix "@" (i: INTEGER): like child_item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    child_capacity: INTEGER
            -- Maximal number of children
            -- (from TREE)

    count: INTEGER
            -- Number of items
            -- (from TREE)

    arity: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = arity

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like child_item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: child_index = old child_index and other.child_index = old other.child_index
            true_implies_same_size: Result implies arity = other.arity

feature -- Status report

    child_after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    child_before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    child_isfirst: BOOLEAN
            -- Is cursor under first child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_islast: BOOLEAN
            -- Is cursor under last child?
            -- (from TREE)
        ensure -- from CHAIN
            valid_position: Result implies not is_leaf
        ensure -- from TREE
            not_is_leaf: Result implies not is_leaf

    child_readable: BOOLEAN
            -- Is there a current child_item to be read?
            -- (from TREE)

    child_writable: BOOLEAN
            -- Is there a current child_item that may be modified?
            -- (from TREE)

    committed: BOOLEAN
            -- Have enough productions been recognized to interpret
            -- failure of parsing as a syntax error in this construct?
            -- (Otherwise the parsing process will backtrack, trying
            -- other possible interpretations of the part already read.)
            -- (from CONSTRUCT)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: child_off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added?
            -- (from DYNAMIC_TREE)

    Child_extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    has (v: CONSTRUCT): BOOLEAN
            -- Does subtree include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from TREE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_leaf

    is_empty: BOOLEAN
            -- Is structure empty of items?
            -- (from TREE)

    is_inserted (v: CONSTRUCT): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_leaf: BOOLEAN
            -- Are there no children?
            -- (from TREE)

    is_optional: BOOLEAN
            -- Is construct optional?
            -- (from CONSTRUCT)

    is_root: BOOLEAN
            -- Is there no parent?
            -- (from TREE)

    is_sibling (other: like parent): BOOLEAN
            -- Are current node and other siblings?
            -- (from TREE)
        require -- from TREE
            other_exists: other /= void
        ensure -- from TREE
            not_root: Result implies not is_root
            other_not_root: Result implies not other.is_root
            same_parent: Result = not is_root and other.parent = parent

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    child_off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    parsed: BOOLEAN
            -- Has construct been successfully parsed?
            -- (True for optional components not present)
            -- (from CONSTRUCT)

    print_mode: CELL [BOOLEAN]
            -- Must the left-recursion test also print the production?
            -- (Default: no.)
            -- (from CONSTRUCT)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Readable: BOOLEAN is True
            -- (from TREE)

    readable_child: BOOLEAN
            -- Is there a current child to be read?
            -- (from TREE)

    token_type: INTEGER
            -- Token code associated with terminal

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from TREE)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= arity + 1))
        ensure -- from TREE
            valid_cursor_index_definition: Result = (i >= 0) and (i <= child_capacity + 1)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= arity))

    Writable: BOOLEAN is True
            -- Is there a current item that may be modified?
            -- (from TREE)

    writable_child: BOOLEAN
            -- Is there a current child that may be modified?
            -- (from TREE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    set_optional
            -- Define this construct as optional.
            -- (from CONSTRUCT)
        ensure -- from CONSTRUCT
            optional_construct: is_optional

feature -- Cursor movement

    child_back
            -- Move cursor to previous position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from BILINEAR
            not_before: not child_before

    child_finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from TWO_WAY_LIST)
        ensure then -- from CHAIN
            at_last: not is_leaf implies child_islast
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_before
        ensure then -- from TREE
            is_last_child: not is_leaf implies child_islast
        ensure then -- from TWO_WAY_LIST
            not_after: not child_after

    child_forth
            -- Move cursor to next position, if any.
            -- (from TWO_WAY_LIST)
        require -- from  TREE
            True
        require -- from LINEAR
            not_after: not child_after
        ensure then -- from LIST
            moved_forth: child_index = old child_index + 1

    child_go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require else -- from TREE
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: child_index = i
        ensure then -- from TREE
            position: child_index = i

    child_go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from  TREE
            True
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is to big.
            -- (from TWO_WAY_LIST)
        ensure -- from CHAIN
            too_far_right: (old child_index + i > arity) implies exhausted
            too_far_left: (old child_index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (child_index = old child_index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old child_index + i) >= 0 and (old child_index + i) <= (arity + 1)) implies child_index = (old child_index + i)
            before_set: (old child_index + i) <= 0 implies child_before
            after_set: (old child_index + i) >= (arity + 1) implies child_after

    search_child (v: like child_item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, child_item)
            item_found: (not exhausted and not object_comparison) implies v = child_item

    child_start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_leaf implies child_isfirst
        ensure then -- from TREE
            is_first_child: not is_leaf implies child_isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_leaf implies child_after

feature -- Element change

    append (s: SEQUENCE [CONSTRUCT])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: arity >= old arity

    extend (v: like item)
            -- Add v as new child.
            -- (from DYNAMIC_TREE)

    child_extend (v: like child_item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            extendible: child_extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: TREE [CONSTRUCT])
            -- Fill with as many items of other as possible.
            -- The representations of other and current node
            -- need not be the same.
            -- (from TREE)

    force (v: like child_item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: child_extendible
        ensure then -- from SEQUENCE
            new_count: arity = old arity + 1
            item_inserted: has (v)

    twl_merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            new_index: child_index = old child_index + old other.arity
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    twl_merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + old other.arity
            same_index: child_index = old child_index
            other_is_empty: other.is_leaf
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_leaf

    merge_tree_after (other: like first_child)
            -- Merge children of other into current structure
            -- after cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    merge_tree_before (other: like first_child)
            -- Merge children of other into current structure
            -- before cursor position. Do not move cursor.
            -- Make other a leaf.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_off: not child_off
            other_exists: (other /= void)
        ensure -- from DYNAMIC_TREE
            other_is_leaf: other.is_leaf

    prune (n: like first_child)
            -- Prune n from children.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            is_child: n.parent = Current
        ensure -- from TREE
            n_is_root: n.is_root

    child_put (v: like child_item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: child_extendible
        require -- from TREE
            child_writable: child_writable
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure -- from TREE
            item_inserted: child_item = v
        ensure then -- from CHAIN
            same_count: arity = old arity

    put_child (n: like parent)
            -- Add n to the list of children.
            -- Do not move child cursor.
            -- (from TWO_WAY_TREE)
        require else -- from DYNAMIC_TREE
            non_void_argument: n /= void

    put_child_left (n: like parent)
            -- Add n to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
            non_void_argument: n /= void

    put_child_right (n: like parent)
            -- Add n to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_TREE)
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
            non_void_argument: n /= void

    put_front (v: like child_item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            item_inserted: first = v

    put_i_th (v: like child_item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    child_put_left (v: like child_item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_before: not child_before
        require -- from DYNAMIC_TREE
            not_child_before: not child_before
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            new_index: child_index = old child_index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    child_put_right (v: like child_item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: child_extendible
            not_after: not child_after
        require -- from DYNAMIC_TREE
            not_child_after: not child_after
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity + 1
            same_index: child_index = old child_index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old child_before implies next.item = v
            item_inserted_before: old child_before implies child.item = v

    replace (v: like item)
            -- Make v the cell's item.
            -- Was declared in CELL as synonym of put.
            -- (from CELL)
        require -- from TREE
            is_writable: writable
        ensure -- from TREE
            item_inserted: item = v
        ensure -- from CELL
            item_inserted: item = v

    child_replace (v: like child_item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: child_writable
        require -- from TREE
            child_writable: child_writable
        ensure -- from ACTIVE
            item_replaced: child_item = v
        ensure -- from TREE
            item_inserted: child_item = v

    replace_child (n: like parent)
            -- Replace current child by n.
            -- (from TWO_WAY_TREE)
        require -- from TREE
            writable_child: writable_child
            was_root: n.is_root
        ensure -- from TREE
            child_replaced: child = n

    sprout
            -- Make current node a root.
            -- (from TREE)

feature -- Removal

    twl_prune (v: like child_item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like child_item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_child
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from TWO_WAY_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: child_writable
        require -- from DYNAMIC_TREE
            child_not_off: not child_off
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_leaf implies child_after
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_left_child
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: child_index > 1
        require else -- from DYNAMIC_LIST
            not_before: not child_before
        require -- from DYNAMIC_TREE
            is_not_first: not child_isfirst
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            new_index: child_index = old child_index - 1
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index - 1

    remove_right_child
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from TWO_WAY_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: child_index < arity
        require -- from DYNAMIC_TREE
            is_not_last: not child_islast
        ensure -- from DYNAMIC_CHAIN
            new_count: arity = old arity - 1
            same_index: child_index = old child_index
        ensure -- from DYNAMIC_TREE
            new_arity: arity = old arity - 1
            new_child_index: child_index = old child_index

    remove_sublist
            -- (from TWO_WAY_LIST)

    split (n: INTEGER)
            -- Remove from current list
            -- min (n, count - index - 1) items
            -- starting at cursor position.
            -- Move cursor right one position.
            -- Make extracted sublist accessible
            -- through attribute sublist.
            -- (from TWO_WAY_LIST)
        require -- from TWO_WAY_LIST
            not_off: not child_off
            valid_sublist: n >= 0

    wipe_out
            -- Remove all items.
            -- (from TWO_WAY_LIST)
        require -- from  DYNAMIC_TREE
            True
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_leaf
        ensure then -- from DYNAMIC_LIST
            is_before: child_before

feature -- Transformation

    commit
            -- If this construct is one among several possible ones,
            -- discard the others.
            -- By default this does nothing.
            -- (from CONSTRUCT)

    parse
            -- Attempt to analyze incoming lexical
            -- tokens according to current construct.
            -- Set parsed to true if successful;
            -- return to original position in input otherwise.
            -- (from CONSTRUCT)

    unused_pre_action
            -- Semantic action executed before construct is parsed
            -- (nothing by default; may be redefined in descendants).
            -- (from CONSTRUCT)

    process
            -- Parse a specimen of the construct, then apply
            -- semantic actions if parsing successful.
            -- (from CONSTRUCT)

    semantics
            -- Apply semantic actions in order:
            -- pre_action, in_action, post_action.
            -- (from CONSTRUCT)

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not child_off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: child_item = old i_th (i)
            swapped_from_item: i_th (i) = old child_item

feature -- Conversion

    binary_representation: BINARY_TREE [CONSTRUCT]
            -- Convert to binary tree representation:
            -- first child becomes left child,
            -- right sibling becomes right child.
            -- (from TREE)
        ensure -- from TREE
            result_is_root: Result.is_root
            result_has_no_right_child: not Result.has_right

    fill_from_binary (b: BINARY_TREE [CONSTRUCT])
            -- Fill from a binary tree representation.
            -- Left child becomes first child.
            -- Right child becomes right sibling.
            -- Any right child of b is ignored.
            -- (from DYNAMIC_TREE)

    linear_representation: LINEAR [CONSTRUCT]
            -- Representation as a linear structure
            -- (from TREE)

feature -- Duplication

    copy (other: like Current)
            -- Copy contents from other.
            -- (from TWO_WAY_TREE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-tree beginning at cursor position and
            -- having min (n, arity - child_index + 1)
            -- children
            -- (from DYNAMIC_TREE)
        require -- from TREE
            not_child_off: not child_off
            valid_sublist: n >= 0

feature -- Implementation

    child: like first_child
            -- Element at cursor position
            -- (from LINKED_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CONSTRUCT]]; test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CONSTRUCT], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    print_name
            -- Print the construct name on standard output.
            -- (from CONSTRUCT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TWO_WAY_TREE
    off_constraint: (child = void) implies child_off
        -- from DYNAMIC_TREE
    extendible_definition: extendible
    child_after_definition: child_after = (child_index = arity + 1)
        -- from TREE
    leaf_definition: is_leaf = (arity = 0)
    child_off_definition: child_off = child_before or child_after
    child_before_definition: child_before = (child_index = 0)
    child_isfirst_definition: child_isfirst = (not is_leaf and child_index = 1)
    child_islast_definition: child_islast = (not is_leaf and child_index = child_capacity)
    child_after_definition: child_after = (child_index >= child_capacity + 1)
    child_consistency: child_readable implies child.parent = Current
        -- from BI_LINKABLE
    right_symmetry: (right_sibling /= void) implies (right_sibling.left_sibling = Current)
    left_symmetry: (left_sibling /= void) implies (left_sibling.right_sibling = Current)
        -- from TWO_WAY_LIST
    non_empty_list_has_two_endpoints: not is_leaf implies (first_child /= void and last_child /= void)
    first_element_constraint: first_child /= void implies first_child.left_sibling = void
    last_element_constraint: last_child /= void implies last_child.right_sibling = void
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_leaf implies ((first_child = void) and (child = void))
    not_void_unless_empty: (child = void) implies is_leaf
    before_constraint: child_before implies (child = first_child)
    after_constraint: child_after implies (child = last_child)
        -- from LIST
    before_definition: child_before = (child_index = 0)
    after_definition: child_after = (child_index = arity + 1)
        -- from CHAIN
    non_negative_index: child_index >= 0
    index_small_enough: child_index <= arity + 1
    off_definition: child_off = ((child_index = 0) or (child_index = arity + 1))
    isfirst_definition: child_isfirst = ((not is_leaf) and (child_index = 1))
    islast_definition: child_islast = ((not is_leaf) and (child_index = arity))
    item_corresponds_to_index: (not child_off) implies (child_item = i_th (child_index))
    index_set_has_same_count: index_set.count = arity
        -- from ACTIVE
    writable_constraint: child_writable implies child_readable
    empty_constraint: is_leaf implies (not child_readable) and (not child_writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (child_after and child_before)
    before_constraint: child_before implies child_off
        -- from LINEAR
    after_constraint: child_after implies child_off
        -- from TRAVERSABLE
    empty_constraint: is_leaf implies child_off
        -- from FINITE
    empty_definition: is_leaf = (arity = 0)
    non_negative_count: arity >= 0
        -- from DYNAMIC_CHAIN
    extendible: child_extendible

end -- class TERMINAL


Lex & Parse Samples

  • Eiffel scanner
  • Polynomial example language


Eiffel scanner

In the directory $ISE_EIFFEL/examples/lex you will find a system that scans Eiffel classes. It consists of the class EIFFEL_SCAN. It uses the file eiffel_regular as lexical grammar to analyze an Eiffel class passed on the command line.

When compiling the example, the executable eiffel_scan(.exe) is created. Use the program as follows:

eiffel_scan <Eiffel class file>

As an example, when the source code of the root class is run through the scanner, it outputs a list of all consecutive tokens and keywords in that class to the console.


EiffelLex Samples

Real $R
Integer $Z
String ("\"" -> "\"")
Div "//"
Mod "\\"
Quotient '/'
Product '*'
Plus '+'
Minus '-'
Relational ('=' | '<' | '>' | ('<' '=') |  ('>' '=') | ('/' '='))
Comment ("--" -> "\n") *(' '| '\t') *("--" -> "\n")
FeatureAddress '$'
Dot '.'
Dotdot ".."
Semicolon ';'
Colon ':'
Comma ','
Assign ":="
ReverseAssign "?="
Lparan '('
Rparan ')'
Lcurly '{'
Rcurly '}'
Lsquare '['
Rsquare ']'
Bang '!'
LeftArray "<<"
RightArray ">>"
Power '^'
Constraint "->"
Character (('\''$P'\'') | ('\'''\\'['t'|'n'|'r'|'f']'\'') | ('\''+('0'..'7')'\''))
Identifier ~('a'..'z') *(~('a'..'z') | '_' | ('0'..'9'))
-- Keywords
as
and
check
class
current
debug
deferred
do
else
elseif
end
ensure
expanded
export
external
false
feature
from
if
implies
indexing
infix
inherit
inspect
integer
invariant
is
language
like
local
loop
not
obsolete
old
once
or
prefix
real
redefine
require
rename
rescue
result
retry
select
strip
then
true
undefine
unique
until
variant
void
when
xor


EIFFEL_SCAN Text

 class
EIFFEL_SCAN

inherit
SCANNING
rename
make as scanning_make
end

ARGUMENTS
undefine
copy ,
consistent ,
is_equal ,
setup
end

create
make

feature

make is
-- Create a lexical analyser for Eiffel if none,
-- then use it to analyze the file of name
-- file_name.
local
file_name: STRING
do
if argument_count < 1 then
io . error . putstring ("Usage: eiffel_scan eiffel_class_file.e%N")
else
file_name := argument (1)
scanning_make
build ("eiffel_lex", "eiffel_regular")
io . putstring ("Scanning file `")
io . putstring (file_name)
io . putstring ("'.%N")
analyze (file_name)
end
end

end -- class EIFFEL_SCAN


eiffel_scan console output

-- Example of a lexical analyzer based on the Eiffel syntax.
-- The analyzer itself is found in the file ``eiffel_lex'', which
-- is created according to the file  ``eiffel_token'' if not
-- previously built and stored.

class EIFFEL_SCAN

inherit

    SCANNING
        rename
            make as scanning_make
        end;

    ARGUMENTS
        undefine
            copy, consistent, is_equal, setup
        end

create

    make

feature

    make is
            -- Create a lexical analyser for Eiffel if none,
            -- then use it to analyze the file of name
            -- `file_name'.
        local
            file_name: STRING;
        do
            if argument_count < 1 then
                io.error.putstring ("Usage: eiffel_scan eiffel_class_file.e%N")
            else
                file_name := argument (1);
                scanning_make;
                build ("eiffel_lex", "eiffel_regular");
                io.putstring ("Scanning file `");
                io.putstring (file_name);
                io.putstring ("'.%N");
                analyze (file_name)
            end
        end -- make

end -- class EIFFEL_SCAN


eiffel_scan console output

Scanning file `eiffel_scan.e'.

--------------- LEXICAL ANALYSIS: ----

Token type 11: -- Example of a lexical analyzer based on the Eiffel syntax.
-- The analyzer itself is found in the file ``eiffel_lex'', which
-- is created according to the file  ``eiffel_token'' if not
-- previously built and stored.

Keyword:  class Code: 1819086195
Token type 32: EIFFEL_SCAN
Keyword:  inherit Code: 1080299636
Token type 32: SCANNING
Keyword:  rename Code: 2076787557
Token type 32: make
Keyword:  as Code: 24947
Token type 32: scanning_make
Keyword:  end Code: 6647396
Token type 15: ;
Token type 32: ARGUMENTS
Keyword:  undefine Code: 1472863845
Token type 32: copy
Token type 17: ,
Token type 32: consistent
Token type 17: ,
Token type 32: is_equal
Token type 17: ,
Token type 32: setup
Keyword:  end Code: 6647396
Token type 32: create
Token type 32: make
Keyword:  feature Code: 1951938661
Token type 32: make
Keyword:  is Code: 26995
Token type 11: -- Create a lexical analyser for Eiffel if none,
                        -- then use it to analyze the file of name

Token type 11: -- `file_name'.

Keyword:  local Code: 1869613420
Token type 32: file_name
Token type 16: :
Token type 32: STRING
Token type 15: ;
Keyword:  do Code: 25711
Keyword:  if Code: 26982
Token type 32: argument_count
Token type 10: <
Token type 2: 1
Keyword:  then Code: 1952998766
Token type 32: io
Token type 13: .
Token type 32: error
Token type 13: .
Token type 32: putstring
Token type 20: (
Token type 3: "Usage: eiffel_scan eiffel_class_file.e%N"
Token type 21: )
Keyword:  else Code: 1701606245
Token type 32: file_name
Token type 18: :=
Token type 32: argument
Token type 20: (
Token type 2: 1
Token type 21: )
Token type 15: ;
Token type 32: scanning_make
Token type 15: ;
Token type 32: build
Token type 20: (
Token type 3: "eiffel_lex"
Token type 17: ,
Token type 3: "eiffel_regular"
Token type 21: )
Token type 15: ;
Token type 32: io
Token type 13: .
Token type 32: putstring
Token type 20: (
Token type 3: "Scanning file `"
Token type 21: )
Token type 15: ;
Token type 32: io
Token type 13: .
Token type 32: putstring
Token type 20: (
Token type 32: file_name
Token type 21: )
Token type 15: ;
Token type 32: io
Token type 13: .
Token type 32: putstring
Token type 20: (
Token type 3: "'.%N"
Token type 21: )
Token type 15: ;
Token type 32: analyze
Token type 20: (
Token type 32: file_name
Token type 21: )
Keyword:  end Code: 6647396
Keyword:  end Code: 6647396
Token type 11: -- make

Keyword:  end Code: 6647396
Token type 11: -- class EIFFEL_SCAN

Token type -1:


Polynomial language

Classes
CONSTANTS
DIFF
IDENTIFIER
INT_CONSTANT
LINE
NESTED
POLY_INTEGER
POLY_LEX
POLYNOM
POLYNOM_INFO
PROCESS
PRODUCT
SIMPLE_VAR
SUM
TERM
VAR
VARIABLES


CONSTANTS Text

 class
CONSTANTS

feature

Dummy : INTEGER is 0

Special : INTEGER is 1

Simple_identifier : INTEGER is 2

Integer_constant : INTEGER is 3

Blanks : INTEGER is 4

end -- class CONSTANTS


CONSTANTS Chart

 class
CONSTANTS

General
cluster: root_cluster

Ancestors
ANY

Queries
Blanks : INTEGER
Dummy : INTEGER
Integer_constant : INTEGER
Simple_identifier : INTEGER
Special : INTEGER


DIFF Text

 class
DIFF

inherit
AGGREGATE
redefine
post_action
end

POLYNOM

create
make

feature

Construct_name : STRING is "DIFF"

feature {NONE}

Separator : STRING is "-"

feature

production : LINKED_LIST [ CONSTRUCT ] is
local
base: PRODUCT
once
create Result. make
Result. forth
create base. make
put (base)
end

post_action is
local
int_value: INTEGER
do
from
child_start
if not no_components then
child . post_action
int_value := info . child_value
child_forth
end
until
no_components or child_after
loop
child . post_action
int_value := int_value - info . child_value
child_forth
end
info . set_child_value (int_value)
end

end -- class DIFF


DIFF Chart

 class
DIFF

General
cluster: root_cluster
create: make

Ancestors
AGGREGATE
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
Construct_name : STRING
count : INTEGER
Document : INPUT
duplicate (n: INTEGER ): [like Current] DIFF
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
has_commit : BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_recursion : BOOLEAN
left_sibling : [like Current] DIFF
linear_representation : LINEAR [ CONSTRUCT ]
no_components : BOOLEAN
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
Production : LINKED_LIST [ CONSTRUCT ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] DIFF
sequential_occurrences (v: CONSTRUCT ): INTEGER
sublist : [like Current] DIFF
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
post_action
pre_action
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] DIFF )
twl_merge_right (other: [like Current] DIFF )
twl_prune (v: [like item ] CONSTRUCT )
wipe_out


IDENTIFIER Text

 class
IDENTIFIER

inherit
TERMINAL

CONSTANTS

create
make

feature {NONE}

default_identifier_name : STRING is
once
Result := "IDENTIFIER"
end

construct_name : STRING is
do
Result := default_identifier_name
end

feature

token_type : INTEGER is
do
Result := simple_identifier
end

end -- class IDENTIFIER


IDENTIFIER Chart

 class
IDENTIFIER

General
cluster: root_cluster
create: make

Ancestors
CONSTANTS
TERMINAL

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
Blanks : INTEGER
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
count : INTEGER
Document : INPUT
Dummy : INTEGER
duplicate (n: INTEGER ): [like Current] IDENTIFIER
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_constant : INTEGER
is_empty : BOOLEAN
is_leaf : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_sibling : [like Current] IDENTIFIER
linear_representation : LINEAR [ CONSTRUCT ]
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] IDENTIFIER
sequential_occurrences (v: CONSTRUCT ): INTEGER
Simple_identifier : INTEGER
Special : INTEGER
sublist : [like Current] IDENTIFIER
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
token : TOKEN
token_type : INTEGER
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] IDENTIFIER )
twl_merge_right (other: [like Current] IDENTIFIER )
twl_prune (v: [like item ] CONSTRUCT )
unused_pre_action
wipe_out


INT_CONSTANT Text

 class
INT_CONSTANT

inherit
TERMINAL

CONSTANTS

feature

token_type : INTEGER is
do
Result := integer_constant
end

feature {NONE}

construct_name : STRING is
once
Result := "INT_CONSTANT"
end

end -- class INT_CONSTANT


INT_CONSTANT Chart

 class
INT_CONSTANT

General
cluster: root_cluster

Ancestors
CONSTANTS
TERMINAL

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
Blanks : INTEGER
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
count : INTEGER
Document : INPUT
Dummy : INTEGER
duplicate (n: INTEGER ): [like Current] INT_CONSTANT
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_constant : INTEGER
is_empty : BOOLEAN
is_leaf : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_sibling : [like Current] INT_CONSTANT
linear_representation : LINEAR [ CONSTRUCT ]
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] INT_CONSTANT
sequential_occurrences (v: CONSTRUCT ): INTEGER
Simple_identifier : INTEGER
Special : INTEGER
sublist : [like Current] INT_CONSTANT
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
token : TOKEN
token_type : INTEGER
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] INT_CONSTANT )
twl_merge_right (other: [like Current] INT_CONSTANT )
twl_prune (v: [like item ] CONSTRUCT )
unused_pre_action
wipe_out


LINE Text

 class
LINE

inherit
AGGREGATE
export
{ PROCESS } all
redefine
post_action
end

POLYNOM

create
make

feature

construct_name : STRING is
once
Result := "LINE"
end

production : LINKED_LIST [ CONSTRUCT ] is
local
var: VARIABLES
sum: SUM
once
create Result. make
Result. forth
create var. make
put (var)
keyword (":")
create sum. make
put (sum)
end

post_action is
do
child_start
child . post_action
from
child_finish
until
info . end_session
loop
info . set_value
child . post_action
io . putstring ("value: ")
io . putint ( info . child_value )
io . new_line
end
end

end -- class LINE


LINE Chart

 class
LINE

General
cluster: root_cluster
create: make

Ancestors
AGGREGATE
POLYNOM

Queries
Construct_name : STRING
Production : LINKED_LIST [ CONSTRUCT ]

Commands
post_action


NESTED Text

 class
NESTED

inherit
AGGREGATE
redefine
post_action
end

POLYNOM

create
make

feature

construct_name : STRING is
once
Result := "NESTED"
end

production : LINKED_LIST [ CONSTRUCT ] is
local
expression: SUM
once
create Result. make
Result. forth
keyword ("(")
commit
create expression. make
put (expression)
keyword (")")
end

post_action is
do
child_start
child_forth
child . post_action
end

end -- class NESTED


NESTED Chart

 class
NESTED

General
cluster: root_cluster
create: make

Ancestors
AGGREGATE
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
Construct_name : STRING
count : INTEGER
Document : INPUT
duplicate (n: INTEGER ): [like Current] NESTED
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
has_commit : BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_recursion : BOOLEAN
left_sibling : [like Current] NESTED
linear_representation : LINEAR [ CONSTRUCT ]
no_components : BOOLEAN
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
Production : LINKED_LIST [ CONSTRUCT ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] NESTED
sequential_occurrences (v: CONSTRUCT ): INTEGER
sublist : [like Current] NESTED
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
post_action
pre_action
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] NESTED )
twl_merge_right (other: [like Current] NESTED )
twl_prune (v: [like item ] CONSTRUCT )
wipe_out


POLYNOM Text

 class
POLYNOM

feature {NONE}

info : POLYNOM_INFO is
once
create Result. make
end

end -- class POLYNOM


POLYNOM Chart

 class
POLYNOM

General
cluster: root_cluster

Ancestors
ANY


POLYNOM_INFO Text

 class
POLYNOM_INFO

create
make

feature

make is
do
create id_table . make
create id_value . make
end

end_session : BOOLEAN

child_value : INTEGER

feature {NONE}

id_table : SORTED_TWO_WAY_LIST [ STRING ]
-- List of identifiers in the polynom

id_value : LINKED_LIST [ INTEGER ]
-- List of values of the variables of the polynom

feature

set_child_value (i: INTEGER ) is
do
child_value := i
end

cons_id_table (s: STRING ) is
-- Fill the id_table with the identifiers found
-- in the declarations list.
do
if not id_table . has (s) then
id_table . extend (s)
id_value . put_right (0)
end
end

print_id_table is
do
io . putstring ("id_table:%N")
if not id_table . empty then
from
id_table . start
until
id_table . after
loop
io . putstring ("%T")
io . putstring ( id_table . item )
io . putstring ("%N")
id_table . forth
end
end
end

set_value is
do
if not id_table . empty then
io . putstring ("Enter the integer values (9999 to end):")
id_value . wipe_out
id_value . forth
io . new_line
from
id_table . start
until
id_table . after
loop
io . putstring ( id_table . item )
io . putstring (": ")
io . readint
id_value . put_left ( io . lastint )
end_session := io . lastint = 9999
id_table . forth
end
end
end

int_value (s: STRING ): INTEGER is
do
id_table . start
id_table . compare_objects
id_table . search (s)
if not ( id_table . empty or id_table . after ) then
id_value . go_i_th ( id_table . index )
Result := id_value . item
else
io . putstring ("The variable ")
io . putstring (s)
io . putstring (" is not declared")
io . new_line
end
end

end -- class POLYNOM_INFO


POLYNOM_INFO Chart

 class
POLYNOM_INFO

General
cluster: root_cluster
create: make

Ancestors
ANY

Queries
child_value : INTEGER
end_session : BOOLEAN
int_value (s: STRING ): INTEGER

Commands
cons_id_table (s: STRING )
make
print_id_table
set_child_value (i: INTEGER )
set_value


POLY_INTEGER Text

 class
POLY_INTEGER

inherit
INT_CONSTANT
redefine
action
end

POLYNOM

create
make

feature {NONE}

action is
do
info . set_child_value ( token . string_value . to_integer )
end

end -- class POLY_INTEGER


POLY_INTEGER Chart

 class
POLY_INTEGER

General
cluster: root_cluster
create: make

Ancestors
INT_CONSTANT
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
Blanks : INTEGER
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
count : INTEGER
Document : INPUT
Dummy : INTEGER
duplicate (n: INTEGER ): [like Current] POLY_INTEGER
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_constant : INTEGER
is_empty : BOOLEAN
is_leaf : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_sibling : [like Current] POLY_INTEGER
linear_representation : LINEAR [ CONSTRUCT ]
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] POLY_INTEGER
sequential_occurrences (v: CONSTRUCT ): INTEGER
Simple_identifier : INTEGER
Special : INTEGER
sublist : [like Current] POLY_INTEGER
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
token : TOKEN
token_type : INTEGER
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] POLY_INTEGER )
twl_merge_right (other: [like Current] POLY_INTEGER )
twl_prune (v: [like item ] CONSTRUCT )
unused_pre_action
wipe_out


POLY_LEX Text

 class
POLY_LEX

inherit
L_INTERFACE

CONSTANTS
undefine
consistent ,
copy ,
is_equal ,
setup
end

feature {NONE}

obtain_analyzer is
-- Create lexical analyzer for the Polynomial language
do
ignore_case
keywords_ignore_case
build_expressions
build_keywords
set_separator_type ( blanks )
end

build_expressions is
-- Define regular expressions
-- for the Polynomial language
do
put_expression ( special_expression , special , "Special")
put_expression ("*('a'..'z')", simple_identifier , "Simple_identifier")
put_expression ("+('0'..'9')", integer_constant , "Integer_constant")
put_expression ("+('\t'|'\n'|' ')", blanks , "Blanks")
end

special_expression : STRING is
-- Regular expression describing Special
once
create Result. make (80)
Result. append ("('\050'..'\057')|")
Result. append ("('\072'..'\076')|")
Result. append ("'['|']'|'|'|'{'|'}'|%"->%"|%":=%"")
end

build_keywords is
-- Define keywords (special symbols)
-- for the Polynomial language
do
put_keyword ("+", special )
put_keyword ("-", special )
put_keyword (";", special )
put_keyword (":", special )
put_keyword ("(", special )
put_keyword (")", special )
put_keyword ("*", special )
end

end -- class POLY_LEX


POLY_LEX Chart

 class
POLY_LEX

General
cluster: root_cluster

Ancestors
CONSTANTS
L_INTERFACE

Queries
infix " @ " (i: INTEGER ): LINKED_LIST [ INTEGER ]
Ack : INTEGER
additional_space : INTEGER
all_default : BOOLEAN
Ampersand : INTEGER
analyzer : LEXICAL
area : SPECIAL [ LINKED_LIST [ INTEGER ]]
Back_space : INTEGER
Backslash : INTEGER
Bar : INTEGER
Bel : INTEGER
Blank : INTEGER
Blanks : INTEGER
Break : INTEGER
Bs : INTEGER
Buf_overflow : INTEGER
Can : INTEGER
capacity : INTEGER
Carriage_return : INTEGER
Case_diff : INTEGER
case_sensitive : BOOLEAN
categories_table : ARRAY [ INTEGER ]
changeable_comparison_criterion : BOOLEAN
Character_set_size : INTEGER
Circumflex : INTEGER
Closing_brace : INTEGER
Colon : INTEGER
Comma : INTEGER
Commercial_at : INTEGER
count : INTEGER
Cr : INTEGER
Ctrl_a : INTEGER
Ctrl_b : INTEGER
Ctrl_backslash : INTEGER
Ctrl_c : INTEGER
Ctrl_circumflex : INTEGER
Ctrl_d : INTEGER
Ctrl_e : INTEGER
Ctrl_f : INTEGER
Ctrl_g : INTEGER
Ctrl_h : INTEGER
Ctrl_i : INTEGER
Ctrl_j : INTEGER
Ctrl_k : INTEGER
Ctrl_l : INTEGER
Ctrl_lbracket : INTEGER
Ctrl_m : INTEGER
Ctrl_n : INTEGER
Ctrl_o : INTEGER
Ctrl_p : INTEGER
Ctrl_q : INTEGER
Ctrl_questmark : INTEGER
Ctrl_r : INTEGER
Ctrl_rbracket : INTEGER
Ctrl_s : INTEGER
Ctrl_t : INTEGER
Ctrl_u : INTEGER
Ctrl_underlined : INTEGER
Ctrl_v : INTEGER
Ctrl_w : INTEGER
Ctrl_x : INTEGER
Ctrl_y : INTEGER
Ctrl_z : INTEGER
Dc1 : INTEGER
Dc2 : INTEGER
Dc3 : INTEGER
Dc4 : INTEGER
Del : INTEGER
description : STRING
dfa : FIXED_DFA
Dle : INTEGER
Dollar : INTEGER
Dot : INTEGER
Doublequote : INTEGER
Down_arrow : INTEGER
Dummy : INTEGER
Eight : INTEGER
Em : INTEGER
Enq : INTEGER
entry (i: INTEGER ): LINKED_LIST [ INTEGER ]
Eot : INTEGER
Equal_sign : INTEGER
Error_list : ERROR_LIST
Esc : INTEGER
Etb : INTEGER
Etx : INTEGER
Exclamation : INTEGER
extendible : BOOLEAN
final_array : ARRAY [ INTEGER ]
First_printable : INTEGER
Five : INTEGER
Four : INTEGER
Fs : INTEGER
full : BOOLEAN
Grave_accent : INTEGER
Greaterthan : INTEGER
greatest_input : INTEGER
Growth_percentage : INTEGER
Gs : INTEGER
has (v: LINKED_LIST [ INTEGER ]): BOOLEAN
has_letters : BOOLEAN
Home_arrow : INTEGER
Ht : INTEGER
index_set : INTEGER_INTERVAL
initialized : BOOLEAN
input_array : ARRAY [ FIXED_INTEGER_SET ]
Integer_constant : INTEGER
is_empty : BOOLEAN
is_equal (other: [like Current] POLY_LEX ): BOOLEAN
keyword_h_table : HASH_TABLE [ INTEGER , STRING ]
keywords_case_sensitive : BOOLEAN
keywords_list : LINKED_LIST [ STRING ]
Last_ascii : INTEGER
last_character_code : INTEGER
last_created_tool : INTEGER
Last_printable : INTEGER
Lbracket : INTEGER
Lcurly : INTEGER
Left_arrow : INTEGER
Lessthan : INTEGER
Letter_layout : INTEGER
lexical_frozen : BOOLEAN
Line_feed : INTEGER
linear_representation : LINEAR [ LINKED_LIST [ INTEGER ]]
lower : INTEGER
Lower_a : INTEGER
Lower_b : INTEGER
Lower_c : INTEGER
Lower_d : INTEGER
Lower_e : INTEGER
Lower_f : INTEGER
Lower_g : INTEGER
Lower_h : INTEGER
Lower_i : INTEGER
Lower_j : INTEGER
Lower_k : INTEGER
Lower_l : INTEGER
Lower_m : INTEGER
Lower_n : INTEGER
Lower_o : INTEGER
Lower_p : INTEGER
Lower_q : INTEGER
Lower_r : INTEGER
Lower_s : INTEGER
Lower_t : INTEGER
Lower_u : INTEGER
Lower_v : INTEGER
Lower_w : INTEGER
Lower_x : INTEGER
Lower_y : INTEGER
Lower_z : INTEGER
Minimal_increase : INTEGER
Minus : INTEGER
Nak : INTEGER
nb_states : INTEGER
Nine : INTEGER
Nl : INTEGER
No_token : INTEGER
Np : INTEGER
Nul : INTEGER
Number_sign : INTEGER
object_comparison : BOOLEAN
occurrences (v: LINKED_LIST [ INTEGER ]): INTEGER
One : INTEGER
Opening_brace : INTEGER
Overflow : INTEGER
pdfa_item (i: INTEGER ): LINKED_LIST [ INTEGER ]
Percent : INTEGER
Plus : INTEGER
prunable : BOOLEAN
Questmark : INTEGER
Rbracket : INTEGER
Rcurly : INTEGER
recognize (s: STRING ): INTEGER
resizable : BOOLEAN
Right_arrow : INTEGER
Rs : INTEGER
same_items (other: [like Current] POLY_LEX ): BOOLEAN
selected_tools : LINKED_LIST [ INTEGER ]
Semicolon : INTEGER
Seven : INTEGER
Si : INTEGER
Simple_identifier : INTEGER
Singlequote : INTEGER
Six : INTEGER
Slash : INTEGER
So : INTEGER
Soh : INTEGER
Sp : INTEGER
Special : INTEGER
Star : INTEGER
start_number : INTEGER
Stx : INTEGER
Sub : INTEGER
subarray (start_pos, end_pos: INTEGER ): [like Current] POLY_LEX
Syn : INTEGER
Tabulation : INTEGER
Three : INTEGER
Tilde : INTEGER
token_type_list : LINKED_LIST [ INTEGER ]
tool_list : LINKED_LIST [ PDFA ]
tool_names : LINKED_LIST [ STRING ]
Two : INTEGER
Underlined : INTEGER
Up_arrow : INTEGER
upper : INTEGER
Upper_a : INTEGER
Upper_b : INTEGER
Upper_c : INTEGER
Upper_d : INTEGER
Upper_e : INTEGER
Upper_f : INTEGER
Upper_g : INTEGER
Upper_h : INTEGER
Upper_i : INTEGER
Upper_j : INTEGER
Upper_k : INTEGER
Upper_l : INTEGER
Upper_m : INTEGER
Upper_n : INTEGER
Upper_o : INTEGER
Upper_p : INTEGER
Upper_q : INTEGER
Upper_r : INTEGER
Upper_s : INTEGER
Upper_t : INTEGER
Upper_u : INTEGER
Upper_v : INTEGER
Upper_w : INTEGER
Upper_x : INTEGER
Upper_y : INTEGER
Upper_z : INTEGER
Us : INTEGER
valid_index (i: INTEGER ): BOOLEAN
valid_index_set : BOOLEAN
Vt : INTEGER
Zero : INTEGER

Commands
add_keyword (word: STRING )
add_word (s: STRING ; n: INTEGER )
any_character
any_printable
append (p, s: INTEGER )
append_optional (p, s: INTEGER )
array_make (min_index, max_index: INTEGER )
associate (t, n: INTEGER )
automatic_grow
build (doc: INPUT )
build_dollar_any
build_dollar_b
build_dollar_n
build_dollar_p
build_dollar_r
build_dollar_z
case_insensitive (c: INTEGER )
clear_all
compare_objects
compare_references
construct_dfa
copy (other: [like Current] POLY_LEX )
delete_transition (source, input_doc, target: INTEGER )
difference (r: INTEGER ; c: CHARACTER )
discard_items
distinguish_case
enter (v: [like item ] LINKED_LIST [ INTEGER ]; i: INTEGER )
fill (other: CONTAINER [ LINKED_LIST [ INTEGER ]])
force (v: [like item ] LINKED_LIST [ INTEGER ]; i: INTEGER )
grow (i: INTEGER )
ignore_case
include (fa: PDFA ; shift: INTEGER )
initialize
interval (b, e: CHARACTER )
iteration (c: INTEGER )
iteration1 (c: INTEGER )
iteration_n (n, c: INTEGER )
keywords_distinguish_case
keywords_ignore_case
make_analyzer
make_extended (char_code: INTEGER )
make_from_array (a: ARRAY [ LINKED_LIST [ INTEGER ]])
metalex_make
optional (c: INTEGER )
pdfa_make (n, i: INTEGER )
pdfa_put (v: [like item ] LINKED_LIST [ INTEGER ]; i: INTEGER )
prepend_optional (p, s: INTEGER )
prune_all (v: LINKED_LIST [ INTEGER ])
put_expression (s: STRING ; n: INTEGER ; c: STRING )
put_keyword (s: STRING ; exp: INTEGER )
put_nameless_expression (s: STRING ; n: INTEGER )
read_grammar (token_file_name: STRING )
remove
remove_case_sensitiveness
resize (min_index, max_index: INTEGER )
retrieve_analyzer (file_name: STRING )
select_tool (i: INTEGER )
set_e_transition (source, target: INTEGER )
set_final (s, r: INTEGER )
set_letters
set_start (n: INTEGER )
set_transition (source, input_doc, target: INTEGER )
set_word (word: STRING )
store_analyzer (file_name: STRING )
subcopy (other: [like Current] POLY_LEX ; start_pos, end_pos, index_pos: INTEGER )
trace
union (a, b: INTEGER )
union2 (a, b: INTEGER )
up_to (word: STRING )


PROCESS Text

 class
PROCESS

inherit
POLY_LEX

create
make

feature

root_line : LINE

make is
local
nb_try: INTEGER
t_b: BOOLEAN
text_name: STRING
do
create root_line . make
build ( root_line . document )
io . putstring ("Do you want to test for left recursion? ")
io . readword
io . next_line
if io . laststring . is_equal ("y") then
root_line . print_mode . put (True)
root_line . expand_all
t_b := not root_line . left_recursion
root_line . check_recursion
if not root_line . left_recursion . item then
io . putstring ("No left recursion detected%N")
end
else
from
until
nb_try < 5 and text_name /= void and then text_name. count > 0
loop
io . putstring ("File name with polynom description: ")
io . readword
text_name := io . laststring
nb_try := nb_try + 1
end
if nb_try = 5 then
io . putstring ("*** Demo stopped%N")
else
root_line . document . set_input_file (text_name)
root_line . document . get_token
root_line . process
end
end
end

end -- class PROCESS


PROCESS Chart

 class
PROCESS

General
cluster: root_cluster
create: make

Ancestors
POLY_LEX

Queries
infix " @ " (i: INTEGER ): LINKED_LIST [ INTEGER ]
Ack : INTEGER
additional_space : INTEGER
all_default : BOOLEAN
Ampersand : INTEGER
analyzer : LEXICAL
area : SPECIAL [ LINKED_LIST [ INTEGER ]]
Back_space : INTEGER
Backslash : INTEGER
Bar : INTEGER
Bel : INTEGER
Blank : INTEGER
Blanks : INTEGER
Break : INTEGER
Bs : INTEGER
Buf_overflow : INTEGER
Can : INTEGER
capacity : INTEGER
Carriage_return : INTEGER
Case_diff : INTEGER
case_sensitive : BOOLEAN
categories_table : ARRAY [ INTEGER ]
changeable_comparison_criterion : BOOLEAN
Character_set_size : INTEGER
Circumflex : INTEGER
Closing_brace : INTEGER
Colon : INTEGER
Comma : INTEGER
Commercial_at : INTEGER
count : INTEGER
Cr : INTEGER
Ctrl_a : INTEGER
Ctrl_b : INTEGER
Ctrl_backslash : INTEGER
Ctrl_c : INTEGER
Ctrl_circumflex : INTEGER
Ctrl_d : INTEGER
Ctrl_e : INTEGER
Ctrl_f : INTEGER
Ctrl_g : INTEGER
Ctrl_h : INTEGER
Ctrl_i : INTEGER
Ctrl_j : INTEGER
Ctrl_k : INTEGER
Ctrl_l : INTEGER
Ctrl_lbracket : INTEGER
Ctrl_m : INTEGER
Ctrl_n : INTEGER
Ctrl_o : INTEGER
Ctrl_p : INTEGER
Ctrl_q : INTEGER
Ctrl_questmark : INTEGER
Ctrl_r : INTEGER
Ctrl_rbracket : INTEGER
Ctrl_s : INTEGER
Ctrl_t : INTEGER
Ctrl_u : INTEGER
Ctrl_underlined : INTEGER
Ctrl_v : INTEGER
Ctrl_w : INTEGER
Ctrl_x : INTEGER
Ctrl_y : INTEGER
Ctrl_z : INTEGER
Dc1 : INTEGER
Dc2 : INTEGER
Dc3 : INTEGER
Dc4 : INTEGER
Del : INTEGER
description : STRING
dfa : FIXED_DFA
Dle : INTEGER
Dollar : INTEGER
Dot : INTEGER
Doublequote : INTEGER
Down_arrow : INTEGER
Dummy : INTEGER
Eight : INTEGER
Em : INTEGER
Enq : INTEGER
entry (i: INTEGER ): LINKED_LIST [ INTEGER ]
Eot : INTEGER
Equal_sign : INTEGER
Error_list : ERROR_LIST
Esc : INTEGER
Etb : INTEGER
Etx : INTEGER
Exclamation : INTEGER
extendible : BOOLEAN
final_array : ARRAY [ INTEGER ]
First_printable : INTEGER
Five : INTEGER
Four : INTEGER
Fs : INTEGER
full : BOOLEAN
Grave_accent : INTEGER
Greaterthan : INTEGER
greatest_input : INTEGER
Growth_percentage : INTEGER
Gs : INTEGER
has (v: LINKED_LIST [ INTEGER ]): BOOLEAN
has_letters : BOOLEAN
Home_arrow : INTEGER
Ht : INTEGER
index_set : INTEGER_INTERVAL
initialized : BOOLEAN
input_array : ARRAY [ FIXED_INTEGER_SET ]
Integer_constant : INTEGER
is_empty : BOOLEAN
is_equal (other: [like Current] PROCESS ): BOOLEAN
keyword_h_table : HASH_TABLE [ INTEGER , STRING ]
keywords_case_sensitive : BOOLEAN
keywords_list : LINKED_LIST [ STRING ]
Last_ascii : INTEGER
last_character_code : INTEGER
last_created_tool : INTEGER
Last_printable : INTEGER
Lbracket : INTEGER
Lcurly : INTEGER
Left_arrow : INTEGER
Lessthan : INTEGER
Letter_layout : INTEGER
lexical_frozen : BOOLEAN
Line_feed : INTEGER
linear_representation : LINEAR [ LINKED_LIST [ INTEGER ]]
lower : INTEGER
Lower_a : INTEGER
Lower_b : INTEGER
Lower_c : INTEGER
Lower_d : INTEGER
Lower_e : INTEGER
Lower_f : INTEGER
Lower_g : INTEGER
Lower_h : INTEGER
Lower_i : INTEGER
Lower_j : INTEGER
Lower_k : INTEGER
Lower_l : INTEGER
Lower_m : INTEGER
Lower_n : INTEGER
Lower_o : INTEGER
Lower_p : INTEGER
Lower_q : INTEGER
Lower_r : INTEGER
Lower_s : INTEGER
Lower_t : INTEGER
Lower_u : INTEGER
Lower_v : INTEGER
Lower_w : INTEGER
Lower_x : INTEGER
Lower_y : INTEGER
Lower_z : INTEGER
Minimal_increase : INTEGER
Minus : INTEGER
Nak : INTEGER
nb_states : INTEGER
Nine : INTEGER
Nl : INTEGER
No_token : INTEGER
Np : INTEGER
Nul : INTEGER
Number_sign : INTEGER
object_comparison : BOOLEAN
occurrences (v: LINKED_LIST [ INTEGER ]): INTEGER
One : INTEGER
Opening_brace : INTEGER
Overflow : INTEGER
pdfa_item (i: INTEGER ): LINKED_LIST [ INTEGER ]
Percent : INTEGER
Plus : INTEGER
prunable : BOOLEAN
Questmark : INTEGER
Rbracket : INTEGER
Rcurly : INTEGER
recognize (s: STRING ): INTEGER
resizable : BOOLEAN
Right_arrow : INTEGER
root_line : LINE
Rs : INTEGER
same_items (other: [like Current] PROCESS ): BOOLEAN
selected_tools : LINKED_LIST [ INTEGER ]
Semicolon : INTEGER
Seven : INTEGER
Si : INTEGER
Simple_identifier : INTEGER
Singlequote : INTEGER
Six : INTEGER
Slash : INTEGER
So : INTEGER
Soh : INTEGER
Sp : INTEGER
Special : INTEGER
Star : INTEGER
start_number : INTEGER
Stx : INTEGER
Sub : INTEGER
subarray (start_pos, end_pos: INTEGER ): [like Current] PROCESS
Syn : INTEGER
Tabulation : INTEGER
Three : INTEGER
Tilde : INTEGER
token_type_list : LINKED_LIST [ INTEGER ]
tool_list : LINKED_LIST [ PDFA ]
tool_names : LINKED_LIST [ STRING ]
Two : INTEGER
Underlined : INTEGER
Up_arrow : INTEGER
upper : INTEGER
Upper_a : INTEGER
Upper_b : INTEGER
Upper_c : INTEGER
Upper_d : INTEGER
Upper_e : INTEGER
Upper_f : INTEGER
Upper_g : INTEGER
Upper_h : INTEGER
Upper_i : INTEGER
Upper_j : INTEGER
Upper_k : INTEGER
Upper_l : INTEGER
Upper_m : INTEGER
Upper_n : INTEGER
Upper_o : INTEGER
Upper_p : INTEGER
Upper_q : INTEGER
Upper_r : INTEGER
Upper_s : INTEGER
Upper_t : INTEGER
Upper_u : INTEGER
Upper_v : INTEGER
Upper_w : INTEGER
Upper_x : INTEGER
Upper_y : INTEGER
Upper_z : INTEGER
Us : INTEGER
valid_index (i: INTEGER ): BOOLEAN
valid_index_set : BOOLEAN
Vt : INTEGER
Zero : INTEGER

Commands
add_keyword (word: STRING )
add_word (s: STRING ; n: INTEGER )
any_character
any_printable
append (p, s: INTEGER )
append_optional (p, s: INTEGER )
array_make (min_index, max_index: INTEGER )
associate (t, n: INTEGER )
automatic_grow
build (doc: INPUT )
build_dollar_any
build_dollar_b
build_dollar_n
build_dollar_p
build_dollar_r
build_dollar_z
case_insensitive (c: INTEGER )
clear_all
compare_objects
compare_references
construct_dfa
copy (other: [like Current] PROCESS )
delete_transition (source, input_doc, target: INTEGER )
difference (r: INTEGER ; c: CHARACTER )
discard_items
distinguish_case
enter (v: [like item ] LINKED_LIST [ INTEGER ]; i: INTEGER )
fill (other: CONTAINER [ LINKED_LIST [ INTEGER ]])
force (v: [like item ] LINKED_LIST [ INTEGER ]; i: INTEGER )
grow (i: INTEGER )
ignore_case
include (fa: PDFA ; shift: INTEGER )
initialize
interval (b, e: CHARACTER )
iteration (c: INTEGER )
iteration1 (c: INTEGER )
iteration_n (n, c: INTEGER )
keywords_distinguish_case
keywords_ignore_case
make
make_analyzer
make_extended (char_code: INTEGER )
make_from_array (a: ARRAY [ LINKED_LIST [ INTEGER ]])
metalex_make
optional (c: INTEGER )
pdfa_make (n, i: INTEGER )
pdfa_put (v: [like item ] LINKED_LIST [ INTEGER ]; i: INTEGER )
prepend_optional (p, s: INTEGER )
prune_all (v: LINKED_LIST [ INTEGER ])
put_expression (s: STRING ; n: INTEGER ; c: STRING )
put_keyword (s: STRING ; exp: INTEGER )
put_nameless_expression (s: STRING ; n: INTEGER )
read_grammar (token_file_name: STRING )
remove
remove_case_sensitiveness
resize (min_index, max_index: INTEGER )
retrieve_analyzer (file_name: STRING )
select_tool (i: INTEGER )
set_e_transition (source, target: INTEGER )
set_final (s, r: INTEGER )
set_letters
set_start (n: INTEGER )
set_transition (source, input_doc, target: INTEGER )
set_word (word: STRING )
store_analyzer (file_name: STRING )
subcopy (other: [like Current] PROCESS ; start_pos, end_pos, index_pos: INTEGER )
trace
union (a, b: INTEGER )
union2 (a, b: INTEGER )
up_to (word: STRING )


PRODUCT Text

 class
PRODUCT

inherit
AGGREGATE
redefine
post_action
end

POLYNOM

create
make

feature

construct_name : STRING is
once
Result := "PRODUCT"
end

feature {NONE}

Separator : STRING is "*"

feature

production : LINKED_LIST [ CONSTRUCT ] is
local
base: TERM
once
create Result. make
Result. forth
create base. make
put (base)
end

post_action is
local
int_value: INTEGER
do
if not no_components then
from
child_start
if not child_after then
int_value := 1
end
until
child_after
loop
child . post_action
int_value := int_value * info . child_value
child_forth
end
info . set_child_value (int_value)
end
end

end -- class PRODUCT


PRODUCT Chart

 class
PRODUCT

General
cluster: root_cluster
create: make

Ancestors
AGGREGATE
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
Construct_name : STRING
count : INTEGER
Document : INPUT
duplicate (n: INTEGER ): [like Current] PRODUCT
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
has_commit : BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_recursion : BOOLEAN
left_sibling : [like Current] PRODUCT
linear_representation : LINEAR [ CONSTRUCT ]
no_components : BOOLEAN
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
Production : LINKED_LIST [ CONSTRUCT ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] PRODUCT
sequential_occurrences (v: CONSTRUCT ): INTEGER
sublist : [like Current] PRODUCT
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
post_action
pre_action
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] PRODUCT )
twl_merge_right (other: [like Current] PRODUCT )
twl_prune (v: [like item ] CONSTRUCT )
wipe_out


SIMPLE_VAR Text

 class
SIMPLE_VAR

inherit
IDENTIFIER
redefine
action ,
construct_name
end

POLYNOM

create
make

feature {NONE}

construct_name : STRING is
once
Result := "SIMPLE_VAR"
end

action is
do
info . set_child_value ( info . int_value ( token . string_value ))
end

end -- class SIMPLE_VAR


SIMPLE_VAR Chart

 class
SIMPLE_VAR

General
cluster: root_cluster
create: make

Ancestors
IDENTIFIER
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
Blanks : INTEGER
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
count : INTEGER
Document : INPUT
Dummy : INTEGER
duplicate (n: INTEGER ): [like Current] SIMPLE_VAR
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_constant : INTEGER
is_empty : BOOLEAN
is_leaf : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_sibling : [like Current] SIMPLE_VAR
linear_representation : LINEAR [ CONSTRUCT ]
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] SIMPLE_VAR
sequential_occurrences (v: CONSTRUCT ): INTEGER
Simple_identifier : INTEGER
Special : INTEGER
sublist : [like Current] SIMPLE_VAR
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
token : TOKEN
token_type : INTEGER
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] SIMPLE_VAR )
twl_merge_right (other: [like Current] SIMPLE_VAR )
twl_prune (v: [like item ] CONSTRUCT )
unused_pre_action
wipe_out


SUM Text

 class
SUM

inherit
AGGREGATE
redefine
post_action
end

POLYNOM

create
make

feature

construct_name : STRING is
once
Result := "SUM"
end

feature {NONE}

Separator : STRING is "+"

feature

production : LINKED_LIST [ CONSTRUCT ] is
local
base: DIFF
once
create Result. make
Result. forth
create base. make
put (base)
end

post_action is
local
int_value: INTEGER
do
if not no_components then
from
child_start
until
child_after
loop
child . post_action
int_value := int_value + info . child_value
child_forth
end
info . set_child_value (int_value)
end
end

end -- class SUM


SUM Chart

 class
SUM

General
cluster: root_cluster
create: make

Ancestors
AGGREGATE
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
Construct_name : STRING
count : INTEGER
Document : INPUT
duplicate (n: INTEGER ): [like Current] SUM
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
has_commit : BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_recursion : BOOLEAN
left_sibling : [like Current] SUM
linear_representation : LINEAR [ CONSTRUCT ]
no_components : BOOLEAN
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
Production : LINKED_LIST [ CONSTRUCT ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] SUM
sequential_occurrences (v: CONSTRUCT ): INTEGER
sublist : [like Current] SUM
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
post_action
pre_action
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] SUM )
twl_merge_right (other: [like Current] SUM )
twl_prune (v: [like item ] CONSTRUCT )
wipe_out


TERM Text

 class
TERM

inherit
CHOICE
redefine
post_action
end

POLYNOM

create
make

feature

construct_name : STRING is
once
Result := "TERM"
end

production : LINKED_LIST [ CONSTRUCT ] is
local
id: SIMPLE_VAR
val: POLY_INTEGER
nest: NESTED
once
create Result. make
Result. forth
create id. make
put (id)
create val. make
put (val)
create nest. make
put (nest)
end

post_action is
do
retained . post_action
end

end -- class TERM


TERM Chart

 class
TERM

General
cluster: root_cluster
create: make

Ancestors
CHOICE
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
Construct_name : STRING
count : INTEGER
Document : INPUT
duplicate (n: INTEGER ): [like Current] TERM
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_recursion : BOOLEAN
left_sibling : [like Current] TERM
linear_representation : LINEAR [ CONSTRUCT ]
no_components : BOOLEAN
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
Production : LINKED_LIST [ CONSTRUCT ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
retained : CONSTRUCT
right_sibling : [like Current] TERM
sequential_occurrences (v: CONSTRUCT ): INTEGER
sublist : [like Current] TERM
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
post_action
pre_action
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] TERM )
twl_merge_right (other: [like Current] TERM )
twl_prune (v: [like item ] CONSTRUCT )
wipe_out


VAR Text

 class
VAR

inherit
IDENTIFIER
redefine
construct_name ,
action
end

POLYNOM

create
make

feature {NONE}

construct_name : STRING is
once
Result := "VAR"
end

action is
do
info . cons_id_table ( token . string_value )
end

end -- class VAR


VARIABLES Text

 class
VARIABLES

inherit
AGGREGATE
redefine
post_action
end

POLYNOM

create
make

feature

construct_name : STRING is
once
Result := "VARIABLES"
end

feature {NONE}

Separator : STRING is ";"

feature

production : LINKED_LIST [ IDENTIFIER ] is
local
base: VAR
once
create Result. make
Result. forth
create base. make
put (base)
end

post_action is
do
if not no_components then
from
child_start
until
child_after
loop
child . post_action
child_forth
end
end
end

end -- class VARIABLES


VARIABLES Chart

 class
VARIABLES

General
cluster: root_cluster
create: make

Ancestors
AGGREGATE
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
Construct_name : STRING
count : INTEGER
Document : INPUT
duplicate (n: INTEGER ): [like Current] VARIABLES
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
has_commit : BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_recursion : BOOLEAN
left_sibling : [like Current] VARIABLES
linear_representation : LINEAR [ CONSTRUCT ]
no_components : BOOLEAN
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
Production : LINKED_LIST [ IDENTIFIER ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] VARIABLES
sequential_occurrences (v: CONSTRUCT ): INTEGER
sublist : [like Current] VARIABLES
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
post_action
pre_action
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] VARIABLES )
twl_merge_right (other: [like Current] VARIABLES )
twl_prune (v: [like item ] CONSTRUCT )
wipe_out


VAR Chart

 class
VAR

General
cluster: root_cluster
create: make

Ancestors
IDENTIFIER
POLYNOM

Queries
infix " @ " (i: INTEGER ): [like item ] CONSTRUCT
arity : INTEGER
binary_representation : BINARY_TREE [ CONSTRUCT ]
Blanks : INTEGER
changeable_comparison_criterion : BOOLEAN
child : [like first_element ] CONSTRUCT
child_after : BOOLEAN
child_before : BOOLEAN
child_cursor : CURSOR
Child_extendible : BOOLEAN
child_index : INTEGER
child_isfirst : BOOLEAN
child_islast : BOOLEAN
child_item : CONSTRUCT
child_off : BOOLEAN
child_readable : BOOLEAN
child_writable : BOOLEAN
committed : BOOLEAN
count : INTEGER
Document : INPUT
Dummy : INTEGER
duplicate (n: INTEGER ): [like Current] VAR
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] CONSTRUCT
first_child : [like parent ] CONSTRUCT
for_all (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
has (v: CONSTRUCT ): BOOLEAN
i_th (i: INTEGER ): [like item ] CONSTRUCT
index_of (v: [like item ] CONSTRUCT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_constant : INTEGER
is_empty : BOOLEAN
is_leaf : BOOLEAN
is_optional : BOOLEAN
is_root : BOOLEAN
is_sibling (other: [like parent ] CONSTRUCT ): BOOLEAN
item : CONSTRUCT
last : [like item ] CONSTRUCT
last_child : [like parent ] CONSTRUCT
left_sibling : [like Current] VAR
linear_representation : LINEAR [ CONSTRUCT ]
object_comparison : BOOLEAN
occurrences (v: [like item ] CONSTRUCT ): INTEGER
parsed : BOOLEAN
Print_mode : CELL [ BOOLEAN ]
prunable : BOOLEAN
Readable : BOOLEAN
readable_child : BOOLEAN
right_sibling : [like Current] VAR
sequential_occurrences (v: CONSTRUCT ): INTEGER
Simple_identifier : INTEGER
Special : INTEGER
sublist : [like Current] VAR
there_exists (test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ]): BOOLEAN
token : TOKEN
token_type : INTEGER
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Writable : BOOLEAN
writable_child : BOOLEAN

Commands
append (s: SEQUENCE [ CONSTRUCT ])
child_back
child_extend (v: [like item ] CONSTRUCT )
child_finish
child_forth
child_go_i_th (i: INTEGER )
child_go_to (p: CURSOR )
child_put (v: [like item ] CONSTRUCT )
child_put_left (v: [like item ] CONSTRUCT )
child_put_right (v: [like item ] CONSTRUCT )
child_replace (v: [like item ] CONSTRUCT )
child_start
commit
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ CONSTRUCT ]]; test: FUNCTION [ ANY , TUPLE [ CONSTRUCT ], BOOLEAN ])
extend (v: [like item ] CONSTRUCT )
fill (other: TREE [ CONSTRUCT ])
fill_from_binary (b: BINARY_TREE [ CONSTRUCT ])
force (v: [like item ] CONSTRUCT )
make
merge_tree_after (other: [like first_child ] CONSTRUCT )
merge_tree_before (other: [like first_child ] CONSTRUCT )
move (i: INTEGER )
parse
print_name
process
prune (n: [like first_child ] CONSTRUCT )
prune_all (v: [like item ] CONSTRUCT )
put_child (n: [like parent ] CONSTRUCT )
put_child_left (n: [like parent ] CONSTRUCT )
put_child_right (n: [like parent ] CONSTRUCT )
put_front (v: [like item ] CONSTRUCT )
put_i_th (v: [like item ] CONSTRUCT ; i: INTEGER )
remove_child
remove_left_child
remove_right_child
remove_sublist
replace (v: [like item ] CONSTRUCT )
replace_child (n: [like parent ] CONSTRUCT )
search_child (v: [like item ] CONSTRUCT )
semantics
set_optional
split (n: INTEGER )
sprout
swap (i: INTEGER )
twl_merge_left (other: [like Current] VAR )
twl_merge_right (other: [like Current] VAR )
twl_prune (v: [like item ] CONSTRUCT )
unused_pre_action
wipe_out


EiffelNet

Type: Library
Platform: Any
Version: 5.0

See:

  • Content
  • Samples
  • Reference


EiffelNet

  • Introduction
  • Clients and server
  • An overview of EiffelNet mechanisms
  • The predefined level
  • Introduction to the examples
  • Working at the predefined level
  • Obtaining a finer degree of control
  • Using datagram sockets
  • Event-driven command execution
  • A more complexe example


What is EiffelNet

Introduction

What is EiffelNet?

The client-server model of computing is quickly gaining ground as a way of optimizing network resources and of building sophisticated and flexible transactional applications.

The object-oriented method of software development, as embodied in Eiffel, potentially provides ideal support for developing client-server applications. The EiffelNet library described in this report makes this potential a reality by addressing one the crucial needs of client-server development: how to exchange objects between software systems. Systems using EiffelNet can exchange object structures with other systems running on the same machine or on different machines; in the case of different machines, the hardware architectures need not be the same. Objects are transmitted using sockets.

Writing client-server applications, especially their communication aspects, is an arduous task; developers must master many tricky details of socket programming and other low-level mechanisms. EiffelNet hides this complexity by providing ready-made classes addressing the most common cases, so that developers only have to describe what is specific to their application, letting EiffelNet handle the whole process of communication and synchronization between clients and servers. This part of EiffelNet is known as the predefined level and for many uses this is the only one that you will need to learn about. For developments requiring a finer degree of control, all the major mechanisms of socket programming are still accessible in a convenient form through more specialized classes.

In offering these varying levels of abstraction and control, EiffelNet follows the principles set by other libraries of the ISE Eiffel 5 environment (see for example the discussion of EiffelLex in reference [2]). Some users require a mechanism that will be very easy to learn and will hide all the details in common cases; other users (or the same at later stages of their work) need to access the whole array of facilities available at the level of the underlying hardware or software. The various components of the library should address all these needs.

This manual describes how to use EiffelNet at its various levels of abstraction.

Background and prerequisites

EiffelNet is a component of the ISE Eiffel 5 development environment. Please contact your ISE Eiffel distributor or ISE to find out how to acquire EiffelNet if it is not already part of your delivery.

This manual assumes the following prerequisites:

  • Familiarity with the basic Eiffel concepts: classes, inheritance, features, assertions, exception handling (see reference [1]).
  • Experience of writing software with Eiffel.
  • Basic knowledge of the EiffelBase libraries, as described in reference [2].

Familiarity with the basic concepts of client-server computing will also be helpful (see for example reference [3]; if you are new to this area, however, you will still be able to use EiffelNet, as this manual defines all the needed concepts.

Organization of this manual

Section 2 discusses the notion of client and server. Section 3 presents an overview of EiffelNet’s facilities. Section 4 describes the predefined level: a set of high-level classes that provide a complete framework, covering the most common uses and limiting the developer’s work to the strict minimum. Sections 5 to 10 describe the facilities in detail through a set of increasingly ambitious examples (whose texts may all be found in the directory $ISE_EIFFEL/examples/net of the Eiffel distribution). Section 11 is a short bibliography.


Clients and servers

In the client-server model of computing, a number of software systems, the clients, may require general-purpose services provided by other systems, the servers. Clients and servers run concurrently, on the same machine or, more generally, on different machines connected through a network.

Typically, the clients are systems, for example systems that provide useful facilities for human users; the servers take care of operations that clients could not perform on their own (or would perform less efficiently), and of operations that are common to several clients. Example of servers include:

  • Computation servers, which take care of heavy or specialized computations not appropriate for the clients, assuming the servers' processors are more powerful.
  • File servers and database servers, providing access to persistent data that different clients may need to access.

The client-server relation is usually many-to-many: each client application, in the course of performing its duties, may successively require services from different servers; and each server may cater to different clients. This second aspect, illustrated by the following figure, is particularly important; it allows a single server to communicate with as many clients as appropriate.

Although communication occurs both ways - clients sending objects to servers and conversely - the situation in such a scheme is usually not symmetric. Whereas a client requesting a certain service will need to know beforehand what server provides that service, the server, for its part, will not in general name its clients in advance; it will simply stand ready to provide its services to whatever suitable client happens to request them.

This dissymmetry appears clearly in EiffelNet and in the examples of this manual. It means in particular that clients and servers act differently at the beginning of their client-server lifecycle. The party that initiates the communication is the client; in this operation it will identify the desired server (through a local file name for communication on the same machine, or though a machine name for network communication). The server simply makes itself ready for possible connections by starting to "listen" on the communication channels - relying for this on an EiffelNet procedure that is indeed called listen.


An overview of EiffelNet Mechanisms

To enable clients and servers to exchange objects, you will have to ensure that they can refer to a common address. At the predefined level this is really the only notion that you need to know, although it is useful to get the bigger picture, in particular the concept of socket (which enables systems to set up communication channels), the various forms of communication (single-machine versus multi-machine, stream versus datagram), the kinds of object structure that may be exchanged, the notion of packet, and how to associate commands with communication events. The following paragraphs review these ideas and the corresponding EiffelNet abstractions.

Establishing a common address

When two systems need to communicate through sockets, they must establish a binding through some common point of reference, called an address. Predictably, the notion of address is one of the important internal abstractions of EiffelNet, although in most cases developers of applications using EiffelNet do not need to manipulate address objects directly.

EiffelNet supports two modes of communication: single-machine and multi-machine. In the single-machine case, the two communicating systems are known to be running on the same machine. In the multi-machine case, also known as the network case, they may be running on different machines, and communication occurs through a network. These two modes clearly require a different binding mechanism.

When a client and a server reside on the same machine, they both have access to that machine's file system. This provides a straightforward binding mechanism: the common address will simply be a "path name", the Unix terminology for the full name of a file in a hierarchically organized file system. In the examples below this file will be /tmp/here (file here in the /tmp directory, conventionally used for temporary files). This file must not exist prior to the communication; it will be created by the socket mechanisms and then removed.

For the network style of communication, this simple device of using a path name is no longer applicable. To define a common address, we may use two elements of information: the name of a machine, and the indication of a port on that machine. More precisely:

  • The port will be identified by an integer. In the examples below port 2000 will be used.
  • The machine may be identified in either of two ways: its host name (the name assigned to the machine when the operating system was first installed on it) or its Internet address, a sequence of numbers separated by periods, such as 127.0.0.1. EiffelNet routines that need an argument identifying a machine will indifferently take a host name or an Internet address, passed in either case as a string. In the examples below the identification will be a host name, given as the string "serverhost".

In network-style client-server communication, the mechanism will be dissymmetric, reflecting the possibility (noted earlier) of a single server catering to many clients. The clients will state both the machine identification of their intended server and the port on which they will talk to that server. The server, however, will only specify the port; this means that it makes itself available to any client that cares to talk to it on that port. This provides some of the essential flexibility of client-server communication, where only one of the partners needs to state beforehand whom it wants to talk to.

Sockets and communication modes

A software system will exchange objects with another by sending them to a socket. Although if you stay at the predefined level you will not need to manipulate sockets explicitly, it is useful to understand this concept and know about the corresponding EiffelNet classes.

You may think of a socket as a communication port; by attaching sockets together you enable communication between the corresponding systems, for example a client and a server:

EiffelNet has been designed so that sockets look very much like files. You send objects to a socket in the same way that you write objects onto a file, and receive objects from a socket in the same way that you read objects from a file. This fundamental commonality is reflected in the inheritance hierarchy of the corresponding classes:

Note that the hierarchy as shown is not complete; in particular the full structure uses classes STREAM (of which the STREAM_ classes are heirs) and DATAGRAM for multiple inheritance. Only the classes below the dotted line are part of EiffelNet; the others are part of EiffelBase, the fundamental data structure and algorithm library of ISE Eiffel [2].

The most important property of this inheritance hierarchy is that it shows how sockets fit within the overall structure. Thanks to the common ancestor IO_MEDIUM, socket classes have most of their features in common with files.

In normal usage, the only socket classes that you will need are four classes appearing at the bottom of the above figure. They correspond to two separate distinctions: single-machine versus multi-machine, and reliable versus unreliable.

On the first distinction:

  • If the communicating systems run on the same machine, you may use one of the UNIX_ classes.
  • For systems that run on different machines, you must use one of the NETWORK_ classes. This will also work if the systems are on the same machine, but less efficiently since communication may go through the network.

The use of the word UNIX_ does not mean that the machine must be running the Unix operating system; rather, it denotes a certain style of client-server communication, the Unix style. (This is comparable to the use of the name UNIX_FILE in EiffelBase, for a class describing files that behave in the Unix style even though they may be implemented on non-Unix machines.)

The second distinction reflects two modes of socket communication: stream communication and datagram communication. Both of these modes support two-way communication between systems, but with different properties:

  • A stream socket, as provided by the STREAM_<i> classes, provides sequenced communication without any loss or duplication of data. Stream communication is normally synchronous: the sending system waits until it has established a connection to the receiving system and transmitted the data.
  • A datagram socket, as provided by the DATAGRAM_ classes, is asynchronous: the sending system emits its data and does not wait for an acknowledgment. Because the sender is not blocked, this mode is more efficient, but it does not guarantee sequencing, reliability or non-duplication.

Sending and receiving simple values

IO_MEDIUM has all the basic input and output facilities applying to objects of basic types, as also offered in FILE (see the specification of FILE in reference [2]). So you can use sockets to send and receive characters, integers, real numbers in simple or double precision and strings. For example, if the type of `my_socket' is one of the socket classes shown on the preceding figures, any of the above calls will be valid:

my_socket.putstring ("Some text") my_socket.readint; my_last_integer := my_socketllastint

Since sockets are bidirectional, these instructions may all appear as part of the same class provided you make sure to guarantee proper synchronization between senders and receivers. You may also prefer to specialize certain sockets for sending and others for receiving.

Sending and receiving object structures

In many cases, what you will want to send and receive is not just simple values but non-basic objects (instances of arbitrary classes, having as many fields as needed) and, more generally, entire object structures.

The basic mechanism enabling a system to send objects through EiffelNet is also the basic mechanism for storing objects into a file: class STORABLE from EiffelBase.

As documented in [2], STORABLE provides features to store and retrieve complete object structures. There are three storage procedures, called under the respective forms

struct1.basic_store (iom1)
struct1.general_store (iom1)
struct1.independent_store (iom1)

Assuming that the type of iom1 is IO_MEDIUMor a conforming type such as FILE or one of the _SOCKET classes, and that the type of struct1 conforms to STORABLE .

Note that reference [2] in its original version does not include independent_store, and requires iom to be of type FILE rather than the more general IO_MEDIUM. The current version of EiffelBase, however, supports the more general properties described here.

All three storage procedures have the effect of sending to iom1 (whether a file, a socket or some other IO-medium) a copy of the entire object structure starting at struc1. Together with the retrieval routines seen below, they apply the principle of reference completeness stated in [1] and [2]:

Whenever a routine of class STORABLE stores an object into an external file, it stores with it the dependents of that object. Whenever one of the associated retrieval routines retrieves a previously stored object, it also retrieves all its dependents.

For EiffelNet, of course, "storing" and "retrieving" mean sending and receiving. The rest of this section, which applies to sockets as well as to files, will continue to use the original terminology of storage and retrieval.

The three storage procedures differ in their degree of generality:

  • basic_store will only work if the sending and retrieving are performed by instances of the same system (the same executable module).
  • general_store will work if the sender and retriever are different systems (using the same classes for the objects that they exchange), but these systems must run on machines of the same architecture, or at least of architectures that use the same data representation.
  • independent_store will work in the most general case, with the sender and receiver possibly running on platforms using different data representations.

The penalty for using more general representations is that the data representation (as stored into the file or sent to the socket) will have to include more information. So basic_store uses the most compact representation, and independent_store the most verbose.

The scheme for accessing an object structure produced by one of these three procedures is the following, used in a descendant of class STORABLE:

    struct2 ?= retrieved (iom2)

Here iom2 must be of a type conforming to IO_MEDIUM. The assignment attempt ?= checks that the root object of the structure produced by the corresponding call to one of the _store procedures is of a type that conforms to the type of struct2; if not, the assignment will assign to struct2 a void reference.

Although there are three separate storage procedures, there is only one retrieval routine, retrieved; the algorithm for retrieved is able to figure out, from the format of the retrieved objects, whether they were produced in the basic, general or independent mode.

Packets

The classes PACKET and DATAGRAM_PACKET are used to represent packets of data that can be sent to sockets.

Their main use is for a system that relies on datagram communication. As noted above, this mode does not guarantee sequencing, making each system responsible for checking that packets arrive in the proper order. This is possible through feature number of class DATAGRAM_PACKET, which gives the number of the current packet.

Associating commands with events

EiffelNet supports a highly asynchronous (and hence efficient) mode of operation by offering mechanisms through which you can specify that a certain action must be executed whenever a certain medium becomes available for reading, writing or handling of special cases (out of bounds). This facility is provided by a set of related classes:

  • The actions are represented by class POLL_COMMAND, an heir of the EiffelBase class COMMAND with, in particular, the procedure execute.
  • Using MEDIUM_POLLER, you can specify that a certain command (an instance of POLL_COMMAND) must be executed whenever a certain medium becomes available for the appropriate operation (read, write, handling of out-of-bounds cases).
  • Using POLL_MASK, you can set a mask to select the sockets or files on which your instance of MEDIUM_POLLER is working.


The predefined level

Many client-server applications follow a standard scheme that relies on the facilities outlined so far. When your application conforms to this scheme, you can avoid most of the work by relying on the client and server classes of the predefined level. There is no need to consider sockets explicitly or to worry about synchronization.

As in many other cases found in the ISE Eiffel 5 libraries, the object-oriented method makes it possible here to encapsulate the standard pattern found in most usual cases.

The predefined client and server classes

The classes of the predefined level, which only support stream communication (not datagrams), are CLIENT, SERVER, and their descendants UNIX_CLIENT, UNIX_SERVER, NETWORK_CLIENT and NETWORK_SERVER. All the architecture of a client-server application is already available through these classes. All you have to do is to specify the address you want to use, what you want to send, when you want to send it, and what you want to do when you receive data. The rest will be taken care of automatically.

The UNIX_ classes are meant for systems running on the same machine, using UNIX_STREAM_SOCKET; the NETWORK_ classes support inter-machine communication, using NETWORK_SOCKET.

Using the client classes

When you want to write an application, your client should inherit from UNIX_CLIENT for example, and in your creation procedure, you have to setup your address, and then call the inherited make routine, with your address as an argument. You are then provided with some send and receive routines.

Using the server classes

For the server, you inherit for example from UNIX_SERVER. In the same way as for the client, you set up your address in the creation procedure, and then call the make creation procedure inherited from UNIX_SERVER. After that your creation procedure should call execute, which is inherited from SERVER, and provides you with a loop calling receive, process_message, respond and clean_up. Then, you should redefine these routines to do what you want your server to do.


Introduction to the examples

The following sections describe a set of examples showing how to use EiffelNet to build client-server applications.

The examples start with the most simple uses involving high-level classes covering common cases and shielding developers from details of the mechanism. Subsequent examples will reveal some of these details, useful for more advanced or specific applications of EiffelNet.

All the examples discussed here appear in the directory $ISE_EIFFEL/examples/net of the Eiffel distribution.

Caution: On Windows, the `advanced' and the `same_mach' are not working since they are using specific code to Unix Operating systems.


Working at predefined level

The example classes discussed in this section appear in the subdirectory predef of the example directory

The first example shows how to use the predefined level classes, covering many common client-server schemes. The work needed in this case is minimal: just effect or redefine a few routines describing the specific processing that your client and your server require.

The example

The example describes a simple communication protocol. The client sends to the server a list of strings, which together form the message "This is my test"; the server receives the corresponding object structure, appends to it one more element - the string "I'm back" - and returns the result to the client, which will accept it and print it. The server increases a counter each time it closes a connection with a client, and will only accept three connections.

Object structures

As noted above, it is possible with sockets, as any other IO_MEDIUM, to send and receive simple objects such as integers. But for this first example we are already more ambitious and want to exchange entire linked lists of strings. The structures that we will exchange are described by the following class:

    class
        OUR_MESSAGE

    inherit

        LINKED_LIST [STRING]

        STORABLE

    creation
           make

    end

Note that to make use of the storage and retrieval facilities the objects to be exchanged must be instances of a class which, as here, is a descendant of STORABLE.

Application classes and system structure

The client and server mechanisms will be described by instances of two classes that make up the example, called OUR_CLIENT and OUR_SERVER.

We want to have the two communicating systems be two different systems (compiled separately, with two separate Ace files). OUR_CLIENT will be part of one of these systems; OUR_SERVER will be part of the other.

There are four predefined classes, corresponding to the client and server sides with, in each case, the choice between the "Unix" (single-machine) and "network" (multi-machine) styles of communication. Note that all these classes support stream communication; for datagrams, see using datagram sockets. The server class should inherit from UNIX_SERVER or NETWORK_SERVER; the client class should inherit from UNIX_CLIENT or NETWORK_CLIENT. The choice between UNIX_ and NETWORK_ classes must of course be the same on both sides.

The client

Here is the client class:

    class
        OUR_CLIENT

    inherit

        UNIX_CLIENT
              redefine
                received
                end

    creation
       make_client

    feature

    our_list: OUR_MESSAGE

    received: OUR_MESSAGE
            -- Type redefinition

    make_client is
            -- Build list, send it, receive modified list, and print it.
    do
            make ("/tmp/here")
         build_list
            send (our_list)
            receive
        process_received
        cleanup
     rescue
        cleanup
    end

    build_list is
            -- Build list of strings our_list for transmission to server.
        do
            create our_list.make;
             our_list.extend ("This "); our_list.extend ("is ")
             our_list.extend ("our "); our_list.extend ("test")
            end
    process_received is
             -- Print the contents of received in sequence.
        do
            if received = Void then
                io.putstring ("No list received")
            else
                from
                    received.start
                until
                    received.after
                loop
                    io.putstring (received.item)
                    received.forth
                end
            end
            io.new_line
            end

    end

The scheme is very simple:

  • The inherited procedure make takes care of the many details of creating a socket and setting up the communication; the following sections will give some insight into what this involves. The argument to make is the path name that has been selected to enable communication with the server: /tmp/here.
  • The client has defined a procedure build_list to construct an object structure.
  • It then uses the inherited procedure send to send this object structure to the server; send expects an argument of a type conforming to STORABLE, so that it can use all the predefined storage and retrieval facilities.
  • The receive procedure, called next, obtains an object structure from the server; here, as will be seen from the server's text below, this is the original list to which the server has appended a new element. The result of procedure receive is available through feature received. To avoid the need for an assignment attempt (as with the result of a retrieve operation with STORABLE) the class redefines received to be of type STORABLE.
  • The client has defined a procedure process_received to print the received string.
  • Finally, a call to cleanup is necessary to close the sockets that have been opened and free the corresponding resources.

Of course, in a typical object-oriented design, the class and those which appear in the rest of this set of examples may "do" more than one thing and so may have more routines than the ones shown in this document.

This example shows how to write a client class in the most common cases: inherit from UNIX_CLIENTor NETWORK_CLIENT; use make to specify the socket address, send to send an object structure, receive to receive an object structure, received to access it, and cleanup to clean things up.

There would be one difference for a NETWORK_CLIENT: procedure make would need two arguments, the name of a host and a port on that host. For example, to connect to a server running on a machine of name serverhost and using port 2000, the call would be:

make ("serverhost", 2000)

As noted earlier, you may identify the machine by an Internet address such as "127.0.0.1" rather than by a host name.

The server

Now, the server class:

    class
        OUR_SERVER

    inherit

        UNIX_SERVER
        redefine
            received, respond
         end

    creation
        make_server

    feature

        received: OUR_MESSAGE

        make_server is
                -- Receive list, print it, extend it, and send the result back.
            do
                     make ("/tmp/here")
                execute
                rescue
                cleanup
                end

        process_message is
                -- Print received list.
            do
                from
                    received.start
                until
                    received.after
                    loop
                    io.putstring (received.item)
                    received.forth
                    end
                io.new_line
            end

        respond is
                -- Extend received list.
            do
                 received.extend ("%N I'm back.%N")
                resend (received)
                end

    end

The developer's task is even easier here than on the client side. The last instruction in the creation procedure is execute, inherited from the chosen _SERVER class, which executes a loop that will repeatedly call receive, process_message, respond and close. This loop is actually an infinite one, which will only terminate if the server is killed (in which case a Rescue clause will execute procedure cleanup); indeed, a server is not expected to terminate under normal circumstances.

To define a server's behavior as desired for your particular application, all you are required to do is to effect the procedure process_message, inherited from the _SERVER class in deferred form. (Remember that to "effect" a deferred feature is to provide a non-deferred version, also called an effective version.) Here the effective version prints the list of strings received from the client.

In addition, you may also, as here, redefine procedure respond. In the _SERVER class this procedure is effective, but it does nothing; this means that you have nothing special to do for the common case in which the server does not respond when it has received a message. Here, however, we do want to respond; the redefined version of respond extends the received string and returns it. Procedure resend sends an object structure back to the last connected client. It is also possible to have more sophisticated versions of respond, for example to dispatch objects to all active clients; this will be shown in a later example

As in the client case there is a cleanup procedure to free the sockets, but you do not need to call it explicitly; it is called by execute. You may redefine this procedure to free some additional resources of your own.


Obtaining a finer degree of control

Let us now take a more internal look at the workings of EiffelNet. The two examples that follow have the same behavior as the preceding one; since their text is less simple, they are only interesting as an illustration of the lower-level facilities that you may want to use in specific cases. If you are already familiar with socket programming, they will also give you a more precise idea of how EiffelNet encapsulates the basic socket mechanisms.

As before, we have a client and a server class, still called OUR_CLIENT and OUR_SERVER, which are part of two different systems and will run concurrently. The communication uses streams rather than datagrams; the datagram form of communication will be examined in section using datagram sockets.

A client and a server on the same machine

The example classes discussed in this section appear in the subdirectory same_mach of the example directory

First, let us assume that the client and server run on the same machine, so that we will use the UNIX_ versions of the classes (the next example will be multi-machine). The communication protocol is also the same as before: the client sends a list of strings, the server returns it extended.

Here we will create and manipulate sockets directly. For that reason, both classes inherit from the EiffelNet class SOCKET_RESOURCES which introduces a number of constants and other useful socket-related features.

The two sockets must be able to refer to a common address. For a communication within a single machine, as noted, this address is a path name, again /tmp/here for this example. The address will be an argument of the creation procedure used to obtain a socket soc1 on either side:

create soc1.make_client ("/tmp/here")
create soc1.make_server ("/tmp/here")

The make_ procedures take care of all the hassles of establishing a socket for a client or a server: creating an address object, setting it to the given path name, binding the socket to the address, and in the client case establishing the connection. For finer control, these procedures are still available: you can create a bare socket by using the basic creation procedure make (rather than the more sophisticated make_client and make_server), then create a separate address object, associate the two, and call the bind and connect procedures.

Because communication is bidirectional, the distinction between client and server is not between who sends and who receives, although here the server only sends messages of acknowledgment. The client is the party that initiates the communication; the server is the party which stands ready to accept the communication. This difference justifies the presence of two creation procedures make_client and make_server as illustrated above. To initiate the communication, the client will execute:

soc1.connect

To make itself ready for the communication, the server will execute:

soc1.listen (n)

where n is a positive integer indicating the maximum number of client connection attempts that may be queued. The value 5, used in the example, is typical for n.

When you use the _SERVER classes of the predefined level, as in the earlier example, 5 is indeed the default; you can change the value to a positive integer n through the call set_queued (n).

Whenever the server needs to exchange objects with one of the clients, it obtains access to the socket through the following sequence:

soc1.accept
soc2 := soc1.accepted
... Storage and retrieval operations using soc2 (not soc1) ...
soc2.close

Procedure accept ensures synchronization with the client. When communication is established, accept creates a new socket which will be accessible through attribute accepted, whose value is here assigned to the local entity soc2. To receive objects, the server will use operations of the form introduced earlier (An overview of EiffelNet, sending and receiving object structures):

struct ?= soc2.retrieved

applying to soc2, not soc1; this makes soc1 available to accept connections with other clients, a fundamental feature of client-server mechanisms.

The operation soc2.close which terminates the above sequence closes the new socket. In principle this is not necessary, since garbage collection should eventually reclaim the socket object, and the dispose procedure of the corresponding socket class includes a call to close. But the risk exists that you run out of sockets before garbage collection reclaims all currently opened sockets, so it is preferable to include the close calls explicitly.

At the end of the processing it is necessary to close the original socket soc1 but also to unlink it. The feature cleanup from class SOCKET takes care of both closing and unlinking.

Here is the server class based on these principles. The actual processing has been put aside in a procedure process.

    class
        OUR_SERVER

    inherit

        SOCKET_RESOURCES

        STORABLE

    creation
        make

    feature

        soc1, soc2: UNIX_STREAM_SOCKET

        make is
                -- Accept communication with client and exchange messages<
             local
                count: INTEGER
             do
                 create soc1.make_server ("/tmp/here")
                 from
                    soc1listen (5)
                    count := 0
                 until
                    count = 3
                 loop
                    process -- See below
                    count := count + 1
                 end
                soc1.cleanup
             rescue
                soc1.cleanup
            end

    process is
            -- Receive a message, extend it, and send it back
        local
            our_new_list: OUR_MESSAGE
        do
            soc1.accept
            soc2 ?= soc1.accepted
            our_new_list ?= retrieved (soc2)
             from
                our_new_list.start
             until
                our_new_list.after
             loop
                io.putstring (our_new_list.item)
                io.new_line
                our_new_list.forth
             end
            our_new_list.extend ("%N I'm back.%N")
            our_new_list.general_store (soc2)
            soc2.close
        end

    end

Note that at the end the server should not only closes the original socket soc1 but also unlinks it. It is recommended to have a Rescue clause which, as here, ensures that the socket will be closed and unlinked if the system terminates abnormally before its term.

Here now is the client class:

    class
        OUR_CLIENT

    inherit

          SOCKET_RESOURCES

    creation
        make

    feature

        soc1: UNIX_STREAM_SOCKET

        make is
                -- Establish communication with server, and exchange messages
             do
                create soc1.make_client ("/tmp/here")
                soc1.connect
                process -- See below
                soc1.cleanup
             rescue
                soc1.cleanup
            end

        process is
                -- Build a message to server, receive answer, build
                -- modified message from that answer, and print it.
             local
                our_list, our_new_list: OUR_MESSAGE
             do
                 create our_list.make
                our_list.extend("This"); our_list.extend (" is")
                our_list.extend (" our"); our_list.extend (" test")
                our_list.general_store (soc1)
                our_new_list ?= soc1.retrieved
                 from
                    our_new_list.start
                 until
                    our_new_list.after
                 loop
                    io.putstring (our_new_list.item)
                    our_new_list.forth
                 end
                io.new_line
            end

    end

Communication between two different machines

The example classes discussed in this section appear in the subdirectory two_mach of the example directory

Let us now assume that the client and the server will run on two separate machines. Instead of UNIX_ sockets, we must now use sockets of type NETWORK_STREAM_SOCKET.

The available creation procedures are slightly different. The server will be set up so as to listen to clients from any machine; it designates a port, identified by an integer, on which it will listen. The socket creation on the server side is then

create soc1.make_server_port (2000)

For the client, the creation will specify two elements of information: the port number and the server. The server argument, a string, identifies the machine used as a server; it may be the host name of that machine, for example "serverhost" as used in the example; or it can be the machine's internet address, made of a sequence of numbers separated by periods, such as "127.0.0.1".

The rest of the classes is as before.

    class
        OUR_SERVER

    inherit

        SOCKET_RESOURCES

        STORABLE

    creation
        make

    feature

        soc1, soc2: NETWORK_STREAM_SOCKET

        make is
                -- Accept communication with client and exchange messages.
             do
                 create soc1.make_server_by_port (2000)
                ... The rest as before...
             end

        process is
            ... As before ...
        end

    end

    class
        OUR_CLIENT

    inherit

        SOCKET_RESOURCES

    creation
        make

    feature

        soc1: NETWORK_STREAM_SOCKET

        make is
             do
                 create soc1.make_client_by_port (2000, "serverhost")
                ... The rest as before ...
            end

            process is
                ... As before ...
            end

    end


Using datagram sockets

The example classes discussed in this section appear in the subdirectory datagram of the example directory

Using datagram sockets implies a few differences from the preceding schemes. You create a NETWORK_DATAGRAM_SOCKET or a UNIX_DATAGRAM_SOCKET as before. You do not need to call listen, accept or connect. Once you have created your sockets using the make_client or make_server creation procedure, you can use the send and received routines, specifying the socket to which you want to send, or from which you want to receive.

The command send takes an argument of type DATAGRAM_PACKET, and the query received returns a result of this type. DATAGRAM_PACKET is an heir of class PACKET, itself an heir of ARRAY [CHARACTER]. Class DATAGRAM_PACKET makes it possible, through the query number and the associated command set_number, to associate a packet number with each packet. This compensates for lack of guaranteed sequencing of datagram sockets: the sender can number packets through set_number, and the receiver can check that all packets have been received through number, asking the sender to re-emit missing objects.

The text of this example is similar to what appears below (in a more general setting involving event-driven computation) for the next example.


Event-driven command execution

The example classes discussed in this section appear in the subdirectory polling of the example directory

9.1 Commands and events

In the preceding examples each participant in a communication had to get ready to send or receive at specific stages of its life. Although this did not preclude asynchronous communication, it is sometimes desirable to make the scheme even more asynchronous, and control more decentralized, by letting each system simply specify certain communication events that it wants to monitor, and certain commands to be executed on occurrence of the specified events.

This event-command model of computation is of course not new with EiffelNet. In ISE Eiffel 3, it is already used in EiffelVision and especially in EiffelBuild, which makes it possible to build a graphical application by specifying which command should be executed in response to each of a set of specified interface events, such as mouse click or keyboard entry. The commands are objects, instances of a general-purpose class COMMAND or its proper descendants. Class COMMAND has, among its features, a procedure execute which executes the current command; some commands are undoable and have an undo procedure.

Class COMMAND and related classes used to be in EiffelVision but because of their generality were moved to [2], although this occurred after the publication of [2].

In EiffelNet the possible events associated with a socket will be of three kind: a read event; a write event; or a special event (out of bounds operation). The command classes will be descendants of POLL_COMMAND, an heir of COMMAND.

9.2 Command classes

The example uses four command classes: CLIENT_DATAGRAM_READER, CLIENT_DATAGRAM_WRITER and their counterpart for servers, representing operations that must be triggered in the case of a read event and a write event.

Here is the reader command for clients:

    class
        CLIENT_DATAGRAM_READER

    inherit

        POLL_COMMAND
        redefine
            active_medium
        end

    creation
        make

    feature

        active_medium: NETWORK_DATAGRAM_SOCKET

        execute is
                -- Obtain a packet of ten characters and print them.
            local
                rec_pack: DATAGRAM_PACKET
                i: INTEGER
            do
                rec_pack := active_medium.received (10, 0)
                io.putint (rec_pack.packet_number)
                io.new_line
                from
                    i := 0
                until
                    i > 9
                loop
                    io.putchar (rec_pack.element (i)); i := i + 1
                end
                    io.new_line
                end

    end

The execute procedure reads a packet of ten characters and prints these characters. Its counterpart in the writing command will produce these ten packets:

    class
        CLIENT_DATAGRAM_WRITER

    inherit

        POLL_COMMAND
            redefine
                active_medium
            end

        BASIC_ROUTINES

    creation
        make

    feature

        active_medium: NETWORK_DATAGRAM_SOCKET

        execute is
                -- Make a packet with characters 'a' to 'k' in successive positions.
            local
                sen_pack: DATAGRAM_PACKET
                ccode: INTEGER
            do
                create sen_pack.make (10)
                from
                    ccode := charcode ('a')
                until
                    ccode > charcode ('k')
                loop
                    sen_pack.put_element (charconv (ccode), ccode -- charcode ('a'))
                    ccode := ccode + 1
                end
                sen_pack.set_packet_number (1)
                active_medium.send (sen_pack, Void, 0)
            end

    end

9.3 The server and the client

Once the commands have been defined, it suffices for the server and the client to associate instances of these commands with the appropriate.

The abstraction needed for this purpose is provided by class MEDIUM_POLLER. An instance of this class knows about a number of commands, each associated with a certain socket in read, write or special event mode. By applying procedure execute to such a medium poller, you direct it to monitor these sockets for the corresponding events and to execute the command associated with each event that will be received. Procedure execute takes two integer arguments: the maximum number of sockets to monitor, and the timeout in milliseconds.

Here is the server built with this mechanism:

    class

        POLLING_SERVER

    creation
        make

    feature

        make is
                -- Create read and write commands, attach them to a poller,
                -- set up the poller for execution.
            local
                soc: NETWORK_DATAGRAM_SOCKET
                poller: MEDIUM_POLLER
                readcomm: SERVER_DATAGRAM_READER
                writecomm: SERVER_DATAGRAM_WRITER
            do
                create soc.make_server_by_port (6530)
                create poller.make
                create readcomm.make (soc); poller.put_read_command (readcomm)
                create writecomm.make (soc); poller.put_write_command (writecomm)
                poller.make_read_only; poller.execute (15, 20000)
                poller.make_write_only; poller.execute (15, 20000)
                soc.close
                end

    end

Procedure make creates three objects: a socket, which it associates with a specific port; a poller; and a read command (an instance of SERVER_DATAGRAM_READER), which it attaches to the socket. It then enters the read command into the poller, and does the same thing with a write command. It sets up the poller to accept read commands only and then executes the poller; this will enable the server to get the read event triggered by the client's write command (as it appears below in the text of class POLLING_CLIENT). Then the server reverses the poller's set-up to write-only, and calls execute again.

The procedures make_read_only and make_write_only are creation procedures, so that it is possible in a single instruction to create a poller and set it up for read-only or write-only, as in create pollerlmake_read_only. For clarity, however, the above class and the next separate calls to these procedures from the creation of the poller, which uses make as creation procedure.

The client follows the same scheme, reversing the order of read and write operations:

    class

        POLLING_CLIENT

    creation
        make

    feature

        make is
                -- Create read and write commands, attach them to a poller,
                -- set up the poller for execution.
            local
                soc: NETWORK_DATAGRAM_SOCKET
                poller: MEDIUM_POLLER
                readcomm: DATAGRAM_READER
                writecomm: DATAGRAM_WRITER
            do
                create soc.make_client_by_port (6530, "serverhost")
                create poller.make
                create readcomm.make (soc)
                poller.put_read_command (readcomm)
                create writecomm.make (soc)
                poller.put_write_command (writecomm)
                poller.make_write_only
                poller.execute (15, 20000)
                poller.make_read_only
                poller.execute (15, 20000)
                soc.close
            rescue
                if soc /= Void and then not soc.is_closed then
                    soc.close
                end
            end

    end

9.4 A less deterministic scheme

Although the example uses the event-driven mechanisms of EiffelNet, it is still relatively deterministic in that it follows a precise protocol defined by a strict sequence of read and write operations on both sides. This is why every call to execute is preceded by a call to either make_read_only or make_write_only to set up the poller in the appropriate mode.

A less deterministic scheme may often be desirable, where you simply enter a number of commands (read, write, out of bounds processing) into a poller and then wait for arbitrary events to occur and trigger commands. There is no need with this scheme to know in advance the order in which events may occur: a read event will trigger the command entered into the poller through put_read_command; a write event will trigger the command entered through put_write_command.

To achieve this behavior, simply create the poller using make as creation procedure. This will set up the poller so as to accept all socket events, and enter into event-driven command execution by calling execute on the poller.


A more complex example

The example classes discussed in this section appear in the subdirectory advanced of the example directory

The last example exercises most of EiffelNet's major facilities. It consists of a server that allows an arbitrary number of clients to connect to it. Each time the user of one of the client systems types a line on the keyboard, the client sends this character to the server, which then broadcasts it to all the clients (including the original sender). This scheme allows several people to talk together, hence the names chosen: the server class is called CHAT, and the client is called JOIN.

The example uses the network mode of communication, based on the NETWORK_CLIENT and NETWORK_SERVER classes. It uses automatic polling through MEDIUM_POLLER as in the previous example; the relevant command is given by class CONNECTION, an heir of POLL_COMMAND. The information exchanged between the server and its clients is described by class MESSAGE, an heir of LINKED_LIST [STRING] similar to the earlier examples' OUR_MESSAGE (see see "Object structures", 6.2 , page 14). Attributes include, the name client_name of the client that has sent this message, the boolean new indicating whether the current message is the first from a client that is trying to connect to the server, and over indicating that the message is the last sent by a client before disconnecting.

The server maintains a list of the currently active connections. In the receive routine, it checks on the main socket for any client trying to connect. The socket is set to be non-blocking to enable the server to continue checking the already connected clients. If the connection is successful, the server sends to the new client the list of clients already connected and adds the new connection to its list. Then it polls the connections in the list, and processes the messages, if any. If the message is tagged new, the server sends a message to all the clients indicating that a new client has joined the server; if it is tagged over, it sends a message indicating that the client has opted out.

Each client uses the MEDIUM_POLLER to check any message coming from the server and immediately displays any such message. It also checks a special connection, created with iolinput as a medium, to check what the user is typing and then send it to the server. If the user types bye, the client terminates, sending a message tagged over to the server.


Bibliography

11 BIBLIOGRAPHY

[1] Bertrand Meyer: Eiffel: The Language, Prentice Hall, 1992. (Available from ISE.)

[2] Bertrand Meyer: Reusable Software: The Base Object-Oriented Component Libraries, Prentice Hall, 1994. (Available from ISE and included in the standard delivery of ISE Eiffel.)

[3] W. Richard Stevens: Unix Network Programming, Prentice Hall, 1990.


EiffelNet Content Introduction

Description

Version: 5.0

Availability: Basic Package.


cluster net

Cluster
    net

Subclusters
    net.abstract
    net.local
    net.mail
    net.network
    net.polling
    net.transfer


cluster net.abstract

Cluster
    net.abstract

Supercluster
    net

Subclusters
    net.abstract.client_server
    net.abstract.socket


cluster net.abstract.client_server

Cluster
    net.abstract.client_server

Supercluster
    net.abstract

Classes
    CLIENT
    SERVER


CLIENT Chart

deferred class
    CLIENT

General
    cluster: net.abstract.client_server
    description: "A client for a socket."

Ancestors
    SOCKET_RESOURCES

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    in_out: SOCKET
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    received: ANY
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    cleanup
    receive
    send (msg: ANY)


CLIENT Flat contracts

indexing
    description: "A client for a socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    CLIENT

feature -- Access

    cleanup
            -- Cleanup client.

    in_out: SOCKET
            -- Receive and send socket.

    receive
            -- Receive message.

    received: ANY
            -- message received on in

    send (msg: ANY)
            -- Send msg.

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CLIENT


SERVER Chart

deferred class
    SERVER

General
    cluster: net.abstract.client_server
    description: "A server for a socket."

Ancestors
    SOCKET_RESOURCES

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    in: SOCKET
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    outflow: [like in] SOCKET
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    queued: INTEGER
    received: ANY
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    cleanup
    close
    execute
    process_message
    receive
    resend (msg: ANY)
    respond
    set_queued (n: INTEGER)


SERVER Flat contracts

indexing
    description: "A server for a socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SERVER

feature -- Access

    cleanup
            -- Cleanup server.

    close
            -- Close sockets.

    execute
            -- Execute transfer loop.

    in: SOCKET
            -- Listen socket

    outflow: like in
            -- Service socket

    process_message
            -- Process the received message.

    queued: INTEGER

    receive
            -- Receive message.

    received: ANY
            -- Last message from socket

    resend (msg: ANY)
            -- Resend msg.

    respond
            -- Respond to client.

    set_queued (n: INTEGER)
            -- Set queued to n.
        require
            valid_queue_number: n > 0 and n < 6
        ensure
            assigned_queued: queued = n

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SERVER


cluster net.abstract.socket

Cluster
    net.abstract.socket

Supercluster
    net.abstract

Classes
    DATAGRAM_PACKET
    DATAGRAM_SOCKET
    PACKET
    SOCKET
    SOCKET_ADDRESS
    SOCKET_RESOURCES
    STREAM_SOCKET


DATAGRAM_PACKET Chart

class
    DATAGRAM_PACKET

General
    cluster: net.abstract.socket
    description: "A datagram packet for use with datagram sockets."
    create: make

Ancestors
    PACKET
    PACKET

Queries
    c_int32_max: INTEGER
    c_int32_min: INTEGER
    count: INTEGER
    data: SPECIAL [CHARACTER]
    data_area_size: INTEGER
    data_info: PACKET
    element (pos: INTEGER): CHARACTER
    is_equal (other: [like Current] DATAGRAM_PACKET): BOOLEAN
    packet_number: INTEGER
    valid_position (pos: INTEGER): BOOLEAN

Commands
    copy (other: [like Current] DATAGRAM_PACKET)
    make (size: INTEGER)
    old_make (size: INTEGER)
    put_element (an_item: CHARACTER; pos: INTEGER)
    set_data (p: PACKET)
    set_packet_number (n: INTEGER)


DATAGRAM_PACKET Flat contracts

indexing
    description: "A datagram packet for use with datagram sockets."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    DATAGRAM_PACKET

create

    make (size: INTEGER)
            -- Create a packet of buffer size size.
        require -- from PACKET
            valid_size: size >= 0

feature -- Initialization

    make (size: INTEGER)
            -- Create a packet of buffer size size.
        require -- from PACKET
            valid_size: size >= 0

    old_make (size: INTEGER)
            -- Create a packet.
            -- (from PACKET)
        require -- from PACKET
            valid_size: size >= 0

feature -- Access

    data: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    count: INTEGER
            -- Number of elements in packet
            -- (from PACKET)

    data_area_size: INTEGER
            -- Size of packet buffer

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is current packet equal to other?
            -- (from PACKET)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying characters of other.
            -- (This is also used by clone)
            -- (from PACKET)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from PACKET
            size_valid: count = other.count

feature -- Externals

    c_int32_max: INTEGER
            -- Max value for signed integer 32 bits

    c_int32_min: INTEGER
            -- Min value for a signed integer 32 bits

feature -- Status_report

    data_info: PACKET
            -- Return received data packet.

    element (pos: INTEGER): CHARACTER
            -- Element located at data position pos
        require -- from PACKET
            pos_valid: valid_position (pos)

    packet_number: INTEGER
            -- Packet number of this packet
        require
            data_not_void: data /= void

    valid_position (pos: INTEGER): BOOLEAN
            -- Is the position pos a valid data position?

feature -- Status_setting

    put_element (an_item: CHARACTER; pos: INTEGER)
            -- Put an_item at data position pos.
        require -- from PACKET
            pos_valid: valid_position (pos)
        ensure then
            element_put: element (pos) = an_item

    set_data (p: PACKET)
            -- Set the data area of p into the current data area.
        require
            large_enough: p /= void and then p.count <= data_area_size

    set_packet_number (n: INTEGER)
            -- Set packet number of current packet.
        require
            number_big_enough: n >= c_int32_min
            number_small_enough: n <= c_int32_max
        ensure
            number_set: packet_number = n

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from PACKET
    data_not_equal_void: data /= void

end -- class DATAGRAM_PACKET


DATAGRAM_SOCKET Chart

deferred class
    DATAGRAM_SOCKET

General
    cluster: net.abstract.socket
    description: "A datagram socket."

Ancestors
    SOCKET

Queries
    address: SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    bound: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    peer_address: [like address] SOCKET_ADDRESS
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    received (size, flags: INTEGER): DATAGRAM_PACKET
    retrieved: ANY
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    support_storable: BOOLEAN
    type: INTEGER
    zero_option: BOOLEAN

Commands
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    connect_to_peer (a_peer_address: [like address] SOCKET_ADDRESS)
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    make
    make_bound_to_address (a_local_address: [like address] SOCKET_ADDRESS)
    make_connected_to_peer (a_peer_address: [like address] SOCKET_ADDRESS)
    make_socket
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    send_to (a_packet: DATAGRAM_PACKET; to_address: SOCKET_ADDRESS; flags: INTEGER)
    set_address (addr: [like address] SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_send_buf_size (s: INTEGER)
    socket_bind
    socket_close
    write (a_packet: PACKET)


DATAGRAM_SOCKET Flat contracts

indexing
    description: "A datagram socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DATAGRAM_SOCKET

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
            -- (from SOCKET)
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    bound: BOOLEAN
            -- Has socket been bound?

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
            -- Is addr a valid peer address?
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel structure?
            -- (from SOCKET)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    name: STRING
            -- Socket name
            -- (from SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists

feature -- Basic operations

    bind
            -- Bind socket to a local address.

    close
            -- Close socket.

    connect_to_peer (a_peer_address: like address)
            -- Target socket to a_peer_address.
        require
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Basic commands

    address: SOCKET_ADDRESS
            -- Local address of socket
            -- (from SOCKET)

    socket_bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    cleanup
            -- Cleanup socket.
            -- (from SOCKET)

    socket_close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Creation

    make
            -- Create a domain typed socket

    make_bound_to_address (a_local_address: like address)
            -- Create a socket bound to its well-known address
            -- local_address.

    make_connected_to_peer (a_peer_address: like address)
            -- Create a socket targeted to peer_address.

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    received (size: INTEGER; flags: INTEGER): DATAGRAM_PACKET
            -- Receive a packet.
            -- Who from is put into the peer_address.
        require
            socket_exists: exists
            opened_for_read: is_open_read
        ensure
            known_address: peer_address /= void

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Send boolean b through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_character (c: CHARACTER)
            -- Send character c through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_double (d: DOUBLE)
            -- Send double d through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_integer (i: INTEGER)
            -- Send integer i through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Send real r through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_string (s: STRING)
            -- Send string s through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putbool (b: BOOLEAN)
            -- Send boolean b through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putchar (c: CHARACTER)
            -- Send character c through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putdouble (d: DOUBLE)
            -- Send double d through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putint (i: INTEGER)
            -- Send integer i through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putreal (r: REAL)
            -- Send real r through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putstring (s: STRING)
            -- Send string s through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a_packet to address in peer_address.
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    send_to (a_packet: DATAGRAM_PACKET; to_address: SOCKET_ADDRESS; flags: INTEGER)
            -- Send a_packet to address to_address
        require
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: to_address /= void
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATAGRAM_SOCKET


PACKET Chart

class
    PACKET

General
    cluster: net.abstract.socket
    description: "A data packet for sending and receiving on a socket."
    create: make

Ancestors
    TO_SPECIAL [T]
    TO_SPECIAL [T]

Queries
    count: INTEGER
    data: SPECIAL [CHARACTER]
    element (pos: INTEGER): CHARACTER
    is_equal (other: [like Current] PACKET): BOOLEAN
    valid_position (pos: INTEGER): BOOLEAN

Commands
    copy (other: [like Current] PACKET)
    make (size: INTEGER)
    put_element (an_item: CHARACTER; pos: INTEGER)

Constraints
    data not equal void


PACKET Flat contracts

indexing
    description: "A data packet for sending and receiving on a socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    PACKET

create

    make (size: INTEGER)
            -- Create a packet.
        require
            valid_size: size >= 0

feature -- Initialization

    make (size: INTEGER)
            -- Create a packet.
        require
            valid_size: size >= 0

feature -- Access

    data: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    element (pos: INTEGER): CHARACTER
            -- Element at position pos
        require
            pos_valid: valid_position (pos)

feature -- Measurement

    count: INTEGER
            -- Number of elements in packet

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is current packet equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    valid_position (pos: INTEGER): BOOLEAN
            -- Is position pos valid for this packet?

feature -- Element change

    put_element (an_item: CHARACTER; pos: INTEGER)
            -- Put element an_item at position pos.
            -- Fist element has position 0.
        require
            pos_valid: valid_position (pos)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying characters of other.
            -- (This is also used by clone)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            size_valid: count = other.count

invariant

    data_not_equal_void: data /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class PACKET


SOCKET_ADDRESS Chart

class
    SOCKET_ADDRESS

General
    cluster: net.abstract.socket
    description: "A socket address."
    create: make

Ancestors
    TO_SPECIAL [T]
    TO_SPECIAL [T]

Queries
    count: INTEGER
    family: INTEGER
    is_equal (other: [like Current] SOCKET_ADDRESS): BOOLEAN
    socket_address: SPECIAL [CHARACTER]

Commands
    copy (other: [like Current] SOCKET_ADDRESS)
    make
    set_family (f: INTEGER)


SOCKET_ADDRESS Flat contracts

indexing
    description: "A socket address."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    SOCKET_ADDRESS

create

    make
            -- Make space available for address size.

feature -- Access

    socket_address: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    count: INTEGER
            -- Size of address

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is current address equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    family: INTEGER
            -- Get the socket family of socket address.

feature -- Status setting

    set_family (f: INTEGER)
            -- Set socket address family to f.

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying characters of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            new_result_count: count = other.count or else count = address_size

feature -- Initalization

    make
            -- Make space available for address size.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SOCKET_ADDRESS


SOCKET Chart

class
    SOCKET

General
    cluster: net.abstract.socket
    description: "Generic sockets"
    create: create_from_descriptor

Ancestors
    EXCEPTIONS
    IO_MEDIUM
    SOCKET_RESOURCES

Queries
    address: SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    peer_address: [like address] SOCKET_ADDRESS
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    retrieved: ANY
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    support_storable: BOOLEAN
    type: INTEGER
    zero_option: BOOLEAN

Commands
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    make_socket
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    set_address (addr: [like address] SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_send_buf_size (s: INTEGER)
    write (a_packet: PACKET)


SOCKET Flat contracts

indexing
    description: "Generic sockets"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    SOCKET

create

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
        ensure
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
            -- Is addr a valid peer address?
        require
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel structure?

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    name: STRING
            -- Socket name
        require -- from  IO_MEDIUM
            True
        require else
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Basic commands

    address: SOCKET_ADDRESS
            -- Local address of socket

    bind
            -- Bind socket to local address in address.
        require
            socket_exists: exists
            valid_local_address: address /= void

    cleanup
            -- Cleanup socket.

    close
            -- Close socket.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else
            socket_exists: exists

    connect
            -- Connect socket to peer address.
        require
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket

    descriptor_available: BOOLEAN
            -- Is descriptor available?

    family: INTEGER
            -- Socket family eg. af_inet, af_unix

    is_closed: BOOLEAN
            -- Is socket closed?

    make_socket
            -- Create socket descriptor.
        require
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.

    set_address (addr: like address)
            -- Set local address to addr.
        require
            same_type: addr.family = family
        ensure
            address_set: address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
        require
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
        require
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
        require -- from IO_MEDIUM
            is_readable: readable
        require else
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
        require
            socket_exists: exists
            opened_for_read: is_open_read

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?

    extendible: BOOLEAN
            -- May new items be added?

    is_executable: BOOLEAN
            -- Is socket an executable?
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?

    is_open_write: BOOLEAN
            -- Is socket opened for writing?

    is_readable: BOOLEAN
            -- Is socket a readable medium?
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of putbool.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    put_character (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of putchar.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    put_double (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of putdouble.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    put_integer (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of putint.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of putreal.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    put_string (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of putstring.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    putbool (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of put_boolean.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    putchar (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of put_character.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    putdouble (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of put_double.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    putint (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of put_integer.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    putreal (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of put_real.
        require -- from IO_MEDIUM
            extendible: extendible
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    putstring (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of put_string.
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else
            socket_exists: exists
            opened_for_write: is_open_write

    readable: BOOLEAN
            -- Is there currently any data available on socket?
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a packet a_packet of data to socket.
        require
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
        require
            socket_exists: exists
            opened_for_write: is_open_write

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
        require
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
        require
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
        require
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
        require
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
        require
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
        require
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
        require
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
        require
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
        require
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
        require
            socket_exists: exists

    route
            -- Set socket to routing.
        require
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
        require
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
        require
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
        require
            socket_exists: exists
        ensure
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
        require
            socket_exists: exists
        ensure
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
        require
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
        require
            socket_exists: exists
        ensure
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
        require
            socket_exists: exists
        ensure
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SOCKET


SOCKET_RESOURCES Chart

class
    SOCKET_RESOURCES

General
    cluster: net.abstract.socket
    description: "Resources require for EiffelNet."

Ancestors
    ANY

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN


SOCKET_RESOURCES Flat contracts

indexing
    description: "Resources require for EiffelNet."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    SOCKET_RESOURCES

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.

    address_not_readable: BOOLEAN
            -- Unreadable address

    already_bound: BOOLEAN
            -- Socket has already been bound.

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).

    dtable_full: BOOLEAN
            -- Descriptor table is full

    error: STRING
            -- Output a related error message.

    error_number: INTEGER
            -- Returned error number

    expired_socket: BOOLEAN
            -- Socket connection has expired.

    invalid_address: BOOLEAN
            -- Address is not valid.

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.

    network: BOOLEAN
            -- Socket failed due to network problems.

    no_buffers: BOOLEAN
            -- No more buffers available

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.

    not_connected: BOOLEAN
            -- Socket is not connect.

    protected_address: BOOLEAN
            -- No access to this address is allowed.

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.

    socket_in_use: BOOLEAN
            -- Socket is already in use.

    socket_ok: BOOLEAN
            -- No error

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.

    zero_option: BOOLEAN
            -- No options provided

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message

    c_oobmsg: INTEGER
            -- Out of bound message

    c_peekmsg: INTEGER
            -- Peek message

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SOCKET_RESOURCES


STREAM_SOCKET Chart

class
    STREAM_SOCKET

General
    cluster: net.abstract.socket
    description: "Connexion oriented socket."
    create: create_from_descriptor

Ancestors
    SOCKET

Queries
    accepted: [like Current] STREAM_SOCKET
    address: SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    peer_address: [like address] SOCKET_ADDRESS
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    retrieved: ANY
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    Support_storable: BOOLEAN
    type: INTEGER
    zero_option: BOOLEAN

Commands
    accept
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    listen (queue: INTEGER)
    make_socket
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    set_address (addr: [like address] SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_send_buf_size (s: INTEGER)
    write (a_packet: PACKET)


STREAM_SOCKET Flat contracts

indexing
    description: "Connexion oriented socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    STREAM_SOCKET

create

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
            -- (from SOCKET)
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
            -- Is addr a valid peer address?
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    name: STRING
            -- Socket name
            -- (from SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature

    accept
            -- Accept a new connection on listen socket.
            -- Accepted service socket available in accepted.
        require
            socket_exists: exists

    accepted: like Current
            -- Last accepted socket.

    listen (queue: INTEGER)
            -- Listen on socket for at most queue connections.
        require
            socket_exists: exists

feature -- Basic commands

    address: SOCKET_ADDRESS
            -- Local address of socket
            -- (from SOCKET)

    bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    cleanup
            -- Cleanup socket.
            -- (from SOCKET)

    close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of putbool.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_character (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of putchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_double (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of putdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_integer (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of putint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of putreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_string (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of putstring.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putbool (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of put_boolean.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putchar (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of put_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putdouble (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of put_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putint (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of put_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putreal (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of put_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putstring (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of put_string.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a packet a_packet of data to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class STREAM_SOCKET


cluster net.local

Cluster
    net.local

Supercluster
    net

Subclusters
    net.local.client_server
    net.local.socket


cluster net.local.client_server

Cluster
    net.local.client_server

Supercluster
    net.local

Classes
    UNIX_CLIENT
    UNIX_SERVER


UNIX_CLIENT Chart

class
    UNIX_CLIENT

General
    cluster: net.local.client_server
    description: "A client with Unix socket."

Ancestors
    CLIENT

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    in_out: UNIX_STREAM_SOCKET
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    received: ANY
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    cleanup
    make (a: STRING)
    receive
    send (msg: ANY)


UNIX_CLIENT Flat contracts

indexing
    description: "A client with Unix socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_CLIENT

feature -- Initialization

    make (a: STRING)
            -- Create an unix socket client.
        require
            a_valid_name: a /= void and then not a.is_empty

feature -- Access

    in_out: UNIX_STREAM_SOCKET
            -- Receive and send sockets.

    receive
            -- Receive message.
            -- (from CLIENT)

    received: ANY
            -- message received on in
            -- (from CLIENT)

    send (msg: ANY)
            -- Send msg.
            -- (from CLIENT)

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    cleanup
            -- Clean close

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class UNIX_CLIENT


UNIX_SERVER Chart

deferred class
    UNIX_SERVER

General
    cluster: net.local.client_server
    description: "A server for a Unix socket."

Ancestors
    SERVER

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    in: UNIX_STREAM_SOCKET
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    outflow: [like in] UNIX_STREAM_SOCKET
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    queued: INTEGER
    received: ANY
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    cleanup
    close
    execute
    make (a_path: STRING)
    process_message
    receive
    resend (msg: ANY)
    respond
    set_queued (n: INTEGER)


UNIX_SERVER Flat contracts

indexing
    description: "A server for a Unix socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    UNIX_SERVER

feature -- Access

    cleanup
            -- Clean close

    close
            -- Close socket.

    execute
            -- Execute transfer loop.
            -- (from SERVER)

    in: UNIX_STREAM_SOCKET
            -- Receive socket

    make (a_path: STRING)
            -- Create an unix socket server bound to address
            -- a_path.

    outflow: like in
            -- Service socket
            -- (from SERVER)

    process_message
            -- Process the received message.
            -- (from SERVER)

    queued: INTEGER
            -- (from SERVER)

    receive
            -- Receive activity of server

    received: ANY
            -- Last message from socket
            -- (from SERVER)

    resend (msg: ANY)
            -- Resend msg.
            -- (from SERVER)

    respond
            -- Respond to client.
            -- (from SERVER)

    set_queued (n: INTEGER)
            -- Set queued to n.
            -- (from SERVER)
        require -- from SERVER
            valid_queue_number: n > 0 and n < 6
        ensure -- from SERVER
            assigned_queued: queued = n

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class UNIX_SERVER


cluster net.local.socket

Cluster
    net.local.socket

Supercluster
    net.local

Classes
    UNIX_DATAGRAM_SOCKET
    UNIX_SOCKET
    UNIX_SOCKET_ADDRESS
    UNIX_STREAM_SOCKET


UNIX_DATAGRAM_SOCKET Chart

class
    UNIX_DATAGRAM_SOCKET

General
    cluster: net.local.socket
    description: "An unix datagram socket."
    create: make_bound, make_targeted, make

Ancestors
    DATAGRAM_SOCKET
    UNIX_SOCKET

Queries
    address: UNIX_SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    bound: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    peer_address: [like address] UNIX_SOCKET_ADDRESS
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    received (size, flags: INTEGER): DATAGRAM_PACKET
    retrieved: ANY
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_address: SOCKET_ADDRESS
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_name: STRING
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    support_storable: BOOLEAN
    type: INTEGER
    zero_option: BOOLEAN

Commands
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    connect_to_peer (a_peer_address: [like address] UNIX_SOCKET_ADDRESS)
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    make
    make_bound (a_path: STRING)
    make_bound_to_address (a_local_address: [like address] UNIX_SOCKET_ADDRESS)
    make_connected_to_peer (a_peer_address: [like address] UNIX_SOCKET_ADDRESS)
    make_peer_address
    make_socket
    make_targeted (a_peer_path: STRING)
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    send_to (a_packet: DATAGRAM_PACKET; to_address: SOCKET_ADDRESS; flags: INTEGER)
    set_address (addr: [like address] UNIX_SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] UNIX_SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_send_buf_size (s: INTEGER)
    socket_bind
    socket_cleanup
    socket_close
    target_to (a_peer_path: STRING)
    unlink
    write (a_packet: PACKET)


UNIX_DATAGRAM_SOCKET Flat contracts

indexing
    description: "An unix datagram socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_DATAGRAM_SOCKET

create

    make
            -- Create an unix datagram socket.

    make_bound (a_path: STRING)
            -- Create an unix socket bound to a local well known
            -- address a_path.

    make_targeted (a_peer_path: STRING)
            -- Create an unix socket targeted to a_peer_path.

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
            -- (from SOCKET)
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read

    make
            -- Create an unix datagram socket.

    make_bound (a_path: STRING)
            -- Create an unix socket bound to a local well known
            -- address a_path.

    make_targeted (a_peer_path: STRING)
            -- Create an unix socket targeted to a_peer_path.

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    bound: BOOLEAN
            -- Has socket been bound?
            -- (from DATAGRAM_SOCKET)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
            -- Is addr a valid peer address?
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel structure?
            -- (from SOCKET)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    unlink
            -- Remove associate name from file system.
            -- (from UNIX_SOCKET)
        require else -- from UNIX_SOCKET
            name_address: address /= void

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    make_peer_address
            -- Create a peer address.
        ensure -- from DATAGRAM_SOCKET
            peer_created: peer_address /= void

    socket_name: STRING
            -- Socket name
            -- (from SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists

    target_to (a_peer_path: STRING)
            -- Target socket to a_peer_path.
        require
            socket_exists: exists

feature -- Basic operations

    bind
            -- Bind socket to a local address.
            -- (from DATAGRAM_SOCKET)

    close
            -- Close socket.
            -- (from DATAGRAM_SOCKET)

    connect_to_peer (a_peer_address: like address)
            -- Target socket to a_peer_address.
            -- (from DATAGRAM_SOCKET)
        require -- from DATAGRAM_SOCKET
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Basic commands

    socket_address: SOCKET_ADDRESS
            -- Local address of socket
            -- (from SOCKET)

    socket_bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    socket_cleanup
            -- Cleanup socket.
            -- (from SOCKET)

    socket_close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Creation

    make_bound_to_address (a_local_address: like address)
            -- Create a socket bound to its well-known address
            -- local_address.
            -- (from DATAGRAM_SOCKET)

    make_connected_to_peer (a_peer_address: like address)
            -- Create a socket targeted to peer_address.
            -- (from DATAGRAM_SOCKET)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    received (size: INTEGER; flags: INTEGER): DATAGRAM_PACKET
            -- Receive a packet.
            -- Who from is put into the peer_address.
            -- (from DATAGRAM_SOCKET)
        require -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_read: is_open_read
        ensure -- from DATAGRAM_SOCKET
            known_address: peer_address /= void

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Send boolean b through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putbool.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_character (c: CHARACTER)
            -- Send character c through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putchar.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_double (d: DOUBLE)
            -- Send double d through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putdouble.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_integer (i: INTEGER)
            -- Send integer i through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putint.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Send real r through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putreal.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_string (s: STRING)
            -- Send string s through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putstring.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putbool (b: BOOLEAN)
            -- Send boolean b through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_boolean.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putchar (c: CHARACTER)
            -- Send character c through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_character.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putdouble (d: DOUBLE)
            -- Send double d through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_double.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putint (i: INTEGER)
            -- Send integer i through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_integer.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putreal (r: REAL)
            -- Send real r through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_real.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putstring (s: STRING)
            -- Send string s through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_string.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a_packet to address in peer_address.
            -- (from DATAGRAM_SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    send_to (a_packet: DATAGRAM_PACKET; to_address: SOCKET_ADDRESS; flags: INTEGER)
            -- Send a_packet to address to_address
            -- (from DATAGRAM_SOCKET)
        require -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: to_address /= void
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- Status Report

    address: UNIX_SOCKET_ADDRESS
            -- Local address of socket
            -- (from UNIX_SOCKET)

    cleanup
            -- Close socket and unlink it from file system.
            -- (from UNIX_SOCKET)

    name: STRING
            -- Socket name
            -- (from UNIX_SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists
        require else -- from UNIX_SOCKET
            valid_address: address /= void

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class UNIX_DATAGRAM_SOCKET


UNIX_SOCKET_ADDRESS Chart

class
    UNIX_SOCKET_ADDRESS

General
    cluster: net.local.socket
    description: "A unix socket address."
    create: make_from_path, make

Ancestors
    SOCKET_ADDRESS
    SOCKET_ADDRESS
    SOCKET_RESOURCES

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    count: INTEGER
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    family: INTEGER
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_equal (other: [like Current] UNIX_SOCKET_ADDRESS): BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    path: STRING
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    socket_address: SPECIAL [CHARACTER]
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    copy (other: [like Current] UNIX_SOCKET_ADDRESS)
    make
    make_from_path (a_path: [like path] STRING)
    set_family (f: INTEGER)
    set_path (p: STRING)
    socket_address_make


UNIX_SOCKET_ADDRESS Flat contracts

indexing
    description: "A unix socket address."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_SOCKET_ADDRESS

create

    make
            -- Create an unix socket address.

    make_from_path (a_path: like path)
            -- Create an unix socket address from a path.

feature -- Initialization

    make
            -- Create an unix socket address.

    make_from_path (a_path: like path)
            -- Create an unix socket address from a path.

feature -- Access

    socket_address: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    count: INTEGER
            -- Size of address
            -- (from SOCKET_ADDRESS)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is current address equal to other?
            -- (from SOCKET_ADDRESS)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    family: INTEGER
            -- Get the socket family of socket address.
            -- (from SOCKET_ADDRESS)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    path: STRING
            -- Path of the socket address file

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    set_family (f: INTEGER)
            -- Set socket address family to f.
            -- (from SOCKET_ADDRESS)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying characters of other.
            -- (This is also used by clone.)
            -- (from SOCKET_ADDRESS)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from SOCKET_ADDRESS
            new_result_count: count = other.count or else count = address_size

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Initalization

    socket_address_make
            -- Make space available for address size.
            -- (from SOCKET_ADDRESS)

feature -- Status settings

    set_path (p: STRING)
            -- Set socket path to p.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class UNIX_SOCKET_ADDRESS


UNIX_SOCKET Chart

deferred class
    UNIX_SOCKET

General
    cluster: net.local.socket
    description: "An unix socket."

Ancestors
    SOCKET

Queries
    address: UNIX_SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    peer_address: [like address] UNIX_SOCKET_ADDRESS
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    retrieved: ANY
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    support_storable: BOOLEAN
    type: INTEGER
    zero_option: BOOLEAN

Commands
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    make_socket
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    set_address (addr: [like address] UNIX_SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] UNIX_SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_send_buf_size (s: INTEGER)
    unlink
    write (a_packet: PACKET)


UNIX_SOCKET Flat contracts

indexing
    description: "An unix socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    UNIX_SOCKET

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
            -- (from SOCKET)
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
            -- Is addr a valid peer address?
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel structure?
            -- (from SOCKET)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    unlink
            -- Remove associate name from file system.
        require else
            name_address: address /= void

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Basic commands

    bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of putbool.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_character (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of putchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_double (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of putdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_integer (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of putint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of putreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_string (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of putstring.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putbool (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of put_boolean.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putchar (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of put_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putdouble (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of put_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putint (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of put_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putreal (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of put_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putstring (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of put_string.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a packet a_packet of data to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- Status Report

    address: UNIX_SOCKET_ADDRESS
            -- Local address of socket

    cleanup
            -- Close socket and unlink it from file system.

    name: STRING
            -- Socket name
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists
        require else
            valid_address: address /= void

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class UNIX_SOCKET


UNIX_STREAM_SOCKET Chart

class
    UNIX_STREAM_SOCKET

General
    cluster: net.local.socket
    description: "An unix stream socket."
    create: make, make_server, make_client, create_from_descriptor

Ancestors
    STREAM_SOCKET
    UNIX_SOCKET

Queries
    accepted: [like Current] UNIX_STREAM_SOCKET
    address: UNIX_SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    old_socket_address: SOCKET_ADDRESS
    old_socket_name: STRING
    peer_address: [like address] UNIX_SOCKET_ADDRESS
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    retrieved: ANY
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    Support_storable: BOOLEAN
    type: INTEGER
    zero_option: BOOLEAN

Commands
    accept
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    listen (queue: INTEGER)
    make
    make_client (a_peer: STRING)
    make_server (a_name: STRING)
    make_socket
    new_line
    old_socket_cleanup
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    set_address (addr: [like address] UNIX_SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] UNIX_SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_send_buf_size (s: INTEGER)
    unlink
    write (a_packet: PACKET)


UNIX_STREAM_SOCKET Flat contracts

indexing
    description: "An unix stream socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:57 $"
    revision: "$Revision: 1.2 $"

class interface
    UNIX_STREAM_SOCKET

create

    make
            -- Make an unix socket stream.

    make_client (a_peer: STRING)
            -- Create an unix stream client socket with peer
            -- address set to a_peer.
        require
            valid_path: a_peer /= void

    make_server (a_name: STRING)
            -- Create an unix stream server socket bound to local
            -- address a_name.
        require
            valid_path: a_name /= void and then not a_name.is_empty

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
            -- (from SOCKET)
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read

    make
            -- Make an unix socket stream.

    make_client (a_peer: STRING)
            -- Create an unix stream client socket with peer
            -- address set to a_peer.
        require
            valid_path: a_peer /= void

    make_server (a_name: STRING)
            -- Create an unix stream server socket bound to local
            -- address a_name.
        require
            valid_path: a_name /= void and then not a_name.is_empty

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: SOCKET_ADDRESS): BOOLEAN
            -- Is addr a valid peer address?
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?
            -- (from STREAM_SOCKET)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    unlink
            -- Remove associate name from file system.
            -- (from UNIX_SOCKET)
        require else -- from UNIX_SOCKET
            name_address: address /= void

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    old_socket_name: STRING
            -- Socket name
            -- (from SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature

    accept
            -- Accept a new connection on listen socket.
            -- Accepted service socket available in accepted.
            -- (from STREAM_SOCKET)
        require -- from STREAM_SOCKET
            socket_exists: exists

    accepted: like Current
            -- Last accepted socket.
            -- (from STREAM_SOCKET)

    listen (queue: INTEGER)
            -- Listen on socket for at most queue connections.
            -- (from STREAM_SOCKET)
        require -- from STREAM_SOCKET
            socket_exists: exists

feature -- Basic commands

    old_socket_address: SOCKET_ADDRESS
            -- Local address of socket
            -- (from SOCKET)

    bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    old_socket_cleanup
            -- Cleanup socket.
            -- (from SOCKET)

    close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of putbool.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_character (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of putchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_double (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of putdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_integer (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of putint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of putreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_string (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of putstring.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putbool (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of put_boolean.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putchar (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of put_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putdouble (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of put_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putint (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of put_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putreal (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of put_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putstring (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of put_string.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a packet a_packet of data to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- Status Report

    address: UNIX_SOCKET_ADDRESS
            -- Local address of socket
            -- (from UNIX_SOCKET)

    cleanup
            -- Close socket and unlink it from file system.
            -- (from UNIX_SOCKET)

    name: STRING
            -- Socket name
            -- (from UNIX_SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists
        require else -- from UNIX_SOCKET
            valid_address: address /= void

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class UNIX_STREAM_SOCKET


cluster net.mail

Cluster
    net.mail

Supercluster
    net

Classes
    EMAIL
    EMAIL_CONSTANTS
    EMAIL_PROTOCOL
    EMAIL_RESOURCE
    HEADER
    MAILER
    MEMORY_RESOURCE
    PROTOCOL_RESOURCE
    RETRIEVING_PROTOCOL
    SENDING_PROTOCOL
    SMTP_PROTOCOL
    TRANSFER_ERROR


EMAIL_CONSTANTS Chart

class
    EMAIL_CONSTANTS

General
    cluster: net.mail
    description: "Objects that ..."

Ancestors
    ANY

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    Ehlo: STRING
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    Helo: STRING
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    Mail_reply_to: STRING
    Mail_to: STRING
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER


EMAIL_CONSTANTS Flat contracts

indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

class interface
    EMAIL_CONSTANTS

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220

    Ack_end_connection: INTEGER is 221

    Data: STRING is "DATA"

    Data_code: INTEGER is 354

    Ehlo: STRING is "EHLO "

    Helo: STRING is "HELO "

    Mail_bcc: STRING is "RCPT BCC:"

    Mail_cc: STRING is "RCPT CC:"

    Mail_from: STRING is "MAIL FROM: "

    Mail_reply_to: STRING is "RCPT REPLY TO:"

    Mail_to: STRING is "RCPT TO: "

    No_valid_recipient: INTEGER is 554

    Ok: INTEGER is 250

    Quit: STRING is "QUIT"

    Remote_error: INTEGER is 550

    Size_error: INTEGER is 500

    Struct_error: INTEGER is 552

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]

    H_bcc: STRING is "Bcc"

    H_cc: STRING is "Cc"

    H_from: STRING is "From"

    H_reply_to: STRING is "Reply-to"

    H_subject: STRING is "Subject"

    H_to: STRING is "To"

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EMAIL_CONSTANTS


EMAIL Chart

class
    EMAIL

General
    cluster: net.mail
    description: "Email Object"
    create: make_with_entry, make

Ancestors
    MEMORY_RESOURCE

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    Can_be_received: BOOLEAN
    Can_be_sent: BOOLEAN
    Can_receive: BOOLEAN
    Can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    has_header_entry (header_key: STRING): BOOLEAN
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    mail_message: STRING
    Mail_reply_to: STRING
    mail_signature: STRING
    Mail_to: STRING
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    add_header_entries (header_key: STRING; header_entries: ARRAY [STRING])
    add_header_entry (header_key, header_entry: STRING)
    disable_initiated
    disable_transfer_error
    enable_initiated
    enable_transfer_error
    make
    make_with_entry (header_from, header_to: STRING)
    receive
    remove_header_entries (header_key: STRING)
    remove_header_entry (header_key, header_entry: STRING)
    send
    set_message (s: STRING)
    set_signature (s: STRING)
    set_transfer_error_message (s: STRING)


EMAIL Flat contracts

indexing
    description: "Email Object"
    author: "david s"
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

class interface
    EMAIL

create

    make
            -- Initialize the headers table.

    make_with_entry (header_from, header_to: STRING)
            -- Create an email with the 'header_from' and the 'header_to'.
        require
            needed_info: header_from /= void and then header_to /= void

feature -- Initialization

    make
            -- Initialize the headers table.

    make_with_entry (header_from, header_to: STRING)
            -- Create an email with the 'header_from' and the 'header_to'.
        require
            needed_info: header_from /= void and then header_to /= void

feature -- Access

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'
            -- (from EMAIL_RESOURCE)

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers
            -- (from EMAIL_RESOURCE)

    mail_message: STRING
            -- Email message
            -- (from MEMORY_RESOURCE)

    mail_signature: STRING
            -- Email signature
            -- (from MEMORY_RESOURCE)

feature -- Status report

    error: BOOLEAN
            -- Is there an error?
            -- (from EMAIL_RESOURCE)

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?
            -- (from EMAIL_RESOURCE)

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?
            -- (from EMAIL_RESOURCE)

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling
            -- (from EMAIL_RESOURCE)

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.
            -- (from EMAIL_RESOURCE)

    disable_transfer_error
            -- Disable transfer error.
            -- (from EMAIL_RESOURCE)

    enable_initiated
            -- Set is_initiated.
            -- (from EMAIL_RESOURCE)

    enable_transfer_error
            -- Enable transfer error.
            -- (from EMAIL_RESOURCE)

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.
            -- (from EMAIL_RESOURCE)

feature -- Basic operations

    add_header_entries (header_key: STRING; header_entries: ARRAY [STRING])
            -- Add multiple 'header_entries' at once  to 'header_key',
            -- If not such header exists. create it.

    add_header_entry (header_key, header_entry: STRING)
            -- Add 'header_entry' to header 'header_key',
            -- If no such header exists, create it.
        require
            not_void: header_entry /= void and then header_key /= void

    has_header_entry (header_key: STRING): BOOLEAN

    receive
            -- Receive email.

    remove_header_entries (header_key: STRING)
        require
            header_exists: headers.has (header_key)

    remove_header_entry (header_key, header_entry: STRING)
            -- Remove 'header_entry' from header 'header_key'.
        require
            header_exists: headers.has (header_key)
            header_entry_exists: (headers.item (header_key)).entries.has (header_entry)
        ensure
            header_entry_no_longer_exists: not (headers.item (header_key)).entries.has (header_entry)

    send
            -- Send email.

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

feature -- Implementation (EMAIL_RESOURCE)

    Can_be_received: BOOLEAN is True
            -- Can an email received?

    Can_be_sent: BOOLEAN is True
            -- Can an email be send?

    Can_receive: BOOLEAN is False
            -- Can memory resource receive?
            -- (from MEMORY_RESOURCE)

    Can_send: BOOLEAN is False
            -- Can memory resource send?
            -- (from MEMORY_RESOURCE)

feature -- Settings

    set_message (s: STRING)
            -- Set mail_message to 's'.
            -- (from MEMORY_RESOURCE)

    set_signature (s: STRING)
            -- Set mail_signature to 's'.
            -- (from MEMORY_RESOURCE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EMAIL


EMAIL_PROTOCOL Chart

deferred class
    EMAIL_PROTOCOL

General
    cluster: net.mail
    description: "Handle any emails actions"

Ancestors
    PROTOCOL_RESOURCE

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    Can_be_received: BOOLEAN
    Can_be_sent: BOOLEAN
    can_receive: BOOLEAN
    can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    default_port: INTEGER
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    hostname: STRING
    is_connected: BOOLEAN
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    Mail_reply_to: STRING
    Mail_to: STRING
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    close_protocol
    disable_connected
    disable_initiated
    disable_transfer_error
    enable_connected
    enable_initiated
    enable_transfer_error
    initiate_protocol
    set_default_port (new_port: INTEGER)
    set_transfer_error_message (s: STRING)
    transfer (resource: EMAIL_RESOURCE)


EMAIL_PROTOCOL Flat contracts

indexing
    description: "Handle any emails actions"
    author: ""
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EMAIL_PROTOCOL

feature -- Access

    default_port: INTEGER
            -- Default port

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'
            -- (from EMAIL_RESOURCE)

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers
            -- (from EMAIL_RESOURCE)

    hostname: STRING
            -- hostname .. ex: smtp

feature -- Status report

    can_receive: BOOLEAN
            -- Can resource receive?
            -- (from EMAIL_RESOURCE)

    can_send: BOOLEAN
            -- Can resource send?
            -- (from EMAIL_RESOURCE)

    error: BOOLEAN
            -- Is there an error?
            -- (from EMAIL_RESOURCE)

    is_connected: BOOLEAN
            -- Is the connection done?

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?
            -- (from EMAIL_RESOURCE)

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?
            -- (from EMAIL_RESOURCE)

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling
            -- (from EMAIL_RESOURCE)

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.
            -- (from EMAIL_RESOURCE)

    disable_transfer_error
            -- Disable transfer error.
            -- (from EMAIL_RESOURCE)

    enable_initiated
            -- Set is_initiated.
            -- (from EMAIL_RESOURCE)

    enable_transfer_error
            -- Enable transfer error.
            -- (from EMAIL_RESOURCE)

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.
            -- (from EMAIL_RESOURCE)

feature -- Basic operations

    close_protocol
            -- Close the protocol.
        ensure -- from PROTOCOL_RESOURCE
            protocol_not_initiated: not is_initiated

    initiate_protocol
            -- Initiate the protocol.
        ensure -- from PROTOCOL_RESOURCE
            protocol_initiated: is_initiated

    transfer (resource: EMAIL_RESOURCE)
            -- Transfer the Current email resource to 'resource'.
            -- (from EMAIL_RESOURCE)
        require -- from EMAIL_RESOURCE
            resource_exists: resource /= void
            is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
            connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

feature -- Implementation (EMAIL_RESOURCE)

    Can_be_received: BOOLEAN is False
            -- Can a protocol be received?
            -- (from PROTOCOL_RESOURCE)

    Can_be_sent: BOOLEAN is False
            -- Can a protocol resource be send?
            -- (from PROTOCOL_RESOURCE)

feature -- Settings

    disable_connected
            -- Unset is_connected.

    enable_connected
            -- Set is_connected.

    set_default_port (new_port: INTEGER)
            -- Set the default port to 'new_port'.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EMAIL_PROTOCOL


EMAIL_RESOURCE Chart

deferred class
    EMAIL_RESOURCE

General
    cluster: net.mail
    description: "All resources"

Ancestors
    EMAIL_CONSTANTS

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    can_be_received: BOOLEAN
    can_be_sent: BOOLEAN
    can_receive: BOOLEAN
    can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    Mail_reply_to: STRING
    Mail_to: STRING
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    disable_initiated
    disable_transfer_error
    enable_initiated
    enable_transfer_error
    set_transfer_error_message (s: STRING)
    transfer (resource: EMAIL_RESOURCE)


EMAIL_RESOURCE Flat contracts

indexing
    description: "All resources"
    author: ""
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EMAIL_RESOURCE

feature -- Access

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers

feature -- Status report

    can_be_received: BOOLEAN
            -- Can resource be received?

    can_be_sent: BOOLEAN
            -- Can resource be sent?

    can_receive: BOOLEAN
            -- Can resource receive?

    can_send: BOOLEAN
            -- Can resource send?

    error: BOOLEAN
            -- Is there an error?

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.

    disable_transfer_error
            -- Disable transfer error.

    enable_initiated
            -- Set is_initiated.

    enable_transfer_error
            -- Enable transfer error.

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.

feature -- Basic operations

    transfer (resource: EMAIL_RESOURCE)
            -- Transfer the Current email resource to 'resource'.
        require
            resource_exists: resource /= void
            is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
            connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EMAIL_RESOURCE


HEADER Chart

class
    HEADER

General
    cluster: net.mail
    description: "Objects that contains all the information relative to any header. Headers can only have email addresses informations."
    create: make_with_entries, make

Ancestors
    ANY

Queries
    entries: ARRAYED_LIST [STRING]
    multiple_entries: BOOLEAN
    unique_entry: STRING

Commands
    add_entries (list: ARRAY [STRING])
    add_entry (s: STRING)
    enable_contains_addresses
    enable_multiple_entries
    make (item: STRING)
    make_with_entries (list: ARRAY [STRING])
    remove_entry (entry: STRING)
    remove_i_th_entry (i: INTEGER)


HEADER Flat contracts

indexing
    description: "Objects that contains all the information relative to any header. Headers can only have email addresses informations."
    author: "David s"
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

class interface
    HEADER

create

    make (item: STRING)
            -- Initialize the header with one 'item'.

    make_with_entries (list: ARRAY [STRING])
            -- Initialize the header with a 'list' of entries.

feature -- Initialization

    make (item: STRING)
            -- Initialize the header with one 'item'.

    make_with_entries (list: ARRAY [STRING])
            -- Initialize the header with a 'list' of entries.

feature -- Access

    entries: ARRAYED_LIST [STRING]
            -- Multiple entries.

feature -- Status report

    multiple_entries: BOOLEAN
            -- Has the header multiple entries.

    unique_entry: STRING
            -- Entry,
            -- Useful if not multiple entries.
        require
            has_unique_entry: not multiple_entries

feature -- Status setting

    enable_contains_addresses

    enable_multiple_entries
            -- Enable multiple entries.

feature -- Basic operations

    add_entries (list: ARRAY [STRING])
            -- Add multiple entries at once.
        require
            entries_exist: entries /= void

    add_entry (s: STRING)
            -- Add a new entry 's' to the header.
        ensure
            has_multiple_entries: multiple_entries
            entry_inserted: entries.has (s)

    remove_entry (entry: STRING)
            -- Remove 'entry'
        require
            has_entry: entries.has (entry)

    remove_i_th_entry (i: INTEGER)
            -- Remove 'i'-th entry.
        require
            valid_index: entries.valid_cursor_index (i)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HEADER


MAILER Chart

class
    MAILER

General
    cluster: net.mail
    description: "Mailer object used to send or retrieve resources"
    create: default_create

Ancestors
    ANY

Queries
    error: BOOLEAN
    from_resource: EMAIL_RESOURCE
    to_resource: EMAIL_RESOURCE
    transfer_error: TRANSFER_ERROR

Commands
    set_from_resource (resource: EMAIL_RESOURCE)
    set_to_resource (resource: EMAIL_RESOURCE)
    transfer


MAILER Flat contracts

indexing
    description: "Mailer object used to send or retrieve resources"
    author: "david s"
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

class interface
    MAILER

create

feature -- Access

    from_resource: EMAIL_RESOURCE
            -- Resource that will be sent.

    to_resource: EMAIL_RESOURCE
            -- Resource that will receive.

feature -- Status report

    error: BOOLEAN

    transfer_error: TRANSFER_ERROR
            -- Has the transfer failed?

feature -- Basic operations

    transfer
            -- transfer data and check for errors.
        require
            resources_exists: from_resource /= void and then to_resource /= void
            valid_transfer: (from_resource.can_be_sent and then to_resource.can_send) or (from_resource.can_receive and then to_resource.can_be_received)

feature -- Settings

    set_from_resource (resource: EMAIL_RESOURCE)
            -- Set 'resource' to from_resource.
        require
            resource_exists: resource /= void
            valid_from_resource: resource.can_be_sent or resource.can_receive

    set_to_resource (resource: EMAIL_RESOURCE)
            -- Set 'resource' to to_resource.
        require
            resource_exists: resource /= void
            valid_to_resource: resource.can_send or resource.can_be_received

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class MAILER


MEMORY_RESOURCE Chart

deferred class
    MEMORY_RESOURCE

General
    cluster: net.mail
    description: "Memory resource object."

Ancestors
    EMAIL_RESOURCE

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    can_be_received: BOOLEAN
    can_be_sent: BOOLEAN
    Can_receive: BOOLEAN
    Can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    mail_message: STRING
    Mail_reply_to: STRING
    mail_signature: STRING
    Mail_to: STRING
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    disable_initiated
    disable_transfer_error
    enable_initiated
    enable_transfer_error
    receive
    send
    set_message (s: STRING)
    set_signature (s: STRING)
    set_transfer_error_message (s: STRING)
    transfer (resource: EMAIL_RESOURCE)


MEMORY_RESOURCE Flat contracts

indexing
    description: "Memory resource object."
    author: "David s"
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    MEMORY_RESOURCE

feature -- Access

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'
            -- (from EMAIL_RESOURCE)

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers
            -- (from EMAIL_RESOURCE)

    mail_message: STRING
            -- Email message

    mail_signature: STRING
            -- Email signature

feature -- Status report

    can_be_received: BOOLEAN
            -- Can resource be received?
            -- (from EMAIL_RESOURCE)

    can_be_sent: BOOLEAN
            -- Can resource be sent?
            -- (from EMAIL_RESOURCE)

    error: BOOLEAN
            -- Is there an error?
            -- (from EMAIL_RESOURCE)

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?
            -- (from EMAIL_RESOURCE)

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?
            -- (from EMAIL_RESOURCE)

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling
            -- (from EMAIL_RESOURCE)

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.
            -- (from EMAIL_RESOURCE)

    disable_transfer_error
            -- Disable transfer error.
            -- (from EMAIL_RESOURCE)

    enable_initiated
            -- Set is_initiated.
            -- (from EMAIL_RESOURCE)

    enable_transfer_error
            -- Enable transfer error.
            -- (from EMAIL_RESOURCE)

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.
            -- (from EMAIL_RESOURCE)

feature -- Basic operations

    receive
            -- Receive the resource.

    send
            -- Send the resource.

    transfer (resource: EMAIL_RESOURCE)
            -- Transfer the Current email resource to 'resource'.
            -- (from EMAIL_RESOURCE)
        require -- from EMAIL_RESOURCE
            resource_exists: resource /= void
            is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
            connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

feature -- Implementation (EMAIL_RESOURCE)

    Can_receive: BOOLEAN is False
            -- Can memory resource receive?

    Can_send: BOOLEAN is False
            -- Can memory resource send?

feature -- Settings

    set_message (s: STRING)
            -- Set mail_message to 's'.

    set_signature (s: STRING)
            -- Set mail_signature to 's'.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class MEMORY_RESOURCE


PROTOCOL_RESOURCE Chart

deferred class
    PROTOCOL_RESOURCE

General
    cluster: net.mail
    description: "Objects that ..."

Ancestors
    EMAIL_RESOURCE

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    Can_be_received: BOOLEAN
    Can_be_sent: BOOLEAN
    can_receive: BOOLEAN
    can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    Mail_reply_to: STRING
    Mail_to: STRING
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    close_protocol
    disable_initiated
    disable_transfer_error
    enable_initiated
    enable_transfer_error
    initiate_protocol
    set_transfer_error_message (s: STRING)
    transfer (resource: EMAIL_RESOURCE)


PROTOCOL_RESOURCE Flat contracts

indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    PROTOCOL_RESOURCE

feature -- Access

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'
            -- (from EMAIL_RESOURCE)

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers
            -- (from EMAIL_RESOURCE)

feature -- Status report

    can_receive: BOOLEAN
            -- Can resource receive?
            -- (from EMAIL_RESOURCE)

    can_send: BOOLEAN
            -- Can resource send?
            -- (from EMAIL_RESOURCE)

    error: BOOLEAN
            -- Is there an error?
            -- (from EMAIL_RESOURCE)

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?
            -- (from EMAIL_RESOURCE)

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?
            -- (from EMAIL_RESOURCE)

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling
            -- (from EMAIL_RESOURCE)

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.
            -- (from EMAIL_RESOURCE)

    disable_transfer_error
            -- Disable transfer error.
            -- (from EMAIL_RESOURCE)

    enable_initiated
            -- Set is_initiated.
            -- (from EMAIL_RESOURCE)

    enable_transfer_error
            -- Enable transfer error.
            -- (from EMAIL_RESOURCE)

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.
            -- (from EMAIL_RESOURCE)

feature -- Basic operations

    close_protocol
            -- Close the protocol.
        ensure
            protocol_not_initiated: not is_initiated

    initiate_protocol
            -- initiate the protocol with the server.
        ensure
            protocol_initiated: is_initiated

    transfer (resource: EMAIL_RESOURCE)
            -- Transfer the Current email resource to 'resource'.
            -- (from EMAIL_RESOURCE)
        require -- from EMAIL_RESOURCE
            resource_exists: resource /= void
            is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
            connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

feature -- Implementation (EMAIL_RESOURCE)

    Can_be_received: BOOLEAN is False
            -- Can a protocol be received?

    Can_be_sent: BOOLEAN is False
            -- Can a protocol resource be send?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class PROTOCOL_RESOURCE


RETRIEVING_PROTOCOL Chart

deferred class
    RETRIEVING_PROTOCOL

General
    cluster: net.mail
    description: "Objects that handle the retrieving of data"

Ancestors
    EMAIL_PROTOCOL

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    Can_be_received: BOOLEAN
    Can_be_sent: BOOLEAN
    can_receive: BOOLEAN
    can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    default_port: INTEGER
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    hostname: STRING
    is_connected: BOOLEAN
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    Mail_reply_to: STRING
    Mail_to: STRING
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    close_protocol
    disable_connected
    disable_initiated
    disable_transfer_error
    enable_connected
    enable_initiated
    enable_transfer_error
    execute_transfer
    initiate_protocol
    set_default_port (new_port: INTEGER)
    set_transfer_error_message (s: STRING)
    transfer (resource: EMAIL_RESOURCE)


RETRIEVING_PROTOCOL Flat contracts

indexing
    description: "Objects that handle the retrieving of data"
    author: "david"
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    RETRIEVING_PROTOCOL

feature -- Access

    default_port: INTEGER
            -- Default port
            -- (from EMAIL_PROTOCOL)

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'
            -- (from EMAIL_RESOURCE)

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers
            -- (from EMAIL_RESOURCE)

    hostname: STRING
            -- hostname .. ex: smtp
            -- (from EMAIL_PROTOCOL)

feature -- Status report

    can_receive: BOOLEAN
            -- Can resource receive?
            -- (from EMAIL_RESOURCE)

    can_send: BOOLEAN
            -- Can resource send?
            -- (from EMAIL_RESOURCE)

    error: BOOLEAN
            -- Is there an error?
            -- (from EMAIL_RESOURCE)

    is_connected: BOOLEAN
            -- Is the connection done?
            -- (from EMAIL_PROTOCOL)

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?
            -- (from EMAIL_RESOURCE)

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?
            -- (from EMAIL_RESOURCE)

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling
            -- (from EMAIL_RESOURCE)

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.
            -- (from EMAIL_RESOURCE)

    disable_transfer_error
            -- Disable transfer error.
            -- (from EMAIL_RESOURCE)

    enable_initiated
            -- Set is_initiated.
            -- (from EMAIL_RESOURCE)

    enable_transfer_error
            -- Enable transfer error.
            -- (from EMAIL_RESOURCE)

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.
            -- (from EMAIL_RESOURCE)

feature -- Basic operations

    close_protocol
            -- Close the protocol.
            -- (from EMAIL_PROTOCOL)
        ensure -- from PROTOCOL_RESOURCE
            protocol_not_initiated: not is_initiated

    execute_transfer
            -- Do the transfer.

    initiate_protocol
            -- Initiate the protocol.
            -- (from EMAIL_PROTOCOL)
        ensure -- from PROTOCOL_RESOURCE
            protocol_initiated: is_initiated

    transfer (resource: EMAIL_RESOURCE)
            -- Transfer the Current email resource to 'resource'.
            -- (from EMAIL_RESOURCE)
        require -- from EMAIL_RESOURCE
            resource_exists: resource /= void
            is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
            connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

feature -- Implementation (EMAIL_RESOURCE)

    Can_be_received: BOOLEAN is False
            -- Can a protocol be received?
            -- (from PROTOCOL_RESOURCE)

    Can_be_sent: BOOLEAN is False
            -- Can a protocol resource be send?
            -- (from PROTOCOL_RESOURCE)

feature -- Settings

    disable_connected
            -- Unset is_connected.
            -- (from EMAIL_PROTOCOL)

    enable_connected
            -- Set is_connected.
            -- (from EMAIL_PROTOCOL)

    set_default_port (new_port: INTEGER)
            -- Set the default port to 'new_port'.
            -- (from EMAIL_PROTOCOL)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class RETRIEVING_PROTOCOL


SENDING_PROTOCOL Chart

deferred class
    SENDING_PROTOCOL

General
    cluster: net.mail
    description: "Objects that handle the sending of data"

Ancestors
    EMAIL_PROTOCOL

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    Can_be_received: BOOLEAN
    Can_be_sent: BOOLEAN
    can_receive: BOOLEAN
    Can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    default_port: INTEGER
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    hostname: STRING
    is_connected: BOOLEAN
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    Mail_reply_to: STRING
    Mail_to: STRING
    memory_resource: MEMORY_RESOURCE
    No_valid_recipient: INTEGER
    Ok: INTEGER
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    close_protocol
    disable_connected
    disable_initiated
    disable_transfer_error
    enable_connected
    enable_initiated
    enable_transfer_error
    initiate_protocol
    send_mail
    set_default_port (new_port: INTEGER)
    set_transfer_error_message (s: STRING)
    transfer (resource: EMAIL_RESOURCE)


SENDING_PROTOCOL Flat contracts

indexing
    description: "Objects that handle the sending of data"
    author: "david"
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SENDING_PROTOCOL

feature -- Access

    default_port: INTEGER
            -- Default port
            -- (from EMAIL_PROTOCOL)

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'
            -- (from EMAIL_RESOURCE)

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers
            -- (from EMAIL_RESOURCE)

    hostname: STRING
            -- hostname .. ex: smtp
            -- (from EMAIL_PROTOCOL)

    memory_resource: MEMORY_RESOURCE
            -- Memory resource to be send

feature -- Status report

    can_receive: BOOLEAN
            -- Can resource receive?
            -- (from EMAIL_RESOURCE)

    error: BOOLEAN
            -- Is there an error?
            -- (from EMAIL_RESOURCE)

    is_connected: BOOLEAN
            -- Is the connection done?
            -- (from EMAIL_PROTOCOL)

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?
            -- (from EMAIL_RESOURCE)

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?
            -- (from EMAIL_RESOURCE)

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling
            -- (from EMAIL_RESOURCE)

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.
            -- (from EMAIL_RESOURCE)

    disable_transfer_error
            -- Disable transfer error.
            -- (from EMAIL_RESOURCE)

    enable_initiated
            -- Set is_initiated.
            -- (from EMAIL_RESOURCE)

    enable_transfer_error
            -- Enable transfer error.
            -- (from EMAIL_RESOURCE)

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.
            -- (from EMAIL_RESOURCE)

feature -- Basic operations

    close_protocol
            -- Close the protocol.
            -- (from EMAIL_PROTOCOL)
        ensure -- from PROTOCOL_RESOURCE
            protocol_not_initiated: not is_initiated

    initiate_protocol
            -- Initiate the protocol.
            -- (from EMAIL_PROTOCOL)
        ensure -- from PROTOCOL_RESOURCE
            protocol_initiated: is_initiated

    send_mail
            -- Send resource.
        require
            connection_exists: is_connected
            connection_initiated: is_initiated
            valid_headers: memory_resource.headers.has (h_from) and then memory_resource.headers.has (h_to)

    transfer (resource: EMAIL_RESOURCE)
            -- Transfer the Current email resource to 'resource'.
            -- (from EMAIL_RESOURCE)
        require -- from EMAIL_RESOURCE
            resource_exists: resource /= void
            is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
            connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

feature -- Implemantation (EMAIL_RESOURCE)

    Can_send: BOOLEAN is True
            --Can a sending protocol send?

feature -- Implementation (EMAIL_RESOURCE)

    Can_be_received: BOOLEAN is False
            -- Can a protocol be received?
            -- (from PROTOCOL_RESOURCE)

    Can_be_sent: BOOLEAN is False
            -- Can a protocol resource be send?
            -- (from PROTOCOL_RESOURCE)

feature -- Settings

    disable_connected
            -- Unset is_connected.
            -- (from EMAIL_PROTOCOL)

    enable_connected
            -- Set is_connected.
            -- (from EMAIL_PROTOCOL)

    set_default_port (new_port: INTEGER)
            -- Set the default port to 'new_port'.
            -- (from EMAIL_PROTOCOL)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SENDING_PROTOCOL


SMTP_PROTOCOL Chart

class
    SMTP_PROTOCOL

General
    cluster: net.mail
    description: "Objects that ..."
    create: make

Ancestors
    SENDING_PROTOCOL

Queries
    Ack_begin_connection: INTEGER
    Ack_end_connection: INTEGER
    Can_be_received: BOOLEAN
    Can_be_sent: BOOLEAN
    Can_receive: BOOLEAN
    Can_send: BOOLEAN
    Data: STRING
    Data_code: INTEGER
    Default_headers: ARRAY [STRING]
    Default_port: INTEGER
    Ehlo: STRING
    error: BOOLEAN
    H_bcc: STRING
    H_cc: STRING
    H_from: STRING
    H_reply_to: STRING
    H_subject: STRING
    H_to: STRING
    header (h: STRING): HEADER
    headers: HASH_TABLE [HEADER, STRING]
    Helo: STRING
    hostname: STRING
    is_connected: BOOLEAN
    is_header_valid: BOOLEAN
    is_initiated: BOOLEAN
    Mail_bcc: STRING
    Mail_cc: STRING
    Mail_from: STRING
    Mail_reply_to: STRING
    Mail_to: STRING
    memory_resource: MEMORY_RESOURCE
    No_valid_recipient: INTEGER
    Ok: INTEGER
    pipelining: BOOLEAN
    Quit: STRING
    Remote_error: INTEGER
    Size_error: INTEGER
    smtp_code_number: INTEGER
    smtp_reply: STRING
    Struct_error: INTEGER
    Transfer_error: TRANSFER_ERROR

Commands
    close_protocol
    disable_connected
    disable_initiated
    disable_pipelining
    disable_transfer_error
    enable_connected
    enable_initiated
    enable_pipelining
    enable_transfer_error
    initialize
    initiate_protocol
    make (host, user: STRING)
    set_default_port (new_port: INTEGER)
    set_transfer_error_message (s: STRING)
    transfer (resource: MEMORY_RESOURCE)


SMTP_PROTOCOL Flat contracts

indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

class interface
    SMTP_PROTOCOL

create

    make (host: STRING; user: STRING)
            -- Create an smtp protocol with 'host, 'user' and default port.

feature -- Initialization

    make (host: STRING; user: STRING)
            -- Create an smtp protocol with 'host, 'user' and default port.

feature -- Access

    header (h: STRING): HEADER
            -- Retrieve the content of the header 'h'
            -- (from EMAIL_RESOURCE)

    headers: HASH_TABLE [HEADER, STRING]
            -- All information concerning each headers
            -- (from EMAIL_RESOURCE)

    hostname: STRING
            -- hostname .. ex: smtp
            -- (from EMAIL_PROTOCOL)

    memory_resource: MEMORY_RESOURCE
            -- Memory resource to be send
            -- (from SENDING_PROTOCOL)

    pipelining: BOOLEAN
            -- Does the connection use pipeline?

    smtp_code_number: INTEGER
            -- Code number of the reply

    smtp_reply: STRING
            -- Replied message from SMTP protocol

feature -- Status report

    error: BOOLEAN
            -- Is there an error?
            -- (from EMAIL_RESOURCE)

    is_connected: BOOLEAN
            -- Is the connection done?
            -- (from EMAIL_PROTOCOL)

    is_header_valid: BOOLEAN
            -- Is the email resource's header valid?
            -- (from EMAIL_RESOURCE)

    is_initiated: BOOLEAN
            -- Has the connection has been initiated?
            -- (from EMAIL_RESOURCE)

    transfer_error: TRANSFER_ERROR
            -- Transfer error handling
            -- (from EMAIL_RESOURCE)

feature -- Status setting

    disable_initiated
            -- Unset is_initiated.
            -- (from EMAIL_RESOURCE)

    disable_transfer_error
            -- Disable transfer error.
            -- (from EMAIL_RESOURCE)

    enable_initiated
            -- Set is_initiated.
            -- (from EMAIL_RESOURCE)

    enable_transfer_error
            -- Enable transfer error.
            -- (from EMAIL_RESOURCE)

    set_transfer_error_message (s: STRING)
            -- Set transfer error message to 's'.
            -- (from EMAIL_RESOURCE)

feature -- Access EMAIL_PROTOCOL

    Default_port: INTEGER is 25
            -- Smtp default port

feature -- Basic operations.

    close_protocol
            -- Terminate the connection.
        require -- from  PROTOCOL_RESOURCE
            True
        require else
            connection_exists: is_connected
        ensure -- from PROTOCOL_RESOURCE
            protocol_not_initiated: not is_initiated

    initiate_protocol
            -- Initiate the smtp connection
            -- It can be a helo or a ehlo connection.
        ensure -- from PROTOCOL_RESOURCE
            protocol_initiated: is_initiated

feature -- Constants for SMTP Protocol

    Ack_begin_connection: INTEGER is 220
            -- (from EMAIL_CONSTANTS)

    Ack_end_connection: INTEGER is 221
            -- (from EMAIL_CONSTANTS)

    Data: STRING is "DATA"
            -- (from EMAIL_CONSTANTS)

    Data_code: INTEGER is 354
            -- (from EMAIL_CONSTANTS)

    Ehlo: STRING is "EHLO "
            -- (from EMAIL_CONSTANTS)

    Helo: STRING is "HELO "
            -- (from EMAIL_CONSTANTS)

    Mail_bcc: STRING is "RCPT BCC:"
            -- (from EMAIL_CONSTANTS)

    Mail_cc: STRING is "RCPT CC:"
            -- (from EMAIL_CONSTANTS)

    Mail_from: STRING is "MAIL FROM: "
            -- (from EMAIL_CONSTANTS)

    Mail_reply_to: STRING is "RCPT REPLY TO:"
            -- (from EMAIL_CONSTANTS)

    Mail_to: STRING is "RCPT TO: "
            -- (from EMAIL_CONSTANTS)

    No_valid_recipient: INTEGER is 554
            -- (from EMAIL_CONSTANTS)

    Ok: INTEGER is 250
            -- (from EMAIL_CONSTANTS)

    Quit: STRING is "QUIT"
            -- (from EMAIL_CONSTANTS)

    Remote_error: INTEGER is 550
            -- (from EMAIL_CONSTANTS)

    Size_error: INTEGER is 500
            -- (from EMAIL_CONSTANTS)

    Struct_error: INTEGER is 552
            -- (from EMAIL_CONSTANTS)

feature -- Constants for email headers (Authorized keys for the Hashtables)

    default_headers: ARRAY [STRING]
            -- (from EMAIL_CONSTANTS)

    H_bcc: STRING is "Bcc"
            -- (from EMAIL_CONSTANTS)

    H_cc: STRING is "Cc"
            -- (from EMAIL_CONSTANTS)

    H_from: STRING is "From"
            -- (from EMAIL_CONSTANTS)

    H_reply_to: STRING is "Reply-to"
            -- (from EMAIL_CONSTANTS)

    H_subject: STRING is "Subject"
            -- (from EMAIL_CONSTANTS)

    H_to: STRING is "To"
            -- (from EMAIL_CONSTANTS)

feature -- Implemantation (EMAIL_RESOURCE)

    Can_send: BOOLEAN is True
            --Can a sending protocol send?
            -- (from SENDING_PROTOCOL)

feature -- Implementation (EMAIL_RESOURCE)

    Can_be_received: BOOLEAN is False
            -- Can a protocol be received?
            -- (from PROTOCOL_RESOURCE)

    Can_be_sent: BOOLEAN is False
            -- Can a protocol resource be send?
            -- (from PROTOCOL_RESOURCE)

    Can_receive: BOOLEAN is False
            -- Can the Smtp protocolreceive?

    initialize
            -- Initialize the protocol to send a new email.

feature -- Implementation (EMAIL_RESOURCE).

    transfer (resource: MEMORY_RESOURCE)
            -- Send the email and add a . at the end of the message.
        require -- from EMAIL_RESOURCE
            resource_exists: resource /= void
            is_valid_transfer: (resource.can_be_sent and can_send) or (resource.can_receive and can_be_received)
            connection_is_initiated: (can_be_sent and resource.is_initiated) or (is_initiated and resource.can_be_received)

feature -- Setting

    disable_pipelining
            -- Unset pipelining.

    enable_pipelining
            -- Set pipelining.

feature -- Settings

    disable_connected
            -- Unset is_connected.
            -- (from EMAIL_PROTOCOL)

    enable_connected
            -- Set is_connected.
            -- (from EMAIL_PROTOCOL)

    set_default_port (new_port: INTEGER)
            -- Set the default port to 'new_port'.
            -- (from EMAIL_PROTOCOL)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SMTP_PROTOCOL


TRANSFER_ERROR Chart

class
    TRANSFER_ERROR

General
    cluster: net.mail
    description: "Objects that ..."

Ancestors
    ANY

Queries
    transfer_error: BOOLEAN
    transfer_error_message: STRING

Commands
    disable_transfer_error
    enable_transfer_error
    set_transfer_error_message (s: STRING)


TRANSFER_ERROR Flat contracts

indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/11/12 17:57:58 $"
    revision: "$Revision: 1.2 $"

class interface
    TRANSFER_ERROR

feature -- Access

    transfer_error_message: STRING

feature -- Status report

    transfer_error: BOOLEAN
            -- Is transfer error?

feature -- Status setting

    disable_transfer_error

    enable_transfer_error

    set_transfer_error_message (s: STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TRANSFER_ERROR


cluster net.network

Cluster
    net.network

Supercluster
    net

Subclusters
    net.network.client_server
    net.network.socket


cluster net.network.client_server

Cluster
    net.network.client_server

Supercluster
    net.network

Classes
    NETWORK_CLIENT
    NETWORK_SERVER


NETWORK_CLIENT Chart

class
    NETWORK_CLIENT

General
    cluster: net.network.client_server
    description: "A client for a network socket."

Ancestors
    CLIENT

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    in_out: NETWORK_STREAM_SOCKET
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    received: ANY
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    cleanup
    make (a_peer_port: INTEGER; a_peer_name: STRING)
    receive
    send (msg: ANY)


NETWORK_CLIENT Flat contracts

indexing
    description: "A client for a network socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

class interface
    NETWORK_CLIENT

feature -- Access

    cleanup
            -- Shut down client.

    in_out: NETWORK_STREAM_SOCKET
            -- Receive and send sockets.

    make (a_peer_port: INTEGER; a_peer_name: STRING)
            -- Make client with port a_peer_port and host a_peer_name.
        require
            a_valid_port: a_peer_port > 0
            a_valid_name: a_peer_name /= void and then not a_peer_name.is_empty

    receive
            -- Receive message.
            -- (from CLIENT)

    received: ANY
            -- message received on in
            -- (from CLIENT)

    send (msg: ANY)
            -- Send msg to server.

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class NETWORK_CLIENT


NETWORK_SERVER Chart

deferred class
    NETWORK_SERVER

General
    cluster: net.network.client_server
    description: "A server for a network socket."

Ancestors
    SERVER

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    in: NETWORK_STREAM_SOCKET
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    outflow: [like in] NETWORK_STREAM_SOCKET
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    queued: INTEGER
    received: ANY
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    cleanup
    close
    execute
    make (a_port: INTEGER)
    process_message
    receive
    resend (msg: ANY)
    respond
    set_queued (n: INTEGER)


NETWORK_SERVER Flat contracts

indexing
    description: "A server for a network socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    NETWORK_SERVER

feature -- Access

    cleanup
            -- Clean close of server.

    close
            -- Close server socket.

    execute
            -- Execute transfer loop.
            -- (from SERVER)

    in: NETWORK_STREAM_SOCKET
            -- Receive socket.

    make (a_port: INTEGER)
            -- Make a network server listening to a_port.
        require
            valid_port: a_port >= 0

    outflow: like in
            -- Service socket
            -- (from SERVER)

    process_message
            -- Process the received message.
            -- (from SERVER)

    queued: INTEGER
            -- (from SERVER)

    receive
            -- Receive activity of server.

    received: ANY
            -- Last message from socket
            -- (from SERVER)

    resend (msg: ANY)
            -- Send back message msg.

    respond
            -- Respond to client.
            -- (from SERVER)

    set_queued (n: INTEGER)
            -- Set queued to n.
            -- (from SERVER)
        require -- from SERVER
            valid_queue_number: n > 0 and n < 6
        ensure -- from SERVER
            assigned_queued: queued = n

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class NETWORK_SERVER


cluster net.network.socket

Cluster
    net.network.socket

Supercluster
    net.network

Classes
    HOST_ADDRESS
    NETWORK_DATAGRAM_SOCKET
    NETWORK_SOCKET
    NETWORK_SOCKET_ADDRESS
    NETWORK_STREAM_SOCKET


HOST_ADDRESS Chart

class
    HOST_ADDRESS

General
    cluster: net.network.socket
    description: "A host address."
    create: make_local, make_from_ip_number, make_from_name, make

Ancestors
    TO_SPECIAL [T]
    TO_SPECIAL [T]

Queries
    address_host: SPECIAL [CHARACTER]
    count: INTEGER
    host_address: STRING
    host_number: INTEGER
    is_equal (other: [like Current] HOST_ADDRESS): BOOLEAN
    local_host_name: STRING

Commands
    copy (other: [like Current] HOST_ADDRESS)
    from_c (ptr: POINTER)
    make
    make_from_ip_number (an_ip_address: STRING)
    make_from_name (a_name: STRING)
    make_local
    set_address_from_name (a_name: STRING)
    set_host_address (host_id: STRING)
    set_in_address_any


HOST_ADDRESS Flat contracts

indexing
    description: "A host address."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

class interface
    HOST_ADDRESS

create

    make
            -- Create a host address object.

    make_local
            -- Create a local host address object.

    make_from_name (a_name: STRING)
            -- Create host address from host name a_name.

    make_from_ip_number (an_ip_address: STRING)
            -- Create host address from IP number in dotted format.

feature -- Initialization

    make
            -- Create a host address object.

    make_from_ip_number (an_ip_address: STRING)
            -- Create host address from IP number in dotted format.

    make_from_name (a_name: STRING)
            -- Create host address from host name a_name.

    make_local
            -- Create a local host address object.

feature -- Access

    address_host: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    count: INTEGER
            -- Object address size

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Are the two host address areas equal ?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Conversion

    from_c (ptr: POINTER)
            -- Converts a c host address structure (address_in)
            -- to an eiffel address object.

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            new_result_count: count = other.count or else count = in_addr_size

feature -- Status_report

    host_address: STRING
            -- IP number (dotted format) of current address

    host_number: INTEGER
            -- IP number in long integer form of current address

    local_host_name: STRING
            -- Host name of the local machine

feature -- Status_setting

    set_address_from_name (a_name: STRING)
            -- Set the host address using the name provided in 'a_name'.
        require
            name_valid: a_name /= void and then not a_name.is_empty

    set_host_address (host_id: STRING)
            -- Set host address from dotted format string.
        require
            dotted_address_not_void: host_id /= void

    set_in_address_any
            -- Set host address to "in address any".
            -- This is a special address selected by the host machine.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HOST_ADDRESS


NETWORK_DATAGRAM_SOCKET Chart

class
    NETWORK_DATAGRAM_SOCKET

General
    cluster: net.network.socket
    description: "Network datagram sockets"
    create: make_targeted_to_hostname, make_targeted_to_ip, make, make_server_by_port, make_bound_client_by_port, make_client_by_port, make_bound

Ancestors
    DATAGRAM_SOCKET
    NETWORK_SOCKET

Queries
    address: NETWORK_SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    bound: BOOLEAN
    broadcast_enabled: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    has_exception_state: BOOLEAN
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    peer_address: [like address] NETWORK_SOCKET_ADDRESS
    port: INTEGER
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    ready_for_reading: BOOLEAN
    ready_for_writing: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    received (size, flags: INTEGER): DATAGRAM_PACKET
    retrieved: ANY
    reuse_address: BOOLEAN
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_address: SOCKET_ADDRESS
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    support_storable: BOOLEAN
    timeout: INTEGER
    type: INTEGER
    zero_option: BOOLEAN

Commands
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    connect_to_peer (a_peer_address: [like address] NETWORK_SOCKET_ADDRESS)
    create_from_descriptor (fd: INTEGER)
    disable_broadcast
    disable_debug
    dispose
    do_not_reuse_address
    do_not_route
    enable_broadcast
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    make
    make_bound (a_port: INTEGER)
    make_bound_to_address (a_local_address: [like address] NETWORK_SOCKET_ADDRESS)
    make_connected_to_peer (a_peer_address: [like address] NETWORK_SOCKET_ADDRESS)
    make_peer_address
    make_socket
    make_targeted_to_hostname (a_hostname: STRING; a_peer_port: INTEGER)
    make_targeted_to_ip (an_ip_number: STRING; a_peer_port: INTEGER)
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    send_to (a_packet: DATAGRAM_PACKET; to_address: SOCKET_ADDRESS; flags: INTEGER)
    set_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_reuse_address
    set_send_buf_size (s: INTEGER)
    set_timeout (n: INTEGER)
    socket_bind
    socket_close
    socket_set_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    target_to_hostname (a_hostname: STRING; a_peer_port: INTEGER)
    target_to_ip (an_ip_number: STRING; a_peer_port: INTEGER)
    write (a_packet: PACKET)


NETWORK_DATAGRAM_SOCKET Flat contracts

indexing
    description: "Network datagram sockets"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

class interface
    NETWORK_DATAGRAM_SOCKET

create

    make
            -- Make a network datagram socket.
        ensure then
            timeout_set_to_default: timeout = default_timeout

    make_client_by_port (a_peer_port: INTEGER; a_peer_host: STRING)
        require
            valid_peer_host: a_peer_host /= void and then not a_peer_host.empty
            valid_port: a_peer_port >= 0

    make_bound_client_by_port (a_local_port, a_peer_port: INTEGER; a_peer_host: STRING)
        require
            valid_peer_host: a_peer_host /= void and then not a_peer_host.empty
            valid_port: a_peer_port >= 0

    make_server_by_port (a_port: INTEGER)
        require
            valid_port: a_port >= 0

    make_bound (a_port: INTEGER)
            -- Make a network datagram socket bound to its well
            -- known local address with port a_port.
        ensure
            timeout_set_to_default: timeout = default_timeout

    make_targeted_to_hostname (a_hostname: STRING; a_peer_port: INTEGER)
            -- Make a network datagram socket connected to
            -- hostname a_hostname and port a_port.
        ensure
            timeout_set_to_default: timeout = default_timeout

    make_targeted_to_ip (an_ip_number: STRING; a_peer_port: INTEGER)
            -- Make a network datagram socket connected to
            -- hostname a_hostname and port a_port.
        ensure
            timeout_set_to_default: timeout = default_timeout

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
            -- (from NETWORK_SOCKET)
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read
        ensure then -- from NETWORK_SOCKET
            timeout_set_to_default: timeout = default_timeout

    make
            -- Make a network datagram socket.
        ensure then
            timeout_set_to_default: timeout = default_timeout

    make_bound (a_port: INTEGER)
            -- Make a network datagram socket bound to its well
            -- known local address with port a_port.
        ensure
            timeout_set_to_default: timeout = default_timeout

    make_targeted_to_hostname (a_hostname: STRING; a_peer_port: INTEGER)
            -- Make a network datagram socket connected to
            -- hostname a_hostname and port a_port.
        ensure
            timeout_set_to_default: timeout = default_timeout

    make_targeted_to_ip (an_ip_number: STRING; a_peer_port: INTEGER)
            -- Make a network datagram socket connected to
            -- hostname a_hostname and port a_port.
        ensure
            timeout_set_to_default: timeout = default_timeout

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address: NETWORK_SOCKET_ADDRESS
            -- Local address of socket
            -- (from NETWORK_SOCKET)

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    bound: BOOLEAN
            -- Has socket been bound?
            -- (from DATAGRAM_SOCKET)

    broadcast_enabled: BOOLEAN
            -- Is broadcasting enabled?
        require
            valid_descriptor: exists

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    has_exception_state: BOOLEAN
            -- Is socket in exception state within timeout seconds?
            -- (from NETWORK_SOCKET)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: like address): BOOLEAN
            -- Is addr a valid peer address?
            -- (from NETWORK_SOCKET)
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    port: INTEGER
            -- Port socket is bound to.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            valid_socket: exists

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    ready_for_reading: BOOLEAN
            -- Is data available for reading from the socket within
            -- timeout seconds?
            -- (from NETWORK_SOCKET)

    ready_for_writing: BOOLEAN
            -- Can data be written to the socket within timeout seconds?
            -- (from NETWORK_SOCKET)

    reuse_address: BOOLEAN
            -- Is reuse_address option set?
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            socket_exists: exists

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel structure?
            -- (from SOCKET)

    timeout: INTEGER
            -- Duration of timeout in seconds
            -- (from NETWORK_SOCKET)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    disable_broadcast
            -- Disable broadcasting.
        require
            valid_descriptor: exists

    do_not_reuse_address
            -- Turn reuse_address option off.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            socket_exists: exists

    enable_broadcast
            -- Enable broadcasting.
        require
            valid_descriptor: exists

    set_reuse_address
            -- Turn reuse_address option on.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            socket_exists: exists

    set_timeout (n: INTEGER)
            -- Set timeout to n seconds.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            non_negative: n >= 0
        ensure -- from NETWORK_SOCKET
            timeout_set: timeout = n or timeout = default_timeout

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    make_peer_address
            -- Create peer address.
        ensure -- from DATAGRAM_SOCKET
            peer_created: peer_address /= void

    name: STRING
            -- Socket name
            -- (from SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists

    target_to_hostname (a_hostname: STRING; a_peer_port: INTEGER)
            -- Connect socket to address provided by
            -- hostname a_hostname and port a_port.
        require
            socket_exists: exists

    target_to_ip (an_ip_number: STRING; a_peer_port: INTEGER)
            -- Connect socket to address provided by
            -- hostname a_hostname and port a_port.
        require
            socket_exists: exists

feature -- Basic operations

    bind
            -- Bind socket to a local address.
            -- (from DATAGRAM_SOCKET)

    close
            -- Close socket.
            -- (from DATAGRAM_SOCKET)

    connect_to_peer (a_peer_address: like address)
            -- Target socket to a_peer_address.
            -- (from DATAGRAM_SOCKET)
        require -- from DATAGRAM_SOCKET
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Basic commands

    socket_address: SOCKET_ADDRESS
            -- Local address of socket
            -- (from SOCKET)

    socket_bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    cleanup
            -- Cleanup socket.
            -- (from SOCKET)

    socket_close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    socket_set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Creation

    make_bound_to_address (a_local_address: like address)
            -- Create a socket bound to its well-known address
            -- local_address.
            -- (from DATAGRAM_SOCKET)

    make_connected_to_peer (a_peer_address: like address)
            -- Create a socket targeted to peer_address.
            -- (from DATAGRAM_SOCKET)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    received (size: INTEGER; flags: INTEGER): DATAGRAM_PACKET
            -- Receive a packet.
            -- Who from is put into the peer_address.
            -- (from DATAGRAM_SOCKET)
        require -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_read: is_open_read
        ensure -- from DATAGRAM_SOCKET
            known_address: peer_address /= void

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Send boolean b through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putbool.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_character (c: CHARACTER)
            -- Send character c through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putchar.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_double (d: DOUBLE)
            -- Send double d through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putdouble.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_integer (i: INTEGER)
            -- Send integer i through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putint.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Send real r through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putreal.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    put_string (s: STRING)
            -- Send string s through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of putstring.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putbool (b: BOOLEAN)
            -- Send boolean b through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_boolean.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putchar (c: CHARACTER)
            -- Send character c through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_character.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putdouble (d: DOUBLE)
            -- Send double d through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_double.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putint (i: INTEGER)
            -- Send integer i through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_integer.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putreal (r: REAL)
            -- Send real r through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_real.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    putstring (s: STRING)
            -- Send string s through socket.
            -- Was declared in DATAGRAM_SOCKET as synonym of put_string.
            -- (from DATAGRAM_SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
        require else -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: peer_address /= void

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a_packet to address in peer_address.
            -- (from DATAGRAM_SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    send_to (a_packet: DATAGRAM_PACKET; to_address: SOCKET_ADDRESS; flags: INTEGER)
            -- Send a_packet to address to_address
            -- (from DATAGRAM_SOCKET)
        require -- from DATAGRAM_SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_peer: to_address /= void
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from NETWORK_SOCKET
    timeout_set: timeout > 0

end -- class NETWORK_DATAGRAM_SOCKET


NETWORK_SOCKET_ADDRESS Chart

class
    NETWORK_SOCKET_ADDRESS

General
    cluster: net.network.socket
    description: "A network socket address."
    create: make_local_from_port, make_from_name_and_port, make_from_ip_and_port, make

Ancestors
    SOCKET_ADDRESS
    SOCKET_ADDRESS
    SOCKET_RESOURCES

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    count: INTEGER
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    expired_socket: BOOLEAN
    family: INTEGER
    host_address: HOST_ADDRESS
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_equal (other: [like Current] NETWORK_SOCKET_ADDRESS): BOOLEAN
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    port: INTEGER
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    socket_address: SPECIAL [CHARACTER]
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    zero_option: BOOLEAN

Commands
    clear_zero
    copy (other: [like Current] NETWORK_SOCKET_ADDRESS)
    make
    make_from_ip_and_port (an_ip_number: STRING; a_port: INTEGER)
    make_from_name_and_port (a_hostname: STRING; a_port: INTEGER)
    make_local_from_port (a_port: INTEGER)
    set_family (f: INTEGER)
    set_host_address (a_host_address: HOST_ADDRESS)
    set_port (p: INTEGER)
    set_port_from_name (a_name, protocol: STRING)
    socket_address_make


NETWORK_SOCKET_ADDRESS Flat contracts

indexing
    description: "A network socket address."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

class interface
    NETWORK_SOCKET_ADDRESS

create

    make
            -- Create a network address.

    make_local_from_port (a_port: INTEGER)
            -- Create a local address with port a_port.

    make_from_name_and_port (a_hostname: STRING; a_port: INTEGER)
            -- Create an address from host name a_hostname and
            -- port a_port.

    make_from_ip_and_port (an_ip_number: STRING; a_port: INTEGER)
            -- Create an address from ip number an_ip_number
            -- (in dotted format) and port a_port.

feature -- Initialization

    make
            -- Create a network address.

    make_from_ip_and_port (an_ip_number: STRING; a_port: INTEGER)
            -- Create an address from ip number an_ip_number
            -- (in dotted format) and port a_port.

    make_from_name_and_port (a_hostname: STRING; a_port: INTEGER)
            -- Create an address from host name a_hostname and
            -- port a_port.

    make_local_from_port (a_port: INTEGER)
            -- Create a local address with port a_port.

feature -- Access

    socket_address: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    count: INTEGER
            -- Size of address
            -- (from SOCKET_ADDRESS)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is current address equal to other?
            -- (from SOCKET_ADDRESS)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    family: INTEGER
            -- Get the socket family of socket address.
            -- (from SOCKET_ADDRESS)

    host_address: HOST_ADDRESS
            -- Host address of address

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    port: INTEGER
            -- Port number

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    clear_zero
            -- Set zero attribute in address structure.

    set_family (f: INTEGER)
            -- Set socket address family to f.
            -- (from SOCKET_ADDRESS)

    set_host_address (a_host_address: HOST_ADDRESS)
            -- Set host address to a_host_address

    set_port (p: INTEGER)
            -- Set port to p.

    set_port_from_name (a_name, protocol: STRING)
            -- Set port number using a_name and protocol
            -- to refer into the (local) services file.

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying characters of other.
            -- (This is also used by clone.)
            -- (from SOCKET_ADDRESS)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from SOCKET_ADDRESS
            new_result_count: count = other.count or else count = address_size

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Initalization

    socket_address_make
            -- Make space available for address size.
            -- (from SOCKET_ADDRESS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class NETWORK_SOCKET_ADDRESS


NETWORK_SOCKET Chart

deferred class
    NETWORK_SOCKET

General
    cluster: net.network.socket
    description: "A network socket."

Ancestors
    SOCKET

Queries
    address: NETWORK_SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    has_exception_state: BOOLEAN
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    peer_address: [like address] NETWORK_SOCKET_ADDRESS
    port: INTEGER
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    ready_for_reading: BOOLEAN
    ready_for_writing: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    retrieved: ANY
    reuse_address: BOOLEAN
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    support_storable: BOOLEAN
    timeout: INTEGER
    type: INTEGER
    zero_option: BOOLEAN

Commands
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_reuse_address
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    make_socket
    new_line
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    set_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    set_blocking
    set_non_blocking
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_reuse_address
    set_send_buf_size (s: INTEGER)
    set_timeout (n: INTEGER)
    write (a_packet: PACKET)

Constraints
    timeout set


NETWORK_SOCKET Flat contracts

indexing
    description: "A network socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    NETWORK_SOCKET

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read
        ensure then
            timeout_set_to_default: timeout = default_timeout

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address: NETWORK_SOCKET_ADDRESS
            -- Local address of socket

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    has_exception_state: BOOLEAN
            -- Is socket in exception state within timeout seconds?

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: like address): BOOLEAN
            -- Is addr a valid peer address?
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    port: INTEGER
            -- Port socket is bound to.
        require
            valid_socket: exists

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    ready_for_reading: BOOLEAN
            -- Is data available for reading from the socket within
            -- timeout seconds?

    ready_for_writing: BOOLEAN
            -- Can data be written to the socket within timeout seconds?

    reuse_address: BOOLEAN
            -- Is reuse_address option set?
        require
            socket_exists: exists

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    support_storable: BOOLEAN
            -- Can medium be used to store an Eiffel structure?
            -- (from SOCKET)

    timeout: INTEGER
            -- Duration of timeout in seconds

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    do_not_reuse_address
            -- Turn reuse_address option off.
        require
            socket_exists: exists

    set_reuse_address
            -- Turn reuse_address option on.
        require
            socket_exists: exists

    set_timeout (n: INTEGER)
            -- Set timeout to n seconds.
        require
            non_negative: n >= 0
        ensure
            timeout_set: timeout = n or timeout = default_timeout

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    name: STRING
            -- Socket name
            -- (from SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Basic commands

    bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    cleanup
            -- Cleanup socket.
            -- (from SOCKET)

    close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of putbool.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_character (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of putchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_double (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of putdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_integer (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of putint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of putreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_string (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of putstring.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putbool (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of put_boolean.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putchar (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of put_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putdouble (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of put_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putint (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of put_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putreal (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of put_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putstring (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of put_string.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a packet a_packet of data to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

    timeout_set: timeout > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class NETWORK_SOCKET


NETWORK_STREAM_SOCKET Chart

class
    NETWORK_STREAM_SOCKET

General
    cluster: net.network.socket
    description: "A network stream socket."
    create: make_server_by_port, make, make_client_by_port, create_from_descriptor

Ancestors
    NETWORK_SOCKET
    STREAM_SOCKET

Queries
    accepted: [like Current] NETWORK_STREAM_SOCKET
    address: NETWORK_SOCKET_ADDRESS
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    debug_enabled: BOOLEAN
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    exists: BOOLEAN
    expired_socket: BOOLEAN
    extendible: BOOLEAN
    family: INTEGER
    group_id: INTEGER
    has_exception_state: BOOLEAN
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    is_blocking: BOOLEAN
    is_closed: BOOLEAN
    is_executable: BOOLEAN
    is_group_id: BOOLEAN
    is_linger_on: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_out_of_band_inline: BOOLEAN
    is_plain_text: BOOLEAN
    is_process_id: BOOLEAN
    is_readable: BOOLEAN
    is_socket_stream: BOOLEAN
    is_valid_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS): BOOLEAN
    is_writable: BOOLEAN
    last_boolean: BOOLEAN
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linger_time: INTEGER
    maxium_seg_size: INTEGER
    name: STRING
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    old_socket_address: SOCKET_ADDRESS
    peer_address: [like address] NETWORK_SOCKET_ADDRESS
    port: INTEGER
    process_id: INTEGER
    protected_address: BOOLEAN
    protocol: INTEGER
    protocol_not_supported: BOOLEAN
    read (size: INTEGER): PACKET
    readable: BOOLEAN
    ready_for_reading: BOOLEAN
    ready_for_writing: BOOLEAN
    receive (size, flags: INTEGER): PACKET
    receive_buf_size: INTEGER
    retrieved: ANY
    reuse_address: BOOLEAN
    route_enabled: BOOLEAN
    send_buf_size: INTEGER
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    Support_storable: BOOLEAN
    timeout: INTEGER
    type: INTEGER
    zero_option: BOOLEAN

Commands
    accept
    basic_store (object: ANY)
    bind
    cleanup
    close
    connect
    create_from_descriptor (fd: INTEGER)
    disable_debug
    dispose
    do_not_reuse_address
    do_not_route
    enable_debug
    general_store (object: ANY)
    independent_store (object: ANY)
    listen (queue: INTEGER)
    make
    make_client_by_port (a_peer_port: INTEGER; a_peer_host: STRING)
    make_server_by_port (a_port: INTEGER)
    make_socket
    new_line
    old_socket_set_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_boolean
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    readbool
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    route
    send (a_packet: PACKET; flags: INTEGER)
    set_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    set_blocking
    set_delay
    set_linger_off
    set_linger_on (time: INTEGER)
    set_nodelay
    set_non_blocking
    set_out_of_band_inline
    set_out_of_band_not_inline
    set_owner (own: INTEGER)
    set_peer_address (addr: [like address] NETWORK_SOCKET_ADDRESS)
    set_receive_buf_size (s: INTEGER)
    set_reuse_address
    set_send_buf_size (s: INTEGER)
    set_timeout (n: INTEGER)
    write (a_packet: PACKET)


NETWORK_STREAM_SOCKET Flat contracts

indexing
    description: "A network stream socket."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

class interface
    NETWORK_STREAM_SOCKET

create

    make
            -- Create a network stream socket.
        ensure
            timeout_set_to_default: timeout = default_timeout

    make_client_by_port (a_peer_port: INTEGER; a_peer_host: STRING)
            -- Create a client connection to a_peer_host on
            -- a_peer_port.
        require
            valid_peer_host: a_peer_host /= void and then not a_peer_host.is_empty
            valid_port: a_peer_port >= 0

    make_server_by_port (a_port: INTEGER)
            -- Create server socket on a_port.
        require
            valid_port: a_port >= 0

feature -- Initialization

    create_from_descriptor (fd: INTEGER)
            -- Create socket from descriptor fd.
            -- (from NETWORK_SOCKET)
        ensure -- from SOCKET
            family_valid: family = address.family
            opened_all: is_open_write and is_open_read
        ensure then -- from NETWORK_SOCKET
            timeout_set_to_default: timeout = default_timeout

    make
            -- Create a network stream socket.
        ensure
            timeout_set_to_default: timeout = default_timeout

    make_client_by_port (a_peer_port: INTEGER; a_peer_host: STRING)
            -- Create a client connection to a_peer_host on
            -- a_peer_port.
        require
            valid_peer_host: a_peer_host /= void and then not a_peer_host.is_empty
            valid_port: a_peer_port >= 0

    make_server_by_port (a_port: INTEGER)
            -- Create server socket on a_port.
        require
            valid_port: a_port >= 0

feature -- Access

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

feature -- Status report

    address: NETWORK_SOCKET_ADDRESS
            -- Local address of socket
            -- (from NETWORK_SOCKET)

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    has_exception_state: BOOLEAN
            -- Is socket in exception state within timeout seconds?
            -- (from NETWORK_SOCKET)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    is_linger_on: BOOLEAN
            -- Is lingering switched on?
        require
            socket_exists: exists

    is_out_of_band_inline: BOOLEAN
            -- Are out-of-band packets sent inline?
        require
            socket_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)?
            -- (from IO_MEDIUM)

    is_valid_peer_address (addr: like address): BOOLEAN
            -- Is addr a valid peer address?
            -- (from NETWORK_SOCKET)
        require -- from SOCKET
            address_exists: addr /= void

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    linger_time: INTEGER
            -- Linger time
        require
            socket_exists: exists

    maxium_seg_size: INTEGER
            -- Maximum segment size
        require
            socket_exists: exists

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    port: INTEGER
            -- Port socket is bound to.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            valid_socket: exists

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    ready_for_reading: BOOLEAN
            -- Is data available for reading from the socket within
            -- timeout seconds?
            -- (from NETWORK_SOCKET)

    ready_for_writing: BOOLEAN
            -- Can data be written to the socket within timeout seconds?
            -- (from NETWORK_SOCKET)

    reuse_address: BOOLEAN
            -- Is reuse_address option set?
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            socket_exists: exists

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    Support_storable: BOOLEAN is True
            -- Can medium be used to store an Eiffel structure?
            -- (from STREAM_SOCKET)

    timeout: INTEGER
            -- Duration of timeout in seconds
            -- (from NETWORK_SOCKET)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature -- Status setting

    do_not_reuse_address
            -- Turn reuse_address option off.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            socket_exists: exists

    set_delay
            -- Switch option TCPNO_DELAY on.
        require
            socket_exists: exists

    set_linger_off
            -- Switch lingering off.
        require
            socket_exists: exists

    set_linger_on (time: INTEGER)
            -- Switch lingering on and set linger time to time.
        require
            socket_exists: exists

    set_nodelay
            -- Switch option TCPNO_DELAY off.
        require
            socket_exists: exists

    set_out_of_band_inline
            -- Switch "out of band packets inline" on.
        require
            socket_exists: exists

    set_out_of_band_not_inline
            -- Switch "out of band packets inline" off.
        require
            socket_exists: exists

    set_reuse_address
            -- Turn reuse_address option on.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            socket_exists: exists

    set_timeout (n: INTEGER)
            -- Set timeout to n seconds.
            -- (from NETWORK_SOCKET)
        require -- from NETWORK_SOCKET
            non_negative: n >= 0
        ensure -- from NETWORK_SOCKET
            timeout_set: timeout = n or timeout = default_timeout

feature -- Element change

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from SOCKET)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

feature -- Removal

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

feature -- Miscellaneous

    name: STRING
            -- Socket name
            -- (from SOCKET)
        require -- from  IO_MEDIUM
            True
        require else -- from SOCKET
            socket_exists: exists

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature

    accept
            -- Accept a new connection on listen socket.
            -- Accepted service socket available in accepted.
            -- (from STREAM_SOCKET)
        require -- from STREAM_SOCKET
            socket_exists: exists

    accepted: like Current
            -- Last accepted socket.
            -- (from STREAM_SOCKET)

    listen (queue: INTEGER)
            -- Listen on socket for at most queue connections.
            -- (from STREAM_SOCKET)
        require -- from STREAM_SOCKET
            socket_exists: exists

feature -- Basic commands

    old_socket_address: SOCKET_ADDRESS
            -- Local address of socket
            -- (from SOCKET)

    bind
            -- Bind socket to local address in address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_local_address: address /= void

    cleanup
            -- Cleanup socket.
            -- (from SOCKET)

    close
            -- Close socket.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        require else -- from SOCKET
            socket_exists: exists

    connect
            -- Connect socket to peer address.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_peer_address: peer_address /= void

    descriptor: INTEGER
            -- Socket descriptor of current socket
            -- (from SOCKET)

    descriptor_available: BOOLEAN
            -- Is descriptor available?
            -- (from SOCKET)

    family: INTEGER
            -- Socket family eg. af_inet, af_unix
            -- (from SOCKET)

    is_closed: BOOLEAN
            -- Is socket closed?
            -- (from SOCKET)

    make_socket
            -- Create socket descriptor.
            -- (from SOCKET)
        require -- from SOCKET
            valid_family: family >= 0
            valid_type: type >= 0
            valid_protocol: protocol >= 0

    peer_address: like address
            -- Peer address of socket
            -- (from SOCKET)

    protocol: INTEGER
            -- Protocol of the socket. default 0
            -- means for the system to chose the default
            -- protocol for the family chosen. eg. udp, tcp.
            -- (from SOCKET)

    set_address (addr: like address)
            -- Set local address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            same_type: addr.family = family
        ensure -- from SOCKET
            address_set: address = addr

    old_socket_set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    set_peer_address (addr: like address)
            -- Set peer address to addr.
            -- (from SOCKET)
        require -- from SOCKET
            address_exists: addr /= void
            address_valid: is_valid_peer_address (addr)
        ensure -- from SOCKET
            address_set: peer_address = addr

    type: INTEGER
            -- Type of socket. eg stream, datagram
            -- (from SOCKET)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- Input

    last_boolean: BOOLEAN
            -- Last boolean read by read_boolean
            -- (from SOCKET)

    read (size: INTEGER): PACKET
            -- Read a packet of data of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_boolean
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of readbool.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of readchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_double
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of readdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_integer
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of readint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_line
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of readline.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_real
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of readreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of readstream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readbool
            -- Read a new boolean.
            -- Maker result available in last_boolean.
            -- Was declared in SOCKET as synonym of read_boolean.
            -- (from SOCKET)
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in SOCKET as synonym of read_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readdouble
            -- Read a new double.
            -- Make result available in last_double.
            -- Was declared in SOCKET as synonym of read_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readint
            -- Read a new integer.
            -- Make result available in last_integer.
            -- Was declared in SOCKET as synonym of read_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readline
            -- Read a line of characters (ended by a new_line).
            -- Was declared in SOCKET as synonym of read_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readreal
            -- Read a new real.
            -- Make result available in last_real.
            -- Was declared in SOCKET as synonym of read_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char characters.
            -- Make result available in last_string.
            -- Was declared in SOCKET as synonym of read_stream.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

    receive (size, flags: INTEGER): PACKET
            -- Receive a packet of maximum size size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_read: is_open_read

feature -- Output

    exists: BOOLEAN
            -- Does socket exist?
            -- (from SOCKET)

    extendible: BOOLEAN
            -- May new items be added?
            -- (from SOCKET)

    is_executable: BOOLEAN
            -- Is socket an executable?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_open_read: BOOLEAN
            -- Is socket opened for reading?
            -- (from SOCKET)

    is_open_write: BOOLEAN
            -- Is socket opened for writing?
            -- (from SOCKET)

    is_readable: BOOLEAN
            -- Is socket a readable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_writable: BOOLEAN
            -- Is socket a writable medium?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of put_new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_boolean (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of putbool.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_character (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of putchar.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_double (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of putdouble.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_integer (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of putint.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_new_line
            -- Write a "new_line" character to socket.
            -- Was declared in SOCKET as synonym of new_line.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_real (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of putreal.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    put_string (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of putstring.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putbool (b: BOOLEAN)
            -- Write boolean b to socket.
            -- Was declared in SOCKET as synonym of put_boolean.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putchar (c: CHARACTER)
            -- Write character c to socket.
            -- Was declared in SOCKET as synonym of put_character.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putdouble (d: DOUBLE)
            -- Write double d to socket.
            -- Was declared in SOCKET as synonym of put_double.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putint (i: INTEGER)
            -- Write integer i to socket.
            -- Was declared in SOCKET as synonym of put_integer.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putreal (r: REAL)
            -- Write real r to socket.
            -- Was declared in SOCKET as synonym of put_real.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    putstring (s: STRING)
            -- Write string s to socket.
            -- Was declared in SOCKET as synonym of put_string.
            -- (from SOCKET)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void
        require else -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

    readable: BOOLEAN
            -- Is there currently any data available on socket?
            -- (from SOCKET)
        require -- from IO_MEDIUM
            handle_exists: exists

    send (a_packet: PACKET; flags: INTEGER)
            -- Send a packet a_packet of data to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write
            valid_packet: a_packet /= void

    write (a_packet: PACKET)
            -- Write packet a_packet to socket.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            opened_for_write: is_open_write

feature -- socket options

    debug_enabled: BOOLEAN
            -- Is socket system debugging enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    disable_debug
            -- Disable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    do_not_route
            -- Set socket to non-routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    enable_debug
            -- Enable socket system debugging.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    group_id: INTEGER
            -- Group id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            group_set: is_group_id

    is_blocking: BOOLEAN
            -- Is the socket blocking?
            -- (from SOCKET)

    is_group_id: BOOLEAN
            -- Is the owner id the socket group id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_process_id: BOOLEAN
            -- Is the owner id the socket process id?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    is_socket_stream: BOOLEAN
            -- Is the socket a stream?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    process_id: INTEGER
            -- Process id of socket
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            process_set: is_process_id

    receive_buf_size: INTEGER
            -- Size of receive buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route
            -- Set socket to routing.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    route_enabled: BOOLEAN
            -- Is routing enabled?
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    send_buf_size: INTEGER
            -- Size of send buffer.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists

    set_blocking
            -- Set socket to blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            is_blocking

    set_non_blocking
            -- Set socket to non-blocking mode.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            not is_blocking

    set_owner (own: INTEGER)
            -- Negative value sets group process id.
            -- positive value sets process id.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
            valid_owner: own /= 0 and own /= - 1
        ensure -- from SOCKET
            set_id: own < - 1 implies own = group_id or else own > 0 implies own = process_id

    set_receive_buf_size (s: INTEGER)
            -- Set receive buffer size.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = receive_buf_size

    set_send_buf_size (s: INTEGER)
            -- Set the send buffer to size s.
            -- (from SOCKET)
        require -- from SOCKET
            socket_exists: exists
        ensure -- from SOCKET
            size_set: s = send_buf_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from NETWORK_SOCKET
    timeout_set: timeout > 0

end -- class NETWORK_STREAM_SOCKET


cluster net.polling

Cluster
    net.polling

Supercluster
    net

Subclusters
    net.polling.abstract
    net.polling.implementation


cluster net.polling.abstract

Cluster
    net.polling.abstract

Supercluster
    net.polling

Classes
    MEDIUM_POLLER
    POLL_COMMAND
    POLL_MASK
    SOCKET_POLLER


MEDIUM_POLLER Chart

class
    MEDIUM_POLLER

General
    cluster: net.polling.abstract
    description: "A medium poller for asynchronous IO on IO_MEDIUMs"
    create: make_write_only, make_exception_only, make_read_only, make

Ancestors
    SOCKET_RESOURCES

Queries
    address_in_use: BOOLEAN
    address_not_readable: BOOLEAN
    already_bound: BOOLEAN
    bad_socket_handle: BOOLEAN
    c_msgdontroute: INTEGER
    c_oobmsg: INTEGER
    c_peekmsg: INTEGER
    connect_in_progress: BOOLEAN
    connection_refused: BOOLEAN
    dtable_full: BOOLEAN
    error: STRING
    error_number: INTEGER
    Except_mask: POLL_MASK
    Exception_command_list: ARRAY [POLL_COMMAND]
    expired_socket: BOOLEAN
    ignore_exception: BOOLEAN
    ignore_read: BOOLEAN
    ignore_write: BOOLEAN
    invalid_address: BOOLEAN
    invalid_socket_handle: BOOLEAN
    last_except_mask: POLL_MASK
    last_read_mask: POLL_MASK
    last_write_mask: POLL_MASK
    medium_select (number_to_check, time_out_msec: INTEGER): INTEGER
    network: BOOLEAN
    no_buffers: BOOLEAN
    no_permission: BOOLEAN
    not_connected: BOOLEAN
    protected_address: BOOLEAN
    protocol_not_supported: BOOLEAN
    Read_command_list: ARRAY [POLL_COMMAND]
    Read_mask: POLL_MASK
    socket_family_not_supported: BOOLEAN
    socket_in_use: BOOLEAN
    socket_ok: BOOLEAN
    socket_would_block: BOOLEAN
    wait: BOOLEAN
    Write_command_list: ARRAY [POLL_COMMAND]
    Write_mask: POLL_MASK
    zero_option: BOOLEAN

Commands
    execute (max_des, time_out_msec: INTEGER)
    make
    make_exception_only
    make_read_only
    make_write_only
    process_selected (number_of_selected: INTEGER)
    put_exception_command (a_command: POLL_COMMAND)
    put_read_command (a_command: POLL_COMMAND)
    put_write_command (a_command: POLL_COMMAND)
    remove_associated_exception_command (s: IO_MEDIUM)
    remove_associated_read_command (s: IO_MEDIUM)
    remove_associated_write_command (s: IO_MEDIUM)
    remove_exception_command (a_command: POLL_COMMAND)
    remove_read_command (a_command: POLL_COMMAND)
    remove_write_command (a_command: POLL_COMMAND)
    set_exception
    set_ignore_exception
    set_ignore_read
    set_ignore_write
    set_read
    set_wait
    set_write
    unset_wait


MEDIUM_POLLER Flat contracts

indexing
    description: "A medium poller for asynchronous IO on IO_MEDIUMs"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

class interface
    MEDIUM_POLLER

create

    make
            -- Create poller for multi-event polling.

    make_read_only
            -- Create poller for read events only.

    make_write_only
            -- Create poller for write events only.

    make_exception_only
            -- Create poller for exception events only.

feature -- Initialization

    make
            -- Create poller for multi-event polling.

    make_exception_only
            -- Create poller for exception events only.

    make_read_only
            -- Create poller for read events only.

    make_write_only
            -- Create poller for write events only.

feature -- Status report

    address_in_use: BOOLEAN
            -- Address is in use by another socket.
            -- (from SOCKET_RESOURCES)

    address_not_readable: BOOLEAN
            -- Unreadable address
            -- (from SOCKET_RESOURCES)

    already_bound: BOOLEAN
            -- Socket has already been bound.
            -- (from SOCKET_RESOURCES)

    bad_socket_handle: BOOLEAN
            -- Socket descriptor is bad.
            -- (from SOCKET_RESOURCES)

    connect_in_progress: BOOLEAN
            -- Call to connect returned on a non-blocking socket.
            -- (from SOCKET_RESOURCES)

    connection_refused: BOOLEAN
            -- Connection is refused (possibly due to security).
            -- (from SOCKET_RESOURCES)

    dtable_full: BOOLEAN
            -- Descriptor table is full
            -- (from SOCKET_RESOURCES)

    error: STRING
            -- Output a related error message.
            -- (from SOCKET_RESOURCES)

    error_number: INTEGER
            -- Returned error number
            -- (from SOCKET_RESOURCES)

    expired_socket: BOOLEAN
            -- Socket connection has expired.
            -- (from SOCKET_RESOURCES)

    invalid_address: BOOLEAN
            -- Address is not valid.
            -- (from SOCKET_RESOURCES)

    invalid_socket_handle: BOOLEAN
            -- Socket descriptor is not valid.
            -- (from SOCKET_RESOURCES)

    network: BOOLEAN
            -- Socket failed due to network problems.
            -- (from SOCKET_RESOURCES)

    no_buffers: BOOLEAN
            -- No more buffers available
            -- (from SOCKET_RESOURCES)

    no_permission: BOOLEAN
            -- No permission is given to user for this socket.
            -- (from SOCKET_RESOURCES)

    not_connected: BOOLEAN
            -- Socket is not connect.
            -- (from SOCKET_RESOURCES)

    protected_address: BOOLEAN
            -- No access to this address is allowed.
            -- (from SOCKET_RESOURCES)

    protocol_not_supported: BOOLEAN
            -- Protocol is not supported on this platform.
            -- (from SOCKET_RESOURCES)

    socket_family_not_supported: BOOLEAN
            -- Requested family is not supported.
            -- (from SOCKET_RESOURCES)

    socket_in_use: BOOLEAN
            -- Socket is already in use.
            -- (from SOCKET_RESOURCES)

    socket_ok: BOOLEAN
            -- No error
            -- (from SOCKET_RESOURCES)

    socket_would_block: BOOLEAN
            -- Call to read, write, etc would have blocked.
            -- (from SOCKET_RESOURCES)

    zero_option: BOOLEAN
            -- No options provided
            -- (from SOCKET_RESOURCES)

feature

    execute (max_des, time_out_msec: INTEGER)
            -- Poll io_medium's whose descriptor is less than
            -- max_des and process ready media.
            -- If no medium is ready, wait the 'time_out..'
            -- time before returning.
        require
            valid_number: max_des > 0

    medium_select (number_to_check, time_out_msec: INTEGER): INTEGER
            -- Check the multiplexing masks for the
            -- read, write, and exception medium reception
            -- and return the number of mediums waiting
            -- after 'time_out...' time

feature --  blocking features

    set_wait
            -- Set poller to block.
        ensure
            wait_set: wait

    unset_wait
            -- Set poller to return after timeout.
        ensure
            wait_not_set: not wait

    wait: BOOLEAN
            -- Poller blocks until event?
            -- (otherwise, returns after timeout)

feature -- Externals: flags for send, sendto recv and recvfrom socket calls

    c_msgdontroute: INTEGER
            -- Do not route message
            -- (from SOCKET_RESOURCES)

    c_oobmsg: INTEGER
            -- Out of bound message
            -- (from SOCKET_RESOURCES)

    c_peekmsg: INTEGER
            -- Peek message
            -- (from SOCKET_RESOURCES)

feature -- booleans to decide whether to include each mask in the select call

    ignore_exception: BOOLEAN
            -- Is Exception mask ignored?

    ignore_read: BOOLEAN
            -- Is read mask ignored?

    ignore_write: BOOLEAN
            -- Is write mask ignored?

    set_exception
            -- Set exception mask to be looked up.
        ensure
            exception_used: not ignore_exception

    set_ignore_exception
            --  Ignore exception mask.
        ensure
            exception_not_used: ignore_exception

    set_ignore_read
            -- Ignore read mask.
        ensure
            read_not_used: ignore_read

    set_ignore_write
            -- Ignore write mask.
        ensure
            write_not_used: ignore_write

    set_read
            -- Set read mask to be looked up.
        ensure
            read_used: not ignore_read

    set_write
            -- Set write mask to be looked up.
        ensure
            write_used: not ignore_write

feature -- commands to be executed

    exception_command_list: ARRAY [POLL_COMMAND]
            -- List of poll commands to be called
            -- when their medium is selected for exception event.

    put_exception_command (a_command: POLL_COMMAND)
            -- Set a_command to be called when exception event
            -- is selected on its io_medium.
        require
            valid_command: a_command /= void
            not_empty_medium: a_command.active_medium /= void
        ensure
            command_added: exception_command_list.has (a_command)

    put_read_command (a_command: POLL_COMMAND)
            -- Set a_command to be called when read event is
            -- selected on its io_medium.
        require
            valid_command: a_command /= void
            not_empty_medium: a_command.active_medium /= void
        ensure
            command_added: read_command_list.has (a_command)

    put_write_command (a_command: POLL_COMMAND)
            -- Set a_command to be called when write event is
            -- selected on its io_medium.
        require
            valid_command: a_command /= void
            not_empty_medium: a_command.active_medium /= void
        ensure
            command_added: write_command_list.has (a_command)

    read_command_list: ARRAY [POLL_COMMAND]
            -- List of poll commands to be called
            -- when their medium is selected for read event.

    remove_associated_exception_command (s: IO_MEDIUM)
            -- Remove command associated with medium s from
            -- exception registered media.
        require
            has_command: exception_command_list.upper >= s.handle
        ensure
            command_removed: exception_command_list.item (s.handle) = void

    remove_associated_read_command (s: IO_MEDIUM)
            -- Remove command associated with medium s from
            -- read registered media.
        require
            has_command: read_command_list.upper >= s.handle
        ensure
            command_removed: read_command_list.item (s.handle) = void

    remove_associated_write_command (s: IO_MEDIUM)
            -- Remove command associated with medium s from
            -- write registered media.
        require
            has_command: write_command_list.upper >= s.handle
        ensure
            command_removed: write_command_list.item (s.handle) = void

    remove_exception_command (a_command: POLL_COMMAND)
            -- Remove a_command from exception registered media.
        require
            has_command: exception_command_list.has (a_command)
        ensure
            command_removed: not exception_command_list.has (a_command)

    remove_read_command (a_command: POLL_COMMAND)
            -- Remove a_command from read registered media.
        require
            valid_command: a_command /= void
            has_command: read_command_list.has (a_command)
            not_empty_medium: a_command.active_medium /= void
        ensure
            command_removed: not read_command_list.has (a_command)

    remove_write_command (a_command: POLL_COMMAND)
            -- Remove a_command from write registered media.
        require
            has_command: write_command_list.has (a_command)
        ensure
            command_removed: not write_command_list.has (a_command)

    write_command_list: ARRAY [POLL_COMMAND]
            -- List of poll commands to be called
            -- when their medium is selected for write event.

feature -- medium masks

    except_mask: POLL_MASK
            -- Exception mask used by medium select

    last_except_mask: POLL_MASK
            -- Exception mask returned by medium select

    last_read_mask: POLL_MASK
            -- Read mask returned by medium select

    last_write_mask: POLL_MASK
            -- Write mask returned by medium select

    read_mask: POLL_MASK
            -- Read mask used by medium select

    write_mask: POLL_MASK
            -- Write mask used by medium select.

feature -- process set commands

    process_selected (number_of_selected: INTEGER)
            -- Process commands for ready media.
        require
            valid_number: number_of_selected > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class MEDIUM_POLLER


POLL_COMMAND Chart

deferred class
    POLL_COMMAND

General
    cluster: net.polling.abstract
    description: "A poll command for use with a medium poller."

Ancestors
    ANY

Queries
    active_medium: IO_MEDIUM

Commands
    execute (arg: ANY)
    make (s: [like active_medium] IO_MEDIUM)


POLL_COMMAND Flat contracts

indexing
    description: "A poll command for use with a medium poller."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    POLL_COMMAND

feature -- Access

    active_medium: IO_MEDIUM
            -- Medium which was polled

feature -- Basic operation

    execute (arg: ANY)
            -- do the work of the command

feature -- Initalization

    make (s: like active_medium)
        require
            socket_open: s /= void and then not s.is_closed
        ensure
            socket_assigned: s = active_medium

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class POLL_COMMAND


POLL_MASK Chart

class
    POLL_MASK

General
    cluster: net.polling.abstract
    description: "A mask for use with a medium poller."
    create: make

Ancestors
    TO_SPECIAL [T]
    TO_SPECIAL [T]

Queries
    count: INTEGER
    is_bit_set (b: INTEGER): BOOLEAN
    is_equal (other: [like Current] POLL_MASK): BOOLEAN
    is_medium_ready (s: IO_MEDIUM): BOOLEAN
    mask: SPECIAL [CHARACTER]

Commands
    clear
    clear_bit (b: INTEGER)
    clear_medium (s: IO_MEDIUM)
    copy (other: [like Current] POLL_MASK)
    make
    set_bit (b: INTEGER)
    set_medium (s: IO_MEDIUM)


POLL_MASK Flat contracts

indexing
    description: "A mask for use with a medium poller."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

class interface
    POLL_MASK

create

    make
            -- Create mask.

feature -- Initialization

    make
            -- Create mask.

feature -- Access

    mask: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    count: INTEGER
            -- Size of mask in bytes

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is current mask equal to other ?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    is_bit_set (b: INTEGER): BOOLEAN
            -- Is the bit identified by b set ?

    is_medium_ready (s: IO_MEDIUM): BOOLEAN
            -- Is the bit identified by the medium s handle set ?
        require
            valid_medium: s /= void and then not s.is_closed

feature -- Status setting

    clear
            -- Blank out all bits in mask.

    clear_bit (b: INTEGER)
            -- Clear bit at position b in mask.
        ensure
            has_cleared: not is_bit_set (b)

    clear_medium (s: IO_MEDIUM)
            -- Clear bit at medium s handle position, in mask.
        require
            valid_medium: s /= void and then not s.is_closed
        ensure
            has_cleared: not is_bit_set (s.handle)

    set_bit (b: INTEGER)
            -- Set bit at position b in mask.
        ensure
            has_set: is_bit_set (b)

    set_medium (s: IO_MEDIUM)
            -- Set bit at medium s handle position, in mask.
        require
            valid_medium: s /= void and then not s.is_closed
        ensure
            has_set: is_bit_set (s.handle)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then
            size_valid: count = other.count or else count = mask_size

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class POLL_MASK


SOCKET_POLLER Chart

deferred class
    SOCKET_POLLER

General
    cluster: net.polling.abstract
    description: "Asynchronous socket polling, timer-based."

Ancestors
    ANY

Queries
    is_auto_discard: BOOLEAN
    is_poll_all: BOOLEAN
    is_poller_active: BOOLEAN

Commands
    add_accept_call_back (a_stream_socket: STREAM_SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
    add_readable_call_back (a_socket: SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
    make
    make_active (a_poll_delay: INTEGER)
    remove_accept_call_back (a_stream_socket: STREAM_SOCKET)
    remove_readable_call_back (a_socket: SOCKET)
    set_active (a_poll_delay: INTEGER)
    set_auto_discard
    set_inactive
    set_no_discard
    set_poll_all
    set_poll_one
    wipe_out_all_call_backs


SOCKET_POLLER Flat contracts

indexing
    description: "Asynchronous socket polling, timer-based."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:59 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    SOCKET_POLLER

feature -- Activation

    is_auto_discard: BOOLEAN
            -- Subscription is removed at call-back.

    is_poll_all: BOOLEAN
            -- Are all subscribed socket polled at each timer call-
            -- back or just one?

    is_poller_active: BOOLEAN
            -- Is poller called back?

    set_active (a_poll_delay: INTEGER)
            -- Activate poller timer with a_poll_delay
            -- time quantum (in milliseconds).
        require
            a_poll_delay_positive_and_not_null: a_poll_delay > 0
            poller_inactive: not is_poller_active

    set_auto_discard
            -- Poller will call back only once.

    set_inactive
            -- Disactivate poller timer.
        require
            poller_active: is_poller_active

    set_no_discard
            -- Subsciption to polling remains after call-back.

    set_poll_all
            -- All subscribed sockets will be polled at each poll
            -- delay.

    set_poll_one
            -- Only one subscribed listening socket and one service
            -- socket will be polled at each poll delay (if present).

feature -- Creation

    make
            -- Create internal structure of poller.

    make_active (a_poll_delay: INTEGER)
            -- Create active poller with a_poll_delay time
            -- quantum (in milliseconds).

feature -- Subscription

    add_accept_call_back (a_stream_socket: STREAM_SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
            -- Set command	a_command to be called when
            -- a_stream_socket is connected.
        require
            stream_socket_open_read: a_stream_socket.is_open_read
            command_not_void: a_command /= void

    add_readable_call_back (a_socket: SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
            -- Set command	a_command to be called when
            -- a_socket is readable.
        require
            socket_open_read: a_socket.is_open_read
            command_not_void: a_command /= void

    remove_accept_call_back (a_stream_socket: STREAM_SOCKET)
            -- Remove socket a_stream_socket from call-back list.

    remove_readable_call_back (a_socket: SOCKET)
            -- Remove socket a_socket from call-back list.

    wipe_out_all_call_backs
            -- Remove all socket call_backs from poller.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SOCKET_POLLER


cluster net.polling.implementation

Cluster
    net.polling.implementation

Supercluster
    net.polling

Classes
    WEL_SOCKET_POLLER


WEL_SOCKET_POLLER Chart

class
    WEL_SOCKET_POLLER

General
    cluster: net.polling.implementation
    create: make_active, make

Ancestors
    SOCKET_POLLER
    WEL_COMMAND
    WEL_WM_CONSTANTS

Queries
    is_auto_discard: BOOLEAN
    is_poll_all: BOOLEAN
    is_poller_active: BOOLEAN
    message_information: WEL_MESSAGE_INFORMATION
    Wm_activate: INTEGER
    Wm_activateapp: INTEGER
    Wm_afxfirst: INTEGER
    Wm_afxlast: INTEGER
    Wm_app: INTEGER
    Wm_appcommand: INTEGER
    Wm_askcbformatname: INTEGER
    Wm_canceljournal: INTEGER
    Wm_cancelmode: INTEGER
    Wm_capturechanged: INTEGER
    Wm_changecbchain: INTEGER
    Wm_changeuistate: INTEGER
    Wm_char: INTEGER
    Wm_chartoitem: INTEGER
    Wm_childactivate: INTEGER
    Wm_clear: INTEGER
    Wm_close: INTEGER
    Wm_command: INTEGER
    Wm_commnotify: INTEGER
    Wm_compacting: INTEGER
    Wm_compareitem: INTEGER
    Wm_contextmenu: INTEGER
    Wm_copy: INTEGER
    Wm_copydata: INTEGER
    Wm_create: INTEGER
    Wm_cut: INTEGER
    Wm_deadchar: INTEGER
    Wm_deleteitem: INTEGER
    Wm_destroy: INTEGER
    Wm_destroyclipboard: INTEGER
    Wm_devicechange: INTEGER
    Wm_devmodechange: INTEGER
    Wm_displaychange: INTEGER
    Wm_drawclipboard: INTEGER
    Wm_drawitem: INTEGER
    Wm_dropfiles: INTEGER
    Wm_enable: INTEGER
    Wm_endsession: INTEGER
    Wm_enteridle: INTEGER
    Wm_entermenuloop: INTEGER
    Wm_entersizemove: INTEGER
    Wm_erasebkgnd: INTEGER
    Wm_exitmenuloop: INTEGER
    Wm_exitsizemove: INTEGER
    Wm_fontchange: INTEGER
    Wm_getdlgcode: INTEGER
    Wm_getfont: INTEGER
    Wm_gethotkey: INTEGER
    Wm_geticon: INTEGER
    Wm_getminmaxinfo: INTEGER
    Wm_getobject: INTEGER
    Wm_gettext: INTEGER
    Wm_gettextlength: INTEGER
    Wm_handheldfirst: INTEGER
    Wm_handheldlast: INTEGER
    Wm_help: INTEGER
    Wm_hotkey: INTEGER
    Wm_hscroll: INTEGER
    Wm_hscrollclipboard: INTEGER
    Wm_iconerasebkgnd: INTEGER
    Wm_ime_char: INTEGER
    Wm_ime_composition: INTEGER
    Wm_ime_compositionfull: INTEGER
    Wm_ime_control: INTEGER
    Wm_ime_endcomposition: INTEGER
    Wm_ime_keydown: INTEGER
    wm_ime_keylast: INTEGER
    Wm_ime_keyup: INTEGER
    Wm_ime_notify: INTEGER
    Wm_ime_request: INTEGER
    Wm_ime_select: INTEGER
    Wm_ime_setcontext: INTEGER
    Wm_ime_startcomposition: INTEGER
    Wm_initdialog: INTEGER
    Wm_initmenu: INTEGER
    Wm_initmenupopup: INTEGER
    Wm_inputlangchange: INTEGER
    Wm_inputlangchangerequest: INTEGER
    Wm_keydown: INTEGER
    Wm_keyfirst: INTEGER
    wm_keylast: INTEGER
    Wm_keyup: INTEGER
    Wm_killfocus: INTEGER
    Wm_lbuttondblclk: INTEGER
    Wm_lbuttondown: INTEGER
    Wm_lbuttonup: INTEGER
    Wm_mbuttondblclk: INTEGER
    Wm_mbuttondown: INTEGER
    Wm_mbuttonup: INTEGER
    Wm_mdiactivate: INTEGER
    Wm_mdicascade: INTEGER
    Wm_mdicreate: INTEGER
    Wm_mdidestroy: INTEGER
    Wm_mdigetactive: INTEGER
    Wm_mdiiconarrange: INTEGER
    Wm_mdimaximize: INTEGER
    Wm_mdinext: INTEGER
    Wm_mdirefreshmenu: INTEGER
    Wm_mdirestore: INTEGER
    Wm_mdisetmenu: INTEGER
    Wm_mditile: INTEGER
    Wm_measureitem: INTEGER
    Wm_menuchar: INTEGER
    Wm_menucommand: INTEGER
    Wm_menudrag: INTEGER
    Wm_menugetobject: INTEGER
    Wm_menurbuttonup: INTEGER
    Wm_menuselect: INTEGER
    Wm_mouseactivate: INTEGER
    Wm_mousefirst: INTEGER
    Wm_mousehover: INTEGER
    wm_mouselast: INTEGER
    Wm_mouseleave: INTEGER
    Wm_mousemove: INTEGER
    Wm_mousewheel: INTEGER
    Wm_move: INTEGER
    Wm_moving: INTEGER
    Wm_ncactivate: INTEGER
    Wm_nccalcsize: INTEGER
    Wm_nccreate: INTEGER
    Wm_ncdestroy: INTEGER
    Wm_nchittest: INTEGER
    Wm_nclbuttondblclk: INTEGER
    Wm_nclbuttondown: INTEGER
    Wm_nclbuttonup: INTEGER
    Wm_ncmbuttondblclk: INTEGER
    Wm_ncmbuttondown: INTEGER
    Wm_ncmbuttonup: INTEGER
    Wm_ncmousehover: INTEGER
    Wm_ncmouseleave: INTEGER
    Wm_ncmousemove: INTEGER
    Wm_ncpaint: INTEGER
    Wm_ncrbuttondblclk: INTEGER
    Wm_ncrbuttondown: INTEGER
    Wm_ncrbuttonup: INTEGER
    Wm_ncxbuttondblclk: INTEGER
    Wm_ncxbuttondown: INTEGER
    Wm_ncxbuttonup: INTEGER
    Wm_nextdlgctl: INTEGER
    Wm_nextmenu: INTEGER
    Wm_notify: INTEGER
    Wm_notifyformat: INTEGER
    Wm_null: INTEGER
    Wm_paint: INTEGER
    Wm_paintclipboard: INTEGER
    Wm_painticon: INTEGER
    Wm_palettechanged: INTEGER
    Wm_paletteischanging: INTEGER
    Wm_parentnotify: INTEGER
    Wm_paste: INTEGER
    Wm_penwinfirst: INTEGER
    Wm_penwinlast: INTEGER
    Wm_power: INTEGER
    Wm_powerbroadcast: INTEGER
    Wm_print: INTEGER
    Wm_printclient: INTEGER
    Wm_querydragicon: INTEGER
    Wm_queryendsession: INTEGER
    Wm_querynewpalette: INTEGER
    Wm_queryopen: INTEGER
    Wm_queryuistate: INTEGER
    Wm_queuesync: INTEGER
    Wm_quit: INTEGER
    Wm_rbuttondblclk: INTEGER
    Wm_rbuttondown: INTEGER
    Wm_rbuttonup: INTEGER
    Wm_renderallformats: INTEGER
    Wm_renderformat: INTEGER
    Wm_setcursor: INTEGER
    Wm_setfocus: INTEGER
    Wm_setfont: INTEGER
    Wm_sethotkey: INTEGER
    Wm_seticon: INTEGER
    Wm_setredraw: INTEGER
    Wm_settext: INTEGER
    Wm_settingchange: INTEGER
    Wm_showwindow: INTEGER
    Wm_size: INTEGER
    Wm_sizeclipboard: INTEGER
    Wm_sizing: INTEGER
    Wm_spoolerstatus: INTEGER
    Wm_stylechanged: INTEGER
    Wm_stylechanging: INTEGER
    Wm_syncpaint: INTEGER
    Wm_syschar: INTEGER
    Wm_syscolorchange: INTEGER
    Wm_syscommand: INTEGER
    Wm_sysdeadchar: INTEGER
    Wm_syskeydown: INTEGER
    Wm_syskeyup: INTEGER
    Wm_tcard: INTEGER
    Wm_timechange: INTEGER
    Wm_timer: INTEGER
    Wm_undo: INTEGER
    Wm_uninitmenupopup: INTEGER
    Wm_updateuistate: INTEGER
    Wm_user: INTEGER
    Wm_userchanged: INTEGER
    Wm_vkeytoitem: INTEGER
    Wm_vscroll: INTEGER
    Wm_vscrollclipboard: INTEGER
    Wm_windowposchanged: INTEGER
    Wm_windowposchanging: INTEGER
    Wm_wininichange: INTEGER
    Wm_xbuttondblclk: INTEGER
    Wm_xbuttondown: INTEGER
    Wm_xbuttonup: INTEGER

Commands
    add_accept_call_back (a_stream_socket: STREAM_SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
    add_readable_call_back (a_socket: SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
    execute (arg: ANY)
    make (a_window: WEL_WINDOW; a_timer_id: INTEGER)
    make_active (a_window: WEL_WINDOW; a_timer_id, a_delay: INTEGER)
    poller_make
    poller_make_active (a_poll_delay: INTEGER)
    remove_accept_call_back (a_stream_socket: STREAM_SOCKET)
    remove_readable_call_back (a_socket: SOCKET)
    set_active (a_delay: INTEGER)
    set_auto_discard
    set_inactive
    set_message_information (mi: WEL_MESSAGE_INFORMATION)
    set_no_discard
    set_poll_all
    set_poll_one
    wipe_out_all_call_backs


WEL_SOCKET_POLLER Flat contracts

class interface
    WEL_SOCKET_POLLER

create

    make (a_window: WEL_WINDOW; a_timer_id: INTEGER)
            -- Create WEL_TIMER and socket_poller.
        require
            not_window_void: a_window /= void
        ensure
            window: parent_window = a_window
            id: timer_id = a_timer_id

    make_active (a_window: WEL_WINDOW; a_timer_id: INTEGER; a_delay: INTEGER)
            -- Enable timer and create active socket_poller.
        require
            not_window_void: a_window /= void
        ensure
            window: parent_window = a_window
            id: timer_id = a_timer_id
            poller_active: is_poller_active

feature -- Access

    message_information: WEL_MESSAGE_INFORMATION
            -- Information associated to the message
            -- (from WEL_COMMAND)

    Wm_activate: INTEGER is 6
            -- Declared in Windows as WM_ACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_activateapp: INTEGER is 28
            -- Declared in Windows as WM_ACTIVATEAPP
            -- (from WEL_WM_CONSTANTS)

    Wm_afxfirst: INTEGER is 864
            -- Declared in Windows as WM_AFXFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_afxlast: INTEGER is 895
            -- Declared in Windows as WM_AFXLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_app: INTEGER is 32768
            -- Declared in Windows as WM_APP
            -- (from WEL_WM_CONSTANTS)

    Wm_appcommand: INTEGER is 793
            -- Declared in Windows as WM_APPCOMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_askcbformatname: INTEGER is 780
            -- Declared in Windows as WM_ASKCBFORMATNAME
            -- (from WEL_WM_CONSTANTS)

    Wm_canceljournal: INTEGER is 75
            -- Declared in Windows as WM_CANCELJOURNAL
            -- (from WEL_WM_CONSTANTS)

    Wm_cancelmode: INTEGER is 31
            -- Declared in Windows as WM_CANCELMODE
            -- (from WEL_WM_CONSTANTS)

    Wm_capturechanged: INTEGER is 533
            -- Declared in Windows as WM_CAPTURECHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_changecbchain: INTEGER is 781
            -- Declared in Windows as WM_CHANGECBCHAIN
            -- (from WEL_WM_CONSTANTS)

    Wm_changeuistate: INTEGER is 295
            -- Declared in Windows as WM_CHANGEUISTATE
            -- (from WEL_WM_CONSTANTS)

    Wm_char: INTEGER is 258
            -- Declared in Windows as WM_CHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_chartoitem: INTEGER is 47
            -- Declared in Windows as WM_CHARTOITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_childactivate: INTEGER is 34
            -- Declared in Windows as WM_CHILDACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_clear: INTEGER is 771
            -- Declared in Windows as WM_CLEAR
            -- (from WEL_WM_CONSTANTS)

    Wm_close: INTEGER is 16
            -- Declared in Windows as WM_CLOSE
            -- (from WEL_WM_CONSTANTS)

    Wm_command: INTEGER is 273
            -- Declared in Windows as WM_COMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_commnotify: INTEGER is 68
            -- Declared in Windows as WM_COMMNOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_compacting: INTEGER is 65
            -- Declared in Windows as WM_COMPACTING
            -- (from WEL_WM_CONSTANTS)

    Wm_compareitem: INTEGER is 57
            -- Declared in Windows as WM_COMPAREITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_contextmenu: INTEGER is 123
            -- Declared in Windows as WM_CONTEXTMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_copy: INTEGER is 769
            -- Declared in Windows as WM_COPY
            -- (from WEL_WM_CONSTANTS)

    Wm_copydata: INTEGER is 74
            -- Declared in Windows as WM_COPYDATA
            -- (from WEL_WM_CONSTANTS)

    Wm_create: INTEGER is 1
            -- Declared in Windows as WM_CREATE
            -- (from WEL_WM_CONSTANTS)

    Wm_cut: INTEGER is 768
            -- Declared in Windows as WM_CUT
            -- (from WEL_WM_CONSTANTS)

    Wm_deadchar: INTEGER is 259
            -- Declared in Windows as WM_DEADCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_deleteitem: INTEGER is 45
            -- Declared in Windows as WM_DELETEITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_destroy: INTEGER is 2
            -- Declared in Windows as WM_DESTROY
            -- (from WEL_WM_CONSTANTS)

    Wm_destroyclipboard: INTEGER is 775
            -- Declared in Windows as WM_DESTROYCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_devicechange: INTEGER is 537
            -- Declared in Windows as WM_DEVICECHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_devmodechange: INTEGER is 27
            -- Declared in Windows as WM_DEVMODECHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_displaychange: INTEGER is 126
            -- Declared in Windows as WM_DISPLAYCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_drawclipboard: INTEGER is 776
            -- Declared in Windows as WM_DRAWCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_drawitem: INTEGER is 43
            -- Declared in Windows as WM_DRAWITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_dropfiles: INTEGER is 563
            -- Declared in Windows as WM_DROPFILES
            -- (from WEL_WM_CONSTANTS)

    Wm_enable: INTEGER is 10
            -- Declared in Windows as WM_ENABLE
            -- (from WEL_WM_CONSTANTS)

    Wm_endsession: INTEGER is 22
            -- Declared in Windows as WM_ENDSESSION
            -- (from WEL_WM_CONSTANTS)

    Wm_enteridle: INTEGER is 289
            -- Declared in Windows as WM_ENTERIDLE
            -- (from WEL_WM_CONSTANTS)

    Wm_entermenuloop: INTEGER is 529
            -- Declared in Windows as WM_ENTERMENULOOP
            -- (from WEL_WM_CONSTANTS)

    Wm_entersizemove: INTEGER is 561
            -- Declared in Windows as WM_ENTERSIZEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_erasebkgnd: INTEGER is 20
            -- Declared in Windows as WM_ERASEBKGND
            -- (from WEL_WM_CONSTANTS)

    Wm_exitmenuloop: INTEGER is 530
            -- Declared in Windows as WM_EXITMENULOOP
            -- (from WEL_WM_CONSTANTS)

    Wm_exitsizemove: INTEGER is 562
            -- Declared in Windows as WM_EXITSIZEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_fontchange: INTEGER is 29
            -- Declared in Windows as WM_FONTCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_getdlgcode: INTEGER is 135
            -- Declared in Windows as WM_GETDLGCODE
            -- (from WEL_WM_CONSTANTS)

    Wm_getfont: INTEGER is 49
            -- Declared in Windows as WM_GETFONT
            -- (from WEL_WM_CONSTANTS)

    Wm_gethotkey: INTEGER is 51
            -- Declared in Windows as WM_GETHOTKEY
            -- (from WEL_WM_CONSTANTS)

    Wm_geticon: INTEGER is 127
            -- Declared in Windows as WM_GETICON
            -- (from WEL_WM_CONSTANTS)

    Wm_getminmaxinfo: INTEGER is 36
            -- Declared in Windows as WM_GETMINMAXINFO
            -- (from WEL_WM_CONSTANTS)

    Wm_getobject: INTEGER is 61
            -- Declared in Windows as WM_GETOBJECT
            -- (from WEL_WM_CONSTANTS)

    Wm_gettext: INTEGER is 13
            -- Declared in Windows as WM_GETTEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_gettextlength: INTEGER is 14
            -- Declared in Windows as WM_GETTEXTLENGTH
            -- (from WEL_WM_CONSTANTS)

    Wm_handheldfirst: INTEGER is 856
            -- Declared in Windows as WM_HANDHELDFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_handheldlast: INTEGER is 863
            -- Declared in Windows as WM_HANDHELDLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_help: INTEGER is 83
            -- Declared in Windows as WM_HELP
            -- (from WEL_WM_CONSTANTS)

    Wm_hotkey: INTEGER is 786
            -- Declared in Windows as WM_HOTKEY
            -- (from WEL_WM_CONSTANTS)

    Wm_hscroll: INTEGER is 276
            -- Declared in Windows as WM_HSCROLL
            -- (from WEL_WM_CONSTANTS)

    Wm_hscrollclipboard: INTEGER is 782
            -- Declared in Windows as WM_HSCROLLCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_iconerasebkgnd: INTEGER is 39
            -- Declared in Windows as WM_ICONERASEBKGND
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_char: INTEGER is 646
            -- Declared in Windows as WM_IME_CHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_composition: INTEGER is 271
            -- Declared in Windows as WM_IME_COMPOSITION
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_compositionfull: INTEGER is 644
            -- Declared in Windows as WM_IME_COMPOSITIONFULL
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_control: INTEGER is 643
            -- Declared in Windows as WM_IME_CONTROL
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_endcomposition: INTEGER is 270
            -- Declared in Windows as WM_IME_ENDCOMPOSITION
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_keydown: INTEGER is 656
            -- Declared in Windows as WM_IME_KEYDOWN
            -- (from WEL_WM_CONSTANTS)

    wm_ime_keylast: INTEGER
            -- Declared in Windows as WM_IME_KEYLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_keyup: INTEGER is 657
            -- Declared in Windows as WM_IME_KEYUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_notify: INTEGER is 642
            -- Declared in Windows as WM_IME_NOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_request: INTEGER is 648
            -- Declared in Windows as WM_IME_REQUEST
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_select: INTEGER is 645
            -- Declared in Windows as WM_IME_SELECT
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_setcontext: INTEGER is 641
            -- Declared in Windows as WM_IME_SETCONTEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_startcomposition: INTEGER is 269
            -- Declared in Windows as WM_IME_STARTCOMPOSITION
            -- (from WEL_WM_CONSTANTS)

    Wm_initdialog: INTEGER is 272
            -- Declared in Windows as WM_INITDIALOG
            -- (from WEL_WM_CONSTANTS)

    Wm_initmenu: INTEGER is 278
            -- Declared in Windows as WM_INITMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_initmenupopup: INTEGER is 279
            -- Declared in Windows as WM_INITMENUPOPUP
            -- (from WEL_WM_CONSTANTS)

    Wm_inputlangchange: INTEGER is 81
            -- Declared in Windows as WM_INPUTLANGCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_inputlangchangerequest: INTEGER is 80
            -- Declared in Windows as WM_INPUTLANGCHANGEREQUEST
            -- (from WEL_WM_CONSTANTS)

    Wm_keydown: INTEGER is 256
            -- Declared in Windows as WM_KEYDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_keyfirst: INTEGER is 256
            -- Declared in Windows as WM_KEYFIRST
            -- (from WEL_WM_CONSTANTS)

    wm_keylast: INTEGER
            -- Declared in Windows as WM_KEYLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_keyup: INTEGER is 257
            -- Declared in Windows as WM_KEYUP
            -- (from WEL_WM_CONSTANTS)

    Wm_killfocus: INTEGER is 8
            -- Declared in Windows as WM_KILLFOCUS
            -- (from WEL_WM_CONSTANTS)

    Wm_lbuttondblclk: INTEGER is 515
            -- Declared in Windows as WM_LBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_lbuttondown: INTEGER is 513
            -- Declared in Windows as WM_LBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_lbuttonup: INTEGER is 514
            -- Declared in Windows as WM_LBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_mbuttondblclk: INTEGER is 521
            -- Declared in Windows as WM_MBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_mbuttondown: INTEGER is 519
            -- Declared in Windows as WM_MBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_mbuttonup: INTEGER is 520
            -- Declared in Windows as WM_MBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_mdiactivate: INTEGER is 546
            -- Declared in Windows as WM_MDIACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdicascade: INTEGER is 551
            -- Declared in Windows as WM_MDICASCADE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdicreate: INTEGER is 544
            -- Declared in Windows as WM_MDICREATE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdidestroy: INTEGER is 545
            -- Declared in Windows as WM_MDIDESTROY
            -- (from WEL_WM_CONSTANTS)

    Wm_mdigetactive: INTEGER is 553
            -- Declared in Windows as WM_MDIGETACTIVE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdiiconarrange: INTEGER is 552
            -- Declared in Windows as WM_MDIICONARRANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdimaximize: INTEGER is 549
            -- Declared in Windows as WM_MDIMAXIMIZE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdinext: INTEGER is 548
            -- Declared in Windows as WM_MDINEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_mdirefreshmenu: INTEGER is 564
            -- Declared in Windows as WM_MDIREFRESHMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_mdirestore: INTEGER is 547
            -- Declared in Windows as WM_MDIRESTORE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdisetmenu: INTEGER is 560
            -- Declared in Windows as WM_MDISETMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_mditile: INTEGER is 550
            -- Declared in Windows as WM_MDITILE
            -- (from WEL_WM_CONSTANTS)

    Wm_measureitem: INTEGER is 44
            -- Declared in Windows as WM_MEASUREITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_menuchar: INTEGER is 288
            -- Declared in Windows as WM_MENUCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_menucommand: INTEGER is 294
            -- Declared in Windows as WM_MENUCOMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_menudrag: INTEGER is 291
            -- Declared in Windows as WM_MENUDRAG
            -- (from WEL_WM_CONSTANTS)

    Wm_menugetobject: INTEGER is 292
            -- Declared in Windows as WM_MENUGETOBJECT
            -- (from WEL_WM_CONSTANTS)

    Wm_menurbuttonup: INTEGER is 290
            -- Declared in Windows as WM_MENURBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_menuselect: INTEGER is 287
            -- Declared in Windows as WM_MENUSELECT
            -- (from WEL_WM_CONSTANTS)

    Wm_mouseactivate: INTEGER is 33
            -- Declared in Windows as WM_MOUSEACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_mousefirst: INTEGER is 512
            -- Declared in Windows as WM_MOUSEFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_mousehover: INTEGER is 673
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSEHOVER
            -- (from WEL_WM_CONSTANTS)

    wm_mouselast: INTEGER
            -- Declared in Windows as WM_MOUSELAST
            -- (from WEL_WM_CONSTANTS)

    Wm_mouseleave: INTEGER is 675
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSELEAVE
            -- (from WEL_WM_CONSTANTS)

    Wm_mousemove: INTEGER is 512
            -- Declared in Windows as WM_MOUSEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_mousewheel: INTEGER is 522
            -- Declared in Windows as WM_MOUSEWHEEL
            -- (from WEL_WM_CONSTANTS)

    Wm_move: INTEGER is 3
            -- Declared in Windows as WM_MOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_moving: INTEGER is 534
            -- Declared in Windows as WM_MOVING
            -- (from WEL_WM_CONSTANTS)

    Wm_ncactivate: INTEGER is 134
            -- Declared in Windows as WM_NCACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_nccalcsize: INTEGER is 131
            -- Declared in Windows as WM_NCCALCSIZE
            -- (from WEL_WM_CONSTANTS)

    Wm_nccreate: INTEGER is 129
            -- Declared in Windows as WM_NCCREATE
            -- (from WEL_WM_CONSTANTS)

    Wm_ncdestroy: INTEGER is 130
            -- Declared in Windows as WM_NCDESTROY
            -- (from WEL_WM_CONSTANTS)

    Wm_nchittest: INTEGER is 132
            -- Declared in Windows as WM_NCHITTEST
            -- (from WEL_WM_CONSTANTS)

    Wm_nclbuttondblclk: INTEGER is 163
            -- Declared in Windows as WM_NCLBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_nclbuttondown: INTEGER is 161
            -- Declared in Windows as WM_NCLBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_nclbuttonup: INTEGER is 162
            -- Declared in Windows as WM_NCLBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmbuttondblclk: INTEGER is 169
            -- Declared in Windows as WM_NCMBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmbuttondown: INTEGER is 167
            -- Declared in Windows as WM_NCMBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmbuttonup: INTEGER is 168
            -- Declared in Windows as WM_NCMBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmousehover: INTEGER is 672
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSEHOVER
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmouseleave: INTEGER is 674
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSELEAVE
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmousemove: INTEGER is 160
            -- Declared in Windows as WM_NCMOUSEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_ncpaint: INTEGER is 133
            -- Declared in Windows as WM_NCPAINT
            -- (from WEL_WM_CONSTANTS)

    Wm_ncrbuttondblclk: INTEGER is 166
            -- Declared in Windows as WM_NCRBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_ncrbuttondown: INTEGER is 164
            -- Declared in Windows as WM_NCRBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_ncrbuttonup: INTEGER is 165
            -- Declared in Windows as WM_NCRBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ncxbuttondblclk: INTEGER is 173
            -- Declared in Windows as WM_NCXBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_ncxbuttondown: INTEGER is 171
            -- Declared in Windows as WM_NCXBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_ncxbuttonup: INTEGER is 172
            -- Declared in Windows as WM_NCXBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_nextdlgctl: INTEGER is 40
            -- Declared in Windows as WM_NEXTDLGCTL
            -- (from WEL_WM_CONSTANTS)

    Wm_nextmenu: INTEGER is 531
            -- Declared in Windows as WM_NEXTMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_notify: INTEGER is 78
            -- Declared in Windows as WM_NOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_notifyformat: INTEGER is 85
            -- Declared in Windows as WM_NOTIFYFORMAT
            -- (from WEL_WM_CONSTANTS)

    Wm_null: INTEGER is 0
            -- Declared in Windows as WM_NULL
            -- (from WEL_WM_CONSTANTS)

    Wm_paint: INTEGER is 15
            -- Declared in Windows as WM_PAINT
            -- (from WEL_WM_CONSTANTS)

    Wm_paintclipboard: INTEGER is 777
            -- Declared in Windows as WM_PAINTCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_painticon: INTEGER is 38
            -- Declared in Windows as WM_PAINTICON
            -- (from WEL_WM_CONSTANTS)

    Wm_palettechanged: INTEGER is 785
            -- Declared in Windows as WM_PALETTECHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_paletteischanging: INTEGER is 784
            -- Declared in Windows as WM_PALETTEISCHANGING
            -- (from WEL_WM_CONSTANTS)

    Wm_parentnotify: INTEGER is 528
            -- Declared in Windows as WM_PARENTNOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_paste: INTEGER is 770
            -- Declared in Windows as WM_PASTE
            -- (from WEL_WM_CONSTANTS)

    Wm_penwinfirst: INTEGER is 896
            -- Declared in Windows as WM_PENWINFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_penwinlast: INTEGER is 911
            -- Declared in Windows as WM_PENWINLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_power: INTEGER is 72
            -- Declared in Windows as WM_POWER
            -- (from WEL_WM_CONSTANTS)

    Wm_powerbroadcast: INTEGER is 536
            -- Declared in Windows as WM_POWERBROADCAST
            -- (from WEL_WM_CONSTANTS)

    Wm_print: INTEGER is 791
            -- Declared in Windows as WM_PRINT
            -- (from WEL_WM_CONSTANTS)

    Wm_printclient: INTEGER is 792
            -- Declared in Windows as WM_PRINTCLIENT
            -- (from WEL_WM_CONSTANTS)

    Wm_querydragicon: INTEGER is 55
            -- Declared in Windows as WM_QUERYDRAGICON
            -- (from WEL_WM_CONSTANTS)

    Wm_queryendsession: INTEGER is 17
            -- Declared in Windows as WM_QUERYENDSESSION
            -- (from WEL_WM_CONSTANTS)

    Wm_querynewpalette: INTEGER is 783
            -- Declared in Windows as WM_QUERYNEWPALETTE
            -- (from WEL_WM_CONSTANTS)

    Wm_queryopen: INTEGER is 19
            -- Declared in Windows as WM_QUERYOPEN
            -- (from WEL_WM_CONSTANTS)

    Wm_queryuistate: INTEGER is 297
            -- Declared in Windows as WM_QUERYUISTATE
            -- (from WEL_WM_CONSTANTS)

    Wm_queuesync: INTEGER is 35
            -- Declared in Windows as WM_QUEUESYNC
            -- (from WEL_WM_CONSTANTS)

    Wm_quit: INTEGER is 18
            -- Declared in Windows as WM_QUIT
            -- (from WEL_WM_CONSTANTS)

    Wm_rbuttondblclk: INTEGER is 518
            -- Declared in Windows as WM_RBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_rbuttondown: INTEGER is 516
            -- Declared in Windows as WM_RBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_rbuttonup: INTEGER is 517
            -- Declared in Windows as WM_RBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_renderallformats: INTEGER is 774
            -- Declared in Windows as WM_RENDERALLFORMATS
            -- (from WEL_WM_CONSTANTS)

    Wm_renderformat: INTEGER is 773
            -- Declared in Windows as WM_RENDERFORMAT
            -- (from WEL_WM_CONSTANTS)

    Wm_setcursor: INTEGER is 32
            -- Declared in Windows as WM_SETCURSOR
            -- (from WEL_WM_CONSTANTS)

    Wm_setfocus: INTEGER is 7
            -- Declared in Windows as WM_SETFOCUS
            -- (from WEL_WM_CONSTANTS)

    Wm_setfont: INTEGER is 48
            -- Declared in Windows as WM_SETFONT
            -- (from WEL_WM_CONSTANTS)

    Wm_sethotkey: INTEGER is 50
            -- Declared in Windows as WM_SETHOTKEY
            -- (from WEL_WM_CONSTANTS)

    Wm_seticon: INTEGER is 128
            -- Declared in Windows as WM_SETICON
            -- (from WEL_WM_CONSTANTS)

    Wm_setredraw: INTEGER is 11
            -- Declared in Windows as WM_SETREDRAW
            -- (from WEL_WM_CONSTANTS)

    Wm_settext: INTEGER is 12
            -- Declared in Windows as WM_SETTEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_settingchange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WM_CONSTANTS as synonym of wm_wininichange.
            -- (from WEL_WM_CONSTANTS)

    Wm_showwindow: INTEGER is 24
            -- Declared in Windows as WM_SHOWWINDOW
            -- (from WEL_WM_CONSTANTS)

    Wm_size: INTEGER is 5
            -- Declared in Windows as WM_SIZE
            -- (from WEL_WM_CONSTANTS)

    Wm_sizeclipboard: INTEGER is 779
            -- Declared in Windows as WM_SIZECLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_sizing: INTEGER is 532
            -- Declared in Windows as WM_SIZING
            -- (from WEL_WM_CONSTANTS)

    Wm_spoolerstatus: INTEGER is 42
            -- Declared in Windows as WM_SPOOLERSTATUS
            -- (from WEL_WM_CONSTANTS)

    Wm_stylechanged: INTEGER is 125
            -- Declared in Windows as WM_STYLECHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_stylechanging: INTEGER is 124
            -- Declared in Windows as WM_STYLECHANGING
            -- (from WEL_WM_CONSTANTS)

    Wm_syncpaint: INTEGER is 136
            -- Declared in Windows as WM_SYNCPAINT
            -- (from WEL_WM_CONSTANTS)

    Wm_syschar: INTEGER is 262
            -- Declared in Windows as WM_SYSCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_syscolorchange: INTEGER is 21
            -- Declared in Windows as WM_SYSCOLORCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_syscommand: INTEGER is 274
            -- Declared in Windows as WM_SYSCOMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_sysdeadchar: INTEGER is 263
            -- Declared in Windows as WM_SYSDEADCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_syskeydown: INTEGER is 260
            -- Declared in Windows as WM_SYSKEYDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_syskeyup: INTEGER is 261
            -- Declared in Windows as WM_SYSKEYUP
            -- (from WEL_WM_CONSTANTS)

    Wm_tcard: INTEGER is 82
            -- Declared in Windows as WM_TCARD
            -- (from WEL_WM_CONSTANTS)

    Wm_timechange: INTEGER is 30
            -- Declared in Windows as WM_TIMECHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_timer: INTEGER is 275
            -- Declared in Windows as WM_TIMER
            -- (from WEL_WM_CONSTANTS)

    Wm_undo: INTEGER is 772
            -- Declared in Windows as WM_UNDO
            -- (from WEL_WM_CONSTANTS)

    Wm_uninitmenupopup: INTEGER is 293
            -- Declared in Windows as WM_UNINITMENUPOPUP
            -- (from WEL_WM_CONSTANTS)

    Wm_updateuistate: INTEGER is 296
            -- Declared in Windows as WM_UPDATEUISTATE
            -- (from WEL_WM_CONSTANTS)

    Wm_user: INTEGER is 1024
            -- Declared in Windows as WM_USER
            -- (from WEL_WM_CONSTANTS)

    Wm_userchanged: INTEGER is 84
            -- Declared in Windows as WM_USERCHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_vkeytoitem: INTEGER is 46
            -- Declared in Windows as WM_VKEYTOITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_vscroll: INTEGER is 277
            -- Declared in Windows as WM_VSCROLL
            -- (from WEL_WM_CONSTANTS)

    Wm_vscrollclipboard: INTEGER is 778
            -- Declared in Windows as WM_VSCROLLCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_windowposchanged: INTEGER is 71
            -- Declared in Windows as WM_WINDOWPOSCHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_windowposchanging: INTEGER is 70
            -- Declared in Windows as WM_WINDOWPOSCHANGING
            -- (from WEL_WM_CONSTANTS)

    Wm_wininichange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WM_CONSTANTS as synonym of wm_settingchange.
            -- (from WEL_WM_CONSTANTS)

    Wm_xbuttondblclk: INTEGER is 525
            -- Declared in Windows as WM_XBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_xbuttondown: INTEGER is 523
            -- Declared in Windows as WM_XBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_xbuttonup: INTEGER is 524
            -- Declared in Windows as WM_XBUTTONUP
            -- (from WEL_WM_CONSTANTS)

feature -- Element change

    set_message_information (mi: WEL_MESSAGE_INFORMATION)
            -- Set message_information with mi.
            -- (from WEL_COMMAND)
        ensure -- from WEL_COMMAND
            message_information_set: message_information = mi

feature -- Activation

    is_auto_discard: BOOLEAN
            -- Subscription is removed at call-back.
            -- (from SOCKET_POLLER)

    is_poll_all: BOOLEAN
            -- Are all subscribed socket polled at each timer call-
            -- back or just one?
            -- (from SOCKET_POLLER)

    is_poller_active: BOOLEAN
            -- Is the poller active?

    set_active (a_delay: INTEGER)
            -- Set a_poll_delay to delay_time.
        require -- from SOCKET_POLLER
            a_poll_delay_positive_and_not_null: a_poll_delay > 0
            poller_inactive: not is_poller_active

    set_auto_discard
            -- Poller will call back only once.
            -- (from SOCKET_POLLER)

    set_inactive
            -- Stop polling the socket.
        require -- from SOCKET_POLLER
            poller_active: is_poller_active

    set_no_discard
            -- Subsciption to polling remains after call-back.
            -- (from SOCKET_POLLER)

    set_poll_all
            -- All subscribed sockets will be polled at each poll
            -- delay.
            -- (from SOCKET_POLLER)

    set_poll_one
            -- Only one subscribed listening socket and one service
            -- socket will be polled at each poll delay (if present).
            -- (from SOCKET_POLLER)

feature -- Creation

    poller_make
            -- Create internal structure of poller.
            -- (from SOCKET_POLLER)

    poller_make_active (a_poll_delay: INTEGER)
            -- Create active poller with a_poll_delay time
            -- quantum (in milliseconds).
            -- (from SOCKET_POLLER)

feature -- Execute

    execute (arg: ANY)
            -- Poll the socket.

feature -- Initialisation

    make (a_window: WEL_WINDOW; a_timer_id: INTEGER)
            -- Create WEL_TIMER and socket_poller.
        require
            not_window_void: a_window /= void
        ensure
            window: parent_window = a_window
            id: timer_id = a_timer_id

    make_active (a_window: WEL_WINDOW; a_timer_id: INTEGER; a_delay: INTEGER)
            -- Enable timer and create active socket_poller.
        require
            not_window_void: a_window /= void
        ensure
            window: parent_window = a_window
            id: timer_id = a_timer_id
            poller_active: is_poller_active

feature -- Subscription

    add_accept_call_back (a_stream_socket: STREAM_SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
            -- Set command	a_command to be called when
            -- a_stream_socket is connected.
            -- (from SOCKET_POLLER)
        require -- from SOCKET_POLLER
            stream_socket_open_read: a_stream_socket.is_open_read
            command_not_void: a_command /= void

    add_readable_call_back (a_socket: SOCKET; a_command: POLL_COMMAND; an_argument: ANY)
            -- Set command	a_command to be called when
            -- a_socket is readable.
            -- (from SOCKET_POLLER)
        require -- from SOCKET_POLLER
            socket_open_read: a_socket.is_open_read
            command_not_void: a_command /= void

    remove_accept_call_back (a_stream_socket: STREAM_SOCKET)
            -- Remove socket a_stream_socket from call-back list.
            -- (from SOCKET_POLLER)

    remove_readable_call_back (a_socket: SOCKET)
            -- Remove socket a_socket from call-back list.
            -- (from SOCKET_POLLER)

    wipe_out_all_call_backs
            -- Remove all socket call_backs from poller.
            -- (from SOCKET_POLLER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SOCKET_POLLER


cluster net.transfer

Cluster
    net.transfer

Supercluster
    net

Subclusters
    net.transfer.addresses
    net.transfer.resources
    net.transfer.transactions


cluster net.transfer.addresses

Cluster
    net.transfer.addresses

Supercluster
    net.transfer

Subclusters
    net.transfer.addresses.comparators

Classes
    FILE_URL
    FTP_URL
    HOST_VALIDITY_CHECKER
    HTTP_URL
    NETWORK_RESOURCE_URL
    PROXY_INFORMATION
    URL


cluster net.transfer.addresses.comparators

Cluster
    net.transfer.addresses.comparators

Supercluster
    net.transfer.addresses

Classes
    CHARACTER_SET
    COMPARATOR
    COMPARATOR_BUILDER
    COMPARATOR_BUILDER_IMPL
    RANGE_COMPARATOR
    SINGLE_CHARACTER_COMPARATOR


CHARACTER_SET Chart

class
    CHARACTER_SET

General
    cluster: net.transfer.addresses.comparators
    description: "Comparator for character sets"

Ancestors
    COMPARATOR_BUILDER

Queries
    Comparator_builder: COMPARATOR_BUILDER_IMPL
    contains_character (c: CHARACTER): BOOLEAN
    contains_string (s: STRING): BOOLEAN
    has (token: STRING): BOOLEAN
    is_empty: BOOLEAN
    set: STRING

Commands
    add (s: STRING)
    define (s: STRING)
    remove (s: STRING)


CHARACTER_SET Flat contracts

indexing
    description: "Comparator for character sets"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    usage: "The features 'define', 'add' and 'remove' accept a string asargument that represents a set of single character (like 'a')or character ranges (like 'a-z'). To use a character with aspecial meaning (like '-') as single character, it can be quotedusing the character '\'"

class interface
    CHARACTER_SET

feature -- Access

    comparator_builder: COMPARATOR_BUILDER_IMPL
            -- Comparator builder singleton
            -- (from COMPARATOR_BUILDER)

    contains_character (c: CHARACTER): BOOLEAN
            -- Does character set contain character c?
        require
            not_empty: not is_empty
        ensure
            index_unchanged: comparators.index = old comparators.index

    contains_string (s: STRING): BOOLEAN
            -- Does character set contain string s?
        require
            not_empty: not is_empty
            string_exists: s /= void

    has (token: STRING): BOOLEAN
            -- Is there a comparator for token?
        require
            non_empty_token: token /= void and then not token.is_empty
        ensure
            index_unchanged: comparators.index = old comparators.index

    set: STRING
            -- Current character set
        require
            not_empty: not is_empty
        ensure
            index_unchanged: comparators.index = old comparators.index

feature -- Status report

    is_empty: BOOLEAN
            -- Is character set empty?

feature -- Status setting

    define (s: STRING)
            -- Define character set.
        require
            string_exists: s /= void
        ensure
            comparators_set_up: comparators /= void and then not comparators.is_empty

feature -- Element change

    add (s: STRING)
            -- Add s to character set.
        require
            non_empty_string: s /= void and then not s.is_empty
            no_such_comparator: not has (s)
        ensure
            elements_added: comparators.count >= old comparators.count

feature -- Removal

    remove (s: STRING)
            -- Remove s from character set.
        require
            non_empty_string: s /= void and then not s.is_empty
            has_comparator: has (s)
        ensure
            elements_removed: comparators.count <= old comparators.count

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CHARACTER_SET


COMPARATOR_BUILDER Chart

class
    COMPARATOR_BUILDER

General
    cluster: net.transfer.addresses.comparators
    description: "Singleton instance of the comparator builder"

Ancestors
    ANY

Queries
    Comparator_builder: COMPARATOR_BUILDER_IMPL


COMPARATOR_BUILDER Flat contracts

indexing
    description: "Singleton instance of the comparator builder"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    COMPARATOR_BUILDER

feature -- Access

    comparator_builder: COMPARATOR_BUILDER_IMPL
            -- Comparator builder singleton

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class COMPARATOR_BUILDER


COMPARATOR_BUILDER_IMPL Chart

class
    COMPARATOR_BUILDER_IMPL

General
    cluster: net.transfer.addresses.comparators
    description: "Implementation of comparator builder"
    create: make

Ancestors
    ASCII

Queries
    comparators: LINKED_SET [COMPARATOR]
    comparators_available: BOOLEAN
    is_set_defined: BOOLEAN

Commands
    add (s: STRING)
    build
    define_set (s: STRING)
    remove (s: STRING)

Constraints
    character array set up
    comparators set up
    token valid


COMPARATOR_BUILDER_IMPL Flat contracts

indexing
    description: "Implementation of comparator builder"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    COMPARATOR_BUILDER_IMPL

create

    make
            -- Create builder.

feature -- Access

    comparators: LINKED_SET [COMPARATOR]
            -- Set of comparators currently built

feature -- Status report

    comparators_available: BOOLEAN
            -- Is there a set of comparators available?

    is_set_defined: BOOLEAN
            -- Has a character set been defined?

feature -- Status setting

    add (s: STRING)
            -- Add to character set.
        require
            non_empty_string: s /= void and then not s.is_empty

    define_set (s: STRING)
            -- Define character set.
        require
            non_empty_string: s /= void and then not s.is_empty

    remove (s: STRING)
            -- Remove from character set.
        require
            non_empty_string: s /= void and then not s.is_empty

feature -- Basic operations

    build
            -- Build comparators.
        require
            set_defined: is_set_defined

invariant

    character_array_set_up: character_array /= void
    comparators_set_up: comparators /= void
    token_valid: (last_token /= void and then not last_token.is_empty) implies token_type /= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class COMPARATOR_BUILDER_IMPL


COMPARATOR Chart

deferred class
    COMPARATOR

General
    cluster: net.transfer.addresses.comparators
    description: "Comparators for characters"

Ancestors
    ANY

Queries
    character_set: STRING
    contains (c: CHARACTER): BOOLEAN

Constraints
    no empty comparator


COMPARATOR Flat contracts

indexing
    description: "Comparators for characters"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    COMPARATOR

feature -- Access

    character_set: STRING
            -- Character set represented by comparator

    contains (c: CHARACTER): BOOLEAN
            -- Does comparator contain c?

invariant

    no_empty_comparator: character_set /= void and then not character_set.is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class COMPARATOR


RANGE_COMPARATOR Chart

class
    RANGE_COMPARATOR

General
    cluster: net.transfer.addresses.comparators
    description: "Comparators for character ranges"
    create: make

Ancestors
    COMPARATOR

Queries
    character_set: STRING
    contains (c: CHARACTER): BOOLEAN


RANGE_COMPARATOR Flat contracts

indexing
    description: "Comparators for character ranges"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    RANGE_COMPARATOR

create

    make (lo, up: CHARACTER)
            -- Create comparator.
        ensure
            lower_set: lower = lo
            upper_set: upper = up

feature -- Access

    character_set: STRING
            -- Character set represented by comparator

    contains (c: CHARACTER): BOOLEAN
            -- Does comparator contain c?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARATOR
    no_empty_comparator: character_set /= void and then not character_set.is_empty

end -- class RANGE_COMPARATOR


SINGLE_CHARACTER_COMPARATOR Chart

class
    SINGLE_CHARACTER_COMPARATOR

General
    cluster: net.transfer.addresses.comparators
    description: "Comparators for single characters"
    create: make

Ancestors
    COMPARATOR

Queries
    character_set: STRING
    contains (c: CHARACTER): BOOLEAN


SINGLE_CHARACTER_COMPARATOR Flat contracts

indexing
    description: "Comparators for single characters"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    SINGLE_CHARACTER_COMPARATOR

create

    make (c: CHARACTER)
            -- Create comparator.
        ensure
            character_set: character = c

feature -- Access

    character_set: STRING
            -- Character represented by comparator

    contains (c: CHARACTER): BOOLEAN
            -- Does comparator contain c?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARATOR
    no_empty_comparator: character_set /= void and then not character_set.is_empty

end -- class SINGLE_CHARACTER_COMPARATOR


FILE_URL Chart

class
    FILE_URL

General
    cluster: net.transfer.addresses
    description: "File URL"
    create: make

Ancestors
    URL

Queries
    Default_port: INTEGER
    Has_username: BOOLEAN
    Hash_code: INTEGER
    is_correct: BOOLEAN
    Is_hashable: BOOLEAN
    Is_password_accepted: BOOLEAN
    Is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    location: STRING
    name: FILE_NAME
    port: INTEGER
    proxy_host: STRING
    proxy_host_ok (host: STRING): BOOLEAN
    proxy_port: INTEGER
    Service: STRING

Commands
    reset_proxy
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_username (un: STRING)


FILE_URL Flat contracts

indexing
    description: "File URL"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    FILE_URL

create

    make (a: STRING)
            -- Create URL with address a.
            -- (from URL)
        require -- from URL
            address_specified: a /= void and then not a.is_empty
        ensure -- from URL
            address_set: address = a
            default_port_set: port = default_port
            no_proxy_set: proxy_information = void

feature -- Access

    Hash_code: INTEGER is 0
            -- Hash function
            -- (Objects of the current type cannot be hashed, therefore the
            -- hash function is a constant.)

    location: STRING
            -- Full URL of resource

    name: FILE_NAME

    port: INTEGER
            -- Port used by service
            -- (from URL)

    proxy_host: STRING
            -- Name or address of proxy host
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_not_empty: Result /= void and then not Result.is_empty

    proxy_port: INTEGER
            -- Port of proxy
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_non_negative: Result >= 0

    Service: STRING is "file"
            -- Name of service

feature -- Status report

    Default_port: INTEGER is 0
            -- Default port number for service (Answer: 0)
            -- (The 'file' service does not use a port.)

    Has_username: BOOLEAN is False
            -- Can address contain a username? (Answer: no)

    is_correct: BOOLEAN
            -- Is URL correct?

    Is_hashable: BOOLEAN is False
            -- Are objects of this type hashable? (Answer: no)

    Is_password_accepted: BOOLEAN is False
            -- Can a password be set? (Answer: no)

    Is_proxy_supported: BOOLEAN is False
            -- Are proxy connections supported? (Answer: no)

    is_proxy_used: BOOLEAN
            -- Is a proxy used?
            -- (from URL)

    proxy_host_ok (host: STRING): BOOLEAN
            -- Is host name of proxy correct?
        require -- from URL
            proxy_supported: is_proxy_supported

feature -- Status setting

    reset_proxy
            -- Reset proxy information.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            no_proxy_set: not is_proxy_used
            port_reset: proxy_port = 0

    set_password (pw: STRING)
            -- Set password.
        require -- from URL
            password_accepted: is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty

    set_port (port_no: INTEGER)
            -- Set port to port_no.
            -- (from URL)
        require -- from URL
            port_non_negative: port_no >= 0
        ensure -- from URL
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and proxy port to port_no.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            non_empty_host: host /= void and then not host.is_empty
            host_valid: proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from URL
            host_set: proxy_host = host
            port_set: proxy_port = port_no

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            proxy_information_set: proxy_information = pi

    set_username (un: STRING)
            -- Set username.
        require -- from URL
            username_ok: has_username
            non_empty_username: un /= void and then not un.is_empty

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from URL
    proxy_used_definition: is_proxy_used = (proxy_information /= void)
    proxy_usage_constraint: is_proxy_used implies is_proxy_supported

end -- class FILE_URL


FTP_URL Chart

class
    FTP_URL

General
    cluster: net.transfer.addresses
    description: "URLs for FTP resources"
    create: make

Ancestors
    NETWORK_RESOURCE_URL

Queries
    Default_port: INTEGER
    Has_username: BOOLEAN
    hash_code: INTEGER
    host: STRING
    is_correct: BOOLEAN
    is_equal (other: [like Current] FTP_URL): BOOLEAN
    is_hashable: BOOLEAN
    is_host_correct (h: STRING): BOOLEAN
    is_password_accepted: BOOLEAN
    is_path_correct (p: STRING): BOOLEAN
    Is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    location: STRING
    password: STRING
    path: STRING
    port: INTEGER
    proxy_host: STRING
    proxy_host_ok (h: STRING): BOOLEAN
    proxy_port: INTEGER
    Service: STRING
    username: STRING

Commands
    reset_proxy
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_username (un: STRING)


FTP_URL Flat contracts

indexing
    description: "URLs for FTP resources"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    FTP_URL

create

    make (a: STRING)
            -- Create address.
        require -- from URL
            address_specified: a /= void and then not a.is_empty
        ensure -- from URL
            address_set: address = a
            default_port_set: port = default_port
            no_proxy_set: proxy_information = void

feature -- Access

    hash_code: INTEGER
            -- Hash function
            -- (from NETWORK_RESOURCE_URL)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    host: STRING
            -- Name or IP address of host
            -- (from NETWORK_RESOURCE_URL)

    location: STRING
            -- Full URL of resource
            -- (from NETWORK_RESOURCE_URL)

    password: STRING
            -- Optional password
            -- (from NETWORK_RESOURCE_URL)

    path: STRING
            -- Path of resource
            -- (from NETWORK_RESOURCE_URL)

    port: INTEGER
            -- Port used by service
            -- (from URL)

    proxy_host: STRING
            -- Name or address of proxy host
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_not_empty: Result /= void and then not Result.is_empty

    proxy_port: INTEGER
            -- Port of proxy
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_non_negative: Result >= 0

    Service: STRING is "ftp"
            -- Name of service (Answer: "ftp")

    username: STRING
            -- Optional username
            -- (from NETWORK_RESOURCE_URL)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is equal to other?
            -- (from NETWORK_RESOURCE_URL)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    Default_port: INTEGER is 21
            -- Number of default port for service (Answer: 21)

    Has_username: BOOLEAN is True
            -- Can address contain a username? (Answer: yes)

    proxy_host_ok (h: STRING): BOOLEAN
            -- Is h a valid host?
            -- (from HOST_VALIDITY_CHECKER)
        require -- from URL
            proxy_supported: is_proxy_supported

    is_correct: BOOLEAN
            -- Is address correct?
            -- (from NETWORK_RESOURCE_URL)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_host_correct (h: STRING): BOOLEAN
            -- Is host h name correct?
            -- (from NETWORK_RESOURCE_URL)

    is_password_accepted: BOOLEAN
            -- Can a password be set?
            -- (from NETWORK_RESOURCE_URL)

    is_path_correct (p: STRING): BOOLEAN
            -- Is path name correct?

    Is_proxy_supported: BOOLEAN is True
            -- Are proxy connections supported? (Answer: yes)

    is_proxy_used: BOOLEAN
            -- Is a proxy used?
            -- (from URL)

feature -- Status setting

    reset_proxy
            -- Reset proxy information.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            no_proxy_set: not is_proxy_used
            port_reset: proxy_port = 0

    set_password (pw: STRING)
            -- Set password.
            -- (from NETWORK_RESOURCE_URL)
        require -- from URL
            password_accepted: is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty
        ensure then -- from NETWORK_RESOURCE_URL
            password_set: password = pw

    set_port (port_no: INTEGER)
            -- Set port to port_no.
            -- (from URL)
        require -- from URL
            port_non_negative: port_no >= 0
        ensure -- from URL
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and proxy port to port_no.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            non_empty_host: host /= void and then not host.is_empty
            host_valid: proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from URL
            host_set: proxy_host = host
            port_set: proxy_port = port_no

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            proxy_information_set: proxy_information = pi

    set_username (un: STRING)
            -- Set username.
            -- (from NETWORK_RESOURCE_URL)
        require -- from URL
            username_ok: has_username
            non_empty_username: un /= void and then not un.is_empty
        ensure then -- from NETWORK_RESOURCE_URL
            username_set: username = un

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from NETWORK_RESOURCE_URL
    path_charset_defined: path_charset /= void and then not path_charset.is_empty
    username_exists: username /= void
    password_exists: password /= void
    password_constraint: not password.is_empty implies not username.is_empty
        -- from URL
    proxy_used_definition: is_proxy_used = (proxy_information /= void)
    proxy_usage_constraint: is_proxy_used implies is_proxy_supported

end -- class FTP_URL


HOST_VALIDITY_CHECKER Chart

class
    HOST_VALIDITY_CHECKER

General
    cluster: net.transfer.addresses
    description: "Facility to check the validity of hosts"

Ancestors
    ANY

Queries
    host_ok (h: STRING): BOOLEAN


HOST_VALIDITY_CHECKER Flat contracts

indexing
    description: "Facility to check the validity of hosts"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.1 $"

class interface
    HOST_VALIDITY_CHECKER

feature -- Status report

    host_ok (h: STRING): BOOLEAN
            -- Is h a valid host?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HOST_VALIDITY_CHECKER


HTTP_URL Chart

class
    HTTP_URL

General
    cluster: net.transfer.addresses
    description: "URLs for HTTP resources"
    create: make

Ancestors
    NETWORK_RESOURCE_URL

Queries
    Default_port: INTEGER
    Has_username: BOOLEAN
    hash_code: INTEGER
    host: STRING
    is_correct: BOOLEAN
    is_equal (other: [like Current] HTTP_URL): BOOLEAN
    is_hashable: BOOLEAN
    is_host_correct (h: STRING): BOOLEAN
    is_password_accepted: BOOLEAN
    is_path_correct (p: STRING): BOOLEAN
    Is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    location: STRING
    password: STRING
    path: STRING
    port: INTEGER
    proxy_host: STRING
    proxy_host_ok (h: STRING): BOOLEAN
    proxy_port: INTEGER
    Service: STRING
    username: STRING

Commands
    reset_proxy
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_username (un: STRING)


HTTP_URL Flat contracts

indexing
    description: "URLs for HTTP resources"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    HTTP_URL

create

    make (a: STRING)
            -- Create address.
            -- (from NETWORK_RESOURCE_URL)
        require -- from URL
            address_specified: a /= void and then not a.is_empty
        ensure -- from URL
            address_set: address = a
            default_port_set: port = default_port
            no_proxy_set: proxy_information = void

feature -- Access

    hash_code: INTEGER
            -- Hash function
            -- (from NETWORK_RESOURCE_URL)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    host: STRING
            -- Name or IP address of host
            -- (from NETWORK_RESOURCE_URL)

    location: STRING
            -- Full URL of resource
            -- (from NETWORK_RESOURCE_URL)

    password: STRING
            -- Optional password
            -- (from NETWORK_RESOURCE_URL)

    path: STRING
            -- Path of resource
            -- (from NETWORK_RESOURCE_URL)

    port: INTEGER
            -- Port used by service
            -- (from URL)

    proxy_host: STRING
            -- Name or address of proxy host
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_not_empty: Result /= void and then not Result.is_empty

    proxy_port: INTEGER
            -- Port of proxy
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_non_negative: Result >= 0

    Service: STRING is "http"
            -- Name of service (Answer: "http")

    username: STRING
            -- Optional username
            -- (from NETWORK_RESOURCE_URL)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is equal to other?
            -- (from NETWORK_RESOURCE_URL)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    Default_port: INTEGER is 80
            -- Number of default port for service (Answer: 80)

    Has_username: BOOLEAN is False
            -- Can address contain a username? (Answer: no)

    proxy_host_ok (h: STRING): BOOLEAN
            -- Is h a valid host?
            -- (from HOST_VALIDITY_CHECKER)
        require -- from URL
            proxy_supported: is_proxy_supported

    is_correct: BOOLEAN
            -- Is address correct?
            -- (from NETWORK_RESOURCE_URL)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_host_correct (h: STRING): BOOLEAN
            -- Is host h name correct?
            -- (from NETWORK_RESOURCE_URL)

    is_password_accepted: BOOLEAN
            -- Can a password be set?
            -- (from NETWORK_RESOURCE_URL)

    is_path_correct (p: STRING): BOOLEAN
            -- Is path name correct?
            -- (from NETWORK_RESOURCE_URL)

    Is_proxy_supported: BOOLEAN is True
            -- Are proxy connections supported? (Answer: yes)

    is_proxy_used: BOOLEAN
            -- Is a proxy used?
            -- (from URL)

feature -- Status setting

    reset_proxy
            -- Reset proxy information.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            no_proxy_set: not is_proxy_used
            port_reset: proxy_port = 0

    set_password (pw: STRING)
            -- Set password.
            -- (from NETWORK_RESOURCE_URL)
        require -- from URL
            password_accepted: is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty
        ensure then -- from NETWORK_RESOURCE_URL
            password_set: password = pw

    set_port (port_no: INTEGER)
            -- Set port to port_no.
            -- (from URL)
        require -- from URL
            port_non_negative: port_no >= 0
        ensure -- from URL
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and proxy port to port_no.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            non_empty_host: host /= void and then not host.is_empty
            host_valid: proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from URL
            host_set: proxy_host = host
            port_set: proxy_port = port_no

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            proxy_information_set: proxy_information = pi

    set_username (un: STRING)
            -- Set username.
            -- (from NETWORK_RESOURCE_URL)
        require -- from URL
            username_ok: has_username
            non_empty_username: un /= void and then not un.is_empty
        ensure then -- from NETWORK_RESOURCE_URL
            username_set: username = un

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from NETWORK_RESOURCE_URL
    path_charset_defined: path_charset /= void and then not path_charset.is_empty
    username_exists: username /= void
    password_exists: password /= void
    password_constraint: not password.is_empty implies not username.is_empty
        -- from URL
    proxy_used_definition: is_proxy_used = (proxy_information /= void)
    proxy_usage_constraint: is_proxy_used implies is_proxy_supported

end -- class HTTP_URL


NETWORK_RESOURCE_URL Chart

deferred class
    NETWORK_RESOURCE_URL

General
    cluster: net.transfer.addresses
    description: "URLs for network resources"

Ancestors
    HOST_VALIDITY_CHECKER
    URL

Queries
    default_port: INTEGER
    has_username: BOOLEAN
    hash_code: INTEGER
    host: STRING
    is_correct: BOOLEAN
    is_equal (other: [like Current] NETWORK_RESOURCE_URL): BOOLEAN
    is_hashable: BOOLEAN
    is_host_correct (h: STRING): BOOLEAN
    is_password_accepted: BOOLEAN
    is_path_correct (p: STRING): BOOLEAN
    is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    location: STRING
    password: STRING
    path: STRING
    port: INTEGER
    proxy_host: STRING
    proxy_host_ok (h: STRING): BOOLEAN
    proxy_port: INTEGER
    service: STRING
    username: STRING

Commands
    reset_proxy
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_username (un: STRING)

Constraints
    path charset defined
    username exists
    password exists
    password constraint


NETWORK_RESOURCE_URL Flat contracts

indexing
    description: "URLs for network resources"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    NETWORK_RESOURCE_URL

feature -- Access

    default_port: INTEGER
            -- Default port number for service
            -- (from URL)

    hash_code: INTEGER
            -- Hash function
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    host: STRING
            -- Name or IP address of host

    location: STRING
            -- Full URL of resource

    password: STRING
            -- Optional password

    path: STRING
            -- Path of resource

    port: INTEGER
            -- Port used by service
            -- (from URL)

    proxy_host: STRING
            -- Name or address of proxy host
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_not_empty: Result /= void and then not Result.is_empty

    proxy_port: INTEGER
            -- Port of proxy
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure -- from URL
            result_non_negative: Result >= 0

    service: STRING
            -- Name of service
            -- (from URL)

    username: STRING
            -- Optional username

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    has_username: BOOLEAN
            -- Can address contain a username?
            -- (from URL)

    proxy_host_ok (h: STRING): BOOLEAN
            -- Is h a valid host?
            -- (from HOST_VALIDITY_CHECKER)
        require -- from URL
            proxy_supported: is_proxy_supported

    is_correct: BOOLEAN
            -- Is address correct?

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_host_correct (h: STRING): BOOLEAN
            -- Is host h name correct?

    is_password_accepted: BOOLEAN
            -- Can a password be set?

    is_path_correct (p: STRING): BOOLEAN
            -- Is path name correct?

    is_proxy_supported: BOOLEAN
            -- Are proxy connections supported?
            -- (from URL)

    is_proxy_used: BOOLEAN
            -- Is a proxy used?
            -- (from URL)

feature -- Status setting

    reset_proxy
            -- Reset proxy information.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            no_proxy_set: not is_proxy_used
            port_reset: proxy_port = 0

    set_password (pw: STRING)
            -- Set password.
        require -- from URL
            password_accepted: is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty
        ensure then
            password_set: password = pw

    set_port (port_no: INTEGER)
            -- Set port to port_no.
            -- (from URL)
        require -- from URL
            port_non_negative: port_no >= 0
        ensure -- from URL
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and proxy port to port_no.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
            non_empty_host: host /= void and then not host.is_empty
            host_valid: proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from URL
            host_set: proxy_host = host
            port_set: proxy_port = port_no

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from URL)
        require -- from URL
            proxy_supported: is_proxy_supported
        ensure -- from URL
            proxy_information_set: proxy_information = pi

    set_username (un: STRING)
            -- Set username.
        require -- from URL
            username_ok: has_username
            non_empty_username: un /= void and then not un.is_empty
        ensure then
            username_set: username = un

invariant

    path_charset_defined: path_charset /= void and then not path_charset.is_empty
    username_exists: username /= void
    password_exists: password /= void
    password_constraint: not password.is_empty implies not username.is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from URL
    proxy_used_definition: is_proxy_used = (proxy_information /= void)
    proxy_usage_constraint: is_proxy_used implies is_proxy_supported

end -- class NETWORK_RESOURCE_URL


PROXY_INFORMATION Chart

class
    PROXY_INFORMATION

General
    cluster: net.transfer.addresses
    description: "Information about proxies"
    create: make

Ancestors
    HOST_VALIDITY_CHECKER

Queries
    host: STRING
    port: INTEGER
    proxy_host_ok (h: STRING): BOOLEAN

Commands
    set_host (h: STRING)
    set_port (p: INTEGER)

Constraints
    host not empty
    host valid
    port non negative


PROXY_INFORMATION Flat contracts

indexing
    description: "Information about proxies"
    status: "See notice at end of class"
    author: "Patrick Schoenbach"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.1 $"

class interface
    PROXY_INFORMATION

create

    make (h: STRING; p: INTEGER)
            -- Create proxy information for host h and port p.
        require
            host_not_empty: h /= void and then not h.is_empty
            host_valid: proxy_host_ok (h)
            port_number_non_negative: p >= 0
        ensure
            host_set: host = h
            port_set: port = p

feature -- Access

    host: STRING
            -- Name or address of proxy host

    port: INTEGER
            -- Port of proxy

feature -- Status report

    proxy_host_ok (h: STRING): BOOLEAN
            -- Is h a valid host?
            -- (from HOST_VALIDITY_CHECKER)

feature -- Status setting

    set_host (h: STRING)
            -- Set host name to h.
        require
            host_not_empty: h /= void and then not h.is_empty
            host_valid: proxy_host_ok (h)
        ensure
            host_set: host = h

    set_port (p: INTEGER)
            -- Set port to p.
        require
            port_non_negative: p >= 0
        ensure
            port_set: port = p

invariant

    host_not_empty: host /= void and then not host.is_empty
    host_valid: proxy_host_ok (host)
    port_non_negative: port >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class PROXY_INFORMATION


URL Chart

deferred class
    URL

General
    cluster: net.transfer.addresses
    description: "Unified resource locators"

Ancestors
    HASHABLE

Queries
    default_port: INTEGER
    has_username: BOOLEAN
    hash_code: INTEGER
    is_correct: BOOLEAN
    is_hashable: BOOLEAN
    is_password_accepted: BOOLEAN
    is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    location: STRING
    port: INTEGER
    proxy_host: STRING
    proxy_host_ok (host: STRING): BOOLEAN
    proxy_port: INTEGER
    service: STRING

Commands
    reset_proxy
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_username (un: STRING)

Constraints
    proxy used definition
    proxy usage constraint


URL Flat contracts

indexing
    description: "Unified resource locators"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    URL

feature -- Access

    default_port: INTEGER
            -- Default port number for service

    hash_code: INTEGER
            -- Hash code value
            -- (from HASHABLE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    location: STRING
            -- Full URL of resource

    port: INTEGER
            -- Port used by service

    proxy_host: STRING
            -- Name or address of proxy host
        require
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure
            result_not_empty: Result /= void and then not Result.is_empty

    proxy_port: INTEGER
            -- Port of proxy
        require
            proxy_supported: is_proxy_supported
            has_proxy: is_proxy_used
        ensure
            result_non_negative: Result >= 0

    service: STRING
            -- Name of service

feature -- Status report

    has_username: BOOLEAN
            -- Can address contain a username?

    is_correct: BOOLEAN
            -- Is URL correct?

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_password_accepted: BOOLEAN
            -- Can a password be set?

    is_proxy_supported: BOOLEAN
            -- Are proxy connections supported?

    is_proxy_used: BOOLEAN
            -- Is a proxy used?

    proxy_host_ok (host: STRING): BOOLEAN
            -- Is host name of proxy correct?
        require
            proxy_supported: is_proxy_supported

feature -- Status setting

    reset_proxy
            -- Reset proxy information.
        require
            proxy_supported: is_proxy_supported
        ensure
            no_proxy_set: not is_proxy_used
            port_reset: proxy_port = 0

    set_password (pw: STRING)
            -- Set password.
        require
            password_accepted: is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty

    set_port (port_no: INTEGER)
            -- Set port to port_no.
        require
            port_non_negative: port_no >= 0
        ensure
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and proxy port to port_no.
        require
            proxy_supported: is_proxy_supported
            non_empty_host: host /= void and then not host.is_empty
            host_valid: proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure
            host_set: proxy_host = host
            port_set: proxy_port = port_no

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
        require
            proxy_supported: is_proxy_supported
        ensure
            proxy_information_set: proxy_information = pi

    set_username (un: STRING)
            -- Set username.
        require
            username_ok: has_username
            non_empty_username: un /= void and then not un.is_empty

invariant

    proxy_used_definition: is_proxy_used = (proxy_information /= void)
    proxy_usage_constraint: is_proxy_used implies is_proxy_supported
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class URL


cluster net.transfer.resources

Cluster
    net.transfer.resources

Supercluster
    net.transfer

Classes
    DATA_RESOURCE
    DATA_RESOURCE_ERROR_CONSTANTS
    DATA_RESOURCE_FACTORY_IMPL
    FILE_PROTOCOL
    FTP_PROTOCOL
    HTTP_PROTOCOL
    NETWORK_RESOURCE
    TRANSFER_COMMAND_CONSTANTS


DATA_RESOURCE_ERROR_CONSTANTS Chart

class
    DATA_RESOURCE_ERROR_CONSTANTS

General
    cluster: net.transfer.resources
    description: "Constants for resource errors"

Ancestors
    ANY

Queries
    error_text (code: INTEGER): STRING


DATA_RESOURCE_ERROR_CONSTANTS Flat contracts

indexing
    description: "Constants for resource errors"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    DATA_RESOURCE_ERROR_CONSTANTS

feature -- Status report

    error_text (code: INTEGER): STRING
            -- Textual description of error
        require
            positive_code: code > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATA_RESOURCE_ERROR_CONSTANTS


DATA_RESOURCE_FACTORY_IMPL Chart

class
    DATA_RESOURCE_FACTORY_IMPL

General
    cluster: net.transfer.resources
    description: "Implementation of data resource factory"
    create: make

Ancestors
    ANY

Queries
    address: STRING
    default_service: STRING
    is_address_correct: BOOLEAN
    is_address_set: BOOLEAN
    is_service_supported: BOOLEAN
    resource: DATA_RESOURCE
    service: STRING
    url: URL

Commands
    create_resource
    set_address (addr: STRING)
    set_default_service (service_name: STRING)

Constraints
    default service specified


DATA_RESOURCE_FACTORY_IMPL Flat contracts

indexing
    description: "Implementation of data resource factory"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    DATA_RESOURCE_FACTORY_IMPL

create

    make
            -- Create factory.

feature -- Access

    address: STRING
            -- Address (without service part)

    resource: DATA_RESOURCE
            -- Created data resource

    service: STRING
            -- Requested service

    url: URL
            -- URL representation of the address

feature -- Status report

    default_service: STRING
            -- Name of service assumed if no service is specified in address

    is_address_correct: BOOLEAN
            -- Is address correct?
        require
            address_set: is_address_set

    is_address_set: BOOLEAN
            -- Has address been set?

    is_service_supported: BOOLEAN
            -- Is service supported?

feature -- Status setting

    set_address (addr: STRING)
            -- Set address.
        require
            address_exists: addr /= void
            address_not_empty: not addr.is_empty
        ensure
            address_set_if_supported: is_service_supported implies is_address_set

    set_default_service (service_name: STRING)
            -- Set default service to service_name.
        require
            name_exists: service_name /= void
            name_not_empty: not service_name.is_empty

feature -- Basic operations

    create_resource
            -- Create resource.
        require
            correct_address: is_address_correct
        ensure
            resource_created: resource /= void

invariant

    default_service_specified: default_service /= void and then not default_service.is_empty
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATA_RESOURCE_FACTORY_IMPL


DATA_RESOURCE Chart

deferred class
    DATA_RESOURCE

General
    cluster: net.transfer.resources
    description: "Data resources"

Ancestors
    DATA_RESOURCE_ERROR_CONSTANTS
    HASHABLE

Queries
    address: URL
    address_exists: BOOLEAN
    bytes_transferred: INTEGER
    count: INTEGER
    error: BOOLEAN
    error_code: INTEGER
    error_text (code: INTEGER): STRING
    has_packet: BOOLEAN
    hash_code: INTEGER
    is_count_valid: BOOLEAN
    is_equal (other: [like Current] DATA_RESOURCE): BOOLEAN
    is_hashable: BOOLEAN
    is_mode_set: BOOLEAN
    is_open: BOOLEAN
    is_packet_pending: BOOLEAN
    is_proxy_supported: BOOLEAN
    is_readable: BOOLEAN
    is_writable: BOOLEAN
    last_packet: STRING
    last_packet_size: INTEGER
    location: STRING
    mode: INTEGER
    port: INTEGER
    read_buffer_size: INTEGER
    read_mode: BOOLEAN
    service: STRING
    supports_multiple_transactions: BOOLEAN
    timeout: INTEGER
    transfer_initiated: BOOLEAN
    valid_mode (n: INTEGER): BOOLEAN
    write_mode: BOOLEAN

Commands
    close
    dispose
    initiate_transfer
    open
    put (other: DATA_RESOURCE)
    read
    reset_error
    reset_proxy
    reuse_connection (other: DATA_RESOURCE)
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_read_buffer_size (n: INTEGER)
    set_read_mode
    set_timeout (n: INTEGER)
    set_username (un: STRING)
    set_write_mode

Constraints
    address assigned
    timeout non negative
    packet constraint
    pending constraint
    error definition
    valid count constraint
    mode constraint


DATA_RESOURCE Flat contracts

indexing
    description: "Data resources"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DATA_RESOURCE

feature -- Access

    address: URL
            -- Associated address

    hash_code: INTEGER
            -- Hash function
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    last_packet: STRING
            -- Last packet read

    location: STRING
            -- Location of resource
        require
            address_exists: address /= void

    mode: INTEGER
            -- Current mode

    port: INTEGER
            -- Port used by service

    service: STRING
            -- Name of service

feature -- Measurement

    bytes_transferred: INTEGER
            -- Number of transferred bytes

    count: INTEGER
            -- Size of data resource

    last_packet_size: INTEGER
            -- Size of last packet

    read_buffer_size: INTEGER
            -- Size of read buffer

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is resource equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    address_exists: BOOLEAN
            -- Does address exists?

    error: BOOLEAN
            -- Has an error occurred?

    error_code: INTEGER
            -- Code of error

    error_text (code: INTEGER): STRING
            -- Textual description of error
            -- (from DATA_RESOURCE_ERROR_CONSTANTS)
        require -- from DATA_RESOURCE_ERROR_CONSTANTS
            positive_code: code > 0

    has_packet: BOOLEAN
            -- Is there a packet available in last_packet?

    is_count_valid: BOOLEAN
            -- Is value in count valid?

    is_hashable: BOOLEAN
            -- Are objects of current type hashable?
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_mode_set: BOOLEAN
            -- Has resource mode been set?

    is_open: BOOLEAN
            -- Is resource open?

    is_packet_pending: BOOLEAN
            -- Can another packet currently be read out?

    is_proxy_supported: BOOLEAN
            -- Is proxy supported by resource?

    is_readable: BOOLEAN
            -- Is it possible to open in read mode currently?
        ensure
            mode_unchanged: mode = old mode

    is_writable: BOOLEAN
            -- Is it possible to open in write mode currently?
        ensure
            mode_unchanged: mode = old mode

    read_mode: BOOLEAN
            -- Is read mode set?

    supports_multiple_transactions: BOOLEAN
            -- Does resource support multiple tranactions per connection?

    timeout: INTEGER
            -- Connection timeout

    transfer_initiated: BOOLEAN
            -- Has transfer being initiated.

    valid_mode (n: INTEGER): BOOLEAN
            -- Is mode n valid?

    write_mode: BOOLEAN
            -- Is write mode set?

feature -- Status setting

    close
            -- Close.
        require
            open: is_open
        ensure
            closed: not is_open
            mode_unchanged: mode = old mode
            no_packet_available: not (has_packet and is_packet_pending)

    initiate_transfer
            -- Initiate transfer.
        require
            no_error_occurred: not error
            mode_set: is_mode_set
            open: is_open
            not_initiated: not transfer_initiated
        ensure
            failure_means_error: not transfer_initiated implies error

    open
            -- Open resource.
        require
            no_error_occurred: not error
            mode_set: is_mode_set
        ensure
            no_packet_available: not (has_packet and is_packet_pending)
            initiated_flag_reset: not transfer_initiated
            failure_means_error: not is_open implies error

    reset_error
            -- Reset error.
        ensure
            error_reset: not error

    reset_proxy
            -- Reset proxy information.
        ensure
            proxy_reset: not address.is_proxy_used

    reuse_connection (other: DATA_RESOURCE)
            -- Reuse connection of other.
        require
            other_exists: other /= void
            same_type: same_type (other)
            supports_multiple_transactions: supports_multiple_transactions and other.supports_multiple_transactions
            other_opened: other.is_open

    set_password (pw: STRING)
            -- Set password to pw.
        require
            password_accepted: address.is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty

    set_port (port_no: INTEGER)
            -- Set port number to port_no.
        require
            closed: not is_open
            non_negative_port_number: port_no >= 0
        ensure
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and port to port_no.
        require
            proxy_supported: is_proxy_supported
            closed: not is_open
            non_empty_host: host /= void and then not host.is_empty
            host_ok: address.proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure
            proxy_set: address.is_proxy_used

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
        require
            proxy_supported: is_proxy_supported
        ensure
            proxy_set: address.is_proxy_used

    set_read_buffer_size (n: INTEGER)
            -- Set size of read buffer.
        require
            size_positive: n > 0
        ensure
            buffer_size_set: read_buffer_size = n

    set_read_mode
            -- Set read mode.
        ensure
            read_mode_set: read_mode

    set_timeout (n: INTEGER)
            -- Set connection timeout to n.
        require
            non_negative: n >= 0
        ensure
            timeout_set: timeout = n

    set_username (un: STRING)
            -- Set username to un.
        require
            username_accepted: address.has_username
            non_empty_username: un /= void and then not un.is_empty

    set_write_mode
            -- Set write mode.
        ensure
            write_mode_set: write_mode

feature -- Removal

    dispose
            -- Clean up resource.

feature -- Input

    read
            -- Read packet.
        require
            no_error_occurred: not error
            open: is_open
            transfer_initated: transfer_initiated
            readable: is_readable
            positive_read_buffer_size: read_buffer_size > 0
            packet_pending: is_packet_pending
        ensure
            packet_received: is_packet_pending implies last_packet_size > 0
            counter_correct: not error implies bytes_transferred = old bytes_transferred + last_packet_size

feature -- Output

    put (other: DATA_RESOURCE)
            -- Write out resource other.
        require
            no_error_occurred: not (error and other.error)
            other_resource_exists: other /= void
            resources_open: is_open and other.is_open
            writable: is_writable
            transfer_initated: transfer_initiated

invariant

    address_assigned: address /= void
    timeout_non_negative: timeout >= 0
    packet_constraint: not (has_packet xor last_packet /= void)
    pending_constraint: is_packet_pending implies (is_open and is_readable and transfer_initiated)
    error_definition: error = (error_code /= 0)
    valid_count_constraint: count > 0 implies is_count_valid
    mode_constraint: is_mode_set = read_mode xor write_mode
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATA_RESOURCE


FILE_PROTOCOL Chart

class
    FILE_PROTOCOL

General
    cluster: net.transfer.resources
    description: "The FILE protocol"
    create: make

Ancestors
    DATA_RESOURCE

Queries
    address: FILE_URL
    address_exists: BOOLEAN
    bytes_transferred: INTEGER
    count: INTEGER
    error: BOOLEAN
    error_code: INTEGER
    error_text (code: INTEGER): STRING
    has_packet: BOOLEAN
    hash_code: INTEGER
    Is_count_valid: BOOLEAN
    is_equal (other: [like Current] FILE_PROTOCOL): BOOLEAN
    is_hashable: BOOLEAN
    Is_local: BOOLEAN
    is_mode_set: BOOLEAN
    is_open: BOOLEAN
    is_packet_pending: BOOLEAN
    is_proxy_supported: BOOLEAN
    is_readable: BOOLEAN
    is_writable: BOOLEAN
    last_packet: STRING
    last_packet_size: INTEGER
    location: STRING
    mode: INTEGER
    port: INTEGER
    read_buffer_size: INTEGER
    read_mode: BOOLEAN
    service: STRING
    Supports_multiple_transactions: BOOLEAN
    timeout: INTEGER
    transfer_initiated: BOOLEAN
    valid_mode (n: INTEGER): BOOLEAN
    write_mode: BOOLEAN

Commands
    close
    dispose
    initiate_transfer
    open
    put (other: DATA_RESOURCE)
    read
    reset_error
    reset_overwrite_mode
    reset_proxy
    reuse_connection (other: DATA_RESOURCE)
    set_overwrite_mode
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_read_buffer_size (n: INTEGER)
    set_read_mode
    set_timeout (n: INTEGER)
    set_username (un: STRING)
    set_write_mode


FILE_PROTOCOL Flat contracts

indexing
    description: "The FILE protocol"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    FILE_PROTOCOL

create

    make (addr: like address)
            -- Create protocol.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            address_exists: addr /= void
        ensure -- from DATA_RESOURCE
            address_set: address = addr

feature -- Access

    address: FILE_URL
            -- Associated address

    hash_code: INTEGER
            -- Hash function
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    last_packet: STRING
            -- Last packet read
            -- (from DATA_RESOURCE)

    location: STRING
            -- Location of resource
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            address_exists: address /= void

    mode: INTEGER
            -- Current mode
            -- (from DATA_RESOURCE)

    port: INTEGER
            -- Port used by service
            -- (from DATA_RESOURCE)

    service: STRING
            -- Name of service
            -- (from DATA_RESOURCE)

feature -- Measurement

    bytes_transferred: INTEGER
            -- Number of transferred bytes

    count: INTEGER
            -- Size of data resource

    last_packet_size: INTEGER
            -- Size of last packet

    read_buffer_size: INTEGER
            -- Size of read buffer

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is resource equal to other?
            -- (from DATA_RESOURCE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    address_exists: BOOLEAN
            -- Does address exist?

    error: BOOLEAN
            -- Has an error occurred?
            -- (from DATA_RESOURCE)

    error_code: INTEGER
            -- Code of error
            -- (from DATA_RESOURCE)

    error_text (code: INTEGER): STRING
            -- Textual description of error
            -- (from DATA_RESOURCE_ERROR_CONSTANTS)
        require -- from DATA_RESOURCE_ERROR_CONSTANTS
            positive_code: code > 0

    has_packet: BOOLEAN
            -- Is there a packet available in last_packet?
            -- (from DATA_RESOURCE)

    Is_count_valid: BOOLEAN is True
            -- Is value in count valid? (Answer: yes)

    is_hashable: BOOLEAN
            -- Are objects of current type hashable?
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    Is_local: BOOLEAN is True
            -- Is protocol not networked? (Answer: yes)

    is_mode_set: BOOLEAN
            -- Has resource mode been set?
            -- (from DATA_RESOURCE)

    is_open: BOOLEAN
            -- Is resource open?

    is_packet_pending: BOOLEAN
            -- Can another packet currently be read out?

    is_proxy_supported: BOOLEAN
            -- Is proxy supported by resource?
            -- (from DATA_RESOURCE)

    is_readable: BOOLEAN
            -- Is it possible to open in read mode currently?
        ensure -- from DATA_RESOURCE
            mode_unchanged: mode = old mode

    is_writable: BOOLEAN
            -- Is it possible to open in write mode currently?
        ensure -- from DATA_RESOURCE
            mode_unchanged: mode = old mode

    read_mode: BOOLEAN
            -- Is read mode set?

    Supports_multiple_transactions: BOOLEAN is False
            -- Does resource support multiple tranactions per connection?
            -- (Answer: no)

    timeout: INTEGER
            -- Connection timeout
            -- (from DATA_RESOURCE)

    transfer_initiated: BOOLEAN
            -- Has transfer being initiated.
            -- (from DATA_RESOURCE)

    valid_mode (n: INTEGER): BOOLEAN
            -- Is mode n valid?

    write_mode: BOOLEAN
            -- Is write mode set?

feature -- Status setting

    close
            -- Close.
        require -- from DATA_RESOURCE
            open: is_open
        ensure -- from DATA_RESOURCE
            closed: not is_open
            mode_unchanged: mode = old mode
            no_packet_available: not (has_packet and is_packet_pending)

    initiate_transfer
            -- Initiate transfer.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
            open: is_open
            not_initiated: not transfer_initiated
        ensure -- from DATA_RESOURCE
            failure_means_error: not transfer_initiated implies error

    open
            -- Open file resource.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
        ensure -- from DATA_RESOURCE
            no_packet_available: not (has_packet and is_packet_pending)
            initiated_flag_reset: not transfer_initiated
            failure_means_error: not is_open implies error
        ensure then
            counter_reset: bytes_transferred = 0

    reset_error
            -- Reset error.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            error_reset: not error

    reset_overwrite_mode
            -- Switch on file overwrite mode on.

    reset_proxy
            -- Reset proxy information.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            proxy_reset: not address.is_proxy_used

    reuse_connection (other: DATA_RESOURCE)
            -- Reuse connection of other.
        require -- from DATA_RESOURCE
            other_exists: other /= void
            same_type: same_type (other)
            supports_multiple_transactions: supports_multiple_transactions and other.supports_multiple_transactions
            other_opened: other.is_open

    set_overwrite_mode
            -- Switch on file overwrite mode on.

    set_password (pw: STRING)
            -- Set password to pw.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            password_accepted: address.is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty

    set_port (port_no: INTEGER)
            -- Set port number to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            closed: not is_open
            non_negative_port_number: port_no >= 0
        ensure -- from DATA_RESOURCE
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and port to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
            closed: not is_open
            non_empty_host: host /= void and then not host.is_empty
            host_ok: address.proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_read_buffer_size (n: INTEGER)
            -- Set size of read buffer.
        require -- from DATA_RESOURCE
            size_positive: n > 0
        ensure -- from DATA_RESOURCE
            buffer_size_set: read_buffer_size = n
        ensure then
            buffer_size_correct: buffer.area.count = read_buffer_size

    set_read_mode
            -- Set read mode.
        ensure -- from DATA_RESOURCE
            read_mode_set: read_mode

    set_timeout (n: INTEGER)
            -- Set connection timeout to n.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            non_negative: n >= 0
        ensure -- from DATA_RESOURCE
            timeout_set: timeout = n

    set_username (un: STRING)
            -- Set username to un.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            username_accepted: address.has_username
            non_empty_username: un /= void and then not un.is_empty

    set_write_mode
            -- Set write mode.
        ensure -- from DATA_RESOURCE
            write_mode_set: write_mode

feature -- Removal

    dispose
            -- Clean up resource.
            -- (from DATA_RESOURCE)

feature -- Input

    read
            -- Read packet.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            open: is_open
            transfer_initated: transfer_initiated
            readable: is_readable
            positive_read_buffer_size: read_buffer_size > 0
            packet_pending: is_packet_pending
        ensure -- from DATA_RESOURCE
            packet_received: is_packet_pending implies last_packet_size > 0
            counter_correct: not error implies bytes_transferred = old bytes_transferred + last_packet_size

feature -- Output

    put (other: DATA_RESOURCE)
            -- Write out resource other.
        require -- from DATA_RESOURCE
            no_error_occurred: not (error and other.error)
            other_resource_exists: other /= void
            resources_open: is_open and other.is_open
            writable: is_writable
            transfer_initated: transfer_initiated

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DATA_RESOURCE
    address_assigned: address /= void
    timeout_non_negative: timeout >= 0
    packet_constraint: not (has_packet xor last_packet /= void)
    pending_constraint: is_packet_pending implies (is_open and is_readable and transfer_initiated)
    error_definition: error = (error_code /= 0)
    valid_count_constraint: count > 0 implies is_count_valid
    mode_constraint: is_mode_set = read_mode xor write_mode

end -- class FILE_PROTOCOL


FTP_PROTOCOL Chart

class
    FTP_PROTOCOL

General
    cluster: net.transfer.resources
    description: "FTP protocol"
    create: make

Ancestors
    NETWORK_RESOURCE

Queries
    address: FTP_URL
    address_exists: BOOLEAN
    assertion_violation: BOOLEAN
    bytes_transferred: INTEGER
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    count: INTEGER
    Default_buffer_size: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    error: BOOLEAN
    error_code: INTEGER
    error_text (code: INTEGER): STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    has_packet: BOOLEAN
    hash_code: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_binary_mode: BOOLEAN
    is_count_valid: BOOLEAN
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_equal (other: [like Current] FTP_PROTOCOL): BOOLEAN
    is_hashable: BOOLEAN
    is_logged_in: BOOLEAN
    is_mode_set: BOOLEAN
    is_open: BOOLEAN
    is_packet_pending: BOOLEAN
    is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    is_readable: BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    is_writable: BOOLEAN
    last_packet: STRING
    last_packet_size: INTEGER
    location: STRING
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    mode: INTEGER
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    passive_mode: BOOLEAN
    port: INTEGER
    Postcondition: INTEGER
    Precondition: INTEGER
    read_buffer_size: INTEGER
    read_mode: BOOLEAN
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    service: STRING
    Signal_exception: INTEGER
    Supports_multiple_transactions: BOOLEAN
    tag_name: STRING
    timeout: INTEGER
    transfer_initiated: BOOLEAN
    valid_mode (n: INTEGER): BOOLEAN
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER
    write_mode: BOOLEAN

Commands
    catch (code: INTEGER)
    close
    die (code: INTEGER)
    dispose
    ignore (code: INTEGER)
    initiate_transfer
    message_on_failure
    no_message_on_failure
    open
    put (other: DATA_RESOURCE)
    raise (name: STRING)
    read
    reset_error
    reset_proxy
    reuse_connection (other: DATA_RESOURCE)
    set_active_mode
    set_binary_mode
    set_passive_mode
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_read_buffer_size (n: INTEGER)
    set_read_mode
    set_text_mode
    set_timeout (n: INTEGER)
    set_username (un: STRING)
    set_write_mode

Constraints
    data socket ok


FTP_PROTOCOL Flat contracts

indexing
    description: "FTP protocol"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    FTP_PROTOCOL

create

    make (addr: like address)
            -- Create protocol.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            address_exists: addr /= void
        ensure -- from DATA_RESOURCE
            address_set: address = addr

feature -- Access

    address: FTP_URL
            -- Associated address

    bytes_transferred: INTEGER
            -- Number of transferred bytes
            -- (from NETWORK_RESOURCE)

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    hash_code: INTEGER
            -- Hash function
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    last_packet: STRING
            -- Last packet read
            -- (from DATA_RESOURCE)

    last_packet_size: INTEGER
            -- Size of last packet
            -- (from NETWORK_RESOURCE)

    location: STRING
            -- Location of resource
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            address_exists: address /= void

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    mode: INTEGER
            -- Current mode
            -- (from DATA_RESOURCE)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    port: INTEGER
            -- Port used by service
            -- (from DATA_RESOURCE)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    read_buffer_size: INTEGER
            -- Size of read buffer
            -- (from NETWORK_RESOURCE)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    service: STRING
            -- Name of service
            -- (from DATA_RESOURCE)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Measurement

    count: INTEGER
            -- Size of data resource

    Default_buffer_size: INTEGER is 16384
            -- Default size of read buffer

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is resource equal to other?
            -- (from DATA_RESOURCE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    address_exists: BOOLEAN
            -- Does address exists?
            -- (from NETWORK_RESOURCE)

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    error: BOOLEAN
            -- Has an error occurred?
            -- (from DATA_RESOURCE)

    error_code: INTEGER
            -- Code of error
            -- (from DATA_RESOURCE)

    error_text (code: INTEGER): STRING
            -- Textual description of error
            -- (from DATA_RESOURCE_ERROR_CONSTANTS)
        require -- from DATA_RESOURCE_ERROR_CONSTANTS
            positive_code: code > 0

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    has_packet: BOOLEAN
            -- Is there a packet available in last_packet?
            -- (from DATA_RESOURCE)

    is_binary_mode: BOOLEAN
            -- Is binary transfer mode selected?

    is_count_valid: BOOLEAN
            -- Is value in count valid?
            -- (from NETWORK_RESOURCE)

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_hashable: BOOLEAN
            -- Are objects of current type hashable?
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_logged_in: BOOLEAN
            -- Logged in to a server?

    is_mode_set: BOOLEAN
            -- Has resource mode been set?
            -- (from DATA_RESOURCE)

    is_open: BOOLEAN
            -- Is resource open?

    is_packet_pending: BOOLEAN
            -- Can another packet currently be read out?
            -- (from NETWORK_RESOURCE)

    is_proxy_supported: BOOLEAN
            -- Is proxy supported by resource?
            -- (from DATA_RESOURCE)

    is_proxy_used: BOOLEAN
            -- Is a proxy used?
            -- (from NETWORK_RESOURCE)

    is_readable: BOOLEAN
            -- Is it possible to open in read mode currently?
            -- (from NETWORK_RESOURCE)
        ensure -- from DATA_RESOURCE
            mode_unchanged: mode = old mode

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    is_writable: BOOLEAN
            -- Is it possible to open in write mode currently?
            -- (from NETWORK_RESOURCE)
        ensure -- from DATA_RESOURCE
            mode_unchanged: mode = old mode

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    passive_mode: BOOLEAN
            -- Is passive mode used?

    read_mode: BOOLEAN
            -- Is read mode set?

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    Supports_multiple_transactions: BOOLEAN is True
            -- Does resource support multiple transactions per connection?
            -- (Answer: yes)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

    timeout: INTEGER
            -- Connection timeout
            -- (from DATA_RESOURCE)

    transfer_initiated: BOOLEAN
            -- Has transfer being initiated.
            -- (from DATA_RESOURCE)

    valid_mode (n: INTEGER): BOOLEAN
            -- Is mode n valid?

    write_mode: BOOLEAN
            -- Is write mode set?

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    close
            -- Close.
        require -- from DATA_RESOURCE
            open: is_open
        ensure -- from DATA_RESOURCE
            closed: not is_open
            mode_unchanged: mode = old mode
            no_packet_available: not (has_packet and is_packet_pending)
        ensure then
            not_logged_in: not is_logged_in

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    initiate_transfer
            -- Initiate transfer.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
            open: is_open
            not_initiated: not transfer_initiated
        ensure -- from DATA_RESOURCE
            failure_means_error: not transfer_initiated implies error
        ensure then
            connection_established: data_socket.is_open_read or data_socket.is_open_write

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    open
            -- Open resource.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
        ensure -- from DATA_RESOURCE
            no_packet_available: not (has_packet and is_packet_pending)
            initiated_flag_reset: not transfer_initiated
            failure_means_error: not is_open implies error

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

    reset_error
            -- Reset error.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            error_reset: not error

    reset_proxy
            -- Reset proxy information.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            proxy_reset: not address.is_proxy_used

    reuse_connection (other: DATA_RESOURCE)
            -- Reuse connection of other.
        require -- from DATA_RESOURCE
            other_exists: other /= void
            same_type: same_type (other)
            supports_multiple_transactions: supports_multiple_transactions and other.supports_multiple_transactions
            other_opened: other.is_open

    set_active_mode
            -- Switch FTP client to active mode.
        ensure
            active_mode_set: not passive_mode

    set_binary_mode
            -- Set binary transfer mode.
        ensure
            binary_mode_set: is_binary_mode

    set_passive_mode
            -- Switch FTP client to passive mode.
        ensure
            passive_mode_set: passive_mode

    set_password (pw: STRING)
            -- Set password to pw.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            password_accepted: address.is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty

    set_port (port_no: INTEGER)
            -- Set port number to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            closed: not is_open
            non_negative_port_number: port_no >= 0
        ensure -- from DATA_RESOURCE
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and port to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
            closed: not is_open
            non_empty_host: host /= void and then not host.is_empty
            host_ok: address.proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_read_buffer_size (n: INTEGER)
            -- Set size of read buffer.
            -- (from NETWORK_RESOURCE)
        require -- from DATA_RESOURCE
            size_positive: n > 0
        ensure -- from DATA_RESOURCE
            buffer_size_set: read_buffer_size = n

    set_read_mode
            -- Set read mode.
        ensure -- from DATA_RESOURCE
            read_mode_set: read_mode

    set_text_mode
            -- Set ASCII text transfer mode.
        ensure
            text_mode_set: not is_binary_mode

    set_timeout (n: INTEGER)
            -- Set connection timeout to n.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            non_negative: n >= 0
        ensure -- from DATA_RESOURCE
            timeout_set: timeout = n

    set_username (un: STRING)
            -- Set username to un.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            username_accepted: address.has_username
            non_empty_username: un /= void and then not un.is_empty

    set_write_mode
            -- Set write mode.
        ensure -- from DATA_RESOURCE
            write_mode_set: write_mode

feature -- Removal

    dispose
            -- Clean up resource.
            -- (from DATA_RESOURCE)

feature -- Input

    read
            -- Read packet.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            open: is_open
            transfer_initated: transfer_initiated
            readable: is_readable
            positive_read_buffer_size: read_buffer_size > 0
            packet_pending: is_packet_pending
        ensure -- from DATA_RESOURCE
            packet_received: is_packet_pending implies last_packet_size > 0
            counter_correct: not error implies bytes_transferred = old bytes_transferred + last_packet_size

feature -- Output

    put (other: DATA_RESOURCE)
            -- Write out resource other.
        require -- from DATA_RESOURCE
            no_error_occurred: not (error and other.error)
            other_resource_exists: other /= void
            resources_open: is_open and other.is_open
            writable: is_writable
            transfer_initated: transfer_initiated

invariant

    data_socket_ok: data_socket /= void implies data_socket.socket_ok
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from NETWORK_RESOURCE
    main_socket_ok: (main_socket /= void and not error) implies main_socket.socket_ok
        -- from DATA_RESOURCE
    address_assigned: address /= void
    timeout_non_negative: timeout >= 0
    packet_constraint: not (has_packet xor last_packet /= void)
    pending_constraint: is_packet_pending implies (is_open and is_readable and transfer_initiated)
    error_definition: error = (error_code /= 0)
    valid_count_constraint: count > 0 implies is_count_valid
    mode_constraint: is_mode_set = read_mode xor write_mode

end -- class FTP_PROTOCOL


HTTP_PROTOCOL Chart

class
    HTTP_PROTOCOL

General
    cluster: net.transfer.resources
    description: "Files accessed via HTTP"
    create: make

Ancestors
    NETWORK_RESOURCE

Queries
    address: NETWORK_RESOURCE_URL
    address_exists: BOOLEAN
    assertion_violation: BOOLEAN
    bytes_transferred: INTEGER
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    count: INTEGER
    Default_buffer_size: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    error: BOOLEAN
    error_code: INTEGER
    error_text (code: INTEGER): STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    has_packet: BOOLEAN
    hash_code: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_count_valid: BOOLEAN
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_equal (other: [like Current] HTTP_PROTOCOL): BOOLEAN
    is_hashable: BOOLEAN
    is_mode_set: BOOLEAN
    is_open: BOOLEAN
    is_packet_pending: BOOLEAN
    is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    is_readable: BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    Is_writable: BOOLEAN
    last_packet: STRING
    last_packet_size: INTEGER
    location: STRING
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    mode: INTEGER
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    port: INTEGER
    Postcondition: INTEGER
    Precondition: INTEGER
    read_buffer_size: INTEGER
    read_mode: BOOLEAN
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    service: STRING
    Signal_exception: INTEGER
    Supports_multiple_transactions: BOOLEAN
    tag_name: STRING
    timeout: INTEGER
    transfer_initiated: BOOLEAN
    valid_mode (n: INTEGER): BOOLEAN
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER
    Write_mode: BOOLEAN

Commands
    catch (code: INTEGER)
    close
    die (code: INTEGER)
    dispose
    ignore (code: INTEGER)
    initiate_transfer
    message_on_failure
    no_message_on_failure
    open
    put (other: DATA_RESOURCE)
    raise (name: STRING)
    read
    reset_error
    reset_proxy
    reuse_connection (other: DATA_RESOURCE)
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_read_buffer_size (n: INTEGER)
    set_read_mode
    set_timeout (n: INTEGER)
    set_username (un: STRING)
    set_write_mode

Constraints
    headers list exists
    count constraint


HTTP_PROTOCOL Flat contracts

indexing
    description: "Files accessed via HTTP"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    HTTP_PROTOCOL

create

    make (addr: like address)
            -- Create protocol.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            address_exists: addr /= void
        ensure -- from DATA_RESOURCE
            address_set: address = addr

feature -- Access

    address: NETWORK_RESOURCE_URL
            -- Address of URL
            -- (from NETWORK_RESOURCE)

    bytes_transferred: INTEGER
            -- Number of transferred bytes
            -- (from NETWORK_RESOURCE)

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    hash_code: INTEGER
            -- Hash function
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    last_packet: STRING
            -- Last packet read
            -- (from DATA_RESOURCE)

    last_packet_size: INTEGER
            -- Size of last packet
            -- (from NETWORK_RESOURCE)

    location: STRING
            -- Resource location
        require -- from DATA_RESOURCE
            address_exists: address /= void

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    mode: INTEGER
            -- Current mode
            -- (from DATA_RESOURCE)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    port: INTEGER
            -- Port used by service
            -- (from DATA_RESOURCE)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    read_buffer_size: INTEGER
            -- Size of read buffer
            -- (from NETWORK_RESOURCE)

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    service: STRING
            -- Name of service
            -- (from DATA_RESOURCE)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Measurement

    count: INTEGER
            -- Size of data resource

    Default_buffer_size: INTEGER is 16384
            -- Default size of read buffer.

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is resource equal to other?
            -- (from DATA_RESOURCE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    address_exists: BOOLEAN
            -- Does address exists?
            -- (from NETWORK_RESOURCE)

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    error: BOOLEAN
            -- Has an error occurred?
            -- (from DATA_RESOURCE)

    error_code: INTEGER
            -- Code of error
            -- (from DATA_RESOURCE)

    error_text (code: INTEGER): STRING
            -- Textual description of error
            -- (from DATA_RESOURCE_ERROR_CONSTANTS)
        require -- from DATA_RESOURCE_ERROR_CONSTANTS
            positive_code: code > 0

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    has_packet: BOOLEAN
            -- Is there a packet available in last_packet?
            -- (from DATA_RESOURCE)

    is_count_valid: BOOLEAN
            -- Is value in count valid?
            -- (from NETWORK_RESOURCE)

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_hashable: BOOLEAN
            -- Are objects of current type hashable?
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_mode_set: BOOLEAN
            -- Has resource mode been set?
            -- (from DATA_RESOURCE)

    is_open: BOOLEAN
            -- Is resource open?
            -- (from NETWORK_RESOURCE)

    is_packet_pending: BOOLEAN
            -- Can another packet currently be read out?
            -- (from NETWORK_RESOURCE)

    is_proxy_supported: BOOLEAN
            -- Is proxy supported by resource?
            -- (from DATA_RESOURCE)

    is_proxy_used: BOOLEAN
            -- Is a proxy used?
            -- (from NETWORK_RESOURCE)

    is_readable: BOOLEAN
            -- Is it possible to open in read mode currently?
            -- (from NETWORK_RESOURCE)
        ensure -- from DATA_RESOURCE
            mode_unchanged: mode = old mode

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    Is_writable: BOOLEAN is False
            -- Is it possible to open in write mode currently? (Answer: no)
            -- (HTTP resources are read-only.)

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    read_mode: BOOLEAN
            -- Is read mode set?

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    Supports_multiple_transactions: BOOLEAN is False
            -- Does resource support multiple tranactions per connection?
            -- (Answer: no)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

    timeout: INTEGER
            -- Connection timeout
            -- (from DATA_RESOURCE)

    transfer_initiated: BOOLEAN
            -- Has transfer being initiated.
            -- (from DATA_RESOURCE)

    valid_mode (n: INTEGER): BOOLEAN
            -- Is mode n valid?

    Write_mode: BOOLEAN is False
            -- Is write mode set? (Answer: no)

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    close
            -- Close.
        require -- from DATA_RESOURCE
            open: is_open
        ensure -- from DATA_RESOURCE
            closed: not is_open
            mode_unchanged: mode = old mode
            no_packet_available: not (has_packet and is_packet_pending)

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    initiate_transfer
            -- Initiate transfer.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
            open: is_open
            not_initiated: not transfer_initiated
        ensure -- from DATA_RESOURCE
            failure_means_error: not transfer_initiated implies error

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    open
            -- Open resource.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
        ensure -- from DATA_RESOURCE
            no_packet_available: not (has_packet and is_packet_pending)
            initiated_flag_reset: not transfer_initiated
            failure_means_error: not is_open implies error
        ensure then
            correct_socket_if_not_error: not error = main_socket.socket_ok

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

    reset_error
            -- Reset error.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            error_reset: not error

    reset_proxy
            -- Reset proxy information.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            proxy_reset: not address.is_proxy_used

    reuse_connection (other: DATA_RESOURCE)
            -- Reuse connection of other.
            -- (from NETWORK_RESOURCE)
        require -- from DATA_RESOURCE
            other_exists: other /= void
            same_type: same_type (other)
            supports_multiple_transactions: supports_multiple_transactions and other.supports_multiple_transactions
            other_opened: other.is_open

    set_password (pw: STRING)
            -- Set password to pw.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            password_accepted: address.is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty

    set_port (port_no: INTEGER)
            -- Set port number to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            closed: not is_open
            non_negative_port_number: port_no >= 0
        ensure -- from DATA_RESOURCE
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and port to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
            closed: not is_open
            non_empty_host: host /= void and then not host.is_empty
            host_ok: address.proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_read_buffer_size (n: INTEGER)
            -- Set size of read buffer.
            -- (from NETWORK_RESOURCE)
        require -- from DATA_RESOURCE
            size_positive: n > 0
        ensure -- from DATA_RESOURCE
            buffer_size_set: read_buffer_size = n

    set_read_mode
            -- Set read mode.
        ensure -- from DATA_RESOURCE
            read_mode_set: read_mode

    set_timeout (n: INTEGER)
            -- Set connection timeout to n.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            non_negative: n >= 0
        ensure -- from DATA_RESOURCE
            timeout_set: timeout = n

    set_username (un: STRING)
            -- Set username to un.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            username_accepted: address.has_username
            non_empty_username: un /= void and then not un.is_empty

    set_write_mode
            -- Set write mode.
        ensure -- from DATA_RESOURCE
            write_mode_set: write_mode

feature -- Removal

    dispose
            -- Clean up resource.
            -- (from DATA_RESOURCE)

feature -- Input

    read
            -- Read packet.
            -- (from NETWORK_RESOURCE)
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            open: is_open
            transfer_initated: transfer_initiated
            readable: is_readable
            positive_read_buffer_size: read_buffer_size > 0
            packet_pending: is_packet_pending
        ensure -- from DATA_RESOURCE
            packet_received: is_packet_pending implies last_packet_size > 0
            counter_correct: not error implies bytes_transferred = old bytes_transferred + last_packet_size

feature -- Output

    put (other: DATA_RESOURCE)
            -- Write out resource other.
            -- (from NETWORK_RESOURCE)
        require -- from DATA_RESOURCE
            no_error_occurred: not (error and other.error)
            other_resource_exists: other /= void
            resources_open: is_open and other.is_open
            writable: is_writable
            transfer_initated: transfer_initiated

invariant

    headers_list_exists: headers /= void
    count_constraint: is_count_valid implies (is_packet_pending = (bytes_transferred < count))
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from NETWORK_RESOURCE
    main_socket_ok: (main_socket /= void and not error) implies main_socket.socket_ok
        -- from DATA_RESOURCE
    address_assigned: address /= void
    timeout_non_negative: timeout >= 0
    packet_constraint: not (has_packet xor last_packet /= void)
    pending_constraint: is_packet_pending implies (is_open and is_readable and transfer_initiated)
    error_definition: error = (error_code /= 0)
    valid_count_constraint: count > 0 implies is_count_valid
    mode_constraint: is_mode_set = read_mode xor write_mode

end -- class HTTP_PROTOCOL


NETWORK_RESOURCE Chart

deferred class
    NETWORK_RESOURCE

General
    cluster: net.transfer.resources
    description: "Resources accessed over a network"

Ancestors
    DATA_RESOURCE
    EXCEPTIONS
    TRANSFER_COMMAND_CONSTANTS

Queries
    address: NETWORK_RESOURCE_URL
    address_exists: BOOLEAN
    assertion_violation: BOOLEAN
    bytes_transferred: INTEGER
    Check_instruction: INTEGER
    Class_invariant: INTEGER
    class_name: STRING
    Com_exception: INTEGER
    count: INTEGER
    Developer_exception: INTEGER
    developer_exception_name: STRING
    error: BOOLEAN
    error_code: INTEGER
    error_text (code: INTEGER): STRING
    exception: INTEGER
    exception_trace: STRING
    External_exception: INTEGER
    Floating_point_exception: INTEGER
    has_packet: BOOLEAN
    hash_code: INTEGER
    Incorrect_inspect_value: INTEGER
    Io_exception: INTEGER
    is_count_valid: BOOLEAN
    is_developer_exception: BOOLEAN
    is_developer_exception_of_name (name: STRING): BOOLEAN
    is_equal (other: [like Current] NETWORK_RESOURCE): BOOLEAN
    is_hashable: BOOLEAN
    is_mode_set: BOOLEAN
    is_open: BOOLEAN
    is_packet_pending: BOOLEAN
    is_proxy_supported: BOOLEAN
    is_proxy_used: BOOLEAN
    is_readable: BOOLEAN
    is_signal: BOOLEAN
    is_system_exception: BOOLEAN
    is_writable: BOOLEAN
    last_packet: STRING
    last_packet_size: INTEGER
    location: STRING
    Loop_invariant: INTEGER
    Loop_variant: INTEGER
    meaning (except: INTEGER): STRING
    mode: INTEGER
    No_more_memory: INTEGER
    Operating_system_exception: INTEGER
    original_class_name: STRING
    original_exception: INTEGER
    original_recipient_name: STRING
    original_tag_name: STRING
    port: INTEGER
    Postcondition: INTEGER
    Precondition: INTEGER
    read_buffer_size: INTEGER
    read_mode: BOOLEAN
    recipient_name: STRING
    Rescue_exception: INTEGER
    Retrieve_exception: INTEGER
    Routine_failure: INTEGER
    Runtime_io_exception: INTEGER
    service: STRING
    Signal_exception: INTEGER
    supports_multiple_transactions: BOOLEAN
    tag_name: STRING
    timeout: INTEGER
    transfer_initiated: BOOLEAN
    valid_mode (n: INTEGER): BOOLEAN
    Void_assigned_to_expanded: INTEGER
    Void_call_target: INTEGER
    write_mode: BOOLEAN

Commands
    catch (code: INTEGER)
    close
    die (code: INTEGER)
    dispose
    ignore (code: INTEGER)
    initiate_transfer
    message_on_failure
    no_message_on_failure
    open
    put (other: DATA_RESOURCE)
    raise (name: STRING)
    read
    reset_error
    reset_proxy
    reuse_connection (other: DATA_RESOURCE)
    set_password (pw: STRING)
    set_port (port_no: INTEGER)
    set_proxy (host: STRING; port_no: INTEGER)
    set_proxy_information (pi: PROXY_INFORMATION)
    set_read_buffer_size (n: INTEGER)
    set_read_mode
    set_timeout (n: INTEGER)
    set_username (un: STRING)
    set_write_mode

Constraints
    main socket ok


NETWORK_RESOURCE Flat contracts

indexing
    description: "Resources accessed over a network"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    NETWORK_RESOURCE

feature -- Access

    address: NETWORK_RESOURCE_URL
            -- Address of URL

    bytes_transferred: INTEGER
            -- Number of transferred bytes

    Check_instruction: INTEGER is 7
            -- Exception code for violated check
            -- (from EXCEP_CONST)

    Class_invariant: INTEGER is 6
            -- Exception code for violated class invariant
            -- (from EXCEP_CONST)

    Com_exception: INTEGER is 28
            -- Exception code for a COM error.
            -- (from EXCEP_CONST)

    Developer_exception: INTEGER is 24
            -- Exception code for developer exception
            -- (from EXCEP_CONST)

    External_exception: INTEGER is 18
            -- Exception code for operating system error
            -- which does not set the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    Floating_point_exception: INTEGER is 5
            -- Exception code for floating point exception
            -- (from EXCEP_CONST)

    hash_code: INTEGER
            -- Hash function
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    Incorrect_inspect_value: INTEGER is 9
            -- Exception code for inspect value which is not one
            -- of the inspect constants, if there is no Else_part
            -- (from EXCEP_CONST)

    Io_exception: INTEGER is 21
            -- Exception code for I/O error
            -- (from EXCEP_CONST)

    last_packet: STRING
            -- Last packet read
            -- (from DATA_RESOURCE)

    last_packet_size: INTEGER
            -- Size of last packet

    location: STRING
            -- Location of resource
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            address_exists: address /= void

    Loop_invariant: INTEGER is 11
            -- Exception code for violated loop invariant
            -- (from EXCEP_CONST)

    Loop_variant: INTEGER is 10
            -- Exception code for non-decreased loop variant
            -- (from EXCEP_CONST)

    mode: INTEGER
            -- Current mode
            -- (from DATA_RESOURCE)

    No_more_memory: INTEGER is 2
            -- Exception code for failed memory allocation
            -- (from EXCEP_CONST)

    Operating_system_exception: INTEGER is 22
            -- Exception code for operating system error
            -- which sets the errno variable
            -- (Unix-specific)
            -- (from EXCEP_CONST)

    port: INTEGER
            -- Port used by service
            -- (from DATA_RESOURCE)

    Postcondition: INTEGER is 4
            -- Exception code for violated postcondition
            -- (from EXCEP_CONST)

    Precondition: INTEGER is 3
            -- Exception code for violated precondition
            -- (from EXCEP_CONST)

    read_buffer_size: INTEGER
            -- Size of read buffer

    Rescue_exception: INTEGER is 14
            -- Exception code for exception in rescue clause
            -- (from EXCEP_CONST)

    Retrieve_exception: INTEGER is 23
            -- Exception code for retrieval error
            -- may be raised by retrieved in IO_MEDIUM.
            -- (from EXCEP_CONST)

    Routine_failure: INTEGER is 8
            -- Exception code for failed routine
            -- (from EXCEP_CONST)

    Runtime_io_exception: INTEGER is 27
            -- Exception code for I/O error raised by runtime functions
            -- such as store/retrieve, file access...
            -- (from EXCEP_CONST)

    service: STRING
            -- Name of service
            -- (from DATA_RESOURCE)

    Signal_exception: INTEGER is 12
            -- Exception code for operating system signal
            -- (from EXCEP_CONST)

    Void_assigned_to_expanded: INTEGER is 19
            -- Exception code for assignment of void value
            -- to expanded entity
            -- (from EXCEP_CONST)

    Void_call_target: INTEGER is 1
            -- Exception code for feature applied to void reference
            -- (from EXCEP_CONST)

feature -- Measurement

    count: INTEGER
            -- Size of data resource
            -- (from DATA_RESOURCE)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is resource equal to other?
            -- (from DATA_RESOURCE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    address_exists: BOOLEAN
            -- Does address exists?

    assertion_violation: BOOLEAN
            -- Is last exception originally due to a violated
            -- assertion or non-decreasing variant?
            -- (from EXCEPTIONS)

    class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    developer_exception_name: STRING
            -- Name of last developer-raised exception
            -- (from EXCEPTIONS)
        require -- from EXCEPTIONS
            applicable: is_developer_exception

    error: BOOLEAN
            -- Has an error occurred?
            -- (from DATA_RESOURCE)

    error_code: INTEGER
            -- Code of error
            -- (from DATA_RESOURCE)

    error_text (code: INTEGER): STRING
            -- Textual description of error
            -- (from DATA_RESOURCE_ERROR_CONSTANTS)
        require -- from DATA_RESOURCE_ERROR_CONSTANTS
            positive_code: code > 0

    exception: INTEGER
            -- Code of last exception that occurred
            -- (from EXCEPTIONS)

    exception_trace: STRING
            -- String representation of the exception trace
            -- (from EXCEPTIONS)

    has_packet: BOOLEAN
            -- Is there a packet available in last_packet?
            -- (from DATA_RESOURCE)

    is_count_valid: BOOLEAN
            -- Is value in count valid?

    is_developer_exception: BOOLEAN
            -- Is the last exception originally due to
            -- a developer exception?
            -- (from EXCEPTIONS)

    is_developer_exception_of_name (name: STRING): BOOLEAN
            -- Is the last exception originally due to a developer
            -- exception of name name?
            -- (from EXCEPTIONS)

    is_hashable: BOOLEAN
            -- Are objects of current type hashable?
            -- (from DATA_RESOURCE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_mode_set: BOOLEAN
            -- Has resource mode been set?
            -- (from DATA_RESOURCE)

    is_open: BOOLEAN
            -- Is resource open?

    is_packet_pending: BOOLEAN
            -- Can another packet currently be read out?

    is_proxy_supported: BOOLEAN
            -- Is proxy supported by resource?
            -- (from DATA_RESOURCE)

    is_proxy_used: BOOLEAN
            -- Is a proxy used?

    is_readable: BOOLEAN
            -- Is it possible to open in read mode currently?
        ensure -- from DATA_RESOURCE
            mode_unchanged: mode = old mode

    is_signal: BOOLEAN
            -- Is last exception originally due to an external
            -- event (operating system signal)?
            -- (from EXCEPTIONS)

    is_system_exception: BOOLEAN
            -- Is last exception originally due to an
            -- external event (operating system error)?
            -- (from EXCEPTIONS)

    is_writable: BOOLEAN
            -- Is it possible to open in write mode currently?
        ensure -- from DATA_RESOURCE
            mode_unchanged: mode = old mode

    meaning (except: INTEGER): STRING
            -- A message in English describing what except is
            -- (from EXCEPTIONS)

    original_class_name: STRING
            -- Name of the class that includes the recipient
            -- of original form of last exception
            -- (from EXCEPTIONS)

    original_exception: INTEGER
            -- Original code of last exception that triggered
            -- current exception
            -- (from EXCEPTIONS)

    original_recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by original form of last exception
            -- (from EXCEPTIONS)

    original_tag_name: STRING
            -- Assertion tag for original form of last
            -- assertion violation.
            -- (from EXCEPTIONS)

    read_mode: BOOLEAN
            -- Is read mode set?
            -- (from DATA_RESOURCE)

    recipient_name: STRING
            -- Name of the routine whose execution was
            -- interrupted by last exception
            -- (from EXCEPTIONS)

    supports_multiple_transactions: BOOLEAN
            -- Does resource support multiple tranactions per connection?
            -- (from DATA_RESOURCE)

    tag_name: STRING
            -- Tag of last violated assertion clause
            -- (from EXCEPTIONS)

    timeout: INTEGER
            -- Connection timeout
            -- (from DATA_RESOURCE)

    transfer_initiated: BOOLEAN
            -- Has transfer being initiated.
            -- (from DATA_RESOURCE)

    valid_mode (n: INTEGER): BOOLEAN
            -- Is mode n valid?
            -- (from DATA_RESOURCE)

    write_mode: BOOLEAN
            -- Is write mode set?
            -- (from DATA_RESOURCE)

feature -- Status setting

    catch (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- caught. This is the default.
            -- (from EXCEPTIONS)

    close
            -- Close.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            open: is_open
        ensure -- from DATA_RESOURCE
            closed: not is_open
            mode_unchanged: mode = old mode
            no_packet_available: not (has_packet and is_packet_pending)

    die (code: INTEGER)
            -- Terminate execution with exit status code,
            -- without triggering an exception.
            -- (from EXCEPTIONS)

    ignore (code: INTEGER)
            -- Make sure that any exception of code code will be
            -- ignored. This is not the default.
            -- (from EXCEPTIONS)

    initiate_transfer
            -- Initiate transfer.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
            open: is_open
            not_initiated: not transfer_initiated
        ensure -- from DATA_RESOURCE
            failure_means_error: not transfer_initiated implies error

    message_on_failure
            -- Print an exception history table
            -- in case of failure.
            -- This is the default.
            -- (from EXCEPTIONS)

    no_message_on_failure
            -- Do not print an exception history table
            -- in case of failure.
            -- (from EXCEPTIONS)

    open
            -- Open resource.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            mode_set: is_mode_set
        ensure -- from DATA_RESOURCE
            no_packet_available: not (has_packet and is_packet_pending)
            initiated_flag_reset: not transfer_initiated
            failure_means_error: not is_open implies error

    raise (name: STRING)
            -- Raise a developer exception of name name.
            -- (from EXCEPTIONS)

    reset_error
            -- Reset error.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            error_reset: not error

    reset_proxy
            -- Reset proxy information.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            proxy_reset: not address.is_proxy_used

    reuse_connection (other: DATA_RESOURCE)
            -- Reuse connection of other.
        require -- from DATA_RESOURCE
            other_exists: other /= void
            same_type: same_type (other)
            supports_multiple_transactions: supports_multiple_transactions and other.supports_multiple_transactions
            other_opened: other.is_open

    set_password (pw: STRING)
            -- Set password to pw.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            password_accepted: address.is_password_accepted
            non_empty_password: pw /= void and then not pw.is_empty

    set_port (port_no: INTEGER)
            -- Set port number to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            closed: not is_open
            non_negative_port_number: port_no >= 0
        ensure -- from DATA_RESOURCE
            port_set: port = port_no

    set_proxy (host: STRING; port_no: INTEGER)
            -- Set proxy host to host and port to port_no.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
            closed: not is_open
            non_empty_host: host /= void and then not host.is_empty
            host_ok: address.proxy_host_ok (host)
            non_negative_port: port_no >= 0
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_proxy_information (pi: PROXY_INFORMATION)
            -- Set proxy information to pi.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            proxy_supported: is_proxy_supported
        ensure -- from DATA_RESOURCE
            proxy_set: address.is_proxy_used

    set_read_buffer_size (n: INTEGER)
            -- Set size of read buffer.
        require -- from DATA_RESOURCE
            size_positive: n > 0
        ensure -- from DATA_RESOURCE
            buffer_size_set: read_buffer_size = n

    set_read_mode
            -- Set read mode.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            read_mode_set: read_mode

    set_timeout (n: INTEGER)
            -- Set connection timeout to n.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            non_negative: n >= 0
        ensure -- from DATA_RESOURCE
            timeout_set: timeout = n

    set_username (un: STRING)
            -- Set username to un.
            -- (from DATA_RESOURCE)
        require -- from DATA_RESOURCE
            username_accepted: address.has_username
            non_empty_username: un /= void and then not un.is_empty

    set_write_mode
            -- Set write mode.
            -- (from DATA_RESOURCE)
        ensure -- from DATA_RESOURCE
            write_mode_set: write_mode

feature -- Removal

    dispose
            -- Clean up resource.
            -- (from DATA_RESOURCE)

feature -- Input

    read
            -- Read packet.
        require -- from DATA_RESOURCE
            no_error_occurred: not error
            open: is_open
            transfer_initated: transfer_initiated
            readable: is_readable
            positive_read_buffer_size: read_buffer_size > 0
            packet_pending: is_packet_pending
        ensure -- from DATA_RESOURCE
            packet_received: is_packet_pending implies last_packet_size > 0
            counter_correct: not error implies bytes_transferred = old bytes_transferred + last_packet_size

feature -- Output

    put (other: DATA_RESOURCE)
            -- Write out resource other.
        require -- from DATA_RESOURCE
            no_error_occurred: not (error and other.error)
            other_resource_exists: other /= void
            resources_open: is_open and other.is_open
            writable: is_writable
            transfer_initated: transfer_initiated

invariant

    main_socket_ok: (main_socket /= void and not error) implies main_socket.socket_ok
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DATA_RESOURCE
    address_assigned: address /= void
    timeout_non_negative: timeout >= 0
    packet_constraint: not (has_packet xor last_packet /= void)
    pending_constraint: is_packet_pending implies (is_open and is_readable and transfer_initiated)
    error_definition: error = (error_code /= 0)
    valid_count_constraint: count > 0 implies is_count_valid
    mode_constraint: is_mode_set = read_mode xor write_mode

end -- class NETWORK_RESOURCE


TRANSFER_COMMAND_CONSTANTS Chart

class
    TRANSFER_COMMAND_CONSTANTS

General
    cluster: net.transfer.resources
    description: "Constants for server commands"

Ancestors
    ANY


cluster net.transfer.transactions

Cluster
    net.transfer.transactions

Supercluster
    net.transfer

Classes
    DATA_RESOURCE_FACTORY
    MULTIPLE_TRANSACTION
    SINGLE_TRANSACTION
    TRANSACTION
    TRANSACTION_CONTAINER [G -> TRANSACTION]
    TRANSFER_MANAGER
    TRANSFER_MANAGER_BUILDER
    TRANSFER_MANAGER_BUILDER_IMPL


DATA_RESOURCE_FACTORY Chart

class
    DATA_RESOURCE_FACTORY

General
    cluster: net.transfer.transactions
    description: "Singleton instance of resource factory"

Ancestors
    ANY

Queries
    Resource_factory: DATA_RESOURCE_FACTORY_IMPL


DATA_RESOURCE_FACTORY Flat contracts

indexing
    description: "Singleton instance of resource factory"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    DATA_RESOURCE_FACTORY

feature -- Access

    resource_factory: DATA_RESOURCE_FACTORY_IMPL
            -- Singleton of resource factory

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATA_RESOURCE_FACTORY


MULTIPLE_TRANSACTION Chart

class
    MULTIPLE_TRANSACTION

General
    cluster: net.transfer.transactions
    description: "Transactions consisting of multiple transfers"
    create: make

Ancestors
    ARRAYED_LIST [G]
    TRANSACTION
    TRANSACTION_CONTAINER [G -> TRANSACTION]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    error: BOOLEAN
    error_stops: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] TRANSACTION): BOOLEAN
    index: INTEGER
    index_of (v: [like item] TRANSACTION; i: INTEGER): INTEGER
    insertable (t: TRANSACTION): BOOLEAN
    is_correct: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] MULTIPLE_TRANSACTION): BOOLEAN
    is_inserted (v: TRANSACTION): BOOLEAN
    linear_representation: LINEAR [TRANSACTION]
    object_comparison: BOOLEAN
    occurrences (v: [like item] TRANSACTION): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    source: DATA_RESOURCE
    succeeded: BOOLEAN
    target: DATA_RESOURCE
    there_exists (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
    transaction: [like first] TRANSACTION
    writable: BOOLEAN

Commands
    add_transaction (t: TRANSACTION)
    append (s: SEQUENCE [TRANSACTION])
    back
    compare_objects
    compare_references
    continue_on_error
    copy (other: [like Current] MULTIPLE_TRANSACTION)
    do_all (action: PROCEDURE [ANY, TUPLE [TRANSACTION]])
    do_if (action: PROCEDURE [ANY, TUPLE [TRANSACTION]]; test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN])
    execute
    extend (v: [like item] TRANSACTION)
    fill (other: CONTAINER [TRANSACTION])
    finish
    force (v: [like item] TRANSACTION)
    forth
    prune (v: [like item] TRANSACTION)
    prune_all (v: [like item] TRANSACTION)
    put (v: [like item] TRANSACTION)
    remove
    replace (v: [like first] TRANSACTION)
    reset_error
    search (v: [like item] TRANSACTION)
    select_transaction (i: INTEGER)
    start
    stop_on_error
    wipe_out


MULTIPLE_TRANSACTION Flat contracts

indexing
    description: "Transactions consisting of multiple transfers"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    MULTIPLE_TRANSACTION

create

    make
            -- Create transaction list.

feature -- Access

    has (v: like transaction): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like transaction; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    transaction: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from  TRANSACTION_CONTAINER
            True
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    source: DATA_RESOURCE
            -- Current source

    target: DATA_RESOURCE
            -- Current target

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    occurrences (v: like transaction): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like transaction): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    error: BOOLEAN
            -- Has an error occurred in current transaction?

    error_stops: BOOLEAN
            -- Is transfer stopped on error?
            -- (from TRANSACTION_CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    insertable (t: TRANSACTION): BOOLEAN
            -- Can transaction t be inserted in container?
        require -- from TRANSACTION_CONTAINER
            transaction_exists: t /= void

    is_correct: BOOLEAN
            -- Is transaction set up correctly?

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: TRANSACTION): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    succeeded: BOOLEAN
            -- Has the transaction succeeded?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    continue_on_error
            -- Error does not stop action.
            -- (from TRANSACTION_CONTAINER)
        ensure -- from TRANSACTION_CONTAINER
            does_not_stop: not error_stops

    reset_error
            -- Reset error flags.

    stop_on_error
            -- Error stops action.
            -- (from TRANSACTION_CONTAINER)
        ensure -- from TRANSACTION_CONTAINER
            stop: error_stops

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    select_transaction (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from TRANSACTION_CONTAINER
            not_empty: not is_empty
            index_in_range: 1 <= n and n <= count
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from TRANSACTION_CONTAINER
            selected: index = n

    search (v: like transaction)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, transaction)
            item_found: (not exhausted and not object_comparison) implies v = transaction

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    add_transaction (t: TRANSACTION)
            -- Add transaction.
            -- (from TRANSACTION_CONTAINER)
        require -- from TRANSACTION_CONTAINER
            transaction_exists: t /= void
            transaction_correct: t.is_correct
        ensure -- from TRANSACTION_CONTAINER
            one_more_item: count = old count + 1
            index_unchanged: not old is_empty implies index = old index

    append (s: SEQUENCE [TRANSACTION])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like transaction)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [TRANSACTION])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like transaction)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like transaction)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: transaction = v

feature -- Removal

    prune (v: like transaction)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like transaction)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [TRANSACTION]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

feature -- Basic operations

    execute
            -- Execute transaction.
        require -- from TRANSACTION
            correct_transaction: is_correct

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [TRANSACTION]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [TRANSACTION]]; test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRANSACTION_CONTAINER
    empty_definition: is_empty = (count = 0)
    index_in_range: not is_empty implies (1 <= index and index <= count)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (transaction = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class MULTIPLE_TRANSACTION


SINGLE_TRANSACTION Chart

class
    SINGLE_TRANSACTION

General
    cluster: net.transfer.transactions
    description: "Transactions consisting out of a single transfer"
    create: make

Ancestors
    TRANSACTION

Queries
    Count: INTEGER
    error: BOOLEAN
    is_correct: BOOLEAN
    source: DATA_RESOURCE
    succeeded: BOOLEAN
    target: DATA_RESOURCE

Commands
    execute
    reset_error


SINGLE_TRANSACTION Flat contracts

indexing
    description: "Transactions consisting out of a single transfer"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    SINGLE_TRANSACTION

create

    make (s, t: DATA_RESOURCE)
            -- Create transaction.
        require
            source_exists: s /= void
            target_exists: t /= void
        ensure
            source_set: source = s
            target_set: target = t
            read_mode_set: source.read_mode
            write_mode_set: target.write_mode

feature -- Access

    source: DATA_RESOURCE
            -- Current source

    target: DATA_RESOURCE
            -- Current target

feature -- Measurement

    Count: INTEGER is 1
            -- Number of transactions (Always 1)

feature -- Status report

    error: BOOLEAN
            -- Has an error occurred in current transaction?
            -- (from TRANSACTION)

    is_correct: BOOLEAN
            -- Is transaction set up correctly?

    succeeded: BOOLEAN
            -- Has the transaction succeeded?

feature -- Status setting

    reset_error
            -- Reset error flags.

feature -- Basic operations

    execute
            -- Execute transaction.
        require -- from TRANSACTION
            correct_transaction: is_correct

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SINGLE_TRANSACTION


TRANSACTION_CONTAINER Chart

deferred class
    TRANSACTION_CONTAINER [G -> TRANSACTION]

General
    cluster: net.transfer.transactions
    description: "Container for transactions"

Ancestors
    SEQUENCE [G]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    error_stops: BOOLEAN
    exhausted: BOOLEAN
    extendible: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    insertable (t: G): BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: G): BOOLEAN
    item: G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: G): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    transaction: G
    writable: BOOLEAN

Commands
    add_transaction (t: G)
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    continue_on_error
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    remove
    replace (v: G)
    search (v: [like item] G)
    select_transaction (n: INTEGER)
    start
    stop_on_error
    wipe_out

Constraints
    empty definition
    index in range


TRANSACTION_CONTAINER Flat contracts

indexing
    description: "Container for transactions"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TRANSACTION_CONTAINER [G -> TRANSACTION]

feature -- Access

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Current index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: G
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    off: BOOLEAN
            -- Is there no current item?
            -- (from BILINEAR)

    transaction: G
            -- Current transaction

feature -- Measurement

    count: INTEGER
            -- Number of transactions

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    error_stops: BOOLEAN
            -- Is transfer stopped on error?

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    insertable (t: G): BOOLEAN
            -- Can transaction t be inserted in container?
        require
            transaction_exists: t /= void

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    continue_on_error
            -- Error does not stop action.
        ensure
            does_not_stop: not error_stops

    select_transaction (n: INTEGER)
            -- Select n-th transaction.
        require
            not_empty: not is_empty
            index_in_range: 1 <= n and n <= count
        ensure
            selected: index = n

    stop_on_error
            -- Error stops action.
        ensure
            stop: error_stops

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from BILINEAR)
        require -- from BILINEAR
            not_before: not before

    before: BOOLEAN
            -- Is there no valid position to the left of current one?
            -- (from BILINEAR)

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Element change

    add_transaction (t: G)
            -- Add transaction.
        require
            transaction_exists: t /= void
            transaction_correct: t.is_correct
        ensure
            one_more_item: count = old count + 1
            index_unchanged: not old is_empty implies index = old index

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: G)
            -- Add a new occurrence of v.
            -- (from BAG)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    replace (v: G)
            -- Replace current item by v.
            -- (from ACTIVE)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove the first occurrence of v if any.
            -- If no such occurrence go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    remove
            -- Remove current item.
            -- (from ACTIVE)
        require -- from ACTIVE
            prunable: prunable
            writable: writable

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    empty_definition: is_empty = (count = 0)
    index_in_range: not is_empty implies (1 <= index and index <= count)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

end -- class TRANSACTION_CONTAINER


TRANSACTION Chart

deferred class
    TRANSACTION

General
    cluster: net.transfer.transactions
    description: "Data transactions"

Ancestors
    ANY

Queries
    count: INTEGER
    error: BOOLEAN
    is_correct: BOOLEAN
    source: DATA_RESOURCE
    succeeded: BOOLEAN
    target: DATA_RESOURCE

Commands
    execute
    reset_error


TRANSACTION Flat contracts

indexing
    description: "Data transactions"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TRANSACTION

feature -- Access

    source: DATA_RESOURCE
            -- Current source

    target: DATA_RESOURCE
            -- Current target

feature -- Measurement

    count: INTEGER
            -- Number of transactions

feature -- Status report

    error: BOOLEAN
            -- Has an error occurred in current transaction?

    is_correct: BOOLEAN
            -- Is transaction set up correctly?

    succeeded: BOOLEAN
            -- Has the transaction succeeded?

feature -- Status setting

    reset_error
            -- Reset error flag.

feature -- Basic operations

    execute
            -- Execute transaction.
        require
            correct_transaction: is_correct

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TRANSACTION


TRANSFER_MANAGER_BUILDER Chart

class
    TRANSFER_MANAGER_BUILDER

General
    cluster: net.transfer.transactions
    description: "Singleton instance of the transfer manager builder"

Ancestors
    ANY

Queries
    Transfer_manager_builder: TRANSFER_MANAGER_BUILDER_IMPL


TRANSFER_MANAGER_BUILDER Flat contracts

indexing
    description: "Singleton instance of the transfer manager builder"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    TRANSFER_MANAGER_BUILDER

feature -- Access

    transfer_manager_builder: TRANSFER_MANAGER_BUILDER_IMPL
            -- Transfer manager builder singleton

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TRANSFER_MANAGER_BUILDER


TRANSFER_MANAGER_BUILDER_IMPL Chart

class
    TRANSFER_MANAGER_BUILDER_IMPL

General
    cluster: net.transfer.transactions
    description: "Implementation of transfer manager builder"
    create: make

Ancestors
    DATA_RESOURCE_FACTORY
    HOST_VALIDITY_CHECKER

Queries
    count: INTEGER
    error: BOOLEAN
    error_reason: STRING
    host_ok (h: STRING): BOOLEAN
    is_address_correct (addr: STRING; mode: INTEGER): BOOLEAN
    is_empty: BOOLEAN
    is_mode_valid (mode: INTEGER): BOOLEAN
    last_added_source_correct: BOOLEAN
    last_added_target_correct: BOOLEAN
    manager: TRANSFER_MANAGER
    manager_built: BOOLEAN
    transaction (n: INTEGER): TRANSACTION
    transfer_finished: BOOLEAN
    transfer_succeeded: BOOLEAN

Commands
    add_transaction (s, t: STRING)
    build_manager
    remove_transaction (n: INTEGER)
    reset_proxies
    reset_source_proxy
    reset_target_proxy
    set_proxies (host: STRING; port: INTEGER)
    set_source_proxy (host: STRING; port: INTEGER)
    set_target_proxy (host: STRING; port: INTEGER)
    set_timeout (s: INTEGER)
    transfer
    wipe_out

Constraints
    readable set exists
    writable set exists
    resource hash
    success constraint
    count equality


TRANSFER_MANAGER_BUILDER_IMPL Flat contracts

indexing
    description: "Implementation of transfer manager builder"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    TRANSFER_MANAGER_BUILDER_IMPL

create

    make
            -- Create transfer manager builder.

feature -- Access

    manager: TRANSFER_MANAGER
            -- The built manager
        require
            built: manager_built

    transaction (n: INTEGER): TRANSACTION
            -- n-th transaction
        require
            not_empty: not is_empty
            index_in_range: 1 <= n and n <= count
        ensure
            result_exists: Result /= void

feature -- Measurement

    count: INTEGER
            -- Number of transactions in builder

feature -- Status report

    error: BOOLEAN
            -- Has an error occurred?

    error_reason: STRING
            -- Reason of most recent error
        require
            error_occurred: error
        ensure
            non_empty_string: Result /= void and then not Result.is_empty

    host_ok (h: STRING): BOOLEAN
            -- Is h a valid host?
            -- (from HOST_VALIDITY_CHECKER)

    is_address_correct (addr: STRING; mode: INTEGER): BOOLEAN
            -- Is address addr correct considering mode?
            -- (mode is Readable or Writable)
        require
            non_empty_address: addr /= void and then not addr.is_empty
            mode_valid: is_mode_valid (mode)

    is_empty: BOOLEAN
            -- No transaction stored in builder?

    is_mode_valid (mode: INTEGER): BOOLEAN
            -- Is mode valid?

    last_added_source_correct: BOOLEAN
            -- Is source address of the most recent transaction addition
            -- correct?

    last_added_target_correct: BOOLEAN
            -- Is target address of the most recent transaction addition
            -- correct?

    manager_built: BOOLEAN
            -- Has manager been built?

    transfer_finished: BOOLEAN
            -- Has a transfer occurred?

    transfer_succeeded: BOOLEAN
            -- Has the last transfer succeeded?

feature -- Status setting

    reset_proxies
            -- Reset source and target proxy.
        ensure
            no_source_proxy_set: source_proxy = void
            no_target_proxy_set: target_proxy = void

    reset_source_proxy
            -- Reset source proxy.
        ensure
            no_source_proxy_set: source_proxy = void

    reset_target_proxy
            -- Reset target proxy.
        ensure
            no_target_proxy_set: target_proxy = void

    set_proxies (host: STRING; port: INTEGER)
            -- Set source and target proxy host to host and
            -- port to port.
        require
            host_not_empty: host /= void and then not host.is_empty
            port_non_negative: port >= 0
        ensure
            source_proxy_exists: source_proxy /= void
            host_set: source_proxy.host = host
            port_set: source_proxy.port = port
            proxies_equal: source_proxy = target_proxy

    set_source_proxy (host: STRING; port: INTEGER)
            -- Set source proxy host to host and port to port.
        require
            host_not_empty: host /= void and then not host.is_empty
            port_non_negative: port >= 0
        ensure
            source_proxy_exists: source_proxy /= void
            host_set: source_proxy.host = host
            port_set: source_proxy.port = port

    set_target_proxy (host: STRING; port: INTEGER)
            -- Set target proxy host to host and port to port.
        require
            host_not_empty: host /= void and then not host.is_empty
            port_non_negative: port >= 0
        ensure
            target_proxy_exists: target_proxy /= void
            host_set: target_proxy.host = host
            port_set: target_proxy.port = port

    set_timeout (s: INTEGER)
            -- Set timeout to s seconds.
            -- (This feature must be called *before* adding transactions in
            -- order to affect the added transactions.)
        require
            non_negative: s >= 0
        ensure
            timeout_set: timeout = s

feature -- Element change

    add_transaction (s, t: STRING)
            -- Add transaction from source s to target t.
        require
            source_exists: s /= void
            target_exists: t /= void
        ensure
            one_more_transaction_if_correct: (last_added_source_correct and last_added_target_correct) implies count = old count + 1

feature -- Removal

    remove_transaction (n: INTEGER)
            -- Remove n-th transaction.
        require
            not_empty: not is_empty
            index_in_range: 1 <= n and n <= count
        ensure
            one_less_item: count = count - 1
            index_unchanged: (old transactions.index < old count) implies (transactions.index = old transactions.index)
            index_adapted: (old transactions.index = old count) implies (transactions.index = old transactions.index - 1)

    wipe_out
            -- Clear manager.
        ensure
            empty: is_empty
            no_optimized_transactions: optimized_transactions = void
            no_manager: not manager_built

feature -- Basic operations

    build_manager
            -- Build manager.
        require
            not_empty: not is_empty
        ensure
            manager_ready: manager_built

    transfer
            -- Start transfer.
        require
            manager_built: manager_built
        ensure
            transfer_finished: transfer_finished

invariant

    readable_set_exists: readable_set /= void
    writable_set_exists: writable_set /= void
    resource_hash: resource_hash /= void
    success_constraint: transfer_succeeded implies transfer_finished
    count_equality: (optimized_count > 0) implies (count = optimized_count)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TRANSFER_MANAGER_BUILDER_IMPL


TRANSFER_MANAGER Chart

class
    TRANSFER_MANAGER

General
    cluster: net.transfer.transactions
    description: "Managers that control the data transactions"
    create: make

Ancestors
    ARRAYED_LIST [G]
    DATA_RESOURCE_ERROR_CONSTANTS
    TRANSACTION_CONTAINER [G -> TRANSACTION]

Queries
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    error: BOOLEAN
    error_reason: STRING
    error_stops: BOOLEAN
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    finished_transactions: INTEGER
    for_all (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: [like item] TRANSACTION): BOOLEAN
    index: INTEGER
    index_of (v: [like item] TRANSACTION; i: INTEGER): INTEGER
    insertable (t: TRANSACTION): BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] TRANSFER_MANAGER): BOOLEAN
    is_inserted (v: TRANSACTION): BOOLEAN
    linear_representation: LINEAR [TRANSACTION]
    object_comparison: BOOLEAN
    occurrences (v: [like item] TRANSACTION): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    source: DATA_RESOURCE
    target: DATA_RESOURCE
    there_exists (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
    total_count: INTEGER
    transaction: [like first] TRANSACTION
    transactions_succeeded: BOOLEAN
    transfer_finished: BOOLEAN
    writable: BOOLEAN

Commands
    add_transaction (t: TRANSACTION)
    append (s: SEQUENCE [TRANSACTION])
    back
    compare_objects
    compare_references
    continue_on_error
    copy (other: [like Current] TRANSFER_MANAGER)
    do_all (action: PROCEDURE [ANY, TUPLE [TRANSACTION]])
    do_if (action: PROCEDURE [ANY, TUPLE [TRANSACTION]]; test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN])
    execute_transaction
    extend (v: [like item] TRANSACTION)
    fill (other: CONTAINER [TRANSACTION])
    finish
    force (v: [like item] TRANSACTION)
    forth
    prune (v: [like item] TRANSACTION)
    prune_all (v: [like item] TRANSACTION)
    put (v: [like item] TRANSACTION)
    remove
    remove_transaction (n: INTEGER)
    replace (v: [like first] TRANSACTION)
    reset_status
    search (v: [like item] TRANSACTION)
    select_transaction (i: INTEGER)
    start
    stop_on_error
    transfer
    wipe_out

Constraints
    finished transaction range


TRANSFER_MANAGER Flat contracts

indexing
    description: "Managers that control the data transactions"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    TRANSFER_MANAGER

create

    make
            -- Create manager.

feature -- Access

    has (v: like transaction): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like transaction; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    transaction: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from  TRANSACTION_CONTAINER
            True
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    source: DATA_RESOURCE
            -- Selected source

    target: DATA_RESOURCE
            -- Selected target

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    finished_transactions: INTEGER
            -- Number of already finished transactions

    occurrences (v: like transaction): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like transaction): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    total_count: INTEGER
            -- Total number of transactions
        ensure
            index_unchanged: index = old index

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    error: BOOLEAN
            -- Has an error occurred in any transaction?
        require
            not_empty: not is_empty

    error_reason: STRING
            -- Reason of most recent error
        require
            error_exists: error
        ensure
            non_empty_string: Result /= void and then not Result.is_empty
            index_unchanged: index = old index

    error_stops: BOOLEAN
            -- Is transfer stopped on error?
            -- (from TRANSACTION_CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    insertable (t: TRANSACTION): BOOLEAN
            -- Can transaction t be added?
        require -- from TRANSACTION_CONTAINER
            transaction_exists: t /= void

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: TRANSACTION): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    transactions_succeeded: BOOLEAN
            -- Have all transactions succeeded?
        require
            not_empty: not is_empty

    transfer_finished: BOOLEAN
            -- Has a transfer taken place?

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    continue_on_error
            -- Error does not stop action.
            -- (from TRANSACTION_CONTAINER)
        ensure -- from TRANSACTION_CONTAINER
            does_not_stop: not error_stops

    reset_status
            -- Reset status flags.
        ensure
            finished_flag_reset: not transfer_finished
            no_error: not error

    stop_on_error
            -- Error stops action.
            -- (from TRANSACTION_CONTAINER)
        ensure -- from TRANSACTION_CONTAINER
            stop: error_stops

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    select_transaction (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        require -- from TRANSACTION_CONTAINER
            not_empty: not is_empty
            index_in_range: 1 <= n and n <= count
        ensure -- from CHAIN
            position_expected: index = i
        ensure -- from TRANSACTION_CONTAINER
            selected: index = n

    search (v: like transaction)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, transaction)
            item_found: (not exhausted and not object_comparison) implies v = transaction

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    add_transaction (t: TRANSACTION)
            -- Add transaction.
            -- (from TRANSACTION_CONTAINER)
        require -- from TRANSACTION_CONTAINER
            transaction_exists: t /= void
            transaction_correct: t.is_correct
        ensure -- from TRANSACTION_CONTAINER
            one_more_item: count = old count + 1
            index_unchanged: not old is_empty implies index = old index

    append (s: SEQUENCE [TRANSACTION])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like transaction)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [TRANSACTION])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like transaction)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like transaction)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: transaction = v

feature -- Removal

    prune (v: like transaction)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like transaction)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_transaction (n: INTEGER)
            -- Remove n-th transaction.
        require
            not_empty: not is_empty
            index_in_range: 1 <= n and n <= count
        ensure
            one_less_item: count = count - 1
            index_unchanged: (old index < old count) implies (index = old index)
            index_adapted: (old index = old count) implies (index = old index - 1)

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [TRANSACTION]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

feature -- Basic operations

    execute_transaction
            -- Execute selected transaction.
        ensure
            counter_updated: not transaction.error implies finished_transactions = old finished_transactions + transaction.count

    transfer
            -- Transfer file.
        require
            not_empty: not is_empty
            flags_reset: not (transfer_finished and transactions_succeeded)
        ensure
            transfer_flag_set: transfer_finished

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [TRANSACTION]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [TRANSACTION]]; test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [TRANSACTION], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

    finished_transaction_range: 0 <= finished_transactions and finished_transactions <= total_count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from TRANSACTION_CONTAINER
    empty_definition: is_empty = (count = 0)
    index_in_range: not is_empty implies (1 <= index and index <= count)
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (transaction = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class TRANSFER_MANAGER


EiffelNet Samples

Description

Version: 5.0

Availability: Basic Package.

Here is a set of five examples written thanks to the EiffelNet library to show some basic applications. Two of them rely on specific code to Unix Operating systems and consequently could not be run under Windows.

  • Advanced: for Unix Operating systems.
  • Polling
  • Predef
  • Same mach: for Unix Operating systems.
  • Two mach


Advanced

The Advanced Sample

Compiling

To compile the example, you must compile to projects: chat and join.

To compile the chat project:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\advanced\chat\.
  • Select Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

To compile the join project:

  • Launch EiffelBench.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\advanced\join\.
  • Select Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

Under the Hood


Polling

The Polling Sample

Compiling

To compile the example, you must compile to projects: client and server.

To compile the client project:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\polling\client\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

To compile the server project:

  • Launch EiffelBench.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\polling\server\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

Under the Hood


Predef

The Predef Sample

Compiling

To compile the example, you must compile to projects: client and server.

To compile the client project:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\predef\client\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

To compile the server project:

  • Launch EiffelBench.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\predef\server\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

Under the Hood


Same Mach

The Same Mach Sample

Compiling

To compile the example, you must compile to projects: client and server.

To compile the client project:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\polling\client\.
  • Select Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

To compile the server project:

  • Launch EiffelBench.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\polling\server\.
  • Select Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

Under the Hood


Two Mach

The Two Mach Sample

Compiling

To compile the example, you must compile to projects: client and server.

To compile the client project:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\two_mach\client\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

To compile the server project:

  • Launch EiffelBench.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\net\two_mach\server\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

Under the Hood


EiffelStore

Type: Library
Platform: Any
Version: 5.0

See:

  • Introduction
  • Content
  • Samples
  • Reference


EiffelStore Introduction

Overview

EiffelStore provides facilities for interfacing an application with various DataBase Management Systems (DBMS). It contains a powerful set of classes grouped into layers representing different levels of abstraction.

Layers Organization

  • The interface layer provides a high-level, unique interface for every DBMS.
  • The implementation layer customizes high-level routines to various DBMS handles.


EiffelStore Content

EiffelStore library content

EiffelStore main classes are grouped into 2 main layers:

  • The interface layer provides a high-level, unique interface for every DBMS.
  • The implementation layer customizes high-level routines to various DBMS handles.

Other cluster can facilitate your database management:

  • The generation cluster, with the EiffelStore wizard, generates a facilitated and dynamic interface with your database.
  • The dataview cluster lets you create a customized database GUI.


EiffelStore Interface Layer

The Interface Layer

The Interface layer gathers a set of classes covering all the capabilities an application need to interface efficiently with a DBMS.

The interface affords these main capabilities:

  • Connecting to the database.
  • Modifying database objects.
  • Selecting data from the database.
  • Accessing data selected from the database.
  • Coupling database objects with Eiffel objects.
  • Binding variables in a database query.
  • Using stored procedures.
  • Dealing with database status and behavior.

Note: In general, each of these capabilities corresponds to one EiffelStore class.

See Also
The implementation layer


Database Connection

Connecting to your database

  1. To connect to your database, you have to create a handle: this handle actually link the interface classes with corresponding implementation classes mapped to your DBMS. This handle is implemented by the DATABASE_APPL class:
       database_appl: DATABASE_APPL [ODBC]
             -- Database handle.
       ...
       create database_appl.login (a_name, a_psswd)
       database_appl.set_base

    Note: Notice the call of set_base that enables to link EiffelStore interface to this specific handle.

    Tip: You can manage handles to many databases: as an instance of DATABASE_APPL stands for a specific database handle, you only have to create one instance of DATABASE_APPL for every DBMS handle you wish to create. Do not forget to call set_base to activate appropriate handle.

    Note: The generic parameter of DATABASE_APPL specifies the actual DBMS used.

  2. Once your handle is created, you have to create a session manager which will allow you to manage your database, specifically to establish connection, disconnect and also handle errors. The class DB_CONTROL enables your application to plainly control the functioning and status of your database and to request any information about it.
       session_control: DB_CONTROL
             -- Session control.
       ...
       create session_control.make
       session_control.connect

    Note: Take a look at the database control part to see how to use DB_CONTROL capabilities.

See Also
Database control and error handling
Implementation


Data Modification

Updating your database content

Use the DB_CHANGE class to perform any operation on your database that does not require access to a result. You can for instance modify table row content, drop table rows, create and delete tables.

Note: Take a look at the Data Storing capability if you want to insert table rows.

DB_CHANGE allows you to modify the database data using the SQL language:

  • Prepare your SQL query and use modify:
       modification: DB_CHANGE
             -- Modification tool.
       ...
       create modification.make
       modification.modify("Update CONTACTS set Firstname = 'John'")

  • Commit your changes with your session control:
       session_control: DB_CONTROL
             -- Session control.
       ...
       session_control.commit

    Tip: It is always better to check the database status for errors before committing changes.

See Also
Data storing
Stored procedures
Implementation


Database Selection

Selecting data from the database

Use the DB_SELECTION class to select data from the database. Once you have selected the data, you can access it with convenience using adaptative EiffelStore structures.

Note: Take a look at the Database/Eiffel objects Coupling if you need information about your database structure.

DB_SELECTION enables your application to get database content using SQL 'select' queries:

  • You can carry out 'select' queries in an intuitive way using directly the SQL language:
       selection: DB_SELECTION
       ...
       create selection.make
       selection.set_query ("select * from CONTACTS where firstname = 'John'")
       selection.execute

    Tip: Always check the database status for errors after your 'select' query.

  • You can also customize your selection using bind variables.

See Also
Binding variables in a database query.
Coupling database objects with Eiffel objects.
Accessing selected data from the database.


Selection Access

Accessing selected data from the database

Once you have selected data from the database, it returns a set of rows containing queried columns values. Each row loaded with DB_SELECTION is stored in a DB_RESULT object. The easiest way to access the data is thus to refer to DB_RESULT objects themselves.

Note: Take a look at the Database/Eiffel objects Coupling to learn advanced data handling features.

To use DB_RESULT, process in 2 steps:

  • retrieve DB_RESULT objects.
  • access DB_RESULT content.

Retrieving DB_RESULT objects

DB_SELECTION class provides different ways to customize result loading:

  • You want to access an unique row: DB_RESULT object is accessible via cursor:
       selection: DB_SELECTION
       my_result: DB_RESULT
       ...
       selection.query ("...")
       if selection.is_ok then
           selection.load_result
           my_result := selection.cursor
       end

  • You want to load a complete list of rows: DB_SELECTION can store DB_RESULT objects in a list. To do this, you have mainly to provide a LIST object to DB_SELECTION with set_container:
       selection: DB_SELECTION
       container: ARRAYED_LIST [DB_RESULT]
       create container.make (Max_results)
       ...
       selection.set_container (container)
       ...
       from
           container.start
       until
           container.after
       loop
           ...
       end

    Tip: Provide DB_SELECTION with the LIST structure convenient for what you need to do with the results.

  • You want to select part of the result set: you can set an action in DB_SELECTION that will be executed each time a row is loaded. This action can for instance manipulate current row and define a stop condition.
    • You need to define a descendant of class ACTION and set it to DB_SELECTION:
      class MY_ACTION
      inherit
         ACTION
            redefine
                execute, found
            end
      ...
      execute is
         do
             i := i + 1
         end
      ...
      found: BOOLEAN is
         do
            Result := i >= Max_result
         end

    • Then set action to DB_SELECTION:
         selection: DB_SELECTION
         action: MY_ACTION
         ...
         selection.set_action (action)
         selection.query ("...")
         if selection.is_ok then
            selection.load_result
         end

Accessing content of DB_RESULT

A DB_RESULT object merely carries data retrieved from the database. You have to convert it to a DB_TUPLE to access data within the retrieved row conveniently, i.e. mostly the column values:
   selection: DB_SELECTION
   tuple: DB_TUPLE
   ...
   create tuple
   tuple.copy (selection.cursor)
   if tuple.count >= 2 and then tuple.column_name (2).is_equal ("Firstname") then
      io.putstring (tuple.item (2).out)
   end

See Also
Performing a database selection.
Coupling database data and Eiffel objects.


Data Object Coupling

Coupling database data with Eiffel objects

A smart way to work with relational databases is to have Eiffel objects directly mapping relational tables. 3 EiffelStore main capabilities enable this coupling:

  • DB_REPOSITORY objects describe a relational table and enable to create Eiffel objects mapping database tables.
  • DB_STORE enables to insert data into relational tables using directly DB_REPOSITORY objects.
  • DB_SELECTION can map a database query result into Eiffel objects.

Describing relational tables with DB_REPOSITORY

A DB_REPOSITORY object stores available information about a table. To access this information, you mainly have to give the table name and load the table description:

   repository: DB_REPOSITORY
   ...
   create repository.make ("CONTACTS")
   repository.load
   if repository.exists then
      ...
   end

Tip: Loading a table description is often a costly operation: table has to be fetched among existing tables then every table column description must be loaded. Hence it is better to store and reuse a repository (maybe with a HASH_TABLE) once it has been loaded.

Using the table information, DB_REPOSITORY then helps generating Eiffel classes mapping relational tables:

  • You can directly use {DB_REPOSITORY}.generate_class. Generated class may look like:
       class CONTACTS

       feature -- Access

       id: INTEGER
       ...
       feature -- Settings

       set_id (an_id: INTEGER) is
             -- Set an_id to id.
          do
             id := an_id
          end
       ...

    Note: The EiffelStore Wizard uses the generation.generator cluster to generate the classes mapped to your database.

Inserting data in the database

DB_STORE lets you easily insert rows into a table using:

  • the table description provided by DB_REPOSITORY.
  • a class mapping the relational table.
This is straight-forward since you only have to give DB_STORE the object filled with the table values. Suppose you want to add a contact into your database:

   storage: DB_STORE
   contacts_rep: DB_REPOSITORY
   a_contact: CONTACTS
   ...
   create storage.make
      -- contacts_rep is loaded and exists.
   storage.set_repository (contacts_rep)
      -- a_contact carries values to insert into the database.
   storage.put (a_contact)

Accessing database content with Eiffel objects

DB_SELECTION lets you map data retrieved from the database into Eiffel objects: Result column names must match object attributes names so you can use for instance classes created by DB_REPOSITORY. Class DB_ACTION redefines ACTION and can be used to retrieve Eiffel objects directly into an ARRAYED_LIST:

   selection: DB_SELECTION
   list_filling: DB_ACTION [CONTACTS]
   contact: CONTACTS
   ...
   selection.object_convert (contact)
   create list_filling.make (selection, contact)
   selection.set_action (list_filling)
   ...
   selection.load_result
   if selection.is_ok then
      Result := list_filling.list
   end

Note: You can see how actions are used in DB_SELECTION.

See Also
Performing a database selection.
Database-specific structures use.


Query variables

Binding variables in a database query

If you have to execute database queries which only differ in the expression values, you can create a template query and then bind variables into this template for each execution.

This mechanism can be applied for requests with a result (DB_SELECTION) or without (DB_CHANGE). Hence both classes inherits from STRING_HDL that actually handle variable binding.

To use variable binding:

  • Create a template query.
  • Bind variables to the query.

Creating a template query

Template queries are parsed to replace each variable by its bound value. To create a template query, you have hence to put directly variables where the values would take place.

Variables syntax is simple: the ':' special character followed by the variable name.

   selection: DB_SELECTION
   Bind_var: STRING is "firstname"
   ...
   create selection.make
   selection.set_query ("Select * from CONTACTS where Firstname = ':" + Bind_var + "'")

Note: The code example shows how to bind variables to a DB_SELECTION object but the mechanism is exactly the same for DB_CHANGE objects.

Binding variables to a query

Once you have created your query, you can map variable names to values and execute the query:

   selection: DB_SELECTION
   Bind_var: STRING is "firstname"
   ...
   loop
      io.read_line
      selection.set_map_name (io.laststring, Bind_var)
      selection.execute_query
      ...
      selection.unset_map_name (Bind_var)
   end

See Also
Performing a database selection.
Modifying database content.


Stored Procedures

Using stored procedures

When sending requests to the database, the request is first parsed then executed. Instead of parsing many times the same requests, i.e. with only changes in expression values, most of RDBMS enable to precompile requests. These requests can then be executed as routines and are identified by a name and a signature.

EiffelStore lets you use stored procedures with DB_PROC class to:

  • Execute a stored procedure.
  • Create a stored procedure.

Executing a stored procedure

To execute a stored procedure:

  • Create a DB_PROC object and load the stored procedure you want to use:
       procedure: DB_PROC
       ...
       create procedure.make ("UPDATE")
       procedure.load
       if procedure.exists then
          ...
       end

  • Execute the procedure through a DB_SELECTION (if a result is expected) or a DB_CHANGE object (otherwise).

    Note: Requests with a result (DB_SELECTION) or without (DB_CHANGE) are both abstract expressions. DB_PROC executes an abstract expression using an object of DB_EXPRESSION type, which corresponds to an abstract expression. DB_SELECTION and DB_CHANGE inherits from DB_EXPRESSION.

    You can execute your request mostly like a basic one:

    • Create your request.
    • Bind request variables. Variables are stored procedure arguments.

      Note: Take a look at how to bind variables to a query.

    • Execute the query through the DB_PROC object.
         procedure: DB_PROC
         expr: DB_CHANGE
         ...
         procedure.execute (expr)
         expr.clear_all

    • Check for errors and load result if any.

Creating a stored procedure

DB_PROC also enables you to create or drop stored procedures:

  • Use store to create a procedure.
  • Use drop to delete one.
The following example shows how to overwrite a procedure in the database:

   procedure: DB_PROC

   ...
   create procedure.make ("NEW_PROCEDURE")
   procedure.load
   if procedure.exists then
      procedure.drop
   end
   procedure.load
   if not procedure.exists then
      procedure.set_arguments (<<"one_arg">>, <<"">>)
      procedure.store ("update contacts set firstname = one_arg where contactid = 1")
   end

See Also
Performing a database selection.
Coupling database data and Eiffel objects.


Database control

Handling database status and behavior

Use the DB_CONTROL class to check or change database status and behavior. The main operations you are likely to use are:

  • Handling database errors.
  • Connecting to the database.
  • Committing changes in the database.

Handling database errors

Every EiffelStore interface class has an is_ok feature. This enables to check directly if the last database operation has been successful.

When an error is detected, you can access through DB_CONTROL further information about the error:

  • error_message provides a description of the error that occurred.
  • error_code returns a code corresponding to the error type. This code enables to handle specific errors within your code without parsing the error_message.
  • warning_message provides a warning message about the last transaction performed.

Once you have handled your error, for instance by displaying the error_message on screen, you can call reset to perform new database transactions.

Managing database connection

DB_CONTROL lets you connect, check connection and disconnect from the database.

The following example sum up these capabilities:

   session_control: DB_CONTROL
   ...
   session_control.connect
   if session_control.is_connected then
      -- Perform your transactions here.
      session_control.disconnect
   end

Committing changes in the database

Every modification you do in the database are usually not directly saved. This enables to limit damage caused by mishandlings. You can then manage database modification through 2 commands:

  • Commit saves the changes in the database.
  • Rollback restores the database content corresponding to last commitment.

The following example illustrates the use of these commands:

   session_control: DB_CONTROL
   ...
   from
   until
      transaction_completed or else not session_control.is_ok
   loop
      -- Perform your transaction here.
   end
   if session_control.is_ok then
      session_control.commit
   else
      session_control.rollback
   end

The loop performs a multi-step transaction. If transaction is not carried out entirely, the database could stay in an invalid state: this code ensures that database remains in a valid state.

Caution: Some databases can be in an auto-commit mode. Furthermore, some special database commands can automatically commit database changes.

See Also
Database connection
Implementation


EiffelStore Implementation Layer

The Implementation Layer

Each interface class has an implementation counterpart that implements specific DBMS handling. The class prefix indicates clearly its layer, for instance:

  • DB_SELECTION is the interface to perform a database selection query.
  • DATABASE_SELECTION [DATABASE] is its implementation.

The abstract DATABASE class represents a DBMS, i.e. it is the Eiffel-side database call interface. It is inherited for instance by the instantiable ORACLE and ODBC classes.

EiffelStore enables to link common interface objects with database-specific implementation objects using a handle. This handle also enables to switch between different databases.

Let us see in 4 steps how EiffelStore implements this handle system:

  • The active database handle.
  • The association between interface and implementation objects.
  • The access to the DBMS call interface from the implementation layer.
  • The active database selection from the database application.

The active database handle

The HANDLE_USE class provides access to the unique HANDLE instance. This object stores all the information about the active database, mainly:

  • Database login information:
       login: LOGIN [DATABASE]
             -- Session login

  • Database status information:
       status: DB_STATUS
             -- Status of active database

Association between interface and implementation

The association between an interface object and its implementation counterpart is done at the interface object creation.

Every interface class inherits from the HANDLE_USE class and can access the active database handle. This handle contains a DB [DATABASE] object that provides implementation objects corresponding to every interface objects.

The creation procedure for a DB_CHANGE object is for instance:

make is
         -- Create an interface object to change active base.
   do
      implementation := handle.database.db_change
      create ht.make (name_table_size)
      implementation.set_ht (ht)
   end

Access to the DBMS call interface

Every implementation class can access the active database call interface by inheriting from the HANDLE_SPEC [DATABASE] class. This class provides access to the DATABASE object, i.e. an instance of class ORACLE or ODBC.

DATABASE descendants are actually wrappers for the DBMS call interfaces written in C. More precisely, call interfaces as delivered by the DBMS companies are called in an EiffelStore C library. The C libraries are then wrapped into Eiffel classes, DATABASE descendants.

Active database selection

As seen in the interface connection part, active database selection is performed by the {DATABASE_APPL}.set_base feature: when a DATABASE_APPL object calls set_base, database represented by this object is activated.

Let us give some details about the set_base feature:

  • Database call interface global reference is updated through {HANDLE_SPEC}.update_handle.
  • All information about the database is set to the handle, mainly:
    • Login information.
    • Status information.

    Note: When database is inactive, its information is stored in the DATABASE_APPL object.

The corresponding code looks like:

session_status: DB_STATUS
      -- A session management object reference.
...
set_base is
   ...
   update_handle
   if session_status = Void then
      create session_status.make
   end
   handle.set_status (session_status)
   ...

See Also
The interface layer


EiffelStore Generation Cluster

The EiffelStore library lets the user associate database elements with Eiffel objects. These database elements are basically database table rows, database view rows or more generally sets of database attribute values. The easiest way to manipulate database elements is to insert their content into Eiffel objects and to work on these Eiffel objects as database elements.

A first solution to implement this is to use some adaptable structures that will fit to any database element. This is done in EiffelStore through the DB_TUPLE class, which contains mainly an ARRAY [STRING] containing element attribute names and an ARRAY [ANY] containing element attribute values. This solution has one major drawback: any static checking is impossible: the developer cannot be sure at compile time of the nature of a DB_TUPLE, i.e. what it represents, and cannot know if attributes number, names and types are correct. To overcome this problem, a second solution is to use data structures that statically fits to the expected database element, as introduced in the Data Object Coupling section.

The major problem of this technique is that structures are static: one structure, so one class instead of one object, should be created for each database element.


Data structures use

1. Overview

EiffelStore affords a context that optimizes and facilitates the use of the classes that maps your database content.

The main advantage of database-specific structures is the static checking: you can determine at compile-time the type of information you are accessing or modifying.

However, it can be more flexible to determine the type of data you are dealing with at run-time. This can be particularly useful for GUI applications, take a look at the DataView cluster.

Each data structure carries some meta-data about its type so that the run-time typing hazards can be avoided with assertions based on this meta-data.

The advantage of this system is two-fold:

  • You can choose to use compile-time type checking or not, depending on your own needs.

  • If you choose run-time type checking, assertions ensure that each object type is valid and prevent catcalls.

Let us see first what you can do with data structures and their context, then how it is implemented.

2. Data structure capabilities

Database-specific classes and their context let you perform the following operations:

  • Storing table/view rows content

  • Manipulating abstract table/view rows content

  • Getting objects metadata

  • Accessing database metadata

  • More interesting features

2.1. Storing table/view rows content

You can store table/view rows content into classes that have the table or view name: one database table/view row correspond to one Eiffel object. Each table attribute will correspond to a class attribute with the same name. set commands enable to change the object content to insert rows in the database or update rows. DB_SELECTION class can directly map database results into these objects, and you can directly create a table/view row from one object with the DB_STORE class. Take a look at the data-object coupling section.

[Note on the types and default values]

2.2. Manipulating abstract table/view rows content

Each table/view storage structure inherits from the DB_TABLE abstract class. This enables to handle DB_TABLE objects as abstract database table/view structures.

You can then access or modify DB_TABLE attributes: instead of accessing attributes with their name, which implies that the object type is known at compile-time, attributes can then be accessed with a code.

tablerow: DB_TABLE
...
display_attribute (code: INTEGER) is
        -- Display attribute with `code'.
    do
        io.putstring (tablerow.table_description.attribute (code).out)
    end

Note: to access attributes data with code, you need to use the DB_TABLE_DESCRIPTION object associated to your DB_TABLE object.

2.3. Getting objects metadata

While manipulating DB_TABLE objects, you can easily get:

  • Which database table/view the object references.

  • What are the types of its attributes.

Note: you also get objects metadata through the DB_TABLE_DESCRIPTION object associated to your DB_TABLE object.

Objects metadata used in assertions ensures objects type validity. To illustrates this, let's look at the contract form of a class that manipulates "abstract" table/view rows:

set_table_code (code: INTEGER)
        -- Assign `code' to `tablecode'.

tablecode: INTEGER
        -- Table code.

compute (tablerow: DB_TABLE)
        -- Compute `tablerow'.
    require
        type_is_ok: tablerow.table_description.Table_code = tablecode

2.4. Accessing database metadata

Basic database metadata is also available: the DB_SPECIFIC_TABLES_ACCESS_USE class (generated), stores INTEGER codes for each database table/view. These codes afford related table/view name and related new storing objects (i.e. that conforms to DB_TABLE class).

tables: DB_SPECIFIC_TABLES_ACCESS
...
 new_object (code: INTEGER): DB_TABLE is
        -- New object of table with `code'.
    do
        Result := tables.obj (code)
    end

2.5. More interesting features

The DB_TABLE_DESCRIPTION class offers more features to get table row attributes as conveniently as possible:

  • The table/view row primary key value (ID)

  • The list of table/view row attributes

  • A selection of table/view row attributes

  • The list of table/view row attributes mapped to a function.

  • Printable attribute values (i.e. the associated STRING values)

3. Implementation

Database-specific classes can be divided into 3 types:

  • Classes holding database table rows content (inheriting from DB_TABLE)

  • Classes describing database tables (inheriting from DB_TABLE_DESCRIPTION)

  • A class describing the database and giving access to the previous types of classes (inheriting from DB_TABLES_ACCESS)

One database table is hence associated to one table class and one description class. Both classes are closely interrelated to provide what the developer need. The table access classes describes the database tables and gives access to both table and description classes.

Each database-specific (generated) class inherits from an abstract class. These abstract classes gathers all the facilities that are not specific to your database, and so that can be inherited by all the database-specific classes.

Let us see abstract and database-specific classes relationship:

General and generated classes relationships

  • Yellow classes are abstract.

  • Green classes are database-specific.

2. Table and description classes relationship

Table classes, that inherit from DB_TABLE, and description classes, that inherit from DB_TABLE_DESCRIPTION, both deals with database tables. This section explains what are their own role and their relationship.

2.1. Table classes

As seen in the previous section, table classes merely store table rows attribute values. Their objects can be considered as database table rows, or more precisely, database table rows on the Eiffel side. These classes inherit from DB_TABLE.

Each of these classes are associated to a description class.

Tip: Use table classes to carry data.

2.2. Description classes

The description classes goal is 3-fold:

  • Getting meta-data about the table represented at run-time.

  • Getting table rows data dynamically.

  • Facilitating data management.

These descriptions inherit from DB_TABLE_DESCRIPTION.

Since they only describes a table and provide tools, description objects can be unique. EiffelStore ensures their unicity for resources optimization.

Tip: Use description classes to access and modify data.

2.3. Relationship

Each table class is associated to the description class corresponding to the same database table.

A table class object provides the associated table description:

row: DB_TABLE
description: DB_TABLE_DESCRIPTION
...
row := db_manager.database_result
description := row.table_description

As descriptions are unique, every table row object is associated to the same description. The following figure illustrates this:

table and description objects relationship

As seen in the previous section, to manipulate abstract table/view rows content, you have to use the description class. The following example shows how to output a table row ID value.

row: DB_TABLE
description: DB_TABLE_DESCRIPTION
...
    -- Link description unique object to `row' content.
description := row.table_description
io.putstring (description.attribute (description.id_name) + ": ")
io.putstring (description.attribute (description.id_code).out)

As descriptions are unique, this means that description objects are also associated to a specific table object to deal with it (i.e. access or modify its content). Actually, the table_description feature associates the description with the current object and then returns this description.

Note: The table_description feature is still a query as the association part should not be visible at the interface level.

On the whole, you have to pay attention to always execute table_description on your table/view row to get the appropriate description.

3. Table access classes

3.1. Overview

Table access classes provide facilities to manage table row and table description objects. They also give basic database table meta-data.

The following figure shows table access classes and their relations.

  • Yellow classes are EiffelStore classes

  • Green class is generated

  • Pink class is an application class

Table access classes BON diagram

Relationship between the tables access object, description and table objects

3.2. DB_SPECIFIC_TABLES_ACCESS class

The DB_SPECIFIC_TABLES_ACCESS class stores the unique table description object. It also provides the following facilities:

  • Every database table code

  • Table descriptions from a table code

  • Sample table class objects from a table code

  • Table names from a table code

Note: database table codes given in the class match the table codes provided by DB_TABLE_DESCRIPTION.

3.3. Abstract access class

The DB_TABLES_ACCESS class provides an interface for the DB_SPECIFIC_TABLES_ACCESS class which is non-specific to the database. This can be used by non database-specific code (for instance the DataView cluster) to access database tables.

Unique table description objects and table codes are of course not directly available from this class, but the following features are still available:

  • Table descriptions from a table code

  • Sample table class objects from a table code

  • Table names from a table code

3.4. Use classes

The DB_SPECIFIC_TABLES_ACCESS object can be accessed as a kind of "global variable" by any class which inherits from DB_SPECIFIC_TABLES_ACCESS_USE. This class also ensures DB_SPECIFIC_TABLES_ACCESS object unicity.

The DB_TABLES_ACCESS_USE class affords the same possibility but with no reference to the DB_SPECIFIC_TABLES_ACCESS object. The unique DB_SPECIFIC_TABLES_ACCESS should be set to this class as of type DB_TABLES_ACCESS.


Data structures creation

1. Overview

EiffelStore enables to create data structures mapped to your own database. This part describes how the EiffelStore wizard generates these structures mapped to your database and how you can map your own classes to your database with EiffelStore.

Tip: We recommend that you read what are and how to use these data structures before reading this section.

The EiffelStore wizard generates the database-specific classes from an EiffelStore generation system based on template files containing tags.

Let us see first how the EiffelStore generation system works. Let us see then how the EiffelStore wizard uses this system for the data structures generation.

2. EiffelStore generation system

This part describes the class creation in 4 steps:

  • Mapping system possibilities

  • General mapping system

  • Tags description

  • Implementation overview

2.1. Capabilities

Let us see first what information you can map into your classes.

2 kinds of classes can be generated:

  • Classes that represents a database table.

  • Classes that represents the whole database.

2.1.1. Database table classes

You can insert information about a database table:

  • The table name

  • The number of attributes of table

You can also select a piece of code, map it to a table attribute and repeat the operation for every attribute. Information that can be inserted is:

  • The attribute names

  • The attribute types

  • The attribute default creation values

  • The attribute positions in the table

Thus you can get for instance class attributes that correspond to database attributes:

class CONTACTS

feature

id: INTEGER

lastname: STRING

firstname: STRING

You can also modify the piece of code to map for the first and last attributes, for cosmetics reasons. You can also choose to only map a piece of code to attributes of a given type.

2.1.2. Database content classes

Database content classes can basically store the list of your database tables.

You can select a piece of code and map it to database table information:

  • Database table name.

  • Database table position in the database.

The mapped pieces of code are then concatenated in your file.

2.2. General mapping system

EiffelStore follows this sequence of steps to generate a class:

  1. You provide meta-data about the table or view

  2. You provide the template

  3. It parses the template to find the tags

  4. It replaces each tag by the meta-data value corresponding to the tag

Let us take an example:

template file extract | corresponding result file extract
attribute_count: <ACNT> | attribute_count: 5

This works for meta-data on the class or view. For meta-data on class (or view) attributes, a second tag type enables to specify text areas that are mapped to specific table (or view) attributes.

Let us take an example:

template file extract | corresponding result file extract
<A:A:A> <AN:L>: <TN:U> </A> | companyid: DOUBLE companyname: STRING

Text contained in the tag 'A' is mapped to each table (or view) attribute and the resulting texts are concatenated. Let us see now the details about each tag.

2.3. Tags description

2.3.1. Database table tags description

The available tags for database table classes generation can be separated into 3 types:

  • Tags corresponding to table meta-data

  • Tags corresponding to attribute meta-data

  • Tags to enclose attribute meta-data

2.3.1.1. Table meta-data tags
Tag name | Tag description | Options
 |  | Option name | Option description
<CN:?> | Table name | U | in uppercase
 |  | I | with initial capital
 |  | L | in lowercase
<ACNT> | Attribute count | N/A
2.3.1.2. Attribute meta-data tags
Tag name | Tag description | Options
 |  | Option name | Option description
<AN:?> | Attribute name | U | in uppercase
 |  | I | with initial capital
 |  | L | in lowercase
<IT> | Attribute position in the table | N/A
<TN:?> | Attribute type name | U | in uppercase
 |  | I | with initial capital
 |  | L | in lowercase
<TDV> | Attribute type default value | N/A

Note: Attribute tags are only valid within an enclosing tag.

2.3.1.3. Enclosing tags

The tag <A:?:?> </A> encloses text that will be mapped to attributes matching criteria. These criteria are specified by the tag options:

  • First option: attribute type criterion

    • Option name | Option description
A | All attributes
I | INTEGER attributes
S | STRING attributes
D | DATE attributes
B | BOOLEAN attributes
C | CHARACTER attributes
F | DOUBLE attributes

  • Second option: attribute position criterion

    • Option name | Option description
A | All attributes
F | First attribute
I | Intermediate attributes
L | Last attribute

    Note: this option is generally used to have a valid and nice layout or indentation.

Note: several options can be selected for one criterion.

2.3.2. Database content tags description

The tags described above can be reused for database content: database content class mapping is equivalent to the previous mapping but within a different scope:

  • class corresponds to the database rather than tables

  • class content deals with tables rather than table attributes

The meaning of available tags is so modified:

  • System meta-data tags

  • Table meta-data tags

  • Enclosing tags

Note: every tag is not available for this mapping.

2.3.2.1. System meta-data tags
Tag name | Tag description
<ACNT> | Table count
2.3.2.2. Table meta-data tags
Tag name | Tag description | Options
 |  | Option name | Option description
<CN:?> | Table name | U | in uppercase
 |  | I | with initial capital
 |  | L | in lowercase
<IT> | Table position in the database | N/A
2.3.2.3. Enclosing tags

The tag <A:A:?> </A> encloses text that will be mapped to tables matching a position criterion. This criterion is specified by the tag options:

Option name | Option description
A | All tables
F | First table
I | Intermediate tables
L | Last table

2.4. Implementation overview

The data structure generation system is implemented with 4 EiffelStore classes:

  • DB_CLASS_GENERATOR abstractly generates a class mapped to database meta-data.

  • DB_TABLE_CLASS_GENERATOR generates a class mapped to a database table.

  • DB_ACCESS_CLASS_GENERATOR generates a class mapped to the database.

  • DB_TEMPLATE_TAGS defines available tags for mapping and their meaning.

Generation classes BON diagram

3. EiffelStore wizard

The EiffelStore wizard uses the EiffelStore generation system described above to generate the data structures mapped to your database.

The wizard generates 3 types of classes:

  • Classes storing database table rows content

  • Classes describing a database table

  • A class describing the database and giving access to the previous types of classes

The wizard uses one different template for each class.

3.1. Table classes

For each selected database table, a class is created from the same template, mapping the database table. This template is:

indexing
    description: "Class which allows EiffelStore to retrieve/store%
    %the content of a table row from database table <CN:U>"
    author: "EiffelStore Wizard"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.5 $"

class
    <CN:U>

inherit
    DB_TABLE
        -- redefine
        -- out
        -- end
        undefine
            Tables,
            is_valid_code
        end

    DB_SPECIFIC_TABLES_ACCESS_USE

create
    make

feature -- Access

<A:A:A> <AN:L>: <TN:U>

</A> table_description: DB_TABLE_DESCRIPTION is
        -- Description associated to the <CN:L>.
    do
        tables.<CN:L>_description.set_<CN:L> (Current)
        Result := tables.<CN:L>_description
    end

feature -- Initialization

    set_default is
        do
            <A:A:A> <AN:L> := <TDV>
</A> end

feature -- Basic operations

<A:A:A> set_<AN:L> (a_<AN:L>: <TN:U>) is
        do
            <AN:L> := a_<AN:L>
        end

</A>feature -- Output

    out: STRING is
            -- Printable representation of current object.
        do
            Result := ""
<A:A:A>     if <AN:L> /= Void then
                Result.append ("<AN:I>: " + <AN:L>.out + "%N")
            end
</A>    end

end -- class CODES

Note: the template content can be adjusted, for instance to add comments or change the indexing. However, the fundamental template structure should not be changed to use data structures as described in the corresponding section.

3.2. Description classes

For each selected database table, a class is also created from an unique template, mapping the database table. This template is:

indexing
    description: "Description of class <CN:U>"
    author: "EiffelStore Wizard"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.5 $"

class
    <CN:U>_DESCRIPTION

inherit
    DB_TABLE_DESCRIPTION
        -- rename
        -- Tables as Abstract_tables
        undefine
            Tables,
            is_valid_code
        end

DB_SPECIFIC_TABLES_ACCESS_USE

create
    {DB_SPECIFIC_TABLES_ACCESS} make

feature -- Access

    Table_name: STRING is "<CN:U>"

    Table_code: INTEGER is <CI>

    Attribute_number: INTEGER is <ACNT>
            -- Number of attributes in the table.

    Id_code: INTEGER is
            -- Table ID attribute code.
        do
            Result := <IC>
        end

    <A:A:A> <AN:I>: INTEGER is <IT>

</A> attribute_code_list: ARRAYED_LIST [INTEGER] is
            -- Feature code list
        once
            create Result.make (Attribute_number)
            <A:A:A> Result.extend (<AN:I>)
</A> end

    description_list: ARRAYED_LIST [STRING] is
            -- Feature name list. Can be interpreted as a list
            -- or a hash-table.
        once
            create Result.make (Attribute_number)
            <A:A:A> Result.extend ("<AN:I>")
</A> end

    type_list: ARRAYED_LIST [INTEGER] is
            -- Feature type list. Can be interpreted as a list
            -- or a hash-table.
        once
            create Result.make (Attribute_number)
            <A:A:A> Result.extend (<TN:I>_type)
</A> end

    to_delete_fkey_from_table: HASH_TABLE [INTEGER, INTEGER] is
            -- List of tables depending on this one and their
            -- foreign key for this table.
            -- Deletion on this table may imply deletions on
            -- depending tables.
        once
            <DH> end

    to_create_fkey_from_table: HASH_TABLE [INTEGER, INTEGER] is
            -- List of associated necessary tables and the
            -- linking foreign keys.
            -- Creation on this table may imply creations on
            -- associated necessary tables.
        once
            <CH> end

    attribute (i: INTEGER): ANY is
            -- Get feature value of feature whose code is 'i'.
        do
            inspect i
<A:A:A>         when <AN:I> then
                    Result := <CN:L>.<AN:L>
</A>        end
        end

    set_attribute (i: INTEGER; value: ANY) is
            -- Set feature value of feature whose code is `i' to `value'.
            -- `value' must be of type STRING, INTEGER, BOOLEAN, CHARACTER,
            -- DOUBLE or DATE_TIME. References are made automatically from
            -- expanded types.
        local
            integer_value: INTEGER_REF
            double_value: DOUBLE_REF
            boolean_value: BOOLEAN_REF
            character_value: CHARACTER_REF
            date_time_value: DATE_TIME
            string_value: STRING
        do
            inspect i
<A:S:A>         when <AN:I> then
                    string_value ?= value
                    <CN:L>.set_<AN:L> (string_value)
</A><A:F:A>     when <AN:I> then
                    double_value ?= value
                    if double_value /= Void then
                        <CN:L>.set_<AN:L> (double_value.item)
                    else
                        <CN:L>.set_<AN:L> (0.0)
                    end
</A><A:I:A>     when <AN:I> then
                    integer_value ?= value
                    if integer_value /= Void then
                        <CN:L>.set_<AN:L> (integer_value.item)
                    else
                        <CN:L>.set_<AN:L> (0)
                    end
</A><A:D:A>     when <AN:I> then
                    date_time_value ?= value
                    <CN:L>.set_<AN:L> (date_time_value)
</A><A:C:A>     when <AN:I> then
                    character_value ?= value
                    if character_value /= Void then
                        <CN:L>.set_<AN:L> (character_value.item)
                    else
                        <CN:L>.set_<AN:L> ('%U')
                    end
</A><A:B:A>     when <AN:I> then
                    boolean_value ?= value
                    if boolean_value /= Void then
                        <CN:L>.set_<AN:L> (boolean_value.item)
                    else
                        <CN:L>.set_<AN:L> (False)
                    end
</A>         end
        end

feature {<CN:U>} -- Basic operations

    set_<CN:L> (a_<CN:L>: <CN:U>) is
            -- Associate the description to a piece of <CN:L>.
        require
            not_void: a_<CN:L> /= Void
        do
            <CN:L> := a_<CN:L>
        ensure
            <CN:L> = a_<CN:L>
        end

feature {NONE} -- Implementation

    <CN:L>: <CN:U>
            -- Piece of <CN:L> associated with the description

end -- class CODES_DESCRIPTION

Note: As for the table class generation, the template content can be adjusted, for instance to add comments or change the indexing. However, the fundamental template structure should not be changed.

Some additional tags are directly replaced by the wizard:

  • The <CR> and <DR> tags are replaced with information on associated tables.

  • The <IC> tag is replaced by information on the primary key (table ID).

  • The <CI> tag is replaced by the table position in the database.

2.3.3. Access class

The DB_SPECIFIC_TABLES_ACCESS class is mapped to the database from the following template:

indexing
    description: "Description of database tables.%
            %Use this class through DB_SPECIFIC_TABLES_ACCESS_USE."
    author: "EiffelStore Wizard"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.5 $"

class
    DB_SPECIFIC_TABLES_ACCESS

inherit
    DB_TABLES_ACCESS

creation
    make

feature -- Access

    <A:A:A> <CN:I>: INTEGER is <IT>

</A> Table_number: INTEGER is <ACNT>

    code_list: ARRAYED_LIST [INTEGER] is
            -- Table code list.
        once
            create Result.make (Table_number)
<A:A:A>     Result.extend (<CN:I>)
</A>    end

    name_list: ARRAYED_LIST [STRING] is
            -- Table name list. Can be interpreted as a list
            -- or a hash-table.
        once
            create Result.make (Table_number)
<A:A:A>     Result.extend ("<CN:I>")
</A>    end

    obj (i: INTEGER): DB_TABLE is
            -- Return instance of table with code `i'.
        do
            inspect i
<A:A:A>         when <CN:I> then
                    create {<CN:U>} Result.make
</A>        end
        end

    description (i: INTEGER): DB_TABLE_DESCRIPTION is
            -- Return description of table with code `i'.
        do
            inspect i
<A:A:A>         when <CN:I> then
                    Result := <CN:L>_description
</A>        end
        end

<A:A:A> <CN:L>_description: <CN:U>_DESCRIPTION is
            -- Unique description of table `<CN:U>'.
        once
            create Result.make
        end

</A>
end -- class DB_SPECIFIC_TABLES_ACCESS


EiffelStore DataView Cluster

1. Introduction

DataView cluster helps the programmer creating a GUI for a RDBMS. It gives a basic solution for a RDBMS GUI and also enables the developer to customize his GUI from this basic interface.

This cluster is client of EiffelStore to interface with a RDBMS and EiffelVision2 to create a GUI. However, the use of EiffelStore and EiffelVision2 is sufficiently encapsulated to let the programmer use other database/graphic libraries.

Notice finally that DataView is based on some common O-O design patterns. Knowing these patterns will help you understand how the library works. It can also give an example of patterns use.

2. Specifications

This part draws the main capabilities that can be expected from the DataView cluster. These capabilities are not exhaustive since the cluster architecture enables to add easily new capabilities to it.

2.1. Required database structure

The cluster has been designed to work well with relational databases on Third Normal Form. Database tables must also have an unique numeric ID.

  • The cluster automatically performs associations between related tables. This is required to work fine with 3rd NF architectures.
  • The unique ID enables to update the database content. If you only intend to display database table content, unique IDs are not required.
  • The numeric ID enables to directly give IDs to new table rows. If you don't intend to create table rows, this is not necessary. Notice that with only a couple of redefinitions, the numeric ID requirement problem can be overcome.

2.2. Database content display

The cluster provides facilities to:

  • display a set of table rows.
  • select a (current) table row in the set.
  • display the current table row so that it can be edited.

For instance, an interface can display a multi-column list of table rows. A given row can be selected in the list and its information can be then edited through a set of text fields and combo-boxes.

The standard cluster usage is to define a GUI that will associate a given frame/window to a given database table, that is, the information that is displayed in a GUI area will be determined at compile-time. This enables to adapt the GUI display to the type of information displayed, which is recommended when creating a GUI for non-developer users (or any people that should not be aware of the database structure and functioning). Nevertheless, determining the type of information displayed by a frame/window at runtime is still possible as not hard-coded.

Abstracting database in the GUI might not be as easy as only changing database attribute fields names. Information to display may not match the database tables structure. However, for consistency reasons, we can assume that the information to display within a GUI area belongs to a set of associated tables. The easiest solution is to create database views that directly contain the information to display on the GUI area. This implies though that the database has to be modified for the GUI needs.

DataView cluster affords a second solution:

  • Model-View separation enables to merge graphically information that is separated in the process part (i.e. that is from a different table).
  • Table associations facilities enable to specify to display automatically content of table rows associated to a given table row. For instance, with a CONTACTS table associated to a COMPANIES table, the cluster can retrieve automatically a COMPANIES table row associated to a selected CONTACTS table row.

2.3. Actions performed on the database

The cluster provides facilities for the following actions:

  • Creating a table row
  • Deleting a table row
  • Updating the content of a table row
  • Selecting a set of table rows

Other capabilities can be added to these ones, for instance by writing descendants of DataView cluster classes that would handle more database operations.

Operations relative to the database structure modification, for instance creating a database table, may be more difficult to add since the database structure is hard-coded. But these advanced capabilities might not be necessary in a GUI for non-developer users.

3. General description

3.1. Global architecture

The DataView cluster is based on 1 class called DV_TABLE_COMPONENT that represents the interface for 1 relational database table. An architecture using DataView is centered on database table structure rather than the GUI structure. The basic idea is to have:

  • 1 database relational table
  • 1 GUI window or frame
  • 1 DV_TABLE_COMPONENT object

This is then possible to adapt the code to have a GUI meeting the specifications, database structure can be totally abstracted in the interface, which might be more convenient for non-developer GUI users.

3.2. Library structure

The cluster can be separated into 3 main parts:

  • The model: processes the information and interfaces with an abstract graphic interface (the handle) and an abstract database interface.
  • The handle: defines an abstract graphic interface for the model.
  • The view: implements the handle interface with EiffelVision2 widgets.

The abstract database interface is defined in the EiffelStore generation.tables_access cluster. This cluster can indeed been used independently from the DataView cluster.

3.3. Model cluster structure

The model cluster processes the information retrieved from the GUI and the database and update then both GUI and database.

The cluster is based on the DV_TABLE_COMPONENT class which objects represents a database relational table (or view).

DV_TABLE_COMPONENT objects can be interconnected to match the table associations. The DV_TABLE_COMPONENT class has been designed to work with 3rd Normal Form relational databases. DV_TABLE_COMPONENT achieves most of the work to retrieve associated table rows for a 3NF database. For instance, when deleting a table row, the component ensures that every associated table row is also deleted.

DV_TABLE_COMPONENT objects can be customized by adding some subcomponents to it. Subcomponents enable to display table rows content on screen, to navigate among table rows and to perform different database queries.

Process objects structure for a GUI

3.4. Design patterns

This cluster adapts several well-known O-O design patterns.

3.4.1. Model-View separation pattern

The GUI appearance is totally abstracted in the GUI processing part, this enables to change the GUI display without changing any part of the model part. This is implemented with 2 sets of classes:

  • A set of interfaces that corresponds to each type of abstract widgets needed by the model.
  • A set of classes that implements these interfaces. Notice that an implementation class can implement several interfaces and several classes can implement the same interface.

Let's see an example through a BON diagram:

Model-View separation pattern implementation in DataView

  • Light blue classes represents the model cluster.

  • Orange class represents the handle.

  • Yellow and green classes represents the view cluster.

  • Pink classes represents the EiffelVision2 library.

3.4.2. Strategy pattern

DataView cluster provides the developer with a basic GUI implementation AND lets them customize their application. This is possible with a strategy pattern:

The developer assigns different subcomponents to a DV_TABLE_COMPONENT object to define its behavior. The component object only uses the interface of each subcomponent.

A default implementation is written for each interface to let the user use the cluster as quick as possible. To adapt components behavior to their needs, the developer can then create a new subcomponent class inheriting from the abstract interface.

This BON diagram illustrates this for DV_CREATOR and DV_SEARCHER subcomponents:

Strategy pattern used in DataView model cluster

4. Cluster interface

This part describes how to use the table component class and its subcomponents classes:

  • The DV_SEARCHER class to select table rows from the database.

  • The DV_TABLEROW_NAVIGATOR class to navigate among selected table rows.

  • The DV_CREATOR class to create new table rows in the database.

  • The DV_TABLEROW_FIELDS class to edit a table row content.

4.1. DV_TABLE_COMPONENT class

This class is responsible for the management of a database table. Its behavior is determined by its assigned subcomponents.

To create a valid and functional DV_TABLE_COMPONENT object, follow these steps:

  1. Call set_tablecode to specify which table the component will deal with.
  2. Specify handlers to output messages.
  3. Set the database handler.
  4. Add different controllers corresponding to actions to perform.
  5. Set subcomponents.
  6. Set associated components.
  7. Call activate to let the component work. This will basically set different default values for non required information not set during the creation process.

The component can then be used on an interface:

  • Input interactions are done via component and subcomponents controllers (4).
  • Output interactions are done via output handlers (2).

4.1.1. Output handlers

Output handlers are specific to the DV_TABLE_COMPONENT object, that is, you can output messages in a different way within your GUI. However, the same handlers will be used for subcomponents.

3 handlers can be set:

  • `status_handler' to display status information
  • `warning_handler' to display warning information. Warnings usually correspond to database errors, they are called warnings because the database error is "caught" and the message should enable the user to round the problem.
  • `confirmation_handler' to ask for confirmation before an action.

These handlers have default values, which are:

  • For `status_handler' and `warning_handler', messages are displayed on standard output (with {ANY}.io.pustring)
  • For `confirmation_handler', action is executed without confirmation.

4.1.2. Database handler

This handler is specific to the application. It must inherit from ABSTRACT_DB_TABLE_MANAGER. Since it is specific to the program, it can be set before creating any DV_TABLE_COMPONENT object through {DV_DATABASE_HANDLER}.set_database_handler. The DB_TABLE_MANAGER class is the default database handler for EiffelStore.

4.1.3. Action controllers

No subcomponent is associated to 'write', 'refresh' and 'delete' actions since these actions does not require specific behavioral choices.

To perform 'write', 'refresh' and 'delete' at runtime, a controller is associated to each of these actions. This controller triggers the action when a determined user event is grabbed, for instance, when the user clicks a button.

Controllers are implemented by the abstract class DV_SENSITIVE_CONTROL of cluster user_interactions (handle).

4.1.4. Subcomponents

Subcomponents can be assigned to a table component to specify its behavior to create table rows, select table rows from the database and navigate among selected table rows. A special subcomponent enable to display the current table row, i.e. the table row that can be edited to update the database. The default behavior for these subcomponents is that the functionality is not available, that is, subcomponents are not mandatory.

These components share the table component output handlers. They are automatically activated when table component is activated.

4.1.5. Associated components

Table components can be associated to reflect relation of database tables represented. Associated table components are organized:

  • 1 master component enables to manually select database table rows.
  • Slave components automatically select table rows that are associated to the current table row of the master component.

Note: Notice that table associations can be nested.

2 types of associations are possible to reflect table relations:

  • The slave table is dependent on the master table (1:N relationship)
  • The slave table is necessary for the master table (N:1 relationship)

Let us see an example with 3 relational tables:

Tables architecture and corresponding component objects

The object architecture leads to a GUI where the user can select a company and see the company country information and contacts in this company.

Finally, notice that by default slave components have the same output handlers as their master and slave components are activated when the master component is.

4.2. DV_SEARCHER class

4.2.1. Overview

DV_SEARCHER is responsible for retrieving table rows from the database. Let us see how it interacts with a table component:

Basic relationship between table component class and search class

  • `display' assigns a set of table rows to the table component.
  • `refresh' asks to refresh the table rows from the same database query.

DV_SEARCHER component does not afford an extended interface. This interface is defined in its descendants. The implemented DV_SEARCHER descendants are:

  • DV_TYPED_SEARCHER performs different basic searches used by the cluster.
  • DV_INTERACTIVE_SEARCHER enables to create a graphic interface to let user set search parameters.

4.2.2. DV_TYPED_SEARCHER class

This class provides 3 types of searches:

  • "Every row" search: every rows of a table are fetched.
  • "ID selection" search: the selection is qualified by an ID.
  • "Qualified selection" search: the selection is qualified.
4.2.2.1. "Every row" search

Call read to set table rows on the associated table component.

4.2.2.2. "ID selection" search

Call read_from_tablerow to set table rows on the associated table component. Qualification ID is the ID of the table row in parameter. Table of row in parameter must be the table of rows to select.

This capability is used by DataView cluster in DV_CHOICE_CREATOR to select a just-created table row and display it on the table component.

4.2.2.3. "Qualified selection" search

Call read_from_tablerow to set table rows on the associated table component. Table of row in parameter may not be the table of rows to select.

To extract the qualifier, the search component needs additional information:

  • The location of the qualifying value in the table row passed in parameter (set_row_attribute_code)
  • The qualifying attribute location in the table rows to select (set_criterion)

This capability is used in DV_TABLE_COMPONENT when a table row is selected to set associated table rows to slave components. Take a look at add_necessary_table and add_dependent_table.

4.2.3. DV_INTERACTIVE_SEARCHER class

This class enables to create a graphic interface to let user perform basic searches. These searches are qualified by one table attribute. This interface has 5 parts:

  • A controller that enables to launch the search
  • A text input field to set qualifying attribute
  • A text input field to set qualifying value
  • A typed input field to set qualification type
  • A Boolean input field to set case sensitivity

Text input fields correspond to handle class DV_SENSITIVE_STRING, typed input fields corresponds to handle class DV_SENSITIVE_INTEGER and Boolean input fields corresponds to handle class DV_SENSITIVE_CHECK.

4.3. DV_TABLEROW_NAVIGATOR class

4.3.1. Overview

Table component class contains a set of table rows. This class lets table component class know which of these rows is the current one.

Basic relationship between table component class and navigation class

DV_CHOICE_CREATOR also uses the class to enable to select associated table rows when creating a new table row (for instance, when creating a company, an existing country should be selected). Let us see how this is designed:

DV_TABLEROWS_NAVIGATOR clients

Note: DV_TABLEROWS_COMPONENT class merely carries a set of table rows and enables to select one table row.

DV_CONTROL_NAVIGATOR affords a way to navigate among searched table rows.

4.3.2. DV_CONTROL_NAVIGATOR class

This class enables 2 navigation systems:

  • Navigating among table rows with "previous" and "next" controllers.
  • Navigating among table rows through a display list.

Tip: Notice that both systems can be used.

You can directly set controllers for "previous" and "next" actions. A 3rd controller, "edit list", enables to show or raise the display list.

Caution: Notice that DV_CONTROL_NAVIGATOR only manages this controller sensitivity.

You can assign a display list to the navigator with a DV_TABLEROW_LIST component.

4.4. DV_CREATOR class

4.4.1. Overview

This class enables to create database table rows.

Basic relationship between table component class and navigation class

DV_CREATOR class contains minimum information to interact with DV_TABLE_COMPONENT: when a table row is created, a creator component may display it on the table component. In this case, when the table component needs to refresh the table rows set, this refreshing action need to be managed by the creator component:

  • `set_just_created' informs a table component that displayed table row set comes from the creator component.
  • `refresh' lets the creation component refresh table component display.

Much of the work, that is row creation, is totally abstracted in DV_CREATOR. DV_CHOICE_CREATOR implements DV_CREATOR and thus affords a creation procedure.

4.4.2. DV_CHOICE_CREATOR class

4.4.2.1. Overview

This class creates a new table row and sets its key values:

  • Database handle gives the primary key value (ID) .
  • The class asks the user for foreign key values (for table associations) by displaying available values in a list.

DV_TABLEROW_NAVIGATOR is used to select a foreign key value, let us see how this is implemented:

DV_CHOICE_CREATOR suppliers for foreign keys selection

DV_TABLEROW_ID_PROVIDER inherits from DV_TABLEROWS_COMPONENT to interface with DV_TABLEROWS_NAVIGATOR.

Relation between DV_CHOICE_CREATOR and DV_TABLEROW_ID_PROVIDER is basically:

DV_CHOICE_CREATOR/DV_TABLEROW_ID_PROVIDER basic interactions

Creation process and DV_CHOICE_CREATOR objects creation procedure can help you use this class.

4.4.2.2. Creation process

Table row creation process is:

  1. Table row creation is triggered by a controller ("create")
  2. DV_CHOICE_CREATOR creates a table row object
  3. DV_CHOICE_CREATOR requests a first foreign key value to DV_TABLEROW_ID_PROVIDER (through `select_from_table')
  4. DV_TABLEROW_ID_PROVIDER loads the available table rows that can be referenced
  5. DV_TABLEROW_ID_PROVIDER assigns the table rows to DV_TABLEROWS_NAVIGATOR and pops up the interface with the table rows
  6. Table row selection is triggered by a controller ("ok")
  7. DV_TABLEROW_ID_PROVIDER retrieves the selected table row ID and gives it back to DV_CHOICE_CREATOR (through `add_foreign_key_value')
  8. DV_CHOICE_CREATOR requests other foreign key values to DV_TABLEROW_ID_PROVIDER
  9. DV_CHOICE_CREATOR creates the database row with a new ID through the database handle
4.4.2.3. Objects creation procedure

To create a DV_CHOICE_CREATOR, follow these steps:

  1. Create an object conforming to DV_TABLEROWS_NAVIGATOR
  2. Create a DV_TABLEROW_ID_PROVIDER object and assign the DV_TABLEROWS_NAVIGATOR object to it
  3. Set a controller to trigger foreign key selection
  4. Set the action to perform to pop up the interface to select the foreign key
  5. Create a DV_CHOICE_CREATOR object and assign the DV_TABLEROW_ID_PROVIDER object to it
  6. Set a controller to trigger table row creation

4.5. DV_TABLEROW_FIELDS class

4.5.1. Overview

This class enable to display and edit the current table row of a table component. Let us see first how it interacts with the table component:

DV_TABLE_COMPONENT/DV_TABLEROW_FIELDS basic interactions

  • refresh_tablerow refreshes display with a new table row

  • update_tablerow requests an updated table row for database update. Unchanged values are kept from a default table row

  • updated_tablerow is the last updated table row

The class contains a list of fields that represent editable table attributes. The design is simple:

Table row edition capability design

4.5.2. DV_TABLEROW_FIELD class

This class enables to edit a table row attribute value. The view is abstracted using the handle cluster DV_SENSITIVE_STRING class that represents the editable text value.

This class manages a field value but can also provide field name and type if graphic fields are provided. Notice that standard DV_TABLEROW_FIELD objects can be generated through the DV_FACTORY class, which is a component factory.

5. Handle cluster

This cluster provides the model with an interface to input or output data on the GUI. This enables to remove any link to a graphic implementation in the model, following the Model-View separation design pattern. The cluster contains a set of interface classes to design this:

  • The DV_SENSITIVE_CONTROL class to let the user trigger an action.
  • The DV_SENSITIVE_STRING class to input or output a text value.
  • The DV_SENSITIVE_INTEGER class to input or output a quantity value.
  • The DV_SENSITIVE_CHECK class to input or output a tag value.
  • The DV_TABLEROW_LIST class to display a set of table rows and grab events on it.

5.1. DV_SENSITIVE_CONTROL class

The DV_SENSITIVE_CONTROL class lets a model class trigger a specific action on a determined user event. Furthermore, the model class lets the user know when its state enables to trigger the action, by setting the controller sensitivity (i.e. if the controller is insensitive, the action cannot be triggered).

Note: sensitivity excepted, these controllers could have been implemented by Eiffel agents.

Note: sensitivity enables to let the user know before triggering an action if this is possible or not. The other possibility is to let the user know after trying to trigger the action that it was not possible (with a warning for instance): this is often less convenient.

The standard controllers are buttons or menu items: the specific action is triggered when button is clicked or menu item selected.

DV_SENSITIVE_CONTROL is inherited by DV_BUTTON that implements an EiffelVision2 button. Other implementations can be added, such as a menu item.

5.2. DV_SENSITIVE_STRING class

The DV_SENSITIVE_STRING class lets a model class input or output a text graphically. As for controllers, the model class lets the user know when a text value can be input by setting the widget sensitivity.

The standard graphical widgets to perform this are text fields, but several other widgets can be used:

  • A combo-box so that the interface can suggest different values.
  • A label if the text only need to be output.

Note: customized, specific widgets can be defined, you can for instance take a look at the DV_STRING_LIST class.

5.3. DV_SENSITIVE_INTEGER class

This class lets a model class input or output an INTEGER value graphically. As for controllers, the model class lets the user know when an integer value can be input by setting the widget sensitivity.

Different widgets can be used to implement this:

  • A text field. Notice that the value entered should be checked to ensure it is an INTEGER value.
  • A combo-box. Each combo-box option is associated to an integer.
  • A scroll button.

5.4. DV_SENSITIVE_CHECK class

This class lets a model class input or output a BOOLEAN value graphically. As for controllers, the model class lets the user know when a Boolean value can be input by setting the widget sensitivity.

The standard widget to implement this is a check box.

5.5. DV_TABLEROW_LIST class

The DV_TABLEROW_LIST class provides an interface to display a set of table rows so that the user can select a particular row.

  • The model can be informed of a row selection or deselection: the class accepts actions (implemented by agents) that are triggered when a row is selected or deselected.
  • The model can retrieve the currently selected row: the class yields the current index position in the list.

DV_TABLEROW_MULTILIST implements DV_TABLEROW_LIST with an EiffelVision2 multi-column list.

Note: This class is used for the standard implementation of DV_TABLEROW_NAVIGATOR to navigate among table rows selected from the database.


cluster eiffelstore

 Cluster
eiffelstore

Subclusters
eiffelstore.dataview
eiffelstore.dbms
eiffelstore.eiffel2rm
eiffelstore.generation
eiffelstore.install
eiffelstore.interface
eiffelstore.mapping
eiffelstore.precomp
eiffelstore.save
eiffelstore.spec
eiffelstore.support


cluster dataview

 Cluster
dataview

Subclusters
dataview.graphical
dataview.processing
dataview.user_interactions


cluster dataview.graphical

 Cluster
dataview.graphical

Supercluster
dataview

Classes
DV_BOX
DV_BUTTON
DV_CHECK_BUTTON
DV_COMBO_BOX
DV_FACTORY
DV_FRAME
DV_HORIZONTAL_BOX
DV_LABEL
DV_RADIO_BUTTON
DV_SELECTION_WINDOW
DV_STRING_LIST
DV_TABLEROW_MULTILIST
DV_TEXT
DV_TEXT_FIELD
DV_TITLED_WIDGET
DV_VERTICAL_BOX


DV_BOX Chart

 deferred class
DV_BOX

General
cluster: dataview.graphical
description: "Box container for display elements"

Ancestors
EV_BOX

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
infix " @ " (i: INTEGER ): [like item ] EV_WIDGET
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
after : BOOLEAN
background_color : EV_COLOR
before : BOOLEAN
border_width : INTEGER
client_height : INTEGER
client_width : INTEGER
count : INTEGER
cursor : EV_DYNAMIC_LIST_CURSOR [ EV_WIDGET ]
data : ANY
deny_cursor : EV_CURSOR
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] EV_WIDGET
for_all (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
foreground_color : EV_COLOR
Full : BOOLEAN
has (v: [like item ] EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
i_th (i: INTEGER ): EV_WIDGET
id_object (an_id: INTEGER ): IDENTIFIED
index : INTEGER
index_of (v: [like item ] EV_WIDGET ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_default_non_expand : BOOLEAN
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DV_BOX ): BOOLEAN
is_homogeneous : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_item_expanded (an_item: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : EV_WIDGET
last : [like item ] EV_WIDGET
linear_representation : LINEAR [ EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
occurrences (v: [like item ] EV_WIDGET ): INTEGER
off : BOOLEAN
padding : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
same (other: EV_ANY ): BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
sequential_occurrences (v: EV_WIDGET ): INTEGER
target_name : STRING
there_exists (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
append (s: SEQUENCE [ EV_WIDGET ])
back
center_pointer
copy (other: [like Current] DV_BOX )
default_create
destroy
disable_borders
disable_capture
disable_default_expand
disable_homogeneous
disable_item_expand (an_item: EV_WIDGET )
disable_padding
disable_pebble_positioning
disable_sensitive
dl_prune (v: [like item ] EV_WIDGET )
do_all (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]]; test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ])
enable_borders
enable_capture
enable_default_expand
enable_homogeneous
enable_item_expand (an_item: EV_WIDGET )
enable_padding
enable_pebble_positioning
enable_sensitive
extend (widget: EV_WIDGET )
extend_cell
extend_separator
fill (other: CONTAINER [ EV_WIDGET ])
finish
force (v: [like item ] EV_WIDGET )
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
hide
make
make_without_borders
merge_left (other: [like Current] DV_BOX )
merge_radio_button_groups (other: EV_CONTAINER )
merge_right (other: [like Current] DV_BOX )
move (i: INTEGER )
propagate_background_color
propagate_foreground_color
prune (v: [like item ] EV_WIDGET )
prune_all (v: [like item ] EV_WIDGET )
put (v: [like item ] EV_WIDGET )
put_front (v: [like item ] EV_WIDGET )
put_i_th (v: [like item ] EV_WIDGET ; i: INTEGER )
put_left (v: [like item ] EV_WIDGET )
put_right (v: [like item ] EV_WIDGET )
remove
remove_help_context
remove_left
remove_pebble
remove_right
replace (v: [like item ] EV_WIDGET )
search (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_border_width (value: INTEGER )
set_data (some_data: [like data ] ANY )
set_default
set_default_border_width (new_border_width: INTEGER )
set_default_colors
set_default_padding (new_padding: INTEGER )
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_padding (value: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
show
start
swap (i: INTEGER )
wipe_out


DV_BOX Flat contracts

 indexing
description: "Box container for display elements"
date: "$Date: 2001/11/13 00:01:51 $"
revision: "$Revision: 1.5 $"

deferred class interface
DV_BOX

feature -- Initialization

make
-- Initialize.

make_without_borders
-- Initialize.
-- Box has no borders: use this to have a nice display
-- when box is contained in another box.

set_default
-- Initialize default values

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

cursor : EV_DYNAMIC_LIST_CURSOR [ EV_WIDGET ]
-- Current cursor position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .cursor)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

first : like item
-- Item at first position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

i_th (i: INTEGER ): EV_WIDGET
-- Item at i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .i_th (i))

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

index : INTEGER
-- Current position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of ith occurence of v.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index_of (v, i)

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_DYNAMIC_LIST
a_list_not_void: a_list /= void
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Item at current position.
-- (from EV_DYNAMIC_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item
ensure then -- from EV_DYNAMIC_LIST
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .item)

last : like item
-- Item at last position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

sequential_occurrences (v: EV_WIDGET ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

count : INTEGER
-- Number of items.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .count

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
count_definition: Result. count = count

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Does other contain the same elements?
-- (from LIST )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from LIST
indices_unchanged: index = old index and other. index = old other. index
true_implies_same_size: Result implies count = other. count

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LIST )

border_width : INTEGER
-- Width of border around container in pixels.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .border_width
positive: Result >= 0

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from EV_DYNAMIC_LIST )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_default_non_expand : BOOLEAN
-- Can't elements be expanded by default?

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_homogeneous : BOOLEAN
-- Are all items forced to have same dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .is_homogeneous

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_item_expanded (an_item: EV_WIDGET ): BOOLEAN
-- Is an_item expanded to occupy available spare space?
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
bridge_ok: Result = implementation .is_item_expanded (an_item)

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

off : BOOLEAN
-- Is there no current item?
-- (from CHAIN )

padding : INTEGER
-- Space between children in pixels.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .padding
positive: Result >= 0

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from SEQUENCE )
require -- from ACTIVE
True
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
-- if it points to an item, Current must have it.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .valid_cursor (p)

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )
require -- from ACTIVE
True
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_borders
-- Display without borders.

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_default_expand
-- Disable default element displays expansion.
ensure
is_default_non_expand: is_default_non_expand

disable_homogeneous
-- Allow items to have different dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
not_is_homogeneous: not is_homogeneous

disable_item_expand (an_item: EV_WIDGET )
-- Do not expand an_item to occupy avalible spare space.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
not_an_item_expanded: not is_item_expanded (an_item)

disable_padding
-- Display without padding.

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_borders
-- Display with borders.

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_default_expand
-- Enable default element displays expansion.
ensure
is_default_expand: not is_default_non_expand

enable_homogeneous
-- Force all items to have same dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
is_homogeneous: is_homogeneous

enable_item_expand (an_item: EV_WIDGET )
-- Expand an_item to occupy avalible spare space.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
an_item_expanded: is_item_expanded (an_item)

enable_padding
-- Display with padding.

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_border_width (value: INTEGER )
-- Assign value to border_width .
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
positive_value: value >= 0
ensure -- from EV_BOX
border_width_assigned: border_width = value

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_padding (value: INTEGER )
-- Assign value to padding .
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
positive_value: value >= 0
ensure -- from EV_BOX
padding_assigned: padding = value

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Cursor movement

back
-- Move to previous position.
-- (from EV_DYNAMIC_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (No effect if empty)
-- (from CHAIN )
ensure then -- from CHAIN
at_last: not is_empty implies islast

forth
-- Move cursor to next position.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from EV_DYNAMIC_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions.
-- (from EV_DYNAMIC_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from EV_DYNAMIC_LIST
empty_implies_after: is_empty implies after

feature -- Element change

append (s: SEQUENCE [ EV_WIDGET ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count
ensure -- from EV_CONTAINER
has_v: has (v)

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count
ensure -- from EV_CONTAINER
has_v: has (v)

put_front (v: like item )
-- Add v at beginning. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_first: v = first
count_increased: count = old count + 1
cursor_not_moved: ( index = old index + 1) or ( before and old before )

put_i_th (v: like item ; i: INTEGER )
-- Replace item at i-th position by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
valid_index: i > 0 and i <= count
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = i_th (i)
not_has_old_item: not has (old i_th (i))
old_item_parent_void: (old i_th (i)). parent = void
count_same: count = old count
cursor_not_moved: index = old index

put_left (v: like item )
-- Add v to the left of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_before: not before
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index - 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index + 1

put_right (v: like item )
-- Add v to right of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_after: not after
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index + 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

replace (v: like item )
-- Replace current item by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_CONTAINER
has_v: has (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = item
not_has_old_item: not has (old item )
old_item_parent_void: (old item ). parent = void
count_same: count = old count
cursor_not_moved: index = old index

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

swap (i: INTEGER )
-- Exchange_item at i-th position with item
-- at cursor position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Removal

prune (v: like item )
-- Remove v if present. Do not move cursor, except if
-- cursor was on v, move to right neighbor.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable: prunable
ensure then -- from SET
removed_count_change: old has (v) implies ( count = old count - 1)
not_removed_no_count_change: not old has (v) implies ( count = old count )
item_deleted: not has (v)
ensure then -- from EV_DYNAMIC_LIST
not_has_v: not has (v)
had_item_implies_parent_void: old has (v) implies v. parent = void
had_item_implies_count_decreased: old has (v) implies count = old count - 1
had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

dl_prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item. Move cursor to right neighbor.
-- (or after if no right neighbor).
-- (from EV_DYNAMIC_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after
ensure then -- from EV_DYNAMIC_LIST
v_removed: not has (old item )
parent_void: (old item ). parent = void
count_decreased: count = old count - 1
index_same: index = old index

remove_left
-- Remove item to left of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1
ensure then -- from EV_DYNAMIC_LIST
left_neighbor_removed: not has (old i_th ( index - 1))
parent_void: (old i_th ( index - 1)). parent = void
index_decreased: index = old index - 1

remove_right
-- Remove item to right of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index
ensure then -- from EV_DYNAMIC_LIST
right_neighbor_removed: not has (old i_th ( index + 1))
parent_void: (old i_th ( index + 1)). parent = void
index_same: index = old index

wipe_out
-- Remove all items.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Conversion

linear_representation : LINEAR [ EV_WIDGET ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

extend (widget: EV_WIDGET )
-- Add widget to end of structure.
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_CONTAINER
has_v: has (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_last: v = last
count_increased: count = old count + 1
cursor_not_moved: ( index = old index ) or ( after and old after )

extend_cell
-- Add a cell, i.e. an empty display element,
-- to end of structure.

extend_separator
-- Add a non-expandable separator to end
-- of structure.

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

set_default_border_width (new_border_width: INTEGER )
-- Set new_border_width as default border width.

set_default_padding (new_padding: INTEGER )
-- Set new_padding as default padding.

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

same (other: EV_ANY ): BOOLEAN
-- Is other Current?
-- (from EV_DYNAMIC_LIST )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
-- Actions to be performed when a new item is added.
-- (from EV_CONTAINER_ACTION_SEQUENCES )
ensure -- from EV_CONTAINER_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]]; test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_BOX


DV_BUTTON Chart

 class
DV_BUTTON

General
cluster: dataview.graphical
description: "Display button."
create: make_with_text , make_with_text_and_action

Ancestors
DV_SENSITIVE_CONTROL
EV_BUTTON

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
select_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
data : ANY
deny_cursor : EV_CURSOR
foreground_color : EV_COLOR
has_capture : BOOLEAN
has_focus : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pixmap : EV_PIXMAP
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
screen_x : INTEGER
screen_y : INTEGER
target_name : STRING
text : STRING
tooltip : STRING
width : INTEGER
x_position : INTEGER
y_position : INTEGER

Commands
activate
add_action (action: PROCEDURE [ ANY , TUPLE ])
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] DV_BUTTON )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
hide
remove_help_context
remove_pebble
remove_pixmap
remove_text
remove_tooltip
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pixmap (a_pixmap: EV_PIXMAP )
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
set_tooltip (a_tooltip: STRING )
show


DV_BUTTON Flat contracts

 indexing
description: "Display button."
date: "$Date: 2001/07/14 02:09:16 $"
revision: "$Revision: 1.2 $"

class interface
DV_BUTTON

create

make_with_text (a_text: STRING )
-- Create Current and assign a_text to text
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_assigned: text . is_equal (a_text) and text /= a_text

make_with_text_and_action (a_text: STRING ; an_action: PROCEDURE [ ANY , TUPLE ])
-- Create with 'a_text' as text and an_action in select_actions .
-- (from EV_BUTTON )
require -- from EV_BUTTON
text_not_void: a_text /= void
an_action_not_void: an_action /= void
ensure -- from EV_BUTTON
text_assigned: text . is_equal (a_text)
select_actions_has_an_action: select_actions . has (an_action)

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pixmap : EV_PIXMAP
-- Image displayed on Current.
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PIXMAPABLE
bridge_ok: (Result = void and implementation .pixmap = void ) or Result. is_equal ( implementation .pixmap)

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

feature -- Measurement

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from DV_SENSITIVE_CONTROL
True
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from DV_SENSITIVE_CONTROL
True
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_pixmap
-- Make pixmap Void.
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PIXMAPABLE
pixmap_removed: pixmap = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pixmap (a_pixmap: EV_PIXMAP )
-- Assign a_pixmap to pixmap .
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
pixmap_not_void: a_pixmap /= void
ensure -- from EV_PIXMAPABLE
pixmap_assigned: a_pixmap. is_equal ( pixmap ) and pixmap /= a_pixmap

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

activate
-- Activate control.

add_action (action: PROCEDURE [ ANY , TUPLE ])
-- Set action to associated button action.

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

select_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when button is pressed then released.
-- (from EV_BUTTON_ACTION_SEQUENCES )
ensure -- from EV_BUTTON_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_BUTTON


DV_CHECK_BUTTON Chart

 class
DV_CHECK_BUTTON

General
cluster: dataview.graphical
description: "Check button."
create: make_with_text

Ancestors
DV_SENSITIVE_CHECK
EV_CHECK_BUTTON

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
select_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
checked : BOOLEAN
data : ANY
deny_cursor : EV_CURSOR
foreground_color : EV_COLOR
has_capture : BOOLEAN
has_focus : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_selectable : BOOLEAN
is_selected : BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pixmap : EV_PIXMAP
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
screen_x : INTEGER
screen_y : INTEGER
target_name : STRING
text : STRING
tooltip : STRING
width : INTEGER
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] DV_CHECK_BUTTON )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_select
disable_sensitive
enable_capture
enable_pebble_positioning
enable_select
enable_sensitive
hide
remove_help_context
remove_pebble
remove_pixmap
remove_text
remove_tooltip
request_insensitive
request_sensitive
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pixmap (a_pixmap: EV_PIXMAP )
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
set_tooltip (a_tooltip: STRING )
show
toggle


DV_CHECK_BUTTON Flat contracts

 indexing
description: "Check button."
date: "$Date: 2001/07/14 02:09:16 $"
revision: "$Revision: 1.2 $"

class interface
DV_CHECK_BUTTON

create

make_with_text (a_text: STRING )
-- Create Current and assign a_text to text
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_assigned: text . is_equal (a_text) and text /= a_text

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

checked : BOOLEAN
-- Boolean value held.

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pixmap : EV_PIXMAP
-- Image displayed on Current.
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PIXMAPABLE
bridge_ok: (Result = void and implementation .pixmap = void ) or Result. is_equal ( implementation .pixmap)

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

feature -- Measurement

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_selectable : BOOLEAN
-- May enable_select be called.
-- (from EV_SELECTABLE )
require -- from EV_SELECTABLE
not_destroyed: not is_destroyed

is_selected : BOOLEAN
-- Is selected.
-- (from EV_SELECTABLE )
require -- from EV_SELECTABLE
not_destroyed: not is_destroyed
ensure -- from EV_SELECTABLE
bridge_ok: Result = implementation .is_selected

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_select
-- Deselect the object.
-- (from EV_DESELECTABLE )
require -- from DV_SENSITIVE_CHECK
True
require -- from EV_DESELECTABLE
not_destroyed: not is_destroyed
ensure -- from EV_DESELECTABLE
unselected: not is_selected

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_select
-- Make is_selected True.
-- (from EV_SELECTABLE )
require -- from DV_SENSITIVE_CHECK
True
require -- from EV_SELECTABLE
not_destroyed: not is_destroyed
is_selectable: is_selectable
ensure -- from EV_SELECTABLE
is_selected: is_selected

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

toggle
-- Change is_selected .
-- (from EV_DESELECTABLE )
require -- from EV_DESELECTABLE
not_is_destroyed: not is_destroyed
can_be_selected: not is_selected implies is_selectable
ensure -- from EV_DESELECTABLE
is_selected_changed: is_selected /= old is_selected

feature -- Element change

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_pixmap
-- Make pixmap Void.
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PIXMAPABLE
pixmap_removed: pixmap = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pixmap (a_pixmap: EV_PIXMAP )
-- Assign a_pixmap to pixmap .
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
pixmap_not_void: a_pixmap /= void
ensure -- from EV_PIXMAPABLE
pixmap_assigned: a_pixmap. is_equal ( pixmap ) and pixmap /= a_pixmap

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

select_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when button is pressed then released.
-- (from EV_BUTTON_ACTION_SEQUENCES )
ensure -- from EV_BUTTON_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0
-- from EV_DESELECTABLE
not_selectable_therefore_not_selected: not is_selectable implies not is_selected

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_CHECK_BUTTON


DV_COMBO_BOX Chart

 class
DV_COMBO_BOX

General
cluster: dataview.graphical
description: "Typed combo box."
create: make_with_string_data , make_with_integer_data , make_with_boolean_data , make

Ancestors
DV_MESSAGES
DV_SENSITIVE_CHECK
DV_SENSITIVE_INTEGER
DV_SENSITIVE_STRING
EV_COMBO_BOX

Action sequences
change_actions : EV_NOTIFY_ACTION_SEQUENCE
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
deselect_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
return_actions : EV_NOTIFY_ACTION_SEQUENCE
select_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
infix " @ " (i: INTEGER ): [like item ] EV_LIST_ITEM
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
after : BOOLEAN
background_color : EV_COLOR
before : BOOLEAN
behavior_type : INTEGER
Boolean_data : INTEGER
capacity : INTEGER
caret_position : INTEGER
Changeable_comparison_criterion : BOOLEAN
checked : BOOLEAN
count : INTEGER
creation_confirmation (table_name: STRING ): STRING
creation_done (table_name: STRING ): STRING
cursor : EV_DYNAMIC_LIST_CURSOR [ EV_LIST_ITEM ]
data : ANY
deletion_confirmation (table_name: STRING ): STRING
deletion_done (table_name: STRING ): STRING
deny_cursor : EV_CURSOR
empty_combo_item_label : STRING
enter_field_value (type, name: STRING ): STRING
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] EV_LIST_ITEM
for_all (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
foreground_color : EV_COLOR
Full : BOOLEAN
has (v: [like item ] EV_LIST_ITEM ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_selection : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
i_th (i: INTEGER ): EV_LIST_ITEM
id_object (an_id: INTEGER ): IDENTIFIED
index : INTEGER
index_of (v: [like item ] EV_LIST_ITEM ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_data : INTEGER
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_editable : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DV_COMBO_BOX ): BOOLEAN
is_inserted (v: EV_LIST_ITEM ): BOOLEAN
is_locked : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : EV_LIST_ITEM
item_by_data (some_data: ANY ): [like item ] EV_LIST_ITEM
last : [like item ] EV_LIST_ITEM
linear_representation : LINEAR [ EV_LIST_ITEM ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
Normal : INTEGER
object_comparison : BOOLEAN
object_id : INTEGER
occurrences (v: [like item ] EV_LIST_ITEM ): INTEGER
off : BOOLEAN
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pixmaps_height : INTEGER
pixmaps_width : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
retrieve_field_value (type, name: STRING ): STRING
same (other: EV_ANY ): BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
selected_item : EV_LIST_ITEM
selected_text : STRING
selection_end : INTEGER
selection_start : INTEGER
selection_window_title (table_name: STRING ): STRING
sequential_occurrences (v: EV_LIST_ITEM ): INTEGER
String_data : INTEGER
string_value : STRING
strings : LINKED_LIST [ STRING ]
tablerows_selected (count: INTEGER ): STRING
target_name : STRING
text : STRING
text_length : INTEGER
there_exists (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
tooltip : STRING
type_not_recognized (name: STRING ): STRING
undetermined_table_name : STRING
update_done (table_name: STRING ): STRING
valid_behavior_type (behavior: INTEGER ): BOOLEAN
valid_caret_position (pos: INTEGER ): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_data_type (a_data: ANY ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
value : INTEGER
width : INTEGER
writable : BOOLEAN
wrong_date_format (name: STRING ): STRING
wrong_datetime_format (name: STRING ): STRING
x_position : INTEGER
y_position : INTEGER

Commands
add_choice (a_choice: STRING )
add_data_choice (a_data: ANY ; a_label: STRING )
append (s: SEQUENCE [ EV_LIST_ITEM ])
append_text (a_text: STRING )
back
center_pointer
compare_objects
compare_references
copy (other: [like Current] DV_COMBO_BOX )
copy_selection
cut_selection
default_create
delete_selection
deselect_all
destroy
disable_capture
disable_checked
disable_edit
disable_pebble_positioning
disable_sensitive
dl_prune (v: [like item ] EV_LIST_ITEM )
do_all (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]]; test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ])
enable_capture
enable_checked
enable_edit
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_LIST_ITEM )
fill (other: CONTAINER [ EV_LIST_ITEM ])
finish
force (v: [like item ] EV_LIST_ITEM )
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
hide
insert_text (a_text: STRING )
lock_sensitiveness
make
make_with_boolean_data
make_with_integer_data
make_with_string_data
merge_left (other: [like Current] DV_COMBO_BOX )
merge_right (other: [like Current] DV_COMBO_BOX )
move (i: INTEGER )
paste (a_position: INTEGER )
prepend_text (a_text: STRING )
prune (v: [like item ] EV_LIST_ITEM )
prune_all (v: [like item ] EV_LIST_ITEM )
put (v: [like item ] EV_LIST_ITEM )
put_front (v: [like item ] EV_LIST_ITEM )
put_i_th (v: [like item ] EV_LIST_ITEM ; i: INTEGER )
put_left (v: [like item ] EV_LIST_ITEM )
put_right (v: [like item ] EV_LIST_ITEM )
remove
remove_help_context
remove_left
remove_pebble
remove_right
remove_selection
remove_text
remove_tooltip
replace (v: [like item ] EV_LIST_ITEM )
request_insensitive
request_sensitive
search (v: [like item ] EV_LIST_ITEM )
select_all
select_region (start_pos, end_pos: INTEGER )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_capacity (a_capacity: INTEGER )
set_caret_position (a_caret_position: INTEGER )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_minimum_width_in_characters (nb: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pixmaps_size (a_width, a_height: INTEGER )
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_string_value (a_text: STRING )
set_strings (a_string_array: INDEXABLE [ STRING , INTEGER ])
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
set_tooltip (a_tooltip: STRING )
set_value (i: INTEGER )
show
start
swap (i: INTEGER )
unlock_sensitiveness
wipe_out


DV_COMBO_BOX Flat contracts

 indexing
description: "Typed combo box."
date: "$Date: 2001/07/14 02:09:16 $"
revision: "$Revision: 1.2 $"

class interface
DV_COMBO_BOX

create

make
-- Create display.
ensure
has_normal_behavior: behavior_type = normal

make_with_string_data
-- Create display. Combo box has a string data behavior:
-- only predefined string values can be set from the GUI.
ensure
has_string_data_behavior: behavior_type = string_data

make_with_integer_data
-- Create display. Combo box has a integer data behavior:
-- only predefined string values can be set from the GUI.
ensure
has_integer_data_behavior: behavior_type = integer_data

make_with_boolean_data
-- Create display. Combo box has a boolean data behavior:
-- only predefined string values can be set from the GUI.
ensure
has_boolean_data_behavior: behavior_type = boolean_data

feature -- Initialization

make
-- Create display.
ensure
has_normal_behavior: behavior_type = normal

make_with_boolean_data
-- Create display. Combo box has a boolean data behavior:
-- only predefined string values can be set from the GUI.
ensure
has_boolean_data_behavior: behavior_type = boolean_data

make_with_integer_data
-- Create display. Combo box has a integer data behavior:
-- only predefined string values can be set from the GUI.
ensure
has_integer_data_behavior: behavior_type = integer_data

make_with_string_data
-- Create display. Combo box has a string data behavior:
-- only predefined string values can be set from the GUI.
ensure
has_string_data_behavior: behavior_type = string_data

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

Boolean_data : INTEGER is 3
-- Combo box enable access to selected boolean data.

capacity : INTEGER
-- Number of characters field can hold.
-- (from EV_TEXT_FIELD )
require -- from EV_TEXT_FIELD
not_destroyed: not is_destroyed

checked : BOOLEAN
-- Boolean value held.

cursor : EV_DYNAMIC_LIST_CURSOR [ EV_LIST_ITEM ]
-- Current cursor position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .cursor)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

first : like item
-- Item at first position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

i_th (i: INTEGER ): EV_LIST_ITEM
-- Item at i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .i_th (i))

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

index : INTEGER
-- Current position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of ith occurence of v.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index_of (v, i)

Integer_data : INTEGER is 2
-- Combo box enable access to selected integer data.

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_DYNAMIC_LIST
a_list_not_void: a_list /= void
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_LIST_ITEM
-- Item at current position.
-- (from EV_DYNAMIC_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable
ensure then -- from EV_DYNAMIC_LIST
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .item)

item_by_data (some_data: ANY ): like item
-- First item with some_data.
-- (from EV_ITEM_LIST )
require -- from EV_ITEM_LIST
not_destroyed: not is_destroyed
data_not_void: some_data /= void
ensure -- from EV_ITEM_LIST
bridge_ok: Result = implementation .item_by_data (some_data)

last : like item
-- Item at last position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

Normal : INTEGER is 0
-- Combo box enable access to selected row label.

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

sequential_occurrences (v: EV_LIST_ITEM ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pixmaps_height : INTEGER
-- Height of pixmaps dispalyed in list.
-- (from EV_COMBO_BOX )
require -- from EV_COMBO_BOX
not_destroyed: not is_destroyed
ensure -- from EV_COMBO_BOX
bridge_ok: Result = implementation .pixmaps_height

pixmaps_width : INTEGER
-- Width of pixmaps displayed in list.
-- (from EV_COMBO_BOX )
require -- from EV_COMBO_BOX
not_destroyed: not is_destroyed
ensure -- from EV_COMBO_BOX
bridge_ok: Result = implementation .pixmaps_width

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

selected_item : EV_LIST_ITEM
-- Currently selected item.
-- Topmost selected item if multiple items are selected.
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
bridge_ok: Result = implementation .selected_item

selected_text : STRING
-- Currently selected text.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result. is_equal ( implementation .selected_text)

String_data : INTEGER is 1
-- Combo box enable access to selected string data.

string_value : STRING
-- Display string.

strings : LINKED_LIST [ STRING ]
-- Representation of Current.
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
not_void: Result /= void
same_size: Result. count = count

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text of Current.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

text_length : INTEGER
-- Number of characters making up text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .text_length

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

value : INTEGER
-- Integer value held.

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

count : INTEGER
-- Number of items.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .count

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
count_definition: Result. count = count

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Does other contain the same elements?
-- (from LIST )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from LIST
indices_unchanged: index = old index and other. index = old other. index
true_implies_same_size: Result implies count = other. count

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LIST )

behavior_type : INTEGER
-- Component behavior type: normal (default), with string data,
-- with integer data or with boolean data.

caret_position : INTEGER
-- Current position of caret.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .caret_position

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from EV_DYNAMIC_LIST )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

has_selection : BOOLEAN
-- Does current have a selection?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .has_selection

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_editable : BOOLEAN
-- Is text editable?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .is_editable

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_inserted (v: EV_LIST_ITEM ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_locked : BOOLEAN
-- Is label sensitiveness locked?

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

off : BOOLEAN
-- Is there no current item?
-- (from CHAIN )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from SEQUENCE )

selection_end : INTEGER
-- Index of last character selected
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .selection_end
within_range: Result >= 1 and Result <= text_length
consistent_with_selection_start: Result >= selection_start

selection_start : INTEGER
-- Index of first selected character.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .selection_start
within_range: Result >= 1 and Result <= text_length
consistent_with_selection_end: selection_end >= Result

valid_behavior_type (behavior: INTEGER ): BOOLEAN
-- Is behavior valid?

valid_caret_position (pos: INTEGER ): BOOLEAN
-- Is pos a valid caret position?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .valid_caret_position (pos)

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
-- if it points to an item, Current must have it.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .valid_cursor (p)

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_data_type (a_data: ANY ): BOOLEAN
-- Does a_data type correspond to combo box behavior type?
require
not_void: a_data /= void

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_edit
-- Make Current read-only.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
is_editable: not is_editable

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_edit
-- Make Current editable.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
is_editable: is_editable

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

remove_selection
-- Ensure there is no selected_item .
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
not_selected: selected_item = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_caret_position (a_caret_position: INTEGER )
-- Assign a_caret_posiiton to caret_position .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
valid_caret_position: valid_caret_position (a_caret_position)
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
caret_position_assigned: caret_position = a_caret_position

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_strings (a_string_array: INDEXABLE [ STRING , INTEGER ])
-- Wipe out and re-initialize with an item
-- for each of a_string_array.
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
items_created: count = strings . count

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Cursor movement

back
-- Move to previous position.
-- (from EV_DYNAMIC_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (No effect if empty)
-- (from CHAIN )
ensure then -- from CHAIN
at_last: not is_empty implies islast

forth
-- Move cursor to next position.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from EV_DYNAMIC_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions.
-- (from EV_DYNAMIC_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from EV_DYNAMIC_LIST
empty_implies_after: is_empty implies after

feature -- Element change

append (s: SEQUENCE [ EV_LIST_ITEM ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

append_text (a_text: STRING )
-- Append a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_appended: check_text_modification (old text , a_text)
caret_not_moved: old caret_position = caret_position

extend (v: like item )
-- Add v to end. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_last: v = last
count_increased: count = old count + 1
cursor_not_moved: ( index = old index ) or ( after and old after )

fill (other: CONTAINER [ EV_LIST_ITEM ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

insert_text (a_text: STRING )
-- Insert a_text to right of caret_position .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_insert_correctly: text . is_equal ((old text ). substring (1, (old caret_position - 1)) + a_text + (old text ). substring ((old caret_position ), (old text . count )))
caret_not_moved: old caret_position = caret_position

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

prepend_text (a_text: STRING )
-- Prepend a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_prepended: text . is_equal (a_text + old text )
caret_not_moved: old caret_position = caret_position

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count

put_front (v: like item )
-- Add v at beginning. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_first: v = first
count_increased: count = old count + 1
cursor_not_moved: ( index = old index + 1) or ( before and old before )

put_i_th (v: like item ; i: INTEGER )
-- Replace item at i-th position by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
valid_index: i > 0 and i <= count
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = i_th (i)
not_has_old_item: not has (old i_th (i))
old_item_parent_void: (old i_th (i)). parent = void
count_same: count = old count
cursor_not_moved: index = old index

put_left (v: like item )
-- Add v to the left of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_before: not before
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index - 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index + 1

put_right (v: like item )
-- Add v to right of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_after: not after
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index + 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
text_removed: text = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

replace (v: like item )
-- Replace current item by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = item
not_has_old_item: not has (old item )
old_item_parent_void: (old item ). parent = void
count_same: count = old count
cursor_not_moved: index = old index

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_capacity (a_capacity: INTEGER )
-- Assign a_capacity to capacity .
-- (from EV_TEXT_FIELD )
require -- from EV_TEXT_FIELD
not_destroyed: not is_destroyed
a_capacity_not_negative: a_capacity >= 0

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pixmaps_size (a_width: INTEGER ; a_height: INTEGER )
-- Set the size of pixmaps displayed in Current.
-- Note: The Default value is 16x16
-- (from EV_COMBO_BOX )
require -- from EV_COMBO_BOX
not_destroyed: not is_destroyed
valid_width: a_width > 0
valid_height: a_height > 0
ensure -- from EV_COMBO_BOX
width_set: pixmaps_width = a_width
height_set: pixmaps_height = a_height

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_COMBO_BOX )
require -- from EV_COMBO_BOX
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
a_text_not_empty: not a_text. is_empty
combo_box_is_editable: is_editable
ensure -- from EV_COMBO_BOX
text_set: check_text_modification ( void , a_text)

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

swap (i: INTEGER )
-- Exchange_item at i-th position with item
-- at cursor position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Removal

prune (v: like item )
-- Remove v if present. Do not move cursor, except if
-- cursor was on v, move to right neighbor.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable: prunable
ensure then -- from SET
removed_count_change: old has (v) implies ( count = old count - 1)
not_removed_no_count_change: not old has (v) implies ( count = old count )
item_deleted: not has (v)
ensure then -- from EV_DYNAMIC_LIST
not_has_v: not has (v)
had_item_implies_parent_void: old has (v) implies v. parent = void
had_item_implies_count_decreased: old has (v) implies count = old count - 1
had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

dl_prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item. Move cursor to right neighbor.
-- (or after if no right neighbor).
-- (from EV_DYNAMIC_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after
ensure then -- from EV_DYNAMIC_LIST
v_removed: not has (old item )
parent_void: (old item ). parent = void
count_decreased: count = old count - 1
index_same: index = old index

remove_left
-- Remove item to left of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1
ensure then -- from EV_DYNAMIC_LIST
left_neighbor_removed: not has (old i_th ( index - 1))
parent_void: (old i_th ( index - 1)). parent = void
index_decreased: index = old index - 1

remove_right
-- Remove item to right of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index
ensure then -- from EV_DYNAMIC_LIST
right_neighbor_removed: not has (old i_th ( index + 1))
parent_void: (old i_th ( index + 1)). parent = void
index_same: index = old index

wipe_out
-- Remove all items.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Resizing

set_minimum_width_in_characters (nb: INTEGER )
-- Make a minimum of nb of the widest character visible
-- on one line.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
valid_nb: nb > 0
ensure -- from EV_TEXT_COMPONENT
minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Conversion

linear_representation : LINEAR [ EV_LIST_ITEM ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

add_choice (a_choice: STRING )
-- Add a_choice to the combo box.
require
has_normal_behavior: behavior_type = normal
not_void: a_choice /= void
not_empty: not a_choice. is_empty

add_data_choice (a_data: ANY ; a_label: STRING )
-- Add a_data to the combo box and enable its selection
-- with a_label.
require
type_not_void: a_data /= void
valid_behavior_type: behavior_type /= normal
valid_data_type: valid_data_type (a_data)
label_not_void: a_label /= void
label_not_empty: not a_label. is_empty

disable_checked
-- Uncheck property.

enable_checked
-- Check property.

lock_sensitiveness
-- Lock display string sensitiveness.

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

set_string_value (a_text: STRING )
-- Set display string to a_text.

set_value (i: INTEGER )
-- Set i to integer value.

unlock_sensitiveness
-- Unlock display string sensitiveness.

feature -- Implementation

Changeable_comparison_criterion : BOOLEAN is False
-- May object_comparison be changed?
-- (Answer: no by default.
-- (from EV_ITEM_LIST )

feature --

enter_field_value (type, name: STRING ): STRING
-- Value of field with name and type not valid message.
-- (from DV_MESSAGES )

retrieve_field_value (type, name: STRING ): STRING
-- Value of field with name and type retrieval failure message.
-- (from DV_MESSAGES )

type_not_recognized (name: STRING ): STRING
-- Type of field with name not recognized message.
-- (from DV_MESSAGES )

wrong_date_format (name: STRING ): STRING
-- Wrong date type format for field with name message.
-- (from DV_MESSAGES )

wrong_datetime_format (name: STRING ): STRING
-- Wrong date & time type format for field with name message.
-- (from DV_MESSAGES )

feature -- Basic operation

copy_selection
-- Copy selected_text to clipboard.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
selection_copied: clipboard_content . is_equal ( selected_text )
text_unchanged: text . is_equal (old text )
caret_not_moved: caret_position = old caret_position

cut_selection
-- Move selected_text to clipboard.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
selection_in_clipboard: clipboard_content . is_equal (old selected_text )
selection_cut: text . is_equal ((old text ). substring (1, old selection_start - 1) + (old text ). substring (old selection_end + 1, (old text ). count ))

delete_selection
-- Delete current selection.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
has_no_selection: not has_selection
selection_deleted: text . is_equal ((old text ). substring (1, old selection_start - 1) + (old text ). substring (old selection_end + 1, (old text ). count ))

deselect_all
-- Unselect the current selection.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
not_has_selection: not has_selection

paste (a_position: INTEGER )
-- Insert text from clipboard at a_position.
-- No effect if clipboard is empty.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
a_position_within_range: a_position >= 1 and a_position <= text_length + 1
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
text_pasted_correctly: text . is_equal ((old text ). substring (1, a_position - 1) + clipboard_content + ((old text ). substring (a_position, ((old text ). count ))))
caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content . count

select_all
-- Select all text.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
positive_length: text_length > 0
ensure -- from EV_TEXT_COMPONENT
has_selection: has_selection
selection_start_set: selection_start = 1
selection_end_set: selection_end = text_length

select_region (start_pos, end_pos: INTEGER )
-- Select text between start_pos and end_pos inclusive.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
start_within_range: start_pos >= 1 and start_pos <= text_length
end_within_range: end_pos >= 1 and end_pos <= text_length
ensure -- from EV_TEXT_COMPONENT
has_selection: (start_pos /= end_pos) implies has_selection
selection_start_set: selection_start = start_pos
selection_end_set: selection_end = end_pos

feature -- Combo box

empty_combo_item_label : STRING
-- Label for an empty combo item value.
-- (from DV_MESSAGES )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

same (other: EV_ANY ): BOOLEAN
-- Is other Current?
-- (from EV_DYNAMIC_LIST )

feature -- Creation

creation_confirmation (table_name: STRING ): STRING
-- Table row creation on table_name confirmation message.
-- (from DV_MESSAGES )

creation_done (table_name: STRING ): STRING
-- Table row creation on table_name successful message.
-- (from DV_MESSAGES )

feature -- Deletion

deletion_confirmation (table_name: STRING ): STRING
-- Table row deletion on table_name confirmation message.
-- (from DV_MESSAGES )

deletion_done (table_name: STRING ): STRING
-- Table row deletion on table_name successful message.
-- (from DV_MESSAGES )

feature -- Event handling

change_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when text changes.
-- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES )
ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
not_void: Result /= void

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

deselect_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when an item is deselected.
-- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES )
ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

return_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when return key is pressed.
-- (from EV_TEXT_FIELD_ACTION_SEQUENCES )
ensure -- from EV_TEXT_FIELD_ACTION_SEQUENCES
not_void: Result /= void

select_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when an item is selected.
-- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES )
ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
not_void: Result /= void

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]]; test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

feature -- Selection

tablerows_selected (count: INTEGER ): STRING
-- Database selection carried out message. count table rows
-- have been selected.
-- (from DV_MESSAGES )

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

feature -- Update

update_done (table_name: STRING ): STRING
-- Table row update on table_name successful message.
-- (from DV_MESSAGES )

feature -- Window to select foreign key values for creation

selection_window_title (table_name: STRING ): STRING
-- Selection window title.
-- (from DV_MESSAGES )

undetermined_table_name : STRING
-- Undetermined table name (use for selection_window_title ).
-- (from DV_MESSAGES )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_TEXT_FIELD
capacity_not_negative: capacity >= 0
-- from EV_TEXT_COMPONENT
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_ITEM_LIST
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_COMBO_BOX


DV_FACTORY Chart

 class
DV_FACTORY

General
cluster: dataview.graphical
description: "Objects that can easily create display objects."
create: make

Ancestors
ANY

Queries
model : DV_TABLEROW_FIELD
view : DV_BOX

Commands
fill_basic_qualifying_cbox (cbox: DV_COMBO_BOX ; db_handler: ABSTRACT_DB_TABLE_MANAGER )
fill_column_selecting_cbox (cbox: DV_COMBO_BOX ; table_description: DB_TABLE_DESCRIPTION )
insensitive_area (a_minimum_width, a_code: INTEGER )
insensitive_combo_box (a_minimum_width, a_code: INTEGER ; combo_box: DV_COMBO_BOX )
insensitive_field (a_minimum_width, a_code: INTEGER )
make
sensitive_area (a_minimum_width, a_code: INTEGER )
sensitive_combo_box (a_minimum_width, a_code: INTEGER ; combo_box: DV_COMBO_BOX )
sensitive_field (a_minimum_width, a_code: INTEGER )


DV_FACTORY Flat contracts

 indexing
description: "Objects that can easily create display objects."
date: "$Date: 2001/07/05 16:06:52 $"
revision: "$Revision: 1.1 $"

class interface
DV_FACTORY

create

make
-- Gives access.

feature -- Initialization

make
-- Gives access.

feature -- Access

model : DV_TABLEROW_FIELD
-- Last processing element created.

view : DV_BOX
-- Last display element created.

feature -- Basic operations

insensitive_area (a_minimum_width, a_code: INTEGER )
-- Display field adapted to display
-- a typed database table row.
-- Field is insensitive.
-- Set field minimum width to a_minimum_width.
require
valid_minimum_width: a_minimum_width >= 0

insensitive_combo_box (a_minimum_width, a_code: INTEGER ; combo_box: DV_COMBO_BOX )
-- Display combo box adapted to display
-- a typed database table row.
-- Field is insensitive.
-- Set field minimum width to a_minimum_width.
require
valid_minimum_width: a_minimum_width >= 0

insensitive_field (a_minimum_width, a_code: INTEGER )
-- Display field adapted to display
-- a typed database table row.
-- Field is insensitive.
-- Set field minimum width to a_minimum_width.
require
valid_minimum_width: a_minimum_width >= 0

sensitive_area (a_minimum_width, a_code: INTEGER )
-- Display field adapted to display
-- a typed database table row.
-- Field is sensitive.
-- Set field minimum width to a_minimum_width.
require
valid_minimum_width: a_minimum_width >= 0

sensitive_combo_box (a_minimum_width, a_code: INTEGER ; combo_box: DV_COMBO_BOX )
-- Display combo box adapted to display
-- a typed database table row.
-- Field is sensitive.
-- Set field minimum width to a_minimum_width.
require
valid_minimum_width: a_minimum_width >= 0

sensitive_field (a_minimum_width, a_code: INTEGER )
-- Display field adapted to display
-- a typed database table row.
-- Field is sensitive.
-- Set field minimum width to a_minimum_width.
-- FIeld represent attribute with code
require
valid_minimum_width: a_minimum_width >= 0

feature -- Settings

fill_basic_qualifying_cbox (cbox: DV_COMBO_BOX ; db_handler: ABSTRACT_DB_TABLE_MANAGER )
-- Fill cbox with existing columns of table described by table_description.
require
combo_box_not_void: cbox /= void
has_integer_data_behavior: cbox. behavior_type = cbox. integer_data
db_handler_not_void: db_handler /= void

fill_column_selecting_cbox (cbox: DV_COMBO_BOX ; table_description: DB_TABLE_DESCRIPTION )
-- Fill cbox with existing columns of table described by table_description.
require
not_void: cbox /= void
has_integer_data_behavior: cbox. behavior_type = cbox. integer_data
table_description_not_void: table_description /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_FACTORY


DV_FRAME Chart

 class
DV_FRAME

General
cluster: dataview.graphical
description: "Frame container for one display element"
create: make_with_text

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
data : ANY
deny_cursor : EV_CURSOR
Ev_frame_etched_in : INTEGER
Ev_frame_etched_out : INTEGER
Ev_frame_lowered : INTEGER
Ev_frame_raised : INTEGER
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: [like item ] EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] DV_FRAME )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
make_with_text (title: STRING )
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: [like item ] EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_default_title_color (new_title_color: EV_COLOR )
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


DV_FRAME Flat contracts

 indexing
description: "Frame container for one display element"
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_FRAME

create

make_with_text (title: STRING )
-- Initialize.
require -- from EV_TEXTABLE
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_assigned: text . is_equal (a_text) and text /= a_text

feature -- Initialization

make_with_text (title: STRING )
-- Initialize.
require -- from EV_TEXTABLE
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_assigned: text . is_equal (a_text) and text /= a_text

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: like item ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

set_default_title_color (new_title_color: EV_COLOR )
-- Set new_title_color as default title color.
-- Set frame title with new_title_color.

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: like item )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Constants

Ev_frame_etched_in : INTEGER is unique
-- Sunken groove.
-- (from EV_FRAME_CONSTANTS )

Ev_frame_etched_out : INTEGER is unique
-- Raised ridge.
-- (from EV_FRAME_CONSTANTS )

Ev_frame_lowered : INTEGER is unique
-- Inward bevel.
-- (from EV_FRAME_CONSTANTS )

Ev_frame_raised : INTEGER is unique
-- Outward bevel.
-- (from EV_FRAME_CONSTANTS )

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
-- Actions to be performed when a new item is added.
-- (from EV_CONTAINER_ACTION_SEQUENCES )
ensure -- from EV_CONTAINER_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_FRAME


DV_HORIZONTAL_BOX Chart

 class
DV_HORIZONTAL_BOX

General
cluster: dataview.graphical
description: "Horizontal box for display elements"
create: make_without_borders , make

Ancestors
DV_BOX
EV_HORIZONTAL_BOX

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
infix " @ " (i: INTEGER ): [like item ] EV_WIDGET
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
after : BOOLEAN
background_color : EV_COLOR
before : BOOLEAN
border_width : INTEGER
client_height : INTEGER
client_width : INTEGER
count : INTEGER
cursor : EV_DYNAMIC_LIST_CURSOR [ EV_WIDGET ]
data : ANY
deny_cursor : EV_CURSOR
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] EV_WIDGET
for_all (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
foreground_color : EV_COLOR
Full : BOOLEAN
has (v: [like item ] EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
i_th (i: INTEGER ): EV_WIDGET
id_object (an_id: INTEGER ): IDENTIFIED
index : INTEGER
index_of (v: [like item ] EV_WIDGET ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_default_non_expand : BOOLEAN
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DV_HORIZONTAL_BOX ): BOOLEAN
is_homogeneous : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_item_expanded (an_item: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : EV_WIDGET
last : [like item ] EV_WIDGET
linear_representation : LINEAR [ EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
occurrences (v: [like item ] EV_WIDGET ): INTEGER
off : BOOLEAN
padding : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
same (other: EV_ANY ): BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
sequential_occurrences (v: EV_WIDGET ): INTEGER
target_name : STRING
there_exists (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
append (s: SEQUENCE [ EV_WIDGET ])
back
center_pointer
copy (other: [like Current] DV_HORIZONTAL_BOX )
default_create
destroy
disable_borders
disable_capture
disable_default_expand
disable_homogeneous
disable_item_expand (an_item: EV_WIDGET )
disable_padding
disable_pebble_positioning
disable_sensitive
dl_prune (v: [like item ] EV_WIDGET )
do_all (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]]; test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ])
enable_borders
enable_capture
enable_default_expand
enable_homogeneous
enable_item_expand (an_item: EV_WIDGET )
enable_padding
enable_pebble_positioning
enable_sensitive
extend (widget: EV_WIDGET )
extend_cell
extend_separator
fill (other: CONTAINER [ EV_WIDGET ])
finish
force (v: [like item ] EV_WIDGET )
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
hide
make
make_without_borders
merge_left (other: [like Current] DV_HORIZONTAL_BOX )
merge_radio_button_groups (other: EV_CONTAINER )
merge_right (other: [like Current] DV_HORIZONTAL_BOX )
move (i: INTEGER )
propagate_background_color
propagate_foreground_color
prune (v: [like item ] EV_WIDGET )
prune_all (v: [like item ] EV_WIDGET )
put (v: [like item ] EV_WIDGET )
put_front (v: [like item ] EV_WIDGET )
put_i_th (v: [like item ] EV_WIDGET ; i: INTEGER )
put_left (v: [like item ] EV_WIDGET )
put_right (v: [like item ] EV_WIDGET )
remove
remove_help_context
remove_left
remove_pebble
remove_right
replace (v: [like item ] EV_WIDGET )
search (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_border_width (value: INTEGER )
set_data (some_data: [like data ] ANY )
set_default
set_default_border_width (new_border_width: INTEGER )
set_default_colors
set_default_padding (new_padding: INTEGER )
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_padding (value: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
show
start
swap (i: INTEGER )
wipe_out


DV_HORIZONTAL_BOX Flat contracts

 indexing
description: "Horizontal box for display elements"
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_HORIZONTAL_BOX

create

make
-- Initialize.
-- (from DV_BOX )

make_without_borders
-- Initialize.
-- Box has no borders: use this to have a nice display
-- when box is contained in another box.
-- (from DV_BOX )

feature -- Initialization

make
-- Initialize.
-- (from DV_BOX )

make_without_borders
-- Initialize.
-- Box has no borders: use this to have a nice display
-- when box is contained in another box.
-- (from DV_BOX )

set_default
-- Initialize default values
-- (from DV_BOX )

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

cursor : EV_DYNAMIC_LIST_CURSOR [ EV_WIDGET ]
-- Current cursor position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .cursor)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

first : like item
-- Item at first position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

i_th (i: INTEGER ): EV_WIDGET
-- Item at i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .i_th (i))

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

index : INTEGER
-- Current position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of ith occurence of v.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index_of (v, i)

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_DYNAMIC_LIST
a_list_not_void: a_list /= void
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Item at current position.
-- (from EV_DYNAMIC_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item
ensure then -- from EV_DYNAMIC_LIST
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .item)

last : like item
-- Item at last position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

sequential_occurrences (v: EV_WIDGET ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

count : INTEGER
-- Number of items.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .count

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
count_definition: Result. count = count

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Does other contain the same elements?
-- (from LIST )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from LIST
indices_unchanged: index = old index and other. index = old other. index
true_implies_same_size: Result implies count = other. count

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LIST )

border_width : INTEGER
-- Width of border around container in pixels.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .border_width
positive: Result >= 0

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from EV_DYNAMIC_LIST )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_default_non_expand : BOOLEAN
-- Can't elements be expanded by default?
-- (from DV_BOX )

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_homogeneous : BOOLEAN
-- Are all items forced to have same dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .is_homogeneous

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_item_expanded (an_item: EV_WIDGET ): BOOLEAN
-- Is an_item expanded to occupy available spare space?
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
bridge_ok: Result = implementation .is_item_expanded (an_item)

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

off : BOOLEAN
-- Is there no current item?
-- (from CHAIN )

padding : INTEGER
-- Space between children in pixels.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .padding
positive: Result >= 0

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from SEQUENCE )
require -- from ACTIVE
True
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
-- if it points to an item, Current must have it.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .valid_cursor (p)

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )
require -- from ACTIVE
True
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_borders
-- Display without borders.
-- (from DV_BOX )

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_default_expand
-- Disable default element displays expansion.
-- (from DV_BOX )
ensure -- from DV_BOX
is_default_non_expand: is_default_non_expand

disable_homogeneous
-- Allow items to have different dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
not_is_homogeneous: not is_homogeneous

disable_item_expand (an_item: EV_WIDGET )
-- Do not expand an_item to occupy avalible spare space.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
not_an_item_expanded: not is_item_expanded (an_item)

disable_padding
-- Display without padding.
-- (from DV_BOX )

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_borders
-- Display with borders.
-- (from DV_BOX )

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_default_expand
-- Enable default element displays expansion.
-- (from DV_BOX )
ensure -- from DV_BOX
is_default_expand: not is_default_non_expand

enable_homogeneous
-- Force all items to have same dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
is_homogeneous: is_homogeneous

enable_item_expand (an_item: EV_WIDGET )
-- Expand an_item to occupy avalible spare space.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
an_item_expanded: is_item_expanded (an_item)

enable_padding
-- Display with padding.
-- (from DV_BOX )

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_border_width (value: INTEGER )
-- Assign value to border_width .
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
positive_value: value >= 0
ensure -- from EV_BOX
border_width_assigned: border_width = value

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_padding (value: INTEGER )
-- Assign value to padding .
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
positive_value: value >= 0
ensure -- from EV_BOX
padding_assigned: padding = value

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Cursor movement

back
-- Move to previous position.
-- (from EV_DYNAMIC_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (No effect if empty)
-- (from CHAIN )
ensure then -- from CHAIN
at_last: not is_empty implies islast

forth
-- Move cursor to next position.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from EV_DYNAMIC_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions.
-- (from EV_DYNAMIC_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from EV_DYNAMIC_LIST
empty_implies_after: is_empty implies after

feature -- Element change

append (s: SEQUENCE [ EV_WIDGET ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count
ensure -- from EV_CONTAINER
has_v: has (v)

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count
ensure -- from EV_CONTAINER
has_v: has (v)

put_front (v: like item )
-- Add v at beginning. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_first: v = first
count_increased: count = old count + 1
cursor_not_moved: ( index = old index + 1) or ( before and old before )

put_i_th (v: like item ; i: INTEGER )
-- Replace item at i-th position by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
valid_index: i > 0 and i <= count
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = i_th (i)
not_has_old_item: not has (old i_th (i))
old_item_parent_void: (old i_th (i)). parent = void
count_same: count = old count
cursor_not_moved: index = old index

put_left (v: like item )
-- Add v to the left of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_before: not before
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index - 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index + 1

put_right (v: like item )
-- Add v to right of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_after: not after
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index + 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

replace (v: like item )
-- Replace current item by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_CONTAINER
has_v: has (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = item
not_has_old_item: not has (old item )
old_item_parent_void: (old item ). parent = void
count_same: count = old count
cursor_not_moved: index = old index

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

swap (i: INTEGER )
-- Exchange_item at i-th position with item
-- at cursor position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Removal

prune (v: like item )
-- Remove v if present. Do not move cursor, except if
-- cursor was on v, move to right neighbor.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable: prunable
ensure then -- from SET
removed_count_change: old has (v) implies ( count = old count - 1)
not_removed_no_count_change: not old has (v) implies ( count = old count )
item_deleted: not has (v)
ensure then -- from EV_DYNAMIC_LIST
not_has_v: not has (v)
had_item_implies_parent_void: old has (v) implies v. parent = void
had_item_implies_count_decreased: old has (v) implies count = old count - 1
had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

dl_prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item. Move cursor to right neighbor.
-- (or after if no right neighbor).
-- (from EV_DYNAMIC_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after
ensure then -- from EV_DYNAMIC_LIST
v_removed: not has (old item )
parent_void: (old item ). parent = void
count_decreased: count = old count - 1
index_same: index = old index

remove_left
-- Remove item to left of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1
ensure then -- from EV_DYNAMIC_LIST
left_neighbor_removed: not has (old i_th ( index - 1))
parent_void: (old i_th ( index - 1)). parent = void
index_decreased: index = old index - 1

remove_right
-- Remove item to right of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index
ensure then -- from EV_DYNAMIC_LIST
right_neighbor_removed: not has (old i_th ( index + 1))
parent_void: (old i_th ( index + 1)). parent = void
index_same: index = old index

wipe_out
-- Remove all items.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Conversion

linear_representation : LINEAR [ EV_WIDGET ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

extend (widget: EV_WIDGET )
-- Add widget to end of structure.
-- (from DV_BOX )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_CONTAINER
has_v: has (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_last: v = last
count_increased: count = old count + 1
cursor_not_moved: ( index = old index ) or ( after and old after )

extend_cell
-- Add a cell, i.e. an empty display element,
-- to end of structure.
-- (from DV_BOX )

extend_separator
-- Add a non-expandable separator to end
-- of structure.

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

set_default_border_width (new_border_width: INTEGER )
-- Set new_border_width as default border width.
-- (from DV_BOX )

set_default_padding (new_padding: INTEGER )
-- Set new_padding as default padding.
-- (from DV_BOX )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

same (other: EV_ANY ): BOOLEAN
-- Is other Current?
-- (from EV_DYNAMIC_LIST )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
-- Actions to be performed when a new item is added.
-- (from EV_CONTAINER_ACTION_SEQUENCES )
ensure -- from EV_CONTAINER_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]]; test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_HORIZONTAL_BOX


DV_LABEL Chart

 class
DV_LABEL

General
cluster: dataview.graphical
description: "Label."
create: make_with_text , default_create

Ancestors
DV_SENSITIVE_STRING
EV_LABEL

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
data : ANY
deny_cursor : EV_CURSOR
font : EV_FONT
foreground_color : EV_COLOR
has_capture : BOOLEAN
has_focus : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_locked : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
screen_x : INTEGER
screen_y : INTEGER
target_name : STRING
text : STRING
tooltip : STRING
value : STRING
width : INTEGER
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] DV_LABEL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
hide
lock_sensitiveness
remove_help_context
remove_pebble
remove_text
remove_tooltip
request_insensitive
request_sensitive
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_font (a_font: EV_FONT )
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
set_tooltip (a_tooltip: STRING )
set_value (a_text: STRING )
show
unlock_sensitiveness


DV_LABEL Flat contracts

 indexing
description: "Label."
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_LABEL

create

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

make_with_text (a_text: STRING )
-- Create Current and assign a_text to text
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_assigned: text . is_equal (a_text) and text /= a_text

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

font : EV_FONT
-- Typeface appearance for Current.
-- (from EV_FONTABLE )
require -- from EV_FONTABLE
not_destroyed: not is_destroyed
ensure -- from EV_FONTABLE
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .font)

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

value : STRING
-- Text area value.

feature -- Measurement

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_locked : BOOLEAN
-- Is label sensitiveness locked?

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_font (a_font: EV_FONT )
-- Assign a_font to font .
-- (from EV_FONTABLE )
require -- from EV_FONTABLE
not_destroyed: not is_destroyed
a_font_not_void: a_font /= void
ensure -- from EV_FONTABLE
font_assigned: font . is_equal (a_font)

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

lock_sensitiveness
-- Lock display string sensitiveness.

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

set_value (a_text: STRING )
-- Set display string to a_text.

unlock_sensitiveness
-- Unlock display string sensitiveness.

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_LABEL


DV_RADIO_BUTTON Chart

 class
DV_RADIO_BUTTON

General
cluster: dataview.graphical
description: "Radio button."
create: make_with_text

Ancestors
DV_SENSITIVE_CHECK
EV_RADIO_BUTTON

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
select_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
checked : BOOLEAN
data : ANY
deny_cursor : EV_CURSOR
foreground_color : EV_COLOR
has_capture : BOOLEAN
has_focus : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_selectable : BOOLEAN
is_selected : BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
peers : LINKED_LIST [[like Current] DV_RADIO_BUTTON ]
pixmap : EV_PIXMAP
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
screen_x : INTEGER
screen_y : INTEGER
selected_peer : [like Current] DV_RADIO_BUTTON
target_name : STRING
text : STRING
tooltip : STRING
width : INTEGER
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] DV_RADIO_BUTTON )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_select
disable_sensitive
enable_capture
enable_pebble_positioning
enable_select
enable_sensitive
hide
remove_help_context
remove_pebble
remove_pixmap
remove_text
remove_tooltip
request_insensitive
request_sensitive
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pixmap (a_pixmap: EV_PIXMAP )
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
set_tooltip (a_tooltip: STRING )
show


DV_RADIO_BUTTON Flat contracts

 indexing
description: "Radio button."
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_RADIO_BUTTON

create

make_with_text (a_text: STRING )
-- Create Current and assign a_text to text
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_assigned: text . is_equal (a_text) and text /= a_text

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

checked : BOOLEAN
-- Boolean value held.

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pixmap : EV_PIXMAP
-- Image displayed on Current.
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PIXMAPABLE
bridge_ok: (Result = void and implementation .pixmap = void ) or Result. is_equal ( implementation .pixmap)

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

feature -- Measurement

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_selectable : BOOLEAN
-- May enable_select be called.
-- (from EV_SELECTABLE )
require -- from EV_SELECTABLE
not_destroyed: not is_destroyed

is_selected : BOOLEAN
-- Is selected.
-- (from EV_SELECTABLE )
require -- from EV_RADIO_PEER
not_destroyed: not is_destroyed
require -- from EV_SELECTABLE
not_destroyed: not is_destroyed
ensure -- from EV_SELECTABLE
bridge_ok: Result = implementation .is_selected

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

peers : LINKED_LIST [like Current]
-- All radio items in the group Current is in.
-- Includes Current.
-- (from EV_RADIO_PEER )
require -- from EV_RADIO_PEER
not_destroyed: not is_destroyed
ensure -- from EV_RADIO_PEER
not_void: Result /= void
bridge_ok: Result. count = implementation .peers. count

selected_peer : like Current
-- Item in peers that is currently selected.
-- (from EV_RADIO_PEER )
require -- from EV_RADIO_PEER
not_destroyed: not is_destroyed
ensure -- from EV_RADIO_PEER
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .selected_peer)

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_select
-- Make is_selected True.
-- (from EV_SELECTABLE )
require -- from DV_SENSITIVE_CHECK
True
require -- from EV_RADIO_PEER
not_destroyed: not is_destroyed
require -- from EV_SELECTABLE
not_destroyed: not is_destroyed
is_selectable: is_selectable
ensure -- from EV_RADIO_PEER
selected_peer_is_current: selected_peer = Current
ensure -- from EV_SELECTABLE
is_selected: is_selected

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_pixmap
-- Make pixmap Void.
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PIXMAPABLE
pixmap_removed: pixmap = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pixmap (a_pixmap: EV_PIXMAP )
-- Assign a_pixmap to pixmap .
-- (from EV_PIXMAPABLE )
require -- from EV_PIXMAPABLE
not_destroyed: not is_destroyed
pixmap_not_void: a_pixmap /= void
ensure -- from EV_PIXMAPABLE
pixmap_assigned: a_pixmap. is_equal ( pixmap ) and pixmap /= a_pixmap

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

disable_select
-- Do nothing.

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

select_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when button is pressed then released.
-- (from EV_BUTTON_ACTION_SEQUENCES )
ensure -- from EV_BUTTON_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0
-- from EV_RADIO_PEER
peers_not_void: peers /= void
selected_peer_not_void: selected_peer /= void
peers_returns_new_copy_of_list: peers /= peers
peers_has_current: peers . has (Current)
is_selected_equals_selected_peer_is_current: is_selected = ( selected_peer = Current)
one_radio_item_selected: selected_count = 1

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_RADIO_BUTTON


DV_SELECTION_WINDOW Chart

 class
DV_SELECTION_WINDOW

General
cluster: dataview.graphical
description: "Windows that enable to select adatabase table row."
create: make

Ancestors
DB_TABLES_ACCESS_USE
DV_MESSAGES
EV_TITLED_WINDOW

Action sequences
close_request_actions : EV_NOTIFY_ACTION_SEQUENCE
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
move_actions : EV_GEOMETRY_ACTION_SEQUENCE
new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
show_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
accelerators : EV_ACCELERATOR_LIST
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
creation_confirmation (table_name: STRING ): STRING
creation_done (table_name: STRING ): STRING
data : ANY
deletion_confirmation (table_name: STRING ): STRING
deletion_done (table_name: STRING ): STRING
deny_cursor : EV_CURSOR
empty_combo_item_label : STRING
enter_field_value (type, name: STRING ): STRING
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: [like item ] EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
icon_name : STRING
icon_pixmap : EV_PIXMAP
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_maximized : BOOLEAN
is_minimized : BOOLEAN
is_modal : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
lower_bar : EV_VERTICAL_BOX
maximum_height : INTEGER
maximum_width : INTEGER
menu_bar : EV_MENU_BAR
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
retrieve_field_value (type, name: STRING ): STRING
screen_x : INTEGER
screen_y : INTEGER
selecting_control : DV_BUTTON
selection_window_title (table_name: STRING ): STRING
tablerows_selected (count: INTEGER ): STRING
tables_set : BOOLEAN
target_name : STRING
title : STRING
type_not_recognized (name: STRING ): STRING
undetermined_table_name : STRING
update_done (table_name: STRING ): STRING
upper_bar : EV_VERTICAL_BOX
user_can_resize : BOOLEAN
width : INTEGER
writable : BOOLEAN
wrong_date_format (name: STRING ): STRING
wrong_datetime_format (name: STRING ): STRING
x_position : INTEGER
y_position : INTEGER

Commands
center_pointer
copy (other: [like Current] DV_SELECTION_WINDOW )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
disable_user_resize
enable_capture
enable_pebble_positioning
enable_sensitive
enable_user_resize
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
lock_update
lower
make
maximize
merge_radio_button_groups (other: EV_CONTAINER )
minimize
propagate_background_color
propagate_foreground_color
prune (v: [like item ] EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
raise
remove_help_context
remove_icon_name
remove_menu_bar
remove_pebble
remove_title
replace (v: [like item ] EV_WIDGET )
restore
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_content
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_display_list (display_l: DV_TABLEROW_MULTILIST )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_height (a_height: INTEGER )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_icon_name (an_icon_name: STRING )
set_icon_pixmap (an_icon: EV_PIXMAP )
set_maximum_height (a_maximum_height: INTEGER )
set_maximum_size (a_maximum_width, a_maximum_height: INTEGER )
set_maximum_width (a_maximum_width: INTEGER )
set_menu_bar (a_menu_bar: EV_MENU_BAR )
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_position (a_x, a_y: INTEGER )
set_size (a_width, a_height: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_title (a_title: STRING )
set_width (a_width: INTEGER )
set_x_position (a_x: INTEGER )
set_y_position (a_y: INTEGER )
show
unlock_update
wipe_out


DV_SELECTION_WINDOW Flat contracts

 indexing
description: "Windows that enable to select adatabase table row."
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_SELECTION_WINDOW

create

make
-- Create the window and the status bar.

feature -- Initialization

make
-- Create the window and the status bar.

set_content
-- Set window widgets.

set_display_list (display_l: DV_TABLEROW_MULTILIST )
-- Set selection list to display_list .
require
not_void: display_l /= void

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

lower_bar : EV_VERTICAL_BOX
-- Room at bottom of window. (Example use: statusbar.)
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .lower_bar

maximum_height : INTEGER
-- Upper bound on height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: (Result = implementation .internal_maximum_height) or (Result = implementation .minimum_height)

maximum_width : INTEGER
-- Upper bound on width in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: (Result = implementation .internal_maximum_width) or (Result = implementation .minimum_width)

menu_bar : EV_MENU_BAR
-- Horizontal bar at top of client area that contains menu's.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .menu_bar

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

selecting_control : DV_BUTTON
-- Button to select a table row.

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

title : STRING
-- A textual name used by the window manager.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: equal (Result, implementation .title)

upper_bar : EV_VERTICAL_BOX
-- Room at top of window. (Example use: toolbars.)
-- Positioned below menu bar.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .upper_bar

feature -- Access

accelerators : EV_ACCELERATOR_LIST
-- Key combination shortcuts associated with this window.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

icon_name : STRING
-- Alternative name, displayed when window is minimised.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: equal (Result, implementation .icon_name)

icon_pixmap : EV_PIXMAP
-- Window icon.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result. is_equal ( implementation .icon_pixmap)

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has (v: like item ): BOOLEAN
-- Does structure include v?
-- (from EV_WINDOW )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_maximized : BOOLEAN
-- Is displayed at maximum size?
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result = implementation .is_maximized

is_minimized : BOOLEAN
-- Is displayed iconified/minimised?
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result = implementation .is_minimized

is_modal : BOOLEAN
-- Must the window be closed before application can
-- receive user events again?
--
-- May be redefined in EV_DIALOG to return
-- a different value
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

user_can_resize : BOOLEAN
-- Can the user resize?
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .user_can_resize

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

disable_user_resize
-- Prevent user from resizing.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
not_user_can_resize: not user_can_resize

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

enable_user_resize
-- Allow user to resize.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
user_can_resize: user_can_resize

hide
-- Hide window.
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

lock_update
-- Lock drawing updates for this window on certain platforms until
-- unlock_update is called.
--
-- Note: - Only one window can be locked at a time.
-- - The window cannot be moved while update is locked.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
no_locked_window: ((create { EV_ENVIRONMENT }).application.locked_window = void )
ensure -- from EV_WINDOW
locked_window_is_current: (create { EV_ENVIRONMENT }).application.locked_window = Current

lower
-- Request that window be displayed below all other windows.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

maximize
-- Display at maximum size.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
is_maximized: is_maximized

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

minimize
-- Display iconified/minimised.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

raise
-- Request that window be displayed above all other windows.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

remove_menu_bar
-- Make menu_bar Void.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
void: menu_bar = void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

remove_title
-- Make title Void.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
a_title_removed: title = void

restore
-- Restore to original position when minimized or maximized.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
maximize_restored: old is_maximized implies not is_maximized

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_height (a_height: INTEGER )
-- Assign a_height to height in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_height_positive_or_zero: a_height >= 0
ensure -- from EV_POSITIONABLE
height_assigned: height = minimum_height or else height = a_height

set_maximum_height (a_maximum_height: INTEGER )
-- Assign a_maximum_height to maximum_height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_height_non_negative: a_maximum_height >= 0
a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
ensure -- from EV_WINDOW
maximum_height_assigned: maximum_height = a_maximum_height

set_maximum_size (a_maximum_width, a_maximum_height: INTEGER )
-- Assign a_maximum_width to maximum_width
-- and a_maximum_height to maximum_height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
ensure -- from EV_WINDOW
maximum_width_assigned: maximum_width = a_maximum_width
maximum_height_assigned: maximum_height = a_maximum_height

set_maximum_width (a_maximum_width: INTEGER )
-- Assign a_maximum_width to maximum_width in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_width_non_negative: a_maximum_width >= 0
a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
ensure -- from EV_WINDOW
maximum_width_assigned: maximum_width = a_maximum_width

set_menu_bar (a_menu_bar: EV_MENU_BAR )
-- Assign a_menu_bar to menu_bar .
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
no_menu_bar_assigned: menu_bar = void
a_menu_bar_not_void: a_menu_bar /= void
ensure -- from EV_WINDOW
assigned: menu_bar = a_menu_bar

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_position (a_x, a_y: INTEGER )
-- Assign a_x to x_position and a_y to y_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
x_position_assigned: x_position = a_x
y_position_assigned: y_position = a_y

set_size (a_width, a_height: INTEGER )
-- Assign a_width to width and a_height to height in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_width_positive_or_zero: a_width >= 0
a_height_positive_or_zero: a_height >= 0
ensure -- from EV_POSITIONABLE
width_assigned: width = minimum_width or else width = a_width
height_assigned: height = minimum_height or else height = a_height

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

set_title (a_title: STRING )
-- Assign a_title to title .
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_title_not_void: a_title /= void
a_title_not_empty: not a_title. is_empty
ensure -- from EV_WINDOW
a_title_assigned: title . is_equal (a_title)

set_width (a_width: INTEGER )
-- Assign a_width to width in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_width_positive_or_zero: a_width >= 0
ensure -- from EV_POSITIONABLE
width_assigned: width = minimum_width or else width = a_width

set_x_position (a_x: INTEGER )
-- Assign a_x to x_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
x_position_assigned: x_position = a_x

set_y_position (a_y: INTEGER )
-- Assign a_y to y_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
y_position_assigned: y_position = a_y

show
-- Show window.
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

unlock_update
-- Unlock updates for this widget on certain platforms.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
locked_window_is_current: (create { EV_ENVIRONMENT }).application.locked_window = Current
ensure -- from EV_WINDOW
no_locked_window: ((create { EV_ENVIRONMENT }).application.locked_window = void )

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_icon_name
-- Make icon_name Void.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
icon_name_removed: icon_name = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_icon_name (an_icon_name: STRING )
-- Assign an_icon_name to icon_name .
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
an_icon_name_not_void: an_icon_name /= void
an_icon_name_not_empty: not an_icon_name. is_empty
ensure -- from EV_TITLED_WINDOW
icon_name_assigned: icon_name . is_equal (an_icon_name)

set_icon_pixmap (an_icon: EV_PIXMAP )
-- Assign an_icon to icon.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
pixmap_not_void: an_icon /= void
ensure -- from EV_TITLED_WINDOW
icon_pixmap_assigned: icon_pixmap . is_equal (an_icon)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

feature -- Removal

prune (v: like item )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature --

enter_field_value (type, name: STRING ): STRING
-- Value of field with name and type not valid message.
-- (from DV_MESSAGES )

retrieve_field_value (type, name: STRING ): STRING
-- Value of field with name and type retrieval failure message.
-- (from DV_MESSAGES )

type_not_recognized (name: STRING ): STRING
-- Type of field with name not recognized message.
-- (from DV_MESSAGES )

wrong_date_format (name: STRING ): STRING
-- Wrong date type format for field with name message.
-- (from DV_MESSAGES )

wrong_datetime_format (name: STRING ): STRING
-- Wrong date & time type format for field with name message.
-- (from DV_MESSAGES )

feature -- Combo box

empty_combo_item_label : STRING
-- Label for an empty combo item value.
-- (from DV_MESSAGES )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Creation

creation_confirmation (table_name: STRING ): STRING
-- Table row creation on table_name confirmation message.
-- (from DV_MESSAGES )

creation_done (table_name: STRING ): STRING
-- Table row creation on table_name successful message.
-- (from DV_MESSAGES )

feature -- Deletion

deletion_confirmation (table_name: STRING ): STRING
-- Table row deletion on table_name confirmation message.
-- (from DV_MESSAGES )

deletion_done (table_name: STRING ): STRING
-- Table row deletion on table_name successful message.
-- (from DV_MESSAGES )

feature -- Event handling

close_request_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed whan a request to close window
-- has been received.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

move_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when window moves.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
-- Actions to be performed when a new item is added.
-- (from EV_CONTAINER_ACTION_SEQUENCES )
ensure -- from EV_CONTAINER_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

show_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when window is shown.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

feature -- Selection

tablerows_selected (count: INTEGER ): STRING
-- Database selection carried out message. count table rows
-- have been selected.
-- (from DV_MESSAGES )

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

feature -- Update

update_done (table_name: STRING ): STRING
-- Table row update on table_name successful message.
-- (from DV_MESSAGES )

feature -- Window to select foreign key values for creation

selection_window_title (table_name: STRING ): STRING
-- Selection window title.
-- (from DV_MESSAGES )

undetermined_table_name : STRING
-- Undetermined table name (use for selection_window_title ).
-- (from DV_MESSAGES )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_TITLED_WINDOW
accelerators_not_void: is_usable implies accelerators /= void
-- from EV_WINDOW
consistent_horizontal_bounds: maximum_width >= minimum_width
consistent_vertical_bounds: maximum_height >= minimum_height
upper_bar_not_void: is_usable implies upper_bar /= void
lower_bar_not_void: is_usable implies lower_bar /= void
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_SELECTION_WINDOW


DV_STRING_LIST Chart

 class
DV_STRING_LIST

General
cluster: dataview.graphical
description: "Objects that represents a character separated list of types"
create: make

Ancestors
DB_TABLES_ACCESS_USE
DV_SENSITIVE_STRING
EV_LIST

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
deselect_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
select_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
infix " @ " (i: INTEGER ): [like item ] EV_LIST_ITEM
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
after : BOOLEAN
background_color : EV_COLOR
before : BOOLEAN
Changeable_comparison_criterion : BOOLEAN
count : INTEGER
cursor : EV_DYNAMIC_LIST_CURSOR [ EV_LIST_ITEM ]
data : ANY
deny_cursor : EV_CURSOR
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] EV_LIST_ITEM
for_all (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
foreground_color : EV_COLOR
Full : BOOLEAN
has (v: [like item ] EV_LIST_ITEM ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
i_th (i: INTEGER ): EV_LIST_ITEM
id_object (an_id: INTEGER ): IDENTIFIED
index : INTEGER
index_of (v: [like item ] EV_LIST_ITEM ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
integer_list : ARRAYED_LIST [ INTEGER ]
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DV_STRING_LIST ): BOOLEAN
is_inserted (v: EV_LIST_ITEM ): BOOLEAN
is_locked : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : EV_LIST_ITEM
item_by_data (some_data: ANY ): [like item ] EV_LIST_ITEM
last : [like item ] EV_LIST_ITEM
linear_representation : LINEAR [ EV_LIST_ITEM ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
multiple_selection_enabled : BOOLEAN
object_comparison : BOOLEAN
object_id : INTEGER
occurrences (v: [like item ] EV_LIST_ITEM ): INTEGER
off : BOOLEAN
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pixmaps_height : INTEGER
pixmaps_width : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
same (other: EV_ANY ): BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
selected_item : EV_LIST_ITEM
selected_items : DYNAMIC_LIST [ EV_LIST_ITEM ]
separator : CHARACTER
sequential_occurrences (v: EV_LIST_ITEM ): INTEGER
strings : LINKED_LIST [ STRING ]
tables_set : BOOLEAN
target_name : STRING
there_exists (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
tooltip : STRING
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
value : STRING
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
add_choice (a_code: INTEGER ; a_label: STRING )
append (s: SEQUENCE [ EV_LIST_ITEM ])
back
center_pointer
compare_objects
compare_references
copy (other: [like Current] DV_STRING_LIST )
default_create
destroy
disable_capture
disable_multiple_selection
disable_pebble_positioning
disable_sensitive
dl_prune (v: [like item ] EV_LIST_ITEM )
do_all (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]]; test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ])
enable_capture
enable_multiple_selection
enable_pebble_positioning
enable_sensitive
ensure_item_visible (an_item: EV_LIST_ITEM )
extend (v: [like item ] EV_LIST_ITEM )
fill (other: CONTAINER [ EV_LIST_ITEM ])
fill_with_attributes (code: INTEGER )
finish
force (v: [like item ] EV_LIST_ITEM )
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
hide
lock_sensitiveness
make
merge_left (other: [like Current] DV_STRING_LIST )
merge_right (other: [like Current] DV_STRING_LIST )
move (i: INTEGER )
prune (v: [like item ] EV_LIST_ITEM )
prune_all (v: [like item ] EV_LIST_ITEM )
put (v: [like item ] EV_LIST_ITEM )
put_front (v: [like item ] EV_LIST_ITEM )
put_i_th (v: [like item ] EV_LIST_ITEM ; i: INTEGER )
put_left (v: [like item ] EV_LIST_ITEM )
put_right (v: [like item ] EV_LIST_ITEM )
remove
remove_help_context
remove_left
remove_pebble
remove_right
remove_selection
remove_tooltip
replace (v: [like item ] EV_LIST_ITEM )
request_insensitive
request_sensitive
search (v: [like item ] EV_LIST_ITEM )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_list_separator (a_sep: CHARACTER )
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pixmaps_size (a_width, a_height: INTEGER )
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_strings (a_string_array: INDEXABLE [ STRING , INTEGER ])
set_target_menu_mode
set_target_name (a_name: STRING )
set_tooltip (a_tooltip: STRING )
set_value (s: STRING )
show
start
swap (i: INTEGER )
unlock_sensitiveness
wipe_out


DV_STRING_LIST Flat contracts

 indexing
description: "Objects that represents a character separated list of types"
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_STRING_LIST

create

make
-- Create list.

feature -- Initialization

make
-- Create list.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

cursor : EV_DYNAMIC_LIST_CURSOR [ EV_LIST_ITEM ]
-- Current cursor position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .cursor)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

first : like item
-- Item at first position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

i_th (i: INTEGER ): EV_LIST_ITEM
-- Item at i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .i_th (i))

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

index : INTEGER
-- Current position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of ith occurence of v.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index_of (v, i)

integer_list : ARRAYED_LIST [ INTEGER ]
-- List selected values, coded with integers.
ensure
result_not_void: Result /= void

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_DYNAMIC_LIST
a_list_not_void: a_list /= void
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_LIST_ITEM
-- Item at current position.
-- (from EV_DYNAMIC_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable
ensure then -- from EV_DYNAMIC_LIST
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .item)

item_by_data (some_data: ANY ): like item
-- First item with some_data.
-- (from EV_ITEM_LIST )
require -- from EV_ITEM_LIST
not_destroyed: not is_destroyed
data_not_void: some_data /= void
ensure -- from EV_ITEM_LIST
bridge_ok: Result = implementation .item_by_data (some_data)

last : like item
-- Item at last position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

sequential_occurrences (v: EV_LIST_ITEM ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

selected_item : EV_LIST_ITEM
-- Currently selected item.
-- Topmost selected item if multiple items are selected.
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
bridge_ok: Result = implementation .selected_item

selected_items : DYNAMIC_LIST [ EV_LIST_ITEM ]
-- Currently selected items.
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST
bridge_ok: lists_equal (Result, implementation .selected_items)

separator : CHARACTER
-- Integer values separator, ',' by default.

strings : LINKED_LIST [ STRING ]
-- Representation of Current.
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
not_void: Result /= void
same_size: Result. count = count

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

value : STRING
-- List selected values, coded with integers.
-- and comma-separated.

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

count : INTEGER
-- Number of items.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .count

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
count_definition: Result. count = count

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Does other contain the same elements?
-- (from LIST )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from LIST
indices_unchanged: index = old index and other. index = old other. index
true_implies_same_size: Result implies count = other. count

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LIST )

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from EV_DYNAMIC_LIST )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_inserted (v: EV_LIST_ITEM ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_locked : BOOLEAN
-- Is label sensitiveness locked?

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

multiple_selection_enabled : BOOLEAN
-- Can more than one item be selected?
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST
bridge_ok: Result = implementation .multiple_selection_enabled

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

off : BOOLEAN
-- Is there no current item?
-- (from CHAIN )

pixmaps_height : INTEGER
-- Height of displayed pixmaps in the list.
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST
bridge_ok: Result = implementation .pixmaps_height

pixmaps_width : INTEGER
-- Width of displayed pixmaps in the list.
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST
bridge_ok: Result = implementation .pixmaps_width

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from SEQUENCE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
-- if it points to an item, Current must have it.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .valid_cursor (p)

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_multiple_selection
-- Allow only one item to be selected.
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST
not_multiple_selection_enabled: not multiple_selection_enabled

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_multiple_selection
-- Allow more than one item to be selected.
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST
multiple_selection_enabled: multiple_selection_enabled

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

ensure_item_visible (an_item: EV_LIST_ITEM )
-- Ensure item an_item is visible in Current.
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
is_displayed: is_displayed
an_item_contained: has (an_item)

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

remove_selection
-- Ensure there is no selected_item .
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
not_selected: selected_item = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_pixmaps_size (a_width: INTEGER ; a_height: INTEGER )
-- Set size of pixmaps disaplyed in Current.
-- Note: Default value is 16x16
-- (from EV_LIST )
require -- from EV_LIST
not_destroyed: not is_destroyed
valid_width: a_width > 0
valid_height: a_height > 0
ensure -- from EV_LIST
width_set: pixmaps_width = a_width
height_set: pixmaps_height = a_height

set_strings (a_string_array: INDEXABLE [ STRING , INTEGER ])
-- Wipe out and re-initialize with an item
-- for each of a_string_array.
-- (from EV_LIST_ITEM_LIST )
require -- from EV_LIST_ITEM_LIST
not_destroyed: not is_destroyed
ensure -- from EV_LIST_ITEM_LIST
items_created: count = strings . count

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Cursor movement

back
-- Move to previous position.
-- (from EV_DYNAMIC_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (No effect if empty)
-- (from CHAIN )
ensure then -- from CHAIN
at_last: not is_empty implies islast

forth
-- Move cursor to next position.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from EV_DYNAMIC_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions.
-- (from EV_DYNAMIC_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from EV_DYNAMIC_LIST
empty_implies_after: is_empty implies after

feature -- Element change

append (s: SEQUENCE [ EV_LIST_ITEM ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

extend (v: like item )
-- Add v to end. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_last: v = last
count_increased: count = old count + 1
cursor_not_moved: ( index = old index ) or ( after and old after )

fill (other: CONTAINER [ EV_LIST_ITEM ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count

put_front (v: like item )
-- Add v at beginning. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_first: v = first
count_increased: count = old count + 1
cursor_not_moved: ( index = old index + 1) or ( before and old before )

put_i_th (v: like item ; i: INTEGER )
-- Replace item at i-th position by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
valid_index: i > 0 and i <= count
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = i_th (i)
not_has_old_item: not has (old i_th (i))
old_item_parent_void: (old i_th (i)). parent = void
count_same: count = old count
cursor_not_moved: index = old index

put_left (v: like item )
-- Add v to the left of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_before: not before
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index - 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index + 1

put_right (v: like item )
-- Add v to right of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_after: not after
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index + 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

replace (v: like item )
-- Replace current item by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = item
not_has_old_item: not has (old item )
old_item_parent_void: (old item ). parent = void
count_same: count = old count
cursor_not_moved: index = old index

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

swap (i: INTEGER )
-- Exchange_item at i-th position with item
-- at cursor position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Removal

prune (v: like item )
-- Remove v if present. Do not move cursor, except if
-- cursor was on v, move to right neighbor.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable: prunable
ensure then -- from SET
removed_count_change: old has (v) implies ( count = old count - 1)
not_removed_no_count_change: not old has (v) implies ( count = old count )
item_deleted: not has (v)
ensure then -- from EV_DYNAMIC_LIST
not_has_v: not has (v)
had_item_implies_parent_void: old has (v) implies v. parent = void
had_item_implies_count_decreased: old has (v) implies count = old count - 1
had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

dl_prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item. Move cursor to right neighbor.
-- (or after if no right neighbor).
-- (from EV_DYNAMIC_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after
ensure then -- from EV_DYNAMIC_LIST
v_removed: not has (old item )
parent_void: (old item ). parent = void
count_decreased: count = old count - 1
index_same: index = old index

remove_left
-- Remove item to left of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1
ensure then -- from EV_DYNAMIC_LIST
left_neighbor_removed: not has (old i_th ( index - 1))
parent_void: (old i_th ( index - 1)). parent = void
index_decreased: index = old index - 1

remove_right
-- Remove item to right of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index
ensure then -- from EV_DYNAMIC_LIST
right_neighbor_removed: not has (old i_th ( index + 1))
parent_void: (old i_th ( index + 1)). parent = void
index_same: index = old index

wipe_out
-- Remove all items.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Conversion

linear_representation : LINEAR [ EV_LIST_ITEM ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

add_choice (a_code: INTEGER ; a_label: STRING )
-- Add a_data to the combo box and enable its selection
-- with a_label.
require
label_not_void: a_label /= void
label_not_empty: not a_label. is_empty

fill_with_attributes (code: INTEGER )
-- Fill the list with attributes of table with code.
require
is_valid_code: is_valid_code (code)

lock_sensitiveness
-- Lock display string sensitiveness.

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

set_list_separator (a_sep: CHARACTER )
-- Set a_sep to the character to separate
-- integer values in the string representation.
-- Default value is comma.

set_value (s: STRING )
-- List values to select , coded with integers.
-- and comma-separated.

unlock_sensitiveness
-- Unlock display string sensitiveness.

feature -- Implementation

Changeable_comparison_criterion : BOOLEAN is False
-- May object_comparison be changed?
-- (Answer: no by default.
-- (from EV_ITEM_LIST )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

same (other: EV_ANY ): BOOLEAN
-- Is other Current?
-- (from EV_DYNAMIC_LIST )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

deselect_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when an item is deselected.
-- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES )
ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

select_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when an item is selected.
-- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES )
ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
not_void: Result /= void

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ EV_LIST_ITEM ]]; test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ EV_LIST_ITEM ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_LIST
selected_items_not_void: is_usable implies selected_items /= void
selected_items_first_is_selected_item: is_usable and not selected_items . is_empty implies selected_items . first = selected_item
selected_items_empty_xor_selected_item_not_void: is_usable implies selected_items . is_empty xor selected_item /= void
single_selection_implies_at_most_one_selected_item: is_usable and not multiple_selection_enabled implies selected_items . count <= 1
selection_size_within_bounds: is_usable implies selected_items . count <= count
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_ITEM_LIST
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_STRING_LIST


DV_TABLEROW_MULTILIST Chart

 class
DV_TABLEROW_MULTILIST

General
cluster: dataview.graphical
description: "Multi column list displaying database table rows."

Ancestors
DV_TABLEROW_LIST
EV_MULTI_COLUMN_LIST

Action sequences
column_resize_actions : EV_COLUMN_ACTION_SEQUENCE
column_title_click_actions : EV_COLUMN_ACTION_SEQUENCE
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
deselect_actions : EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
select_actions : EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE

Queries
infix " @ " (i: INTEGER ): [like item ] EV_MULTI_COLUMN_LIST_ROW
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
after : BOOLEAN
attribute_list : ARRAYED_LIST [ INTEGER ]
background_color : EV_COLOR
before : BOOLEAN
Changeable_comparison_criterion : BOOLEAN
column_alignment (a_column: INTEGER ): EV_TEXT_ALIGNMENT
column_alignments_assigned (alignments: LINKED_LIST [ EV_TEXT_ALIGNMENT ]): BOOLEAN
column_count : INTEGER
column_title (a_column: INTEGER ): STRING
column_titles_assigned (titles: ARRAY [ STRING ]): BOOLEAN
column_width (a_column: INTEGER ): INTEGER
column_widths_assigned (widths: ARRAY [ INTEGER ]): BOOLEAN
count : INTEGER
cursor : EV_DYNAMIC_LIST_CURSOR [ EV_MULTI_COLUMN_LIST_ROW ]
data : ANY
deny_cursor : EV_CURSOR
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] EV_MULTI_COLUMN_LIST_ROW
for_all (test: FUNCTION [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ], BOOLEAN ]): BOOLEAN
foreground_color : EV_COLOR
Full : BOOLEAN
has (v: [like item ] EV_MULTI_COLUMN_LIST_ROW ): BOOLEAN
has_capture : BOOLEAN
has_deselect_action (action: PROCEDURE [ ANY , TUPLE ]): BOOLEAN
has_focus : BOOLEAN
has_select_action (action: PROCEDURE [ ANY , TUPLE ]): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
i_th (i: INTEGER ): EV_MULTI_COLUMN_LIST_ROW
id_object (an_id: INTEGER ): IDENTIFIED
index : INTEGER
index_of (v: [like item ] EV_MULTI_COLUMN_LIST_ROW ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
information_set : BOOLEAN
is_destroyed : BOOLEAN
is_display_ready : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DV_TABLEROW_MULTILIST ): BOOLEAN
is_inserted (v: EV_MULTI_COLUMN_LIST_ROW ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : EV_MULTI_COLUMN_LIST_ROW
item_by_data (some_data: ANY ): [like item ] EV_MULTI_COLUMN_LIST_ROW
last : [like item ] EV_MULTI_COLUMN_LIST_ROW
linear_representation : LINEAR [ EV_MULTI_COLUMN_LIST_ROW ]
list_index : INTEGER
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
multiple_selection_enabled : BOOLEAN
object_comparison : BOOLEAN
object_id : INTEGER
occurrences (v: [like item ] EV_MULTI_COLUMN_LIST_ROW ): INTEGER
off : BOOLEAN
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pixmaps_height : INTEGER
pixmaps_width : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
row_height : INTEGER
same (other: EV_ANY ): BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
selected_item : EV_MULTI_COLUMN_LIST_ROW
selected_items : DYNAMIC_LIST [ EV_MULTI_COLUMN_LIST_ROW ]
sequential_occurrences (v: EV_MULTI_COLUMN_LIST_ROW ): INTEGER
table_code : INTEGER
table_code_set : BOOLEAN
tables_set : BOOLEAN
target_name : STRING
there_exists (test: FUNCTION [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ], BOOLEAN ]): BOOLEAN
title_list : ARRAYED_LIST [ STRING ]
title_list_set : BOOLEAN
title_shown : BOOLEAN
tooltip : STRING
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center (a_column: INTEGER )
align_text_left (a_column: INTEGER )
align_text_right (a_column: INTEGER )
append (s: SEQUENCE [ EV_MULTI_COLUMN_LIST_ROW ])
back
build
center_pointer
clear_selection
compare_objects
compare_references
copy (other: [like Current] DV_TABLEROW_MULTILIST )
default_create
destroy
disable_capture
disable_multiple_selection
disable_pebble_positioning
disable_sensitive
dl_prune (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
do_all (action: PROCEDURE [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ]]; test: FUNCTION [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ], BOOLEAN ])
enable_capture
enable_multiple_selection
enable_pebble_positioning
enable_sensitive
ensure_item_visible (an_item: EV_MULTI_COLUMN_LIST_ROW )
extend (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
extend_deselect_actions (action: PROCEDURE [ ANY , TUPLE ])
extend_select_actions (action: PROCEDURE [ ANY , TUPLE ])
fill (other: CONTAINER [ EV_MULTI_COLUMN_LIST_ROW ])
finish
force (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
hide
hide_title_row
merge_left (other: [like Current] DV_TABLEROW_MULTILIST )
merge_right (other: [like Current] DV_TABLEROW_MULTILIST )
move (i: INTEGER )
prune (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
prune_all (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
put (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
put_front (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
put_i_th (v: [like item ] EV_MULTI_COLUMN_LIST_ROW ; i: INTEGER )
put_left (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
put_right (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
refresh (tablerow_list: ARRAYED_LIST [ DB_TABLE ])
remove
remove_help_context
remove_left
remove_pebble
remove_right
remove_tooltip
replace (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
resize_column_to_content (a_column: INTEGER )
search (v: [like item ] EV_MULTI_COLUMN_LIST_ROW )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_attributes (a_list: ARRAYED_LIST [ INTEGER ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_column_alignment (an_alignment: EV_TEXT_ALIGNMENT ; a_column: INTEGER )
set_column_alignments (alignments: LINKED_LIST [ EV_TEXT_ALIGNMENT ])
set_column_title (a_title: STRING ; a_column: INTEGER )
set_column_titles (a_title_list: ARRAY [ STRING ])
set_column_width (a_width, a_column: INTEGER )
set_column_widths (widths: ARRAY [ INTEGER ])
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pixmaps_size (a_width, a_height: INTEGER )
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_tablecode (tablecode: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_tooltip (a_tooltip: STRING )
set_value_list_redirector (vlr: DV_VALUE_LIST_REDIRECTOR )
show
show_title_row
start
swap (i: INTEGER )
wipe_out


DV_TABLEROW_MULTILIST Flat contracts

 indexing
description: "Multi column list displaying database table rows."
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_TABLEROW_MULTILIST

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

attribute_list : ARRAYED_LIST [ INTEGER ]
-- List of table attributes to display in column titles.

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

column_count : INTEGER
-- Column count.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .column_count

cursor : EV_DYNAMIC_LIST_CURSOR [ EV_MULTI_COLUMN_LIST_ROW ]
-- Current cursor position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .cursor)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

first : like item
-- Item at first position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

i_th (i: INTEGER ): EV_MULTI_COLUMN_LIST_ROW
-- Item at i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .i_th (i))

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

index : INTEGER
-- Position of graphic selected element
-- in the buffer list.

list_index : INTEGER
-- Current position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of ith occurence of v.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index_of (v, i)

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_DYNAMIC_LIST
a_list_not_void: a_list /= void
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_MULTI_COLUMN_LIST_ROW
-- Item at current position.
-- (from EV_DYNAMIC_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable
ensure then -- from EV_DYNAMIC_LIST
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .item)

item_by_data (some_data: ANY ): like item
-- First item with some_data.
-- (from EV_ITEM_LIST )
require -- from EV_ITEM_LIST
not_destroyed: not is_destroyed
data_not_void: some_data /= void
ensure -- from EV_ITEM_LIST
bridge_ok: Result = implementation .item_by_data (some_data)

last : like item
-- Item at last position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

sequential_occurrences (v: EV_MULTI_COLUMN_LIST_ROW ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

row_height : INTEGER
-- Height in pixels of each row.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .row_height

selected_item : EV_MULTI_COLUMN_LIST_ROW
-- Currently selected item.
-- Topmost selected item if multiple items are selected.
-- (For multiple selections see selected_items ).
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .selected_item

selected_items : DYNAMIC_LIST [ EV_MULTI_COLUMN_LIST_ROW ]
-- Currently selected items.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: lists_equal (Result, implementation .selected_items)

table_code : INTEGER
-- Database table code.

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

title_list : ARRAYED_LIST [ STRING ]
-- List of column titles.

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

count : INTEGER
-- Number of items.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .count

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
count_definition: Result. count = count

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Does other contain the same elements?
-- (from LIST )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from LIST
indices_unchanged: list_index = old list_index and other. list_index = old other. list_index
true_implies_same_size: Result implies count = other. count

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LIST )

column_alignment (a_column: INTEGER ): EV_TEXT_ALIGNMENT
-- Result is alignment of column a_column.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column >= 1 and a_column <= column_count
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result. is_equal ( implementation .column_alignment (a_column))

column_title (a_column: INTEGER ): STRING
-- Title of a_column.
-- Returns "" if no title given yet.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_positive: a_column >= 1
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result. is_equal ( implementation .column_title (a_column))

column_width (a_column: INTEGER ): INTEGER
-- Width of a_column in pixels.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column >= 1 and a_column <= column_count
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .column_width (a_column)

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from EV_DYNAMIC_LIST )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_deselect_action (action: PROCEDURE [ ANY , TUPLE ]): BOOLEAN
-- Does list of actions executed when an item is deselected
-- contain action?

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

has_select_action (action: PROCEDURE [ ANY , TUPLE ]): BOOLEAN
-- Does list of actions executed when an item is selected
-- contain action?

information_set : BOOLEAN
-- Is table_code set or are multi-list columns
-- sufficiently defined?

is_display_ready : BOOLEAN
-- Has the object display been built?

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_inserted (v: EV_MULTI_COLUMN_LIST_ROW ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

multiple_selection_enabled : BOOLEAN
-- Can more than one item be selected?
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .multiple_selection_enabled

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

off : BOOLEAN
-- Is there no current item?
-- (from CHAIN )

pixmaps_height : INTEGER
-- Height of displayed pixmaps in Current.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .pixmaps_height

pixmaps_width : INTEGER
-- Width of displayed pixmaps in Current.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .pixmaps_width

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from SEQUENCE )

table_code_set : BOOLEAN
-- Has a table code been set?

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

title_list_set : BOOLEAN
-- Has a title list been set?

title_shown : BOOLEAN
-- Is a row displaying column titles shown?
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
bridge_ok: Result = implementation .title_shown

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
-- if it points to an item, Current must have it.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .valid_cursor (p)

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )

feature -- Status setting

align_text_center (a_column: INTEGER )
-- Display text of a_column centered.
-- First column is always left aligned.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column > 1 and a_column <= column_count

align_text_left (a_column: INTEGER )
-- Display text of a_column left aligned.
-- First column is always left aligned.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column > 1 and a_column <= column_count

align_text_right (a_column: INTEGER )
-- Display text of a_column right aligned.
-- First column is always left aligned.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column > 1 and a_column <= column_count

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

clear_selection
-- Make selected_items empty.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
selected_items_empty: selected_items . is_empty

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_multiple_selection
-- Allow only one item to be selected.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
not_multiple_selection_enabled: not multiple_selection_enabled

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_multiple_selection
-- Allow more than one item to be selected.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
multiple_selection_enabled: multiple_selection_enabled

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

ensure_item_visible (an_item: EV_MULTI_COLUMN_LIST_ROW )
-- Ensure an_item is visible in Current.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
is_displayed: is_displayed
an_item_contained: has (an_item)

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

hide_title_row
-- Hide row displaying column titles.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
not_title_shown: not title_shown

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_pixmaps_size (a_width: INTEGER ; a_height: INTEGER )
-- Set the size of displayed pixmaps in the Multicolumn list.
-- Note: The Default value is 16x16
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
valid_width: a_width > 0
valid_height: a_height > 0
ensure -- from EV_MULTI_COLUMN_LIST
width_set: pixmaps_width = a_width
height_set: pixmaps_height = a_height

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

show_title_row
-- Show row displaying column titles.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
ensure -- from EV_MULTI_COLUMN_LIST
title_shown: title_shown

feature -- Cursor movement

back
-- Move to previous position.
-- (from EV_DYNAMIC_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (No effect if empty)
-- (from CHAIN )
ensure then -- from CHAIN
at_last: not is_empty implies islast

forth
-- Move cursor to next position.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: list_index = old list_index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: list_index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from EV_DYNAMIC_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions.
-- (from EV_DYNAMIC_LIST )
ensure -- from CHAIN
too_far_right: (old list_index + i > count ) implies exhausted
too_far_left: (old list_index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( list_index = old list_index + i)

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from EV_DYNAMIC_LIST
empty_implies_after: is_empty implies after

feature -- Element change

append (s: SEQUENCE [ EV_MULTI_COLUMN_LIST_ROW ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

extend (v: like item )
-- Add v to end. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_last: v = last
count_increased: count = old count + 1
cursor_not_moved: ( list_index = old list_index ) or ( after and old after )

fill (other: CONTAINER [ EV_MULTI_COLUMN_LIST_ROW ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: list_index = old list_index + old other. count
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: list_index = old list_index
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count

put_front (v: like item )
-- Add v at beginning. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_first: v = first
count_increased: count = old count + 1
cursor_not_moved: ( list_index = old list_index + 1) or ( before and old before )

put_i_th (v: like item ; i: INTEGER )
-- Replace item at i-th position by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
valid_index: i > 0 and i <= count
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = i_th (i)
not_has_old_item: not has (old i_th (i))
old_item_parent_void: (old i_th (i)). parent = void
count_same: count = old count
cursor_not_moved: list_index = old list_index

put_left (v: like item )
-- Add v to the left of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_before: not before
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( list_index - 1)
count_increased: count = old count + 1
cursor_not_moved: list_index = old list_index + 1

put_right (v: like item )
-- Add v to right of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_after: not after
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( list_index + 1)
count_increased: count = old count + 1
cursor_not_moved: list_index = old list_index

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

replace (v: like item )
-- Replace current item by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = item
not_has_old_item: not has (old item )
old_item_parent_void: (old item ). parent = void
count_same: count = old count
cursor_not_moved: list_index = old list_index

resize_column_to_content (a_column: INTEGER )
-- Resize column a_column to width of its widest text.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column > 0 and a_column <= column_count

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_column_alignment (an_alignment: EV_TEXT_ALIGNMENT ; a_column: INTEGER )
-- Align the text of column a_column to an_alignment
-- The first column must stay as left aligned as MSDN
-- states that the first column can only be set as left aligned
-- for Win32.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column > 1 and a_column <= column_count
alignment_not_void: an_alignment /= void
ensure -- from EV_MULTI_COLUMN_LIST
column_alignment_assigned: column_alignment (a_column). is_equal (an_alignment)

set_column_alignments (alignments: LINKED_LIST [ EV_TEXT_ALIGNMENT ])
-- Assign alignments to column text alignments in order.
-- The first alignment element is ignored
-- (see set_column_alignment).
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
alignments_not_void: alignments /= void
ensure -- from EV_MULTI_COLUMN_LIST
column_alignments_assigned: column_alignments_assigned (alignments)

set_column_title (a_title: STRING ; a_column: INTEGER )
-- Assign a_title to the column_title (a_column).
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_positive: a_column > 0
a_title_not_void: a_title /= void
ensure -- from EV_MULTI_COLUMN_LIST
a_title_assigned: a_title. is_equal ( column_title (a_column))

set_column_width (a_width: INTEGER ; a_column: INTEGER )
-- Assign a_width column_width (a_column).
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
a_column_within_range: a_column > 0 and a_column <= column_count
a_width_positive: a_width >= 0
ensure -- from EV_MULTI_COLUMN_LIST
a_width_assigned: a_width = column_width (a_column)

set_column_widths (widths: ARRAY [ INTEGER ])
-- Assign widths to column widths in order.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
widths_not_void: widths /= void
ensure -- from EV_MULTI_COLUMN_LIST
column_widths_assigned: column_widths_assigned (widths)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

swap (i: INTEGER )
-- Exchange_item at i-th position with item
-- at cursor position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Removal

prune (v: like item )
-- Remove v if present. Do not move cursor, except if
-- cursor was on v, move to right neighbor.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable: prunable
ensure then -- from SET
removed_count_change: old has (v) implies ( count = old count - 1)
not_removed_no_count_change: not old has (v) implies ( count = old count )
item_deleted: not has (v)
ensure then -- from EV_DYNAMIC_LIST
not_has_v: not has (v)
had_item_implies_parent_void: old has (v) implies v. parent = void
had_item_implies_count_decreased: old has (v) implies count = old count - 1
had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies list_index = old list_index - 1

dl_prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item. Move cursor to right neighbor.
-- (or after if no right neighbor).
-- (from EV_DYNAMIC_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after
ensure then -- from EV_DYNAMIC_LIST
v_removed: not has (old item )
parent_void: (old item ). parent = void
count_decreased: count = old count - 1
index_same: list_index = old list_index

remove_left
-- Remove item to left of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
left_exists: list_index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: list_index = old list_index - 1
ensure then -- from EV_DYNAMIC_LIST
left_neighbor_removed: not has (old i_th ( list_index - 1))
parent_void: (old i_th ( list_index - 1)). parent = void
index_decreased: list_index = old list_index - 1

remove_right
-- Remove item to right of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
right_exists: list_index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: list_index = old list_index
ensure then -- from EV_DYNAMIC_LIST
right_neighbor_removed: not has (old i_th ( list_index + 1))
parent_void: (old i_th ( list_index + 1)). parent = void
index_same: list_index = old list_index

wipe_out
-- Remove all items.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Conversion

linear_representation : LINEAR [ EV_MULTI_COLUMN_LIST_ROW ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

build
-- Set up the list.
require -- from DV_TABLEROW_LIST
information_set: information_set

extend_deselect_actions (action: PROCEDURE [ ANY , TUPLE ])
-- Extend list of actions executed when an item is deselected.

extend_select_actions (action: PROCEDURE [ ANY , TUPLE ])
-- Extend list of actions executed when an item is selected.

refresh (tablerow_list: ARRAYED_LIST [ DB_TABLE ])
-- Fill the multi_column_list according to tablerow_list.
-- Select current item of tablerow_list if any.
require -- from DV_TABLEROW_LIST
not_void: al /= void

set_attributes (a_list: ARRAYED_LIST [ INTEGER ])
-- Set a_list to the list of database table attributes to display.

set_column_titles (a_title_list: ARRAY [ STRING ])
-- Set a_title_list to the column title list.
require -- from EV_MULTI_COLUMN_LIST
not_destroyed: not is_destroyed
titles_not_void: titles /= void
ensure -- from EV_MULTI_COLUMN_LIST
column_titles_assigned: column_titles_assigned (titles)
ensure then
title_list_set: title_list_set

set_tablecode (tablecode: INTEGER )
-- Set tablecode to table_code .
require -- from DV_TABLEROW_LIST
is_valid_code: is_valid_code (tablecode)

set_value_list_redirector (vlr: DV_VALUE_LIST_REDIRECTOR )
-- Set a value list redirector vlr to redirect
-- fixed column results from integer string to "explicit" string.

feature -- Implementation

Changeable_comparison_criterion : BOOLEAN is False
-- May object_comparison be changed?
-- (Answer: no by default.
-- (from EV_ITEM_LIST )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

column_alignments_assigned (alignments: LINKED_LIST [ EV_TEXT_ALIGNMENT ]): BOOLEAN
-- Are alignments of columns equal to alignments.
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
alignment_not_void: alignments /= void

column_titles_assigned (titles: ARRAY [ STRING ]): BOOLEAN
-- Are titles of columns equal to titles?
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
titles_not_void: titles /= void

column_widths_assigned (widths: ARRAY [ INTEGER ]): BOOLEAN
-- Are widths of columns equal to widths?
-- (from EV_MULTI_COLUMN_LIST )
require -- from EV_MULTI_COLUMN_LIST
widths_not_void: widths /= void

same (other: EV_ANY ): BOOLEAN
-- Is other Current?
-- (from EV_DYNAMIC_LIST )

feature -- Event handling

column_resize_actions : EV_COLUMN_ACTION_SEQUENCE
-- Actions to be performed
-- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES )
ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
not_void: Result /= void

column_title_click_actions : EV_COLUMN_ACTION_SEQUENCE
-- Actions to be performed
-- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES )
ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
not_void: Result /= void

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

deselect_actions : EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
-- Actions to be performed
-- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES )
ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

select_actions : EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
-- Actions to be performed
-- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES )
ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
not_void: Result /= void

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ]]; test: FUNCTION [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ EV_MULTI_COLUMN_LIST_ROW ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_ITEM_LIST
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from LIST
before_definition: before = ( list_index = 0)
after_definition: after = ( list_index = count + 1)
-- from CHAIN
non_negative_index: list_index >= 0
index_small_enough: list_index <= count + 1
off_definition: off = (( list_index = 0) or ( list_index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( list_index = 1))
islast_definition: islast = (( not is_empty ) and ( list_index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( list_index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLEROW_MULTILIST


DV_TEXT_FIELD Chart

 class
DV_TEXT_FIELD

General
cluster: dataview.graphical
description: "Text field or text area."

Ancestors
DV_SENSITIVE_STRING
EV_TEXT_FIELD

Action sequences
change_actions : EV_NOTIFY_ACTION_SEQUENCE
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
return_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
background_color : EV_COLOR
capacity : INTEGER
caret_position : INTEGER
data : ANY
deny_cursor : EV_CURSOR
foreground_color : EV_COLOR
has_capture : BOOLEAN
has_focus : BOOLEAN
has_selection : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_editable : BOOLEAN
is_locked : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
screen_x : INTEGER
screen_y : INTEGER
selected_text : STRING
selection_end : INTEGER
selection_start : INTEGER
target_name : STRING
text : STRING
text_length : INTEGER
tooltip : STRING
valid_caret_position (pos: INTEGER ): BOOLEAN
value : STRING
width : INTEGER
x_position : INTEGER
y_position : INTEGER

Commands
append_text (a_text: STRING )
center_pointer
copy (other: [like Current] DV_TEXT_FIELD )
copy_selection
cut_selection
default_create
delete_selection
deselect_all
destroy
disable_capture
disable_edit
disable_pebble_positioning
disable_sensitive
enable_capture
enable_edit
enable_pebble_positioning
enable_sensitive
hide
insert_text (a_text: STRING )
lock_sensitiveness
paste (a_position: INTEGER )
prepend_text (a_text: STRING )
remove_help_context
remove_pebble
remove_text
remove_tooltip
request_insensitive
request_sensitive
select_all
select_region (start_pos, end_pos: INTEGER )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_capacity (a_capacity: INTEGER )
set_caret_position (a_caret_position: INTEGER )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_minimum_width_in_characters (nb: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
set_tooltip (a_tooltip: STRING )
set_value (a_text: STRING )
show
unlock_sensitiveness


DV_TEXT_FIELD Flat contracts

 indexing
description: "Text field or text area."
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_TEXT_FIELD

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

capacity : INTEGER
-- Number of characters field can hold.
-- (from EV_TEXT_FIELD )
require -- from EV_TEXT_FIELD
not_destroyed: not is_destroyed

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

selected_text : STRING
-- Currently selected text.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result. is_equal ( implementation .selected_text)

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text of Current.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

text_length : INTEGER
-- Number of characters making up text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .text_length

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

value : STRING
-- Text area value.

feature -- Measurement

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

caret_position : INTEGER
-- Current position of caret.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .caret_position

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

has_selection : BOOLEAN
-- Does current have a selection?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .has_selection

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_editable : BOOLEAN
-- Is text editable?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .is_editable

is_locked : BOOLEAN
-- Is label sensitiveness locked?

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

selection_end : INTEGER
-- Index of last character selected
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .selection_end
within_range: Result >= 1 and Result <= text_length
consistent_with_selection_start: Result >= selection_start

selection_start : INTEGER
-- Index of first selected character.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .selection_start
within_range: Result >= 1 and Result <= text_length
consistent_with_selection_end: selection_end >= Result

valid_caret_position (pos: INTEGER ): BOOLEAN
-- Is pos a valid caret position?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .valid_caret_position (pos)

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_edit
-- Make Current read-only.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
is_editable: not is_editable

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_edit
-- Make Current editable.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
is_editable: is_editable

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_caret_position (a_caret_position: INTEGER )
-- Assign a_caret_posiiton to caret_position .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
valid_caret_position: valid_caret_position (a_caret_position)
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
caret_position_assigned: caret_position = a_caret_position

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

append_text (a_text: STRING )
-- Append a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_appended: check_text_modification (old text , a_text)
caret_not_moved: old caret_position = caret_position

insert_text (a_text: STRING )
-- Insert a_text to right of caret_position .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_insert_correctly: text . is_equal ((old text ). substring (1, (old caret_position - 1)) + a_text + (old text ). substring ((old caret_position ), (old text . count )))
caret_not_moved: old caret_position = caret_position

prepend_text (a_text: STRING )
-- Prepend a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_prepended: text . is_equal (a_text + old text )
caret_not_moved: old caret_position = caret_position

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
text_removed: text = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_capacity (a_capacity: INTEGER )
-- Assign a_capacity to capacity .
-- (from EV_TEXT_FIELD )
require -- from EV_TEXT_FIELD
not_destroyed: not is_destroyed
a_capacity_not_negative: a_capacity >= 0

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXT_COMPONENT
text_set: check_text_modification ( void , a_text)

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

feature -- Resizing

set_minimum_width_in_characters (nb: INTEGER )
-- Make a minimum of nb of the widest character visible
-- on one line.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
valid_nb: nb > 0
ensure -- from EV_TEXT_COMPONENT
minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

lock_sensitiveness
-- Lock display string sensitiveness.

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

set_value (a_text: STRING )
-- Set display string to a_text.

unlock_sensitiveness
-- Unlock display string sensitiveness.

feature -- Basic operation

copy_selection
-- Copy selected_text to clipboard.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
selection_copied: clipboard_content . is_equal ( selected_text )
text_unchanged: text . is_equal (old text )
caret_not_moved: caret_position = old caret_position

cut_selection
-- Move selected_text to clipboard.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
selection_in_clipboard: clipboard_content . is_equal (old selected_text )
selection_cut: text . is_equal ((old text ). substring (1, old selection_start - 1) + (old text ). substring (old selection_end + 1, (old text ). count ))

delete_selection
-- Delete current selection.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
has_no_selection: not has_selection
selection_deleted: text . is_equal ((old text ). substring (1, old selection_start - 1) + (old text ). substring (old selection_end + 1, (old text ). count ))

deselect_all
-- Unselect the current selection.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
not_has_selection: not has_selection

paste (a_position: INTEGER )
-- Insert text from clipboard at a_position.
-- No effect if clipboard is empty.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
a_position_within_range: a_position >= 1 and a_position <= text_length + 1
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
text_pasted_correctly: text . is_equal ((old text ). substring (1, a_position - 1) + clipboard_content + ((old text ). substring (a_position, ((old text ). count ))))
caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content . count

select_all
-- Select all text.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
positive_length: text_length > 0
ensure -- from EV_TEXT_COMPONENT
has_selection: has_selection
selection_start_set: selection_start = 1
selection_end_set: selection_end = text_length

select_region (start_pos, end_pos: INTEGER )
-- Select text between start_pos and end_pos inclusive.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
start_within_range: start_pos >= 1 and start_pos <= text_length
end_within_range: end_pos >= 1 and end_pos <= text_length
ensure -- from EV_TEXT_COMPONENT
has_selection: (start_pos /= end_pos) implies has_selection
selection_start_set: selection_start = start_pos
selection_end_set: selection_end = end_pos

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Event handling

change_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when text changes.
-- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES )
ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
not_void: Result /= void

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

return_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when return key is pressed.
-- (from EV_TEXT_FIELD_ACTION_SEQUENCES )
ensure -- from EV_TEXT_FIELD_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_TEXT_FIELD
capacity_not_negative: capacity >= 0
-- from EV_TEXT_COMPONENT
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TEXT_FIELD


DV_TEXT Chart

 class
DV_TEXT

General
cluster: dataview.graphical
description: "Text field or text area."

Ancestors
DV_SENSITIVE_STRING
EV_TEXT

Action sequences
change_actions : EV_NOTIFY_ACTION_SEQUENCE
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
background_color : EV_COLOR
caret_position : INTEGER
current_line_number : INTEGER
data : ANY
deny_cursor : EV_CURSOR
first_position_from_line_number (i: INTEGER ): INTEGER
foreground_color : EV_COLOR
has_capture : BOOLEAN
has_focus : BOOLEAN
has_selection : BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_editable : BOOLEAN
is_locked : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
last_line_not_empty : BOOLEAN
last_position_from_line_number (i: INTEGER ): INTEGER
line (i: INTEGER ): STRING
line_count : INTEGER
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
screen_x : INTEGER
screen_y : INTEGER
search (str: STRING ; start: INTEGER ): INTEGER
selected_text : STRING
selection_end : INTEGER
selection_start : INTEGER
target_name : STRING
text : STRING
text_length : INTEGER
tooltip : STRING
valid_caret_position (pos: INTEGER ): BOOLEAN
valid_line_index (i: INTEGER ): BOOLEAN
value : STRING
width : INTEGER
x_position : INTEGER
y_position : INTEGER

Commands
append_text (a_text: STRING )
center_pointer
copy (other: [like Current] DV_TEXT )
copy_selection
cut_selection
default_create
delete_selection
deselect_all
destroy
disable_capture
disable_edit
disable_pebble_positioning
disable_sensitive
enable_capture
enable_edit
enable_pebble_positioning
enable_sensitive
hide
insert_text (a_text: STRING )
lock_sensitiveness
paste (a_position: INTEGER )
prepend_text (a_text: STRING )
put_new_line
remove_help_context
remove_pebble
remove_text
remove_tooltip
request_insensitive
request_sensitive
scroll_to_line (i: INTEGER )
select_all
select_lines (first_line, last_line: INTEGER )
select_region (start_pos, end_pos: INTEGER )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_caret_position (a_caret_position: INTEGER )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_minimum_width_in_characters (nb: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
set_tooltip (a_tooltip: STRING )
set_value (a_text: STRING )
show
unlock_sensitiveness


DV_TEXT Flat contracts

 indexing
description: "Text field or text area."
date: "$Date: 2001/07/14 02:09:17 $"
revision: "$Revision: 1.2 $"

class interface
DV_TEXT

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

line (i: INTEGER ): STRING
-- Result is content of ith line.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
valid_line_index: valid_line_index (i) and then (i = line_count implies last_line_not_empty )
ensure -- from EV_TEXT
result_not_void: Result /= void

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

selected_text : STRING
-- Currently selected text.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result. is_equal ( implementation .selected_text)

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text of Current.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

text_length : INTEGER
-- Number of characters making up text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .text_length

tooltip : STRING
-- Tooltip displayed on Current.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
bridge_ok: (Result = void and implementation .tooltip = void ) or Result. is_equal ( implementation .tooltip)

value : STRING
-- Text area value.

feature -- Measurement

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

caret_position : INTEGER
-- Current position of caret.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .caret_position

current_line_number : INTEGER
-- Line currently containing cursor.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT
valid_line_index: valid_line_index (Result)

first_position_from_line_number (i: INTEGER ): INTEGER
-- Position of first character on i-th line.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
valid_line: valid_line_index (i) and then (i = line_count implies last_line_not_empty )
ensure -- from EV_TEXT
valid_caret_position: valid_caret_position (i)

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

has_selection : BOOLEAN
-- Does current have a selection?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .has_selection

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_editable : BOOLEAN
-- Is text editable?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .is_editable

is_locked : BOOLEAN
-- Is label sensitiveness locked?

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

last_position_from_line_number (i: INTEGER ): INTEGER
-- Position of last character on i-th line.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
valid_line: valid_line_index (i) and then (i = line_count implies last_line_not_empty )
ensure -- from EV_TEXT
valid_caret_position: valid_caret_position (i)

line_count : INTEGER
-- Number of lines in Current.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT
result_greater_zero: Result > 0

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

selection_end : INTEGER
-- Index of last character selected
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .selection_end
within_range: Result >= 1 and Result <= text_length
consistent_with_selection_start: Result >= selection_start

selection_start : INTEGER
-- Index of first selected character.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .selection_start
within_range: Result >= 1 and Result <= text_length
consistent_with_selection_end: selection_end >= Result

valid_caret_position (pos: INTEGER ): BOOLEAN
-- Is pos a valid caret position?
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
bridge_ok: Result = implementation .valid_caret_position (pos)

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_edit
-- Make Current read-only.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
is_editable: not is_editable

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_edit
-- Make Current editable.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
is_editable: is_editable

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_caret_position (a_caret_position: INTEGER )
-- Assign a_caret_posiiton to caret_position .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
valid_caret_position: valid_caret_position (a_caret_position)
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
caret_position_assigned: caret_position = a_caret_position

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

append_text (a_text: STRING )
-- Append a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_appended: check_text_modification (old text , a_text)
caret_not_moved: old caret_position = caret_position

insert_text (a_text: STRING )
-- Insert a_text to right of caret_position .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_insert_correctly: text . is_equal ((old text ). substring (1, (old caret_position - 1)) + a_text + (old text ). substring ((old caret_position ), (old text . count )))
caret_not_moved: old caret_position = caret_position

prepend_text (a_text: STRING )
-- Prepend a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
ensure -- from EV_TEXT_COMPONENT
text_prepended: text . is_equal (a_text + old text )
caret_not_moved: old caret_position = caret_position

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
text_removed: text = void

remove_tooltip
-- Make tooltip Void.
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
ensure -- from EV_TOOLTIPABLE
tooltip_removed: tooltip = void

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
text_not_void: a_text /= void
no_carriage_returns: not a_text. has ('%R')
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXT_COMPONENT
text_set: check_text_modification ( void , a_text)

set_tooltip (a_tooltip: STRING )
-- Assign a_tooltip to tooltip .
-- (from EV_TOOLTIPABLE )
require -- from EV_TOOLTIPABLE
not_destroyed: not is_destroyed
tooltip: a_tooltip /= void
a_tooltip_not_empty: not a_tooltip. is_empty
ensure -- from EV_TOOLTIPABLE
tooltip_assigned: a_tooltip. is_equal ( tooltip ) and tooltip /= a_tooltip

feature -- Resizing

set_minimum_width_in_characters (nb: INTEGER )
-- Make a minimum of nb of the widest character visible
-- on one line.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
valid_nb: nb > 0
ensure -- from EV_TEXT_COMPONENT
minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

lock_sensitiveness
-- Lock display string sensitiveness.

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

set_value (a_text: STRING )
-- Set display string to a_text.

unlock_sensitiveness
-- Unlock display string sensitiveness.

feature -- Basic operation

copy_selection
-- Copy selected_text to clipboard.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
ensure -- from EV_TEXT_COMPONENT
selection_copied: clipboard_content . is_equal ( selected_text )
text_unchanged: text . is_equal (old text )
caret_not_moved: caret_position = old caret_position

cut_selection
-- Move selected_text to clipboard.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
selection_in_clipboard: clipboard_content . is_equal (old selected_text )
selection_cut: text . is_equal ((old text ). substring (1, old selection_start - 1) + (old text ). substring (old selection_end + 1, (old text ). count ))

delete_selection
-- Delete current selection.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
has_selection: has_selection
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
has_no_selection: not has_selection
selection_deleted: text . is_equal ((old text ). substring (1, old selection_start - 1) + (old text ). substring (old selection_end + 1, (old text ). count ))

deselect_all
-- Unselect the current selection.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
ensure -- from EV_TEXT_COMPONENT
not_has_selection: not has_selection

paste (a_position: INTEGER )
-- Insert text from clipboard at a_position.
-- No effect if clipboard is empty.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
a_position_within_range: a_position >= 1 and a_position <= text_length + 1
is_editable: is_editable
ensure -- from EV_TEXT_COMPONENT
text_pasted_correctly: text . is_equal ((old text ). substring (1, a_position - 1) + clipboard_content + ((old text ). substring (a_position, ((old text ). count ))))
caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content . count

put_new_line
-- Insert return character at caret_position .
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed

scroll_to_line (i: INTEGER )
-- Ensure that line i is visible in Current.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
valid_line_index: valid_line_index (i) and then (i = line_count implies last_line_not_empty )

search (str: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of str at or after start;
-- 0 if none.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
valid_string: str /= void

select_all
-- Select all text.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
positive_length: text_length > 0
ensure -- from EV_TEXT_COMPONENT
has_selection: has_selection
selection_start_set: selection_start = 1
selection_end_set: selection_end = text_length

select_lines (first_line, last_line: INTEGER )
-- Select all lines from first_line to last_line.
-- (from EV_TEXT )
require -- from EV_TEXT
not_destroyed: not is_destroyed
valid_line_index: valid_line_index (first_line) and valid_line_index (last_line)
ensure -- from EV_TEXT
has_selection: has_selection

select_region (start_pos, end_pos: INTEGER )
-- Select text between start_pos and end_pos inclusive.
-- (from EV_TEXT_COMPONENT )
require -- from EV_TEXT_COMPONENT
not_destroyed: not is_destroyed
start_within_range: start_pos >= 1 and start_pos <= text_length
end_within_range: end_pos >= 1 and end_pos <= text_length
ensure -- from EV_TEXT_COMPONENT
has_selection: (start_pos /= end_pos) implies has_selection
selection_start_set: selection_start = start_pos
selection_end_set: selection_end = end_pos

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

last_line_not_empty : BOOLEAN
-- Has last line at least one character?
-- (from EV_TEXT )

valid_line_index (i: INTEGER ): BOOLEAN
-- Is i a valid line index?
-- (from EV_TEXT )

feature -- Event handling

change_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when text changes.
-- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES )
ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
not_void: Result /= void

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_TEXT_COMPONENT
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TEXT


DV_TITLED_WIDGET Chart

 class
DV_TITLED_WIDGET

General
cluster: dataview.graphical
description: "Text component with a title. Can be displayed vertically or horizontally"
create: make_vertical_with_title , make_horizontal_with_title

Ancestors
ANY

Queries
box : DV_BOX
field : EV_WIDGET
is_horizontal : BOOLEAN
is_vertical : BOOLEAN
label : DV_LABEL

Commands
change_field (new_field: EV_WIDGET )
make_horizontal_with_title (txt: STRING )
make_vertical_with_title (txt: STRING )


DV_TITLED_WIDGET Flat contracts

 indexing
description: "Text component with a title. Can be displayed vertically or horizontally"
date: "$Date: 2001/07/05 16:06:53 $"
revision: "$Revision: 1.1 $"

class interface
DV_TITLED_WIDGET

create

make_vertical_with_title (txt: STRING )
-- Initialization
require
not_void: txt /= void

make_horizontal_with_title (txt: STRING )
-- Initialization
require
not_void: txt /= void

feature -- Initialization

make_horizontal_with_title (txt: STRING )
-- Initialization
require
not_void: txt /= void

make_vertical_with_title (txt: STRING )
-- Initialization
require
not_void: txt /= void

feature -- Access

box : DV_BOX
-- Box containing field.

field : EV_WIDGET
-- Field.

label : DV_LABEL
-- Title label.

feature -- Status report

is_horizontal : BOOLEAN
-- Is the display horizontal?

is_vertical : BOOLEAN
-- Is the display vertical?

feature -- Basic operations

change_field (new_field: EV_WIDGET )
-- Replace field with new_field.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TITLED_WIDGET


DV_VERTICAL_BOX Chart

 class
DV_VERTICAL_BOX

General
cluster: dataview.graphical
description: "Vertical box for display elements"
create: make_without_borders , make

Ancestors
DV_BOX
EV_VERTICAL_BOX

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
infix " @ " (i: INTEGER ): [like item ] EV_WIDGET
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
after : BOOLEAN
background_color : EV_COLOR
before : BOOLEAN
border_width : INTEGER
client_height : INTEGER
client_width : INTEGER
count : INTEGER
cursor : EV_DYNAMIC_LIST_CURSOR [ EV_WIDGET ]
data : ANY
deny_cursor : EV_CURSOR
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] EV_WIDGET
for_all (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
foreground_color : EV_COLOR
Full : BOOLEAN
has (v: [like item ] EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
i_th (i: INTEGER ): EV_WIDGET
id_object (an_id: INTEGER ): IDENTIFIED
index : INTEGER
index_of (v: [like item ] EV_WIDGET ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_default_non_expand : BOOLEAN
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DV_VERTICAL_BOX ): BOOLEAN
is_homogeneous : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_item_expanded (an_item: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : EV_WIDGET
last : [like item ] EV_WIDGET
linear_representation : LINEAR [ EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
occurrences (v: [like item ] EV_WIDGET ): INTEGER
off : BOOLEAN
padding : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
same (other: EV_ANY ): BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
sequential_occurrences (v: EV_WIDGET ): INTEGER
target_name : STRING
there_exists (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
append (s: SEQUENCE [ EV_WIDGET ])
back
center_pointer
copy (other: [like Current] DV_VERTICAL_BOX )
default_create
destroy
disable_borders
disable_capture
disable_default_expand
disable_homogeneous
disable_item_expand (an_item: EV_WIDGET )
disable_padding
disable_pebble_positioning
disable_sensitive
dl_prune (v: [like item ] EV_WIDGET )
do_all (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]]; test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ])
enable_borders
enable_capture
enable_default_expand
enable_homogeneous
enable_item_expand (an_item: EV_WIDGET )
enable_padding
enable_pebble_positioning
enable_sensitive
extend (widget: EV_WIDGET )
extend_cell
extend_separator
fill (other: CONTAINER [ EV_WIDGET ])
finish
force (v: [like item ] EV_WIDGET )
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
hide
make
make_without_borders
merge_left (other: [like Current] DV_VERTICAL_BOX )
merge_radio_button_groups (other: EV_CONTAINER )
merge_right (other: [like Current] DV_VERTICAL_BOX )
move (i: INTEGER )
propagate_background_color
propagate_foreground_color
prune (v: [like item ] EV_WIDGET )
prune_all (v: [like item ] EV_WIDGET )
put (v: [like item ] EV_WIDGET )
put_front (v: [like item ] EV_WIDGET )
put_i_th (v: [like item ] EV_WIDGET ; i: INTEGER )
put_left (v: [like item ] EV_WIDGET )
put_right (v: [like item ] EV_WIDGET )
remove
remove_help_context
remove_left
remove_pebble
remove_right
replace (v: [like item ] EV_WIDGET )
search (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_border_width (value: INTEGER )
set_data (some_data: [like data ] ANY )
set_default
set_default_border_width (new_border_width: INTEGER )
set_default_colors
set_default_padding (new_padding: INTEGER )
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_padding (value: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_target_menu_mode
set_target_name (a_name: STRING )
show
start
swap (i: INTEGER )
wipe_out


DV_VERTICAL_BOX Flat contracts

 indexing
description: "Vertical box for display elements"
date: "$Date: 2001/07/14 02:09:18 $"
revision: "$Revision: 1.2 $"

class interface
DV_VERTICAL_BOX

create

make
-- Initialize.
-- (from DV_BOX )

make_without_borders
-- Initialize.
-- Box has no borders: use this to have a nice display
-- when box is contained in another box.
-- (from DV_BOX )

feature -- Initialization

make
-- Initialize.
-- (from DV_BOX )

make_without_borders
-- Initialize.
-- Box has no borders: use this to have a nice display
-- when box is contained in another box.
-- (from DV_BOX )

set_default
-- Initialize default values
-- (from DV_BOX )

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

cursor : EV_DYNAMIC_LIST_CURSOR [ EV_WIDGET ]
-- Current cursor position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .cursor)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

first : like item
-- Item at first position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

i_th (i: INTEGER ): EV_WIDGET
-- Item at i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result. is_equal ( implementation .i_th (i))

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

index : INTEGER
-- Current position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of ith occurence of v.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .index_of (v, i)

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_DYNAMIC_LIST
a_list_not_void: a_list /= void
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Item at current position.
-- (from EV_DYNAMIC_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item
ensure then -- from EV_DYNAMIC_LIST
not_void: Result /= void
bridge_ok: Result. is_equal ( implementation .item)

last : like item
-- Item at last position
-- (from CHAIN )
require -- from CHAIN
not_empty: not is_empty

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

sequential_occurrences (v: EV_WIDGET ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

count : INTEGER
-- Number of items.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .count

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
count_definition: Result. count = count

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Does other contain the same elements?
-- (from LIST )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from LIST
indices_unchanged: index = old index and other. index = old other. index
true_implies_same_size: Result implies count = other. count

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LIST )

border_width : INTEGER
-- Width of border around container in pixels.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .border_width
positive: Result >= 0

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from EV_DYNAMIC_LIST )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_default_non_expand : BOOLEAN
-- Can't elements be expanded by default?
-- (from DV_BOX )

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_homogeneous : BOOLEAN
-- Are all items forced to have same dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .is_homogeneous

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_item_expanded (an_item: EV_WIDGET ): BOOLEAN
-- Is an_item expanded to occupy available spare space?
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
bridge_ok: Result = implementation .is_item_expanded (an_item)

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from CHAIN )
ensure -- from CHAIN
valid_position: Result implies not is_empty

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

off : BOOLEAN
-- Is there no current item?
-- (from CHAIN )

padding : INTEGER
-- Space between children in pixels.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
bridge_ok: Result = implementation .padding
positive: Result >= 0

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from SEQUENCE )
require -- from ACTIVE
True
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
-- if it points to an item, Current must have it.
-- (from EV_DYNAMIC_LIST )
ensure then -- from EV_DYNAMIC_LIST
bridge_ok: Result = implementation .valid_cursor (p)

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )
require -- from ACTIVE
True
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_borders
-- Display without borders.
-- (from DV_BOX )

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_default_expand
-- Disable default element displays expansion.
-- (from DV_BOX )
ensure -- from DV_BOX
is_default_non_expand: is_default_non_expand

disable_homogeneous
-- Allow items to have different dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
not_is_homogeneous: not is_homogeneous

disable_item_expand (an_item: EV_WIDGET )
-- Do not expand an_item to occupy avalible spare space.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
not_an_item_expanded: not is_item_expanded (an_item)

disable_padding
-- Display without padding.
-- (from DV_BOX )

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_borders
-- Display with borders.
-- (from DV_BOX )

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_default_expand
-- Enable default element displays expansion.
-- (from DV_BOX )
ensure -- from DV_BOX
is_default_expand: not is_default_non_expand

enable_homogeneous
-- Force all items to have same dimensions.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
ensure -- from EV_BOX
is_homogeneous: is_homogeneous

enable_item_expand (an_item: EV_WIDGET )
-- Expand an_item to occupy avalible spare space.
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
has_an_item: has (an_item)
ensure -- from EV_BOX
an_item_expanded: is_item_expanded (an_item)

enable_padding
-- Display with padding.
-- (from DV_BOX )

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_border_width (value: INTEGER )
-- Assign value to border_width .
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
positive_value: value >= 0
ensure -- from EV_BOX
border_width_assigned: border_width = value

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_padding (value: INTEGER )
-- Assign value to padding .
-- (from EV_BOX )
require -- from EV_BOX
not_destroyed: not is_destroyed
positive_value: value >= 0
ensure -- from EV_BOX
padding_assigned: padding = value

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Cursor movement

back
-- Move to previous position.
-- (from EV_DYNAMIC_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (No effect if empty)
-- (from CHAIN )
ensure then -- from CHAIN
at_last: not is_empty implies islast

forth
-- Move cursor to next position.
-- (from EV_DYNAMIC_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from EV_DYNAMIC_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions.
-- (from EV_DYNAMIC_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from EV_DYNAMIC_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from EV_DYNAMIC_LIST
empty_implies_after: is_empty implies after

feature -- Element change

append (s: SEQUENCE [ EV_WIDGET ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty
ensure then -- from DYNAMIC_LIST
other_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count
ensure -- from EV_CONTAINER
has_v: has (v)

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from SET
in_set_already: old has (v) implies ( count = old count )
added_to_set: not old has (v) implies ( count = old count + 1)
ensure then -- from CHAIN
same_count: count = old count
ensure -- from EV_CONTAINER
has_v: has (v)

put_front (v: like item )
-- Add v at beginning. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_first: v = first
count_increased: count = old count + 1
cursor_not_moved: ( index = old index + 1) or ( before and old before )

put_i_th (v: like item ; i: INTEGER )
-- Replace item at i-th position by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
valid_index: i > 0 and i <= count
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = i_th (i)
not_has_old_item: not has (old i_th (i))
old_item_parent_void: (old i_th (i)). parent = void
count_same: count = old count
cursor_not_moved: index = old index

put_left (v: like item )
-- Add v to the left of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_before: not before
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index - 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index + 1

put_right (v: like item )
-- Add v to right of cursor position. Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
not_after: not after
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_at_index_plus_one: v = i_th ( index + 1)
count_increased: count = old count + 1
cursor_not_moved: index = old index

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

replace (v: like item )
-- Replace current item by v.
-- (from EV_DYNAMIC_LIST )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_CONTAINER
has_v: has (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
item_replaced: v = item
not_has_old_item: not has (old item )
old_item_parent_void: (old item ). parent = void
count_same: count = old count
cursor_not_moved: index = old index

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

swap (i: INTEGER )
-- Exchange_item at i-th position with item
-- at cursor position.
-- (from EV_DYNAMIC_LIST )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Removal

prune (v: like item )
-- Remove v if present. Do not move cursor, except if
-- cursor was on v, move to right neighbor.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable: prunable
ensure then -- from SET
removed_count_change: old has (v) implies ( count = old count - 1)
not_removed_no_count_change: not old has (v) implies ( count = old count )
item_deleted: not has (v)
ensure then -- from EV_DYNAMIC_LIST
not_has_v: not has (v)
had_item_implies_parent_void: old has (v) implies v. parent = void
had_item_implies_count_decreased: old has (v) implies count = old count - 1
had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

dl_prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item. Move cursor to right neighbor.
-- (or after if no right neighbor).
-- (from EV_DYNAMIC_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after
ensure then -- from EV_DYNAMIC_LIST
v_removed: not has (old item )
parent_void: (old item ). parent = void
count_decreased: count = old count - 1
index_same: index = old index

remove_left
-- Remove item to left of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1
ensure then -- from EV_DYNAMIC_LIST
left_neighbor_removed: not has (old i_th ( index - 1))
parent_void: (old i_th ( index - 1)). parent = void
index_decreased: index = old index - 1

remove_right
-- Remove item to right of cursor position.
-- Do not move cursor.
-- (from EV_DYNAMIC_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index
ensure then -- from EV_DYNAMIC_LIST
right_neighbor_removed: not has (old i_th ( index + 1))
parent_void: (old i_th ( index + 1)). parent = void
index_same: index = old index

wipe_out
-- Remove all items.
-- (from EV_DYNAMIC_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Conversion

linear_representation : LINEAR [ EV_WIDGET ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

extend (widget: EV_WIDGET )
-- Add widget to end of structure.
-- (from DV_BOX )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
require -- from EV_DYNAMIC_LIST
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: not same (v)
v_not_parent_of_current: not is_parent_recursive (v)
ensure -- from EV_CONTAINER
has_v: has (v)
ensure -- from EV_DYNAMIC_LIST
parent_is_current: v. parent = Current
v_is_last: v = last
count_increased: count = old count + 1
cursor_not_moved: ( index = old index ) or ( after and old after )

extend_cell
-- Add a cell, i.e. an empty display element,
-- to end of structure.
-- (from DV_BOX )

extend_separator
-- Add a non-expandable separator to end
-- of structure.

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

set_default_border_width (new_border_width: INTEGER )
-- Set new_border_width as default border width.
-- (from DV_BOX )

set_default_padding (new_padding: INTEGER )
-- Set new_padding as default padding.
-- (from DV_BOX )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

same (other: EV_ANY ): BOOLEAN
-- Is other Current?
-- (from EV_DYNAMIC_LIST )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
-- Actions to be performed when a new item is added.
-- (from EV_CONTAINER_ACTION_SEQUENCES )
ensure -- from EV_CONTAINER_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ EV_WIDGET ]]; test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ EV_WIDGET ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_VERTICAL_BOX


cluster dataview.processing

 Cluster
dataview.processing

Supercluster
dataview

Classes
DV_CHOICE_CREATOR
DV_COMPONENT
DV_CONTROL_NAVIGATOR
DV_CREATOR
DV_DATABASE_HANDLE
DV_INTERACTIVE_SEARCHER
DV_LOCATED_VALUE_REDIRECTOR
DV_MESSAGES
DV_SEARCHER
DV_TABLE_COMPONENT
DV_TABLEROW_FIELD
DV_TABLEROW_FIELDS
DV_TABLEROW_ID_PROVIDER
DV_TABLEROWS_COMPONENT
DV_TABLEROWS_NAVIGATOR
DV_TYPED_SEARCHER
DV_VALUE_LIST_REDIRECTOR
DV_VALUE_REDIRECTOR


DV_CHOICE_CREATOR Chart

 class
DV_CHOICE_CREATOR

General
cluster: dataview.processing
description: "Objects that enable to create a database table row and let user select foreign keys of new row."
create: make

Ancestors
DB_TABLES_ACCESS_USE
DV_CREATOR
DV_MESSAGES

Queries
can_be_activated : BOOLEAN
control_set : BOOLEAN
creation_confirmation (table_name: STRING ): STRING
creation_done (table_name: STRING ): STRING
deletion_confirmation (table_name: STRING ): STRING
deletion_done (table_name: STRING ): STRING
empty_combo_item_label : STRING
enter_field_value (type, name: STRING ): STRING
is_activated : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
retrieve_field_value (type, name: STRING ): STRING
selection_window_title (table_name: STRING ): STRING
table_component_set : BOOLEAN
tablerows_selected (count: INTEGER ): STRING
tables_set : BOOLEAN
type_not_recognized (name: STRING ): STRING
undetermined_table_name : STRING
update_done (table_name: STRING ): STRING
wrong_date_format (name: STRING ): STRING
wrong_datetime_format (name: STRING ): STRING

Commands
make
set_control (ctrl: DV_SENSITIVE_CONTROL )
set_tablerow_selector (tr_selector: DV_TABLEROW_ID_PROVIDER )


DV_CHOICE_CREATOR Flat contracts

 indexing
description: "Objects that enable to create a database table row and let user select foreign keys of new row."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_CHOICE_CREATOR

create

make
-- Initialize.

feature -- Initialization

make
-- Initialize.

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

control_set : BOOLEAN
-- Has a controller for creation been set?

is_activated : BOOLEAN
-- Is component activated?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

table_component_set : BOOLEAN
-- Has a table component (where the created rows will be
-- displayed set?
-- (from DV_CREATOR )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

feature -- Basic operations

set_control (ctrl: DV_SENSITIVE_CONTROL )
-- Set control to trigger the creation to ctrl.
require
not_activated: not is_activated
control_not_void: ctrl /= void
ensure
control_set: control_set

set_tablerow_selector (tr_selector: DV_TABLEROW_ID_PROVIDER )
-- Set associated component to select foreign key values.
require
not_activated: not is_activated
component_not_void: tr_selector /= void

feature --

enter_field_value (type, name: STRING ): STRING
-- Value of field with name and type not valid message.
-- (from DV_MESSAGES )

retrieve_field_value (type, name: STRING ): STRING
-- Value of field with name and type retrieval failure message.
-- (from DV_MESSAGES )

type_not_recognized (name: STRING ): STRING
-- Type of field with name not recognized message.
-- (from DV_MESSAGES )

wrong_date_format (name: STRING ): STRING
-- Wrong date type format for field with name message.
-- (from DV_MESSAGES )

wrong_datetime_format (name: STRING ): STRING
-- Wrong date & time type format for field with name message.
-- (from DV_MESSAGES )

feature -- Combo box

empty_combo_item_label : STRING
-- Label for an empty combo item value.
-- (from DV_MESSAGES )

feature -- Creation

creation_confirmation (table_name: STRING ): STRING
-- Table row creation on table_name confirmation message.
-- (from DV_MESSAGES )

creation_done (table_name: STRING ): STRING
-- Table row creation on table_name successful message.
-- (from DV_MESSAGES )

feature -- Deletion

deletion_confirmation (table_name: STRING ): STRING
-- Table row deletion on table_name confirmation message.
-- (from DV_MESSAGES )

deletion_done (table_name: STRING ): STRING
-- Table row deletion on table_name successful message.
-- (from DV_MESSAGES )

feature -- Selection

tablerows_selected (count: INTEGER ): STRING
-- Database selection carried out message. count table rows
-- have been selected.
-- (from DV_MESSAGES )

feature -- Update

update_done (table_name: STRING ): STRING
-- Table row update on table_name successful message.
-- (from DV_MESSAGES )

feature -- Window to select foreign key values for creation

selection_window_title (table_name: STRING ): STRING
-- Selection window title.
-- (from DV_MESSAGES )

undetermined_table_name : STRING
-- Undetermined table name (use for selection_window_title ).
-- (from DV_MESSAGES )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_CHOICE_CREATOR


DV_COMPONENT Chart

 deferred class
DV_COMPONENT

General
cluster: dataview.processing
description: "Component that has to be activated."

Ancestors
ANY

Queries
can_be_activated : BOOLEAN
is_activated : BOOLEAN

Commands
activate


DV_COMPONENT Flat contracts

 indexing
description: "Component that has to be activated."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_COMPONENT

feature -- Initialization

activate
-- Activate component.
require
can_be_activated: can_be_activated
ensure
is_activated: is_activated

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

is_activated : BOOLEAN
-- Is component activated?

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_COMPONENT


DV_CONTROL_NAVIGATOR Chart

 class
DV_CONTROL_NAVIGATOR

General
cluster: dataview.processing
description: "Objects that enable to navigate among a list of database table rows."
create: make

Ancestors
DV_TABLEROWS_NAVIGATOR

Queries
can_be_activated : BOOLEAN
can_be_activated_with_list : BOOLEAN
display_list_set : BOOLEAN
is_activated : BOOLEAN

Commands
make
reactivate
set_display_list (display_l: DV_TABLEROW_LIST )
set_list_edition_control (list_edition_ctrl: DV_SENSITIVE_CONTROL )
set_next_control (next_ctrl: DV_SENSITIVE_CONTROL )
set_previous_control (previous_ctrl: DV_SENSITIVE_CONTROL )


DV_CONTROL_NAVIGATOR Flat contracts

 indexing
description: "Objects that enable to navigate among a list of database table rows."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_CONTROL_NAVIGATOR

create

make
--Initialize.

feature -- Initialization

make
--Initialize.

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

can_be_activated_with_list : BOOLEAN
-- Can the component be activated if a display list is set?

display_list_set : BOOLEAN
-- Has a display list been set?

is_activated : BOOLEAN
-- Is component activated?

feature -- Basic operations

reactivate
-- Reset component and reactivate it from db_selectable_component .
-- (Simply activate it if it was not activated.)
require -- from DV_TABLEROWS_NAVIGATOR
can_be_activated: can_be_activated
ensure -- from DV_TABLEROWS_NAVIGATOR
is_activated: is_activated

set_display_list (display_l: DV_TABLEROW_LIST )
-- Set display list to navigate through selection results.
-- display_list can be changed after activation to display
-- different results on different lists. Please use this
-- capability carefully and manage potential changes necessary
-- on DV_TABLE_COMPONENT and DV_SEARCHER .
require
not_void: display_l /= void
information_set_for_list_if_activated: is_activated implies can_be_activated_with_list
ensure
display_list_set: display_list_set

set_list_edition_control (list_edition_ctrl: DV_SENSITIVE_CONTROL )
-- Set list_edition_ctrl as control to raise display list.
-- Warning: action to raise the list is not added, component
-- only manage sensitiveness.
-- Note: display_list_set is not mandatory.
require
not_void: list_edition_ctrl /= void

set_next_control (next_ctrl: DV_SENSITIVE_CONTROL )
-- Set next_ctrl as control to go to next page.
require
not_void: next_ctrl /= void

set_previous_control (previous_ctrl: DV_SENSITIVE_CONTROL )
-- Set previous_ctrl as control to go to previous page.
require
not_void: previous_ctrl /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_CONTROL_NAVIGATOR


DV_CREATOR Chart

 deferred class
DV_CREATOR

General
cluster: dataview.processing
description: "Objects that enable to create adatabase table row."

Ancestors
DV_COMPONENT

Queries
can_be_activated : BOOLEAN
control_set : BOOLEAN
is_activated : BOOLEAN
table_component_set : BOOLEAN

Commands
activate


DV_CREATOR Flat contracts

 indexing
description: "Objects that enable to create adatabase table row."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_CREATOR

feature -- Initialization

activate
-- Activate component.
-- (from DV_COMPONENT )
require -- from DV_COMPONENT
can_be_activated: can_be_activated
ensure -- from DV_COMPONENT
is_activated: is_activated

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

control_set : BOOLEAN
-- Is creation control system set?

is_activated : BOOLEAN
-- Is component activated?
-- (from DV_COMPONENT )

table_component_set : BOOLEAN
-- Has a table component (where the created rows will be
-- displayed set?

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_CREATOR


DV_DATABASE_HANDLE Chart

 class
DV_DATABASE_HANDLE

General
cluster: dataview.processing
description: "Objects that enables to set default valuesfor DB_TABLE_COMPONENT without creating an instanceof the class."
create: make_for_settings

Ancestors
ANY

Queries
database_handler : ABSTRACT_DB_TABLE_MANAGER
database_handler_set : BOOLEAN

Commands
basic_confirmation_handler (message: STRING ; action_to_confirm: PROCEDURE [ ANY , TUPLE ])
basic_message_handler (message: STRING )
make_for_settings
set_database_handler (db_handler: ABSTRACT_DB_TABLE_MANAGER )


DV_DATABASE_HANDLE Flat contracts

 indexing
description: "Objects that enables to set default valuesfor DB_TABLE_COMPONENT without creating an instanceof the class."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_DATABASE_HANDLE

create

make_for_settings
-- Give access.

feature -- Initialization

make_for_settings
-- Give access.

feature -- Access

basic_confirmation_handler (message: STRING ; action_to_confirm: PROCEDURE [ ANY , TUPLE ])
-- Execute action_to_confirm without confirmation.

basic_message_handler (message: STRING )
-- Display message on standard output.

database_handler : ABSTRACT_DB_TABLE_MANAGER
-- Interface with the database.

feature -- Status report

database_handler_set : BOOLEAN
-- Is a database handler set?

feature -- Basic operations

set_database_handler (db_handler: ABSTRACT_DB_TABLE_MANAGER )
-- Set db_handler to
-- database_handler .

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_DATABASE_HANDLE


DV_INTERACTIVE_SEARCHER Chart

 class
DV_INTERACTIVE_SEARCHER

General
cluster: dataview.processing
description: "Objects that enable user to perform a database selectiondetermined at run-time."
create: make

Ancestors
DV_SEARCHER

Queries
can_be_activated : BOOLEAN
is_activated : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
tables_set : BOOLEAN
user_component_set : BOOLEAN

Commands
make
read
set_case_selector (a_case_selector: DV_SENSITIVE_CHECK )
set_column_selector (a_col_selector: DV_SENSITIVE_INTEGER )
set_control (a_ctrl: DV_SENSITIVE_CONTROL )
set_qualification_selector (a_qual_selector: DV_SENSITIVE_INTEGER )
set_value_selector (a_val_selector: DV_SENSITIVE_STRING )


DV_INTERACTIVE_SEARCHER Flat contracts

 indexing
description: "Objects that enable user to perform a database selectiondetermined at run-time."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_INTERACTIVE_SEARCHER

create

make
-- Initialize.

feature -- Initialization

make
-- Initialize.

feature -- Status report

can_be_activated : BOOLEAN
-- Can component be activated?

is_activated : BOOLEAN
-- Is component activated?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

user_component_set : BOOLEAN
-- Is component user set?
-- (from DV_SEARCHER )

feature -- Basic operations

read
-- Read the database according to qualifying clause.
require
is_activated: is_activated

set_case_selector (a_case_selector: DV_SENSITIVE_CHECK )
-- Set case selector to a_case_selector.
require
not_void: a_case_selector /= void

set_column_selector (a_col_selector: DV_SENSITIVE_INTEGER )
-- Set column selector to a_col_selector.
require
not_void: a_col_selector /= void

set_control (a_ctrl: DV_SENSITIVE_CONTROL )
-- Set a_ctrl to trigger a search.
require
not_void: a_ctrl /= void

set_qualification_selector (a_qual_selector: DV_SENSITIVE_INTEGER )
-- Set qualification selector to a_qual_selector.
require
not_void: a_qual_selector /= void

set_value_selector (a_val_selector: DV_SENSITIVE_STRING )
-- Set value selector to a_val_selector.
require
not_void: a_val_selector /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_INTERACTIVE_SEARCHER


DV_LOCATED_VALUE_REDIRECTOR Chart

 class
DV_LOCATED_VALUE_REDIRECTOR

General
cluster: dataview.processing
description: "Objects that contain a VALUE_REDIRECTOR positionned with an integer"

Ancestors
ANY

Queries
location : INTEGER
value_redirector : DV_VALUE_REDIRECTOR

Commands
set_location (v: INTEGER )
set_value_redirector (v: DV_VALUE_REDIRECTOR )


DV_LOCATED_VALUE_REDIRECTOR Flat contracts

 indexing
description: "Objects that contain a VALUE_REDIRECTOR positionned with an integer"
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_LOCATED_VALUE_REDIRECTOR

feature -- Access

location : INTEGER
-- Position in a list.

value_redirector : DV_VALUE_REDIRECTOR
-- Value redirector.

feature -- Settings

set_location (v: INTEGER )
-- Set location with v.
ensure
location_set: location = v

set_value_redirector (v: DV_VALUE_REDIRECTOR )
-- Set value_redirector with v.
ensure
value_redirector_set: value_redirector = v

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_LOCATED_VALUE_REDIRECTOR


DV_MESSAGES Chart

 deferred class
DV_MESSAGES

General
cluster: dataview.processing
description: "Objects that stores default messages."

Ancestors
ANY

Queries
creation_confirmation (table_name: STRING ): STRING
creation_done (table_name: STRING ): STRING
deletion_confirmation (table_name: STRING ): STRING
deletion_done (table_name: STRING ): STRING
empty_combo_item_label : STRING
enter_field_value (type, name: STRING ): STRING
retrieve_field_value (type, name: STRING ): STRING
selection_window_title (table_name: STRING ): STRING
tablerows_selected (count: INTEGER ): STRING
type_not_recognized (name: STRING ): STRING
undetermined_table_name : STRING
update_done (table_name: STRING ): STRING
wrong_date_format (name: STRING ): STRING
wrong_datetime_format (name: STRING ): STRING


DV_MESSAGES Flat contracts

 indexing
description: "Objects that stores default messages."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_MESSAGES

feature --

enter_field_value (type, name: STRING ): STRING
-- Value of field with name and type not valid message.

retrieve_field_value (type, name: STRING ): STRING
-- Value of field with name and type retrieval failure message.

type_not_recognized (name: STRING ): STRING
-- Type of field with name not recognized message.

wrong_date_format (name: STRING ): STRING
-- Wrong date type format for field with name message.

wrong_datetime_format (name: STRING ): STRING
-- Wrong date & time type format for field with name message.

feature -- Combo box

empty_combo_item_label : STRING
-- Label for an empty combo item value.

feature -- Creation

creation_confirmation (table_name: STRING ): STRING
-- Table row creation on table_name confirmation message.

creation_done (table_name: STRING ): STRING
-- Table row creation on table_name successful message.

feature -- Deletion

deletion_confirmation (table_name: STRING ): STRING
-- Table row deletion on table_name confirmation message.

deletion_done (table_name: STRING ): STRING
-- Table row deletion on table_name successful message.

feature -- Selection

tablerows_selected (count: INTEGER ): STRING
-- Database selection carried out message. count table rows
-- have been selected.

feature -- Update

update_done (table_name: STRING ): STRING
-- Table row update on table_name successful message.

feature -- Window to select foreign key values for creation

selection_window_title (table_name: STRING ): STRING
-- Selection window title.

undetermined_table_name : STRING
-- Undetermined table name (use for selection_window_title ).

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_MESSAGES


DV_SEARCHER Chart

 deferred class
DV_SEARCHER

General
cluster: dataview.processing
description: "Objects that enable to perform a database selection."

Ancestors
DB_TABLES_ACCESS_USE
DV_COMPONENT

Queries
can_be_activated : BOOLEAN
is_activated : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
tables_set : BOOLEAN
user_component_set : BOOLEAN

Commands
activate


DV_SEARCHER Flat contracts

 indexing
description: "Objects that enable to perform a database selection."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_SEARCHER

feature -- Initialization

activate
-- Activate component.
-- (from DV_COMPONENT )
require -- from DV_COMPONENT
can_be_activated: can_be_activated
ensure -- from DV_COMPONENT
is_activated: is_activated

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

is_activated : BOOLEAN
-- Is component activated?
-- (from DV_COMPONENT )

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

user_component_set : BOOLEAN
-- Is component user set?

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_SEARCHER


DV_TABLEROWS_COMPONENT Chart

 deferred class
DV_TABLEROWS_COMPONENT

General
cluster: dataview.processing
description: "Objects that ask user to selecta database table row from a set throughclass DV_TABLEROWS_NAVIGATOR ."

Ancestors
DV_COMPONENT

Queries
can_be_activated : BOOLEAN
is_activated : BOOLEAN

Commands
activate
set_db_tablerow_navigator (db_tr_navigator: DV_TABLEROWS_NAVIGATOR )


DV_TABLEROWS_COMPONENT Flat contracts

 indexing
description: "Objects that ask user to selecta database table row from a set throughclass DV_TABLEROWS_NAVIGATOR ."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_TABLEROWS_COMPONENT

feature -- Initialization

activate
-- Activate component.
-- (from DV_COMPONENT )
require -- from DV_COMPONENT
can_be_activated: can_be_activated
ensure -- from DV_COMPONENT
is_activated: is_activated

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?
-- (from DV_COMPONENT )

is_activated : BOOLEAN
-- Is component activated?
-- (from DV_COMPONENT )

feature -- Basic operations

set_db_tablerow_navigator (db_tr_navigator: DV_TABLEROWS_NAVIGATOR )
-- Set db_tr_navigator to component enabling to navigate among
-- retrieved database table rows.
require
not_void: db_tr_navigator /= void
not_activated: not is_activated

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLEROWS_COMPONENT


DV_TABLEROWS_NAVIGATOR Chart

 deferred class
DV_TABLEROWS_NAVIGATOR

General
cluster: dataview.processing
description: "Objects that enable to navigate among a list of database table rows."

Ancestors
DV_COMPONENT

Queries
can_be_activated : BOOLEAN
is_activated : BOOLEAN

Commands
activate


DV_TABLEROWS_NAVIGATOR Flat contracts

 indexing
description: "Objects that enable to navigate among a list of database table rows."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_TABLEROWS_NAVIGATOR

feature -- Initialization

activate
-- Activate component.
-- (from DV_COMPONENT )
require -- from DV_COMPONENT
can_be_activated: can_be_activated
ensure -- from DV_COMPONENT
is_activated: is_activated

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?
-- (from DV_COMPONENT )

is_activated : BOOLEAN
-- Is component activated?
-- (from DV_COMPONENT )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLEROWS_NAVIGATOR


DV_TABLEROW_FIELDS Chart

 class
DV_TABLEROW_FIELDS

General
cluster: dataview.processing
description: "Fields representing part ofthe content of a table row."
create: make

Ancestors
DB_TABLES_ACCESS_USE
DV_COMPONENT

Queries
can_be_activated : BOOLEAN
is_activated : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
tables_set : BOOLEAN

Commands
add_field (ta_field: DV_TABLEROW_FIELD )
extend (ta_field: DV_TABLEROW_FIELD )
make


DV_TABLEROW_FIELDS Flat contracts

 indexing
description: "Fields representing part ofthe content of a table row."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_TABLEROW_FIELDS

create

make
-- Initialize.

feature -- Initialization

make
-- Initialize.

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

is_activated : BOOLEAN
-- Is component activated?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

feature -- Basic Operations

add_field (ta_field: DV_TABLEROW_FIELD )
-- Add field to structure.
-- Was declared in DV_TABLEROW_FIELDS as synonym of extend .
require
not_void: ta_field /= void
not_activated: not is_activated

extend (ta_field: DV_TABLEROW_FIELD )
-- Add field to structure.
-- Was declared in DV_TABLEROW_FIELDS as synonym of add_field .
require
not_void: ta_field /= void
not_activated: not is_activated

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLEROW_FIELDS


DV_TABLEROW_FIELD Chart

 class
DV_TABLEROW_FIELD

General
cluster: dataview.processing
description: "Graphic objects representing a database table attribute."
create: make_with_code

Ancestors
DV_COMPONENT
DV_MESSAGES

Queries
attribute_code : INTEGER
can_be_activated : BOOLEAN
can_update : BOOLEAN
creation_confirmation (table_name: STRING ): STRING
creation_done (table_name: STRING ): STRING
deletion_confirmation (table_name: STRING ): STRING
deletion_done (table_name: STRING ): STRING
empty_combo_item_label : STRING
enter_field_value (type, name: STRING ): STRING
graphical_title : DV_SENSITIVE_STRING
graphical_title_set : BOOLEAN
graphical_type : DV_SENSITIVE_STRING
graphical_type_set : BOOLEAN
graphical_value : DV_SENSITIVE_STRING
graphical_value_set : BOOLEAN
has_changed : BOOLEAN
is_activated : BOOLEAN
is_boolean : BOOLEAN
is_character : BOOLEAN
is_cleared : BOOLEAN
is_date : BOOLEAN
is_datetime : BOOLEAN
is_double : BOOLEAN
is_integer : BOOLEAN
is_real : BOOLEAN
is_string : BOOLEAN
retrieve_field_value (type, name: STRING ): STRING
selection_window_title (table_name: STRING ): STRING
table_description : DB_TABLE_DESCRIPTION
tablerows_selected (count: INTEGER ): STRING
text : STRING
type_not_recognized (name: STRING ): STRING
undetermined_table_name : STRING
update_done (table_name: STRING ): STRING
use_redirection : BOOLEAN
wrong_date_format (name: STRING ): STRING
wrong_datetime_format (name: STRING ): STRING

Commands
make_with_code (code: INTEGER )
set_graphical_title (g_title: DV_SENSITIVE_STRING )
set_graphical_type (g_type: DV_SENSITIVE_STRING )
set_graphical_value (g_value: DV_SENSITIVE_STRING )
set_is_date
set_redirector (a_redirector: DV_VALUE_REDIRECTOR )
set_title (t: STRING )
set_type (t: STRING )


DV_TABLEROW_FIELD Flat contracts

 indexing
description: "Graphic objects representing a database table attribute."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_TABLEROW_FIELD

create

make_with_code (code: INTEGER )
-- Initialize with code to
-- locate table attribute in the database.

feature -- Initialization

make_with_code (code: INTEGER )
-- Initialize with code to
-- locate table attribute in the database.

feature -- Access

attribute_code : INTEGER
-- Code of the represented attribute in the
-- database table.

graphical_title : DV_SENSITIVE_STRING
-- Graphical element holding field title.

graphical_type : DV_SENSITIVE_STRING
-- Graphical element holding field type.

graphical_value : DV_SENSITIVE_STRING
-- Graphical element holding field value.

table_description : DB_TABLE_DESCRIPTION
-- Description of the database table containing
-- the represented attribute.

text : STRING
-- Field text.
ensure
result_not_void: Result /= void

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

can_update : BOOLEAN
-- Can value held be updated?

graphical_title_set : BOOLEAN
-- Is a graphical title set?

graphical_type_set : BOOLEAN
-- Is a graphical type set?

graphical_value_set : BOOLEAN
-- Is a graphical value set?

has_changed : BOOLEAN
-- Has the user changed the field content?

is_activated : BOOLEAN
-- Is component activated?

is_boolean : BOOLEAN
-- Is the attribute a boolean value?

is_character : BOOLEAN
-- Is the attribute a character value?

is_cleared : BOOLEAN
-- Has the field been cleared?

is_date : BOOLEAN
-- Is the attribute a date only value?

is_datetime : BOOLEAN
-- Is the attribute a date & time value?

is_double : BOOLEAN
-- Is the attribute a double value?

is_integer : BOOLEAN
-- Is the attribute an integer value?

is_real : BOOLEAN
-- Is the attribute a date & time value?

is_string : BOOLEAN
-- Is the attribute a date & time value?

use_redirection : BOOLEAN
-- Is the display a redirection from the attribute?

feature -- Status setting

set_is_date
-- Field must contain a date value.
require
is_datetime: is_datetime
ensure
is_datetime: is_datetime
is_date: is_date

feature -- Basic operations

set_graphical_title (g_title: DV_SENSITIVE_STRING )
-- Set graphical title to g_title.
require
not_activated: not is_activated
not_void: g_title /= void

set_graphical_type (g_type: DV_SENSITIVE_STRING )
-- Set graphical type to g_type.
require
not_activated: not is_activated
not_void: g_type /= void

set_graphical_value (g_value: DV_SENSITIVE_STRING )
-- Set graphical value to g_value.
require
not_activated: not is_activated
not_void: g_value /= void

set_redirector (a_redirector: DV_VALUE_REDIRECTOR )
-- Set redirector to redirect an integer to the associated string.
require
not_activated: not is_activated

set_title (t: STRING )
-- Set component title to t.
require
not_activated: not is_activated
graphical_title_set: graphical_title_set

set_type (t: STRING )
-- Set component type to t.
require
not_activated: not is_activated
graphical_type_set: graphical_type_set

feature --

enter_field_value (type, name: STRING ): STRING
-- Value of field with name and type not valid message.
-- (from DV_MESSAGES )

retrieve_field_value (type, name: STRING ): STRING
-- Value of field with name and type retrieval failure message.
-- (from DV_MESSAGES )

type_not_recognized (name: STRING ): STRING
-- Type of field with name not recognized message.
-- (from DV_MESSAGES )

wrong_date_format (name: STRING ): STRING
-- Wrong date type format for field with name message.
-- (from DV_MESSAGES )

wrong_datetime_format (name: STRING ): STRING
-- Wrong date & time type format for field with name message.
-- (from DV_MESSAGES )

feature -- Combo box

empty_combo_item_label : STRING
-- Label for an empty combo item value.
-- (from DV_MESSAGES )

feature -- Creation

creation_confirmation (table_name: STRING ): STRING
-- Table row creation on table_name confirmation message.
-- (from DV_MESSAGES )

creation_done (table_name: STRING ): STRING
-- Table row creation on table_name successful message.
-- (from DV_MESSAGES )

feature -- Deletion

deletion_confirmation (table_name: STRING ): STRING
-- Table row deletion on table_name confirmation message.
-- (from DV_MESSAGES )

deletion_done (table_name: STRING ): STRING
-- Table row deletion on table_name successful message.
-- (from DV_MESSAGES )

feature -- Selection

tablerows_selected (count: INTEGER ): STRING
-- Database selection carried out message. count table rows
-- have been selected.
-- (from DV_MESSAGES )

feature -- Update

update_done (table_name: STRING ): STRING
-- Table row update on table_name successful message.
-- (from DV_MESSAGES )

feature -- Window to select foreign key values for creation

selection_window_title (table_name: STRING ): STRING
-- Selection window title.
-- (from DV_MESSAGES )

undetermined_table_name : STRING
-- Undetermined table name (use for selection_window_title ).
-- (from DV_MESSAGES )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLEROW_FIELD


DV_TABLEROW_ID_PROVIDER Chart

 class
DV_TABLEROW_ID_PROVIDER

General
cluster: dataview.processing
description: "Objects that enable to retrieve foreign key values for table row creation. Foreign key values are selected dynamically by user using a navigator."
create: make

Ancestors
DB_TABLES_ACCESS_USE
DV_TABLEROWS_COMPONENT

Queries
can_be_activated : BOOLEAN
is_activated : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
tables_set : BOOLEAN

Commands
make
set_db_tablerow_navigator (db_tr_navigator: DV_TABLEROWS_NAVIGATOR )
set_raising_action (raising_action: PROCEDURE [ ANY , TUPLE ])
set_selecting_control (selecting_ctrl: DV_SENSITIVE_CONTROL )


DV_TABLEROW_ID_PROVIDER Flat contracts

 indexing
description: "Objects that enable to retrieve foreign key values for table row creation. Foreign key values are selected dynamically by user using a navigator."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_TABLEROW_ID_PROVIDER

create

make
-- Initialize.

feature -- Initialization

make
-- Initialize.

feature -- Status report

can_be_activated : BOOLEAN
-- Can the component be activated?

is_activated : BOOLEAN
-- Is the component activated?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

feature -- Basic operations

set_db_tablerow_navigator (db_tr_navigator: DV_TABLEROWS_NAVIGATOR )
-- Set db_tr_navigator to component enabling to navigate among
-- retrieved database table rows.
-- (from DV_TABLEROWS_COMPONENT )
require -- from DV_TABLEROWS_COMPONENT
not_void: db_tr_navigator /= void
not_activated: not is_activated

set_raising_action (raising_action: PROCEDURE [ ANY , TUPLE ])
-- Set raising_action to raise navigation component to
-- select table row.
require
not_activated: not is_activated
action_not_void: raising_action /= void

set_selecting_control (selecting_ctrl: DV_SENSITIVE_CONTROL )
-- Enable that component can
-- select active table row.
require
not_activated: not is_activated
not_void: selecting_ctrl /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLEROW_ID_PROVIDER


DV_TABLE_COMPONENT Chart

 class
DV_TABLE_COMPONENT

General
cluster: dataview.processing
description: "Objects that represents a database table rowset and its graphical display."
create: make

Ancestors
DB_TABLES_ACCESS_USE
DV_DATABASE_HANDLE
DV_MESSAGES
DV_TABLEROWS_COMPONENT

Queries
can_be_activated : BOOLEAN
confirmation_handler_set : BOOLEAN
creation_confirmation (table_name: STRING ): STRING
creation_done (table_name: STRING ): STRING
database_handler : ABSTRACT_DB_TABLE_MANAGER
database_handler_set : BOOLEAN
db_searcher_set : BOOLEAN
deletion_confirmation (table_name: STRING ): STRING
deletion_done (table_name: STRING ): STRING
empty_combo_item_label : STRING
enter_field_value (type, name: STRING ): STRING
is_activated : BOOLEAN
is_creating : BOOLEAN
is_deleting : BOOLEAN
is_dependent : BOOLEAN
is_dependent_tablecode (code: INTEGER ): BOOLEAN
is_necessary : BOOLEAN
is_necessary_tablecode (code: INTEGER ): BOOLEAN
is_refreshing : BOOLEAN
is_subcomponent : BOOLEAN
is_topcomponent : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
is_writing : BOOLEAN
retrieve_field_value (type, name: STRING ): STRING
selected_tablerow : DB_TABLE
selected_tablerows : ARRAYED_LIST [ DB_TABLE ]
selection_window_title (table_name: STRING ): STRING
status_handler_set : BOOLEAN
table_corresponds (tr_list: ARRAYED_LIST [ DB_TABLE ]): BOOLEAN
table_description : DB_TABLE_DESCRIPTION
tablerows_selected (count: INTEGER ): STRING
tables_set : BOOLEAN
type_not_recognized (name: STRING ): STRING
undetermined_table_name : STRING
update_done (table_name: STRING ): STRING
warning_handler_set : BOOLEAN
wrong_date_format (name: STRING ): STRING
wrong_datetime_format (name: STRING ): STRING

Commands
activate
add_dependent_table (comp: DV_TABLE_COMPONENT )
add_necessary_table (comp: DV_TABLE_COMPONENT )
basic_confirmation_handler (message: STRING ; action_to_confirm: PROCEDURE [ ANY , TUPLE ])
basic_message_handler (message: STRING )
desactivate
make
make_for_settings
replace_selected_tablerows (tr_set: ARRAYED_LIST [ DB_TABLE ])
set_confirmation_handler (c_handler: PROCEDURE [ ANY , TUPLE [ STRING , PROCEDURE [ ANY , TUPLE ]]])
set_database_handler (db_handler: ABSTRACT_DB_TABLE_MANAGER )
set_db_creator (creator: DV_CREATOR )
set_db_fields_component (db_fields_comp: DV_TABLEROW_FIELDS )
set_db_searcher (db_srcher: DV_SEARCHER )
set_db_tablerow_navigator (db_tr_navigator: DV_TABLEROWS_NAVIGATOR )
set_deleting_control (deleting_ctrl: DV_SENSITIVE_CONTROL )
set_refreshing_control (refreshing_ctrl: DV_SENSITIVE_CONTROL )
set_status_handler (s_handler: PROCEDURE [ ANY , TUPLE [ STRING ]])
set_tablecode (tablecode: INTEGER )
set_warning_handler (w_handler: PROCEDURE [ ANY , TUPLE [ STRING ]])
set_writing_control (writing_ctrl: DV_SENSITIVE_CONTROL )

Constraints
top is not cleared


DV_TABLE_COMPONENT Flat contracts

 indexing
description: "Objects that represents a database table rowset and its graphical display."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_TABLE_COMPONENT

create

make
-- Initialize.

feature -- Initialization

make
-- Initialize.

make_for_settings
-- Give access.
-- (from DV_DATABASE_HANDLE )

feature -- Access

basic_confirmation_handler (message: STRING ; action_to_confirm: PROCEDURE [ ANY , TUPLE ])
-- Execute action_to_confirm without confirmation.
-- (from DV_DATABASE_HANDLE )

basic_message_handler (message: STRING )
-- Display message on standard output.
-- (from DV_DATABASE_HANDLE )

database_handler : ABSTRACT_DB_TABLE_MANAGER
-- Interface with the database.
-- (from DV_DATABASE_HANDLE )

selected_tablerow : DB_TABLE
-- Currently selected table row.

selected_tablerows : ARRAYED_LIST [ DB_TABLE ]
-- Last selected table row set.
require -- from DV_TABLEROWS_COMPONENT
is_activated: is_activated
ensure -- from DV_TABLEROWS_COMPONENT
result_not_void: Result /= void

table_description : DB_TABLE_DESCRIPTION
-- Description of table represented by component.

feature -- Status report

can_be_activated : BOOLEAN
-- Can component be activated?

confirmation_handler_set : BOOLEAN
-- Is a confirmation handler set?

database_handler_set : BOOLEAN
-- Is a database handler set?
-- (from DV_DATABASE_HANDLE )

db_searcher_set : BOOLEAN
-- Is a component to search table rows set?

is_activated : BOOLEAN
-- Is component activated?

is_creating : BOOLEAN
-- Can the component create elements
-- in the database?

is_deleting : BOOLEAN
-- Can the component delete elements
-- in the database?

is_dependent : BOOLEAN
-- Is this subcomponent table dependent on
-- calling component table?

is_dependent_tablecode (code: INTEGER ): BOOLEAN
-- Does code correspond to a dependent
-- table on represented table?

is_necessary : BOOLEAN
-- Is this subcomponent table necessary for
-- calling component table?

is_necessary_tablecode (code: INTEGER ): BOOLEAN
-- Does code correspond to a necessary
-- table for represented table?

is_refreshing : BOOLEAN
-- Can the component refresh display from the database?

is_subcomponent : BOOLEAN
-- Is this component determined by a calling
-- component?

is_topcomponent : BOOLEAN
-- Is this component not determined by any calling
-- component?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

is_writing : BOOLEAN
-- Can the component write the database?

status_handler_set : BOOLEAN
-- Is a status information handler set?

table_corresponds (tr_list: ARRAYED_LIST [ DB_TABLE ]): BOOLEAN
-- Does type of tr_list elements corresponds to represented
-- table?
require
not_void: tr_list /= void

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

warning_handler_set : BOOLEAN
-- Is a warning handler set?

feature -- Status setting

set_db_creator (creator: DV_CREATOR )
-- Enable that component can create
-- elements in the database.
require
not_void: creator /= void
not_activated: not is_activated
ensure
is_creating: is_creating

set_deleting_control (deleting_ctrl: DV_SENSITIVE_CONTROL )
-- Enable that component can
-- write the database.
require
not_void: deleting_ctrl /= void
not_activated: not is_activated
ensure
is_deleting: is_deleting

set_refreshing_control (refreshing_ctrl: DV_SENSITIVE_CONTROL )
-- Enable that component can
-- write the database.
require
not_void: refreshing_ctrl /= void
not_activated: not is_activated
ensure
is_refreshing: is_refreshing

set_writing_control (writing_ctrl: DV_SENSITIVE_CONTROL )
-- Enable that component can
-- write the database.
require
not_void: writing_ctrl /= void
not_activated: not is_activated
ensure
is_writing: is_writing

feature -- Basic operations

activate
-- Activate component.
require -- from DV_COMPONENT
can_be_activated: can_be_activated
ensure -- from DV_COMPONENT
is_activated: is_activated

add_dependent_table (comp: DV_TABLE_COMPONENT )
-- Add a subcomponent representing a dependent
-- table on represented table.
require
is_dependent_table: is_dependent_tablecode (comp. table_description . table_code )
no_db_searcher_set: not comp. db_searcher_set
not_activated: not is_activated

add_necessary_table (comp: DV_TABLE_COMPONENT )
-- Add a subcomponent representing a necessary
-- table for represented table.
require
is_necessary_table: is_necessary_tablecode (comp. table_description . table_code )
no_db_searcher_set: not comp. db_searcher_set
not_activated: not is_activated

desactivate
-- Desactivate component to add subcomponents.
ensure
not_activated: not is_activated

replace_selected_tablerows (tr_set: ARRAYED_LIST [ DB_TABLE ])
-- Replace current table row set with tr_set. Use this capability
-- when component is activated to switch between different
-- results. Database searcher set may have to afford to
-- refresh different searches.
require
is_activated: is_activated
not_void: tr_set /= void
table_corresponds: table_corresponds (tr_set)

set_confirmation_handler (c_handler: PROCEDURE [ ANY , TUPLE [ STRING , PROCEDURE [ ANY , TUPLE ]]])
-- Set c_handler to confirmation_handler
require
not_activated: not is_activated
not_void: c_handler /= void

set_database_handler (db_handler: ABSTRACT_DB_TABLE_MANAGER )
-- Set db_handler to
-- database_handler .
-- (from DV_DATABASE_HANDLE )

set_db_fields_component (db_fields_comp: DV_TABLEROW_FIELDS )
-- Set db_fields_comp to component displaying selected table row
-- content.
require
not_void: db_fields_comp /= void
not_activated: not is_activated

set_db_searcher (db_srcher: DV_SEARCHER )
-- Set component enabling to load table rows, eventually from
-- database, to db_srcher.
require
not_void: db_srcher /= void
not_activated: not is_activated
ensure
db_searcher_set: db_searcher_set

set_db_tablerow_navigator (db_tr_navigator: DV_TABLEROWS_NAVIGATOR )
-- Set db_tr_navigator to component enabling to navigate among
-- retrieved database table rows.
-- (from DV_TABLEROWS_COMPONENT )
require -- from DV_TABLEROWS_COMPONENT
not_void: db_tr_navigator /= void
not_activated: not is_activated

set_status_handler (s_handler: PROCEDURE [ ANY , TUPLE [ STRING ]])
-- Set s_handler to status_handler
require
not_activated: not is_activated
not_void: s_handler /= void

set_tablecode (tablecode: INTEGER )
-- Initialize with fields_set_comp to display
-- current selection.
require
not_activated: not is_activated

set_warning_handler (w_handler: PROCEDURE [ ANY , TUPLE [ STRING ]])
-- Set w_handler to warning_handler
require
not_activated: not is_activated
not_void: w_handler /= void

feature --

enter_field_value (type, name: STRING ): STRING
-- Value of field with name and type not valid message.
-- (from DV_MESSAGES )

retrieve_field_value (type, name: STRING ): STRING
-- Value of field with name and type retrieval failure message.
-- (from DV_MESSAGES )

type_not_recognized (name: STRING ): STRING
-- Type of field with name not recognized message.
-- (from DV_MESSAGES )

wrong_date_format (name: STRING ): STRING
-- Wrong date type format for field with name message.
-- (from DV_MESSAGES )

wrong_datetime_format (name: STRING ): STRING
-- Wrong date & time type format for field with name message.
-- (from DV_MESSAGES )

feature -- Combo box

empty_combo_item_label : STRING
-- Label for an empty combo item value.
-- (from DV_MESSAGES )

feature -- Creation

creation_confirmation (table_name: STRING ): STRING
-- Table row creation on table_name confirmation message.
-- (from DV_MESSAGES )

creation_done (table_name: STRING ): STRING
-- Table row creation on table_name successful message.
-- (from DV_MESSAGES )

feature -- Deletion

deletion_confirmation (table_name: STRING ): STRING
-- Table row deletion on table_name confirmation message.
-- (from DV_MESSAGES )

deletion_done (table_name: STRING ): STRING
-- Table row deletion on table_name successful message.
-- (from DV_MESSAGES )

feature -- Selection

tablerows_selected (count: INTEGER ): STRING
-- Database selection carried out message. count table rows
-- have been selected.
-- (from DV_MESSAGES )

feature -- Update

update_done (table_name: STRING ): STRING
-- Table row update on table_name successful message.
-- (from DV_MESSAGES )

feature -- Window to select foreign key values for creation

selection_window_title (table_name: STRING ): STRING
-- Selection window title.
-- (from DV_MESSAGES )

undetermined_table_name : STRING
-- Undetermined table name (use for selection_window_title ).
-- (from DV_MESSAGES )

invariant

top_is_not_cleared: is_topcomponent implies not is_cleared
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLE_COMPONENT


DV_TYPED_SEARCHER Chart

 class
DV_TYPED_SEARCHER

General
cluster: dataview.processing
description: "Objects that enable to rows of a database table."
create: make

Ancestors
DV_SEARCHER

Queries
behavior_type : INTEGER
can_be_activated : BOOLEAN
Every_row : INTEGER
Id_selection : INTEGER
is_activated : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
Qualified_selection : INTEGER
tables_set : BOOLEAN
user_component_set : BOOLEAN
valid_behavior_type (behavior: INTEGER ): BOOLEAN

Commands
make
read
read_from_tablerow (db_table: DB_TABLE )
set_behavior_type (behavior: INTEGER )
set_criterion (code: INTEGER )
set_row_attribute_code (attr_code: INTEGER )


DV_TYPED_SEARCHER Flat contracts

 indexing
description: "Objects that enable to rows of a database table."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_TYPED_SEARCHER

create

make
-- Initialization.

feature -- Initialization

make
-- Initialization.

feature -- Access

Every_row : INTEGER is 0
-- Every table row are selected.

Id_selection : INTEGER is 1
-- Table row is selected by its ID.

Qualified_selection : INTEGER is 2
-- Table row is selected with a qualifier.

feature -- Status report

behavior_type : INTEGER
-- Component behavior type: read all table rows,
-- tablerows selected by ID or by a qualifier.

can_be_activated : BOOLEAN
-- Can the component be activated?
-- (from DV_SEARCHER )

is_activated : BOOLEAN
-- Is the component activated?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

user_component_set : BOOLEAN
-- Is component user set?
-- (from DV_SEARCHER )

valid_behavior_type (behavior: INTEGER ): BOOLEAN
-- Is behavior valid?

feature -- Basic operations

read
-- Extract criterion_value from db_table using attribute_code
-- and read database on table with table_code with a selection
-- qualified by criterion .
require
is_activated: is_activated
user_component_set: user_component_set

read_from_tablerow (db_table: DB_TABLE )
-- Extract criterion_value from db_table using attribute_code
-- and read database on table with table_code with a selection
-- qualified by criterion .
require
is_activated: is_activated
valid_behavior: behavior_type = id_selection or else behavior_type = qualified_selection
user_component_set: user_component_set

set_behavior_type (behavior: INTEGER )
-- Initialization.
require
valid_behavior_type: valid_behavior_type (behavior)

set_criterion (code: INTEGER )
-- Set table attribute code as criterion
-- for database read.
require
behavior_is_valid: behavior_type = qualified_selection

set_row_attribute_code (attr_code: INTEGER )
-- Set attr_code as attribute code corresponding to criterion value to
-- match with the query.
require
valid_code: True
behavior_is_valid: behavior_type = qualified_selection

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TYPED_SEARCHER


DV_VALUE_LIST_REDIRECTOR Chart

 class
DV_VALUE_LIST_REDIRECTOR

General
cluster: dataview.processing
description: "Redirect values to strings at fixedlist positions"
create: make

Ancestors
ANY

Queries
list_set : BOOLEAN
redirected_list : ARRAYED_LIST [ STRING ]

Commands
add_value_redirector (redirector: DV_VALUE_REDIRECTOR ; position: INTEGER )
make
redirect_list (list: ARRAYED_LIST [ ANY ])


DV_VALUE_LIST_REDIRECTOR Flat contracts

 indexing
description: "Redirect values to strings at fixedlist positions"
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_VALUE_LIST_REDIRECTOR

create

make
-- Initialize.

feature -- Initialization

add_value_redirector (redirector: DV_VALUE_REDIRECTOR ; position: INTEGER )
-- Add redirection redirector at position in the list.
require
not_void: redirector /= void

make
-- Initialize.

feature -- Access

redirected_list : ARRAYED_LIST [ STRING ]
-- Last list set with redirections performed.
require
list_set: list_set

feature -- Status report

list_set : BOOLEAN
-- Has a list been set?

feature -- Basic operations

redirect_list (list: ARRAYED_LIST [ ANY ])
-- Redirect defined values of list.
-- Values at redirection positions must be integer values.
require
not_void: list /= void
ensure
list_set: list_set

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_VALUE_LIST_REDIRECTOR


DV_VALUE_REDIRECTOR Chart

 class
DV_VALUE_REDIRECTOR

General
cluster: dataview.processing
description: "Convert a data to its string representation accordingto an agent. Use this class when ` out ' cannot be used."
create: make_with_default_size , make

Ancestors
ANY

Queries
at_least_one_result_set : BOOLEAN
can_invert : BOOLEAN
inverted_value (s: STRING ): ANY
redirected_value (data: ANY ): STRING

Commands
make
make_with_default_size (n_items: INTEGER )
set_inversion_table (inv_t: HASH_TABLE [ ANY , STRING ])
set_invertor (inv: FUNCTION [ ANY , TUPLE [ STRING ], ANY ])
set_redirector (red: FUNCTION [ ANY , TUPLE [ ANY ], STRING ])
set_results (res_t: HASH_TABLE [ STRING , HASHABLE ])


DV_VALUE_REDIRECTOR Flat contracts

 indexing
description: "Convert a data to its string representation accordingto an agent. Use this class when ` out ' cannot be used."
author: "Cedric Reduron"
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

class interface
DV_VALUE_REDIRECTOR

create

make
-- Create storage hash-tables.

make_with_default_size (n_items: INTEGER )
-- Make with and allocate space to store at least n_items.

feature -- Initialization

make
-- Create storage hash-tables.

make_with_default_size (n_items: INTEGER )
-- Make with and allocate space to store at least n_items.

feature -- Access

inverted_value (s: STRING ): ANY
--
require
can_invert: can_invert

redirected_value (data: ANY ): STRING
-- Return the redirected value from redirector.
require
at_least_one_result_set: at_least_one_result_set

feature -- Status report

at_least_one_result_set : BOOLEAN
-- Is one way to get a result set?

can_invert : BOOLEAN
-- Can component retrieve data from its indirection?

feature -- Basic operations

set_inversion_table (inv_t: HASH_TABLE [ ANY , STRING ])
-- Set values of the invertor result table with res_t.
require
not_void: inv_t /= void
ensure
can_invert: can_invert

set_invertor (inv: FUNCTION [ ANY , TUPLE [ STRING ], ANY ])
-- Set the invertor to use.
-- Warning: set a procedure keeping result of type ANY to avoid cat calls.
require
not_void: inv /= void
ensure
can_invert: can_invert

set_redirector (red: FUNCTION [ ANY , TUPLE [ ANY ], STRING ])
-- Set the redirector to use.
-- PLEASE set a procedure keeping argument of type ANY to avoid cat calls.
require
not_void: red /= void
ensure
at_least_one_result_set: at_least_one_result_set

set_results (res_t: HASH_TABLE [ STRING , HASHABLE ])
-- Set values of the redirector result table with res_t.
require
not_void: res_t /= void
ensure
at_least_one_result_set: at_least_one_result_set

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_VALUE_REDIRECTOR


cluster dataview.user_interactions

 Cluster
dataview.user_interactions

Supercluster
dataview

Classes
DV_SENSITIVE_CHECK
DV_SENSITIVE_CONTROL
DV_SENSITIVE_INTEGER
DV_SENSITIVE_STRING
DV_TABLEROW_LIST


DV_SENSITIVE_CHECK Chart

 deferred class
DV_SENSITIVE_CHECK

General
cluster: dataview.user_interactions
description: "Sensitive check."

Ancestors
ANY

Queries
checked : BOOLEAN

Commands
disable_checked
enable_checked
request_insensitive
request_sensitive


DV_SENSITIVE_CHECK Flat contracts

 indexing
description: "Sensitive check."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_SENSITIVE_CHECK

feature -- Access

checked : BOOLEAN
-- Is property checked?

feature -- Basic operations

disable_checked
-- Uncheck property.

enable_checked
-- Check property.

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_SENSITIVE_CHECK


DV_SENSITIVE_CONTROL Chart

 deferred class
DV_SENSITIVE_CONTROL

General
cluster: dataview.user_interactions
description: "Objects that enable the user toperform an action at runtime."

Ancestors
ANY

Commands
activate
disable_sensitive
enable_sensitive
set_action (action: PROCEDURE [ ANY , TUPLE ])


DV_SENSITIVE_CONTROL Flat contracts

 indexing
description: "Objects that enable the user toperform an action at runtime."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_SENSITIVE_CONTROL

feature -- Basic operations

activate
-- Activate control.

disable_sensitive
-- Disable control sensitive.

enable_sensitive
-- Enable control sensitive.

set_action (action: PROCEDURE [ ANY , TUPLE ])
-- Set action performed by control.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_SENSITIVE_CONTROL


DV_SENSITIVE_INTEGER Chart

 deferred class
DV_SENSITIVE_INTEGER

General
cluster: dataview.user_interactions
description: "Sensitive integer provider."

Ancestors
ANY

Queries
value : INTEGER

Commands
request_insensitive
request_sensitive
set_value (i: INTEGER )


DV_SENSITIVE_INTEGER Flat contracts

 indexing
description: "Sensitive integer provider."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_SENSITIVE_INTEGER

feature -- Access

value : INTEGER
-- Selected integer value.

feature -- Basic operations

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

set_value (i: INTEGER )
-- Set i to integer value.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_SENSITIVE_INTEGER


DV_SENSITIVE_STRING Chart

 deferred class
DV_SENSITIVE_STRING

General
cluster: dataview.user_interactions
description: "Graphical element holding a string."

Ancestors
ANY

Queries
value : STRING

Commands
request_insensitive
request_sensitive
set_value (a_text: STRING )


DV_SENSITIVE_STRING Flat contracts

 indexing
description: "Graphical element holding a string."
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_SENSITIVE_STRING

feature -- Access

value : STRING
-- Display string.

feature -- Basic operations

request_insensitive
-- Request display insensitive.

request_sensitive
-- Request display sensitive.

set_value (a_text: STRING )
-- Set display string to a_text.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_SENSITIVE_STRING


DV_TABLEROW_LIST Chart

 deferred class
DV_TABLEROW_LIST

General
cluster: dataview.user_interactions
description: "Interface for a selection-sensitive database table row list structure"

Ancestors
DB_TABLES_ACCESS_USE

Queries
is_valid_code (code: INTEGER ): BOOLEAN
tables_set : BOOLEAN


DV_TABLEROW_LIST Flat contracts

 indexing
description: "Interface for a selection-sensitive database table row list structure"
date: "$Date: 2001/07/05 16:06:54 $"
revision: "$Revision: 1.1 $"

deferred class interface
DV_TABLEROW_LIST

feature -- Status report

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

indexing
library: "[
EiffelStore: library of reusable components for ISE Eiffel.
]"
status: "[
Copyright (C) 1986-2001 Interactive Software Engineering Inc.
All rights reserved. Duplication and distribution prohibited.
May be used only with ISE Eiffel, under terms of user license.
Contact ISE for any other use.
]"
source: "[
Interactive Software Engineering Inc.
ISE Building
360 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Electronic mail < info@eiffel.com >
Customer support http://support.eiffel.com
]"
info: "[
For latest info see award-winning pages: http://eiffel.com
]"

end -- class DV_TABLEROW_LIST


cluster eiffelstore.dbms

 Cluster
eiffelstore.dbms

Supercluster
eiffelstore

Subclusters
eiffelstore.dbms.rdbms
eiffelstore.dbms.support


cluster eiffelstore.dbms.rdbms

 Cluster
eiffelstore.dbms.rdbms

Supercluster
eiffelstore.dbms

Subclusters
eiffelstore.dbms.rdbms.odbc
eiffelstore.dbms.rdbms.oracle


cluster eiffelstore.dbms.rdbms.odbc

 Cluster
eiffelstore.dbms.rdbms.odbc

Supercluster
eiffelstore.dbms.rdbms

Subclusters
eiffelstore.dbms.rdbms.odbc.Clib

Classes
DB_PARA_ODBC
ODBC


cluster eiffelstore.dbms.rdbms.odbc.Clib

 Cluster
eiffelstore.dbms.rdbms.odbc.Clib

Supercluster
eiffelstore.dbms.rdbms.odbc


DB_PARA_ODBC Chart

 class
DB_PARA_ODBC

General
cluster: eiffelstore.dbms.rdbms.odbc
create: make

Ancestors
ANY

Queries
count : INTEGER
get (pos: INTEGER ): POINTER
ptr : ARRAY [ POINTER ]

Commands
make (size: INTEGER )
release
resize (size: INTEGER )
set (val: POINTER ; pos: INTEGER )


DB_PARA_ODBC Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:16 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: odbc

class interface
DB_PARA_ODBC

create

make (size: INTEGER )

feature -- Initialization

make (size: INTEGER )

feature -- Status

count : INTEGER

ptr : ARRAY [ POINTER ]

feature -- Status Setting

get (pos: INTEGER ): POINTER

release

resize (size: INTEGER )
require
array_exist: ptr /= void

set (val: POINTER ; pos: INTEGER )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_PARA_ODBC


ODBC Chart

 class
ODBC

General
cluster: eiffelstore.dbms.rdbms.odbc
description: " ODBC specification"

Ancestors
DATABASE

Queries
c_boolean_type : INTEGER
c_character_type : INTEGER
c_date_type : INTEGER
c_float_type : INTEGER
c_integer_type : INTEGER
c_real_type : INTEGER
c_string_type : INTEGER
conv_type (indicator, index: INTEGER ): INTEGER
convert_string_type (r_any: ANY ; field_name, class_name: STRING ): ANY
Database_handle_name : STRING
date_to_str (object: DATE_TIME ): STRING
descriptor_is_available : BOOLEAN
dim_rep_diff (repository_dimension, db_field_count: INTEGER ): BOOLEAN
False_representation : STRING
found : BOOLEAN
get_boolean_data (no_descriptor, ind: INTEGER ): BOOLEAN
get_col_len (no_descriptor, ind: INTEGER ): INTEGER
get_col_type (no_descriptor, ind: INTEGER ): INTEGER
get_count (no_descriptor: INTEGER ): INTEGER
get_data_len (no_descriptor, ind: INTEGER ): INTEGER
get_date_data (no_descriptor, ind: INTEGER ): INTEGER
get_day (no_descriptor, ind: INTEGER ): INTEGER
get_error_code : INTEGER
get_error_message : POINTER
get_float_data (no_descriptor, ind: INTEGER ): DOUBLE
get_hour (no_descriptor, ind: INTEGER ): INTEGER
get_integer_data (no_descriptor, ind: INTEGER ): INTEGER
get_min (no_descriptor, ind: INTEGER ): INTEGER
get_month (no_descriptor, ind: INTEGER ): INTEGER
get_real_data (no_descriptor, ind: INTEGER ): REAL
get_sec (no_descriptor, ind: INTEGER ): INTEGER
get_warn_message : POINTER
get_year (no_descriptor, ind: INTEGER ): INTEGER
has_row_number : BOOLEAN
hide_qualifier (tmp_strg: STRING ): POINTER
identifier_quoter : STRING
is_error_updated : BOOLEAN
is_null_data (no_descriptor, ind: INTEGER ): BOOLEAN
map_var_after : STRING
map_var_before : STRING
Map_var_between : STRING
map_var_between_2 : STRING
Max_char_size : INTEGER
Name_proc_lower : BOOLEAN
new_descriptor : INTEGER
Normal_parse : BOOLEAN
parse (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; uhandle: HANDLE ; sql: STRING ): BOOLEAN
password_ensure (name, passwd, uname, upasswd: STRING ): BOOLEAN
password_ok (upasswd: STRING ): BOOLEAN
proc_args : BOOLEAN
put_col_name (no_descriptor, index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
put_column_name (repository: DATABASE_REPOSITORY [[like Current] ODBC ]; map_table: ARRAY [ INTEGER ]): STRING
put_data (no_descriptor, index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
qualifier_seperator : STRING
results_order (no_descriptor: INTEGER ): INTEGER
select_exists (name: STRING ): STRING
Select_text : STRING
selection_string (rep_qualifier, rep_owner, repository_name: STRING ): STRING
sensitive_mixed : BOOLEAN
sql_adapt_db (sql: STRING ): STRING
Sql_after_exec : STRING
Sql_as : STRING
Sql_creation : STRING
Sql_end : STRING
Sql_execution : STRING
Sql_name_boolean : STRING
Sql_name_character : STRING
Sql_name_datetime : STRING
Sql_name_double : STRING
Sql_name_integer : STRING
Sql_name_real : STRING
Sql_name_string : STRING
Sql_string : STRING
sql_string2 (int: INTEGER ): STRING
string_format (object: STRING ): STRING
support_drop_proc : BOOLEAN
support_proc : INTEGER
Support_sql_of_proc : BOOLEAN
support_stored_proc : BOOLEAN
text_not_supported : STRING
trancount : INTEGER
True_representation : STRING
user_name_ok (uname: STRING ): BOOLEAN

Commands
begin
bind_parameter (table, parameters: ARRAY [ ANY ]; descriptor: INTEGER ; sql: STRING )
clear_error
close_cursor (no_descriptor: INTEGER )
commit
connect (user_name, user_passwd, data_source, application, hostname, roleid, rolepasswd, groupid: STRING )
database_make (i: INTEGER )
disconnect
drop_proc_not_supported
exec_immediate (no_descriptor: INTEGER ; command: STRING )
exec_proc_not_supported
init_order (no_descriptor: INTEGER ; command: STRING )
next_row (no_descriptor: INTEGER )
pre_immediate (descriptor, i: INTEGER )
result_order (descriptor: INTEGER )
rollback
start_order (no_descriptor: INTEGER )
store_proc_not_supported
terminate_order (no_descriptor: INTEGER )
unset_catalog_flag (desc: INTEGER )
update_map_table_error (uhandle: HANDLE ; map_table: ARRAY [ INTEGER ]; ind: INTEGER )


ODBC Flat contracts

 indexing
description: " ODBC specification"
date: "$Date: 2001/06/14 00:28:16 $"
revision: "$Revision: 1.1 $"

class interface
ODBC

feature

Database_handle_name : STRING is "ODBC"

feature -- DATABASE_BOOLEAN

sql_name_boolean : STRING
ensure then
textual_outlook: Result. is_equal ("bit")

feature -- DATABASE_CHARACTER

sql_name_character : STRING
ensure then
Result. is_equal ("char (1)")

feature -- DATABASE_DATETIME

sql_name_datetime : STRING

feature -- DATABASE_DOUBLE

sql_name_double : STRING
ensure then
Result. is_equal ("float")

feature -- DATABASE_INTEGER

sql_name_integer : STRING
ensure then
Result. is_equal ("integer")

feature -- DATABASE_REAL

sql_name_real : STRING
ensure then
Result. is_equal ("real")

feature -- DATABASE_STRING

sql_name_string : STRING
ensure then
Result. is_equal ("char (")

feature -- External

begin

c_boolean_type : INTEGER

c_character_type : INTEGER

c_date_type : INTEGER

c_float_type : INTEGER

c_integer_type : INTEGER

c_real_type : INTEGER

c_string_type : INTEGER

close_cursor (no_descriptor: INTEGER )

commit

connect (user_name, user_passwd, data_source, application, hostname, roleid, rolepasswd, groupid: STRING )
require -- from DATABASE
True
require else
data_source_set: data_source /= void

conv_type (indicator: INTEGER ; index: INTEGER ): INTEGER

database_make (i: INTEGER )

disconnect

exec_immediate (no_descriptor: INTEGER ; command: STRING )

get_boolean_data (no_descriptor: INTEGER ; ind: INTEGER ): BOOLEAN

get_col_len (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_col_type (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_count (no_descriptor: INTEGER ): INTEGER

get_data_len (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_date_data (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_day (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_error_code : INTEGER

get_error_message : POINTER

get_float_data (no_descriptor: INTEGER ; ind: INTEGER ): DOUBLE

get_hour (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_integer_data (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_min (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_month (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_real_data (no_descriptor: INTEGER ; ind: INTEGER ): REAL

get_sec (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_warn_message : POINTER

get_year (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

identifier_quoter : STRING

init_order (no_descriptor: INTEGER ; command: STRING )

is_null_data (no_descriptor: INTEGER ; ind: INTEGER ): BOOLEAN
-- Is last retrieved data null?

new_descriptor : INTEGER

next_row (no_descriptor: INTEGER )

put_col_name (no_descriptor: INTEGER ; index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER

put_data (no_descriptor: INTEGER ; index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER

qualifier_seperator : STRING

rollback

sensitive_mixed : BOOLEAN

start_order (no_descriptor: INTEGER )

support_proc : INTEGER

terminate_order (no_descriptor: INTEGER )

trancount : INTEGER

feature -- For DATABASE_CHANGE

descriptor_is_available : BOOLEAN

hide_qualifier (tmp_strg: STRING ): POINTER

pre_immediate (descriptor, i: INTEGER )

results_order (no_descriptor: INTEGER ): INTEGER
-- Fetch all the rows resulting from the sql query
-- Default value zero
-- Only for Sybase
-- (from DATABASE )

feature -- For DATABASE_DYN_STORE

unset_catalog_flag (desc: INTEGER )

feature -- For DATABASE_FORMAT

date_to_str (object: DATE_TIME ): STRING
-- String representation in SQL of object

False_representation : STRING is "0"

string_format (object: STRING ): STRING
-- String representation in SQL of object.

True_representation : STRING is "1"

feature -- For DATABASE_PROC

drop_proc_not_supported

exec_proc_not_supported

has_row_number : BOOLEAN
-- May the database store the text of a stored procedure in more than one
-- row?
-- Default value False
-- Redefined for Ingres
-- (from DATABASE )

map_var_after : STRING
-- Redefined for Sybase
-- (from DATABASE )

map_var_before : STRING
-- Redefined for Sybase
-- (from DATABASE )

Map_var_between : STRING is "@"

map_var_between_2 : STRING
-- Equal type
-- Only for Ingres
-- (from DATABASE )

Name_proc_lower : BOOLEAN is True

proc_args : BOOLEAN
-- True if the execution of the stored procedure is
-- "execute procedure_name (argument1='sireude')"
-- False if "execute procedure_name ('sireude')"
-- Default value False
-- True for Sybase
-- (from DATABASE )

select_exists (name: STRING ): STRING

Select_text : STRING is ""

sql_adapt_db (sql: STRING ): STRING

Sql_after_exec : STRING is " }"

Sql_as : STRING is " as "

Sql_creation : STRING is "CREATE PROC"

Sql_end : STRING is ""

Sql_execution : STRING is "{CALL "

store_proc_not_supported

support_drop_proc : BOOLEAN

Support_sql_of_proc : BOOLEAN is False

support_stored_proc : BOOLEAN

text_not_supported : STRING

feature -- For DATABASE_REPOSITORY

Max_char_size : INTEGER is 254

selection_string (rep_qualifier, rep_owner, repository_name: STRING ): STRING

Sql_string : STRING is "char ("

sql_string2 (int: INTEGER ): STRING

feature -- For DATABASE_SELECTION , DATABASE_CHANGE

bind_parameter (table: ARRAY [ ANY ]; parameters: ARRAY [ ANY ]; descriptor: INTEGER ; sql: STRING )

Normal_parse : BOOLEAN is False

parse (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; uhandle: HANDLE ; sql: STRING ): BOOLEAN

result_order (descriptor: INTEGER )
-- Fetch one row resulting from the sql query
-- Default value zero
-- For Sybase
-- (from DATABASE )

feature -- For DATABASE_STATUS

clear_error
-- Reset database error status.

found : BOOLEAN
-- Is there any record matching the last
-- selection condition used ?

is_error_updated : BOOLEAN
-- Has an ODBC function been called since last update which may have
-- updated error code, error message or warning message?

feature -- For DATABASE_STORE

dim_rep_diff (repository_dimension, db_field_count: INTEGER ): BOOLEAN
-- Is the dimension of the repository different to the field count of the object to insert?
-- If yes, make a default map_table
-- Default value False
-- Only for Sybase
-- (from DATABASE )

put_column_name (repository: DATABASE_REPOSITORY [like Current]; map_table: ARRAY [ INTEGER ]): STRING

update_map_table_error (uhandle: HANDLE ; map_table: ARRAY [ INTEGER ]; ind: INTEGER )

feature -- For database types

convert_string_type (r_any: ANY ; field_name, class_name: STRING ): ANY
-- Convert r_any to the expected object.
-- By default returns r_any, redefined in ORACLE to return
-- an INTEGER_REF when field_name is "data_type".
-- (from DATABASE )
require -- from DATABASE
r_any_not_void: r_any /= void
field_name_not_void: field_name /= void
class_name_not_void: class_name /= void
ensure -- from DATABASE
valid_result: Result /= void

feature -- LOGIN and DATABASE_APPL only for password_ok and user_name_ok

password_ensure (name, passwd, uname, upasswd: STRING ): BOOLEAN

password_ok (upasswd: STRING ): BOOLEAN

user_name_ok (uname: STRING ): BOOLEAN

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ODBC


cluster eiffelstore.dbms.rdbms.oracle

 Cluster
eiffelstore.dbms.rdbms.oracle

Supercluster
eiffelstore.dbms.rdbms

Subclusters
eiffelstore.dbms.rdbms.oracle.Clib

Classes
ORACLE


cluster eiffelstore.dbms.rdbms.oracle.Clib

 Cluster
eiffelstore.dbms.rdbms.oracle.Clib

Supercluster
eiffelstore.dbms.rdbms.oracle


ORACLE Chart

 class
ORACLE

General
cluster: eiffelstore.dbms.rdbms.oracle
description: "Oracle specification"

Ancestors
DATABASE

Queries
c_boolean_type : INTEGER
c_character_type : INTEGER
c_date_type : INTEGER
c_float_type : INTEGER
c_integer_type : INTEGER
c_real_type : INTEGER
c_string_type : INTEGER
conv_type (indicator, index: INTEGER ): INTEGER
convert_string_type (r_any: ANY ; field_name, class_name: STRING ): ANY
Database_handle_name : STRING
date_to_str (object: DATE_TIME ): STRING
descriptor_is_available : BOOLEAN
dim_rep_diff (repository_dimension, db_field_count: INTEGER ): BOOLEAN
False_representation : STRING
found : BOOLEAN
get_boolean_data (no_descriptor, ind: INTEGER ): BOOLEAN
get_col_len (no_descriptor, ind: INTEGER ): INTEGER
get_col_type (no_descriptor, ind: INTEGER ): INTEGER
get_count (no_descriptor: INTEGER ): INTEGER
get_data_len (no_descriptor, ind: INTEGER ): INTEGER
get_date_data (no_descriptor, ind: INTEGER ): INTEGER
get_day (no_descriptor, ind: INTEGER ): INTEGER
get_error_code : INTEGER
get_error_message : POINTER
get_float_data (no_descriptor, ind: INTEGER ): DOUBLE
get_hour (no_descriptor, ind: INTEGER ): INTEGER
get_integer_data (no_descriptor, ind: INTEGER ): INTEGER
get_min (no_descriptor, ind: INTEGER ): INTEGER
get_month (no_descriptor, ind: INTEGER ): INTEGER
get_real_data (no_descriptor, ind: INTEGER ): REAL
get_sec (no_descriptor, ind: INTEGER ): INTEGER
get_warn_message : POINTER
get_year (no_descriptor, ind: INTEGER ): INTEGER
has_row_number : BOOLEAN
hide_qualifier (c_temp: STRING ): POINTER
identifier_quoter : STRING
is_error_updated : BOOLEAN
is_null_data (no_descriptor, ind: INTEGER ): BOOLEAN
map_var_after : STRING
map_var_before : STRING
Map_var_between : STRING
map_var_between_2 : STRING
max_char_size : INTEGER
Name_proc_lower : BOOLEAN
new_descriptor : INTEGER
normal_parse : BOOLEAN
parse (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; uhandle: HANDLE ; sql: STRING ): BOOLEAN
password_ensure (name, passwd, uname, upasswd: STRING ): BOOLEAN
password_ok (upasswd: STRING ): BOOLEAN
proc_args : BOOLEAN
put_col_name (no_descriptor, index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
put_column_name (repository: DATABASE_REPOSITORY [[like Current] ORACLE ]; map_table: ARRAY [ INTEGER ]): STRING
put_data (no_descriptor, index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
qualifier_seperator : STRING
results_order (no_descriptor: INTEGER ): INTEGER
select_exists (name: STRING ): STRING
Select_text : STRING
selection_string (rep_qualifier, rep_owner, rep_name: STRING ): STRING
sensitive_mixed : BOOLEAN
sql_adapt_db (sql: STRING ): STRING
Sql_after_exec : STRING
Sql_as : STRING
Sql_creation : STRING
Sql_end : STRING
Sql_execution : STRING
Sql_name_boolean : STRING
Sql_name_character : STRING
Sql_name_datetime : STRING
Sql_name_double : STRING
Sql_name_integer : STRING
Sql_name_real : STRING
sql_name_string : STRING
Sql_string : STRING
sql_string2 (int: INTEGER ): STRING
string_format (object: STRING ): STRING
Support_drop_proc : BOOLEAN
support_proc : INTEGER
Support_sql_of_proc : BOOLEAN
support_stored_proc : BOOLEAN
text_not_supported : STRING
trancount : INTEGER
True_representation : STRING
user_name_ok (uname: STRING ): BOOLEAN

Commands
begin
bind_args_value (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; sql: STRING )
bind_parameter (value, parameters: ARRAY [ ANY ]; descriptor: INTEGER ; sql: STRING )
clear_error
close_cursor (no_descriptor: INTEGER )
commit
connect (user_name, user_passwd, data_source, application, hostname, roleid, rolepasswd, groupid: STRING )
database_make (i: INTEGER )
disconnect
drop_proc_not_supported
exec_immediate (no_descriptor: INTEGER ; command: STRING )
exec_proc_not_supported
init_order (no_descriptor: INTEGER ; command: STRING )
next_row (no_descriptor: INTEGER )
pre_immediate (descriptor, i: INTEGER )
result_order (descriptor: INTEGER )
rollback
start_order (no_descriptor: INTEGER )
store_proc_not_supported
terminate_order (no_descriptor: INTEGER )
unset_catalog_flag (desc: INTEGER )
update_map_table_error (uhandle: HANDLE ; map_table: ARRAY [ INTEGER ]; ind: INTEGER )


ORACLE Flat contracts

 indexing
description: "Oracle specification"
date: "$Date: 2001/06/14 00:28:16 $"
revision: "$Revision: 1.1 $"

class interface
ORACLE

feature

Database_handle_name : STRING is "ORACLE"

feature -- DATABASE_BOOLEAN

Sql_name_boolean : STRING is "CHAR"

feature -- DATABASE_CHARACTER

Sql_name_character : STRING is "CHAR"

feature -- DATABASE_DATETIME

Sql_name_datetime : STRING is "DATE"

feature -- DATABASE_DOUBLE

Sql_name_double : STRING is "FLOAT"

feature -- DATABASE_INTEGER

Sql_name_integer : STRING is "NUMBER"

feature -- DATABASE_REAL

Sql_name_real : STRING is "FLOAT"

feature -- DATABASE_STRING

sql_name_string : STRING

feature -- External features

begin

c_boolean_type : INTEGER

c_character_type : INTEGER

c_date_type : INTEGER

c_float_type : INTEGER

c_integer_type : INTEGER

c_real_type : INTEGER

c_string_type : INTEGER

close_cursor (no_descriptor: INTEGER )
-- Do nothing, for ODBC prepared statement

commit

connect (user_name, user_passwd, data_source, application, hostname, roleid, rolepasswd, groupid: STRING )

conv_type (indicator: INTEGER ; index: INTEGER ): INTEGER

database_make (i: INTEGER )

disconnect

exec_immediate (no_descriptor: INTEGER ; command: STRING )

get_boolean_data (no_descriptor: INTEGER ; ind: INTEGER ): BOOLEAN

get_col_len (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_col_type (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_count (no_descriptor: INTEGER ): INTEGER

get_data_len (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_date_data (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_day (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_error_code : INTEGER

get_error_message : POINTER

get_float_data (no_descriptor: INTEGER ; ind: INTEGER ): DOUBLE

get_hour (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_integer_data (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_min (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_month (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_real_data (no_descriptor: INTEGER ; ind: INTEGER ): REAL

get_sec (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

get_warn_message : POINTER

get_year (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER

identifier_quoter : STRING
-- Return the string used to quote identifiers in SQL command,
-- for example, if the quoter is `, and we want to select on
-- table "my table", we should express the query as:
-- select * from `My table`
-- Only for ODBC
-- (from DATABASE )

init_order (no_descriptor: INTEGER ; command: STRING )

is_null_data (no_descriptor: INTEGER ; ind: INTEGER ): BOOLEAN
-- is last retrieved data null?

new_descriptor : INTEGER

next_row (no_descriptor: INTEGER )

put_col_name (no_descriptor: INTEGER ; index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER

put_data (no_descriptor: INTEGER ; index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER

qualifier_seperator : STRING
-- When "qualifier" and "owner" are used to identifier
-- a database object, they should be seperated by a string called
-- "qualifier seperator"
-- Only for ODBC
-- (from DATABASE )

rollback

sensitive_mixed : BOOLEAN
-- Is the database sensitive to lower or
-- upper case?
-- Only for ODBC , Ingres
-- (from DATABASE )

start_order (no_descriptor: INTEGER )

terminate_order (no_descriptor: INTEGER )

trancount : INTEGER

feature -- For DATABASE_CHANGE

descriptor_is_available : BOOLEAN

hide_qualifier (c_temp: STRING ): POINTER
-- When "qualifier" is used to identify an database object,
-- we have to hide ":" in the qualifier first, otherwise, it
-- will be misinterpreted by feature SQL_SCAN::parse
-- Only for ODBC
-- (from DATABASE )

pre_immediate (descriptor, i: INTEGER )
-- In IMMEDIATE EXECUTE mode, if the performed SQL statement is
-- a call to a stored procedure, allocate some area used by the
-- stored procedure
-- Only for ODBC
-- (from DATABASE )

results_order (no_descriptor: INTEGER ): INTEGER
-- Fetch all the rows resulting from the sql query
-- Default value zero
-- Only for Sybase
-- (from DATABASE )

feature -- For DATABASE_DYN_STORE

unset_catalog_flag (desc: INTEGER )
-- Default value zero
-- Only for ODBC .
-- (from DATABASE )

feature -- For DATABASE_FORMAT

date_to_str (object: DATE_TIME ): STRING
-- String representation in SQL of object

False_representation : STRING is "'F'"

string_format (object: STRING ): STRING
-- String representation in SQL of object.
-- WARNING: use "IS NULL" if object is empty instead of
-- "= NULL" which does not work.

True_representation : STRING is "'T'"

feature -- For DATABASE_PROC

drop_proc_not_supported
-- Display the text saying that the database
-- does not support stored procedure dropping
-- Redefined for ODBC
-- (from DATABASE )

exec_proc_not_supported
-- Display the text saying that the database
-- does not support stored procedure executing
-- Redefined for ODBC
-- (from DATABASE )

has_row_number : BOOLEAN
-- May the database store the text of a stored procedure in more than one
-- row?
-- Default value False
-- Redefined for Ingres
-- (from DATABASE )

map_var_after : STRING
-- Redefined for Sybase
-- (from DATABASE )

map_var_before : STRING
-- Redefined for Sybase
-- (from DATABASE )

Map_var_between : STRING is ""

map_var_between_2 : STRING
-- Equal type
-- Only for Ingres
-- (from DATABASE )

Name_proc_lower : BOOLEAN is False

proc_args : BOOLEAN
-- True if the execution of the stored procedure is
-- "execute procedure_name (argument1='sireude')"
-- False if "execute procedure_name ('sireude')"
-- Default value False
-- True for Sybase
-- (from DATABASE )

select_exists (name: STRING ): STRING

Select_text : STRING is "select text from all_source where Name = :name and Type = 'PROCEDURE'"

sql_adapt_db (sql: STRING ): STRING
-- Adapt the SQL string for the database
-- Only for Sybase and ODBC
-- (from DATABASE )

Sql_after_exec : STRING is "; END;"

Sql_as : STRING is " AS BEGIN "

Sql_creation : STRING is "create procedure "

Sql_end : STRING is "; END;"

Sql_execution : STRING is "BEGIN "

store_proc_not_supported
-- Display the text saying that the database
-- does not support stored procedure creating
-- Redefined for ODBC
-- (from DATABASE )

Support_drop_proc : BOOLEAN is True

support_proc : INTEGER
-- Does the database support stored procedure?
-- 1 if True, 0 if False
-- Redefined for ODBC
-- (from DATABASE )

Support_sql_of_proc : BOOLEAN is True

support_stored_proc : BOOLEAN

text_not_supported : STRING
-- Display the text saying that the database
-- does not support stored procedure text retrieving
-- Redefined for ODBC
-- (from DATABASE )

feature -- For DATABASE_REPOSITORY

max_char_size : INTEGER
-- Limit size before being a text
-- Except for ODBC
-- (from DATABASE )

selection_string (rep_qualifier, rep_owner, rep_name: STRING ): STRING

Sql_string : STRING is "VARCHAR2 ("

sql_string2 (int: INTEGER ): STRING

feature -- For DATABASE_SELECTION , DATABASE_CHANGE

bind_args_value (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; sql: STRING )
-- Append map variables name from to s.
-- Map variables are used for set input arguments.
-- uht can be empty (for stored procedures).

bind_parameter (value: ARRAY [ ANY ]; parameters: ARRAY [ ANY ]; descriptor: INTEGER ; sql: STRING )

normal_parse : BOOLEAN

parse (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; uhandle: HANDLE ; sql: STRING ): BOOLEAN

result_order (descriptor: INTEGER )
-- Fetch one row resulting from the sql query
-- Default value zero
-- For Sybase
-- (from DATABASE )

feature -- For DATABASE_STATUS

clear_error
-- Reset database error status.

found : BOOLEAN
-- Is there any record matching the last
-- selection condition used ?

is_error_updated : BOOLEAN
-- Has an Oracle function been called since last update which may have
-- updated error code, error message or warning message?

feature -- For DATABASE_STORE

dim_rep_diff (repository_dimension, db_field_count: INTEGER ): BOOLEAN
-- Is the dimension of the repository different to the field count of the object to insert?
-- If yes, make a default map_table
-- Default value False
-- Only for Sybase
-- (from DATABASE )

put_column_name (repository: DATABASE_REPOSITORY [like Current]; map_table: ARRAY [ INTEGER ]): STRING
-- Add the columns names to sql_string in the feature put
-- Redefined for ODBC
-- (from DATABASE )

update_map_table_error (uhandle: HANDLE ; map_table: ARRAY [ INTEGER ]; ind: INTEGER )

feature -- For database types

convert_string_type (r_any: ANY ; field_name, class_name: STRING ): ANY
-- Convert r_any to the expected object.
-- By default returns r_any, redefined in ORACLE to return
-- an INTEGER_REF when field_name is "data_type".
require -- from DATABASE
r_any_not_void: r_any /= void
field_name_not_void: field_name /= void
class_name_not_void: class_name /= void
ensure -- from DATABASE
valid_result: Result /= void

feature -- LOGIN and DATABASE_APPL only for password_ok

password_ensure (name, passwd, uname, upasswd: STRING ): BOOLEAN

password_ok (upasswd: STRING ): BOOLEAN

user_name_ok (uname: STRING ): BOOLEAN
-- Can the user name be Void?
-- Yes only for ODBC
-- (from DATABASE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ORACLE


cluster eiffelstore.dbms.support

 Cluster
eiffelstore.dbms.support

Supercluster
eiffelstore.dbms

Classes
COLUMNS [G -> DATABASE create default_create end]
DATABASE
DATABASE_ALL_TYPES [G -> DATABASE create default_create end]
DATABASE_APPL [G -> DATABASE create default_create end]
DATABASE_BOOLEAN [G -> DATABASE create default_create end]
DATABASE_CHANGE [G -> DATABASE create default_create end]
DATABASE_CHARACTER [G -> DATABASE create default_create end]
DATABASE_CONTROL [G -> DATABASE create default_create end]
DATABASE_DATA [G -> DATABASE create default_create end]
DATABASE_DATETIME [G -> DATABASE create default_create end]
DATABASE_DOUBLE [G -> DATABASE create default_create end]
DATABASE_DYN_CHANGE [G -> DATABASE create default_create end]
DATABASE_DYN_SELECTION [G -> DATABASE create default_create end]
DATABASE_FORMAT [G -> DATABASE create default_create end]
DATABASE_INTEGER [G -> DATABASE create default_create end]
DATABASE_MANAGER [G -> DATABASE create default_create end]
DATABASE_PROC [G -> DATABASE create default_create end]
DATABASE_REAL [G -> DATABASE create default_create end]
DATABASE_REPOSITORY [G -> DATABASE create default_create end]
DATABASE_SELECTION [G -> DATABASE create default_create end]
DATABASE_STATUS [G -> DATABASE create default_create end]
DATABASE_STORE [G -> DATABASE create default_create end]
DATABASE_STRING [G -> DATABASE create default_create end]
DATABASE_STRING_EX [G -> DATABASE create default_create end]
DATABASE_TUPLE [G -> DATABASE create default_create end]
DB [G -> DATABASE create default_create end]
HANDLE_SPEC [G -> DATABASE create default_create end]
HANDLE_SPEC_IMPL
LOGIN [G -> DATABASE create default_create end]
TYPES [G -> DATABASE create default_create end]


COLUMNS Chart

 class
COLUMNS [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Description of a database table column"

Ancestors
TYPES [G -> DATABASE create default_create end]

Queries
Boolean_type_database : INTEGER
buffer_length : INTEGER
Character_type_database : INTEGER
column_id : INTEGER
column_name : STRING
column_nulls : STRING
column_size : INTEGER
column_typename : STRING
creation_date : DATE_TIME
data_default : STRING
data_length : INTEGER
data_precision : INTEGER
data_scale : INTEGER
data_type : INTEGER
Date_type_database : INTEGER
db_spec : DATABASE
decimal_digits : INTEGER
default_length : INTEGER
density : INTEGER
duplicate : [like Current] COLUMNS [G]
eiffel_type : INTEGER
Float_type_database : INTEGER
high_value : INTEGER
Integer_type_database : INTEGER
length : INTEGER
low_value : INTEGER
nullable : INTEGER
num_distinct : INTEGER
num_prec_radix : INTEGER
owner : STRING
owner_id : INTEGER
precision : INTEGER
radix : INTEGER
Real_type_database : INTEGER
scale : INTEGER
status : INTEGER
String_type_database : INTEGER
table_cat : STRING
table_id : INTEGER
table_name : STRING
table_owner : STRING
table_qualifier : STRING
table_schem : STRING
table_type : STRING
type_name : STRING

Commands
clear_all
set_all (col_id, dat_type, dat_len, sca, rad, prec, nulable, def_len, num_dist, low_val, high_val, dens, own_id, tb_id, stat: INTEGER ; dat_def, qualifier, own, tab_name, tab_type, col_name, col_nulls, col_typename: STRING ; creat_date: DATE_TIME )


COLUMNS Flat contracts

 indexing
description: "Description of a database table column"
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
COLUMNS [G -> DATABASE create default_create end]

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

buffer_length : INTEGER
-- Column length in bytes
-- Was declared in COLUMNS as synonym of data_length and length .

column_id : INTEGER
-- Column identification number (number of column in table)

column_name : STRING
-- Column name

column_nulls : STRING
-- 'Y' if the column can contain null values, 'N' if the column can't contain null values

column_size : INTEGER
-- precision of the Column
-- Was declared in COLUMNS as synonym of data_precision and precision .

column_typename : STRING

creation_date : DATE_TIME
-- Table creation date

data_default : STRING
-- Default field value

data_length : INTEGER
-- Column length in bytes
-- Was declared in COLUMNS as synonym of length and buffer_length .

data_precision : INTEGER
-- precision of the Column
-- Was declared in COLUMNS as synonym of precision and column_size .

data_scale : INTEGER
-- the scale of the column
-- Was declared in COLUMNS as synonym of scale and decimal_digits .

data_type : INTEGER
-- Data type of a column. Ingres has the following data type code(negative is for nullable field):
-- integer -30/30
-- float -31/31
-- c -32/32
-- text -37/37
-- date -3/3
-- money -5/5
-- char -20/20
-- varchar -21/21
-- table_key -12/12
-- object_key -11/11

decimal_digits : INTEGER
-- the scale of the column
-- Was declared in COLUMNS as synonym of data_scale and scale .

default_length : INTEGER
-- Length of default value for a column

density : INTEGER
-- Oracle V7 add ons.

duplicate : like Current
-- Duplicate copy of Current

eiffel_type : INTEGER
-- Eiffel type code mapped to Ingres type data_type

high_value : INTEGER
-- Oracle V7 add ons.

length : INTEGER
-- Column length in bytes
-- Was declared in COLUMNS as synonym of data_length and buffer_length .

low_value : INTEGER
-- Oracle V7 add ons.

nullable : INTEGER
-- if the column can get NULL value

num_distinct : INTEGER
-- Oracle V7 add ons.

num_prec_radix : INTEGER
-- the radix of the Column
-- Was declared in COLUMNS as synonym of radix .

owner : STRING
-- Owner id of table of name table_name
-- Was declared in COLUMNS as synonym of table_owner and table_schem .

owner_id : INTEGER
-- Owner id of table of name table_name

precision : INTEGER
-- precision of the Column
-- Was declared in COLUMNS as synonym of data_precision and column_size .

radix : INTEGER
-- the radix of the Column
-- Was declared in COLUMNS as synonym of num_prec_radix .

scale : INTEGER
-- the scale of the column
-- Was declared in COLUMNS as synonym of data_scale and decimal_digits .

status : INTEGER
-- Flag to check whether a column field can be null

table_cat : STRING
-- Qualifier of the table in which the column belongs
-- Was declared in COLUMNS as synonym of table_qualifier .

table_id : INTEGER
-- Table identification number

table_name : STRING
-- Table name

table_owner : STRING
-- Owner id of table of name table_name
-- Was declared in COLUMNS as synonym of owner and table_schem .

table_qualifier : STRING
-- Qualifier of the table in which the column belongs
-- Was declared in COLUMNS as synonym of table_cat .

table_schem : STRING
-- Owner id of table of name table_name
-- Was declared in COLUMNS as synonym of owner and table_owner .

table_type : STRING
-- Table type

type_name : STRING
-- type name in ODBC

feature -- Status setting

set_all (col_id, dat_type, dat_len, sca, rad, prec, nulable, def_len, num_dist, low_val, high_val, dens, own_id, tb_id, stat: INTEGER ; dat_def, qualifier, own, tab_name, tab_type, col_name, col_nulls, col_typename: STRING ; creat_date: DATE_TIME )
-- Set attributes with input parameter values.

feature -- Removal

clear_all
-- Reset all attributes to default values.

feature -- Conversion

boolean_type_database : INTEGER
-- Boolean type code in Ingres
-- (from TYPES )

character_type_database : INTEGER
-- Character type code in Ingres
-- (from TYPES )

date_type_database : INTEGER
-- Datetime type code in Ingres
-- (from TYPES )

float_type_database : INTEGER
-- Double type code in Ingres
-- (from TYPES )

integer_type_database : INTEGER
-- Integer type code in Ingres
-- (from TYPES )

real_type_database : INTEGER
-- Real type code in Ingres
-- (from TYPES )

string_type_database : INTEGER
-- String type code in Ingres
-- (from TYPES )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class COLUMNS


DATABASE_ALL_TYPES Chart

 class
DATABASE_ALL_TYPES [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_ALL_TYPES "
create: make

Ancestors
HASH_TABLE [G, H -> HASHABLE ]
INTERNAL

Queries
infix " @ " (key: INTEGER ): DB_TYPE
after : BOOLEAN
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
capacity : INTEGER
changeable_comparison_criterion : BOOLEAN
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
conflict : BOOLEAN
count : INTEGER
current_keys : ARRAY [ INTEGER ]
cursor : CURSOR
db_type (object: ANY ): DB_TYPE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
Extendible : BOOLEAN
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
found : BOOLEAN
found_item : DB_TYPE
Full : BOOLEAN
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
has (key: INTEGER ): BOOLEAN
has_item (v: DB_TYPE ): BOOLEAN
inserted : BOOLEAN
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_empty : BOOLEAN
is_equal (other: [like Current] DATABASE_ALL_TYPES [G]): BOOLEAN
is_inserted (v: DB_TYPE ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_registered (object: ANY ): BOOLEAN
is_special (object: ANY ): BOOLEAN
item (key: INTEGER ): DB_TYPE
item_for_iteration : DB_TYPE
key_for_iteration : INTEGER
linear_representation : ARRAYED_LIST [ DB_TYPE ]
new_instance_of (type_id: INTEGER ): ANY
not_found : BOOLEAN
object_comparison : BOOLEAN
occurrences (v: DB_TYPE ): INTEGER
off : BOOLEAN
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
prunable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
removed : BOOLEAN
replaced : BOOLEAN
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
valid_cursor (c: CURSOR ): BOOLEAN
valid_key (k: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
accommodate (n: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] DATABASE_ALL_TYPES [G])
extend (new: DB_TYPE ; key: INTEGER )
fill (other: CONTAINER [ DB_TYPE ])
force (new: DB_TYPE ; key: INTEGER )
forth
go_to (c: CURSOR )
ht_make (n: INTEGER )
make
put (new: DB_TYPE ; key: INTEGER )
Register_all
register_type (type: DB_TYPE )
remove (key: INTEGER )
replace (new: DB_TYPE ; key: INTEGER )
replace_key (new_key, old_key: INTEGER )
search (key: INTEGER )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
start


DATABASE_ALL_TYPES Flat contracts

 indexing
description: "Implementation of DB_ALL_TYPES "
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_ALL_TYPES [G -> DATABASE create default_create end]

create

make

feature -- Initialization

accommodate (n: INTEGER )
-- Reallocate table with enough space for n items;
-- keep all current items.
-- (from HASH_TABLE )
require -- from HASH_TABLE
n >= 0
ensure -- from HASH_TABLE
count_not_changed: count = old count
slot_count_same_as_count: used_slot_count = count
breathing_space: count * 100 < capacity * initial_occupation

make

ht_make (n: INTEGER )
-- Allocate hash table for at least n items.
-- The table will be resized automatically
-- if more than n items are inserted.
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
breathing_space: n * 100 < capacity * initial_occupation
minimum_space: minimum_capacity * 100 < capacity * initial_occupation
more_than_minimum: capacity >= minimum_capacity
no_status: not special_status

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

current_keys : ARRAY [ INTEGER ]
-- New array containing actually used keys, from 1 to count
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
good_count: Result. count = count

cursor : CURSOR
-- Current cursor position
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
cursor_not_void: Result /= void

db_type (object: ANY ): DB_TYPE
-- DB_TYPE instance associated to object
ensure
result_value: Result = item ( dynamic_type (object))

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

found_item : DB_TYPE
-- Item, if any, yielded by last search operation
-- (from HASH_TABLE )

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has (key: INTEGER ): BOOLEAN
-- Is there an item in the table with key key?
-- (from HASH_TABLE )
ensure then -- from HASH_TABLE
default_case: (key = computed_default_key ) implies (Result = has_default )

has_item (v: DB_TYPE ): BOOLEAN
-- Does structure include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from HASH_TABLE )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

item (key: INTEGER ): DB_TYPE
-- Item associated with key, if present
-- otherwise default value of type G
-- Was declared in HASH_TABLE as synonym of @.
-- (from HASH_TABLE )
require -- from TABLE
valid_key: valid_key (k)
ensure then -- from HASH_TABLE
default_value_if_not_present: ( not ( has (key))) implies (Result = computed_default_value )

item_for_iteration : DB_TYPE
-- Element at current iteration position
-- (from HASH_TABLE )
require -- from HASH_TABLE
not_off: not off

key_for_iteration : INTEGER
-- Key at current iteration position
-- (from HASH_TABLE )
require -- from HASH_TABLE
not_off: not off
ensure -- from HASH_TABLE
at_iteration_position: Result = key_at ( iteration_position )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

infix " @ " (key: INTEGER ): DB_TYPE
-- Item associated with key, if present
-- otherwise default value of type G
-- Was declared in HASH_TABLE as synonym of item .
-- (from HASH_TABLE )
require -- from TABLE
valid_key: valid_key (k)
ensure then -- from HASH_TABLE
default_value_if_not_present: ( not ( has (key))) implies (Result = computed_default_value )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

capacity : INTEGER
-- Number of items that may be stored.
-- (from HASH_TABLE )

count : INTEGER
-- Number of items in table
-- (from HASH_TABLE )

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

occurrences (v: DB_TYPE ): INTEGER
-- Number of table items equal to v.
-- (from HASH_TABLE )
ensure -- from BAG
non_negative_occurrences: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Does table contain the same information as other?
-- (from HASH_TABLE )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result

feature -- Status report

after : BOOLEAN
-- Is cursor past last item?
-- Was declared in HASH_TABLE as synonym of off .
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
definition: Result = (( not has_default and ( iteration_position >= capacity )) or ( has_default and ( iteration_position = ( capacity + 1))))

changeable_comparison_criterion : BOOLEAN
-- May object_comparison be changed?
-- (Answer: yes by default.)
-- (from CONTAINER )

conflict : BOOLEAN
-- Did last operation cause a conflict?
-- (from HASH_TABLE )

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from HASH_TABLE )

found : BOOLEAN
-- Did last operation find the item sought?
-- (from HASH_TABLE )

Full : BOOLEAN is False
-- Is structure filled to capacity? (Answer: no.)
-- (from HASH_TABLE )

inserted : BOOLEAN
-- Did last operation insert an item?
-- (from HASH_TABLE )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_inserted (v: DB_TYPE ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_registered (object: ANY ): BOOLEAN
-- Is object type registered?
require
object_not_void: object /= void
ensure
result_value: Result = has ( dynamic_type (object))

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

not_found : BOOLEAN
-- Did last operation fail to find the item sought?
-- (from HASH_TABLE )

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

off : BOOLEAN
-- Is cursor past last item?
-- Was declared in HASH_TABLE as synonym of after .
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
definition: Result = (( not has_default and ( iteration_position >= capacity )) or ( has_default and ( iteration_position = ( capacity + 1))))

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from HASH_TABLE )

removed : BOOLEAN
-- Did last operation remove an item?
-- (from HASH_TABLE )

replaced : BOOLEAN
-- Did last operation replace an item?
-- (from HASH_TABLE )

valid_cursor (c: CURSOR ): BOOLEAN
-- Can cursor be moved to position c?
-- (from HASH_TABLE )
require -- from HASH_TABLE
c_not_void: c /= void

valid_key (k: INTEGER ): BOOLEAN
-- Is k a valid key?
-- (Answer: always yes for hash tables in this version)
-- (from HASH_TABLE )
ensure then -- from HASH_TABLE
Result

feature -- Status setting

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

feature -- Cursor movement

forth
-- Advance cursor to next occupied position,
-- or off if no such position remains.
-- (from HASH_TABLE )
require -- from HASH_TABLE
not_off: not off

go_to (c: CURSOR )
-- Move to position c.
-- (from HASH_TABLE )
require -- from HASH_TABLE
c_not_void: c /= void
valid_cursor: valid_cursor (c)

search (key: INTEGER )
-- Search for item of key key.
-- If found, set found to true, and set
-- found_item to item associated with key.
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
found_or_not_found: found or not_found
item_if_found: found implies ( found_item = content . item ( position ))

start
-- Bring cursor to first position.
-- (from HASH_TABLE )

feature -- Element change

extend (new: DB_TYPE ; key: INTEGER )
-- Assuming there is no item of key key,
-- insert new with key.
-- Set inserted .
--
-- To choose between various insert/replace procedures,
-- see instructions in the Indexing clause.
-- (from HASH_TABLE )
require -- from HASH_TABLE
not_present: not has (key)
ensure -- from HASH_TABLE
inserted: inserted
insertion_done: item (key) = new
one_more: count = old count + 1
same_slot_count_or_one_more_unless_reallocated: ( used_slot_count = old used_slot_count ) or ( used_slot_count = old used_slot_count + 1) or ( used_slot_count = count )
default_property: has_default = ((key = computed_default_key ) or (old has_default ))

fill (other: CONTAINER [ DB_TYPE ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (new: DB_TYPE ; key: INTEGER )
-- Update table so that new will be the item associated
-- with key.
-- If there was an item for that key, set found
-- and set found_item to that item.
-- If there was none, set not_found and set
-- found_item to the default value.
--
-- To choose between various insert/replace procedures,
-- see instructions in the Indexing clause.
-- (from HASH_TABLE )
require else -- from HASH_TABLE
True
ensure then -- from HASH_TABLE
insertion_done: item (key) = new
now_present: has (key)
found_or_not_found: found or not_found
not_found_iff_was_not_present: not_found = not (old has (key))
same_count_or_one_more: ( count = old count ) or ( count = old count + 1)
same_slot_count_or_one_more_unless_reallocated: ( used_slot_count = old used_slot_count ) or ( used_slot_count = old used_slot_count + 1) or ( used_slot_count = count )
found_item_is_old_item: found implies ( found_item = old ( item (key)))
default_value_if_not_found: not_found implies ( found_item = computed_default_value )
default_property: has_default = ((key = computed_default_key ) or ((key /= computed_default_key ) and (old has_default )))

put (new: DB_TYPE ; key: INTEGER )
-- Insert new with key if there is no other item
-- associated with the same key.
-- Set inserted if and only if an insertion has
-- been made (i.e. key was not present).
-- If so, set position to the insertion position.
-- If not, set conflict .
-- In either case, set found_item to the item
-- now associated with key (previous item if
-- there was one, new otherwise).
--
-- To choose between various insert/replace procedures,
-- see instructions in the Indexing clause.
-- (from HASH_TABLE )
require -- from TABLE
valid_key: valid_key (k)
ensure then -- from HASH_TABLE
conflict_or_inserted: conflict or inserted
insertion_done: inserted implies item (key) = new
now_present: inserted implies has (key)
one_more_if_inserted: inserted implies ( count = old count + 1)
one_more_slot_if_inserted_unless_reallocated: inserted implies (( used_slot_count = old used_slot_count + 1) or ( used_slot_count = count ))
unchanged_if_conflict: conflict implies ( count = old count )
same_item_if_conflict: conflict implies ( item (key) = old ( item (key)))
slot_count_unchanged_if_conflict: conflict implies ( used_slot_count = old used_slot_count )
found_item_associated_with_key: found_item = item (key)
new_item_if_inserted: inserted implies ( found_item = new)
old_item_if_conflict: conflict implies ( found_item = old ( item (key)))
default_property: has_default = (( inserted and (key = computed_default_key )) or (( conflict or (key /= computed_default_key )) and (old has_default )))

register_all
-- Register all available types.
require
count = 0
ensure
positive_count: count > 0

register_type (type: DB_TYPE )
-- Register a new type.
require
type_not_void: type /= void
type_not_register: not has_item (type)
ensure
incremented_count: count = old count + 1

replace (new: DB_TYPE ; key: INTEGER )
-- Replace item at key, if present,
-- with new; do not change associated key.
-- Set replaced if and only if a replacement has been made
-- (i.e. key was present); otherwise set not_found .
-- Set found_item to the item previously associated
-- with key (default value if there was none).
--
-- To choose between various insert/replace procedures,
-- see instructions in the Indexing clause.
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
replaced_or_not_found: replaced or not_found
insertion_done: replaced implies item (key) = new
no_change_if_not_found: not_found implies item (key) = old ( item (key))
found_item_is_old_item: found_item = old ( item (key))

replace_key (new_key: INTEGER ; old_key: INTEGER )
-- If there is an item of key old_key and no item of key
-- new_key, replace the former's key by new_key,
-- set replaced , and set found_item to the item
-- previously associated with old_key.
-- Otherwise set not_found or conflict respectively.
-- If conflict , set found_item to the item previously
-- associated with new_key.
--
-- To choose between various insert/replace procedures,
-- see instructions in the Indexing clause.
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
same_count: count = old count
same_slot_count: used_slot_count = old used_slot_count
replaced_or_conflict_or_not_found: replaced or conflict or not_found
old_absent: ( replaced and not equal (new_key, old_key)) implies ( not has (old_key))
new_present: ( replaced or conflict ) = has (new_key)
new_item: replaced implies ( item (new_key) = old ( item (old_key)))
not_found_iff_no_old_key: not_found = old ( not has (old_key))
conflict_iff_already_present: conflict = old ( has (new_key))
not_inserted_if_conflict: conflict implies ( item (new_key) = old ( item (new_key)))
default_property: has_default = ((new_key = computed_default_key ) or ((new_key /= computed_default_key ) and (old has_default )))

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Removal

clear_all
-- Reset all items to default values; reset status.
-- (from HASH_TABLE )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from HASH_TABLE
position_equal_to_zero: position = 0
count_equal_to_zero: count = 0
used_slot_count_equal_to_zero: used_slot_count = 0
has_default_set: not has_default
no_status: not special_status

remove (key: INTEGER )
-- Remove item associated with key, if present.
-- Set removed if and only if an item has been
-- removed (i.e. key was present);
-- if so, set position to index of removed element.
-- If not, set not_found .
-- (from HASH_TABLE )
ensure -- from HASH_TABLE
removed_or_not_found: removed or not_found
not_present: not has (key)
one_less: found implies ( count = old count - 1)
same_slot_count: used_slot_count = old used_slot_count
default_case: (key = computed_default_key ) implies ( not has_default )
non_default_case: (key /= computed_default_key ) implies ( has_default = old has_default )

feature -- Conversion

linear_representation : ARRAYED_LIST [ DB_TYPE ]
-- Representation as a linear structure
-- (from HASH_TABLE )
ensure then -- from HASH_TABLE
result_exists: Result /= void
good_count: Result. count = count

feature -- Duplication

copy (other: like Current)
-- Re-initialize from other.
-- (from HASH_TABLE )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from HASH_TABLE
keys_not_void: keys /= void
content_not_void: content /= void
keys_same_capacity_plus_one: keys . count = capacity + 1
content_same_capacity_plus_one: content . count = capacity + 1
deleted_same_capacity: deleted_marks . count = capacity
keys_starts_at_zero: keys . lower = 0
content_starts_at_zero: content . lower = 0
deleted_starts_at_zero: deleted_marks . lower = 0
valid_iteration_position: off or truly_occupied ( iteration_position )
control_non_negative: control >= 0
special_status: special_status = ( conflict or inserted or replaced or removed or found or not_found )
max_occupation_meaningful: ( max_occupation > 0) and ( max_occupation < 100)
initial_occupation_meaningful: ( initial_occupation > 0) and ( initial_occupation < 100)
sized_generously_enough: initial_occupation < max_occupation
count_big_enough: 0 <= count
count_small_enough: count <= capacity
breathing_space: count * 100 <= capacity * max_occupation
count_no_more_than_slot_count: count <= used_slot_count
slot_count_big_enough: 0 <= count
slot_count_small_enough: used_slot_count <= capacity
extra_space_non_negative: extra_space >= 0
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0

end -- class DATABASE_ALL_TYPES


DATABASE_APPL Chart

 class
DATABASE_APPL [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "General application"
create: login_and_connect , login , default_create

Ancestors
DB_CONSTANT
GENERAL_APPL
HANDLE_SPEC [G -> DATABASE create default_create end]
HANDLE_USE

Queries
db_spec : DATABASE
is_logged_to_base : BOOLEAN

Commands
login (user_name, password: STRING )
login_and_connect (user_name, password: STRING )
set_application (application_name: STRING )
set_base
set_data_source (dsn: STRING )
set_group (groupid: STRING )
set_hostname (host_name: STRING )
set_role (roleid, rolepasswd: STRING )


DATABASE_APPL Flat contracts

 indexing
description: "General application"
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_APPL [G -> DATABASE create default_create end]

create

login (user_name, password: STRING )
-- Login to database server under user_name with password.
require
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
require
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Initialization

login (user_name, password: STRING )
-- Login to database server under user_name with password.
require
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
require
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_logged_to_base : BOOLEAN
-- Is current handle logged to Ingres server?
ensure
test_condition: Result implies ( session_login /= void )

feature -- Status setting

set_application (application_name: STRING )
-- Set database application name with application_name.
require
argument_exist: application_name /= void
ensure
is_logged_to_base: is_logged_to_base

set_base
-- Initialize or re-activate database server
-- after a handle change.
require
is_logged_to_base: is_logged_to_base
ensure
handle . database = session_database
handle . process = session_process
handle . status = session_status
handle . execution_type = session_execution_type
handle . login = session_login

set_data_source (dsn: STRING )
-- Set database source name with dsn.
require
argument_exist: dsn /= void
ensure
is_logged_to_base: is_logged_to_base

set_group (groupid: STRING )
-- Set database group with groupId.
require
argument_exist: groupid /= void
ensure
is_logged_to_base: is_logged_to_base

set_hostname (host_name: STRING )
-- Set database host name with host_name.
require
argument_exist: host_name /= void
ensure
is_logged_to_base: is_logged_to_base

set_role (roleid, rolepasswd: STRING )
-- Set database role with roleId and password(if it has one) with rolePassWd.
require
argument_exist: roleid /= void
ensure
is_logged_to_base: is_logged_to_base

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_APPL


DATABASE_BOOLEAN Chart

 class
DATABASE_BOOLEAN [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Boolean format of the database"

Ancestors
DB_TYPE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
Eiffel_name : STRING
Eiffel_ref : BOOLEAN_REF
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DATABASE_BOOLEAN Flat contracts

 indexing
description: "Boolean format of the database"
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_BOOLEAN [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
-- (from DB_TYPE )
require -- from DB_TYPE
object_not_void: object /= void
ensure -- from DB_TYPE
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure -- from DB_TYPE
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name for boolean
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure then
textual_outlook: Result. is_equal ("BOOLEAN")

eiffel_ref : BOOLEAN_REF
-- Shared boolean reference
ensure -- from DB_TYPE
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name for boolean
ensure -- from DB_TYPE
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_BOOLEAN


DATABASE_CHANGE Chart

 class
DATABASE_CHANGE [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implmentation of DB_CHANGE "
create: make

Ancestors
DB_EXEC_USE
DB_STATUS_USE
HANDLE_SPEC [G -> DATABASE create default_create end]
SQL_SCAN

Queries
infix " @ " (i: INTEGER ): CHARACTER
infix " >= " (other: [like Current] DATABASE_CHANGE [G]): BOOLEAN
infix " > " (other: [like Current] DATABASE_CHANGE [G]): BOOLEAN
infix " <= " (other: [like Current] DATABASE_CHANGE [G]): BOOLEAN
infix " < " (other: [like Current] DATABASE_CHANGE [G]): BOOLEAN
infix " + " (s: STRING ): STRING
abs (n: INTEGER ): INTEGER
adapt (s: STRING ): [like Current] DATABASE_CHANGE [G]
additional_space : INTEGER
area : SPECIAL [ CHARACTER ]
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
boolean_format (object: BOOLEAN ): STRING
Boolean_type : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
capacity : INTEGER
Changeable_comparison_criterion : BOOLEAN
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
compiler_version : INTEGER
count : INTEGER
date_format (object: DATE_TIME ): STRING
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
Extendible : BOOLEAN
False_constant : STRING
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
full : BOOLEAN
fuzzy_index (other: STRING ; start, fuzz: INTEGER ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Growth_percentage : INTEGER
has (c: CHARACTER ): BOOLEAN
hash_code : INTEGER
immediate_execution : BOOLEAN
index_of (c: CHARACTER ; start: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_connected : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DATABASE_CHANGE [G]): BOOLEAN
is_hashable : BOOLEAN
is_inserted (v: CHARACTER ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_ok : BOOLEAN
is_special (object: ANY ): BOOLEAN
is_tracing : BOOLEAN
item (i: INTEGER ): CHARACTER
item_code (i: INTEGER ): INTEGER
last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
last_parsed_query : STRING
linear_representation : LINEAR [ CHARACTER ]
mapped_value (key: STRING ): ANY
max (other: [like Current] DATABASE_CHANGE [G]): [like Current] DATABASE_CHANGE [G]
min (other: [like Current] DATABASE_CHANGE [G]): [like Current] DATABASE_CHANGE [G]
Minimal_increase : INTEGER
mirrored : [like Current] DATABASE_CHANGE [G]
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
object_comparison : BOOLEAN
occurrences (c: CHARACTER ): INTEGER
out : [like Current] DATABASE_CHANGE [G]
parse (s: STRING ): STRING
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
prunable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
resizable : BOOLEAN
rsign (r: REAL ): INTEGER
shared_with (other: [like Current] DATABASE_CHANGE [G]): BOOLEAN
sign (n: INTEGER ): INTEGER
split (a_separator: CHARACTER ): LINEAR [ STRING ]
string_format (object: STRING ): STRING
string_is_boolean : BOOLEAN
string_is_double : BOOLEAN
string_is_integer : BOOLEAN
string_is_real : BOOLEAN
substring (n1, n2: INTEGER ): [like Current] DATABASE_CHANGE [G]
substring_index (other: STRING ; start: INTEGER ): INTEGER
three_way_comparison (other: [like Current] DATABASE_CHANGE [G]): INTEGER
to_boolean : BOOLEAN
to_c : ANY
to_double : DOUBLE
to_integer : INTEGER
to_real : REAL
trace_output : FILE
True_constant : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
valid_index (i: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
adapt_size
append (s: STRING )
append_boolean (b: BOOLEAN )
append_character (c: CHARACTER )
append_double (d: DOUBLE )
append_integer (i: INTEGER )
append_real (r: REAL )
append_string (s: STRING )
append_substring (s: STRING ; n1, n2: INTEGER )
automatic_grow
center_justify
character_justify (pivot: CHARACTER ; position: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] DATABASE_CHANGE [G])
deep_traversal (object: ANY )
extend (c: CHARACTER )
fill (other: CONTAINER [ CHARACTER ])
fill_blank
fill_character (c: CHARACTER )
format_make
from_c (c_string: POINTER )
from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
get_complex_value (obj: ANY ; str: STRING )
get_value (obj: ANY ; str: STRING )
grow (newsize: INTEGER )
head (n: INTEGER )
insert (s: STRING ; i: INTEGER )
left_adjust
left_justify
make (i: INTEGER )
make_from_c (c_string: POINTER )
make_from_string (s: STRING )
mark (obj: ANY )
mirror
modify (sql: STRING )
multiply (n: INTEGER )
object_finish_action (object: ANY )
object_init_action (object: ANY )
precede (c: CHARACTER )
prepend (s: STRING )
prepend_boolean (b: BOOLEAN )
prepend_character (c: CHARACTER )
prepend_double (d: DOUBLE )
prepend_integer (i: INTEGER )
prepend_real (r: REAL )
prepend_string (s: STRING )
prune (c: CHARACTER )
prune_all (c: CHARACTER )
prune_all_leading (c: CHARACTER )
prune_all_trailing (c: CHARACTER )
put (c: CHARACTER ; i: INTEGER )
reference_object_action (i: INTEGER ; object: ANY )
remake (n: INTEGER )
remove (i: INTEGER )
replace
replace_blank
replace_character (c: CHARACTER )
replace_substring (s: [like Current] DATABASE_CHANGE [G]; start_pos, end_pos: INTEGER )
replace_substring_all (original, new: [like Current] DATABASE_CHANGE [G])
resize (newsize: INTEGER )
right_adjust
right_justify
set (t: [like Current] DATABASE_CHANGE [G]; n1, n2: INTEGER )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_ht (table: HASH_TABLE [ ANY , STRING ])
set_immediate
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_map_name (n: ANY ; key: STRING )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
set_trace
share (other: [like Current] DATABASE_CHANGE [G])
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
subcopy (other: [like Current] DATABASE_CHANGE [G]; start_pos, end_pos, index_pos: INTEGER )
switch_mark (obj: ANY )
tail (n: INTEGER )
to_lower
to_upper
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )
unset_immediate
unset_map_name (key: STRING )
unset_trace
wipe_out


DATABASE_CHANGE Flat contracts

 indexing
description: "Implmentation of DB_CHANGE "
date: "$Date: 2001/06/14 17:19:02 $"
revision: "$Revision: 1.2 $"

class interface
DATABASE_CHANGE [G -> DATABASE create default_create end]

create

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

feature -- Initialization

adapt (s: STRING ): like Current
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (from STRING )

from_c (c_string: POINTER )
-- Reset contents of string from contents of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
ensure -- from STRING
no_zero_byte: not has ('%U')

from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
-- Reset contents of string from substring of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
start_position_big_enough: start_pos >= 1
end_position_big_enough: start_pos <= end_pos + 1
ensure -- from STRING
valid_count: count = end_pos - start_pos + 1

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

format_make
-- Create an interface object to format data.
-- (from DB_FORMAT )

make_from_c (c_string: POINTER )
-- Initialize from contents of c_string,
-- a string created by some external C function
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer

make_from_string (s: STRING )
-- Initialize from the characters of s.
-- (Useful in proper descendants of class STRING ,
-- to initialize a string-like object from a manifest string.)
-- (from STRING )
require -- from STRING
string_exists: s /= void
ensure -- from STRING
shared_implementation: shared_with (s)

remake (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Access

area : SPECIAL [ CHARACTER ]
-- Special data zone
-- (from TO_SPECIAL )

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

False_constant : STRING is "false"
-- Constant string "false"
-- (from STRING )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

fuzzy_index (other: STRING ; start: INTEGER ; fuzz: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (from STRING )
require -- from STRING
other_exists: other /= void
other_not_empty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
acceptable_fuzzy: fuzz <= other. count

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has (c: CHARACTER ): BOOLEAN
-- Does string include c?
-- (from STRING )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

hash_code : INTEGER
-- Hash code value
-- (from STRING )
ensure -- from HASHABLE
good_hash_value: Result >= 0

index_of (c: CHARACTER ; start: INTEGER ): INTEGER
-- Position of first occurrence of c at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
start_large_enough: start >= 1
start_small_enough: start <= count + 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

item (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of @.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

item_code (i: INTEGER ): INTEGER
-- Numeric code of character at position i
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0

last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
-- Position of last occurence of c.
-- 0 if none
-- (from STRING )
require -- from STRING
start_index_small_enough: start_index_from_end <= count
start_index_large_enough: start_index_from_end >= 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

last_parsed_query : STRING
-- Last parsed query

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

shared_with (other: like Current): BOOLEAN
-- Does string share the text of other?
-- (from STRING )

substring_index (other: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
other_nonvoid: other /= void
other_notempty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
ensure -- from STRING
correct_place: Result > 0 implies substring (Result, Result + other. count - 1). is_equal (other)

True_constant : STRING is "true"
-- Constant string "true"
-- (from STRING )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

infix " @ " (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of item .
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

capacity : INTEGER
-- Allocated space
-- (from STRING )

count : INTEGER
-- Actual number of characters making up the string
-- (from STRING )

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from STRING )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from STRING
Result. count = count

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

occurrences (c: CHARACTER ): INTEGER
-- Number of times c appears in the string
-- (from STRING )
ensure -- from BAG
non_negative_occurrences: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (from STRING )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from COMPARABLE
trichotomy: Result = ( not (Current < other) and not (other < Current))

max (other: like Current): like Current
-- The greater of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other

min (other: like Current): like Current
-- The smaller of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other

three_way_comparison (other: like Current): INTEGER
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)

infix " < " (other: like Current): BOOLEAN
-- Is string lexicographically lower than other?
-- (from STRING )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
asymmetric: Result implies not (other < Current)

infix " <= " (other: like Current): BOOLEAN
-- Is current object less than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = ((Current < other) or is_equal (other))

infix " > " (other: like Current): BOOLEAN
-- Is current object greater than other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other < Current)

infix " >= " (other: like Current): BOOLEAN
-- Is current object greater than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other <= Current)

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status report

Changeable_comparison_criterion : BOOLEAN is False
-- (from STRING )

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from STRING )

full : BOOLEAN
-- Is structure full?
-- (from BOUNDED )

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

string_is_boolean : BOOLEAN
-- Does Current represent a BOOLEAN?
-- (from STRING )

string_is_double : BOOLEAN
-- Does Current represent a DOUBLE?
-- (from STRING )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

is_inserted (v: CHARACTER ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

string_is_integer : BOOLEAN
-- Does Current represent an INTEGER?
-- (from STRING )

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
-- (from STRING_HDL )
require -- from STRING_HDL
keys_exists: key /= void

string_is_real : BOOLEAN
-- Does Current represent a REAL?
-- (from STRING )

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from STRING )

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the string?
-- (from STRING )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

feature -- Status setting

clear_all
-- Remove all mapped keys.
-- (from STRING_HDL )
ensure -- from STRING
is_empty: count = 0
same_capacity: capacity = old capacity

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

set_ht (table: HASH_TABLE [ ANY , STRING ])
-- Pass map table to current.
-- Set ht with table.
require else
table_exists: table /= void
ensure then
ht = table

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Element change

append (s: STRING )
-- Append a copy of s at end.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + old s. count

append_boolean (b: BOOLEAN )
-- Append the string representation of b at end.
-- (from STRING )

append_character (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of extend .
-- (from STRING )
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

append_double (d: DOUBLE )
-- Append the string representation of d at end.
-- (from STRING )

append_integer (i: INTEGER )
-- Append the string representation of i at end.
-- (from STRING )

append_real (r: REAL )
-- Append the string representation of r at end.
-- (from STRING )

append_string (s: STRING )
-- Append a copy of s, if not void, at end.
-- (from STRING )

copy (other: like Current)
-- Reinitialize by copying the characters of other.
-- (This is also used by clone .)
-- (from STRING )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)
ensure then -- from STRING
new_result_count: count = other. count

extend (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of append_character .
-- (from STRING )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

fill (other: CONTAINER [ CHARACTER ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

fill_blank
-- Fill with capacity blank characters.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

fill_character (c: CHARACTER )
-- Fill with capacity characters all equal to c.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

head (n: INTEGER )
-- Remove all characters except for the first n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

insert (s: STRING ; i: INTEGER )
-- Add s to the left of position i in current string.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count + s. count

left_adjust
-- Remove leading whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item (1) /= ' ') and ( item (1) /= ' ') and ( item (1) /= '%R') and ( item (1) /= ''))

modify (sql: STRING )
-- Pass to active database handle a modification
-- query with SQL statement sql.
-- Execute sql statement.
require else
argument_exists: sql /= void
connected: is_connected
descriptor_is_available: db_spec . descriptor_is_available

precede (c: CHARACTER )
-- Add c at front.
-- (from STRING )
ensure -- from STRING
new_count: count = old count + 1

prepend (s: STRING )
-- Prepend a copy of s at front.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + s. count

prepend_boolean (b: BOOLEAN )
-- Prepend the string representation of b at front.
-- (from STRING )

prepend_character (c: CHARACTER )
-- Prepend the string representation of c at front.
-- (from STRING )

prepend_double (d: DOUBLE )
-- Prepend the string representation of d at front.
-- (from STRING )

prepend_integer (i: INTEGER )
-- Prepend the string representation of i at front.
-- (from STRING )

prepend_real (r: REAL )
-- Prepend the string representation of r at front.
-- (from STRING )

prepend_string (s: STRING )
-- Prepend a copy of s, if not void, at front.
-- (from STRING )

put (c: CHARACTER ; i: INTEGER )
-- Replace character at position i by c.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: item (k) = v

replace_blank
-- Replace all current characters with blanks.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_character (c: CHARACTER )
-- Replace all current characters with characters all equal to c.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_substring (s: like Current; start_pos, end_pos: INTEGER )
-- Copy the characters of s to positions
-- start_pos .. end_pos.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: end_pos <= count
order_respected: start_pos <= end_pos
index_large_enough: start_pos > 0
ensure -- from STRING
new_count: count = old count + s. count - end_pos + start_pos - 1

replace_substring_all (original, new: like Current)
-- Replace every occurence of original with new.
-- (from STRING )
require -- from STRING
original_exists: original /= void
new_exists: new /= void
original_not_empty: not original. is_empty

right_adjust
-- Remove trailing whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item ( count ) /= ' ') and ( item ( count ) /= ' ') and ( item ( count ) /= '%R') and ( item ( count ) /= ''))

set (t: like Current; n1, n2: INTEGER )
-- Set current string to substring of t from indices n1
-- to n2, or to empty string if no such substring.
-- (from STRING )
require -- from STRING
argument_not_void: t /= void
ensure -- from STRING
is_substring: is_equal (t. substring (n1, n2))

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

share (other: like Current)
-- Make current string share the text of other.
-- Subsequent changes to the characters of current string
-- will also affect other, and conversely.
-- (from STRING )
require -- from STRING
argument_not_void: other /= void
ensure -- from STRING
shared_count: other. count = count

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (from STRING )
require -- from STRING
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( count - index_pos) >= (end_pos - start_pos)

tail (n: INTEGER )
-- Remove all characters except for the last n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

infix " + " (s: STRING ): STRING
-- Append a copy of 's' at the end of a copy of Current,
-- Then return the Result.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
result_exists: Result /= void
new_count: Result. count = count + s. count

feature -- Removal

prune (c: CHARACTER )
-- Remove first occurrence of c, if any.
-- (from STRING )
require -- from COLLECTION
prunable: prunable
require else -- from STRING
True

prune_all (c: CHARACTER )
-- Remove all occurrences of c.
-- (from STRING )
require -- from COLLECTION
prunable
require else -- from STRING
True
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from STRING
changed_count: count = (old count ) - (old occurrences (c))

prune_all_leading (c: CHARACTER )
-- Remove all leading occurrences of c.
-- (from STRING )

prune_all_trailing (c: CHARACTER )
-- Remove all trailing occurrences of c.
-- (from STRING )

remove (i: INTEGER )
-- Remove i-th character.
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count - 1

wipe_out
-- Remove all characters.
-- (from STRING )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from STRING
is_empty: count = 0
empty_capacity: capacity = 0

feature -- Resizing

adapt_size
-- Adapt the size to accommodate count characters.
-- (from STRING )

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (newsize: INTEGER )
-- Ensure that the capacity is at least newsize.
-- (from STRING )
require -- from RESIZABLE
True
require else -- from STRING
new_size_non_negative: newsize >= 0
ensure -- from RESIZABLE
new_capacity: capacity >= i

resize (newsize: INTEGER )
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (from STRING )
require -- from STRING
new_size_non_negative: newsize >= 0

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- Converted string of object according to the database format
-- (from DB_FORMAT )

center_justify
-- Center justify the string using
-- the capacity as the width
-- (from STRING )

character_justify (pivot: CHARACTER ; position: INTEGER )
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (from STRING )
require -- from STRING
valid_position: position <= capacity
positive_position: position >= 1
pivot_not_space: pivot /= ' '
not_empty: not is_empty

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_format (object: DATE_TIME ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

left_justify
-- Left justify the string using
-- the capacity as the width
-- (from STRING )

linear_representation : LINEAR [ CHARACTER ]
-- Representation as a linear structure
-- (from STRING )

mirror
-- Reverse the order of characters.
-- "Hello world" -> "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: count = old count

mirrored : like Current
-- Mirror image of string;
-- result for "Hello world" is "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: Result. count = count

right_justify
-- Right justify the string using
-- the capacity as the width
-- (from STRING )

split (a_separator: CHARACTER ): LINEAR [ STRING ]
-- Split on a_separator.
-- Ignore separators in quotes.
-- (from STRING )
ensure -- from STRING
Result /= void

string_format (object: STRING ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

to_boolean : BOOLEAN
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (from STRING )
require -- from STRING
is_boolean: string_is_boolean

frozen to_c : ANY
-- A reference to a C form of current string.
-- Useful only for interfacing with C software.
-- (from STRING )

to_double : DOUBLE
-- "Double" value;
-- for example, when applied to "123.0", will yield 123.0 (double)
-- (from STRING )
require -- from STRING
represents_a_double: string_is_double

to_integer : INTEGER
-- Integer value;
-- for example, when applied to "123", will yield 123
-- (from STRING )
require -- from STRING
is_integer: string_is_integer

to_lower
-- Convert to lower case.
-- (from STRING )

to_real : REAL
-- Real value;
-- for example, when applied to "123.0", will yield 123.0
-- (from STRING )
require -- from STRING
represents_a_real: string_is_real

to_upper
-- Convert to upper case.
-- (from STRING )

feature -- Duplication

multiply (n: INTEGER )
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (from STRING )
require -- from STRING
meaningful_multiplier: n >= 1

substring (n1, n2: INTEGER ): like Current
-- Copy of substring containing all characters at indices
-- between n1 and n2
-- (from STRING )
ensure -- from STRING
new_result_count: Result. count = n2 - n1 + 1 or Result. count = 0

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

append_substring (s: STRING ; n1, n2: INTEGER )
-- Append substring `s.substring (n1, n2)' to Current.
-- Faster than append s.substring (n1, n2).
-- (from SQL_SCAN )
require -- from SQL_SCAN
string_exists: s /= void
meaningful_origin: 1 <= n1
meaningful_interval: n1 <= n2
meaningful_end: n2 <= s. count

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

get_complex_value (obj: ANY ; str: STRING )
-- Retrieve string value of reference object obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
object_exists: obj /= void
str_exists: str /= void

get_value (obj: ANY ; str: STRING )
-- Retrieve string value of obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
str_exists: str /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

parse (s: STRING ): STRING
-- Parse string s by replacing each pattern ":<name>"
-- with the Eiffel object description whose name
-- also matches "<name>".
-- (from SQL_SCAN )

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

replace
-- Replace all occurences of :key by `ht.item (":key")'
-- (from SQL_SCAN )

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Output

out : like Current
-- Printable representation
-- (from STRING )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from STRING
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set . count = count
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from COMPARABLE
irreflexive_comparison: not (Current < Current)

end -- class DATABASE_CHANGE


DATABASE_CHARACTER Chart

 class
DATABASE_CHARACTER [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Character format of the database"

Ancestors
DB_TYPE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
Eiffel_name : STRING
Eiffel_ref : CHARACTER_REF
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DATABASE_CHARACTER Flat contracts

 indexing
description: "Character format of the database"
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_CHARACTER [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
-- (from DB_TYPE )
require -- from DB_TYPE
object_not_void: object /= void
ensure -- from DB_TYPE
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure -- from DB_TYPE
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name for character
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure then
Result. is_equal ("CHARACTER")

eiffel_ref : CHARACTER_REF
-- Shared character reference
ensure -- from DB_TYPE
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name for character
ensure -- from DB_TYPE
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_CHARACTER


DATABASE_CONTROL Chart

 class
DATABASE_CONTROL [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_CONTROL "

Ancestors
DB_STATUS_USE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
db_spec : DATABASE
is_connected : BOOLEAN
transaction_count : INTEGER

Commands
begin
commit
connect
disconnect
rollback


DATABASE_CONTROL Flat contracts

 indexing
description: "Implementation of DB_CONTROL "
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_CONTROL [G -> DATABASE create default_create end]

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

feature -- Status setting and report

begin
-- Start of transaction status from database handle
require
connection_exists: is_connected

commit
-- Commit status from database handle
require
connection_exists: is_connected

connect
-- Connection from database
require
not_already_connected: not is_connected

disconnect
-- Disconnection from database
require
connection_exists: is_connected

rollback
-- Rollback status from database handle
require
connection_exists: is_connected

transaction_count : INTEGER
-- Number of started transactions with database handle
require
connection_exists: is_connected

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_CONTROL


DATABASE_DATA Chart

 class
DATABASE_DATA [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_DATA "

Ancestors
DB_CONSTANT
DB_DATA_SQL
DB_STATUS_USE
EXT_INTERNAL
TYPES [G -> DATABASE create default_create end]

Queries
abs (n: INTEGER ): INTEGER
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
Boolean_type_database : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
Character_type_database : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
column_name (index: INTEGER ): STRING
compiler_version : INTEGER
count : INTEGER
Date_type_database : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
Float_type_database : INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
Integer_type_database : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_special (object: ANY ): BOOLEAN
item (index: INTEGER ): ANY
map_table : ARRAY [ INTEGER ]
metadata_to_update : BOOLEAN
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Real_type_database : INTEGER
Reference_type : INTEGER
rsign (r: REAL ): INTEGER
sign (n: INTEGER ): INTEGER
String_type_database : INTEGER
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
Wide_character_type : INTEGER

Commands
deep_traversal (object: ANY )
fill_in (no_descriptor: INTEGER )
mark (obj: ANY )
object_finish_action (object: ANY )
object_init_action (object: ANY )
reference_object_action (i: INTEGER ; object: ANY )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
switch_mark (obj: ANY )
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )
update_map_table (object: ANY )
update_metadata


DATABASE_DATA Flat contracts

 indexing
description: "Implementation of DB_DATA "
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_DATA [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Status report

column_name (index: INTEGER ): STRING
-- Name of the index-th column.
require -- from DB_DATA_SQL
True
require else
index_in_range: index > 0 and index <= count
ensure then
returned_name: Result = select_name . item (index)

count : INTEGER
-- Number of columns in result

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

item (index: INTEGER ): ANY
-- Data at index-th column.
require -- from DB_DATA_SQL
True
require else
index_in_range: index > 0 and index <= count
ensure then
returned_value: Result = value . item (index)

map_table : ARRAY [ INTEGER ]
-- Correspondance table between column rank and
-- attribute rank in mapped object

metadata_to_update : BOOLEAN
-- Should cursor update the metadata to fill in database
-- values properly?
-- (from DB_DATA )

feature -- Status setting

update_metadata
-- Cursor must update database metadata to
-- fill in properly.
-- (from DB_DATA )

feature -- Element change

fill_in (no_descriptor: INTEGER )
-- Fill attributes of Current with results obtained
-- from server after execution of query statement.

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

update_map_table (object: ANY )
-- Update map table according to field names of object
-- and Current metadata.
require -- from DB_DATA_SQL
True
require else
object_exists: object /= void

feature -- Conversion

boolean_type_database : INTEGER
-- Boolean type code in Ingres
-- (from TYPES )

character_type_database : INTEGER
-- Character type code in Ingres
-- (from TYPES )

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_type_database : INTEGER
-- Datetime type code in Ingres
-- (from TYPES )

float_type_database : INTEGER
-- Double type code in Ingres
-- (from TYPES )

integer_type_database : INTEGER
-- Integer type code in Ingres
-- (from TYPES )

real_type_database : INTEGER
-- Real type code in Ingres
-- (from TYPES )

string_type_database : INTEGER
-- String type code in Ingres
-- (from TYPES )

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_DATA


DATABASE_DATETIME Chart

 class
DATABASE_DATETIME [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: " DATE_TIME format of the database"

Ancestors
DB_TYPE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
eiffel_name : STRING
Eiffel_ref : DATE_TIME
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DATABASE_DATETIME Flat contracts

 indexing
description: " DATE_TIME format of the database"
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_DATETIME [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
-- (from DB_TYPE )
require -- from DB_TYPE
object_not_void: object /= void
ensure -- from DB_TYPE
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure -- from DB_TYPE
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void

eiffel_ref : DATE_TIME
-- Shared absolute date reference
ensure -- from DB_TYPE
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name for date
ensure -- from DB_TYPE
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_DATETIME


DATABASE_DOUBLE Chart

 class
DATABASE_DOUBLE [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Double format of the database"

Ancestors
DB_TYPE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
Eiffel_name : STRING
Eiffel_ref : DOUBLE_REF
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DATABASE_DOUBLE Flat contracts

 indexing
description: "Double format of the database"
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_DOUBLE [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
-- (from DB_TYPE )
require -- from DB_TYPE
object_not_void: object /= void
ensure -- from DB_TYPE
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure -- from DB_TYPE
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name for double
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure then
Result. is_equal ("DOUBLE")

eiffel_ref : DOUBLE_REF
-- Shared double reference
ensure -- from DB_TYPE
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name for double
ensure -- from DB_TYPE
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_DOUBLE


DATABASE_DYN_CHANGE Chart

 class
DATABASE_DYN_CHANGE [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_DYN_CHANGE "
create: make

Ancestors
DATABASE_CHANGE [G -> DATABASE create default_create end]
PARAMETER_HDL

Queries
infix " @ " (i: INTEGER ): CHARACTER
infix " >= " (other: [like Current] DATABASE_DYN_CHANGE [G]): BOOLEAN
infix " > " (other: [like Current] DATABASE_DYN_CHANGE [G]): BOOLEAN
infix " <= " (other: [like Current] DATABASE_DYN_CHANGE [G]): BOOLEAN
infix " < " (other: [like Current] DATABASE_DYN_CHANGE [G]): BOOLEAN
infix " + " (s: STRING ): STRING
abs (n: INTEGER ): INTEGER
adapt (s: STRING ): [like Current] DATABASE_DYN_CHANGE [G]
additional_space : INTEGER
area : SPECIAL [ CHARACTER ]
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
boolean_format (object: BOOLEAN ): STRING
Boolean_type : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
capacity : INTEGER
Changeable_comparison_criterion : BOOLEAN
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
compiler_version : INTEGER
count : INTEGER
date_format (object: DATE_TIME ): STRING
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
Extendible : BOOLEAN
False_constant : STRING
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
full : BOOLEAN
fuzzy_index (other: STRING ; start, fuzz: INTEGER ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Growth_percentage : INTEGER
has (c: CHARACTER ): BOOLEAN
hash_code : INTEGER
immediate_execution : BOOLEAN
index_of (c: CHARACTER ; start: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_allocatable : BOOLEAN
is_connected : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DATABASE_DYN_CHANGE [G]): BOOLEAN
is_executed : BOOLEAN
is_hashable : BOOLEAN
is_inserted (v: CHARACTER ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_ok : BOOLEAN
is_prepared : BOOLEAN
is_special (object: ANY ): BOOLEAN
is_tracing : BOOLEAN
item (i: INTEGER ): CHARACTER
item_code (i: INTEGER ): INTEGER
last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
last_parsed_query : STRING
linear_representation : LINEAR [ CHARACTER ]
mapped_value (key: STRING ): ANY
max (other: [like Current] DATABASE_DYN_CHANGE [G]): [like Current] DATABASE_DYN_CHANGE [G]
min (other: [like Current] DATABASE_DYN_CHANGE [G]): [like Current] DATABASE_DYN_CHANGE [G]
Minimal_increase : INTEGER
mirrored : [like Current] DATABASE_DYN_CHANGE [G]
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
object_comparison : BOOLEAN
occurrences (c: CHARACTER ): INTEGER
out : [like Current] DATABASE_DYN_CHANGE [G]
parameter_count : INTEGER
parameter_name_exist (key: STRING ): BOOLEAN
parse (s: STRING ): STRING
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
prunable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
resizable : BOOLEAN
rsign (r: REAL ): INTEGER
shared_with (other: [like Current] DATABASE_DYN_CHANGE [G]): BOOLEAN
sign (n: INTEGER ): INTEGER
split (a_separator: CHARACTER ): LINEAR [ STRING ]
string_format (object: STRING ): STRING
string_is_boolean : BOOLEAN
string_is_double : BOOLEAN
string_is_integer : BOOLEAN
string_is_real : BOOLEAN
substring (n1, n2: INTEGER ): [like Current] DATABASE_DYN_CHANGE [G]
substring_index (other: STRING ; start: INTEGER ): INTEGER
three_way_comparison (other: [like Current] DATABASE_DYN_CHANGE [G]): INTEGER
to_boolean : BOOLEAN
to_c : ANY
to_double : DOUBLE
to_integer : INTEGER
to_real : REAL
trace_output : FILE
True_constant : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
valid_index (i: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
adapt_size
append (s: STRING )
append_boolean (b: BOOLEAN )
append_character (c: CHARACTER )
append_double (d: DOUBLE )
append_integer (i: INTEGER )
append_real (r: REAL )
append_string (s: STRING )
append_substring (s: STRING ; n1, n2: INTEGER )
automatic_grow
bind_parameter
center_justify
character_justify (pivot: CHARACTER ; position: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] DATABASE_DYN_CHANGE [G])
deep_traversal (object: ANY )
execute
extend (c: CHARACTER )
fill (other: CONTAINER [ CHARACTER ])
fill_blank
fill_character (c: CHARACTER )
format_make
from_c (c_string: POINTER )
from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
get_complex_value (obj: ANY ; str: STRING )
get_value (obj: ANY ; str: STRING )
grow (newsize: INTEGER )
head (n: INTEGER )
insert (s: STRING ; i: INTEGER )
left_adjust
left_justify
make (i: INTEGER )
make_from_c (c_string: POINTER )
make_from_string (s: STRING )
mark (obj: ANY )
mirror
modify (sql: STRING )
multiply (n: INTEGER )
normal_put (c: CHARACTER ; i: INTEGER )
object_finish_action (object: ANY )
object_init_action (object: ANY )
precede (c: CHARACTER )
prepare (s: STRING )
prepend (s: STRING )
prepend_boolean (b: BOOLEAN )
prepend_character (c: CHARACTER )
prepend_double (d: DOUBLE )
prepend_integer (i: INTEGER )
prepend_real (r: REAL )
prepend_string (s: STRING )
prune (c: CHARACTER )
prune_all (c: CHARACTER )
prune_all_leading (c: CHARACTER )
prune_all_trailing (c: CHARACTER )
reference_object_action (i: INTEGER ; object: ANY )
remake (n: INTEGER )
remove (i: INTEGER )
replace
replace_blank
replace_character (c: CHARACTER )
replace_substring (s: [like Current] DATABASE_DYN_CHANGE [G]; start_pos, end_pos: INTEGER )
replace_substring_all (original, new: [like Current] DATABASE_DYN_CHANGE [G])
resize (newsize: INTEGER )
right_adjust
right_justify
set (t: [like Current] DATABASE_DYN_CHANGE [G]; n1, n2: INTEGER )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_executed (b: BOOLEAN )
set_ht (table: HASH_TABLE [ ANY , STRING ])
set_immediate
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_map_name (n: ANY ; key: STRING )
set_parameter (value: ANY ; key: STRING )
set_parameters_value (p: ARRAY [ ANY ])
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_prepared (b: BOOLEAN )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
set_trace
setup_parameters
share (other: [like Current] DATABASE_DYN_CHANGE [G])
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
subcopy (other: [like Current] DATABASE_DYN_CHANGE [G]; start_pos, end_pos, index_pos: INTEGER )
switch_mark (obj: ANY )
tail (n: INTEGER )
terminate
to_lower
to_upper
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )
unset_immediate
unset_map_name (key: STRING )
unset_trace
wipe_out


DATABASE_DYN_CHANGE Flat contracts

 indexing
description: "Implementation of DB_DYN_CHANGE "
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_DYN_CHANGE [G -> DATABASE create default_create end]

create

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

feature -- Initialization

adapt (s: STRING ): like Current
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (from STRING )

from_c (c_string: POINTER )
-- Reset contents of string from contents of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
ensure -- from STRING
no_zero_byte: not has ('%U')

from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
-- Reset contents of string from substring of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
start_position_big_enough: start_pos >= 1
end_position_big_enough: start_pos <= end_pos + 1
ensure -- from STRING
valid_count: count = end_pos - start_pos + 1

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

format_make
-- Create an interface object to format data.
-- (from DB_FORMAT )

make_from_c (c_string: POINTER )
-- Initialize from contents of c_string,
-- a string created by some external C function
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer

make_from_string (s: STRING )
-- Initialize from the characters of s.
-- (Useful in proper descendants of class STRING ,
-- to initialize a string-like object from a manifest string.)
-- (from STRING )
require -- from STRING
string_exists: s /= void
ensure -- from STRING
shared_implementation: shared_with (s)

remake (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Access

area : SPECIAL [ CHARACTER ]
-- Special data zone
-- (from TO_SPECIAL )

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

False_constant : STRING is "false"
-- Constant string "false"
-- (from STRING )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

fuzzy_index (other: STRING ; start: INTEGER ; fuzz: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (from STRING )
require -- from STRING
other_exists: other /= void
other_not_empty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
acceptable_fuzzy: fuzz <= other. count

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has (c: CHARACTER ): BOOLEAN
-- Does string include c?
-- (from STRING )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

hash_code : INTEGER
-- Hash code value
-- (from STRING )
ensure -- from HASHABLE
good_hash_value: Result >= 0

index_of (c: CHARACTER ; start: INTEGER ): INTEGER
-- Position of first occurrence of c at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
start_large_enough: start >= 1
start_small_enough: start <= count + 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

item (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of @.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

item_code (i: INTEGER ): INTEGER
-- Numeric code of character at position i
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0

last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
-- Position of last occurence of c.
-- 0 if none
-- (from STRING )
require -- from STRING
start_index_small_enough: start_index_from_end <= count
start_index_large_enough: start_index_from_end >= 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

last_parsed_query : STRING
-- Last parsed query
-- (from DATABASE_CHANGE )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

shared_with (other: like Current): BOOLEAN
-- Does string share the text of other?
-- (from STRING )

substring_index (other: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
other_nonvoid: other /= void
other_notempty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
ensure -- from STRING
correct_place: Result > 0 implies substring (Result, Result + other. count - 1). is_equal (other)

True_constant : STRING is "true"
-- Constant string "true"
-- (from STRING )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

infix " @ " (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of item .
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

capacity : INTEGER
-- Allocated space
-- (from STRING )

count : INTEGER
-- Actual number of characters making up the string
-- (from STRING )

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from STRING )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from STRING
Result. count = count

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

occurrences (c: CHARACTER ): INTEGER
-- Number of times c appears in the string
-- (from STRING )
ensure -- from BAG
non_negative_occurrences: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (from STRING )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from COMPARABLE
trichotomy: Result = ( not (Current < other) and not (other < Current))

max (other: like Current): like Current
-- The greater of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other

min (other: like Current): like Current
-- The smaller of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other

three_way_comparison (other: like Current): INTEGER
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)

infix " < " (other: like Current): BOOLEAN
-- Is string lexicographically lower than other?
-- (from STRING )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
asymmetric: Result implies not (other < Current)

infix " <= " (other: like Current): BOOLEAN
-- Is current object less than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = ((Current < other) or is_equal (other))

infix " > " (other: like Current): BOOLEAN
-- Is current object greater than other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other < Current)

infix " >= " (other: like Current): BOOLEAN
-- Is current object greater than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other <= Current)

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status report

Changeable_comparison_criterion : BOOLEAN is False
-- (from STRING )

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from STRING )

full : BOOLEAN
-- Is structure full?
-- (from BOUNDED )

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

string_is_boolean : BOOLEAN
-- Does Current represent a BOOLEAN?
-- (from STRING )

string_is_double : BOOLEAN
-- Does Current represent a DOUBLE?
-- (from STRING )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_executed : BOOLEAN
-- Is the statement has been executed ?
-- (from PARAMETER_HDL )

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

is_inserted (v: CHARACTER ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

string_is_integer : BOOLEAN
-- Does Current represent an INTEGER?
-- (from STRING )

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity ?
-- (from PARAMETER_HDL )
require -- from STRING_HDL
keys_exists: key /= void

is_prepared : BOOLEAN
-- Is the statement has been prepared ?
-- (from PARAMETER_HDL )

string_is_real : BOOLEAN
-- Does Current represent a REAL?
-- (from STRING )

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

parameter_count : INTEGER
-- number of parameters, set by 'prepare'
-- (from PARAMETER_HDL )
ensure -- from PARAMETER_HDL
Result > 0 implies is_prepared

parameter_name_exist (key: STRING ): BOOLEAN
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
not_void: key /= void

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from STRING )

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the string?
-- (from STRING )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

feature -- Status setting

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

set_ht (table: HASH_TABLE [ ANY , STRING ])
-- Pass map table to current.
-- Set ht with table.
-- (from DATABASE_CHANGE )
require else -- from DATABASE_CHANGE
table_exists: table /= void
ensure then -- from DATABASE_CHANGE
ht = table

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Element change

append (s: STRING )
-- Append a copy of s at end.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + old s. count

append_boolean (b: BOOLEAN )
-- Append the string representation of b at end.
-- (from STRING )

append_character (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of extend .
-- (from STRING )
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

append_double (d: DOUBLE )
-- Append the string representation of d at end.
-- (from STRING )

append_integer (i: INTEGER )
-- Append the string representation of i at end.
-- (from STRING )

append_real (r: REAL )
-- Append the string representation of r at end.
-- (from STRING )

append_string (s: STRING )
-- Append a copy of s, if not void, at end.
-- (from STRING )

copy (other: like Current)
-- Reinitialize by copying the characters of other.
-- (This is also used by clone .)
-- (from STRING )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)
ensure then -- from STRING
new_result_count: count = other. count

extend (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of append_character .
-- (from STRING )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

fill (other: CONTAINER [ CHARACTER ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

fill_blank
-- Fill with capacity blank characters.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

fill_character (c: CHARACTER )
-- Fill with capacity characters all equal to c.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

head (n: INTEGER )
-- Remove all characters except for the first n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

insert (s: STRING ; i: INTEGER )
-- Add s to the left of position i in current string.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count + s. count

left_adjust
-- Remove leading whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item (1) /= ' ') and ( item (1) /= ' ') and ( item (1) /= '%R') and ( item (1) /= ''))

modify (sql: STRING )
-- Pass to active database handle a modification
-- query with SQL statement sql.
-- Execute sql statement.
-- (from DATABASE_CHANGE )
require else -- from DATABASE_CHANGE
argument_exists: sql /= void
connected: is_connected
descriptor_is_available: db_spec . descriptor_is_available

precede (c: CHARACTER )
-- Add c at front.
-- (from STRING )
ensure -- from STRING
new_count: count = old count + 1

prepend (s: STRING )
-- Prepend a copy of s at front.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + s. count

prepend_boolean (b: BOOLEAN )
-- Prepend the string representation of b at front.
-- (from STRING )

prepend_character (c: CHARACTER )
-- Prepend the string representation of c at front.
-- (from STRING )

prepend_double (d: DOUBLE )
-- Prepend the string representation of d at front.
-- (from STRING )

prepend_integer (i: INTEGER )
-- Prepend the string representation of i at front.
-- (from STRING )

prepend_real (r: REAL )
-- Prepend the string representation of r at front.
-- (from STRING )

prepend_string (s: STRING )
-- Prepend a copy of s, if not void, at front.
-- (from STRING )

normal_put (c: CHARACTER ; i: INTEGER )
-- Replace character at position i by c.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: item (k) = v

replace_blank
-- Replace all current characters with blanks.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_character (c: CHARACTER )
-- Replace all current characters with characters all equal to c.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_substring (s: like Current; start_pos, end_pos: INTEGER )
-- Copy the characters of s to positions
-- start_pos .. end_pos.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: end_pos <= count
order_respected: start_pos <= end_pos
index_large_enough: start_pos > 0
ensure -- from STRING
new_count: count = old count + s. count - end_pos + start_pos - 1

replace_substring_all (original, new: like Current)
-- Replace every occurence of original with new.
-- (from STRING )
require -- from STRING
original_exists: original /= void
new_exists: new /= void
original_not_empty: not original. is_empty

right_adjust
-- Remove trailing whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item ( count ) /= ' ') and ( item ( count ) /= ' ') and ( item ( count ) /= '%R') and ( item ( count ) /= ''))

set (t: like Current; n1, n2: INTEGER )
-- Set current string to substring of t from indices n1
-- to n2, or to empty string if no such substring.
-- (from STRING )
require -- from STRING
argument_not_void: t /= void
ensure -- from STRING
is_substring: is_equal (t. substring (n1, n2))

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

share (other: like Current)
-- Make current string share the text of other.
-- Subsequent changes to the characters of current string
-- will also affect other, and conversely.
-- (from STRING )
require -- from STRING
argument_not_void: other /= void
ensure -- from STRING
shared_count: other. count = count

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (from STRING )
require -- from STRING
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( count - index_pos) >= (end_pos - start_pos)

tail (n: INTEGER )
-- Remove all characters except for the last n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

infix " + " (s: STRING ): STRING
-- Append a copy of 's' at the end of a copy of Current,
-- Then return the Result.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
result_exists: Result /= void
new_count: Result. count = count + s. count

feature -- Removal

prune (c: CHARACTER )
-- Remove first occurrence of c, if any.
-- (from STRING )
require -- from COLLECTION
prunable: prunable
require else -- from STRING
True

prune_all (c: CHARACTER )
-- Remove all occurrences of c.
-- (from STRING )
require -- from COLLECTION
prunable
require else -- from STRING
True
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from STRING
changed_count: count = (old count ) - (old occurrences (c))

prune_all_leading (c: CHARACTER )
-- Remove all leading occurrences of c.
-- (from STRING )

prune_all_trailing (c: CHARACTER )
-- Remove all trailing occurrences of c.
-- (from STRING )

remove (i: INTEGER )
-- Remove i-th character.
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count - 1

wipe_out
-- Remove all characters.
-- (from STRING )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from STRING
is_empty: count = 0
empty_capacity: capacity = 0

feature -- Resizing

adapt_size
-- Adapt the size to accommodate count characters.
-- (from STRING )

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (newsize: INTEGER )
-- Ensure that the capacity is at least newsize.
-- (from STRING )
require -- from RESIZABLE
True
require else -- from STRING
new_size_non_negative: newsize >= 0
ensure -- from RESIZABLE
new_capacity: capacity >= i

resize (newsize: INTEGER )
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (from STRING )
require -- from STRING
new_size_non_negative: newsize >= 0

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- Converted string of object according to the database format
-- (from DB_FORMAT )

center_justify
-- Center justify the string using
-- the capacity as the width
-- (from STRING )

character_justify (pivot: CHARACTER ; position: INTEGER )
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (from STRING )
require -- from STRING
valid_position: position <= capacity
positive_position: position >= 1
pivot_not_space: pivot /= ' '
not_empty: not is_empty

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_format (object: DATE_TIME ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

left_justify
-- Left justify the string using
-- the capacity as the width
-- (from STRING )

linear_representation : LINEAR [ CHARACTER ]
-- Representation as a linear structure
-- (from STRING )

mirror
-- Reverse the order of characters.
-- "Hello world" -> "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: count = old count

mirrored : like Current
-- Mirror image of string;
-- result for "Hello world" is "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: Result. count = count

right_justify
-- Right justify the string using
-- the capacity as the width
-- (from STRING )

split (a_separator: CHARACTER ): LINEAR [ STRING ]
-- Split on a_separator.
-- Ignore separators in quotes.
-- (from STRING )
ensure -- from STRING
Result /= void

string_format (object: STRING ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

to_boolean : BOOLEAN
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (from STRING )
require -- from STRING
is_boolean: string_is_boolean

frozen to_c : ANY
-- A reference to a C form of current string.
-- Useful only for interfacing with C software.
-- (from STRING )

to_double : DOUBLE
-- "Double" value;
-- for example, when applied to "123.0", will yield 123.0 (double)
-- (from STRING )
require -- from STRING
represents_a_double: string_is_double

to_integer : INTEGER
-- Integer value;
-- for example, when applied to "123", will yield 123
-- (from STRING )
require -- from STRING
is_integer: string_is_integer

to_lower
-- Convert to lower case.
-- (from STRING )

to_real : REAL
-- Real value;
-- for example, when applied to "123.0", will yield 123.0
-- (from STRING )
require -- from STRING
represents_a_real: string_is_real

to_upper
-- Convert to upper case.
-- (from STRING )

feature -- Duplication

multiply (n: INTEGER )
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (from STRING )
require -- from STRING
meaningful_multiplier: n >= 1

substring (n1, n2: INTEGER ): like Current
-- Copy of substring containing all characters at indices
-- between n1 and n2
-- (from STRING )
ensure -- from STRING
new_result_count: Result. count = n2 - n1 + 1 or Result. count = 0

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

append_substring (s: STRING ; n1, n2: INTEGER )
-- Append substring `s.substring (n1, n2)' to Current.
-- Faster than append s.substring (n1, n2).
-- (from SQL_SCAN )
require -- from SQL_SCAN
string_exists: s /= void
meaningful_origin: 1 <= n1
meaningful_interval: n1 <= n2
meaningful_end: n2 <= s. count

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

get_complex_value (obj: ANY ; str: STRING )
-- Retrieve string value of reference object obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
object_exists: obj /= void
str_exists: str /= void

get_value (obj: ANY ; str: STRING )
-- Retrieve string value of obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
str_exists: str /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

parse (s: STRING ): STRING
-- Parse string s by replacing each pattern ":<name>"
-- with the Eiffel object description whose name
-- also matches "<name>".
-- (from SQL_SCAN )

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

replace
-- Replace all occurences of :key by `ht.item (":key")'
-- (from SQL_SCAN )

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature

bind_parameter
-- Bind of the prarameters of the sql statement
require
prepared_statement: is_prepared

clear_all
-- (from PARAMETER_HDL )
ensure -- from STRING
is_empty: count = 0
same_capacity: capacity = old capacity

execute
-- Execute the sql statement
require
prepared_statement: is_prepared
ensure
executed_statement: is_executed

prepare (s: STRING )
-- Parse of the sql statement s
require
not_void: s /= void
meaning_full_statement: s. count > 0
ensure
prepared_statement: is_prepared
prepared_statement: not is_executed

set_map_name (n: ANY ; key: STRING )
-- Store item n whith key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

terminate

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Output

out : like Current
-- Printable representation
-- (from STRING )

feature -- Status Report

is_allocatable : BOOLEAN

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

feature -- setting

set_executed (b: BOOLEAN )
-- (from PARAMETER_HDL )

set_parameter (value: ANY ; key: STRING )
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
key_not_void: key /= void
has_parameters: parameter_count > 0

set_parameters_value (p: ARRAY [ ANY ])
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
has_parameters: parameter_count > 0

set_prepared (b: BOOLEAN )
-- (from PARAMETER_HDL )

setup_parameters
-- setup parameters_value with actual parameters value
-- (from PARAMETER_HDL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from STRING
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set . count = count
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from COMPARABLE
irreflexive_comparison: not (Current < Current)

end -- class DATABASE_DYN_CHANGE


DATABASE_DYN_SELECTION Chart

 class
DATABASE_DYN_SELECTION [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_DYN_SELECTION "
create: make

Ancestors
DATABASE_SELECTION [G -> DATABASE create default_create end]
PARAMETER_HDL

Queries
infix " @ " (i: INTEGER ): CHARACTER
infix " >= " (other: [like Current] DATABASE_DYN_SELECTION [G]): BOOLEAN
infix " > " (other: [like Current] DATABASE_DYN_SELECTION [G]): BOOLEAN
infix " <= " (other: [like Current] DATABASE_DYN_SELECTION [G]): BOOLEAN
infix " < " (other: [like Current] DATABASE_DYN_SELECTION [G]): BOOLEAN
infix " + " (s: STRING ): STRING
abs (n: INTEGER ): INTEGER
adapt (s: STRING ): [like Current] DATABASE_DYN_SELECTION [G]
additional_space : INTEGER
area : SPECIAL [ CHARACTER ]
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
boolean_format (object: BOOLEAN ): STRING
Boolean_type : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
capacity : INTEGER
Changeable_comparison_criterion : BOOLEAN
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
compiler_version : INTEGER
count : INTEGER
date_format (object: DATE_TIME ): STRING
db_spec : DATABASE
descriptor : INTEGER
descriptor_available : BOOLEAN
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
Extendible : BOOLEAN
False_constant : STRING
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
full : BOOLEAN
fuzzy_index (other: STRING ; start, fuzz: INTEGER ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Growth_percentage : INTEGER
has (c: CHARACTER ): BOOLEAN
hash_code : INTEGER
immediate_execution : BOOLEAN
index_of (c: CHARACTER ; start: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_connected : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DATABASE_DYN_SELECTION [G]): BOOLEAN
is_executed : BOOLEAN
is_hashable : BOOLEAN
is_inserted (v: CHARACTER ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_ok : BOOLEAN
is_prepared : BOOLEAN
is_special (object: ANY ): BOOLEAN
is_tracing : BOOLEAN
item (i: INTEGER ): CHARACTER
item_code (i: INTEGER ): INTEGER
last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
last_parsed_query : STRING
linear_representation : LINEAR [ CHARACTER ]
mapped_value (key: STRING ): ANY
max (other: [like Current] DATABASE_DYN_SELECTION [G]): [like Current] DATABASE_DYN_SELECTION [G]
min (other: [like Current] DATABASE_DYN_SELECTION [G]): [like Current] DATABASE_DYN_SELECTION [G]
Minimal_increase : INTEGER
mirrored : [like Current] DATABASE_DYN_SELECTION [G]
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
object_comparison : BOOLEAN
occurrences (c: CHARACTER ): INTEGER
out : [like Current] DATABASE_DYN_SELECTION [G]
parameter_count : INTEGER
parameter_name_exist (key: STRING ): BOOLEAN
parse (s: STRING ): STRING
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
prunable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
resizable : BOOLEAN
rsign (r: REAL ): INTEGER
shared_with (other: [like Current] DATABASE_DYN_SELECTION [G]): BOOLEAN
sign (n: INTEGER ): INTEGER
split (a_separator: CHARACTER ): LINEAR [ STRING ]
string_format (object: STRING ): STRING
string_is_boolean : BOOLEAN
string_is_double : BOOLEAN
string_is_integer : BOOLEAN
string_is_real : BOOLEAN
substring (n1, n2: INTEGER ): [like Current] DATABASE_DYN_SELECTION [G]
substring_index (other: STRING ; start: INTEGER ): INTEGER
three_way_comparison (other: [like Current] DATABASE_DYN_SELECTION [G]): INTEGER
to_boolean : BOOLEAN
to_c : ANY
to_double : DOUBLE
to_integer : INTEGER
to_real : REAL
trace_output : FILE
True_constant : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
valid_index (i: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
adapt_size
append (s: STRING )
append_boolean (b: BOOLEAN )
append_character (c: CHARACTER )
append_double (d: DOUBLE )
append_integer (i: INTEGER )
append_real (r: REAL )
append_string (s: STRING )
append_substring (s: STRING ; n1, n2: INTEGER )
automatic_grow
bind_parameter
center_justify
character_justify (pivot: CHARACTER ; position: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] DATABASE_DYN_SELECTION [G])
cursor_to_object (object: ANY ; cursor: DB_RESULT )
deep_traversal (object: ANY )
execute
extend (c: CHARACTER )
fill (other: CONTAINER [ CHARACTER ])
fill_blank
fill_character (c: CHARACTER )
format_make
from_c (c_string: POINTER )
from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
get_complex_value (obj: ANY ; str: STRING )
get_value (obj: ANY ; str: STRING )
grow (newsize: INTEGER )
head (n: INTEGER )
insert (s: STRING ; i: INTEGER )
left_adjust
left_justify
make (i: INTEGER )
make_from_c (c_string: POINTER )
make_from_string (s: STRING )
mark (obj: ANY )
mirror
modify (s: STRING )
multiply (n: INTEGER )
next
object_finish_action (object: ANY )
object_init_action (object: ANY )
precede (c: CHARACTER )
prepare (s: STRING )
prepend (s: STRING )
prepend_boolean (b: BOOLEAN )
prepend_character (c: CHARACTER )
prepend_double (d: DOUBLE )
prepend_integer (i: INTEGER )
prepend_real (r: REAL )
prepend_string (s: STRING )
prune (c: CHARACTER )
prune_all (c: CHARACTER )
prune_all_leading (c: CHARACTER )
prune_all_trailing (c: CHARACTER )
put (c: CHARACTER ; i: INTEGER )
query (s: STRING )
reference_object_action (i: INTEGER ; object: ANY )
remake (n: INTEGER )
remove (i: INTEGER )
replace
replace_blank
replace_character (c: CHARACTER )
replace_substring (s: [like Current] DATABASE_DYN_SELECTION [G]; start_pos, end_pos: INTEGER )
replace_substring_all (original, new: [like Current] DATABASE_DYN_SELECTION [G])
reset_cursor
resize (newsize: INTEGER )
right_adjust
right_justify
set (t: [like Current] DATABASE_DYN_SELECTION [G]; n1, n2: INTEGER )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_executed (b: BOOLEAN )
set_ht (table: HASH_TABLE [ ANY , STRING ])
set_immediate
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_map_name (n: ANY ; key: STRING )
set_parameter (value: ANY ; key: STRING )
set_parameters_value (p: ARRAY [ ANY ])
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_prepared (b: BOOLEAN )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
set_trace
setup_parameters
share (other: [like Current] DATABASE_DYN_SELECTION [G])
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
subcopy (other: [like Current] DATABASE_DYN_SELECTION [G]; start_pos, end_pos, index_pos: INTEGER )
switch_mark (obj: ANY )
tail (n: INTEGER )
terminate
to_lower
to_upper
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )
unset_immediate
unset_map_name (key: STRING )
unset_trace
wipe_out


DATABASE_DYN_SELECTION Flat contracts

 indexing
description: "Implementation of DB_DYN_SELECTION "
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_DYN_SELECTION [G -> DATABASE create default_create end]

create

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

feature -- Initialization

adapt (s: STRING ): like Current
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (from STRING )

from_c (c_string: POINTER )
-- Reset contents of string from contents of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
ensure -- from STRING
no_zero_byte: not has ('%U')

from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
-- Reset contents of string from substring of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
start_position_big_enough: start_pos >= 1
end_position_big_enough: start_pos <= end_pos + 1
ensure -- from STRING
valid_count: count = end_pos - start_pos + 1

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

format_make
-- Create an interface object to format data.
-- (from DB_FORMAT )

make_from_c (c_string: POINTER )
-- Initialize from contents of c_string,
-- a string created by some external C function
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer

make_from_string (s: STRING )
-- Initialize from the characters of s.
-- (Useful in proper descendants of class STRING ,
-- to initialize a string-like object from a manifest string.)
-- (from STRING )
require -- from STRING
string_exists: s /= void
ensure -- from STRING
shared_implementation: shared_with (s)

remake (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Access

area : SPECIAL [ CHARACTER ]
-- Special data zone
-- (from TO_SPECIAL )

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

False_constant : STRING is "false"
-- Constant string "false"
-- (from STRING )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

fuzzy_index (other: STRING ; start: INTEGER ; fuzz: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (from STRING )
require -- from STRING
other_exists: other /= void
other_not_empty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
acceptable_fuzzy: fuzz <= other. count

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has (c: CHARACTER ): BOOLEAN
-- Does string include c?
-- (from STRING )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

hash_code : INTEGER
-- Hash code value
-- (from STRING )
ensure -- from HASHABLE
good_hash_value: Result >= 0

index_of (c: CHARACTER ; start: INTEGER ): INTEGER
-- Position of first occurrence of c at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
start_large_enough: start >= 1
start_small_enough: start <= count + 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

item (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of @.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

item_code (i: INTEGER ): INTEGER
-- Numeric code of character at position i
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0

last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
-- Position of last occurence of c.
-- 0 if none
-- (from STRING )
require -- from STRING
start_index_small_enough: start_index_from_end <= count
start_index_large_enough: start_index_from_end >= 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

last_parsed_query : STRING
-- Last parsed query
-- (from DATABASE_SELECTION )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

shared_with (other: like Current): BOOLEAN
-- Does string share the text of other?
-- (from STRING )

substring_index (other: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
other_nonvoid: other /= void
other_notempty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
ensure -- from STRING
correct_place: Result > 0 implies substring (Result, Result + other. count - 1). is_equal (other)

True_constant : STRING is "true"
-- Constant string "true"
-- (from STRING )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

infix " @ " (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of item .
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

capacity : INTEGER
-- Allocated space
-- (from STRING )

count : INTEGER
-- Actual number of characters making up the string
-- (from STRING )

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from STRING )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from STRING
Result. count = count

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

occurrences (c: CHARACTER ): INTEGER
-- Number of times c appears in the string
-- (from STRING )
ensure -- from BAG
non_negative_occurrences: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (from STRING )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from COMPARABLE
trichotomy: Result = ( not (Current < other) and not (other < Current))

max (other: like Current): like Current
-- The greater of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other

min (other: like Current): like Current
-- The smaller of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other

three_way_comparison (other: like Current): INTEGER
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)

infix " < " (other: like Current): BOOLEAN
-- Is string lexicographically lower than other?
-- (from STRING )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
asymmetric: Result implies not (other < Current)

infix " <= " (other: like Current): BOOLEAN
-- Is current object less than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = ((Current < other) or is_equal (other))

infix " > " (other: like Current): BOOLEAN
-- Is current object greater than other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other < Current)

infix " >= " (other: like Current): BOOLEAN
-- Is current object greater than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other <= Current)

feature -- Status report

Changeable_comparison_criterion : BOOLEAN is False
-- (from STRING )

descriptor : INTEGER
-- Cursor descriptor index
-- (from DATABASE_SELECTION )

descriptor_available : BOOLEAN
-- Is a new cursor descriptor available?
-- (from DATABASE_SELECTION )

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from STRING )

full : BOOLEAN
-- Is structure full?
-- (from BOUNDED )

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

string_is_boolean : BOOLEAN
-- Does Current represent a BOOLEAN?
-- (from STRING )

string_is_double : BOOLEAN
-- Does Current represent a DOUBLE?
-- (from STRING )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_executed : BOOLEAN
-- Is the statement has been executed ?
-- (from PARAMETER_HDL )

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

is_inserted (v: CHARACTER ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

string_is_integer : BOOLEAN
-- Does Current represent an INTEGER?
-- (from STRING )

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity ?
-- (from PARAMETER_HDL )
require -- from STRING_HDL
keys_exists: key /= void

is_prepared : BOOLEAN
-- Is the statement has been prepared ?
-- (from PARAMETER_HDL )

string_is_real : BOOLEAN
-- Does Current represent a REAL?
-- (from STRING )

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

parameter_count : INTEGER
-- number of parameters, set by 'prepare'
-- (from PARAMETER_HDL )
ensure -- from PARAMETER_HDL
Result > 0 implies is_prepared

parameter_name_exist (key: STRING ): BOOLEAN
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
not_void: key /= void

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from STRING )

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the string?
-- (from STRING )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status setting

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

cursor_to_object (object: ANY ; cursor: DB_RESULT )
-- Effectively load object attributes with
-- cursor fields.
-- (from DATABASE_SELECTION )
require -- from DATABASE_SELECTION
cursor_exists: cursor /= void
object_exists: object /= void

set_ht (table: HASH_TABLE [ ANY , STRING ])
-- Obtain bind variables table.
-- Set ht with table.
-- (from DATABASE_SELECTION )
require else -- from DATABASE_SELECTION
table_exists: table /= void
ensure then -- from DATABASE_SELECTION
ht = table

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Element change

append (s: STRING )
-- Append a copy of s at end.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + old s. count

append_boolean (b: BOOLEAN )
-- Append the string representation of b at end.
-- (from STRING )

append_character (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of extend .
-- (from STRING )
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

append_double (d: DOUBLE )
-- Append the string representation of d at end.
-- (from STRING )

append_integer (i: INTEGER )
-- Append the string representation of i at end.
-- (from STRING )

append_real (r: REAL )
-- Append the string representation of r at end.
-- (from STRING )

append_string (s: STRING )
-- Append a copy of s, if not void, at end.
-- (from STRING )

copy (other: like Current)
-- Reinitialize by copying the characters of other.
-- (This is also used by clone .)
-- (from STRING )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)
ensure then -- from STRING
new_result_count: count = other. count

extend (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of append_character .
-- (from STRING )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

fill (other: CONTAINER [ CHARACTER ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

fill_blank
-- Fill with capacity blank characters.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

fill_character (c: CHARACTER )
-- Fill with capacity characters all equal to c.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

head (n: INTEGER )
-- Remove all characters except for the first n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

insert (s: STRING ; i: INTEGER )
-- Add s to the left of position i in current string.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count + s. count

left_adjust
-- Remove leading whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item (1) /= ' ') and ( item (1) /= ' ') and ( item (1) /= '%R') and ( item (1) /= ''))

precede (c: CHARACTER )
-- Add c at front.
-- (from STRING )
ensure -- from STRING
new_count: count = old count + 1

prepend (s: STRING )
-- Prepend a copy of s at front.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + s. count

prepend_boolean (b: BOOLEAN )
-- Prepend the string representation of b at front.
-- (from STRING )

prepend_character (c: CHARACTER )
-- Prepend the string representation of c at front.
-- (from STRING )

prepend_double (d: DOUBLE )
-- Prepend the string representation of d at front.
-- (from STRING )

prepend_integer (i: INTEGER )
-- Prepend the string representation of i at front.
-- (from STRING )

prepend_real (r: REAL )
-- Prepend the string representation of r at front.
-- (from STRING )

prepend_string (s: STRING )
-- Prepend a copy of s, if not void, at front.
-- (from STRING )

put (c: CHARACTER ; i: INTEGER )
-- Replace character at position i by c.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: item (k) = v

replace_blank
-- Replace all current characters with blanks.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_character (c: CHARACTER )
-- Replace all current characters with characters all equal to c.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_substring (s: like Current; start_pos, end_pos: INTEGER )
-- Copy the characters of s to positions
-- start_pos .. end_pos.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: end_pos <= count
order_respected: start_pos <= end_pos
index_large_enough: start_pos > 0
ensure -- from STRING
new_count: count = old count + s. count - end_pos + start_pos - 1

replace_substring_all (original, new: like Current)
-- Replace every occurence of original with new.
-- (from STRING )
require -- from STRING
original_exists: original /= void
new_exists: new /= void
original_not_empty: not original. is_empty

right_adjust
-- Remove trailing whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item ( count ) /= ' ') and ( item ( count ) /= ' ') and ( item ( count ) /= '%R') and ( item ( count ) /= ''))

set (t: like Current; n1, n2: INTEGER )
-- Set current string to substring of t from indices n1
-- to n2, or to empty string if no such substring.
-- (from STRING )
require -- from STRING
argument_not_void: t /= void
ensure -- from STRING
is_substring: is_equal (t. substring (n1, n2))

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

share (other: like Current)
-- Make current string share the text of other.
-- Subsequent changes to the characters of current string
-- will also affect other, and conversely.
-- (from STRING )
require -- from STRING
argument_not_void: other /= void
ensure -- from STRING
shared_count: other. count = count

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (from STRING )
require -- from STRING
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( count - index_pos) >= (end_pos - start_pos)

tail (n: INTEGER )
-- Remove all characters except for the last n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

infix " + " (s: STRING ): STRING
-- Append a copy of 's' at the end of a copy of Current,
-- Then return the Result.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
result_exists: Result /= void
new_count: Result. count = count + s. count

feature -- Removal

prune (c: CHARACTER )
-- Remove first occurrence of c, if any.
-- (from STRING )
require -- from COLLECTION
prunable: prunable
require else -- from STRING
True

prune_all (c: CHARACTER )
-- Remove all occurrences of c.
-- (from STRING )
require -- from COLLECTION
prunable
require else -- from STRING
True
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from STRING
changed_count: count = (old count ) - (old occurrences (c))

prune_all_leading (c: CHARACTER )
-- Remove all leading occurrences of c.
-- (from STRING )

prune_all_trailing (c: CHARACTER )
-- Remove all trailing occurrences of c.
-- (from STRING )

remove (i: INTEGER )
-- Remove i-th character.
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count - 1

wipe_out
-- Remove all characters.
-- (from STRING )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from STRING
is_empty: count = 0
empty_capacity: capacity = 0

feature -- Resizing

adapt_size
-- Adapt the size to accommodate count characters.
-- (from STRING )

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (newsize: INTEGER )
-- Ensure that the capacity is at least newsize.
-- (from STRING )
require -- from RESIZABLE
True
require else -- from STRING
new_size_non_negative: newsize >= 0
ensure -- from RESIZABLE
new_capacity: capacity >= i

resize (newsize: INTEGER )
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (from STRING )
require -- from STRING
new_size_non_negative: newsize >= 0

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- Converted string of object according to the database format
-- (from DB_FORMAT )

center_justify
-- Center justify the string using
-- the capacity as the width
-- (from STRING )

character_justify (pivot: CHARACTER ; position: INTEGER )
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (from STRING )
require -- from STRING
valid_position: position <= capacity
positive_position: position >= 1
pivot_not_space: pivot /= ' '
not_empty: not is_empty

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_format (object: DATE_TIME ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

left_justify
-- Left justify the string using
-- the capacity as the width
-- (from STRING )

linear_representation : LINEAR [ CHARACTER ]
-- Representation as a linear structure
-- (from STRING )

mirror
-- Reverse the order of characters.
-- "Hello world" -> "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: count = old count

mirrored : like Current
-- Mirror image of string;
-- result for "Hello world" is "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: Result. count = count

right_justify
-- Right justify the string using
-- the capacity as the width
-- (from STRING )

split (a_separator: CHARACTER ): LINEAR [ STRING ]
-- Split on a_separator.
-- Ignore separators in quotes.
-- (from STRING )
ensure -- from STRING
Result /= void

string_format (object: STRING ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

to_boolean : BOOLEAN
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (from STRING )
require -- from STRING
is_boolean: string_is_boolean

frozen to_c : ANY
-- A reference to a C form of current string.
-- Useful only for interfacing with C software.
-- (from STRING )

to_double : DOUBLE
-- "Double" value;
-- for example, when applied to "123.0", will yield 123.0 (double)
-- (from STRING )
require -- from STRING
represents_a_double: string_is_double

to_integer : INTEGER
-- Integer value;
-- for example, when applied to "123", will yield 123
-- (from STRING )
require -- from STRING
is_integer: string_is_integer

to_lower
-- Convert to lower case.
-- (from STRING )

to_real : REAL
-- Real value;
-- for example, when applied to "123.0", will yield 123.0
-- (from STRING )
require -- from STRING
represents_a_real: string_is_real

to_upper
-- Convert to upper case.
-- (from STRING )

feature -- Duplication

multiply (n: INTEGER )
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (from STRING )
require -- from STRING
meaningful_multiplier: n >= 1

substring (n1, n2: INTEGER ): like Current
-- Copy of substring containing all characters at indices
-- between n1 and n2
-- (from STRING )
ensure -- from STRING
new_result_count: Result. count = n2 - n1 + 1 or Result. count = 0

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

append_substring (s: STRING ; n1, n2: INTEGER )
-- Append substring `s.substring (n1, n2)' to Current.
-- Faster than append s.substring (n1, n2).
-- (from SQL_SCAN )
require -- from SQL_SCAN
string_exists: s /= void
meaningful_origin: 1 <= n1
meaningful_interval: n1 <= n2
meaningful_end: n2 <= s. count

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

get_complex_value (obj: ANY ; str: STRING )
-- Retrieve string value of reference object obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
object_exists: obj /= void
str_exists: str /= void

get_value (obj: ANY ; str: STRING )
-- Retrieve string value of obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
str_exists: str /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

modify (s: STRING )
-- Do nothing.
-- (from DATABASE_SELECTION )

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

next
-- Move to next row matching execute clause.
-- (from DATABASE_SELECTION )
require else -- from DATABASE_SELECTION
connected: is_connected

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

parse (s: STRING ): STRING
-- Parse string s by replacing each pattern ":<name>"
-- with the Eiffel object description whose name
-- also matches "<name>".
-- (from SQL_SCAN )

query (s: STRING )
-- Query database server using SQL statement.
-- (from DATABASE_SELECTION )
require -- from DATABASE_SELECTION
argument_exists: s /= void
connected: is_connected
prepare_execute: not immediate_execution
descriptor_is_available: db_spec . descriptor_is_available

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

replace
-- Replace all occurences of :key by `ht.item (":key")'
-- (from SQL_SCAN )

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

terminate
-- Release cursor descriptor used with last query.
-- (from DATABASE_SELECTION )
require else -- from DATABASE_SELECTION
connected: is_connected
is_ok: is_ok
ensure -- from DATABASE_SELECTION
descriptor_is_available: descriptor_available

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature

bind_parameter
-- Bind of the prarameters of the sql statement
require
prepared_statement: is_prepared

clear_all
-- (from PARAMETER_HDL )
ensure -- from STRING
is_empty: count = 0
same_capacity: capacity = old capacity

execute
-- Execute the sql statement
require
prepared_statement: is_prepared
ensure
executed_statement: is_executed

prepare (s: STRING )
-- Parse of the sql statement s
require
not_void: s /= void
meaning_full_statement: s. count > 0
ensure
prepared_statement: is_prepared
prepared_statement: not is_executed

reset_cursor
require
prepared_statement: is_prepared

set_map_name (n: ANY ; key: STRING )
-- Store item n whith key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Output

out : like Current
-- Printable representation
-- (from STRING )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

feature -- setting

set_executed (b: BOOLEAN )
-- (from PARAMETER_HDL )

set_parameter (value: ANY ; key: STRING )
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
key_not_void: key /= void
has_parameters: parameter_count > 0

set_parameters_value (p: ARRAY [ ANY ])
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
has_parameters: parameter_count > 0

set_prepared (b: BOOLEAN )
-- (from PARAMETER_HDL )

setup_parameters
-- setup parameters_value with actual parameters value
-- (from PARAMETER_HDL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from STRING
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set . count = count
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from COMPARABLE
irreflexive_comparison: not (Current < Current)

end -- class DATABASE_DYN_SELECTION


DATABASE Chart

 deferred class
DATABASE

General
cluster: eiffelstore.dbms.support
description: "Specification of the database. Generic parameter"

Ancestors
ANY

Queries
c_boolean_type : INTEGER
c_character_type : INTEGER
c_date_type : INTEGER
c_float_type : INTEGER
c_integer_type : INTEGER
c_real_type : INTEGER
c_string_type : INTEGER
conv_type (indicator, index: INTEGER ): INTEGER
convert_string_type (r_any: ANY ; field_name, class_name: STRING ): ANY
database_handle_name : STRING
date_to_str (object: DATE_TIME ): STRING
descriptor_is_available : BOOLEAN
dim_rep_diff (repository_dimension, db_field_count: INTEGER ): BOOLEAN
false_representation : STRING
found : BOOLEAN
get_boolean_data (no_descriptor, ind: INTEGER ): BOOLEAN
get_col_len (no_descriptor, ind: INTEGER ): INTEGER
get_col_type (no_descriptor, ind: INTEGER ): INTEGER
get_count (no_descriptor: INTEGER ): INTEGER
get_data_len (no_descriptor, ind: INTEGER ): INTEGER
get_date_data (no_descriptor, ind: INTEGER ): INTEGER
get_day (no_descriptor, ind: INTEGER ): INTEGER
get_error_code : INTEGER
get_error_message : POINTER
get_float_data (no_descriptor, ind: INTEGER ): DOUBLE
get_hour (no_descriptor, ind: INTEGER ): INTEGER
get_integer_data (no_descriptor, ind: INTEGER ): INTEGER
get_min (no_descriptor, ind: INTEGER ): INTEGER
get_month (no_descriptor, ind: INTEGER ): INTEGER
get_real_data (no_descriptor, ind: INTEGER ): REAL
get_sec (no_descriptor, ind: INTEGER ): INTEGER
get_warn_message : POINTER
get_year (no_descriptor, ind: INTEGER ): INTEGER
has_row_number : BOOLEAN
hide_qualifier (c_temp: STRING ): POINTER
identifier_quoter : STRING
is_error_updated : BOOLEAN
is_null_data (no_descriptor, ind: INTEGER ): BOOLEAN
map_var_after : STRING
map_var_before : STRING
map_var_between : STRING
map_var_between_2 : STRING
max_char_size : INTEGER
name_proc_lower : BOOLEAN
new_descriptor : INTEGER
normal_parse : BOOLEAN
parse (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; uhandle: HANDLE ; sql: STRING ): BOOLEAN
password_ensure (name, passwd, uname, upasswd: STRING ): BOOLEAN
password_ok (upasswd: STRING ): BOOLEAN
proc_args : BOOLEAN
put_col_name (no_descriptor, index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
put_column_name (repository: DATABASE_REPOSITORY [[like Current] DATABASE ]; map_table: ARRAY [ INTEGER ]): STRING
put_data (no_descriptor, index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
qualifier_seperator : STRING
results_order (no_descriptor: INTEGER ): INTEGER
select_exists (name: STRING ): STRING
select_text : STRING
selection_string (rep_qualifier, rep_owner, repository_name: STRING ): STRING
sensitive_mixed : BOOLEAN
sql_adapt_db (sql: STRING ): STRING
sql_after_exec : STRING
sql_as : STRING
sql_creation : STRING
sql_end : STRING
sql_execution : STRING
sql_name_boolean : STRING
sql_name_character : STRING
sql_name_datetime : STRING
sql_name_double : STRING
sql_name_integer : STRING
sql_name_real : STRING
sql_name_string : STRING
sql_string : STRING
sql_string2 (int: INTEGER ): STRING
string_format (object: STRING ): STRING
support_drop_proc : BOOLEAN
support_proc : INTEGER
support_sql_of_proc : BOOLEAN
support_stored_proc : BOOLEAN
text_not_supported : STRING
trancount : INTEGER
true_representation : STRING
user_name_ok (uname: STRING ): BOOLEAN

Commands
begin
bind_parameter (value, parameters: ARRAY [ ANY ]; descriptor: INTEGER ; sql: STRING )
clear_error
close_cursor (no_descriptor: INTEGER )
commit
connect (user_name, user_passwd, data_source, application, hostname, roleid, rolepasswd, groupid: STRING )
database_make (i: INTEGER )
disconnect
drop_proc_not_supported
exec_immediate (no_descriptor: INTEGER ; command: STRING )
exec_proc_not_supported
init_order (no_descriptor: INTEGER ; command: STRING )
next_row (no_descriptor: INTEGER )
pre_immediate (descriptor, i: INTEGER )
result_order (descriptor: INTEGER )
rollback
start_order (no_descriptor: INTEGER )
store_proc_not_supported
terminate_order (no_descriptor: INTEGER )
unset_catalog_flag (desc: INTEGER )
update_map_table_error (db_handle: HANDLE ; map_table: ARRAY [ INTEGER ]; ind: INTEGER )


DATABASE Flat contracts

 indexing
description: "Specification of the database. Generic parameter"
date: "$Date: 2001/06/14 00:28:17 $"
revision: "$Revision: 1.1 $"

deferred class interface
DATABASE

feature

database_handle_name : STRING
-- Database handle name.

feature -- DATABASE_BOOLEAN

sql_name_boolean : STRING
-- SQL type name for boolean

feature -- DATABASE_CHARACTER

sql_name_character : STRING
-- SQL type name for character

feature -- DATABASE_DATETIME

sql_name_datetime : STRING
-- SQL type name for datetime

feature -- DATABASE_DOUBLE

sql_name_double : STRING
-- SQL type name for double

feature -- DATABASE_INTEGER

sql_name_integer : STRING
-- SQL type name for integer

feature -- DATABASE_REAL

sql_name_real : STRING
-- SQL type name for real

feature -- DATABASE_STRING

sql_name_string : STRING
-- SQL type name of string

feature -- External features

begin
-- Begin a data base transaction

c_boolean_type : INTEGER
-- Boolean Eiffel type

c_character_type : INTEGER
-- Character Eiffel type

c_date_type : INTEGER
-- Datetime Eiffel type

c_float_type : INTEGER
-- Float Eiffel type

c_integer_type : INTEGER
-- Integer Eiffel type

c_real_type : INTEGER
-- Real Eiffel type

c_string_type : INTEGER
-- String Eiffel type

close_cursor (no_descriptor: INTEGER )
-- A SQL has been performed in DYNAMIC EXECUTION mode,
-- Then if the DYNAMICALLY EXECUTED SQL statement is a SELECT
-- statement, then the cursor is closed.
-- Then one can do an other selection on the previous cursor.

commit
-- Commit the current transaction

connect (user_name, user_passwd, data_source, application, hostname, roleid, rolepasswd, groupid: STRING )
-- Connect to an ODBC database

conv_type (indicator: INTEGER ; index: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

database_make (i: INTEGER )
-- Initialize database c-module

disconnect
-- Disconnect the current connection with an database

exec_immediate (no_descriptor: INTEGER ; command: STRING )
-- In IMMEDIATE EXECUTE mode perform the SQL statement,
-- and then check if there is warning message for the execution,

get_boolean_data (no_descriptor: INTEGER ; ind: INTEGER ): BOOLEAN
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_col_len (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_col_type (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_count (no_descriptor: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_data_len (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_date_data (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_day (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_error_code : INTEGER
-- Function related with the error processing

get_error_message : POINTER
-- Function related with the error processing

get_float_data (no_descriptor: INTEGER ; ind: INTEGER ): DOUBLE
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_hour (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_integer_data (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_min (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_month (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_real_data (no_descriptor: INTEGER ; ind: INTEGER ): REAL
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_sec (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

get_warn_message : POINTER
-- Function related with the error processing

get_year (no_descriptor: INTEGER ; ind: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

identifier_quoter : STRING
-- Return the string used to quote identifiers in SQL command,
-- for example, if the quoter is `, and we want to select on
-- table "my table", we should express the query as:
-- select * from `My table`
-- Only for ODBC

init_order (no_descriptor: INTEGER ; command: STRING )
-- In DYNAMICALLY EXECUTE mode perform the SQL statement
-- But this routine only get things ready for dynamic execution:
-- 1. get the SQL statement PREPAREd; and check if there are
-- warning message for the SQL statement;
-- 2. DESCRIBE the SQL statement and get enough information to
-- allocate enough memory space for the corresponding descriptor.

is_null_data (no_descriptor: INTEGER ; ind: INTEGER ): BOOLEAN
-- Is last retrieved data null?

new_descriptor : INTEGER
-- A descriptor is used to store a row fetched by FETCH command
-- Whenever perform a SELECT statement, allocate a new descriptor
-- by int_new_descriptor(), the descriptor is freed
-- when the SELECT statement terminates.

next_row (no_descriptor: INTEGER )
-- A SELECT statement is now being executed in DYNAMIC EXECUTION mode,
-- the routine is to FETCH a new tuple from database
-- and if a new tuple is fetched, return 1 otherwise return 0.

put_col_name (no_descriptor: INTEGER ; index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

put_data (no_descriptor: INTEGER ; index: INTEGER ; ar: SPECIAL [ CHARACTER ]; max_len: INTEGER ): INTEGER
-- Function used to get data from structure SQLDA filled by FETCH clause.

qualifier_seperator : STRING
-- When "qualifier" and "owner" are used to identifier
-- a database object, they should be seperated by a string called
-- "qualifier seperator"
-- Only for ODBC

rollback
-- Commit the current transaction

sensitive_mixed : BOOLEAN
-- Is the database sensitive to lower or
-- upper case?
-- Only for ODBC , Ingres

start_order (no_descriptor: INTEGER )
-- Finish execution of a SQL statement in DYNAMICLLY EXECUTION mode: */
-- 1. if the PREPAREd SQL statement is a NON_SELECT statement,
-- just EXECUTE it; otherwise, DEFINE a CURSOR for it and
-- OPEN the CURSOR . In the process, if error occurs, do some
-- clearence;

terminate_order (no_descriptor: INTEGER )
-- A SQL has been performed in DYNAMIC EXECUTION mode,
-- so the routine is to do some clearence:
-- 1. if the DYNAMICLLY EXECUTED SQL statement is a NON_SELECT
-- statement, just free the memory for ODBCSQLDA and clear
-- the cell in 'descriptor' to NULL; otherwise, CLOSE the CURSOR
-- and then do the same clearence.
-- 2. return error number.

trancount : INTEGER
-- Return the number of transactions now active

feature -- For DATABASE_CHANGE

descriptor_is_available : BOOLEAN
-- Is a new descritor available?

hide_qualifier (c_temp: STRING ): POINTER
-- When "qualifier" is used to identify an database object,
-- we have to hide ":" in the qualifier first, otherwise, it
-- will be misinterpreted by feature SQL_SCAN::parse
-- Only for ODBC

pre_immediate (descriptor, i: INTEGER )
-- In IMMEDIATE EXECUTE mode, if the performed SQL statement is
-- a call to a stored procedure, allocate some area used by the
-- stored procedure
-- Only for ODBC

results_order (no_descriptor: INTEGER ): INTEGER
-- Fetch all the rows resulting from the sql query
-- Default value zero
-- Only for Sybase

feature -- For DATABASE_DYN_STORE

unset_catalog_flag (desc: INTEGER )
-- Default value zero
-- Only for ODBC .

feature -- For DATABASE_FORMAT

date_to_str (object: DATE_TIME ): STRING
-- String representation in SQL of object
-- For ODBC , ORACLE

false_representation : STRING
-- Database representation of the boolean False

string_format (object: STRING ): STRING
-- String representation in SQL of object

true_representation : STRING
-- Database representation of the boolean True

feature -- For DATABASE_PROC

drop_proc_not_supported
-- Display the text saying that the database
-- does not support stored procedure dropping
-- Redefined for ODBC

exec_proc_not_supported
-- Display the text saying that the database
-- does not support stored procedure executing
-- Redefined for ODBC

has_row_number : BOOLEAN
-- May the database store the text of a stored procedure in more than one
-- row?
-- Default value False
-- Redefined for Ingres

map_var_after : STRING
-- Redefined for Sybase

map_var_before : STRING
-- Redefined for Sybase

map_var_between : STRING
-- @ symbol for ODBC and Sybase

map_var_between_2 : STRING
-- Equal type
-- Only for Ingres

name_proc_lower : BOOLEAN
-- Has the name of the stored procedure to be in lower case?

proc_args : BOOLEAN
-- True if the execution of the stored procedure is
-- "execute procedure_name (argument1='sireude')"
-- False if "execute procedure_name ('sireude')"
-- Default value False
-- True for Sybase

select_exists (name: STRING ): STRING
-- SQL query to test stored procedure existing

select_text : STRING
-- SQL query to get stored procedure text

sql_adapt_db (sql: STRING ): STRING
-- Adapt the SQL string for the database
-- Only for Sybase and ODBC

sql_after_exec : STRING
-- End of the stored procedure execution string.

sql_as : STRING
-- Creating a stored procedure "as"...

sql_creation : STRING
-- Begining of the stored procedure creation string.

sql_end : STRING
-- End of the stored procedure creation string.

sql_execution : STRING
-- Begining of the stored procedure execution string.

store_proc_not_supported
-- Display the text saying that the database
-- does not support stored procedure creating
-- Redefined for ODBC

support_drop_proc : BOOLEAN
-- Does the database support stored procedure dropping from server?

support_proc : INTEGER
-- Does the database support stored procedure?
-- 1 if True, 0 if False
-- Redefined for ODBC

support_sql_of_proc : BOOLEAN
-- Does the database support SQL attachment to the stored procedure?

support_stored_proc : BOOLEAN
-- Does the database support creating a stored procedure?

text_not_supported : STRING
-- Display the text saying that the database
-- does not support stored procedure text retrieving
-- Redefined for ODBC

feature -- For DATABASE_REPOSITORY

max_char_size : INTEGER
-- Limit size before being a text
-- Except for ODBC

selection_string (rep_qualifier, rep_owner, repository_name: STRING ): STRING
-- String to select the table needed

sql_string : STRING
-- Database type of a string
-- with a size less than Max_char_size

sql_string2 (int: INTEGER ): STRING
-- Database type of a string
-- with a size more than Max_char_size

feature -- For DATABASE_SELECTION , DATABASE_CHANGE

bind_parameter (value: ARRAY [ ANY ]; parameters: ARRAY [ ANY ]; descriptor: INTEGER ; sql: STRING )
-- Bind the parameters from the parameters array with
-- the values from the value array. It has been implemented
-- for the use of dynamic sql
-- Only for ODBC and Oracle, it has to be done for Sybase and Ingres

normal_parse : BOOLEAN
-- Should the SQL string be normal parsed,
-- using SQL_SCAN?

parse (descriptor: INTEGER ; uht: HASH_TABLE [ ANY , STRING ]; uhandle: HANDLE ; sql: STRING ): BOOLEAN
-- Prepare string sql by appending map
-- variables name from to sql. Map variables are used
-- for set input arguments
-- For ODBC

result_order (descriptor: INTEGER )
-- Fetch one row resulting from the sql query
-- Default value zero
-- For Sybase

feature -- For DATABASE_STATUS

clear_error
-- Reset database error status.

found : BOOLEAN
-- Is there any record matching the last
-- selection condition used ?

is_error_updated : BOOLEAN
-- Has a database function been called since last update which may have
-- updated error code, error message or warning message?

feature -- For DATABASE_STORE

dim_rep_diff (repository_dimension, db_field_count: INTEGER ): BOOLEAN
-- Is the dimension of the repository different to the field count of the object to insert?
-- If yes, make a default map_table
-- Default value False
-- Only for Sybase

put_column_name (repository: DATABASE_REPOSITORY [like Current]; map_table: ARRAY [ INTEGER ]): STRING
-- Add the columns names to sql_string in the feature put
-- Redefined for ODBC

update_map_table_error (db_handle: HANDLE ; map_table: ARRAY [ INTEGER ]; ind: INTEGER )
-- Set error number as 200
-- Except for ODBC and for Oracle

feature -- For database types

convert_string_type (r_any: ANY ; field_name, class_name: STRING ): ANY
-- Convert r_any to the expected object.
-- By default returns r_any, redefined in ORACLE to return
-- an INTEGER_REF when field_name is "data_type".
require
r_any_not_void: r_any /= void
field_name_not_void: field_name /= void
class_name_not_void: class_name /= void
ensure
valid_result: Result /= void

feature -- LOGIN and DATABASE_APPL only for password_ok

password_ensure (name, passwd, uname, upasswd: STRING ): BOOLEAN
-- Is name equal to uname and passwd equal to upasswd?

password_ok (upasswd: STRING ): BOOLEAN
-- Can the user password be Void?

user_name_ok (uname: STRING ): BOOLEAN
-- Can the user name be Void?
-- Yes only for ODBC

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE


DATABASE_FORMAT Chart

 class
DATABASE_FORMAT [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_FORMAT "

Ancestors
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
boolean_format (object: BOOLEAN ): STRING
date_format (object: DATE_TIME ): STRING
db_spec : DATABASE
string_format (object: STRING ): STRING


DATABASE_FORMAT Flat contracts

 indexing
description: "Implementation of DB_FORMAT "
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_FORMAT [G -> DATABASE create default_create end]

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- String representation in SQL of object

date_format (object: DATE_TIME ): STRING
-- String representation in SQL of object
ensure then
Result = date_buffer

string_format (object: STRING ): STRING
-- String representation in SQL of object

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_FORMAT


DATABASE_INTEGER Chart

 class
DATABASE_INTEGER [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Integer format of the database"

Ancestors
DB_TYPE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
Eiffel_name : STRING
Eiffel_ref : INTEGER_REF
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DATABASE_INTEGER Flat contracts

 indexing
description: "Integer format of the database"
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_INTEGER [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
-- (from DB_TYPE )
require -- from DB_TYPE
object_not_void: object /= void
ensure -- from DB_TYPE
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure -- from DB_TYPE
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name for integer
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure then
Result. is_equal ("INTEGER")

eiffel_ref : INTEGER_REF
-- Shared integer reference
ensure -- from DB_TYPE
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name for integer
ensure -- from DB_TYPE
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_INTEGER


DATABASE_MANAGER Chart

 class
DATABASE_MANAGER [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Object that enable basic database management."

Ancestors
ANY

Queries
database_handle_created : BOOLEAN
database_handle_name : STRING
Db_change : DB_CHANGE
Db_selection : DB_SELECTION
error_message : STRING
has_error : BOOLEAN
is_connected : BOOLEAN
load_data_with_select (s: STRING ): ANY
load_list_with_select (s: STRING ; an_obj: ANY ): ARRAYED_LIST [[like an_obj] ANY ]
session_control : DB_CONTROL
string_format (s: STRING ): STRING

Commands
commit
disconnect
establish_connection
execute_query (a_query: STRING )
execute_query_without_commit (a_query: STRING )
insert_with_repository (an_obj: ANY ; rep: DB_REPOSITORY )
set_connection_information (user_name, password, data_source: STRING )


DATABASE_MANAGER Flat contracts

 indexing
description: "Object that enable basic database management."
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_MANAGER [G -> DATABASE create default_create end]

feature -- Access

database_handle_name : STRING
-- Database handle name
ensure
not_void: Result /= void

db_change : DB_CHANGE
-- Performs a change in the database (i.e. a command).

db_selection : DB_SELECTION
-- Performs a selection in the database (i.e. a query).

session_control : DB_CONTROL
-- Session control.

string_format (s: STRING ): STRING
-- String representation in SQL of s.

feature -- Status report

database_handle_created : BOOLEAN
-- Has the database handle been created?

error_message : STRING
-- Error message if an error occured during last
-- database operation.

has_error : BOOLEAN
-- Has an error occured during last database operation?

is_connected : BOOLEAN
-- Is the application connected to a database?

feature -- Connection

disconnect
-- Disconnect from database.
require
is_connected: is_connected

establish_connection
-- Establish connection.
require
information_set: database_handle_created
not_connected: not is_connected

set_connection_information (user_name, password, data_source: STRING )
-- Set information required to connect to the database.
require
not_void: user_name /= void and password /= void and data_source /= void

feature -- Queries

load_data_with_select (s: STRING ): ANY
-- Load directly a single data from the database.
require
meaningful_select: s /= void

load_list_with_select (s: STRING ; an_obj: ANY ): ARRAYED_LIST [like an_obj]
-- Load list of objects whose type are the same as an_obj,
-- following the SQL query s.
require
not_void: an_obj /= void
meaningful_select: s /= void
ensure
result_not_void: Result /= void

feature -- Queries without result to load.

commit
-- Commit updates in the database.

execute_query (a_query: STRING )
-- Execute a_query and commit changes.
require
not_void: a_query /= void

execute_query_without_commit (a_query: STRING )
-- Execute a_query in the database.
-- Warning: query executed is not committed.
require
not_void: a_query /= void

insert_with_repository (an_obj: ANY ; rep: DB_REPOSITORY )
-- Store in the database object an_obj with db_repository.
require
repository_loaded: rep. loaded

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_MANAGER


DATABASE_PROC Chart

 class
DATABASE_PROC [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_PROC "
create: make

Ancestors
HANDLE_SPEC [G -> DATABASE create default_create end]
HANDLE_USE

Queries
arguments_name : ARRAY [ STRING ]
arguments_set : BOOLEAN
arguments_type : ARRAY [ ANY ]
db_spec : DATABASE
exists : BOOLEAN
text : STRING

Commands
change_name (new_name: STRING )
drop
execute (destination: DB_EXPRESSION )
execute_string (destination: DB_EXPRESSION ; sql: STRING )
load
make
set_arguments (args_name: [like arguments_name ] ARRAY [ STRING ]; args_type: [like arguments_type ] ARRAY [ ANY ])
set_no_arguments
store (sql: STRING )


DATABASE_PROC Flat contracts

 indexing
description: "Implementation of DB_PROC "
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_PROC [G -> DATABASE create default_create end]

create

make
-- If the database has row numbers
-- initialize row_number

feature -- Initialization

make
-- If the database has row numbers
-- initialize row_number

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

arguments_name : ARRAY [ STRING ]
-- Argument names of stored procedure

arguments_set : BOOLEAN
-- Have arguments been set?
ensure
arguments_set: Result implies ( arguments_name /= void and arguments_type /= void )

arguments_type : ARRAY [ ANY ]
-- Argument types of stored procedure

exists : BOOLEAN
-- Does current procedure exist in server?

text : STRING
-- SQL statement attached to stored procedure

feature -- Element change

change_name (new_name: STRING )
-- Change procedure name with new_name.
ensure then
name_changed: name = new_name

set_arguments (args_name: like arguments_name ; args_type: like arguments_type )
-- Set arguments_name and arguments_type
-- of current as a variable list of argument
-- names and a variable list of argument
-- types, respectively.
require
args_name_not_void: args_name /= void
args_type_not_void: args_type /= void
not_arguments_set: not arguments_set
ensure
arguments_set
set_with_input_parameter1: arguments_name = args_name
set_with_input_parameter2: arguments_type = args_type

set_no_arguments
-- No arguments for the current procedure.
ensure
arguments_type_void: arguments_type = void
arguments_name_void: arguments_name = void
no_arguments: not arguments_set

feature -- Basic operations

drop
-- Drop current procedure from server.

execute (destination: DB_EXPRESSION )
-- Execute current procedure with destination
-- as a DB_SELECTION or a DB_CHANGE object mapping
-- entity values with procedure parameter names
-- if any.
require else
argument_not_void: destination /= void

execute_string (destination: DB_EXPRESSION ; sql: STRING )
-- Execute the procedure using the sql statement sql

load
-- Make result of stored procedure execution available.
-- Activate current stored procedure from server
-- so that presence may be accurately tested using exists .

store (sql: STRING )
-- Store current procedure performing sql statement.
require else
argument_not_void: sql /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_PROC


DATABASE_REAL Chart

 class
DATABASE_REAL [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Real format of the database"

Ancestors
DB_TYPE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
Eiffel_name : STRING
Eiffel_ref : REAL_REF
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DATABASE_REAL Flat contracts

 indexing
description: "Real format of the database"
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_REAL [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
-- (from DB_TYPE )
require -- from DB_TYPE
object_not_void: object /= void
ensure -- from DB_TYPE
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure -- from DB_TYPE
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name for real
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure then
Result. is_equal ("REAL")

eiffel_ref : REAL_REF
-- Shared real reference
ensure -- from DB_TYPE
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name for real
ensure -- from DB_TYPE
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_REAL


DATABASE_REPOSITORY Chart

 class
DATABASE_REPOSITORY [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_REPOSITORY "
create: make

Ancestors
ACTION
BASIC_ROUTINES
DB_STATUS_USE
EXCEPTIONS
EXT_INTERNAL
TYPES [G -> DATABASE create default_create end]

Queries
abs (n: INTEGER ): INTEGER
assertion_violation : BOOLEAN
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
Boolean_type_database : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
Character_type_database : INTEGER
charconv (i: INTEGER ): CHARACTER
Check_instruction : INTEGER
Class_invariant : INTEGER
class_name (object: ANY ): STRING
column_i_th (i: INTEGER ): COLUMNS [ DATABASE ]
column_name (i: INTEGER ): STRING
column_number : INTEGER
Com_exception : INTEGER
compiler_version : INTEGER
conforms (object: ANY ): BOOLEAN
Date_type_database : INTEGER
db_spec : DATABASE
Developer_exception : INTEGER
developer_exception_name : STRING
dimension : INTEGER
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
exception : INTEGER
exception_trace : STRING
exceptions_class_name : STRING
exists : BOOLEAN
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
External_exception : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
Float_type_database : INTEGER
Floating_point_exception : INTEGER
found : BOOLEAN
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Incorrect_inspect_value : INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
Integer_type_database : INTEGER
Io_exception : INTEGER
is_developer_exception : BOOLEAN
is_developer_exception_of_name (name: STRING ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_signal : BOOLEAN
is_special (object: ANY ): BOOLEAN
is_system_exception : BOOLEAN
Loop_invariant : INTEGER
Loop_variant : INTEGER
meaning (except: INTEGER ): STRING
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
No_more_memory : INTEGER
Operating_system_exception : INTEGER
original_class_name : STRING
original_exception : INTEGER
original_recipient_name : STRING
original_tag_name : STRING
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
Postcondition : INTEGER
Precondition : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Real_type_database : INTEGER
recipient_name : STRING
Reference_type : INTEGER
rep_owner : STRING
rep_qualifier : STRING
repository_name : STRING
Rescue_exception : INTEGER
Retrieve_exception : INTEGER
Routine_failure : INTEGER
rsign (r: REAL ): INTEGER
Runtime_io_exception : INTEGER
sign (n: INTEGER ): INTEGER
Signal_exception : INTEGER
String_type_database : INTEGER
tag_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
Void_assigned_to_expanded : INTEGER
Void_call_target : INTEGER
Wide_character_type : INTEGER

Commands
allocate (object: ANY ; table_name: STRING )
catch (code: INTEGER )
change_name (new_name: STRING )
deep_traversal (object: ANY )
die (code: INTEGER )
execute
generate_class (f: FILE )
ignore (code: INTEGER )
load
make
mark (obj: ANY )
message_on_failure
no_message_on_failure
object_finish_action (object: ANY )
object_init_action (object: ANY )
raise (name: STRING )
reference_object_action (i: INTEGER ; object: ANY )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
simple_object_action (type, i: INTEGER ; object: ANY )
start
store_action (object: ANY )
switch_mark (obj: ANY )
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )


DATABASE_REPOSITORY Flat contracts

 indexing
description: "Implementation of DB_REPOSITORY "
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_REPOSITORY [G -> DATABASE create default_create end]

create

make
-- Create attributes

feature -- Initialization

load
-- Load in description of repository repository_name .
require else
repository_name_exists: repository_name /= void

make
-- Create attributes

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

Check_instruction : INTEGER is 7
-- Exception code for violated check
-- (from EXCEP_CONST )

Class_invariant : INTEGER is 6
-- Exception code for violated class invariant
-- (from EXCEP_CONST )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

Com_exception : INTEGER is 28
-- Exception code for a COM error.
-- (from EXCEP_CONST )

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

Developer_exception : INTEGER is 24
-- Exception code for developer exception
-- (from EXCEP_CONST )

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

External_exception : INTEGER is 18
-- Exception code for operating system error
-- which does not set the errno variable
-- (Unix-specific)
-- (from EXCEP_CONST )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

Floating_point_exception : INTEGER is 5
-- Exception code for floating point exception
-- (from EXCEP_CONST )

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Incorrect_inspect_value : INTEGER is 9
-- Exception code for inspect value which is not one
-- of the inspect constants, if there is no Else_part
-- (from EXCEP_CONST )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

Io_exception : INTEGER is 21
-- Exception code for I/O error
-- (from EXCEP_CONST )

Loop_invariant : INTEGER is 11
-- Exception code for violated loop invariant
-- (from EXCEP_CONST )

Loop_variant : INTEGER is 10
-- Exception code for non-decreased loop variant
-- (from EXCEP_CONST )

No_more_memory : INTEGER is 2
-- Exception code for failed memory allocation
-- (from EXCEP_CONST )

Operating_system_exception : INTEGER is 22
-- Exception code for operating system error
-- which sets the errno variable
-- (Unix-specific)
-- (from EXCEP_CONST )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

Postcondition : INTEGER is 4
-- Exception code for violated postcondition
-- (from EXCEP_CONST )

Precondition : INTEGER is 3
-- Exception code for violated precondition
-- (from EXCEP_CONST )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Rescue_exception : INTEGER is 14
-- Exception code for exception in rescue clause
-- (from EXCEP_CONST )

Retrieve_exception : INTEGER is 23
-- Exception code for retrieval error
-- may be raised by retrieved in IO_MEDIUM .
-- (from EXCEP_CONST )

Routine_failure : INTEGER is 8
-- Exception code for failed routine
-- (from EXCEP_CONST )

Runtime_io_exception : INTEGER is 27
-- Exception code for I/O error raised by runtime functions
-- such as store/retrieve, file access...
-- (from EXCEP_CONST )

Signal_exception : INTEGER is 12
-- Exception code for operating system signal
-- (from EXCEP_CONST )

Void_assigned_to_expanded : INTEGER is 19
-- Exception code for assignment of void value
-- to expanded entity
-- (from EXCEP_CONST )

Void_call_target : INTEGER is 1
-- Exception code for feature applied to void reference
-- (from EXCEP_CONST )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Status report

assertion_violation : BOOLEAN
-- Is last exception originally due to a violated
-- assertion or non-decreasing variant?
-- (from EXCEPTIONS )

exceptions_class_name : STRING
-- Name of the class that includes the recipient
-- of original form of last exception
-- (from EXCEPTIONS )

column_i_th (i: INTEGER ): COLUMNS [ DATABASE ]
-- Column corresponding to indice 'i'.
require
indice_valid: i >= 1 and i <= column_number
ensure
Result /= void

column_name (i: INTEGER ): STRING
-- Name of i-th column of table-like repository.
require else
repository_exists: exists
good_position: 0 < i and i <= dimension

column_number : INTEGER
-- Column Number.
ensure
Result >= 0

conforms (object: ANY ): BOOLEAN
-- Is the structure of repository_name the same
-- as the structure of object.
require else
object_exists: object /= void

developer_exception_name : STRING
-- Name of last developer-raised exception
-- (from EXCEPTIONS )
require -- from EXCEPTIONS
applicable: is_developer_exception

dimension : INTEGER
-- Table column count.
require else
repository_exists: exists

exception : INTEGER
-- Code of last exception that occurred
-- (from EXCEPTIONS )

exception_trace : STRING
-- String representation of the exception trace
-- (from EXCEPTIONS )

exists : BOOLEAN
-- Does current repository exist in database schema?

is_developer_exception : BOOLEAN
-- Is the last exception originally due to
-- a developer exception?
-- (from EXCEPTIONS )

is_developer_exception_of_name (name: STRING ): BOOLEAN
-- Is the last exception originally due to a developer
-- exception of name name?
-- (from EXCEPTIONS )

is_signal : BOOLEAN
-- Is last exception originally due to an external
-- event (operating system signal)?
-- (from EXCEPTIONS )

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

is_system_exception : BOOLEAN
-- Is last exception originally due to an
-- external event (operating system error)?
-- (from EXCEPTIONS )

meaning (except: INTEGER ): STRING
-- A message in English describing what except is
-- (from EXCEPTIONS )

original_class_name : STRING
-- Name of the class that includes the recipient
-- of original form of last exception
-- (from EXCEPTIONS )

original_exception : INTEGER
-- Original code of last exception that triggered
-- current exception
-- (from EXCEPTIONS )

original_recipient_name : STRING
-- Name of the routine whose execution was
-- interrupted by original form of last exception
-- (from EXCEPTIONS )

original_tag_name : STRING
-- Assertion tag for original form of last
-- assertion violation.
-- (from EXCEPTIONS )

recipient_name : STRING
-- Name of the routine whose execution was
-- interrupted by last exception
-- (from EXCEPTIONS )

rep_owner : STRING
-- Owner of the table.

rep_qualifier : STRING
-- Qualifier of the Repository.

repository_name : STRING
-- Repository name corresponding to table name in DB schema.

tag_name : STRING
-- Tag of last violated assertion clause
-- (from EXCEPTIONS )

feature -- Status setting

allocate (object: ANY ; table_name: STRING )
-- Create a schema table repository_name conforming
-- to object basic attributes.
require else
table_not_void: table_name /= void
object_not_void: object /= void

catch (code: INTEGER )
-- Make sure that any exception of code code will be
-- caught. This is the default.
-- (from EXCEPTIONS )

change_name (new_name: STRING )
-- Set repository name with repository_name .
require else
new_name_not_void: new_name /= void
ensure then
not exists

die (code: INTEGER )
-- Terminate execution with exit status code,
-- without triggering an exception.
-- (from EXCEPTIONS )

ignore (code: INTEGER )
-- Make sure that any exception of code code will be
-- ignored. This is not the default.
-- (from EXCEPTIONS )

message_on_failure
-- Print an exception history table
-- in case of failure.
-- This is the default.
-- (from EXCEPTIONS )

no_message_on_failure
-- Do not print an exception history table
-- in case of failure.
-- (from EXCEPTIONS )

raise (name: STRING )
-- Raise a developer exception of name name.
-- (from EXCEPTIONS )

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conversion

boolean_type_database : INTEGER
-- Boolean type code in Ingres
-- (from TYPES )

character_type_database : INTEGER
-- Character type code in Ingres
-- (from TYPES )

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_type_database : INTEGER
-- Datetime type code in Ingres
-- (from TYPES )

float_type_database : INTEGER
-- Double type code in Ingres
-- (from TYPES )

integer_type_database : INTEGER
-- Integer type code in Ingres
-- (from TYPES )

real_type_database : INTEGER
-- Real type code in Ingres
-- (from TYPES )

string_type_database : INTEGER
-- String type code in Ingres
-- (from TYPES )

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

execute
-- Implement an ACTION operation

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

found : BOOLEAN
-- Is there any exit condition found
-- while iterating on selection results in
-- load_result of DB_SELECTION?
-- (Default: do nothing)
-- (from ACTION )

generate_class (f: FILE )
-- Generate Eiffel class template according to data
-- representation given by repository_name .
require
file_exists: f /= void and then f. exists

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

start
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)
-- (from ACTION )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_REPOSITORY


DATABASE_SELECTION Chart

 class
DATABASE_SELECTION [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_SELECTION "
create: make

Ancestors
DB_EXEC_USE
DB_STATUS_USE
HANDLE_SPEC [G -> DATABASE create default_create end]
SQL_SCAN

Queries
infix " @ " (i: INTEGER ): CHARACTER
infix " >= " (other: [like Current] DATABASE_SELECTION [G]): BOOLEAN
infix " > " (other: [like Current] DATABASE_SELECTION [G]): BOOLEAN
infix " <= " (other: [like Current] DATABASE_SELECTION [G]): BOOLEAN
infix " < " (other: [like Current] DATABASE_SELECTION [G]): BOOLEAN
infix " + " (s: STRING ): STRING
abs (n: INTEGER ): INTEGER
adapt (s: STRING ): [like Current] DATABASE_SELECTION [G]
additional_space : INTEGER
area : SPECIAL [ CHARACTER ]
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
boolean_format (object: BOOLEAN ): STRING
Boolean_type : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
capacity : INTEGER
Changeable_comparison_criterion : BOOLEAN
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
compiler_version : INTEGER
count : INTEGER
date_format (object: DATE_TIME ): STRING
db_spec : DATABASE
descriptor : INTEGER
descriptor_available : BOOLEAN
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
Extendible : BOOLEAN
False_constant : STRING
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
full : BOOLEAN
fuzzy_index (other: STRING ; start, fuzz: INTEGER ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Growth_percentage : INTEGER
has (c: CHARACTER ): BOOLEAN
hash_code : INTEGER
immediate_execution : BOOLEAN
index_of (c: CHARACTER ; start: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_connected : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DATABASE_SELECTION [G]): BOOLEAN
is_hashable : BOOLEAN
is_inserted (v: CHARACTER ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_ok : BOOLEAN
is_special (object: ANY ): BOOLEAN
is_tracing : BOOLEAN
item (i: INTEGER ): CHARACTER
item_code (i: INTEGER ): INTEGER
last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
last_parsed_query : STRING
linear_representation : LINEAR [ CHARACTER ]
mapped_value (key: STRING ): ANY
max (other: [like Current] DATABASE_SELECTION [G]): [like Current] DATABASE_SELECTION [G]
min (other: [like Current] DATABASE_SELECTION [G]): [like Current] DATABASE_SELECTION [G]
Minimal_increase : INTEGER
mirrored : [like Current] DATABASE_SELECTION [G]
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
object_comparison : BOOLEAN
occurrences (c: CHARACTER ): INTEGER
out : [like Current] DATABASE_SELECTION [G]
parse (s: STRING ): STRING
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
prunable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
resizable : BOOLEAN
rsign (r: REAL ): INTEGER
shared_with (other: [like Current] DATABASE_SELECTION [G]): BOOLEAN
sign (n: INTEGER ): INTEGER
split (a_separator: CHARACTER ): LINEAR [ STRING ]
string_format (object: STRING ): STRING
string_is_boolean : BOOLEAN
string_is_double : BOOLEAN
string_is_integer : BOOLEAN
string_is_real : BOOLEAN
substring (n1, n2: INTEGER ): [like Current] DATABASE_SELECTION [G]
substring_index (other: STRING ; start: INTEGER ): INTEGER
three_way_comparison (other: [like Current] DATABASE_SELECTION [G]): INTEGER
to_boolean : BOOLEAN
to_c : ANY
to_double : DOUBLE
to_integer : INTEGER
to_real : REAL
trace_output : FILE
True_constant : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
valid_index (i: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
adapt_size
append (s: STRING )
append_boolean (b: BOOLEAN )
append_character (c: CHARACTER )
append_double (d: DOUBLE )
append_integer (i: INTEGER )
append_real (r: REAL )
append_string (s: STRING )
append_substring (s: STRING ; n1, n2: INTEGER )
automatic_grow
center_justify
character_justify (pivot: CHARACTER ; position: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] DATABASE_SELECTION [G])
cursor_to_object (object: ANY ; cursor: DB_RESULT )
deep_traversal (object: ANY )
extend (c: CHARACTER )
fill (other: CONTAINER [ CHARACTER ])
fill_blank
fill_character (c: CHARACTER )
format_make
from_c (c_string: POINTER )
from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
get_complex_value (obj: ANY ; str: STRING )
get_value (obj: ANY ; str: STRING )
grow (newsize: INTEGER )
head (n: INTEGER )
insert (s: STRING ; i: INTEGER )
left_adjust
left_justify
make (i: INTEGER )
make_from_c (c_string: POINTER )
make_from_string (s: STRING )
mark (obj: ANY )
mirror
modify (s: STRING )
multiply (n: INTEGER )
next
object_finish_action (object: ANY )
object_init_action (object: ANY )
precede (c: CHARACTER )
prepend (s: STRING )
prepend_boolean (b: BOOLEAN )
prepend_character (c: CHARACTER )
prepend_double (d: DOUBLE )
prepend_integer (i: INTEGER )
prepend_real (r: REAL )
prepend_string (s: STRING )
prune (c: CHARACTER )
prune_all (c: CHARACTER )
prune_all_leading (c: CHARACTER )
prune_all_trailing (c: CHARACTER )
put (c: CHARACTER ; i: INTEGER )
query (s: STRING )
reference_object_action (i: INTEGER ; object: ANY )
remake (n: INTEGER )
remove (i: INTEGER )
replace
replace_blank
replace_character (c: CHARACTER )
replace_substring (s: [like Current] DATABASE_SELECTION [G]; start_pos, end_pos: INTEGER )
replace_substring_all (original, new: [like Current] DATABASE_SELECTION [G])
resize (newsize: INTEGER )
right_adjust
right_justify
set (t: [like Current] DATABASE_SELECTION [G]; n1, n2: INTEGER )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_ht (table: HASH_TABLE [ ANY , STRING ])
set_immediate
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_map_name (n: ANY ; key: STRING )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
set_trace
share (other: [like Current] DATABASE_SELECTION [G])
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
subcopy (other: [like Current] DATABASE_SELECTION [G]; start_pos, end_pos, index_pos: INTEGER )
switch_mark (obj: ANY )
tail (n: INTEGER )
terminate
to_lower
to_upper
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )
unset_immediate
unset_map_name (key: STRING )
unset_trace
wipe_out


DATABASE_SELECTION Flat contracts

 indexing
description: "Implementation of DB_SELECTION "
date: "$Date: 2001/06/14 00:28:18 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_SELECTION [G -> DATABASE create default_create end]

create

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

feature -- Initialization

adapt (s: STRING ): like Current
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (from STRING )

from_c (c_string: POINTER )
-- Reset contents of string from contents of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
ensure -- from STRING
no_zero_byte: not has ('%U')

from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
-- Reset contents of string from substring of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
start_position_big_enough: start_pos >= 1
end_position_big_enough: start_pos <= end_pos + 1
ensure -- from STRING
valid_count: count = end_pos - start_pos + 1

make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

format_make
-- Create an interface object to format data.
-- (from DB_FORMAT )

make_from_c (c_string: POINTER )
-- Initialize from contents of c_string,
-- a string created by some external C function
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer

make_from_string (s: STRING )
-- Initialize from the characters of s.
-- (Useful in proper descendants of class STRING ,
-- to initialize a string-like object from a manifest string.)
-- (from STRING )
require -- from STRING
string_exists: s /= void
ensure -- from STRING
shared_implementation: shared_with (s)

remake (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Access

area : SPECIAL [ CHARACTER ]
-- Special data zone
-- (from TO_SPECIAL )

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

False_constant : STRING is "false"
-- Constant string "false"
-- (from STRING )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

fuzzy_index (other: STRING ; start: INTEGER ; fuzz: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (from STRING )
require -- from STRING
other_exists: other /= void
other_not_empty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
acceptable_fuzzy: fuzz <= other. count

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has (c: CHARACTER ): BOOLEAN
-- Does string include c?
-- (from STRING )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

hash_code : INTEGER
-- Hash code value
-- (from STRING )
ensure -- from HASHABLE
good_hash_value: Result >= 0

index_of (c: CHARACTER ; start: INTEGER ): INTEGER
-- Position of first occurrence of c at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
start_large_enough: start >= 1
start_small_enough: start <= count + 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

item (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of @.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

item_code (i: INTEGER ): INTEGER
-- Numeric code of character at position i
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0

last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
-- Position of last occurence of c.
-- 0 if none
-- (from STRING )
require -- from STRING
start_index_small_enough: start_index_from_end <= count
start_index_large_enough: start_index_from_end >= 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

last_parsed_query : STRING
-- Last parsed query

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

shared_with (other: like Current): BOOLEAN
-- Does string share the text of other?
-- (from STRING )

substring_index (other: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
other_nonvoid: other /= void
other_notempty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
ensure -- from STRING
correct_place: Result > 0 implies substring (Result, Result + other. count - 1). is_equal (other)

True_constant : STRING is "true"
-- Constant string "true"
-- (from STRING )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

infix " @ " (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of item .
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

capacity : INTEGER
-- Allocated space
-- (from STRING )

count : INTEGER
-- Actual number of characters making up the string
-- (from STRING )

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from STRING )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from STRING
Result. count = count

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

occurrences (c: CHARACTER ): INTEGER
-- Number of times c appears in the string
-- (from STRING )
ensure -- from BAG
non_negative_occurrences: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (from STRING )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from COMPARABLE
trichotomy: Result = ( not (Current < other) and not (other < Current))

max (other: like Current): like Current
-- The greater of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other

min (other: like Current): like Current
-- The smaller of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other

three_way_comparison (other: like Current): INTEGER
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)

infix " < " (other: like Current): BOOLEAN
-- Is string lexicographically lower than other?
-- (from STRING )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
asymmetric: Result implies not (other < Current)

infix " <= " (other: like Current): BOOLEAN
-- Is current object less than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = ((Current < other) or is_equal (other))

infix " > " (other: like Current): BOOLEAN
-- Is current object greater than other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other < Current)

infix " >= " (other: like Current): BOOLEAN
-- Is current object greater than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other <= Current)

feature -- Status report

Changeable_comparison_criterion : BOOLEAN is False
-- (from STRING )

descriptor : INTEGER
-- Cursor descriptor index

descriptor_available : BOOLEAN
-- Is a new cursor descriptor available?

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from STRING )

full : BOOLEAN
-- Is structure full?
-- (from BOUNDED )

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

string_is_boolean : BOOLEAN
-- Does Current represent a BOOLEAN?
-- (from STRING )

string_is_double : BOOLEAN
-- Does Current represent a DOUBLE?
-- (from STRING )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

is_inserted (v: CHARACTER ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

string_is_integer : BOOLEAN
-- Does Current represent an INTEGER?
-- (from STRING )

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
-- (from STRING_HDL )
require -- from STRING_HDL
keys_exists: key /= void

string_is_real : BOOLEAN
-- Does Current represent a REAL?
-- (from STRING )

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from STRING )

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the string?
-- (from STRING )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status setting

clear_all
-- Remove all mapped keys.
-- (from STRING_HDL )
ensure -- from STRING
is_empty: count = 0
same_capacity: capacity = old capacity

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

cursor_to_object (object: ANY ; cursor: DB_RESULT )
-- Effectively load object attributes with
-- cursor fields.
require
cursor_exists: cursor /= void
object_exists: object /= void

set_ht (table: HASH_TABLE [ ANY , STRING ])
-- Obtain bind variables table.
-- Set ht with table.
require else
table_exists: table /= void
ensure then
ht = table

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Element change

append (s: STRING )
-- Append a copy of s at end.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + old s. count

append_boolean (b: BOOLEAN )
-- Append the string representation of b at end.
-- (from STRING )

append_character (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of extend .
-- (from STRING )
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

append_double (d: DOUBLE )
-- Append the string representation of d at end.
-- (from STRING )

append_integer (i: INTEGER )
-- Append the string representation of i at end.
-- (from STRING )

append_real (r: REAL )
-- Append the string representation of r at end.
-- (from STRING )

append_string (s: STRING )
-- Append a copy of s, if not void, at end.
-- (from STRING )

copy (other: like Current)
-- Reinitialize by copying the characters of other.
-- (This is also used by clone .)
-- (from STRING )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)
ensure then -- from STRING
new_result_count: count = other. count

extend (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of append_character .
-- (from STRING )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

fill (other: CONTAINER [ CHARACTER ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

fill_blank
-- Fill with capacity blank characters.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

fill_character (c: CHARACTER )
-- Fill with capacity characters all equal to c.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

head (n: INTEGER )
-- Remove all characters except for the first n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

insert (s: STRING ; i: INTEGER )
-- Add s to the left of position i in current string.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count + s. count

left_adjust
-- Remove leading whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item (1) /= ' ') and ( item (1) /= ' ') and ( item (1) /= '%R') and ( item (1) /= ''))

precede (c: CHARACTER )
-- Add c at front.
-- (from STRING )
ensure -- from STRING
new_count: count = old count + 1

prepend (s: STRING )
-- Prepend a copy of s at front.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + s. count

prepend_boolean (b: BOOLEAN )
-- Prepend the string representation of b at front.
-- (from STRING )

prepend_character (c: CHARACTER )
-- Prepend the string representation of c at front.
-- (from STRING )

prepend_double (d: DOUBLE )
-- Prepend the string representation of d at front.
-- (from STRING )

prepend_integer (i: INTEGER )
-- Prepend the string representation of i at front.
-- (from STRING )

prepend_real (r: REAL )
-- Prepend the string representation of r at front.
-- (from STRING )

prepend_string (s: STRING )
-- Prepend a copy of s, if not void, at front.
-- (from STRING )

put (c: CHARACTER ; i: INTEGER )
-- Replace character at position i by c.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: item (k) = v

replace_blank
-- Replace all current characters with blanks.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_character (c: CHARACTER )
-- Replace all current characters with characters all equal to c.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_substring (s: like Current; start_pos, end_pos: INTEGER )
-- Copy the characters of s to positions
-- start_pos .. end_pos.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: end_pos <= count
order_respected: start_pos <= end_pos
index_large_enough: start_pos > 0
ensure -- from STRING
new_count: count = old count + s. count - end_pos + start_pos - 1

replace_substring_all (original, new: like Current)
-- Replace every occurence of original with new.
-- (from STRING )
require -- from STRING
original_exists: original /= void
new_exists: new /= void
original_not_empty: not original. is_empty

right_adjust
-- Remove trailing whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item ( count ) /= ' ') and ( item ( count ) /= ' ') and ( item ( count ) /= '%R') and ( item ( count ) /= ''))

set (t: like Current; n1, n2: INTEGER )
-- Set current string to substring of t from indices n1
-- to n2, or to empty string if no such substring.
-- (from STRING )
require -- from STRING
argument_not_void: t /= void
ensure -- from STRING
is_substring: is_equal (t. substring (n1, n2))

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

share (other: like Current)
-- Make current string share the text of other.
-- Subsequent changes to the characters of current string
-- will also affect other, and conversely.
-- (from STRING )
require -- from STRING
argument_not_void: other /= void
ensure -- from STRING
shared_count: other. count = count

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (from STRING )
require -- from STRING
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( count - index_pos) >= (end_pos - start_pos)

tail (n: INTEGER )
-- Remove all characters except for the last n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

infix " + " (s: STRING ): STRING
-- Append a copy of 's' at the end of a copy of Current,
-- Then return the Result.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
result_exists: Result /= void
new_count: Result. count = count + s. count

feature -- Removal

prune (c: CHARACTER )
-- Remove first occurrence of c, if any.
-- (from STRING )
require -- from COLLECTION
prunable: prunable
require else -- from STRING
True

prune_all (c: CHARACTER )
-- Remove all occurrences of c.
-- (from STRING )
require -- from COLLECTION
prunable
require else -- from STRING
True
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from STRING
changed_count: count = (old count ) - (old occurrences (c))

prune_all_leading (c: CHARACTER )
-- Remove all leading occurrences of c.
-- (from STRING )

prune_all_trailing (c: CHARACTER )
-- Remove all trailing occurrences of c.
-- (from STRING )

remove (i: INTEGER )
-- Remove i-th character.
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count - 1

wipe_out
-- Remove all characters.
-- (from STRING )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from STRING
is_empty: count = 0
empty_capacity: capacity = 0

feature -- Resizing

adapt_size
-- Adapt the size to accommodate count characters.
-- (from STRING )

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (newsize: INTEGER )
-- Ensure that the capacity is at least newsize.
-- (from STRING )
require -- from RESIZABLE
True
require else -- from STRING
new_size_non_negative: newsize >= 0
ensure -- from RESIZABLE
new_capacity: capacity >= i

resize (newsize: INTEGER )
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (from STRING )
require -- from STRING
new_size_non_negative: newsize >= 0

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- Converted string of object according to the database format
-- (from DB_FORMAT )

center_justify
-- Center justify the string using
-- the capacity as the width
-- (from STRING )

character_justify (pivot: CHARACTER ; position: INTEGER )
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (from STRING )
require -- from STRING
valid_position: position <= capacity
positive_position: position >= 1
pivot_not_space: pivot /= ' '
not_empty: not is_empty

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_format (object: DATE_TIME ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

left_justify
-- Left justify the string using
-- the capacity as the width
-- (from STRING )

linear_representation : LINEAR [ CHARACTER ]
-- Representation as a linear structure
-- (from STRING )

mirror
-- Reverse the order of characters.
-- "Hello world" -> "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: count = old count

mirrored : like Current
-- Mirror image of string;
-- result for "Hello world" is "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: Result. count = count

right_justify
-- Right justify the string using
-- the capacity as the width
-- (from STRING )

split (a_separator: CHARACTER ): LINEAR [ STRING ]
-- Split on a_separator.
-- Ignore separators in quotes.
-- (from STRING )
ensure -- from STRING
Result /= void

string_format (object: STRING ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

to_boolean : BOOLEAN
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (from STRING )
require -- from STRING
is_boolean: string_is_boolean

frozen to_c : ANY
-- A reference to a C form of current string.
-- Useful only for interfacing with C software.
-- (from STRING )

to_double : DOUBLE
-- "Double" value;
-- for example, when applied to "123.0", will yield 123.0 (double)
-- (from STRING )
require -- from STRING
represents_a_double: string_is_double

to_integer : INTEGER
-- Integer value;
-- for example, when applied to "123", will yield 123
-- (from STRING )
require -- from STRING
is_integer: string_is_integer

to_lower
-- Convert to lower case.
-- (from STRING )

to_real : REAL
-- Real value;
-- for example, when applied to "123.0", will yield 123.0
-- (from STRING )
require -- from STRING
represents_a_real: string_is_real

to_upper
-- Convert to upper case.
-- (from STRING )

feature -- Duplication

multiply (n: INTEGER )
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (from STRING )
require -- from STRING
meaningful_multiplier: n >= 1

substring (n1, n2: INTEGER ): like Current
-- Copy of substring containing all characters at indices
-- between n1 and n2
-- (from STRING )
ensure -- from STRING
new_result_count: Result. count = n2 - n1 + 1 or Result. count = 0

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

append_substring (s: STRING ; n1, n2: INTEGER )
-- Append substring `s.substring (n1, n2)' to Current.
-- Faster than append s.substring (n1, n2).
-- (from SQL_SCAN )
require -- from SQL_SCAN
string_exists: s /= void
meaningful_origin: 1 <= n1
meaningful_interval: n1 <= n2
meaningful_end: n2 <= s. count

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

get_complex_value (obj: ANY ; str: STRING )
-- Retrieve string value of reference object obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
object_exists: obj /= void
str_exists: str /= void

get_value (obj: ANY ; str: STRING )
-- Retrieve string value of obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
str_exists: str /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

modify (s: STRING )
-- Do nothing.

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

next
-- Move to next row matching execute clause.
require else
connected: is_connected

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

parse (s: STRING ): STRING
-- Parse string s by replacing each pattern ":<name>"
-- with the Eiffel object description whose name
-- also matches "<name>".
-- (from SQL_SCAN )

query (s: STRING )
-- Query database server using SQL statement.
require
argument_exists: s /= void
connected: is_connected
prepare_execute: not immediate_execution
descriptor_is_available: db_spec . descriptor_is_available

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

replace
-- Replace all occurences of :key by `ht.item (":key")'
-- (from SQL_SCAN )

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

terminate
-- Release cursor descriptor used with last query.
require else
connected: is_connected
is_ok: is_ok
ensure
descriptor_is_available: descriptor_available

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Output

out : like Current
-- Printable representation
-- (from STRING )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from STRING
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set . count = count
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from COMPARABLE
irreflexive_comparison: not (Current < Current)

end -- class DATABASE_SELECTION


DATABASE_STATUS Chart

 class
DATABASE_STATUS [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_STATUS "

Ancestors
DB_STATUS_USE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
db_spec : DATABASE
error_code : INTEGER
error_message : STRING
found : BOOLEAN
is_error_updated : BOOLEAN
warning_message : STRING

Commands
reset


DATABASE_STATUS Flat contracts

 indexing
description: "Implementation of DB_STATUS "
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_STATUS [G -> DATABASE create default_create end]

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

error_code : INTEGER
-- Error code from database server

error_message : STRING
-- Error message from database server

found : BOOLEAN
-- Is there any record matching the last
-- selection condition used ?

is_error_updated : BOOLEAN
-- Has an Oracle/ODBC function been called since last update which may have
-- updated error code, error message or warning message?

reset
--Reset database error status.
ensure -- from DB_STATUS_USE
is_ok: is_ok
no_error: error_code = 0
no_message_error: error_message . is_equal ("")
no_message_warning: warning_message . is_equal ("")

warning_message : STRING
-- Warning message from database server

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_STATUS


DATABASE_STORE Chart

 class
DATABASE_STORE [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_STORE "
create: make

Ancestors
DB_EXEC_USE
DB_STATUS_USE
HANDLE_SPEC [G -> DATABASE create default_create end]
SQL_SCAN

Queries
infix " @ " (i: INTEGER ): CHARACTER
infix " >= " (other: [like Current] DATABASE_STORE [G]): BOOLEAN
infix " > " (other: [like Current] DATABASE_STORE [G]): BOOLEAN
infix " <= " (other: [like Current] DATABASE_STORE [G]): BOOLEAN
infix " < " (other: [like Current] DATABASE_STORE [G]): BOOLEAN
infix " + " (s: STRING ): STRING
abs (n: INTEGER ): INTEGER
adapt (s: STRING ): [like Current] DATABASE_STORE [G]
additional_space : INTEGER
area : SPECIAL [ CHARACTER ]
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
boolean_format (object: BOOLEAN ): STRING
Boolean_type : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
capacity : INTEGER
Changeable_comparison_criterion : BOOLEAN
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
compiler_version : INTEGER
count : INTEGER
date_format (object: DATE_TIME ): STRING
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
Extendible : BOOLEAN
False_constant : STRING
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
full : BOOLEAN
fuzzy_index (other: STRING ; start, fuzz: INTEGER ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Growth_percentage : INTEGER
has (c: CHARACTER ): BOOLEAN
hash_code : INTEGER
immediate_execution : BOOLEAN
index_of (c: CHARACTER ; start: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_empty : BOOLEAN
is_equal (other: [like Current] DATABASE_STORE [G]): BOOLEAN
is_hashable : BOOLEAN
is_inserted (v: CHARACTER ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_special (object: ANY ): BOOLEAN
is_tracing : BOOLEAN
item (i: INTEGER ): CHARACTER
item_code (i: INTEGER ): INTEGER
last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
linear_representation : LINEAR [ CHARACTER ]
mapped_value (key: STRING ): ANY
max (other: [like Current] DATABASE_STORE [G]): [like Current] DATABASE_STORE [G]
min (other: [like Current] DATABASE_STORE [G]): [like Current] DATABASE_STORE [G]
Minimal_increase : INTEGER
mirrored : [like Current] DATABASE_STORE [G]
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
object_comparison : BOOLEAN
occurrences (c: CHARACTER ): INTEGER
out : [like Current] DATABASE_STORE [G]
owns_repository : BOOLEAN
parse (s: STRING ): STRING
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
prunable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
repository : DATABASE_REPOSITORY [G]
resizable : BOOLEAN
rsign (r: REAL ): INTEGER
shared_with (other: [like Current] DATABASE_STORE [G]): BOOLEAN
sign (n: INTEGER ): INTEGER
split (a_separator: CHARACTER ): LINEAR [ STRING ]
string_format (object: STRING ): STRING
string_is_boolean : BOOLEAN
string_is_double : BOOLEAN
string_is_integer : BOOLEAN
string_is_real : BOOLEAN
substring (n1, n2: INTEGER ): [like Current] DATABASE_STORE [G]
substring_index (other: STRING ; start: INTEGER ): INTEGER
three_way_comparison (other: [like Current] DATABASE_STORE [G]): INTEGER
to_boolean : BOOLEAN
to_c : ANY
to_double : DOUBLE
to_integer : INTEGER
to_real : REAL
trace_output : FILE
True_constant : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
valid_index (i: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
adapt_size
append (s: STRING )
append_boolean (b: BOOLEAN )
append_character (c: CHARACTER )
append_double (d: DOUBLE )
append_integer (i: INTEGER )
append_real (r: REAL )
append_string (s: STRING )
append_substring (s: STRING ; n1, n2: INTEGER )
automatic_grow
center_justify
character_justify (pivot: CHARACTER ; position: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] DATABASE_STORE [G])
deep_traversal (object: ANY )
extend (c: CHARACTER )
fill (other: CONTAINER [ CHARACTER ])
fill_blank
fill_character (c: CHARACTER )
force (obj: ANY )
format_make
from_c (c_string: POINTER )
from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
get_complex_value (obj: ANY ; str: STRING )
get_value (obj: ANY ; str: STRING )
grow (newsize: INTEGER )
head (n: INTEGER )
insert (s: STRING ; i: INTEGER )
left_adjust
left_justify
make (size: INTEGER )
make_from_c (c_string: POINTER )
make_from_string (s: STRING )
mark (obj: ANY )
mirror
multiply (n: INTEGER )
object_finish_action (object: ANY )
object_init_action (object: ANY )
precede (c: CHARACTER )
prepend (s: STRING )
prepend_boolean (b: BOOLEAN )
prepend_character (c: CHARACTER )
prepend_double (d: DOUBLE )
prepend_integer (i: INTEGER )
prepend_real (r: REAL )
prepend_string (s: STRING )
prune (c: CHARACTER )
prune_all (c: CHARACTER )
prune_all_leading (c: CHARACTER )
prune_all_trailing (c: CHARACTER )
put (object: ANY )
reference_object_action (i: INTEGER ; object: ANY )
remake (n: INTEGER )
remove (i: INTEGER )
replace
replace_blank
replace_character (c: CHARACTER )
replace_substring (s: [like Current] DATABASE_STORE [G]; start_pos, end_pos: INTEGER )
replace_substring_all (original, new: [like Current] DATABASE_STORE [G])
resize (newsize: INTEGER )
right_adjust
right_justify
scan_make (i: INTEGER )
set (t: [like Current] DATABASE_STORE [G]; n1, n2: INTEGER )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_immediate
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_map_name (n: ANY ; key: STRING )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
set_repository (one_repository: DATABASE_REPOSITORY [G])
set_trace
share (other: [like Current] DATABASE_STORE [G])
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
string_put (c: CHARACTER ; i: INTEGER )
subcopy (other: [like Current] DATABASE_STORE [G]; start_pos, end_pos, index_pos: INTEGER )
switch_mark (obj: ANY )
tail (n: INTEGER )
to_lower
to_upper
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )
unset_immediate
unset_map_name (key: STRING )
unset_trace
wipe_out


DATABASE_STORE Flat contracts

 indexing
description: "Implementation of DB_STORE "
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_STORE [G -> DATABASE create default_create end]

create

make (size: INTEGER )

feature -- Initialization

adapt (s: STRING ): like Current
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (from STRING )

from_c (c_string: POINTER )
-- Reset contents of string from contents of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
ensure -- from STRING
no_zero_byte: not has ('%U')

from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
-- Reset contents of string from substring of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
start_position_big_enough: start_pos >= 1
end_position_big_enough: start_pos <= end_pos + 1
ensure -- from STRING
valid_count: count = end_pos - start_pos + 1

make (size: INTEGER )

scan_make (i: INTEGER )
-- Create format and allocate string.
-- (from SQL_SCAN )

format_make
-- Create an interface object to format data.
-- (from DB_FORMAT )

make_from_c (c_string: POINTER )
-- Initialize from contents of c_string,
-- a string created by some external C function
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer

make_from_string (s: STRING )
-- Initialize from the characters of s.
-- (Useful in proper descendants of class STRING ,
-- to initialize a string-like object from a manifest string.)
-- (from STRING )
require -- from STRING
string_exists: s /= void
ensure -- from STRING
shared_implementation: shared_with (s)

remake (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Access

area : SPECIAL [ CHARACTER ]
-- Special data zone
-- (from TO_SPECIAL )

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

False_constant : STRING is "false"
-- Constant string "false"
-- (from STRING )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

fuzzy_index (other: STRING ; start: INTEGER ; fuzz: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (from STRING )
require -- from STRING
other_exists: other /= void
other_not_empty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
acceptable_fuzzy: fuzz <= other. count

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has (c: CHARACTER ): BOOLEAN
-- Does string include c?
-- (from STRING )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

hash_code : INTEGER
-- Hash code value
-- (from STRING )
ensure -- from HASHABLE
good_hash_value: Result >= 0

index_of (c: CHARACTER ; start: INTEGER ): INTEGER
-- Position of first occurrence of c at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
start_large_enough: start >= 1
start_small_enough: start <= count + 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

item (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of @.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

item_code (i: INTEGER ): INTEGER
-- Numeric code of character at position i
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0

last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
-- Position of last occurence of c.
-- 0 if none
-- (from STRING )
require -- from STRING
start_index_small_enough: start_index_from_end <= count
start_index_large_enough: start_index_from_end >= 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

shared_with (other: like Current): BOOLEAN
-- Does string share the text of other?
-- (from STRING )

substring_index (other: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
other_nonvoid: other /= void
other_notempty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
ensure -- from STRING
correct_place: Result > 0 implies substring (Result, Result + other. count - 1). is_equal (other)

True_constant : STRING is "true"
-- Constant string "true"
-- (from STRING )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

infix " @ " (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of item .
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

capacity : INTEGER
-- Allocated space
-- (from STRING )

count : INTEGER
-- Actual number of characters making up the string
-- (from STRING )

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from STRING )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from STRING
Result. count = count

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

occurrences (c: CHARACTER ): INTEGER
-- Number of times c appears in the string
-- (from STRING )
ensure -- from BAG
non_negative_occurrences: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (from STRING )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from COMPARABLE
trichotomy: Result = ( not (Current < other) and not (other < Current))

max (other: like Current): like Current
-- The greater of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other

min (other: like Current): like Current
-- The smaller of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other

three_way_comparison (other: like Current): INTEGER
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)

infix " < " (other: like Current): BOOLEAN
-- Is string lexicographically lower than other?
-- (from STRING )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
asymmetric: Result implies not (other < Current)

infix " <= " (other: like Current): BOOLEAN
-- Is current object less than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = ((Current < other) or is_equal (other))

infix " > " (other: like Current): BOOLEAN
-- Is current object greater than other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other < Current)

infix " >= " (other: like Current): BOOLEAN
-- Is current object greater than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other <= Current)

feature -- Status report

Changeable_comparison_criterion : BOOLEAN is False
-- (from STRING )

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from STRING )

full : BOOLEAN
-- Is structure full?
-- (from BOUNDED )

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

string_is_boolean : BOOLEAN
-- Does Current represent a BOOLEAN?
-- (from STRING )

string_is_double : BOOLEAN
-- Does Current represent a DOUBLE?
-- (from STRING )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

is_inserted (v: CHARACTER ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

string_is_integer : BOOLEAN
-- Does Current represent an INTEGER?
-- (from STRING )

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
-- (from STRING_HDL )
require -- from STRING_HDL
keys_exists: key /= void

string_is_real : BOOLEAN
-- Does Current represent a REAL?
-- (from STRING )

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

owns_repository : BOOLEAN
-- Is the current store operation associated
-- with a repository?
ensure
existence_condition: Result = ( repository /= void )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from STRING )

repository : DATABASE_REPOSITORY [G]
-- Associated repository

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the string?
-- (from STRING )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

feature -- Status setting

clear_all
-- Remove all mapped keys.
-- (from STRING_HDL )
ensure -- from STRING
is_empty: count = 0
same_capacity: capacity = old capacity

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

set_repository (one_repository: DATABASE_REPOSITORY [G])
-- Associate one_repository handle to current
-- db_store handle.
require
parameter_not_void: one_repository /= void
ensure then
repository_not_void: repository /= void

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Element change

append (s: STRING )
-- Append a copy of s at end.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + old s. count

append_boolean (b: BOOLEAN )
-- Append the string representation of b at end.
-- (from STRING )

append_character (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of extend .
-- (from STRING )
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

append_double (d: DOUBLE )
-- Append the string representation of d at end.
-- (from STRING )

append_integer (i: INTEGER )
-- Append the string representation of i at end.
-- (from STRING )

append_real (r: REAL )
-- Append the string representation of r at end.
-- (from STRING )

append_string (s: STRING )
-- Append a copy of s, if not void, at end.
-- (from STRING )

copy (other: like Current)
-- Reinitialize by copying the characters of other.
-- (This is also used by clone .)
-- (from STRING )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)
ensure then -- from STRING
new_result_count: count = other. count

extend (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of append_character .
-- (from STRING )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

fill (other: CONTAINER [ CHARACTER ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

fill_blank
-- Fill with capacity blank characters.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

fill_character (c: CHARACTER )
-- Fill with capacity characters all equal to c.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

head (n: INTEGER )
-- Remove all characters except for the first n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

insert (s: STRING ; i: INTEGER )
-- Add s to the left of position i in current string.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count + s. count

left_adjust
-- Remove leading whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item (1) /= ' ') and ( item (1) /= ' ') and ( item (1) /= '%R') and ( item (1) /= ''))

precede (c: CHARACTER )
-- Add c at front.
-- (from STRING )
ensure -- from STRING
new_count: count = old count + 1

prepend (s: STRING )
-- Prepend a copy of s at front.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + s. count

prepend_boolean (b: BOOLEAN )
-- Prepend the string representation of b at front.
-- (from STRING )

prepend_character (c: CHARACTER )
-- Prepend the string representation of c at front.
-- (from STRING )

prepend_double (d: DOUBLE )
-- Prepend the string representation of d at front.
-- (from STRING )

prepend_integer (i: INTEGER )
-- Prepend the string representation of i at front.
-- (from STRING )

prepend_real (r: REAL )
-- Prepend the string representation of r at front.
-- (from STRING )

prepend_string (s: STRING )
-- Prepend a copy of s, if not void, at front.
-- (from STRING )

string_put (c: CHARACTER ; i: INTEGER )
-- Replace character at position i by c.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: item (k) = v

replace_blank
-- Replace all current characters with blanks.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_character (c: CHARACTER )
-- Replace all current characters with characters all equal to c.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_substring (s: like Current; start_pos, end_pos: INTEGER )
-- Copy the characters of s to positions
-- start_pos .. end_pos.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: end_pos <= count
order_respected: start_pos <= end_pos
index_large_enough: start_pos > 0
ensure -- from STRING
new_count: count = old count + s. count - end_pos + start_pos - 1

replace_substring_all (original, new: like Current)
-- Replace every occurence of original with new.
-- (from STRING )
require -- from STRING
original_exists: original /= void
new_exists: new /= void
original_not_empty: not original. is_empty

right_adjust
-- Remove trailing whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item ( count ) /= ' ') and ( item ( count ) /= ' ') and ( item ( count ) /= '%R') and ( item ( count ) /= ''))

set (t: like Current; n1, n2: INTEGER )
-- Set current string to substring of t from indices n1
-- to n2, or to empty string if no such substring.
-- (from STRING )
require -- from STRING
argument_not_void: t /= void
ensure -- from STRING
is_substring: is_equal (t. substring (n1, n2))

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

share (other: like Current)
-- Make current string share the text of other.
-- Subsequent changes to the characters of current string
-- will also affect other, and conversely.
-- (from STRING )
require -- from STRING
argument_not_void: other /= void
ensure -- from STRING
shared_count: other. count = count

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (from STRING )
require -- from STRING
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( count - index_pos) >= (end_pos - start_pos)

tail (n: INTEGER )
-- Remove all characters except for the last n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

infix " + " (s: STRING ): STRING
-- Append a copy of 's' at the end of a copy of Current,
-- Then return the Result.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
result_exists: Result /= void
new_count: Result. count = count + s. count

feature -- Removal

prune (c: CHARACTER )
-- Remove first occurrence of c, if any.
-- (from STRING )
require -- from COLLECTION
prunable: prunable
require else -- from STRING
True

prune_all (c: CHARACTER )
-- Remove all occurrences of c.
-- (from STRING )
require -- from COLLECTION
prunable
require else -- from STRING
True
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from STRING
changed_count: count = (old count ) - (old occurrences (c))

prune_all_leading (c: CHARACTER )
-- Remove all leading occurrences of c.
-- (from STRING )

prune_all_trailing (c: CHARACTER )
-- Remove all trailing occurrences of c.
-- (from STRING )

remove (i: INTEGER )
-- Remove i-th character.
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count - 1

wipe_out
-- Remove all characters.
-- (from STRING )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from STRING
is_empty: count = 0
empty_capacity: capacity = 0

feature -- Resizing

adapt_size
-- Adapt the size to accommodate count characters.
-- (from STRING )

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (newsize: INTEGER )
-- Ensure that the capacity is at least newsize.
-- (from STRING )
require -- from RESIZABLE
True
require else -- from STRING
new_size_non_negative: newsize >= 0
ensure -- from RESIZABLE
new_capacity: capacity >= i

resize (newsize: INTEGER )
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (from STRING )
require -- from STRING
new_size_non_negative: newsize >= 0

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- Converted string of object according to the database format
-- (from DB_FORMAT )

center_justify
-- Center justify the string using
-- the capacity as the width
-- (from STRING )

character_justify (pivot: CHARACTER ; position: INTEGER )
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (from STRING )
require -- from STRING
valid_position: position <= capacity
positive_position: position >= 1
pivot_not_space: pivot /= ' '
not_empty: not is_empty

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_format (object: DATE_TIME ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

left_justify
-- Left justify the string using
-- the capacity as the width
-- (from STRING )

linear_representation : LINEAR [ CHARACTER ]
-- Representation as a linear structure
-- (from STRING )

mirror
-- Reverse the order of characters.
-- "Hello world" -> "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: count = old count

mirrored : like Current
-- Mirror image of string;
-- result for "Hello world" is "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: Result. count = count

right_justify
-- Right justify the string using
-- the capacity as the width
-- (from STRING )

split (a_separator: CHARACTER ): LINEAR [ STRING ]
-- Split on a_separator.
-- Ignore separators in quotes.
-- (from STRING )
ensure -- from STRING
Result /= void

string_format (object: STRING ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

to_boolean : BOOLEAN
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (from STRING )
require -- from STRING
is_boolean: string_is_boolean

frozen to_c : ANY
-- A reference to a C form of current string.
-- Useful only for interfacing with C software.
-- (from STRING )

to_double : DOUBLE
-- "Double" value;
-- for example, when applied to "123.0", will yield 123.0 (double)
-- (from STRING )
require -- from STRING
represents_a_double: string_is_double

to_integer : INTEGER
-- Integer value;
-- for example, when applied to "123", will yield 123
-- (from STRING )
require -- from STRING
is_integer: string_is_integer

to_lower
-- Convert to lower case.
-- (from STRING )

to_real : REAL
-- Real value;
-- for example, when applied to "123.0", will yield 123.0
-- (from STRING )
require -- from STRING
represents_a_real: string_is_real

to_upper
-- Convert to upper case.
-- (from STRING )

feature -- Duplication

multiply (n: INTEGER )
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (from STRING )
require -- from STRING
meaningful_multiplier: n >= 1

substring (n1, n2: INTEGER ): like Current
-- Copy of substring containing all characters at indices
-- between n1 and n2
-- (from STRING )
ensure -- from STRING
new_result_count: Result. count = n2 - n1 + 1 or Result. count = 0

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

append_substring (s: STRING ; n1, n2: INTEGER )
-- Append substring `s.substring (n1, n2)' to Current.
-- Faster than append s.substring (n1, n2).
-- (from SQL_SCAN )
require -- from SQL_SCAN
string_exists: s /= void
meaningful_origin: 1 <= n1
meaningful_interval: n1 <= n2
meaningful_end: n2 <= s. count

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

force (obj: ANY )
-- Store object into supposingly fixed
-- and resizable active repository.
require
object_exists: obj /= void
owns_repository: owns_repository
repository_exists: repository . exists

get_complex_value (obj: ANY ; str: STRING )
-- Retrieve string value of reference object obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
object_exists: obj /= void
str_exists: str /= void

get_value (obj: ANY ; str: STRING )
-- Retrieve string value of obj and put in str.
-- (from SQL_SCAN )
require -- from SQL_SCAN
str_exists: str /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

parse (s: STRING ): STRING
-- Parse string s by replacing each pattern ":<name>"
-- with the Eiffel object description whose name
-- also matches "<name>".
-- (from SQL_SCAN )

put (object: ANY )
-- Store object into active repository.
require
object_exists: object /= void
owns_repository: owns_repository
repository_exists: repository . exists

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

replace
-- Replace all occurences of :key by `ht.item (":key")'
-- (from SQL_SCAN )

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Output

out : like Current
-- Printable representation
-- (from STRING )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from STRING
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set . count = count
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from COMPARABLE
irreflexive_comparison: not (Current < Current)

end -- class DATABASE_STORE


DATABASE_STRING_EX Chart

 class
DATABASE_STRING_EX [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "String tools"
create: make

Ancestors
HANDLE_SPEC [G -> DATABASE create default_create end]
STRING

Queries
infix " @ " (i: INTEGER ): CHARACTER
infix " >= " (other: [like Current] DATABASE_STRING_EX [G]): BOOLEAN
infix " > " (other: [like Current] DATABASE_STRING_EX [G]): BOOLEAN
infix " <= " (other: [like Current] DATABASE_STRING_EX [G]): BOOLEAN
infix " < " (other: [like Current] DATABASE_STRING_EX [G]): BOOLEAN
infix " + " (s: STRING ): STRING
adapt (s: STRING ): [like Current] DATABASE_STRING_EX [G]
additional_space : INTEGER
area : SPECIAL [ CHARACTER ]
capacity : INTEGER
Changeable_comparison_criterion : BOOLEAN
count : INTEGER
db_spec : DATABASE
Extendible : BOOLEAN
False_constant : STRING
full : BOOLEAN
fuzzy_index (other: STRING ; start, fuzz: INTEGER ): INTEGER
Growth_percentage : INTEGER
has (c: CHARACTER ): BOOLEAN
hash_code : INTEGER
index_of (c: CHARACTER ; start: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_boolean : BOOLEAN
is_double : BOOLEAN
is_empty : BOOLEAN
is_equal (other: [like Current] DATABASE_STRING_EX [G]): BOOLEAN
is_hashable : BOOLEAN
is_inserted (v: CHARACTER ): BOOLEAN
is_integer : BOOLEAN
is_real : BOOLEAN
item (i: INTEGER ): CHARACTER
item_code (i: INTEGER ): INTEGER
last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
linear_representation : LINEAR [ CHARACTER ]
max (other: [like Current] DATABASE_STRING_EX [G]): [like Current] DATABASE_STRING_EX [G]
min (other: [like Current] DATABASE_STRING_EX [G]): [like Current] DATABASE_STRING_EX [G]
Minimal_increase : INTEGER
mirrored : [like Current] DATABASE_STRING_EX [G]
object_comparison : BOOLEAN
occurrences (c: CHARACTER ): INTEGER
out : [like Current] DATABASE_STRING_EX [G]
prunable : BOOLEAN
resizable : BOOLEAN
shared_with (other: [like Current] DATABASE_STRING_EX [G]): BOOLEAN
split (a_separator: CHARACTER ): LINEAR [ STRING ]
substring (n1, n2: INTEGER ): [like Current] DATABASE_STRING_EX [G]
substring_index (other: STRING ; start: INTEGER ): INTEGER
three_way_comparison (other: [like Current] DATABASE_STRING_EX [G]): INTEGER
to_boolean : BOOLEAN
to_c : ANY
to_double : DOUBLE
to_integer : INTEGER
to_real : REAL
True_constant : STRING
valid_index (i: INTEGER ): BOOLEAN

Commands
adapt_size
append (s: STRING )
append_boolean (b: BOOLEAN )
append_character (c: CHARACTER )
append_double (d: DOUBLE )
append_integer (i: INTEGER )
append_real (r: REAL )
append_string (s: STRING )
automatic_grow
center_justify
character_justify (pivot: CHARACTER ; position: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] DATABASE_STRING_EX [G])
extend (c: CHARACTER )
fill (other: CONTAINER [ CHARACTER ])
fill_blank
fill_character (c: CHARACTER )
from_c (c_string: POINTER )
from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
get_select_name (no_descriptor, index: INTEGER )
get_value (no_descriptor, index: INTEGER )
grow (newsize: INTEGER )
head (n: INTEGER )
insert (s: STRING ; i: INTEGER )
left_adjust
left_justify
make_from_c (c_string: POINTER )
make_from_string (s: STRING )
mirror
multiply (n: INTEGER )
precede (c: CHARACTER )
prepend (s: STRING )
prepend_boolean (b: BOOLEAN )
prepend_character (c: CHARACTER )
prepend_double (d: DOUBLE )
prepend_integer (i: INTEGER )
prepend_real (r: REAL )
prepend_string (s: STRING )
prune (c: CHARACTER )
prune_all (c: CHARACTER )
prune_all_leading (c: CHARACTER )
prune_all_trailing (c: CHARACTER )
put (c: CHARACTER ; i: INTEGER )
remake (n: INTEGER )
remove (i: INTEGER )
replace_blank
replace_character (c: CHARACTER )
replace_substring (s: [like Current] DATABASE_STRING_EX [G]; start_pos, end_pos: INTEGER )
replace_substring_all (original, new: [like Current] DATABASE_STRING_EX [G])
resize (newsize: INTEGER )
right_adjust
right_justify
set (t: [like Current] DATABASE_STRING_EX [G]; n1, n2: INTEGER )
share (other: [like Current] DATABASE_STRING_EX [G])
subcopy (other: [like Current] DATABASE_STRING_EX [G]; start_pos, end_pos, index_pos: INTEGER )
tail (n: INTEGER )
to_lower
to_upper
wipe_out


DATABASE_STRING_EX Flat contracts

 indexing
description: "String tools"
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_STRING_EX [G -> DATABASE create default_create end]

create

make (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Initialization

adapt (s: STRING ): like Current
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (from STRING )

from_c (c_string: POINTER )
-- Reset contents of string from contents of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
ensure -- from STRING
no_zero_byte: not has ('%U')

from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
-- Reset contents of string from substring of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
start_position_big_enough: start_pos >= 1
end_position_big_enough: start_pos <= end_pos + 1
ensure -- from STRING
valid_count: count = end_pos - start_pos + 1

make_from_c (c_string: POINTER )
-- Initialize from contents of c_string,
-- a string created by some external C function
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer

make_from_string (s: STRING )
-- Initialize from the characters of s.
-- (Useful in proper descendants of class STRING ,
-- to initialize a string-like object from a manifest string.)
-- (from STRING )
require -- from STRING
string_exists: s /= void
ensure -- from STRING
shared_implementation: shared_with (s)

remake (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Access

area : SPECIAL [ CHARACTER ]
-- Special data zone
-- (from TO_SPECIAL )

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

False_constant : STRING is "false"
-- Constant string "false"
-- (from STRING )

fuzzy_index (other: STRING ; start: INTEGER ; fuzz: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (from STRING )
require -- from STRING
other_exists: other /= void
other_not_empty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
acceptable_fuzzy: fuzz <= other. count

has (c: CHARACTER ): BOOLEAN
-- Does string include c?
-- (from STRING )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

hash_code : INTEGER
-- Hash code value
-- (from STRING )
ensure -- from HASHABLE
good_hash_value: Result >= 0

index_of (c: CHARACTER ; start: INTEGER ): INTEGER
-- Position of first occurrence of c at or after start;
-- 0 if none.
-- (from STRING )
require -- from STRING
start_large_enough: start >= 1
start_small_enough: start <= count + 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

item (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of @.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

item_code (i: INTEGER ): INTEGER
-- Numeric code of character at position i
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0

last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
-- Position of last occurence of c.
-- 0 if none
-- (from STRING )
require -- from STRING
start_index_small_enough: start_index_from_end <= count
start_index_large_enough: start_index_from_end >= 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

shared_with (other: like Current): BOOLEAN
-- Does string share the text of other?
-- (from STRING )

substring_index (other: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start;
-- 0 if none.
-- (from STRING )
require -- from STRING
other_nonvoid: other /= void
other_notempty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
ensure -- from STRING
correct_place: Result > 0 implies substring (Result, Result + other. count - 1). is_equal (other)

True_constant : STRING is "true"
-- Constant string "true"
-- (from STRING )

infix " @ " (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of item .
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

capacity : INTEGER
-- Allocated space
-- (from STRING )

count : INTEGER
-- Actual number of characters making up the string
-- (from STRING )

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from STRING )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from STRING
Result. count = count

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

occurrences (c: CHARACTER ): INTEGER
-- Number of times c appears in the string
-- (from STRING )
ensure -- from BAG
non_negative_occurrences: Result >= 0

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (from STRING )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from COMPARABLE
trichotomy: Result = ( not (Current < other) and not (other < Current))

max (other: like Current): like Current
-- The greater of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other

min (other: like Current): like Current
-- The smaller of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other

three_way_comparison (other: like Current): INTEGER
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)

infix " < " (other: like Current): BOOLEAN
-- Is string lexicographically lower than other?
-- (from STRING )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
asymmetric: Result implies not (other < Current)

infix " <= " (other: like Current): BOOLEAN
-- Is current object less than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = ((Current < other) or is_equal (other))

infix " > " (other: like Current): BOOLEAN
-- Is current object greater than other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other < Current)

infix " >= " (other: like Current): BOOLEAN
-- Is current object greater than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other <= Current)

feature -- Status report

Changeable_comparison_criterion : BOOLEAN is False
-- (from STRING )

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from STRING )

full : BOOLEAN
-- Is structure full?
-- (from BOUNDED )

is_boolean : BOOLEAN
-- Does Current represent a BOOLEAN?
-- (from STRING )

is_double : BOOLEAN
-- Does Current represent a DOUBLE?
-- (from STRING )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

is_inserted (v: CHARACTER ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_integer : BOOLEAN
-- Does Current represent an INTEGER?
-- (from STRING )

is_real : BOOLEAN
-- Does Current represent a REAL?
-- (from STRING )

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from STRING )

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the string?
-- (from STRING )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

feature -- Status setting

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

get_select_name (no_descriptor: INTEGER ; index: INTEGER )
-- Put in Current name of the index-th column of selection.
ensure
capacity_unchanged: capacity = old capacity
not_change_area: area = old area

get_value (no_descriptor: INTEGER ; index: INTEGER )
-- Put in Current value of index-th column of selection.
ensure
capacity_unchanged: capacity = old capacity
not_change_area: area = old area

feature -- Element change

append (s: STRING )
-- Append a copy of s at end.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + old s. count

append_boolean (b: BOOLEAN )
-- Append the string representation of b at end.
-- (from STRING )

append_character (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of extend .
-- (from STRING )
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

append_double (d: DOUBLE )
-- Append the string representation of d at end.
-- (from STRING )

append_integer (i: INTEGER )
-- Append the string representation of i at end.
-- (from STRING )

append_real (r: REAL )
-- Append the string representation of r at end.
-- (from STRING )

append_string (s: STRING )
-- Append a copy of s, if not void, at end.
-- (from STRING )

copy (other: like Current)
-- Reinitialize by copying the characters of other.
-- (This is also used by clone .)
-- (from STRING )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)
ensure then -- from STRING
new_result_count: count = other. count

extend (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of append_character .
-- (from STRING )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

fill (other: CONTAINER [ CHARACTER ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

fill_blank
-- Fill with capacity blank characters.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

fill_character (c: CHARACTER )
-- Fill with capacity characters all equal to c.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

head (n: INTEGER )
-- Remove all characters except for the first n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

insert (s: STRING ; i: INTEGER )
-- Add s to the left of position i in current string.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count + s. count

left_adjust
-- Remove leading whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item (1) /= ' ') and ( item (1) /= ' ') and ( item (1) /= '%R') and ( item (1) /= ''))

precede (c: CHARACTER )
-- Add c at front.
-- (from STRING )
ensure -- from STRING
new_count: count = old count + 1

prepend (s: STRING )
-- Prepend a copy of s at front.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + s. count

prepend_boolean (b: BOOLEAN )
-- Prepend the string representation of b at front.
-- (from STRING )

prepend_character (c: CHARACTER )
-- Prepend the string representation of c at front.
-- (from STRING )

prepend_double (d: DOUBLE )
-- Prepend the string representation of d at front.
-- (from STRING )

prepend_integer (i: INTEGER )
-- Prepend the string representation of i at front.
-- (from STRING )

prepend_real (r: REAL )
-- Prepend the string representation of r at front.
-- (from STRING )

prepend_string (s: STRING )
-- Prepend a copy of s, if not void, at front.
-- (from STRING )

put (c: CHARACTER ; i: INTEGER )
-- Replace character at position i by c.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: item (k) = v

replace_blank
-- Replace all current characters with blanks.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_character (c: CHARACTER )
-- Replace all current characters with characters all equal to c.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_substring (s: like Current; start_pos, end_pos: INTEGER )
-- Copy the characters of s to positions
-- start_pos .. end_pos.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: end_pos <= count
order_respected: start_pos <= end_pos
index_large_enough: start_pos > 0
ensure -- from STRING
new_count: count = old count + s. count - end_pos + start_pos - 1

replace_substring_all (original, new: like Current)
-- Replace every occurence of original with new.
-- (from STRING )
require -- from STRING
original_exists: original /= void
new_exists: new /= void
original_not_empty: not original. is_empty

right_adjust
-- Remove trailing whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item ( count ) /= ' ') and ( item ( count ) /= ' ') and ( item ( count ) /= '%R') and ( item ( count ) /= ''))

set (t: like Current; n1, n2: INTEGER )
-- Set current string to substring of t from indices n1
-- to n2, or to empty string if no such substring.
-- (from STRING )
require -- from STRING
argument_not_void: t /= void
ensure -- from STRING
is_substring: is_equal (t. substring (n1, n2))

share (other: like Current)
-- Make current string share the text of other.
-- Subsequent changes to the characters of current string
-- will also affect other, and conversely.
-- (from STRING )
require -- from STRING
argument_not_void: other /= void
ensure -- from STRING
shared_count: other. count = count

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (from STRING )
require -- from STRING
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( count - index_pos) >= (end_pos - start_pos)

tail (n: INTEGER )
-- Remove all characters except for the last n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

infix " + " (s: STRING ): STRING
-- Append a copy of 's' at the end of a copy of Current,
-- Then return the Result.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
result_exists: Result /= void
new_count: Result. count = count + s. count

feature -- Removal

clear_all
-- Reset all characters.
-- (from STRING )
ensure -- from STRING
is_empty: count = 0
same_capacity: capacity = old capacity

prune (c: CHARACTER )
-- Remove first occurrence of c, if any.
-- (from STRING )
require -- from COLLECTION
prunable: prunable
require else -- from STRING
True

prune_all (c: CHARACTER )
-- Remove all occurrences of c.
-- (from STRING )
require -- from COLLECTION
prunable
require else -- from STRING
True
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from STRING
changed_count: count = (old count ) - (old occurrences (c))

prune_all_leading (c: CHARACTER )
-- Remove all leading occurrences of c.
-- (from STRING )

prune_all_trailing (c: CHARACTER )
-- Remove all trailing occurrences of c.
-- (from STRING )

remove (i: INTEGER )
-- Remove i-th character.
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count - 1

wipe_out
-- Remove all characters.
-- (from STRING )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from STRING
is_empty: count = 0
empty_capacity: capacity = 0

feature -- Resizing

adapt_size
-- Adapt the size to accommodate count characters.
-- (from STRING )

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (newsize: INTEGER )
-- Ensure that the capacity is at least newsize.
-- (from STRING )
require -- from RESIZABLE
True
require else -- from STRING
new_size_non_negative: newsize >= 0
ensure -- from RESIZABLE
new_capacity: capacity >= i

resize (newsize: INTEGER )
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (from STRING )
require -- from STRING
new_size_non_negative: newsize >= 0

feature -- Conversion

center_justify
-- Center justify the string using
-- the capacity as the width
-- (from STRING )

character_justify (pivot: CHARACTER ; position: INTEGER )
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (from STRING )
require -- from STRING
valid_position: position <= capacity
positive_position: position >= 1
pivot_not_space: pivot /= ' '
not_empty: not is_empty

left_justify
-- Left justify the string using
-- the capacity as the width
-- (from STRING )

linear_representation : LINEAR [ CHARACTER ]
-- Representation as a linear structure
-- (from STRING )

mirror
-- Reverse the order of characters.
-- "Hello world" -> "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: count = old count

mirrored : like Current
-- Mirror image of string;
-- result for "Hello world" is "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: Result. count = count

right_justify
-- Right justify the string using
-- the capacity as the width
-- (from STRING )

split (a_separator: CHARACTER ): LINEAR [ STRING ]
-- Split on a_separator.
-- Ignore separators in quotes.
-- (from STRING )
ensure -- from STRING
Result /= void

to_boolean : BOOLEAN
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (from STRING )
require -- from STRING
is_boolean: is_boolean

frozen to_c : ANY
-- A reference to a C form of current string.
-- Useful only for interfacing with C software.
-- (from STRING )

to_double : DOUBLE
-- "Double" value;
-- for example, when applied to "123.0", will yield 123.0 (double)
-- (from STRING )
require -- from STRING
represents_a_double: is_double

to_integer : INTEGER
-- Integer value;
-- for example, when applied to "123", will yield 123
-- (from STRING )
require -- from STRING
is_integer: is_integer

to_lower
-- Convert to lower case.
-- (from STRING )

to_real : REAL
-- Real value;
-- for example, when applied to "123.0", will yield 123.0
-- (from STRING )
require -- from STRING
represents_a_real: is_real

to_upper
-- Convert to upper case.
-- (from STRING )

feature -- Duplication

multiply (n: INTEGER )
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (from STRING )
require -- from STRING
meaningful_multiplier: n >= 1

substring (n1, n2: INTEGER ): like Current
-- Copy of substring containing all characters at indices
-- between n1 and n2
-- (from STRING )
ensure -- from STRING
new_result_count: Result. count = n2 - n1 + 1 or Result. count = 0

feature -- Output

out : like Current
-- Printable representation
-- (from STRING )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from STRING
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set . count = count
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from COMPARABLE
irreflexive_comparison: not (Current < Current)

end -- class DATABASE_STRING_EX


DATABASE_STRING Chart

 class
DATABASE_STRING [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "String format of the database"

Ancestors
DB_TYPE
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
db_spec : DATABASE
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
eiffel_name : STRING
Eiffel_ref : STRING
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DATABASE_STRING Flat contracts

 indexing
description: "String format of the database"
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_STRING [G -> DATABASE create default_create end]

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
-- (from DB_TYPE )
require -- from DB_TYPE
object_not_void: object /= void
ensure -- from DB_TYPE
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void
ensure -- from DB_TYPE
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name
-- (from DB_TYPE )
require -- from DB_TYPE
eiffel_ref_not_void: eiffel_ref /= void

eiffel_ref : STRING
-- Shared string reference
ensure -- from DB_TYPE
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name of string
ensure -- from DB_TYPE
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_STRING


DATABASE_TUPLE Chart

 class
DATABASE_TUPLE [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Implementation of DB_TUPLE "
create: make

Ancestors
HANDLE_USE

Queries
column_name (position: INTEGER ): STRING
count : INTEGER
data : DATABASE_DATA [G]
item (index: INTEGER ): ANY
map_table : ARRAY [ INTEGER ]

Commands
fill_in (no_descriptor: INTEGER )
make
update_map_table (object: ANY )


DATABASE_TUPLE Flat contracts

 indexing
description: "Implementation of DB_TUPLE "
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
DATABASE_TUPLE [G -> DATABASE create default_create end]

create

make
-- Create implementation.
ensure
data_not_void: data /= void

feature -- Initialization

make
-- Create implementation.
ensure
data_not_void: data /= void

feature -- Status report

column_name (position: INTEGER ): STRING
-- Name of the position-th column
ensure
resulting_data: Result = data . column_name (position)

count : INTEGER
-- Number of items
ensure
resulting_data: Result = data . count

data : DATABASE_DATA [G]
-- Associated data description

item (index: INTEGER ): ANY
-- Value of index column in current row
-- pointed to by active database cursor

map_table : ARRAY [ INTEGER ]
-- Association table returning k-th field
-- position mapping i-th column value of current active tuple
ensure then
resulting_data: Result = data . map_table

feature -- Status setting

fill_in (no_descriptor: INTEGER )
-- Fill in current tuple with database cursor.
require else
data_exists: data /= void

update_map_table (object: ANY )
-- Update map table according to new object.
require else
data_exists: data /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DATABASE_TUPLE


DB Chart

 class
DB [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Contains all the handles"

Ancestors
DB_CONSTANT

Queries
db_all_types : DATABASE_ALL_TYPES [G]
db_change : DATABASE_CHANGE [G]
db_control : DATABASE_CONTROL [G]
db_dyn_change : DATABASE_DYN_CHANGE [G]
db_dyn_selection : DATABASE_DYN_SELECTION [G]
db_format : DATABASE_FORMAT [G]
db_proc : DATABASE_PROC [G]
db_repository : DATABASE_REPOSITORY [G]
db_result : DATABASE_TUPLE [G]
db_selection : DATABASE_SELECTION [G]
db_status : DATABASE_STATUS [G]
db_store : DATABASE_STORE [G]
Name : STRING


DB Flat contracts

 indexing
description: "Contains all the handles"
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
DB [G -> DATABASE create default_create end]

feature -- Status report

db_all_types : DATABASE_ALL_TYPES [G]
-- DATABASE_ALL_TYPES handle

db_change : DATABASE_CHANGE [G]
-- DATABASE_CHANGE handle

db_control : DATABASE_CONTROL [G]
-- DATABASE_CONTROL handle

db_dyn_change : DATABASE_DYN_CHANGE [G]
-- DATABASE_DYN_CHANGE handle

db_dyn_selection : DATABASE_DYN_SELECTION [G]
-- DATABASE_DYN_SELECTION handle

db_format : DATABASE_FORMAT [G]
-- DATABASE_FORMAT handle

db_proc : DATABASE_PROC [G]
-- DATABASE_PROC handle

db_repository : DATABASE_REPOSITORY [G]
-- DATABASE_REPOSITORY handle

db_result : DATABASE_TUPLE [G]
-- DATABASE_TUPLE handle

db_selection : DATABASE_SELECTION [G]
-- DATABASE_SELECTION handle

db_status : DATABASE_STATUS [G]
-- DATABASE_STATUS handle

db_store : DATABASE_STORE [G]
-- DATABASE_STORE handle

name : STRING
-- Database name

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB


HANDLE_SPEC Chart

 class
HANDLE_SPEC [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: "Handle to actual database"

Ancestors
ANY

Queries
db_spec : DATABASE


HANDLE_SPEC Flat contracts

 indexing
description: "Handle to actual database"
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
HANDLE_SPEC [G -> DATABASE create default_create end]

feature -- Access

db_spec : DATABASE
-- Handle to actual database
ensure
not_void: Result /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HANDLE_SPEC


LOGIN Chart

 class
LOGIN [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: ""
create: make

Ancestors
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
application : STRING
data_source : STRING
db_spec : DATABASE
groupid : STRING
hostname : STRING
name : STRING
passwd : STRING
roleid : STRING
rolepasswd : STRING

Commands
make
set (uname, upasswd: STRING )
set_application (appname: STRING )
set_data_source (udata_source: STRING )
set_group (ugroupid: STRING )
set_hostname (uhostname: STRING )
set_role (uroleid, urolepasswd: STRING )


LOGIN Flat contracts

 indexing
description: ""
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
LOGIN [G -> DATABASE create default_create end]

create

make

feature -- Initialization

make

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

application : STRING
-- Application name.

data_source : STRING
-- Data Source.

groupid : STRING
-- Group Identifier.

hostname : STRING
-- Host name

name : STRING
-- User name

passwd : STRING
-- User password

roleid : STRING
-- Role identifier .

rolepasswd : STRING
-- Role password.

feature -- Status setting

set (uname, upasswd: STRING )
-- Set user name and password before connection becomes possible.
require
user_name_ok: db_spec . user_name_ok (uname)
password_ok: db_spec . password_ok (upasswd)
ensure
password_ensure: db_spec . password_ensure ( name , passwd , uname, upasswd)

set_application (appname: STRING )
-- Set name of application
require
argument_not_void: appname /= void
ensure
name_set: application . is_equal (appname)

set_data_source (udata_source: STRING )
-- Set Data Source of ODBC .
require
argument_not_void: data_source /= void

set_group (ugroupid: STRING )
require
argument_not_void: ugroupid /= void
ensure
name_set: groupid . is_equal (ugroupid)

set_hostname (uhostname: STRING )
require
argument_not_void: uhostname /= void
ensure
name_set: hostname . is_equal (uhostname)

set_role (uroleid, urolepasswd: STRING )
-- Set role identifier of data base.
require
argument_not_void: uroleid /= void
ensure
name_set: roleid . is_equal (uroleid)

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class LOGIN


TYPES Chart

 class
TYPES [G -> DATABASE create default_create end]

General
cluster: eiffelstore.dbms.support
description: ""

Ancestors
HANDLE_SPEC [G -> DATABASE create default_create end]

Queries
Boolean_type_database : INTEGER
Character_type_database : INTEGER
Date_type_database : INTEGER
db_spec : DATABASE
Float_type_database : INTEGER
Integer_type_database : INTEGER
Real_type_database : INTEGER
String_type_database : INTEGER


TYPES Flat contracts

 indexing
description: ""
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
TYPES [G -> DATABASE create default_create end]

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Conversion

boolean_type_database : INTEGER
-- Boolean type code in Ingres

character_type_database : INTEGER
-- Character type code in Ingres

date_type_database : INTEGER
-- Datetime type code in Ingres

float_type_database : INTEGER
-- Double type code in Ingres

integer_type_database : INTEGER
-- Integer type code in Ingres

real_type_database : INTEGER
-- Real type code in Ingres

string_type_database : INTEGER
-- String type code in Ingres

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TYPES


cluster eiffelstore.eiffel2rm

 Cluster
eiffelstore.eiffel2rm

Supercluster
eiffelstore

Subclusters
eiffelstore.eiffel2rm.compositor
eiffelstore.eiffel2rm.database_schema
eiffelstore.eiffel2rm.meta_schema
eiffelstore.eiffel2rm.model2


cluster eiffelstore.eiffel2rm.compositor

 Cluster
eiffelstore.eiffel2rm.compositor

Supercluster
eiffelstore.eiffel2rm


cluster eiffelstore.eiffel2rm.database_schema

 Cluster
eiffelstore.eiffel2rm.database_schema

Supercluster
eiffelstore.eiffel2rm


cluster eiffelstore.eiffel2rm.meta_schema

 Cluster
eiffelstore.eiffel2rm.meta_schema

Supercluster
eiffelstore.eiffel2rm


cluster eiffelstore.eiffel2rm.model2

 Cluster
eiffelstore.eiffel2rm.model2

Supercluster
eiffelstore.eiffel2rm


cluster eiffelstore.generation

 Cluster
eiffelstore.generation

Supercluster
eiffelstore

Subclusters
eiffelstore.generation.generator
eiffelstore.generation.tables_access


cluster eiffelstore.generation.generator

 Cluster
eiffelstore.generation.generator

Supercluster
eiffelstore.generation

Classes
DB_ACCESS_CLASS_GENERATOR
DB_CLASS_GENERATOR
DB_TABLE_CLASS_GENERATOR
DB_TEMPLATE_TAGS


DB_ACCESS_CLASS_GENERATOR Chart

 class
DB_ACCESS_CLASS_GENERATOR

General
cluster: eiffelstore.generation.generator
description: "Objects that enable to create a class relatedto a specific database table from a template anda class description (class DB_REPOSITORY )."

Ancestors
DB_CLASS_GENERATOR

Queries
description_set : BOOLEAN
error_message : STRING
generated_file_content : STRING
is_ok : BOOLEAN
template_content_set : BOOLEAN

Commands
generate_file
set_table_names (table_names: ARRAYED_LIST [ DB_REPOSITORY ])
set_template_content (a_template_content: STRING )


DB_ACCESS_CLASS_GENERATOR Flat contracts

 indexing
description: "Objects that enable to create a class relatedto a specific database table from a template anda class description (class DB_REPOSITORY )."
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_ACCESS_CLASS_GENERATOR

feature -- Access

generated_file_content : STRING
-- Content of file mapped to database table associated to table description.
-- (from DB_CLASS_GENERATOR )
require -- from DB_CLASS_GENERATOR
is_ok: is_ok

feature -- Status report

description_set : BOOLEAN
-- Are table names set?

error_message : STRING
-- Error message.
-- (from DB_CLASS_GENERATOR )

is_ok : BOOLEAN
-- Is file properly generated?
-- (from DB_CLASS_GENERATOR )

template_content_set : BOOLEAN
-- Is template file content set?
-- (from DB_CLASS_GENERATOR )

feature -- Basic operations

generate_file
-- Generate file with table description and
-- template file content.
-- (from DB_CLASS_GENERATOR )
require -- from DB_CLASS_GENERATOR
description_set: description_set
content_set: template_content_set

set_table_names (table_names: ARRAYED_LIST [ DB_REPOSITORY ])
-- Set table names to map template to the database tables.
require
not_void: table_names /= void
ensure
table_name_list_set: description_set

set_template_content (a_template_content: STRING )
-- Set template file content for the class generation.
-- (from DB_CLASS_GENERATOR )
require -- from DB_CLASS_GENERATOR
content_exists: a_template_content /= void and then not a_template_content. is_empty
ensure -- from DB_CLASS_GENERATOR
content_set: template_content_set

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_ACCESS_CLASS_GENERATOR


DB_CLASS_GENERATOR Chart

 deferred class
DB_CLASS_GENERATOR

General
cluster: eiffelstore.generation.generator
description: "Objects that enable to create a class relatedto a specific database table from a template anda class description (class DB_REPOSITORY )."

Ancestors
ANY

Queries
description_set : BOOLEAN
error_message : STRING
generated_file_content : STRING
is_ok : BOOLEAN
template_content_set : BOOLEAN

Commands
generate_file
set_template_content (a_template_content: STRING )


DB_CLASS_GENERATOR Flat contracts

 indexing
description: "Objects that enable to create a class relatedto a specific database table from a template anda class description (class DB_REPOSITORY )."
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

deferred class interface
DB_CLASS_GENERATOR

feature -- Access

generated_file_content : STRING
-- Content of file mapped to database table associated to table description.
require
is_ok: is_ok

feature -- Status report

description_set : BOOLEAN
-- Is description for mapping set?

error_message : STRING
-- Error message.

is_ok : BOOLEAN
-- Is file properly generated?

template_content_set : BOOLEAN
-- Is template file content set?

feature -- Basic operations

generate_file
-- Generate file with table description and
-- template file content.
require
description_set: description_set
content_set: template_content_set

set_template_content (a_template_content: STRING )
-- Set template file content for the class generation.
require
content_exists: a_template_content /= void and then not a_template_content. is_empty
ensure
content_set: template_content_set

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_CLASS_GENERATOR


DB_TABLE_CLASS_GENERATOR Chart

 class
DB_TABLE_CLASS_GENERATOR

General
cluster: eiffelstore.generation.generator
description: "Objects that enable to create a class relatedto a specific database table from a template anda class description (class DB_REPOSITORY )."

Ancestors
DB_CLASS_GENERATOR

Queries
description_set : BOOLEAN
error_message : STRING
generated_file_content : STRING
generated_file_name : STRING
is_ok : BOOLEAN
template_content_set : BOOLEAN

Commands
generate_file
set_table_description (a_table_description: DB_REPOSITORY )
set_template_content (a_template_content: STRING )


DB_TABLE_CLASS_GENERATOR Flat contracts

 indexing
description: "Objects that enable to create a class relatedto a specific database table from a template anda class description (class DB_REPOSITORY )."
status: "See notice at end of class"
date: "$Date: 2001/06/14 17:19:03 $"
revision: "$Revision: 1.2 $"
product: eiffelstore
database: all_bases

class interface
DB_TABLE_CLASS_GENERATOR

feature -- Access

generated_file_content : STRING
-- Content of file mapped to database table associated to table description.
-- (from DB_CLASS_GENERATOR )
require -- from DB_CLASS_GENERATOR
is_ok: is_ok

generated_file_name : STRING
-- File name possibility for the generated file:
-- maps the class name and has the ".e" extension.
require
is_ok: is_ok

feature -- Status report

description_set : BOOLEAN
-- Is table description set?

error_message : STRING
-- Error message.
-- (from DB_CLASS_GENERATOR )

is_ok : BOOLEAN
-- Is file properly generated?
-- (from DB_CLASS_GENERATOR )

template_content_set : BOOLEAN
-- Is template file content set?
-- (from DB_CLASS_GENERATOR )

feature -- Basic operations

generate_file
-- Generate file with table description and
-- template file content.
require -- from DB_CLASS_GENERATOR
description_set: description_set
content_set: template_content_set

set_table_description (a_table_description: DB_REPOSITORY )
-- Set table description to map template to the database table.
require
not_void: a_table_description /= void
is_loaded_and_exists: a_table_description. exists
ensure
table_description_set: description_set

set_template_content (a_template_content: STRING )
-- Set template file content for the class generation.
-- (from DB_CLASS_GENERATOR )
require -- from DB_CLASS_GENERATOR
content_exists: a_template_content /= void and then not a_template_content. is_empty
ensure -- from DB_CLASS_GENERATOR
content_set: template_content_set

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TABLE_CLASS_GENERATOR


DB_TEMPLATE_TAGS Chart

 class
DB_TEMPLATE_TAGS

General
cluster: eiffelstore.generation.generator
description: "Objects that enable to access tags used in templatedescribing how to generate a class related to a specificdatabase table."

Ancestors
ANY

Queries
Attribute_block : STRING
Attribute_block_end : STRING
Attribute_count : STRING
has_all_attribute_option : BOOLEAN
has_all_type_option : BOOLEAN
has_boolean_type_option : BOOLEAN
has_character_type_option : BOOLEAN
has_date_type_option : BOOLEAN
has_double_type_option : BOOLEAN
has_first_attribute_option : BOOLEAN
has_integer_type_option : BOOLEAN
has_intermediate_attribute_option : BOOLEAN
has_last_attribute_option : BOOLEAN
has_string_type_option : BOOLEAN
Initcap_attribute_name : STRING
Initcap_class_name : STRING
Initcap_type_name : STRING
is_valid_attribute_tag : BOOLEAN
Iterator : STRING
Lower_attribute_name : STRING
Lower_class_name : STRING
Lower_type_name : STRING
Tag_close : CHARACTER
Type_default_value : STRING
Upper_attribute_name : STRING
Upper_class_name : STRING
Upper_type_name : STRING

Commands
parse_tag (tag: STRING )
reset


DB_TEMPLATE_TAGS Flat contracts

 indexing
description: "Objects that enable to access tags used in templatedescribing how to generate a class related to a specificdatabase table."
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_TEMPLATE_TAGS

feature -- Access

Attribute_block : STRING is "<A:"
-- Tag to indicate a block to write for every table attribute.

Attribute_block_end : STRING is "</A>"
-- Tag to indicate the end of a block for every table attribute.

Attribute_count : STRING is "<ACNT>"
-- Tag to replace by the number of attributes.

Initcap_attribute_name : STRING is "<AN:I>"
-- Tag to replace by the name of the attribute in lower case
-- except for the initial character.

Initcap_class_name : STRING is "<CN:I>"
-- Tag to replace by the name of the table in lower case
-- except for the initial character.

Initcap_type_name : STRING is "<TN:I>"
-- Tag to replace by the attribute type name (in lowercase except
-- for the initial character).

Iterator : STRING is "<IT>"
-- Tag to replace by the position of the attribute.

Lower_attribute_name : STRING is "<AN:L>"
-- Tag to replace by the name of the attribute in lower case.

Lower_class_name : STRING is "<CN:L>"
-- Tag to replace by the name of the table in lower case.

Lower_type_name : STRING is "<TN:L>"
-- Tag to replace by the attribute type name (in lowercase).

Tag_close : CHARACTER is '>'
-- Character closing a tag.

Type_default_value : STRING is "<TDV>"
-- Tag to replace by the attribute type default value.

Upper_attribute_name : STRING is "<AN:U>"
-- Tag to replace by the name of the attribute in upper case.

Upper_class_name : STRING is "<CN:U>"
-- Tag to replace by the name of the table in upper case.

Upper_type_name : STRING is "<TN:U>"
-- Tag to replace by the attribute type name (in uppercase).

feature -- Status report

has_all_attribute_option : BOOLEAN
-- Does last parsed tag have the "all attributes" option?

has_all_type_option : BOOLEAN
-- Does last parsed tag have the "all types" option?

has_boolean_type_option : BOOLEAN
-- Does last parsed tag have the "boolean type" option?

has_character_type_option : BOOLEAN
-- Does last parsed tag have the "character type" option?

has_date_type_option : BOOLEAN
-- Does last parsed tag have the "date type" option?

has_double_type_option : BOOLEAN
-- Does last parsed tag have the "double type" option?

has_first_attribute_option : BOOLEAN
-- Does last parsed tag have the "first attribute" option?

has_integer_type_option : BOOLEAN
-- Does last parsed tag have the "integer type" option?

has_intermediate_attribute_option : BOOLEAN
-- Does last parsed tag have the "intermediate attribute" option?

has_last_attribute_option : BOOLEAN
-- Does last parsed tag have the "last attribute" option?

has_string_type_option : BOOLEAN
-- Does last parsed tag have the "string type" option?

is_valid_attribute_tag : BOOLEAN
-- Is last parsed tag a valid attribute tag?

feature -- Status setting

reset
-- Reset status indicators.

feature -- Basic operations

parse_tag (tag: STRING )
-- Parse tag to have information on it.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TEMPLATE_TAGS


cluster eiffelstore.generation.tables_access

 Cluster
eiffelstore.generation.tables_access

Supercluster
eiffelstore.generation

Subclusters
eiffelstore.generation.tables_access.abstract

Classes
DB_TABLE_MANAGER


cluster eiffelstore.generation.tables_access.abstract

 Cluster
eiffelstore.generation.tables_access.abstract

Supercluster
eiffelstore.generation.tables_access

Classes
ABSTRACT_DB_TABLE_MANAGER
DB_TABLE
DB_TABLE_DESCRIPTION
DB_TABLES_ACCESS
DB_TABLES_ACCESS_USE


ABSTRACT_DB_TABLE_MANAGER Chart

 deferred class
ABSTRACT_DB_TABLE_MANAGER

General
cluster: eiffelstore.generation.tables_access.abstract
description: "Abstract interface with a database.It blobbes needs of DB_TABLE_COMPONENT classand descendants."

Ancestors
DB_TABLES_ACCESS_USE

Queries
Case_insensitive : BOOLEAN
Case_sensitive : BOOLEAN
Contains_type : INTEGER
database_result_list : ARRAYED_LIST [ DB_TABLE ]
Equals_type : INTEGER
error_message : STRING
Greater_type : INTEGER
has_error : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
Lower_type : INTEGER
Max_type : INTEGER
Prefix_type : INTEGER
select_query_prepared : BOOLEAN
Suffix_type : INTEGER
tables_set : BOOLEAN
valid_type (type: INTEGER ): BOOLEAN

Commands
add_specific_qualifier (column: INTEGER ; value: STRING ; type: INTEGER ; case: BOOLEAN )
add_value_qualifier (column: INTEGER ; value: STRING )
delete_tablerow (a_tablerow: DB_TABLE )
load_result
prepare_select_with_table (tablecode: INTEGER )
set_id_and_create_tablerow (a_tablerow: DB_TABLE )
update_tablerow (description: DB_TABLE )


ABSTRACT_DB_TABLE_MANAGER Flat contracts

 indexing
description: "Abstract interface with a database.It blobbes needs of DB_TABLE_COMPONENT classand descendants."
author: "Cedric Reduron"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"

deferred class interface
ABSTRACT_DB_TABLE_MANAGER

feature -- Access

Case_insensitive : BOOLEAN is False
-- Selection is case insensitive.

Case_sensitive : BOOLEAN is True
-- Selection is case sensitive.

Contains_type : INTEGER is 5
-- Attribute contains value.

database_result_list : ARRAYED_LIST [ DB_TABLE ]
-- Database result list.
require
no_error: not has_error
ensure
result_not_void: Result /= void

Equals_type : INTEGER is 0
-- Attribute equals value.

Greater_type : INTEGER is 1
-- Attribute is greater than value.

Lower_type : INTEGER is 2
-- Attribute is lower than value.

Max_type : INTEGER is 5
-- Maximum type.

Prefix_type : INTEGER is 3
-- Value is prefix of attribute.

Suffix_type : INTEGER is 4
-- Value is suffix of attribute.

feature -- Status report

error_message : STRING
-- Error message if an error occured during last
-- database operation.

has_error : BOOLEAN
-- Has an error occured during last database operation?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

select_query_prepared : BOOLEAN
-- Is a select query prepared?

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

valid_type (type: INTEGER ): BOOLEAN
-- Is type a valid qualifying type?

feature -- Basic operations: selection

add_specific_qualifier (column: INTEGER ; value: STRING ; type: INTEGER ; case: BOOLEAN )
-- Add qualifier column related to value with type and case.
require
select_query_prepared: select_query_prepared
not_void: value /= void
valid_type: valid_type (type)

add_value_qualifier (column: INTEGER ; value: STRING )
-- Add qualifier column = value to prepared select query.
require
select_query_prepared: select_query_prepared
not_void: value /= void

load_result
-- Load result. Set has_error . Result is available in
-- database_result if result is unique, database_result_list otherwise.
require
select_query_prepared: select_query_prepared

prepare_select_with_table (tablecode: INTEGER )
-- Prepare a simple select query on table with code tablecode.
-- Execute it with load_result_list.
require
is_valid_tablecode: is_valid_code (tablecode)

feature -- Basic operations: update

delete_tablerow (a_tablerow: DB_TABLE )
-- Delete tablerow in the database,
-- i.e. the table row of an_obj table with an_obj ID.
require
not_void: a_tablerow /= void

set_id_and_create_tablerow (a_tablerow: DB_TABLE )
-- Store in the DB object a_tablerow after giving it
-- a valid ID.
require
not_void: a_tablerow /= void

update_tablerow (description: DB_TABLE )
-- Update object with description in the database.
-- Object should already exist and should have kept
-- same ID.
require
not_void: description /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ABSTRACT_DB_TABLE_MANAGER


DB_TABLES_ACCESS Chart

 deferred class
DB_TABLES_ACCESS

General
cluster: eiffelstore.generation.tables_access.abstract
description: "Description of database tables."

Ancestors
ANY

Queries
code_list : ARRAYED_LIST [ INTEGER ]
created : BOOLEAN
description (i: INTEGER ): DB_TABLE_DESCRIPTION
is_valid (code: INTEGER ): BOOLEAN
name_list : ARRAYED_LIST [ STRING ]
obj (i: INTEGER ): DB_TABLE
table_number : INTEGER

Commands
make


DB_TABLES_ACCESS Flat contracts

 indexing
description: "Description of database tables."
author: "Cedric Reduron"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"

deferred class interface
DB_TABLES_ACCESS

feature -- Initialization

make
-- Ensure object unicity.
require
not_created: not created
ensure
created: created

feature -- Access

code_list : ARRAYED_LIST [ INTEGER ]
-- Table code list.

description (i: INTEGER ): DB_TABLE_DESCRIPTION
-- Return description of table with code i.
require
in_range: is_valid (i)

name_list : ARRAYED_LIST [ STRING ]
-- Table name list. Can be interpreted as a list
-- or a hash-table.

obj (i: INTEGER ): DB_TABLE
-- Return instance of table with code i.
require
in_range: is_valid (i)

table_number : INTEGER

feature -- Status report

created : BOOLEAN
-- Is the class object created?

feature -- Facilities

is_valid (code: INTEGER ): BOOLEAN
-- Is code a valid table code?

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TABLES_ACCESS


DB_TABLES_ACCESS_USE Chart

 deferred class
DB_TABLES_ACCESS_USE

General
cluster: eiffelstore.generation.tables_access.abstract
description: "Access to the class DB_TABLES_ACCESS "

Ancestors
ANY

Queries
is_valid_code (code: INTEGER ): BOOLEAN
tables_set : BOOLEAN


DB_TABLES_ACCESS_USE Flat contracts

 indexing
description: "Access to the class DB_TABLES_ACCESS "
author: "Cedric Reduron"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"

deferred class interface
DB_TABLES_ACCESS_USE

feature -- Status report

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TABLES_ACCESS_USE


DB_TABLE_DESCRIPTION Chart

 deferred class
DB_TABLE_DESCRIPTION

General
cluster: eiffelstore.generation.tables_access.abstract
description: "Description of a table."

Ancestors
DB_TABLES_ACCESS_USE

Queries
attribute (code: INTEGER ): ANY
attribute_code_list : ARRAYED_LIST [ INTEGER ]
attribute_list : ARRAYED_LIST [ ANY ]
attribute_number : INTEGER
Boolean_type : INTEGER
Character_type : INTEGER
Date_time_type : INTEGER
description_list : ARRAYED_LIST [ STRING ]
Double_type : INTEGER
id : ANY
id_code : INTEGER
id_name : STRING
Integer_type : INTEGER
is_valid_code (code: INTEGER ): BOOLEAN
mapped_list (action: FUNCTION [ ANY , TUPLE [ STRING ], STRING ]): ARRAYED_LIST [ STRING ]
No_id : INTEGER
printable_attribute (code: INTEGER ): STRING
printable_attribute_list : ARRAYED_LIST [ STRING ]
printable_id : STRING
Printable_type_table : HASH_TABLE [ STRING , INTEGER ]
Real_type : INTEGER
selected_attribute_list (list: ARRAYED_LIST [ INTEGER ]): ARRAYED_LIST [ ANY ]
selected_printable_attribute_list (list: ARRAYED_LIST [ INTEGER ]): ARRAYED_LIST [ STRING ]
String_type : INTEGER
table_code : INTEGER
table_name : STRING
tables_set : BOOLEAN
to_create_fkey_from_table : HASH_TABLE [ INTEGER , INTEGER ]
to_delete_fkey_from_table : HASH_TABLE [ INTEGER , INTEGER ]
type_list : ARRAYED_LIST [ INTEGER ]
valid (code: INTEGER ): BOOLEAN

Commands
make
set_attribute (code: INTEGER ; value: ANY )
set_id (value: ANY )


DB_TABLE_DESCRIPTION Flat contracts

 indexing
description: "Description of a table."
author: "Cedric Reduron"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"

deferred class interface
DB_TABLE_DESCRIPTION

feature -- Initialization

make
-- Enable to ensure unicity of object.

feature -- Status report

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

valid (code: INTEGER ): BOOLEAN
-- Is code a valid attribute code?

feature -- Basic operations

set_attribute (code: INTEGER ; value: ANY )
-- Set attribute with code to value.
-- value must be of type STRING , INTEGER , BOOLEAN , CHARACTER ,
-- DOUBLE or DATE_TIME . References are made automatically from
-- expanded types.
require
valid_code: valid (code)

set_id (value: ANY )
-- Set ID of table row to value.
-- value must be of type STRING , INTEGER
-- (reference created automatically) or DATE_TIME .

feature -- Access (table description)

attribute_code_list : ARRAYED_LIST [ INTEGER ]
-- Feature code list.

attribute_number : INTEGER
-- Number of attributes in the table.

Boolean_type : INTEGER is 3

Character_type : INTEGER is 2

Date_time_type : INTEGER is 21

description_list : ARRAYED_LIST [ STRING ]
-- Feature name list. Can be interpreted as a list
-- or a hash-table.

Double_type : INTEGER is 6

id_code : INTEGER
-- Table ID attribute code.

id_name : STRING
-- Table ID attribute name.

Integer_type : INTEGER is 4

No_id : INTEGER is 0
-- Id_code value when no ID exists or ID constraint is not
-- located to a single attribute.

printable_type_table : HASH_TABLE [ STRING , INTEGER ]
-- Default string associated to attributes possible
-- types.

Real_type : INTEGER is 5

String_type : INTEGER is 20

table_code : INTEGER
-- Eiffel table code, matches IDs definition in LOG_TABLE.

table_name : STRING
-- Database table name.

to_create_fkey_from_table : HASH_TABLE [ INTEGER , INTEGER ]
-- List of associated necessary tables and the
-- linking foreign keys.
-- Creation on this table may imply creations on
-- associated necessary tables.

to_delete_fkey_from_table : HASH_TABLE [ INTEGER , INTEGER ]
-- List of tables depending on this one and their
-- foreign key for this table.
-- Deletion on this table may imply deletions on
-- depending tables.

type_list : ARRAYED_LIST [ INTEGER ]
-- Feature type list. Can be interpreted as a list
-- or a hash-table.

feature -- Access (table row values)

attribute (code: INTEGER ): ANY
-- Value of attribute with code.
require
valid_code: valid (code)

attribute_list : ARRAYED_LIST [ ANY ]
-- Table row attribute values.
ensure
not_void: Result /= void

id : ANY
-- Table row ID.

mapped_list (action: FUNCTION [ ANY , TUPLE [ STRING ], STRING ]): ARRAYED_LIST [ STRING ]
-- Feature list mapped with action.
-- This can be useful to create tags or parameter names.

printable_attribute (code: INTEGER ): STRING
-- String value of attribute with code.
require
valid_code: valid (code)
ensure
result_not_void: Result /= void

printable_attribute_list : ARRAYED_LIST [ STRING ]
-- Table row attribute string values.
ensure
not_void: Result /= void

printable_id : STRING
-- String value of table row ID.

selected_attribute_list (list: ARRAYED_LIST [ INTEGER ]): ARRAYED_LIST [ ANY ]
-- Table row attribute values which codes are in list.
require
not_void: list /= void
ensure
not_void: Result /= void

selected_printable_attribute_list (list: ARRAYED_LIST [ INTEGER ]): ARRAYED_LIST [ STRING ]
-- Table row attribute values which codes are in list.
require
not_void: list /= void
ensure
not_void: Result /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TABLE_DESCRIPTION


DB_TABLE Chart

 deferred class
DB_TABLE

General
cluster: eiffelstore.generation.tables_access.abstract
description: "Element representing a database table"

Ancestors
DB_TABLES_ACCESS_USE

Queries
is_valid_code (code: INTEGER ): BOOLEAN
table_description : DB_TABLE_DESCRIPTION
tables_set : BOOLEAN

Commands
make
set_default


DB_TABLE Flat contracts

 indexing
description: "Element representing a database table"
author: "Cedric Reduron"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"

deferred class interface
DB_TABLE

feature -- Initialization

make
-- Create all the attributes.

set_default
-- Sets object default values.
-- WARNING: Default primary and foreign key values
-- MUST NOT be valid database values!

feature -- Access

table_description : DB_TABLE_DESCRIPTION

feature -- Status report

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TABLE


DB_TABLE_MANAGER Chart

 class
DB_TABLE_MANAGER

General
cluster: eiffelstore.generation.tables_access
description: "Database Manager using database structure description."
create: make

Ancestors
ABSTRACT_DB_TABLE_MANAGER

Queries
Case_insensitive : BOOLEAN
Case_sensitive : BOOLEAN
Contains_type : INTEGER
database_result : DB_TABLE
database_result_list : ARRAYED_LIST [ DB_TABLE ]
Equals_type : INTEGER
error_message : STRING
Greater_type : INTEGER
has_error : BOOLEAN
is_connected : BOOLEAN
is_id_selection : BOOLEAN
is_valid_code (code: INTEGER ): BOOLEAN
like_type (type: INTEGER ): BOOLEAN
load_data_with_select (s: STRING ): ANY
load_list_with_query_and_tablecode (query: STRING ; tablecode: INTEGER ): ARRAYED_LIST [ DB_TABLE ]
Lower_type : INTEGER
Max_type : INTEGER
new_id_for_tablerow (table_descr: DB_TABLE_DESCRIPTION ): ANY
Prefix_type : INTEGER
select_qualifiers : STRING
select_query : STRING
select_query_prepared : BOOLEAN
Suffix_type : INTEGER
tables_set : BOOLEAN
valid_type (type: INTEGER ): BOOLEAN

Commands
add_qualifier (value: STRING )
add_specific_qualifier (column: INTEGER ; value: STRING ; type: INTEGER ; case_sens: BOOLEAN )
add_value_qualifier (column: INTEGER ; value: STRING )
commit
create_item (an_obj: DB_TABLE )
create_item_with_id (an_obj: DB_TABLE )
delete_item (an_obj: DB_TABLE )
delete_tablerow (an_obj: DB_TABLE )
disconnect
establish_connection
execute_query (query: STRING )
load_result
make (dbm: DATABASE_MANAGER [ DATABASE ])
prepare_select_with_table (tablecode: INTEGER )
remove_order_by
remove_qualifiers
set_all_columns
set_columns (cols: ARRAYED_LIST [ INTEGER ])
set_connection_information (user_name, password, data_source: STRING )
set_id_and_create_tablerow (an_obj: DB_TABLE )
set_id_qualifier (id_value: STRING )
set_multiple_order_by (column_list: ARRAYED_LIST [ INTEGER ])
set_order_by (column: INTEGER )
set_table (tablecode: INTEGER )
update_tablerow (tablerow: DB_TABLE )


DB_TABLE_MANAGER Flat contracts

 indexing
description: "Database Manager using database structure description."
author: "Cedric Reduron"
date: "$Date: 2001/06/14 00:28:20 $"
revision: "$Revision: 1.1 $"

class interface
DB_TABLE_MANAGER

create

make (dbm: DATABASE_MANAGER [ DATABASE ])
-- Set dbm to manage database
-- interactions.
require
database_manager_not_void: dbm /= void

feature -- Initialization

make (dbm: DATABASE_MANAGER [ DATABASE ])
-- Set dbm to manage database
-- interactions.
require
database_manager_not_void: dbm /= void

feature -- Access

Case_insensitive : BOOLEAN is False
-- Selection is case insensitive.
-- (from ABSTRACT_DB_TABLE_MANAGER )

Case_sensitive : BOOLEAN is True
-- Selection is case sensitive.
-- (from ABSTRACT_DB_TABLE_MANAGER )

Contains_type : INTEGER is 5
-- Attribute contains value.
-- (from ABSTRACT_DB_TABLE_MANAGER )

database_result : DB_TABLE
-- Database unique result. Selection should
-- have been qualified with ID.
require
no_error: not has_error
is_id_selection: is_id_selection

database_result_list : ARRAYED_LIST [ DB_TABLE ]
-- Database result list.
require -- from ABSTRACT_DB_TABLE_MANAGER
no_error: not has_error
ensure -- from ABSTRACT_DB_TABLE_MANAGER
result_not_void: Result /= void

Equals_type : INTEGER is 0
-- Attribute equals value.
-- (from ABSTRACT_DB_TABLE_MANAGER )

Greater_type : INTEGER is 1
-- Attribute is greater than value.
-- (from ABSTRACT_DB_TABLE_MANAGER )

Lower_type : INTEGER is 2
-- Attribute is lower than value.
-- (from ABSTRACT_DB_TABLE_MANAGER )

Max_type : INTEGER is 5
-- Maximum type.
-- (from ABSTRACT_DB_TABLE_MANAGER )

Prefix_type : INTEGER is 3
-- Value is prefix of attribute.
-- (from ABSTRACT_DB_TABLE_MANAGER )

select_qualifiers : STRING
-- Qualifying clause of current SQL query.

select_query : STRING
-- Select query to execute. Execute with load_result_list.
require
select_query_prepared: select_query_prepared

Suffix_type : INTEGER is 4
-- Value is suffix of attribute.
-- (from ABSTRACT_DB_TABLE_MANAGER )

feature -- Status report

error_message : STRING
-- Error message if an error occured during last
-- database operation.

has_error : BOOLEAN
-- Has an error occured during last database operation?

is_connected : BOOLEAN
-- Is the application connected to a database?

is_id_selection : BOOLEAN
-- Is prepared select query qualified with ID?

is_valid_code (code: INTEGER ): BOOLEAN
-- Does code represents a database table?
-- (from DB_TABLES_ACCESS_USE )

like_type (type: INTEGER ): BOOLEAN
-- Does type require a SQL query using 'like'?

select_query_prepared : BOOLEAN
-- Is a select query prepared?

tables_set : BOOLEAN
-- Is abstract description of database tables
-- set?
-- (from DB_TABLES_ACCESS_USE )

valid_type (type: INTEGER ): BOOLEAN
-- Is type a valid qualifying type?
-- (from ABSTRACT_DB_TABLE_MANAGER )

feature -- Basic operations

add_qualifier (value: STRING )
-- Add qualifier value to prepared select query.
require
select_query_prepared: select_query_prepared

add_specific_qualifier (column: INTEGER ; value: STRING ; type: INTEGER ; case_sens: BOOLEAN )
-- Add qualifier column related to value with type and case.
-- 'LIKE' predicates are implemented by both Oracle and ODBC with '%' and '_' wild
-- card characters.
-- Case sensitiveness can only be specified for Oracle. ODBC set case sensitiveness
-- directly on database columns.
require -- from ABSTRACT_DB_TABLE_MANAGER
select_query_prepared: select_query_prepared
not_void: value /= void
valid_type: valid_type (type)

add_value_qualifier (column: INTEGER ; value: STRING )
-- Add qualifier column = value to prepared select query.
require -- from ABSTRACT_DB_TABLE_MANAGER
select_query_prepared: select_query_prepared
not_void: value /= void

load_result
-- Load result. Set has_error . Result is available in
-- database_result if result is unique, database_result_list otherwise.
require -- from ABSTRACT_DB_TABLE_MANAGER
select_query_prepared: select_query_prepared

prepare_select_with_table (tablecode: INTEGER )
-- Prepare a simple select query on table with code tablecode.
-- Execute it with load_result_list.
require -- from ABSTRACT_DB_TABLE_MANAGER
is_valid_tablecode: is_valid_code (tablecode)

remove_order_by
-- Remove order by from current prepared select query.
require
select_query_prepared: select_query_prepared

remove_qualifiers
-- Remove all qualifiers of prepared select query.
require
select_query_prepared: select_query_prepared
ensure
is_not_id_selection: not is_id_selection

set_all_columns
-- Select all columns for prepared select query.
require
select_query_prepared: select_query_prepared

set_columns (cols: ARRAYED_LIST [ INTEGER ])
-- Set cols as result columns of prepared select query.
-- Don't change other select query parameters.
require
select_query_prepared: select_query_prepared

set_id_qualifier (id_value: STRING )
-- Prepared select query will select table row with id id_value.
ensure
is_id_selection: is_id_selection

set_multiple_order_by (column_list: ARRAYED_LIST [ INTEGER ])
-- Order result by attribute of code column.
require
select_query_prepared: select_query_prepared
column_list_not_void: column_list /= void

set_order_by (column: INTEGER )
-- Order result by attribute of code column.
require
select_query_prepared: select_query_prepared

set_table (tablecode: INTEGER )
-- Set table with code tablecode as result table of prepared select query.
-- Don't change other select query parameters.
require
select_query_prepared: select_query_prepared
is_valid_code: is_valid_code (tablecode)

feature -- Commitment

commit
-- Commit changes in the database.

feature -- Connection

disconnect
-- Disconnect from database.
require
is_connected: is_connected

establish_connection
-- Establish connection to database.
ensure
not_void: session_control /= void

set_connection_information (user_name, password, data_source: STRING )
-- Set database connection information: user_name, password
-- and data_source.
require
not_void: user_name /= void and password /= void and data_source /= void

feature -- Creation

create_item (an_obj: DB_TABLE )
-- Store in the DB object an_obj.

create_item_with_id (an_obj: DB_TABLE )
-- Store in the DB object an_obj after giving it
-- a valid ID.
-- Was declared in DB_TABLE_MANAGER as synonym of set_id_and_create_tablerow .

new_id_for_tablerow (table_descr: DB_TABLE_DESCRIPTION ): ANY
-- Next available ID for table described by table_descr.
require
not_void: table_descr /= void

set_id_and_create_tablerow (an_obj: DB_TABLE )
-- Store in the DB object an_obj after giving it
-- a valid ID.
-- Was declared in DB_TABLE_MANAGER as synonym of create_item_with_id .
require -- from ABSTRACT_DB_TABLE_MANAGER
not_void: a_tablerow /= void

feature -- Deletion

delete_item (an_obj: DB_TABLE )
-- Delete an_obj in the database, i.e.
-- the table row of an_obj table with an_obj ID.

delete_tablerow (an_obj: DB_TABLE )
-- Delete an_obj in the database,
-- i.e. the table row of an_obj table with an_obj ID.
require -- from ABSTRACT_DB_TABLE_MANAGER
not_void: a_tablerow /= void

feature -- General command

execute_query (query: STRING )
-- Execute SQL query and commit changes.
require
not_void: query /= void

feature -- Queries

load_data_with_select (s: STRING ): ANY
-- Load directly an integer value from the database.
require
meaningful_select: s /= void

load_list_with_query_and_tablecode (query: STRING ; tablecode: INTEGER ): ARRAYED_LIST [ DB_TABLE ]
-- Load list of table rows from query. Table rows type is
-- table of code tablecode.
require
is_valid_code: is_valid_code (tablecode)

feature -- Update

update_tablerow (tablerow: DB_TABLE )
-- Update item with description in database.
require -- from ABSTRACT_DB_TABLE_MANAGER
not_void: description /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TABLE_MANAGER


cluster eiffelstore.install

 Cluster
eiffelstore.install

Supercluster
eiffelstore


cluster eiffelstore.interface

 Cluster
eiffelstore.interface

Supercluster
eiffelstore

Classes
DB_ALL_TYPES
DB_CHANGE
DB_CONTROL
DB_DATA
DB_DATA_SQL
DB_DYN_CHANGE
DB_DYN_SELECTION
DB_EXPRESSION
DB_PROC
DB_REPOSITORY
DB_RESULT
DB_SELECTION
DB_STORE
DB_TUPLE
DB_TYPE


DB_ALL_TYPES Chart

 class
DB_ALL_TYPES

General
cluster: eiffelstore.interface
create: make

Ancestors
HANDLE_USE

Queries
db_type (object: ANY ): DB_TYPE
is_registered (object: ANY ): BOOLEAN

Commands
make

Constraints
implementation not void


DB_ALL_TYPES Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
product: "EiffelStore"
database: "All bases"

class interface
DB_ALL_TYPES

create

make
-- Create an interface object to register
-- all types for active base.

feature -- Initialization

make
-- Create an interface object to register
-- all types for active base.

feature -- Access

db_type (object: ANY ): DB_TYPE
-- DB_TYPE instance of object
require
object_not_void: object /= void
object_is_register: is_registered (object)
ensure
Result = implementation . db_type (object)

feature -- Status report

is_registered (object: ANY ): BOOLEAN
-- Is object type registered?
require
object_not_void: object /= void
ensure
Result = implementation . is_registered (object)

invariant

implementation_not_void: implementation /= void
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_ALL_TYPES


DB_CHANGE Chart

 class
DB_CHANGE

General
cluster: eiffelstore.interface
create: make

Ancestors
DB_CONSTANT
DB_EXEC_USE
DB_EXPRESSION
DB_STATUS_USE

Queries
is_connected : BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_ok : BOOLEAN
last_parsed_query : STRING
last_query : STRING
mapped_value (key: STRING ): ANY

Commands
clear_all
execute_query
modify (request: STRING )
set_map_name (n: ANY ; key: STRING )
set_query (query: STRING )
set_trace
unset_map_name (key: STRING )


DB_CHANGE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
access: change, modify, update, insert, delete
product: eiffelstore
database: all_bases

class interface
DB_CHANGE

create

make
-- Create an interface object to change active base.

feature -- Access

last_parsed_query : STRING
-- Last parsed SQL query

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status report

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
-- (from STRING_HDL )
require -- from STRING_HDL
keys_exists: key /= void

last_query : STRING
-- Last SQL statement used
-- (from DB_EXPRESSION )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

feature -- Status setting

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

feature -- Status setting

clear_all
-- Remove all mapped keys.
-- (from STRING_HDL )

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

set_query (query: STRING )
-- Set last_query with query.
-- (from DB_EXPRESSION )
require -- from DB_EXPRESSION
query_not_void: query /= void
ensure -- from DB_EXPRESSION
last_query_changed: last_query = query

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- Basic operations

execute_query
-- Execute modify with last_query .
require -- from DB_EXPRESSION
last_query_not_void: last_query /= void

modify (request: STRING )
-- Execute request to modify persistent objects.
-- When using the DBMS layer the request must be
-- SQL-like compliant.
require
connected: is_connected
request_exists: request /= void
is_ok: is_ok
ensure
last_query_changed: last_query = request

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_CHANGE


DB_CONTROL Chart

 class
DB_CONTROL

General
cluster: eiffelstore.interface
create: make

Ancestors
DB_EXEC_USE
DB_STATUS_USE
NUMERIC_NULL_VALUE

Queries
error_code : INTEGER
error_message : STRING
exhausted : BOOLEAN
immediate_execution : BOOLEAN
is_connected : BOOLEAN
is_ok : BOOLEAN
is_tracing : BOOLEAN
numeric_null_value : DOUBLE
trace_output : FILE
transaction_count : INTEGER
warning_message : STRING

Commands
begin
commit
connect
disconnect
raise_error
reset
rollback
set_immediate
set_numeric_null_value (a_value: DOUBLE )
set_trace
unset_immediate
unset_trace


DB_CONTROL Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_CONTROL

create

make
-- Create an interface objet to control the active base.

feature -- Access

numeric_null_value : DOUBLE
-- Default value set to integer, double or real field instead of NULL.
-- Real and integer values are TRUNCATED.
-- (from NUMERIC_NULL_VALUE )

set_numeric_null_value (a_value: DOUBLE )
-- Set a_value to the default numeric NULL value.
-- (from NUMERIC_NULL_VALUE )

feature -- Status report

transaction_count : INTEGER
-- Number of started transactions
require
connection_exists: is_connected

feature -- Status report

error_code : INTEGER
-- Error code of last transaction
-- (from DB_STATUS_USE )

error_message : STRING
-- SQL error message prompted by database server
-- (from DB_STATUS_USE )

exhausted : BOOLEAN
-- Is there any more resulting row?
-- (from DB_STATUS_USE )

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

warning_message : STRING
-- SQL warning message prompted by database server
-- (from DB_STATUS_USE )

feature -- Status setting

reset
-- Reset is_ok , error_code_stored,error_message_stored and warning_message after error occurred.
-- (from DB_STATUS_USE )
ensure -- from DB_STATUS_USE
is_ok: is_ok
no_error: error_code = 0
no_message_error: error_message . is_equal ("")
no_message_warning: warning_message . is_equal ("")

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Basic operations

begin
-- Start a new transaction.
require
connection_exists: is_connected

commit
-- Commit work.
require
connection_exists: is_connected
transaction_exists: transaction_count >= 0

connect
-- Connect to database.
require
not_already_connected: not is_connected
ensure
not is_ok or else is_connected

disconnect
-- Disconnect from database.
require
connection_exists: is_connected
ensure
no_connection: not is_connected
all_transaction_ended: transaction_count = 0

raise_error
-- Prompt error code and error message on standard output.

rollback
-- Rollback work.
require
connection_exists: is_connected
transaction_exists: transaction_count >= 0

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_CONTROL


DB_DATA Chart

 class
DB_DATA

General
cluster: eiffelstore.interface

Ancestors
ANY

Queries
metadata_to_update : BOOLEAN

Commands
update_metadata


DB_DATA Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_DATA

feature -- Status report

metadata_to_update : BOOLEAN
-- Should cursor update the metadata to fill in database
-- values properly?

feature -- Status setting

update_metadata
-- Cursor must update database metadata to
-- fill in properly.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_DATA


DB_DATA_SQL Chart

 deferred class
DB_DATA_SQL

General
cluster: eiffelstore.interface

Ancestors
DB_DATA

Queries
column_name (index: INTEGER ): STRING
count : INTEGER
item (index: INTEGER ): ANY
map_table : ARRAY [ INTEGER ]
metadata_to_update : BOOLEAN

Commands
fill_in (no_descriptor: INTEGER )
update_map_table (object: ANY )
update_metadata


DB_DATA_SQL Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
access: sql, structure
product: eiffelstore
database: rdbms

deferred class interface
DB_DATA_SQL

feature -- Status report

column_name (index: INTEGER ): STRING
-- Name of the index-th column

count : INTEGER
-- Number of columns in result

item (index: INTEGER ): ANY
-- Data at index-th column

map_table : ARRAY [ INTEGER ]
-- Correspondance table between column
-- rank and attribute rank in mapped object

metadata_to_update : BOOLEAN
-- Should cursor update the metadata to fill in database
-- values properly?
-- (from DB_DATA )

feature -- Status setting

fill_in (no_descriptor: INTEGER )
-- Fill in attributes of Current with results obtained
-- from server after execution of query statement.

update_map_table (object: ANY )
-- Update map table according to field names of object.

update_metadata
-- Cursor must update database metadata to
-- fill in properly.
-- (from DB_DATA )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_DATA_SQL


DB_DYN_CHANGE Chart

 class
DB_DYN_CHANGE

General
cluster: eiffelstore.interface
description: " DB_CHANGE for dynamic sql"
create: make

Ancestors
DB_CHANGE
PARAMETER_HDL

Queries
is_allocatable : BOOLEAN
is_connected : BOOLEAN
is_executed : BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_ok : BOOLEAN
is_prepared : BOOLEAN
last_parsed_query : STRING
last_query : STRING
mapped_value (key: STRING ): ANY
parameter_count : INTEGER
parameter_name_exist (key: STRING ): BOOLEAN

Commands
bind_parameter
clear_all
execute
execute_query
make
modify (request: STRING )
prepare (s: STRING )
set_executed (b: BOOLEAN )
set_map_name (n: ANY ; key: STRING )
set_parameter (value: ANY ; key: STRING )
set_parameters_value (p: ARRAY [ ANY ])
set_prepared (b: BOOLEAN )
set_query (query: STRING )
set_trace
setup_parameters
terminate
unset_map_name (key: STRING )


DB_DYN_CHANGE Flat contracts

 indexing
description: " DB_CHANGE for dynamic sql"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"

class interface
DB_DYN_CHANGE

create

make
-- Creation routine

feature -- Initialization

make
-- Creation routine

feature -- Access

last_parsed_query : STRING
-- Last parsed SQL query
-- (from DB_CHANGE )

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status report

is_executed : BOOLEAN
-- Is the statement has been executed ?
-- (from PARAMETER_HDL )

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity ?
-- (from PARAMETER_HDL )
require -- from STRING_HDL
keys_exists: key /= void

is_prepared : BOOLEAN
-- Is the statement has been prepared ?
-- (from PARAMETER_HDL )

last_query : STRING
-- Last SQL statement used
-- (from DB_EXPRESSION )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

parameter_name_exist (key: STRING ): BOOLEAN
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
not_void: key /= void

feature -- Status setting

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

feature -- Status setting

set_query (query: STRING )
-- Set last_query with query.
-- (from DB_EXPRESSION )
require -- from DB_EXPRESSION
query_not_void: query /= void
ensure -- from DB_EXPRESSION
last_query_changed: last_query = query

feature -- Element change

bind_parameter
-- Bind of the prarameters of the sql statement
require
prepared_statement: is_prepared

execute
-- Execute the sql statement
require
prepare_statement: is_prepared

parameter_count : INTEGER
ensure -- from PARAMETER_HDL
Result > 0 implies is_prepared

prepare (s: STRING )
-- Parse of the sql statement s
require
not_void: s /= void
meaning_full_sql: s. count > 0
is_ok: is_ok
is_allocatable: is_allocatable
ensure
prepared_statement: is_prepared

feature -- Basic operations

execute_query
-- Execute modify with last_query .
-- (from DB_CHANGE )
require -- from DB_EXPRESSION
last_query_not_void: last_query /= void

modify (request: STRING )
-- Execute request to modify persistent objects.
-- When using the DBMS layer the request must be
-- SQL-like compliant.
-- (from DB_CHANGE )
require -- from DB_CHANGE
connected: is_connected
request_exists: request /= void
is_ok: is_ok
ensure -- from DB_CHANGE
last_query_changed: last_query = request

feature

clear_all
-- (from PARAMETER_HDL )

set_map_name (n: ANY ; key: STRING )
-- Store item n whith key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- Basic Operations

terminate

feature -- Status Report

is_allocatable : BOOLEAN

feature -- setting

set_executed (b: BOOLEAN )
-- (from PARAMETER_HDL )

set_parameter (value: ANY ; key: STRING )
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
key_not_void: key /= void
has_parameters: parameter_count > 0

set_parameters_value (p: ARRAY [ ANY ])
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
has_parameters: parameter_count > 0

set_prepared (b: BOOLEAN )
-- (from PARAMETER_HDL )

setup_parameters
-- setup parameters_value with actual parameters value
-- (from PARAMETER_HDL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_DYN_CHANGE


DB_DYN_SELECTION Chart

 class
DB_DYN_SELECTION

General
cluster: eiffelstore.interface
description: " DB_SELECTION for dynamic sql"
create: make

Ancestors
DB_SELECTION
DB_SELECTION
PARAMETER_HDL

Queries
after : BOOLEAN
container : LIST [ DB_RESULT ]
cursor : DB_RESULT
immediate_execution : BOOLEAN
is_allocatable : BOOLEAN
is_connected : BOOLEAN
is_executed : BOOLEAN
is_exiting : BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_ok : BOOLEAN
is_prepared : BOOLEAN
is_tracing : BOOLEAN
last_parsed_query : STRING
last_query : STRING
mapped_value (key: STRING ): ANY
object : ANY
parameter_count : INTEGER
parameter_name_exist (key: STRING ): BOOLEAN
stop_condition : ACTION
trace_output : FILE

Commands
bind_parameter
clear_all
cursor_to_object
execute
execute_query
forth
load_result
make
next
no_object_convert
object_convert (reference: ANY )
prepare (s: STRING )
query (s: STRING )
reset_cursor (c: DB_RESULT )
set_action (action: ACTION )
set_container (one_container: [like container ] LIST [ DB_RESULT ])
set_executed (b: BOOLEAN )
set_immediate
set_map_name (n: ANY ; key: STRING )
set_parameter (value: ANY ; key: STRING )
set_parameters_value (p: ARRAY [ ANY ])
set_prepared (b: BOOLEAN )
set_query (query: STRING )
set_trace
setup_parameters
start
terminate
unset_action
unset_container
unset_immediate
unset_map_name (key: STRING )
unset_trace
wipe_out


DB_DYN_SELECTION Flat contracts

 indexing
description: " DB_SELECTION for dynamic sql"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"

class interface
DB_DYN_SELECTION

create

make
-- Create an interface objet to query active base.

feature -- Initialization

make
-- Create an interface objet to query active base.

feature -- Access

last_parsed_query : STRING
-- Last parsed SQL query
-- (from DB_SELECTION )

feature -- Status report

after : BOOLEAN
-- Is the container after?
-- (from DB_SELECTION )
require -- from DB_SELECTION
container_exists: container /= void

container : LIST [ DB_RESULT ]
-- Stored cursors.
-- (from DB_SELECTION )

cursor : DB_RESULT
-- Cursor pointing to last fetched query result
-- (from DB_SELECTION )

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

is_allocatable : BOOLEAN
-- Can Current be added to other concurrently opened selections?
-- (from DB_SELECTION )

is_executed : BOOLEAN
-- Is the statement has been executed ?
-- (from PARAMETER_HDL )

is_exiting : BOOLEAN
-- Is exit condition of load_result iteration loop met?
-- (from DB_SELECTION )
ensure -- from DB_SELECTION
Result implies ( not is_ok or else exhausted or else ( stop_condition /= void and then stop_condition . found ))

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity ?
-- (from PARAMETER_HDL )
require -- from STRING_HDL
keys_exists: key /= void

is_prepared : BOOLEAN
-- Is the statement has been prepared ?
-- (from PARAMETER_HDL )

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

last_query : STRING
-- Last SQL statement used
-- (from DB_EXPRESSION )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object : ANY
-- Eiffel object to be filled in by cursor_to_object
-- (from DB_SELECTION )

parameter_name_exist (key: STRING ): BOOLEAN
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
not_void: key /= void

stop_condition : ACTION
-- Object providing an execute routine called
-- after each load_result iteration step
-- (from DB_SELECTION )

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status setting

cursor_to_object
-- Assign object attributes with cursor field values.
-- (from DB_SELECTION )
require -- from DB_SELECTION
cursor_exists: cursor /= void
object_exists: object /= void

forth
-- Move cursor to next element of container .
-- (from DB_SELECTION )
require else -- from DB_SELECTION
container_exists: container /= void
ensure then -- from DB_SELECTION
container_index_moved: container . index = old container . index + 1
cursor_updated: not after implies cursor = container . item

no_object_convert
-- Do not transform cursor into an Eiffel object
-- while reading in selection results.
-- (from DB_SELECTION )
ensure -- from DB_SELECTION
object = void

object_convert (reference: ANY )
-- Set object with reference, reference to an Eiffel
-- object to be filled in with cursor field values.
-- (from DB_SELECTION )
require -- from DB_SELECTION
reference_exists: reference /= void
ensure -- from DB_SELECTION
object_set: object = reference

reset_cursor (c: DB_RESULT )
-- Reset cursor with c.
-- (from DB_SELECTION )
require -- from DB_SELECTION
arguments_exists: c /= void
connected: is_connected
ensure -- from DB_SELECTION
cursor_reset: cursor = c

set_action (action: ACTION )
-- Set stop_condition with action.
-- (from DB_SELECTION )
require -- from DB_SELECTION
action_exists: action /= void
ensure -- from DB_SELECTION
stop_condition_set: stop_condition = action

set_container (one_container: like container )
-- Make results of selection query persist in container.
-- (from DB_SELECTION )
require -- from DB_SELECTION
container_exists: one_container /= void
ensure -- from DB_SELECTION
container_set: container = one_container

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_query (query: STRING )
-- Set last_query with query .
-- (from DB_EXPRESSION )
require -- from DB_EXPRESSION
query_not_void: query /= void
ensure -- from DB_EXPRESSION
last_query_changed: last_query = query

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

start
-- Set cursor on first element of container .
-- (from DB_SELECTION )
require else -- from DB_SELECTION
container_exists: container /= void
ensure then -- from DB_SELECTION
container_on_first: container . isfirst
cursor_updated: cursor = container . item

unset_action
-- Reset stop_condition to Void.
-- (from DB_SELECTION )
ensure -- from DB_SELECTION
stop_condition_void: stop_condition = void

unset_container
-- Do not store in container results of selection.
-- (from DB_SELECTION )
require -- from DB_SELECTION
container_exists: container /= void
ensure -- from DB_SELECTION
container_is_void: container = void

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Element change

bind_parameter
-- Bind of the parameters of the sql statement
require
prepared_statement: is_prepared

execute
-- Execute the sql statement
require
prepared_statement: is_prepared
ensure
prepared_statement: is_executed

parameter_count : INTEGER
ensure -- from PARAMETER_HDL
Result > 0 implies is_prepared

prepare (s: STRING )
-- Parse of the sql statement s
require
not_void: s /= void
meaning_full_statement: s. count > 0
is_ok: is_ok
is_allocatable: is_allocatable
ensure
prepared_statement: is_prepared
prepared_statement: not is_executed

feature -- Basic operations

execute_query
-- Execute query with last_query .
-- (from DB_SELECTION )
require -- from DB_EXPRESSION
last_query_not_void: last_query /= void

load_result
-- Iterate through selection results,
-- load container if requested and call action routine
-- for each iteration step until exit_condition is met.
-- (from DB_SELECTION )
require -- from DB_SELECTION
connected: is_connected
is_ok: is_ok
ensure -- from DB_SELECTION
cursor_not_void: cursor /= void
exit_condition_met: is_exiting

next
-- Move to next element matching the query.
-- (from DB_SELECTION )
require -- from DB_SELECTION
connected: is_connected

query (s: STRING )
-- Select stored objects using s and make
-- them retrievable using load_result .
-- (from DB_SELECTION )
require -- from DB_SELECTION
connected: is_connected
argument_exists: s /= void
argument_is_not_empty: not s. is_empty
is_ok: is_ok
is_allocatable: is_allocatable
ensure -- from DB_SELECTION
last_query_changed: last_query = s

terminate
-- Clear database cursor.
-- (from DB_SELECTION )
require -- from DB_SELECTION
connected: is_connected
ensure -- from DB_SELECTION
is_allocatable: is_allocatable

wipe_out
-- Clear selection results.
-- (from DB_SELECTION )
ensure -- from DB_SELECTION
container_is_empty: container /= void implies container . is_empty
object_model_void: object = void
cursor_void: cursor = void

feature

clear_all
-- (from PARAMETER_HDL )

set_map_name (n: ANY ; key: STRING )
-- Store item n whith key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from PARAMETER_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- setting

set_executed (b: BOOLEAN )
-- (from PARAMETER_HDL )

set_parameter (value: ANY ; key: STRING )
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
key_not_void: key /= void
has_parameters: parameter_count > 0

set_parameters_value (p: ARRAY [ ANY ])
-- (from PARAMETER_HDL )
require -- from PARAMETER_HDL
has_parameters: parameter_count > 0

set_prepared (b: BOOLEAN )
-- (from PARAMETER_HDL )

setup_parameters
-- setup parameters_value with actual parameters value
-- (from PARAMETER_HDL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from DB_SELECTION
last_cursor_in_container: container /= void and then not container . is_empty implies container . has ( cursor )

end -- class DB_DYN_SELECTION


DB_EXPRESSION Chart

 deferred class
DB_EXPRESSION

General
cluster: eiffelstore.interface

Ancestors
STRING_HDL

Queries
is_mapped (key: STRING ): BOOLEAN
last_query : STRING
mapped_value (key: STRING ): ANY

Commands
clear_all
execute_query
set_map_name (n: ANY ; key: STRING )
set_query (query: STRING )
unset_map_name (key: STRING )


DB_EXPRESSION Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: "EiffelStore"
database: "All bases"

deferred class interface
DB_EXPRESSION

feature -- Status report

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
-- (from STRING_HDL )
require -- from STRING_HDL
keys_exists: key /= void

last_query : STRING
-- Last SQL statement used

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

feature -- Status setting

clear_all
-- Remove all mapped keys.
-- (from STRING_HDL )

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

set_query (query: STRING )
-- Set last_query with query.
require
query_not_void: query /= void
ensure
last_query_changed: last_query = query

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- Basic operations

execute_query
-- Execute last_query .
require
last_query_not_void: last_query /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_EXPRESSION


DB_PROC Chart

 class
DB_PROC

General
cluster: eiffelstore.interface
create: make

Ancestors
DB_EXEC_USE
DB_STATUS_USE

Queries
arguments_name : ARRAY [ STRING ]
arguments_set : BOOLEAN
arguments_type : ARRAY [ ANY ]
exists : BOOLEAN
immediate_execution : BOOLEAN
is_connected : BOOLEAN
is_ok : BOOLEAN
is_tracing : BOOLEAN
loaded : BOOLEAN
name : STRING
text : STRING
trace_output : FILE

Commands
change_name (new_name: STRING )
drop
execute (destination: DB_EXPRESSION )
execute_string (destination: DB_EXPRESSION ; sql: STRING )
load
make (a_name: STRING )
set_arguments (args_name: [like arguments_name ] ARRAY [ STRING ]; args_type: [like arguments_type ] ARRAY [ ANY ])
set_immediate
set_no_arguments
set_trace
store (sql: STRING )
unset_immediate
unset_trace

Constraints
implementation not void
load and exists


DB_PROC Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: "EiffelStore"
database: "All bases"

class interface
DB_PROC

create

make (a_name: STRING )
-- Create an interface object to create
-- and execute stored procedure.
require
a_name_not_void: a_name /= void
ensure
name_equal: name . is_equal (a_name)

feature -- Initialization

make (a_name: STRING )
-- Create an interface object to create
-- and execute stored procedure.
require
a_name_not_void: a_name /= void
ensure
name_equal: name . is_equal (a_name)

feature -- Status report

arguments_name : ARRAY [ STRING ]
-- Argument names

arguments_set : BOOLEAN
-- Have arguments been set?
ensure
Result = ( arguments_name /= void and arguments_type /= void )

arguments_type : ARRAY [ ANY ]
-- Argument types

exists : BOOLEAN
-- Does current procedure exist in server?
require
loaded: loaded

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

loaded : BOOLEAN
-- Is current procedure loaded?

name : STRING
-- Procedure name

text : STRING
-- SQL text of current procedure
require
exists: exists
ensure
result_not_void: Result /= void

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status setting

change_name (new_name: STRING )
-- Change procedure name with new_name.
require
new_name_not_void: new_name /= void
ensure
new_name. is_equal ( name )
not_loaded: not loaded

set_arguments (args_name: like arguments_name ; args_type: like arguments_type )
-- Set arguments_name of current
-- as a variable list of argument names.
require
args_name_not_void: args_name /= void
args_type_not_void: args_type /= void
same_count: args_name. count = args_type. count
ensure
arguments_name = args_name
arguments_type = args_type
arguments_set

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_no_arguments
-- No arguments for the current procedure
ensure
arguments_name = void
arguments_type = void
no_arguments: not arguments_set

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Basic operations

drop
-- Drop current procedure from server.
require
exists: exists
ensure
not_loaded: not loaded

execute (destination: DB_EXPRESSION )
-- Execute current procedure with destination
-- be a DB_SELECTION or DB_CHANGE object mapping
-- entity values with procedure parameter names
-- if any.
require
destination_not_void: destination /= void
exists: exists

execute_string (destination: DB_EXPRESSION ; sql: STRING )
-- Execute using sql statement current procedure with destination
-- be a DB_SELECTION or DB_CHANGE object mapping
-- entity values with procedure parameter names
-- if any.
require
destination_not_void: destination /= void
exists: exists

load
-- Load stored procedure name
require
is_connected: is_connected
ensure
loaded: loaded

store (sql: STRING )
-- Store current procedure with sql expression.
require
sql_not_void: sql /= void
not_exists: not exists

invariant

implementation_not_void: implementation /= void
load_and_exists: loaded implies ( exists or not exists )
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_PROC


DB_REPOSITORY Chart

 class
DB_REPOSITORY

General
cluster: eiffelstore.interface
create: make

Ancestors
DB_EXEC_USE
DB_STATUS_USE

Queries
column_i_th (i: INTEGER ): COLUMNS [ DATABASE ]
column_number : INTEGER
conforms (object: ANY ): BOOLEAN
exists : BOOLEAN
is_connected : BOOLEAN
is_ok : BOOLEAN
loaded : BOOLEAN
repository_name : STRING

Commands
allocate (object: ANY )
change_name (new_name: STRING )
generate_class (f: FILE )
load
make (name: STRING )


DB_REPOSITORY Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_REPOSITORY

create

make (name: STRING )
-- Create repository with name.
require
name_exists: name /= void
ensure
repository_name . is_equal (name)

feature -- Initialization

make (name: STRING )
-- Create repository with name.
require
name_exists: name /= void
ensure
repository_name . is_equal (name)

feature -- Access

column_i_th (i: INTEGER ): COLUMNS [ DATABASE ]
-- Column corresponding to indice 'i'
require
indice_valid: i >= 1 and i <= column_number
ensure
Result /= void

column_number : INTEGER
-- Column number
ensure
Result >= 0

feature -- Status report

conforms (object: ANY ): BOOLEAN
-- Do object attributes match the data description
-- accessed through repository_name ?
require
parameter_not_void: object /= void
is_loaded: loaded
is_ok: is_ok

exists : BOOLEAN
-- Does repository repository_name exist?
require
is_ok: is_ok
rep_loaded: loaded

loaded : BOOLEAN
-- Is current repository data description
-- retrieved from base?

repository_name : STRING
-- Name of repository

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Basic operations

allocate (object: ANY )
-- Generate a database repository according to the
-- data representation of Eiffel object object.
require
connected: is_connected
obj_exists: object /= void
is_ok: is_ok

change_name (new_name: STRING )
-- Change repository name with new_name.
require
is_ok: is_ok
name_exists: new_name /= void
ensure
ensure_name (new_name)

generate_class (f: FILE )
-- Generate an Eiffel class template mapping
-- the loaded data description.
require
is_ok: is_ok
rep_loaded: loaded
file_exists: f /= void and then f. exists

load
-- Load persistent data description accessible through
-- repository_name .
require
repository_name: repository_name /= void
connected: is_connected
ensure
loaded

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_REPOSITORY


DB_RESULT Chart

 class
DB_RESULT

General
cluster: eiffelstore.interface
create: make

Ancestors
HANDLE_USE

Queries
data : DB_DATA
map_table_to_create : BOOLEAN

Commands
copy (other: DB_RESULT )
fill_in
make


DB_RESULT Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_RESULT

create

make
-- Create an interface object
-- to receive query result.

feature -- Initialization

make
-- Create an interface object
-- to receive query result.

feature -- Status report

data : DB_DATA
-- Loaded data

map_table_to_create : BOOLEAN
-- Does map table need to be created?

feature -- Element change

copy (other: DB_RESULT )
-- Assign Current attributes with other attributes.
require
other /= void
ensure
implementation /= void

fill_in
-- Fill in data .

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_RESULT


DB_SELECTION Chart

 class
DB_SELECTION

General
cluster: eiffelstore.interface
create: make

Ancestors
DB_CONSTANT
DB_EXEC_USE
DB_EXPRESSION
DB_STATUS_USE
EXT_INTERNAL

Queries
after : BOOLEAN
container : LIST [ DB_RESULT ]
cursor : DB_RESULT
immediate_execution : BOOLEAN
is_allocatable : BOOLEAN
is_connected : BOOLEAN
is_exiting : BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_ok : BOOLEAN
is_tracing : BOOLEAN
last_parsed_query : STRING
last_query : STRING
mapped_value (key: STRING ): ANY
object : ANY
stop_condition : ACTION
trace_output : FILE

Commands
clear_all
cursor_to_object
execute_query
forth
load_result
make
next
no_object_convert
object_convert (reference: ANY )
query (s: STRING )
reset_cursor (c: DB_RESULT )
set_action (action: ACTION )
set_container (one_container: [like container ] LIST [ DB_RESULT ])
set_immediate
set_map_name (n: ANY ; key: STRING )
set_query (query: STRING )
set_trace
start
terminate
unset_action
unset_container
unset_immediate
unset_map_name (key: STRING )
unset_trace
wipe_out

Constraints
last cursor in container


DB_SELECTION Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
access: perform_select, search, retrieve
product: eiffelstore
database: all_bases

class interface
DB_SELECTION

create

make
-- Create an interface objet to query active base.

feature -- Initialization

make
-- Create an interface objet to query active base.

feature -- Access

last_parsed_query : STRING
-- Last parsed SQL query

feature -- Status report

after : BOOLEAN
-- Is the container after?
require
container_exists: container /= void

container : LIST [ DB_RESULT ]
-- Stored cursors.

cursor : DB_RESULT
-- Cursor pointing to last fetched query result

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

is_allocatable : BOOLEAN
-- Can Current be added to other concurrently opened selections?

is_exiting : BOOLEAN
-- Is exit condition of load_result iteration loop met?
ensure
Result implies ( not is_ok or else exhausted or else ( stop_condition /= void and then stop_condition . found ))

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
-- (from STRING_HDL )
require -- from STRING_HDL
keys_exists: key /= void

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

last_query : STRING
-- Last SQL statement used
-- (from DB_EXPRESSION )

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object : ANY
-- Eiffel object to be filled in by cursor_to_object

stop_condition : ACTION
-- Object providing an execute routine called
-- after each load_result iteration step

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status setting

clear_all
-- Remove all mapped keys.
-- (from STRING_HDL )

cursor_to_object
-- Assign object attributes with cursor field values.
require
cursor_exists: cursor /= void
object_exists: object /= void

forth
-- Move cursor to next element of container .
require else
container_exists: container /= void
ensure then
container_index_moved: container . index = old container . index + 1
cursor_updated: not after implies cursor = container . item

no_object_convert
-- Do not transform cursor into an Eiffel object
-- while reading in selection results.
ensure
object = void

object_convert (reference: ANY )
-- Set object with reference, reference to an Eiffel
-- object to be filled in with cursor field values.
require
reference_exists: reference /= void
ensure
object_set: object = reference

reset_cursor (c: DB_RESULT )
-- Reset cursor with c.
require
arguments_exists: c /= void
connected: is_connected
ensure
cursor_reset: cursor = c

set_action (action: ACTION )
-- Set stop_condition with action.
require
action_exists: action /= void
ensure
stop_condition_set: stop_condition = action

set_container (one_container: like container )
-- Make results of selection query persist in container.
require
container_exists: one_container /= void
ensure
container_set: container = one_container

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

set_query (query: STRING )
-- Set last_query with query .
-- (from DB_EXPRESSION )
require -- from DB_EXPRESSION
query_not_void: query /= void
ensure -- from DB_EXPRESSION
last_query_changed: last_query = query

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

start
-- Set cursor on first element of container .
require else
container_exists: container /= void
ensure then
container_on_first: container . isfirst
cursor_updated: cursor = container . item

unset_action
-- Reset stop_condition to Void.
ensure
stop_condition_void: stop_condition = void

unset_container
-- Do not store in container results of selection.
require
container_exists: container /= void
ensure
container_is_void: container = void

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Basic operations

execute_query
-- Execute query with last_query .
require -- from DB_EXPRESSION
last_query_not_void: last_query /= void

load_result
-- Iterate through selection results,
-- load container if requested and call action routine
-- for each iteration step until exit_condition is met.
require
connected: is_connected
is_ok: is_ok
ensure
cursor_not_void: cursor /= void
exit_condition_met: is_exiting

next
-- Move to next element matching the query.
require
connected: is_connected

query (s: STRING )
-- Select stored objects using s and make
-- them retrievable using load_result .
require
connected: is_connected
argument_exists: s /= void
argument_is_not_empty: not s. is_empty
is_ok: is_ok
is_allocatable: is_allocatable
ensure
last_query_changed: last_query = s

terminate
-- Clear database cursor.
require
connected: is_connected
ensure
is_allocatable: is_allocatable

wipe_out
-- Clear selection results.
ensure
container_is_empty: container /= void implies container . is_empty
object_model_void: object = void
cursor_void: cursor = void

invariant

last_cursor_in_container: container /= void and then not container . is_empty implies container . has ( cursor )
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_SELECTION


DB_STORE Chart

 class
DB_STORE

General
cluster: eiffelstore.interface
create: make

Ancestors
DB_EXEC_USE
DB_STATUS_USE

Queries
immediate_execution : BOOLEAN
is_connected : BOOLEAN
is_ok : BOOLEAN
is_tracing : BOOLEAN
owns_repository : BOOLEAN
trace_output : FILE

Commands
force (object: ANY )
put (object: ANY )
set_immediate
set_repository (repository: DB_REPOSITORY )
set_trace
unset_immediate
unset_trace


DB_STORE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
access: store
product: eiffelstore
database: all_bases

class interface
DB_STORE

create

make
-- Create an interface object to store in active base.

feature -- Status report

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).
-- (from DB_EXEC_USE )

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?
-- (from DB_EXEC_USE )

owns_repository : BOOLEAN
-- Is Current linked to a repository?

trace_output : FILE
-- Trace destination file
-- (from DB_EXEC_USE )

feature -- Status report

is_connected : BOOLEAN
-- Has connection to the database server succeeded?
-- (from DB_STATUS_USE )

is_ok : BOOLEAN
-- Is last SQL statement ok ?
-- (from DB_STATUS_USE )

feature -- Status setting

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: immediate_execution

set_repository (repository: DB_REPOSITORY )
-- Set implementation repository with repository.
require
repository_not_void: repository /= void
ensure
owns_repository: owns_repository

set_trace
-- Trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
-- (from DB_EXEC_USE )
ensure -- from DB_EXEC_USE
trace_status: not is_tracing

feature -- Basic operations

force (object: ANY )
-- Insert object in repository attached to Current.
require
connected: is_connected
object_exists: object /= void
is_ok: is_ok
owns_repository: owns_repository

put (object: ANY )
-- Insert object in repository attached to Current.
require
connected: is_connected
object_exists: object /= void
is_ok: is_ok
owns_repository: owns_repository

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_STORE


DB_TUPLE Chart

 class
DB_TUPLE

General
cluster: eiffelstore.interface
create: copy , make

Ancestors
DB_RESULT

Queries
column_name (index: INTEGER ): STRING
count : INTEGER
data : DB_DATA_SQL
is_empty : BOOLEAN
item (index: INTEGER ): ANY
map_table_to_create : BOOLEAN

Commands
copy (other: DB_RESULT )
fill_in
make


DB_TUPLE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: rdbms

class interface
DB_TUPLE

create

copy (other: DB_RESULT )
-- Assign Current attributes with other attributes.
-- (from DB_RESULT )
require -- from DB_RESULT
other /= void
ensure -- from DB_RESULT
implementation /= void

make
-- Create an interface object
-- to receive query result.
-- (from DB_RESULT )

feature -- Initialization

make
-- Create an interface object
-- to receive query result.
-- (from DB_RESULT )

feature -- Status report

column_name (index: INTEGER ): STRING
-- Name of index-th item in Current tuple.

count : INTEGER
-- Number of columns in Current tuple

data : DB_DATA_SQL
-- Loaded data returned from last SQL query result

is_empty : BOOLEAN
-- Is Curren tuple empty?

item (index: INTEGER ): ANY
-- Retrieved value at index position in data .

map_table_to_create : BOOLEAN
-- Does map table need to be created?
-- (from DB_RESULT )

feature -- Element change

copy (other: DB_RESULT )
-- Assign Current attributes with other attributes.
-- (from DB_RESULT )
require -- from DB_RESULT
other /= void
ensure -- from DB_RESULT
implementation /= void

fill_in
-- Fill in data .
-- (from DB_RESULT )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TUPLE


DB_TYPE Chart

 deferred class
DB_TYPE

General
cluster: eiffelstore.interface

Ancestors
INTERNAL

Queries
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
compiler_version : INTEGER
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
eiffel_name : STRING
eiffel_ref : ANY
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_special (object: ANY ): BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
same (object: ANY ): BOOLEAN
sql_name : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )


DB_TYPE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:21 $"
revision: "$Revision: 1.1 $"
product: "EiffelStore"
database: "All bases"

deferred class interface
DB_TYPE

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

same (object: ANY ): BOOLEAN
-- Is it the same type that object?
require
object_not_void: object /= void
ensure
Result = ( dynamic_type (object) = dynamic )

feature -- Status report

dynamic : INTEGER
-- Dynamic type of Eiffel reference?
require
eiffel_ref_not_void: eiffel_ref /= void
ensure
Result = dynamic_type ( eiffel_ref )

eiffel_name : STRING
-- Eiffel type name
require
eiffel_ref_not_void: eiffel_ref /= void

eiffel_ref : ANY
-- Eiffel reference of the type
ensure
result_not_void: Result /= void

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

sql_name : STRING
-- SQL type name
ensure
result_not_void: Result /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_TYPE


cluster eiffelstore.mapping

 Cluster
eiffelstore.mapping

Supercluster
eiffelstore

Subclusters
eiffelstore.mapping.database_operation
eiffelstore.mapping.database_schema
eiffelstore.mapping.eiffel2rm
eiffelstore.mapping.keys
eiffelstore.mapping.meta_schema
eiffelstore.mapping.rm2eiffel
eiffelstore.mapping.rows
eiffelstore.mapping.shared_information


cluster eiffelstore.mapping.database_operation

 Cluster
eiffelstore.mapping.database_operation

Supercluster
eiffelstore.mapping


cluster eiffelstore.mapping.database_schema

 Cluster
eiffelstore.mapping.database_schema

Supercluster
eiffelstore.mapping


cluster eiffelstore.mapping.eiffel2rm

 Cluster
eiffelstore.mapping.eiffel2rm

Supercluster
eiffelstore.mapping

Subclusters
eiffelstore.mapping.eiffel2rm.compositor
eiffelstore.mapping.eiffel2rm.model_example


cluster eiffelstore.mapping.eiffel2rm.compositor

 Cluster
eiffelstore.mapping.eiffel2rm.compositor

Supercluster
eiffelstore.mapping.eiffel2rm


cluster eiffelstore.mapping.eiffel2rm.model_example

 Cluster
eiffelstore.mapping.eiffel2rm.model_example

Supercluster
eiffelstore.mapping.eiffel2rm


cluster eiffelstore.mapping.keys

 Cluster
eiffelstore.mapping.keys

Supercluster
eiffelstore.mapping

Classes
BASIC_KEY
INTEGER_KEY
KEY
MULTI_KEY


BASIC_KEY Chart

 deferred class
BASIC_KEY

General
cluster: eiffelstore.mapping.keys
description: "Objects that ..."

Ancestors
KEY

Queries
hash_code : INTEGER
Is_basic : BOOLEAN
is_hashable : BOOLEAN
item : HASHABLE

Commands
make (type: [like item ] HASHABLE )


BASIC_KEY Flat contracts

 indexing
description: "Objects that ..."
author: ""
date: "$Date: 2001/06/14 00:28:22 $"
revision: "$Revision: 1.1 $"

deferred class interface
BASIC_KEY

feature -- Initialization

make (type: like item )
-- Initialize

feature --Access

hash_code : INTEGER
-- Hash code value
ensure -- from HASHABLE
good_hash_value: Result >= 0

Is_basic : BOOLEAN is True

item : HASHABLE

feature -- Status report

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class BASIC_KEY


INTEGER_KEY Chart

 class
INTEGER_KEY

General
cluster: eiffelstore.mapping.keys
description: ""
create: make

Ancestors
BASIC_KEY

Queries
hash_code : INTEGER
Is_basic : BOOLEAN
is_hashable : BOOLEAN
item : INTEGER_REF

Commands
make (type: [like item ] INTEGER_REF )


INTEGER_KEY Flat contracts

 indexing
description: ""
author: "David Solal"
date: "$ Date: "
revision: "$ Revision: "

class interface
INTEGER_KEY

create

make (type: like item )
-- Initialize
-- (from BASIC_KEY )

feature -- Initialization

make (type: like item )
-- Initialize
-- (from BASIC_KEY )

feature -- Access

item : INTEGER_REF

feature --Access

hash_code : INTEGER
-- Hash code value
-- (from BASIC_KEY )
ensure -- from HASHABLE
good_hash_value: Result >= 0

Is_basic : BOOLEAN is True
-- (from BASIC_KEY )

feature -- Status report

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class INTEGER_KEY


KEY Chart

 deferred class
KEY

General
cluster: eiffelstore.mapping.keys
description: "Objects that ..."

Ancestors
HASHABLE

Queries
hash_code : INTEGER
is_basic : BOOLEAN
is_hashable : BOOLEAN


KEY Flat contracts

 indexing
description: "Objects that ..."
author: ""
date: "$Date: 2001/06/14 00:28:22 $"
revision: "$Revision: 1.1 $"

deferred class interface
KEY

feature -- Access

hash_code : INTEGER
-- Hash code value
-- (from HASHABLE )
ensure -- from HASHABLE
good_hash_value: Result >= 0

is_basic : BOOLEAN

feature -- Status report

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class KEY


MULTI_KEY Chart

 class
MULTI_KEY

General
cluster: eiffelstore.mapping.keys
description: "Multiple keys"

Ancestors
ANY

Commands
hash_code


MULTI_KEY Flat contracts

 indexing
description: "Multiple keys"
author: "Lionel Moro"
date: "$Date: 2001/06/14 00:28:22 $"
revision: "$Revision: 1.1 $"

class interface
MULTI_KEY

feature -- Access

hash_code

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MULTI_KEY


cluster eiffelstore.mapping.meta_schema

 Cluster
eiffelstore.mapping.meta_schema

Supercluster
eiffelstore.mapping


cluster eiffelstore.mapping.rm2eiffel

 Cluster
eiffelstore.mapping.rm2eiffel

Supercluster
eiffelstore.mapping

Subclusters
eiffelstore.mapping.rm2eiffel.compositor
eiffelstore.mapping.rm2eiffel.rm_compositor
eiffelstore.mapping.rm2eiffel.Sql_parser


cluster eiffelstore.mapping.rm2eiffel.compositor

 Cluster
eiffelstore.mapping.rm2eiffel.compositor

Supercluster
eiffelstore.mapping.rm2eiffel


cluster eiffelstore.mapping.rm2eiffel.rm_compositor

 Cluster
eiffelstore.mapping.rm2eiffel.rm_compositor

Supercluster
eiffelstore.mapping.rm2eiffel


cluster eiffelstore.mapping.rm2eiffel.Sql_parser

 Cluster
eiffelstore.mapping.rm2eiffel.Sql_parser

Supercluster
eiffelstore.mapping.rm2eiffel


cluster eiffelstore.mapping.rows

 Cluster
eiffelstore.mapping.rows

Supercluster
eiffelstore.mapping


cluster eiffelstore.mapping.shared_information

 Cluster
eiffelstore.mapping.shared_information

Supercluster
eiffelstore.mapping


cluster eiffelstore.precomp

 Cluster
eiffelstore.precomp

Supercluster
eiffelstore

Subclusters
eiffelstore.precomp.spec


cluster eiffelstore.precomp.spec

 Cluster
eiffelstore.precomp.spec

Supercluster
eiffelstore.precomp

Subclusters
eiffelstore.precomp.spec.solaris
eiffelstore.precomp.spec.windows


cluster eiffelstore.precomp.spec.solaris

 Cluster
eiffelstore.precomp.spec.solaris

Supercluster
eiffelstore.precomp.spec

Subclusters
eiffelstore.precomp.spec.solaris.store


cluster eiffelstore.precomp.spec.solaris.store

 Cluster
eiffelstore.precomp.spec.solaris.store

Supercluster
eiffelstore.precomp.spec.solaris


cluster eiffelstore.precomp.spec.windows

 Cluster
eiffelstore.precomp.spec.windows

Supercluster
eiffelstore.precomp.spec

Subclusters
eiffelstore.precomp.spec.windows.store


cluster eiffelstore.precomp.spec.windows.store

 Cluster
eiffelstore.precomp.spec.windows.store

Supercluster
eiffelstore.precomp.spec.windows


cluster eiffelstore.save

 Cluster
eiffelstore.save

Supercluster
eiffelstore


cluster eiffelstore.spec

 Cluster
eiffelstore.spec

Supercluster
eiffelstore

Subclusters
eiffelstore.spec.msc


cluster eiffelstore.spec.msc

 Cluster
eiffelstore.spec.msc

Supercluster
eiffelstore.spec

Subclusters
eiffelstore.spec.msc.lib


cluster eiffelstore.spec.msc.lib

 Cluster
eiffelstore.spec.msc.lib

Supercluster
eiffelstore.spec.msc


cluster eiffelstore.support

 Cluster
eiffelstore.support

Supercluster
eiffelstore

Subclusters
eiffelstore.support.Clib

Classes
ACTION
DB_ACTION [G]
DB_CONSTANT
DB_EXEC
DB_EXEC_USE
DB_FORMAT
DB_STATUS
DB_STATUS_USE
EXT_INTERNAL
GENERAL_APPL
HANDLE
HANDLE_USE
NUMERIC_NULL_VALUE
PARAMETER_HDL
SQL_SCAN
STRING_HDL


ACTION Chart

 class
ACTION

General
cluster: eiffelstore.support

Ancestors
ANY

Queries
found : BOOLEAN

Commands
execute
start


ACTION Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
ACTION

feature -- Basic operations

execute
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)

found : BOOLEAN
-- Is there any exit condition found
-- while iterating on selection results in
-- load_result of DB_SELECTION?
-- (Default: do nothing)

start
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ACTION


cluster eiffelstore.support.Clib

 Cluster
eiffelstore.support.Clib

Supercluster
eiffelstore.support


DB_ACTION Chart

 class
DB_ACTION [G]

General
cluster: eiffelstore.support
description: "Objects that redefine ACTION to store Eiffel objects converted from database in a list."
create: make

Ancestors
ACTION

Queries
found : BOOLEAN
item : G
list : ARRAYED_LIST [G]
selection : DB_SELECTION

Commands
execute
make (a_selection: [like selection ] DB_SELECTION ; an_item: G)
start


DB_ACTION Flat contracts

 indexing
description: "Objects that redefine ACTION to store Eiffel objects converted from database in a list."
author: "pascalf"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_ACTION [G]

create

make (a_selection: like selection ; an_item: G)
-- Initialize.
require
not_void: a_selection /= void and an_item /= void
ensure
set: selection = a_selection and item = an_item

feature -- Access

item : G
-- Current found item in selection .
-- Must be a reference on selection.object,
-- thus selection.cursor_to_object updates it.

list : ARRAYED_LIST [G]
-- Result list.

selection : DB_SELECTION
-- Current selection.

feature -- Basic operations

found : BOOLEAN
-- Is there any exit condition found
-- while iterating on selection results in
-- load_result of DB_SELECTION?
-- (Default: do nothing)
-- (from ACTION )

start
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)
-- (from ACTION )

feature -- Actions

execute
-- Update item with current
-- selected item in the container.

feature -- Creation

make (a_selection: like selection ; an_item: G)
-- Initialize.
require
not_void: a_selection /= void and an_item /= void
ensure
set: selection = a_selection and item = an_item

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_ACTION


DB_CONSTANT Chart

 class
DB_CONSTANT

General
cluster: eiffelstore.support

Ancestors
ANY


DB_EXEC Chart

 class
DB_EXEC

General
cluster: eiffelstore.support
create: make

Ancestors
ANY

Queries
immediate_execution : BOOLEAN
is_tracing : BOOLEAN
Trace_output : FILE

Commands
set_immediate
set_trace
unset_immediate
unset_trace


DB_EXEC Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
access: execute, immediate, prepare
product: eiffelstore
database: all_bases

class interface
DB_EXEC

create

make
-- Create current instance
ensure
execution_status: not immediate_execution

feature -- Status report

immediate_execution : BOOLEAN
-- Is execution of SQL query immediate?

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?

trace_output : FILE
-- Trace destination file
ensure
destination_file_present: Result = io . error

feature -- Status setting

set_immediate
-- Set immediate_execution to true.
-- Query will be executed with a
-- `EXECUTE IMMEDIATE' SQL statement
ensure
execution_status: immediate_execution

set_trace
-- Trace queries sent to database server.
ensure
trace_status: is_tracing

unset_immediate
-- Set immediate_execution to false.
-- Query will be executed with a
-- PREPARE and EXECUTE SQL statement.
ensure
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
ensure
trace_status: not is_tracing

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_EXEC


DB_EXEC_USE Chart

 class
DB_EXEC_USE

General
cluster: eiffelstore.support

Ancestors
HANDLE_USE

Queries
immediate_execution : BOOLEAN
is_tracing : BOOLEAN
trace_output : FILE

Commands
set_immediate
set_trace
unset_immediate
unset_trace


DB_EXEC_USE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
access: execute, immediate, prepare
product: eiffelstore
database: all_bases

class interface
DB_EXEC_USE

feature -- Status report

immediate_execution : BOOLEAN
-- Are requests immediately executed?
-- (default is no).

is_tracing : BOOLEAN
-- Is trace option for SQL queries on?

trace_output : FILE
-- Trace destination file

feature -- Status setting

set_immediate
-- Set queries to be executed with a
-- `EXECUTE IMMEDIATE' SQL statement.
ensure
execution_status: immediate_execution

set_trace
-- Trace queries sent to database server.
ensure
trace_status: is_tracing

unset_immediate
-- Set queries to be executed with a
-- PREPARE followed by a EXECUTE SQL statement.
ensure
execution_status: not immediate_execution

unset_trace
-- Do not trace queries sent to database server.
ensure
trace_status: not is_tracing

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_EXEC_USE


DB_FORMAT Chart

 class
DB_FORMAT

General
cluster: eiffelstore.support
description: "Different formats of the database"
create: make

Ancestors
HANDLE_USE

Queries
boolean_format (object: BOOLEAN ): STRING
date_format (object: DATE_TIME ): STRING
string_format (object: STRING ): STRING

Commands
make


DB_FORMAT Flat contracts

 indexing
description: "Different formats of the database"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"

class interface
DB_FORMAT

create

make
-- Create an interface object to format data.

feature -- Initialization

make
-- Create an interface object to format data.

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- Converted string of object according to the database format

date_format (object: DATE_TIME ): STRING
-- Converted string of object according to the database format.
require
argument_not_void: object /= void

string_format (object: STRING ): STRING
-- Converted string of object according to the database format.
require
argument_not_void: object /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_FORMAT


DB_STATUS Chart

 class
DB_STATUS

General
cluster: eiffelstore.support
create: make

Ancestors
HANDLE_USE

Queries
error_code : INTEGER
error_message : STRING
found : BOOLEAN
is_connected : BOOLEAN
is_error_updated : BOOLEAN
warning_message : STRING

Commands
reset
set (new_value: INTEGER )
set_connect (new_value: BOOLEAN )

Constraints
has handle


DB_STATUS Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
access: status, error
product: eiffelstore
database: all_bases

class interface
DB_STATUS

create

make
-- Create implementation handle.

feature -- Status report

error_code : INTEGER
-- Error code prompted by database server

error_message : STRING
-- SQL error message prompted by database server

found : BOOLEAN
-- Is there any record matching the last
-- selection condition used ?

is_connected : BOOLEAN
-- Has connection to the data base server succeeded?

is_error_updated : BOOLEAN
-- Has an Oracle/ODBC function been called since last update which may have
-- updated error status?

warning_message : STRING
-- SQL warning message prompted by database server

feature -- Status setting

reset
-- Reset database error status.
ensure
no_error: error_code_stored = 0
no_message_error: error_message_stored . is_equal ("")
no_message_warning: warning_message_stored . is_equal ("")

set (new_value: INTEGER )
-- Should be removed!

set_connect (new_value: BOOLEAN )
-- Change state of connection.
ensure
is_connected_reset: is_connected = new_value

invariant

has_handle: implementation /= void
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_STATUS


DB_STATUS_USE Chart

 class
DB_STATUS_USE

General
cluster: eiffelstore.support

Ancestors
HANDLE_USE


EXT_INTERNAL Chart

 class
EXT_INTERNAL

General
cluster: eiffelstore.support

Ancestors
BASIC_ROUTINES
INTERNAL
NUMERIC_NULL_VALUE

Queries
abs (n: INTEGER ): INTEGER
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
compiler_version : INTEGER
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_special (object: ANY ): BOOLEAN
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
rsign (r: REAL ): INTEGER
sign (n: INTEGER ): INTEGER
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
Wide_character_type : INTEGER

Commands
deep_traversal (object: ANY )
mark (obj: ANY )
object_finish_action (object: ANY )
object_init_action (object: ANY )
reference_object_action (i: INTEGER ; object: ANY )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
switch_mark (obj: ANY )
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )


EXT_INTERNAL Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
access: internal
product: eiffelstore
database: all_bases

class interface
EXT_INTERNAL

feature -- Access

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Status report

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Element change

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Conversion

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
require
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
require
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
require
object_exists: object /= void
value_exists: value /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
require
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
require
object_exists: obj /= void

nb_classes : INTEGER
-- Number of dynamic types in current system

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
require
object_exists: obj /= void

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
require
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
require
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
require
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class EXT_INTERNAL


GENERAL_APPL Chart

 deferred class
GENERAL_APPL

General
cluster: eiffelstore.support

Ancestors
HANDLE_USE


HANDLE Chart

 class
HANDLE

General
cluster: eiffelstore.support

Ancestors
ANY

Queries
All_types : DB_ALL_TYPES
database : DB [ DATABASE ]
execution_type : DB_EXEC
login : LOGIN [ DATABASE ]
process : POINTER_REF
status : DB_STATUS


HANDLE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
HANDLE

feature -- Status report

all_types : DB_ALL_TYPES
-- All data types available in active database
ensure
result_not_void: Result /= void

database : DB [ DATABASE ]
-- Active database accessed through the handle

execution_type : DB_EXEC
-- Immediate or non-immediate execution

login : LOGIN [ DATABASE ]
-- Session login

process : POINTER_REF
-- Communication channel with database server
-- (single or multiple depending on RDBMS)

status : DB_STATUS
-- Status of active database

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HANDLE


HANDLE_USE Chart

 class
HANDLE_USE

General
cluster: eiffelstore.support

Ancestors
ANY


NUMERIC_NULL_VALUE Chart

 class
NUMERIC_NULL_VALUE

General
cluster: eiffelstore.support
description: "Object that defines the numeric value that codes a databaseNULL value."

Ancestors
ANY


PARAMETER_HDL Chart

 class
PARAMETER_HDL

General
cluster: eiffelstore.support
description: "(At least ODBC )"

Ancestors
STRING_HDL

Queries
is_executed : BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_prepared : BOOLEAN
mapped_value (key: STRING ): ANY
parameter_count : INTEGER
parameter_name_exist (key: STRING ): BOOLEAN

Commands
clear_all
set_executed (b: BOOLEAN )
set_map_name (n: ANY ; key: STRING )
set_parameter (value: ANY ; key: STRING )
set_parameters_value (p: ARRAY [ ANY ])
set_prepared (b: BOOLEAN )
setup_parameters
unset_map_name (key: STRING )


PARAMETER_HDL Flat contracts

 indexing
status: "Objects that handle parameters in dynamic requests"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases
"(At least ODBC )"

class interface
PARAMETER_HDL

feature -- Status report

is_executed : BOOLEAN
-- Is the statement has been executed ?

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity ?
require -- from STRING_HDL
keys_exists: key /= void

is_prepared : BOOLEAN
-- Is the statement has been prepared ?

mapped_value (key: STRING ): ANY
-- Value mapped with key
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

parameter_count : INTEGER
-- number of parameters, set by 'prepare'
ensure
Result > 0 implies is_prepared

parameter_name_exist (key: STRING ): BOOLEAN
require
not_void: key /= void

feature

clear_all

set_map_name (n: ANY ; key: STRING )
-- Store item n whith key key.
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

unset_map_name (key: STRING )
-- Remove item associated with key key.
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- setting

set_executed (b: BOOLEAN )

set_parameter (value: ANY ; key: STRING )
require
key_not_void: key /= void
has_parameters: parameter_count > 0

set_parameters_value (p: ARRAY [ ANY ])
require
has_parameters: parameter_count > 0

set_prepared (b: BOOLEAN )

setup_parameters
-- setup parameters_value with actual parameters value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class PARAMETER_HDL


SQL_SCAN Chart

 class
SQL_SCAN

General
cluster: eiffelstore.support
create: make

Ancestors
DB_FORMAT
EXT_INTERNAL
STRING
STRING_HDL

Queries
infix " @ " (i: INTEGER ): CHARACTER
infix " >= " (other: [like Current] SQL_SCAN ): BOOLEAN
infix " > " (other: [like Current] SQL_SCAN ): BOOLEAN
infix " <= " (other: [like Current] SQL_SCAN ): BOOLEAN
infix " < " (other: [like Current] SQL_SCAN ): BOOLEAN
infix " + " (s: STRING ): STRING
abs (n: INTEGER ): INTEGER
adapt (s: STRING ): [like Current] SQL_SCAN
additional_space : INTEGER
area : SPECIAL [ CHARACTER ]
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
boolean_format (object: BOOLEAN ): STRING
Boolean_type : INTEGER
bottom_int_div (n1, n2: INTEGER ): INTEGER
capacity : INTEGER
Changeable_comparison_criterion : BOOLEAN
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
charconv (i: INTEGER ): CHARACTER
class_name (object: ANY ): STRING
compiler_version : INTEGER
count : INTEGER
date_format (object: DATE_TIME ): STRING
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
Extendible : BOOLEAN
False_constant : STRING
field (i: INTEGER ; object: ANY ): ANY
field_clean (i: INTEGER ; object: ANY ): BOOLEAN
field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
field_count (object: ANY ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
full : BOOLEAN
fuzzy_index (other: STRING ; start, fuzz: INTEGER ): INTEGER
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
Growth_percentage : INTEGER
has (c: CHARACTER ): BOOLEAN
hash_code : INTEGER
index_of (c: CHARACTER ; start: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_empty : BOOLEAN
is_equal (other: [like Current] SQL_SCAN ): BOOLEAN
is_hashable : BOOLEAN
is_inserted (v: CHARACTER ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_mapped (key: STRING ): BOOLEAN
is_marked (obj: ANY ): BOOLEAN
is_special (object: ANY ): BOOLEAN
item (i: INTEGER ): CHARACTER
item_code (i: INTEGER ): INTEGER
last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
linear_representation : LINEAR [ CHARACTER ]
mapped_value (key: STRING ): ANY
max (other: [like Current] SQL_SCAN ): [like Current] SQL_SCAN
min (other: [like Current] SQL_SCAN ): [like Current] SQL_SCAN
Minimal_increase : INTEGER
mirrored : [like Current] SQL_SCAN
Nb_classes : INTEGER
new_instance_of (type_id: INTEGER ): ANY
object_comparison : BOOLEAN
occurrences (c: CHARACTER ): INTEGER
out : [like Current] SQL_SCAN
parse (s: STRING ): STRING
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
Pointer_type : INTEGER
prunable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
resizable : BOOLEAN
rsign (r: REAL ): INTEGER
shared_with (other: [like Current] SQL_SCAN ): BOOLEAN
sign (n: INTEGER ): INTEGER
split (a_separator: CHARACTER ): LINEAR [ STRING ]
string_format (object: STRING ): STRING
string_is_boolean : BOOLEAN
string_is_double : BOOLEAN
string_is_integer : BOOLEAN
string_is_real : BOOLEAN
substring (n1, n2: INTEGER ): [like Current] SQL_SCAN
substring_index (other: STRING ; start: INTEGER ): INTEGER
three_way_comparison (other: [like Current] SQL_SCAN ): INTEGER
to_boolean : BOOLEAN
to_c : ANY
to_double : DOUBLE
to_integer : INTEGER
to_real : REAL
True_constant : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
up_int_div (n1, n2: INTEGER ): INTEGER
valid_index (i: INTEGER ): BOOLEAN
Wide_character_type : INTEGER

Commands
adapt_size
append (s: STRING )
append_boolean (b: BOOLEAN )
append_character (c: CHARACTER )
append_double (d: DOUBLE )
append_integer (i: INTEGER )
append_real (r: REAL )
append_string (s: STRING )
append_substring (s: STRING ; n1, n2: INTEGER )
automatic_grow
center_justify
character_justify (pivot: CHARACTER ; position: INTEGER )
clear_all
compare_objects
compare_references
copy (other: [like Current] SQL_SCAN )
deep_traversal (object: ANY )
extend (c: CHARACTER )
fill (other: CONTAINER [ CHARACTER ])
fill_blank
fill_character (c: CHARACTER )
format_make
from_c (c_string: POINTER )
from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
get_complex_value (obj: ANY ; str: STRING )
get_value (obj: ANY ; str: STRING )
grow (newsize: INTEGER )
head (n: INTEGER )
insert (s: STRING ; i: INTEGER )
left_adjust
left_justify
make (i: INTEGER )
make_from_c (c_string: POINTER )
make_from_string (s: STRING )
mark (obj: ANY )
mirror
multiply (n: INTEGER )
object_finish_action (object: ANY )
object_init_action (object: ANY )
precede (c: CHARACTER )
prepend (s: STRING )
prepend_boolean (b: BOOLEAN )
prepend_character (c: CHARACTER )
prepend_double (d: DOUBLE )
prepend_integer (i: INTEGER )
prepend_real (r: REAL )
prepend_string (s: STRING )
prune (c: CHARACTER )
prune_all (c: CHARACTER )
prune_all_leading (c: CHARACTER )
prune_all_trailing (c: CHARACTER )
put (c: CHARACTER ; i: INTEGER )
reference_object_action (i: INTEGER ; object: ANY )
remake (n: INTEGER )
remove (i: INTEGER )
replace
replace_blank
replace_character (c: CHARACTER )
replace_substring (s: [like Current] SQL_SCAN ; start_pos, end_pos: INTEGER )
replace_substring_all (original, new: [like Current] SQL_SCAN )
resize (newsize: INTEGER )
right_adjust
right_justify
set (t: [like Current] SQL_SCAN ; n1, n2: INTEGER )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_map_name (n: ANY ; key: STRING )
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
share (other: [like Current] SQL_SCAN )
simple_object_action (type, i: INTEGER ; object: ANY )
store_action (object: ANY )
subcopy (other: [like Current] SQL_SCAN ; start_pos, end_pos, index_pos: INTEGER )
switch_mark (obj: ANY )
tail (n: INTEGER )
to_lower
to_upper
traversal (object: ANY )
unmark (obj: ANY )
unmark_structure (obj: ANY )
unset_map_name (key: STRING )
wipe_out


SQL_SCAN Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: "EiffelStore"

class interface
SQL_SCAN

create

make (i: INTEGER )
-- Create format and allocate string.

feature -- Initialization

adapt (s: STRING ): like Current
-- Object of a type conforming to the type of s,
-- initialized with attributes from s
-- (from STRING )

from_c (c_string: POINTER )
-- Reset contents of string from contents of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
ensure -- from STRING
no_zero_byte: not has ('%U')

from_c_substring (c_string: POINTER ; start_pos, end_pos: INTEGER )
-- Reset contents of string from substring of c_string,
-- a string created by some external C function.
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer
start_position_big_enough: start_pos >= 1
end_position_big_enough: start_pos <= end_pos + 1
ensure -- from STRING
valid_count: count = end_pos - start_pos + 1

make (i: INTEGER )
-- Create format and allocate string.

format_make
-- Create an interface object to format data.
-- (from DB_FORMAT )

make_from_c (c_string: POINTER )
-- Initialize from contents of c_string,
-- a string created by some external C function
-- (from STRING )
require -- from STRING
c_string_exists: c_string /= default_pointer

make_from_string (s: STRING )
-- Initialize from the characters of s.
-- (Useful in proper descendants of class STRING ,
-- to initialize a string-like object from a manifest string.)
-- (from STRING )
require -- from STRING
string_exists: s /= void
ensure -- from STRING
shared_implementation: shared_with (s)

remake (n: INTEGER )
-- Allocate space for at least n characters.
-- (from STRING )
require -- from STRING
non_negative_size: n >= 0
ensure -- from STRING
empty_string: count = 0
area_allocated: capacity >= n

feature -- Access

area : SPECIAL [ CHARACTER ]
-- Special data zone
-- (from TO_SPECIAL )

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

False_constant : STRING is "false"
-- Constant string "false"
-- (from STRING )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

fuzzy_index (other: STRING ; start: INTEGER ; fuzz: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start
-- with 0..fuzz mismatches between the string and other.
-- 0 if there are no fuzzy matches
-- (from STRING )
require -- from STRING
other_exists: other /= void
other_not_empty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
acceptable_fuzzy: fuzz <= other. count

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has (c: CHARACTER ): BOOLEAN
-- Does string include c?
-- (from STRING )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

hash_code : INTEGER
-- Hash code value
-- (from STRING )
ensure -- from HASHABLE
good_hash_value: Result >= 0

index_of (c: CHARACTER ; start: INTEGER ): INTEGER
-- Position of first occurrence of c at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
start_large_enough: start >= 1
start_small_enough: start <= count + 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

item (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of @.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

item_code (i: INTEGER ): INTEGER
-- Numeric code of character at position i
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0

last_index_of (c: CHARACTER ; start_index_from_end: INTEGER ): INTEGER
-- Position of last occurence of c.
-- 0 if none
-- (from STRING )
require -- from STRING
start_index_small_enough: start_index_from_end <= count
start_index_large_enough: start_index_from_end >= 1
ensure -- from STRING
correct_place: Result > 0 implies item (Result) = c

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

shared_with (other: like Current): BOOLEAN
-- Does string share the text of other?
-- (from STRING )

substring_index (other: STRING ; start: INTEGER ): INTEGER
-- Position of first occurrence of other at or after start ;
-- 0 if none.
-- (from STRING )
require -- from STRING
other_nonvoid: other /= void
other_notempty: not other. is_empty
start_large_enough: start >= 1
start_small_enough: start <= count
ensure -- from STRING
correct_place: Result > 0 implies substring (Result, Result + other. count - 1). is_equal (other)

True_constant : STRING is "true"
-- Constant string "true"
-- (from STRING )

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

infix " @ " (i: INTEGER ): CHARACTER
-- Character at position i
-- Was declared in STRING as synonym of item .
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

capacity : INTEGER
-- Allocated space
-- (from STRING )

count : INTEGER
-- Actual number of characters making up the string
-- (from STRING )

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from STRING )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from STRING
Result. count = count

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

occurrences (c: CHARACTER ): INTEGER
-- Number of times c appears in the string
-- (from STRING )
ensure -- from BAG
non_negative_occurrences: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

feature -- Comparison

is_equal (other: like Current): BOOLEAN
-- Is string made of same character sequence as other
-- (possibly with a different capacity)?
-- (from STRING )
require -- from ANY
other_not_void: other /= void
ensure -- from ANY
symmetric: Result implies other. is_equal (Current)
consistent: standard_is_equal (other) implies Result
ensure then -- from COMPARABLE
trichotomy: Result = ( not (Current < other) and not (other < Current))

max (other: like Current): like Current
-- The greater of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_smaller: Current >= other implies Result = Current
other_if_smaller: Current < other implies Result = other

min (other: like Current): like Current
-- The smaller of current object and other
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
current_if_not_greater: Current <= other implies Result = Current
other_if_greater: Current > other implies Result = other

three_way_comparison (other: like Current): INTEGER
-- If current object equal to other, 0;
-- if smaller, -1; if greater, 1
-- (from COMPARABLE )
require -- from COMPARABLE
other_exists: other /= void
ensure -- from COMPARABLE
equal_zero: (Result = 0) = is_equal (other)
smaller_negative: (Result = - 1) = (Current < other)
greater_positive: (Result = 1) = (Current > other)

infix " < " (other: like Current): BOOLEAN
-- Is string lexicographically lower than other?
-- (from STRING )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
asymmetric: Result implies not (other < Current)

infix " <= " (other: like Current): BOOLEAN
-- Is current object less than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = ((Current < other) or is_equal (other))

infix " > " (other: like Current): BOOLEAN
-- Is current object greater than other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other < Current)

infix " >= " (other: like Current): BOOLEAN
-- Is current object greater than or equal to other?
-- (from COMPARABLE )
require -- from PART_COMPARABLE
other_exists: other /= void
ensure then -- from COMPARABLE
definition: Result = (other <= Current)

feature -- Status report

Changeable_comparison_criterion : BOOLEAN is False
-- (from STRING )

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from STRING )

full : BOOLEAN
-- Is structure full?
-- (from BOUNDED )

string_is_boolean : BOOLEAN
-- Does Current represent a BOOLEAN?
-- (from STRING )

string_is_double : BOOLEAN
-- Does Current represent a DOUBLE?
-- (from STRING )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_hashable : BOOLEAN
-- May current object be hashed?
-- (True if it is not its type's default.)
-- (from HASHABLE )
ensure -- from HASHABLE
ok_if_not_default: Result implies (Current /= default )

is_inserted (v: CHARACTER ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

string_is_integer : BOOLEAN
-- Does Current represent an INTEGER?
-- (from STRING )

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
-- (from STRING_HDL )
require -- from STRING_HDL
keys_exists: key /= void

string_is_real : BOOLEAN
-- Does Current represent a REAL?
-- (from STRING )

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

mapped_value (key: STRING ): ANY
-- Value mapped with key
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
key_mapped: is_mapped (key)
ensure -- from STRING_HDL
result_exists: Result /= void

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from STRING )

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the string?
-- (from STRING )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

feature -- Status setting

clear_all
-- Remove all mapped keys.
-- (from STRING_HDL )
ensure -- from STRING
is_empty: count = 0
same_capacity: capacity = old capacity

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count + 1

unset_map_name (key: STRING )
-- Remove item associated with key key.
-- (from STRING_HDL )
require -- from STRING_HDL
key_exists: key /= void
item_exists: is_mapped (key)
ensure -- from STRING_HDL
ht . count = old ht . count - 1

feature -- Element change

append (s: STRING )
-- Append a copy of s at end.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + old s. count

append_boolean (b: BOOLEAN )
-- Append the string representation of b at end.
-- (from STRING )

append_character (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of extend .
-- (from STRING )
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

append_double (d: DOUBLE )
-- Append the string representation of d at end.
-- (from STRING )

append_integer (i: INTEGER )
-- Append the string representation of i at end.
-- (from STRING )

append_real (r: REAL )
-- Append the string representation of r at end.
-- (from STRING )

append_string (s: STRING )
-- Append a copy of s, if not void, at end.
-- (from STRING )

copy (other: like Current)
-- Reinitialize by copying the characters of other.
-- (This is also used by clone .)
-- (from STRING )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)
ensure then -- from STRING
new_result_count: count = other. count

extend (c: CHARACTER )
-- Append c at end.
-- Was declared in STRING as synonym of append_character .
-- (from STRING )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: is_inserted (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1
ensure then -- from STRING
item_inserted: item ( count ) = c
new_count: count = old count + 1

fill (other: CONTAINER [ CHARACTER ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

fill_blank
-- Fill with capacity blank characters.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

fill_character (c: CHARACTER )
-- Fill with capacity characters all equal to c.
-- (from STRING )
ensure -- from STRING
filled: full
same_size: ( count = capacity ) and ( capacity = old capacity )

head (n: INTEGER )
-- Remove all characters except for the first n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

insert (s: STRING ; i: INTEGER )
-- Add s to the left of position i in current string.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count + s. count

left_adjust
-- Remove leading whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item (1) /= ' ') and ( item (1) /= ' ') and ( item (1) /= '%R') and ( item (1) /= ''))

precede (c: CHARACTER )
-- Add c at front.
-- (from STRING )
ensure -- from STRING
new_count: count = old count + 1

prepend (s: STRING )
-- Prepend a copy of s at front.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
new_count: count = old count + s. count

prepend_boolean (b: BOOLEAN )
-- Prepend the string representation of b at front.
-- (from STRING )

prepend_character (c: CHARACTER )
-- Prepend the string representation of c at front.
-- (from STRING )

prepend_double (d: DOUBLE )
-- Prepend the string representation of d at front.
-- (from STRING )

prepend_integer (i: INTEGER )
-- Prepend the string representation of i at front.
-- (from STRING )

prepend_real (r: REAL )
-- Prepend the string representation of r at front.
-- (from STRING )

prepend_string (s: STRING )
-- Prepend a copy of s, if not void, at front.
-- (from STRING )

put (c: CHARACTER ; i: INTEGER )
-- Replace character at position i by c.
-- (from STRING )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: item (k) = v

replace_blank
-- Replace all current characters with blanks.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_character (c: CHARACTER )
-- Replace all current characters with characters all equal to c.
-- (from STRING )
ensure -- from STRING
same_size: ( count = old count ) and ( capacity = old capacity )

replace_substring (s: like Current; start_pos, end_pos: INTEGER )
-- Copy the characters of s to positions
-- start_pos .. end_pos.
-- (from STRING )
require -- from STRING
string_exists: s /= void
index_small_enough: end_pos <= count
order_respected: start_pos <= end_pos
index_large_enough: start_pos > 0
ensure -- from STRING
new_count: count = old count + s. count - end_pos + start_pos - 1

replace_substring_all (original, new: like Current)
-- Replace every occurence of original with new.
-- (from STRING )
require -- from STRING
original_exists: original /= void
new_exists: new /= void
original_not_empty: not original. is_empty

right_adjust
-- Remove trailing whitespace.
-- (from STRING )
ensure -- from STRING
new_count: ( count /= 0) implies (( item ( count ) /= ' ') and ( item ( count ) /= ' ') and ( item ( count ) /= '%R') and ( item ( count ) /= ''))

set (t: like Current; n1, n2: INTEGER )
-- Set current string to substring of t from indices n1
-- to n2, or to empty string if no such substring.
-- (from STRING )
require -- from STRING
argument_not_void: t /= void
ensure -- from STRING
is_substring: is_equal (t. substring (n1, n2))

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

share (other: like Current)
-- Make current string share the text of other.
-- Subsequent changes to the characters of current string
-- will also affect other, and conversely.
-- (from STRING )
require -- from STRING
argument_not_void: other /= void
ensure -- from STRING
shared_count: other. count = count

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy characters of other within bounds start_pos and
-- end_pos to current string starting at index index_pos.
-- (from STRING )
require -- from STRING
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( count - index_pos) >= (end_pos - start_pos)

tail (n: INTEGER )
-- Remove all characters except for the last n;
-- do nothing if n >= count .
-- (from STRING )
require -- from STRING
non_negative_argument: n >= 0
ensure -- from STRING
new_count: count = n. min (old count )

infix " + " (s: STRING ): STRING
-- Append a copy of 's' at the end of a copy of Current,
-- Then return the Result.
-- (from STRING )
require -- from STRING
argument_not_void: s /= void
ensure -- from STRING
result_exists: Result /= void
new_count: Result. count = count + s. count

feature -- Removal

prune (c: CHARACTER )
-- Remove first occurrence of c, if any.
-- (from STRING )
require -- from COLLECTION
prunable: prunable
require else -- from STRING
True

prune_all (c: CHARACTER )
-- Remove all occurrences of c.
-- (from STRING )
require -- from COLLECTION
prunable
require else -- from STRING
True
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from STRING
changed_count: count = (old count ) - (old occurrences (c))

prune_all_leading (c: CHARACTER )
-- Remove all leading occurrences of c.
-- (from STRING )

prune_all_trailing (c: CHARACTER )
-- Remove all trailing occurrences of c.
-- (from STRING )

remove (i: INTEGER )
-- Remove i-th character.
-- (from STRING )
require -- from STRING
index_small_enough: i <= count
index_large_enough: i > 0
ensure -- from STRING
new_count: count = old count - 1

wipe_out
-- Remove all characters.
-- (from STRING )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from STRING
is_empty: count = 0
empty_capacity: capacity = 0

feature -- Resizing

adapt_size
-- Adapt the size to accommodate count characters.
-- (from STRING )

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (newsize: INTEGER )
-- Ensure that the capacity is at least newsize.
-- (from STRING )
require -- from RESIZABLE
True
require else -- from STRING
new_size_non_negative: newsize >= 0
ensure -- from RESIZABLE
new_capacity: capacity >= i

resize (newsize: INTEGER )
-- Rearrange string so that it can accommodate
-- at least newsize characters.
-- Do not lose any previously entered character.
-- (from STRING )
require -- from STRING
new_size_non_negative: newsize >= 0

feature -- Conversion

boolean_format (object: BOOLEAN ): STRING
-- Converted string of object according to the database format
-- (from DB_FORMAT )

center_justify
-- Center justify the string using
-- the capacity as the width
-- (from STRING )

character_justify (pivot: CHARACTER ; position: INTEGER )
-- Justify a string based on a pivot
-- and the position it needs to be in
-- the final string.
-- This will grow the string if necessary
-- to get the pivot in the correct place.
-- (from STRING )
require -- from STRING
valid_position: position <= capacity
positive_position: position >= 1
pivot_not_space: pivot /= ' '
not_empty: not is_empty

charconv (i: INTEGER ): CHARACTER
-- Character corresponding to ascii code i
-- (from BASIC_ROUTINES )

date_format (object: DATE_TIME ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

left_justify
-- Left justify the string using
-- the capacity as the width
-- (from STRING )

linear_representation : LINEAR [ CHARACTER ]
-- Representation as a linear structure
-- (from STRING )

mirror
-- Reverse the order of characters.
-- "Hello world" -> "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: count = old count

mirrored : like Current
-- Mirror image of string;
-- result for "Hello world" is "dlrow olleH".
-- (from STRING )
ensure -- from STRING
same_count: Result. count = count

right_justify
-- Right justify the string using
-- the capacity as the width
-- (from STRING )

split (a_separator: CHARACTER ): LINEAR [ STRING ]
-- Split on a_separator.
-- Ignore separators in quotes.
-- (from STRING )
ensure -- from STRING
Result /= void

string_format (object: STRING ): STRING
-- Converted string of object according to the database format.
-- (from DB_FORMAT )
require -- from DB_FORMAT
argument_not_void: object /= void

to_boolean : BOOLEAN
-- Boolean value;
-- "True" yields True, "False" yields False
-- (case-insensitive)
-- (from STRING )
require -- from STRING
is_boolean: string_is_boolean

frozen to_c : ANY
-- A reference to a C form of current string.
-- Useful only for interfacing with C software.
-- (from STRING )

to_double : DOUBLE
-- "Double" value;
-- for example, when applied to "123.0", will yield 123.0 (double)
-- (from STRING )
require -- from STRING
represents_a_double: string_is_double

to_integer : INTEGER
-- Integer value;
-- for example, when applied to "123", will yield 123
-- (from STRING )
require -- from STRING
is_integer: string_is_integer

to_lower
-- Convert to lower case.
-- (from STRING )

to_real : REAL
-- Real value;
-- for example, when applied to "123.0", will yield 123.0
-- (from STRING )
require -- from STRING
represents_a_real: string_is_real

to_upper
-- Convert to upper case.
-- (from STRING )

feature -- Duplication

multiply (n: INTEGER )
-- Duplicate a string within itself
-- ("hello").multiply(3) => "hellohellohello"
-- (from STRING )
require -- from STRING
meaningful_multiplier: n >= 1

substring (n1, n2: INTEGER ): like Current
-- Copy of substring containing all characters at indices
-- between n1 and n2
-- (from STRING )
ensure -- from STRING
new_result_count: Result. count = n2 - n1 + 1 or Result. count = 0

feature -- Basic operations

abs (n: INTEGER ): INTEGER
-- Absolute value of n
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
non_negative_result: Result >= 0

append_substring (s: STRING ; n1, n2: INTEGER )
-- Append substring `s.substring (n1, n2)' to Current.
-- Faster than append s.substring (n1, n2).
require
string_exists: s /= void
meaningful_origin: 1 <= n1
meaningful_interval: n1 <= n2
meaningful_end: n2 <= s. count

bottom_int_div (n1, n2: INTEGER ): INTEGER
-- Greatest lower bound of the integer division of n1 by n2
-- (from BASIC_ROUTINES )

deep_traversal (object: ANY )
-- Perform a deep recursive traversal on
-- the transitive closure of the object network
-- reachable from root object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
root_object_non_void: object /= void

field_clean (i: INTEGER ; object: ANY ): BOOLEAN
-- Clean i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

field_copy (i: INTEGER ; object, value: ANY ): BOOLEAN
-- Copy value in i-th field of object.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void
value_exists: value /= void

get_complex_value (obj: ANY ; str: STRING )
-- Retrieve string value of reference object obj and put in str.
require
object_exists: obj /= void
str_exists: str /= void

get_value (obj: ANY ; str: STRING )
-- Retrieve string value of obj and put in str.
require
str_exists: str /= void

is_marked (obj: ANY ): BOOLEAN
-- Is obj marked?
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

mark (obj: ANY )
-- Mark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

nb_classes : INTEGER
-- Number of dynamic types in current system
-- (from EXT_INTERNAL )

object_finish_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

object_init_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

parse (s: STRING ): STRING
-- Parse string s by replacing each pattern ":<name>"
-- with the Eiffel object description whose name
-- also matches "<name>".

reference_object_action (i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

replace
-- Replace all occurences of :key by `ht.item (":key")'

rsign (r: REAL ): INTEGER
-- Sign of r:
-- -1 if r < 0
-- 0 if r = 0
-- +1 if r > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (r < 0) = (Result = - 1)
correct_zero: (r = 0) = (Result = 0)
correct_positive: (r > 0) = (Result = + 1)

sign (n: INTEGER ): INTEGER
-- Sign of n:
-- -1 if n < 0
-- 0 if n = 0
-- +1 if n > 0
-- (from BASIC_ROUTINES )
ensure -- from BASIC_ROUTINES
correct_negative: (n < 0) = (Result = - 1)
correct_zero: (n = 0) = (Result = 0)
correct_positive: (n > 0) = (Result = + 1)

simple_object_action (type, i: INTEGER ; object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

store_action (object: ANY )
-- Do nothing.
-- (To be redefined in heir.)
-- (from EXT_INTERNAL )

switch_mark (obj: ANY )
-- Unmark obj if marked or mark it if unmarked.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

traversal (object: ANY )
-- Traverse the entire object structure starting with root obj.
-- An object in the Eiffel run-time system includes the following:
-- a) Reference objects instance of a class type
-- b) Special reference objects allocated to refer to a
-- variable size object like STRING and ARRAY
-- c) Reference objects created for a generic type instantiated
-- as an expanded type or BITS n
-- LIMITATION: Current version excludes objects in the Eiffel
-- run-time system where expanded objects are encapsulated within
-- other objects
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: object /= void

unmark (obj: ANY )
-- Unmark object obj
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

unmark_structure (obj: ANY )
-- Unmark structure of objects.
-- (from EXT_INTERNAL )
require -- from EXT_INTERNAL
object_exists: obj /= void

up_int_div (n1, n2: INTEGER ): INTEGER
-- Least upper bound of the integer division
-- of n1 by n2
-- (from BASIC_ROUTINES )

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Output

out : like Current
-- Printable representation
-- (from STRING )

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from STRING
extendible: extendible
compare_character: not object_comparison
index_set_has_same_count: index_set . count = count
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from COMPARABLE
irreflexive_comparison: not (Current < Current)

end -- class SQL_SCAN


STRING_HDL Chart

 class
STRING_HDL

General
cluster: eiffelstore.support

Ancestors
ANY

Queries
is_mapped (key: STRING ): BOOLEAN
mapped_value (key: STRING ): ANY

Commands
clear_all
set_map_name (n: ANY ; key: STRING )
unset_map_name (key: STRING )


STRING_HDL Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:24 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
STRING_HDL

feature -- Status report

is_mapped (key: STRING ): BOOLEAN
-- Is key mapped to an Eiffel entity?
require
keys_exists: key /= void

mapped_value (key: STRING ): ANY
-- Value mapped with key
require
key_exists: key /= void
key_mapped: is_mapped (key)
ensure
result_exists: Result /= void

feature -- Status setting

clear_all
-- Remove all mapped keys.

set_map_name (n: ANY ; key: STRING )
-- Store item n with key key.
-- n can be Void.
require
key_exists: key /= void
not_key_in_table: not is_mapped (key)
ensure
ht . count = old ht . count + 1

unset_map_name (key: STRING )
-- Remove item associated with key key.
require
key_exists: key /= void
item_exists: is_mapped (key)
ensure
ht . count = old ht . count - 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class STRING_HDL


EiffelStore Samples

The following basic examples showcases the different EiffelStore capabilities:

  • esql: A command line SQL parser: very useful to test your Database connection!
  • select: A basic example to perform smart database queries.
  • insert: A basic example to easily insert data in your database.


Esql Sample

The Esql Sample

This sample consists of a command line SQL parser. SQL statements are filtered through a monitor and sent to the RDBMS.

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\store\esql\.
  • Choose the file that fits your platform and the DBMS you want to use:
    • Ace.odbc.windows.ace on Windows platforms for ODBC DBMS drivers
    • Ace.oracle.windows.ace on Window platforms for Oracle DBMS
    • Ace.oracle.unix.ace on Unix platforms for Oracle DBMS
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

This sample lets you interact with your database through a console.

First you have to enter the database connection information:

  • For ODBC:
    • Database user authentication:
Data Source Name: handson
Name: smith
Password: mypass

    Note: Name and Password are no required with ODBC. If you don't need Name and Password, you can simply hit Return when prompted.

  • For Oracle:
    • Database user authentication:
Name: smith@HANDSON
Password: mypass

    Note: you have to specify the Oracle User Name and Net Service Name with the syntax <user>@<service> where <user> stands for the User Name and <service> stands for the Net Service Name.

Then you can enter standard SQL queries to interact with your database, for instance:

SQL> select firstname, lastname from CONTACTS where lastname = 'Smith'
John    Smith
SQL>

Note: enter exit to quit the application.

Under the Hood

This sample showcases the use of the 3 basic classes to interact with your database:

  • DB_CONTROL to connect and disconnect to your database.
  • DB_SELECTION to perform 'select' queries.
  • DB_CHANGE to perform SQL queries that output no result.

The whole sample code is contained in the root class:

  • ESQL for Oracle.
  • ESQL_ODBC for ODBC.


cluster root_cluster

 Cluster
root_cluster

Classes
ESQL
ESQL_ODBC


ESQL Chart

 class
ESQL

General
cluster: root_cluster
create: make

Ancestors
ACTION
RDB_HANDLE

Queries
db_spec : DATABASE
found : BOOLEAN
is_logged_to_base : BOOLEAN

Commands
login (user_name, password: STRING )
login_and_connect (user_name, password: STRING )
make
set_application (application_name: STRING )
set_base
set_data_source (dsn: STRING )
set_group (groupid: STRING )
set_hostname (host_name: STRING )
set_role (roleid, rolepasswd: STRING )
start


ESQL Flat contracts

 class interface
ESQL

create

make
-- Start SQL_MONITOR

feature -- Initialization

login (user_name, password: STRING )
-- Login to database server under user_name with password.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_logged_to_base : BOOLEAN
-- Is current handle logged to Ingres server?
-- (from DATABASE_APPL )
ensure -- from DATABASE_APPL
test_condition: Result implies ( session_login /= void )

feature -- Status setting

set_application (application_name: STRING )
-- Set database application name with application_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: application_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_base
-- Initialize or re-activate database server
-- after a handle change.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base
ensure -- from DATABASE_APPL
handle . database = session_database
handle . process = session_process
handle . status = session_status
handle . execution_type = session_execution_type
handle . login = session_login

set_data_source (dsn: STRING )
-- Set database source name with dsn.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: dsn /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_group (groupid: STRING )
-- Set database group with groupId.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: groupid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_hostname (host_name: STRING )
-- Set database host name with host_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: host_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_role (roleid, rolepasswd: STRING )
-- Set database role with roleId and password(if it has one) with rolePassWd.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: roleid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

feature -- Basic operations

found : BOOLEAN
-- Is there any exit condition found
-- while iterating on selection results in
-- load_result of DB_SELECTION?
-- (Default: do nothing)
-- (from ACTION )

start
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)
-- (from ACTION )

feature

make
-- Start SQL_MONITOR

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ESQL


ESQL_ODBC Chart

 class
ESQL_ODBC

General
cluster: root_cluster
create: make

Ancestors
ACTION
RDB_HANDLE

Queries
db_spec : DATABASE
found : BOOLEAN
is_logged_to_base : BOOLEAN

Commands
login (user_name, password: STRING )
login_and_connect (user_name, password: STRING )
make
set_application (application_name: STRING )
set_base
set_data_source (dsn: STRING )
set_group (groupid: STRING )
set_hostname (host_name: STRING )
set_role (roleid, rolepasswd: STRING )
start


ESQL_ODBC Flat contracts

 class interface
ESQL_ODBC

create

make
-- Start SQL_MONITOR

feature -- Initialization

login (user_name, password: STRING )
-- Login to database server under user_name with password.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_logged_to_base : BOOLEAN
-- Is current handle logged to Ingres server?
-- (from DATABASE_APPL )
ensure -- from DATABASE_APPL
test_condition: Result implies ( session_login /= void )

feature -- Status setting

set_application (application_name: STRING )
-- Set database application name with application_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: application_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_base
-- Initialize or re-activate database server
-- after a handle change.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base
ensure -- from DATABASE_APPL
handle . database = session_database
handle . process = session_process
handle . status = session_status
handle . execution_type = session_execution_type
handle . login = session_login

set_data_source (dsn: STRING )
-- Set database source name with dsn.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: dsn /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_group (groupid: STRING )
-- Set database group with groupId.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: groupid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_hostname (host_name: STRING )
-- Set database host name with host_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: host_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_role (roleid, rolepasswd: STRING )
-- Set database role with roleId and password(if it has one) with rolePassWd.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: roleid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

feature -- Basic operations

found : BOOLEAN
-- Is there any exit condition found
-- while iterating on selection results in
-- load_result of DB_SELECTION?
-- (Default: do nothing)
-- (from ACTION )

start
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)
-- (from ACTION )

feature

make
-- Start SQL_MONITOR

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ESQL_ODBC


Selector Sample

The Selector Sample

This sample creates a DB_BOOK table in your database, enters sample data in it and lets you select rows from this table with author's name.

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\store\select\.
  • Choose the file that fits your platform and the DBMS you want to use:
    • Ace.odbc.windows.ace on Windows platforms for ODBC DBMS drivers
    • Ace.oracle.windows.ace on Window platforms for Oracle DBMS
    • Ace.oracle.unix.ace on Unix platforms for Oracle DBMS
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

Before running this sample, one must do link a specific file to data.sql as follows:

With Oracle:

ln data.sql.oracle data.sql

With ODBC:

ln data.sql.odbc data.sql

Caution: the data.sql file must be available in the sample application current directory. If you run the sample from EiffelStudio, this directory should be the EIFGEN/W_CODE/ directory of your project.

This sample lets you interact with your database through a console.

First you have to enter the database connection information:

  • For ODBC:
    • Database user authentication:
Data Source Name: handson
Name: smith
Password: mypass

    Note: Name and Password are no required with ODBC. If you don't need Name and Password, you can simply hit Return when prompted.

  • For Oracle:
    • Database user authentication:
Name: smith@HANDSON
Password: mypass

    Note: you have to specify the Oracle User Name and Net Service Name with the syntax <user>@<service> where <user> stands for the User Name and <service> stands for the Net Service Name.

Then you can select rows from this table with author's name, for instance:

Author? ('exit' to terminate):Bertrand Meyer
Seeking for books whose author's name match: Bertrand Meyer

Author:Bertrand Meyer
Title:Eiffel The Libraries
Quantity:11
Price:20
double_value:435.60000610351562
First publication:07/01/1994 12:00:00.0 AM

Author:Bertrand Meyer
Title:Eiffel The Language
Quantity:9
Price:51
double_value:775.22998046875
First publication:07/01/1992 12:00:00.0 AM

Author? ('exit' to terminate):

Note: enter exit to quit the application.

Under the Hood

This sample showcases the use of the DB_SELECTION class to perform smart select queries, using:

  • Database data and Eiffel objects Coupling.
  • Variables Binding.

The whole sample code is contained in the root class:

  • SELECTOR for Oracle.
  • SELECTOR_ODBC for ODBC.


cluster root_cluster

 Cluster
root_cluster

Classes
SELECTOR
SELECTOR_ODBC


SELECTOR Chart

 class
SELECTOR

General
cluster: root_cluster
create: make

Ancestors
ACTION
RDB_HANDLE

Queries
db_spec : DATABASE
found : BOOLEAN
is_logged_to_base : BOOLEAN

Commands
login (user_name, password: STRING )
login_and_connect (user_name, password: STRING )
make
set_application (application_name: STRING )
set_base
set_data_source (dsn: STRING )
set_group (groupid: STRING )
set_hostname (host_name: STRING )
set_role (roleid, rolepasswd: STRING )
start


SELECTOR Flat contracts

 class interface
SELECTOR

create

make

feature -- Initialization

login (user_name, password: STRING )
-- Login to database server under user_name with password.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_logged_to_base : BOOLEAN
-- Is current handle logged to Ingres server?
-- (from DATABASE_APPL )
ensure -- from DATABASE_APPL
test_condition: Result implies ( session_login /= void )

feature -- Status setting

set_application (application_name: STRING )
-- Set database application name with application_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: application_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_base
-- Initialize or re-activate database server
-- after a handle change.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base
ensure -- from DATABASE_APPL
handle . database = session_database
handle . process = session_process
handle . status = session_status
handle . execution_type = session_execution_type
handle . login = session_login

set_data_source (dsn: STRING )
-- Set database source name with dsn.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: dsn /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_group (groupid: STRING )
-- Set database group with groupId.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: groupid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_hostname (host_name: STRING )
-- Set database host name with host_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: host_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_role (roleid, rolepasswd: STRING )
-- Set database role with roleId and password(if it has one) with rolePassWd.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: roleid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

feature -- Basic operations

found : BOOLEAN
-- Is there any exit condition found
-- while iterating on selection results in
-- load_result of DB_SELECTION?
-- (Default: do nothing)
-- (from ACTION )

start
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)
-- (from ACTION )

feature

make

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SELECTOR


SELECTOR_ODBC Chart

 class
SELECTOR_ODBC

General
cluster: root_cluster
create: make

Ancestors
ACTION
RDB_HANDLE

Queries
db_spec : DATABASE
found : BOOLEAN
is_logged_to_base : BOOLEAN

Commands
login (user_name, password: STRING )
login_and_connect (user_name, password: STRING )
make
set_application (application_name: STRING )
set_base
set_data_source (dsn: STRING )
set_group (groupid: STRING )
set_hostname (host_name: STRING )
set_role (roleid, rolepasswd: STRING )
start


SELECTOR_ODBC Flat contracts

 class interface
SELECTOR_ODBC

create

make

feature -- Initialization

login (user_name, password: STRING )
-- Login to database server under user_name with password.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_logged_to_base : BOOLEAN
-- Is current handle logged to Ingres server?
-- (from DATABASE_APPL )
ensure -- from DATABASE_APPL
test_condition: Result implies ( session_login /= void )

feature -- Status setting

set_application (application_name: STRING )
-- Set database application name with application_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: application_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_base
-- Initialize or re-activate database server
-- after a handle change.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base
ensure -- from DATABASE_APPL
handle . database = session_database
handle . process = session_process
handle . status = session_status
handle . execution_type = session_execution_type
handle . login = session_login

set_data_source (dsn: STRING )
-- Set database source name with dsn.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: dsn /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_group (groupid: STRING )
-- Set database group with groupId.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: groupid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_hostname (host_name: STRING )
-- Set database host name with host_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: host_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_role (roleid, rolepasswd: STRING )
-- Set database role with roleId and password(if it has one) with rolePassWd.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: roleid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

feature -- Basic operations

found : BOOLEAN
-- Is there any exit condition found
-- while iterating on selection results in
-- load_result of DB_SELECTION?
-- (Default: do nothing)
-- (from ACTION )

start
-- Execute something whenever
-- routine load_result of DB_SELECTION is
-- called with Current set as stop_condition,
-- before iterating on query result.
-- (Default: do nothing)
-- (from ACTION )

feature

make

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SELECTOR_ODBC


Inserter Sample

The Inserter Sample

This sample lets the user insert a DB_BOOK object in your database using EiffelStore insertion facilities.

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\store\select\.
  • Choose the file that fits your platform and the DBMS you want to use:
    • Ace.odbc.windows.ace on Windows platforms for ODBC DBMS drivers
    • Ace.oracle.windows.ace on Window platforms for Oracle DBMS
    • Ace.oracle.unix.ace on Unix platforms for Oracle DBMS
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

This sample lets you interact with your database through a console.

First you have to enter the database connection information:

  • For ODBC:
    • Database user authentication:
Data Source Name: handson
Name: smith
Password: mypass

    Note: Name and Password are no required with ODBC. If you don't need Name and Password, you can simply hit Return when prompted.

  • For Oracle:
    • Database user authentication:
Name: smith@HANDSON
Password: mypass

    Note: you have to specify the Oracle User Name and Net Service Name with the syntax <user>@<service> where <user> stands for the User Name and <service> stands for the Net Service Name.

Then you can insert a book in the database, for instance:

What new book should I create?
Author? John Smith
Title? My book
Quantity? 1
Price? 50
Year? 2001
Double value? 12.675
Object inserted

Note: if your database does not contain a DB_BOOK table, this example will create it.

Under the Hood

This sample showcases the use of the DB_STORE class to perform database insertions where the SQL language is totally abstracted.

The whole sample code is contained in the root class:

  • INSERTER for Oracle.
  • INSERTER_ODBC for ODBC.


cluster root_cluster

 Cluster
root_cluster

Classes
INSERTER
INSERTER_ODBC


INSERTER Chart

 class
INSERTER

General
cluster: root_cluster
create: make

Ancestors
RDB_HANDLE

Queries
db_spec : DATABASE
is_logged_to_base : BOOLEAN

Commands
login (user_name, password: STRING )
login_and_connect (user_name, password: STRING )
make
set_application (application_name: STRING )
set_base
set_data_source (dsn: STRING )
set_group (groupid: STRING )
set_hostname (host_name: STRING )
set_role (roleid, rolepasswd: STRING )


INSERTER Flat contracts

 class interface
INSERTER

create

make

feature -- Initialization

login (user_name, password: STRING )
-- Login to database server under user_name with password.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_logged_to_base : BOOLEAN
-- Is current handle logged to Ingres server?
-- (from DATABASE_APPL )
ensure -- from DATABASE_APPL
test_condition: Result implies ( session_login /= void )

feature -- Status setting

set_application (application_name: STRING )
-- Set database application name with application_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: application_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_base
-- Initialize or re-activate database server
-- after a handle change.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base
ensure -- from DATABASE_APPL
handle . database = session_database
handle . process = session_process
handle . status = session_status
handle . execution_type = session_execution_type
handle . login = session_login

set_data_source (dsn: STRING )
-- Set database source name with dsn.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: dsn /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_group (groupid: STRING )
-- Set database group with groupId.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: groupid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_hostname (host_name: STRING )
-- Set database host name with host_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: host_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_role (roleid, rolepasswd: STRING )
-- Set database role with roleId and password(if it has one) with rolePassWd.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: roleid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

feature

make

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class INSERTER


INSERTER_ODBC Chart

 class
INSERTER_ODBC

General
cluster: root_cluster
create: make

Ancestors
RDB_HANDLE

Queries
db_spec : DATABASE
is_logged_to_base : BOOLEAN

Commands
login (user_name, password: STRING )
login_and_connect (user_name, password: STRING )
make
set_application (application_name: STRING )
set_base
set_data_source (dsn: STRING )
set_group (groupid: STRING )
set_hostname (host_name: STRING )
set_role (roleid, rolepasswd: STRING )


INSERTER_ODBC Flat contracts

 class interface
INSERTER_ODBC

create

make

feature -- Initialization

login (user_name, password: STRING )
-- Login to database server under user_name with password.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

login_and_connect (user_name, password: STRING )
-- Login under user_name with password
-- and immediately connect to Ingres database server,
-- using a temporary local DB_CONTROL object.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
user_name_ok: db_spec . user_name_ok (user_name)
password_ok: db_spec . password_ok (password)

feature -- Access

db_spec : DATABASE
-- Handle to actual database
-- (from HANDLE_SPEC )
ensure -- from HANDLE_SPEC
not_void: Result /= void

feature -- Status report

is_logged_to_base : BOOLEAN
-- Is current handle logged to Ingres server?
-- (from DATABASE_APPL )
ensure -- from DATABASE_APPL
test_condition: Result implies ( session_login /= void )

feature -- Status setting

set_application (application_name: STRING )
-- Set database application name with application_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: application_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_base
-- Initialize or re-activate database server
-- after a handle change.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base
ensure -- from DATABASE_APPL
handle . database = session_database
handle . process = session_process
handle . status = session_status
handle . execution_type = session_execution_type
handle . login = session_login

set_data_source (dsn: STRING )
-- Set database source name with dsn.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: dsn /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_group (groupid: STRING )
-- Set database group with groupId.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: groupid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_hostname (host_name: STRING )
-- Set database host name with host_name.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: host_name /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

set_role (roleid, rolepasswd: STRING )
-- Set database role with roleId and password(if it has one) with rolePassWd.
-- (from DATABASE_APPL )
require -- from DATABASE_APPL
argument_exist: roleid /= void
ensure -- from DATABASE_APPL
is_logged_to_base: is_logged_to_base

feature

make

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class INSERTER_ODBC


EiffelThread

Type: Library
Platform: Any
Version: 5.0

See:

  • Content
  • Reference


EiffelThread Content

Content

The EiffelThread library includes the main components needed to build multithreaded systems.
See:

  • Introduction
  • Library description
  • FAQ


EiffelThread Content

EiffelThread Library Content

Multithreaded applications provide a flexible, exciting way of utilizing the power of modern computer systems. ISE Eiffel supports a powerful multithreaded model, fast and easy to use.

The EiffelThread library is mapped to the C thread standard libraries: it supports Windows, POSIX-like and Unix International Threads. EiffelThread is supported by the ISE compiler and run-time on Windows, Linux, FreeBSD, LinuxPPC, Solaris, SGI, VxWorks, LynxOS, CRAY and Unixware.

This document will explain how to use the EiffelThread library. To fully take advantage of this documentation you should know some basics about multithreaded systems

To enable multithreading in the ISE EiffelStudio environment, you will need to do some changes in your project settings. To learn more about once feature in an Eiffel multithreaded environment, click here.

Users of the EiffelThread library in version 4.5 and older should read "changes between 4.5 and 5.0" to get the info they need to migrate their code to the new implementation of threads in Eiffel.

If you encounter problems, take a look at the FAQ list.


Thread library overview

This is only a quick overview of the Thread library. The reference of this library should give all its content.

Creating and launching threads: the class THREAD (deferred)

The class of the thread object you want to create should inherit the THREAD class.
Your thread is represented by a class which inherits from THREAD (deferred class).

    class
        MY_THREAD

    inherit
        THREAD>
        ...

    feature

        execute is
            -- define the deferred feature from THREAD.
        do
            ...
        end
        ...

    end --class MY_THREAD
Creating a thread is like creating an Eiffel object:
    my_thread: MY_THREAD
        -- MY_THREAD inherits from THREAD and defines
        -- the deferred procedure `execute'

    create my_thread

Note: You have created a thread object but have not started the thread itself yet.
To run the thread, use the feature launch from THREAD.

    my_thread.launch
On the Eiffel side, the procedure execute will be launched. This procedure is deferred in class THREAD, you have to define it in MY_THREAD.

On the C side, a C thread will be created and launched.

Caution: you may call join_all and the end of the exceution of the parent thread if you do not want it to die before its child, otherwise they may prematurily terminate.

The class MUTEX

The implementation of the class MUTEX is mapped on the C standard thread library. An instance of class MUTEX can be shared between different thread.

my_mutex.pointer is the pointer to the nested C mutex of my_mutex.

  • Declaration of the mutex:
        my_mutex: MUTEX
  • Creation of mutex:
        create my_mutex.make
  • Locking the mutex:
        my_mutex.lock
  • Unlocking the mutex:
        my_mutex.unlock
  • try_lock: if it is not locked yet, lock the mutex and return True, otherwise it returns False.
        my_mutex.try_lock
  • Is my mutex initialized?
        my_mutex.is_set

Note: on Windows: The MUTEX objects on Windows are recursive while they are not on Unix. A recursive mutex can be locked twice by the same thread.

Caution: be sure that a mutex is unlocked when it is disposed.

The class SEMAPHORE

Like MUTEX, the features of this class are mapped on the C thread library. An instance of class SEMAPHORE can be shared between thread.

  • Declaration of the semaphore :
        my_sem: SEMAPHORE
    Creation of semaphore: initialize semaphore with nb_tokens, it requires nb_tokens >= 0
        create my_sem.make (nb_tokens)
  • Wait for a token:
        my_sem.wait
  • Give back a token:
        my_sem.post
  • try_wait, similar to try_lock from MUTEX, if a token is available, take it and return True, otherwise return False.
        my_sem.try_wait

Caution: be sure that a semaphore does not wait for a token when it is disposed

The class CONDITION_VARIABLE

This class allows to use condition variables in Eiffel. An instance of class CONDITION_VARIABLE can be shared between threads.

  • Declaration of the condition variable
        my_cond: CONDITION_VARIABLE
  • Creation:
        create my_cond.make
  • Wait for a signal (send by signal). You need to use a mutex.
        my_mutex: MUTEX

    create my_mutex.make

    my_mutex must be locked by the calling thread so as wait can be called. wait atomically unlocks my_mutex and waits for the condition variable my_mutex to receive a signal. As soon as it received a signal, my_cond locks my_mutex;

        my_mutex.lock
        -- You must lock `my_mutex' before calling wait.

    my_cond.wait (my_mutex)
        -- Here the critical code to execute when `my_cond' received a signal.

    my_mutex.unlock
        -- Unlock the mutex at the end of the critical section.
  • Send a signal one thread blocked on the condition variable `my_cond'.
        my_cond.signal
  • Send a signal to all the threads blocked on the condition variable `my_cond'.
        my_cond.broadcast

Caution: be sure that a condition variable is unblocked when it is disposed.

Miscellaneous classes

class THREAD_ATTRIBUTES: defines the attributes of an Eiffel Thread regarding the thread scheduling policy and priority.

Controlling execution: THREAD_CONTROL

  • yield: the calling thread yields its execution in favor of an other thread of same priority.
  • join_all: the calling thread waits for all other threads to finished (all its children).
  • A parent thread can wait for the termination of a child process through the feature join of class THREAD_CONTROL (inherited by THREAD):
        thr: MY_THREAD
    ...
    thr.launch
    ...
    thr.join


Multithread FAQ

I've launched several threads and they do not seem to be executed:

The thread that launched the several threads may be dead before its children.

Two threads can lock the same mutex, however none of them unlocks it:

Same problem as above. Maybe the first thread that locked the shared mutex died before the second tried to lock it: thus, the first one automatically unlocked it when it died. You should put a join_all or an infinite loop in the parent thread.

I've added the option multithreaded in the project settings and it crashes:

If you have already compiled your system in non-MT mode, you cannot change the mode of compilation and simply relaunch your compilation (the generated C-code would be incompatible). Delete all your object files in your W_code or F_code directory and freeze or finalize the system again.

My once function changed during my MT-Eiffel-program:

The once functions are once per thread in Multithreaded mode. Hence, each once function is thread-specific and is initialized the first time it is called in a thread.

You can create a once per process by following these instructions.


cluster thread

Cluster
    thread

Classes
    CONDITION_VARIABLE
    MUTEX
    OBJECT_OWNER
    PROXY [G]
    SEMAPHORE
    THREAD
    THREAD_ATTRIBUTES
    THREAD_CONTROL


CONDITION_VARIABLE Chart

class
    CONDITION_VARIABLE

General
    cluster: thread
    description: "Class describing a condition variable."
    create: make

Ancestors
    MEMORY
    OBJECT_OWNER

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    has_owner: BOOLEAN
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    is_set: BOOLEAN
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    thread_is_owner: BOOLEAN
    Total_memory: INTEGER

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    broadcast
    collect
    collection_off
    collection_on
    destroy
    disable_time_accounting
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    make
    mem_free (addr: POINTER)
    record_owner
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)
    signal
    wait (a_mutex: MUTEX)


CONDITION_VARIABLE Flat contracts

indexing
    description: "Class describing a condition variable."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

class interface
    CONDITION_VARIABLE

create

    make
            -- Create and initialize condition variable.

feature -- Initialization

    make
            -- Create and initialize condition variable.

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    has_owner: BOOLEAN
            -- Is object already associated with a thread?
            -- (from OBJECT_OWNER)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    is_set: BOOLEAN
            -- Is cond_pointer initialized?

    record_owner
            -- Record calling thread's id.
            -- (from OBJECT_OWNER)
        require -- from OBJECT_OWNER
            not_recorded_yet: not has_owner

    thread_is_owner: BOOLEAN
            -- Is calling thread creator of the object?
            -- (from OBJECT_OWNER)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)

    collecting: BOOLEAN
            -- Is garbage collection enabled?
            -- (from MEMORY)

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.
            -- (from MEMORY)

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.
            -- (from MEMORY)

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)

    broadcast
            -- Unblock all threads blocked on the current condition variable.
        require
            valid_pointer: is_set

    collection_off
            -- Disable garbage collection.
            -- (from MEMORY)

    collection_on
            -- Enable garbage collection.
            -- (from MEMORY)

    destroy
            -- Destroy condition variable.
        require
            valid_pointer: is_set

    disable_time_accounting
            -- Disable GC time accounting (default).
            -- (from MEMORY)

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    signal
            -- Unblock one thread blocked on the current condition variable.
        require
            valid_pointer: is_set

    wait (a_mutex: MUTEX)
            -- Block calling thread on current condition variable.
        require
            valid_pointer: is_set

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CONDITION_VARIABLE


MUTEX Chart

class
    MUTEX

General
    cluster: thread
    description: "Mutex synchronization object, allows threads to access global data through critical sections."
    create: make, default_create

Ancestors
    MEMORY
    OBJECT_OWNER

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    has_locked: BOOLEAN
    has_owner: BOOLEAN
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    is_set: BOOLEAN
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    thread_is_owner: BOOLEAN
    Total_memory: INTEGER
    trylock: BOOLEAN

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    default_create
    destroy
    disable_time_accounting
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    lock
    mem_free (addr: POINTER)
    record_owner
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)
    unlock


MUTEX Flat contracts

indexing
    description: "Mutex synchronization object, allows threads to access global data through critical sections."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

class interface
    MUTEX

create

    default_create
            -- Create mutex.
        ensure then
            valid_mutex: mutex_pointer /= default_pointer

    make
            -- Create mutex
        ensure
            valid_mutex: mutex_pointer /= default_pointer

feature -- Initialization

    default_create
            -- Create mutex.
        ensure then
            valid_mutex: mutex_pointer /= default_pointer

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    has_owner: BOOLEAN
            -- Is object already associated with a thread?
            -- (from OBJECT_OWNER)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    is_set: BOOLEAN
            -- Is mutex initialized?

    record_owner
            -- Record calling thread's id.
            -- (from OBJECT_OWNER)
        require -- from OBJECT_OWNER
            not_recorded_yet: not has_owner

    thread_is_owner: BOOLEAN
            -- Is calling thread creator of the object?
            -- (from OBJECT_OWNER)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)

    collecting: BOOLEAN
            -- Is garbage collection enabled?
            -- (from MEMORY)

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.
            -- (from MEMORY)

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.
            -- (from MEMORY)

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)

    collection_off
            -- Disable garbage collection.
            -- (from MEMORY)

    collection_on
            -- Enable garbage collection.
            -- (from MEMORY)

    destroy
            -- Destroy mutex.
        require
            valid_mutex: is_set

    disable_time_accounting
            -- Disable GC time accounting (default).
            -- (from MEMORY)

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)

    has_locked: BOOLEAN
            -- Has client been successful in locking mutex without waiting?
            -- Was declared in MUTEX as synonym of trylock.
        require
            valid_mutex: is_set

    lock
            -- Lock mutex, waiting if necessary until that becomes possible.
        require
            valid_mutex: is_set

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    trylock: BOOLEAN
            -- Has client been successful in locking mutex without waiting?
            -- Was declared in MUTEX as synonym of has_locked.
        require
            valid_mutex: is_set

    unlock
            -- Unlock mutex.
        require
            valid_mutex: is_set

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class MUTEX


OBJECT_OWNER Chart

class
    OBJECT_OWNER

General
    cluster: thread
    description: "Class meant to record which thread has created a certain object so that another thread can't call its dispose routine."

Ancestors
    ANY

Queries
    has_owner: BOOLEAN
    thread_is_owner: BOOLEAN

Commands
    record_owner


OBJECT_OWNER Flat contracts

indexing
    description: "Class meant to record which thread has created a certain object so that another thread can't call its dispose routine."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

class interface
    OBJECT_OWNER

feature -- Access

    has_owner: BOOLEAN
            -- Is object already associated with a thread?

    record_owner
            -- Record calling thread's id.
        require
            not_recorded_yet: not has_owner

    thread_is_owner: BOOLEAN
            -- Is calling thread creator of the object?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class OBJECT_OWNER


PROXY Chart

class
    PROXY [G]

General
    obsolete: "Not needed anymore since object does not need protection"
    cluster: thread
    description: "Indirection proxy allowing share of objects between threads, without having the garbage collectors intercollect each-other."
    create: put, make

Ancestors
    ANY

Queries
    item: G


PROXY Flat contracts

indexing
    description: "Indirection proxy allowing share of objects between threads, without having the garbage collectors intercollect each-other."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

class interface
    PROXY [G]

create

    frozen make (obj: G)
            -- Make proxy denote obj.
            -- Was declared in PROXY as synonym of put.
        require
            not_void: obj /= void

    frozen put (obj: G)
            -- Make proxy denote obj.
            -- Was declared in PROXY as synonym of make.
        require
            not_void: obj /= void

feature -- Access

    item: G
            -- Object attached to proxy.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class PROXY


SEMAPHORE Chart

class
    SEMAPHORE

General
    cluster: thread
    description: "Semaphore synchronization object, allows threads to access global data through critical sections."
    create: make

Ancestors
    MEMORY
    OBJECT_OWNER

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    has_owner: BOOLEAN
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    is_set: BOOLEAN
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    thread_is_owner: BOOLEAN
    Total_memory: INTEGER
    try_wait: BOOLEAN
    trywait: BOOLEAN

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    destroy
    disable_time_accounting
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    make (count: INTEGER)
    mem_free (addr: POINTER)
    post
    record_owner
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)
    wait


SEMAPHORE Flat contracts

indexing
    description: "Semaphore synchronization object, allows threads to access global data through critical sections."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

class interface
    SEMAPHORE

create

    make (count: INTEGER)
            -- Create semaphore.
        require
            count_positive: count >= 0
        ensure
            valid_semaphore: sem_pointer /= default_pointer

feature -- Initialization

    make (count: INTEGER)
            -- Create semaphore.
        require
            count_positive: count >= 0
        ensure
            valid_semaphore: sem_pointer /= default_pointer

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    has_owner: BOOLEAN
            -- Is object already associated with a thread?
            -- (from OBJECT_OWNER)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    is_set: BOOLEAN
            -- Is mutex initialized?

    record_owner
            -- Record calling thread's id.
            -- (from OBJECT_OWNER)
        require -- from OBJECT_OWNER
            not_recorded_yet: not has_owner

    thread_is_owner: BOOLEAN
            -- Is calling thread creator of the object?
            -- (from OBJECT_OWNER)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)

    collecting: BOOLEAN
            -- Is garbage collection enabled?
            -- (from MEMORY)

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.
            -- (from MEMORY)

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.
            -- (from MEMORY)

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)

    collection_off
            -- Disable garbage collection.
            -- (from MEMORY)

    collection_on
            -- Enable garbage collection.
            -- (from MEMORY)

    destroy
            -- Destroy semaphore.
        require
            valid_semaphore: is_set

    disable_time_accounting
            -- Disable GC time accounting (default).
            -- (from MEMORY)

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)

    post
            -- Increment semaphore count.
        require
            valid_semaphore: is_set

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    try_wait: BOOLEAN
            -- Has client been successful in decrementing semaphore
            -- count without waiting?
            -- Was declared in SEMAPHORE as synonym of trywait.
        require
            valid_semaphore: is_set

    trywait: BOOLEAN
            -- Has client been successful in decrementing semaphore
            -- count without waiting?
            -- Was declared in SEMAPHORE as synonym of try_wait.
        require
            valid_semaphore: is_set

    wait
            -- Decrement semaphore count, waiting if necessary until
            -- that becomes possible.
        require
            valid_semaphore: is_set

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SEMAPHORE


THREAD_ATTRIBUTES Chart

class
    THREAD_ATTRIBUTES

General
    cluster: thread
    description: "Class defining thread attributes."
    create: make

Ancestors
    ANY

Queries
    Default_policy: INTEGER
    default_priority: INTEGER
    detached: BOOLEAN
    Fifo: INTEGER
    max_priority: INTEGER
    min_priority: INTEGER
    Other: INTEGER
    priority: INTEGER
    Round_robin: INTEGER
    scheduling_policy: INTEGER

Commands
    set_detached (bool: BOOLEAN)
    set_policy (policy: INTEGER)
    set_priority (prio: INTEGER)


THREAD_ATTRIBUTES Flat contracts

indexing
    description: "Class defining thread attributes."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

class interface
    THREAD_ATTRIBUTES

create

    make
            -- Set default values to the thread attributes.

feature -- Access

    detached: BOOLEAN

    priority: INTEGER

    scheduling_policy: INTEGER

feature -- Attribute change

    set_detached (bool: BOOLEAN)
            -- Set the detached state of the thread attribute to bool. If
            -- bool is True (default), the thread will be created detached
            -- on the C level. You can always join a thread, even if it was
            -- created detached. This only affects the C join().

    set_policy (policy: INTEGER)
            -- Set scheduling policy to policy.  Possible values are:
            -- default_policy, other, fifo and round_robin.
        require
            valid_policy: (policy >= 0) and (policy <= 3)

    set_priority (prio: INTEGER)
            -- Set thread priority to prio.
        require
            valid_priority: (prio >= min_priority) and (prio <= max_priority)

feature -- Externals

    default_priority: INTEGER
            -- Get default thread priority for the current architecture.

    max_priority: INTEGER
            -- Get maximum thread priority for the current architecture.

    min_priority: INTEGER
            -- Get minimum thread priority for the current architecture.

feature -- Implementation for scheduling_policy

    Default_policy: INTEGER is 0

    Fifo: INTEGER is 2

    Other: INTEGER is 1

    Round_robin: INTEGER is 3

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class THREAD_ATTRIBUTES


THREAD_CONTROL Chart

class
    THREAD_CONTROL

General
    cluster: thread
    description: "Control over thread execution."

Ancestors
    ANY

Commands
    join
    join_all
    native_join (term: POINTER)
    yield


THREAD_CONTROL Flat contracts

indexing
    description: "Control over thread execution."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

class interface
    THREAD_CONTROL

feature -- Basic operations

    join
            -- The calling thread waits for the current child thread to
            -- terminate.

    join_all
            -- The calling thread waits for all other threads to terminate.

    native_join (term: POINTER)
            -- Same as join except that the low-level architecture-dependant
            -- routine is used. The thread must not be created detached.

    yield
            -- The calling thread yields its execution in favor of another
            -- thread.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class THREAD_CONTROL


THREAD Chart

deferred class
    THREAD

General
    cluster: thread
    description: "Class defining an Eiffel thread."

Ancestors
    THREAD_CONTROL

Queries
    thread_id: POINTER

Commands
    execute
    join
    join_all
    launch
    launch_with_attributes (attr: THREAD_ATTRIBUTES)
    native_join (term: POINTER)
    yield


THREAD Flat contracts

indexing
    description: "Class defining an Eiffel thread."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.4 $"

deferred class interface
    THREAD

feature -- Access

    thread_id: POINTER
            -- Pointer to the thread-id of the current thread object.

feature -- Basic operations

    execute
            -- Routine executed by new thread.

    join
            -- The calling thread waits for the current child thread to
            -- terminate.
            -- (from THREAD_CONTROL)

    join_all
            -- The calling thread waits for all other threads to terminate.
            -- (from THREAD_CONTROL)

    launch
            -- Initialize a new thread running execute.

    launch_with_attributes (attr: THREAD_ATTRIBUTES)
            -- Initialize a new thread running execute, using attributes.

    native_join (term: POINTER)
            -- Same as join except that the low-level architecture-dependant
            -- routine is used. The thread must not be created detached.
            -- (from THREAD_CONTROL)

    yield
            -- The calling thread yields its execution in favor of another
            -- thread.
            -- (from THREAD_CONTROL)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class THREAD


EiffelTime

Type: Library
Platform: Any
Version: 5.0

See:

  • Content
  • Reference


EiffelTime library

The library EiffelTime is built on three notions of time. The absolute notion (for example, what time is it? 3:45 p.m.) is used for events. It may be useful also to deal with an interval between two events (the meeting is between 3:45 p.m. and 6:00 p.m.). Finally EiffelTime has the notion of duration, which is the length of an interval (the meeting will take 2:15). The notion of absolute is linked with duration by the use of an origin.


Absolute time

The classes dealing with date and those dealing with time have almost the same construction. At the top of the hierarchy are the constants and the notion of value (TIME_VALUE, DATE_VALUE, DATE_TIME_VALUE). From this notion come two kinds of heirs which are the absolute notion of time (classes DATE, TIME and DATE_TIME) and the notion of duration (classes DATE_DURATION, TIME_DURATION, DATE_TIME_DURATION).

DATE, TIME and DATE_TIME inherit from the deferred class ABSOLUTE. It implies that instances of these classes are used as absolutes. We can imagine an oriented axis on which are reported values. ABSOLUTE inherits COMPARABLE, there is a complete order inside the class and its heir. ABSOLUTE is a client of DURATION, so that each instance of ABSOLUTE is linked with the duration between the origin and itself.

The default way to compare absolute objects is to compare their respective duration to each other.

TIME

TIME deals with hour, minute and second. Is is possible to use more precision for time (there is no limit inside the class). See More precision in TIME for documentation. This section deals only with second.

Creation

There are three ways to create an instance of the class TIME: by choosing the time (make), by getting the time from the system (make_now), or by choosing the number of seconds elapsed from the origin (make_by_seconds). The arguments of make and make_by_seconds have to respect the range of a day (see preconditions).

Origin and cyclic representation

The origin is 0 hour 0 minute and 0 second. Notion of time is relative to a day in a cyclic representation: days begin at 0:0:0 and end at 23:59:59. If a second is added to 23:59:59 then the result will be 0:0:0. Subtracting a minute to 0:0:0 will yield 23:59:0.

Comparison

Instances of TIME may be compared. Functions <, + > and >= are available. Function is_equal must be use to test equality. = will compare references.

Measurement

The duration linked to an instance of TIME (attribute duration) is an instance of TIME_DURATION. It is the duration from the origin until the current time. The function seconds returns the number of seconds since the origin. This function may be useful to get the number of seconds between two events. The feature - creates an interval between two instances of TIME. The duration of this interval is given by the function duration. However, this duration is not canonical (See Duration for precisions). In TIME, the feature relative_duration returns the same duration, but more efficiently and also it is canonical.

Operations

  • Set directly hour, minute and second with set_hour, set_minute and set_second. Arguments must satisfy the rules of creation.
  • Adding hours, minutes and seconds with features hour_add, minute_add and second_add. Features add and + take an instance of TIME_DURATION as anPage 3 argument and add it to the current time.
  • Moving to the next or the previous hour, minute or second with features hour_forth, hour_back, minute_forth, minute_back, second_forth and second_back. It is faster to use these features rather than those above (hour_back <-> hour_add (-1)).

DATE

DATE deals with year, month and day. It is more complicated since there is no regular period in dates: each month contains its own total of days and there are leap years. That is why some peculiarities appear while manipulating objects of this class. There is no limit for a date (inside the class). The only limit comes from INTEGER representation. If INTEGER size is 32 bits (most common case), and as long as the basic unit is a day, the range for a date is from (- 2^31) to 2^31 (days), i.e. 5.8 million years from the origin.

Creation

There are also three ways to create an instance of the class DATE: by choosing the date (make, make_month_day_year, make_day_month_year), by getting the date from the system (make_now), or by choosing the number of days elapsed from the origin (make_by_days). The arguments of each creation procedure have to respect the common range (See preconditions).

Origin

The origin is 01/01/1600.

Comparison

Instances of DATE may be compared. Functions <, + > and >= are available. Function is_equal must be use to test equality, = will compare references.

Measurement

Each instance of DATE has a function (duration) which returns the duration since the origin until the current date (it is an instance of DATE_DURATION). This duration is definite, i.e. it contains only days (See below). However, it may be useful to deal directly with days (no need of DATE_DURATION). In this case, the function days of DATE yields the number of days since origin.

Status Report

Much information may be gotten from functions written in this part. Most of them are used within the class, but they are exported at the same time.

Operations

DATE operations looks like TIME operations:

  • Setting directly year, month and day with set_year, set_month and set_day. Arguments must satisfy the rules of creation. These rules are more complicated than those of TIME. For example it is not allowed to set day to 31 if the current month is April, whereas it is allowed if the month is January. It is the same rules as for make. The same thing for years: It is not allowed to set year to a non-leap year if the current date is February 29th of a leap year. However, two features are available to set month and year even if day is too large: set_month_cut_days and set_year_cut_days will cut day down to the largest value allowed.
  • Adding years, months and days with features year_add, month_add and day_add. There is no requirement to add a year or a month. However, these features have to return a correct result, i.e. day is checked before each addi-tion. Adding one month to August 31st will yield September 30th. 31 is cut to 30 since there are only 30 days in september. Features add and + take an instance of DATE_DURATION in argument and add it to the current date. It is written so that years and months are added first, the days last. (see DATE_DURATION below)
  • Moving to the next or the previous year, month or day with features year_forth, year_back, month_forth, month_back, day_forth and day_back. It is the same but faster to use these features rather than those upper (year_back <-> year_add (-1)).
  • Features relative_duration and definite_duration return the duration between the current date and the argument. The first one returns a result which is canonical (See definitions below), while the second one returns a definite result but may be not canonical.

For example, date1 is April 20th and date2 is May 28th. Both features will yield instances of DURATION; however, relative_duration will yield 1 month and 8 days whereas definite_duration will yield 38 days.

DATE_TIME

The aim is to gather the time with the date. DATE_TIME is client of TIME and DATE (see inheritance relation). Some features from DATE and TIME are re-written since they are useful within the class. Many other features may be called indirectly with the correct attribute (time or date).

Creation

There are still several ways to create an instance:

  • by choosing value for all the attributes of the date and the time (make).
  • by getting the time from the system (make_now).
  • by gathering an instance of DATE with an instance of TIME (make_by_date_time). This feature copies only the references of its arguments, so that if the time (or the date) is changed, the instance previously initialized will be also changed. If this effect has to be avoided, cloning the arguments is required.
  • by encapsulating an instance of DATE (make_by_date). The attribute time is set to the origin, i.e. 0:0:0.

The attribute date is set with the same reference as the argument (See comment of the previous section).

Access

To make it easier calls to features of TIME and DATE, the most useful access features are written as features in DATE_TIME (days, seconds and their associated duration date_duration and time_duration).

Comparison

Instances of DATE_TIME are totally ordered (the class inherit from ABSOLUTE). Functions <, + > and >= are available. Function is_equal must be used to test equality, = will compare references.

Measurement

Function duration gathers functions duration from the attributes time and date. The result is an instance of DATE_TIME_DURATION.

Element change

It is possible to change reference of time and date with the features set_time and set_date. To change only one element (for example hour), features from TIME or DATE have to be used.

Operations

Addition of hours, minutes and seconds are available directly in the class. The reason is that adding one second may have a consequence on the date. Using second_add from TIME is also possible but the date will not be modified in the case time makes a cycle. It is of course the same for minute and hour. day_add is also available directly since it is frequently used within the class.

Features + and add take an instance of DATE_TIME_DURATION in arguments. The date duration is added first then the time duration. Adding the time duration first would have yield some different result as in this example: the current date is August 30th 23:59:59. The duration to add is one month and one second. Feature add returns October 1st 0:0:0, whereas adding the second first would return September 30th 0:0:0! The same difference occurs with leap years.

Feature relative_duration and definite_duration returns the duration between the current date (with time) and the argument. The first one returns a result which is canonical (see definitions below), while the second one returns a result definite but may be not canonical. It is the same notion than in DATE.

DATE and DATE_TIME

Another way to process would have been to make DATE_TIME inherit from DATE, as long as DATE_TIME is a DATE, with more precision. The choice was to have a client relation between them. Otherwise DATE should have known the existence of DATE_TIME, and many assignment attempts would have been useful in features such as infix +. So DATE_TIME is client of DATE.

However, it could be useful to mix instances of DATE of DATE_TIME. As DATE_TIME is client of DATE with its attribute date, it is easy to get only the date from instances of DATE_TIME. On the other way features are available to convert objects from DATE to DATE_TIME. In class DATE, feature to_date_time builds an instance of DATE_TIME with the origin of time (0,0,0). In the class DATE_TIME, the creation procedure make_by_date has the same effect. (The same feature exists for duration, replacing origin by zero).


Duration

TIME_DURATION, DATE_DURATION AND DATE_TIME_DURATION

The classes dealing with duration inherit DURATION, which inherits GROUP_ELEMENT and PART_COMPARABLE. An instance of TIME_DURATION, DATE_DURATION or DATE_TIME_DURATION is an element of a group, i.e. there is a zero and addition operations (infix +, infix -, prefix + and prefix -). Duration is used as an amount of time, without link to an origin. It may be added to the respective absolute notion (time + time_duration is possible, not time + date_time_duration nor date_time + time_duration...see classes TIME, DATE and DATE_TIME).

Attributes are allowed to take negative values or values which do not stand in the usual range (hour = -1, minute = 75, day = 40...). However, features are available in each class to convert instances into the usual format: functions canonical and to_canonical are present in each class. An instance is canonical (canonical = True) if its attributes stand into the usual range. For example, an instance of TIME_DURATION such as 12:-10:60 is not canonical. to_canonical will return 11:51:0. In DATE_DURATION and DATE_TIME_DURATION, these features are also present.

The order is partially implemented. TIME_DURATION has a complete order whereas DATE_DURATION and DATE_TIME_DURATION are more specific.

TIME_DURATION

Creation

Two ways are possible: by choosing the value of each attributes hour, minute and second (feature make), or by giving an amount of seconds (make_by_seconds). Any integer value is accepted. It is possible to create a duration with 1 hour and -60 minutes.

Access

Zero is a once feature with 0 hour, 0 minute and 0 second. The total amount of second of the current duration is the result of feature seconds_count.

Comparison

Instances of TIME_DURATION may be compared easily. The order is the order of the respective total amount of second. 1:-40:0 is less than 0:0:1800, etc... Functions <, >, <= and >= are available. Is_equal tests equality, = will compare references.

Element change

Set directly hour, minute and second with set_hour, set_minute and set_second. Arguments do not need to satisfy any range rule.

Operations

  • Adding hours, minutes and seconds with features hour_add, minute_add and second_add.
  • TIME_DURATION inherits from GROUP_ELEMENT. infix and prefix +, infix and prefix - are available to compose instances of each other.

Conversion

Two features ensure a link with the notion of day: to_days returns the number of days equivalent to the current duration. For example, a duration such as 23:60:0 is equivalent to one day. For negative duration, the result is never 0. -1 hour is equivalent to -1 day (i.e. the result of the function is - 1). To_days is associated with time_modulo_day. This second function returns an instance of TIME_DURATION. The result represents the difference between the current duration and the number of days yielded by to_days. It implies that the result is always positive and less than one day.

For example, the current duration is 25:70:600. to_days will returns 1 (one day) and time_modulo_day will return 2:20:0:. If the current duration is negative: -23:-80:300, to_days will return -2 (minus two days) and time_modulo_day will return 23:45:0.

Durations may be canonical or not canonical (BOOLEAN canonical). That means the features hour, minute and second are included in a particular range, or not. An instance of TIME_DURATION is canonical if:

  • in the case of a positive duration (> zero), all of the three features have to be positive or 0, minute and second less than 60.
  • in the case of a negative duration (< zero), all of the three features have to be negative or 0, minute and second strictly greater than -60. The function canonical tests if the duration is canonical or not, the function to_canonical yields a new duration equivalent to the current one and canonical.

DATE_DURATION

Dealing with the gregorian calendar is not so easy because of irregularities. A duration of one month may be equal to 28 up to 31 days, depending on the current date! On the other hand, it could be useful to deal with precise duration. This point leads to an original design of the class: A separation is made between two kinds of instances.

The definite ones and the relative ones. The function definite which returns a BOOLEAN, is true for definite duration and false otherwise. An instance is definite if and only if its attributes month and year are 0. Then only the number of days is used. Relative (non definite) durations have their attributes year, month and day meaningful but it is then impossible to compare them to each other (is one month greater than 30 days?, is one year greater than 365 days?). The main difference appears when a duration is added to a date. In the case of a definite duration, there is no ambiguity. A given number of days are added to the date, taking care of the calendar. In the other case, the result is relative to the origin date. For example, a one month duration may be equal to 28 days if the date is in February or 31days if the date is in August. A duration becomes definite when its attributes year and month become 0. However it is possible to deal with instances of DATE_DURATION without taking care of this distinction.

Relative date_duration

Relative duration can not be compared with any other durations (including zero). The reason is simple. It is not possible to say if 30 days are less than 1 month: it depends on the date: it is true in August (in a 31 days month) and it is false in February.

If feature > (or <, + + is called with at least one non definite member (the current instance or the argument), the result will be always False. We may only know if two durations are equal, with the feature is_equal. It compares field by field the two durations. When adding a relative date_duration to a date, the years and the months are added first, then the date may be cut (June 31 -> June 30) and finally the days are added. For example, if one month is added to the date August 31st, the result is September 30th.

Nevertheless there is a way to compare relative durations: a relative date_duration may be canonical. It means that the duration has its attributes month and day in a fixed range. month must be between 1 and 12, and day larger than 1 and less than a value between 27 and 30. This value is fixed simply: (in the case of a positive duration) when setting day to 0 and adding one more month, the addition of the start date and this new duration must yield a date strictly after the final date (yielded by adding date and tested duration). For example is 0/0/30 (i.e. 0 year, 0 month and 30 days) canonical?

  • If the origin date is 01/15 (15th of January), the final date is 02/14. We can not convert 30 days into 1 month in this case. The duration is canonical.
  • If the origin date is 04/15 (15th of april), the final date is 05/15. The duration is not canonical since it is possible to convert days into 1 month. The origin date is used to determine whether the duration is positive or not. If the final date is after the origin date the duration is positive, otherwise it is negative. That does not mean we can compare it to zero, that is only used to determine the sign of the canonical standard. If the duration is negative, it is canonical only if all the attributes are negative.

A way to compare two relative durations is to make them canonical from the same date, and then to compare the fields. It is the same as adding the durations to the same date, and to compare the final dates to each other.

Definite date_duration

Definite durations are characterized by the attribute day. Whenever a duration has its attributes year and month equal to 0, this duration is then definite. On the other hand, if one of these two attributes is not 0, the duration is not definite anymore.

The number of days between an origin date and the result of (date + duration) does not depend on the origin date. It is possible to compare definite date_duration to each other. The order is the one of day.

A definite duration may be canonical or not. It is canonical if the number of day is small enough.

General description

Creation

Two creation features are available: make takes three arguments (year, month and day). If year and month are null, the duration will be definite; make_by_days takes only the number of day. The duration is automatically definite.

Comparison

Features <, >, <= and >= are available. If both instances are definite, numbers of days are compared. If one of them is non definite, the result is False.

Element change

Features set_day, set_month and set_year are available to set one of these three attributes day, month, year.

Operation

  • Add years, months and days with features year_add, month_add and day_add.
  • DATE_DURATION inherits from GROUP_ELEMENT. infix and prefix +, infix and prefix - are available to compose instances of each other.

Conversion

  • to_canonical is used to get a new duration equivalent to the current one and canonical. It needs an argument from class DATE, which is the origin of calculations.
  • to_definite is used to get a new duration equivalent to the current one and definite. As with the previous feature, one argument is needed. - to_date_time is used to get an instance of DATE_TIME_DURATION. It will have the same date of the current duration and time set to zero.

DATE_TIME_DURATION

DATE_TIME_DURATION is client of DATE_DURATION and TIME_DURATION. Most of the common features described in DATE_DURATION are present in the class. The class deals with its attributes date and time in the same way as DATE_TIME.

There are, as in DATE_DURATION, definite and non definite durations. It is the date part which gives the definite non definite status. Features canonical and to_canonical are present in DATE_TIME_DURATION. They have to deal with the attributes time.

Creation

There are still several ways to create an instance:

  • by choosing values for all the attributes of date and time (make). - by choosing a value for day and values for all the attributes of time. The instance is then definite (make_definite).
  • by gathering an instance of DATE with an instance of TIME (make_by_date_time). This feature copies the references of its arguments, so that if the time (or the date) is changed, the instance previously initialized will be also changed. If this effect has to be avoided, the use of clones is required.
  • by encapsulating an instance of DATE (make_by_date). The attribute time is set to zero, i.e. 0:0:0. The attribute date is set with the same reference than the argument.

Access

Seconds_count is the amount of seconds of the time part only. To get the total amount of seconds of the cur-rent duration, first shift it to a definite duration, then multiply day by the number of seconds in day and add to it seconds_count. Take care that the duration is not more than 68 years. If it is, the number of seconds will be larger than 2 billion, which is the upper limit for INTEGER (4 bytes).

Comparison

The rules are the same than those for DATE_DURATION. Features <, >, <= and >= are available. If both instances are definite, numbers of days are compared. If one of them is non definite, the result is False.

Element change

It is possible to change reference of time and date with the features set_time and set_date. To change only one element (for example hour), features from TIME_DURATION or DATE_DURATION have to be used.

Operation

  • DATE_TIME_DURATION inherits from GROUP_ELEMENT. infix and prefix +, infix and prefix - are available to compose instances to each other.
  • Only day_add is present. To add only one element, features from TIME_DURATION or DATE_DURATION have to be used.

Conversion

  • canonical and to_canonical are available in the class. To be canonical an instance of the class must have its attributes time and date canonical. Then time must have the same sign than the one of the current duration. The sign of the current instance is determined by adding it to the argument (from DATE_TIME). That will yield a final date. If this final date is after the origin (= the argument), the current duration is considered positive. Otherwise, it is considered negative. Finally time must be less than one day (if positive) or more than minus one day (if negative). To_canonical returns a duration equivalent to the current one (for the argument) and canonical.
  • time_to_canonical looks like to_canonical but focuses mainly on time. It requires a definite duration so that it is possible to compare it to zero. It yields a definite duration equivalent to the current one with a canonical time. hour is then cut so that it stands in the range of one day (0 to 23 if positive and -23 to 0 if negative). The attributes day is also modified to keep the result equivalent to the current duration. time_to_canonical does not need any argument because only time and day are modified.


Interval

Class INTERVAL deals with intervals between two instances of the same class which conform to ABSOLUTE (DATE, TIME, DATE_TIME). The notions of interval is directly linked with the notion of order.

The start_bound must be before the end_bound.

Creation

The features make, set_start_bound and set_end_bound take clones of their arguments, so that if these arguments are changed, the interval previously created is not.

It would have been possible to create intervals with references to date or time, but a modification of the dates would have been effective in the interval so that only the invariant would have been able to check if the start_bound is still before the end_bound.

Interval measurement

The measure of intervals is made by duration: the result is an instance of the class DURATION. However, as DURATION is the common parent of TIME_DURATION, DATE_DURATION and DATE_TIME_DURATION, it does not have many features available. Some features in class TIME, DATE, DATE_TIME return the same result and are more efficient to use. DURATION has to be use as the last solution.

Comparison

It includes intersection, inclusion and a special comparison.

  • is_equal is present and compare values, not references.
  • Feature intersects returns the mathematical result of the intersection of two intervals.
  • is_strict_included_by, strict_includes, is_included_by and includes are connected to the same notion of inclusion.
  • <, + > and >= use a special rule to compare intervals. int1 < int2 is true if int1 starts and ends strictly before int2. The other features use the same rule and is_equal if needed.
  • overlaps looks like intersects but the argument has to be after the current interval. is_overlapped is the opposite.
  • meets and is_met are used to test if two intervals have a common bound.

Status Report

The main part of the functions need an argument from the same generic type and return a BOOLEAN value.

  • empty tests if the bounds are equal.
  • has, strict_before, strict_after, before and after test the position of an element relatively to the current interval.

Element change

set_start_bound and set_end_bound are available to change the bounds.

Operations

Union and intersection are the mathematical functions. gather requires that two intervals meet each other and then yields the union.


Format

The aim of classes dealing with format is to get a printable representation of date (or time) which conforms to the local habits. It means that for each country and for each habit a different set of data has to be used.

For this reason data and formatting features which use the data are completely separated in EiffelTime. This makes it easy to switch from one set of data to another.

Data are organized in classes which inherit from LOCALIZER. They are classified by their type: BOOLEAN, STRING, ARRAY [STRING] and INTEGER. Each piece of information is stored with a key and manipulated with it.

Formatting features are organized in classes which inherit from FORMAT: FORMAT [TIME], FORMAT [DATE], FORMAT [DATE_TIME], they are clients of LOCALIZER.

Storing data

LOCALIZER

The class is written so that all the common operations are available to manipulate data. Four types of data are available: BOOLEAN, STRING, ARRAY [STRING] and INTEGER. For each of them features are present.

  • to record data: record_boolean_value, record_integer_value, record_string_array_value and record_string_value. A value is stored with a key. If the key is already present, nothing happens. To force the system to record a new value, features force_boolean, force_integer, force_string and force_string_array are available, with the same signature.
  • to test the presence of data: has_boolean_entry, has_integer_entry, has_string_array_entry and has_string_entry.
  • to remove data: remove_boolean, remove_integer, remove_string and remove_string_array.
  • to access data: boolean_value, integer_value, string_array_value and string_value. To keep the access process convenient, a default value is required for each access. This is to avoid the client of the class testing for each request. It is a little bit disturbing for arrays but much time is saved while accessing data.

LOCALIZER is not specific to EiffelTime. It will be useful for other libraries and users applications.

TIME_LOCALIZER

The class represents a more specific type of data structure. It inherits from LOCALIZER. Invariants are present to ensure that data needed in classes FORMAT and its heirs are well defined.

Formatting date and time

FORMAT

The class is deferred and generic. It contains features to justify strings. Four options are available: left_justified, centered, right_justified and not_justified. The total width (width) has to be defined (generally during initialization). Function justify returns a new string whose length is equal to width, and which contains the string argument justified according to the current parameters. Only its heirs provide effective formatting feature: formatted. Then justify and formatted may be used together to provide a formatted and justified representation of a date (or time).

FORMAT [TIME] and FORMAT [DATE]

These classes have several common points.

  • They are clients of LOCALIZER. LOCALIZER provides them data to format date or time. The creation procedure has its first argument which conforms to LOCALIZER. It is possible to change localizer with set_localizer.
  • In these classes, feature formatted is effective and provides a formatted representation of the its argument. formatted includes many options (the attributes of the class).

FORMAT [DATE_TIME]

FORMAT [DATE_TIME] inherits from FORMAT. It is a client of FORMAT [TIME] and FORMAT [DATE]. An instance of this class gathers one instance of FORMAT [TIME] and one of FORMAT [DATE]. Several options are then available (which are not in FORMAT):

  • to have date before or after time with set_date_first and set_time_first.
  • to justify the date and the time before they are formatted together with justify_date and justify_time.
  • to change element such as the separator, or the attributes format_date and format_time (with set_separator_date_time, set_format_date and set_format_time). A special care has to be brought to the attribute width since it must keep larger or equal to the sum of the formatted date plus the formatted time plus the separator length.


More precision

TIME and TIME_DURATION are designed to deal with high precision in time. The only limit is the one from number representation.

The classes TIME and TIME_DURATION have an attribute fine_second (inherited from TIME_VALUE) which allows high precision. This attribute represents the number of seconds with fractions (it is an instance of DOUBLE). From this attribute are calculated second and fractional_second (which are functions): second is the truncated-to-integer part and fractional_second is the difference between the two previous one, so that the sum of second and fractional_second is always equal to fine_second (see invariant in TIME_VALUE).

As a result of this, when fine_second is positive (3.55 for example), second and fractional_second are also positive (3 and 0.55). When fine_second is negative (- 3.55 for example), second and fractional_second are also negative (- 3 and - 0.55).

Manipulation on second and fractional_second are in fact always made through fine_second. Users who do not want to deal with precision do not need to care about this.

Features dealing with fine_second and fractional_second are described here.

Creation (common to TIME and to TIME_DURATION)

  • make_fine looks like make but it takes a DOUBLE for its third argument (instead of an INTEGER). fine_second is then set to this value.
  • make_by_fine_seconds looks like make_by_seconds but it takes a DOUBLE for argument (instead of an INTEGER). Comparison (common) There are no new features. The same ones are available since they are written to deal with precision. It is possible to compare two instances, one with precision and the other one without.

Measurement and access

In TIME:

- fine_seconds looks like seconds but it contains fractions.

In TIME_DURATION:

- fine_seconds_count looks like seconds_count but it contains fractions.

Element change

  • set_fine_second allows to set directly fine_second to a DOUBLE. In TIME, a precondition requires that the argument stands in the allowed range.
  • set_fractionals allows to set directly fractional_second to a DOUBLE. In TIME a precondition requires that the argument is positive and smaller than one. In TIME_DURATION the precondition is particular: it is not allowed to have an argument with a different sign than second. Otherwise, as long as fractional_second and second are linked to fine_second, such a setting would mean that second is also changed and fractional_second set to a different value. For example if fine_second = 4.5 (then second = 4 and fractional_second = 0.5) and - 0.8 is the argument of set_fractionals.

The result of that would be fine_second = 3.2 (then second = 3 and fractional_second = 0.2). It is better to prohibit that.

Comment: feature set_second (from both TIME and TIME_DURATION) will cut down fractional_second to zero.

Operations

- fine_second_add looks like second_add but takes a DOUBLE for argument.

In TIME_DURATION:

- canonical and to_canonical deals already with precision. There is nothing different.


cluster time

Cluster
    time

Subclusters
    time.format

Classes
    ABSOLUTE
    DATE
    DATE_CONSTANTS
    DATE_DURATION
    DATE_MEASUREMENT
    DATE_SET
    DATE_TIME
    DATE_TIME_DURATION
    DATE_TIME_MEASUREMENT
    DATE_TIME_SET
    DATE_TIME_VALIDITY_CHECKER
    DATE_TIME_VALUE
    DATE_VALIDITY_CHECKER
    DATE_VALUE
    DURATION
    GROUP_ELEMENT
    INTERVAL [G -> ABSOLUTE]
    TIME
    TIME_CONSTANTS
    TIME_DURATION
    TIME_MEASUREMENT
    TIME_SET
    TIME_UTILITY
    TIME_VALIDITY_CHECKER
    TIME_VALUE


ABSOLUTE Chart

deferred class
    ABSOLUTE

General
    cluster: time
    description: "Absolute temporal values"

Ancestors
    COMPARABLE

Queries
    infix ">=" (other: [like Current] ABSOLUTE): BOOLEAN
    infix ">" (other: [like Current] ABSOLUTE): BOOLEAN
    infix "<=" (other: [like Current] ABSOLUTE): BOOLEAN
    infix "<" (other: [like Current] ABSOLUTE): BOOLEAN
    infix "-" (other: [like Current] ABSOLUTE): INTERVAL [[like Current] ABSOLUTE]
    duration: DURATION
    is_equal (other: [like Current] ABSOLUTE): BOOLEAN
    max (other: [like Current] ABSOLUTE): [like Current] ABSOLUTE
    min (other: [like Current] ABSOLUTE): [like Current] ABSOLUTE
    origin: [like Current] ABSOLUTE
    relative_duration (other: [like Current] ABSOLUTE): DURATION
    three_way_comparison (other: [like Current] ABSOLUTE): INTEGER


ABSOLUTE Flat contracts

indexing
    description: "Absolute temporal values"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date, time

deferred class interface
    ABSOLUTE

feature -- Access

    origin: like Current
            -- Place of start for recording objects
        ensure
            result_exists: Result /= void

feature -- Measurement

    duration: DURATION
            -- Length of the interval of time since origin

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from COMPARABLE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is the current object before other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Basic operations

    relative_duration (other: like Current): DURATION
            -- Relative duration from Current to other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    infix "-" (other: like Current): INTERVAL [like Current]
            -- Interval between current object and other
        require
            other_exists: other /= void
            other_smaller_than_current: other <= Current
        ensure
            result_exists: Result /= void
            result_set: Result.start_bound.is_equal (other) and then Result.end_bound.is_equal (Current)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

end -- class ABSOLUTE


DATE_CONSTANTS Chart

class
    DATE_CONSTANTS

General
    cluster: time
    description: "Universal constants about dates"

Ancestors
    TIME_UTILITY

Queries
    date_default_format_string: STRING
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    is_leap_year (y: INTEGER): BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    Max_weeks_in_year: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]


DATE_CONSTANTS Flat contracts

indexing
    description: "Universal constants about dates"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date

class interface
    DATE_CONSTANTS

feature -- Access

    date_default_format_string: STRING
            -- Default output format for dates

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
        require
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year

    Days_in_week: INTEGER is 7
            -- Number of days in a week

    days_text: ARRAY [STRING]
            -- Short text representation of days

    long_days_text: ARRAY [STRING]
            -- Long text representation of days

    long_months_text: ARRAY [STRING]
            -- Long text representation of months

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year

    Months_in_year: INTEGER is 12
            -- Number of months in year

    months_text: ARRAY [STRING]
            -- Short text representation of months

feature -- Status report

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_CONSTANTS


DATE_DURATION Chart

class
    DATE_DURATION

General
    cluster: time
    description: "Durations of date"
    create: make_by_days, make

Ancestors
    DATE_CONSTANTS
    DATE_MEASUREMENT
    DURATION

Queries
    infix ">=" (other: [like Current] DATE_DURATION): BOOLEAN
    infix ">" (other: [like Current] DATE_DURATION): BOOLEAN
    infix "<=" (other: [like Current] DATE_DURATION): BOOLEAN
    infix "<" (other: [like Current] DATE_DURATION): BOOLEAN
    infix "-" (other: [like Current] DATE_DURATION): [like Current] DATE_DURATION
    infix "+" (other: [like Current] DATE_DURATION): [like Current] DATE_DURATION
    prefix "-": [like Current] DATE_DURATION
    prefix "+": [like Current] DATE_DURATION
    canonical (date: DATE): BOOLEAN
    date_default_format_string: STRING
    day: INTEGER
    days_count: INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    days_in_month: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    definite: BOOLEAN
    has_origin_date: BOOLEAN
    is_equal (other: [like Current] DATE_DURATION): BOOLEAN
    is_leap_year (y: INTEGER): BOOLEAN
    is_negative: BOOLEAN
    is_positive: BOOLEAN
    is_zero: BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    Max_weeks_in_year: INTEGER
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    origin_date: DATE
    to_canonical (start_date: DATE): [like Current] DATE_DURATION
    to_date_time: DATE_TIME_DURATION
    year: INTEGER
    Zero: DATE_DURATION

Commands
    day_add (d: INTEGER)
    make (y, m, d: INTEGER)
    make_by_days (d: INTEGER)
    month_add (m: INTEGER)
    set_day (d: INTEGER)
    set_month (m: INTEGER)
    set_origin_date (d: DATE)
    set_year (y: INTEGER)
    to_definite (date: DATE)
    year_add (y: INTEGER)

Constraints
    equal signs


DATE_DURATION Flat contracts

indexing
    description: "Durations of date"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date

class interface
    DATE_DURATION

create

    make (y, m, d: INTEGER)
            -- Set year, month and day to y, m and d respectively.
        ensure
            year_set: year = y
            month_set: month = m
            day_set: day = d

    make_by_days (d: INTEGER)
            -- Set day to d.
            -- The duration is definite
        ensure
            day_set: day = d
            definite_duration: definite

feature -- Initialization

    make (y, m, d: INTEGER)
            -- Set year, month and day to y, m and d respectively.
        ensure
            year_set: year = y
            month_set: month = m
            day_set: day = d

    make_by_days (d: INTEGER)
            -- Set day to d.
            -- The duration is definite
        ensure
            day_set: day = d
            definite_duration: definite

feature -- Access

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    zero: DATE_DURATION
            -- Neutral element for "+" and "-"
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
        ensure then
            definite: Result.definite

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Are the current object and other equal?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then
            result_definition: Result = (year = other.year and then month = other.month and then day = other.day)

    infix "<" (other: like Current): BOOLEAN
            -- Is the current object smaller than other?
            -- It is impossible to compare not definite duration.
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            definite_duration: (definite and then other.definite) implies Result = (day < other.day)
            non_definite_duration: (not definite or else not other.definite) implies Result = False

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

feature -- Status report

    canonical (date: DATE): BOOLEAN
            -- Is duration expressed minimally for adding to date, i.e.
            -- 	If addition will yield a date after date, then:
            --		year positive,
            --		month between 0 and `Months_in_year - 1',
            --		day between 0 and (number of days of the month before
            --		the yielded) - 1?
            -- 	If addition will yield a date before date, then:
            --		year negative,
            --		month between `1 - Months_in_year' and 0,
            --		day between (number of days of the month before the
            --		yielded) and 0?
        require
            date_exist: date /= void

    definite: BOOLEAN
            -- Is the duration is independant of the date
            -- on which it applies? (use of day only)?
            -- or not (use of year, month and day)?
        ensure
            result_definition: Result = ((year = 0) and then (month = 0))

    has_origin_date: BOOLEAN
            -- Has `origin date' been set?

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

    is_negative: BOOLEAN
            -- Is duration negative?
            -- (from DURATION)

    is_positive: BOOLEAN
            -- Is duration positive?

    is_zero: BOOLEAN
            -- Is duration zero?
            -- (from DURATION)

feature -- Status setting

    set_origin_date (d: DATE)
            -- Set origin_date to d.
        ensure
            origin_date_set: origin_date = d

feature -- Element change

    prefix "+": like Current
            -- Unary plus
            -- (from DURATION)
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: Result.is_equal (Current)

    infix "-" (other: like Current): like Current
            -- Difference with other
            -- (from DURATION)
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void

feature -- Conversion

    to_canonical (start_date: DATE): like Current
            -- A new duration, equivalent to current one
            -- and canonical for date
        ensure
            canonical_result: Result.canonical (start_date)
            duration_not_changed: equal (start_date + Current, start_date + Result)

    to_date_time: DATE_TIME_DURATION
            -- Date-time version, with a zero time component
        ensure
            result_exists: Result /= void
            year_set: Result.year = year
            month_set: Result.month = month
            day_set: Result.day = day

    to_definite (date: DATE)
            -- Make current duration definite.
        require
            date_exists: date /= void
        ensure
            definite_result: definite

feature -- Basic operations

    infix "+" (other: like Current): like Current
            -- Sum of current object with other
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            commutative: Result.is_equal (other + Current)
        ensure then
            origin_equal: equal (origin_date, Result.origin_date)

    prefix "-": like Current
            -- Unary minus
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: (Result + Current).is_equal (zero)
        ensure then
            origin_equal: equal (origin_date, Result.origin_date)

feature -- Attribute

    day: INTEGER

    days_count: INTEGER
            -- Number of days in duration
        require
            origin_date_set: has_origin_date

    month: INTEGER

    origin_date: DATE
            -- Origin date of duration

    year: INTEGER

feature -- Element Change

    day_add (d: INTEGER)
            -- Add d days to Current.
        ensure
            day_set: day = old day + d

    month_add (m: INTEGER)
            -- Add m months to Current.
        ensure
            month_set: month = old month + m

    set_day (d: INTEGER)
            -- Set day to d.
        require -- from DATE_MEASUREMENT
            d_large_enough: d >= 1
            d_small_enough: d <= days_in_month
        ensure -- from DATE_MEASUREMENT
            day_set: day = d

    set_month (m: INTEGER)
            -- Set month to m.
        require -- from DATE_MEASUREMENT
            m_large_enough: m >= 1
            m_small_enough: m <= months_in_year
            d_small_enough: day <= days_in_i_th_month (m, year)
        ensure -- from DATE_MEASUREMENT
            month_set: month = m

    set_year (y: INTEGER)
            -- Set year to y.
        require -- from DATE_MEASUREMENT
            can_not_cut_29th_feb: day <= days_in_i_th_month (month, y)
        ensure -- from DATE_MEASUREMENT
            year_set: year = y

    year_add (y: INTEGER)
            -- Add y years to Current.
        ensure
            year_set: year = old year + y

feature -- Status Report

    days_in_month: INTEGER
            -- Number of days in month 'month'.
            -- (from DATE_MEASUREMENT)
        ensure -- from DATE_MEASUREMENT
            positive_result: Result > 0

invariant

    equal_signs: (has_origin_date and then canonical (origin_date)) implies (day >= 0 and month >= 0 and year >= 0) or (day <= 0 and month <= 0 and year <= 0)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DURATION
    sign_correctness: is_positive xor is_negative xor is_zero
        -- from GROUP_ELEMENT
    neutral_addition: Current.is_equal (Current + zero)
    self_subtraction: zero.is_equal (Current - Current)

end -- class DATE_DURATION


DATE Chart

class
    DATE

General
    cluster: time
    description: "Absolute dates"
    create: make_month_day_year, make_by_compact_date, make_from_string, make_day_month_year, make_from_string_default, make_now, make_from_string_with_base, make_by_days, make, make_from_string_default_with_base

Ancestors
    ABSOLUTE
    DATE_VALIDITY_CHECKER
    DATE_VALUE

Queries
    infix ">=" (other: [like Current] DATE): BOOLEAN
    infix ">" (other: [like Current] DATE): BOOLEAN
    infix "<=" (other: [like Current] DATE): BOOLEAN
    infix "<" (other: [like Current] DATE): BOOLEAN
    infix "-" (other: [like Current] DATE): INTERVAL [[like Current] DATE]
    infix "+" (d: DATE_DURATION): DATE
    compact_date: INTEGER
    compact_date_valid (c_d: INTEGER): BOOLEAN
    date_default_format_string: STRING
    date_valid (s, code_string: STRING): BOOLEAN
    date_valid_default (s: STRING): BOOLEAN
    date_valid_default_with_base (s: STRING; base: INTEGER): BOOLEAN
    date_valid_with_base (s, code_string: STRING; base: INTEGER): BOOLEAN
    day: INTEGER
    day_of_january_1st: INTEGER
    day_of_the_week: INTEGER
    days: INTEGER
    days_at_month: INTEGER
    days_from (y: INTEGER): INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    days_in_month: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_in_year: INTEGER
    days_text: ARRAY [STRING]
    duration: DATE_DURATION
    formatted_out (s: STRING): STRING
    is_correct_date (y, m, d: INTEGER): BOOLEAN
    is_equal (other: [like Current] DATE): BOOLEAN
    is_leap_year (y: INTEGER): BOOLEAN
    leap_year: BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    max (other: [like Current] DATE): [like Current] DATE
    Max_weeks_in_year: INTEGER
    min (other: [like Current] DATE): [like Current] DATE
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    Origin: DATE
    out: STRING
    relative_duration (other: [like Current] DATE): DATE_DURATION
    three_way_comparison (other: [like Current] DATE): INTEGER
    to_date_time: DATE_TIME
    week_of_year: INTEGER
    year: INTEGER
    year_day: INTEGER

Commands
    add (d: DATE_DURATION)
    day_add (d: INTEGER)
    day_back
    day_forth
    month_add (m: INTEGER)
    month_back
    month_forth
    set_day (d: INTEGER)
    set_month (m: INTEGER)
    set_year (y: INTEGER)
    year_add (y: INTEGER)
    year_back
    year_forth
    year_month_add (y, m: INTEGER)

Constraints
    day large enough
    day small enough
    month large enough
    month small enough
    year small enough
    year positive


DATE Flat contracts

indexing
    description: "Absolute dates"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date

class interface
    DATE

create

    make (y, m, d: INTEGER)
            -- Set year, month and day to y, m, d respectively.
        require
            correct_date: is_correct_date (y, m, d)
        ensure
            year_set: year = y
            month_set: month = m
            day_set: day = d

    make_month_day_year (m, d, y: INTEGER)
            -- Set month, day and year to m, d and y respectively.
        require
            correct_date: is_correct_date (y, m, d)
        ensure
            year_set: year = y
            month_set: month = m
            day_set: day = d

    make_day_month_year (d, m, y: INTEGER)
            -- Set day, month and year to d, m and y respectively.
        require
            correct_date: is_correct_date (y, m, d)
        ensure
            year_set: year = y
            month_set: month = m
            day_set: day = d

    make_now
            -- Set the current object to today's date.

    make_by_days (n: INTEGER)
            -- Set the current date with the number of days n since origin.
        ensure
            days_set: days = n

    make_from_string_default (s: STRING)
            -- Initialize from a "standard" string of form
            -- date_default_format_string.
            -- (For 2-digit year specifications, the current century is used as
            -- base century.)
        require
            s_exists: s /= void
            date_valid: date_valid (s, date_default_format_string)

    make_from_string_default_with_base (s: STRING; base: INTEGER)
            -- Initialize from a "standard" string of form
            -- date_default_format_string with base century base.
        require
            s_exists: s /= void
            base_valid: base > 0 and (base \\ 100 = 0)
            date_valid: date_valid_with_base (s, date_default_format_string, base)

    make_from_string (s: STRING; code: STRING)
            -- Initialize from a "standard" string of form
            -- code.
            -- (For 2-digit year specifications, the current century is used as
            -- base century.)
        require
            s_exists: s /= void
            c_exists: code /= void
            date_valid: date_valid (s, code)

    make_from_string_with_base (s: STRING; code: STRING; base: INTEGER)
            -- Initialize from a "standard" string of form
            -- code with base century base.
        require
            s_exists: s /= void
            c_exists: code /= void
            base_valid: base > 0 and (base \\ 100 = 0)
            date_valid: date_valid_with_base (s, code, base)

    make_by_compact_date (c_d: INTEGER)
            -- Initialize from a compact_date.
        require
            c_d_not_void: c_d /= void
            c_d_valid: compact_date_valid (c_d)
        ensure
            compact_date_set: compact_date = c_d

feature -- Access

    compact_date: INTEGER
            -- Day, month and year coded.
            -- (from DATE_VALUE)

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    day: INTEGER
            -- Day of the current object
            -- (from DATE_VALUE)

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    month: INTEGER
            -- Month of the current object
            -- (from DATE_VALUE)

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    origin: DATE
            -- Origin date
        ensure -- from ABSOLUTE
            result_exists: Result /= void

    year: INTEGER
            -- Year of the current object
            -- (from DATE_VALUE)

feature -- Measurement

    days: INTEGER
            -- Number of days elapsed since origin
        ensure
            same_duration: Result = duration.day

    duration: DATE_DURATION
            -- Definite duration elapsed since origin
        ensure then
            definite_result: Result.definite
            duration_set: ((Current - origin).duration).is_equal (Result)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from COMPARABLE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is the current date before other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    day_of_january_1st: INTEGER
            -- Day of the week of january 1st of the current year
        ensure
            day_of_the_week_definition: Result > 0 and then Result < 8

    day_of_the_week: INTEGER
            -- Number of day from the beginning of the week
            -- sunday is 1, etc.., saturday is 7
        ensure
            day_of_the_week_range: Result > 0 and then Result < 8

    days_at_month: INTEGER
            -- Number of days from the beginning of the year
            -- until the beginning of the current month
        ensure
            positive_result: Result >= 0

    days_from (y: INTEGER): INTEGER
            -- Days between the current year and year y

    days_in_year: INTEGER
            -- Number of days in the current year
        ensure
            valid_result: (leap_year implies Result = days_in_leap_year) and then (not leap_year implies Result = days_in_non_leap_year)

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

    leap_year: BOOLEAN
            -- Is the current year a leap year?

    week_of_year: INTEGER
            -- Number of weeks from the beginning of the year
            -- The first week of the year begins on the first sunday of the year
            -- The week number before the first sunday of the year is 0
        ensure
            positive_result: Result >= 0
            result_small_enough: Result < max_weeks_in_year

    year_day: INTEGER
            -- Number of days from the beginning of the year
        ensure
            result_large_enough: Result >= 1
            result_small_enough: Result <= days_in_year

feature -- Element change

    set_day (d: INTEGER)
            -- Set day to d.
            -- (from DATE_VALUE)
        require -- from DATE_MEASUREMENT
            d_large_enough: d >= 1
            d_small_enough: d <= days_in_month
        ensure -- from DATE_MEASUREMENT
            day_set: day = d

    set_month (m: INTEGER)
            -- Set month to m.
            -- (from DATE_VALUE)
        require -- from DATE_MEASUREMENT
            m_large_enough: m >= 1
            m_small_enough: m <= months_in_year
            d_small_enough: day <= days_in_i_th_month (m, year)
        ensure -- from DATE_MEASUREMENT
            month_set: month = m

    set_year (y: INTEGER)
            -- Set year to y.
            -- (from DATE_VALUE)
        require -- from DATE_MEASUREMENT
            can_not_cut_29th_feb: day <= days_in_i_th_month (month, y)
        ensure -- from DATE_MEASUREMENT
            year_set: year = y

feature -- Conversion

    to_date_time: DATE_TIME
            -- Date-time version, with a zero time component

feature -- Basic operations

    add (d: DATE_DURATION)
            -- Adds d to the current date.
            -- if d is not definite, add years and months and then days.

    day_add (d: INTEGER)
            -- Add d days to the current date.
        ensure
            days_set: days = old days + d

    day_back
            -- Move to previous day.
        ensure
            days_set: days = old days - 1

    day_forth
            -- Move to next day.
            -- days is from the origin, day is current.
        ensure
            days_set: days = old days + 1

    month_add (m: INTEGER)
            -- Add m months to the current date.
            -- Can move days backward.

    month_back
            -- Move to previous month.
            -- Can move days backward if previous month has less days than the
            -- current month.

    month_forth
            -- Move to next month.
            -- Can move days backward if next month has less days than the
            -- current month.

    relative_duration (other: like Current): DATE_DURATION
            -- Duration from other to the current date
        require -- from ABSOLUTE
            other_exists: other /= void
        ensure -- from ABSOLUTE
            result_exists: Result /= void
        ensure then
            exact_duration: (other + Result).is_equal (Current)
            canonical_duration: Result.canonical (other)
            origin_date_set: equal (Result.origin_date, other)

    year_add (y: INTEGER)
            -- Add y years to the current date.
            -- May cut the 29th february.
        ensure
            year_set: year = old year + y

    year_back
            -- Move to previous year.
            -- May cut the 29th february.
        ensure
            year_decreased: year = old year - 1

    year_forth
            -- Move to next year.
            -- May cut the 29th february.
        ensure
            year_increased: year = old year + 1

    year_month_add (y, m: INTEGER)
            -- Add y years and m months to the current date.
            -- Check the number of days after.

    infix "+" (d: DATE_DURATION): DATE
            -- Sum to current date the duration d
            -- if duration not define, add years and then months and then days.
        ensure
            result_exists: Result /= void
            definite_set: d.definite implies (Result - Current).duration.is_equal (d)

    infix "-" (other: like Current): INTERVAL [like Current]
            -- Interval between current object and other
            -- (from ABSOLUTE)
        require -- from ABSOLUTE
            other_exists: other /= void
            other_smaller_than_current: other <= Current
        ensure -- from ABSOLUTE
            result_exists: Result /= void
            result_set: Result.start_bound.is_equal (other) and then Result.end_bound.is_equal (Current)

feature -- Output

    formatted_out (s: STRING): STRING
            -- Printable representation of Current with "standard"
            -- Form: s
        require
            s_exists: s /= void

    out: STRING
            -- Printable representation of Current with "standard"
            -- Form: date_default_format_string

feature -- Preconditions

    compact_date_valid (c_d: INTEGER): BOOLEAN
            -- Is compact date c_d valid?
            -- (from DATE_VALIDITY_CHECKER)

    date_valid (s: STRING; code_string: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to code_string?
            -- (from DATE_VALIDITY_CHECKER)
        require -- from DATE_VALIDITY_CHECKER
            s_exists: s /= void
            code_exists: code_string /= void

    date_valid_default (s: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to
            -- date_default_format_string?
            -- (from DATE_VALIDITY_CHECKER)
        require -- from DATE_VALIDITY_CHECKER
            s_exists: s /= void

    date_valid_default_with_base (s: STRING; base: INTEGER): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to
            -- date_default_format_string?
            -- Use base century base.
            -- (from DATE_VALIDITY_CHECKER)
        require -- from DATE_VALIDITY_CHECKER
            s_exists: s /= void
            base_valid: base > 0 and (base \\ 100 = 0)

    date_valid_with_base (s: STRING; code_string: STRING; base: INTEGER): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to code_string?
            -- Use base century base.
            -- (from DATE_VALIDITY_CHECKER)
        require -- from DATE_VALIDITY_CHECKER
            s_exists: s /= void
            code_exists: code_string /= void
            base_valid: base > 0 and (base \\ 100 = 0)

    is_correct_date (y, m, d: INTEGER): BOOLEAN
            -- Is date specified by y, m, and d a correct date?
            -- (from DATE_VALIDITY_CHECKER)

feature -- Status Report

    days_in_month: INTEGER
            -- Number of days in month 'month'.
            -- (from DATE_MEASUREMENT)
        ensure -- from DATE_MEASUREMENT
            positive_result: Result > 0

invariant

    day_large_enough: day >= 1
    day_small_enough: day <= days_in_month
    month_large_enough: month >= 1
    month_small_enough: month <= months_in_year
    year_small_enough: year <= 65535
    year_positive: year > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

end -- class DATE


DATE_MEASUREMENT Chart

deferred class
    DATE_MEASUREMENT

General
    cluster: time
    description: "Date Measurement"

Ancestors
    DATE_CONSTANTS

Queries
    date_default_format_string: STRING
    day: INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    days_in_month: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    is_leap_year (y: INTEGER): BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    Max_weeks_in_year: INTEGER
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    year: INTEGER

Commands
    set_day (d: INTEGER)
    set_month (m: INTEGER)
    set_year (y: INTEGER)


DATE_MEASUREMENT Flat contracts

indexing
    description: "Date Measurement"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DATE_MEASUREMENT

feature -- Access

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    day: INTEGER
            -- Number of days associated with current object

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    month: INTEGER
            -- Number of monthes associated with current object

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    year: INTEGER
            -- Number of years associated with current object

feature -- Status report

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

feature -- Element change

    set_day (d: INTEGER)
            -- Set day to d.
        require
            d_large_enough: d >= 1
            d_small_enough: d <= days_in_month
        ensure
            day_set: day = d

    set_month (m: INTEGER)
            -- Set month to m.
            -- day must be small enough.
        require
            m_large_enough: m >= 1
            m_small_enough: m <= months_in_year
            d_small_enough: day <= days_in_i_th_month (m, year)
        ensure
            month_set: month = m

    set_year (y: INTEGER)
            -- Set year to y.
        require
            can_not_cut_29th_feb: day <= days_in_i_th_month (month, y)
        ensure
            year_set: year = y

feature -- Status Report

    days_in_month: INTEGER
            -- Number of days in month 'month'.
        ensure
            positive_result: Result > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_MEASUREMENT


DATE_SET Chart

class
    DATE_SET

General
    cluster: time
    description: "Sets of compactly coded dates"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): INTEGER
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [INTEGER]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): INTEGER
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: INTEGER): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] DATE_SET): BOOLEAN
    is_inserted (v: INTEGER): BOOLEAN
    item (i: INTEGER): DATE
    item_array (i: INTEGER): INTEGER
    last: INTEGER
    linear_representation: LINEAR [INTEGER]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: INTEGER): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] DATE_SET): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] DATE_SET
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] DATE_SET)
    discard_items
    enter (v: [like item] INTEGER; i: INTEGER)
    fill (other: CONTAINER [INTEGER])
    force (v: [like item] INTEGER; i: INTEGER)
    grow (i: INTEGER)
    make (n: INTEGER)
    make_array (min_index, max_index: INTEGER)
    make_from_array (a: ARRAY [INTEGER])
    prune_all (v: INTEGER)
    put (d: DATE)
    put_array (v: [like item] INTEGER; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    subcopy (other: [like Current] DATE_SET; start_pos, end_pos, index_pos: INTEGER)

Constraints
    last non negative
    last small enough


DATE_SET Flat contracts

indexing
    description: "Sets of compactly coded dates"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_SET

create

    make (n: INTEGER)
            -- Create set for n dates.
        require
            positive: n > 0

feature -- Initialization

    make (n: INTEGER)
            -- Create set for n dates.
        require
            positive: n > 0

    make_array (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [INTEGER])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    area: SPECIAL [INTEGER]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: INTEGER): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (i: INTEGER): DATE
            -- Item at index i
        require
            index_in_range: 1 <= i and i <= last

    item_array (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    last: INTEGER
            -- Index of the last item inserted

    infix "@" (i: INTEGER): INTEGER
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: INTEGER): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item_array (upper) = void or else item_array (upper) = item_array (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: INTEGER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item_array (upper) = other.item_array (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like item_array; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [INTEGER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item_array; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item_array (i) = v
            higher_count: count >= old count

    put (d: DATE)
            -- insert d as last item.
        require
            exists: d /= void
        ensure
            inserted: equal (item (last), d)

    put_array (v: like item_array; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item_array (k) = v

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: INTEGER)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [INTEGER]
            -- Representation as a linear structure
            -- (from ARRAY)

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

    last_non_negative: last >= 0
    last_small_enough: last <= count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class DATE_SET


DATE_TIME_DURATION Chart

class
    DATE_TIME_DURATION

General
    cluster: time
    description: "Duration of dates and times"
    create: make_definite, make_fine, make, make_by_date, make_by_date_time

Ancestors
    DATE_TIME_MEASUREMENT
    DURATION

Queries
    infix ">=" (other: [like Current] DATE_TIME_DURATION): BOOLEAN
    infix ">" (other: [like Current] DATE_TIME_DURATION): BOOLEAN
    infix "<=" (other: [like Current] DATE_TIME_DURATION): BOOLEAN
    infix "<" (other: [like Current] DATE_TIME_DURATION): BOOLEAN
    infix "-" (other: [like Current] DATE_TIME_DURATION): [like Current] DATE_TIME_DURATION
    infix "+" (other: [like Current] DATE_TIME_DURATION): [like Current] DATE_TIME_DURATION
    prefix "-": [like Current] DATE_TIME_DURATION
    prefix "+": [like Current] DATE_TIME_DURATION
    canonical (start_date: DATE_TIME): BOOLEAN
    date: DATE_DURATION
    date_default_format_string: STRING
    day: INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    definite: BOOLEAN
    fine_second: DOUBLE
    fine_seconds_count: DOUBLE
    has_origin_date_time: BOOLEAN
    hour: INTEGER
    Hours_in_day: INTEGER
    is_equal (other: [like Current] DATE_TIME_DURATION): BOOLEAN
    is_leap_year (y: INTEGER): BOOLEAN
    is_negative: BOOLEAN
    is_positive: BOOLEAN
    is_zero: BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    Max_weeks_in_year: INTEGER
    minute: INTEGER
    Minutes_in_hour: INTEGER
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    origin_date_time: DATE_TIME
    second: INTEGER
    seconds_count: INTEGER_64
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    time: TIME_DURATION
    time_default_format_string: STRING
    time_to_canonical: [like Current] DATE_TIME_DURATION
    to_canonical (start_date: DATE_TIME): [like Current] DATE_TIME_DURATION
    year: INTEGER
    Zero: DATE_TIME_DURATION

Commands
    day_add (d: INTEGER)
    make (y, mo, d, h, mi, s: INTEGER)
    make_by_date (d: DATE_DURATION)
    make_by_date_time (d: DATE_DURATION; t: TIME_DURATION)
    make_definite (d, h, m, s: INTEGER)
    make_fine (y, mo, d, h, mi: INTEGER; s: DOUBLE)
    set_date (d: DATE_DURATION)
    set_origin_date_time (dt: DATE_TIME)
    set_time (t: TIME_DURATION)

Constraints
    date exists
    time exists
    origin constraint
    same signs


DATE_TIME_DURATION Flat contracts

indexing
    description: "Duration of dates and times"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date, time

class interface
    DATE_TIME_DURATION

create

    make (y, mo, d, h, mi, s: INTEGER)
            -- Set year, month, day to y, mo, d.
            -- Set hour, minute, second to h, mi, s.
        ensure
            date_exists: date /= void
            time_exists: time /= void
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            second_set: second = s

    make_definite (d, h, m, s: INTEGER)
            -- Set day to d.
            -- Set hour, minute, second to h, m, s.
        ensure
            date_exists: date /= void
            time_exists: time /= void
            definite_result: definite
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = m
            second_set: second = s

    make_fine (y, mo, d, h, mi: INTEGER; s: DOUBLE)
            -- set year, month, day to y, mo, d.
            -- set hour, minute, second to h, mi, s.
        ensure
            date_exists: date /= void
            time_exists: time /= void
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            fine_second_set: fine_second = s

    make_by_date_time (d: DATE_DURATION; t: TIME_DURATION)
            -- Set date to d and time to t.
        require
            date_exists: d /= void
            time_exists: t /= void
        ensure
            date_set: date = d
            time_set: time = t

    make_by_date (d: DATE_DURATION)
            -- Set date to d and time to zero.
        require
            d_exists: d /= void
        ensure
            date_set: date = d
            time_exists: time /= void
            time_set: time.is_equal (time.zero)

feature -- Initialization

    make (y, mo, d, h, mi, s: INTEGER)
            -- Set year, month, day to y, mo, d.
            -- Set hour, minute, second to h, mi, s.
        ensure
            date_exists: date /= void
            time_exists: time /= void
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            second_set: second = s

    make_by_date (d: DATE_DURATION)
            -- Set date to d and time to zero.
        require
            d_exists: d /= void
        ensure
            date_set: date = d
            time_exists: time /= void
            time_set: time.is_equal (time.zero)

    make_by_date_time (d: DATE_DURATION; t: TIME_DURATION)
            -- Set date to d and time to t.
        require
            date_exists: d /= void
            time_exists: t /= void
        ensure
            date_set: date = d
            time_set: time = t

    make_definite (d, h, m, s: INTEGER)
            -- Set day to d.
            -- Set hour, minute, second to h, m, s.
        ensure
            date_exists: date /= void
            time_exists: time /= void
            definite_result: definite
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = m
            second_set: second = s

    make_fine (y, mo, d, h, mi: INTEGER; s: DOUBLE)
            -- set year, month, day to y, mo, d.
            -- set hour, minute, second to h, mi, s.
        ensure
            date_exists: date /= void
            time_exists: time /= void
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            fine_second_set: fine_second = s

feature -- Access

    date: DATE_DURATION
            -- Date part of the current duration

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    day: INTEGER
            -- Day of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_day: Result = date.day

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    fine_second: DOUBLE
            -- Representation of second with decimals
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_fine_second: Result = time.fine_second

    fine_seconds_count: DOUBLE
            -- Total number of seconds of current duration
        require
            has_origin: has_origin_date_time

    hour: INTEGER
            -- Hour of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_hour: Result = time.hour

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    minute: INTEGER
            -- Minute of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_minute: Result = time.minute

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    month: INTEGER
            -- Month of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_month: Result = date.month

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    origin_date_time: DATE_TIME
            -- Origin date time of duration

    second: INTEGER
            -- Second of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_second: Result = time.second

    seconds_count: INTEGER_64
            -- Total number of seconds of current duration
        require
            has_origin: has_origin_date_time

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time: TIME_DURATION
            -- Time part of current duration

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

    year: INTEGER
            -- Year of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_year: Result = date.year

    zero: DATE_TIME_DURATION
            -- Neutral element for "+" and "-"
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Are the current duration an other equal?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    infix "<" (other: like Current): BOOLEAN
            -- Is the current duration smaller than other?
            -- False if either is not definite
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then
            non_definite_result: not (definite and other.definite) implies Result = False

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

feature -- Status report

    canonical (start_date: DATE_TIME): BOOLEAN
            -- Are the time and date parts of the same sign,
            -- and both canonical?

    definite: BOOLEAN
            -- Is this duration date-independent?
            -- (True if it only uses day, not year and month)
        ensure
            result_definition: Result = (year = 0 and then month = 0)

    has_origin_date_time: BOOLEAN
            -- Has an origin_date_time been set?

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

    is_negative: BOOLEAN
            -- Is duration negative?
            -- (from DURATION)

    is_positive: BOOLEAN
            -- Is duration positive?

    is_zero: BOOLEAN
            -- Is duration zero?
            -- (from DURATION)

feature -- Status setting

    set_origin_date_time (dt: DATE_TIME)
            -- Set origin_date_time to dt.
        ensure
            origin_date_time_set: origin_date_time = dt
            origin_date_set: origin_date_time.date = date.origin_date

feature -- Element change

    prefix "+": like Current
            -- Unary plus
            -- (from DURATION)
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: Result.is_equal (Current)

    infix "-" (other: like Current): like Current
            -- Difference with other
            -- (from DURATION)
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void

feature -- Conversion

    time_to_canonical: like Current
            -- A new duration, equivalent to current one
            -- but time is canonical and has the same sign as date
        require
            definite_duration: definite
        ensure
            time_canonical: Result.time.canonical
            same_sign: ((Result.date > date.zero) implies (Result.time >= time.zero)) and then ((Result.date < date.zero) implies (Result.time <= time.zero))

    to_canonical (start_date: DATE_TIME): like Current
            -- A new duration, equivalent to current one
            -- and canonical for start_date
        ensure
            canonical_set: Result.canonical (start_date)
            duration_not_changed: equal (start_date + Current, start_date + Result)

feature -- Basic operations

    day_add (d: INTEGER)
            -- Add d days to the current duration.
        ensure
            result_definition: day = old day + d

    infix "+" (other: like Current): like Current
            -- Sum with other (commutative)
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            commutative: Result.is_equal (other + Current)
        ensure then
            origin_date_time: equal (origin_date_time, Result.origin_date_time)

    prefix "-": like Current
            -- Unary minus
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: (Result + Current).is_equal (zero)
        ensure then
            origin_date_time: equal (origin_date_time, Result.origin_date_time)

feature -- Element Change

    set_date (d: DATE_DURATION)
            -- Set date to d.
        require
            d_exists: d /= void
        ensure
            date_set: date = d

    set_time (t: TIME_DURATION)
            -- Set time to t.
        require
            t_exists: time /= void
        ensure
            time_set: time = t

invariant

    date_exists: date /= void
    time_exists: time /= void
    origin_constraint: (origin_date_time = void and date.origin_date = void) or else origin_date_time.date = date.origin_date
    same_signs: (has_origin_date_time and then canonical (origin_date_time)) implies ((date.is_positive or date.is_zero) and (time.is_positive or time.is_zero)) or else ((date.is_negative or date.is_zero) and (time.is_negative or time.is_zero))
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DURATION
    sign_correctness: is_positive xor is_negative xor is_zero
        -- from GROUP_ELEMENT
    neutral_addition: Current.is_equal (Current + zero)
    self_subtraction: zero.is_equal (Current - Current)
        -- from DATE_TIME_MEASUREMENT
    date_exists: date /= void
    time_exists: time /= void

end -- class DATE_TIME_DURATION


DATE_TIME Chart

class
    DATE_TIME

General
    cluster: time
    description: "Absolute temporal values composed of a date and a time"
    create: make_from_string_with_base, make_fine, make_now, make, make_by_date, make_from_string, make_from_string_default_with_base, make_by_date_time, make_from_string_default

Ancestors
    ABSOLUTE
    DATE_TIME_VALIDITY_CHECKER
    DATE_TIME_VALUE

Queries
    infix ">=" (other: [like Current] DATE_TIME): BOOLEAN
    infix ">" (other: [like Current] DATE_TIME): BOOLEAN
    infix "<=" (other: [like Current] DATE_TIME): BOOLEAN
    infix "<" (other: [like Current] DATE_TIME): BOOLEAN
    infix "-" (other: [like Current] DATE_TIME): INTERVAL [[like Current] DATE_TIME]
    infix "+" (d: DATE_TIME_DURATION): [like Current] DATE_TIME
    date: DATE
    date_default_format_string: STRING
    date_duration: DATE_DURATION
    date_time_valid (s, code_string: STRING): BOOLEAN
    date_time_valid_with_base (s, code_string: STRING; base: INTEGER): BOOLEAN
    day: INTEGER
    days: INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    definite_duration (other: [like Current] DATE_TIME): DATE_TIME_DURATION
    duration: DATE_TIME_DURATION
    fine_second: DOUBLE
    formatted_out (s: STRING): STRING
    fractional_second: DOUBLE
    hour: INTEGER
    Hours_in_day: INTEGER
    is_correct_date_time (y, mo, d, h, mi: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN
    is_equal (other: [like Current] DATE_TIME): BOOLEAN
    is_leap_year (y: INTEGER): BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    max (other: [like Current] DATE_TIME): [like Current] DATE_TIME
    Max_weeks_in_year: INTEGER
    min (other: [like Current] DATE_TIME): [like Current] DATE_TIME
    minute: INTEGER
    Minutes_in_hour: INTEGER
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    Origin: DATE_TIME
    out: STRING
    relative_duration (other: [like Current] DATE_TIME): DATE_TIME_DURATION
    second: INTEGER
    seconds: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    three_way_comparison (other: [like Current] DATE_TIME): INTEGER
    time: TIME
    time_default_format_string: STRING
    time_duration: TIME_DURATION
    year: INTEGER

Commands
    add (dtd: DATE_TIME_DURATION)
    copy (other: [like Current] DATE_TIME)
    day_add (d: INTEGER)
    fine_second_add (s: DOUBLE)
    hour_add (h: INTEGER)
    make (y, mo, d, h, mi, s: INTEGER)
    make_by_date (d: DATE)
    make_by_date_time (d: DATE; t: TIME)
    make_fine (y, mo, d, h, mi: INTEGER; s: DOUBLE)
    make_from_string (s, code: STRING)
    make_from_string_default (s: STRING)
    make_from_string_default_with_base (s: STRING; base: INTEGER)
    make_from_string_with_base (s, code: STRING; base: INTEGER)
    make_now
    minute_add (m: INTEGER)
    second_add (s: INTEGER)
    set_date (d: DATE)
    set_time (t: TIME)


DATE_TIME Flat contracts

indexing
    description: "Absolute temporal values composed of a date and a time"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date, time

class interface
    DATE_TIME

create

    make (y, mo, d, h, mi, s: INTEGER)
            -- Set year, month day to y, mo, d.
            -- Set hour, minute, second to h, mi, s.
        require
            correct_date_time: is_correct_date_time (y, mo, d, h, mi, s, False)
        ensure
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            second_set: second = s

    make_fine (y, mo, d, h, mi: INTEGER; s: DOUBLE)
            -- Set year, month day to y, mo, d.
            -- Set hour, minute, second to h, m, s.
        require
            correct_date_time: is_correct_date_time (y, mo, d, h, mi, s, False)
        ensure
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            second_set: fine_second = s

    make_by_date_time (d: DATE; t: TIME)
            -- Set date to d and time to t
        require
            d_exists: d /= void
            t_exists: t /= void
        ensure
            date_set: date = d
            time_set: time = t

    make_by_date (d: DATE)
            -- Set date to d and time to origin of time.
        require
            d_exists: d /= void
        ensure
            date_set: date = d
            time_set: time.is_equal (time.origin)

    make_now
            -- Get the date and the time from the system.

    make_from_string (s: STRING; code: STRING)
            -- Initialize from a "standard" string of form
            -- code.
            -- (For 2-digit year specifications, the current century is used as
            -- base century.)
        require
            s_exists: s /= void
            c_exists: code /= void
            date_time_valid: date_time_valid (s, code)

    make_from_string_with_base (s: STRING; code: STRING; base: INTEGER)
            -- Initialize from a "standard" string of form
            -- code with base century base.
        require
            s_exists: s /= void
            c_exists: code /= void
            base_valid: base > 0 and (base \\ 100 = 0)
            date_time_valid: date_time_valid_with_base (s, code, base)

    make_from_string_default (s: STRING)
            -- Initialize from a "standard" string of form
            -- default_format_string.
            -- (For 2-digit year specifications, the current century is used as
            -- base century.)
        require
            s_exists: s /= void
            date_time_valid: date_time_valid (s, default_format_string)

    make_from_string_default_with_base (s: STRING; base: INTEGER)
            -- Initialize from a "standard" string of form
            -- default_format_string with base century base.
        require
            s_exists: s /= void
            base_valid: base > 0 and (base \\ 100 = 0)
            date_time_valid: date_time_valid_with_base (s, default_format_string, base)

feature -- Initialization

    make (y, mo, d, h, mi, s: INTEGER)
            -- Set year, month day to y, mo, d.
            -- Set hour, minute, second to h, mi, s.
        require
            correct_date_time: is_correct_date_time (y, mo, d, h, mi, s, False)
        ensure
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            second_set: second = s

    make_by_date (d: DATE)
            -- Set date to d and time to origin of time.
        require
            d_exists: d /= void
        ensure
            date_set: date = d
            time_set: time.is_equal (time.origin)

    make_by_date_time (d: DATE; t: TIME)
            -- Set date to d and time to t
        require
            d_exists: d /= void
            t_exists: t /= void
        ensure
            date_set: date = d
            time_set: time = t

    make_fine (y, mo, d, h, mi: INTEGER; s: DOUBLE)
            -- Set year, month day to y, mo, d.
            -- Set hour, minute, second to h, m, s.
        require
            correct_date_time: is_correct_date_time (y, mo, d, h, mi, s, False)
        ensure
            year_set: year = y
            month_set: month = mo
            day_set: day = d
            hour_set: hour = h
            minute_set: minute = mi
            second_set: fine_second = s

    make_from_string (s: STRING; code: STRING)
            -- Initialize from a "standard" string of form
            -- code.
            -- (For 2-digit year specifications, the current century is used as
            -- base century.)
        require
            s_exists: s /= void
            c_exists: code /= void
            date_time_valid: date_time_valid (s, code)

    make_from_string_default (s: STRING)
            -- Initialize from a "standard" string of form
            -- default_format_string.
            -- (For 2-digit year specifications, the current century is used as
            -- base century.)
        require
            s_exists: s /= void
            date_time_valid: date_time_valid (s, default_format_string)

    make_from_string_default_with_base (s: STRING; base: INTEGER)
            -- Initialize from a "standard" string of form
            -- default_format_string with base century base.
        require
            s_exists: s /= void
            base_valid: base > 0 and (base \\ 100 = 0)
            date_time_valid: date_time_valid_with_base (s, default_format_string, base)

    make_from_string_with_base (s: STRING; code: STRING; base: INTEGER)
            -- Initialize from a "standard" string of form
            -- code with base century base.
        require
            s_exists: s /= void
            c_exists: code /= void
            base_valid: base > 0 and (base \\ 100 = 0)
            date_time_valid: date_time_valid_with_base (s, code, base)

    make_now
            -- Get the date and the time from the system.

feature -- Access

    date: DATE
            -- Date of the current object

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    date_duration: DATE_DURATION
            -- Definite duration between origin of date and current date

    day: INTEGER
            -- Day of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_day: Result = date.day

    days: INTEGER
            -- Number of days elapsed since origin

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    fine_second: DOUBLE
            -- Representation of second with decimals
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_fine_second: Result = time.fine_second

    fractional_second: DOUBLE
            -- Fractional part of fine_second
            -- (from TIME_VALUE)

    hour: INTEGER
            -- Hour of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_hour: Result = time.hour

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    minute: INTEGER
            -- Minute of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_minute: Result = time.minute

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    month: INTEGER
            -- Month of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_month: Result = date.month

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    origin: DATE_TIME
            -- Origin date with origin time
        ensure -- from ABSOLUTE
            result_exists: Result /= void

    second: INTEGER
            -- Second of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_second: Result = time.second

    seconds: INTEGER
            -- Number of seconds elapsed from midnight of the current date

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time: TIME
            -- Time of the current object

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

    time_duration: TIME_DURATION
            -- Duration elapsed from midnight of the current date

    year: INTEGER
            -- Year of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_year: Result = date.year

feature -- Measurement

    duration: DATE_TIME_DURATION
            -- Definite duration elapsed from origin
        ensure then
            definite_result: Result.definite

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is the current object equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is the current object before other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

feature -- Basic operations

    add (dtd: DATE_TIME_DURATION)
            -- Adds dtd to current duration

    day_add (d: INTEGER)
            -- Add d days to the current date.
        ensure
            days_set: days = old days + d

    definite_duration (other: like Current): DATE_TIME_DURATION
            -- Duration from other to the current date, converted to a
            -- definite duration
        require
            other_exists: other /= void
        ensure
            definite_result: Result.definite

    fine_second_add (s: DOUBLE)
            -- Add s seconds to the current object.
            -- if s has decimals, fractional_second from time is modified.

    hour_add (h: INTEGER)
            -- Add h hours to the current time.

    minute_add (m: INTEGER)
            -- Add m minutes to the current time.

    relative_duration (other: like Current): DATE_TIME_DURATION
            -- Duration from other to current date
        require -- from ABSOLUTE
            other_exists: other /= void
        ensure -- from ABSOLUTE
            result_exists: Result /= void
        ensure then
            origin_set: equal (other, Result.origin_date_time)

    second_add (s: INTEGER)
            -- Add s seconds to the current time.

    infix "+" (d: DATE_TIME_DURATION): like Current
            -- Sum the current object with d
        ensure
            result_exists: Result /= void

    infix "-" (other: like Current): INTERVAL [like Current]
            -- Interval between current object and other
            -- (from ABSOLUTE)
        require -- from ABSOLUTE
            other_exists: other /= void
            other_smaller_than_current: other <= Current
        ensure -- from ABSOLUTE
            result_exists: Result /= void
            result_set: Result.start_bound.is_equal (other) and then Result.end_bound.is_equal (Current)

feature -- Element Change

    copy (other: like Current)
            -- set date and time with the other attributes.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    set_date (d: DATE)
            -- Set date to d.
        require
            d_exists: d /= void
        ensure
            date_set: date = d

    set_time (t: TIME)
            -- Set time to t.
        require
            t_exists: t /= void
        ensure
            time_set: time = t

feature -- Output

    formatted_out (s: STRING): STRING
            -- Printable representation of the current object
            -- With "standard" form: s
        require
            s_exists: s /= void

    out: STRING
            -- Printable representation of the current object
            -- With "standard" form: default_format_string

feature -- Preconditions

    date_time_valid (s: STRING; code_string: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE_TIME
            -- And does the string s correspond to code_string?
            -- (from DATE_TIME_VALIDITY_CHECKER)
        require -- from DATE_TIME_VALIDITY_CHECKER
            s_exists: s /= void
            code_exists: code_string /= void

    date_time_valid_with_base (s: STRING; code_string: STRING; base: INTEGER): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE_TIME
            -- And does the string s correspond to code_string?
            -- Use base century base.
            -- (from DATE_TIME_VALIDITY_CHECKER)
        require -- from DATE_TIME_VALIDITY_CHECKER
            s_exists: s /= void
            code_exists: code_string /= void
            base_valid: base > 0 and (base \\ 100 = 0)

    is_correct_date_time (y, mo, d, h, mi: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN
            -- Is date-time specified by y, mo, d, h, mi, s
            -- correct?
            -- twelve_hour_scale specifies if the hour range is 1 - 12
            -- (if True) or 0 - 23 (if False).
            -- (from DATE_TIME_VALIDITY_CHECKER)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)
        -- from DATE_TIME_MEASUREMENT
    date_exists: date /= void
    time_exists: time /= void

end -- class DATE_TIME


DATE_TIME_MEASUREMENT Chart

deferred class
    DATE_TIME_MEASUREMENT

General
    cluster: time
    description: "Date/Time Measurement"

Ancestors
    DATE_CONSTANTS
    TIME_CONSTANTS

Queries
    date: DATE_MEASUREMENT
    date_default_format_string: STRING
    day: INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    fine_second: DOUBLE
    hour: INTEGER
    Hours_in_day: INTEGER
    is_leap_year (y: INTEGER): BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    Max_weeks_in_year: INTEGER
    minute: INTEGER
    Minutes_in_hour: INTEGER
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    second: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    time: TIME_MEASUREMENT
    time_default_format_string: STRING
    year: INTEGER

Constraints
    date exists
    time exists


DATE_TIME_MEASUREMENT Flat contracts

indexing
    description: "Date/Time Measurement"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DATE_TIME_MEASUREMENT

feature -- Access

    date: DATE_MEASUREMENT
            -- Date corresponding to current object

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    day: INTEGER
            -- Day of the current object
        ensure
            same_day: Result = date.day

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    fine_second: DOUBLE
            -- Representation of second with decimals
        ensure
            same_fine_second: Result = time.fine_second

    hour: INTEGER
            -- Hour of the current object
        ensure
            same_hour: Result = time.hour

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    minute: INTEGER
            -- Minute of the current object
        ensure
            same_minute: Result = time.minute

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    month: INTEGER
            -- Month of the current object
        ensure
            same_month: Result = date.month

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    second: INTEGER
            -- Second of the current object
        ensure
            same_second: Result = time.second

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time: TIME_MEASUREMENT
            -- Time corresponding to current object

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

    year: INTEGER
            -- Year of the current object
        ensure
            same_year: Result = date.year

feature -- Status report

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

invariant

    date_exists: date /= void
    time_exists: time /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_MEASUREMENT


DATE_TIME_SET Chart

class
    DATE_TIME_SET

General
    cluster: time
    description: "Sets of compactly coded date-time pairs"
    create: make

Ancestors
    ANY

Queries
    item (i: INTEGER): DATE_TIME
    last: INTEGER

Commands
    make (n: INTEGER)
    put (dt: DATE_TIME)

Constraints
    last non negative
    last1
    last2


DATE_TIME_SET Flat contracts

indexing
    description: "Sets of compactly coded date-time pairs"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_TIME_SET

create

    make (n: INTEGER)
            -- Create set for n date-time pairs.
        require
            positive: n > 0

feature -- Access

    item (i: INTEGER): DATE_TIME
            -- Item at index i
        require
            index_in_range: 1 <= i and i <= last

    last: INTEGER
            -- Index of the last item inserted

feature -- Element change

    put (dt: DATE_TIME)
            -- insert dt as last item.
        require
            exists: dt /= void
        ensure
            inserted_date: equal (date_set.item (last), dt.date)
            inserted_time: equal (time_set.item (last), dt.time)

feature -- Initalization

    make (n: INTEGER)
            -- Create set for n date-time pairs.
        require
            positive: n > 0

invariant

    last_non_negative: last >= 0
    last1: last = date_set.last
    last2: last = time_set.last
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_SET


DATE_TIME_VALIDITY_CHECKER Chart

class
    DATE_TIME_VALIDITY_CHECKER

General
    cluster: time
    description: "Facility routines to check the validity of DATE_TIMEs"

Ancestors
    DATE_VALIDITY_CHECKER
    TIME_VALIDITY_CHECKER

Queries
    date_time_valid (s, code_string: STRING): BOOLEAN
    date_time_valid_with_base (s, code_string: STRING; base: INTEGER): BOOLEAN
    is_correct_date_time (y, mo, d, h, mi: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN


DATE_TIME_VALIDITY_CHECKER Flat contracts

indexing
    description: "Facility routines to check the validity of DATE_TIMEs"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_TIME_VALIDITY_CHECKER

feature -- Preconditions

    date_time_valid (s: STRING; code_string: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE_TIME
            -- And does the string s correspond to code_string?
        require
            s_exists: s /= void
            code_exists: code_string /= void

    date_time_valid_with_base (s: STRING; code_string: STRING; base: INTEGER): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE_TIME
            -- And does the string s correspond to code_string?
            -- Use base century base.
        require
            s_exists: s /= void
            code_exists: code_string /= void
            base_valid: base > 0 and (base \\ 100 = 0)

    is_correct_date_time (y, mo, d, h, mi: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN
            -- Is date-time specified by y, mo, d, h, mi, s
            -- correct?
            -- twelve_hour_scale specifies if the hour range is 1 - 12
            -- (if True) or 0 - 23 (if False).

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_VALIDITY_CHECKER


DATE_TIME_VALUE Chart

class
    DATE_TIME_VALUE

General
    cluster: time

Ancestors
    DATE_TIME_MEASUREMENT

Queries
    date: DATE_VALUE
    date_default_format_string: STRING
    day: INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    fine_second: DOUBLE
    fractional_second: DOUBLE
    hour: INTEGER
    Hours_in_day: INTEGER
    is_leap_year (y: INTEGER): BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    Max_weeks_in_year: INTEGER
    minute: INTEGER
    Minutes_in_hour: INTEGER
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    second: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    time: TIME_VALUE
    time_default_format_string: STRING
    year: INTEGER


DATE_TIME_VALUE Flat contracts

indexing
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date, time

class interface
    DATE_TIME_VALUE

feature -- Access

    date: DATE_VALUE
            -- Date of the current object

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    day: INTEGER
            -- Day of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_day: Result = date.day

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    fine_second: DOUBLE
            -- Representation of second with decimals
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_fine_second: Result = time.fine_second

    fractional_second: DOUBLE
            -- Decimal part of second
        ensure
            same_fractional: Result = time.fractional_second

    hour: INTEGER
            -- Hour of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_hour: Result = time.hour

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    minute: INTEGER
            -- Minute of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_minute: Result = time.minute

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    month: INTEGER
            -- Month of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_month: Result = date.month

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    second: INTEGER
            -- Second of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_second: Result = time.second

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time: TIME_VALUE
            -- Time of the current object

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

    year: INTEGER
            -- Year of the current object
            -- (from DATE_TIME_MEASUREMENT)
        ensure -- from DATE_TIME_MEASUREMENT
            same_year: Result = date.year

feature -- Status report

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DATE_TIME_MEASUREMENT
    date_exists: date /= void
    time_exists: time /= void

end -- class DATE_TIME_VALUE


DATE_VALIDITY_CHECKER Chart

class
    DATE_VALIDITY_CHECKER

General
    cluster: time
    description: "Facility routines to check the validity of DATEs"

Ancestors
    DATE_CONSTANTS
    DATE_VALUE

Queries
    compact_date_valid (c_d: INTEGER): BOOLEAN
    date_valid (s, code_string: STRING): BOOLEAN
    date_valid_default (s: STRING): BOOLEAN
    date_valid_default_with_base (s: STRING; base: INTEGER): BOOLEAN
    date_valid_with_base (s, code_string: STRING; base: INTEGER): BOOLEAN
    is_correct_date (y, m, d: INTEGER): BOOLEAN


DATE_VALIDITY_CHECKER Flat contracts

indexing
    description: "Facility routines to check the validity of DATEs"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_VALIDITY_CHECKER

feature -- Preconditions

    compact_date_valid (c_d: INTEGER): BOOLEAN
            -- Is compact date c_d valid?

    date_valid (s: STRING; code_string: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to code_string?
        require
            s_exists: s /= void
            code_exists: code_string /= void

    date_valid_default (s: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to
            -- date_default_format_string?
        require
            s_exists: s /= void

    date_valid_default_with_base (s: STRING; base: INTEGER): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to
            -- date_default_format_string?
            -- Use base century base.
        require
            s_exists: s /= void
            base_valid: base > 0 and (base \\ 100 = 0)

    date_valid_with_base (s: STRING; code_string: STRING; base: INTEGER): BOOLEAN
            -- Is the code_string enough precise
            -- To create an instance of type DATE
            -- And does the string s correspond to code_string?
            -- Use base century base.
        require
            s_exists: s /= void
            code_exists: code_string /= void
            base_valid: base > 0 and (base \\ 100 = 0)

    is_correct_date (y, m, d: INTEGER): BOOLEAN
            -- Is date specified by y, m, and d a correct date?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_VALIDITY_CHECKER


DATE_VALUE Chart

class
    DATE_VALUE

General
    cluster: time
    description: "Values of date"

Ancestors
    DATE_MEASUREMENT

Queries
    compact_date: INTEGER
    date_default_format_string: STRING
    day: INTEGER
    days_in_i_th_month (i, y: INTEGER): INTEGER
    Days_in_leap_year: INTEGER
    days_in_month: INTEGER
    Days_in_non_leap_year: INTEGER
    Days_in_week: INTEGER
    days_text: ARRAY [STRING]
    is_leap_year (y: INTEGER): BOOLEAN
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    Max_weeks_in_year: INTEGER
    month: INTEGER
    Months_in_year: INTEGER
    months_text: ARRAY [STRING]
    year: INTEGER

Commands
    set_day (d: INTEGER)
    set_month (m: INTEGER)
    set_year (y: INTEGER)


DATE_VALUE Flat contracts

indexing
    description: "Values of date"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"
    access: date

class interface
    DATE_VALUE

feature -- Access

    compact_date: INTEGER
            -- Day, month and year coded.

    date_default_format_string: STRING
            -- Default output format for dates
            -- (from DATE_CONSTANTS)

    day: INTEGER
            -- Day of the current object

    days_in_i_th_month (i, y: INTEGER): INTEGER
            -- Number of days in the i th month at year y
            -- (from DATE_CONSTANTS)
        require -- from DATE_CONSTANTS
            i_large_enough: i >= 1
            i_small_enough: i <= months_in_year

    Days_in_leap_year: INTEGER is 366
            -- Number of days in a leap year
            -- (from DATE_CONSTANTS)

    Days_in_non_leap_year: INTEGER is 365
            -- Number of days in a non-leap year
            -- (from DATE_CONSTANTS)

    Days_in_week: INTEGER is 7
            -- Number of days in a week
            -- (from DATE_CONSTANTS)

    days_text: ARRAY [STRING]
            -- Short text representation of days
            -- (from DATE_CONSTANTS)

    long_days_text: ARRAY [STRING]
            -- Long text representation of days
            -- (from DATE_CONSTANTS)

    long_months_text: ARRAY [STRING]
            -- Long text representation of months
            -- (from DATE_CONSTANTS)

    Max_weeks_in_year: INTEGER is 53
            -- Maximun number of weeks in a year
            -- (from DATE_CONSTANTS)

    month: INTEGER
            -- Month of the current object

    Months_in_year: INTEGER is 12
            -- Number of months in year
            -- (from DATE_CONSTANTS)

    months_text: ARRAY [STRING]
            -- Short text representation of months
            -- (from DATE_CONSTANTS)

    year: INTEGER
            -- Year of the current object

feature -- Status report

    is_leap_year (y: INTEGER): BOOLEAN
            -- Is year y a leap year?
            -- (from DATE_CONSTANTS)

feature -- Element change

    set_day (d: INTEGER)
            -- Set day to d.
        require -- from DATE_MEASUREMENT
            d_large_enough: d >= 1
            d_small_enough: d <= days_in_month
        ensure -- from DATE_MEASUREMENT
            day_set: day = d

    set_month (m: INTEGER)
            -- Set month to m.
        require -- from DATE_MEASUREMENT
            m_large_enough: m >= 1
            m_small_enough: m <= months_in_year
            d_small_enough: day <= days_in_i_th_month (m, year)
        ensure -- from DATE_MEASUREMENT
            month_set: month = m

    set_year (y: INTEGER)
            -- Set year to y.
        require -- from DATE_MEASUREMENT
            can_not_cut_29th_feb: day <= days_in_i_th_month (month, y)
        ensure -- from DATE_MEASUREMENT
            year_set: year = y

feature -- Status Report

    days_in_month: INTEGER
            -- Number of days in month 'month'.
            -- (from DATE_MEASUREMENT)
        ensure -- from DATE_MEASUREMENT
            positive_result: Result > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_VALUE


DURATION Chart

deferred class
    DURATION

General
    cluster: time
    description: "Temporal intervals"

Ancestors
    GROUP_ELEMENT
    PART_COMPARABLE

Queries
    infix ">=" (other: [like Current] DURATION): BOOLEAN
    infix ">" (other: [like Current] DURATION): BOOLEAN
    infix "<=" (other: [like Current] DURATION): BOOLEAN
    infix "<" (other: [like Current] DURATION): BOOLEAN
    infix "-" (other: [like Current] DURATION): [like Current] DURATION
    infix "+" (other: [like Current] DURATION): [like Current] DURATION
    prefix "-": [like Current] DURATION
    prefix "+": [like Current] DURATION
    is_negative: BOOLEAN
    is_positive: BOOLEAN
    is_zero: BOOLEAN
    zero: [like Current] DURATION

Constraints
    sign correctness


DURATION Flat contracts

indexing
    description: "Temporal intervals"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DURATION

feature -- Access

    zero: like Current
            -- Neutral element for "+" and "-"
            -- (from GROUP_ELEMENT)
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN
            -- Is current object less than other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

feature -- Status report

    is_negative: BOOLEAN
            -- Is duration negative?

    is_positive: BOOLEAN
            -- Is duration positive?

    is_zero: BOOLEAN
            -- Is duration zero?

feature -- Element change

    prefix "+": like Current
            -- Unary plus
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: Result.is_equal (Current)

    infix "-" (other: like Current): like Current
            -- Difference with other
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void

feature -- Basic operations

    infix "+" (other: like Current): like Current
            -- Sum with other (commutative)
            -- (from GROUP_ELEMENT)
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            commutative: Result.is_equal (other + Current)

    prefix "-": like Current
            -- Unary minus
            -- (from GROUP_ELEMENT)
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: (Result + Current).is_equal (zero)

invariant

    sign_correctness: is_positive xor is_negative xor is_zero
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from GROUP_ELEMENT
    neutral_addition: Current.is_equal (Current + zero)
    self_subtraction: zero.is_equal (Current - Current)

end -- class DURATION


cluster time.format

Cluster
    time.format

Supercluster
    time

Subclusters
    time.format.english

Classes
    CODE_VALIDITY_CHECKER
    DATE_TIME_CODE
    DATE_TIME_CODE_STRING
    DATE_TIME_LANGUAGE_CONSTANTS
    DATE_TIME_PARSER
    FIND_SEPARATOR_FACILITY


CODE_VALIDITY_CHECKER Chart

class
    CODE_VALIDITY_CHECKER

General
    cluster: time.format
    description: "Facility routines to check the validity of a DATE_TIME_CODE"

Ancestors
    ANY

Queries
    is_code (s: STRING): BOOLEAN
    is_colon (s: STRING): BOOLEAN
    is_comma (s: STRING): BOOLEAN
    is_day (s: STRING): BOOLEAN
    is_day0 (s: STRING): BOOLEAN
    is_day_text (s: STRING): BOOLEAN
    is_dot (s: STRING): BOOLEAN
    is_fractional_second (s: STRING): BOOLEAN
    is_hour (s: STRING): BOOLEAN
    is_hour0 (s: STRING): BOOLEAN
    is_hour12 (s: STRING): BOOLEAN
    is_meridiem (s: STRING): BOOLEAN
    is_minus (s: STRING): BOOLEAN
    is_minute (s: STRING): BOOLEAN
    is_minute0 (s: STRING): BOOLEAN
    is_month (s: STRING): BOOLEAN
    is_month0 (s: STRING): BOOLEAN
    is_month_text (s: STRING): BOOLEAN
    is_second (s: STRING): BOOLEAN
    is_second0 (s: STRING): BOOLEAN
    is_separator (s: STRING): BOOLEAN
    is_slash (s: STRING): BOOLEAN
    is_space (s: STRING): BOOLEAN
    is_year2 (s: STRING): BOOLEAN
    is_year4 (s: STRING): BOOLEAN


CODE_VALIDITY_CHECKER Flat contracts

indexing
    description: "Facility routines to check the validity of a DATE_TIME_CODE"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    CODE_VALIDITY_CHECKER

feature -- Preconditions

    is_code (s: STRING): BOOLEAN
            -- Is the string a code?
        require
            s_exists: s /= void

    is_colon (s: STRING): BOOLEAN
            -- Is the code a separator-colomn?
        require
            s_exists: s /= void

    is_comma (s: STRING): BOOLEAN
            -- Is the code a separator-coma?
        require
            s_exists: s /= void

    is_day (s: STRING): BOOLEAN
            -- Is the code a day-numeric?
        require
            s_exists: s /= void

    is_day0 (s: STRING): BOOLEAN
            -- Is the code a day-numeric
            -- Padded with zero?
        require
            s_exists: s /= void

    is_day_text (s: STRING): BOOLEAN
            -- Is the code a day-text?
        require
            s_exists: s /= void

    is_dot (s: STRING): BOOLEAN
            -- Is the code a separator-dot?
        require
            s_exists: s /= void

    is_fractional_second (s: STRING): BOOLEAN
            -- Is the code a fractional-second
            -- With precision to n figures?
        require
            s_exists: s /= void

    is_hour (s: STRING): BOOLEAN
            -- Is the code a 24-hour-clock-scale?
        require
            s_exists: s /= void

    is_hour0 (s: STRING): BOOLEAN
            -- Is the code a 24-hour-clock-scale
            -- Padded with zero?
        require
            s_exists: s /= void

    is_hour12 (s: STRING): BOOLEAN
            -- Is the code a 12-hour-clock-scale?
        require
            s_exists: s /= void

    is_meridiem (s: STRING): BOOLEAN
            -- Is the code a meridiem notation?
        require
            s_exists: s /= void

    is_minus (s: STRING): BOOLEAN
            -- Is the code a separator-minus?
        require
            s_exists: s /= void

    is_minute (s: STRING): BOOLEAN
            -- Is the code a minute-numeric?
        require
            s_exists: s /= void

    is_minute0 (s: STRING): BOOLEAN
            -- Is the code a minute-numeric
            -- Padded with zero?
        require
            s_exists: s /= void

    is_month (s: STRING): BOOLEAN
            -- Is the code a month-numeric?
        require
            s_exists: s /= void

    is_month0 (s: STRING): BOOLEAN
            -- Is the code a month-numeric
            -- Padded with zero?
        require
            s_exists: s /= void

    is_month_text (s: STRING): BOOLEAN
            -- Is the code a month-text?
        require
            s_exists: s /= void

    is_second (s: STRING): BOOLEAN
            -- Is the code a second-numeric?
        require
            s_exists: s /= void

    is_second0 (s: STRING): BOOLEAN
            -- Is the code a second-numeric
            -- Padded with zero?
        require
            s_exists: s /= void

    is_separator (s: STRING): BOOLEAN
            -- Is the code a seperator?
        require
            s_exists: s /= void

    is_slash (s: STRING): BOOLEAN
            -- Is the code a separator-slash?
        require
            s_exists: s /= void

    is_space (s: STRING): BOOLEAN
            -- Is the code a separator-space?
        require
            s_exists: s /= void

    is_year2 (s: STRING): BOOLEAN
            -- Is the code a year-numeric
            -- On 2 figures?
        require
            s_exists: s /= void

    is_year4 (s: STRING): BOOLEAN
            -- Is the code a year-numeric
            -- On 4 figures?
        require
            s_exists: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CODE_VALIDITY_CHECKER


DATE_TIME_CODE Chart

class
    DATE_TIME_CODE

General
    cluster: time.format
    description: "Code used by the DATE/TIME to STRING conversion"
    create: make

Ancestors
    CODE_VALIDITY_CHECKER

Queries
    count_max: INTEGER
    count_min: INTEGER
    is_code (s: STRING): BOOLEAN
    is_colon (s: STRING): BOOLEAN
    is_comma (s: STRING): BOOLEAN
    is_day (s: STRING): BOOLEAN
    is_day0 (s: STRING): BOOLEAN
    is_day_text (s: STRING): BOOLEAN
    is_dot (s: STRING): BOOLEAN
    is_fractional_second (s: STRING): BOOLEAN
    is_hour (s: STRING): BOOLEAN
    is_hour0 (s: STRING): BOOLEAN
    is_hour12 (s: STRING): BOOLEAN
    is_meridiem (s: STRING): BOOLEAN
    is_minus (s: STRING): BOOLEAN
    is_minute (s: STRING): BOOLEAN
    is_minute0 (s: STRING): BOOLEAN
    is_month (s: STRING): BOOLEAN
    is_month0 (s: STRING): BOOLEAN
    is_month_text (s: STRING): BOOLEAN
    is_numeric: BOOLEAN
    is_second (s: STRING): BOOLEAN
    is_second0 (s: STRING): BOOLEAN
    is_separator (s: STRING): BOOLEAN
    is_slash (s: STRING): BOOLEAN
    is_space (s: STRING): BOOLEAN
    is_text: BOOLEAN
    is_year2 (s: STRING): BOOLEAN
    is_year4 (s: STRING): BOOLEAN
    name: STRING
    type: INTEGER
    value: STRING
    value_max: INTEGER
    value_min: INTEGER

Commands
    make (v: STRING)
    set_value (v: STRING)


DATE_TIME_CODE Flat contracts

indexing
    description: "Code used by the DATE/TIME to STRING conversion"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_TIME_CODE

create

    make (v: STRING)
            -- Create code.
        require
            v_exists: v /= void
            v_is_code: is_code (v)
        ensure
            value_set: value.is_equal (v)

feature -- Status report

    is_numeric: BOOLEAN
            -- Has the code a numeric value?

    is_text: BOOLEAN
            -- Has the code a string value?

feature -- Attributes

    count_max: INTEGER
            -- Count max of the real value

    count_min: INTEGER
            -- Count min of the real value

    name: STRING
            -- Name of the code

    type: INTEGER
            -- Type number.

    value: STRING
            -- String code

    value_max: INTEGER
            -- Max of the real value

    value_min: INTEGER
            -- Min of the real value

feature -- Change

    set_value (v: STRING)
            -- Set all the attributes such as
            -- Value, count_max, etc.
        require
            v_exists: v /= void
            v_is_code: is_code (v)
        ensure
            value_set: value.is_equal (v)

feature -- Creation

    make (v: STRING)
            -- Create code.
        require
            v_exists: v /= void
            v_is_code: is_code (v)
        ensure
            value_set: value.is_equal (v)

feature -- Preconditions

    is_code (s: STRING): BOOLEAN
            -- Is the string a code?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_colon (s: STRING): BOOLEAN
            -- Is the code a separator-colomn?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_comma (s: STRING): BOOLEAN
            -- Is the code a separator-coma?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_day (s: STRING): BOOLEAN
            -- Is the code a day-numeric?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_day0 (s: STRING): BOOLEAN
            -- Is the code a day-numeric
            -- Padded with zero?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_day_text (s: STRING): BOOLEAN
            -- Is the code a day-text?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_dot (s: STRING): BOOLEAN
            -- Is the code a separator-dot?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_fractional_second (s: STRING): BOOLEAN
            -- Is the code a fractional-second
            -- With precision to n figures?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_hour (s: STRING): BOOLEAN
            -- Is the code a 24-hour-clock-scale?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_hour0 (s: STRING): BOOLEAN
            -- Is the code a 24-hour-clock-scale
            -- Padded with zero?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_hour12 (s: STRING): BOOLEAN
            -- Is the code a 12-hour-clock-scale?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_meridiem (s: STRING): BOOLEAN
            -- Is the code a meridiem notation?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_minus (s: STRING): BOOLEAN
            -- Is the code a separator-minus?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_minute (s: STRING): BOOLEAN
            -- Is the code a minute-numeric?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_minute0 (s: STRING): BOOLEAN
            -- Is the code a minute-numeric
            -- Padded with zero?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_month (s: STRING): BOOLEAN
            -- Is the code a month-numeric?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_month0 (s: STRING): BOOLEAN
            -- Is the code a month-numeric
            -- Padded with zero?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_month_text (s: STRING): BOOLEAN
            -- Is the code a month-text?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_second (s: STRING): BOOLEAN
            -- Is the code a second-numeric?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_second0 (s: STRING): BOOLEAN
            -- Is the code a second-numeric
            -- Padded with zero?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_separator (s: STRING): BOOLEAN
            -- Is the code a seperator?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_slash (s: STRING): BOOLEAN
            -- Is the code a separator-slash?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_space (s: STRING): BOOLEAN
            -- Is the code a separator-space?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_year2 (s: STRING): BOOLEAN
            -- Is the code a year-numeric
            -- On 2 figures?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

    is_year4 (s: STRING): BOOLEAN
            -- Is the code a year-numeric
            -- On 4 figures?
            -- (from CODE_VALIDITY_CHECKER)
        require -- from CODE_VALIDITY_CHECKER
            s_exists: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_CODE


DATE_TIME_CODE_STRING Chart

class
    DATE_TIME_CODE_STRING

General
    cluster: time.format
    description: "DATE/TIME to STRING conversion"
    create: make

Ancestors
    FIND_SEPARATOR_FACILITY

Queries
    base_century: INTEGER
    correspond (s: STRING): BOOLEAN
    create_date (s: STRING): DATE
    create_date_string (date: DATE): STRING
    create_date_time (s: STRING): DATE_TIME
    create_string (date_time: DATE_TIME): STRING
    create_time (s: STRING): TIME
    create_time_string (time: TIME): STRING
    is_date (s: STRING): BOOLEAN
    is_date_time (s: STRING): BOOLEAN
    is_time (s: STRING): BOOLEAN
    is_value_valid (s: STRING): BOOLEAN
    name: STRING
    precise: BOOLEAN
    precise_date: BOOLEAN
    precise_time: BOOLEAN
    separators_used: BOOLEAN
    value: HASH_TABLE [DATE_TIME_CODE, INTEGER]

Commands
    make (s: STRING)
    set_base_century (c: INTEGER)


DATE_TIME_CODE_STRING Flat contracts

indexing
    description: "DATE/TIME to STRING conversion"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_TIME_CODE_STRING

create

    make (s: STRING)
            -- Create code descriptors and hash-table from s.
        require
            s_exists: s /= void
        ensure
            value_set: value /= void
            base_century_set: base_century < 0 and (base_century \\ 100 = 0)

feature -- Status report

    is_date (s: STRING): BOOLEAN
            -- Does s contain a DATE?
        require
            non_empty_string: s /= void and then not s.is_empty

    is_date_time (s: STRING): BOOLEAN
            -- Does s contain a DATE_TIME?
        require
            non_empty_string: s /= void and then not s.is_empty

    is_time (s: STRING): BOOLEAN
            -- Does s contain a TIME?
        require
            non_empty_string: s /= void and then not s.is_empty

    is_value_valid (s: STRING): BOOLEAN
            -- Does s contain a valid date or time as string representation?
        require
            non_empty_string: s /= void and then not s.is_empty

    separators_used: BOOLEAN
            -- Does the code string contain any separators?

feature -- Status setting

    set_base_century (c: INTEGER)
            -- Set base century to c.
        require
            base_valid: c > 0 and (c \\ 100 = 0)
        ensure
            base_century_set: base_century = c

feature -- Attributes

    base_century: INTEGER
            -- Base century, used when interpreting 2-digit year
            -- specifications.

    name: STRING
            -- Name of the code string.

    value: HASH_TABLE [DATE_TIME_CODE, INTEGER]
            -- Hash-table representing the code string.

feature -- Creation

    make (s: STRING)
            -- Create code descriptors and hash-table from s.
        require
            s_exists: s /= void
        ensure
            value_set: value /= void
            base_century_set: base_century < 0 and (base_century \\ 100 = 0)

feature -- Interface

    correspond (s: STRING): BOOLEAN
            -- Does the user string s correspond to the code string?
        require
            s_exists: s /= void

    create_date (s: STRING): DATE
            -- Create a DATE according to the format in s.
        require
            s_exists: s /= void
            is_precise: precise_date
            s_correspond: correspond (s)
        ensure
            date_exists: Result /= void
            day_text_equal_day: right_day_text

    create_date_string (date: DATE): STRING
            -- Create the output of date according to the code string.
        require
            date_exists: date /= void
        ensure
            string_exists: Result /= void
            string_correspond: correspond (Result)

    create_date_time (s: STRING): DATE_TIME
            -- Create DATE_TIME according to s.
        require
            s_exist: s /= void
            is_precise: precise
            s_correspond: correspond (s)
            valid: is_value_valid (s)
        ensure
            date_time_exists: Result /= void
            day_text_equal_day: right_day_text

    create_string (date_time: DATE_TIME): STRING
            -- Create the output of date_time according to the code string.
        require
            non_void: date_time /= void
        ensure
            string_exists: Result /= void
            string_correspond: correspond (Result)

    create_time (s: STRING): TIME
            -- Create a TIME according to the format in s.
        require
            s_exists: s /= void
            is_precise: precise_time
            s_correspond: correspond (s)
        ensure
            time_exists: Result /= void
            time_correspond: create_time_string (Result).is_equal (s)

    create_time_string (time: TIME): STRING
            -- Create the output of time according to the code string.
        require
            time_exists: time /= void
        ensure
            string_exists: Result /= void
            string_correspond: correspond (Result)

    precise: BOOLEAN
            -- Is the code string enough precise to create
            -- nn instance of type DATE_TIME?
        require
            not_void: value /= void

    precise_date: BOOLEAN
            -- Is the code string enough precise to create
            -- nn instance of type DATE?
        require
            not_void: value /= void

    precise_time: BOOLEAN
            -- Is the code string enough precise to create
            -- an instance of type TIME?
        require
            not_void: value /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_CODE_STRING


DATE_TIME_LANGUAGE_CONSTANTS Chart

deferred class
    DATE_TIME_LANGUAGE_CONSTANTS

General
    cluster: time.format
    description: "Language settings"

Ancestors
    ANY

Queries
    date_default_format_string: STRING
    days_text: ARRAY [STRING]
    default_format_string: STRING
    long_days_text: ARRAY [STRING]
    long_months_text: ARRAY [STRING]
    months_text: ARRAY [STRING]
    name: STRING
    time_default_format_string: STRING


DATE_TIME_LANGUAGE_CONSTANTS Flat contracts

indexing
    description: "Language settings"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    DATE_TIME_LANGUAGE_CONSTANTS

feature

    date_default_format_string: STRING
            -- Standard output of the date.

    days_text: ARRAY [STRING]
            -- Array of days in short format.

    default_format_string: STRING
            -- Standard output of the date and time.

    long_days_text: ARRAY [STRING]
            -- Array of days in long format.

    long_months_text: ARRAY [STRING]
            -- Array of monthes in long format.

    months_text: ARRAY [STRING]
            -- Array of monthes in short format.

    name: STRING
            -- Language

    time_default_format_string: STRING
            -- Standard output of the time.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_LANGUAGE_CONSTANTS


DATE_TIME_PARSER Chart

class
    DATE_TIME_PARSER

General
    cluster: time.format
    description: "Parser facility for dates and times"
    create: make

Ancestors
    DATE_TIME_VALIDITY_CHECKER
    FIND_SEPARATOR_FACILITY

Queries
    day: INTEGER
    day_text: STRING
    fine_second: DOUBLE
    hour: INTEGER
    is_date: BOOLEAN
    is_date_time: BOOLEAN
    is_set_up: BOOLEAN
    is_time: BOOLEAN
    is_value_valid: BOOLEAN
    minute: INTEGER
    month: INTEGER
    parsed: BOOLEAN
    source_string: STRING
    year: INTEGER

Commands
    parse
    set_base_century (c: INTEGER)
    set_day_array (d: ARRAY [STRING])
    set_month_array (m: ARRAY [STRING])
    set_source_string (s: STRING)

Constraints
    valid value definition
    valid value implies parsing


DATE_TIME_PARSER Flat contracts

indexing
    description: "Parser facility for dates and times"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_TIME_PARSER

create

    make (c: HASH_TABLE [DATE_TIME_CODE, INTEGER])
            -- Create parser with date/time code c, months array m,
            -- days array d, and base century b.
        require
            code_exists: c /= void
        ensure
            code_set: code = c

feature -- Access

    day: INTEGER
            -- Day part of source_string
        require
            value_parsed: parsed

    day_text: STRING
            -- Text representation of day
        require
            value_parsed: parsed

    fine_second: DOUBLE
            -- Seconds part of source_string
        require
            value_parsed: parsed

    hour: INTEGER
            -- Hour part of source_string
        require
            value_parsed: parsed

    minute: INTEGER
            -- Minute part of source_string
        require
            value_parsed: parsed

    month: INTEGER
            -- Month part of source_string
        require
            value_parsed: parsed

    source_string: STRING
            -- String to be parsed

    year: INTEGER
            -- Year part of source_string
        require
            value_parsed: parsed

feature -- Status report

    is_date: BOOLEAN
            -- Does source_string contain a DATE?
        require
            string_parsed: parsed

    is_date_time: BOOLEAN
            -- Does source_string contain a DATE_TIME?
        require
            string_parsed: parsed

    is_set_up: BOOLEAN
            -- Has parser been set up completely?

    is_time: BOOLEAN
            -- Does source_string contain a TIME?
        require
            string_parsed: parsed

    is_value_valid: BOOLEAN
            -- Is parsed value valid?

    parsed: BOOLEAN
            -- Has source_string been parsed?

feature -- Status setting

    set_base_century (c: INTEGER)
            -- Set base century to c.
        require
            base_century_valid: c /= 0 and (c \\ 100 = 0)
        ensure
            base_century_set: base_century = c

    set_day_array (d: ARRAY [STRING])
            -- Set day array to d.
        require
            not_void: d /= void
        ensure
            days_set: days = d

    set_month_array (m: ARRAY [STRING])
            -- Set month array to m.
        require
            not_void: m /= void
        ensure
            months_set: months = m

    set_source_string (s: STRING)
            -- Assign s to source_string.
        require
            non_empty_string: s /= void and then not s.is_empty
        ensure
            source_set: source_string = s
            not_parsed: not parsed

feature -- Basic operations

    parse
            -- Parse source_string.
        require
            setup_complete: is_set_up
        ensure
            string_parsed: parsed

invariant

    valid_value_definition: is_value_valid = (parsed and then (is_date or is_time or is_date_time))
    valid_value_implies_parsing: is_value_valid implies parsed
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_PARSER


cluster time.format.english

Cluster
    time.format.english

Supercluster
    time.format

Classes
    DATE_TIME_TOOLS


DATE_TIME_TOOLS Chart

class
    DATE_TIME_TOOLS

General
    cluster: time.format.english
    description: "English settings"

Ancestors
    DATE_TIME_LANGUAGE_CONSTANTS

Queries
    Date_default_format_string: STRING
    Days_text: ARRAY [STRING]
    Default_format_string: STRING
    Long_days_text: ARRAY [STRING]
    Long_months_text: ARRAY [STRING]
    Months_text: ARRAY [STRING]
    Name: STRING
    Time_default_format_string: STRING


DATE_TIME_TOOLS Flat contracts

indexing
    description: "English settings"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    DATE_TIME_TOOLS

feature

    Date_default_format_string: STRING is "[0]mm/[0]dd/yyyy"

    days_text: ARRAY [STRING]

    Default_format_string: STRING is "[0]mm/[0]dd/yyyy hh12:[0]mi:[0]ss.ff3"

    long_days_text: ARRAY [STRING]

    long_months_text: ARRAY [STRING]

    months_text: ARRAY [STRING]

    Name: STRING is "English"

    Time_default_format_string: STRING is "hh12:[0]mi:[0]ss.ff3"

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class DATE_TIME_TOOLS


FIND_SEPARATOR_FACILITY Chart

class
    FIND_SEPARATOR_FACILITY

General
    cluster: time.format
    description: "Facility to find seperators in date or time strings"

Ancestors
    BASIC_ROUTINES
    CODE_VALIDITY_CHECKER


GROUP_ELEMENT Chart

deferred class
    GROUP_ELEMENT

General
    cluster: time
    description: "Invertible object with an internal + operation"

Ancestors
    ANY

Queries
    infix "-" (other: [like Current] GROUP_ELEMENT): [like Current] GROUP_ELEMENT
    infix "+" (other: [like Current] GROUP_ELEMENT): [like Current] GROUP_ELEMENT
    prefix "-": [like Current] GROUP_ELEMENT
    prefix "+": [like Current] GROUP_ELEMENT
    zero: [like Current] GROUP_ELEMENT

Constraints
    neutral addition
    self subtraction


GROUP_ELEMENT Flat contracts

indexing
    description: "Invertible object with an internal + operation"
    note: "The model is that of a commutative group."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    GROUP_ELEMENT

feature -- Access

    zero: like Current
            -- Neutral element for "+" and "-"
        ensure
            result_exists: Result /= void

feature -- Basic operations

    infix "+" (other: like Current): like Current
            -- Sum with other (commutative)
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void
            commutative: Result.is_equal (other + Current)

    prefix "+": like Current
            -- Unary plus
        ensure
            result_exists: Result /= void
            result_definition: Result.is_equal (Current)

    infix "-" (other: like Current): like Current
            -- Result of subtracting other
        require
            other_exists: other /= void
        ensure
            result_exists: Result /= void

    prefix "-": like Current
            -- Unary minus
        ensure
            result_exists: Result /= void
            result_definition: (Result + Current).is_equal (zero)

invariant

    neutral_addition: Current.is_equal (Current + zero)
    self_subtraction: zero.is_equal (Current - Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class GROUP_ELEMENT


INTERVAL Chart

class
    INTERVAL [G -> ABSOLUTE]

General
    cluster: time
    description: "Intervals between absolute values"
    create: make

Ancestors
    PART_COMPARABLE
    PART_COMPARABLE

Queries
    infix ">=" (other: [like Current] INTERVAL [G]): BOOLEAN
    infix ">" (other: [like Current] INTERVAL [G]): BOOLEAN
    infix "<=" (other: [like Current] INTERVAL [G]): BOOLEAN
    infix "<" (other: [like Current] INTERVAL [G]): BOOLEAN
    after (v: G): BOOLEAN
    before (v: G): BOOLEAN
    duration: DURATION
    empty: BOOLEAN
    end_bound: G
    gather (other: [like Current] INTERVAL [G]): [like Current] INTERVAL [G]
    has (v: G): BOOLEAN
    includes (other: [like Current] INTERVAL [G]): BOOLEAN
    intersection (other: [like Current] INTERVAL [G]): [like Current] INTERVAL [G]
    intersects (other: [like Current] INTERVAL [G]): BOOLEAN
    is_equal (other: [like Current] INTERVAL [G]): BOOLEAN
    is_included_by (other: [like Current] INTERVAL [G]): BOOLEAN
    is_met_by (other: [like Current] INTERVAL [G]): BOOLEAN
    is_overlapped_by (other: [like Current] INTERVAL [G]): BOOLEAN
    is_strict_included_by (other: [like Current] INTERVAL [G]): BOOLEAN
    meets (other: [like Current] INTERVAL [G]): BOOLEAN
    out: STRING
    overlaps (other: [like Current] INTERVAL [G]): BOOLEAN
    start_bound: G
    strict_after (v: G): BOOLEAN
    strict_before (v: G): BOOLEAN
    strict_includes (other: [like Current] INTERVAL [G]): BOOLEAN
    union (other: [like Current] INTERVAL [G]): [like Current] INTERVAL [G]

Commands
    make (s, e: G)
    set_end_bound (e: G)
    set_start_bound (s: G)

Constraints
    start bound exists
    end bound exists
    start bound before end bound
    current intersection
    current union
    has bounds
    between bound


INTERVAL Flat contracts

indexing
    description: "Intervals between absolute values"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    INTERVAL [G -> ABSOLUTE]

create

    make (s, e: G)
            -- Sets start_bound and end_bound to s and e respectively.
        require
            start_exists: s /= void
            end_exists: e /= void
            start_before_end: s <= e
        ensure
            start_bound_set: start_bound /= void and then deep_equal (start_bound, s)
            end_bound_set: end_bound /= void and then deep_equal (end_bound, e)

feature -- Initialization

    make (s, e: G)
            -- Sets start_bound and end_bound to s and e respectively.
        require
            start_exists: s /= void
            end_exists: e /= void
            start_before_end: s <= e
        ensure
            start_bound_set: start_bound /= void and then deep_equal (start_bound, s)
            end_bound_set: end_bound /= void and then deep_equal (end_bound, e)

feature -- Access

    end_bound: G
            -- End bound of the current interval

    start_bound: G
            -- Start bound of the current interval

feature -- Measurement

    duration: DURATION
            -- Length of the interval

feature -- Comparison

    includes (other: like Current): BOOLEAN
            -- Does current interval include other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

    intersects (other: like Current): BOOLEAN
            -- Does current interval intersect other?
        require
            other_exists: other /= void

    is_equal (other: like Current): BOOLEAN
            -- Is current interval equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    is_included_by (other: like Current): BOOLEAN
            -- Is current interval included by other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

    is_met_by (other: like Current): BOOLEAN
            -- Is current interval met by other?
        require
            other_exists: other /= void
        ensure
            symmetry: Result = other.meets (Current)

    is_overlapped_by (other: like Current): BOOLEAN
            -- Is current interval overlapped by other?
        require
            other_exists: other /= void
        ensure
            symmetry: Result = other.overlaps (Current)

    is_strict_included_by (other: like Current): BOOLEAN
            -- Is current interval strictly included by other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

    meets (other: like Current): BOOLEAN
            -- Does current interval meet other?
        require
            other_exists: other /= void
        ensure
            symmetry: Result = other.is_met_by (Current)
            result_definition: Result = (Current <= other and intersects (other))

    overlaps (other: like Current): BOOLEAN
            -- Does current interval overlap other?
        require
            other_exists: other /= void
        ensure
            result_defition: Result = (strict_before (other.end_bound) and has (other.start_bound))
            symmetry: Result = other.is_overlapped_by (Current)

    strict_includes (other: like Current): BOOLEAN
            -- Does current interval strictly include other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix "<" (other: like Current): BOOLEAN
            -- Is current interval strictly before other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix "<=" (other: like Current): BOOLEAN
            -- Is current interval before other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current interval after other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current interval after other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

feature -- Status report

    after (v: G): BOOLEAN
            -- Is the current interval after v?
        require
            exists: v /= void
        ensure
            result_definition: Result = (start_bound >= v)

    before (v: G): BOOLEAN
            -- Is the current interval before v?
        require
            exists: v /= void
        ensure
            result_definition: Result = (end_bound <= v)

    empty: BOOLEAN
            -- Is current interval empty?
        ensure
            result_definition: Result = duration.is_equal (duration.zero)

    has (v: G): BOOLEAN
            -- Does current interval have v between its bounds?
        require
            exists: v /= void
        ensure
            result_definition: Result xor not ((start_bound <= v) and then (end_bound >= v))

    strict_after (v: G): BOOLEAN
            -- Is the current interval strictly after v?
        require
            exists: v /= void
        ensure
            result_definition: Result = (start_bound > v)

    strict_before (v: G): BOOLEAN
            -- Is the current interval strictly before v?
        require
            exists: v /= void
        ensure
            result_definition: Result xor (not (end_bound < v))

feature -- Element change

    set_end_bound (e: G)
            -- Set end_bound to e.
        require
            end_bound_exists: e /= void
            end_after_start_bound: e >= start_bound
        ensure
            end_bound_set: equal (end_bound, e)

    set_start_bound (s: G)
            -- Set start_bound to s.
        require
            start_bound_exists: s /= void
            start_before_end_bound: s <= end_bound
        ensure
            start_bound_set: equal (start_bound, s)

feature -- Basic operations

    gather (other: like Current): like Current
            -- Union of other and current interval if other meets
            -- current interval
        require
            other_exist: other /= void
            meeting_interval: meets (other)
        ensure
            result_exist: Result /= void
            result_same_as_union: Result.is_equal (union (other))

    intersection (other: like Current): like Current
            -- Intersection with other
        require
            other_exists: other /= void
        ensure
            intersects_validity: intersects (other) implies Result /= void
            result_is_included_by_current: intersects (other) implies includes (Result)
            result_is_included_by_other: intersects (other) implies other.includes (Result)

    union (other: like Current): like Current
            -- Union with other
        require
            other_exists: other /= void
            intersects: intersects (other)
        ensure
            result_exists: Result /= void
            result_includes_current: Result.includes (Current)
            result_includes_other: Result.includes (other)

feature -- Output

    out: STRING
            -- Printable representation of the current interval

invariant

    start_bound_exists: start_bound /= void
    end_bound_exists: end_bound /= void
    start_bound_before_end_bound: start_bound <= end_bound
    current_intersection: intersection (Current).is_equal (Current)
    current_union: union (Current).is_equal (Current)
    has_bounds: has (start_bound) and has (end_bound)
    between_bound: after (start_bound) and before (end_bound)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class INTERVAL


TIME_CONSTANTS Chart

class
    TIME_CONSTANTS

General
    cluster: time
    description: "Universal constants of time in a day"

Ancestors
    TIME_UTILITY

Queries
    Hours_in_day: INTEGER
    Minutes_in_hour: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    time_default_format_string: STRING


TIME_CONSTANTS Flat contracts

indexing
    description: "Universal constants of time in a day"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"
    access: time

class interface
    TIME_CONSTANTS

feature -- Access

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute

    time_default_format_string: STRING
            -- Default output format for times

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TIME_CONSTANTS


TIME_DURATION Chart

class
    TIME_DURATION

General
    cluster: time
    description: "Durations of time"
    create: make_by_seconds, make_fine, make_by_fine_seconds, make

Ancestors
    DOUBLE_MATH
    DURATION
    TIME_MEASUREMENT

Queries
    infix ">=" (other: [like Current] TIME_DURATION): BOOLEAN
    infix ">" (other: [like Current] TIME_DURATION): BOOLEAN
    infix "<=" (other: [like Current] TIME_DURATION): BOOLEAN
    infix "<" (other: [like Current] TIME_DURATION): BOOLEAN
    infix "-" (other: [like Current] TIME_DURATION): [like Current] TIME_DURATION
    infix "+" (other: [like Current] TIME_DURATION): [like Current] TIME_DURATION
    prefix "-": [like Current] TIME_DURATION
    prefix "+": [like Current] TIME_DURATION
    canonical: BOOLEAN
    fine_second: DOUBLE
    fine_seconds_count: DOUBLE
    fractional_second: DOUBLE
    hour: INTEGER
    Hours_in_day: INTEGER
    is_equal (other: [like Current] TIME_DURATION): BOOLEAN
    is_negative: BOOLEAN
    is_positive: BOOLEAN
    is_zero: BOOLEAN
    minute: INTEGER
    Minutes_in_hour: INTEGER
    second: INTEGER
    seconds_count: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    time_default_format_string: STRING
    time_modulo_day: [like Current] TIME_DURATION
    to_canonical: [like Current] TIME_DURATION
    to_days: INTEGER
    Zero: TIME_DURATION

Commands
    fine_second_add (s: DOUBLE)
    hour_add (h: INTEGER)
    make (h, m, s: INTEGER)
    make_by_fine_seconds (s: DOUBLE)
    make_by_seconds (s: INTEGER)
    make_fine (h, m: INTEGER; s: DOUBLE)
    minute_add (m: INTEGER)
    second_add (s: INTEGER)
    set_fine_second (s: DOUBLE)
    set_fractionals (f: DOUBLE)
    set_hour (h: INTEGER)
    set_minute (m: INTEGER)
    set_second (s: INTEGER)

Constraints
    fractionals large enough
    fractionals small enough
    fractional and second same sign
    equal signs


TIME_DURATION Flat contracts

indexing
    description: "Durations of time"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"
    access: time

class interface
    TIME_DURATION

create

    make (h, m, s: INTEGER)
            -- Set hour, minute and second to h, m, s respectively.
        ensure
            hour_set: hour = h
            minute_set: minute = m
            second_set: second = s

    make_fine (h, m: INTEGER; s: DOUBLE)
            -- Set `hour, minute and second to h, m and truncated to
            -- integer part of s respectively.
            -- Set fractional_second to the fractional part of s.
        ensure
            hour_set: hour = h
            minute_set: minute = m
            fine_second_set: fine_second = s

    make_by_seconds (s: INTEGER)
            -- Set the object by the number of seconds s.
        ensure
            seconds_count_set: seconds_count = s

    make_by_fine_seconds (s: DOUBLE)
            -- Set the object by the number of seconds s.
        ensure
            minute_large_enough: minute >= 0
            minute_small_enough: minute < minutes_in_hour
            second_large_enough: second >= 0
            second_small_enough: second < seconds_in_minute
            fine_seconds_set: dabs (fine_seconds_count - s) <= tolerance

feature -- Initialization

    make (h, m, s: INTEGER)
            -- Set hour, minute and second to h, m, s respectively.
        ensure
            hour_set: hour = h
            minute_set: minute = m
            second_set: second = s

    make_by_fine_seconds (s: DOUBLE)
            -- Set the object by the number of seconds s.
        ensure
            minute_large_enough: minute >= 0
            minute_small_enough: minute < minutes_in_hour
            second_large_enough: second >= 0
            second_small_enough: second < seconds_in_minute
            fine_seconds_set: dabs (fine_seconds_count - s) <= tolerance

    make_by_seconds (s: INTEGER)
            -- Set the object by the number of seconds s.
        ensure
            seconds_count_set: seconds_count = s

    make_fine (h, m: INTEGER; s: DOUBLE)
            -- Set `hour, minute and second to h, m and truncated to
            -- integer part of s respectively.
            -- Set fractional_second to the fractional part of s.
        ensure
            hour_set: hour = h
            minute_set: minute = m
            fine_second_set: fine_second = s

feature -- Access

    fine_seconds_count: DOUBLE
            -- Number of seconds and fractionals of seconds of current duration

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    seconds_count: INTEGER
            -- Total number of seconds of current duration
        ensure
            same_count: Result = fine_seconds_count.truncated_to_integer

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

    zero: TIME_DURATION
            -- Neutral element for "+" and "-"
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void

feature -- Comparison

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from PART_COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void

feature -- Status report

    canonical: BOOLEAN
            -- Is duration expressed minimally, i.e.
            --	If duration is positive then
            --		hour positive,
            --		minute and second between 0 and 59,
            --		fractional_second between 0 and 999?
            --	If duration is negative then
            --		hour negative,
            --		minute and second between -59 and 0,
            --		fractional_second between -999 and 0?

    is_negative: BOOLEAN
            -- Is duration negative?
            -- (from DURATION)

    is_positive: BOOLEAN
            -- Is duration positive?

    is_zero: BOOLEAN
            -- Is duration zero?
            -- (from DURATION)

feature -- Element change

    prefix "+": like Current
            -- Unary plus
            -- (from DURATION)
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: Result.is_equal (Current)

    infix "-" (other: like Current): like Current
            -- Difference with other
            -- (from DURATION)
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void

feature -- Conversion

    time_modulo_day: like Current
            -- Duration modulo duration of a day
        ensure
            result_smaller_than_day: Result.seconds_count < seconds_in_day
            result_positive: Result >= zero

    to_canonical: like Current
            -- A new duration
        ensure
            result_canonical: Result.canonical

    to_days: INTEGER
            -- Total number of days equivalent to the current duration

feature -- Basic operations

    fine_second_add (s: DOUBLE)
            -- Add s seconds to the current time.
            -- if s has decimals, fractional_second is modifed.

    hour_add (h: INTEGER)
            -- Add h hours to the current duration.
        ensure
            hour_set: hour = old hour + h

    minute_add (m: INTEGER)
            -- Add m minutes to the current duration.
        ensure
            minute_set: minute = old minute + m

    second_add (s: INTEGER)
            -- Add s seconds to the current duration.
        ensure
            second_set: second = old second + s

    infix "+" (other: like Current): like Current
            -- Sum with other
        require -- from GROUP_ELEMENT
            other_exists: other /= void
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            commutative: Result.is_equal (other + Current)

    prefix "-": like Current
            -- Unary minus
        ensure -- from GROUP_ELEMENT
            result_exists: Result /= void
            result_definition: (Result + Current).is_equal (zero)

feature -- Attributes

    fine_second: DOUBLE

    fractional_second: DOUBLE

    hour: INTEGER

    minute: INTEGER

    second: INTEGER

feature -- Comparaison

    is_equal (other: like Current): BOOLEAN
            -- Is the current duration equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    infix "<" (other: like Current): BOOLEAN
            -- Is the current duration smaller than other?
        require -- from PART_COMPARABLE
            other_exists: other /= void

feature -- Element Change

    set_fine_second (s: DOUBLE)
            -- Set fine_second to s.
        require -- from TIME_MEASUREMENT
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure -- from TIME_MEASUREMENT
            fine_second_set: fine_second = s

    set_fractionals (f: DOUBLE)
            -- Set fractional_second to f.
            -- f must have the same sign as second.
        require -- from TIME_MEASUREMENT
            f_large_enough: f >= 0
            f_small_enough: f < 1
        ensure -- from TIME_MEASUREMENT
            second_same: second = old second

    set_hour (h: INTEGER)
            -- Set hour to h.
        require -- from TIME_MEASUREMENT
            h_large_enough: h >= 0
            h_small_enough: h < hours_in_day
        ensure -- from TIME_MEASUREMENT
            hour_set: hour = h

    set_minute (m: INTEGER)
            -- Set minute to m.
        require -- from TIME_MEASUREMENT
            m_large_enough: m >= 0
            m_small_enough: m < minutes_in_hour
        ensure -- from TIME_MEASUREMENT
            minute_set: minute = m

    set_second (s: INTEGER)
            -- Set second to s.
            -- fractional_second is cut down to 0.
        require -- from TIME_MEASUREMENT
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure -- from TIME_MEASUREMENT
            second_set: second = s

invariant

    fractionals_large_enough: fractional_second > - 1
    fractionals_small_enough: fractional_second < 1
    fractional_and_second_same_sign: second * fractional_second >= 0
    equal_signs: canonical implies (hour >= 0 and minute >= 0 and fine_second >= 0) or (hour <= 0 and minute <= 0 and fine_second <= 0)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from DURATION
    sign_correctness: is_positive xor is_negative xor is_zero
        -- from GROUP_ELEMENT
    neutral_addition: Current.is_equal (Current + zero)
    self_subtraction: zero.is_equal (Current - Current)

end -- class TIME_DURATION


TIME Chart

class
    TIME

General
    cluster: time
    description: "Absolute times"
    create: make_fine, make_now, make, make_by_compact_time, make_from_string, make_by_seconds, make_by_fine_seconds, make_from_string_default

Ancestors
    ABSOLUTE
    TIME_VALIDITY_CHECKER
    TIME_VALUE

Queries
    infix ">=" (other: [like Current] TIME): BOOLEAN
    infix ">" (other: [like Current] TIME): BOOLEAN
    infix "<=" (other: [like Current] TIME): BOOLEAN
    infix "<" (other: [like Current] TIME): BOOLEAN
    infix "-" (other: [like Current] TIME): INTERVAL [[like Current] TIME]
    infix "+" (t: TIME_DURATION): TIME
    compact_time: INTEGER
    compact_time_valid (c_t: INTEGER): BOOLEAN
    duration: TIME_DURATION
    fine_second: DOUBLE
    fine_seconds: DOUBLE
    formatted_out (s: STRING): STRING
    fractional_second: DOUBLE
    hour: INTEGER
    Hours_in_day: INTEGER
    is_correct_time (h, m: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN
    is_equal (other: [like Current] TIME): BOOLEAN
    max (other: [like Current] TIME): [like Current] TIME
    micro_second: INTEGER
    milli_second: INTEGER
    min (other: [like Current] TIME): [like Current] TIME
    minute: INTEGER
    Minutes_in_hour: INTEGER
    nano_second: INTEGER
    Origin: TIME
    out: STRING
    relative_duration (other: [like Current] TIME): TIME_DURATION
    second: INTEGER
    seconds: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    three_way_comparison (other: [like Current] TIME): INTEGER
    time_default_format_string: STRING
    time_valid (s, code_string: STRING): BOOLEAN

Commands
    fine_second_add (f: DOUBLE)
    hour_add (h: INTEGER)
    hour_back
    hour_forth
    make (h, m, s: INTEGER)
    make_by_compact_time (c_t: INTEGER)
    make_by_fine_seconds (sec: DOUBLE)
    make_by_seconds (sec: INTEGER)
    make_fine (h, m: INTEGER; s: DOUBLE)
    make_from_string (s, code: STRING)
    make_from_string_default (s: STRING)
    make_now
    minute_add (m: INTEGER)
    minute_back
    minute_forth
    second_add (s: INTEGER)
    second_back
    second_forth
    set_fine_second (s: DOUBLE)
    set_fractionals (f: DOUBLE)
    set_hour (h: INTEGER)
    set_minute (m: INTEGER)
    set_second (s: INTEGER)

Constraints
    second large enough
    second small enough
    fractionals large enough
    fractionals small enough
    minute large enough
    minute small enough
    hour large enough
    hour small enough


TIME Flat contracts

indexing
    description: "Absolute times"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"
    access: time

class interface
    TIME

create

    make (h, m, s: INTEGER)
            -- Set `hour, minute and second to h, m, s respectively.
        require
            correct_time: is_correct_time (h, m, s, False)
        ensure
            hour_set: hour = h
            minute_set: minute = m
            second_set: second = s

    make_fine (h, m: INTEGER; s: DOUBLE)
            -- Set `hour, minute and second to h, m and truncated to
            -- integer part of s respectively.
            -- Set fractional_second to the fractional part of s.
        require
            correct_time: is_correct_time (h, m, s, False)
        ensure
            hour_set: hour = h
            minute_set: minute = m
            fine_second_set: fine_second = s

    make_now
            -- Set current time according to timezone.

    make_by_seconds (sec: INTEGER)
            -- Set the object by the number of seconds sec from midnight.
        require
            s_large_enough: sec >= 0
            s_small_enough: sec < seconds_in_day
        ensure
            seconds_set: seconds = sec

    make_by_fine_seconds (sec: DOUBLE)
            -- Set the object by the number of seconds sec.
        require
            s_large_enough: sec >= 0
            s_small_enough: sec < seconds_in_day

    make_from_string (s: STRING; code: STRING)
            -- Initialize from a "standard" string of form
            -- code.
        require
            s_exists: s /= void
            c_exists: code /= void
            time_valid: time_valid (s, code)

    make_from_string_default (s: STRING)
            -- Initialize from a "standard" string of form
            -- default_format_string.
        require
            s_exists: s /= void
            time_valid: time_valid (s, default_format_string)

    make_by_compact_time (c_t: INTEGER)
            -- Initialize from compact_time.
        require
            c_t_not_void: c_t /= void
            c_t_valid: compact_time_valid (c_t)
        ensure
            compact_time_set: compact_time = c_t

feature -- Initialization

    make (h, m, s: INTEGER)
            -- Set `hour, minute and second to h, m, s respectively.
        require
            correct_time: is_correct_time (h, m, s, False)
        ensure
            hour_set: hour = h
            minute_set: minute = m
            second_set: second = s

    make_by_compact_time (c_t: INTEGER)
            -- Initialize from compact_time.
        require
            c_t_not_void: c_t /= void
            c_t_valid: compact_time_valid (c_t)
        ensure
            compact_time_set: compact_time = c_t

    make_by_fine_seconds (sec: DOUBLE)
            -- Set the object by the number of seconds sec.
        require
            s_large_enough: sec >= 0
            s_small_enough: sec < seconds_in_day

    make_by_seconds (sec: INTEGER)
            -- Set the object by the number of seconds sec from midnight.
        require
            s_large_enough: sec >= 0
            s_small_enough: sec < seconds_in_day
        ensure
            seconds_set: seconds = sec

    make_fine (h, m: INTEGER; s: DOUBLE)
            -- Set `hour, minute and second to h, m and truncated to
            -- integer part of s respectively.
            -- Set fractional_second to the fractional part of s.
        require
            correct_time: is_correct_time (h, m, s, False)
        ensure
            hour_set: hour = h
            minute_set: minute = m
            fine_second_set: fine_second = s

    make_from_string (s: STRING; code: STRING)
            -- Initialize from a "standard" string of form
            -- code.
        require
            s_exists: s /= void
            c_exists: code /= void
            time_valid: time_valid (s, code)

    make_from_string_default (s: STRING)
            -- Initialize from a "standard" string of form
            -- default_format_string.
        require
            s_exists: s /= void
            time_valid: time_valid (s, default_format_string)

    make_now
            -- Set current time according to timezone.

feature -- Access

    compact_time: INTEGER
            -- Hour, minute, second coded.
            -- (from TIME_VALUE)

    fine_second: DOUBLE
            -- Representation of second with decimals
            -- (from TIME_VALUE)

    fractional_second: DOUBLE
            -- Fractional part of fine_second
            -- (from TIME_VALUE)

    hour: INTEGER
            -- Hour of the current time
            -- (from TIME_VALUE)

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    micro_second: INTEGER
            -- Microsecond of the current time
            -- (from TIME_VALUE)

    milli_second: INTEGER
            -- Millisecond of the current time
            -- (from TIME_VALUE)

    minute: INTEGER
            -- Minute of the current time
            -- (from TIME_VALUE)

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    nano_second: INTEGER
            -- Nanosecond of the current time
            -- (from TIME_VALUE)

    origin: TIME
            -- Origin time
        ensure -- from ABSOLUTE
            result_exists: Result /= void

    second: INTEGER
            -- Second of the current time
            -- (from TIME_VALUE)

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

feature -- Measurement

    duration: TIME_DURATION
            -- Duration elapsed from midnight
        ensure then
            seconds_large_enough: duration.seconds_count >= 0
            seconds_small_enough: duration.seconds_count < seconds_in_day

    fine_seconds: DOUBLE
            -- Number of seconds and fractions of seconds elapsed from midnight

    seconds: INTEGER
            -- Number of seconds elapsed from midnight
        ensure
            result_definition: Result = duration.seconds_count

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object of the same type
            -- as current object and identical to it?
            -- (from COMPARABLE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is the current time before other?
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Element change

    set_fine_second (s: DOUBLE)
            -- Set fine_second to s
            -- (from TIME_VALUE)
        require -- from TIME_MEASUREMENT
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure -- from TIME_MEASUREMENT
            fine_second_set: fine_second = s

    set_fractionals (f: DOUBLE)
            -- Set fractional_second to f.
            -- (from TIME_VALUE)
        require -- from TIME_MEASUREMENT
            f_large_enough: f >= 0
            f_small_enough: f < 1
        ensure -- from TIME_MEASUREMENT
            second_same: second = old second

    set_hour (h: INTEGER)
            -- Set hour to h.
            -- (from TIME_VALUE)
        require -- from TIME_MEASUREMENT
            h_large_enough: h >= 0
            h_small_enough: h < hours_in_day
        ensure -- from TIME_MEASUREMENT
            hour_set: hour = h

    set_minute (m: INTEGER)
            -- Set minute to m.
            -- (from TIME_VALUE)
        require -- from TIME_MEASUREMENT
            m_large_enough: m >= 0
            m_small_enough: m < minutes_in_hour
        ensure -- from TIME_MEASUREMENT
            minute_set: minute = m

    set_second (s: INTEGER)
            -- Set second to s.
            -- (from TIME_VALUE)
        require -- from TIME_MEASUREMENT
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure -- from TIME_MEASUREMENT
            second_set: second = s

feature -- Basic operations

    fine_second_add (f: DOUBLE)
            -- Add f seconds to the current time.
            -- if f has decimals, fractional_second is modified.

    hour_add (h: INTEGER)
            -- Add h hours to the current object.

    hour_back
            -- Move to evious hour.

    hour_forth
            -- Move to next hour.

    minute_add (m: INTEGER)
            -- Add m minutes to the current object.

    minute_back
            -- Move to evious minute.

    minute_forth
            -- Move to next minute.

    relative_duration (other: like Current): TIME_DURATION
            -- Duration elapsed from other to Current
        require -- from ABSOLUTE
            other_exists: other /= void
        ensure -- from ABSOLUTE
            result_exists: Result /= void

    second_add (s: INTEGER)
            -- Add s seconds to the current time.

    second_back
            -- Move to previous second.

    second_forth
            -- Move to next second.

    infix "+" (t: TIME_DURATION): TIME
            -- Sum of the current time and duration t
        require
            t_exists: t /= void
        ensure
            result_exists: Result /= void

    infix "-" (other: like Current): INTERVAL [like Current]
            -- Interval between current object and other
            -- (from ABSOLUTE)
        require -- from ABSOLUTE
            other_exists: other /= void
            other_smaller_than_current: other <= Current
        ensure -- from ABSOLUTE
            result_exists: Result /= void
            result_set: Result.start_bound.is_equal (other) and then Result.end_bound.is_equal (Current)

feature -- Output

    formatted_out (s: STRING): STRING
            -- Printable representation of time with "standard"
            -- Form: s
        require
            s_exists: s /= void

    out: STRING
            -- Printable representation of time with "standard"
            -- Form: time_default_format_string

feature -- Preconditions

    compact_time_valid (c_t: INTEGER): BOOLEAN
            -- Is compact time c_t valid?
            -- (from TIME_VALIDITY_CHECKER)
        require -- from TIME_VALIDITY_CHECKER
            c_t_not_void: c_t /= void

    is_correct_time (h, m: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN
            -- Is time represented by h, m, code, and s correct?
            -- twelve_hour_scale specifies if the hour range is 1 - 12
            -- (if True) or 0 - 23 (if False).
            -- (from TIME_VALIDITY_CHECKER)

    time_valid (s: STRING; code_string: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- to create an instance of type TIME?
            -- And does the string s correspond to code_string?
            -- (from TIME_VALIDITY_CHECKER)
        require -- from TIME_VALIDITY_CHECKER
            s_exists: s /= void
            code_exists: code_string /= void

invariant

    second_large_enough: second >= 0
    second_small_enough: second < seconds_in_minute
    fractionals_large_enough: fractional_second >= 0
    fractionals_small_enough: fractional_second < 1
    minute_large_enough: minute >= 0
    minute_small_enough: minute < minutes_in_hour
    hour_large_enough: hour >= 0
    hour_small_enough: hour < hours_in_day
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

end -- class TIME


TIME_MEASUREMENT Chart

deferred class
    TIME_MEASUREMENT

General
    cluster: time
    description: "Time Measurable Units"

Ancestors
    TIME_CONSTANTS

Queries
    fine_second: DOUBLE
    hour: INTEGER
    Hours_in_day: INTEGER
    minute: INTEGER
    Minutes_in_hour: INTEGER
    second: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    time_default_format_string: STRING

Commands
    set_fine_second (s: DOUBLE)
    set_fractionals (f: DOUBLE)
    set_hour (h: INTEGER)
    set_minute (m: INTEGER)
    set_second (s: INTEGER)


TIME_MEASUREMENT Flat contracts

indexing
    description: "Time Measurable Units"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    TIME_MEASUREMENT

feature -- Access

    fine_second: DOUBLE
            -- Number of fine seconds associated with current object

    hour: INTEGER
            -- Number of hours associated with current object

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    minute: INTEGER
            -- Number of minutes associated with current object

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    second: INTEGER
            -- Number of seconds associated with current object.

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

feature -- Settings

    set_fine_second (s: DOUBLE)
            -- Set fine_second to s
        require
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure
            fine_second_set: fine_second = s

    set_fractionals (f: DOUBLE)
            -- Set fractional_second to f.
        require
            f_large_enough: f >= 0
            f_small_enough: f < 1
        ensure
            second_same: second = old second

    set_hour (h: INTEGER)
            -- Set hour to h.
        require
            h_large_enough: h >= 0
            h_small_enough: h < hours_in_day
        ensure
            hour_set: hour = h

    set_minute (m: INTEGER)
            -- Set minute to m.
        require
            m_large_enough: m >= 0
            m_small_enough: m < minutes_in_hour
        ensure
            minute_set: minute = m

    set_second (s: INTEGER)
            -- Set second to s.
        require
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure
            second_set: second = s

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TIME_MEASUREMENT


TIME_SET Chart

class
    TIME_SET

General
    cluster: time
    description: "Sets of compactly coded times"
    create: make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): NUMERIC
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [NUMERIC]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): NUMERIC
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: NUMERIC): BOOLEAN
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] TIME_SET): BOOLEAN
    is_inserted (v: NUMERIC): BOOLEAN
    item (i: INTEGER): TIME
    item_array (i: INTEGER): NUMERIC
    last: INTEGER
    linear_representation: LINEAR [NUMERIC]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: NUMERIC): INTEGER
    prunable: BOOLEAN
    resizable: BOOLEAN
    same_items (other: [like Current] TIME_SET): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] TIME_SET
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN

Commands
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] TIME_SET)
    discard_items
    enter (v: [like item] NUMERIC; i: INTEGER)
    fill (other: CONTAINER [NUMERIC])
    force (v: [like item] NUMERIC; i: INTEGER)
    grow (i: INTEGER)
    make (n: INTEGER)
    make_array (min_index, max_index: INTEGER)
    make_from_array (a: ARRAY [NUMERIC])
    prune_all (v: NUMERIC)
    put (t: TIME)
    put_array (v: [like item] NUMERIC; i: INTEGER)
    resize (min_index, max_index: INTEGER)
    subcopy (other: [like Current] TIME_SET; start_pos, end_pos, index_pos: INTEGER)

Constraints
    last non negative
    last small enough


TIME_SET Flat contracts

indexing
    description: "Sets of compactly coded times"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    TIME_SET

create

    make (n: INTEGER)
            -- Create set for n times.
        require
            positive: n > 0

feature -- Initialization

    make (n: INTEGER)
            -- Create set for n times.
        require
            positive: n > 0

    make_array (min_index, max_index: INTEGER)
            -- Allocate array; set index interval to
            -- min_index .. max_index; set all values to default.
            -- (Make array empty if min_index = max_index + 1).
            -- (from ARRAY)
        require -- from ARRAY
            valid_bounds: min_index <= max_index + 1
        ensure -- from ARRAY
            lower_set: lower = min_index
            upper_set: upper = max_index
            items_set: all_default

    make_from_array (a: ARRAY [NUMERIC])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    area: SPECIAL [NUMERIC]
            -- Special data zone
            -- (from TO_SPECIAL)

    entry (i: INTEGER): NUMERIC
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: NUMERIC): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (i: INTEGER): TIME
            -- Item at index i
        require
            index_in_range: 1 <= i and i <= last

    item_array (i: INTEGER): NUMERIC
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

    last: INTEGER
            -- Index of the last item inserted

    infix "@" (i: INTEGER): NUMERIC
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: NUMERIC): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((item_array (upper) = void or else item_array (upper) = item_array (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: NUMERIC): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (item_array (upper) = other.item_array (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like item_array; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [NUMERIC])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item_array; i: INTEGER)
            -- Assign item v to i-th entry.
            -- Always applicable: resize the array if i falls out of
            -- currently defined bounds; preserve existing items.
            -- (from ARRAY)
        ensure -- from ARRAY
            inserted: item_array (i) = v
            higher_count: count >= old count

    put (t: TIME)
            -- insert t as last item.
        require
            exists: t /= void
        ensure
            inserted: equal (item (last), t)

    put_array (v: like item_array; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item_array (k) = v

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: NUMERIC)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (min_index, max_index: INTEGER)
            -- Rearrange array so that it can accommodate
            -- indices down to min_index and up to max_index.
            -- Do not lose any previously entered item.
            -- (from ARRAY)
        require -- from ARRAY
            good_indices: min_index <= max_index
        ensure -- from ARRAY
            no_low_lost: lower = min_index or else lower = old lower
            no_high_lost: upper = max_index or else upper = old upper

feature -- Conversion

    linear_representation: LINEAR [NUMERIC]
            -- Representation as a linear structure
            -- (from ARRAY)

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

invariant

    last_non_negative: last >= 0
    last_small_enough: last <= count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class TIME_SET


TIME_UTILITY Chart

class
    TIME_UTILITY

General
    cluster: time
    description: "Functions useful in time calculations"

Ancestors
    ANY

Queries
    Date_time_tools: DATE_TIME_TOOLS
    default_format_string: STRING
    div (i, j: INTEGER): INTEGER
    mod (i, j: INTEGER): INTEGER


TIME_UTILITY Flat contracts

indexing
    description: "Functions useful in time calculations"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    TIME_UTILITY

feature -- Access

    date_time_tools: DATE_TIME_TOOLS
            -- Tools for outputting dates and times in different formats

    default_format_string: STRING
            -- Default output format string

feature -- Basic operations

    div (i, j: INTEGER): INTEGER
            -- (i \\ j) if i positive
            -- (i \\ j + 1) if i negative
        ensure
            result_definition: i = j * Result + mod (i, j)

    mod (i, j: INTEGER): INTEGER
            -- (i \\ j) if i positive
            -- (i \\ j + j) if i negative
        ensure
            positive_result: Result >= 0
            result_definition: i = j * div (i, j) + Result

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TIME_UTILITY


TIME_VALIDITY_CHECKER Chart

class
    TIME_VALIDITY_CHECKER

General
    cluster: time
    description: "Facility routines to check the validity of TIMEs"

Ancestors
    TIME_CONSTANTS
    TIME_VALUE

Queries
    compact_time_valid (c_t: INTEGER): BOOLEAN
    is_correct_time (h, m: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN
    time_valid (s, code_string: STRING): BOOLEAN


TIME_VALIDITY_CHECKER Flat contracts

indexing
    description: "Facility routines to check the validity of TIMEs"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    TIME_VALIDITY_CHECKER

feature -- Preconditions

    compact_time_valid (c_t: INTEGER): BOOLEAN
            -- Is compact time c_t valid?
        require
            c_t_not_void: c_t /= void

    is_correct_time (h, m: INTEGER; s: DOUBLE; twelve_hour_scale: BOOLEAN): BOOLEAN
            -- Is time represented by h, m, code, and s correct?
            -- twelve_hour_scale specifies if the hour range is 1 - 12
            -- (if True) or 0 - 23 (if False).

    time_valid (s: STRING; code_string: STRING): BOOLEAN
            -- Is the code_string enough precise
            -- to create an instance of type TIME?
            -- And does the string s correspond to code_string?
        require
            s_exists: s /= void
            code_exists: code_string /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TIME_VALIDITY_CHECKER


TIME_VALUE Chart

class
    TIME_VALUE

General
    cluster: time
    description: "Values of time"

Ancestors
    TIME_MEASUREMENT

Queries
    compact_time: INTEGER
    fine_second: DOUBLE
    fractional_second: DOUBLE
    hour: INTEGER
    Hours_in_day: INTEGER
    micro_second: INTEGER
    milli_second: INTEGER
    minute: INTEGER
    Minutes_in_hour: INTEGER
    nano_second: INTEGER
    second: INTEGER
    Seconds_in_day: INTEGER
    Seconds_in_hour: INTEGER
    Seconds_in_minute: INTEGER
    time_default_format_string: STRING

Commands
    set_fine_second (s: DOUBLE)
    set_fractionals (f: DOUBLE)
    set_hour (h: INTEGER)
    set_minute (m: INTEGER)
    set_second (s: INTEGER)


TIME_VALUE Flat contracts

indexing
    description: "Values of time"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"
    access: time

class interface
    TIME_VALUE

feature -- Access

    compact_time: INTEGER
            -- Hour, minute, second coded.

    fine_second: DOUBLE
            -- Representation of second with decimals

    fractional_second: DOUBLE
            -- Fractional part of fine_second

    hour: INTEGER
            -- Hour of the current time

    Hours_in_day: INTEGER is 24
            -- Number of hours in a day
            -- (from TIME_CONSTANTS)

    micro_second: INTEGER
            -- Microsecond of the current time

    milli_second: INTEGER
            -- Millisecond of the current time

    minute: INTEGER
            -- Minute of the current time

    Minutes_in_hour: INTEGER is 60
            -- Number of minutes in an hour
            -- (from TIME_CONSTANTS)

    nano_second: INTEGER
            -- Nanosecond of the current time

    second: INTEGER
            -- Second of the current time

    Seconds_in_day: INTEGER is 86400
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_hour: INTEGER is 3600
            -- Number of seconds in an hour
            -- (from TIME_CONSTANTS)

    Seconds_in_minute: INTEGER is 60
            -- Number of seconds in a minute
            -- (from TIME_CONSTANTS)

    time_default_format_string: STRING
            -- Default output format for times
            -- (from TIME_CONSTANTS)

feature -- Element change

    set_fine_second (s: DOUBLE)
            -- Set fine_second to s
        require -- from TIME_MEASUREMENT
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure -- from TIME_MEASUREMENT
            fine_second_set: fine_second = s

    set_fractionals (f: DOUBLE)
            -- Set fractional_second to f.
        require -- from TIME_MEASUREMENT
            f_large_enough: f >= 0
            f_small_enough: f < 1
        ensure -- from TIME_MEASUREMENT
            second_same: second = old second

    set_hour (h: INTEGER)
            -- Set hour to h.
        require -- from TIME_MEASUREMENT
            h_large_enough: h >= 0
            h_small_enough: h < hours_in_day
        ensure -- from TIME_MEASUREMENT
            hour_set: hour = h

    set_minute (m: INTEGER)
            -- Set minute to m.
        require -- from TIME_MEASUREMENT
            m_large_enough: m >= 0
            m_small_enough: m < minutes_in_hour
        ensure -- from TIME_MEASUREMENT
            minute_set: minute = m

    set_second (s: INTEGER)
            -- Set second to s.
        require -- from TIME_MEASUREMENT
            s_large_enough: s >= 0
            s_small_enough: s < seconds_in_minute
        ensure -- from TIME_MEASUREMENT
            second_set: second = s

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TIME_VALUE


EiffelVision 2

Type: Library
Platform: Any
Version: 5.0

See:

  • Introduction
  • Content
  • Samples
  • Reference


EiffelVision 2 Introduction

Overview

Preface

The EiffelVision library offers an object-oriented framework for graphical user interface (GUI) development. Using EiffelVision, developers can access all necessary GUI components, called widgets (buttons, windows, listviews) as well as truly graphical elements such as points, lines, arcs, polygons and the like -- to develop a modern, functional and good-looking graphical interactive application.

EiffelVision has played a major role in ISE Eiffel and provided numerous Eiffel projects with a powerful, portable graphics development platform. EiffelStudio is totally reliant on EiffelVision for its graphical elements and overall interaction with the user.

Scope

The EiffelVision library addresses all the major needs of developers of systems supporting modern graphical interfaces. EiffelVision runs on Microsoft Windows and all major variations of Unix (including Linux). All versions are fully source-compatible; with only a recompile, applications will run on every supported platform with the native look-and-feel.

EiffelVision provides an effective way of building advanced graphical applications using user interface standards and toolkits (such as Microsoft Windows and GTK) without having to learn the details of the toolkits. Instead, you can use EiffelVision to work entirely in terms of high level abstractions representing windows, buttons, labels, graphical figures, menus, buttons etc., and apply clearly understandable operations to the corresponding objects.

Architecture

EiffelVision relies on a two-tiered architecture illustrated by the following figure.

The two tiers play complementary roles:

  • At the top level, EiffelVision provides fully portable graphics.
  • At the lower level, platform-specific libraries cover the graphical mechanisms of graphics platforms such as Windows and GTK.

The lower tier serves for the implementation of the upper tier, but can also be used independently. For example WEL has had a resounding success with Windows developers who need an advanced mechanism for building Windows-specific graphical applications, taking advantage of every facility of the Windows API (Application Programming Interface) and of the Eiffel approach, but do not need portability on the client side. The GEL library is a wrapper library, automatically generated from the entire GTK API by a tool named The Gote Converter.

Features

As stated before, the library has undergone some drastic changes since the previous release. Names have been changed to improve consistency. Contracts are added whereever possible. Following is a summary of the other re-engineered aspects of the library:

  • Taking full advantage of the agent mechanism of Eiffel, events are now triggered through action sequences (lists of actions) that will be executed in order. This system does not require separate classes to be written for each event, however the command pattern can still be used if desired.
  • The pick-and-drop mechanism now relies on the Eiffel type system. A stone (some transportable object) is now any Eiffel class and can always be dropped on a widget that accepts the type (or a more general type) of that stone.
  • containers (widgets that contain other widgets) are now derived from EiffelBase classes. For example you can now insert widgets in any position and iterate over them.

Design

EiffelVision provides programmers with high-level classes, that provide all mechanism and data structures needed to build advanced user interfaces for deployment on almost all platforms without having to worry about detailed requirements of toolkits.

The abstract design has been derived from an analysis of user interfaces. Therefore we have classes with names like MENU, WINDOW, BUTTON, LINE or POLYGON. The features of these classes are simple, clearly defined properties or commands, like the feature `minimize' (a command) on WINDOW or `text' (a property of type STRING) on BUTTON.

Note: all class names in EiffelVision are pre-pended with EV_ to avoid name clashes with existing classes. BUTTON hence becomes EV_BUTTON, etc.

Properties

When talking about a property of a class, like `text', in fact we are talking about multiple features. One is a query of the state of the property, in this case simply the query `text'. The other is the set-routine, which is by convention named `set_text' taking exactly one argument of the type of property. A property can be read-only, which means that it cannot be set by clients of the class.

text: STRING
set_text (a_text: STRING) is ...

Boolean properties have a different convention. Instead of one set-routine, it has one enable-routine and one disable-routine. The first one sets the property to true, the second to false. This has been done like this because sometimes these enable/disable features have trivial equivalents, for example for feature `enable_visible' a clearer name is `show'.

is_sensitive: BOOLEAN
enable_sensitive is ...
disable_sensitive is ...

Implementation

For flexibility, EiffelVision is built using the bridge pattern. This means that every platform-dependant component of the library consist of two classes, plus an implementation class for each platform (currently two). One is the interface. All the features of interfaces do nothing except delegate the call to the implementation object which is coupled to it. This object has the static type of the implementation-interface with the name of the interface class, with _I appended to it. From this implementation-interface, implementation classes inherit to implement platform-specific features.


EiffelVision 2 Interface Content

EiffelVision 2 is a platform independent Graphical User Interface (GUI) library that allows easy, simultaneous development of Windowed applications for both Windows & Unix based platforms. Heavily relying on ISE's premier EiffelBase library, EiffelVision 2 has been designed primarily with ease of use in mind. By reusing EiffelBase structures, existing, as well as new Eiffel users will find EiffelVision to be surprising intuitive and easy to use. In no time, users will be producing good-looking Windowed application skeletons, of which will run on a multitude of platforms with no manipulation of code.

The EiffelVision 2 library includes the following interface clusters:

  • A Kernel cluster that includes classes that are key to a Vision2 application. The main class being EV_APPLICATION which is the main entry point of all Vision2 applications.
  • A Widgets cluster containing classes that used to create Vision2 widgets. Widgets are the visible objects that the user sees and interacts with on the desktop, examples of widgets are windows, buttons and labels.
  • An Items cluster includes the classes needed to create items, items can be thought of as widgets that are contained within only a certain type of widget, such as an EV_LIST that may only contain objects of type EV_LIST_ITEM. Items provide an abstract way of dealing with an item widget's internal data structures and provide in many cases the same functionality that a widget does.
  • An Events cluster containing classes that allow for user initiated events, such as the clicking of a button to be dealt with via the use of a linked list of agents (EV_ACTION_SEQUENCE). Agents can be thought of as an object that encapsulates a certain procedure. When a user clicks a button on the screen, the corresponding EV_BUTTON object has its associating pointer_button_press_actions fired and this in turn, fires all of the agents held within, thus calling all of the procedures represented by the agents. Every widget and item has a certain number of ACTION_SEQUENCE objects that are linked with a certain type of event.
  • A Properties cluster contains classes that allow for the customization of Vision 2 widgets and items. Classes such as EV_COLORIZABLE and EV_FONTABLE contain routines that allow for color and fonts to be altered for a widget or item respectively.
  • A Support cluster includes classes that provide more professional touches to an application, whether these are keyboard shortcuts (EV_ACCELERATOR_LIST) or graphical output (EV_GRAPHICAL_FORMAT) for drawable widgets such as EV_PIXMAP.
  • A Figures cluster that allows for the projection of two-dimensional shapes (figures) on to an EV_DRAWABLE or printer via the use of an EV_PROJECTOR.

To see differences between released versions of Vision2, click Here


Revisions

Revisions and bug fixes

This document contains details of modifications and bug fixes to the vision2 library listed by the release version of EiffelStudio. All bug fixes and modifications are relative to the previously released version.

Eiffel Studio 5.2

Interface modifications

  • EV_TEXTABLE - `align_text_left', `align_text_right' and `align_text_center' have been extracted into a new class, EV_TEXT_ALIGNABLE which inherits EV_TEXTABLE. All previous descendents of EV_TEXTABLE now inherit EV_TEXT_ALIGNABLE, except EV_TREE_NODE, EV_MENU_ITEM, EV_LIST_ITEM and EV_TOOL_BAR_BUTTON
  • EV_TEXT_COMPONENT - Now inherits EV_TEXTABLE.
  • EV_TEXT_ALIGNMENT_CONSTANTS - New class added to support EV_TEXT_ALIGNABLE.
  • EV_MENU_ITEM_LIST - `parent' is now of type EV_ANY, instead of EV_MENU_ITEM_LIST as it did not hold for EV_MENU_BAR. The renaming of `parent' to `old_parent' in EV_MENU_BAR has now been removed.
  • EV_VIEWPORT - added `set_item_width', `set_item_height' and `set_item_size'.
  • EV_TABLE
    • redefined `prunable' to `True' and implemented `prune'.
    • Added the following features - `set_item_span', `set_item_position', `set_item_span_and_position', `area_clear_excluding_widget', `item_row_span', `item_column_span', `item_row_position' and `item_column_position'.
  • EV_WIDGET - Changed type of `focus_in_actions' and `focus_out_actions' from EV_FOCUS_ACTION_SEQUENCE to EV_NOTIFY_ACTION_SEQUENCE. `is_parent_recursive' is no longer available. It has been moved to EV_CONTAINER. This was necessary to fix a catcall encountered using vision2 under .NET. The problem manifested with widgets that held items.
  • EV_FIGURE - `proximity_in_actions' and `proximity_out_actions' are now obsolete.
  • EV_FONTABLE - `set_font' now sets a copy of the font internally.
  • EV_TREE - `ensure_item_visible' and `has_recursively' now take an EV_TREE_NODE as arguments, instead of an EV_TREE_ITEM.
  • EV_TEXT - `put_new_line' is now obsolete. Use `set_text ("%N") instead.
    • "
  • EV_APPLICATION_ACTION_SEQUENCES - Added `cancel_actions', fired when a pick and drop is cancelled, and `pnd_motion_actions' fired while the pointer moves during a pick and drop.
  • EV_TREE_NODE_LIST
    • `find_item_recursively_by_data', `has_recursively' and `recursive_do_all' are now implemented in this class, instead of both EV_TREE and EV_TREE_NODE which are descendents.
    • Added `retrive_items_recursively_by_data' and `retrieve_item_recursively_by_data' which allow you to specify a comparison criterion, and due to this addition, `find_item_recursively_by_data' has now been made obsolete.
  • EV_DYNAMIC_LIST - Added `retrieve_item_by_data' and `retrieve_items_by_data'.
  • EV_ITEM_LIST - Made `item_by_data' obsolete, as you should now use `retrieve_item_by_data' added in EV_DYNAMIC_LIST.
  • EV_DIALOG - Added `is_relative' and defined `is_modal' in this class, instead of inheriting it from EV_WINDOW.

Bug fixes

  • Platform independent
    • EV_FIGURE_POLYLINE - Fixed `start_angle' and `end_angle' so that they are computed relative to the first and last polyline segments. This also fixes the start and end arrows, so that when displayed, they now actually point in the direction of their respective line segments.
    • EV_TREE and EV_TREE_NODE - Fixed `find_item_recursively_by_data' which failed on the `index_not_changed' postcondition. Note that these features are now defined in EV_TREE_NODE_LIST.
    • EV_DYNAMIC_TREE_ITEM - Fixed invariant violation from EV_ITEM_LIST, when created with `default_create'.
  • Windows
    • EV_RADIO_BUTTON - The default minimum height after `default_create' is now enough to display the widget correctly.
    • EV_CHECK_BUTTON - The default minimum height after `default_create' is now enough to display the widget correctly.
    • EV_NOTEBOOK - When removing a widget from a notebook, it is now visible. Previously, the widget would be hidden.
    • EV_LIST, EV_MULTI_COLUMN_LIST, EV_TREE - Fixed `set_foreground_color' and `set_background_color'. Previously, calling these features did nothing.
    • EV_BOX - If a widget was not`is_item_expanded', then adding a new widget to the box before that widget would sometimes cause a different widget to become `is_item_expanded'.
    • EV_TOOL_BAR_RADIO_BUTTON - The currently selected button in `peers' was unselected when the button was pressed, and not when it was really selected. This bug made it possible to make `selected_peer' Void, which caused an invariant to fail.
    • EV_LIST_ITEM - Calling `enable_select' when parented in an EV_LIST now also sets the item as focused in the parent. This corrects bugs in keyboard navigation when selecting an item programatically.
    • EV_FIXED - The minimum size is constrained by the positions and sizes of the children (They must be completely displayed), although when the positions of the children were reduced, the minimum allowable size was not recomputed. This meant that the widget would be enlarged when the positions of the children increased, but could never be reduced in size when the positions of the children were decreased.
    • EV_MENU and EV_MENU_ITEM - `set_pixmap' has been implemented as previously, it did nothing.
    • EV_TABLE - re-implemented resizing calculations to fix numerous problems when children had minimum sizes. The minimum size now also includes the border width when empty.
    • EV_NOTEBOOK - `selection_actions' were called when you selected an item through `select_item', even if the item was already selected. `selection_actions' are now only fired when the selection changes.
    • EV_TREE_ITEM - calling `set_pixmap' twice successively with the same EV_PIXMAP caused a postcondition failure.
    • EV_TEXT - Fixed `put_new_line', although it has been made obsolete, as you should just use `append_text ("%N") instead.
    • EV_SPLIT_AREA - Fixed crash reproducable by inserting an EV_PIXMAP directly into the split area.
    • EV_CONTAINER - Fixed `propagate_foreground_color' and `propagate_background_color' which failed when one of the children was a descendent of EV_CELL.
    • EV_APPLICATION_ACTION_SEQUENCES - `drop_actions' was being fired even when the pick and drop was cancelled.
    • EV_PIXMAP - Previously, if you were to add an agent to an action sequence of the pixmap, before it was parented, the agent would be removed during the parenting.
    • EV_MENU
      • Pruning an EV_MENU_SEPARATOR when one or more EV_RADIO_MENU_ITEM were still contained in the menu would cause occasional crashes.
      • Previously, when adding an EV_MENU_SEPARATOR, followed by multiple EV_RADIO_MENU_ITEMS, all the items were being selected.
      • Fixed bug in `destroy' which was causing postcondition failures.
    • EV_TITLED_WINDOW - Fixed a GDI leak, manifesting when a window was destroyed.
    • EV_DIALOG
      • Fixed `is_modal' which was previously always returned `False'.
      • Fixed bug with `background_color' and `foreground_color' which was not taken into account if the dialog was shown relative or modally to another window.
      • If a dialog with a default cancel button was displayed using `show', then minimizing the dialog would cause the system to fail internally.
      • Fix bug in `show_relative_to_window' which would cause any associated menus to be removed.
      • Fixed bug in `show', as if the dialog had already been shown modelessly to a window, then calling `show' did not show it independently, but still modelessly.
      • Fixed bug with `show_actions' which would be wiped out if you called `show_modal_to_window' and then `hide'.
      • `set_pixmap' will now actually display the pixmap, whereas before, no pixmap was displayed.
    • EV_TEXT_COMPONENT - Fixed `text_length' which was returning incorrect value for all descendents.
    • EV_TEXT - Fixed `line_count' which was previously returning the correct result + 1.
    • EV_SCROLLABLE_AREA - Fixed crash which occurred when you attempted to use `set_x_offset' or `set_y_offset' before the area had been parented or displayed.
    • EV_FONTABLE - Fixed bug when `font' was queried, `preferred_families' was not returned correctly, and would always be empty.
    • EV_CONTAINER - `set_background_pixmap' was not correctly cloning the image of the pixmap, and the displayed image could then be modified after setting, by changing the image of the original pixmap.
  • Gtk
    • EV_WIDGET - Focus in/out actions are now correctly called for widgets that do not occupy their entire space allocation such as EV_TEXT_FIELD.
    • EV_DRAWABLE_IMP - Polylines now display correctly on big-endian machines (Sparc, PowerPC).

Eiffel Studio 5.1

Interface modifications

  • EV_TEXTABLE and EV_TEXT_COMPONENT - `text' no longer returns Void when empty.
  • EV_WINDOW - `title' no longer returns `Void' when empty.
  • EV_TOOLTIPABLE - `tooltip' no longer returns `Void' when empty. If empty, no tooltip is displayed.
  • EV_TITLED_WINDOW - `icon_name' no longer returns `Void' when empty.
  • EV_CLIPBOARD - `text' no longer returns `Void' when empty.
  • EV_MESSAGE_DIALOG - `text' no longer returns `Void' when empty.
  • EV_FILE_DIALOG - `file_name' no longer returns `Void' when the "Cancel" button was pressed, `Result' is empty instead.
  • EV_DIRECTORY_DIALOG - `directory' no longer returns `Void when the "Cancel" button was pressed, `Result' is empty instead.
  • EV_CONTAINER - has three new features `set_background_pixmap', `background_pixmap' and `remove_background_pixmap'. `background_pixmap' will be tessellated to cover complete background area.
  • EV_TREE and EV_TREE_NODE - Added `recursively_do_all'.
  • EV_STANDARD_DIALOGS
    • `ok_actions' have been renamed in descendents where appropriate. e.g. in EV_PRINT_DIALOG, they are renamed to `print_actions' to match the texts of the associated buttons. Where renamed, `ok_actions' are still available but obsolete.
    • Selected button now also returns the correct text of the button (Previously it was always "Ok").
  • EV_DIALOG_CONSTANTS - Added new constants required for the above change to EV_STANDARD_DIALOGS.
  • EV_DRAWABLE - `draw_straight_line' now has a precondition to ensure the points are not identical.
  • EV_SPLIT_AREA - seperated `put' from `extend'. They were defined as synonyms, but have different behaviour.
  • EV_DYNAMIC_TREE_ITEM - Added `remove_subtree_function'. Item now only shows as expandable if there is a subtree function.
  • EV_WINDOW - Added `maximum_dimension' which is the greatest value allowed for `width' and `height'. This is also the default value for `width' and `height'.
  • EV_OPTION_BUTTON - This class has been made obsolete. It will be removed at the next release.
  • EV_PICK_AND_DROPABLE_ACTION_SEQUENCES - Added `pick_ended_actions' which are called when a pick ends.
  • EV_WIDGET - `set_minimum_height', `set_minimum_width' and `set_minimum_size' now all allow 0 as an argument. Previously, 1 was the minimum valid dimension.
  • EV_MULTI_COLUMN_LIST - `clear_selection' is now obsolete. Use `remove_selection' instead.

Bug fixes

  • Platform independent
    • EV_FIXED - Corrected `set_item_height', which was failing.
    • EV_SELECTABLE - Corrected postcondition of `is_selected'.
    • EV_PND_ACTION_SEQUENCE -- `veto_pebble_function' is now only called when its argument conforms to the transported pebble.
  • Windows
    • EV_RANGE - The `maximum_value' could not be set greater than 32,000. The full range of an INTEGER may now be set.
    • `focused_widget' from `EV_APPLICATION' - was incorrect if an EV_CONTAINER had just received the focus.
    • EV_PICK_AND_DROPABLE
      • Ending a pick and drop on an EV_TOOL_BAR_BUTTON which has a non `void' pebble no longer starts a transport from the button.
      • Reduced flicker on cursor when picking from an EV_TREE_ITEM or EV_LIST_ITEM.
      • `pebble_function' would previously be called twice during a pick and drop.
    • EV_FIXED - Items contained are now drawn correctly dependent on their z order.
    • EV_DRAWABLE
      • `Remove_clip_area' did not remove the clip_area correctly, but set it to the current size. This meant that if you then enlarged the widget, clipping would be applied.
      • Fixed problems with ordering of calls to certain features which would cause postcondition violations in the implementation.
      • `draw_pie_slice', `fill_pie_slice' and `draw_arc' now have divide by 0 protection in the implementation.
    • EV_TEXT - `set_background_color' now correctly sets the color of the whole background. Previously only the area containing text was modified.
    • EV_CLIPBOARD - Our implementation would sometimes query `text' when not allowed by Windows, thus causing postcondition failures.
    • EV_BUTTON - The result of `text_alignment' after default_create was incorrect.
  • Gtk
    • Gtk version of Studio released (including Vision2), so no fixes from 5.0


Kernel

Kernel Overview

The kernel cluster contains classes that provide functionality that are common to most Windowed application. These classes are considered the core, or kernel of any Vision2 application. The most important of these classes is EV_APPLICATION. This is used to initialize the graphical toolkit and event loop of your Vision2 application. Kernel also includes classes such as EV_TIMEOUT that calls procedures (via agents) at a set interval, and EV_COLOR which is used for coloring widgets and items. For a complete list of the classes contained in the Kernel cluster, click here. To start programming with Vision2, you first have to correctly initialize EV_APPLICATION.

Launching your application with EV_APPLICATION - The heart of all Vision2 systems

EV_APPLICATION is the basis for every Vision2 application and is considered the most important class in the library. It is responsible for initializing the underlying toolkit that is driving the windowing system on the platform that you decide to compile your system on. It also also where the main event loop that drives your application is executed.

Note: It is not possible to create a Vision2 component unless an application exists (query EV_ENVIRONMENT).

You may inherit EV_APPLICATION or use it as a client in order to create your vision2 application. A simple method of using EV_APPLICATION is as follows:
  1. Create an instance of EV_APPLICATION.
  2. Create one or more windows for your application.
  3. Launch the application.

An example of a Vision2 application using inheritance from EV_APPLICATION is shown below.

class
HELLOWORLD_APP

inherit
EV_APPLICATION

create
make

feature

make is
-- Create the application.
local
helloworld_window: EV_TITLED_WINDOW
do
default_create
create helloworld_window
helloworld_window.set_title ("Helloworld!)
helloworld_window.close_request_actions.extend (agent destroy)
helloworld_window.show
launch
end

end

This is the same Vision2 application but instead using EV_APPLICATION in a client/supplier relationship.

class
HELLOWORLD_APP

create
make

feature

make is
-- Create the Vision2 application with a helloworld window.
local
app: EV_APPLICATION
helloworld_window: EV_TITLED_WINDOW
do
create app
create helloworld_window
helloworld_window.set_title ("Helloworld!")
helloworld_window.close_request_actions.extend (agent app.destroy)
helloworld_window.show
app.launch
end

end

What does Launch actually do?

In Vision2, to launch an application means to pass control to the underlying graphical toolkit. Simply creating an application does not launch it. An explicit call to launch is required for the event processing to begin.

Note: A Vision2 system is event based. This means that you do not have control of the execution within a Vision2 system, but must respond appropriately to events as they occur. Therefore, if you call launch on an EV_APPLICATION, the processing for the application will continue indefinitely unless you have provided a way to exit the application. It is essential to initialize your components correctly, so your application can be exited (call destroy on the application).

Building your application skeleton

Now that you have a basic application skeleton set up you can now go about

  • Creating widgets and setting their properties.
  • Adding containers to your window(s), then place your created widgets in those containers.
  • Add code to respond to user actions with agents and action sequences.

Once you have learnt the basics of GUI programming within Vision2, you are well on the way to creating powerful multi-platform applications. The Application Programming Interface (API) of Vision2 has been designed in a way to ensure that the library is as intuitive, consistent and stylistic as possible, heavy reuse of components from EiffelBase has been one of the main reasons that made this possible.


Widgets

Widgets Overview

What is a Widget?

A Widget is the fundamental building block of your applications GUI, components such as Windows, Buttons and Labels are examples of such. The widget set of Vision2 provide you with the flexibility to easily create powerful graphical applications. All widgets in Vision2 inherit from EV_WIDGET and the features provided in EV_WIDGET may be called on any widget.

Variations of Widget

Within Vision2, widgets have been classified into three different groups:

  • Primitives -- These are elements of the user interface that are mainly responsible for interaction with the user, such as an EV_BUTTON.
  • Containers -- These are used to contain other widgets and position them in a certain way, such as an EV_VERTICAL_BOX that stacks its children one by one vertically.
  • Dialogs -- These are popup dialog windows used for interacting with the user for tasks such as opening a file (EV_FILE_OPEN_DIALOG) or displaying a message (EV_MESSAGE_DIALOG). You may construct your own dialogs by inheriting EV_DIALOG.

How do I create a widget?

All widgets in Vision2 are based around the default_create mechanism in Eiffel, this means that all that needs to be done to create a widget is to declare a reference to a type (such as EV_BUTTON) and then call create on that reference. An example of this is as follows.

a_button: EV_BUTTON
create a_button

Along with the default creation, Vision2 also includes a few convenience creation functions. Examples of this are make_with_text for all widgets that may have text associated with them (those that inherit from EV_TEXTABLE), this saves a call to set_text upon default creation of the textable widget.

create a_button.make_with_text ("Click Me")

This would be in place of

create a_button
a_button.set_text ("Click Me")

Note: When a widget is created no extra initialization has to be performed, the only exception is for a window where you have to call show in order for it to be displayed on screen.

Sizing

As EV_PRIMITIVE is of type EV_WIDGET, the following facilities are provided for setting the minimum size : set_minimum_width, set_minimum_height and set_minimum_size.

The minimum size of a widget is the smallest possible size that it can possibly be inside its parent container. If an EV_BUTTON was created and set with a minimum_size of width/height (100, 100), if this button was inserted in to an EV_HORIZONTAL_BOX, then the box's size could never be below (100, 100) or it would break the minimum size of the button. The size of a container must always be greater or equal to the minimum sizes of its children.

Note: In Vision2, there is no way to set the current size of the primitive. The current size is dependent on the size of the parent or the minimum_size.

Now what do I do?

Now that you can create a widget, you will need to actually make it usable to your intended user, this will usually involve these three steps.
  • Setting properties for the widget such as color and the minimum size that a widget can possibly be in its parent container.
  • Making the widget respond to user events via the use of agents and action sequences.
  • Placing the widget inside a container widget (either a window or a child of a window) so it can be shown on screen.


Primitives

Primitives Overview

All Vision2 primitives inherit EV_PRIMITIVE.

What is a primitive?

A primitive is a Vision2 widget that may not contain other widgets. Primitives may be placed in containers, but a widget may not contain any child widgets. Some examples of primitives are EV_BUTTON and EV_LABEL. A list of all the classes in the primitives cluster may be found here.

Features of a primitive

All primitives inherit from EV_TOOLTIPABLE and therefore can have tooltips assigned to them. They all inherit many features from EV_WIDGET Each descendent of EV_PRIMITIVE will typically have many available features, specific to their type. For example, EV_SEPARATOR has no extra features, but EV_LABEL has features for modifying the current font and also the text to de displayed.

Widgets as item holders

Although no primitive can contain another widget, certain primitives may contain one or more items. One example of this is an EV_LIST containing EV_LIST_ITEMs.


Containers

Containers Overview

All Vision2 containers inherit EV_CONTAINER

What is a container?

A container is a Vision2 widget that may contain other widgets. Some containers such as EV_CELL may only hold one widget while containers such as EV_BOX may hold multiple widgets. As a container is of type EV_WIDGET, this means that a container may be placed within a container. A list of the classes held within the container cluster can be found here. Windows inherit from EV_CELL and are therefore classed as containers also.

Note: Containers may only contain other widgets. Items may only be placed in certain primitives. For example, an EV_LIST_ITEM may be contained in an EV_LIST.

Inheritance from Base

Wherever possible, Vision2 containers reuse the container structures provided by Base. This provides three main advantages:

  1. Familiarity for operations such as access, insertions and removals. Anybody who already uses Base should find it easy to adapt to using Vision2 containers.
  2. The underlying structures used have been tried and tested for many years and their design has been proved to be robust and effective.
  3. It provides powerful methods of querying the contents. In the original Vision library, you needed to keep reference to widgets as you could not query the contents of a container.

For example, EV_CONTAINER inherits BOX and COLLECTION. Descendents of EV_CONTAINER such as EV_BOX may also inherit other structures from Base.

Usage of Containers

The main role of a container is to position its children in a certain way, an EV_HORIZONTAL_BOX for example positions it children side by side along the horizontal axis, to get vertical stacking you would use an EV_VERTICAL_BOX.

An code example of adding widgets to a container is as follows.

add_to_container is
-- Add 3 buttons to a hbox and then show in window.
local
a_window: EV_TITLED_WINDOW
a_hbox: EV_HORIZONTAL_BOX
a_button: EV_BUTTON
do
create a_window
create a_hbox
create a_button.make_with_text ("Button1")
a_hbox.extend (a_button)
a_hbox.extend (create {EV_BUTTON}.make_with_text ("Button2"))
a_hbox.extend (create {EV_BUTTON}.make_with_text ("Button3"))
a_window.extend (a_hbox)
a_window.show
end

The mapping of a Vision2 container interface is very close to that of containers in Base, such as a linked list.

  • To add a widget to a container call `extend'.
  • To remove a widget from the container call `prune'.
  • To empty a container call `wipe_out'.
  • To traverse the container, you can use features such as start, forth, item and off.

Note: When a widget is added to a container, the container is the parent of the widget.

Size of widget within a container

The size of a widget in a container is always at least its minimum size. By default, when a widget is added to a container it is expandable. This means that if the container gets bigger, the widget will expand to fit the extra space. This convenient functionality means that you don't have to worry about handling the size of the widget (such as when a user alters the size of a window) as this is all performed automatically. If, on the other hand, you decide you want the widget to remain at a certain size (its minimum size), EV_BOX contains the convenient call disable_item_resize.

Sizing of containers

As EV_CONTAINER is of type EV_WIDGET, the following facilities are provided for setting the minimum size : set_minimum_width, set_minimum_height and set_minimum_size. It is important to remember that as a general rule, the current size of a container is always at least the minimum size of all its contents.

Note: The exception to this is: EV_FIXED, EV_VIEWPORT and EV_SCROLLABLE_AREA which do actually allow their contents to be larger than their current size.


Dialogs

Dialogs Overview

This cluster contains all the dialogs provided by Vision2.

Standard dialogs

A standard dialog provides a way of interacting with the underlying platform (such as Windows or Linux) to perform basic tasks such as opening a file or printing a document. Vision2 provides six dialogs that allow the user to perform everyday tasks that are

  • EV_COLOR_DIALOG -- This allows the user of your app to select an RGB color (useful for graphical apps such as a Paint Program).
  • EV_DIRECTORY_DIALOG -- This allows the user of your app to select a directory.
  • EV_FILE_OPEN_DIALOG -- This allows the user of your app to select a file to be opened.
  • EV_FILE_SAVE_DIALOG -- This allows the user of your app to select a filename that will be used for the creation of a file.
  • EV_FONT_DIALOG -- This allows the user of your app to select a font (useful for a Word Processor for example).
  • EV_PRINT_DIALOG -- This allows the user of your app to choose printer settings may be used in conjunction with EV_PRINT_PROJECTOR.

Creating custom dialogs

If you wish to provide a custom dialog in your application, EV_DIALOG has been provided to facilitate this.

Message dialogs

A message dialog gives your application a standard way of displaying useful (or vital) information, this information can be displayed with the following message dialogs.

  • EV_MESSAGE_DIALOG -- Allows a simple message to be displayed to the user.
  • EV_INFORMATION_DIALOG -- Allows useful info to be displayed to the user.
  • EV_QUESTION_DIALOG -- Allows the user to respond to a question with Yes or No.
  • EV_WARNING_DIALOG -- Allows a warning to be displayed to the user.
  • EV_CONFIRMATION_DIALOG -- Allows the user to confirm an action that has been requested.
  • EV_ERROR_DIALOG -- Allows an error message to be shown to the user.


Items

Items Overview

All Vision2 items inherit EV_ITEM. To view the classes contained in the items cluster, click here.

What is an item?

A Vision2 item is an object that is used to display information within certain primitives. For example, EV_LIST may hold items of type EV_LIST_ITEM. All Vision2 items are descendants of EV_PIXMAPABLE meaning they can display an EV_PIXMAP.

Item holders

Below is a structure showing the Vision2 components and the items that they accept, all the items types available in Vision2 are included:

  • EV_LIST accepts items of type:
    • EV_LIST_ITEM
  • EV_COMBO_BOX accepts items of type:
    • EV_LIST_ITEM
  • EV_WINDOW accepts items of type (Use set_menu_bar):
    • EV_MENU_BAR accepts items of type:
      • EV_MENU accepts items of type:
        • EV_MENU
        • EV_MENU_ITEM
        • EV_MENU_SEPARATOR
        • EV_RADIO_MENU_ITEM
        • EV_CHECK_MENU_ITEM
  • EV_MULTI_COLUMN_LIST accepts items of type:
    • EV_MULTI_COLUMN_LIST_ROW
  • EV_TOOL_BAR accepts items of type:
    • EV_TOOL_BAR_BUTTON
    • EV_TOOL_BAR_SELECT_BUTTON
    • EV_TOOL_BAR_SEPARATOR
    • EV_TOOL_BAR_TOGGLE_BUTTON
  • EV_TREE accepts items of type:
    • EV_DYNAMIC_TREE_ITEM accepts items of type:
      • EV_DYNAMIC_TREE_ITEM
      • EV_TREE_ITEM
    • EV_TREE_ITEM accepts items of type:
      • EV_DYNAMIC_TREE_ITEM
      • EV_TREE_ITEM

Note: EV_MENU, EV_TREE_ITEM and EV_DYNAMIC_TREE_ITEM all may contain items of the same type as themselves. This is due to the recursive nature of trees and menus.


Events

Events Overview

This cluster contains classes for event handling within Vision2. To view the classes contained in the the events cluster click here.

What is an event?

An event is considered to be an external action that occurs during a program's execution. Correctly dealing with events is an important part of developing a Vision2 application. For example, if a user clicks on a button, you will want to respond to this event by calling a routine that deals with the request. Vision2 contains action sequences for all kinds of widget events, to view the kind of events available to every widget, click here.

How do I connect to an event?

Every widget and item has an action sequence associated with it that relates to some kind of event, for example an EV_BUTTON has a select_actions action sequence. This gets fired when the user clicks/selects the button. To have a procedure called on this event, you need to create an agent based on this procedure, and then add this to the action sequence (via extend). For a more detailed description of agents and their uses click here.

An example of adding an agent to an action_sequence is as follows.

button.select_actions.extend (agent print ("Button Clicked!%N"))

All Vision2 action sequences inherit EV_ACTION_SEQUENCE and when it is called, all of the agents held within are fired, thus calling all of the procedures represented by the agents. The signature of any agent that you place in an action sequence must conform to those of the action sequences actual generic parameter.

When you want an agent to be called from a certain action sequence and the signatures do not match, you may use force_extend, this will call your agent but has no guarantees on the arguments passed to your procedure.


Properties

Properties Overview

This cluster contains all the common properties available for Vision2 widgets and items. Every Vision2 widget has the same set of properties inherited from EV_WIDGET, but many widgets also inherit additional properties, further refining the behavior of the widget. To view the classes contained in the property cluster, click here.

EV_WIDGET inherits the following properties:

  • EV_PICK_AND_DROPABLE
    • For an overview of the Pick and Drop mechanism, click here.
  • EV_SENSITIVE
    • If a Vision2 component inherits EV_SENSITIVE, it can be made to ignore events.
      Use disable_sensitive to disable event handling, and enable_sensitive to restore event handling.
  • EV_COLORIZABLE
    • If a Vision2 component inherits EV_COLORIZABLE it has facilites for modifying its foreground and background colors.
      Use set_foreground_color to set the foreground_color and set_background_color to set the background_color.
      Use set_default_colors to restore the colors to their defaults.
  • EV_HELP_CONTEXTABLE
    • If a Vision2 component inherits EV_HELP_CONTEXTABLE, facilities are provided for associating help to the component when F1 or Shift F1 is pressed.
  • EV_POSITIONED
    • If a Vision2 component inherits EV_POSITIONED it is possible to query its current position, size and minimum size.
      Use x_position and y_position to find its position relative to its parent.
      Use width and height to find its size.
      Use minimum_width and minimum_height" to find its size.
  • EV_CONTAINABLE
    • If a Vision2 component inherits EV_CONTAINABLE it is able question its parent. Use parent to query the current parent.

Note EV_CONTAINABLE has no features for setting the parent. In Vision2, a child has no features for setting its parent, while a parent such as ev_container contains routines for adding children (one example is extend).

The following properties are also used within Vision2:

  • EV_DESELECTABLE
  • EV_DRAWABLE
  • EV_FONTABLE
  • EV_PIXMAPABLE
  • EV_POSITIONABLE
  • EV_SELECTABLE
  • EV_TEXTABLE
  • EV_TOOLTIPABLE


Pick and Drop

Pick And Drop Overview

Pick and drop is a mechanism which allows data to be transported from a source object to a target. Any Vision2 object inheriting EV_PICK_AND_DROPABLE can be used to transport or receive data.

A simple pick and drop example

Two necessary components for a pick and drop transport are a source and a target, both of which must conform to EV_PICK_AND_DROPABLE. The data that is to be transported is known as a pebble.

The following steps need to be undertaken to set up a simple pick and drop:

  • Set the source by calling set_pebble.
  • Set one or more targets by adding a function to their drop_actions. The arguments of the function must match the type of the pebble to be transported for the source otherwise the transport will not be permitted.

A simple example of this is demonstrated here:

button1.set_pebble ("A PND transport has occured%N")
button2.drop_actions.extend (agent print (?))

As print takes an argument of type STRING, button2 becomes a valid target for the pebble contained in button1. Right clicking the mouse pointer over the source will start the transport, and right clicking with the mouse pointer over a valid target will end the transport. The transport can be cancelled anytime with a simple left click, just as you would do in Eiffel Studio.

Note: When a transport completes, the pebble that was transported is passed as an argument to all features in the targets drop_actions whose argument type matches the pebble

Three different modes of transport

There are three different modes of transport available for pick and drop. They are listed below with details of their use:

  • Pick and Drop mode.
    This is the default mode for pick and drop, but can be set with set_pick_and_drop_mode. Right clicking on a source starts the transport and right clicking on a valid target completes the transport. During execution, a band is drawn from the screen position where the pick started to the current mouse position. Pressing the left mouse button or the escape key during execution will end the transport.
  • Drag and drop mode
    This mode can be set with set_drag_and_drop_mode. Left clicking on a source starts the transport and releasing the left mouse button over a valid target completes the transport. During execution, a band is drawn from the screen position where the pick started to the current mouse position. Releasing the left mouse button or pressing the escape key during execution will end the transport.
  • Target menu mode
    This mode can be set with set_target_menu_mode. Right clicking on a source brings up a menu of all the valid drop targets in the system. Selecting one of these targets completes the transport.

Accept and deny cursors

When mode_is_pick_and_drop or mode_is_drag_and_drop then the shape of the mouse cursor changes to reflect whether the current GUI component below the mouse accepts the pebble or not. Calling set_accept_cursor allows you to customize this cursor used to represent a valid target while calling set_deny_cursor allows you to customize the cursor used for non valid targets.


EiffelVision 2 Support

Support Overview

The support cluster contains many classes providing useful facilities within the library. Many of the classes within this cluster are constant classes, which are filled with constant values for specific contexts, generally indicated by their names. The following constant classes are available within this cluster:

  • EV_DIALOG_CONSTANTS
  • EV_DRAWABLE_CONSTANTS
  • EV_FONT_CONSTANTS
  • EV_KEY_CONSTANTS
  • EV_POSTSCRIPT_PAGE_CONSTANTS
In a similar vein to constant classes, the two following classes are provided to provide support for default EV_COLOR's and EV_PIXMAP's.
  • EV_STOCK_COLORS
  • EV_STOCK_PIXMAPS
Click here to browse the support cluster.


EiffelVision2 Figures

The EiffelVision figure cluster can be considered a high-level way of drawing on an EV_DRAWABLE descendant. Here are some advantages:

  • The model is separated from the representation by using projectors that take a world of figures and project it to any device, not just a drawing area.
  • Instead of drawing with static API's like draw_line, real figure objects are used that can move, change color or morph.
  • For projection devices that allow this, events may be caught and fired through the appropriate figure object.

Figure classes

Every basic figure class inherits from EV_ATOMIC_FIGURE. An atomic figure has the property of having a representation. EV_FIGURE_GROUP on the other hand does not but is a collection of figures. On the top of those two stands EV_FIGURE as common ancestor. As EV_FIGURE_GROUP is a collection of EV_FIGUREs, it can contain subgroups.

As top-level group of a world of figures you must use EV_FIGURE_WORLD. It inherits from EV_FIGURE_GROUP but adds some features for grid and background color.

Figures

class | open/closed | points | description
EV_FIGURE_ARC | open | 2 | a segment of an open ellipse
EV_FIGURE_DOT | open | 1 | a single point
EV_FIGURE_ELLIPSE | closed | 2 | ellipse inside imaginary rectangle
EV_FIGURE_EQUILATERAL | closed | 2 | a figure with any number of sides of the same length
EV_FIGURE_LINE | open | 2 | a straight line between two points
EV_FIGURE_PICTURE | open | 1 | an image positioned by its top-left point
EV_FIGURE_PIE_SLICE | closed | 2 | a part of a closed ellipse
EV_FIGURE_POLYGON | closed | * | a figure defined by any number of points
EV_FIGURE_POLYLINE | open | * | a figure consisting of any number of connecting lines
EV_FIGURE_RECTANGLE | closed | 2 | figure with four sides
EV_FIGURE_STAR | open | 2 | any number of lines emerging from a center point
EV_FIGURE_TEXT | open | 1 | a string positioned by its top-left point displayed in the specified font

A closed figure is a figure that has some area enclosed when drawn that can optionally be filled with a color. Closed figures inherit EV_CLOSED_FIGURE which gives them the property fill_color. Open figures inherit EV_ATOMIC_FIGURE directly just as EV_CLOSED_FIGURE.

Points

Central in the design of the figures are points. Figures are built up as much from points as possible. For example, an ellipse is not a center point with two radiae, but the biggest fitting ellipse inside an imaginary rectangle, so of two points.

As you can see in the table above, each figure has a certain number of points. These values can be 1, 2 or * (any number). For each value there is a class the figure inherits from. These classes are:

  • 1 (a figure has one point): EV_SINGLE_POINTED_FIGURE.
  • 2 (a figure has two points): EV_DOUBLE_POINTED_FIGURE.
  • * (a figure has zero or more points): EV_MULTI_POINTED_FIGURE.

These classes offer features to handle the given number of points. EV_SINGLE_POINTED_FIGURE offers the feature:

point: EV_RELATIVE_POINT

EV_DOUBLE_POINTED_FIGURE inherits EV_SINGLE_POINTED_FIGURE for its first point, which is renamed to point_a. It adds point_b, so it has the features:

point_a: EV_RELATIVE_POINT
point_b: EV_RELATIVE_POINT

EV_MULTI_POINTED_FIGURE internally holds an array of points. Its most important feature is:

i_th_point (i: INTEGER): EV_RELATIVE_POINT

Relative point

The points that the figures use are of type EV_RELATIVE_POINT. Each point is relative to another point, which is also relative. Each point is a set of coordinates and a reference point. The absolute coordinates are calculated only when needed by adding the absolute coordinates of the reference point to the relative coordinates.

Figure worlds

In order to put the figures you want to display in a context, you have to insert them in a figure world object, an instance of EV_FIGURE_WORLD. This is a descendant of EV_FIGURE_GROUP and hence works in the same way. This figure world is later associated with one or more projectors.

EV_FIGURE_WORLD adds a number of features to EV_FIGURE_GROUP. These extra features are needed for the representation by a projector. One is the background color. This feature will be used to erase the canvas for a graphical projector in the specified color. The other features are to manage the grid.

Projectors

A projector is an object that knows what a figure world should look like. The figure world itself is not more than a hint towards its representation. For example, if a line is "20" long, this unit might mean pixels, miles, centimeters or whatever. It is up to the projector to interpret units. Also, color might be interpreted as greyscale. Typically, a projector will do the best possible job projecting the world to its device.

With EiffelVision come these projectors:

  • EV_POSTSCRIPT_PROJECTOR
  • EV_DRAWING_AREA_PROJECTOR
  • EV_PIXMAP_PROJECTOR
The first one maps figure worlds to a postscript file. The other two are descendants of EV_WIDGET_PROJECTOR, and can project on widgets that inherit EV_DRAWABLE: EV_DRAWING_AREA and EV_PIXMAP, eventually using double-buffering, which results in a more smooth animation but requires fast copying from memory to the video buffer (can be slow for a remote display).

Events

The other features of drawing area and widget is that they generate pointer events. These events can be translated by projectors to map the figure world. These projectors send the event to the appropriate figure. Every figure has all common pointer action sequences:
  • pointer_motion_actions
  • pointer_button_press_actions
  • pointer_double_press_actions
  • pointer_button_release_actions
  • pointer_enter_actions
  • pointer_leave_actions
  • pick_actions
  • conforming_pick_actions
  • drop_actions
There are no events for keyboard focus and no key press events. In case you wish to use these events, use the ones of the pixmap or drawing area.

When using events, keep the z-order in mind. This is the order in which the figures are stacked in the world. The first item of a figure group is the figure that is the farthest away. This means that the figure is obscured by any figures which are in front of it, and events will also not be propagated to this figure in that case.

Rotation and scaling

The relative points also support rotation and scaling. These factors work just like coordinates, except scaling, which is multiplied instead of added in the chain of points. This means that when a relative point which is the root of a tree of several points is moved, the entire tree is moved, when it is scaled the entire tree is scaled and same for rotation.

The scaling factor is divided into a horizontal and vertical component. If the factor is 0.5, everything is displayed at half its size. The rotation factor is in radians.


cluster vision2

Cluster
    vision2

Subclusters

    vision2.interface


cluster vision2.interface

Cluster
    vision2.interface

Supercluster
    vision2

Subclusters
    vision2.interface.events
    vision2.interface.figures
    vision2.interface.items
    vision2.interface.kernel
    vision2.interface.properties
    vision2.interface.support
    vision2.interface.widgets


cluster vision2.interface.events

Cluster
    vision2.interface.events

Supercluster
    vision2.interface

Subclusters

Classes
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    EV_APPLICATION_ACTION_SEQUENCES
    EV_BUTTON_ACTION_SEQUENCES
    EV_COLUMN_ACTION_SEQUENCE
    EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE
    EV_CONTAINER_ACTION_SEQUENCES
    EV_DRAWING_AREA_ACTION_SEQUENCES
    EV_FOCUS_ACTION_SEQUENCE
    EV_GAUGE_ACTION_SEQUENCES
    EV_GEOMETRY_ACTION_SEQUENCE
    EV_ITEM_ACTION_SEQUENCES
    EV_KEY_ACTION_SEQUENCE
    EV_KEY_STRING_ACTION_SEQUENCE
    EV_LIST_ITEM_ACTION_SEQUENCES
    EV_LIST_ITEM_LIST_ACTION_SEQUENCES
    EV_LIST_ITEM_SELECT_ACTION_SEQUENCE
    EV_MENU_ITEM_ACTION_SEQUENCES
    EV_MENU_ITEM_LIST_ACTION_SEQUENCES
    EV_MENU_ITEM_SELECT_ACTION_SEQUENCE
    EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
    EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES
    EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
    EV_NEW_ITEM_ACTION_SEQUENCE
    EV_NOTEBOOK_ACTION_SEQUENCES
    EV_NOTIFY_ACTION_SEQUENCE
    EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
    EV_PIXMAP_ACTION_SEQUENCES
    EV_PND_ACTION_SEQUENCE
    EV_PND_START_ACTION_SEQUENCE
    EV_POINTER_BUTTON_ACTION_SEQUENCE
    EV_POINTER_MOTION_ACTION_SEQUENCE
    EV_PROXIMITY_ACTION_SEQUENCE
    EV_STANDARD_DIALOG_ACTION_SEQUENCES
    EV_TEXT_COMPONENT_ACTION_SEQUENCES
    EV_TEXT_FIELD_ACTION_SEQUENCES
    EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES
    EV_TREE_ACTION_SEQUENCES
    EV_TREE_ITEM_SELECT_ACTION_SEQUENCE
    EV_TREE_NODE_ACTION_SEQUENCES
    EV_VALUE_CHANGE_ACTION_SEQUENCE
    EV_WIDGET_ACTION_SEQUENCES
    EV_WINDOW_ACTION_SEQUENCES


EV_ACTION_SEQUENCE Chart

deferred class
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

General
    cluster: vision2.interface.events
    description: "Base Eiffel Vision action sequence."
    keywords: "event, action, sequence"

Ancestors
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_ACTION_SEQUENCE [EVENT_DATA]

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: EVENT_DATA
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, EVENT_DATA]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, EVENT_DATA]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_ACTION_SEQUENCE [EVENT_DATA]): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, EVENT_DATA]
    last: [like first] PROCEDURE [ANY, EVENT_DATA]
    linear_representation: LINEAR [PROCEDURE [ANY, EVENT_DATA]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, EVENT_DATA]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, EVENT_DATA]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, EVENT_DATA]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: EVENT_DATA)
    compare_objects
    compare_references
    copy (other: [like Current] EV_ACTION_SEQUENCE [EVENT_DATA])
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, EVENT_DATA])
    fill (other: CONTAINER [PROCEDURE [ANY, EVENT_DATA]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    force_extend (an_item: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, EVENT_DATA]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    prune_all (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, EVENT_DATA])
    put (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_front (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_i_th (v: [like item] PROCEDURE [ANY, EVENT_DATA]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    put_right (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, EVENT_DATA])
    resume
    search (v: [like item] PROCEDURE [ANY, EVENT_DATA])
    start
    swap (i: INTEGER)
    wipe_out


EV_ACTION_SEQUENCE Flat contracts

indexing
    description: "Base Eiffel Vision action sequence."
    status: "See notice at end of file."
    keywords: "event, action, sequence"
    date: "$Date: 2001/07/12 18:30:35 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, EVENT_DATA]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: EVENT_DATA
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, EVENT_DATA]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, EVENT_DATA]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): PROCEDURE [ANY, EVENT_DATA]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, EVENT_DATA]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, EVENT_DATA]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.

    fill (other: CONTAINER [PROCEDURE [ANY, EVENT_DATA]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    force_extend (an_item: PROCEDURE [ANY, TUPLE])
            -- Extend without checking type of an_item.

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, EVENT_DATA]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, EVENT_DATA]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: EVENT_DATA)
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, EVENT_DATA]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_ACTION_SEQUENCE


EV_APPLICATION_ACTION_SEQUENCES Chart

deferred class
    EV_APPLICATION_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_APPLICATION."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    drop_actions: EV_PND_ACTION_SEQUENCE
    idle_actions: EV_NOTIFY_ACTION_SEQUENCE
    pick_actions: EV_PND_ACTION_SEQUENCE
    post_launch_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_APPLICATION_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_APPLICATION."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_APPLICATION_ACTION_SEQUENCES

feature -- Event handling

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when any "drop" occurs.
        ensure
            not_void: Result /= void

    idle_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when the application is otherwise idle.
        ensure
            not_void: Result /= void

    pick_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when any "pick" occurs.
        ensure
            not_void: Result /= void

    post_launch_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed just after application launch.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_APPLICATION_ACTION_SEQUENCES


EV_BUTTON_ACTION_SEQUENCES Chart

deferred class
    EV_BUTTON_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_BUTTON."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_BUTTON_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_BUTTON."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_BUTTON_ACTION_SEQUENCES

feature -- Event handling

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_BUTTON_ACTION_SEQUENCES


EV_COLUMN_ACTION_SEQUENCE Chart

class
    EV_COLUMN_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for multi column list column events."
    keywords: "ev_column"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_COLUMN_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [INTEGER]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [INTEGER]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_COLUMN_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [INTEGER]]
    last: [like first] PROCEDURE [ANY, TUPLE [INTEGER]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [INTEGER])
    compare_objects
    compare_references
    copy (other: [like Current] EV_COLUMN_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [INTEGER]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_a_column: INTEGER; action: PROCEDURE [ANY, TUPLE])


EV_COLUMN_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for multi column list column events."
    status: "Generated!"
    keywords: "ev_column"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_COLUMN_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [INTEGER]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_a_column: INTEGER; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [INTEGER])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_COLUMN_ACTION_SEQUENCE


EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE Chart

class
    EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for multi column list column click events."
    keywords: "ev_column_title_click"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [INTEGER]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [INTEGER]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [INTEGER]]
    last: [like first] PROCEDURE [ANY, TUPLE [INTEGER]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [INTEGER])
    compare_objects
    compare_references
    copy (other: [like Current] EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [INTEGER]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_a_column: INTEGER; action: PROCEDURE [ANY, TUPLE])


EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for multi column list column click events."
    status: "Generated!"
    keywords: "ev_column_title_click"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [INTEGER]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_a_column: INTEGER; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [INTEGER])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_COLUMN_TITLE_CLICK_ACTION_SEQUENCE


EV_CONTAINER_ACTION_SEQUENCES Chart

deferred class
    EV_CONTAINER_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_CONTAINER."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    new_item_actions: EV_NEW_ITEM_ACTION_SEQUENCE


EV_CONTAINER_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_CONTAINER."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_CONTAINER_ACTION_SEQUENCES

feature -- Event handling

    new_item_actions: EV_NEW_ITEM_ACTION_SEQUENCE
            -- Actions to be performed when a new item is added.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_CONTAINER_ACTION_SEQUENCES


EV_DRAWING_AREA_ACTION_SEQUENCES Chart

deferred class
    EV_DRAWING_AREA_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_DRAWING_AREA."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE


EV_DRAWING_AREA_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_DRAWING_AREA."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_DRAWING_AREA_ACTION_SEQUENCES

feature -- Event handling

    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when an area needs to be redrawn.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_DRAWING_AREA_ACTION_SEQUENCES


EV_FOCUS_ACTION_SEQUENCE Chart

class
    EV_FOCUS_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for lose/gain of keyboard-focus."
    keywords: "ev_focus"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_FOCUS_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_FOCUS_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE]
    last: [like first] PROCEDURE [ANY, TUPLE]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE)
    compare_objects
    compare_references
    copy (other: [like Current] EV_FOCUS_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE])
    put (v: [like item] PROCEDURE [ANY, TUPLE])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (action: PROCEDURE [ANY, TUPLE])


EV_FOCUS_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for lose/gain of keyboard-focus."
    status: "Generated!"
    keywords: "ev_focus"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_FOCUS_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE)
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_FOCUS_ACTION_SEQUENCE


EV_GAUGE_ACTION_SEQUENCES Chart

deferred class
    EV_GAUGE_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_GAUGE."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE


EV_GAUGE_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_GAUGE."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_GAUGE_ACTION_SEQUENCES

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_GAUGE_ACTION_SEQUENCES


EV_GEOMETRY_ACTION_SEQUENCE Chart

class
    EV_GEOMETRY_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for geometry related events."
    keywords: "ev_geometry"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_GEOMETRY_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
    last: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [INTEGER, INTEGER, INTEGER, INTEGER])
    compare_objects
    compare_references
    copy (other: [like Current] EV_GEOMETRY_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_x, a_y, a_width, a_height: INTEGER; action: PROCEDURE [ANY, TUPLE])


EV_GEOMETRY_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for geometry related events."
    status: "Generated!"
    keywords: "ev_geometry"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_GEOMETRY_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_x: INTEGER; a_y: INTEGER; a_width: INTEGER; a_height: INTEGER; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [INTEGER, INTEGER, INTEGER, INTEGER])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_GEOMETRY_ACTION_SEQUENCE


EV_ITEM_ACTION_SEQUENCES Chart

deferred class
    EV_ITEM_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_ITEM."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE


EV_ITEM_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_ITEM."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_ITEM_ACTION_SEQUENCES

feature -- Event handling

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
        ensure
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
        ensure
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_ITEM_ACTION_SEQUENCES


EV_KEY_ACTION_SEQUENCE Chart

class
    EV_KEY_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for keyboard events."
    keywords: "ev_key"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_KEY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_KEY]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [EV_KEY]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [EV_KEY]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [EV_KEY]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_KEY]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_KEY_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_KEY]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [EV_KEY]]
    last: [like first] PROCEDURE [ANY, TUPLE [EV_KEY]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_KEY]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_KEY]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_KEY]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [EV_KEY])
    compare_objects
    compare_references
    copy (other: [like Current] EV_KEY_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_KEY]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_KEY]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_KEY]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_KEY]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [EV_KEY]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [EV_KEY]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_key: EV_KEY; action: PROCEDURE [ANY, TUPLE])


EV_KEY_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for keyboard events."
    status: "Generated!"
    keywords: "ev_key"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_KEY_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_KEY]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [EV_KEY]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [EV_KEY]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [EV_KEY]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_KEY]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_KEY]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_key: EV_KEY; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_KEY]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_KEY]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_KEY]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_KEY]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_KEY]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_KEY]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_KEY]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [EV_KEY])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_KEY]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_KEY_ACTION_SEQUENCE


EV_KEY_STRING_ACTION_SEQUENCE Chart

class
    EV_KEY_STRING_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for keyboard events."
    keywords: "ev_key_string"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_KEY_STRING_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [STRING]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [STRING]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [STRING]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [STRING]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [STRING]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [STRING]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_KEY_STRING_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [STRING]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [STRING]]
    last: [like first] PROCEDURE [ANY, TUPLE [STRING]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [STRING]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [STRING]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [STRING]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [STRING]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [STRING])
    compare_objects
    compare_references
    copy (other: [like Current] EV_KEY_STRING_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [STRING]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [STRING]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [STRING]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [STRING]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [STRING]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [STRING]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [STRING]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_keystring: STRING; action: PROCEDURE [ANY, TUPLE])


EV_KEY_STRING_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for keyboard events."
    status: "Generated!"
    keywords: "ev_key_string"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_KEY_STRING_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [STRING]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [STRING]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [STRING]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [STRING]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [STRING]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [STRING]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_keystring: STRING; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [STRING]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [STRING]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [STRING]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [STRING]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [STRING]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [STRING]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [STRING]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [STRING])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [STRING]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_KEY_STRING_ACTION_SEQUENCE


EV_LIST_ITEM_ACTION_SEQUENCES Chart

deferred class
    EV_LIST_ITEM_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_LIST_ITEM."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_LIST_ITEM_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_LIST_ITEM."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_LIST_ITEM_ACTION_SEQUENCES

feature -- Event handling

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
        ensure
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_LIST_ITEM_ACTION_SEQUENCES


EV_LIST_ITEM_LIST_ACTION_SEQUENCES Chart

deferred class
    EV_LIST_ITEM_LIST_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_LIST_ITEM_LIST."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_LIST_ITEM_LIST_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_LIST_ITEM_LIST."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_LIST_ITEM_LIST_ACTION_SEQUENCES

feature -- Event handling

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is deselected.
        ensure
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is selected.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_LIST_ITEM_LIST_ACTION_SEQUENCES


EV_LIST_ITEM_SELECT_ACTION_SEQUENCE Chart

class
    EV_LIST_ITEM_SELECT_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for list item selection events."
    keywords: "ev_list_item_select"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_LIST_ITEM_SELECT_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [EV_LIST_ITEM]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_LIST_ITEM_SELECT_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
    last: [like first] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [EV_LIST_ITEM])
    compare_objects
    compare_references
    copy (other: [like Current] EV_LIST_ITEM_SELECT_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_item: EV_LIST_ITEM; action: PROCEDURE [ANY, TUPLE])


EV_LIST_ITEM_SELECT_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for list item selection events."
    status: "Generated!"
    keywords: "ev_list_item_select"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_LIST_ITEM_SELECT_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [EV_LIST_ITEM]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_item: EV_LIST_ITEM; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [EV_LIST_ITEM])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_LIST_ITEM_SELECT_ACTION_SEQUENCE


EV_MENU_ITEM_ACTION_SEQUENCES Chart

deferred class
    EV_MENU_ITEM_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_MENU_ITEM."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_MENU_ITEM_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_MENU_ITEM."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_MENU_ITEM_ACTION_SEQUENCES

feature -- Event handling

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_MENU_ITEM_ACTION_SEQUENCES


EV_MENU_ITEM_LIST_ACTION_SEQUENCES Chart

deferred class
    EV_MENU_ITEM_LIST_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_MENU_ITEM_LIST."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE


EV_MENU_ITEM_LIST_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_MENU_ITEM_LIST."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_MENU_ITEM_LIST_ACTION_SEQUENCES

feature -- Event handling

    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE
            -- Actions to be performed when a menu item is selected.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_MENU_ITEM_LIST_ACTION_SEQUENCES


EV_MENU_ITEM_SELECT_ACTION_SEQUENCE Chart

class
    EV_MENU_ITEM_SELECT_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for menu item selection events."
    keywords: "ev_menu_item_select"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_MENU_ITEM_SELECT_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [EV_MENU_ITEM]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_MENU_ITEM_SELECT_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
    last: [like first] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [EV_MENU_ITEM])
    compare_objects
    compare_references
    copy (other: [like Current] EV_MENU_ITEM_SELECT_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_item: EV_MENU_ITEM; action: PROCEDURE [ANY, TUPLE])


EV_MENU_ITEM_SELECT_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for menu item selection events."
    status: "Generated!"
    keywords: "ev_menu_item_select"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_MENU_ITEM_SELECT_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [EV_MENU_ITEM]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_item: EV_MENU_ITEM; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [EV_MENU_ITEM])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_MENU_ITEM_SELECT_ACTION_SEQUENCE


EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES Chart

deferred class
    EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_MULTI_COLUMN_LIST."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    column_resize_actions: EV_COLUMN_ACTION_SEQUENCE
    column_title_click_actions: EV_COLUMN_ACTION_SEQUENCE
    deselect_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
    select_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE


EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_MULTI_COLUMN_LIST."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES

feature -- Event handling

    column_resize_actions: EV_COLUMN_ACTION_SEQUENCE
            -- Actions to be performed
        ensure
            not_void: Result /= void

    column_title_click_actions: EV_COLUMN_ACTION_SEQUENCE
            -- Actions to be performed
        ensure
            not_void: Result /= void

    deselect_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
            -- Actions to be performed
        ensure
            not_void: Result /= void

    select_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
            -- Actions to be performed
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES


EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES Chart

deferred class
    EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_MULTI_COLUMN_LIST_ROW."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_MULTI_COLUMN_LIST_ROW."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES

feature -- Event handling

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
        ensure
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES


EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE Chart

class
    EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for multi column list row selection events."
    keywords: "ev_multi_column_list_row_select"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [EV_MULTI_COLUMN_LIST_ROW]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
    last: [like first] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [EV_MULTI_COLUMN_LIST_ROW])
    compare_objects
    compare_references
    copy (other: [like Current] EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_item: EV_MULTI_COLUMN_LIST_ROW; action: PROCEDURE [ANY, TUPLE])


EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for multi column list row selection events."
    status: "Generated!"
    keywords: "ev_multi_column_list_row_select"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [EV_MULTI_COLUMN_LIST_ROW]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_item: EV_MULTI_COLUMN_LIST_ROW; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [EV_MULTI_COLUMN_LIST_ROW])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE


EV_NEW_ITEM_ACTION_SEQUENCE Chart

class
    EV_NEW_ITEM_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for new container item events."
    keywords: "ev_new_item"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_NEW_ITEM_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_WIDGET]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [EV_WIDGET]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [EV_WIDGET]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [EV_WIDGET]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_WIDGET]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_NEW_ITEM_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_WIDGET]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [EV_WIDGET]]
    last: [like first] PROCEDURE [ANY, TUPLE [EV_WIDGET]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_WIDGET]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_WIDGET]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [EV_WIDGET])
    compare_objects
    compare_references
    copy (other: [like Current] EV_NEW_ITEM_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_a_widget: EV_WIDGET; action: PROCEDURE [ANY, TUPLE])


EV_NEW_ITEM_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for new container item events."
    status: "Generated!"
    keywords: "ev_new_item"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_NEW_ITEM_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [EV_WIDGET]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [EV_WIDGET]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [EV_WIDGET]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_WIDGET]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_WIDGET]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_a_widget: EV_WIDGET; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_WIDGET]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_WIDGET]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_WIDGET]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_WIDGET]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [EV_WIDGET])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_WIDGET]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_NEW_ITEM_ACTION_SEQUENCE


EV_NOTEBOOK_ACTION_SEQUENCES Chart

deferred class
    EV_NOTEBOOK_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_NOTEBOOK."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    selection_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_NOTEBOOK_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_NOTEBOOK."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_NOTEBOOK_ACTION_SEQUENCES

feature -- Event handling

    selection_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected_item changes.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_NOTEBOOK_ACTION_SEQUENCES


EV_NOTIFY_ACTION_SEQUENCE Chart

class
    EV_NOTIFY_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for general notify events with no parameters."
    keywords: "ev_notify"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_NOTIFY_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE]
    last: [like first] PROCEDURE [ANY, TUPLE]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE)
    compare_objects
    compare_references
    copy (other: [like Current] EV_NOTIFY_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE])
    put (v: [like item] PROCEDURE [ANY, TUPLE])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (action: PROCEDURE [ANY, TUPLE])


EV_NOTIFY_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for general notify events with no parameters."
    status: "Generated!"
    keywords: "ev_notify"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_NOTIFY_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE)
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_NOTIFY_ACTION_SEQUENCE


EV_PICK_AND_DROPABLE_ACTION_SEQUENCES Chart

deferred class
    EV_PICK_AND_DROPABLE_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_PICK_AND_DROPABLE."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE


EV_PICK_AND_DROPABLE_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_PICK_AND_DROPABLE."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_PICK_AND_DROPABLE_ACTION_SEQUENCES

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
        ensure
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
        ensure
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_PICK_AND_DROPABLE_ACTION_SEQUENCES


EV_PIXMAP_ACTION_SEQUENCES Chart

deferred class
    EV_PIXMAP_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_PIXMAP."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE


EV_PIXMAP_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_PIXMAP."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_PIXMAP_ACTION_SEQUENCES

feature -- Event handling

    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when an area needs to be redrawn.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_PIXMAP_ACTION_SEQUENCES


EV_PND_ACTION_SEQUENCE Chart

class
    EV_PND_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for PND drop events."
    keywords: "pick and drop, drag and drop, PND, DND, drop"
    create: default_create

Ancestors
    ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]
    INTERNAL

Action sequences
    duplicate (n: INTEGER): [like Current] EV_PND_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [ANY]]
    accepts_pebble (a_pebble: ANY): BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    bit_size (i: INTEGER; object: ANY): INTEGER
    Bit_type: INTEGER
    Blocked_state: INTEGER
    boolean_field (i: INTEGER; object: ANY): BOOLEAN
    Boolean_type: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    character_field (i: INTEGER; object: ANY): CHARACTER
    Character_type: INTEGER
    class_name (object: ANY): STRING
    compiler_version: INTEGER
    count: INTEGER
    cursor: CURSOR
    double_field (i: INTEGER; object: ANY): DOUBLE
    Double_type: INTEGER
    dummy_event_data: TUPLE [ANY]
    dynamic_type (object: ANY): INTEGER
    dynamic_type_from_string (class_type: STRING): INTEGER
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    expanded_field_type (i: INTEGER; object: ANY): STRING
    Expanded_type: INTEGER
    Extendible: BOOLEAN
    field (i: INTEGER; object: ANY): ANY
    field_count (object: ANY): INTEGER
    field_count_of_type (type_id: INTEGER): INTEGER
    field_name (i: INTEGER; object: ANY): STRING
    field_name_of_type (i, type_id: INTEGER): STRING
    field_offset (i: INTEGER; object: ANY): INTEGER
    field_type (i: INTEGER; object: ANY): INTEGER
    field_type_of_type (i, type_id: INTEGER): INTEGER
    first: PROCEDURE [ANY, TUPLE [ANY]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
    has (v: PROCEDURE [ANY, TUPLE [ANY]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [ANY]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [ANY]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    Integer_16_type: INTEGER
    Integer_32_type: INTEGER
    Integer_64_type: INTEGER
    Integer_8_type: INTEGER
    integer_field (i: INTEGER; object: ANY): INTEGER
    Integer_type: INTEGER
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_PND_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [ANY]]): BOOLEAN
    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
    is_special (object: ANY): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [ANY]]
    last: [like first] PROCEDURE [ANY, TUPLE [ANY]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [ANY]]]
    name: STRING
    new_instance_of (type_id: INTEGER): ANY
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [ANY]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    physical_size (object: ANY): INTEGER
    pointer_field (i: INTEGER; object: ANY): POINTER
    Pointer_type: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    real_field (i: INTEGER; object: ANY): REAL
    Real_type: INTEGER
    Reference_type: INTEGER
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [ANY]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]], BOOLEAN]): BOOLEAN
    type_conforms_to (type1, type2: INTEGER): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    veto_pebble_function: FUNCTION [ANY, TUPLE [ANY], BOOLEAN]
    Wide_character_type: INTEGER
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [ANY]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (a_pebble_tuple: TUPLE [ANY])
    compare_objects
    compare_references
    copy (other: [like Current] EV_PND_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [ANY]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [ANY]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [ANY]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [ANY]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [ANY]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [ANY]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [ANY]])
    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
    set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
    set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
    set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
    set_item_name (an_item: PROCEDURE [ANY, TUPLE [ANY]]; a_name: STRING)
    set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
    set_real_field (i: INTEGER; object: ANY; value: REAL)
    set_reference_field (i: INTEGER; object, value: ANY)
    set_veto_pebble_function (a_function: FUNCTION [ANY, TUPLE [ANY], BOOLEAN])
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    names not void


EV_PND_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for PND drop events."
    status: "See notice at end of file."
    keywords: "pick and drop, drag and drop, PND, DND, drop"
    date: "$Date: 2001/07/12 18:30:35 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_PND_ACTION_SEQUENCE

create

    default_create
            -- Create a ready to use action sequence.

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [ANY]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    Bit_type: INTEGER is 8
            -- (from INTERNAL)

    boolean_field (i: INTEGER; object: ANY): BOOLEAN
            -- Boolean value of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    Boolean_type: INTEGER is 3
            -- (from INTERNAL)

    character_field (i: INTEGER; object: ANY): CHARACTER
            -- Character value of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    Character_type: INTEGER is 2
            -- (from INTERNAL)

    class_name (object: ANY): STRING
            -- Name of the class associated with object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    double_field (i: INTEGER; object: ANY): DOUBLE
            -- Double precision value of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

    Double_type: INTEGER is 6
            -- (from INTERNAL)

    dummy_event_data: TUPLE [ANY]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    dynamic_type (object: ANY): INTEGER
            -- Dynamic type of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    expanded_field_type (i: INTEGER; object: ANY): STRING
            -- Class name associated with the i-th
            -- expanded field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_expanded: field_type (i, object) = expanded_type
        ensure -- from INTERNAL
            result_exists: Result /= void

    Expanded_type: INTEGER is 7
            -- (from INTERNAL)

    field (i: INTEGER; object: ANY): ANY
            -- Object attached to the i-th field of object
            -- (directly or through a reference)
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_name (i: INTEGER; object: ANY): STRING
            -- Name of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)
        ensure -- from INTERNAL
            result_exists: Result /= void

    field_name_of_type (i: INTEGER; type_id: INTEGER): STRING
            -- Name of i-th field of dynamic type type_id.
            -- (from INTERNAL)
        require -- from INTERNAL
            index_large_enough: i >= 1
            index_small_enought: i <= field_count_of_type (type_id)

    field_offset (i: INTEGER; object: ANY): INTEGER
            -- Offset of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            not_special: not is_special (object)

    field_type (i: INTEGER; object: ANY): INTEGER
            -- Type of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)

    field_type_of_type (i: INTEGER; type_id: INTEGER): INTEGER
            -- Type of i-th field of dynamic type type_id
            -- (from INTERNAL)
        require -- from INTERNAL
            index_large_enough: i >= 1
            index_small_enough: i <= field_count_of_type (type_id)

    first: PROCEDURE [ANY, TUPLE [ANY]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    generic_dynamic_type (object: ANY; i: INTEGER): INTEGER
            -- Dynamic type of generic parameter of object at
            -- position i.
            -- (from INTERNAL)

    has (v: PROCEDURE [ANY, TUPLE [ANY]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    Integer_16_type: INTEGER is 10
            -- (from INTERNAL)

    Integer_32_type: INTEGER is 4
            -- (from INTERNAL)

    Integer_64_type: INTEGER is 11
            -- (from INTERNAL)

    Integer_8_type: INTEGER is 9
            -- (from INTERNAL)

    integer_field (i: INTEGER; object: ANY): INTEGER
            -- Integer value of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    Integer_type: INTEGER is 4
            -- (from INTERNAL)

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [ANY]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [ANY]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    pointer_field (i: INTEGER; object: ANY): POINTER
            -- Pointer value of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

    Pointer_type: INTEGER is 0
            -- (from INTERNAL)

    real_field (i: INTEGER; object: ANY): REAL
            -- Real value of i-th field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    Real_type: INTEGER is 5
            -- (from INTERNAL)

    Reference_type: INTEGER is 1
            -- (from INTERNAL)

    Wide_character_type: INTEGER is 12
            -- (from INTERNAL)

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [ANY]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    bit_size (i: INTEGER; object: ANY): INTEGER
            -- Size (in bit) of the i-th bit field of object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            is_bit: field_type (i, object) = bit_type
        ensure -- from INTERNAL
            positive_result: Result > 0

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    field_count (object: ANY): INTEGER
            -- Number of logical fields in object
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void

    field_count_of_type (type_id: INTEGER): INTEGER
            -- Number of logical fields in dynamic type type_id.
            -- (from INTERNAL)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    physical_size (object: ANY): INTEGER
            -- Space occupied by object in bytes
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    accepts_pebble (a_pebble: ANY): BOOLEAN
            -- Do any actions accept a_pebble.
        require
            a_pebble_not_void: a_pebble /= void

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [ANY]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    is_special (object: ANY): BOOLEAN
            -- Is object a special object?
            -- It only recognized a special object
            -- initialized within a TO_SPECIAL object.
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    veto_pebble_function: FUNCTION [ANY, TUPLE [ANY], BOOLEAN]
            -- User function to determine whether dropping is allowed.

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

    set_veto_pebble_function (a_function: FUNCTION [ANY, TUPLE [ANY], BOOLEAN])
            -- Assign a_function to veto_pebble_function.

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [ANY]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [ANY]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [ANY]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [ANY]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

    set_boolean_field (i: INTEGER; object: ANY; value: BOOLEAN)
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            boolean_field: field_type (i, object) = boolean_type

    set_character_field (i: INTEGER; object: ANY; value: CHARACTER)
            -- Set character value of i-th field of object to value
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            character_field: field_type (i, object) = character_type

    set_double_field (i: INTEGER; object: ANY; value: DOUBLE)
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            double_field: field_type (i, object) = double_type

    set_integer_field (i: INTEGER; object: ANY; value: INTEGER)
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            integer_field: field_type (i, object) = integer_type

    set_item_name (an_item: PROCEDURE [ANY, TUPLE [ANY]]; a_name: STRING)
            -- Acociate a_name with an_item.

    set_pointer_field (i: INTEGER; object: ANY; value: POINTER)
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            pointer_field: field_type (i, object) = pointer_type

    set_real_field (i: INTEGER; object: ANY; value: REAL)
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            real_field: field_type (i, object) = real_type

    set_reference_field (i: INTEGER; object: ANY; value: ANY)
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void
            index_large_enough: i >= 1
            index_small_enough: i <= field_count (object)
            reference_field: field_type (i, object) = reference_type

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [ANY]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (a_pebble_tuple: TUPLE [ANY])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Conformance

    is_instance_of (object: ANY; type_id: INTEGER): BOOLEAN
            -- Is object an instance of type type_id?
            -- (from INTERNAL)
        require -- from INTERNAL
            object_not_void: object /= void

    type_conforms_to (type1, type2: INTEGER): BOOLEAN
            -- Does type1 conform to type2?
            -- (from INTERNAL)

feature -- Creation

    dynamic_type_from_string (class_type: STRING): INTEGER
            -- Dynamic type corresponding to class_type.
            -- If no dynamic type available, returns -1.
            -- (from INTERNAL)
        require -- from INTERNAL
            class_type_not_void: class_type /= void
        ensure -- from INTERNAL
            valid_result: Result = - 1 or else Result >= 0

    new_instance_of (type_id: INTEGER): ANY
            -- New instance of dynamic type_id.
            -- Note: returned object is not initialized and may
            -- hence violate its invariant.
            -- (from INTERNAL)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [ANY]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Version

    compiler_version: INTEGER
            -- (from INTERNAL)

invariant

    names_not_void: names /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_PND_ACTION_SEQUENCE


EV_PND_START_ACTION_SEQUENCE Chart

class
    EV_PND_START_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for pick and drop transport start events."
    keywords: "ev_pnd_start"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_PND_START_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [INTEGER, INTEGER]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_PND_START_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
    last: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [INTEGER, INTEGER])
    compare_objects
    compare_references
    copy (other: [like Current] EV_PND_START_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_x, a_y: INTEGER; action: PROCEDURE [ANY, TUPLE])


EV_PND_START_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for pick and drop transport start events."
    status: "Generated!"
    keywords: "ev_pnd_start"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_PND_START_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [INTEGER, INTEGER]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_x: INTEGER; a_y: INTEGER; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [INTEGER, INTEGER])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_PND_START_ACTION_SEQUENCE


EV_POINTER_BUTTON_ACTION_SEQUENCE Chart

class
    EV_POINTER_BUTTON_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for mouse button up/down events."
    keywords: "ev_pointer_button"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_POINTER_BUTTON_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_POINTER_BUTTON_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    last: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER])
    compare_objects
    compare_references
    copy (other: [like Current] EV_POINTER_BUTTON_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_x, a_y, a_button: INTEGER; a_x_tilt, a_y_tilt, a_pressure: DOUBLE; a_screen_x, a_screen_y: INTEGER; action: PROCEDURE [ANY, TUPLE])


EV_POINTER_BUTTON_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for mouse button up/down events."
    status: "Generated!"
    keywords: "ev_pointer_button"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_POINTER_BUTTON_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_x: INTEGER; a_y: INTEGER; a_button: INTEGER; a_x_tilt: DOUBLE; a_y_tilt: DOUBLE; a_pressure: DOUBLE; a_screen_x: INTEGER; a_screen_y: INTEGER; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_POINTER_BUTTON_ACTION_SEQUENCE


EV_POINTER_MOTION_ACTION_SEQUENCE Chart

class
    EV_POINTER_MOTION_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for mouse movement events."
    keywords: "ev_pointer_motion"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_POINTER_MOTION_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_POINTER_MOTION_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    last: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER])
    compare_objects
    compare_references
    copy (other: [like Current] EV_POINTER_MOTION_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_x, a_y: INTEGER; a_x_tilt, a_y_tilt, a_pressure: DOUBLE; a_screen_x, a_screen_y: INTEGER; action: PROCEDURE [ANY, TUPLE])


EV_POINTER_MOTION_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for mouse movement events."
    status: "Generated!"
    keywords: "ev_pointer_motion"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_POINTER_MOTION_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_x: INTEGER; a_y: INTEGER; a_x_tilt: DOUBLE; a_y_tilt: DOUBLE; a_pressure: DOUBLE; a_screen_x: INTEGER; a_screen_y: INTEGER; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER, INTEGER, DOUBLE, DOUBLE, DOUBLE, INTEGER, INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_POINTER_MOTION_ACTION_SEQUENCE


EV_PROXIMITY_ACTION_SEQUENCE Chart

class
    EV_PROXIMITY_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for proximity in/out events."
    keywords: "ev_proximity"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_PROXIMITY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_PROXIMITY_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE]
    last: [like first] PROCEDURE [ANY, TUPLE]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE)
    compare_objects
    compare_references
    copy (other: [like Current] EV_PROXIMITY_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE])
    put (v: [like item] PROCEDURE [ANY, TUPLE])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (action: PROCEDURE [ANY, TUPLE])


EV_PROXIMITY_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for proximity in/out events."
    status: "Generated!"
    keywords: "ev_proximity"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_PROXIMITY_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE)
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_PROXIMITY_ACTION_SEQUENCE


EV_STANDARD_DIALOG_ACTION_SEQUENCES Chart

deferred class
    EV_STANDARD_DIALOG_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_STANDARD_DIALOG."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_STANDARD_DIALOG_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_STANDARD_DIALOG."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_STANDARD_DIALOG_ACTION_SEQUENCES

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
        ensure
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_STANDARD_DIALOG_ACTION_SEQUENCES


EV_TEXT_COMPONENT_ACTION_SEQUENCES Chart

deferred class
    EV_TEXT_COMPONENT_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_TEXT_COMPONENT."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    change_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_TEXT_COMPONENT_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_TEXT_COMPONENT."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_TEXT_COMPONENT_ACTION_SEQUENCES

feature -- Event handling

    change_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when text changes.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_TEXT_COMPONENT_ACTION_SEQUENCES


EV_TEXT_FIELD_ACTION_SEQUENCES Chart

deferred class
    EV_TEXT_FIELD_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_TEXT_FIELD."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    return_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_TEXT_FIELD_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_TEXT_FIELD."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_TEXT_FIELD_ACTION_SEQUENCES

feature -- Event handling

    return_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when return key is pressed.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_TEXT_FIELD_ACTION_SEQUENCES


EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES Chart

deferred class
    EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_TOOL_BAR_BUTTON."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_TOOL_BAR_BUTTON."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES

feature -- Event handling

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES


EV_TREE_ACTION_SEQUENCES Chart

deferred class
    EV_TREE_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_TREE."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_TREE_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_TREE."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_TREE_ACTION_SEQUENCES

feature -- Event handling

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a tree item is deselected.
        ensure
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a tree item is selected.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_TREE_ACTION_SEQUENCES


EV_TREE_ITEM_SELECT_ACTION_SEQUENCE Chart

class
    EV_TREE_ITEM_SELECT_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for tree item selection events."
    keywords: "ev_tree_item_select"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_TREE_ITEM_SELECT_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [EV_TREE_NODE]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_TREE_ITEM_SELECT_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
    last: [like first] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [EV_TREE_NODE])
    compare_objects
    compare_references
    copy (other: [like Current] EV_TREE_ITEM_SELECT_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_item: EV_TREE_NODE; action: PROCEDURE [ANY, TUPLE])


EV_TREE_ITEM_SELECT_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for tree item selection events."
    status: "Generated!"
    keywords: "ev_tree_item_select"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_TREE_ITEM_SELECT_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [EV_TREE_NODE]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_item: EV_TREE_NODE; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [EV_TREE_NODE])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_TREE_ITEM_SELECT_ACTION_SEQUENCE


EV_TREE_NODE_ACTION_SEQUENCES Chart

deferred class
    EV_TREE_NODE_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_TREE_NODE."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_TREE_NODE_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_TREE_NODE."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_TREE_NODE_ACTION_SEQUENCES

feature -- Event handling

    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when collapsed.
        ensure
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
        ensure
            not_void: Result /= void

    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when expanded.
        ensure
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_TREE_NODE_ACTION_SEQUENCES


EV_VALUE_CHANGE_ACTION_SEQUENCE Chart

class
    EV_VALUE_CHANGE_ACTION_SEQUENCE

General
    cluster: vision2.interface.events
    description: "Action sequence for change of integer value events."
    keywords: "ev_value_change"
    create: default_create

Ancestors
    EV_ACTION_SEQUENCE [EVENT_DATA -> TUPLE create make end]

Action sequences
    duplicate (n: INTEGER): [like Current] EV_VALUE_CHANGE_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
    after: BOOLEAN
    before: BOOLEAN
    Blocked_state: INTEGER
    call_is_underway: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    dummy_event_data: TUPLE [INTEGER]
    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    event_data_names: ARRAY [STRING]
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: PROCEDURE [ANY, TUPLE [INTEGER]]
    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    has (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
    index: INTEGER
    index_of (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_VALUE_CHANGE_ACTION_SEQUENCE): BOOLEAN
    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] PROCEDURE [ANY, TUPLE [INTEGER]]
    last: [like first] PROCEDURE [ANY, TUPLE [INTEGER]]
    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER]]]
    name: STRING
    Normal_state: INTEGER
    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
    object_comparison: BOOLEAN
    occurrences (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
    off: BOOLEAN
    Paused_state: INTEGER
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
    state: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    abort
    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER]]])
    arrayed_list_make (n: INTEGER)
    back
    block
    call (event_data: TUPLE [INTEGER])
    compare_objects
    compare_references
    copy (other: [like Current] EV_VALUE_CHANGE_ACTION_SEQUENCE)
    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]])
    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN])
    extend (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    extend_kamikaze (an_item: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER]]])
    finish
    flush
    force (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    force_extend (action: PROCEDURE [ANY, TUPLE])
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER]]])
    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
    move (i: INTEGER)
    pause
    prune (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    prune_all (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    prune_when_called (an_action: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_front (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_i_th (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]]; i: INTEGER)
    put_left (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    put_right (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    remove
    remove_left
    remove_right
    replace (v: [like first] PROCEDURE [ANY, TUPLE [INTEGER]])
    resume
    search (v: [like item] PROCEDURE [ANY, TUPLE [INTEGER]])
    start
    swap (i: INTEGER)
    wipe_out
    wrapper (a_value: INTEGER; action: PROCEDURE [ANY, TUPLE])


EV_VALUE_CHANGE_ACTION_SEQUENCE Flat contracts

indexing
    description: "Action sequence for change of integer value events."
    status: "Generated!"
    keywords: "ev_value_change"
    date: "Generated!"
    revision: "Generated!"

class interface
    EV_VALUE_CHANGE_ACTION_SEQUENCE

create

    default_create
            -- Begin in Normal_state.
            -- (from ACTION_SEQUENCE)

feature -- Initialization

    arrayed_list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    dummy_event_data: TUPLE [INTEGER]
            -- Attribute of the generic type.
            -- Useful for introspection and use in like statements.
            -- (from ACTION_SEQUENCE)

    event_data_names: ARRAY [STRING]
            -- Textual description of each event datum.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_event_data_names_internal: deep_equal (Result, event_data_names_internal)

    first: PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    force_extend (action: PROCEDURE [ANY, TUPLE])
            -- Extend without type checking.

    has (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    name: STRING
            -- Textual description.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            equal_to_name_internal: Result.is_equal (name_internal)

    sequential_occurrences (v: PROCEDURE [ANY, TUPLE [INTEGER]]): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    wrapper (a_value: INTEGER; action: PROCEDURE [ANY, TUPLE])
            -- Use this to circumvent tuple type checking. (at your own risk!)
            -- Calls action passing all other arguments.

    infix "@" (i: INTEGER): PROCEDURE [ANY, TUPLE [INTEGER]]
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    Blocked_state: INTEGER is 3
            -- (from ACTION_SEQUENCE)

    call_is_underway: BOOLEAN
            -- Is call currently being executed?
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            Result = not is_aborted_stack.is_empty

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: PROCEDURE [ANY, TUPLE [INTEGER]]): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    Normal_state: INTEGER is 1
            -- (from ACTION_SEQUENCE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    Paused_state: INTEGER is 2
            -- (from ACTION_SEQUENCE)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    state: INTEGER
            -- One of Normal_state Paused_state or Blocked_state
            -- (from ACTION_SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    abort
            -- Abort the current call.
            -- (The current item.call will be completed.)
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            call_is_underway: call_is_underway
        ensure -- from ACTION_SEQUENCE
            is_aborted_set: is_aborted_stack.item

    block
            -- Ignore subsequent calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            blocked_state: state = blocked_state

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    flush
            -- Discard any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            call_buffer_empty: call_buffer.is_empty

    pause
            -- Buffer subsequent calls for later execution.
            -- If is_blocked calls will simply be ignored.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            paused_state: state = paused_state

    resume
            -- Used after block or pause to resume normal call
            -- execution.  Executes any buffered calls.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            normal_state: state = normal_state

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    extend_kamikaze (an_item: like item)
            -- Extend an_item and remove it again after it is called.
            -- (from EV_ACTION_SEQUENCE)

    fill (other: CONTAINER [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Merge other into current structure before cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: ARRAYED_LIST [PROCEDURE [ANY, TUPLE [INTEGER]]])
            -- Merge other into current structure after cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_i_th (v: like i_th; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    replace (v: like first)
            -- Replace current item by v.
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor)
            -- (from ARRAYED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [PROCEDURE [ANY, TUPLE [INTEGER]]]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Basic operations

    call (event_data: TUPLE [INTEGER])
            -- Call each procedure in order unless is_blocked.
            -- If is_paused delay execution until resume.
            -- Stop at current point in list on abort.
            -- (from ACTION_SEQUENCE)
        ensure -- from ACTION_SEQUENCE
            is_aborted_stack_unchanged: old is_aborted_stack.is_equal (is_aborted_stack)

feature -- Element Change

    prune_when_called (an_action: like item)
            -- Remove an_action after the next time it is called.
            -- (from ACTION_SEQUENCE)
        require -- from ACTION_SEQUENCE
            has (an_action)

feature -- Event handling

    empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from not is_empty to is_empty.
            -- (from ACTION_SEQUENCE)

    not_empty_actions: ARRAYED_LIST [PROCEDURE [ANY, TUPLE]]
            -- Actions to be performed on transition from is_empty to not is_empty.
            -- (from ACTION_SEQUENCE)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]]]; test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [PROCEDURE [ANY, TUPLE [INTEGER]]], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTION_SEQUENCE
    is_aborted_stack_not_void: is_aborted_stack /= void
    call_buffer_not_void: call_buffer /= void
    not_has_void: not has (void)
    valid_state: state = normal_state or state = paused_state or state = blocked_state
    call_buffer_consistent: state = normal_state implies call_buffer.is_empty
    not_empty_actions_not_void: not_empty_actions /= void
    empty_actions_not_void: empty_actions /= void
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_VALUE_CHANGE_ACTION_SEQUENCE


EV_WIDGET_ACTION_SEQUENCES Chart

deferred class
    EV_WIDGET_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_WIDGET."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE


EV_WIDGET_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_WIDGET."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_WIDGET_ACTION_SEQUENCES

feature -- Event handling

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
        ensure
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
        ensure
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
        ensure
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
        ensure
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
        ensure
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
        ensure
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
        ensure
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
        ensure
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
        ensure
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
        ensure
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
        ensure
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_WIDGET_ACTION_SEQUENCES


EV_WINDOW_ACTION_SEQUENCES Chart

deferred class
    EV_WINDOW_ACTION_SEQUENCES

General
    cluster: vision2.interface.events
    description: "Action sequences for EV_WINDOW."
    keywords: "event, action, sequence"

Ancestors
    ANY

Action sequences
    close_request_actions: EV_NOTIFY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE


EV_WINDOW_ACTION_SEQUENCES Flat contracts

indexing
    description: "Action sequences for EV_WINDOW."
    status: "Generated!"
    keywords: "event, action, sequence"
    date: "Generated!"
    revision: "Generated!"

deferred class interface
    EV_WINDOW_ACTION_SEQUENCES

feature -- Event handling

    close_request_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed whan a request to close window
            -- has been received.
        ensure
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
        ensure
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
        ensure
            not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_WINDOW_ACTION_SEQUENCES


cluster vision2.interface.figures

Cluster
    vision2.interface.figures

Supercluster
    vision2.interface

Subclusters

Classes
    EV_ARROWED_FIGURE
    EV_ATOMIC_FIGURE
    EV_CLOSED_FIGURE
    EV_DOUBLE_POINTED_FIGURE
    EV_DRAWING_AREA_PROJECTOR
    EV_FIGURE
    EV_FIGURE_ARC
    EV_FIGURE_DOT
    EV_FIGURE_DRAWER
    EV_FIGURE_DRAWING_ROUTINES
    EV_FIGURE_ELLIPSE
    EV_FIGURE_EQUILATERAL
    EV_FIGURE_GROUP
    EV_FIGURE_LINE
    EV_FIGURE_MATH
    EV_FIGURE_PICTURE
    EV_FIGURE_PIE_SLICE
    EV_FIGURE_POLYGON
    EV_FIGURE_POLYLINE
    EV_FIGURE_POSTSCRIPT_DRAWER
    EV_FIGURE_RECTANGLE
    EV_FIGURE_ROUNDED_RECTANGLE
    EV_FIGURE_STAR
    EV_FIGURE_TEXT
    EV_FIGURE_WORLD
    EV_MOVE_HANDLE
    EV_MULTI_POINTED_FIGURE
    EV_PIXMAP_PROJECTOR
    EV_POSTSCRIPT_PROJECTOR
    EV_PROJECTION_ROUTINES
    EV_PROJECTOR
    EV_RELATIVE_POINT
    EV_SINGLE_POINTED_FIGURE
    EV_WIDGET_PROJECTOR


EV_ARROWED_FIGURE Chart

deferred class
    EV_ARROWED_FIGURE

General
    cluster: vision2.interface.figures
    description: "Figure that is can have an arrowhead at its start or endpoint."
    keywords: "figure, line, arrow"

Ancestors
    EV_FIGURE_MATH

Queries
    Arrow_size: INTEGER
    is_end_arrow: BOOLEAN
    is_start_arrow: BOOLEAN
    line_width: INTEGER

Commands
    disable_end_arrow
    disable_start_arrow
    enable_end_arrow
    enable_start_arrow


EV_ARROWED_FIGURE Flat contracts

indexing
    description: "Figure that is can have an arrowhead at its start or endpoint."
    status: "See notice at end of class"
    keywords: "figure, line, arrow"
    date: "$Date: 2001/07/12 18:30:35 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_ARROWED_FIGURE

feature -- Access

    Arrow_size: INTEGER is 10

    is_end_arrow: BOOLEAN
            -- Does point_b have an arrow?

    is_start_arrow: BOOLEAN
            -- Does point_a have an arrow?

feature -- Status setting

    disable_end_arrow
            -- Set is_end_arrow False.

    disable_start_arrow
            -- Set is_start_arrow False.

    enable_end_arrow
            -- Set is_end_arrow True.

    enable_start_arrow
            -- Set is_start_arrow True.

    line_width: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_ARROWED_FIGURE


EV_ATOMIC_FIGURE Chart

deferred class
    EV_ATOMIC_FIGURE

General
    cluster: vision2.interface.figures
    description: "Figures that cannot contain other figures."
    keywords: "figure, atomic"

Ancestors
    EV_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show

Constraints
    foreground color exists
    line width non negative


EV_ATOMIC_FIGURE Flat contracts

indexing
    description: "Figures that cannot contain other figures."
    status: "See notice at end of class"
    keywords: "figure, atomic"
    date: "$Date: 2001/07/12 18:30:35 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_ATOMIC_FIGURE

feature -- Access

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Number of points needed to describe Current.
            -- (from EV_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
        ensure
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
        ensure
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
        require
            a_color_not_void: a_color /= void
        ensure
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
        require
            a_width_non_negative: a_width >= 0
        ensure
            line_width_assigned: line_width = a_width

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is the point on (x, y) on this figure?
            -- (from EV_FIGURE)

invariant

    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_ATOMIC_FIGURE


EV_CLOSED_FIGURE Chart

deferred class
    EV_CLOSED_FIGURE

General
    cluster: vision2.interface.figures
    description: "Closed figures filled with `background_color'."
    keywords: "figure, atomic, filled, closed"

Ancestors
    EV_ATOMIC_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    background_color: EV_COLOR
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_filled: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_background_color
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_background_color (a_color: EV_COLOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_CLOSED_FIGURE Flat contracts

indexing
    description: "Closed figures filled with `background_color'."
    status: "See notice at end of class"
    keywords: "figure, atomic, filled, closed"
    date: "$Date: 2001/07/12 18:30:35 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_CLOSED_FIGURE

feature -- Access

    background_color: EV_COLOR
            -- Color used to fill Current.

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Number of points needed to describe Current.
            -- (from EV_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_filled: BOOLEAN
            -- Is this figure filled?

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    remove_background_color
            -- Do not fill this figure.
        ensure
            background_color_removed: background_color = void

    set_background_color (a_color: EV_COLOR)
            -- Set background_color to a_color.
        require
            a_color_exists: a_color /= void
        ensure
            background_color_assigned: background_color = a_color

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is the point on (x, y) on this figure?
            -- (from EV_FIGURE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_CLOSED_FIGURE


EV_DOUBLE_POINTED_FIGURE Chart

deferred class
    EV_DOUBLE_POINTED_FIGURE

General
    cluster: vision2.interface.figures
    description: "Figures consisting of two points."
    keywords: "figure, points"

Ancestors
    EV_SINGLE_POINTED_FIGURE

Queries
    point_a: EV_RELATIVE_POINT
    point_b: EV_RELATIVE_POINT
    point_count: INTEGER

Commands
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)


EV_DOUBLE_POINTED_FIGURE Flat contracts

indexing
    description: "Figures consisting of two points."
    status: "See notive at end of class"
    keywords: "figure, points"
    date: "$Date: 2001/07/12 18:30:35 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_DOUBLE_POINTED_FIGURE

feature -- Access

    point_a: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_b: EV_RELATIVE_POINT
            -- Second point of Current.

    point_count: INTEGER
            -- Current has two points.

feature -- Status setting

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point_a = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
        require
            a_point_not_void: a_point /= void
        ensure
            point_b_assigned: point_b = a_point

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_DOUBLE_POINTED_FIGURE


EV_DRAWING_AREA_PROJECTOR Chart

class
    EV_DRAWING_AREA_PROJECTOR

General
    cluster: vision2.interface.figures
    description:
        "Projectors that make representations of `world' on
        EV_DRAWING_AREA."
    keywords: "figures, project, pointer, drawing, points"
    create: make_with_buffer, make

Ancestors
    EV_WIDGET_PROJECTOR

Queries
    area: EV_DRAWABLE
    area_x: INTEGER
    area_y: INTEGER
    buffer_used: BOOLEAN
    Default_colors: EV_STOCK_COLORS
    drawable: EV_DRAWABLE
    is_projecting: BOOLEAN
    widget: EV_WIDGET
    world: EV_FIGURE_WORLD

Commands
    change_area_position (a_x, a_y: INTEGER)
    clear_device
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)
    draw_grid
    full_project
    project
    project_rectangle (u: EV_RECTANGLE)
    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
    set_drawable (a_drawable: EV_DRAWABLE)
    set_world (a_world: EV_FIGURE_WORLD)
    update_rectangle (u: EV_RECTANGLE; a_x, a_y: INTEGER)


EV_DRAWING_AREA_PROJECTOR Flat contracts

indexing
    description: "Projectors that make representations of `world' onEV_DRAWING_AREA."
    status: "See notice at end of class"
    keywords: "figures, project, pointer, drawing, points"
    date: "$Date: 2001/07/12 18:30:35 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_DRAWING_AREA_PROJECTOR

create

    make (a_world: EV_FIGURE_WORLD; a_drawing_area: EV_DRAWING_AREA)
            -- Create with a_world and a_drawing_area.
        require
            a_world_not_void: a_world /= void
            a_drawing_area_not_void: a_drawing_area /= void

    make_with_buffer (a_world: EV_FIGURE_WORLD; a_buffer: EV_PIXMAP; a_drawing_area: EV_DRAWING_AREA)
            -- Create with a_world, a_drawing_area and a_buffer.
        require
            a_world_not_void: a_world /= void
            a_drawing_area_not_void: a_drawing_area /= void
            a_buffer_not_void: a_buffer /= void

feature -- Access

    area: EV_DRAWABLE
            -- Area associated with widget.
            -- Void if no buffer is used.
            -- (from EV_WIDGET_PROJECTOR)

    area_x: INTEGER
            -- Coordinates of top-left corner of displayed part of drawable.
            -- (0, 0) when no buffer is used.
            -- Was declared in EV_WIDGET_PROJECTOR as synonym of area_y.
            -- (from EV_WIDGET_PROJECTOR)

    area_y: INTEGER
            -- Coordinates of top-left corner of displayed part of drawable.
            -- (0, 0) when no buffer is used.
            -- Was declared in EV_WIDGET_PROJECTOR as synonym of area_x.
            -- (from EV_WIDGET_PROJECTOR)

    drawable: EV_DRAWABLE
            -- Drawable surface (screen, drawing area or pixmap).
            -- (from EV_FIGURE_DRAWER)

    widget: EV_WIDGET
            -- device if conforms to EV_WIDGET.
            -- Void otherwise.
            -- (from EV_WIDGET_PROJECTOR)

    world: EV_FIGURE_WORLD
            -- Figure-world that will be projected.
            -- (from EV_PROJECTOR)

feature -- Status report

    buffer_used: BOOLEAN
            -- Is drawable only a buffer area for area?
            -- (from EV_WIDGET_PROJECTOR)

feature -- Status setting

    set_world (a_world: EV_FIGURE_WORLD)
            -- Set world to a_world.
            -- (from EV_PROJECTOR)
        require -- from EV_PROJECTOR
            a_world_exists: a_world /= void
        ensure -- from EV_PROJECTOR
            world_assigned: world = a_world

feature -- Element change

    change_area_position (a_x, a_y: INTEGER)
            -- area has moved to (a_x, a_y) of drawable.
            -- (from EV_WIDGET_PROJECTOR)
        require -- from EV_WIDGET_PROJECTOR
            valid_position: a_x >= 0 and a_y >= 0

feature -- Basic operations

    clear_device
            -- Erase entire canvas.
            -- (from EV_WIDGET_PROJECTOR)

    full_project
            -- Project entire area.
            -- (from EV_WIDGET_PROJECTOR)

    is_projecting: BOOLEAN
            -- Is a project currently being performed?
            -- Then, do not start a new one.
            -- (from EV_PROJECTION_ROUTINES)

    project
            -- Make a standard projection of world on device.
            -- (from EV_WIDGET_PROJECTOR)

    project_rectangle (u: EV_RECTANGLE)
            -- Project area under u.
            -- (from EV_WIDGET_PROJECTOR)

    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Assign a_routine for drawing of a_figure.
            -- (from EV_PROJECTION_ROUTINES)

    update_rectangle (u: EV_RECTANGLE; a_x, a_y: INTEGER)
            -- Flush u on area at (a_x, a_y).
            -- (from EV_WIDGET_PROJECTOR)
        require -- from EV_WIDGET_PROJECTOR
            buffer_used: buffer_used

feature -- Implementation

    default_colors: EV_STOCK_COLORS
            -- Once access to EV_STOCK_COLORS.
            -- (from EV_PROJECTION_ROUTINES)

feature -- Basic Operations

    draw_grid
            -- Draw grid on canvas.
            -- world.point is the origin of the grid.
            -- (from EV_FIGURE_DRAWER)

feature -- Element Change

    set_drawable (a_drawable: EV_DRAWABLE)
            -- Set drawable to a_drawable.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWER
            a_drawable_not_void: a_drawable /= void
        ensure -- from EV_FIGURE_DRAWER
            assigned: drawable = a_drawable

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw standard representation of line to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of f to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            text_figure_not_void: text_figure /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PROJECTOR
    world_exists: world /= void
        -- from EV_FIGURE_DRAWER
    drawable_not_void: drawable /= void

end -- class EV_DRAWING_AREA_PROJECTOR


EV_FIGURE_ARC Chart

class
    EV_FIGURE_ARC

General
    cluster: vision2.interface.figures
    description:
        "Curves as defined by two points, a `start_angle' and
        `aperture'."
    keywords: "figure, arc, curve"
    create: make_with_points, default_create

Ancestors
    EV_ATOMIC_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    aperture: DOUBLE
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    Pi: DOUBLE
    point_a: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_b: EV_RELATIVE_POINT
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    start_angle: DOUBLE
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_aperture (an_aperture: DOUBLE)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_start_angle (a_start_angle: DOUBLE)
    set_target_name (a_name: STRING)
    show

Constraints
    start angle within bounds
    aperture within bounds


EV_FIGURE_ARC Flat contracts

indexing
    description: "Curves as defined by two points, a `start_angle' and`aperture'."
    status: "See notice at end of class"
    keywords: "figure, arc, curve"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_ARC

create

    default_create
            -- Create with some start_angle and aperture.

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

feature -- Access

    aperture: DOUBLE
            -- Angle that defines percentage of arc.

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_a: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_b: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    start_angle: DOUBLE
            -- Angle that defines start of arc.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature  -- Access

    Pi: DOUBLE is 3.14159265358979323846
            -- (from MATH_CONST)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_aperture (an_aperture: DOUBLE)
            -- Set aperture to an_aperture.
        require
            an_aperture_within_bounds: an_aperture >= 0 and an_aperture <= 2 * pi
        ensure
            aperture_assigned: aperture = an_aperture

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point_a = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: point_b = a_point

    set_start_angle (a_start_angle: DOUBLE)
            -- Set start_angle to a_start_angle.
        require
            a_start_angle_within_bounds: a_start_angle >= 0 and a_start_angle <= 2 * pi
        ensure
            start_angle_assigned: start_angle = a_start_angle

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

    start_angle_within_bounds: start_angle >= 0 and then start_angle <= 2 * pi
    aperture_within_bounds: aperture >= 0 and then aperture <= 2 * pi
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_ARC


EV_FIGURE_DOT Chart

class
    EV_FIGURE_DOT

General
    cluster: vision2.interface.figures
    description: "Pixels on `point' with size `line_width'."
    keywords: "figure, dot, point, pixel"
    create: make_with_point, default_create

Ancestors
    EV_ATOMIC_FIGURE
    EV_SINGLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    default_create
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_FIGURE_DOT Flat contracts

indexing
    description: "Pixels on `point' with size `line_width'."
    status: "See notive at end of class"
    keywords: "figure, dot, point, pixel"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_DOT

create

    default_create
            -- Create with default attributes.
            -- (from EV_ATOMIC_FIGURE)

    make_with_point (a_point: EV_RELATIVE_POINT)
            -- Create on a_point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void

feature -- Initialization

    default_create
            -- Create with default attributes.
            -- (from EV_ATOMIC_FIGURE)

feature -- Access

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Current has one point.
            -- (from EV_SINGLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_DOT


EV_FIGURE_DRAWER Chart

deferred class
    EV_FIGURE_DRAWER

General
    cluster: vision2.interface.figures
    description: "Adapters for EV_DRAWABLE that allow drawing of figures."
    keywords: "figure, primitives, drawing"

Ancestors
    EV_FIGURE_DRAWING_ROUTINES

Queries
    default_colors: EV_STOCK_COLORS
    drawable: EV_DRAWABLE
    world: EV_FIGURE_WORLD

Commands
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)
    draw_grid
    set_drawable (a_drawable: EV_DRAWABLE)

Constraints
    drawable not void


EV_FIGURE_DRAWER Flat contracts

indexing
    description: "Adapters for EV_DRAWABLE that allow drawing of figures."
    status: "See notice at end of class"
    keywords: "figure, primitives, drawing"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_FIGURE_DRAWER

feature -- Access

    default_colors: EV_STOCK_COLORS

    drawable: EV_DRAWABLE
            -- Drawable surface (screen, drawing area or pixmap).

    world: EV_FIGURE_WORLD

feature -- Basic Operations

    draw_grid
            -- Draw grid on canvas.
            -- world.point is the origin of the grid.

feature -- Element Change

    set_drawable (a_drawable: EV_DRAWABLE)
            -- Set drawable to a_drawable.
        require
            a_drawable_not_void: a_drawable /= void
        ensure
            assigned: drawable = a_drawable

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw standard representation of line to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of f to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            text_figure_not_void: text_figure /= void

invariant

    drawable_not_void: drawable /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_FIGURE_DRAWER


EV_FIGURE_DRAWING_ROUTINES Chart

deferred class
    EV_FIGURE_DRAWING_ROUTINES

General
    cluster: vision2.interface.figures
    description: "Abstract class for drawing of figures."
    keywords: "figure, primitives, drawing"

Ancestors
    EV_FIGURE_MATH

Commands
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)


EV_FIGURE_DRAWING_ROUTINES Flat contracts

indexing
    description: "Abstract class for drawing of figures."
    status: "See notice at end of class"
    keywords: "figure, primitives, drawing"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_FIGURE_DRAWING_ROUTINES

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
        require
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
        require
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
        require
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
        require
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw a standard representation of line to the canvas.
        require
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
        require
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
        require
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
        require
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
        require
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
        require
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of f to canvas.
        require
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
        require
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
        require
            text_figure_not_void: text_figure /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_FIGURE_DRAWING_ROUTINES


EV_FIGURE_ELLIPSE Chart

class
    EV_FIGURE_ELLIPSE

General
    cluster: vision2.interface.figures
    description:
        "Biggest ellipse fitting in imaginary rectangle defined by
        `point_a' and `point_b'."
    keywords: "figure, ellipse, circle"
    create: make_with_points, default_create

Ancestors
    EV_CLOSED_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    background_color: EV_COLOR
    bounding_box: EV_RECTANGLE
    center: EV_COORDINATE
    center_x: INTEGER
    center_y: INTEGER
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_filled: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_a: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_b: EV_RELATIVE_POINT
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    radius1: INTEGER
    radius2: INTEGER
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    default_create
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_background_color
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_background_color (a_color: EV_COLOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_FIGURE_ELLIPSE Flat contracts

indexing
    description: "Biggest ellipse fitting in imaginary rectangle defined by`point_a' and `point_b'."
    status: "See notice at end of class."
    keywords: "figure, ellipse, circle"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_ELLIPSE

create

    default_create
            -- Create with default attributes.
            -- (from EV_CLOSED_FIGURE)

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

feature -- Initialization

    default_create
            -- Create with default attributes.
            -- (from EV_CLOSED_FIGURE)

feature -- Access

    background_color: EV_COLOR
            -- Color used to fill Current.
            -- (from EV_CLOSED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_a: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_b: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    center: EV_COORDINATE
            -- Center point of ellipse.

    center_x: INTEGER
            -- Horizontal position of center point.

    center_y: INTEGER
            -- Vertical position of center point.

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_filled: BOOLEAN
            -- Is this figure filled?
            -- (from EV_CLOSED_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    radius1: INTEGER
            -- Horizontal component of radius.

    radius2: INTEGER
            -- Vertical component of radius.

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    remove_background_color
            -- Do not fill this figure.
            -- (from EV_CLOSED_FIGURE)
        ensure -- from EV_CLOSED_FIGURE
            background_color_removed: background_color = void

    set_background_color (a_color: EV_COLOR)
            -- Set background_color to a_color.
            -- (from EV_CLOSED_FIGURE)
        require -- from EV_CLOSED_FIGURE
            a_color_exists: a_color /= void
        ensure -- from EV_CLOSED_FIGURE
            background_color_assigned: background_color = a_color

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point_a = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: point_b = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_ELLIPSE


EV_FIGURE_EQUILATERAL Chart

class
    EV_FIGURE_EQUILATERAL

General
    cluster: vision2.interface.figures
    description: "Figures with its sides the same size."
    keywords: "figure, equilateral, hexagon, octagon"
    create: make_with_points, default_create

Ancestors
    EV_CLOSED_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    background_color: EV_COLOR
    bounding_box: EV_RECTANGLE
    center_point: EV_RELATIVE_POINT
    corner_point: EV_RELATIVE_POINT
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_filled: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    polygon_array: ARRAY [EV_COORDINATE]
    position_on_figure (x, y: INTEGER): BOOLEAN
    side_count: INTEGER
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_background_color
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_background_color (a_color: EV_COLOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_side_count (n: INTEGER)
    set_target_name (a_name: STRING)
    show

Constraints
    side count bigger than two


EV_FIGURE_EQUILATERAL Flat contracts

indexing
    description: "Figures with its sides the same size."
    status: "See notice at end of class"
    keywords: "figure, equilateral, hexagon, octagon"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_EQUILATERAL

create

    default_create
            -- Create with 8 sides.

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

feature -- Access

    background_color: EV_COLOR
            -- Color used to fill Current.
            -- (from EV_CLOSED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    center_point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    corner_point: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    side_count: INTEGER
            -- Number of sides.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_filled: BOOLEAN
            -- Is this figure filled?
            -- (from EV_CLOSED_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    remove_background_color
            -- Do not fill this figure.
            -- (from EV_CLOSED_FIGURE)
        ensure -- from EV_CLOSED_FIGURE
            background_color_removed: background_color = void

    set_background_color (a_color: EV_COLOR)
            -- Set background_color to a_color.
            -- (from EV_CLOSED_FIGURE)
        require -- from EV_CLOSED_FIGURE
            a_color_exists: a_color /= void
        ensure -- from EV_CLOSED_FIGURE
            background_color_assigned: background_color = a_color

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: center_point = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: corner_point = a_point

    set_side_count (n: INTEGER)
            -- Assign n to side_count.
        require
            n_greater_than_two: n > 2
        ensure
            side_count_assigned: side_count = n

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Implementation

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
        ensure -- from EV_FIGURE
            not_void: Result /= void
        ensure then
            result_exists: Result /= void

    polygon_array: ARRAY [EV_COORDINATE]
            -- Absolute coordinates of all corner points.
        ensure
            result_correct_size: Result.count = side_count

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

invariant

    side_count_bigger_than_two: side_count > 2
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_EQUILATERAL


EV_FIGURE Chart

deferred class
    EV_FIGURE

General
    cluster: vision2.interface.figures
    description: "Graphically representable objects."
    keywords: "figure, graphic"

Ancestors
    EV_ABSTRACT_PICK_AND_DROPABLE
    EV_FIGURE_MATH

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    bounding_box: EV_RECTANGLE
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_sensitive
    enable_capture
    enable_sensitive
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show

Constraints
    points not void
    points correct size
    points items not void


EV_FIGURE Flat contracts

indexing
    description: "Graphically representable objects."
    status: "See notice at end of class"
    keywords: "figure, graphic"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_FIGURE

feature -- Access

    group: EV_FIGURE_GROUP
            -- Parent of Current.

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
        ensure
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Number of points needed to describe Current.

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
        require
            in_world: world /= void
        ensure
            capture_released: not has_capture

    disable_sensitive
            -- Make object non-sensitive to user input.
        ensure
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
        require
            in_world: world /= void
        ensure
            capture_set: has_capture

    enable_sensitive
            -- Make object sensitive to user input.
        ensure
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
        ensure
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
        ensure
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
        require
            a_cursor_not_void: a_cursor /= void
        ensure
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
        ensure
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is the point on (x, y) on this figure?

invariant

    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_FIGURE


EV_FIGURE_GROUP Chart

class
    EV_FIGURE_GROUP

General
    cluster: vision2.interface.figures
    description: "Group of EV_FIGURE's. If a figure is added tothis group, it is removed from its previous group first."
    keywords: "group, figure"
    create: make_with_point, default_create

Ancestors
    ARRAYED_LIST [G]
    EV_FIGURE
    EV_SINGLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): EV_FIGURE
    after: BOOLEAN
    before: BOOLEAN
    bounding_box: EV_RECTANGLE
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] EV_FIGURE_GROUP
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: EV_FIGURE
    for_all (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    group: EV_FIGURE_GROUP
    has (v: EV_FIGURE): BOOLEAN
    has_capture: BOOLEAN
    i_th (i: INTEGER): EV_FIGURE
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_FIGURE; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    intersects (r: EV_RECTANGLE): BOOLEAN
    invalid_rectangle: EV_RECTANGLE
    is_empty: BOOLEAN
    is_inserted (v: EV_FIGURE): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] EV_FIGURE
    last: [like first] EV_FIGURE
    linear_representation: LINEAR [EV_FIGURE]
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_FIGURE): INTEGER
    off: BOOLEAN
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: EV_FIGURE): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
    update_rectangle: EV_RECTANGLE
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    world: EV_FIGURE_WORLD
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [EV_FIGURE])
    back
    calculate_absolute_position
    compare_objects
    compare_references
    disable_capture
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]]; test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN])
    enable_capture
    enable_sensitive
    extend (v: [like item] EV_FIGURE)
    fill (other: CONTAINER [EV_FIGURE])
    finish
    force (v: [like item] EV_FIGURE)
    force_i_th (fig: [like item] EV_FIGURE; i: INTEGER)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    insert (fig: [like item] EV_FIGURE; i: INTEGER)
    invalidate
    list_make (n: INTEGER)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [EV_FIGURE])
    merge_left (other: [like Current] EV_FIGURE_GROUP)
    merge_right (other: [like Current] EV_FIGURE_GROUP)
    move (i: INTEGER)
    prune (v: [like item] EV_FIGURE)
    prune_all (fig: [like item] EV_FIGURE)
    put (v: [like item] EV_FIGURE)
    put_front (v: [like item] EV_FIGURE)
    put_left (v: [like item] EV_FIGURE)
    put_right (v: [like item] EV_FIGURE)
    remove
    remove_left
    remove_pebble
    remove_right
    replace (fig: [like item] EV_FIGURE)
    search (v: [like item] EV_FIGURE)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show
    snap_to_grid
    start
    swap (i: INTEGER)
    validate
    wipe_out


EV_FIGURE_GROUP Flat contracts

indexing
    description: "Group of EV_FIGURE's. If a figure is added tothis group, it is removed from its previous group first."
    status: "See notice at end of class"
    keywords: "group, figure"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_GROUP

create

    default_create
            -- Create without point.

    make_with_point (a_point: EV_RELATIVE_POINT)
            -- Create on a_point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void

feature -- Initialization

    list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [EV_FIGURE])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    first: EV_FIGURE
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    has (v: EV_FIGURE): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): EV_FIGURE
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_FIGURE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Current has one point.
            -- (from EV_SINGLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

    infix "@" (i: INTEGER): EV_FIGURE
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
        ensure -- from EV_FIGURE
            not_void: Result /= void

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    invalid_rectangle: EV_RECTANGLE
            -- Rectangle that needs erasing.
            -- Void if no change is made.

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_FIGURE): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    update_rectangle: EV_RECTANGLE
            -- Rectangle that needs redrawing.
            -- Void if no change is made.

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_point (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

    snap_to_grid
            -- Move all move handles to most nearby point on the grid.
        require
            world_not_void: world /= void
            grid_enabled: world.grid_enabled

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_FIGURE])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [EV_FIGURE])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [EV_FIGURE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?
            -- Always returns False, but descendants can override
            -- it to improve efficiency.

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]]; test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- List operations

    force_i_th (fig: like item; i: INTEGER)
            -- Add fig to the group.
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count

    insert (fig: like item; i: INTEGER)
            -- Add fig to the group.
        require -- from ARRAYED_LIST
            index_small_enough: pos <= count
            index_large_enough: pos >= 1
        ensure -- from ARRAYED_LIST
            new_count: count = old count + 1
            index_unchanged: index = old index
            insertion_done: i_th (pos) = v

    merge_left (other: like Current)
            -- Merge other into group before cursor.
            -- other will be empty afterwards.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into group after cursor.
            -- other will be empty afterwards.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    prune_all (fig: like item)
            -- Remove fig from the group.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove item from figure.
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    replace (fig: like item)
            -- Add fig to the group.
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

    wipe_out
            -- Unreference all groups.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Recomputation

    calculate_absolute_position
            -- Recalculates all absolute positions inside this group.

    invalidate
            -- Some property of Current has changed.

    validate
            -- Invalidate Current.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_FIGURE_GROUP


EV_FIGURE_LINE Chart

class
    EV_FIGURE_LINE

General
    cluster: vision2.interface.figures
    description: "Figure that is a line segment between 2 points."
    keywords: "figure, line, segment, arrow"
    create: make_with_positions, make_with_points, default_create

Ancestors
    EV_ARROWED_FIGURE
    EV_ATOMIC_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    Arrow_size: INTEGER
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_end_arrow: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    is_start_arrow: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_a: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_b: EV_RELATIVE_POINT
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    default_create
    disable_capture
    disable_dashed_line_style
    disable_end_arrow
    disable_sensitive
    disable_start_arrow
    enable_capture
    enable_dashed_line_style
    enable_end_arrow
    enable_sensitive
    enable_start_arrow
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_FIGURE_LINE Flat contracts

indexing
    description: "Figure that is a line segment between 2 points."
    status: "See notice at end of class"
    keywords: "figure, line, segment, arrow"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_LINE

create

    default_create
            -- Create with default attributes.
            -- (from EV_ATOMIC_FIGURE)

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

    make_with_positions (x1, y1, x2, y2: INTEGER)
            -- Create on (x1, y1) - (x2, y2).
        ensure
            point_a_x_assigned: point_a.x = x1
            point_a_y_assigned: point_a.y = y1
            point_b_x_assigned: point_b.x = x2
            point_b_y_assigned: point_b.y = y2

feature -- Initialization

    default_create
            -- Create with default attributes.
            -- (from EV_ATOMIC_FIGURE)

feature -- Access

    Arrow_size: INTEGER is 10
            -- (from EV_ARROWED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_end_arrow: BOOLEAN
            -- Does point_b have an arrow?
            -- (from EV_ARROWED_FIGURE)

    is_start_arrow: BOOLEAN
            -- Does point_a have an arrow?
            -- (from EV_ARROWED_FIGURE)

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_a: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_b: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_end_arrow
            -- Set is_end_arrow False.
            -- (from EV_ARROWED_FIGURE)

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    disable_start_arrow
            -- Set is_start_arrow False.
            -- (from EV_ARROWED_FIGURE)

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_end_arrow
            -- Set is_end_arrow True.
            -- (from EV_ARROWED_FIGURE)

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    enable_start_arrow
            -- Set is_start_arrow True.
            -- (from EV_ARROWED_FIGURE)

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point_a = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: point_b = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_line_width (width: INTEGER)
            -- Set line-width to width.
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_LINE


EV_FIGURE_MATH Chart

class
    EV_FIGURE_MATH

General
    cluster: vision2.interface.figures
    description: "Facilities class for EV_FIGURE."
    keywords: "math"

Ancestors
    DOUBLE_MATH

Queries
    arc_cosine (v: DOUBLE): DOUBLE
    arc_sine (v: DOUBLE): DOUBLE
    arc_tangent (v: DOUBLE): DOUBLE
    between (n, a, b: INTEGER): BOOLEAN
    ceiling (v: DOUBLE): DOUBLE
    cosine (v: DOUBLE): DOUBLE
    dabs (v: DOUBLE): DOUBLE
    delta_x (angle: DOUBLE; length: INTEGER): INTEGER
    delta_y (angle: DOUBLE; length: INTEGER): INTEGER
    distance (x1, y1, x2, y2: INTEGER): INTEGER
    distance_from_line (x, y, x1, y1, x2, y2: INTEGER): INTEGER
    exp (x: DOUBLE): DOUBLE
    floor (v: DOUBLE): DOUBLE
    line_angle (x1, y1, x2, y2: INTEGER): DOUBLE
    log (v: DOUBLE): DOUBLE
    log10 (v: DOUBLE): DOUBLE
    log_2 (v: DOUBLE): DOUBLE
    modulo (a, b: DOUBLE): DOUBLE
    point_on_ellipse (x, y, xc, yc, r1, r2: INTEGER): BOOLEAN
    point_on_ellipse_boundary (x, y, xc, yc, r1, r2, width: INTEGER): BOOLEAN
    point_on_line (x, y, x1, y1, x2, y2, width: INTEGER): BOOLEAN
    point_on_polygon (x, y: INTEGER; points: ARRAY [EV_COORDINATE]): BOOLEAN
    point_on_rectangle (x, y, x1, y1, x2, y2: INTEGER): BOOLEAN
    point_on_segment (x, y, x1, y1, x2, y2, width: INTEGER): BOOLEAN
    sine (v: DOUBLE): DOUBLE
    sqrt (v: DOUBLE): DOUBLE
    tangent (v: DOUBLE): DOUBLE


EV_FIGURE_MATH Flat contracts

indexing
    description: "Facilities class for EV_FIGURE."
    status: "See notice at end of class"
    keywords: "math"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_MATH

feature -- Access

    arc_cosine (v: DOUBLE): DOUBLE
            -- Trigonometric arccosine of radian v
            -- in the range [0, pi]
            -- (from DOUBLE_MATH)

    arc_sine (v: DOUBLE): DOUBLE
            -- Trigonometric arcsine of radian v
            -- in the range [-pi/2, +pi/2]
            -- (from DOUBLE_MATH)

    arc_tangent (v: DOUBLE): DOUBLE
            -- Trigonometric arctangent of radian v
            -- in the range [-pi/2, +pi/2]
            -- (from DOUBLE_MATH)

    ceiling (v: DOUBLE): DOUBLE
            -- Least integral greater than or equal to v
            -- (from DOUBLE_MATH)

    cosine (v: DOUBLE): DOUBLE
            -- Trigonometric cosine of radian v approximated
            -- in the range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)

    dabs (v: DOUBLE): DOUBLE
            -- Absolute of v
            -- (from DOUBLE_MATH)

    exp (x: DOUBLE): DOUBLE
            -- Exponential of v.
            -- (from DOUBLE_MATH)

    floor (v: DOUBLE): DOUBLE
            -- Greatest integral less than or equal to v
            -- (from DOUBLE_MATH)

    log (v: DOUBLE): DOUBLE
            -- Natural logarithm of v
            -- (from DOUBLE_MATH)

    log10 (v: DOUBLE): DOUBLE
            -- Base 10 logarithm of v
            -- (from DOUBLE_MATH)

    log_2 (v: DOUBLE): DOUBLE
            -- Base 2 logarithm of v
            -- (from DOUBLE_MATH)

    sine (v: DOUBLE): DOUBLE
            -- Trigonometric sine of radian v approximated
            -- in range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)

    sqrt (v: DOUBLE): DOUBLE
            -- Square root of v
            -- (from DOUBLE_MATH)

    tangent (v: DOUBLE): DOUBLE
            -- Trigonometric tangent of radian v approximated
            -- in range [-pi/4, +pi/4]
            -- (from DOUBLE_MATH)

feature -- Implementation

    between (n, a, b: INTEGER): BOOLEAN
            -- Is n a value between a and b?

    delta_x (angle: DOUBLE; length: INTEGER): INTEGER
            -- Get dx component of line segment with length and angle.

    delta_y (angle: DOUBLE; length: INTEGER): INTEGER
            -- Get dy component of line segment with length and angle.

    distance (x1, y1, x2, y2: INTEGER): INTEGER
            -- Calculate distance between (x1, y1) and (x2, y2).

    distance_from_line (x, y, x1, y1, x2, y2: INTEGER): INTEGER
            -- Calculate distance between (x, y) and (x1, y1)-(x2, y2).
            -- The line is considered to be infinite.

    line_angle (x1, y1, x2, y2: INTEGER): DOUBLE
            -- Return angle of line from (x2, y2) to (x1, y1).

    modulo (a, b: DOUBLE): DOUBLE
            -- a modulo b.
        require
            divisible: b /= 0.0
        ensure
            in_interval: Result >= 0.0 and Result < b

    point_on_ellipse (x, y, xc, yc, r1, r2: INTEGER): BOOLEAN
            -- Is (x, y) inside specified ellipse?

    point_on_ellipse_boundary (x, y, xc, yc, r1, r2, width: INTEGER): BOOLEAN
            -- Is (x, y) on specified ellipse border?

    point_on_line (x, y, x1, y1, x2, y2, width: INTEGER): BOOLEAN
            -- Is (x, y) on line from (x2, y2) to (x1, y1) with width?

    point_on_polygon (x, y: INTEGER; points: ARRAY [EV_COORDINATE]): BOOLEAN
            -- Is (x, y) contained in polygon with points?
            -- Based on code by Hanpeter van Vliet.

    point_on_rectangle (x, y, x1, y1, x2, y2: INTEGER): BOOLEAN
            -- Is (x, y) inside specified box?

    point_on_segment (x, y, x1, y1, x2, y2, width: INTEGER): BOOLEAN
            -- Is (x, y) on segment [(x2, y2), (x1, y1)] with width?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_FIGURE_MATH


EV_FIGURE_PICTURE Chart

class
    EV_FIGURE_PICTURE

General
    cluster: vision2.interface.figures
    description: "Pixmaps drawn on `point'."
    keywords: "figure, picture, pixmap"
    create: make_with_pixmap, make_with_point, default_create

Ancestors
    EV_ATOMIC_FIGURE
    EV_SINGLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    Default_pixmap: EV_PIXMAP
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    height: INTEGER
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_default_pixmap_used: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pixmap: EV_PIXMAP
    point: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    width: INTEGER
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_point (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show

Constraints
    pixmap exists


EV_FIGURE_PICTURE Flat contracts

indexing
    description: "Pixmaps drawn on `point'."
    status: "See notice at end of class"
    keywords: "figure, picture, pixmap"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_PICTURE

create

    default_create
            -- Create in (0, 0)

    make_with_point (a_point: EV_RELATIVE_POINT)
            -- Create on a_point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void

    make_with_pixmap (a_pixmap: EV_PIXMAP)
            -- Create with a_pixmap.
        require
            a_pixmap_not_void: a_pixmap /= void

feature -- Access

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    pixmap: EV_PIXMAP
            -- Ppixmap that is displayed.

    point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Current has one point.
            -- (from EV_SINGLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    height: INTEGER
            -- Height of Pixmap.
        ensure
            assigned: Result = pixmap.height

    is_default_pixmap_used: BOOLEAN
            -- Is Current using a default pixmap?

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    width: INTEGER
            -- Width of pixmap.
        ensure
            assigned: Result = pixmap.width

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Set pixmap to a_pixmap.
        require
            a_pixmap_not_void: a_pixmap /= void
        ensure
            pixmap_assigned: pixmap = a_pixmap

    set_point (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    default_pixmap: EV_PIXMAP
            -- Pixmap set by default_create.

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

    pixmap_exists: pixmap /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_PICTURE


EV_FIGURE_PIE_SLICE Chart

class
    EV_FIGURE_PIE_SLICE

General
    cluster: vision2.interface.figures
    description:
        "Slices from an ellipse with `center_point'. Size is determined by
        `aperture' [0..2*Pi]."
    keywords: "figure, slice, pizza, pie"
    create: make_with_points, default_create

Ancestors
    EV_CLOSED_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    aperture: DOUBLE
    background_color: EV_COLOR
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_filled: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    Pi: DOUBLE
    point_a: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_b: EV_RELATIVE_POINT
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    start_angle: DOUBLE
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_background_color
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_aperture (an_aperture: DOUBLE)
    set_background_color (a_color: EV_COLOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_start_angle (a_start_angle: DOUBLE)
    set_target_name (a_name: STRING)
    show

Constraints
    start angle within bounds
    aperture within bounds


EV_FIGURE_PIE_SLICE Flat contracts

indexing
    description: "Slices from an ellipse with `center_point'. Size is determined by`aperture' [0..2*Pi]."
    status: "See notice at end of class"
    keywords: "figure, slice, pizza, pie"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_PIE_SLICE

create

    default_create
            -- Create with some start_angle and aperture.

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

feature -- Access

    aperture: DOUBLE
            -- Angle that defines percentage of arc.

    background_color: EV_COLOR
            -- Color used to fill Current.
            -- (from EV_CLOSED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_a: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_b: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    start_angle: DOUBLE
            -- Angle that defines start of arc.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature  -- Access

    Pi: DOUBLE is 3.14159265358979323846
            -- (from MATH_CONST)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_filled: BOOLEAN
            -- Is this figure filled?
            -- (from EV_CLOSED_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    remove_background_color
            -- Do not fill this figure.
            -- (from EV_CLOSED_FIGURE)
        ensure -- from EV_CLOSED_FIGURE
            background_color_removed: background_color = void

    set_aperture (an_aperture: DOUBLE)
            -- Set aperture to an_aperture.
        require
            an_aperture_within_bounds: an_aperture >= 0 and an_aperture <= 2 * pi
        ensure
            aperture_assigned: aperture = an_aperture

    set_background_color (a_color: EV_COLOR)
            -- Set background_color to a_color.
            -- (from EV_CLOSED_FIGURE)
        require -- from EV_CLOSED_FIGURE
            a_color_exists: a_color /= void
        ensure -- from EV_CLOSED_FIGURE
            background_color_assigned: background_color = a_color

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point_a = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: point_b = a_point

    set_start_angle (a_start_angle: DOUBLE)
            -- Set start_angle to a_start_angle.
        require
            a_start_angle_within_bounds: a_start_angle >= 0 and a_start_angle <= 2 * pi
        ensure
            start_angle_assigned: start_angle = a_start_angle

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

    start_angle_within_bounds: start_angle >= 0 and then start_angle <= 2 * pi
    aperture_within_bounds: aperture >= 0 and then aperture <= 2 * pi
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_PIE_SLICE


EV_FIGURE_POLYGON Chart

class
    EV_FIGURE_POLYGON

General
    cluster: vision2.interface.figures
    description: "Filled area's defined by any number of `points'."
    keywords: "figure, polygon"
    create: make_with_coordinates, default_create

Ancestors
    EV_CLOSED_FIGURE
    EV_MULTI_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    background_color: EV_COLOR
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    i_th_point (i: INTEGER): EV_RELATIVE_POINT
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_filled: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    side_count: INTEGER
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    default_create
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    extend_point (a_point: EV_RELATIVE_POINT)
    hide
    remove_background_color
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_background_color (a_color: EV_COLOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_i_th_point (i: INTEGER; a_point: EV_RELATIVE_POINT)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_count (a_count: INTEGER)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_FIGURE_POLYGON Flat contracts

indexing
    description: "Filled area's defined by any number of `points'."
    status: "See notice at end of class"
    keywords: "figure, polygon"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_POLYGON

create

    default_create
            -- Create with default attributes.
            -- (from EV_CLOSED_FIGURE)

    make_with_coordinates (coords: ARRAY [EV_COORDINATE])
            -- Initialize with points in coords.
        require
            coords_exist: coords /= void

feature -- Initialization

    default_create
            -- Create with default attributes.
            -- (from EV_CLOSED_FIGURE)

feature -- Access

    background_color: EV_COLOR
            -- Color used to fill Current.
            -- (from EV_CLOSED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    i_th_point (i: INTEGER): EV_RELATIVE_POINT
            -- i-th point of Current.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            i_within_bounds: i > 0 and then i <= point_count
        ensure -- from EV_MULTI_POINTED_FIGURE
            correct_entry: Result = points.i_th (i)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Dynamic number of points in Current.
            -- (from EV_MULTI_POINTED_FIGURE)
        ensure -- from EV_MULTI_POINTED_FIGURE
            correct: points /= void implies Result = points.count

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_filled: BOOLEAN
            -- Is this figure filled?
            -- (from EV_CLOSED_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    side_count: INTEGER
            -- Returns number of sides this polyline has.
        ensure
            result_not_bigger_than_point_count: Result <= points.count

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    extend_point (a_point: EV_RELATIVE_POINT)
            -- Add a_point to end of Current.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_MULTI_POINTED_FIGURE
            incremented: points.count = old points.count + 1
            assigned: points.i_th (points.count) = a_point

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    remove_background_color
            -- Do not fill this figure.
            -- (from EV_CLOSED_FIGURE)
        ensure -- from EV_CLOSED_FIGURE
            background_color_removed: background_color = void

    set_background_color (a_color: EV_COLOR)
            -- Set background_color to a_color.
            -- (from EV_CLOSED_FIGURE)
        require -- from EV_CLOSED_FIGURE
            a_color_exists: a_color /= void
        ensure -- from EV_CLOSED_FIGURE
            background_color_assigned: background_color = a_color

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_i_th_point (i: INTEGER; a_point: EV_RELATIVE_POINT)
            -- Assign a_point to i-th point.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            i_within_bounds: i > 0 and then i <= point_count
            a_point_not_void: a_point /= void
        ensure -- from EV_MULTI_POINTED_FIGURE
            assigned: points.i_th (i) = a_point

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_count (a_count: INTEGER)
            -- Assign a_count to point_count.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            a_count_non_negative: a_count >= 0
        ensure -- from EV_MULTI_POINTED_FIGURE
            point_count_assigned: point_count = a_count

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) contained in this figure?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_POLYGON


EV_FIGURE_POLYLINE Chart

class
    EV_FIGURE_POLYLINE

General
    cluster: vision2.interface.figures
    description: "Sequences of lines through `points'."
    keywords: "figure, polyline, line"
    create: make_with_coordinates, default_create

Ancestors
    EV_ARROWED_FIGURE
    EV_ATOMIC_FIGURE
    EV_MULTI_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    Arrow_size: INTEGER
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    extract_line (index: INTEGER): EV_FIGURE_LINE
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    i_th_point (i: INTEGER): EV_RELATIVE_POINT
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_closed: BOOLEAN
    is_end_arrow: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    is_start_arrow: BOOLEAN
    line_count: INTEGER
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    default_create
    disable_capture
    disable_closed
    disable_dashed_line_style
    disable_end_arrow
    disable_sensitive
    disable_start_arrow
    enable_capture
    enable_closed
    enable_dashed_line_style
    enable_end_arrow
    enable_sensitive
    enable_start_arrow
    extend_point (a_point: EV_RELATIVE_POINT)
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_i_th_point (i: INTEGER; a_point: EV_RELATIVE_POINT)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_count (a_count: INTEGER)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_FIGURE_POLYLINE Flat contracts

indexing
    description: "Sequences of lines through `points'."
    status: "See notice at end of class"
    keywords: "figure, polyline, line"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_POLYLINE

create

    default_create
            -- Create with default attributes.
            -- (from EV_ATOMIC_FIGURE)

    make_with_coordinates (coords: ARRAY [EV_COORDINATE])
            -- Initialize with points in coords.
        require
            coords_exist: coords /= void

feature -- Initialization

    default_create
            -- Create with default attributes.
            -- (from EV_ATOMIC_FIGURE)

feature -- Access

    Arrow_size: INTEGER is 10
            -- (from EV_ARROWED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    i_th_point (i: INTEGER): EV_RELATIVE_POINT
            -- i-th point of Current.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            i_within_bounds: i > 0 and then i <= point_count
        ensure -- from EV_MULTI_POINTED_FIGURE
            correct_entry: Result = points.i_th (i)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_closed: BOOLEAN
            -- Should this polyline be closed?
            -- i.e. should first and last point be connected?

    is_end_arrow: BOOLEAN
            -- Does point_b have an arrow?
            -- (from EV_ARROWED_FIGURE)

    is_start_arrow: BOOLEAN
            -- Does point_a have an arrow?
            -- (from EV_ARROWED_FIGURE)

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Dynamic number of points in Current.
            -- (from EV_MULTI_POINTED_FIGURE)
        ensure -- from EV_MULTI_POINTED_FIGURE
            correct: points /= void implies Result = points.count

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    extract_line (index: INTEGER): EV_FIGURE_LINE
            -- Create a line-object for line with index.
        require
            index_within_bounds: index > 0 and then index <= line_count
        ensure
            result_exists: Result /= void

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    line_count: INTEGER
            -- Returns number of lines this polyline has.
        ensure
            result_not_bigger_than_point_count: Result <= points.count

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_closed
            -- Set is_closed False.
        ensure
            is_open: not is_closed

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_end_arrow
            -- Set is_end_arrow False.
            -- (from EV_ARROWED_FIGURE)

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    disable_start_arrow
            -- Set is_start_arrow False.
            -- (from EV_ARROWED_FIGURE)

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_closed
            -- Set is_closed True.
        ensure
            is_closed: is_closed

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_end_arrow
            -- Set is_end_arrow True.
            -- (from EV_ARROWED_FIGURE)

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    enable_start_arrow
            -- Set is_start_arrow True.
            -- (from EV_ARROWED_FIGURE)

    extend_point (a_point: EV_RELATIVE_POINT)
            -- Add a_point to end of Current.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_MULTI_POINTED_FIGURE
            incremented: points.count = old points.count + 1
            assigned: points.i_th (points.count) = a_point

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_i_th_point (i: INTEGER; a_point: EV_RELATIVE_POINT)
            -- Assign a_point to i-th point.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            i_within_bounds: i > 0 and then i <= point_count
            a_point_not_void: a_point /= void
        ensure -- from EV_MULTI_POINTED_FIGURE
            assigned: points.i_th (i) = a_point

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_count (a_count: INTEGER)
            -- Assign a_count to point_count.
            -- (from EV_MULTI_POINTED_FIGURE)
        require -- from EV_MULTI_POINTED_FIGURE
            a_count_non_negative: a_count >= 0
        ensure -- from EV_MULTI_POINTED_FIGURE
            point_count_assigned: point_count = a_count

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure? i.e. is it
            -- on any of lines of this polyline?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_POLYLINE


EV_FIGURE_POSTSCRIPT_DRAWER Chart

class
    EV_FIGURE_POSTSCRIPT_DRAWER

General
    cluster: vision2.interface.figures
    description: "Class for drawing of figures to postscript."
    keywords: "figure, primitives, drawing, postscript"

Ancestors
    EV_FIGURE_DRAWING_ROUTINES
    EV_POSTSCRIPT_PAGE_CONSTANTS

Queries
    A0: INTEGER
    A1: INTEGER
    A2: INTEGER
    A3: INTEGER
    A4: INTEGER
    A5: INTEGER
    A6: INTEGER
    A7: INTEGER
    A8: INTEGER
    A9: INTEGER
    B0: INTEGER
    B1: INTEGER
    B10: INTEGER
    B2: INTEGER
    B3: INTEGER
    B4: INTEGER
    B5: INTEGER
    B6: INTEGER
    B7: INTEGER
    B8: INTEGER
    B9: INTEGER
    bottom_margin: INTEGER
    C5envelope: INTEGER
    Comm10envelope: INTEGER
    Dlenvelope: INTEGER
    Executive: INTEGER
    Folio: INTEGER
    Ledger: INTEGER
    left_margin: INTEGER
    Legal: INTEGER
    Letter: INTEGER
    page_height (a_size: INTEGER; landscape: BOOLEAN): INTEGER
    page_width (a_size: INTEGER; landscape: BOOLEAN): INTEGER
    point_height: INTEGER
    point_width: INTEGER
    postscript_result: STRING
    Tabloid: INTEGER
    valid_page_size (a_size: INTEGER): BOOLEAN

Commands
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (rounded_rectangle: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)
    set_margins (a_left_margin, a_bottom_margin: INTEGER)
    set_page_size (a_size: INTEGER; landscape: BOOLEAN)


EV_FIGURE_POSTSCRIPT_DRAWER Flat contracts

indexing
    description: "Class for drawing of figures to postscript."
    status: "See notice at end of class"
    keywords: "figure, primitives, drawing, postscript"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_POSTSCRIPT_DRAWER

feature -- Access

    bottom_margin: INTEGER

    left_margin: INTEGER

    point_height: INTEGER

    point_width: INTEGER

    postscript_result: STRING

feature -- Status report

    page_height (a_size: INTEGER; landscape: BOOLEAN): INTEGER
            -- Return the page height in points (1 inch/72)
            -- for the specified page size and orientation.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)
        require -- from EV_POSTSCRIPT_PAGE_CONSTANTS
            valid_size: valid_page_size (a_size)

    page_width (a_size: INTEGER; landscape: BOOLEAN): INTEGER
            -- Return the page width in points (1 inch/72)
            -- for the specified page size and orientation.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)
        require -- from EV_POSTSCRIPT_PAGE_CONSTANTS
            valid_size: valid_page_size (a_size)

feature -- Status setting

    set_margins (a_left_margin, a_bottom_margin: INTEGER)
            -- Set left and bottom margins to a_left_margin
            -- and a_bottom_margin.

    set_page_size (a_size: INTEGER; landscape: BOOLEAN)
            -- Set horizontal and vertical dimensions of page.

feature -- Constants

    A0: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A1: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A2: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A3: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A4: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A5: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A6: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A7: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A8: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A9: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B0: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B1: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B10: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8 and b9.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B2: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B3: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B4: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B5: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B6: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B7: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B8: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B9: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    C5envelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Comm10envelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Dlenvelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Executive: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Folio: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Ledger: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Legal: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Letter: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Tabloid: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

feature -- Contract support

    valid_page_size (a_size: INTEGER): BOOLEAN
            -- Is a_size a valid page value?
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw standard representation of line to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (rounded_rectangle: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of rounded_rectangle to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
        require -- from EV_FIGURE_DRAWING_ROUTINES
            text_figure_not_void: text_figure /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_FIGURE_POSTSCRIPT_DRAWER


EV_FIGURE_RECTANGLE Chart

class
    EV_FIGURE_RECTANGLE

General
    cluster: vision2.interface.figures
    description: "Rectangular area defined by `point_a' and `point_b'."
    keywords: "figure, rectangle, square"
    create: make_with_points, default_create

Ancestors
    EV_CLOSED_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    background_color: EV_COLOR
    bounding_box: EV_RECTANGLE
    center: EV_COORDINATE
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    height: INTEGER
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_filled: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_a: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_b: EV_RELATIVE_POINT
    point_count: INTEGER
    pointer_style: EV_CURSOR
    polygon_array: ARRAY [EV_COORDINATE]
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    top_left: EV_COORDINATE
    width: INTEGER
    world: EV_FIGURE_WORLD

Commands
    default_create
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_background_color
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_background_color (a_color: EV_COLOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_FIGURE_RECTANGLE Flat contracts

indexing
    description: "Rectangular area defined by `point_a' and `point_b'."
    status: "See notice at end of class"
    keywords: "figure, rectangle, square"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_RECTANGLE

create

    default_create
            -- Create with default attributes.
            -- (from EV_CLOSED_FIGURE)

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

feature -- Initialization

    default_create
            -- Create with default attributes.
            -- (from EV_CLOSED_FIGURE)

feature -- Access

    background_color: EV_COLOR
            -- Color used to fill Current.
            -- (from EV_CLOSED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_a: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_b: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_filled: BOOLEAN
            -- Is this figure filled?
            -- (from EV_CLOSED_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status report

    center: EV_COORDINATE
            -- Center point of rectangle.

    height: INTEGER
            -- Height of rectangle.

    top_left: EV_COORDINATE
            -- Top-left coordinates of rectangle.

    width: INTEGER
            -- Width of rectangle.

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    remove_background_color
            -- Do not fill this figure.
            -- (from EV_CLOSED_FIGURE)
        ensure -- from EV_CLOSED_FIGURE
            background_color_removed: background_color = void

    set_background_color (a_color: EV_COLOR)
            -- Set background_color to a_color.
            -- (from EV_CLOSED_FIGURE)
        require -- from EV_CLOSED_FIGURE
            a_color_exists: a_color /= void
        ensure -- from EV_CLOSED_FIGURE
            background_color_assigned: background_color = a_color

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point_a = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: point_b = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    polygon_array: ARRAY [EV_COORDINATE]
            -- Array with four absolute corner points.

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_RECTANGLE


EV_FIGURE_ROUNDED_RECTANGLE Chart

class
    EV_FIGURE_ROUNDED_RECTANGLE

General
    cluster: vision2.interface.figures
    description: "Rectangular figures with rounded corners."
    keywords: "figure, rectangle, rounded, radius"
    create: make_with_points, default_create

Ancestors
    EV_CLOSED_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    background_color: EV_COLOR
    bounding_box: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_filled: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_a: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_b: EV_RELATIVE_POINT
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    radius: INTEGER
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_background_color
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_background_color (a_color: EV_COLOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_radius (a_radius: INTEGER)
    set_target_name (a_name: STRING)
    show

Constraints
    radius non negative


EV_FIGURE_ROUNDED_RECTANGLE Flat contracts

indexing
    description: "Rectangular figures with rounded corners."
    status: "See notice at end of class"
    keywords: "figure, rectangle, rounded, radius"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_ROUNDED_RECTANGLE

create

    default_create
            -- Create with radius 10.

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

feature -- Access

    background_color: EV_COLOR
            -- Color used to fill Current.
            -- (from EV_CLOSED_FIGURE)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point_a: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_b: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    radius: INTEGER
            -- Size in pixels of rounded corners.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_filled: BOOLEAN
            -- Is this figure filled?
            -- (from EV_CLOSED_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    remove_background_color
            -- Do not fill this figure.
            -- (from EV_CLOSED_FIGURE)
        ensure -- from EV_CLOSED_FIGURE
            background_color_removed: background_color = void

    set_background_color (a_color: EV_COLOR)
            -- Set background_color to a_color.
            -- (from EV_CLOSED_FIGURE)
        require -- from EV_CLOSED_FIGURE
            a_color_exists: a_color /= void
        ensure -- from EV_CLOSED_FIGURE
            background_color_assigned: background_color = a_color

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point_a = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: point_b = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

    set_radius (a_radius: INTEGER)
            -- Assign a_radius to radius.
        require
            a_radius_non_negative: a_radius >= 0
        ensure
            radius_assigned: radius = a_radius

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_void: Result /= void

invariant

    radius_non_negative: radius >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_ROUNDED_RECTANGLE


EV_FIGURE_STAR Chart

class
    EV_FIGURE_STAR

General
    cluster: vision2.interface.figures
    description:
        "`line_count' lines emerging from `center_point'.
        First line is from `center_point' to `corner_point."
    keywords: "figure, star, plus"
    create: make_with_points, default_create

Ancestors
    EV_ATOMIC_FIGURE
    EV_DOUBLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    bounding_box: EV_RECTANGLE
    center_point: EV_RELATIVE_POINT
    corner_point: EV_RELATIVE_POINT
    dashed_line_style: BOOLEAN
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_count: INTEGER
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    polygon_array: ARRAY [EV_COORDINATE]
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_foreground_color (a_color: EV_COLOR)
    set_line_count (n: INTEGER)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point_a (a_point: EV_RELATIVE_POINT)
    set_point_b (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show


EV_FIGURE_STAR Flat contracts

indexing
    description: "`line_count' lines emerging from `center_point'.First line is from `center_point' to `corner_point."
    status: "See notice at end of class"
    keywords: "figure, star, plus"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_STAR

create

    default_create
            -- Create with 6 lines.

    make_with_points (a_point_a, a_point_b: EV_RELATIVE_POINT)
            -- Create on a_point_a and a_point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_a_not_void: a_point_a /= void
            a_point_b_not_void: a_point_b /= void

feature -- Access

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_count: INTEGER
            -- Number of lines.

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    center_point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    corner_point: EV_RELATIVE_POINT
            -- Second point of Current.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    point_count: INTEGER
            -- Current has two points.
            -- (from EV_DOUBLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_count (n: INTEGER)
            -- Set line_count to n.
        require
            n_bigger_than_two: n > 2

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point_a (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: center_point = a_point

    set_point_b (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point_b.
            -- (from EV_DOUBLE_POINTED_FIGURE)
        require -- from EV_DOUBLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_DOUBLE_POINTED_FIGURE
            point_b_assigned: corner_point = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Implementation

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
        ensure -- from EV_FIGURE
            not_void: Result /= void

    polygon_array: ARRAY [EV_COORDINATE]
            -- Return all corner points.
        ensure
            result_correct_size: Result.count = line_count

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_STAR


EV_FIGURE_TEXT Chart

class
    EV_FIGURE_TEXT

General
    cluster: vision2.interface.figures
    description: "`text's in a `font' displayed on `point'."
    keywords: "figure, text, string"
    create: make_with_text, default_create

Ancestors
    EV_ATOMIC_FIGURE
    EV_FONT_CONSTANTS
    EV_SINGLE_POINTED_FIGURE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    dashed_line_style: BOOLEAN
    font: EV_FONT
    foreground_color: EV_COLOR
    group: EV_FIGURE_GROUP
    has_capture: BOOLEAN
    height: INTEGER
    id_object (an_id: INTEGER): IDENTIFIED
    intersects (r: EV_RECTANGLE): BOOLEAN
    is_default_font_used: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    object_id: INTEGER
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    target_name: STRING
    text: STRING
    valid_family (a_family: INTEGER): BOOLEAN
    valid_shape (a_shape: INTEGER): BOOLEAN
    valid_weight (a_weight: INTEGER): BOOLEAN
    width: INTEGER
    world: EV_FIGURE_WORLD

Commands
    disable_capture
    disable_dashed_line_style
    disable_sensitive
    enable_capture
    enable_dashed_line_style
    enable_sensitive
    hide
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_font (a_font: EV_FONT)
    set_foreground_color (a_color: EV_COLOR)
    set_line_width (a_width: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    show

Constraints
    text exists
    font exists


EV_FIGURE_TEXT Flat contracts

indexing
    description: "`text's in a `font' displayed on `point'."
    status: "See notice at end of class"
    keywords: "figure, text, string"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_TEXT

create

    default_create
            -- Create in (0, 0)

    make_with_text (a_text: STRING)
            -- Create with a_text.
        require
            a_text_not_void: a_text /= void

feature -- Access

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_ATOMIC_FIGURE)

    font: EV_FONT
            -- Typeface text is displayed in.

    foreground_color: EV_COLOR
            -- Color of text, lines, etc.
            -- (from EV_ATOMIC_FIGURE)

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    line_width: INTEGER
            -- Thickness of lines.
            -- (from EV_ATOMIC_FIGURE)

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Current has one point.
            -- (from EV_SINGLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text that is displayed.

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

feature -- Status report

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    height: INTEGER
            -- Vertical dimension.

    is_default_font_used: BOOLEAN
            -- Is Current using a default font?

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    width: INTEGER
            -- Horizontal dimension.

feature -- Status setting

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_disabled: not dashed_line_style

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_dashed_line_style
            -- Draw lines dashed.
            -- (from EV_ATOMIC_FIGURE)
        ensure -- from EV_ATOMIC_FIGURE
            dashed_line_style_enabled: dashed_line_style

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
        require
            a_font_not_void: a_font /= void
        ensure
            font_assigned: font = a_font

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_color_not_void: a_color /= void
        ensure -- from EV_ATOMIC_FIGURE
            foreground_color_assigned: foreground_color = a_color

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- (from EV_ATOMIC_FIGURE)
        require -- from EV_ATOMIC_FIGURE
            a_width_non_negative: a_width >= 0
        ensure -- from EV_ATOMIC_FIGURE
            line_width_assigned: line_width = a_width

    set_point (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_text (a_text: STRING)
            -- Assign a_text to text.
        require
            a_text_not_void: a_text /= void
        ensure
            text_assigned: text = a_text

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

feature -- Element change

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature  -- Contract support

    valid_family (a_family: INTEGER): BOOLEAN
            -- Is a_family a valid family value.
            -- (from EV_FONT_CONSTANTS)

    valid_shape (a_shape: INTEGER): BOOLEAN
            -- Is a_shape a valid shape value.
            -- (from EV_FONT_CONSTANTS)

    valid_weight (a_weight: INTEGER): BOOLEAN
            -- Is a_weight a valid weight value.
            -- (from EV_FONT_CONSTANTS)

feature -- Events

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?

invariant

    text_exists: text /= void
    font_exists: font /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ATOMIC_FIGURE
    foreground_color_exists: foreground_color /= void
    line_width_non_negative: line_width >= 0
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)

end -- class EV_FIGURE_TEXT


EV_FIGURE_WORLD Chart

class
    EV_FIGURE_WORLD

General
    cluster: vision2.interface.figures
    description:
        "Figure groups that are the root of a world of figures.
        May be interpreted by any kind of projection.
        Examples: may be output to a printer, saved to an XML file,
        drawn on a drawing area, etc."
    keywords: "figure, world, group, universe, system"
    create: default_create

Ancestors
    EV_FIGURE_GROUP

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): EV_FIGURE
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    bounding_box: EV_RECTANGLE
    capacity: INTEGER
    capture_figure: EV_FIGURE
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    Default_grid_x: INTEGER
    Default_grid_y: INTEGER
    duplicate (n: INTEGER): [like Current] EV_FIGURE_WORLD
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: EV_FIGURE
    for_all (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    grid_enabled: BOOLEAN
    grid_visible: BOOLEAN
    grid_x: INTEGER
    grid_y: INTEGER
    group: EV_FIGURE_GROUP
    has (v: EV_FIGURE): BOOLEAN
    has_capture: BOOLEAN
    i_th (i: INTEGER): EV_FIGURE
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_FIGURE; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    intersects (r: EV_RECTANGLE): BOOLEAN
    invalid_rectangle: EV_RECTANGLE
    is_empty: BOOLEAN
    is_inserted (v: EV_FIGURE): BOOLEAN
    is_redraw_needed: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] EV_FIGURE
    last: [like first] EV_FIGURE
    linear_representation: LINEAR [EV_FIGURE]
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_FIGURE): INTEGER
    off: BOOLEAN
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    points_visible: BOOLEAN
    position_on_figure (x, y: INTEGER): BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: EV_FIGURE): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
    update_rectangle: EV_RECTANGLE
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    world: EV_FIGURE_WORLD
    writable: BOOLEAN
    x_to_grid (a_x: INTEGER): INTEGER
    y_to_grid (a_y: INTEGER): INTEGER

Commands
    append (s: SEQUENCE [EV_FIGURE])
    back
    calculate_absolute_position
    compare_objects
    compare_references
    disable_capture
    disable_grid
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]]; test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN])
    enable_capture
    enable_grid
    enable_sensitive
    extend (v: [like item] EV_FIGURE)
    fill (other: CONTAINER [EV_FIGURE])
    finish
    force (v: [like item] EV_FIGURE)
    force_i_th (fig: [like item] EV_FIGURE; i: INTEGER)
    forth
    full_redraw
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    hide_grid
    hide_points
    insert (fig: [like item] EV_FIGURE; i: INTEGER)
    invalidate
    list_make (n: INTEGER)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [EV_FIGURE])
    merge_left (other: [like Current] EV_FIGURE_WORLD)
    merge_right (other: [like Current] EV_FIGURE_WORLD)
    move (i: INTEGER)
    prune (v: [like item] EV_FIGURE)
    prune_all (fig: [like item] EV_FIGURE)
    put (v: [like item] EV_FIGURE)
    put_front (v: [like item] EV_FIGURE)
    put_left (v: [like item] EV_FIGURE)
    put_right (v: [like item] EV_FIGURE)
    remove
    remove_capture_figure
    remove_left
    remove_pebble
    remove_right
    replace (fig: [like item] EV_FIGURE)
    search (v: [like item] EV_FIGURE)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_background_color (a_color: EV_COLOR)
    set_capture_figure (a_figure: EV_FIGURE)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_grid_x (new_grid_x: INTEGER)
    set_grid_y (new_grid_y: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_name (a_name: STRING)
    show
    show_grid
    show_points
    snap_to_grid
    start
    swap (i: INTEGER)
    validate
    wipe_out

Constraints
    background color exists


EV_FIGURE_WORLD Flat contracts

indexing
    description: "Figure groups that are the root of a world of figures.May be interpreted by any kind of projection.Examples: may be output to a printer, saved to an XML file,drawn on a drawing area, etc."
    status: "See notice at end of class"
    keywords: "figure, world, group, universe, system"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FIGURE_WORLD

create

    default_create
            -- Create with a white background.

feature -- Initialization

    list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [EV_FIGURE])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    background_color: EV_COLOR
            -- Color used to clear drawing device.
            -- Default: White.

    capture_figure: EV_FIGURE
            -- Figure that has mouse capture.

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    Default_grid_x: INTEGER is 20
            -- Default horizontal step of grid.

    Default_grid_y: INTEGER is 20
            -- Default vertical step of grid.

    first: EV_FIGURE
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    grid_enabled: BOOLEAN
            -- Should all move handles in world snap to grid?
            -- Default: False.

    grid_visible: BOOLEAN
            -- Display visual representation of  grid?
            -- Default: True.

    grid_x: INTEGER
            -- Horizontal step of grid.
            -- Default: Default_grid_x.

    grid_y: INTEGER
            -- Vertical step of grid.
            -- Default: Default_grid_x.

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    has (v: EV_FIGURE): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): EV_FIGURE
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_FIGURE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Current has one point.
            -- (from EV_SINGLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    points_visible: BOOLEAN
            -- Are all points in world visible?
            -- Used for debugging purposes.
            -- Default: False.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Current object.

    x_to_grid (a_x: INTEGER): INTEGER
            -- Nearest point on grid to absolute a_x.

    y_to_grid (a_y: INTEGER): INTEGER
            -- Nearest point on grid to absolute a_y.

    infix "@" (i: INTEGER): EV_FIGURE
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE_GROUP)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    invalid_rectangle: EV_RECTANGLE
            -- Rectangle that needs erasing.
            -- Void if no change is made.
            -- (from EV_FIGURE_GROUP)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_FIGURE): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    is_redraw_needed: BOOLEAN
            -- Does entire area need to be redrawn?
            -- This is the case when a figure is added or removed.

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    update_rectangle: EV_RECTANGLE
            -- Rectangle that needs redrawing.
            -- Void if no change is made.
            -- (from EV_FIGURE_GROUP)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_grid
            -- Set grid_enabled False.
        ensure
            grid_disabled: not grid_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_grid
            -- Set grid_enabled True.
        ensure
            grid_enabled: grid_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    full_redraw
            -- On next projection, mark entire area as invalid.

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    hide_grid
            -- Set grid_visible to False.
        ensure
            not_grid_visible: not grid_visible

    hide_points
            -- Set points_visible to False.
        ensure
            not_points_visible: not points_visible

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_point (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

    show_grid
            -- Set grid_visible to True.
        ensure
            grid_visible: grid_visible

    show_points
            -- Set points_visible to True.
        ensure
            points_visible: points_visible

    snap_to_grid
            -- Move all move handles to most nearby point on the grid.
            -- (from EV_FIGURE_GROUP)
        require -- from EV_FIGURE_GROUP
            world_not_void: world /= void
            grid_enabled: world.grid_enabled

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_FIGURE])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [EV_FIGURE])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    remove_capture_figure
            -- Set capture_figure to Void.
        require
            capture_figure_not_void: capture_figure /= void
        ensure
            removed: capture_figure = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_background_color (a_color: EV_COLOR)
            -- Assign a_color to background_color.
        require
            a_color_not_void: a_color /= void
        ensure
            assigned: background_color = a_color

    set_capture_figure (a_figure: EV_FIGURE)
            -- Set capture_figure to a_figure.
        require
            a_figure_not_void: a_figure /= void
        ensure
            assigned: capture_figure = a_figure

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_grid_x (new_grid_x: INTEGER)
            -- Assign new_grid_x to grid_x.
        require
            new_grid_x_positive: new_grid_x > 0
        ensure
            assigned: grid_x = new_grid_x

    set_grid_y (new_grid_y: INTEGER)
            -- Assign new_grid_y to grid_y.
        require
            new_grid_y_positive: new_grid_y > 0
        ensure
            assigned: grid_y = new_grid_y

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [EV_FIGURE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Events

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?
            -- Always returns False, but descendants can override
            -- it to improve efficiency.
            -- (from EV_FIGURE_GROUP)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]]; test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- List operations

    force_i_th (fig: like item; i: INTEGER)
            -- Add fig to the group.
            -- (from EV_FIGURE_GROUP)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count

    insert (fig: like item; i: INTEGER)
            -- Add fig to the group.
            -- (from EV_FIGURE_GROUP)
        require -- from ARRAYED_LIST
            index_small_enough: pos <= count
            index_large_enough: pos >= 1
        ensure -- from ARRAYED_LIST
            new_count: count = old count + 1
            index_unchanged: index = old index
            insertion_done: i_th (pos) = v

    merge_left (other: like Current)
            -- Merge other into group before cursor.
            -- other will be empty afterwards.
            -- (from EV_FIGURE_GROUP)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into group after cursor.
            -- other will be empty afterwards.
            -- (from EV_FIGURE_GROUP)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    prune_all (fig: like item)
            -- Remove fig from the group.
            -- (from EV_FIGURE_GROUP)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove item from figure.
            -- (from EV_FIGURE_GROUP)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    replace (fig: like item)
            -- Add fig to the group.
            -- (from EV_FIGURE_GROUP)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

    wipe_out
            -- Unreference all groups.
            -- (from EV_FIGURE_GROUP)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Recomputation

    calculate_absolute_position
            -- Recalculates all absolute positions inside this group.
            -- (from EV_FIGURE_GROUP)

    invalidate
            -- Some property of Current has changed.
            -- (from EV_FIGURE_GROUP)

    validate
            -- Invalidate Current.
            -- (from EV_FIGURE_GROUP)

invariant

    background_color_exists: background_color /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_FIGURE_WORLD


EV_MOVE_HANDLE Chart

class
    EV_MOVE_HANDLE

General
    cluster: vision2.interface.figures
    description:
        "Handles that allow the user to control certain EV_RELATIVE_POINTs
        in an EV_FIGURE_WORLD."
    keywords: "point, handle, move, resize, grab"

Ancestors
    EV_FIGURE_GROUP

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    end_actions: EV_NOTIFY_ACTION_SEQUENCE
    move_actions: EV_PND_START_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
    start_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): EV_FIGURE
    after: BOOLEAN
    before: BOOLEAN
    bounding_box: EV_RECTANGLE
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] EV_MOVE_HANDLE
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: EV_FIGURE
    for_all (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
    full: BOOLEAN
    group: EV_FIGURE_GROUP
    has (v: EV_FIGURE): BOOLEAN
    has_capture: BOOLEAN
    i_th (i: INTEGER): EV_FIGURE
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_FIGURE; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    intersects (r: EV_RECTANGLE): BOOLEAN
    invalid_rectangle: EV_RECTANGLE
    is_always_shown: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_FIGURE): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    is_snapping: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: [like first] EV_FIGURE
    last: [like first] EV_FIGURE
    linear_representation: LINEAR [EV_FIGURE]
    maximum_x: INTEGER
    maximum_y: INTEGER
    minimum_x: INTEGER
    minimum_y: INTEGER
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_FIGURE): INTEGER
    off: BOOLEAN
    orientation: DOUBLE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    point: EV_RELATIVE_POINT
    point_array: ARRAY [EV_COORDINATE]
    point_count: INTEGER
    pointer_style: EV_CURSOR
    position_on_figure (x, y: INTEGER): BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    real_position_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], TUPLE [INTEGER, INTEGER]]
    sequential_occurrences (v: EV_FIGURE): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
    update_rectangle: EV_RECTANGLE
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    world: EV_FIGURE_WORLD
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [EV_FIGURE])
    back
    calculate_absolute_position
    compare_objects
    compare_references
    disable_always_shown
    disable_capture
    disable_sensitive
    disable_snapping
    do_all (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]]; test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN])
    enable_always_shown
    enable_capture
    enable_sensitive
    enable_snapping
    extend (v: [like item] EV_FIGURE)
    fill (other: CONTAINER [EV_FIGURE])
    finish
    force (v: [like item] EV_FIGURE)
    force_i_th (fig: [like item] EV_FIGURE; i: INTEGER)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    insert (fig: [like item] EV_FIGURE; i: INTEGER)
    invalidate
    list_make (n: INTEGER)
    make_filled (n: INTEGER)
    make_from_array (a: ARRAY [EV_FIGURE])
    merge_left (other: [like Current] EV_MOVE_HANDLE)
    merge_right (other: [like Current] EV_MOVE_HANDLE)
    move (i: INTEGER)
    prune (v: [like item] EV_FIGURE)
    prune_all (fig: [like item] EV_FIGURE)
    put (v: [like item] EV_FIGURE)
    put_front (v: [like item] EV_FIGURE)
    put_left (v: [like item] EV_FIGURE)
    put_right (v: [like item] EV_FIGURE)
    remove
    remove_left
    remove_pebble
    remove_right
    replace (fig: [like item] EV_FIGURE)
    search (v: [like item] EV_FIGURE)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_maximum_x (a_x: INTEGER)
    set_maximum_y (a_y: INTEGER)
    set_minimum_x (a_x: INTEGER)
    set_minimum_y (a_y: INTEGER)
    set_origin (an_origin: EV_RELATIVE_POINT)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_point (a_point: EV_RELATIVE_POINT)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_real_position_agent (an_agent: [like real_position_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], TUPLE [INTEGER, INTEGER]])
    set_target_name (a_name: STRING)
    show
    snap_to_grid
    start
    swap (i: INTEGER)
    validate
    wipe_out


EV_MOVE_HANDLE Flat contracts

indexing
    description: "Handles that allow the user to control certain EV_RELATIVE_POINTsin an EV_FIGURE_WORLD."
    status: "See notice at end of class"
    keywords: "point, handle, move, resize, grab"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_MOVE_HANDLE

feature -- Initialization

    list_make (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before

    make_filled (n: INTEGER)
            -- Allocate list with n items.
            -- (n may be zero for empty list.)
            -- This list will be full.
            -- (from ARRAYED_LIST)
        require -- from ARRAYED_LIST
            valid_number_of_items: n >= 0
        ensure -- from ARRAYED_LIST
            correct_position: before
            filled: full

    make_from_array (a: ARRAY [EV_FIGURE])
            -- Create list from array a.
            -- (from ARRAYED_LIST)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from ARRAYED_LIST)

    first: EV_FIGURE
            -- Item at first position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    group: EV_FIGURE_GROUP
            -- Parent of Current.
            -- (from EV_FIGURE)

    has (v: EV_FIGURE): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Index of item, if valid.
            -- (from ARRAYED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: like first
            -- Current item
            -- (from ARRAYED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require else -- from ARRAYED_LIST
            index_is_valid: valid_index (index)

    i_th (i: INTEGER): EV_FIGURE
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of @.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

    last: like first
            -- Item at last position
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    maximum_x: INTEGER
            -- Right boundary.

    maximum_y: INTEGER
            -- Bottom boundary.

    minimum_x: INTEGER
            -- Left boundary.

    minimum_y: INTEGER
            -- Top boundary.

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_FIGURE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    orientation: DOUBLE
            -- Angle of first point of Current.
            -- (from EV_FIGURE)

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_FIGURE)

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- When not Void, pebble is ignored.
            -- (from EV_FIGURE)

    point: EV_RELATIVE_POINT
            -- First point of Current.
            -- (from EV_SINGLE_POINTED_FIGURE)

    point_array: ARRAY [EV_COORDINATE]
            -- points as absolute coordinates.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            same_length: Result.count = points.count

    point_count: INTEGER
            -- Current has one point.
            -- (from EV_SINGLE_POINTED_FIGURE)

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this figure.
            -- (from EV_FIGURE)

    real_position_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], TUPLE [INTEGER, INTEGER]]
            -- User defined function that translates actual coordinates to
            -- the coordinates Current will be displayed on.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    world: EV_FIGURE_WORLD
            -- Top-level parent of Current.
            -- (from EV_FIGURE)

    infix "@" (i: INTEGER): EV_FIGURE
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: array_valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from ARRAYED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature  -- Measurement

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    bounding_box: EV_RECTANGLE
            -- Smallest orthogonal rectangular area Current fits in.
            -- (from EV_FIGURE_GROUP)
        ensure -- from EV_FIGURE
            not_void: Result /= void

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from ARRAYED_LIST)

    has_capture: BOOLEAN
            -- Are all events sent to Current?
            -- (from EV_FIGURE)

    invalid_rectangle: EV_RECTANGLE
            -- Rectangle that needs erasing.
            -- Void if no change is made.
            -- (from EV_FIGURE_GROUP)

    is_always_shown: BOOLEAN
            -- Is figure always shown?
            -- (Or only when pointer over figure?)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_FIGURE): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from ARRAYED_LIST)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input?
            -- (from EV_FIGURE)

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- (from EV_FIGURE)

    is_snapping: BOOLEAN
            -- Does Current snap to grid when grid is enabled?
            -- Default: True

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from ARRAYED_LIST)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    update_rectangle: EV_RECTANGLE
            -- Rectangle that needs redrawing.
            -- Void if no change is made.
            -- (from EV_FIGURE_GROUP)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from ARRAYED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i a valid index?
            -- (from ARRAYED_LIST)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_always_shown
            -- Set is_always_shown False.
        ensure
            not_always_shown: not is_always_shown

    disable_capture
            -- Disable grab of all events on world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_released: not has_capture

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            insensitive_requested: not internal_is_sensitive

    disable_snapping
            -- Set is_snapping False.
        ensure
            snap_disabled: not is_snapping

    enable_always_shown
            -- Set is_always_shown True.
        ensure
            is_always_shown: is_always_shown

    enable_capture
            -- Grab all mouse events for world.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            in_world: world /= void
        ensure -- from EV_FIGURE
            capture_set: has_capture

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            sensitive_requested: internal_is_sensitive

    enable_snapping
            -- Set is_snapping True.
        ensure
            snap_enabled: is_snapping

    hide
            -- Request that Current not be displayed even when its group is.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            not_is_show_requested: not is_show_requested

    intersects (r: EV_RECTANGLE): BOOLEAN
            -- Does r intersect Currents bounding_box?
            -- (from EV_FIGURE)

    set_point (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
            -- (from EV_SINGLE_POINTED_FIGURE)
        require -- from EV_SINGLE_POINTED_FIGURE
            a_point_not_void: a_point /= void
        ensure -- from EV_SINGLE_POINTED_FIGURE
            point_assigned: point = a_point

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its group is.
            -- True by default.
            -- (from EV_FIGURE)
        ensure -- from EV_FIGURE
            is_show_requested: is_show_requested

    snap_to_grid
            -- Move to the most nearby point on the grid.
        require -- from EV_FIGURE_GROUP
            world_not_void: world /= void
            grid_enabled: world.grid_enabled

feature -- Cursor movement

    back
            -- Move cursor one position backward.
            -- (from ARRAYED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from ARRAYED_LIST
            before_when_empty: is_empty implies before

    forth
            -- Move cursor one position forward.
            -- (from ARRAYED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from ARRAYED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from ARRAYED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position if any.
            -- (from ARRAYED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from ARRAYED_LIST
            after_when_empty: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_FIGURE])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of force.
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [EV_FIGURE])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- Was declared in ARRAYED_LIST as synonym of extend.
            -- (from ARRAYED_LIST)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to the beginning.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1

    put_right (v: like item)
            -- Add v to the right of current position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_FIGURE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_maximum_x (a_x: INTEGER)
            -- Assign a_x to maximum_x.

    set_maximum_y (a_y: INTEGER)
            -- Assign a_y to maximum_y.

    set_minimum_x (a_x: INTEGER)
            -- Assign a_x to minimum_x.

    set_minimum_y (a_y: INTEGER)
            -- Assign a_y to minimum_y.

    set_origin (an_origin: EV_RELATIVE_POINT)
            -- Change origin of all points to o without moving.
            -- (from EV_FIGURE)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- (from EV_FIGURE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_FIGURE)
        require -- from EV_FIGURE
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_FIGURE
            pointer_style_assigned: pointer_style = a_cursor

    set_real_position_agent (an_agent: like real_position_agent)
            -- Assign an_agent to real_position_agent.
        require
            an_agent_not_void: an_agent /= void
        ensure
            real_position_agent_assigned: real_position_agent = an_agent

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- Move cursor to right neighbor.
            -- (or after if no right neighbor or v does not occur)
            -- (from ARRAYED_LIST)
        require -- from COLLECTION
            prunable: prunable

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position
            -- Do not move cursor
            -- (from ARRAYED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: array_valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [EV_FIGURE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    duplicate (n: INTEGER): like Current
            -- Copy of sub-list beginning at current position
            -- and having min (n, count - index + 1) items.
            -- (from ARRAYED_LIST)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Action sequences

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))
            -- (from EV_FIGURE)

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.
            -- (from EV_FIGURE)

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_FIGURE)

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_FIGURE)

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_FIGURE)

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_FIGURE)

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_FIGURE)

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_FIGURE)

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_FIGURE)

    proximity_in_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device comes into range.
            -- (from EV_FIGURE)

    proximity_out_actions: EV_PROXIMITY_ACTION_SEQUENCE
            -- Actions to be performed when pointing device goes out of range.
            -- (from EV_FIGURE)

feature -- Actions

    end_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions called when drag ends.

    move_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions called when user drags Current.

    start_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions called when drag starts.

feature -- Events

    position_on_figure (x, y: INTEGER): BOOLEAN
            -- Is (x, y) on this figure?
            -- Always returns False, but descendants can override
            -- it to improve efficiency.
            -- (from EV_FIGURE_GROUP)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_FIGURE]]; test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_FIGURE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- List operations

    force_i_th (fig: like item; i: INTEGER)
            -- Add fig to the group.
            -- (from EV_FIGURE_GROUP)
        ensure -- from ARRAY
            inserted: i_th (i) = v
            higher_count: count >= old count

    insert (fig: like item; i: INTEGER)
            -- Add fig to the group.
            -- (from EV_FIGURE_GROUP)
        require -- from ARRAYED_LIST
            index_small_enough: pos <= count
            index_large_enough: pos >= 1
        ensure -- from ARRAYED_LIST
            new_count: count = old count + 1
            index_unchanged: index = old index
            insertion_done: i_th (pos) = v

    merge_left (other: like Current)
            -- Merge other into group before cursor.
            -- other will be empty afterwards.
            -- (from EV_FIGURE_GROUP)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into group after cursor.
            -- other will be empty afterwards.
            -- (from EV_FIGURE_GROUP)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    prune_all (fig: like item)
            -- Remove fig from the group.
            -- (from EV_FIGURE_GROUP)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted
        ensure then -- from ARRAYED_LIST
            is_after: after

    remove
            -- Remove item from figure.
            -- (from EV_FIGURE_GROUP)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from ARRAYED_LIST
            index: index = old index

    replace (fig: like item)
            -- Add fig to the group.
            -- (from EV_FIGURE_GROUP)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

    wipe_out
            -- Unreference all groups.
            -- (from EV_FIGURE_GROUP)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Recomputation

    calculate_absolute_position
            -- Recalculates all absolute positions inside this group.
            -- (from EV_FIGURE_GROUP)

    invalidate
            -- Some property of Current has changed.
            -- (from EV_FIGURE_GROUP)

    validate
            -- Invalidate Current.
            -- (from EV_FIGURE_GROUP)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_FIGURE
    points_not_void: points /= void
    points_correct_size: points.count = point_count
    points_items_not_void: all_points_exist (points)
        -- from ARRAYED_LIST
    prunable: prunable
    starts_from_one: lower = 1
    empty_means_storage_empty: is_empty implies all_default
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_MOVE_HANDLE


EV_MULTI_POINTED_FIGURE Chart

deferred class
    EV_MULTI_POINTED_FIGURE

General
    cluster: vision2.interface.figures
    description: "Figures consisting of zero or more points."
    keywords: "figure, points"

Ancestors
    ANY

Queries
    i_th_point (i: INTEGER): EV_RELATIVE_POINT
    point_count: INTEGER

Commands
    extend_point (a_point: EV_RELATIVE_POINT)
    set_i_th_point (i: INTEGER; a_point: EV_RELATIVE_POINT)
    set_point_count (a_count: INTEGER)


EV_MULTI_POINTED_FIGURE Flat contracts

indexing
    description: "Figures consisting of zero or more points."
    status: "See notive at end of class"
    keywords: "figure, points"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_MULTI_POINTED_FIGURE

feature -- Access

    i_th_point (i: INTEGER): EV_RELATIVE_POINT
            -- i-th point of Current.
        require
            i_within_bounds: i > 0 and then i <= point_count
        ensure
            correct_entry: Result = points.i_th (i)

    point_count: INTEGER
            -- Dynamic number of points in Current.
        ensure
            correct: points /= void implies Result = points.count

feature -- Status setting

    extend_point (a_point: EV_RELATIVE_POINT)
            -- Add a_point to end of Current.
        require
            a_point_not_void: a_point /= void
        ensure
            incremented: points.count = old points.count + 1
            assigned: points.i_th (points.count) = a_point

    set_i_th_point (i: INTEGER; a_point: EV_RELATIVE_POINT)
            -- Assign a_point to i-th point.
        require
            i_within_bounds: i > 0 and then i <= point_count
            a_point_not_void: a_point /= void
        ensure
            assigned: points.i_th (i) = a_point

    set_point_count (a_count: INTEGER)
            -- Assign a_count to point_count.
        require
            a_count_non_negative: a_count >= 0
        ensure
            point_count_assigned: point_count = a_count

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_MULTI_POINTED_FIGURE


EV_PIXMAP_PROJECTOR Chart

class
    EV_PIXMAP_PROJECTOR

General
    cluster: vision2.interface.figures
    description: "Projectors that make representations of `world' on EV_PIXMAP."
    keywords: "figures, project, pointer, drawing, points"
    create: make_with_buffer, make

Ancestors
    EV_WIDGET_PROJECTOR

Queries
    area: EV_DRAWABLE
    area_x: INTEGER
    area_y: INTEGER
    buffer_used: BOOLEAN
    Default_colors: EV_STOCK_COLORS
    drawable: EV_DRAWABLE
    is_projecting: BOOLEAN
    world: EV_FIGURE_WORLD

Commands
    change_area_position (a_x, a_y: INTEGER)
    clear_device
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)
    draw_grid
    full_project
    project
    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
    set_drawable (a_drawable: EV_DRAWABLE)
    set_world (a_world: EV_FIGURE_WORLD)
    update_rectangle (u: EV_RECTANGLE; a_x, a_y: INTEGER)


EV_PIXMAP_PROJECTOR Flat contracts

indexing
    description: "Projectors that make representations of `world' on EV_PIXMAP."
    status: "See notice at end of class"
    keywords: "figures, project, pointer, drawing, points"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_PIXMAP_PROJECTOR

create

    make (a_world: EV_FIGURE_WORLD; a_pixmap: EV_PIXMAP)
            -- Create with a_world and a_pixmap.
        require
            a_world_not_void: a_world /= void
            a_pixmap_not_void: a_pixmap /= void

    make_with_buffer (a_world: EV_FIGURE_WORLD; a_buffer, a_pixmap: EV_PIXMAP)
            -- Create with a_world, a_pixmap and a_buffer.
        require
            a_world_not_void: a_world /= void
            a_pixmap_not_void: a_pixmap /= void
            a_buffer_not_void: a_buffer /= void

feature -- Access

    area: EV_DRAWABLE
            -- Area associated with widget.
            -- Void if no buffer is used.
            -- (from EV_WIDGET_PROJECTOR)

    area_x: INTEGER
            -- Coordinates of top-left corner of displayed part of drawable.
            -- (0, 0) when no buffer is used.
            -- Was declared in EV_WIDGET_PROJECTOR as synonym of area_y.
            -- (from EV_WIDGET_PROJECTOR)

    area_y: INTEGER
            -- Coordinates of top-left corner of displayed part of drawable.
            -- (0, 0) when no buffer is used.
            -- Was declared in EV_WIDGET_PROJECTOR as synonym of area_x.
            -- (from EV_WIDGET_PROJECTOR)

    drawable: EV_DRAWABLE
            -- Drawable surface (screen, drawing area or pixmap).
            -- (from EV_FIGURE_DRAWER)

    world: EV_FIGURE_WORLD
            -- Figure-world that will be projected.
            -- (from EV_PROJECTOR)

feature -- Status report

    buffer_used: BOOLEAN
            -- Is drawable only a buffer area for area?
            -- (from EV_WIDGET_PROJECTOR)

feature -- Status setting

    set_world (a_world: EV_FIGURE_WORLD)
            -- Set world to a_world.
            -- (from EV_PROJECTOR)
        require -- from EV_PROJECTOR
            a_world_exists: a_world /= void
        ensure -- from EV_PROJECTOR
            world_assigned: world = a_world

feature -- Element change

    change_area_position (a_x, a_y: INTEGER)
            -- area has moved to (a_x, a_y) of drawable.
            -- (from EV_WIDGET_PROJECTOR)
        require -- from EV_WIDGET_PROJECTOR
            valid_position: a_x >= 0 and a_y >= 0

feature -- Basic operations

    clear_device
            -- Erase entire canvas.
            -- (from EV_WIDGET_PROJECTOR)

    full_project
            -- Project entire area.
            -- (from EV_WIDGET_PROJECTOR)

    is_projecting: BOOLEAN
            -- Is a project currently being performed?
            -- Then, do not start a new one.
            -- (from EV_PROJECTION_ROUTINES)

    project
            -- Make a standard projection of world on device.
            -- (from EV_WIDGET_PROJECTOR)

    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Assign a_routine for drawing of a_figure.
            -- (from EV_PROJECTION_ROUTINES)

    update_rectangle (u: EV_RECTANGLE; a_x, a_y: INTEGER)
            -- Flush u on area at (a_x, a_y).
            -- (from EV_WIDGET_PROJECTOR)
        require -- from EV_WIDGET_PROJECTOR
            buffer_used: buffer_used

feature -- Implementation

    default_colors: EV_STOCK_COLORS
            -- Once access to EV_STOCK_COLORS.
            -- (from EV_PROJECTION_ROUTINES)

feature -- Basic Operations

    draw_grid
            -- Draw grid on canvas.
            -- world.point is the origin of the grid.
            -- (from EV_FIGURE_DRAWER)

feature -- Element Change

    set_drawable (a_drawable: EV_DRAWABLE)
            -- Set drawable to a_drawable.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWER
            a_drawable_not_void: a_drawable /= void
        ensure -- from EV_FIGURE_DRAWER
            assigned: drawable = a_drawable

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw standard representation of line to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of f to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            text_figure_not_void: text_figure /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PROJECTOR
    world_exists: world /= void
        -- from EV_FIGURE_DRAWER
    drawable_not_void: drawable /= void

end -- class EV_PIXMAP_PROJECTOR


EV_POSTSCRIPT_PROJECTOR Chart

class
    EV_POSTSCRIPT_PROJECTOR

General
    cluster: vision2.interface.figures
    description: "Projection to Postscript files."
    keywords: "projector, events, postscript"
    create: make_with_filename

Ancestors
    EV_FIGURE_POSTSCRIPT_DRAWER
    EV_PROJECTION_ROUTINES
    EV_PROJECTOR

Queries
    A0: INTEGER
    A1: INTEGER
    A2: INTEGER
    A3: INTEGER
    A4: INTEGER
    A5: INTEGER
    A6: INTEGER
    A7: INTEGER
    A8: INTEGER
    A9: INTEGER
    B0: INTEGER
    B1: INTEGER
    B10: INTEGER
    B2: INTEGER
    B3: INTEGER
    B4: INTEGER
    B5: INTEGER
    B6: INTEGER
    B7: INTEGER
    B8: INTEGER
    B9: INTEGER
    bottom_margin: INTEGER
    C5envelope: INTEGER
    Comm10envelope: INTEGER
    Dlenvelope: INTEGER
    Executive: INTEGER
    Folio: INTEGER
    is_projecting: BOOLEAN
    Ledger: INTEGER
    left_margin: INTEGER
    Legal: INTEGER
    Letter: INTEGER
    page_height (a_size: INTEGER; landscape: BOOLEAN): INTEGER
    page_width (a_size: INTEGER; landscape: BOOLEAN): INTEGER
    point_height: INTEGER
    point_width: INTEGER
    postscript_result: STRING
    Tabloid: INTEGER
    valid_page_size (a_size: INTEGER): BOOLEAN
    world: EV_FIGURE_WORLD

Commands
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (rounded_rectangle: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)
    project
    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
    set_margins (a_left_margin, a_bottom_margin: INTEGER)
    set_page_size (a_size: INTEGER; landscape: BOOLEAN)
    set_world (a_world: EV_FIGURE_WORLD)


EV_POSTSCRIPT_PROJECTOR Flat contracts

indexing
    description: "Projection to Postscript files."
    status: "See notice at end of class"
    keywords: "projector, events, postscript"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_POSTSCRIPT_PROJECTOR

create

    make_with_filename (a_world: EV_FIGURE_WORLD; a_filename: FILE_NAME)
            -- Create with a_world and a_filename.
        require
            a_world_not_void: a_world /= void
            a_filename_not_void: a_filename /= void

feature -- Access

    bottom_margin: INTEGER
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)

    left_margin: INTEGER
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)

    point_height: INTEGER
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)

    point_width: INTEGER
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)

    postscript_result: STRING
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)

    world: EV_FIGURE_WORLD
            -- Figure-world that will be projected.
            -- (from EV_PROJECTOR)

feature -- Status report

    page_height (a_size: INTEGER; landscape: BOOLEAN): INTEGER
            -- Return the page height in points (1 inch/72)
            -- for the specified page size and orientation.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)
        require -- from EV_POSTSCRIPT_PAGE_CONSTANTS
            valid_size: valid_page_size (a_size)

    page_width (a_size: INTEGER; landscape: BOOLEAN): INTEGER
            -- Return the page width in points (1 inch/72)
            -- for the specified page size and orientation.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)
        require -- from EV_POSTSCRIPT_PAGE_CONSTANTS
            valid_size: valid_page_size (a_size)

feature -- Status setting

    set_margins (a_left_margin, a_bottom_margin: INTEGER)
            -- Set left and bottom margins to a_left_margin
            -- and a_bottom_margin.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)

    set_page_size (a_size: INTEGER; landscape: BOOLEAN)
            -- Set horizontal and vertical dimensions of page.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)

    set_world (a_world: EV_FIGURE_WORLD)
            -- Set world to a_world.
            -- (from EV_PROJECTOR)
        require -- from EV_PROJECTOR
            a_world_exists: a_world /= void
        ensure -- from EV_PROJECTOR
            world_assigned: world = a_world

feature -- Basic operations

    is_projecting: BOOLEAN
            -- Is a project currently being performed?
            -- Then, do not start a new one.
            -- (from EV_PROJECTION_ROUTINES)

    project
            -- Make standard projection of world on device.

    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Assign a_routine for drawing of a_figure.
            -- (from EV_PROJECTION_ROUTINES)

feature -- Constants

    A0: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A1: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A2: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A3: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A4: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A5: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A6: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A7: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A8: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    A9: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B0: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B1: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B10: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8 and b9.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B2: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B3: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B4: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B5: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B6: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B7: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B8: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    B9: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    C5envelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Comm10envelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Dlenvelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Executive: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Folio: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Ledger: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Legal: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Letter: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

    Tabloid: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

feature -- Contract support

    valid_page_size (a_size: INTEGER): BOOLEAN
            -- Is a_size a valid page value?
            -- (from EV_POSTSCRIPT_PAGE_CONSTANTS)

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw standard representation of line to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (rounded_rectangle: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of rounded_rectangle to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
            -- (from EV_FIGURE_POSTSCRIPT_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            text_figure_not_void: text_figure /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PROJECTOR
    world_exists: world /= void

end -- class EV_POSTSCRIPT_PROJECTOR


EV_PROJECTION_ROUTINES Chart

deferred class
    EV_PROJECTION_ROUTINES

General
    cluster: vision2.interface.figures
    description: "Abstract class for figure projection routines."
    keywords: "projector, events, routines"

Ancestors
    EV_FIGURE_DRAWING_ROUTINES

Queries
    is_projecting: BOOLEAN

Commands
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)
    project
    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])


EV_PROJECTION_ROUTINES Flat contracts

indexing
    description: "Abstract class for figure projection routines."
    status: "See notice at end of class"
    keywords: "projector, events, routines"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_PROJECTION_ROUTINES

feature -- Basic operations

    is_projecting: BOOLEAN
            -- Is a project currently being performed?
            -- Then, do not start a new one.

    project
            -- Make standard projection of world on device.

    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Assign a_routine for drawing of a_figure.

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw a standard representation of line to the canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of f to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
            -- (from EV_FIGURE_DRAWING_ROUTINES)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            text_figure_not_void: text_figure /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_PROJECTION_ROUTINES


EV_PROJECTOR Chart

deferred class
    EV_PROJECTOR

General
    cluster: vision2.interface.figures
    description: "Viewers of EV_FIGURE_WORLDs."
    keywords: "projector, world, figure"

Ancestors
    ANY

Queries
    world: EV_FIGURE_WORLD

Commands
    set_world (a_world: EV_FIGURE_WORLD)

Constraints
    world exists


EV_PROJECTOR Flat contracts

indexing
    description: "Viewers of EV_FIGURE_WORLDs."
    status: "See notice at end of class"
    keywords: "projector, world, figure"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_PROJECTOR

feature -- Access

    world: EV_FIGURE_WORLD
            -- Figure-world that will be projected.

feature -- Status setting

    set_world (a_world: EV_FIGURE_WORLD)
            -- Set world to a_world.
        require
            a_world_exists: a_world /= void
        ensure
            world_assigned: world = a_world

invariant

    world_exists: world /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_PROJECTOR


EV_RELATIVE_POINT Chart

class
    EV_RELATIVE_POINT

General
    cluster: vision2.interface.figures
    description:
        "Positions relative to other positions.
        Takes another relative point as origin and then defines a
        hor. & vert. scaling factor, x, y and angle.
        You can then access absolute scale_x, scale_y, x, y and angle
        which are recomputed only if invalidate_absolute_position has
        been called.
        You may also choose to specify a positioner. This is an agent
        that gets called everytime a recomputation is requested.
        When a positioner is installed, the other attributes are ignored.
        The x and y are transformed by the angle and scaling of the origin.
        This implies that the scale_x, scale_y and angle features of this
        object are only for propagation to referring points."
    keywords: "point, position, location, origin"
    create: make_with_position, make_with_origin, default_create, make_with_positioner, make_with_origin_and_position

Ancestors
    EV_FIGURE_MATH
    IDENTIFIED

Queries
    absolute_coordinates: EV_COORDINATE
    angle: DOUBLE
    angle_abs: DOUBLE
    being_positioned: BOOLEAN
    has_positioner: BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    object_id: INTEGER
    origin: EV_RELATIVE_POINT
    out_abs: STRING
    out_rel: STRING
    positioner: PROCEDURE [ANY, TUPLE [[like Current] EV_RELATIVE_POINT]]
    relative_to (org: EV_RELATIVE_POINT): BOOLEAN
    scale_x: DOUBLE
    scale_x_abs: DOUBLE
    scale_y: DOUBLE
    scale_y_abs: DOUBLE
    x: INTEGER
    x_abs: INTEGER
    y: INTEGER
    y_abs: INTEGER

Commands
    change_origin (new_origin: EV_RELATIVE_POINT)
    set_angle (new_angle: DOUBLE)
    set_angle_abs (new_angle_abs: DOUBLE)
    set_origin (new_origin: EV_RELATIVE_POINT)
    set_position (new_x, new_y: INTEGER)
    set_positioner (pos_agent: [like positioner] PROCEDURE [ANY, TUPLE [[like Current] EV_RELATIVE_POINT]])
    set_scale (new_scale: DOUBLE)
    set_scale_x (new_scale_x: DOUBLE)
    set_scale_x_abs (new_scale_x_abs: DOUBLE)
    set_scale_y (new_scale_y: DOUBLE)
    set_scale_y_abs (new_scale_y_abs: DOUBLE)
    set_x (new_x: INTEGER)
    set_x_abs (new_x_abs: INTEGER)
    set_y (new_y: INTEGER)
    set_y_abs (new_y_abs: INTEGER)

Constraints
    notify list exists
    has origin implies origin notifies


EV_RELATIVE_POINT Flat contracts

indexing
    description: "Positions relative to other positions.Takes another relative point as origin and then defines ahor. & vert. scaling factor, x, y and angle.You can then access absolute scale_x, scale_y, x, y and anglewhich are recomputed only if invalidate_absolute_position hasbeen called.You may also choose to specify a positioner. This is an agentthat gets called everytime a recomputation is requested.When a positioner is installed, the other attributes are ignored.The x and y are transformed by the angle and scaling of the origin.This implies that the scale_x, scale_y and angle features of thisobject are only for propagation to referring points."
    status: "See notice at end of class"
    keywords: "point, position, location, origin"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_RELATIVE_POINT

create

    default_create
            -- Base origin.

    make_with_origin (an_origin: EV_RELATIVE_POINT)
            -- Create with an_origin on position (0, 0).

    make_with_origin_and_position (an_origin: EV_RELATIVE_POINT; new_x, new_y: INTEGER)
            -- Create with an_origin on position (new_x, new_y).

    make_with_position (new_x, new_y: INTEGER)
            -- Create on position (new_x, new_y).

    make_with_positioner (pos_agent: like positioner)
            -- Create with pos_agent.

feature -- Access

    absolute_coordinates: EV_COORDINATE
            -- Coordinates relative to (0, 0). Updates if necessary.

    angle: DOUBLE
            -- Angle in radians relative to origin.

    angle_abs: DOUBLE
            -- Angle relative to 0. Updates if necessary.
        ensure
            result_assigned: Result = last_angle_abs

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    origin: EV_RELATIVE_POINT
            -- Origin the position is relative to.
            -- If this is Void, x and y are relative to (0, 0).

    positioner: PROCEDURE [ANY, TUPLE [like Current]]
            -- Take special absolute positioning action.
            -- A positioner is expected to use the routines:
            -- set_x_abs, set_y_abs.
            -- set_angle_abs, set_scale_x_abs, set_scale_y_abs can be used too
            -- to propagate angle and scaling factor to referring points.

    scale_x: DOUBLE
            -- Relative horizontal scaling factor.

    scale_x_abs: DOUBLE
            -- Final horizontal scaling factor. Updates if necessary.
        ensure
            result_assigned: Result = last_scale_x_abs

    scale_y: DOUBLE
            -- Relative vertical scaling factor.

    scale_y_abs: DOUBLE
            -- Final vertical scaling factor. Updates if necessary.
        ensure
            result_assigned: Result = last_scale_y_abs

    x: INTEGER
            -- X-coordinate relative to origin.

    x_abs: INTEGER
            -- X relative to (0, 0). Updates if necessary.
        ensure
            result_assigned: Result = last_x_abs

    y: INTEGER
            -- Y-coordinate relative to origin.

    y_abs: INTEGER
            -- Y relative to (0, 0). Updates if necessary.
        ensure
            result_assigned: Result = last_y_abs

feature -- Status report

    being_positioned: BOOLEAN
            -- Used for cycle detection of positioning agents.

    has_positioner: BOOLEAN
            -- Is this point controlled by an agent?
        ensure
            result_assigned: Result = (positioner /= void)

    relative_to (org: EV_RELATIVE_POINT): BOOLEAN
            -- Does this point have org as origin somehow?
            -- This is not the case when it is being positioned.

feature -- Element change

    change_origin (new_origin: EV_RELATIVE_POINT)
            -- Set point this point is relative to.
            -- Do not change absolute coordinates if
            -- scaling factors and angle do not change.
        require
            new_origin_not_void: new_origin /= void
            no_dependance_circle: not new_origin.relative_to (Current)

    set_angle (new_angle: DOUBLE)
            -- Set angle of this point (in radians).

    set_angle_abs (new_angle_abs: DOUBLE)
            -- Change absolute angle.
        ensure
            last_angle_abs_assigned: last_angle_abs = new_angle_abs

    set_origin (new_origin: EV_RELATIVE_POINT)
            -- Set point this point is relative to.
        require
            new_origin_not_void: new_origin /= void
            no_dependance_circle: not new_origin.relative_to (Current) and new_origin /= Current

    set_position (new_x, new_y: INTEGER)
            -- Set both x and y.

    set_positioner (pos_agent: like positioner)
            -- Set a customized positioning routine.
        ensure
            positioner_assigned: positioner = pos_agent

    set_scale (new_scale: DOUBLE)
            -- Set relative scaling factor.

    set_scale_x (new_scale_x: DOUBLE)
            -- Set relative horizontal scaling factor.

    set_scale_x_abs (new_scale_x_abs: DOUBLE)
            -- Change absolute horizontal scaling factor.
        ensure
            last_scale_x_abs_assigned: last_scale_x_abs = new_scale_x_abs

    set_scale_y (new_scale_y: DOUBLE)
            -- Set relative vertical scaling factor.

    set_scale_y_abs (new_scale_y_abs: DOUBLE)
            -- Change absolute vertical scaling factor.
        ensure
            last_scale_y_abs_assigned: last_scale_y_abs = new_scale_y_abs

    set_x (new_x: INTEGER)
            -- Change relative horizontal position.

    set_x_abs (new_x_abs: INTEGER)
            -- Change absolute position.
        ensure
            last_x_abs_assigned: last_x_abs = new_x_abs

    set_y (new_y: INTEGER)
            -- Change relative vertical position.

    set_y_abs (new_y_abs: INTEGER)
            -- Change absolute position.
        ensure
            last_y_abs_assigned: last_y_abs = new_y_abs

feature -- Representation

    out_abs: STRING
            -- A string with absolute coordinates.

    out_rel: STRING
            -- A string with all relative coordinates of origins.

invariant

    notify_list_exists: notify_list_ids /= void
    has_origin_implies_origin_notifies: origin /= void implies origin.notify_list_ids.has (object_id)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_RELATIVE_POINT


EV_SINGLE_POINTED_FIGURE Chart

deferred class
    EV_SINGLE_POINTED_FIGURE

General
    cluster: vision2.interface.figures
    description: "Figures consisting of one point."
    keywords: "figure, point"

Ancestors
    ANY

Queries
    point: EV_RELATIVE_POINT
    point_count: INTEGER

Commands
    set_point (a_point: EV_RELATIVE_POINT)


EV_SINGLE_POINTED_FIGURE Flat contracts

indexing
    description: "Figures consisting of one point."
    status: "See notive at end of class"
    keywords: "figure, point"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_SINGLE_POINTED_FIGURE

feature -- Access

    point: EV_RELATIVE_POINT
            -- First point of Current.

    point_count: INTEGER
            -- Current has one point.

feature -- Status setting

    set_point (a_point: EV_RELATIVE_POINT)
            -- Assign a_point to point.
        require
            a_point_not_void: a_point /= void
        ensure
            point_assigned: point = a_point

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_SINGLE_POINTED_FIGURE


EV_WIDGET_PROJECTOR Chart

deferred class
    EV_WIDGET_PROJECTOR

General
    cluster: vision2.interface.figures
    description: "Projectors for widgets."
    keywords: "projector, events"

Ancestors
    EV_FIGURE_DRAWER
    EV_PROJECTION_ROUTINES
    EV_PROJECTOR

Queries
    area: EV_DRAWABLE
    area_x: INTEGER
    area_y: INTEGER
    buffer_used: BOOLEAN
    Default_colors: EV_STOCK_COLORS
    drawable: EV_DRAWABLE
    is_projecting: BOOLEAN
    widget: EV_WIDGET
    world: EV_FIGURE_WORLD

Commands
    change_area_position (a_x, a_y: INTEGER)
    clear_device
    draw_figure_arc (arc: EV_FIGURE_ARC)
    draw_figure_dot (dot: EV_FIGURE_DOT)
    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
    draw_figure_line (line: EV_FIGURE_LINE)
    draw_figure_picture (picture: EV_FIGURE_PICTURE)
    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
    draw_figure_star (star: EV_FIGURE_STAR)
    draw_figure_text (text_figure: EV_FIGURE_TEXT)
    draw_grid
    full_project
    project
    project_rectangle (u: EV_RECTANGLE)
    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
    set_drawable (a_drawable: EV_DRAWABLE)
    set_world (a_world: EV_FIGURE_WORLD)
    update_rectangle (u: EV_RECTANGLE; a_x, a_y: INTEGER)


EV_WIDGET_PROJECTOR Flat contracts

indexing
    description: "Projectors for widgets."
    status: "See notice at end of class"
    keywords: "projector, events"
    date: "$Date: 2001/07/12 18:30:36 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_WIDGET_PROJECTOR

feature -- Access

    area: EV_DRAWABLE
            -- Area associated with widget.
            -- Void if no buffer is used.

    area_x: INTEGER
            -- Coordinates of top-left corner of displayed part of drawable.
            -- (0, 0) when no buffer is used.
            -- Was declared in EV_WIDGET_PROJECTOR as synonym of area_y.

    area_y: INTEGER
            -- Coordinates of top-left corner of displayed part of drawable.
            -- (0, 0) when no buffer is used.
            -- Was declared in EV_WIDGET_PROJECTOR as synonym of area_x.

    drawable: EV_DRAWABLE
            -- Drawable surface (screen, drawing area or pixmap).
            -- (from EV_FIGURE_DRAWER)

    widget: EV_WIDGET
            -- device if conforms to EV_WIDGET.
            -- Void otherwise.

    world: EV_FIGURE_WORLD
            -- Figure-world that will be projected.
            -- (from EV_PROJECTOR)

feature -- Status report

    buffer_used: BOOLEAN
            -- Is drawable only a buffer area for area?

feature -- Status setting

    set_world (a_world: EV_FIGURE_WORLD)
            -- Set world to a_world.
            -- (from EV_PROJECTOR)
        require -- from EV_PROJECTOR
            a_world_exists: a_world /= void
        ensure -- from EV_PROJECTOR
            world_assigned: world = a_world

feature -- Element change

    change_area_position (a_x, a_y: INTEGER)
            -- area has moved to (a_x, a_y) of drawable.
        require
            valid_position: a_x >= 0 and a_y >= 0

feature -- Basic operations

    clear_device
            -- Erase entire canvas.

    full_project
            -- Project entire area.

    is_projecting: BOOLEAN
            -- Is a project currently being performed?
            -- Then, do not start a new one.
            -- (from EV_PROJECTION_ROUTINES)

    project
            -- Make a standard projection of world on device.

    project_rectangle (u: EV_RECTANGLE)
            -- Project area under u.

    register_figure (a_figure: EV_FIGURE; a_routine: PROCEDURE [ANY, TUPLE [EV_FIGURE]])
            -- Assign a_routine for drawing of a_figure.
            -- (from EV_PROJECTION_ROUTINES)

    update_rectangle (u: EV_RECTANGLE; a_x, a_y: INTEGER)
            -- Flush u on area at (a_x, a_y).
        require
            buffer_used: buffer_used

feature -- Implementation

    default_colors: EV_STOCK_COLORS
            -- Once access to EV_STOCK_COLORS.
            -- (from EV_PROJECTION_ROUTINES)

feature -- Basic Operations

    draw_grid
            -- Draw grid on canvas.
            -- world.point is the origin of the grid.
            -- (from EV_FIGURE_DRAWER)

feature -- Element Change

    set_drawable (a_drawable: EV_DRAWABLE)
            -- Set drawable to a_drawable.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWER
            a_drawable_not_void: a_drawable /= void
        ensure -- from EV_FIGURE_DRAWER
            assigned: drawable = a_drawable

feature -- Figure drawing

    draw_figure_arc (arc: EV_FIGURE_ARC)
            -- Draw standard representation of arc to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            arc_not_void: arc /= void

    draw_figure_dot (dot: EV_FIGURE_DOT)
            -- Draw standard representation of dot to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            dot_not_void: dot /= void

    draw_figure_ellipse (ellipse: EV_FIGURE_ELLIPSE)
            -- Draw standard representation of ellipse to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            ellipse_not_void: ellipse /= void

    draw_figure_equilateral (eql: EV_FIGURE_EQUILATERAL)
            -- Draw standard representation of eql to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            eql_not_void: eql /= void

    draw_figure_line (line: EV_FIGURE_LINE)
            -- Draw standard representation of line to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_picture (picture: EV_FIGURE_PICTURE)
            -- Draw standard representation of picture to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            picture_not_void: picture /= void

    draw_figure_pie_slice (slice: EV_FIGURE_PIE_SLICE)
            -- Draw standard representation of slice to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            slice_not_void: slice /= void

    draw_figure_polygon (polygon: EV_FIGURE_POLYGON)
            -- Draw standard representation of polygon to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            polygon_not_void: polygon /= void

    draw_figure_polyline (line: EV_FIGURE_POLYLINE)
            -- Draw standard representation of polyline to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            line_not_void: line /= void

    draw_figure_rectangle (rectangle: EV_FIGURE_RECTANGLE)
            -- Draw standard representation of rectangle to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            rectangle_not_void: rectangle /= void

    draw_figure_rounded_rectangle (f: EV_FIGURE_ROUNDED_RECTANGLE)
            -- Draw standard representation of f to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            f_not_void: f /= void

    draw_figure_star (star: EV_FIGURE_STAR)
            -- Draw standard representation of star to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            star_not_void: star /= void

    draw_figure_text (text_figure: EV_FIGURE_TEXT)
            -- Draw standard representation of text_figure to canvas.
            -- (from EV_FIGURE_DRAWER)
        require -- from EV_FIGURE_DRAWING_ROUTINES
            text_figure_not_void: text_figure /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PROJECTOR
    world_exists: world /= void
        -- from EV_FIGURE_DRAWER
    drawable_not_void: drawable /= void

end -- class EV_WIDGET_PROJECTOR


cluster vision2.interface.items

Cluster
    vision2.interface.items

Supercluster
    vision2.interface

Subclusters

Classes
    EV_CHECK_MENU_ITEM
    EV_DYNAMIC_TREE_ITEM
    EV_ITEM
    EV_LIST_ITEM
    EV_MENU
    EV_MENU_BAR
    EV_MENU_ITEM
    EV_MENU_SEPARATOR
    EV_MULTI_COLUMN_LIST_ROW
    EV_RADIO_MENU_ITEM
    EV_TOOL_BAR_BUTTON
    EV_TOOL_BAR_ITEM
    EV_TOOL_BAR_RADIO_BUTTON
    EV_TOOL_BAR_SELECT_BUTTON
    EV_TOOL_BAR_SEPARATOR
    EV_TOOL_BAR_TOGGLE_BUTTON
    EV_TREE_ITEM
    EV_TREE_NODE


EV_CHECK_MENU_ITEM Chart

class
    EV_CHECK_MENU_ITEM

General
    cluster: vision2.interface.items
    description: "Menu item with a check box."
    keywords: "menu, item, check, select, deselect, uncheck"
    create: make_with_text, make_with_text_and_action, default_create

Ancestors
    EV_DESELECTABLE
    EV_MENU_ITEM

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_ITEM_LIST [EV_ITEM]
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING
    text: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_CHECK_MENU_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    disable_select
    disable_sensitive
    enable_pebble_positioning
    enable_select
    enable_sensitive
    remove_pebble
    remove_pixmap
    remove_text
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    toggle


EV_CHECK_MENU_ITEM Flat contracts

indexing
    description: "Menu item with a check box."
    status: "See notice at end of class"
    keywords: "menu, item, check, select, deselect, uncheck"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_CHECK_MENU_ITEM

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_text_and_action (a_text: STRING; an_action: PROCEDURE [ANY, TUPLE])
            -- Create with 'a_text' and an_action in select_actions.
            -- (from EV_MENU_ITEM)
        require -- from EV_MENU_ITEM
            text_not_void: a_text /= void
            an_action_not_void: an_action /= void
        ensure -- from EV_MENU_ITEM
            text_assigned: text.is_equal (a_text)
            select_actions_has_an_action: select_actions.has (an_action)

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_ITEM_LIST [EV_ITEM]
            -- Item list containing Current.
            -- (from EV_ITEM)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

feature -- Status report

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_MENU_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_MENU_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected

end -- class EV_CHECK_MENU_ITEM


EV_DYNAMIC_TREE_ITEM Chart

class
    EV_DYNAMIC_TREE_ITEM

General
    cluster: vision2.interface.items
    description: "Dynamically expandable tree item."
    keywords: "tree, item, dynamic"
    create: make_with_text, make_with_function, default_create

Ancestors
    EV_TREE_NODE

Action sequences
    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    after: BOOLEAN
    alignment: EV_TEXT_ALIGNMENT
    changeable_comparison_criterion: BOOLEAN
    data: ANY
    Default_subtree_function_timeout: INTEGER
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    find_item_recursively_by_data (v: ANY): EV_TREE_NODE
    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    has (v: [like item] EV_TREE_NODE): BOOLEAN
    has_recursively (an_item: [like item] EV_TREE_NODE): BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_TREE_NODE; i: INTEGER): INTEGER
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_expandable: BOOLEAN
    is_expanded: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    item: EV_TREE_NODE
    linear_representation: LINEAR [EV_TREE_NODE]
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: EV_TREE_NODE): INTEGER
    off: BOOLEAN
    parent: EV_TREE_NODE_CONTAINER
    parent_tree: EV_TREE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    subtree_function: FUNCTION [ANY, TUPLE, LINEAR [EV_TREE_NODE]]
    subtree_function_timeout: INTEGER
    target_name: STRING
    text: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    tooltip: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    collapse
    compare_objects
    compare_references
    copy (other: [like Current] EV_DYNAMIC_TREE_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    disable_select
    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
    enable_pebble_positioning
    enable_select
    expand
    finish
    forth
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    search (v: [like item] EV_TREE_NODE)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_subtree_function (a_subtree_function: [like subtree_function] FUNCTION [ANY, TUPLE, LINEAR [EV_TREE_NODE]])
    set_subtree_function_timeout (a_timeout: [like subtree_function_timeout] INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    start
    subtree_function_call
    toggle


EV_DYNAMIC_TREE_ITEM Flat contracts

indexing
    description: "Dynamically expandable tree item."
    status: "See notice at end of file"
    keywords: "tree, item, dynamic"
    date: "11/4/1999"
    revision: "$Revision: 1.2 $"

class interface
    EV_DYNAMIC_TREE_ITEM

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_function (a_subtree_function: like subtree_function)
            -- Create with a_subtree_function.

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    Default_subtree_function_timeout: INTEGER is 1000
            -- 1 second.

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    find_item_recursively_by_data (v: ANY): EV_TREE_NODE
            -- An item at any level in tree that has data.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursively (an_item: like item): BOOLEAN
            -- Does Current contain an_item at any level?
            -- (from EV_TREE_NODE)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Index of current position.

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: EV_TREE_NODE
            -- Item at current position
        require -- from TRAVERSABLE
            not_off: not off

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    occurrences (v: EV_TREE_NODE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)

    parent: EV_TREE_NODE_CONTAINER
            -- Parent of Current.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    parent_tree: EV_TREE
            -- Contains Current.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    set_subtree_function (a_subtree_function: like subtree_function)
            -- Assign a_subtree_function to subtree_function.
        require
            not_destroyed: not is_destroyed

    set_subtree_function_timeout (a_timeout: like subtree_function_timeout)
            -- Assign a_timeout to subtree_function_timeout.
        require
            not_destroyed: not is_destroyed

    subtree_function: FUNCTION [ANY, TUPLE, LINEAR [EV_TREE_NODE]]
            -- Tree items contained.

    subtree_function_call
            -- Call subtree_function if it has not been called in the last
            -- subtree_function_timeout milliseconds.
        require
            not_destroyed: not is_destroyed

    subtree_function_timeout: INTEGER
            -- Time in milliseconds, after subtree_function.call, when
            -- subtree_function.last_result is considered to have expired.
            -- There is no guarantee that subtree_function will be recalled
            -- after this timeout, but Vision will not call it twice within
            -- one timeout period.
            -- Default is 1 second.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?

    is_expanded: BOOLEAN
            -- Are items in Current displayed?
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    collapse
            -- Set is_expanded False.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed
            parent_tree_not_void: parent_tree /= void
            is_collapsable: is_expandable
        ensure -- from EV_TREE_NODE
            not_is_expanded: not is_expanded

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    expand
            -- Set is_expanded True.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed
            parent_tree_not_void: parent_tree /= void
            is_expandable: is_expandable
        ensure -- from EV_TREE_NODE
            is_expanded: is_expanded

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Cursor movement

    finish
            -- Move to last position.

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position if any.

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Conversion

    linear_representation: LINEAR [EV_TREE_NODE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_expandable: BOOLEAN
            -- Is Current able to expand or collapse.
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

feature -- Event handling

    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when collapsed.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when expanded.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

end -- class EV_DYNAMIC_TREE_ITEM


EV_ITEM Chart

deferred class
    EV_ITEM

General
    cluster: vision2.interface.items
    description: "Base class for all items that may be held in EV_ITEM_LISTs."
    keywords: "item"

Ancestors
    EV_CONTAINABLE
    EV_ITEM_ACTION_SEQUENCES
    EV_PICK_AND_DROPABLE
    EV_PIXMAPABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    data: ANY
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_ITEM_LIST [EV_ITEM]
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING

Commands
    copy (other: [like Current] EV_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    enable_pebble_positioning
    remove_pebble
    remove_pixmap
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)


EV_ITEM Flat contracts

indexing
    description: "Base class for all items that may be held in EV_ITEM_LISTs."
    status: "See notice at end of class."
    keywords: "item"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_ITEM

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_ITEM_LIST [EV_ITEM]
            -- Item list containing Current.
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Status report

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_ITEM


EV_LIST_ITEM Chart

class
    EV_LIST_ITEM

General
    cluster: vision2.interface.items
    description: "Item for use in EV_LIST and EV_COMBO_BOX."
    keywords: "list, item, combo"
    create: make_with_text, default_create

Ancestors
    EV_DESELECTABLE
    EV_ITEM
    EV_LIST_ITEM_ACTION_SEQUENCES
    EV_TEXTABLE
    EV_TOOLTIPABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_ITEM_LIST [EV_ITEM]
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING
    text: STRING
    tooltip: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_LIST_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    disable_select
    enable_pebble_positioning
    enable_select
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    toggle


EV_LIST_ITEM Flat contracts

indexing
    description: "Item for use in EV_LIST and EV_COMBO_BOX."
    status: "See notice at end of class"
    keywords: "list, item, combo"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_LIST_ITEM

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_ITEM_LIST [EV_ITEM]
            -- Item list containing Current.
            -- (from EV_ITEM)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Status report

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
            -- (from EV_LIST_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_LIST_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected

end -- class EV_LIST_ITEM


EV_MENU_BAR Chart

class
    EV_MENU_BAR

General
    cluster: vision2.interface.items
    description: "Menu bar containing drop down menus. See EV_MENU."
    keywords: "menu, bar, item, file, edit, help"
    create: default_create

Ancestors
    EV_MENU_ITEM_LIST

Action sequences
    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_MENU_ITEM
    after: BOOLEAN
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MENU_ITEM]
    data: ANY
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_MENU_ITEM
    for_all (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] EV_MENU_ITEM): BOOLEAN
    i_th (i: INTEGER): EV_MENU_ITEM
    index: INTEGER
    index_of (v: [like item] EV_MENU_ITEM; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_MENU_BAR): BOOLEAN
    is_inserted (v: EV_MENU_ITEM): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_MENU_ITEM
    item_by_data (some_data: ANY): [like item] EV_MENU_ITEM
    last: [like item] EV_MENU_ITEM
    linear_representation: LINEAR [EV_MENU_ITEM]
    object_comparison: BOOLEAN
    occurrences (v: [like item] EV_MENU_ITEM): INTEGER
    off: BOOLEAN
    parent: EV_WINDOW
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    sequential_occurrences (v: EV_MENU_ITEM): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [EV_MENU_ITEM])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_MENU_BAR)
    default_create
    destroy
    do_all (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN])
    extend (v: [like item] EV_MENU_ITEM)
    fill (other: CONTAINER [EV_MENU_ITEM])
    finish
    force (v: [like item] EV_MENU_ITEM)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] EV_MENU_BAR)
    merge_right (other: [like Current] EV_MENU_BAR)
    move (i: INTEGER)
    prune (v: [like item] EV_MENU_ITEM)
    prune_all (v: [like item] EV_MENU_ITEM)
    put (v: [like item] EV_MENU_ITEM)
    put_front (v: [like item] EV_MENU_ITEM)
    put_i_th (v: [like item] EV_MENU_ITEM; i: INTEGER)
    put_left (v: [like item] EV_MENU_ITEM)
    put_right (v: [like item] EV_MENU_ITEM)
    remove
    remove_left
    remove_right
    replace (v: [like item] EV_MENU_ITEM)
    search (v: [like item] EV_MENU_ITEM)
    set_data (some_data: [like data] ANY)
    start
    swap (i: INTEGER)
    wipe_out


EV_MENU_BAR Flat contracts

indexing
    description: "Menu bar containing drop down menus. See EV_MENU."
    status: "See notice at end of class"
    keywords: "menu, bar, item, file, edit, help"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_MENU_BAR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MENU_ITEM]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): EV_MENU_ITEM
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    item: EV_MENU_ITEM
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: EV_MENU_ITEM): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_MENU_ITEM): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    parent: EV_WINDOW
            -- Parent of Current.

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_MENU_ITEM])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_MENU_ITEM])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_MENU_ITEM]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE
            -- Actions to be performed when a menu item is selected.
            -- (from EV_MENU_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_MENU_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_MENU_ITEM_LIST
    item_select_actions_not_void: is_usable implies item_select_actions /= void
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_MENU_BAR


EV_MENU Chart

class
    EV_MENU

General
    cluster: vision2.interface.items
    description: "Drop down menu containing EV_MENU_ITEMs"
    keywords: "menu, bar, drop down, popup"
    create: make_with_text, make_with_text_and_action, default_create

Ancestors
    EV_MENU_ITEM
    EV_MENU_ITEM_LIST

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_MENU_ITEM
    accept_cursor: EV_CURSOR
    after: BOOLEAN
    alignment: EV_TEXT_ALIGNMENT
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MENU_ITEM]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_MENU_ITEM
    for_all (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] EV_MENU_ITEM): BOOLEAN
    i_th (i: INTEGER): EV_MENU_ITEM
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_MENU_ITEM; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_MENU): BOOLEAN
    is_inserted (v: EV_MENU_ITEM): BOOLEAN
    is_parent_recursive (a_list: EV_MENU_ITEM_LIST): BOOLEAN
    is_sensitive: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_MENU_ITEM
    item_by_data (some_data: ANY): [like item] EV_MENU_ITEM
    last: [like item] EV_MENU_ITEM
    linear_representation: LINEAR [EV_MENU_ITEM]
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_MENU_ITEM): INTEGER
    off: BOOLEAN
    parent: EV_MENU_ITEM_LIST
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    sequential_occurrences (v: EV_MENU_ITEM): INTEGER
    target_name: STRING
    text: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    align_text_center
    align_text_left
    align_text_right
    append (s: SEQUENCE [EV_MENU_ITEM])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_MENU)
    default_create
    destroy
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN])
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_MENU_ITEM)
    fill (other: CONTAINER [EV_MENU_ITEM])
    finish
    force (v: [like item] EV_MENU_ITEM)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] EV_MENU)
    merge_right (other: [like Current] EV_MENU)
    move (i: INTEGER)
    prune (v: [like item] EV_MENU_ITEM)
    prune_all (v: [like item] EV_MENU_ITEM)
    put (v: [like item] EV_MENU_ITEM)
    put_front (v: [like item] EV_MENU_ITEM)
    put_i_th (v: [like item] EV_MENU_ITEM; i: INTEGER)
    put_left (v: [like item] EV_MENU_ITEM)
    put_right (v: [like item] EV_MENU_ITEM)
    remove
    remove_left
    remove_pebble
    remove_pixmap
    remove_right
    remove_text
    replace (v: [like item] EV_MENU_ITEM)
    search (v: [like item] EV_MENU_ITEM)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    show
    show_at (a_widget: EV_WIDGET; a_x, a_y: INTEGER)
    start
    swap (i: INTEGER)
    wipe_out


EV_MENU Flat contracts

indexing
    description: "Drop down menu containing EV_MENU_ITEMs"
    status: "See notice at end of class"
    keywords: "menu, bar, drop down, popup"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_MENU

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_text_and_action (a_text: STRING; an_action: PROCEDURE [ANY, TUPLE])
            -- Create with 'a_text' and an_action in select_actions.
            -- (from EV_MENU_ITEM)
        require -- from EV_MENU_ITEM
            text_not_void: a_text /= void
            an_action_not_void: an_action /= void
        ensure -- from EV_MENU_ITEM
            text_assigned: text.is_equal (a_text)
            select_actions_has_an_action: select_actions.has (an_action)

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MENU_ITEM]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): EV_MENU_ITEM
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    item: EV_MENU_ITEM
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_MENU_ITEM): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_MENU_ITEM): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    parent: EV_MENU_ITEM_LIST
            -- Menu item list containing Current.
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_MENU_ITEM])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_MENU_ITEM])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_MENU_ITEM]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_parent_recursive (a_list: EV_MENU_ITEM_LIST): BOOLEAN
            -- Is Current present in a_list hierarchy?
            -- (from EV_MENU_ITEM_LIST)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE
            -- Actions to be performed when a menu item is selected.
            -- (from EV_MENU_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_MENU_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_MENU_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_MENU_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Standard operations

    show
            -- Pop up on the current pointer position.
        require
            not_destroyed: not is_destroyed

    show_at (a_widget: EV_WIDGET; a_x, a_y: INTEGER)
            -- Pop up on a_x, a_y relative to the top-left corner
            -- of a_widget.
        require
            not_destroyed: not is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_MENU_ITEM_LIST
    item_select_actions_not_void: is_usable implies item_select_actions /= void
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_MENU


EV_MENU_ITEM Chart

class
    EV_MENU_ITEM

General
    cluster: vision2.interface.items
    description: "Item for use in EV_MENU."
    keywords: "menu, item, dropdown, popup"
    create: make_with_text, make_with_text_and_action, default_create

Ancestors
    EV_ITEM
    EV_MENU_ITEM_ACTION_SEQUENCES
    EV_SENSITIVE
    EV_TEXTABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_sensitive: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_ITEM_LIST [EV_ITEM]
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING
    text: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_MENU_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    disable_sensitive
    enable_pebble_positioning
    enable_sensitive
    remove_pebble
    remove_pixmap
    remove_text
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)


EV_MENU_ITEM Flat contracts

indexing
    description: "Item for use in EV_MENU."
    note: "Single ampersands in text are not shown in the actualwidget. If you need an ampersand in your text,use && instead. The character following the & maybe a shortcut to this widget (combined with Alt)&File -> File (Alt+F = shortcut)Fish && Chips -> Fish & Chips (no shortcut)."
    status: "See notice at end of class"
    keywords: "menu, item, dropdown, popup"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_MENU_ITEM

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_text_and_action (a_text: STRING; an_action: PROCEDURE [ANY, TUPLE])
            -- Create with 'a_text' and an_action in select_actions.
        require
            text_not_void: a_text /= void
            an_action_not_void: an_action /= void
        ensure
            text_assigned: text.is_equal (a_text)
            select_actions_has_an_action: select_actions.has (an_action)

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_ITEM_LIST [EV_ITEM]
            -- Item list containing Current.
            -- (from EV_ITEM)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

feature -- Status report

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_MENU_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_MENU_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_MENU_ITEM


EV_MENU_SEPARATOR Chart

class
    EV_MENU_SEPARATOR

General
    cluster: vision2.interface.items
    description: "Horizontal scored line separator for use in EV_MENU."
    keywords: "menu, item, separator"
    create: default_create

Ancestors
    EV_MENU_ITEM


EV_MULTI_COLUMN_LIST_ROW Chart

class
    EV_MULTI_COLUMN_LIST_ROW

General
    cluster: vision2.interface.items
    description: "Row item for use in EV_MULTI_COLUMN_LIST"
    keywords: "multi column list, row, item, select"
    create: default_create

Ancestors
    EV_DESELECTABLE
    EV_ITEM
    EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES
    EV_PICK_AND_DROPABLE
    EV_PIXMAPABLE
    INTERACTIVE_LIST [G]

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] STRING
    accept_cursor: EV_CURSOR
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    data: ANY
    deny_cursor: EV_CURSOR
    duplicate (n: INTEGER): [like Current] EV_MULTI_COLUMN_LIST_ROW
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] STRING
    for_all (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] STRING): BOOLEAN
    i_th (i: INTEGER): [like item] STRING
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] STRING; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_MULTI_COLUMN_LIST_ROW): BOOLEAN
    is_inserted (v: STRING): BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: STRING
    last: [like item] STRING
    linear_representation: LINEAR [STRING]
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] STRING): INTEGER
    off: BOOLEAN
    parent: EV_ITEM_LIST [EV_ITEM]
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: STRING): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [STRING])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_MULTI_COLUMN_LIST_ROW)
    default_create
    destroy
    disable_pebble_positioning
    disable_select
    do_all (action: PROCEDURE [ANY, TUPLE [STRING]])
    do_if (action: PROCEDURE [ANY, TUPLE [STRING]]; test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN])
    enable_pebble_positioning
    enable_select
    extend (v: [like item] STRING)
    fill (other: CONTAINER [STRING])
    finish
    force (v: [like item] STRING)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] EV_MULTI_COLUMN_LIST_ROW)
    merge_right (other: [like Current] EV_MULTI_COLUMN_LIST_ROW)
    move (i: INTEGER)
    prune (v: [like item] STRING)
    prune_all (v: [like item] STRING)
    put (v: [like item] STRING)
    put_front (v: [like item] STRING)
    put_i_th (v: [like item] STRING; i: INTEGER)
    put_left (v: [like item] STRING)
    put_right (v: [like item] STRING)
    remove
    remove_left
    remove_pebble
    remove_pixmap
    remove_right
    replace (v: [like item] STRING)
    search (v: [like item] STRING)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    start
    swap (i: INTEGER)
    toggle
    wipe_out


EV_MULTI_COLUMN_LIST_ROW Flat contracts

indexing
    description: "Row item for use in EV_MULTI_COLUMN_LIST"
    status: "See notice at end of class"
    keywords: "multi column list, row, item, select"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_MULTI_COLUMN_LIST_ROW

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: STRING
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: STRING): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_ITEM_LIST [EV_ITEM]
            -- Item list containing Current.
            -- (from EV_ITEM)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: STRING): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [STRING])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    fill (other: CONTAINER [STRING])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [STRING]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Element Change

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
            -- (from EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES)
        ensure -- from EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES)
        ensure -- from EV_MULTI_COLUMN_LIST_ROW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [STRING]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [STRING]]; test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [STRING], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from INTERACTIVE_LIST
    consistency_count_equal_to_count: consistency_count = count
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected

end -- class EV_MULTI_COLUMN_LIST_ROW


EV_RADIO_MENU_ITEM Chart

class
    EV_RADIO_MENU_ITEM

General
    cluster: vision2.interface.items
    description:
        "Menu item with state displayed as a circular check box.
        `is_selected' is mutually exclusive with respect to other radio menuitems between separators in a menu."
    keywords: "radio, item, menu, check, select, unselect"
    create: make_with_text, make_with_text_and_action, default_create

Ancestors
    EV_MENU_ITEM
    EV_RADIO_PEER
    EV_SELECTABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_ITEM_LIST [EV_ITEM]
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    peers: LINKED_LIST [[like Current] EV_RADIO_MENU_ITEM]
    pixmap: EV_PIXMAP
    selected_peer: [like Current] EV_RADIO_MENU_ITEM
    target_name: STRING
    text: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_RADIO_MENU_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    disable_sensitive
    enable_pebble_positioning
    enable_select
    enable_sensitive
    remove_pebble
    remove_pixmap
    remove_text
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)


EV_RADIO_MENU_ITEM Flat contracts

indexing
    description: "Menu item with state displayed as a circular check box.`is_selected' is mutually exclusive with respect to other radio menuitems between separators in a menu."
    status: "See notice at end of class"
    keywords: "radio, item, menu, check, select, unselect"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_RADIO_MENU_ITEM

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_text_and_action (a_text: STRING; an_action: PROCEDURE [ANY, TUPLE])
            -- Create with 'a_text' and an_action in select_actions.
            -- (from EV_MENU_ITEM)
        require -- from EV_MENU_ITEM
            text_not_void: a_text /= void
            an_action_not_void: an_action /= void
        ensure -- from EV_MENU_ITEM
            text_assigned: text.is_equal (a_text)
            select_actions_has_an_action: select_actions.has (an_action)

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_ITEM_LIST [EV_ITEM]
            -- Item list containing Current.
            -- (from EV_ITEM)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

feature -- Status report

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    peers: LINKED_LIST [like Current]
            -- All radio items in the group Current is in.
            -- Includes Current.
            -- (from EV_RADIO_PEER)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        ensure -- from EV_RADIO_PEER
            not_void: Result /= void
            bridge_ok: Result.count = implementation.peers.count

    selected_peer: like Current
            -- Item in peers that is currently selected.
            -- (from EV_RADIO_PEER)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        ensure -- from EV_RADIO_PEER
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.selected_peer)

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_RADIO_PEER
            selected_peer_is_current: selected_peer = Current
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_MENU_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_MENU_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_RADIO_PEER
    peers_not_void: peers /= void
    selected_peer_not_void: selected_peer /= void
    peers_returns_new_copy_of_list: peers /= peers
    peers_has_current: peers.has (Current)
    is_selected_equals_selected_peer_is_current: is_selected = (selected_peer = Current)
    one_radio_item_selected: selected_count = 1

end -- class EV_RADIO_MENU_ITEM


EV_TOOL_BAR_BUTTON Chart

class
    EV_TOOL_BAR_BUTTON

General
    cluster: vision2.interface.items
    description: "Press button for use with EV_TOOL_BAR"
    create: make_with_text, default_create

Ancestors
    EV_ITEM
    EV_PICK_AND_DROPABLE
    EV_SENSITIVE
    EV_TEXTABLE
    EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES
    EV_TOOL_BAR_ITEM
    EV_TOOLTIPABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    gray_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_sensitive: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_TOOL_BAR
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING
    text: STRING
    tooltip: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_TOOL_BAR_BUTTON)
    default_create
    destroy
    disable_pebble_positioning
    disable_sensitive
    enable_pebble_positioning
    enable_sensitive
    remove_gray_pixmap
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)


EV_TOOL_BAR_BUTTON Flat contracts

indexing
    description: "Press button for use with EV_TOOL_BAR"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_TOOL_BAR_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    gray_pixmap: EV_PIXMAP
            -- Gray image displayed when the button is not hot
            -- i.e. when the mouse cursor is not over it.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: (Result = void and implementation.gray_pixmap = void) or Result.is_equal (implementation.gray_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_TOOL_BAR
            -- Parent of the current item.
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Status report

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    remove_gray_pixmap
            -- Make gray_pixmap Void.
        require
            not_destroyed: not is_destroyed
        ensure
            gray_pixmap_remove: gray_pixmap = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
            -- Assign a_gray_pixmap to gray_pixmap.
        require
            not_destroyed: not is_destroyed
            gray_pixmap_not_void: a_gray_pixmap /= void
        ensure
            pixmap_assigned: a_gray_pixmap.is_equal (gray_pixmap) and gray_pixmap /= a_gray_pixmap

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_TOOL_BAR_BUTTON


EV_TOOL_BAR_ITEM Chart

deferred class
    EV_TOOL_BAR_ITEM

General
    cluster: vision2.interface.items
    description: "Base class for items for use with EV_TOOL_BAR"

Ancestors
    EV_ITEM

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    data: ANY
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_TOOL_BAR
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING

Commands
    copy (other: [like Current] EV_TOOL_BAR_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    enable_pebble_positioning
    remove_pebble
    remove_pixmap
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)


EV_TOOL_BAR_ITEM Flat contracts

indexing
    description: "Base class for items for use with EV_TOOL_BAR"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_TOOL_BAR_ITEM

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_TOOL_BAR
            -- Contains Current.
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Status report

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_TOOL_BAR_ITEM


EV_TOOL_BAR_RADIO_BUTTON Chart

class
    EV_TOOL_BAR_RADIO_BUTTON

General
    cluster: vision2.interface.items
    description:
        "Toggle button for use with EV_TOOL_BAR.
        `is_selected' is mutualy exclusive with respect to other tool barradio buttons between separators in a tool bar."
    keywords: "toggle, button, tool, bar"
    create: make_with_text, default_create

Ancestors
    EV_RADIO_PEER
    EV_SELECTABLE
    EV_TOOL_BAR_BUTTON

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    gray_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_TOOL_BAR
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    peers: LINKED_LIST [[like Current] EV_TOOL_BAR_RADIO_BUTTON]
    pixmap: EV_PIXMAP
    selected_peer: [like Current] EV_TOOL_BAR_RADIO_BUTTON
    target_name: STRING
    text: STRING
    tooltip: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_TOOL_BAR_RADIO_BUTTON)
    default_create
    destroy
    disable_pebble_positioning
    disable_sensitive
    enable_pebble_positioning
    enable_select
    enable_sensitive
    remove_gray_pixmap
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)


EV_TOOL_BAR_RADIO_BUTTON Flat contracts

indexing
    description: "Toggle button for use with EV_TOOL_BAR.`is_selected' is mutualy exclusive with respect to other tool barradio buttons between separators in a tool bar."
    status: "See notice at end of class."
    keywords: "toggle, button, tool, bar"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_TOOL_BAR_RADIO_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    gray_pixmap: EV_PIXMAP
            -- Gray image displayed when the button is not hot
            -- i.e. when the mouse cursor is not over it.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOL_BAR_BUTTON
            bridge_ok: (Result = void and implementation.gray_pixmap = void) or Result.is_equal (implementation.gray_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_TOOL_BAR
            -- Parent of the current item.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Status report

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    peers: LINKED_LIST [like Current]
            -- All radio items in the group Current is in.
            -- Includes Current.
            -- (from EV_RADIO_PEER)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        ensure -- from EV_RADIO_PEER
            not_void: Result /= void
            bridge_ok: Result.count = implementation.peers.count

    selected_peer: like Current
            -- Item in peers that is currently selected.
            -- (from EV_RADIO_PEER)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        ensure -- from EV_RADIO_PEER
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.selected_peer)

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_RADIO_PEER
            selected_peer_is_current: selected_peer = Current
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    remove_gray_pixmap
            -- Make gray_pixmap Void.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOL_BAR_BUTTON
            gray_pixmap_remove: gray_pixmap = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
            -- Assign a_gray_pixmap to gray_pixmap.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
            gray_pixmap_not_void: a_gray_pixmap /= void
        ensure -- from EV_TOOL_BAR_BUTTON
            pixmap_assigned: a_gray_pixmap.is_equal (gray_pixmap) and gray_pixmap /= a_gray_pixmap

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_RADIO_PEER
    peers_not_void: peers /= void
    selected_peer_not_void: selected_peer /= void
    peers_returns_new_copy_of_list: peers /= peers
    peers_has_current: peers.has (Current)
    is_selected_equals_selected_peer_is_current: is_selected = (selected_peer = Current)
    one_radio_item_selected: selected_count = 1

end -- class EV_TOOL_BAR_RADIO_BUTTON


EV_TOOL_BAR_SELECT_BUTTON Chart

deferred class
    EV_TOOL_BAR_SELECT_BUTTON

General
    cluster: vision2.interface.items
    description: "Base class for tool bar buttons that have two states (See is_selected)"
    keywords: "state, toggle, button"

Ancestors
    EV_TOOL_BAR_BUTTON

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    gray_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_TOOL_BAR
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING
    text: STRING
    tooltip: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_TOOL_BAR_SELECT_BUTTON)
    default_create
    destroy
    disable_pebble_positioning
    disable_sensitive
    enable_pebble_positioning
    enable_select
    enable_sensitive
    remove_gray_pixmap
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)


EV_TOOL_BAR_SELECT_BUTTON Flat contracts

indexing
    description: "Base class for tool bar buttons that have two states (See is_selected)"
    status: "See notice at end of class."
    keywords: "state, toggle, button"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_TOOL_BAR_SELECT_BUTTON

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    gray_pixmap: EV_PIXMAP
            -- Gray image displayed when the button is not hot
            -- i.e. when the mouse cursor is not over it.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOL_BAR_BUTTON
            bridge_ok: (Result = void and implementation.gray_pixmap = void) or Result.is_equal (implementation.gray_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_TOOL_BAR
            -- Parent of the current item.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Status report

    is_selected: BOOLEAN
            -- Is button depressed?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Set is_selected True.
        require
            not_destroyed: not is_destroyed
        ensure
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    remove_gray_pixmap
            -- Make gray_pixmap Void.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOL_BAR_BUTTON
            gray_pixmap_remove: gray_pixmap = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
            -- Assign a_gray_pixmap to gray_pixmap.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
            gray_pixmap_not_void: a_gray_pixmap /= void
        ensure -- from EV_TOOL_BAR_BUTTON
            pixmap_assigned: a_gray_pixmap.is_equal (gray_pixmap) and gray_pixmap /= a_gray_pixmap

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_TOOL_BAR_SELECT_BUTTON


EV_TOOL_BAR_SEPARATOR Chart

class
    EV_TOOL_BAR_SEPARATOR

General
    cluster: vision2.interface.items
    description: "Scored line separator for use in EV_TOOL_BAR."
    keywords: "separator, tool, bar, line, devide"
    create: default_create

Ancestors
    EV_TOOL_BAR_ITEM


EV_TOOL_BAR_TOGGLE_BUTTON Chart

class
    EV_TOOL_BAR_TOGGLE_BUTTON

General
    cluster: vision2.interface.items
    description: "Button for use with EV_TOOL_BAR that toggles between states each timeit is pressed"
    keywords: "tool, bar, toggle, button"
    create: make_with_text, default_create

Ancestors
    EV_DESELECTABLE
    EV_TOOL_BAR_BUTTON

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    deny_cursor: EV_CURSOR
    gray_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_TOOL_BAR
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING
    text: STRING
    tooltip: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_TOOL_BAR_TOGGLE_BUTTON)
    default_create
    destroy
    disable_pebble_positioning
    disable_select
    disable_sensitive
    enable_pebble_positioning
    enable_select
    enable_sensitive
    remove_gray_pixmap
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    toggle


EV_TOOL_BAR_TOGGLE_BUTTON Flat contracts

indexing
    description: "Button for use with EV_TOOL_BAR that toggles between states each timeit is pressed"
    status: "See notice at end of class."
    keywords: "tool, bar, toggle, button"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_TOOL_BAR_TOGGLE_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    gray_pixmap: EV_PIXMAP
            -- Gray image displayed when the button is not hot
            -- i.e. when the mouse cursor is not over it.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOL_BAR_BUTTON
            bridge_ok: (Result = void and implementation.gray_pixmap = void) or Result.is_equal (implementation.gray_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_TOOL_BAR
            -- Parent of the current item.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_ITEM
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Status report

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Element change

    remove_gray_pixmap
            -- Make gray_pixmap Void.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOL_BAR_BUTTON
            gray_pixmap_remove: gray_pixmap = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_gray_pixmap (a_gray_pixmap: EV_PIXMAP)
            -- Assign a_gray_pixmap to gray_pixmap.
            -- (from EV_TOOL_BAR_BUTTON)
        require -- from EV_TOOL_BAR_BUTTON
            not_destroyed: not is_destroyed
            gray_pixmap_not_void: a_gray_pixmap /= void
        ensure -- from EV_TOOL_BAR_BUTTON
            pixmap_assigned: a_gray_pixmap.is_equal (gray_pixmap) and gray_pixmap /= a_gray_pixmap

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_TOOL_BAR_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected

end -- class EV_TOOL_BAR_TOGGLE_BUTTON


EV_TREE_ITEM Chart

class
    EV_TREE_ITEM

General
    cluster: vision2.interface.items
    description:
        "Item for use with EV_TREE.
        A tree item is also a tree-item container because ifwe create a tree-item with a tree-item as parent, theparent will become a subtree."
    keywords: "tree, item, leaf, node, branch"
    create: make_with_text, default_create

Ancestors
    EV_TREE_NODE
    EV_TREE_NODE_LIST

Action sequences
    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_TREE_NODE
    accept_cursor: EV_CURSOR
    after: BOOLEAN
    alignment: EV_TEXT_ALIGNMENT
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TREE_NODE]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    find_item_recursively_by_data (v: ANY): EV_TREE_NODE
    first: [like item] EV_TREE_NODE
    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] EV_TREE_NODE): BOOLEAN
    has_recursively (an_item: [like item] EV_TREE_NODE): BOOLEAN
    i_th (i: INTEGER): EV_TREE_NODE
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_TREE_NODE; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_TREE_ITEM): BOOLEAN
    is_expandable: BOOLEAN
    is_expanded: BOOLEAN
    is_inserted (v: EV_TREE_NODE): BOOLEAN
    is_parent_recursive (a_list: EV_TREE_NODE): BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_TREE_NODE
    item_by_data (some_data: ANY): [like item] EV_TREE_NODE
    last: [like item] EV_TREE_NODE
    linear_representation: LINEAR [EV_TREE_NODE]
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_TREE_NODE): INTEGER
    off: BOOLEAN
    parent: EV_TREE_NODE_CONTAINER
    parent_tree: EV_TREE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    sequential_occurrences (v: EV_TREE_NODE): INTEGER
    target_name: STRING
    text: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    tooltip: STRING
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    align_text_center
    align_text_left
    align_text_right
    append (s: SEQUENCE [EV_TREE_NODE])
    back
    collapse
    compare_objects
    compare_references
    copy (other: [like Current] EV_TREE_ITEM)
    default_create
    destroy
    disable_pebble_positioning
    disable_select
    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
    enable_pebble_positioning
    enable_select
    expand
    extend (v: [like item] EV_TREE_NODE)
    fill (other: CONTAINER [EV_TREE_NODE])
    finish
    force (v: [like item] EV_TREE_NODE)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] EV_TREE_ITEM)
    merge_right (other: [like Current] EV_TREE_ITEM)
    move (i: INTEGER)
    prune (v: [like item] EV_TREE_NODE)
    prune_all (v: [like item] EV_TREE_NODE)
    put (v: [like item] EV_TREE_NODE)
    put_front (v: [like item] EV_TREE_NODE)
    put_i_th (v: [like item] EV_TREE_NODE; i: INTEGER)
    put_left (v: [like item] EV_TREE_NODE)
    put_right (v: [like item] EV_TREE_NODE)
    remove
    remove_left
    remove_pebble
    remove_pixmap
    remove_right
    remove_text
    remove_tooltip
    replace (v: [like item] EV_TREE_NODE)
    search (v: [like item] EV_TREE_NODE)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    start
    swap (i: INTEGER)
    toggle
    wipe_out


EV_TREE_ITEM Flat contracts

indexing
    description: "Item for use with EV_TREE.A tree item is also a tree-item container because ifwe create a tree-item with a tree-item as parent, theparent will become a subtree."
    status: "See notice at end of class"
    keywords: "tree, item, leaf, node, branch"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_TREE_ITEM

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TREE_NODE]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    find_item_recursively_by_data (v: ANY): EV_TREE_NODE
            -- An item at any level in tree that has data.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursively (an_item: like item): BOOLEAN
            -- Does Current contain an_item at any level?
            -- (from EV_TREE_NODE)

    i_th (i: INTEGER): EV_TREE_NODE
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    item: EV_TREE_NODE
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_TREE_NODE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_TREE_NODE_CONTAINER
            -- Parent of Current.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    parent_tree: EV_TREE
            -- Contains Current.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_expanded: BOOLEAN
            -- Are items in Current displayed?
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    is_inserted (v: EV_TREE_NODE): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    collapse
            -- Set is_expanded False.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed
            parent_tree_not_void: parent_tree /= void
            is_collapsable: is_expandable
        ensure -- from EV_TREE_NODE
            not_is_expanded: not is_expanded

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    expand
            -- Set is_expanded True.
            -- (from EV_TREE_NODE)
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed
            parent_tree_not_void: parent_tree /= void
            is_expandable: is_expandable
        ensure -- from EV_TREE_NODE
            is_expanded: is_expanded

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_TREE_NODE])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_TREE_NODE])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).old_parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).old_parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.old_parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).old_parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).old_parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).old_parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_TREE_NODE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature

    is_parent_recursive (a_list: EV_TREE_NODE): BOOLEAN
            -- Is a_list parent or recursively parent of parent?
            -- (from EV_TREE_NODE)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_expandable: BOOLEAN
            -- Is Current able to expand or collapse.
        require -- from EV_TREE_NODE
            not_destroyed: not is_destroyed

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when collapsed.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when expanded.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_TREE_ITEM


EV_TREE_NODE Chart

deferred class
    EV_TREE_NODE

General
    cluster: vision2.interface.items
    description: "Node for use with EV_TREE."
    keywords: "tree, item, leaf, node, branch"

Ancestors
    EV_DESELECTABLE
    EV_ITEM
    EV_TEXTABLE
    EV_TOOLTIPABLE
    EV_TREE_NODE_ACTION_SEQUENCES
    EV_TREE_NODE_CONTAINER

Action sequences
    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    after: BOOLEAN
    alignment: EV_TEXT_ALIGNMENT
    changeable_comparison_criterion: BOOLEAN
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    find_item_recursively_by_data (v: ANY): EV_TREE_NODE
    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    has (v: [like item] EV_TREE_NODE): BOOLEAN
    has_recursively (an_item: [like item] EV_TREE_NODE): BOOLEAN
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_TREE_NODE; i: INTEGER): INTEGER
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_expandable: BOOLEAN
    is_expanded: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    item: EV_TREE_NODE
    linear_representation: LINEAR [EV_TREE_NODE]
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: EV_TREE_NODE): INTEGER
    off: BOOLEAN
    parent: EV_TREE_NODE_CONTAINER
    parent_tree: EV_TREE
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    target_name: STRING
    text: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    tooltip: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    collapse
    compare_objects
    compare_references
    copy (other: [like Current] EV_TREE_NODE)
    default_create
    destroy
    disable_pebble_positioning
    disable_select
    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
    enable_pebble_positioning
    enable_select
    expand
    finish
    forth
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    search (v: [like item] EV_TREE_NODE)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    start
    toggle


EV_TREE_NODE Flat contracts

indexing
    description: "Node for use with EV_TREE."
    status: "See notice at end of class"
    keywords: "tree, item, leaf, node, branch"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_TREE_NODE

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    find_item_recursively_by_data (v: ANY): EV_TREE_NODE
            -- An item at any level in tree that has data.
        require
            not_destroyed: not is_destroyed

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursively (an_item: like item): BOOLEAN
            -- Does Current contain an_item at any level?

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: EV_TREE_NODE
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    occurrences (v: EV_TREE_NODE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)

    parent: EV_TREE_NODE_CONTAINER
            -- Parent of Current.
        require
            not_destroyed: not is_destroyed

    parent_tree: EV_TREE
            -- Contains Current.
        require
            not_destroyed: not is_destroyed

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_expanded: BOOLEAN
            -- Are items in Current displayed?
        require
            not_destroyed: not is_destroyed

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    collapse
            -- Set is_expanded False.
        require
            not_destroyed: not is_destroyed
            parent_tree_not_void: parent_tree /= void
            is_collapsable: is_expandable
        ensure
            not_is_expanded: not is_expanded

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    expand
            -- Set is_expanded True.
        require
            not_destroyed: not is_destroyed
            parent_tree_not_void: parent_tree /= void
            is_expandable: is_expandable
        ensure
            is_expanded: is_expanded

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Cursor movement

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Conversion

    linear_representation: LINEAR [EV_TREE_NODE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_expandable: BOOLEAN
            -- Can Current be expanded and collapsed?
        require
            not_destroyed: not is_destroyed

feature -- Event handling

    collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when collapsed.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when deselected.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    expand_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when expanded.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ITEM_ACTION_SEQUENCES)
        ensure -- from EV_ITEM_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected.
            -- (from EV_TREE_NODE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_NODE_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

end -- class EV_TREE_NODE


cluster vision2.interface.kernel

Cluster
    vision2.interface.kernel

Supercluster
    vision2.interface

Subclusters

Classes
    EV_ACCELERATOR
    EV_ANY
    EV_APPLICATION
    EV_CLIPBOARD
    EV_COLOR
    EV_COORDINATE
    EV_CURSOR
    EV_ENVIRONMENT
    EV_FONT
    EV_KEY
    EV_RECTANGLE
    EV_SCREEN
    EV_SIMPLE_APPLICATION
    EV_TIMEOUT


EV_ACCELERATOR Chart

class
    EV_ACCELERATOR

General
    cluster: vision2.interface.kernel
    description: "A keyboard accelerator defines `actions' to be performed when a`key' is pressed. See `{EV_TITLED_WINDOW}.accelerators'"
    keywords: "accelerator, keyboard, key, shortcut, hotkey"
    create: make_with_key_combination, default_create

Ancestors
    EV_ANY

Action sequences
    actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    alt_required: BOOLEAN
    control_required: BOOLEAN
    data: ANY
    is_destroyed: BOOLEAN
    is_equal (other: [like Current] EV_ACCELERATOR): BOOLEAN
    key: EV_KEY
    out: STRING
    parented: BOOLEAN
    shift_required: BOOLEAN

Commands
    copy (other: [like Current] EV_ACCELERATOR)
    destroy
    disable_alt_required
    disable_control_required
    disable_shift_required
    enable_alt_required
    enable_control_required
    enable_shift_required
    set_data (some_data: [like data] ANY)
    set_key (a_key: EV_KEY)

Constraints
    key not void


EV_ACCELERATOR Flat contracts

indexing
    description: "A keyboard accelerator defines `actions' to be performed when a`key' is pressed. See `{EV_TITLED_WINDOW}.accelerators'"
    status: "See notice at end of class"
    keywords: "accelerator, keyboard, key, shortcut, hotkey"
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_ACCELERATOR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_key_combination (a_key: EV_KEY; require_control, require_alt, require_shift: BOOLEAN)
            -- Create with a_key and modifiers.
        require
            a_key_not_void: a_key /= void

feature -- Access

    alt_required: BOOLEAN
            -- Must the alt key be pressed to trigger actions?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.alt_required

    control_required: BOOLEAN
            -- Must the control key be pressed to trigger actions?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.control_required

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    key: EV_KEY
            -- Key that will trigger actions.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: equal (Result, implementation.key)

    parented: BOOLEAN
            -- Does Current have a parent?
            -- Current is parented if it has been placed in the
            -- accelerator list of a window.
            -- key combination of Current can not be modified if True.
        require
            not_destroyed: not is_destroyed

    shift_required: BOOLEAN
            -- Must the shift key be pressed to trigger actions?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.shift_required

feature -- Status report

    is_equal (other: like Current): BOOLEAN
            -- Does other have the same key combination as Current?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    out: STRING
            -- String representation of key combination.

feature -- Status setting

    disable_alt_required
            -- Make alt_required False.
        require
            not_destroyed: not is_destroyed
            not_parented: not parented
        ensure
            not_alt_required: not alt_required

    disable_control_required
            -- Make control_required False.
        require
            not_destroyed: not is_destroyed
            not_parented: not parented
        ensure
            not_control_required: not control_required

    disable_shift_required
            -- Make shift_required False.
        require
            not_destroyed: not is_destroyed
            not_parented: not parented
        ensure
            not_shift_required: not shift_required

    enable_alt_required
            -- Make alt_required True.
        require
            not_destroyed: not is_destroyed
            not_parented: not parented
        ensure
            alt_required: alt_required

    enable_control_required
            -- Make control_required True.
        require
            not_destroyed: not is_destroyed
            not_parented: not parented
        ensure
            control_required: control_required

    enable_shift_required
            -- Make shift_required True.
        require
            not_destroyed: not is_destroyed
            not_parented: not parented
        ensure
            shift_required: shift_required

    set_key (a_key: EV_KEY)
            -- Assign a_key to key.
        require
            not_destroyed: not is_destroyed
            a_key_not_void: a_key /= void
            not_parented: not parented
        ensure
            a_key_assigned: key.is_equal (a_key)

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Events

    actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when key combination is recieved by the window within which
            -- Current is parented.
        require
            not_destroyed: not is_destroyed
        ensure
            result_not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    key_not_void: key /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_ACCELERATOR


EV_ANY Chart

deferred class
    EV_ANY

General
    cluster: vision2.interface.kernel
    description:
        "Base class for Eiffel Vision interface.
        Eiffel Vision uses the bridge pattern.
        (See bridge pattern notes below.)
        Descendents of this class are coupled to descendents of EV_ANY_I
        (the base class for Eiffel Vision implementation classes).
        EV_ANY's descendants provide a common interface across all
        platforms while EV_ANY_I's descendants provide any necessary
        platform specific implementation."
    keywords: "interface, base, root, any"

Ancestors
    ANY

Queries
    data: ANY
    is_destroyed: BOOLEAN

Commands
    copy (other: [like Current] EV_ANY)
    destroy
    set_data (some_data: [like data] ANY)

Constraints
    is initialized
    is coupled
    default create called


EV_ANY Flat contracts

indexing
    description: "Base class for Eiffel Vision interface.Eiffel Vision uses the bridge pattern.(See bridge pattern notes below.)Descendents of this class are coupled to descendents of EV_ANY_I(the base class for Eiffel Vision implementation classes).EV_ANY's descendants provide a common interface across allplatforms while EV_ANY_I's descendants provide any necessaryplatform specific implementation."
    status: "See notice at end of class"
    keywords: "interface, base, root, any"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_ANY

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
        require
            not_destroyed: not is_destroyed
        ensure
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
        ensure
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
        ensure
            bridge_ok: Result = implementation.is_destroyed

invariant

    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_ANY


EV_APPLICATION Chart

class
    EV_APPLICATION

General
    cluster: vision2.interface.kernel
    description:
        "Eiffel Vision Application.
        To start an Eiffel Vision application: create exactly oneEV_APPLICATION object and call `launch' after setting up initialwindow(s)"
    keywords: "application, accelerator, event loop"

Ancestors
    EV_ANY
    EV_APPLICATION_ACTION_SEQUENCES

Action sequences
    drop_actions: EV_PND_ACTION_SEQUENCE
    idle_actions: EV_NOTIFY_ACTION_SEQUENCE
    pick_actions: EV_PND_ACTION_SEQUENCE
    post_launch_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    alt_pressed: BOOLEAN
    clipboard: EV_CLIPBOARD
    contextual_help_accelerator: EV_ACCELERATOR
    ctrl_pressed: BOOLEAN
    data: ANY
    Default_tooltip_delay: INTEGER
    focused_widget: EV_WIDGET
    help_accelerator: EV_ACCELERATOR
    help_engine: EV_HELP_ENGINE
    is_destroyed: BOOLEAN
    is_launched: BOOLEAN
    locked_window: EV_WINDOW
    shift_pressed: BOOLEAN
    tooltip_delay: INTEGER
    windows: LINEAR [EV_WINDOW]

Commands
    copy (other: [like Current] EV_APPLICATION)
    default_create
    destroy
    display_help_for_widget (a_widget: EV_WIDGET)
    do_once_on_idle (an_action: PROCEDURE [ANY, TUPLE])
    enable_contextual_help
    launch
    process_events
    set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR)
    set_data (some_data: [like data] ANY)
    set_help_accelerator (an_accelerator: EV_ACCELERATOR)
    set_help_engine (an_engine: EV_HELP_ENGINE)
    set_tooltip_delay (a_delay: INTEGER)
    sleep (msec: INTEGER)

Constraints
    tooltip delay not negative
    windows not void


EV_APPLICATION Flat contracts

indexing
    description: "Eiffel Vision Application.To start an Eiffel Vision application: create exactly oneEV_APPLICATION object and call `launch' after setting up initialwindow(s)"
    status: "See notice at end of class"
    keywords: "application, accelerator, event loop"
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_APPLICATION

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    clipboard: EV_CLIPBOARD
            -- Native platform clipboard access.
        require
            not_destroyed: not is_destroyed

    contextual_help_accelerator: EV_ACCELERATOR
            -- Accelerator that enables contextual help mode
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.contextual_help_accelerator)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    help_accelerator: EV_ACCELERATOR
            -- Accelerator that displays contextual help
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.help_accelerator)

    help_engine: EV_HELP_ENGINE
            -- Object that handles contextual help display requests
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.help_engine)

    locked_window: EV_WINDOW
            -- Window currently locked. Void if no window
            -- is currently locked.
            --
            -- See `{EV_WINDOW}.lock_update' for more details
        require
            not_destroyed: not is_destroyed

    windows: LINEAR [EV_WINDOW]
            -- All of the application's windows.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.window)

feature -- Status report

    alt_pressed: BOOLEAN
            -- Is alt key currently pressed?
        require
            not_destroyed: not is_destroyed

    ctrl_pressed: BOOLEAN
            -- Is ctrl key currently pressed?
        require
            not_destroyed: not is_destroyed

    Default_tooltip_delay: INTEGER is 500
            -- Default delay in milleseconds of tool tips.

    focused_widget: EV_WIDGET
            -- Widget that has keyboard focus.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.focused_widget

    is_launched: BOOLEAN
            -- Has launch been called?

    shift_pressed: BOOLEAN
            -- Is shift key currently pressed?
        require
            not_destroyed: not is_destroyed

    tooltip_delay: INTEGER
            -- Time in milliseconds which the pointer must be stationary over
            -- a widget before a tooltips apears.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.tooltip_delay

feature -- Status setting

    set_tooltip_delay (a_delay: INTEGER)
            -- Assign a_delay to tooltip_delay.
        require
            not_destroyed: not is_destroyed
            a_delay_non_negative: a_delay >= 0
        ensure
            assigned: tooltip_delay = a_delay

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    display_help_for_widget (a_widget: EV_WIDGET)
            -- Display contextual help for a_widget, if any.
        require
            not_destroyed: not is_destroyed
            a_widget_not_void: a_widget /= void

    enable_contextual_help
            -- Change mouse cursor to help cursor.
            -- Capture mouse input.
            -- Send help context of widget being clicked to help engine for
            -- Processing.
        require
            not_destroyed: not is_destroyed

    launch
            -- Start the application.
            -- Call prepare the Begin event processing.
        require
            not_destroyed: not is_destroyed
            not_already_launched: not is_launched
        ensure
            is_launched: is_launched

    process_events
            -- Process any pending events.
            -- Pass control to the underlying native toolkit so that it can
            -- handle any events that may be in its queue.
            -- (Should be called from time to time during extended computation.)
        require
            not_destroyed: not is_destroyed
            is_launched: is_launched

    sleep (msec: INTEGER)
            -- Wait for msec milliseconds and return.
        require
            not_destroyed: not is_destroyed
            msec_non_negative: msec >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Element Change

    set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR)
            -- Assign an_accelerator to contextual_help_accelerator
        require
            not_destroyed: not is_destroyed
            an_accelerator_not_void: an_accelerator /= void
        ensure
            contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

    set_help_accelerator (an_accelerator: EV_ACCELERATOR)
            -- Assign an_accelerator to help_accelerator
        require
            not_destroyed: not is_destroyed
            an_accelerator_not_void: an_accelerator /= void
        ensure
            help_accelerator_assigned: help_accelerator = an_accelerator

    set_help_engine (an_engine: EV_HELP_ENGINE)
            -- Assign an_engine to help_engine
        require
            not_destroyed: not is_destroyed
            an_engine_not_void: an_engine /= void
        ensure
            help_engine_set: help_engine = an_engine

feature -- Event handling

    do_once_on_idle (an_action: PROCEDURE [ANY, TUPLE])
            -- Perform an_action one time when the application is next idle.
        require
            not_destroyed: not is_destroyed

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when any "drop" occurs.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

    idle_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when the application is otherwise idle.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when any "pick" occurs.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

    post_launch_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed just after application launch.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    tooltip_delay_not_negative: tooltip_delay >= 0
    windows_not_void: windows /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_APPLICATION


EV_CLIPBOARD Chart

class
    EV_CLIPBOARD

General
    cluster: vision2.interface.kernel
    description: "Objects that allow access to the OS clipboard."
    create: default_create

Ancestors
    EV_ANY

Queries
    data: ANY
    is_destroyed: BOOLEAN
    text: STRING

Commands
    copy (other: [like Current] EV_CLIPBOARD)
    destroy
    remove_text
    set_data (some_data: [like data] ANY)
    set_text (a_text: STRING)


EV_CLIPBOARD Flat contracts

indexing
    description: "Objects that allow access to the OS clipboard."
    status: "See notice at end of class."
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_CLIPBOARD

create

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    text: STRING
            -- Result is text of clipboard.
        require
            not_destroyed: not is_destroyed

feature -- Status setting

    remove_text
            -- Make text Void.
        require
            not_destroyed: not is_destroyed
        ensure
            text_removed: text = void

    set_text (a_text: STRING)
            -- Assign a_text to clipboard.
        require
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure
            text_cloned: text.is_equal (a_text) and then text /= a_text

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_CLIPBOARD


EV_COLOR Chart

class
    EV_COLOR

General
    cluster: vision2.interface.kernel
    description: "Color modeled as red, green, blue intensitieseach with range [0,1]."
    keywords: "color, pixel, rgb, 8, 16, 24"
    create: make_with_rgb, make_with_8_bit_rgb, default_create

Ancestors
    DOUBLE_MATH
    EV_ANY

Queries
    blue: REAL
    blue_16_bit: INTEGER
    blue_8_bit: INTEGER
    data: ANY
    green: REAL
    green_16_bit: INTEGER
    green_8_bit: INTEGER
    hue: REAL
    is_destroyed: BOOLEAN
    is_equal (other: [like Current] EV_COLOR): BOOLEAN
    lightness: REAL
    Max_16_bit: INTEGER
    Max_24_bit: INTEGER
    Max_8_bit: INTEGER
    out: STRING
    red: REAL
    red_16_bit: INTEGER
    red_8_bit: INTEGER
    rgb_24_bit: INTEGER
    saturation: REAL

Commands
    copy (other: [like Current] EV_COLOR)
    destroy
    set_blue (a_blue: REAL)
    set_blue_with_16_bit (a_16_bit_blue: INTEGER)
    set_blue_with_8_bit (an_8_bit_blue: INTEGER)
    set_data (some_data: [like data] ANY)
    set_green (a_green: REAL)
    set_green_with_16_bit (a_16_bit_green: INTEGER)
    set_green_with_8_bit (an_8_bit_green: INTEGER)
    set_red (a_red: REAL)
    set_red_with_16_bit (a_16_bit_red: INTEGER)
    set_red_with_8_bit (an_8_bit_red: INTEGER)
    set_rgb (a_red, a_green, a_blue: REAL)
    set_rgb_with_16_bit (a_16_bit_red, a_16_bit_green, a_16_bit_blue: INTEGER)
    set_rgb_with_24_bit (a_24_bit_rgb: INTEGER)
    set_rgb_with_8_bit (an_8_bit_red, an_8_bit_green, an_8_bit_blue: INTEGER)

Constraints
    red within range
    green within range
    blue within range
    red 8 bit within range
    green 8 bit within range
    blue 8 bit within range
    red 16 bit within range
    green 16 bit within range
    blue 16 bit within range
    rgb 24 bit within range
    red 16 bit conversion
    red 8 bit conversion
    green 16 bit conversion
    green 8 bit conversion
    blue 16 bit conversion
    blue 8 bit conversion


EV_COLOR Flat contracts

indexing
    description: "Color modeled as red, green, blue intensitieseach with range [0,1]."
    keywords: "color, pixel, rgb, 8, 16, 24"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_COLOR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_8_bit_rgb (an_8_bit_red, an_8_bit_green, an_8_bit_blue: INTEGER)
            -- Create with a_red, a_green, a_blue, and default name.
        require
            red_within_range: an_8_bit_red >= 0 and an_8_bit_red <= max_8_bit
            green_within_range: an_8_bit_green >= 0 and an_8_bit_green <= max_8_bit
            blue_within_range: an_8_bit_blue >= 0 and an_8_bit_blue <= max_8_bit
        ensure
            red_assigned: red_8_bit = an_8_bit_red
            green_assigned: green_8_bit = an_8_bit_green
            blue_assigned: blue_8_bit = an_8_bit_blue

    make_with_rgb (a_red, a_green, a_blue: REAL)
            -- Create with a_red, a_green, a_blue, and default name.
        require
            a_red_within_range: a_red >= 0 and then a_red <= 1
            a_green_within_range: a_green >= 0 and then a_green <= 1
            a_blue_within_range: a_blue >= 0 and then a_blue <= 1
        ensure
            red_assigned: (red - a_red).abs <= delta
            green_assigned: (green - a_green).abs <= delta
            blue_assigned: (blue - a_blue).abs <= delta

feature -- Access

    blue: REAL
            -- Intensity of blue component. Range: [0,1]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.blue

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    green: REAL
            -- Intensity of green component. Range: [0,1]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.green

    hue: REAL
            -- Hue of the color
        require
            not_destroyed: not is_destroyed

    lightness: REAL
            -- Lightness of the color
        require
            not_destroyed: not is_destroyed

    red: REAL
            -- Intensity of red component. Range: [0,1]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.red

    saturation: REAL
            -- Saturation of the color
        require
            not_destroyed: not is_destroyed

feature -- Comparison

    copy (other: like Current)
            -- Update Current by setting attributes from other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    is_equal (other: like Current): BOOLEAN
            -- Does Current look the same color as other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Element change

    set_blue (a_blue: REAL)
            -- Assign a_blue to blue.
        require
            not_destroyed: not is_destroyed
            blue_within_range: a_blue >= 0 and then a_blue <= 1
        ensure
            blue_assigned: (blue - a_blue).abs <= delta

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_green (a_green: REAL)
            -- Assign a_green to green.
        require
            not_destroyed: not is_destroyed
            within_range: a_green >= 0 and then a_green <= 1
        ensure
            green_assigned: (green - a_green).abs <= delta

    set_red (a_red: REAL)
            -- Assign a_red to red.
        require
            not_destroyed: not is_destroyed
            within_range: a_red >= 0 and then a_red <= 1
        ensure
            red_assigned: (red - a_red).abs <= delta

    set_rgb (a_red, a_green, a_blue: REAL)
            -- Assign a_red, a_green and a_blue
            -- to red, green and blue respectively.
        require
            not_destroyed: not is_destroyed
            red_within_range: a_red >= 0 and then a_red <= 1
            green_within_range: a_green >= 0 and then a_green <= 1
            blue_within_range: a_blue >= 0 and then a_blue <= 1
        ensure
            red_assigned: (red - a_red).abs <= delta
            green_assigned: (green - a_green).abs <= delta
            blue_assigned: (blue - a_blue).abs <= delta

feature -- Conversion

    blue_16_bit: INTEGER
            -- Intensity of blue component as an 16 bit unsigned integer.
            -- Range [0,65535]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.blue_16_bit

    blue_8_bit: INTEGER
            -- Intensity of blue component as an 8 bit unsigned integer.
            -- Range [0,255]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.blue_8_bit

    green_16_bit: INTEGER
            -- Intensity of green component as an 16 bit unsigned integer.
            -- Range [0,65535]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.green_16_bit

    green_8_bit: INTEGER
            -- Intensity of green component as an 8 bit unsigned integer.
            -- Range [0,255]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.green_8_bit

    red_16_bit: INTEGER
            -- Intensity of red component as an 16 bit unsigned integer.
            -- Range [0,65535]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.red_16_bit

    red_8_bit: INTEGER
            -- Intensity of red component as an 8 bit unsigned integer.
            -- Range [0,255]
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.red_8_bit

    rgb_24_bit: INTEGER
            -- red, green and blue intensities packed into 24 bits
            -- with 8 bits per colour and blue in the least significant 8 bits.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.rgb_24_bit

    set_blue_with_16_bit (a_16_bit_blue: INTEGER)
            -- Set blue from a_16_bit_blue intinsity.
        require
            not_destroyed: not is_destroyed
            within_range: a_16_bit_blue >= 0 and then a_16_bit_blue <= max_16_bit
        ensure
            blue_assigned: blue_16_bit = a_16_bit_blue

    set_blue_with_8_bit (an_8_bit_blue: INTEGER)
            -- Set blue from an_8_bit_blue intinsity.
        require
            not_destroyed: not is_destroyed
            within_range: an_8_bit_blue >= 0 and then an_8_bit_blue <= max_8_bit
        ensure
            blue_assigned: blue_8_bit = an_8_bit_blue

    set_green_with_16_bit (a_16_bit_green: INTEGER)
            -- Set green from a_16_bit_green intinsity.
        require
            not_destroyed: not is_destroyed
            within_range: a_16_bit_green >= 0 and then a_16_bit_green <= max_16_bit
        ensure
            green_assigned: green_16_bit = a_16_bit_green

    set_green_with_8_bit (an_8_bit_green: INTEGER)
            -- Set green from an_8_bit_green intinsity.
        require
            not_destroyed: not is_destroyed
            within_range: an_8_bit_green >= 0 and then an_8_bit_green <= max_8_bit
        ensure
            green_assigned: green_8_bit = an_8_bit_green

    set_red_with_16_bit (a_16_bit_red: INTEGER)
            -- Set red from a_8_bit_red intinsity.
        require
            not_destroyed: not is_destroyed
            within_range: a_16_bit_red >= 0 and then a_16_bit_red <= max_16_bit
        ensure
            red_assigned: red_16_bit = a_16_bit_red

    set_red_with_8_bit (an_8_bit_red: INTEGER)
            -- Set red from an_8_bit_red intinsity.
        require
            not_destroyed: not is_destroyed
            within_range: an_8_bit_red >= 0 and then an_8_bit_red <= max_8_bit
        ensure
            red_assigned: red_8_bit = an_8_bit_red

    set_rgb_with_16_bit (a_16_bit_red, a_16_bit_green, a_16_bit_blue: INTEGER)
            -- Set intensities  from a_16_bit_red, a_16_bit_green, and
            -- a_16_bit_blue intensity. (16 bits per channel.)
        require
            not_destroyed: not is_destroyed
            red_within_range: a_16_bit_red >= 0 and a_16_bit_red <= max_16_bit
            green_within_range: a_16_bit_green >= 0 and a_16_bit_green <= max_16_bit
            blue_within_range: a_16_bit_blue >= 0 and a_16_bit_blue <= max_16_bit
        ensure
            red_assigned: red_16_bit = a_16_bit_red
            green_assigned: green_16_bit = a_16_bit_green
            blue_assigned: blue_16_bit = a_16_bit_blue

    set_rgb_with_24_bit (a_24_bit_rgb: INTEGER)
            -- Set intensities from a_24_bit_rgb value
            -- with blue in the least significant 8 bits.
        require
            not_destroyed: not is_destroyed
            within_range: a_24_bit_rgb >= 0 and a_24_bit_rgb <= max_24_bit
        ensure
            rgb_assigned: rgb_24_bit = a_24_bit_rgb

    set_rgb_with_8_bit (an_8_bit_red, an_8_bit_green, an_8_bit_blue: INTEGER)
            -- Set intensities  from an_8_bit_red, an_8_bit_green, and
            -- an_8_bit_blue intensity. (8 bits per channel.)
        require
            not_destroyed: not is_destroyed
            red_within_range: an_8_bit_red >= 0 and an_8_bit_red <= max_8_bit
            green_within_range: an_8_bit_green >= 0 and an_8_bit_green <= max_8_bit
            blue_within_range: an_8_bit_blue >= 0 and an_8_bit_blue <= max_8_bit
        ensure
            red_assigned: red_8_bit = an_8_bit_red
            green_assigned: green_8_bit = an_8_bit_green
            blue_assigned: blue_8_bit = an_8_bit_blue

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Constants

    Max_16_bit: INTEGER is 65535
            -- Maximum value for 16 bit unsigned integers.

    Max_24_bit: INTEGER is 16777215
            -- Maximum value for 24 bit unsigned integers.

    Max_8_bit: INTEGER is 255
            -- Maximum value for 8 bit unsigned integers.

feature -- Output

    out: STRING
            -- Textual representation.

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    red_within_range: red >= 0 and red <= 1
    green_within_range: green >= 0 and green <= 1
    blue_within_range: blue >= 0 and blue <= 1
    red_8_bit_within_range: red_8_bit >= 0 and red_8_bit <= max_8_bit
    green_8_bit_within_range: green_8_bit >= 0 and green_8_bit <= max_8_bit
    blue_8_bit_within_range: blue_8_bit >= 0 and blue_8_bit <= max_8_bit
    red_16_bit_within_range: red_16_bit >= 0 and red_16_bit <= max_16_bit
    green_16_bit_within_range: green_16_bit >= 0 and green_16_bit <= max_16_bit
    blue_16_bit_within_range: blue_16_bit >= 0 and blue_16_bit <= max_16_bit
    rgb_24_bit_within_range: rgb_24_bit >= 0 and rgb_24_bit <= max_24_bit
    red_16_bit_conversion: ((red * max_16_bit) - red_16_bit).abs <= delta * max_16_bit
    red_8_bit_conversion: ((red * max_8_bit) - red_8_bit).abs <= delta * max_8_bit
    green_16_bit_conversion: ((green * max_16_bit) - green_16_bit).abs <= delta * max_16_bit
    green_8_bit_conversion: ((green * max_8_bit) - green_8_bit).abs < delta * max_8_bit
    blue_16_bit_conversion: ((blue * max_16_bit) - blue_16_bit).abs < delta * max_16_bit
    blue_8_bit_conversion: ((blue * max_8_bit) - blue_8_bit).abs < delta * max_8_bit
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_COLOR


EV_COORDINATE Chart

class
    EV_COORDINATE

General
    cluster: vision2.interface.kernel
    description: "A position in a 2 dimensional space as INTEGERs (x, y)"
    create: set, default_create

Ancestors
    ANY

Queries
    out: STRING
    x: INTEGER
    y: INTEGER

Commands
    set (a_x, a_y: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)


EV_COORDINATE Flat contracts

indexing
    description: "A position in a 2 dimensional space as INTEGERs (x, y)"
    status: "See notice at end of class"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_COORDINATE

create

    set (a_x, a_y: INTEGER)
            -- Assign a_x to x and a_y to y.
        ensure
            x_assigned: x = a_x
            y_assigned: y = a_y

feature -- Access

    x: INTEGER
            -- Horizontal position.

    y: INTEGER
            -- Vertical position.

feature -- Element change

    set (a_x, a_y: INTEGER)
            -- Assign a_x to x and a_y to y.
        ensure
            x_assigned: x = a_x
            y_assigned: y = a_y

    set_x (a_x: INTEGER)
            -- Assign a_x to x.
        ensure
            x_assigned: x = a_x

    set_y (a_y: INTEGER)
            -- Assign a_y to y.
        ensure
            y_assigned: y = a_y

feature -- Output

    out: STRING
            -- Textual representation.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_COORDINATE


EV_CURSOR Chart

class
    EV_CURSOR

General
    cluster: vision2.interface.kernel
    description: "Apearance of a screen pointer cursor, typically moved by a mouse."
    keywords: "mouse, pointer, cursor, arrow"
    create: make_with_pixmap, make_with_size, default_create

Ancestors
    EV_PIXMAP

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    clip_area: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    data: ANY
    deny_cursor: EV_CURSOR
    drawing_mode: INTEGER
    font: EV_FONT
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_equal (other: [like Current] EV_CURSOR): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    tile: EV_PIXMAP
    tooltip: STRING
    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
    width: INTEGER
    x_hotspot: INTEGER
    x_position: INTEGER
    y_hotspot: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    clear
    clear_rectangle (x, y, a_width, a_height: INTEGER)
    copy (other: EV_PIXMAP)
    default_create
    destroy
    disable_capture
    disable_dashed_line_style
    disable_pebble_positioning
    disable_sensitive
    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
    draw_point (x, y: INTEGER)
    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
    draw_rectangle (x, y, a_width, a_height: INTEGER)
    draw_segment (x1, y1, x2, y2: INTEGER)
    draw_straight_line (x1, y1, x2, y2: INTEGER)
    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
    draw_text (x, y: INTEGER; a_text: STRING)
    draw_text_top_left (x, y: INTEGER; a_text: STRING)
    enable_capture
    enable_dashed_line_style
    enable_pebble_positioning
    enable_sensitive
    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    fill_polygon (points: ARRAY [EV_COORDINATE])
    fill_rectangle (x, y, a_width, a_height: INTEGER)
    flush
    hide
    remove_clip_area
    remove_help_context
    remove_pebble
    remove_tile
    remove_tooltip
    save_to_named_file (a_format: EV_GRAPHICAL_FORMAT; a_filename: FILE_NAME)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_and_mode
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_clip_area (an_area: EV_RECTANGLE)
    set_copy_mode
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_drawing_mode (a_mode: INTEGER)
    set_focus
    set_font (a_font: EV_FONT)
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_invert_mode
    set_line_width (a_width: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_or_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tile (a_pixmap: EV_PIXMAP)
    set_tooltip (a_tooltip: STRING)
    set_with_named_file (file_name: STRING)
    set_x_hotspot (a_x_hotspot: INTEGER)
    set_xor_mode
    set_y_hotspot (a_y_hotspot: INTEGER)
    show
    stretch (a_width, a_height: INTEGER)


EV_CURSOR Flat contracts

indexing
    description: "Apearance of a screen pointer cursor, typically moved by a mouse."
    status: "See notice at end of class."
    keywords: "mouse, pointer, cursor, arrow"
    date: "$Date: 2001/07/14 11:02:39 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_CURSOR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_size (a_width, a_height: INTEGER)
            -- Create with a_width and a_height.
            -- (from EV_PIXMAP)
        require -- from EV_PIXMAP
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure then -- from EV_PIXMAP
            width_assigned: width = a_width
            height_assigned: height = a_height

    make_with_pixmap (a_pixmap: EV_PIXMAP; a_x_hotspot, a_y_hotspot: INTEGER)
            -- Create a cursor initialized with a_pixmap as
            -- pixmap and a_x_hotspot & a_y_hotspot as
            -- hotspot coordinates

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    clip_area: EV_RECTANGLE
            -- Rectangular area to apply clipping on.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.clip_area = void)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.dashed_line_style

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    drawing_mode: INTEGER
            -- Logical operation on pixels when drawing.
            -- Default: drawing_mode_copy.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.drawing_mode

    font: EV_FONT
            -- Typeface appearance for Current.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_FONTABLE
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    line_width: INTEGER
            -- Line thickness. Default: 1.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.line_width

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tile: EV_PIXMAP
            -- Pixmap that is used to draw filled primitives with
            -- instead of foreground_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.tile = void)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    x_hotspot: INTEGER
            -- Specifies the x-coordinate of a cursor's hot spot.

    y_hotspot: INTEGER
            -- Specifies the y-coordinate of a cursor's hot spot.

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other have the same appearance as Current.
            -- (from EV_PIXMAP)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width and a_height to width and weight.
            -- Do not stretch image.
            -- May cause cropping.
            -- (from EV_PIXMAP)
        require -- from EV_PIXMAP
            not_destroyed: not is_destroyed
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure -- from EV_PIXMAP
            width_assigned: width = a_width
            height_assigned: height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_with_named_file (file_name: STRING)
            -- Attempt to load pixmap data from a file specified by file_name.
            -- May raise Ev_unknow_image_format or Ev_courpt_image_data
            -- exceptions.
            -- (from EV_PIXMAP)
        require -- from EV_PIXMAP
            not_destroyed: not is_destroyed
            file_name_not_void: file_name /= void
            file_name_not_empty: not file_name.is_empty

    set_x_hotspot (a_x_hotspot: INTEGER)
            -- Set x_hotspot to a_x_hotspot.
        require
            not_destroyed: not is_destroyed
            valid_x_hotspot: a_x_hotspot >= 0 and a_x_hotspot < width
        ensure
            x_hotspot_set: x_hotspot = a_x_hotspot

    set_y_hotspot (a_y_hotspot: INTEGER)
            -- Set y_hotspot to a_y_hotspot.
        require
            not_destroyed: not is_destroyed
            valid_y_hotspot: a_y_hotspot >= 0 and a_y_hotspot < height
        ensure
            y_hotspot_set: y_hotspot = a_y_hotspot

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    stretch (a_width, a_height: INTEGER)
            -- Assign a_width and a_height to width and weight.
            -- Stretch the image to new size.
            -- (from EV_PIXMAP)
        require -- from EV_PIXMAP
            not_destroyed: not is_destroyed
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure -- from EV_PIXMAP
            width_assigned: width = a_width
            height_assigned: height = a_height

feature -- Element change

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_disabled: not dashed_line_style

    enable_dashed_line_style
            -- Draw lines dashed.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_enabled: dashed_line_style

    remove_clip_area
            -- Do not apply any clipping.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            clip_area_void: clip_area = void

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tile
            -- Do not apply a tile when filling.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            tile_void: tile = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_clip_area (an_area: EV_RECTANGLE)
            -- Set area which will be refreshed.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            an_area_not_void: an_area /= void
        ensure -- from EV_DRAWABLE
            clip_area_assigned: clip_area.is_equal (an_area)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_drawing_mode (a_mode: INTEGER)
            -- Set drawing mode to a_logical_mode.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_mode_valid: valid_drawing_mode (a_mode)
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = a_mode

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void
        ensure -- from EV_FONTABLE
            font_assigned: font.is_equal (a_font)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_DRAWABLE
            line_width_assigned: line_width = a_width

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tile (a_pixmap: EV_PIXMAP)
            -- Set tile used to fill figures.
            -- Set to Void to use background_color to fill.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_DRAWABLE
            tile_assigned: tile /= void

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: EV_PIXMAP)
            -- Update Current to have same appearence as other.
            -- (So as to satisfy is_equal.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    save_to_named_file (a_format: EV_GRAPHICAL_FORMAT; a_filename: FILE_NAME)
            -- Save Current to a_filename in format a_format.
            -- (from EV_PIXMAP)
        require -- from EV_PIXMAP
            not_destroyed: not is_destroyed
            a_format_not_void: a_format /= void
            a_filename_not_void: a_filename /= void

feature -- Basic Operations

    flush
            -- Execute any delayed calls to expose_actions without waiting
            -- for next idle.
            -- (from EV_PIXMAP)
        require -- from EV_PIXMAP
            not_destroyed: not is_destroyed

feature -- Clearing operations

    clear
            -- Erase Current with background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    clear_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height in background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature  -- Contract support

    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
            -- Is a_mode a valid drawing mode?
            -- (from EV_DRAWABLE_CONSTANTS)

feature -- Drawing mode setting

    set_and_mode
            -- Set drawing_mode to bitwise AND.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_and

    set_copy_mode
            -- Set drawing_mode to normal.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_copy

    set_invert_mode
            -- Set drawing_mode to bitwise invert.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_invert

    set_or_mode
            -- Set drawing_mode to bitwise OR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_or

    set_xor_mode
            -- Set drawing_mode to bitwise XOR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_xor

feature -- Drawing operations

    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- Angles are measured in radians, and go
            -- counterclockwise from the 3 o'clock angle.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_width >= 0

    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Draw an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the
            -- 3 o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
            -- Draw a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void

    draw_point (x, y: INTEGER)
            -- Draw point at (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
            -- Draw line segments between subsequent points in
            -- points. If is_closed draw line segment between first
            -- and last point in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    draw_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

    draw_segment (x1, y1, x2, y2: INTEGER)
            -- Draw line segment from (x1, y1) to (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_straight_line (x1, y1, x2, y2: INTEGER)
            -- Draw infinite straight line through (x1, y1) and
            -- (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
            -- Draw area of a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
            area_not_void: area /= void

    draw_text (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with left of baseline at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    draw_text_top_left (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with top left corner at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

feature -- Drawing operations (filled)

    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Fill an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Fill part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the 3
            -- o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_polygon (points: ARRAY [EV_COORDINATE])
            -- Draw filled polygon between subsequent points in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    fill_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw filled rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when an area needs to be redrawn.
            -- (from EV_PIXMAP_ACTION_SEQUENCES)
        ensure -- from EV_PIXMAP_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_DRAWABLE
    line_width_positive_or_zero: is_usable implies line_width >= 0
    drawing_mode_valid: is_usable implies valid_drawing_mode (drawing_mode)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_CURSOR


EV_ENVIRONMENT Chart

class
    EV_ENVIRONMENT

General
    cluster: vision2.interface.kernel
    description: "Facilities for inspecting global environment information."
    keywords: "environment, application, global, system"
    create: default_create

Ancestors
    EV_ANY

Queries
    application: EV_APPLICATION
    data: ANY
    is_destroyed: BOOLEAN

Commands
    copy (other: [like Current] EV_ENVIRONMENT)
    destroy
    set_data (some_data: [like data] ANY)


EV_ENVIRONMENT Flat contracts

indexing
    description: "Facilities for inspecting global environment information."
    status: "See notice at end of class"
    keywords: "environment, application, global, system"
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_ENVIRONMENT

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    application: EV_APPLICATION
            -- Single application object for system.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.application

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_ENVIRONMENT


EV_FONT Chart

class
    EV_FONT

General
    cluster: vision2.interface.kernel
    description:
        "Representation of a typeface.
        Appearance is specified in terms of font family, height, shape and
        weight. The local system font closest to the specification will be
        displayed. A specific font name may optionally be specified. See `set_preferred_face'"
    keywords: "character, face, height, family, weight, shape, bold, italic"
    create: make_with_values, default_create

Ancestors
    EV_ANY
    EV_FONT_CONSTANTS

Queries
    ascent: INTEGER
    data: ANY
    descent: INTEGER
    family: INTEGER
    height: INTEGER
    horizontal_resolution: INTEGER
    is_destroyed: BOOLEAN
    is_equal (other: [like Current] EV_FONT): BOOLEAN
    is_proportional: BOOLEAN
    maximum_width: INTEGER
    minimum_width: INTEGER
    name: STRING
    preferred_families: ACTIVE_LIST [STRING]
    shape: INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    valid_family (a_family: INTEGER): BOOLEAN
    valid_shape (a_shape: INTEGER): BOOLEAN
    valid_weight (a_weight: INTEGER): BOOLEAN
    vertical_resolution: INTEGER
    weight: INTEGER
    width: INTEGER

Commands
    copy (other: [like Current] EV_FONT)
    destroy
    set_data (some_data: [like data] ANY)
    set_family (a_family: INTEGER)
    set_height (a_height: INTEGER)
    set_shape (a_shape: INTEGER)
    set_weight (a_weight: INTEGER)

Constraints
    family valid
    weight valid
    shape valid
    height bigger than zero
    ascent bigger than zero
    descent bigger than zero
    height positive
    ascent positive
    descent positive
    width of empty string equals zero
    horizontal resolution non negative
    vertical resolution non negative


EV_FONT Flat contracts

indexing
    description: "Representation of a typeface.Appearance is specified in terms of font family, height, shape andweight. The local system font closest to the specification will bedisplayed. A specific font name may optionally be specified. See `set_preferred_face'"
    status: "See notice at end of class"
    keywords: "character, face, height, family, weight, shape, bold, italic"
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_FONT

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_values (a_family, a_weight, a_shape, a_height: INTEGER)
            -- Create with a_family, a_weight, a_shape and a_height.
        require
            a_family_valid: valid_family (a_family)
            a_weight_valid: valid_weight (a_weight)
            a_shape_valid: valid_shape (a_shape)
            a_height_bigger_than_zero: a_height > 0
        ensure
            a_family_set: family = a_family
            a_weight_set: weight = a_weight
            a_shape_set: shape = a_shape
            a_height_set: height = a_height

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    family: INTEGER
            -- Font category. Can be any of the Family_* constants
            -- defined in EV_FONT_CONSTANTS.
            -- Default: Family_sans
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.family

    height: INTEGER
            -- Preferred font height in pixels.
            -- Default: 8
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.height

    preferred_families: ACTIVE_LIST [STRING]
            -- Preferred familys. The first one in the list
            -- will be tried first. If it does not exists on
            -- the system, the second will be tried, etc.
            --
            -- Overrides family if found on current system.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.preferred_families
            result_not_void: Result /= void

    shape: INTEGER
            -- Preferred font slant. Can be any of the Shape_*
            -- constants defined in EV_FONT_CONSTANTS.
            -- Default: Shape_regular
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.shape

    weight: INTEGER
            -- Preferred font thickness. Can be any of the Weight_*
            -- constants defined in EV_FONT_CONSTANTS.
            -- Default: Weight_regular
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.weight

feature -- Status report

    ascent: INTEGER
            -- Vertical distance from the origin of the drawing
            -- operation to the top of the drawn character.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.ascent

    descent: INTEGER
            -- Vertical distance from the origin of the drawing
            -- operation to the bottom of the drawn character.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.descent

    horizontal_resolution: INTEGER
            -- Horizontal resolution of screen for which the font is designed.
            -- Measured in dots per inch. If return value is zero, the
            -- resolution is not known.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.horizontal_resolution

    is_proportional: BOOLEAN
            -- Can characters in the font have different widths?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_proportional

    maximum_width: INTEGER
            -- Width of the biggest character in the font.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.maximum_width

    minimum_width: INTEGER
            -- Width of the smallest character in the font.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.minimum_width

    name: STRING
            -- Face name chosen by toolkit.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.name)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] in pixels of a_string in the current font,
            -- taking into account line breaks ('').
        require
            not_destroyed: not is_destroyed
            a_string_not_void: a_string /= void
        ensure
            bridge_ok: Result.item (1).is_equal (implementation.string_size (a_string).item (1)) and Result.item (2).is_equal (implementation.string_size (a_string).item (2))

    string_width (a_string: STRING): INTEGER
            -- Width in pixels of a_string in the current font.
        require
            not_destroyed: not is_destroyed
            a_string_not_void: a_string /= void
        ensure
            bridge_ok: Result = implementation.string_width (a_string)
            positive: Result >= 0

    vertical_resolution: INTEGER
            -- Vertical resolution of screen for which the font is designed.
            -- Measured in dots per inch. If return value is zero, the
            -- resolution is not known.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.vertical_resolution

    width: INTEGER
            -- Character width of current fixed-width font.
            -- If font is proportional, returns the average width.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.width

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_family (a_family: INTEGER)
            -- Assign  a_family to family.
        require
            not_destroyed: not is_destroyed
            a_family_valid: valid_family (a_family)
        ensure
            family_assigned: family = a_family

    set_height (a_height: INTEGER)
            -- Set a_height to height.
        require
            not_destroyed: not is_destroyed
            a_height_bigger_than_zero: a_height > 0
        ensure
            height_assigned: height = a_height

    set_shape (a_shape: INTEGER)
            -- Set a_shape to shape.
        require
            not_destroyed: not is_destroyed
            a_shape_valid: valid_shape (a_shape)
        ensure
            shape_assigned: shape = a_shape

    set_weight (a_weight: INTEGER)
            -- Set a_weight to weight.
        require
            not_destroyed: not is_destroyed
            a_weight_valid: valid_weight (a_weight)
        ensure
            weight_assigned: weight = a_weight

feature -- Basic operations

    copy (other: like Current)
            -- Update Current with all attributes of other.
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    is_equal (other: like Current): BOOLEAN
            -- Does other have same appearance?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature  -- Contract support

    valid_family (a_family: INTEGER): BOOLEAN
            -- Is a_family a valid family value.
            -- (from EV_FONT_CONSTANTS)

    valid_shape (a_shape: INTEGER): BOOLEAN
            -- Is a_shape a valid shape value.
            -- (from EV_FONT_CONSTANTS)

    valid_weight (a_weight: INTEGER): BOOLEAN
            -- Is a_weight a valid weight value.
            -- (from EV_FONT_CONSTANTS)

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    family_valid: is_initialized implies valid_family (family)
    weight_valid: is_initialized implies valid_weight (weight)
    shape_valid: is_initialized implies valid_shape (shape)
    height_bigger_than_zero: is_initialized implies height > 0
    ascent_bigger_than_zero: is_initialized implies ascent > 0
    descent_bigger_than_zero: is_initialized implies descent > 0
    height_positive: is_initialized implies height > 0
    ascent_positive: is_initialized implies ascent > 0
    descent_positive: is_initialized implies descent > 0
    width_of_empty_string_equals_zero: is_initialized implies string_width ("") = 0
    horizontal_resolution_non_negative: is_initialized implies horizontal_resolution >= 0
    vertical_resolution_non_negative: is_initialized implies vertical_resolution >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_FONT


EV_KEY Chart

class
    EV_KEY

General
    cluster: vision2.interface.kernel
    description:
        "Eiffel Vision key. Represents a virtual key code. `code' can be any
        of the constant values defined in EV_KEY_CONSTANTS."
    create: make_with_code, default_create

Ancestors
    ANY
    EV_KEY_CONSTANTS

Queries
    code: INTEGER
    is_alpha: BOOLEAN
    is_arrow: BOOLEAN
    is_function: BOOLEAN
    is_number: BOOLEAN
    is_numpad: BOOLEAN
    out: STRING
    valid_key_code (a_code: INTEGER): BOOLEAN

Commands
    set_code (a_code: INTEGER)

Constraints
    code valid


EV_KEY Flat contracts

indexing
    description: "Eiffel Vision key. Represents a virtual key code. `code' can be anyof the constant values defined in EV_KEY_CONSTANTS."
    status: "See notice at end of class"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_KEY

create

    default_create
            -- Initialize with Key_enter.

    make_with_code (a_code: INTEGER)
            -- Initialize with a_code.
        require
            a_code_valid: valid_key_code (a_code)

feature -- Access

    code: INTEGER
            -- Code representing some key.

feature -- Status report

    is_alpha: BOOLEAN
            -- Is code in ["a"-"z"]?

    is_arrow: BOOLEAN
            -- Is code an arrow key?

    is_function: BOOLEAN
            -- Is code a function key?

    is_number: BOOLEAN
            -- Is code in ["0"-"9"]?

    is_numpad: BOOLEAN
            -- Is code a key on the numpad?

feature -- Element change

    set_code (a_code: INTEGER)
            -- Assign a_code to code.
        require
            a_code_valid: valid_key_code (a_code)
        ensure
            code_assigned: code = a_code

feature  -- Contract support

    valid_key_code (a_code: INTEGER): BOOLEAN
            -- Is `a_code' a valid key code?
            -- (from EV_KEY_CONSTANTS)

feature -- Standard output

    out: STRING
            -- Readable representation of code.

invariant

    code_valid: valid_key_code (code)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_KEY


EV_RECTANGLE Chart

class
    EV_RECTANGLE

General
    cluster: vision2.interface.kernel
    description: "Rectangular areas."
    create: make, set, default_create

Ancestors
    ANY

Queries
    bottom: INTEGER
    has (c: EV_COORDINATE): BOOLEAN
    has_x_y (a_x, a_y: INTEGER): BOOLEAN
    height: INTEGER
    intersects (other: [like Current] EV_RECTANGLE): BOOLEAN
    left: INTEGER
    lower_left: EV_COORDINATE
    lower_right: EV_COORDINATE
    out: STRING
    right: INTEGER
    top: INTEGER
    upper_left: EV_COORDINATE
    upper_right: EV_COORDINATE
    width: INTEGER
    x: INTEGER
    y: INTEGER

Commands
    grow_bottom (i: INTEGER)
    grow_left (i: INTEGER)
    grow_right (i: INTEGER)
    grow_top (i: INTEGER)
    include (a_x, a_y: INTEGER)
    include_point (c: EV_COORDINATE)
    merge (other: [like Current] EV_RECTANGLE)
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER)
    resize (a_width, a_height: INTEGER)
    set_bottom (i: INTEGER)
    set_height (new_height: INTEGER)
    set_left (i: INTEGER)
    set_right (i: INTEGER)
    set_top (i: INTEGER)
    set_width (new_width: INTEGER)
    set_x (new_x: INTEGER)
    set_y (new_y: INTEGER)

Constraints
    width positive
    height positive


EV_RECTANGLE Flat contracts

indexing
    description: "Rectangular areas."
    status: "See notice at end of class"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_RECTANGLE

create

    make (a_x, a_y, a_width, a_height: INTEGER)
            -- Initialize with a_x, a_y, a_width, a_height.
            -- Was declared in EV_RECTANGLE as synonym of set.
        require
            a_width_positive: a_width >= 0
            a_height_positive: a_height >= 0

    set (a_x, a_y, a_width, a_height: INTEGER)
            -- Initialize with a_x, a_y, a_width, a_height.
            -- Was declared in EV_RECTANGLE as synonym of make.
        require
            a_width_positive: a_width >= 0
            a_height_positive: a_height >= 0

feature -- Access

    bottom: INTEGER
            -- Vertical position of bottom.

    height: INTEGER
            -- Height of Current.

    left: INTEGER
            -- Horizontal position of left side

    right: INTEGER
            --  Horizontal position of right side.

    top: INTEGER
            -- Vertical position of top.

    width: INTEGER
            -- Width of Current.

    x: INTEGER
            -- Horizontal position.

    y: INTEGER
            -- Vertical position.

feature -- Status report

    has (c: EV_COORDINATE): BOOLEAN
            -- Is c inside Current?
        require
            c_not_void: c /= void

    has_x_y (a_x, a_y: INTEGER): BOOLEAN
            -- Is (a_x, a_y) inside Current?

    intersects (other: like Current): BOOLEAN
            -- Does other at least partially overlap Current?

    lower_left: EV_COORDINATE
            -- Lower-left corner of Current.
        ensure
            result_exists: Result /= void
            result_assigned: Result.x = x and then Result.y = y + height

    lower_right: EV_COORDINATE
            -- Lower-right corner of Current.
        ensure
            result_exists: Result /= void
            result_assigned: Result.x = x + width and then Result.y = y + height

    upper_left: EV_COORDINATE
            -- Upper-left corner of Current.
        ensure
            result_exists: Result /= void
            result_assigned: Result.x = x and then Result.y = y

    upper_right: EV_COORDINATE
            -- Upper-right corner of Current.
        ensure
            result_exists: Result /= void
            result_assigned: Result.x = x + width and then Result.y = y

feature -- Element change

    grow_bottom (i: INTEGER)
            -- Increment size by i to south.

    grow_left (i: INTEGER)
            -- Increment size by i to west.
        require
            width + i > 0

    grow_right (i: INTEGER)
            -- Increment size by i to east.

    grow_top (i: INTEGER)
            -- Increment size by i to north.
        require
            height + i > 0

    include (a_x, a_y: INTEGER)
            -- Enlarge so that a_x, a_y is in Current.

    include_point (c: EV_COORDINATE)
            -- Enlarge so that c is in Current.
        require
            c_not_void: c /= void
        ensure
            has_c: has (c)

    merge (other: like Current)
            -- Enlarge Current so that other fits inside.
        require
            other_not_void: other /= void

    move (a_x, a_y: INTEGER)
            -- Move to a_x and a_y.
        ensure
            x_assigned: x = a_x
            y_assigned: y = a_y

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER)
            -- Move to a_x and a_y and resize to a_width and a_height.
        require
            a_width_positive: a_width >= 0
            a_height_positive: a_height >= 0

    resize (a_width, a_height: INTEGER)
            -- Resize to a_width and a_height.
        require
            a_width_positive: a_width >= 0
            a_height_positive: a_height >= 0
        ensure
            width_assigned: width = a_width
            height_assigned: height = a_height

    set_bottom (i: INTEGER)
            -- Assign i to bottom.
        require
            i - y >= 0
        ensure
            assigned: bottom = i

    set_height (new_height: INTEGER)
            -- Assign new_height to height.
        require
            new_height_positive: new_height >= 0
        ensure
            height_assigned: height = new_height

    set_left (i: INTEGER)
            -- Assign i to left.
        require
            i <= right
        ensure
            assigned: left = i
            right_same: right = old right

    set_right (i: INTEGER)
            -- Assign i to right.
        require
            i - x >= 0
        ensure
            assigned: right = i

    set_top (i: INTEGER)
            -- Assign i to top.
        require
            i <= bottom
        ensure
            assigned: top = i
            bottom_same: bottom = old bottom

    set_width (new_width: INTEGER)
            -- Assign new_width to 'width'.
        require
            new_width_positive: new_width >= 0
        ensure
            width_assigned: width = new_width

    set_x (new_x: INTEGER)
            -- Assign new_x to x.
        ensure
            x_set: x = new_x

    set_y (new_y: INTEGER)
            -- Assign new_y to y.
        ensure
            y_set: y = new_y

feature -- Output

    out: STRING
            -- Return readable string.

invariant

    width_positive: width >= 0
    height_positive: height >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_RECTANGLE


EV_SCREEN Chart

class
    EV_SCREEN

General
    cluster: vision2.interface.kernel
    description: "Facilities for direct drawing on the screen."
    keywords: "screen, root, window, visual, top"
    create: default_create

Ancestors
    EV_DRAWABLE

Queries
    background_color: EV_COLOR
    clip_area: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    data: ANY
    drawing_mode: INTEGER
    font: EV_FONT
    foreground_color: EV_COLOR
    height: INTEGER
    is_destroyed: BOOLEAN
    line_width: INTEGER
    pointer_position: EV_COORDINATE
    tile: EV_PIXMAP
    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
    widget_at_position (x, y: INTEGER): EV_WIDGET
    width: INTEGER

Commands
    clear
    clear_rectangle (x, y, a_width, a_height: INTEGER)
    copy (other: [like Current] EV_SCREEN)
    destroy
    disable_dashed_line_style
    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
    draw_point (x, y: INTEGER)
    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
    draw_rectangle (x, y, a_width, a_height: INTEGER)
    draw_segment (x1, y1, x2, y2: INTEGER)
    draw_straight_line (x1, y1, x2, y2: INTEGER)
    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
    draw_text (x, y: INTEGER; a_text: STRING)
    draw_text_top_left (x, y: INTEGER; a_text: STRING)
    enable_dashed_line_style
    fake_key_click (a_key: EV_KEY)
    fake_key_press (a_key: EV_KEY)
    fake_key_release (a_key: EV_KEY)
    fake_pointer_button_click (a_button: INTEGER)
    fake_pointer_button_press (a_button: INTEGER)
    fake_pointer_button_release (a_button: INTEGER)
    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    fill_polygon (points: ARRAY [EV_COORDINATE])
    fill_rectangle (x, y, a_width, a_height: INTEGER)
    remove_clip_area
    remove_tile
    set_and_mode
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_clip_area (an_area: EV_RECTANGLE)
    set_copy_mode
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_drawing_mode (a_mode: INTEGER)
    set_font (a_font: EV_FONT)
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_invert_mode
    set_line_width (a_width: INTEGER)
    set_or_mode
    set_pointer_position (x, y: INTEGER)
    set_tile (a_pixmap: EV_PIXMAP)
    set_xor_mode

Constraints
    pointer position not negative


EV_SCREEN Flat contracts

indexing
    description: "Facilities for direct drawing on the screen."
    status: "See notice at end of class"
    keywords: "screen, root, window, visual, top"
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_SCREEN

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    clip_area: EV_RECTANGLE
            -- Rectangular area to apply clipping on.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.clip_area = void)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.dashed_line_style

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    drawing_mode: INTEGER
            -- Logical operation on pixels when drawing.
            -- Default: drawing_mode_copy.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.drawing_mode

    font: EV_FONT
            -- Typeface appearance for Current.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_FONTABLE
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    line_width: INTEGER
            -- Line thickness. Default: 1.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.line_width

    tile: EV_PIXMAP
            -- Pixmap that is used to draw filled primitives with
            -- instead of foreground_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.tile = void)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.height
            positive: Result > 0

    width: INTEGER
            -- Horizontal size in pixels.
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.width
            positive: Result > 0

feature -- Status report

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer.
        require
            not_destroyed: not is_destroyed

    widget_at_position (x, y: INTEGER): EV_WIDGET
            -- Widget at position (x, y) if any.
        require
            not_destroyed: not is_destroyed

feature -- Status setting

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

feature -- Element change

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_disabled: not dashed_line_style

    enable_dashed_line_style
            -- Draw lines dashed.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_enabled: dashed_line_style

    remove_clip_area
            -- Do not apply any clipping.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            clip_area_void: clip_area = void

    remove_tile
            -- Do not apply a tile when filling.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            tile_void: tile = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_clip_area (an_area: EV_RECTANGLE)
            -- Set area which will be refreshed.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            an_area_not_void: an_area /= void
        ensure -- from EV_DRAWABLE
            clip_area_assigned: clip_area.is_equal (an_area)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_drawing_mode (a_mode: INTEGER)
            -- Set drawing mode to a_logical_mode.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_mode_valid: valid_drawing_mode (a_mode)
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = a_mode

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void
        ensure -- from EV_FONTABLE
            font_assigned: font.is_equal (a_font)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_DRAWABLE
            line_width_assigned: line_width = a_width

    set_tile (a_pixmap: EV_PIXMAP)
            -- Set tile used to fill figures.
            -- Set to Void to use background_color to fill.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_DRAWABLE
            tile_assigned: tile /= void

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    fake_key_click (a_key: EV_KEY)
            -- Simulate the user clicking a key.
        require
            not_destroyed: not is_destroyed

    fake_key_press (a_key: EV_KEY)
            -- Simulate the user pressing a key.
        require
            not_destroyed: not is_destroyed

    fake_key_release (a_key: EV_KEY)
            -- Simulate the user releasing a key.
        require
            not_destroyed: not is_destroyed

    fake_pointer_button_click (a_button: INTEGER)
            -- Simulate the user clicking a_button on the pointing device.
        require
            not_destroyed: not is_destroyed

    fake_pointer_button_press (a_button: INTEGER)
            -- Simulate the user pressing a a_button on the pointing device.
        require
            not_destroyed: not is_destroyed

    fake_pointer_button_release (a_button: INTEGER)
            -- Simulate the user releasing a a_button on the pointing device.
        require
            not_destroyed: not is_destroyed

    set_pointer_position (x, y: INTEGER)
            -- Set pointer_position to (x,`y`).
        require
            not_destroyed: not is_destroyed

feature -- Clearing operations

    clear
            -- Erase Current with background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    clear_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height in background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature  -- Contract support

    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
            -- Is a_mode a valid drawing mode?
            -- (from EV_DRAWABLE_CONSTANTS)

feature -- Drawing mode setting

    set_and_mode
            -- Set drawing_mode to bitwise AND.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_and

    set_copy_mode
            -- Set drawing_mode to normal.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_copy

    set_invert_mode
            -- Set drawing_mode to bitwise invert.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_invert

    set_or_mode
            -- Set drawing_mode to bitwise OR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_or

    set_xor_mode
            -- Set drawing_mode to bitwise XOR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_xor

feature -- Drawing operations

    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- Angles are measured in radians, and go
            -- counterclockwise from the 3 o'clock angle.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_width >= 0

    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Draw an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the
            -- 3 o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
            -- Draw a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void

    draw_point (x, y: INTEGER)
            -- Draw point at (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
            -- Draw line segments between subsequent points in
            -- points. If is_closed draw line segment between first
            -- and last point in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    draw_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

    draw_segment (x1, y1, x2, y2: INTEGER)
            -- Draw line segment from (x1, y1) to (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_straight_line (x1, y1, x2, y2: INTEGER)
            -- Draw infinite straight line through (x1, y1) and
            -- (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
            -- Draw area of a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
            area_not_void: area /= void

    draw_text (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with left of baseline at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    draw_text_top_left (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with top left corner at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

feature -- Drawing operations (filled)

    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Fill an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Fill part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the 3
            -- o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_polygon (points: ARRAY [EV_COORDINATE])
            -- Draw filled polygon between subsequent points in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    fill_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw filled rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    pointer_position_not_negative: pointer_position.x >= 0 and pointer_position.y >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_DRAWABLE
    line_width_positive_or_zero: is_usable implies line_width >= 0
    drawing_mode_valid: is_usable implies valid_drawing_mode (drawing_mode)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void

end -- class EV_SCREEN


EV_SIMPLE_APPLICATION Chart

deferred class
    EV_SIMPLE_APPLICATION

General
    cluster: vision2.interface.kernel
    description:
        "Eiffel Vision Simple application.
        Base for root class in a simple application.
        Inherit and define `prepare'."
    keywords: "application, accelerator, event loop"

Ancestors
    EV_APPLICATION

Action sequences
    drop_actions: EV_PND_ACTION_SEQUENCE
    idle_actions: EV_NOTIFY_ACTION_SEQUENCE
    pick_actions: EV_PND_ACTION_SEQUENCE
    post_launch_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    alt_pressed: BOOLEAN
    clipboard: EV_CLIPBOARD
    contextual_help_accelerator: EV_ACCELERATOR
    ctrl_pressed: BOOLEAN
    data: ANY
    Default_tooltip_delay: INTEGER
    focused_widget: EV_WIDGET
    help_accelerator: EV_ACCELERATOR
    help_engine: EV_HELP_ENGINE
    is_destroyed: BOOLEAN
    is_launched: BOOLEAN
    locked_window: EV_WINDOW
    shift_pressed: BOOLEAN
    tooltip_delay: INTEGER
    windows: LINEAR [EV_WINDOW]

Commands
    copy (other: [like Current] EV_SIMPLE_APPLICATION)
    default_create
    destroy
    display_help_for_widget (a_widget: EV_WIDGET)
    do_once_on_idle (an_action: PROCEDURE [ANY, TUPLE])
    enable_contextual_help
    launch
    process_events
    set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR)
    set_data (some_data: [like data] ANY)
    set_help_accelerator (an_accelerator: EV_ACCELERATOR)
    set_help_engine (an_engine: EV_HELP_ENGINE)
    set_tooltip_delay (a_delay: INTEGER)
    sleep (msec: INTEGER)


EV_SIMPLE_APPLICATION Flat contracts

indexing
    description: "Eiffel Vision Simple application.Base for root class in a simple application.Inherit and define `prepare'."
    status: "See notice at end of class"
    keywords: "application, accelerator, event loop"
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_SIMPLE_APPLICATION

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    clipboard: EV_CLIPBOARD
            -- Native platform clipboard access.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed

    contextual_help_accelerator: EV_ACCELERATOR
            -- Accelerator that enables contextual help mode
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
        ensure -- from EV_APPLICATION
            bridge_ok: Result.is_equal (implementation.contextual_help_accelerator)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    help_accelerator: EV_ACCELERATOR
            -- Accelerator that displays contextual help
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
        ensure -- from EV_APPLICATION
            bridge_ok: Result.is_equal (implementation.help_accelerator)

    help_engine: EV_HELP_ENGINE
            -- Object that handles contextual help display requests
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
        ensure -- from EV_APPLICATION
            bridge_ok: Result.is_equal (implementation.help_engine)

    locked_window: EV_WINDOW
            -- Window currently locked. Void if no window
            -- is currently locked.
            --
            -- See `{EV_WINDOW}.lock_update' for more details
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed

    windows: LINEAR [EV_WINDOW]
            -- All of the application's windows.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
        ensure -- from EV_APPLICATION
            bridge_ok: Result.is_equal (implementation.windows)

feature -- Status report

    alt_pressed: BOOLEAN
            -- Is alt key currently pressed?
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed

    ctrl_pressed: BOOLEAN
            -- Is ctrl key currently pressed?
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed

    Default_tooltip_delay: INTEGER is 500
            -- Default delay in milleseconds of tool tips.
            -- (from EV_APPLICATION)

    focused_widget: EV_WIDGET
            -- Widget that has keyboard focus.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
        ensure -- from EV_APPLICATION
            bridge_ok: Result = implementation.focused_widget

    is_launched: BOOLEAN
            -- Has launch been called?
            -- (from EV_APPLICATION)

    shift_pressed: BOOLEAN
            -- Is shift key currently pressed?
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed

    tooltip_delay: INTEGER
            -- Time in milliseconds which the pointer must be stationary over
            -- a widget before a tooltips apears.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
        ensure -- from EV_APPLICATION
            bridge_ok: Result = implementation.tooltip_delay

feature -- Status setting

    set_tooltip_delay (a_delay: INTEGER)
            -- Assign a_delay to tooltip_delay.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            a_delay_non_negative: a_delay >= 0
        ensure -- from EV_APPLICATION
            assigned: tooltip_delay = a_delay

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    display_help_for_widget (a_widget: EV_WIDGET)
            -- Display contextual help for a_widget, if any.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            a_widget_not_void: a_widget /= void

    enable_contextual_help
            -- Change mouse cursor to help cursor.
            -- Capture mouse input.
            -- Send help context of widget being clicked to help engine for
            -- Processing.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed

    launch
            -- Start the application.
            -- Call prepare the Begin event processing.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            not_already_launched: not is_launched
        ensure -- from EV_APPLICATION
            is_launched: is_launched

    process_events
            -- Process any pending events.
            -- Pass control to the underlying native toolkit so that it can
            -- handle any events that may be in its queue.
            -- (Should be called from time to time during extended computation.)
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            is_launched: is_launched

    sleep (msec: INTEGER)
            -- Wait for msec milliseconds and return.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            msec_non_negative: msec >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Element Change

    set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR)
            -- Assign an_accelerator to contextual_help_accelerator
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            an_accelerator_not_void: an_accelerator /= void
        ensure -- from EV_APPLICATION
            contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

    set_help_accelerator (an_accelerator: EV_ACCELERATOR)
            -- Assign an_accelerator to help_accelerator
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            an_accelerator_not_void: an_accelerator /= void
        ensure -- from EV_APPLICATION
            help_accelerator_assigned: help_accelerator = an_accelerator

    set_help_engine (an_engine: EV_HELP_ENGINE)
            -- Assign an_engine to help_engine
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed
            an_engine_not_void: an_engine /= void
        ensure -- from EV_APPLICATION
            help_engine_set: help_engine = an_engine

feature -- Event handling

    do_once_on_idle (an_action: PROCEDURE [ANY, TUPLE])
            -- Perform an_action one time when the application is next idle.
            -- (from EV_APPLICATION)
        require -- from EV_APPLICATION
            not_destroyed: not is_destroyed

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when any "drop" occurs.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

    idle_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when the application is otherwise idle.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when any "pick" occurs.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

    post_launch_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed just after application launch.
            -- (from EV_APPLICATION_ACTION_SEQUENCES)
        ensure -- from EV_APPLICATION_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_APPLICATION
    tooltip_delay_not_negative: tooltip_delay >= 0
    windows_not_void: windows /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_SIMPLE_APPLICATION


EV_TIMEOUT Chart

class
    EV_TIMEOUT

General
    cluster: vision2.interface.kernel
    description: "Repeatedly executes a sequence of `actions' at a regular `interval'."
    keywords: "timout, delay, timer, background"
    create: make_with_interval, default_create

Ancestors
    EV_ANY

Action sequences
    actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    count: INTEGER
    data: ANY
    interval: INTEGER
    is_destroyed: BOOLEAN

Commands
    copy (other: [like Current] EV_TIMEOUT)
    destroy
    reset_count
    set_data (some_data: [like data] ANY)
    set_interval (an_interval: INTEGER)

Constraints
    interval not negative
    count not negative
    actions not void


EV_TIMEOUT Flat contracts

indexing
    description: "Repeatedly executes a sequence of `actions' at a regular `interval'."
    status: "See notice at end of class"
    keywords: "timout, delay, timer, background"
    date: "$Date: 2001/07/13 15:28:47 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_TIMEOUT

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_interval (an_interval: INTEGER)
            -- Create with an_interval in milliseconds.
        require
            an_interval_not_negative: an_interval >= 0

feature -- Access

    actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed at a regular interval.
            -- Only called when interval is greater than 0.

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    interval: INTEGER
            -- Time between calls to actions in milliseconds.
            -- If 0, then actions are disabled.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.interval

    set_interval (an_interval: INTEGER)
            -- Assign an_interval in milliseconds to interval.
            -- If an_interval is 0, actions are disabled.
        require
            not_destroyed: not is_destroyed
            an_interval_not_negative: an_interval >= 0
        ensure
            interval_assigned: interval = an_interval
            count_not_changed: count = old count

feature -- Status report

    count: INTEGER
            -- Number of times actions have been called since last
            -- call to reset_count.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.count

feature -- Status setting

    reset_count
            -- Set count to 0.
        require
            not_destroyed: not is_destroyed
        ensure
            count_is_zero: count = 0

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    interval_not_negative: interval >= 0
    count_not_negative: count >= 0
    actions_not_void: actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_TIMEOUT


cluster vision2.interface.properties

Cluster
    vision2.interface.properties

Supercluster
    vision2.interface

Subclusters

Classes
    EV_ABSTRACT_PICK_AND_DROPABLE
    EV_COLORIZABLE
    EV_CONTAINABLE
    EV_DESELECTABLE
    EV_DRAWABLE
    EV_FONTABLE
    EV_HELP_CONTEXTABLE
    EV_PICK_AND_DROPABLE
    EV_PIXMAPABLE
    EV_POSITIONABLE
    EV_POSITIONED
    EV_SELECTABLE
    EV_SENSITIVE
    EV_TEXTABLE
    EV_TOOLTIPABLE


EV_ABSTRACT_PICK_AND_DROPABLE Chart

deferred class
    EV_ABSTRACT_PICK_AND_DROPABLE

General
    cluster: vision2.interface.properties
    description:
        "Abstract interface for all pick and dropable classes.
        Descendants include: widgets, items and figures."
    keywords: "pick and drop, figure, widget, item"

Ancestors
    IDENTIFIED

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_equal (other: [like Current] EV_ABSTRACT_PICK_AND_DROPABLE): BOOLEAN
    object_id: INTEGER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    target_name: STRING

Commands
    copy (other: [like Current] EV_ABSTRACT_PICK_AND_DROPABLE)
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_target_name (a_name: STRING)


EV_ABSTRACT_PICK_AND_DROPABLE Flat contracts

indexing
    description: "Abstract interface for all pick and dropable classes.Descendants include: widgets, items and figures."
    status: "See notice at end of class"
    keywords: "pick and drop, figure, widget, item"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_ABSTRACT_PICK_AND_DROPABLE

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is other attached to an object considered
            -- equal to current object?
            -- (from IDENTIFIED)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status setting

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
        ensure
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
        ensure
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
        ensure
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
        require
            a_pebble_not_void: a_pebble /= void
        ensure
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
        require
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure
            pebble_function_assigned: pebble_function = a_function

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
        require
            a_name_not_void: a_name /= void
        ensure
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from IDENTIFIED)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- User input events

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits this hole is
            -- picked up from another source.
            -- (when drop_actions.accepts_pebble (pebble))

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to take when pick and drop transport drops on Current.

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_ABSTRACT_PICK_AND_DROPABLE


EV_COLORIZABLE Chart

deferred class
    EV_COLORIZABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that can change color."
    keywords: "color, colored, colorable, colorizable, colorize"

Ancestors
    EV_ANY

Queries
    background_color: EV_COLOR
    data: ANY
    foreground_color: EV_COLOR
    is_destroyed: BOOLEAN

Commands
    copy (other: [like Current] EV_COLORIZABLE)
    destroy
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)

Constraints
    background color not void
    foreground color not void


EV_COLORIZABLE Flat contracts

indexing
    description: "Abstraction for objects that can change color."
    status: "See notice at end of class"
    keywords: "color, colored, colorable, colorizable, colorize"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_COLORIZABLE

feature -- Access

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.foreground_color)

feature -- Status setting

    set_default_colors
            -- Set foreground and background color to their default values.
        require
            not_destroyed: not is_destroyed

feature -- Element change

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
        require
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
        require
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure
            foreground_color_assigned: foreground_color.is_equal (a_color)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_COLORIZABLE


EV_CONTAINABLE Chart

deferred class
    EV_CONTAINABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that may be parented."
    keywords: "parentable, containable, child"

Ancestors
    EV_ANY

Queries
    data: ANY
    is_destroyed: BOOLEAN
    parent: EV_ANY

Commands
    copy (other: [like Current] EV_CONTAINABLE)
    destroy
    set_data (some_data: [like data] ANY)


EV_CONTAINABLE Flat contracts

indexing
    description: "Abstraction for objects that may be parented."
    status: "See notice at end of class"
    keywords: "parentable, containable, child"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_CONTAINABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Status report

    parent: EV_ANY
            -- The parent that Current is contained within, if any.
        require
            not_destroyed: not is_destroyed

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_CONTAINABLE


EV_DESELECTABLE Chart

deferred class
    EV_DESELECTABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that may be selected/unselected."
    keywords: "deselect, deselectable, select, selected, selectable"

Ancestors
    EV_SELECTABLE

Queries
    data: ANY
    is_destroyed: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN

Commands
    copy (other: [like Current] EV_DESELECTABLE)
    destroy
    disable_select
    enable_select
    set_data (some_data: [like data] ANY)
    toggle

Constraints
    not selectable therefore not selected


EV_DESELECTABLE Flat contracts

indexing
    description: "Abstraction for objects that may be selected/unselected."
    status: "See notice at end of class"
    keywords: "deselect, deselectable, select, selected, selectable"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_DESELECTABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Status report

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

feature -- Status setting

    disable_select
            -- Deselect the object.
        require
            not_destroyed: not is_destroyed
        ensure
            unselected: not is_selected

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    toggle
            -- Change is_selected.
        require
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure
            is_selected_changed: is_selected /= old is_selected

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    not_selectable_therefore_not_selected: not is_selectable implies not is_selected
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_DESELECTABLE


EV_DRAWABLE Chart

deferred class
    EV_DRAWABLE

General
    cluster: vision2.interface.properties
    description:
        "Abstraction for objects onto which graphical primitives may be
        applied."
    keywords: "figure, primitive, drawing, line, point, ellipse"

Ancestors
    EV_ANY
    EV_COLORIZABLE
    EV_DRAWABLE_CONSTANTS
    EV_FONTABLE

Queries
    background_color: EV_COLOR
    clip_area: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    data: ANY
    drawing_mode: INTEGER
    font: EV_FONT
    foreground_color: EV_COLOR
    height: INTEGER
    is_destroyed: BOOLEAN
    line_width: INTEGER
    tile: EV_PIXMAP
    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
    width: INTEGER

Commands
    clear
    clear_rectangle (x, y, a_width, a_height: INTEGER)
    copy (other: [like Current] EV_DRAWABLE)
    destroy
    disable_dashed_line_style
    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
    draw_point (x, y: INTEGER)
    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
    draw_rectangle (x, y, a_width, a_height: INTEGER)
    draw_segment (x1, y1, x2, y2: INTEGER)
    draw_straight_line (x1, y1, x2, y2: INTEGER)
    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
    draw_text (x, y: INTEGER; a_text: STRING)
    draw_text_top_left (x, y: INTEGER; a_text: STRING)
    enable_dashed_line_style
    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    fill_polygon (points: ARRAY [EV_COORDINATE])
    fill_rectangle (x, y, a_width, a_height: INTEGER)
    remove_clip_area
    remove_tile
    set_and_mode
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_clip_area (an_area: EV_RECTANGLE)
    set_copy_mode
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_drawing_mode (a_mode: INTEGER)
    set_font (a_font: EV_FONT)
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_invert_mode
    set_line_width (a_width: INTEGER)
    set_or_mode
    set_tile (a_pixmap: EV_PIXMAP)
    set_xor_mode

Constraints
    line width positive or zero
    drawing mode valid


EV_DRAWABLE Flat contracts

indexing
    description: "Abstraction for objects onto which graphical primitives may beapplied."
    note: "When line style is dashed and line width is bigger than one,lines are not guaranteed to be dashed on all platforms.All drawing operations are performed in the currentforeground color unless otherwise stated. i.e. `clear_rectangle' uses the current background color."
    status: "See notice at end of class"
    keywords: "figure, primitive, drawing, line, point, ellipse"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_DRAWABLE

feature -- Access

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    clip_area: EV_RECTANGLE
            -- Rectangular area to apply clipping on.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: (Result = void) = (implementation.clip_area = void)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.dashed_line_style

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    drawing_mode: INTEGER
            -- Logical operation on pixels when drawing.
            -- Default: drawing_mode_copy.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.drawing_mode

    font: EV_FONT
            -- Typeface appearance for Current.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_FONTABLE
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    line_width: INTEGER
            -- Line thickness. Default: 1.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.line_width

    tile: EV_PIXMAP
            -- Pixmap that is used to draw filled primitives with
            -- instead of foreground_color.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: (Result = void) = (implementation.tile = void)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
        require
            not_destroyed: not is_destroyed

    width: INTEGER
            -- Horizontal size in pixels.
        require
            not_destroyed: not is_destroyed

feature -- Status setting

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

feature -- Element change

    disable_dashed_line_style
            -- Draw lines solid.
        require
            not_destroyed: not is_destroyed
        ensure
            dashed_line_style_disabled: not dashed_line_style

    enable_dashed_line_style
            -- Draw lines dashed.
            -- See note at top.
        require
            not_destroyed: not is_destroyed
        ensure
            dashed_line_style_enabled: dashed_line_style

    remove_clip_area
            -- Do not apply any clipping.
        require
            not_destroyed: not is_destroyed
        ensure
            clip_area_void: clip_area = void

    remove_tile
            -- Do not apply a tile when filling.
        require
            not_destroyed: not is_destroyed
        ensure
            tile_void: tile = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_clip_area (an_area: EV_RECTANGLE)
            -- Set area which will be refreshed.
        require
            not_destroyed: not is_destroyed
            an_area_not_void: an_area /= void
        ensure
            clip_area_assigned: clip_area.is_equal (an_area)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_drawing_mode (a_mode: INTEGER)
            -- Set drawing mode to a_logical_mode.
        require
            not_destroyed: not is_destroyed
            a_mode_valid: valid_drawing_mode (a_mode)
        ensure
            drawing_mode_assigned: drawing_mode = a_mode

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void
        ensure -- from EV_FONTABLE
            font_assigned: font.is_equal (a_font)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- See note at top.
        require
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
        ensure
            line_width_assigned: line_width = a_width

    set_tile (a_pixmap: EV_PIXMAP)
            -- Set tile used to fill figures.
            -- Set to Void to use background_color to fill.
        require
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure
            tile_assigned: tile /= void

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Clearing operations

    clear
            -- Erase Current with background_color.
        require
            not_destroyed: not is_destroyed

    clear_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height in background_color.
        require
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature  -- Contract support

    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
            -- Is a_mode a valid drawing mode?
            -- (from EV_DRAWABLE_CONSTANTS)

feature -- Drawing mode setting

    set_and_mode
            -- Set drawing_mode to bitwise AND.
        require
            not_destroyed: not is_destroyed
        ensure
            drawing_mode_assigned: drawing_mode = drawing_mode_and

    set_copy_mode
            -- Set drawing_mode to normal.
        require
            not_destroyed: not is_destroyed
        ensure
            drawing_mode_assigned: drawing_mode = drawing_mode_copy

    set_invert_mode
            -- Set drawing_mode to bitwise invert.
        require
            not_destroyed: not is_destroyed
        ensure
            drawing_mode_assigned: drawing_mode = drawing_mode_invert

    set_or_mode
            -- Set drawing_mode to bitwise OR.
        require
            not_destroyed: not is_destroyed
        ensure
            drawing_mode_assigned: drawing_mode = drawing_mode_or

    set_xor_mode
            -- Set drawing_mode to bitwise XOR.
        require
            not_destroyed: not is_destroyed
        ensure
            drawing_mode_assigned: drawing_mode = drawing_mode_xor

feature -- Drawing operations

    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- Angles are measured in radians, and go
            -- counterclockwise from the 3 o'clock angle.
        require
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_width >= 0

    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Draw an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
        require
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the
            -- 3 o'clock angle and grow counterclockwise.
        require
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
            -- Draw a_pixmap with upper-left corner on (x, y).
        require
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void

    draw_point (x, y: INTEGER)
            -- Draw point at (x, y).
        require
            not_destroyed: not is_destroyed

    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
            -- Draw line segments between subsequent points in
            -- points. If is_closed draw line segment between first
            -- and last point in points.
        require
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    draw_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
        require
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

    draw_segment (x1, y1, x2, y2: INTEGER)
            -- Draw line segment from (x1, y1) to (x2, y2).
        require
            not_destroyed: not is_destroyed

    draw_straight_line (x1, y1, x2, y2: INTEGER)
            -- Draw infinite straight line through (x1, y1) and
            -- (x2, y2).
        require
            not_destroyed: not is_destroyed

    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
            -- Draw area of a_pixmap with upper-left corner on (x, y).
        require
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
            area_not_void: area /= void

    draw_text (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with left of baseline at (x, y) using font.
        require
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    draw_text_top_left (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with top left corner at (x, y) using font.
        require
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

feature -- Drawing operations (filled)

    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Fill an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
        require
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Fill part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the 3
            -- o'clock angle and grow counterclockwise.
        require
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_polygon (points: ARRAY [EV_COORDINATE])
            -- Draw filled polygon between subsequent points in points.
        require
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    fill_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw filled rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
        require
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    line_width_positive_or_zero: is_usable implies line_width >= 0
    drawing_mode_valid: is_usable implies valid_drawing_mode (drawing_mode)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void

end -- class EV_DRAWABLE


EV_FONTABLE Chart

deferred class
    EV_FONTABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that have a font property."
    keywords: "font, name, property"

Ancestors
    EV_ANY

Queries
    data: ANY
    font: EV_FONT
    is_destroyed: BOOLEAN

Commands
    copy (other: [like Current] EV_FONTABLE)
    destroy
    set_data (some_data: [like data] ANY)
    set_font (a_font: EV_FONT)


EV_FONTABLE Flat contracts

indexing
    description: "Abstraction for objects that have a font property."
    status: "See notice at end of class"
    keywords: "font, name, property"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_FONTABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    font: EV_FONT
            -- Typeface appearance for Current.
        require
            not_destroyed: not is_destroyed
        ensure
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
        require
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void
        ensure
            font_assigned: font.is_equal (a_font)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_FONTABLE


EV_HELP_CONTEXTABLE Chart

deferred class
    EV_HELP_CONTEXTABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that support active help contexts."
    keywords: "help"

Ancestors
    EV_ANY

Queries
    data: ANY
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    is_destroyed: BOOLEAN

Commands
    copy (other: [like Current] EV_HELP_CONTEXTABLE)
    destroy
    remove_help_context
    set_data (some_data: [like data] ANY)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])


EV_HELP_CONTEXTABLE Flat contracts

indexing
    description: "Abstraction for objects that support active help contexts."
    status: "See notice at end of class"
    keywords: "help"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_HELP_CONTEXTABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.help_context

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
        require
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure
            no_help_context: help_context = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
        require
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure
            help_context_assigned: help_context.is_equal (an_help_context)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_HELP_CONTEXTABLE


EV_PICK_AND_DROPABLE Chart

deferred class
    EV_PICK_AND_DROPABLE

General
    cluster: vision2.interface.properties
    description:
        "Facilities for pick and drop mechanism.
        Decendents can act both as pick and drop sources and as targets.
        When the user picks a `pebble' from a source and drops on a target,the `drop_actions' of the target receive the `pebble' as input.
        The user interface can be either pick and drop or drag and drop,selected by `set_pick_and_drop' and `set_drag_and_drop'."
    keywords: "pick and drop, drag and drop, source, PND, DND"

Ancestors
    EV_ABSTRACT_PICK_AND_DROPABLE
    EV_ANY
    EV_PICK_AND_DROPABLE_ACTION_SEQUENCES

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    data: ANY
    deny_cursor: EV_CURSOR
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    target_name: STRING

Commands
    copy (other: [like Current] EV_PICK_AND_DROPABLE)
    default_create
    destroy
    disable_pebble_positioning
    enable_pebble_positioning
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_data (some_data: [like data] ANY)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_target_menu_mode
    set_target_name (a_name: STRING)

Constraints
    user interface modes mutually exclusive


EV_PICK_AND_DROPABLE Flat contracts

indexing
    description: "Facilities for pick and drop mechanism.Decendents can act both as pick and drop sources and as targets.When the user picks a `pebble' from a source and drops on a target,the `drop_actions' of the target receive the `pebble' as input.The user interface can be either pick and drop or drag and drop,selected by `set_pick_and_drop' and `set_drag_and_drop'."
    example: "Create two buttons one with the string "Hello world!" as pebbleand the other with io~put_string as a drop action.Picking the first button and dropping on the second will print:"Hello world!".b1, b2: BUTTONcreate b1; create b2b1.set_pebble ("Hello world!")b2.drop_actions.extend (io~put_string)"
    status: "See notice at end of class"
    keywords: "pick and drop, drag and drop, source, PND, DND"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_PICK_AND_DROPABLE

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
        ensure then
            bridge_ok: Result = implementation.accept_cursor

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
        ensure then
            bridge_ok: Result = implementation.deny_cursor

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
        ensure then
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
        ensure then
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
        require
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
        ensure then
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
        ensure then
            bridge_ok: Result = implementation.pebble_y_position

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Status report

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
        require
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
        require
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
        require
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
        require
            not_destroyed: not is_destroyed
        ensure
            pebble_positioning_updated: not pebble_positioning_enabled

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
        require
            not_destroyed: not is_destroyed
        ensure
            pebble_positioning_updated: pebble_positioning_enabled

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
        require
            not_destroyed: not is_destroyed
        ensure
            drag_and_drop_set: mode_is_drag_and_drop

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
        require
            not_destroyed: not is_destroyed
        ensure
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
        require
            not_destroyed: not is_destroyed
        ensure
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
        require
            not_destroyed: not is_destroyed
        ensure
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- User input events

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

invariant

    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_PICK_AND_DROPABLE


EV_PIXMAPABLE Chart

deferred class
    EV_PIXMAPABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that have a pixmap property."
    keywords: "pixmap, bitmap, icon, graphic, image"

Ancestors
    EV_ANY

Queries
    data: ANY
    is_destroyed: BOOLEAN
    pixmap: EV_PIXMAP

Commands
    copy (other: [like Current] EV_PIXMAPABLE)
    destroy
    remove_pixmap
    set_data (some_data: [like data] ANY)
    set_pixmap (a_pixmap: EV_PIXMAP)


EV_PIXMAPABLE Flat contracts

indexing
    description: "Abstraction for objects that have a pixmap property."
    status: "See notice at end of class"
    keywords: "pixmap, bitmap, icon, graphic, image"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_PIXMAPABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

feature -- Element change

    remove_pixmap
            -- Make pixmap Void.
        require
            not_destroyed: not is_destroyed
        ensure
            pixmap_removed: pixmap = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
        require
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_PIXMAPABLE


EV_POSITIONABLE Chart

deferred class
    EV_POSITIONABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects whos position can be set."
    keywords: "position, width, height"

Ancestors
    EV_POSITIONED

Queries
    data: ANY
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_POSITIONABLE)
    destroy
    set_data (some_data: [like data] ANY)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)


EV_POSITIONABLE Flat contracts

indexing
    description: "Abstraction for objects whos position can be set."
    status: "See notice at end of class"
    keywords: "position, width, height"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_POSITIONABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
        require
            a_height_positive_or_zero: a_height >= 0
        ensure
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
        ensure
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
        require
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
        require
            a_width_positive_or_zero: a_width >= 0
        ensure
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
        ensure
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
        ensure
            y_position_assigned: y_position = a_y

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_POSITIONABLE


EV_POSITIONED Chart

deferred class
    EV_POSITIONED

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that have geometric position."
    keywords: "position, width, height"

Ancestors
    EV_ANY

Queries
    data: ANY
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_POSITIONED)
    destroy
    set_data (some_data: [like data] ANY)

Constraints
    width not negative
    height not negative
    minimum width not negative
    minimum height not negative


EV_POSITIONED Flat contracts

indexing
    description: "Abstraction for objects that have geometric position."
    status: "See notice at end of class"
    keywords: "position, width, height"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_POSITIONED

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.y_position

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_POSITIONED


EV_SELECTABLE Chart

deferred class
    EV_SELECTABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that may be selected."
    keywords: "select, selected, selectable"

Ancestors
    EV_ANY

Queries
    data: ANY
    is_destroyed: BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN

Commands
    copy (other: [like Current] EV_SELECTABLE)
    destroy
    enable_select
    set_data (some_data: [like data] ANY)


EV_SELECTABLE Flat contracts

indexing
    description: "Abstraction for objects that may be selected."
    status: "See notice at end of class"
    keywords: "select, selected, selectable"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_SELECTABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Status report

    is_selectable: BOOLEAN
            -- May enable_select be called.
        require
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_selected

feature -- Status setting

    enable_select
            -- Make is_selected True.
        require
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure
            is_selected: is_selected

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_SELECTABLE


EV_SENSITIVE Chart

deferred class
    EV_SENSITIVE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that may ignore user input."
    keywords: "sensitive, sensitivity, input"

Ancestors
    EV_CONTAINABLE

Queries
    data: ANY
    is_destroyed: BOOLEAN
    is_sensitive: BOOLEAN
    parent: EV_ANY

Commands
    copy (other: [like Current] EV_SENSITIVE)
    destroy
    disable_sensitive
    enable_sensitive
    set_data (some_data: [like data] ANY)


EV_SENSITIVE Flat contracts

indexing
    description: "Abstraction for objects that may ignore user input."
    status: "See notice at end of class"
    keywords: "sensitive, sensitivity, input"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_SENSITIVE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Status report

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.user_is_sensitive

    parent: EV_ANY
            -- The parent that Current is contained within, if any.
            -- (from EV_CONTAINABLE)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed

feature -- Status setting

    disable_sensitive
            -- Make object non-sensitive to user input.
        require
            not_destroyed: not is_destroyed
        ensure
            is_unsensitive: not is_sensitive

    enable_sensitive
            -- Make object sensitive to user input.
        require
            not_destroyed: not is_destroyed
        ensure
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_SENSITIVE


EV_TEXTABLE Chart

deferred class
    EV_TEXTABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that have a text label."
    keywords: "text, label, font, name, property"

Ancestors
    EV_ANY

Queries
    alignment: EV_TEXT_ALIGNMENT
    data: ANY
    is_destroyed: BOOLEAN
    text: STRING

Commands
    align_text_center
    align_text_left
    align_text_right
    copy (other: [like Current] EV_TEXTABLE)
    destroy
    remove_text
    set_data (some_data: [like data] ANY)
    set_text (a_text: STRING)

Constraints
    text not void implies text not empty


EV_TEXTABLE Flat contracts

indexing
    description: "Abstraction for objects that have a text label."
    status: "See notice at end of class"
    keywords: "text, label, font, name, property"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_TEXTABLE

feature -- Access

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
        require
            not_destroyed: not is_destroyed
        ensure
            alignment_not_void: Result /= void

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    text: STRING
            -- Text displayed in textable.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

feature -- Status setting

    align_text_center
            -- Display text centered.
        require
            not_destroyed: not is_destroyed
        ensure
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
        require
            not_destroyed: not is_destroyed
        ensure
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
        require
            not_destroyed: not is_destroyed
        ensure
            alignment_set: alignment.is_right_aligned

feature -- Element change

    remove_text
            -- Make text Void.
        require
            not_destroyed: not is_destroyed
        ensure
            text_removed: text = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_text (a_text: STRING)
            -- Assign a_text to text.
        require
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure
            text_cloned: text.is_equal (a_text) and then text /= a_text

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_TEXTABLE


EV_TOOLTIPABLE Chart

deferred class
    EV_TOOLTIPABLE

General
    cluster: vision2.interface.properties
    description: "Abstraction for objects that have a tooltip property."
    keywords: "tooltip, popup, hint"

Ancestors
    EV_ANY

Queries
    data: ANY
    is_destroyed: BOOLEAN
    tooltip: STRING

Commands
    copy (other: [like Current] EV_TOOLTIPABLE)
    destroy
    remove_tooltip
    set_data (some_data: [like data] ANY)
    set_tooltip (a_tooltip: STRING)


EV_TOOLTIPABLE Flat contracts

indexing
    description: "Abstraction for objects that have a tooltip property."
    status: "See notice at end of class"
    keywords: "tooltip, popup, hint"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_TOOLTIPABLE

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    tooltip: STRING
            -- Tooltip displayed on Current.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Element change

    remove_tooltip
            -- Make tooltip Void.
        require
            not_destroyed: not is_destroyed
        ensure
            tooltip_removed: tooltip = void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
        require
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_TOOLTIPABLE


cluster vision2.interface.support

Cluster
    vision2.interface.support

Supercluster
    vision2.interface

Subclusters

Classes
    EV_ACCELERATOR_LIST
    EV_BMP_FORMAT
    EV_DIALOG_CONSTANTS
    EV_DRAWABLE_CONSTANTS
    EV_DYNAMIC_LIST [G -> EV_CONTAINABLE]
    EV_DYNAMIC_LIST_CURSOR [G]
    EV_FONT_CONSTANTS
    EV_GRAPHICAL_FORMAT
    EV_HELP_CONTEXT
    EV_HELP_ENGINE
    EV_ITEM_LIST [G -> EV_ITEM]
    EV_KEY_CONSTANTS
    EV_PNG_FORMAT
    EV_POSTSCRIPT_PAGE_CONSTANTS
    EV_PRINT_CONTEXT
    EV_PRINT_PROJECTOR
    EV_RADIO_PEER
    EV_RAW_IMAGE_DATA
    EV_SIMPLE_HELP_CONTEXT
    EV_SIMPLE_HELP_ENGINE
    EV_STOCK_COLORS
    EV_STOCK_PIXMAPS
    EV_TEXT_ALIGNMENT
    EV_TEXT_RICH_ALIGNMENT
    EV_TREE_NODE_LIST


EV_ACCELERATOR_LIST Chart

class
    EV_ACCELERATOR_LIST

General
    cluster: vision2.interface.support
    description: "Objects that store a list of unique keyboard accelerators."
    keywords: "accelerator, shortcut"

Ancestors
    ACTIVE_LIST [G]

Action sequences
    add_actions: ACTION_SEQUENCE [TUPLE [EV_ACCELERATOR]]
    remove_actions: ACTION_SEQUENCE [TUPLE [EV_ACCELERATOR]]

Queries
    infix "@" (i: INTEGER): [like item] EV_ACCELERATOR
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] EV_ACCELERATOR_LIST
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_ACCELERATOR
    for_all (test: FUNCTION [ANY, TUPLE [EV_ACCELERATOR], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] EV_ACCELERATOR): BOOLEAN
    i_th (i: INTEGER): [like item] EV_ACCELERATOR
    index: INTEGER
    index_of (v: [like item] EV_ACCELERATOR; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_ACCELERATOR_LIST): BOOLEAN
    is_inserted (v: EV_ACCELERATOR): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_ACCELERATOR
    last: [like item] EV_ACCELERATOR
    linear_representation: LINEAR [EV_ACCELERATOR]
    object_comparison: BOOLEAN
    occurrences (v: [like item] EV_ACCELERATOR): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: EV_ACCELERATOR): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [EV_ACCELERATOR], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [EV_ACCELERATOR])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_ACCELERATOR_LIST)
    default_create
    do_all (action: PROCEDURE [ANY, TUPLE [EV_ACCELERATOR]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_ACCELERATOR]]; test: FUNCTION [ANY, TUPLE [EV_ACCELERATOR], BOOLEAN])
    extend (v: [like item] EV_ACCELERATOR)
    fill (other: CONTAINER [EV_ACCELERATOR])
    finish
    force (v: [like item] EV_ACCELERATOR)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] EV_ACCELERATOR_LIST)
    merge_right (other: [like Current] EV_ACCELERATOR_LIST)
    move (i: INTEGER)
    on_item_added (an_item: EV_ACCELERATOR)
    on_item_removed (an_item: EV_ACCELERATOR)
    prune (v: [like item] EV_ACCELERATOR)
    prune_all (v: [like item] EV_ACCELERATOR)
    put (v: [like item] EV_ACCELERATOR)
    put_front (v: [like item] EV_ACCELERATOR)
    put_i_th (v: [like item] EV_ACCELERATOR; i: INTEGER)
    put_left (v: [like item] EV_ACCELERATOR)
    put_right (v: [like item] EV_ACCELERATOR)
    remove
    remove_left
    remove_right
    replace (v: [like item] EV_ACCELERATOR)
    search (v: [like item] EV_ACCELERATOR)
    start
    swap (i: INTEGER)
    wipe_out


EV_ACCELERATOR_LIST Flat contracts

indexing
    description: "Objects that store a list of unique keyboard accelerators."
    status: "See notice at end of class."
    keywords: "accelerator, shortcut"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_ACCELERATOR_LIST

feature -- Initialization

    default_create
            -- Standard creation procedure.

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    add_actions: ACTION_SEQUENCE [TUPLE [EV_ACCELERATOR]]
            -- Actions performed when an item has just been added.
            -- (from ACTIVE_LIST)

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: EV_ACCELERATOR
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: EV_ACCELERATOR): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    remove_actions: ACTION_SEQUENCE [TUPLE [EV_ACCELERATOR]]
            -- Actions performed when an item has just been removed.
            -- (from ACTIVE_LIST)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_ACCELERATOR): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_ACCELERATOR])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    fill (other: CONTAINER [EV_ACCELERATOR])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    wipe_out
            -- Remove all items.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [EV_ACCELERATOR]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Miscellaneous

    on_item_added (an_item: EV_ACCELERATOR)
            -- an_item has just been added.
            -- (from ACTIVE_LIST)
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void

    on_item_removed (an_item: EV_ACCELERATOR)
            -- an_item has just been removed.
            -- (from ACTIVE_LIST)
        require -- from INTERACTIVE_LIST
            an_item_not_void: an_item /= void

feature -- Element Change

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    merge_left (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from INTERACTIVE_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from INTERACTIVE_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_ACCELERATOR]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_ACCELERATOR]]; test: FUNCTION [ANY, TUPLE [EV_ACCELERATOR], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_ACCELERATOR], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_ACCELERATOR], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ACTIVE_LIST
    add_actions_not_void: add_actions /= void
    remove_actions_not_void: remove_actions /= void
        -- from INTERACTIVE_LIST
    consistency_count_equal_to_count: consistency_count = count
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_ACCELERATOR_LIST


EV_BMP_FORMAT Chart

class
    EV_BMP_FORMAT

General
    cluster: vision2.interface.support
    description: ""

Ancestors
    EV_GRAPHICAL_FORMAT

Queries
    color_mode: INTEGER
    scale_height: INTEGER
    scale_width: INTEGER

Commands
    set_greyscale
    set_paletted
    set_scale_height (a_height: INTEGER)
    set_scale_width (a_width: INTEGER)
    set_truecolor


EV_BMP_FORMAT Flat contracts

indexing
    description: ""
    status: "See notice at end of class"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_BMP_FORMAT

feature -- Access

    color_mode: INTEGER
            -- Color output mode of Current
            -- (from EV_GRAPHICAL_FORMAT)

    scale_height: INTEGER
            -- Height to scale graphic to, 0 means no scaling.
            -- (from EV_GRAPHICAL_FORMAT)

    scale_width: INTEGER
            -- Width to scale graphic to, 0 means no scaling.
            -- (from EV_GRAPHICAL_FORMAT)

feature -- Status Setting

    set_greyscale
            -- Set color_mode to grayscale.
            -- (from EV_GRAPHICAL_FORMAT)

    set_paletted
            -- Set color_mode to paletted mode.
            -- (from EV_GRAPHICAL_FORMAT)

    set_scale_height (a_height: INTEGER)
            -- Scale the graphic height to a_height.
            -- (from EV_GRAPHICAL_FORMAT)
        require -- from EV_GRAPHICAL_FORMAT
            a_height_not_negative: a_height >= 0
        ensure -- from EV_GRAPHICAL_FORMAT
            scale_height_set: scale_height = a_height

    set_scale_width (a_width: INTEGER)
            -- Scale the graphic width to a_width.
            -- (from EV_GRAPHICAL_FORMAT)
        require -- from EV_GRAPHICAL_FORMAT
            a_width_not_negative: a_width >= 0
        ensure -- from EV_GRAPHICAL_FORMAT
            scale_width_set: scale_width = a_width

    set_truecolor
            -- Set color_mode to truecolor.
            -- (from EV_GRAPHICAL_FORMAT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_BMP_FORMAT


EV_DIALOG_CONSTANTS Chart

class
    EV_DIALOG_CONSTANTS

General
    cluster: vision2.interface.support
    description: "Dialog constants. Standard strings displayed on "
    create: default_create

Ancestors
    ANY

Queries
    ev_abort: STRING
    ev_cancel: STRING
    ev_confirmation_dialog_title: STRING
    ev_error_dialog_title: STRING
    ev_ignore: STRING
    ev_information_dialog_title: STRING
    ev_no: STRING
    ev_ok: STRING
    ev_question_dialog_title: STRING
    ev_retry: STRING
    ev_warning_dialog_title: STRING
    ev_yes: STRING


EV_DIALOG_CONSTANTS Flat contracts

indexing
    description: "Dialog constants. Standard strings displayed on "
    status: "See notice at end of file."
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_DIALOG_CONSTANTS

create

feature -- Button Texts

    ev_abort: STRING
            -- Text displayed on "abort" buttons.

    ev_cancel: STRING
            -- Text displayed on "cancel" buttons.

    ev_ignore: STRING
            -- Text displayed on "ignore" buttons.

    ev_no: STRING
            -- Text displayed on "no" buttons.

    ev_ok: STRING
            -- Text displayed on "ok" buttons.

    ev_retry: STRING
            -- Text displayed on "retry" buttons.

    ev_yes: STRING
            -- Text displayed on "yes" buttons.

feature -- Titles

    ev_confirmation_dialog_title: STRING
            -- Title of EV_CONFIRMATION_DIALOG.

    ev_error_dialog_title: STRING
            -- Title of EV_ERROR_DIALOG.

    ev_information_dialog_title: STRING
            -- Title of EV_INFORMATION_DIALOG.

    ev_question_dialog_title: STRING
            -- Title of EV_QUESTION_DIALOG.

    ev_warning_dialog_title: STRING
            -- Title of EV_WARNING_DIALOG.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_DIALOG_CONSTANTS


EV_DRAWABLE_CONSTANTS Chart

class
    EV_DRAWABLE_CONSTANTS

General
    cluster: vision2.interface.support
    description: "Constants for use by and with EV_DRAWABLE."
    keywords: "figures, primitives, drawing, line, point, ellipse"

Ancestors
    ANY

Queries
    Drawing_mode_and: INTEGER
    Drawing_mode_copy: INTEGER
    Drawing_mode_invert: INTEGER
    Drawing_mode_or: INTEGER
    Drawing_mode_xor: INTEGER
    valid_drawing_mode (a_mode: INTEGER): BOOLEAN


EV_DRAWABLE_CONSTANTS Flat contracts

indexing
    description: "Constants for use by and with EV_DRAWABLE."
    note: "With every drawing mode constant, a truth table is given.S means the source. This is the color of the pixel that is aboutto be applied. T means target. This is the color of the pixel thatis currently on the place where the new pixel is about to be set."
    status: "See notice at end of class"
    keywords: "figures, primitives, drawing, line, point, ellipse"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_DRAWABLE_CONSTANTS

feature -- Constants

    Drawing_mode_and: INTEGER is 3
            -- Drawing mode where bitwise AND is performed when a
            -- pixel is drawn.
            --
            -- T\S | 0 | 1 |
            -- -------------
            --   0 | 0 | 0 |
            -- -------------
            --   1 | 0 | 1 |

    Drawing_mode_copy: INTEGER is 0
            -- Normal drawing mode.
            --
            -- T\S | 0 | 1 |
            -- -------------
            --   0 | 0 | 1 |
            -- -------------
            --   1 | 0 | 1 |

    Drawing_mode_invert: INTEGER is 2
            -- Drawing mode where bits are inverted before drawn.
            --
            -- T\S | 0 | 1 |
            -- -------------
            --   0 | 1 | 0 |
            -- -------------
            --   1 | 1 | 0 |

    Drawing_mode_or: INTEGER is 4
            -- Drawing mode where bitwise OR is performed when a
            -- pixel is drawn.
            --
            -- T\S | 0 | 1 |
            -- -------------
            --   0 | 0 | 1 |
            -- -------------
            --   1 | 1 | 1 |

    Drawing_mode_xor: INTEGER is 1
            -- Drawing mode where bitwise XOR is performed when a
            -- pixel is drawn.
            --
            -- T\S | 0 | 1 |
            -- -------------
            --   0 | 0 | 1 |
            -- -------------
            --   1 | 1 | 0 |

feature -- Contract support

    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
            -- Is a_mode a valid drawing mode?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_DRAWABLE_CONSTANTS


EV_DYNAMIC_LIST_CURSOR Chart

class
    EV_DYNAMIC_LIST_CURSOR [G]

General
    cluster: vision2.interface.support
    description: "Cursor for Eiffel Vision dynamic lists."
    keywords: "container, list, cursor"
    create: make_with_item, make

Ancestors
    CURSOR

Constraints
    item void equals before or after


EV_DYNAMIC_LIST Chart

deferred class
    EV_DYNAMIC_LIST [G -> EV_CONTAINABLE]

General
    cluster: vision2.interface.support
    description: "Multiple Eiffel Vision object containers accessible as list."
    keywords: "widget list, item list, container, dynamic, set, any"

Ancestors
    DYNAMIC_LIST [G]
    EV_CONTAINABLE
    SET [G]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [G]
    data: ANY
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_DYNAMIC_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_parent_recursive (a_list: EV_ANY): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    parent: EV_ANY
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_DYNAMIC_LIST [G])
    default_create
    destroy
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] EV_DYNAMIC_LIST [G])
    merge_right (other: [like Current] EV_DYNAMIC_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    set_data (some_data: [like data] ANY)
    start
    swap (i: INTEGER)
    wipe_out


EV_DYNAMIC_LIST Flat contracts

indexing
    description: "Multiple Eiffel Vision object containers accessible as list."
    status: "See notice at end of class"
    keywords: "widget list, item list, container, dynamic, set, any"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_DYNAMIC_LIST [G -> EV_CONTAINABLE]

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    cursor: EV_DYNAMIC_LIST_CURSOR [G]
            -- Current cursor position.
        ensure then
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): G
            -- Item at i-th position.
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then
            bridge_ok: Result.is_equal (implementation.i_th (i))

    index: INTEGER
            -- Current position.
        ensure then
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then
            bridge_ok: Result = implementation.index_of (v, i)

    item: G
            -- Item at current position.
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
        ensure then
            bridge_ok: Result = implementation.count

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)
        ensure then -- from SET
            only_on_empty: Result = is_empty

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    parent: EV_ANY
            -- The parent that Current is contained within, if any.
            -- (from EV_CONTAINABLE)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
        ensure then
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
        require
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
        require
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
        require
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
        require
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
        require
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    replace (v: like item)
            -- Replace current item by v.
        require
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_parent_recursive (a_list: EV_ANY): BOOLEAN
            -- Is a_list a parent of Current?
        require
            a_list_not_void: a_list /= void

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_DYNAMIC_LIST


EV_FONT_CONSTANTS Chart

class
    EV_FONT_CONSTANTS

General
    cluster: vision2.interface.support
    description: "Facilities used by and for ues with EV_FONT."
    keywords: "character, face, size, family, weight, shape, bold, italic"

Ancestors
    ANY

Queries
    Family_modern: INTEGER
    Family_roman: INTEGER
    Family_sans: INTEGER
    Family_screen: INTEGER
    Family_typewriter: INTEGER
    Shape_italic: INTEGER
    Shape_regular: INTEGER
    valid_family (a_family: INTEGER): BOOLEAN
    valid_shape (a_shape: INTEGER): BOOLEAN
    valid_weight (a_weight: INTEGER): BOOLEAN
    Weight_black: INTEGER
    Weight_bold: INTEGER
    Weight_regular: INTEGER
    Weight_thin: INTEGER


EV_FONT_CONSTANTS Flat contracts

indexing
    description: "Facilities used by and for ues with EV_FONT."
    status: "See notice at end of class"
    keywords: "character, face, size, family, weight, shape, bold, italic"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FONT_CONSTANTS

feature -- Constants

    Family_modern: INTEGER is 5

    Family_roman: INTEGER is 2

    Family_sans: INTEGER is 3

    Family_screen: INTEGER is 1

    Family_typewriter: INTEGER is 4

    Shape_italic: INTEGER is 11

    Shape_regular: INTEGER is 10

    Weight_black: INTEGER is 9

    Weight_bold: INTEGER is 8

    Weight_regular: INTEGER is 7

    Weight_thin: INTEGER is 6

feature -- Contract support

    valid_family (a_family: INTEGER): BOOLEAN
            -- Is a_family a valid family value.

    valid_shape (a_shape: INTEGER): BOOLEAN
            -- Is a_shape a valid shape value.

    valid_weight (a_weight: INTEGER): BOOLEAN
            -- Is a_weight a valid weight value.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_FONT_CONSTANTS


EV_GRAPHICAL_FORMAT Chart

deferred class
    EV_GRAPHICAL_FORMAT

General
    cluster: vision2.interface.support
    description: "Base class for graphical formats"

Ancestors
    ANY

Queries
    color_mode: INTEGER
    file_extension: STRING
    scale_height: INTEGER
    scale_width: INTEGER

Commands
    set_greyscale
    set_paletted
    set_scale_height (a_height: INTEGER)
    set_scale_width (a_width: INTEGER)
    set_truecolor


EV_GRAPHICAL_FORMAT Flat contracts

indexing
    description: "Base class for graphical formats"
    status: "See notice at end of class"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_GRAPHICAL_FORMAT

feature -- Access

    color_mode: INTEGER
            -- Color output mode of Current

    file_extension: STRING
            -- 3 character file extension associated with format.

    scale_height: INTEGER
            -- Height to scale graphic to, 0 means no scaling.

    scale_width: INTEGER
            -- Width to scale graphic to, 0 means no scaling.

feature -- Status Setting

    set_greyscale
            -- Set color_mode to grayscale.

    set_paletted
            -- Set color_mode to paletted mode.

    set_scale_height (a_height: INTEGER)
            -- Scale the graphic height to a_height.
        require
            a_height_not_negative: a_height >= 0
        ensure
            scale_height_set: scale_height = a_height

    set_scale_width (a_width: INTEGER)
            -- Scale the graphic width to a_width.
        require
            a_width_not_negative: a_width >= 0
        ensure
            scale_width_set: scale_width = a_width

    set_truecolor
            -- Set color_mode to truecolor.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_GRAPHICAL_FORMAT


EV_HELP_CONTEXT Chart

deferred class
    EV_HELP_CONTEXT

General
    cluster: vision2.interface.support
    description: "Objects that are sent to the help engine when help is requested."
    keywords: "help"

Ancestors
    ANY


EV_HELP_ENGINE Chart

deferred class
    EV_HELP_ENGINE

General
    cluster: vision2.interface.support
    description: "Objects that process help requests according to a given help context."
    keywords: "help"

Ancestors
    ANY

Commands
    show (a_help_context: EV_HELP_CONTEXT)


EV_HELP_ENGINE Flat contracts

indexing
    description: "Objects that process help requests according to a given help context."
    status: "See notice at end of class."
    keywords: "help"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_HELP_ENGINE

feature -- Basic Operations

    show (a_help_context: EV_HELP_CONTEXT)
            -- Show help with context a_help_context.
        require
            a_help_context_not_void: a_help_context /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_HELP_ENGINE


EV_ITEM_LIST Chart

deferred class
    EV_ITEM_LIST [G -> EV_ITEM]

General
    cluster: vision2.interface.support
    description: "Base class for widgets that contain EV_ITEMs"
    keywords: "item, list"

Ancestors
    EV_ANY
    EV_DYNAMIC_LIST [G -> EV_CONTAINABLE]

Queries
    infix "@" (i: INTEGER): [like item] G
    after: BOOLEAN
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [G]
    data: ANY
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] G
    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] G): BOOLEAN
    i_th (i: INTEGER): G
    index: INTEGER
    index_of (v: [like item] G; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_ITEM_LIST [G]): BOOLEAN
    is_inserted (v: G): BOOLEAN
    is_parent_recursive (a_list: EV_ANY): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: G
    item_by_data (some_data: ANY): [like item] G
    last: [like item] G
    linear_representation: LINEAR [G]
    object_comparison: BOOLEAN
    occurrences (v: [like item] G): INTEGER
    off: BOOLEAN
    parent: EV_ANY
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    sequential_occurrences (v: G): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [G])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_ITEM_LIST [G])
    default_create
    destroy
    do_all (action: PROCEDURE [ANY, TUPLE [G]])
    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
    extend (v: [like item] G)
    fill (other: CONTAINER [G])
    finish
    force (v: [like item] G)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] EV_ITEM_LIST [G])
    merge_right (other: [like Current] EV_ITEM_LIST [G])
    move (i: INTEGER)
    prune (v: [like item] G)
    prune_all (v: [like item] G)
    put (v: [like item] G)
    put_front (v: [like item] G)
    put_i_th (v: [like item] G; i: INTEGER)
    put_left (v: [like item] G)
    put_right (v: [like item] G)
    remove
    remove_left
    remove_right
    replace (v: [like item] G)
    search (v: [like item] G)
    set_data (some_data: [like data] ANY)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    parent of items is current
    items unique


EV_ITEM_LIST Flat contracts

indexing
    description: "Base class for widgets that contain EV_ITEMs"
    status: "See notice at end of class."
    keywords: "item, list"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_ITEM_LIST [G -> EV_ITEM]

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    cursor: EV_DYNAMIC_LIST_CURSOR [G]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): G
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    item: G
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
        require
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: G): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: G): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    parent: EV_ANY
            -- The parent that Current is contained within, if any.
            -- (from EV_CONTAINABLE)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [G])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [G])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [G]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_parent_recursive (a_list: EV_ANY): BOOLEAN
            -- Is a_list a parent of Current?
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [G]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [G]]; test: FUNCTION [ANY, TUPLE [G], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [G], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_ITEM_LIST


EV_KEY_CONSTANTS Chart

class
    EV_KEY_CONSTANTS

General
    cluster: vision2.interface.support
    description:
        "Eiffel Vision key constants. Each constant defined here
        corresponds to a possible value of {EV_KEY}.code"
    keywords: "key, code, constant"

Ancestors
    ANY

Queries
    Key_0: INTEGER
    Key_1: INTEGER
    Key_2: INTEGER
    Key_3: INTEGER
    Key_4: INTEGER
    Key_5: INTEGER
    Key_6: INTEGER
    Key_7: INTEGER
    Key_8: INTEGER
    Key_9: INTEGER
    Key_a: INTEGER
    Key_b: INTEGER
    Key_back_space: INTEGER
    Key_backquote: INTEGER
    Key_backslash: INTEGER
    Key_c: INTEGER
    Key_caps_lock: INTEGER
    Key_close_bracket: INTEGER
    Key_comma: INTEGER
    Key_ctrl: INTEGER
    Key_d: INTEGER
    Key_dash: INTEGER
    Key_delete: INTEGER
    Key_down: INTEGER
    Key_e: INTEGER
    Key_end: INTEGER
    Key_enter: INTEGER
    Key_equal: INTEGER
    Key_escape: INTEGER
    Key_f: INTEGER
    Key_f1: INTEGER
    Key_f10: INTEGER
    Key_f11: INTEGER
    Key_f12: INTEGER
    Key_f2: INTEGER
    Key_f3: INTEGER
    Key_f4: INTEGER
    Key_f5: INTEGER
    Key_f6: INTEGER
    Key_f7: INTEGER
    Key_f8: INTEGER
    Key_f9: INTEGER
    Key_g: INTEGER
    Key_h: INTEGER
    Key_home: INTEGER
    Key_i: INTEGER
    Key_insert: INTEGER
    Key_j: INTEGER
    Key_k: INTEGER
    Key_l: INTEGER
    Key_left: INTEGER
    Key_left_meta: INTEGER
    Key_m: INTEGER
    Key_n: INTEGER
    Key_num_lock: INTEGER
    Key_numpad_0: INTEGER
    Key_numpad_1: INTEGER
    Key_numpad_2: INTEGER
    Key_numpad_3: INTEGER
    Key_numpad_4: INTEGER
    Key_numpad_5: INTEGER
    Key_numpad_6: INTEGER
    Key_numpad_7: INTEGER
    Key_numpad_8: INTEGER
    Key_numpad_9: INTEGER
    Key_numpad_add: INTEGER
    Key_numpad_decimal: INTEGER
    Key_numpad_divide: INTEGER
    Key_numpad_multiply: INTEGER
    Key_numpad_subtract: INTEGER
    Key_o: INTEGER
    Key_open_bracket: INTEGER
    Key_p: INTEGER
    Key_page_down: INTEGER
    Key_page_up: INTEGER
    Key_pause: INTEGER
    Key_period: INTEGER
    Key_q: INTEGER
    Key_quote: INTEGER
    Key_r: INTEGER
    Key_right: INTEGER
    Key_right_meta: INTEGER
    Key_s: INTEGER
    Key_scroll_lock: INTEGER
    Key_semicolon: INTEGER
    Key_shift: INTEGER
    Key_slash: INTEGER
    Key_space: INTEGER
    Key_strings: ARRAY [STRING]
    Key_t: INTEGER
    Key_tab: INTEGER
    Key_u: INTEGER
    Key_up: INTEGER
    Key_v: INTEGER
    Key_w: INTEGER
    Key_x: INTEGER
    Key_y: INTEGER
    Key_z: INTEGER
    valid_key_code (a_code: INTEGER): BOOLEAN


EV_KEY_CONSTANTS Flat contracts

indexing
    description: "Eiffel Vision key constants. Each constant defined here corresponds to a possible value of {EV_KEY}.code"
    status: "See notice at end of class"
    keywords: "key, code, constant"
    date: "generated"
    revision: "generated"

class interface
    EV_KEY_CONSTANTS

feature -- Access

    key_strings: ARRAY [STRING]
            -- String representations of all key codes.

feature -- Constants

    Key_0: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_1: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_2: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_3: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_4: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_5: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_6: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_7: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_8: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_9: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_a: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_b: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_back_space: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_backquote: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_backslash: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_c: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_caps_lock: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_close_bracket: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_comma: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_ctrl: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_left_meta and key_right_meta.

    Key_d: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_dash: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_delete: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_down: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_e: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_end: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_enter: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_equal: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_escape: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f1: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f10: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f11: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f12: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f2: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f3: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f4: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f5: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f6: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f7: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f8: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_f9: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_g: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_h: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_home: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_i: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_insert: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_j: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_k: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_l: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_left: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_left_meta: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl and key_right_meta.

    Key_m: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_n: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_num_lock: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_0: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_1: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_2: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_3: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_4: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_5: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_6: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_7: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_8: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_9: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_add: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_decimal: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_divide: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_multiply: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_numpad_subtract: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_o: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_open_bracket: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_p: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_page_down: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_page_up: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_pause: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_period: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_q: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_quote: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_r: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_right: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_right_meta: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl and key_left_meta.

    Key_s: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_scroll_lock: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_semicolon: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_shift: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_ctrl, key_left_meta and key_right_meta.

    Key_slash: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_space: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_t: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_tab: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_u: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_up: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_v: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_w, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_w: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_x, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_x: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_y, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_y: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_z, key_shift, key_ctrl, key_left_meta and key_right_meta.

    Key_z: INTEGER is unique
            -- Codes representing keys supported in vision2.
            -- Was declared in EV_KEY_CONSTANTS as synonym of key_0, key_1, key_2, key_3, key_4, key_5, key_6, key_7, key_8, key_9, key_numpad_0, key_numpad_1, key_numpad_2, key_numpad_3, key_numpad_4, key_numpad_5, key_numpad_6, key_numpad_7, key_numpad_8, key_numpad_9, key_numpad_add, key_numpad_divide, key_numpad_multiply, key_num_lock, key_numpad_subtract, key_numpad_decimal, key_f1, key_f2, key_f3, key_f4, key_f5, key_f6, key_f7, key_f8, key_f9, key_f10, key_f11, key_f12, key_space, key_back_space, key_enter, key_escape, key_tab, key_pause, key_caps_lock, key_scroll_lock, key_comma, key_equal, key_period, key_semicolon, key_open_bracket, key_close_bracket, key_slash, key_backslash, key_quote, key_backquote, key_dash, key_up, key_down, key_left, key_right, key_page_up, key_page_down, key_home, key_end, key_insert, key_delete, key_a, key_b, key_c, key_d, key_e, key_f, key_g, key_h, key_i, key_j, key_k, key_l, key_m, key_n, key_o, key_p, key_q, key_r, key_s, key_t, key_u, key_v, key_w, key_x, key_y, key_shift, key_ctrl, key_left_meta and key_right_meta.

feature -- Contract support

    valid_key_code (a_code: INTEGER): BOOLEAN
            -- Is `a_code' a valid key code?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_KEY_CONSTANTS


EV_PNG_FORMAT Chart

class
    EV_PNG_FORMAT

General
    cluster: vision2.interface.support
    description: "Portable Network Graphics (PNG) Graphical Format Abstraction used by {EV_PIXMAP}.save_to_named_file"

Ancestors
    EV_GRAPHICAL_FORMAT

Queries
    color_mode: INTEGER
    scale_height: INTEGER
    scale_width: INTEGER

Commands
    set_greyscale
    set_paletted
    set_scale_height (a_height: INTEGER)
    set_scale_width (a_width: INTEGER)
    set_truecolor


EV_PNG_FORMAT Flat contracts

indexing
    description: "Portable Network Graphics (PNG) Graphical Format Abstraction used by {EV_PIXMAP}.save_to_named_file"
    status: "See notice at end of class"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_PNG_FORMAT

feature -- Access

    color_mode: INTEGER
            -- Color output mode of Current
            -- (from EV_GRAPHICAL_FORMAT)

    scale_height: INTEGER
            -- Height to scale graphic to, 0 means no scaling.
            -- (from EV_GRAPHICAL_FORMAT)

    scale_width: INTEGER
            -- Width to scale graphic to, 0 means no scaling.
            -- (from EV_GRAPHICAL_FORMAT)

feature -- Status Setting

    set_greyscale
            -- Set color_mode to grayscale.
            -- (from EV_GRAPHICAL_FORMAT)

    set_paletted
            -- Set color_mode to paletted mode.
            -- (from EV_GRAPHICAL_FORMAT)

    set_scale_height (a_height: INTEGER)
            -- Scale the graphic height to a_height.
            -- (from EV_GRAPHICAL_FORMAT)
        require -- from EV_GRAPHICAL_FORMAT
            a_height_not_negative: a_height >= 0
        ensure -- from EV_GRAPHICAL_FORMAT
            scale_height_set: scale_height = a_height

    set_scale_width (a_width: INTEGER)
            -- Scale the graphic width to a_width.
            -- (from EV_GRAPHICAL_FORMAT)
        require -- from EV_GRAPHICAL_FORMAT
            a_width_not_negative: a_width >= 0
        ensure -- from EV_GRAPHICAL_FORMAT
            scale_width_set: scale_width = a_width

    set_truecolor
            -- Set color_mode to truecolor.
            -- (from EV_GRAPHICAL_FORMAT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_PNG_FORMAT


EV_POSTSCRIPT_PAGE_CONSTANTS Chart

class
    EV_POSTSCRIPT_PAGE_CONSTANTS

General
    cluster: vision2.interface.support
    description: "Page size constants for use with EV_POSTSCRIPT_PROJECTOR."
    keywords: "postscript, page, size, dimensions"

Ancestors
    ANY

Queries
    A0: INTEGER
    A1: INTEGER
    A2: INTEGER
    A3: INTEGER
    A4: INTEGER
    A5: INTEGER
    A6: INTEGER
    A7: INTEGER
    A8: INTEGER
    A9: INTEGER
    B0: INTEGER
    B1: INTEGER
    B10: INTEGER
    B2: INTEGER
    B3: INTEGER
    B4: INTEGER
    B5: INTEGER
    B6: INTEGER
    B7: INTEGER
    B8: INTEGER
    B9: INTEGER
    C5envelope: INTEGER
    Comm10envelope: INTEGER
    Dlenvelope: INTEGER
    Executive: INTEGER
    Folio: INTEGER
    Ledger: INTEGER
    Legal: INTEGER
    Letter: INTEGER
    page_height (a_size: INTEGER; landscape: BOOLEAN): INTEGER
    page_width (a_size: INTEGER; landscape: BOOLEAN): INTEGER
    Tabloid: INTEGER
    valid_page_size (a_size: INTEGER): BOOLEAN


EV_POSTSCRIPT_PAGE_CONSTANTS Flat contracts

indexing
    description: "Page size constants for use with EV_POSTSCRIPT_PROJECTOR."
    status: "See notice at end of class"
    keywords: "postscript, page, size, dimensions"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_POSTSCRIPT_PAGE_CONSTANTS

feature -- Status report

    page_height (a_size: INTEGER; landscape: BOOLEAN): INTEGER
            -- Return the page height in points (1 inch/72)
            -- for the specified page size and orientation.
        require
            valid_size: valid_page_size (a_size)

    page_width (a_size: INTEGER; landscape: BOOLEAN): INTEGER
            -- Return the page width in points (1 inch/72)
            -- for the specified page size and orientation.
        require
            valid_size: valid_page_size (a_size)

feature -- Constants

    A0: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A1: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A2: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A3: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A4: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A5: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A6: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A7: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A8: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    A9: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    B0: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    B1: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    B10: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8 and b9.

    B2: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b3, b4, b5, b6, b7, b8, b9 and b10.

    B3: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b4, b5, b6, b7, b8, b9 and b10.

    B4: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b5, b6, b7, b8, b9 and b10.

    B5: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b6, b7, b8, b9 and b10.

    B6: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b7, b8, b9 and b10.

    B7: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b8, b9 and b10.

    B8: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b9 and b10.

    B9: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8 and b10.

    C5envelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Comm10envelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of c5envelope, dlenvelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Dlenvelope: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, folio, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Executive: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Folio: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, executive, letter, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Ledger: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Legal: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Letter: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, legal, ledger, tabloid, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

    Tabloid: INTEGER is unique
            -- Valid page constants.
            -- Was declared in EV_POSTSCRIPT_PAGE_CONSTANTS as synonym of comm10envelope, c5envelope, dlenvelope, folio, executive, letter, legal, ledger, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 and b10.

feature -- Contract support

    valid_page_size (a_size: INTEGER): BOOLEAN
            -- Is a_size a valid page value?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_POSTSCRIPT_PAGE_CONSTANTS


EV_PRINT_CONTEXT Chart

class
    EV_PRINT_CONTEXT

General
    cluster: vision2.interface.support
    description: "EiffelVision 2 Printer Context, see EV_PRINT_DIALOG"
    keywords: "print, printer, context"

Ancestors
    ANY

Queries
    copies: INTEGER
    file_name: STRING
    from_page: INTEGER
    output_to_file: BOOLEAN
    portrait: BOOLEAN
    printer_name: STRING
    selection_type: INTEGER
    to_page: INTEGER


EV_PRINT_CONTEXT Flat contracts

indexing
    description: "EiffelVision 2 Printer Context, see EV_PRINT_DIALOG"
    status: "See notice at end of class"
    keywords: "print, printer, context"

class interface
    EV_PRINT_CONTEXT

feature -- Access

    copies: INTEGER
            -- Number of copies of print job.

    file_name: STRING
            -- Name of output file.

    from_page: INTEGER
            -- Page print job starts from.

    output_to_file: BOOLEAN
            -- Will output be to file.

    portrait: BOOLEAN
            -- Will print output be portrait.

    printer_name: STRING
            -- Name of printer.

    selection_type: INTEGER
            -- Type code of chosen selection.

    to_page: INTEGER
            -- Page print job prints to.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_PRINT_CONTEXT


EV_PRINT_PROJECTOR Chart

class
    EV_PRINT_PROJECTOR

General
    cluster: vision2.interface.support
    description: "Projection to a Printer."
    keywords: "printer, output, projector"
    create: make_with_context

Ancestors
    EV_ANY
    EV_PROJECTOR

Queries
    data: ANY
    is_destroyed: BOOLEAN
    world: EV_FIGURE_WORLD

Commands
    copy (other: [like Current] EV_PRINT_PROJECTOR)
    default_create
    destroy
    project
    set_data (some_data: [like data] ANY)
    set_world (a_world: EV_FIGURE_WORLD)


EV_PRINT_PROJECTOR Flat contracts

indexing
    description: "Projection to a Printer."
    status: "See notice at end of class"
    keywords: "printer, output, projector"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_PRINT_PROJECTOR

create

    make_with_context (a_world: EV_FIGURE_WORLD; a_context: EV_PRINT_CONTEXT)
            -- Create with a_world and a_context.
        require
            a_world_not_void: a_world /= void
            a_context_not_void: a_context /= void
            output_file_unique: a_context.output_to_file implies not (create {RAW_FILE}.make (a_context.file_name)).exists

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    world: EV_FIGURE_WORLD
            -- Figure-world that will be projected.
            -- (from EV_PROJECTOR)

feature -- Status setting

    set_world (a_world: EV_FIGURE_WORLD)
            -- Set world to a_world.
            -- (from EV_PROJECTOR)
        require -- from EV_PROJECTOR
            a_world_exists: a_world /= void
        ensure -- from EV_PROJECTOR
            world_assigned: world = a_world

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    project
            -- Make a standard projection of the world on the device.
        require
            not_destroyed: not is_destroyed

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_PROJECTOR
    world_exists: world /= void

end -- class EV_PRINT_PROJECTOR


EV_RADIO_PEER Chart

deferred class
    EV_RADIO_PEER

General
    cluster: vision2.interface.support
    description:
        "Facilities for managing peer relations between radio buttons.
        Base class for EV_RADIO_BUTTON, EV_RADIO_MENU_ITEM andEV_TOOL_BAR_RADIO_BUTTON."
    keywords: "radio, item, menu, check, select"

Ancestors
    EV_ANY

Queries
    data: ANY
    is_destroyed: BOOLEAN
    is_selected: BOOLEAN
    peers: LINKED_LIST [[like Current] EV_RADIO_PEER]
    selected_peer: [like Current] EV_RADIO_PEER

Commands
    copy (other: [like Current] EV_RADIO_PEER)
    destroy
    enable_select
    set_data (some_data: [like data] ANY)

Constraints
    peers not void
    selected peer not void
    peers returns new copy of list
    peers has current
    is selected equals selected peer is current
    one radio item selected


EV_RADIO_PEER Flat contracts

indexing
    description: "Facilities for managing peer relations between radio buttons.Base class for EV_RADIO_BUTTON, EV_RADIO_MENU_ITEM andEV_TOOL_BAR_RADIO_BUTTON."
    status: "See notice at end of class"
    keywords: "radio, item, menu, check, select"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_RADIO_PEER

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

feature -- Status report

    is_selected: BOOLEAN
            -- Is this radio item checked?
        require
            not_destroyed: not is_destroyed

    peers: LINKED_LIST [like Current]
            -- All radio items in the group Current is in.
            -- Includes Current.
        require
            not_destroyed: not is_destroyed
        ensure
            not_void: Result /= void
            bridge_ok: Result.count = implementation.peers.count

    selected_peer: like Current
            -- Item in peers that is currently selected.
        require
            not_destroyed: not is_destroyed
        ensure
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.selected_peer)

feature -- Status setting

    enable_select
            -- Change selected peer to Current.
        require
            not_destroyed: not is_destroyed
        ensure
            selected_peer_is_current: selected_peer = Current

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    peers_not_void: peers /= void
    selected_peer_not_void: selected_peer /= void
    peers_returns_new_copy_of_list: peers /= peers
    peers_has_current: peers.has (Current)
    is_selected_equals_selected_peer_is_current: is_selected = (selected_peer = Current)
    one_radio_item_selected: selected_count = 1
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_RADIO_PEER


EV_RAW_IMAGE_DATA Chart

class
    EV_RAW_IMAGE_DATA

General
    cluster: vision2.interface.support
    description: ""
    create: make_with_alpha_zero, make

Ancestors
    ARRAY [G]

Queries
    infix "@" (i: INTEGER): CHARACTER
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [CHARACTER]
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    entry (i: INTEGER): CHARACTER
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: CHARACTER): BOOLEAN
    height: INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_RAW_IMAGE_DATA): BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    linear_representation: LINEAR [CHARACTER]
    lower: INTEGER
    Minimal_increase: INTEGER
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    originating_pixmap: EV_PIXMAP
    pixel (a_x, a_y: INTEGER): EV_COLOR
    pixel_alpha_component (a_x, a_y: INTEGER): CHARACTER
    pixel_blue_component (a_x, a_y: INTEGER): CHARACTER
    pixel_green_component (a_x, a_y: INTEGER): CHARACTER
    pixel_red_component (a_x, a_y: INTEGER): CHARACTER
    prunable: BOOLEAN
    resizable: BOOLEAN
    rgb_hex_representation: STRING
    same_items (other: [like Current] EV_RAW_IMAGE_DATA): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] EV_RAW_IMAGE_DATA
    to_c: ANY
    upper: INTEGER
    valid_coordinates (a_x, a_y: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    width: INTEGER

Commands
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] EV_RAW_IMAGE_DATA)
    discard_items
    enter (v: [like item] CHARACTER; i: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    grow (i: INTEGER)
    make_from_array (a: ARRAY [CHARACTER])
    prune_all (v: CHARACTER)
    set_pixel (a_x, a_y: INTEGER; a_color: EV_COLOR)
    set_pixel_alpha_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
    set_pixel_blue_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
    set_pixel_green_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
    set_pixel_red_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
    subcopy (other: [like Current] EV_RAW_IMAGE_DATA; start_pos, end_pos, index_pos: INTEGER)

Constraints
    items number


EV_RAW_IMAGE_DATA Flat contracts

indexing
    description: ""
    status: "See notice at end of class"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_RAW_IMAGE_DATA

create

    make (a_width, a_height: INTEGER)
            -- Create an array which has a_width
            -- * a_height * 4 items.
        require
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure
            new_count: count = height * width * 4

    make_with_alpha_zero (a_width, a_height: INTEGER)
            -- Create an array which has a_width
            -- * a_height * 4 items.
        require
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure
            new_count: count = height * width * 4

feature -- Initialization

    make_from_array (a: ARRAY [CHARACTER])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    entry (i: INTEGER): CHARACTER
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: CHARACTER): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    originating_pixmap: EV_PIXMAP
            -- Pixmap Current was based on, if any.

    pixel (a_x, a_y: INTEGER): EV_COLOR
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    pixel_alpha_component (a_x, a_y: INTEGER): CHARACTER
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    pixel_blue_component (a_x, a_y: INTEGER): CHARACTER
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    pixel_green_component (a_x, a_y: INTEGER): CHARACTER
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    pixel_red_component (a_x, a_y: INTEGER): CHARACTER
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    rgb_hex_representation: STRING
            -- Returns a string of hex codes representing the RGB values
            -- of all the pixels in pixmap.

    infix "@" (i: INTEGER): CHARACTER
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    height: INTEGER
            -- Number of rows.

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

    width: INTEGER
            -- Number of columns.

feature  -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((array_item (upper) = void or else array_item (upper) = array_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (array_item (upper) = other.array_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: CHARACTER)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

feature  -- Conversion

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from ARRAY)

feature  -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

feature -- Duplication

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature -- Contract support

    valid_coordinates (a_x, a_y: INTEGER): BOOLEAN

feature -- Element Change

    set_pixel (a_x, a_y: INTEGER; a_color: EV_COLOR)
        require
            valid_coordinates: valid_coordinates (a_x, a_y)
            a_color_not_void: a_color /= void

    set_pixel_alpha_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    set_pixel_blue_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    set_pixel_green_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

    set_pixel_red_component (a_x, a_y: INTEGER; a_intensity: CHARACTER)
        require
            valid_coordinates: valid_coordinates (a_x, a_y)

invariant

    items_number: count = width * height * 4
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
    index_set_has_same_bounds: ((index_set.lower = lower) and (index_set.upper = lower + count - 1))
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class EV_RAW_IMAGE_DATA


EV_SIMPLE_HELP_CONTEXT Chart

class
    EV_SIMPLE_HELP_CONTEXT

General
    cluster: vision2.interface.support
    description: "Implement an help context as a string."
    keywords: "help"
    create: make_from_string

Ancestors
    EV_HELP_CONTEXT
    STRING

Queries
    infix "@" (i: INTEGER): CHARACTER
    infix ">=" (other: [like Current] EV_SIMPLE_HELP_CONTEXT): BOOLEAN
    infix ">" (other: [like Current] EV_SIMPLE_HELP_CONTEXT): BOOLEAN
    infix "<=" (other: [like Current] EV_SIMPLE_HELP_CONTEXT): BOOLEAN
    infix "<" (other: [like Current] EV_SIMPLE_HELP_CONTEXT): BOOLEAN
    infix "+" (s: STRING): STRING
    adapt (s: STRING): [like Current] EV_SIMPLE_HELP_CONTEXT
    additional_space: INTEGER
    area: SPECIAL [CHARACTER]
    capacity: INTEGER
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    Extendible: BOOLEAN
    False_constant: STRING
    full: BOOLEAN
    fuzzy_index (other: STRING; start, fuzz: INTEGER): INTEGER
    Growth_percentage: INTEGER
    has (c: CHARACTER): BOOLEAN
    hash_code: INTEGER
    index_of (c: CHARACTER; start: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_boolean: BOOLEAN
    is_double: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_SIMPLE_HELP_CONTEXT): BOOLEAN
    is_hashable: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_integer: BOOLEAN
    is_real: BOOLEAN
    item (i: INTEGER): CHARACTER
    item_code (i: INTEGER): INTEGER
    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
    linear_representation: LINEAR [CHARACTER]
    max (other: [like Current] EV_SIMPLE_HELP_CONTEXT): [like Current] EV_SIMPLE_HELP_CONTEXT
    min (other: [like Current] EV_SIMPLE_HELP_CONTEXT): [like Current] EV_SIMPLE_HELP_CONTEXT
    Minimal_increase: INTEGER
    mirrored: [like Current] EV_SIMPLE_HELP_CONTEXT
    object_comparison: BOOLEAN
    occurrences (c: CHARACTER): INTEGER
    out: [like Current] EV_SIMPLE_HELP_CONTEXT
    prunable: BOOLEAN
    resizable: BOOLEAN
    shared_with (other: [like Current] EV_SIMPLE_HELP_CONTEXT): BOOLEAN
    split (a_separator: CHARACTER): LINEAR [STRING]
    substring (n1, n2: INTEGER): [like Current] EV_SIMPLE_HELP_CONTEXT
    substring_index (other: STRING; start: INTEGER): INTEGER
    three_way_comparison (other: [like Current] EV_SIMPLE_HELP_CONTEXT): INTEGER
    to_boolean: BOOLEAN
    to_c: ANY
    to_double: DOUBLE
    to_integer: INTEGER
    to_real: REAL
    True_constant: STRING
    valid_index (i: INTEGER): BOOLEAN

Commands
    adapt_size
    append (s: STRING)
    append_boolean (b: BOOLEAN)
    append_character (c: CHARACTER)
    append_double (d: DOUBLE)
    append_integer (i: INTEGER)
    append_real (r: REAL)
    append_string (s: STRING)
    automatic_grow
    center_justify
    character_justify (pivot: CHARACTER; position: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] EV_SIMPLE_HELP_CONTEXT)
    extend (c: CHARACTER)
    fill (other: CONTAINER [CHARACTER])
    fill_blank
    fill_character (c: CHARACTER)
    from_c (c_string: POINTER)
    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
    grow (newsize: INTEGER)
    head (n: INTEGER)
    insert (s: STRING; i: INTEGER)
    left_adjust
    left_justify
    make_from_c (c_string: POINTER)
    make_from_string (s: STRING)
    mirror
    multiply (n: INTEGER)
    precede (c: CHARACTER)
    prepend (s: STRING)
    prepend_boolean (b: BOOLEAN)
    prepend_character (c: CHARACTER)
    prepend_double (d: DOUBLE)
    prepend_integer (i: INTEGER)
    prepend_real (r: REAL)
    prepend_string (s: STRING)
    prune (c: CHARACTER)
    prune_all (c: CHARACTER)
    prune_all_leading (c: CHARACTER)
    prune_all_trailing (c: CHARACTER)
    put (c: CHARACTER; i: INTEGER)
    remove (i: INTEGER)
    replace_blank
    replace_character (c: CHARACTER)
    replace_substring (s: [like Current] EV_SIMPLE_HELP_CONTEXT; start_pos, end_pos: INTEGER)
    replace_substring_all (original, new: [like Current] EV_SIMPLE_HELP_CONTEXT)
    resize (newsize: INTEGER)
    right_adjust
    right_justify
    set (t: [like Current] EV_SIMPLE_HELP_CONTEXT; n1, n2: INTEGER)
    share (other: [like Current] EV_SIMPLE_HELP_CONTEXT)
    subcopy (other: [like Current] EV_SIMPLE_HELP_CONTEXT; start_pos, end_pos, index_pos: INTEGER)
    tail (n: INTEGER)
    to_lower
    to_upper
    wipe_out


EV_SIMPLE_HELP_CONTEXT Flat contracts

indexing
    description: "Implement an help context as a string."
    status: "See notice at end of class."
    keywords: "help"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_SIMPLE_HELP_CONTEXT

create

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        ensure -- from STRING
            shared_implementation: shared_with (s)

feature -- Initialization

    adapt (s: STRING): like Current
            -- Object of a type conforming to the type of s,
            -- initialized with attributes from s
            -- (from STRING)

    from_c (c_string: POINTER)
            -- Reset contents of string from contents of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
        ensure -- from STRING
            no_zero_byte: not has ('%U')

    from_c_substring (c_string: POINTER; start_pos, end_pos: INTEGER)
            -- Reset contents of string from substring of c_string,
            -- a string created by some external C function.
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer
            start_position_big_enough: start_pos >= 1
            end_position_big_enough: start_pos <= end_pos + 1
        ensure -- from STRING
            valid_count: count = end_pos - start_pos + 1

    make_from_c (c_string: POINTER)
            -- Initialize from contents of c_string,
            -- a string created by some external C function
            -- (from STRING)
        require -- from STRING
            c_string_exists: c_string /= default_pointer

    make_from_string (s: STRING)
            -- Initialize from the characters of s.
            -- (Useful in proper descendants of class STRING,
            -- to initialize a string-like object from a manifest string.)
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
        ensure -- from STRING
            shared_implementation: shared_with (s)

feature -- Access

    area: SPECIAL [CHARACTER]
            -- Special data zone
            -- (from TO_SPECIAL)

    False_constant: STRING is "false"
            -- Constant string "false"
            -- (from STRING)

    fuzzy_index (other: STRING; start: INTEGER; fuzz: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start
            -- with 0..fuzz mismatches between the string and other.
            -- 0 if there are no fuzzy matches
            -- (from STRING)
        require -- from STRING
            other_exists: other /= void
            other_not_empty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
            acceptable_fuzzy: fuzz <= other.count

    has (c: CHARACTER): BOOLEAN
            -- Does string include c?
            -- (from STRING)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    hash_code: INTEGER
            -- Hash code value
            -- (from STRING)
        ensure -- from HASHABLE
            good_hash_value: Result >= 0

    index_of (c: CHARACTER; start: INTEGER): INTEGER
            -- Position of first occurrence of c at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            start_large_enough: start >= 1
            start_small_enough: start <= count + 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    item (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of @.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

    item_code (i: INTEGER): INTEGER
            -- Numeric code of character at position i
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0

    last_index_of (c: CHARACTER; start_index_from_end: INTEGER): INTEGER
            -- Position of last occurence of c.
            -- 0 if none
            -- (from STRING)
        require -- from STRING
            start_index_small_enough: start_index_from_end <= count
            start_index_large_enough: start_index_from_end >= 1
        ensure -- from STRING
            correct_place: Result > 0 implies item (Result) = c

    shared_with (other: like Current): BOOLEAN
            -- Does string share the text of other?
            -- (from STRING)

    substring_index (other: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of other at or after start;
            -- 0 if none.
            -- (from STRING)
        require -- from STRING
            other_nonvoid: other /= void
            other_notempty: not other.is_empty
            start_large_enough: start >= 1
            start_small_enough: start <= count
        ensure -- from STRING
            correct_place: Result > 0 implies substring (Result, Result + other.count - 1).is_equal (other)

    True_constant: STRING is "true"
            -- Constant string "true"
            -- (from STRING)

    infix "@" (i: INTEGER): CHARACTER
            -- Character at position i
            -- Was declared in STRING as synonym of item.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Allocated space
            -- (from STRING)

    count: INTEGER
            -- Actual number of characters making up the string
            -- (from STRING)

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from STRING)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from STRING
            Result.count = count

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (c: CHARACTER): INTEGER
            -- Number of times c appears in the string
            -- (from STRING)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is string made of same character sequence as other
            -- (possibly with a different capacity)?
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from COMPARABLE
            trichotomy: Result = (not (Current < other) and not (other < Current))

    max (other: like Current): like Current
            -- The greater of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_smaller: Current >= other implies Result = Current
            other_if_smaller: Current < other implies Result = other

    min (other: like Current): like Current
            -- The smaller of current object and other
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            current_if_not_greater: Current <= other implies Result = Current
            other_if_greater: Current > other implies Result = other

    three_way_comparison (other: like Current): INTEGER
            -- If current object equal to other, 0;
            -- if smaller, -1; if greater, 1
            -- (from COMPARABLE)
        require -- from COMPARABLE
            other_exists: other /= void
        ensure -- from COMPARABLE
            equal_zero: (Result = 0) = is_equal (other)
            smaller_negative: (Result = - 1) = (Current < other)
            greater_positive: (Result = 1) = (Current > other)

    infix "<" (other: like Current): BOOLEAN
            -- Is string lexicographically lower than other?
            -- (from STRING)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            asymmetric: Result implies not (other < Current)

    infix "<=" (other: like Current): BOOLEAN
            -- Is current object less than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = ((Current < other) or is_equal (other))

    infix ">" (other: like Current): BOOLEAN
            -- Is current object greater than other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other < Current)

    infix ">=" (other: like Current): BOOLEAN
            -- Is current object greater than or equal to other?
            -- (from COMPARABLE)
        require -- from PART_COMPARABLE
            other_exists: other /= void
        ensure then -- from COMPARABLE
            definition: Result = (other <= Current)

feature -- Status report

    Changeable_comparison_criterion: BOOLEAN is False
            -- (from STRING)

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from STRING)

    full: BOOLEAN
            -- Is structure full?
            -- (from BOUNDED)

    is_boolean: BOOLEAN
            -- Does Current represent a BOOLEAN?
            -- (from STRING)

    is_double: BOOLEAN
            -- Does Current represent a DOUBLE?
            -- (from STRING)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_hashable: BOOLEAN
            -- May current object be hashed?
            -- (True if it is not its type's default.)
            -- (from HASHABLE)
        ensure -- from HASHABLE
            ok_if_not_default: Result implies (Current /= default)

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_integer: BOOLEAN
            -- Does Current represent an INTEGER?
            -- (from STRING)

    is_real: BOOLEAN
            -- Does Current represent a REAL?
            -- (from STRING)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from STRING)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the string?
            -- (from STRING)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    append (s: STRING)
            -- Append a copy of s at end.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + old s.count

    append_boolean (b: BOOLEAN)
            -- Append the string representation of b at end.
            -- (from STRING)

    append_character (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of extend.
            -- (from STRING)
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    append_double (d: DOUBLE)
            -- Append the string representation of d at end.
            -- (from STRING)

    append_integer (i: INTEGER)
            -- Append the string representation of i at end.
            -- (from STRING)

    append_real (r: REAL)
            -- Append the string representation of r at end.
            -- (from STRING)

    append_string (s: STRING)
            -- Append a copy of s, if not void, at end.
            -- (from STRING)

    copy (other: like Current)
            -- Reinitialize by copying the characters of other.
            -- (This is also used by clone.)
            -- (from STRING)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from STRING
            new_result_count: count = other.count

    extend (c: CHARACTER)
            -- Append c at end.
            -- Was declared in STRING as synonym of append_character.
            -- (from STRING)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1
        ensure then -- from STRING
            item_inserted: item (count) = c
            new_count: count = old count + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    fill_blank
            -- Fill with capacity blank characters.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    fill_character (c: CHARACTER)
            -- Fill with capacity characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            filled: full
            same_size: (count = capacity) and (capacity = old capacity)

    head (n: INTEGER)
            -- Remove all characters except for the first n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    insert (s: STRING; i: INTEGER)
            -- Add s to the left of position i in current string.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count + s.count

    left_adjust
            -- Remove leading whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (1) /= ' ') and (item (1) /= '   ') and (item (1) /= '%R') and (item (1) /= ''))

    precede (c: CHARACTER)
            -- Add c at front.
            -- (from STRING)
        ensure -- from STRING
            new_count: count = old count + 1

    prepend (s: STRING)
            -- Prepend a copy of s at front.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            new_count: count = old count + s.count

    prepend_boolean (b: BOOLEAN)
            -- Prepend the string representation of b at front.
            -- (from STRING)

    prepend_character (c: CHARACTER)
            -- Prepend the string representation of c at front.
            -- (from STRING)

    prepend_double (d: DOUBLE)
            -- Prepend the string representation of d at front.
            -- (from STRING)

    prepend_integer (i: INTEGER)
            -- Prepend the string representation of i at front.
            -- (from STRING)

    prepend_real (r: REAL)
            -- Prepend the string representation of r at front.
            -- (from STRING)

    prepend_string (s: STRING)
            -- Prepend a copy of s, if not void, at front.
            -- (from STRING)

    put (c: CHARACTER; i: INTEGER)
            -- Replace character at position i by c.
            -- (from STRING)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: item (k) = v

    replace_blank
            -- Replace all current characters with blanks.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_character (c: CHARACTER)
            -- Replace all current characters with characters all equal to c.
            -- (from STRING)
        ensure -- from STRING
            same_size: (count = old count) and (capacity = old capacity)

    replace_substring (s: like Current; start_pos, end_pos: INTEGER)
            -- Copy the characters of s to positions
            -- start_pos .. end_pos.
            -- (from STRING)
        require -- from STRING
            string_exists: s /= void
            index_small_enough: end_pos <= count
            order_respected: start_pos <= end_pos
            index_large_enough: start_pos > 0
        ensure -- from STRING
            new_count: count = old count + s.count - end_pos + start_pos - 1

    replace_substring_all (original, new: like Current)
            -- Replace every occurence of original with new.
            -- (from STRING)
        require -- from STRING
            original_exists: original /= void
            new_exists: new /= void
            original_not_empty: not original.is_empty

    right_adjust
            -- Remove trailing whitespace.
            -- (from STRING)
        ensure -- from STRING
            new_count: (count /= 0) implies ((item (count) /= ' ') and (item (count) /= '   ') and (item (count) /= '%R') and (item (count) /= ''))

    set (t: like Current; n1, n2: INTEGER)
            -- Set current string to substring of t from indices n1
            -- to n2, or to empty string if no such substring.
            -- (from STRING)
        require -- from STRING
            argument_not_void: t /= void
        ensure -- from STRING
            is_substring: is_equal (t.substring (n1, n2))

    share (other: like Current)
            -- Make current string share the text of other.
            -- Subsequent changes to the characters of current string
            -- will also affect other, and conversely.
            -- (from STRING)
        require -- from STRING
            argument_not_void: other /= void
        ensure -- from STRING
            shared_count: other.count = count

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy characters of other within bounds start_pos and
            -- end_pos to current string starting at index index_pos.
            -- (from STRING)
        require -- from STRING
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (count - index_pos) >= (end_pos - start_pos)

    tail (n: INTEGER)
            -- Remove all characters except for the last n;
            -- do nothing if n >= count.
            -- (from STRING)
        require -- from STRING
            non_negative_argument: n >= 0
        ensure -- from STRING
            new_count: count = n.min (old count)

    infix "+" (s: STRING): STRING
            -- Append a copy of 's' at the end of a copy of Current,
            -- Then return the Result.
            -- (from STRING)
        require -- from STRING
            argument_not_void: s /= void
        ensure -- from STRING
            result_exists: Result /= void
            new_count: Result.count = count + s.count

feature -- Removal

    clear_all
            -- Reset all characters.
            -- (from STRING)
        ensure -- from STRING
            is_empty: count = 0
            same_capacity: capacity = old capacity

    prune (c: CHARACTER)
            -- Remove first occurrence of c, if any.
            -- (from STRING)
        require -- from COLLECTION
            prunable: prunable
        require else -- from STRING
            True

    prune_all (c: CHARACTER)
            -- Remove all occurrences of c.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        require else -- from STRING
            True
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from STRING
            changed_count: count = (old count) - (old occurrences (c))

    prune_all_leading (c: CHARACTER)
            -- Remove all leading occurrences of c.
            -- (from STRING)

    prune_all_trailing (c: CHARACTER)
            -- Remove all trailing occurrences of c.
            -- (from STRING)

    remove (i: INTEGER)
            -- Remove i-th character.
            -- (from STRING)
        require -- from STRING
            index_small_enough: i <= count
            index_large_enough: i > 0
        ensure -- from STRING
            new_count: count = old count - 1

    wipe_out
            -- Remove all characters.
            -- (from STRING)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from STRING
            is_empty: count = 0
            empty_capacity: capacity = 0

feature -- Resizing

    adapt_size
            -- Adapt the size to accommodate count characters.
            -- (from STRING)

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (newsize: INTEGER)
            -- Ensure that the capacity is at least newsize.
            -- (from STRING)
        require -- from  RESIZABLE
            True
        require else -- from STRING
            new_size_non_negative: newsize >= 0
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (newsize: INTEGER)
            -- Rearrange string so that it can accommodate
            -- at least newsize characters.
            -- Do not lose any previously entered character.
            -- (from STRING)
        require -- from STRING
            new_size_non_negative: newsize >= 0

feature -- Conversion

    center_justify
            -- Center justify the string using
            -- the capacity as the width
            -- (from STRING)

    character_justify (pivot: CHARACTER; position: INTEGER)
            -- Justify a string based on a pivot
            -- and the position it needs to be in
            -- the final string.
            -- This will grow the string if necessary
            -- to get the pivot in the correct place.
            -- (from STRING)
        require -- from STRING
            valid_position: position <= capacity
            positive_position: position >= 1
            pivot_not_space: pivot /= ' '
            not_empty: not is_empty

    left_justify
            -- Left justify the string using
            -- the capacity as the width
            -- (from STRING)

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from STRING)

    mirror
            -- Reverse the order of characters.
            -- "Hello world" -> "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: count = old count

    mirrored: like Current
            -- Mirror image of string;
            -- result for "Hello world" is "dlrow olleH".
            -- (from STRING)
        ensure -- from STRING
            same_count: Result.count = count

    right_justify
            -- Right justify the string using
            -- the capacity as the width
            -- (from STRING)

    split (a_separator: CHARACTER): LINEAR [STRING]
            -- Split on a_separator.
            -- Ignore separators in quotes.
            -- (from STRING)
        ensure -- from STRING
            Result /= void

    to_boolean: BOOLEAN
            -- Boolean value;
            -- "True" yields True, "False" yields False
            -- (case-insensitive)
            -- (from STRING)
        require -- from STRING
            is_boolean: is_boolean

    frozen to_c: ANY
            -- A reference to a C form of current string.
            -- Useful only for interfacing with C software.
            -- (from STRING)

    to_double: DOUBLE
            -- "Double" value;
            -- for example, when applied to "123.0", will yield 123.0 (double)
            -- (from STRING)
        require -- from STRING
            represents_a_double: is_double

    to_integer: INTEGER
            -- Integer value;
            -- for example, when applied to "123", will yield 123
            -- (from STRING)
        require -- from STRING
            is_integer: is_integer

    to_lower
            -- Convert to lower case.
            -- (from STRING)

    to_real: REAL
            -- Real value;
            -- for example, when applied to "123.0", will yield 123.0
            -- (from STRING)
        require -- from STRING
            represents_a_real: is_real

    to_upper
            -- Convert to upper case.
            -- (from STRING)

feature -- Duplication

    multiply (n: INTEGER)
            -- Duplicate a string within itself
            -- ("hello").multiply(3) => "hellohellohello"
            -- (from STRING)
        require -- from STRING
            meaningful_multiplier: n >= 1

    substring (n1, n2: INTEGER): like Current
            -- Copy of substring containing all characters at indices
            -- between n1 and n2
            -- (from STRING)
        ensure -- from STRING
            new_result_count: Result.count = n2 - n1 + 1 or Result.count = 0

feature -- Output

    out: like Current
            -- Printable representation
            -- (from STRING)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from STRING
    extendible: extendible
    compare_character: not object_comparison
    index_set_has_same_count: index_set.count = count
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from COMPARABLE
    irreflexive_comparison: not (Current < Current)

end -- class EV_SIMPLE_HELP_CONTEXT


EV_SIMPLE_HELP_ENGINE Chart

class
    EV_SIMPLE_HELP_ENGINE

General
    cluster: vision2.interface.support
    description: "Display content of simple help context in a dialog."
    keywords: "help"
    create: default_create

Ancestors
    EV_HELP_ENGINE

Queries
    Help_title: STRING

Commands
    show (a_help_context: EV_SIMPLE_HELP_CONTEXT)


EV_SIMPLE_HELP_ENGINE Flat contracts

indexing
    description: "Display content of simple help context in a dialog."
    status: "See notice at end of class."
    keywords: "help"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_SIMPLE_HELP_ENGINE

create

feature -- Access

    Help_title: STRING is "Contextual Help"
            -- Help dialog title

feature -- Basic Operations

    show (a_help_context: EV_SIMPLE_HELP_CONTEXT)
            -- Display content of a_help_context in a dialog.
        require -- from EV_HELP_ENGINE
            a_help_context_not_void: a_help_context /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_SIMPLE_HELP_ENGINE


EV_STOCK_COLORS Chart

class
    EV_STOCK_COLORS

General
    cluster: vision2.interface.support
    description: "Facilities for accessing standardized colors."
    keywords: "color, default"

Ancestors
    ANY

Queries
    All_colors: LINKED_LIST [EV_COLOR]
    Black: EV_COLOR
    Blue: EV_COLOR
    Color_3d_face: EV_COLOR
    Color_3d_highlight: EV_COLOR
    Color_3d_shadow: EV_COLOR
    Color_dialog: EV_COLOR
    Color_read_only: EV_COLOR
    Color_read_write: EV_COLOR
    Cyan: EV_COLOR
    Dark_blue: EV_COLOR
    Dark_cyan: EV_COLOR
    Dark_gray: EV_COLOR
    Dark_green: EV_COLOR
    Dark_grey: EV_COLOR
    Dark_magenta: EV_COLOR
    Dark_red: EV_COLOR
    Dark_yellow: EV_COLOR
    Default_background_color: EV_COLOR
    Default_foreground_color: EV_COLOR
    Gray: EV_COLOR
    Green: EV_COLOR
    Grey: EV_COLOR
    Magenta: EV_COLOR
    Red: EV_COLOR
    White: EV_COLOR
    Yellow: EV_COLOR

Constraints
    white not void
    black not void
    grey not void
    gray not void
    dark grey not void
    dark gray not void
    blue not void
    dark blue not void
    cyan not void
    dark cyan not void
    green not void
    dark green not void
    yellow not void
    dark yellow not void
    red not void
    dark red not void
    magenta not void
    dark magenta not void
    color dialog not void
    color read only not void
    color read write not void
    default background color not void
    default foreground color not void
    all colors not void
    all colors count is sixteen


EV_STOCK_COLORS Flat contracts

indexing
    description: "Facilities for accessing standardized colors."
    keywords: "color, default"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_STOCK_COLORS

feature -- Access

    black: EV_COLOR
            -- Black.

    blue: EV_COLOR
            -- Blue.

    color_3d_face: EV_COLOR
            -- Used for dialog box background.
            -- Name: "color dialog".
            -- Was declared in EV_STOCK_COLORS as synonym of color_dialog.

    color_3d_highlight: EV_COLOR
            -- Used for 3D-effects (light color)
            -- Name "color highlight"

    color_3d_shadow: EV_COLOR
            -- Used for 3D-effects (dark color)
            -- Name "color shadow"

    color_dialog: EV_COLOR
            -- Used for dialog box background.
            -- Name: "color dialog".
            -- Was declared in EV_STOCK_COLORS as synonym of color_3d_face.

    color_read_only: EV_COLOR
            -- Used for background of editable when read-only.
            -- Name: "color read only".

    color_read_write: EV_COLOR
            -- Used for background of editable when write/write enabled.
            -- Name: "color read write".

    cyan: EV_COLOR
            -- Cyan.

    dark_blue: EV_COLOR
            -- Dark blue.

    dark_cyan: EV_COLOR
            -- Dark cyan.

    dark_gray: EV_COLOR
            -- Dark grey.
            -- Was declared in EV_STOCK_COLORS as synonym of dark_grey.

    dark_green: EV_COLOR
            -- Dark green.

    dark_grey: EV_COLOR
            -- Dark grey.
            -- Was declared in EV_STOCK_COLORS as synonym of dark_gray.

    dark_magenta: EV_COLOR
            -- Dark magenta.

    dark_red: EV_COLOR
            -- Dark red.

    dark_yellow: EV_COLOR
            -- Dark yellow.

    default_background_color: EV_COLOR
            -- Used for background of most widgets.
            -- Name: "default background".

    default_foreground_color: EV_COLOR
            -- Used for foreground of most widgets.
            -- Name: "default foreground".

    gray: EV_COLOR
            -- Grey.
            -- Was declared in EV_STOCK_COLORS as synonym of grey.

    green: EV_COLOR
            -- Green.

    grey: EV_COLOR
            -- Grey.
            -- Was declared in EV_STOCK_COLORS as synonym of gray.

    magenta: EV_COLOR
            -- Magenta.

    red: EV_COLOR
            -- Red.

    white: EV_COLOR
            -- White.

    yellow: EV_COLOR
            -- Yellow.

feature -- Basic operations

    all_colors: LINKED_LIST [EV_COLOR]
            -- A list of all the basic colors.

invariant

    white_not_void: white /= void
    black_not_void: black /= void
    grey_not_void: grey /= void
    gray_not_void: gray /= void
    dark_grey_not_void: dark_grey /= void
    dark_gray_not_void: dark_gray /= void
    blue_not_void: blue /= void
    dark_blue_not_void: dark_blue /= void
    cyan_not_void: cyan /= void
    dark_cyan_not_void: dark_cyan /= void
    green_not_void: green /= void
    dark_green_not_void: dark_green /= void
    yellow_not_void: yellow /= void
    dark_yellow_not_void: dark_yellow /= void
    red_not_void: red /= void
    dark_red_not_void: dark_red /= void
    magenta_not_void: magenta /= void
    dark_magenta_not_void: dark_magenta /= void
    color_dialog_not_void: color_dialog /= void
    color_read_only_not_void: color_read_only /= void
    color_read_write_not_void: color_read_write /= void
    default_background_color_not_void: default_background_color /= void
    default_foreground_color_not_void: default_foreground_color /= void
    all_colors_not_void: all_colors /= void
    all_colors_count_is_sixteen: all_colors.count = 18
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_STOCK_COLORS


EV_STOCK_PIXMAPS Chart

class
    EV_STOCK_PIXMAPS

General
    cluster: vision2.interface.support
    description: "Facilities for accessing default pixmaps."
    keywords: "pixmap, default"

Ancestors
    ANY

Queries
    Busy_cursor: EV_CURSOR
    Crosshair_cursor: EV_CURSOR
    Default_window_icon: EV_PIXMAP
    Error_pixmap: EV_PIXMAP
    Help_cursor: EV_CURSOR
    Ibeam_cursor: EV_CURSOR
    Information_pixmap: EV_PIXMAP
    No_cursor: EV_CURSOR
    Question_pixmap: EV_PIXMAP
    Sizeall_cursor: EV_CURSOR
    Sizenesw_cursor: EV_CURSOR
    Sizens_cursor: EV_CURSOR
    Sizenwse_cursor: EV_CURSOR
    Sizewe_cursor: EV_CURSOR
    Standard_cursor: EV_CURSOR
    Uparrow_cursor: EV_CURSOR
    Wait_cursor: EV_CURSOR
    Warning_pixmap: EV_PIXMAP


EV_STOCK_PIXMAPS Flat contracts

indexing
    description: "Facilities for accessing default pixmaps."
    status: "See notice at end of class"
    keywords: "pixmap, default"
    date: "$Date: 2001/07/12 18:30:38 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_STOCK_PIXMAPS

feature -- Default cursors

    busy_cursor: EV_CURSOR
            -- Standard arrow and small hourglass

    crosshair_cursor: EV_CURSOR
            -- Crosshair

    help_cursor: EV_CURSOR
            -- Arrow and question mark

    ibeam_cursor: EV_CURSOR
            -- I-beam

    no_cursor: EV_CURSOR
            -- Slashed_circle

    sizeall_cursor: EV_CURSOR
            -- Four-pointed arrow pointing north, south, east and west

    sizenesw_cursor: EV_CURSOR
            -- Double-pointed arrow pointing north-east and south-west

    sizens_cursor: EV_CURSOR
            -- Double-pointed arrow pointing north and south

    sizenwse_cursor: EV_CURSOR
            -- Double-pointed arrow pointing north-west and south-east

    sizewe_cursor: EV_CURSOR
            -- Double-pointed arrow pointing west and east

    standard_cursor: EV_CURSOR
            -- Standard arrow

    uparrow_cursor: EV_CURSOR
            -- Vertical arrow

    wait_cursor: EV_CURSOR
            -- Hourglass

feature -- Default pixmaps

    default_window_icon: EV_PIXMAP
            -- Pixmap used as default icon for new windows.

    error_pixmap: EV_PIXMAP
            -- Pixmap symbolizing an error.

    information_pixmap: EV_PIXMAP
            -- Pixmap symbolizing a piece of information.

    question_pixmap: EV_PIXMAP
            -- Pixmap symbolizing a question.

    warning_pixmap: EV_PIXMAP
            -- Pixmap symbolizing a warning.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_STOCK_PIXMAPS


EV_TEXT_ALIGNMENT Chart

class
    EV_TEXT_ALIGNMENT

General
    cluster: vision2.interface.support
    description: "Enumeration class for text alignment. Default is left."
    keywords: "text, aligment"
    create: make_with_left_alignment, make_with_right_alignment, make_with_center_alignment, default_create

Ancestors
    ANY

Queries
    is_center_aligned: BOOLEAN
    is_left_aligned: BOOLEAN
    is_right_aligned: BOOLEAN

Commands
    set_center_alignment
    set_left_alignment
    set_right_alignment

Constraints
    alignment code within range


EV_TEXT_ALIGNMENT Flat contracts

indexing
    description: "Enumeration class for text alignment. Default is left."
    status: "See notice at end of class"
    keywords: "text, aligment"
    date: "$Date: 2001/07/12 18:30:38 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_TEXT_ALIGNMENT

create

    make_with_left_alignment

    make_with_center_alignment

    make_with_right_alignment

feature -- Status report

    is_center_aligned: BOOLEAN

    is_left_aligned: BOOLEAN

    is_right_aligned: BOOLEAN

feature -- Status setting

    set_center_alignment
            -- Set the horizontal alignment to "center"
        ensure
            is_center_aligned: is_center_aligned

    set_left_alignment
            -- Set the horizontal alignment to "left"
        ensure
            is_left_aligned: is_left_aligned

    set_right_alignment
            -- Set the horizontal alignment to "right"
        ensure
            is_right_aligned: is_right_aligned

invariant

    alignment_code_within_range: alignment_code >= left_alignment and alignment_code <= right_alignment
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_TEXT_ALIGNMENT


EV_TEXT_RICH_ALIGNMENT Chart

class
    EV_TEXT_RICH_ALIGNMENT

General
    cluster: vision2.interface.support
    description: "Enumeration class for text rich alignment        (left, center, right) for horizontal alignment  (top, middle, bottom) for vertical alignment   "
    keywords: "text, aligment, vertical, horizontal"
    create: make_with_left_alignment, make_with_right_alignment, make_with_center_alignment, default_create

Ancestors
    EV_TEXT_ALIGNMENT

Queries
    is_bottom_aligned: BOOLEAN
    is_center_aligned: BOOLEAN
    is_left_aligned: BOOLEAN
    is_middle_aligned: BOOLEAN
    is_right_aligned: BOOLEAN
    is_top_aligned: BOOLEAN

Commands
    set_bottom_alignment
    set_center_alignment
    set_left_alignment
    set_middle_alignment
    set_right_alignment
    set_top_alignment

Constraints
    vertical alignment code within range


EV_TEXT_RICH_ALIGNMENT Flat contracts

indexing
    description: "Enumeration class for text rich alignment        (left, center, right) for horizontal alignment  (top, middle, bottom) for vertical alignment   "
    status: "See notice at end of class"
    keywords: "text, aligment, vertical, horizontal"
    date: "$Date: 2001/07/12 18:30:38 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_TEXT_RICH_ALIGNMENT

create

    make_with_left_alignment
            -- (from EV_TEXT_ALIGNMENT)

    make_with_center_alignment
            -- (from EV_TEXT_ALIGNMENT)

    make_with_right_alignment
            -- (from EV_TEXT_ALIGNMENT)

feature -- Status report

    is_bottom_aligned: BOOLEAN
            -- Is the vertical alignment set to "bottom"?

    is_center_aligned: BOOLEAN
            -- (from EV_TEXT_ALIGNMENT)

    is_left_aligned: BOOLEAN
            -- (from EV_TEXT_ALIGNMENT)

    is_middle_aligned: BOOLEAN
            -- Is the vertical alignment set to "middle"?

    is_right_aligned: BOOLEAN
            -- (from EV_TEXT_ALIGNMENT)

    is_top_aligned: BOOLEAN
            -- Is the vertical alignment set to "top"?

feature -- Status setting

    set_bottom_alignment
            -- Set the vertical alignment to "top"
        ensure
            is_bottom_aligned: is_bottom_aligned

    set_center_alignment
            -- Set the horizontal alignment to "center"
            -- (from EV_TEXT_ALIGNMENT)
        ensure -- from EV_TEXT_ALIGNMENT
            is_center_aligned: is_center_aligned

    set_left_alignment
            -- Set the horizontal alignment to "left"
            -- (from EV_TEXT_ALIGNMENT)
        ensure -- from EV_TEXT_ALIGNMENT
            is_left_aligned: is_left_aligned

    set_middle_alignment
            -- Set the vertical alignment to "top"
        ensure
            is_middle_aligned: is_middle_aligned

    set_right_alignment
            -- Set the horizontal alignment to "right"
            -- (from EV_TEXT_ALIGNMENT)
        ensure -- from EV_TEXT_ALIGNMENT
            is_right_aligned: is_right_aligned

    set_top_alignment
            -- Set the vertical alignment to "top"
        ensure
            is_top_aligned: is_top_aligned

invariant

    vertical_alignment_code_within_range: alignment_code >= top_alignment and alignment_code <= bottom_alignment
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TEXT_ALIGNMENT
    alignment_code_within_range: alignment_code >= left_alignment and alignment_code <= right_alignment

end -- class EV_TEXT_RICH_ALIGNMENT


EV_TREE_NODE_LIST Chart

deferred class
    EV_TREE_NODE_LIST

General
    cluster: vision2.interface.support
    description: "Base class for EV_TREE and EV_TREE_ITEM."

Ancestors
    EV_ITEM_LIST [G -> EV_ITEM]

Queries
    infix "@" (i: INTEGER): [like item] EV_TREE_NODE
    after: BOOLEAN
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TREE_NODE]
    data: ANY
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_TREE_NODE
    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] EV_TREE_NODE): BOOLEAN
    i_th (i: INTEGER): EV_TREE_NODE
    index: INTEGER
    index_of (v: [like item] EV_TREE_NODE; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_TREE_NODE_LIST): BOOLEAN
    is_inserted (v: EV_TREE_NODE): BOOLEAN
    is_parent_recursive (a_list: EV_ANY): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_TREE_NODE
    item_by_data (some_data: ANY): [like item] EV_TREE_NODE
    last: [like item] EV_TREE_NODE
    linear_representation: LINEAR [EV_TREE_NODE]
    object_comparison: BOOLEAN
    occurrences (v: [like item] EV_TREE_NODE): INTEGER
    off: BOOLEAN
    parent: EV_ANY
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    sequential_occurrences (v: EV_TREE_NODE): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [EV_TREE_NODE])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_TREE_NODE_LIST)
    default_create
    destroy
    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
    extend (v: [like item] EV_TREE_NODE)
    fill (other: CONTAINER [EV_TREE_NODE])
    finish
    force (v: [like item] EV_TREE_NODE)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] EV_TREE_NODE_LIST)
    merge_right (other: [like Current] EV_TREE_NODE_LIST)
    move (i: INTEGER)
    prune (v: [like item] EV_TREE_NODE)
    prune_all (v: [like item] EV_TREE_NODE)
    put (v: [like item] EV_TREE_NODE)
    put_front (v: [like item] EV_TREE_NODE)
    put_i_th (v: [like item] EV_TREE_NODE; i: INTEGER)
    put_left (v: [like item] EV_TREE_NODE)
    put_right (v: [like item] EV_TREE_NODE)
    remove
    remove_left
    remove_right
    replace (v: [like item] EV_TREE_NODE)
    search (v: [like item] EV_TREE_NODE)
    set_data (some_data: [like data] ANY)
    start
    swap (i: INTEGER)
    wipe_out


EV_TREE_NODE_LIST Flat contracts

indexing
    description: "Base class for EV_TREE and EV_TREE_ITEM."
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_TREE_NODE_LIST

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TREE_NODE]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): EV_TREE_NODE
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    item: EV_TREE_NODE
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: EV_TREE_NODE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_TREE_NODE): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    parent: EV_ANY
            -- The parent that Current is contained within, if any.
            -- (from EV_CONTAINABLE)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_TREE_NODE])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_TREE_NODE])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).old_parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).old_parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.old_parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).old_parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).old_parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).old_parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_TREE_NODE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_parent_recursive (a_list: EV_ANY): BOOLEAN
            -- Is a_list a parent of Current?
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_TREE_NODE_LIST


cluster vision2.interface.widgets

Cluster
    vision2.interface.widgets

Supercluster
    vision2.interface

Subclusters
    vision2.interface.widgets.containers
    vision2.interface.widgets.dialogs
    vision2.interface.widgets.primitives

Classes
    EV_WIDGET


cluster vision2.interface.widgets.containers

Cluster
    vision2.interface.widgets.containers

Supercluster
    vision2.interface.widgets

Subclusters

Classes
    EV_BOX
    EV_CELL
    EV_CONTAINER
    EV_FIXED
    EV_FRAME
    EV_FRAME_CONSTANTS
    EV_HORIZONTAL_BOX
    EV_HORIZONTAL_SPLIT_AREA
    EV_MENU_ITEM_LIST
    EV_NOTEBOOK
    EV_SCROLLABLE_AREA
    EV_SPLIT_AREA
    EV_STATUS_BAR
    EV_TABLE
    EV_TITLED_WINDOW
    EV_TREE_NODE_CONTAINER
    EV_VERTICAL_BOX
    EV_VERTICAL_SPLIT_AREA
    EV_VIEWPORT
    EV_WIDGET_LIST
    EV_WINDOW


EV_BOX Chart

deferred class
    EV_BOX

General
    cluster: vision2.interface.widgets.containers
    description:
        "Linear widget container.
        Base class for EV_HORIZONTAL_BOX and EV_VERTICAL_BOX"
    keywords: "box, container, child"

Ancestors
    EV_WIDGET_LIST

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    border_width: INTEGER
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_WIDGET
    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_WIDGET
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_WIDGET; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_BOX): BOOLEAN
    is_homogeneous: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_WIDGET
    last: [like item] EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_WIDGET): INTEGER
    off: BOOLEAN
    padding: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    sequential_occurrences (v: EV_WIDGET): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_WIDGET])
    back
    center_pointer
    copy (other: [like Current] EV_BOX)
    default_create
    destroy
    disable_capture
    disable_homogeneous
    disable_item_expand (an_item: EV_WIDGET)
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
    enable_capture
    enable_homogeneous
    enable_item_expand (an_item: EV_WIDGET)
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    finish
    force (v: [like item] EV_WIDGET)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_BOX)
    merge_radio_button_groups (other: EV_CONTAINER)
    merge_right (other: [like Current] EV_BOX)
    move (i: INTEGER)
    propagate_background_color
    propagate_foreground_color
    prune (v: [like item] EV_WIDGET)
    prune_all (v: [like item] EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    put_front (v: [like item] EV_WIDGET)
    put_i_th (v: [like item] EV_WIDGET; i: INTEGER)
    put_left (v: [like item] EV_WIDGET)
    put_right (v: [like item] EV_WIDGET)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    replace (v: [like item] EV_WIDGET)
    search (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_border_width (value: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_padding (value: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_BOX Flat contracts

indexing
    description: "Linear widget container.Base class for EV_HORIZONTAL_BOX and EV_VERTICAL_BOX"
    status: "See notice at end of class"
    keywords: "box, container, child"
    date: "$Date: 2001/07/14 11:14:57 $"
    revision: "$Revision: 1.4 $"

deferred class interface
    EV_BOX

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_WIDGET
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_WIDGET): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        require -- from  FINITE
            True
        require -- from  SET
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    border_width: INTEGER
            -- Width of border around container in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.border_width
            positive: Result >= 0

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_homogeneous: BOOLEAN
            -- Are all items forced to have same dimensions.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_homogeneous

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
            -- Is an_item expanded to occupy available spare space?
        require
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure
            bridge_ok: Result = implementation.is_item_expanded (an_item)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    padding: INTEGER
            -- Space between children in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.padding
            positive: Result >= 0

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_homogeneous
            -- Allow items to have different dimensions.
        require
            not_destroyed: not is_destroyed
        ensure
            not_is_homogeneous: not is_homogeneous

    disable_item_expand (an_item: EV_WIDGET)
            -- Do not expand an_item to occupy available spare space.
        require
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure
            not_an_item_expanded: not is_item_expanded (an_item)

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_homogeneous
            -- Force all items to have same dimensions.
        require
            not_destroyed: not is_destroyed
        ensure
            is_homogeneous: is_homogeneous

    enable_item_expand (an_item: EV_WIDGET)
            -- Expand an_item to occupy available spare space.
        require
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure
            an_item_expanded: is_item_expanded (an_item)

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_border_width (value: INTEGER)
            -- Assign value to border_width.
        require
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure
            border_width_assigned: border_width = value

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_padding (value: INTEGER)
            -- Assign value to padding.
        require
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure
            padding_assigned: padding = value

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_WIDGET])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_BOX


EV_CELL Chart

class
    EV_CELL

General
    cluster: vision2.interface.widgets.containers
    description: "Container that holds only one widget."
    keywords: "container"
    create: default_create

Ancestors
    EV_CONTAINER

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_CELL)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    remove_help_context
    remove_pebble
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    wipe_out


EV_CELL Flat contracts

indexing
    description: "Container that holds only one widget."
    appearance: "---------------|             ||   `item'    ||             |---------------"
    status: "See notice at end of class"
    keywords: "container"
    date: "$Date: 2001/07/14 11:02:40 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_CELL

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: EV_WIDGET): BOOLEAN
            -- Does Current include v?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items in Current.
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.

    full: BOOLEAN
            -- Is structure filled to capacity?

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    writable: BOOLEAN
            -- Is there a current item that may be modified?
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
        require -- from COLLECTION
            prunable: prunable
        ensure then
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_CELL


EV_CONTAINER Chart

deferred class
    EV_CONTAINER

General
    cluster: vision2.interface.widgets.containers
    description:
        "Widget that contains other widgets.
        Base class for all containers."
    keywords: "container, pack"

Ancestors
    BOX [G]
    COLLECTION [G]
    EV_WIDGET

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_CONTAINER)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    remove_help_context
    remove_pebble
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    wipe_out

Constraints
    client width within bounds
    client height within bounds
    all radio buttons connected
    parent of items is current
    items unique


EV_CONTAINER Flat contracts

indexing
    description: "Widget that contains other widgets.Base class for all containers."
    status: "See notice at end of class"
    keywords: "container, pack"
    date: "$Date: 2001/07/14 11:02:40 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_CONTAINER

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    count: INTEGER
            -- Number of elements in Current.
        require
            not_destroyed: not is_destroyed

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CONTAINER)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
        require
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
        require
            not_destroyed: not is_destroyed
            readable: readable
        ensure
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    extendible: BOOLEAN
            -- May new items be added?
            -- (from COLLECTION)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from BOX)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from COLLECTION)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
        require
            not_destroyed: not is_destroyed

    writable: BOOLEAN
            -- Is there a current item that may be modified?
        require
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
        require
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
        require
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
        require
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
        require
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove one occurrence of v if any.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from CONTAINER)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
        require
            not_destroyed: not is_destroyed
        ensure
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
        require
            not_destroyed: not is_destroyed
        ensure
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_CONTAINER


EV_FIXED Chart

class
    EV_FIXED

General
    cluster: vision2.interface.widgets.containers
    description:
        "Container that allows custom placement of widgets. Widgets are
        placed relative to (`origin_x', `origin_y'). Clipping will be
        applied. Items are ordered in z-order with the last item as the
        topmost."
    keywords: "container, fixed, custom"
    create: default_create

Ancestors
    DOUBLE_MATH
    EV_WIDGET_LIST

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_WIDGET
    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_WIDGET
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_WIDGET; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_FIXED): BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_WIDGET
    last: [like item] EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_WIDGET): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    sequential_occurrences (v: EV_WIDGET): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_WIDGET])
    back
    center_pointer
    copy (other: [like Current] EV_FIXED)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    finish
    force (v: [like item] EV_WIDGET)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_FIXED)
    merge_radio_button_groups (other: EV_CONTAINER)
    merge_right (other: [like Current] EV_FIXED)
    move (i: INTEGER)
    propagate_background_color
    propagate_foreground_color
    prune (v: [like item] EV_WIDGET)
    prune_all (v: [like item] EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    put_front (v: [like item] EV_WIDGET)
    put_i_th (v: [like item] EV_WIDGET; i: INTEGER)
    put_left (v: [like item] EV_WIDGET)
    put_right (v: [like item] EV_WIDGET)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    replace (v: [like item] EV_WIDGET)
    search (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_item_height (a_widget: EV_WIDGET; a_height: INTEGER)
    set_item_position (a_widget: EV_WIDGET; an_x, a_y: INTEGER)
    set_item_size (a_widget: EV_WIDGET; a_width, a_height: INTEGER)
    set_item_width (a_widget: EV_WIDGET; a_width: INTEGER)
    set_item_x_position (a_widget: EV_WIDGET; an_x: INTEGER)
    set_item_y_position (a_widget: EV_WIDGET; a_y: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_FIXED Flat contracts

indexing
    description: "Container that allows custom placement of widgets. Widgets areplaced relative to (`origin_x', `origin_y'). Clipping will beapplied. Items are ordered in z-order with the last item as thetopmost."
    appearance: "+---------------------+|    +--------+       ||    |        |       ||  +-+ `last' +-------+|  | |        |`first'||  +-+        +-------++----+--------+-------+"
    status: "See notice at end of class"
    keywords: "container, fixed, custom"
    date: "$Date: 2001/07/14 11:02:40 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_FIXED

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_WIDGET
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_WIDGET): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        require -- from  FINITE
            True
        require -- from  SET
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_WIDGET])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_item_height (a_widget: EV_WIDGET; a_height: INTEGER)
            -- Assign a_height to a_widget.height.
        require
            not_destroyed: not is_destroyed
            has_a_widget: has (a_widget)
            a_height_not_smaller_than_minimum_height: a_height >= a_widget.minimum_height
        ensure
            an_item_height_assigned: a_widget.height = a_height

    set_item_position (a_widget: EV_WIDGET; an_x, a_y: INTEGER)
            -- Assign an_x to a_widget.x_position.
            -- Assign a_y to a_widget.y_position.
        require
            not_destroyed: not is_destroyed
            has_a_widget: has (a_widget)
            an_x_non_negative: an_x >= 0
            a_y_non_negative: a_y >= 0
        ensure
            an_item_x_position_assigned: a_widget.x_position = an_x
            an_item_y_position_assigned: a_widget.y_position = a_y

    set_item_size (a_widget: EV_WIDGET; a_width, a_height: INTEGER)
            -- Assign _width to a_widget.width.
            -- Assign a_height to a_widget.height.
        require
            not_destroyed: not is_destroyed
            has_a_widget: has (a_widget)
            a_width_not_smaller_than_minimum_width: a_width >= a_widget.minimum_width
            a_height_not_smaller_than_minimum_height: a_height >= a_widget.minimum_height
        ensure
            an_item_width_assigned: a_widget.width = a_width
            an_item_height_assigned: a_widget.height = a_height

    set_item_width (a_widget: EV_WIDGET; a_width: INTEGER)
            -- Assign a_width to a_widget.width.
        require
            not_destroyed: not is_destroyed
            has_a_widget: has (a_widget)
            a_width_not_smaller_than_minimum_width: a_width >= a_widget.minimum_width
        ensure
            an_item_width_assigned: a_widget.width = a_width

    set_item_x_position (a_widget: EV_WIDGET; an_x: INTEGER)
            -- Assign an_x to a_widget.x_position.
        require
            not_destroyed: not is_destroyed
            has_a_widget: has (a_widget)
            an_x_non_negative: an_x >= 0
        ensure
            an_item_x_position_assigned: a_widget.x_position = an_x

    set_item_y_position (a_widget: EV_WIDGET; a_y: INTEGER)
            -- Assign a_y to a_widget.y_position.
        require
            not_destroyed: not is_destroyed
            has_a_widget: has (a_widget)
            a_y_non_negative: a_y >= 0
        ensure
            an_item_y_position_assigned: a_widget.y_position = a_y

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_FIXED


EV_FRAME_CONSTANTS Chart

class
    EV_FRAME_CONSTANTS

General
    cluster: vision2.interface.widgets.containers
    description: "Constants for use by and with EV_FRAME."
    keywords: "frame, bevel, outline, raised, lowered"

Ancestors
    ANY

Queries
    Ev_frame_etched_in: INTEGER
    Ev_frame_etched_out: INTEGER
    Ev_frame_lowered: INTEGER
    Ev_frame_raised: INTEGER
    valid_frame_border (a_code: INTEGER): BOOLEAN


EV_FRAME_CONSTANTS Flat contracts

indexing
    description: "Constants for use by and with EV_FRAME."
    status: "See notice at end of class"
    keywords: "frame, bevel, outline, raised, lowered"
    date: "$Date: 2001/07/12 18:30:38 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_FRAME_CONSTANTS

feature -- Constants

    Ev_frame_etched_in: INTEGER is unique
            -- Sunken groove.

    Ev_frame_etched_out: INTEGER is unique
            -- Raised ridge.

    Ev_frame_lowered: INTEGER is unique
            -- Inward bevel.

    Ev_frame_raised: INTEGER is unique
            -- Outward bevel.

feature -- Contract support

    valid_frame_border (a_code: INTEGER): BOOLEAN
            -- Is a_code a valid code ?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_FRAME_CONSTANTS


EV_FRAME Chart

class
    EV_FRAME

General
    cluster: vision2.interface.widgets.containers
    description: "Displays an optionally labeled border around a widget."
    keywords: "container, frame, box, border, bevel, outline, raised, lowered"
    create: make_with_text, default_create

Ancestors
    EV_CELL
    EV_FRAME_CONSTANTS
    EV_TEXTABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    style: INTEGER
    target_name: STRING
    text: STRING
    valid_frame_border (a_code: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_FRAME)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    remove_help_context
    remove_pebble
    remove_text
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_style (a_style: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    show
    wipe_out

Constraints
    valid style


EV_FRAME Flat contracts

indexing
    description: "Displays an optionally labeled border around a widget."
    appearance: "+<`text'>-----+|             ||   `item'    ||             |+-------------+"
    status: "See notice at end of class"
    keywords: "container, frame, box, border, bevel, outline, raised, lowered"
    date: "$Date: 2001/07/14 11:02:40 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_FRAME

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: EV_WIDGET): BOOLEAN
            -- Does Current include v?
            -- (from EV_CELL)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    style: INTEGER
            -- Visual appearance. See: EV_FRAME_CONSTANTS.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.style

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_style (a_style: INTEGER)
            -- Assign a_style to style.
        require
            not_destroyed: not is_destroyed
            a_style_valid: valid_frame_border (a_style)
        ensure
            style_assigned: style = a_style

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature  -- Contract support

    valid_frame_border (a_code: INTEGER): BOOLEAN
            -- Is a_code a valid code ?
            -- (from EV_FRAME_CONSTANTS)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    valid_style: is_usable implies valid_frame_border (style)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_FRAME


EV_HORIZONTAL_BOX Chart

class
    EV_HORIZONTAL_BOX

General
    cluster: vision2.interface.widgets.containers
    description: "Horizontal linear widget container."
    keywords: "container, horizontal, box"
    create: default_create

Ancestors
    EV_BOX

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    border_width: INTEGER
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_WIDGET
    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_WIDGET
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_WIDGET; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_HORIZONTAL_BOX): BOOLEAN
    is_homogeneous: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_WIDGET
    last: [like item] EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_WIDGET): INTEGER
    off: BOOLEAN
    padding: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    sequential_occurrences (v: EV_WIDGET): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_WIDGET])
    back
    center_pointer
    copy (other: [like Current] EV_HORIZONTAL_BOX)
    default_create
    destroy
    disable_capture
    disable_homogeneous
    disable_item_expand (an_item: EV_WIDGET)
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
    enable_capture
    enable_homogeneous
    enable_item_expand (an_item: EV_WIDGET)
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    finish
    force (v: [like item] EV_WIDGET)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_HORIZONTAL_BOX)
    merge_radio_button_groups (other: EV_CONTAINER)
    merge_right (other: [like Current] EV_HORIZONTAL_BOX)
    move (i: INTEGER)
    propagate_background_color
    propagate_foreground_color
    prune (v: [like item] EV_WIDGET)
    prune_all (v: [like item] EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    put_front (v: [like item] EV_WIDGET)
    put_i_th (v: [like item] EV_WIDGET; i: INTEGER)
    put_left (v: [like item] EV_WIDGET)
    put_right (v: [like item] EV_WIDGET)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    replace (v: [like item] EV_WIDGET)
    search (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_border_width (value: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_padding (value: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_HORIZONTAL_BOX Flat contracts

indexing
    description: "Horizontal linear widget container."
    appearance: "---------------------------------------------|             |              |              ||   `first'   |     ....     |    `last'    ||             |              |              |---------------------------------------------"
    status: "See notice at end of class"
    keywords: "container, horizontal, box"
    date: "$Date: 2001/07/14 11:14:57 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_HORIZONTAL_BOX

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_WIDGET
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_WIDGET): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        require -- from  FINITE
            True
        require -- from  SET
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    border_width: INTEGER
            -- Width of border around container in pixels.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.border_width
            positive: Result >= 0

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_homogeneous: BOOLEAN
            -- Are all items forced to have same dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.is_homogeneous

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
            -- Is an_item expanded to occupy available spare space?
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.is_item_expanded (an_item)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    padding: INTEGER
            -- Space between children in pixels.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.padding
            positive: Result >= 0

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_homogeneous
            -- Allow items to have different dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            not_is_homogeneous: not is_homogeneous

    disable_item_expand (an_item: EV_WIDGET)
            -- Do not expand an_item to occupy available spare space.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            not_an_item_expanded: not is_item_expanded (an_item)

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_homogeneous
            -- Force all items to have same dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            is_homogeneous: is_homogeneous

    enable_item_expand (an_item: EV_WIDGET)
            -- Expand an_item to occupy available spare space.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            an_item_expanded: is_item_expanded (an_item)

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_border_width (value: INTEGER)
            -- Assign value to border_width.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure -- from EV_BOX
            border_width_assigned: border_width = value

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_padding (value: INTEGER)
            -- Assign value to padding.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure -- from EV_BOX
            padding_assigned: padding = value

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_WIDGET])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_HORIZONTAL_BOX


EV_HORIZONTAL_SPLIT_AREA Chart

class
    EV_HORIZONTAL_SPLIT_AREA

General
    cluster: vision2.interface.widgets.containers
    description: "Displays two widgets side by side, seperated by an adjustable divider."
    create: default_create

Ancestors
    EV_SPLIT_AREA

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    first: EV_WIDGET
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    maximum_split_position: INTEGER
    minimum_height: INTEGER
    minimum_split_position: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    Prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    second: EV_WIDGET
    split_position: INTEGER
    target_name: STRING
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_HORIZONTAL_SPLIT_AREA)
    default_create
    destroy
    disable_capture
    disable_item_expand (an_item: EV_WIDGET)
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_item_expand (an_item: EV_WIDGET)
    enable_pebble_positioning
    enable_sensitive
    extend (an_item: EV_WIDGET)
    go_to_first
    go_to_second
    hide
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (an_item: EV_WIDGET)
    remove_help_context
    remove_pebble
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_first (an_item: EV_WIDGET)
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_second (an_item: EV_WIDGET)
    set_split_position (a_split_position: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    wipe_out


EV_HORIZONTAL_SPLIT_AREA Flat contracts

indexing
    description: "Displays two widgets side by side, seperated by an adjustable divider."
    apearance: "------------------------------|             ||             ||   `first'   ||   `second'  ||             ||             |------------------------------"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:40 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_HORIZONTAL_SPLIT_AREA

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: EV_WIDGET
            -- First item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    second: EV_WIDGET
            -- Second item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items.
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_SPLIT_AREA
            count_not_negative: count >= 0
            count_valid: count <= 2

    extendible: BOOLEAN
            -- Is structure not full yet?
            -- (from EV_SPLIT_AREA)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_SPLIT_AREA)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_SPLIT_AREA)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from EV_SPLIT_AREA)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
            -- Is an_item expanded relative to Current?
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.is_item_expanded (an_item)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    maximum_split_position: INTEGER
            -- Maximum position splitter can have.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.maximum_split_position
            non_negative: Result >= 0

    minimum_split_position: INTEGER
            -- Minimum position splitter can have.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.minimum_split_position
            non_negative: Result >= 0

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    Prunable: BOOLEAN is True
            -- Items may be removed.
            -- (from EV_SPLIT_AREA)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    split_position: INTEGER
            -- Offset of splitter from left or top.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.split_position

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_item_expand (an_item: EV_WIDGET)
            -- When Current is resized, do not resize an_item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
            split_area_full: full
            other_item_is_expandable: (an_item = first and is_item_expanded (second)) or (an_item = second and is_item_expanded (first))
        ensure -- from EV_SPLIT_AREA
            not_an_item_expanded: not is_item_expanded (an_item)

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_item_expand (an_item: EV_WIDGET)
            -- When Current is resized, resize an_item respectively.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
        ensure -- from EV_SPLIT_AREA
            an_item_expanded: is_item_expanded (an_item)

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    go_to_first
            -- Make first current item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            first_exists: first /= void
        ensure -- from EV_SPLIT_AREA
            item_is_first: item = first

    go_to_second
            -- Make first current item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            second_exists: second /= void
        ensure -- from EV_SPLIT_AREA
            item_is_second: item = second

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Position split_position between minimum and maximum determined
            -- by a_proportion.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            split_area_full: full
            a_proportion_in_valid_range: (a_proportion >= 0 and a_proportion <= 1)

    set_split_position (a_split_position: INTEGER)
            -- Make a_split_position position of splitter in pixels.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            split_area_full: full
            a_split_position_within_bounds: is_displayed implies ((a_split_position >= minimum_split_position and a_split_position <= maximum_split_position))
        ensure -- from EV_SPLIT_AREA
            split_position_assigned: split_position = a_split_position

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (an_item: EV_WIDGET)
            -- Assign an_item to first_item if not already assigned or to
            -- second_item otherwise.
            -- Was declared in EV_SPLIT_AREA as synonym of put.
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure then -- from EV_SPLIT_AREA
            first_item_used_first: old first = void implies first = an_item
            second_item_used_second: old first /= void implies second = an_item
            has_an_item: has (an_item)

    put (an_item: EV_WIDGET)
            -- Assign an_item to first_item if not already assigned or to
            -- second_item otherwise.
            -- Was declared in EV_SPLIT_AREA as synonym of extend.
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure then -- from EV_SPLIT_AREA
            first_item_used_first: old first = void implies first = an_item
            second_item_used_second: old first /= void implies second = an_item
            has_an_item: has (an_item)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_first (an_item: EV_WIDGET)
            -- Assign an_item to first.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            an_item_not_in_split_area: not has (an_item)
            an_item_parent_is_void: an_item.parent = void
            first_is_void: first = void
        ensure -- from EV_SPLIT_AREA
            an_item_assigned: first = an_item
            an_item_not_expanded: not is_item_expanded (an_item)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_second (an_item: EV_WIDGET)
            -- Assign an_item to second.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            an_item_not_in_split_area: not has (an_item)
            an_item_parent_is_void: an_item.parent = void
            second_is_void: second = void
        ensure -- from EV_SPLIT_AREA
            an_item_assigned: second = an_item
            an_item_expanded: is_item_expanded (an_item)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove one occurrence of v if any.
            -- (from EV_SPLIT_AREA)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_SPLIT_AREA
            count_is_one_implies_child_expandable: (count = 1 implies (first /= void and is_item_expanded (first) or second /= void and is_item_expanded (second)))

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from EV_SPLIT_AREA)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from EV_SPLIT_AREA)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_SPLIT_AREA
    maximum_greater_or_equal_minimum: is_usable implies minimum_split_position <= maximum_split_position
    splitter_in_valid_position__minimum: full implies split_position >= minimum_split_position
    splitter_in_valid_position__maximum: full implies split_position <= maximum_split_position
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_HORIZONTAL_SPLIT_AREA


EV_MENU_ITEM_LIST Chart

deferred class
    EV_MENU_ITEM_LIST

General
    cluster: vision2.interface.widgets.containers
    description: "Eiffel Vision menu item list."
    keywords: "menu, bar, drop down, popup"

Ancestors
    EV_ITEM_LIST [G -> EV_ITEM]
    EV_MENU_ITEM_LIST_ACTION_SEQUENCES

Action sequences
    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_MENU_ITEM
    after: BOOLEAN
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MENU_ITEM]
    data: ANY
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_MENU_ITEM
    for_all (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] EV_MENU_ITEM): BOOLEAN
    i_th (i: INTEGER): EV_MENU_ITEM
    index: INTEGER
    index_of (v: [like item] EV_MENU_ITEM; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_MENU_ITEM_LIST): BOOLEAN
    is_inserted (v: EV_MENU_ITEM): BOOLEAN
    is_parent_recursive (a_list: EV_MENU_ITEM_LIST): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_MENU_ITEM
    item_by_data (some_data: ANY): [like item] EV_MENU_ITEM
    last: [like item] EV_MENU_ITEM
    linear_representation: LINEAR [EV_MENU_ITEM]
    object_comparison: BOOLEAN
    occurrences (v: [like item] EV_MENU_ITEM): INTEGER
    off: BOOLEAN
    parent: EV_MENU_ITEM_LIST
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    sequential_occurrences (v: EV_MENU_ITEM): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    append (s: SEQUENCE [EV_MENU_ITEM])
    back
    compare_objects
    compare_references
    copy (other: [like Current] EV_MENU_ITEM_LIST)
    default_create
    destroy
    do_all (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN])
    extend (v: [like item] EV_MENU_ITEM)
    fill (other: CONTAINER [EV_MENU_ITEM])
    finish
    force (v: [like item] EV_MENU_ITEM)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    merge_left (other: [like Current] EV_MENU_ITEM_LIST)
    merge_right (other: [like Current] EV_MENU_ITEM_LIST)
    move (i: INTEGER)
    prune (v: [like item] EV_MENU_ITEM)
    prune_all (v: [like item] EV_MENU_ITEM)
    put (v: [like item] EV_MENU_ITEM)
    put_front (v: [like item] EV_MENU_ITEM)
    put_i_th (v: [like item] EV_MENU_ITEM; i: INTEGER)
    put_left (v: [like item] EV_MENU_ITEM)
    put_right (v: [like item] EV_MENU_ITEM)
    remove
    remove_left
    remove_right
    replace (v: [like item] EV_MENU_ITEM)
    search (v: [like item] EV_MENU_ITEM)
    set_data (some_data: [like data] ANY)
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    item select actions not void


EV_MENU_ITEM_LIST Flat contracts

indexing
    description: "Eiffel Vision menu item list."
    status: "See notice at end of class"
    keywords: "menu, bar, drop down, popup"
    date: "$Date: 2001/07/14 01:02:23 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_MENU_ITEM_LIST

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MENU_ITEM]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): EV_MENU_ITEM
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    item: EV_MENU_ITEM
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    sequential_occurrences (v: EV_MENU_ITEM): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_MENU_ITEM): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    parent: EV_MENU_ITEM_LIST
            -- Container of Current.
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_MENU_ITEM])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_MENU_ITEM])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_MENU_ITEM]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    is_parent_recursive (a_list: EV_MENU_ITEM_LIST): BOOLEAN
            -- Is Current present in a_list hierarchy?
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    item_select_actions: EV_MENU_ITEM_SELECT_ACTION_SEQUENCE
            -- Actions to be performed when a menu item is selected.
            -- (from EV_MENU_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_MENU_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_MENU_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_MENU_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    item_select_actions_not_void: is_usable implies item_select_actions /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_MENU_ITEM_LIST


EV_NOTEBOOK Chart

class
    EV_NOTEBOOK

General
    cluster: vision2.interface.widgets.containers
    description: "Multiple widget container. Each widget is displayed on an individualpage. A tab is displayed for each page allow its selection. Only theselected page is visible."
    create: default_create

Ancestors
    EV_NOTEBOOK_ACTION_SEQUENCES
    EV_WIDGET_LIST

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    selection_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_WIDGET
    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_WIDGET
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_WIDGET; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_NOTEBOOK): BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_WIDGET
    item_text (an_item: EV_WIDGET): STRING
    last: [like item] EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_WIDGET): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_item: EV_WIDGET
    selected_item_index: INTEGER
    sequential_occurrences (v: EV_WIDGET): INTEGER
    Tab_bottom: INTEGER
    Tab_left: INTEGER
    tab_position: INTEGER
    Tab_right: INTEGER
    Tab_top: INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_WIDGET])
    back
    center_pointer
    copy (other: [like Current] EV_NOTEBOOK)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    finish
    force (v: [like item] EV_WIDGET)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_NOTEBOOK)
    merge_radio_button_groups (other: EV_CONTAINER)
    merge_right (other: [like Current] EV_NOTEBOOK)
    move (i: INTEGER)
    position_tabs_bottom
    position_tabs_left
    position_tabs_right
    position_tabs_top
    propagate_background_color
    propagate_foreground_color
    prune (v: [like item] EV_WIDGET)
    prune_all (v: [like item] EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    put_front (v: [like item] EV_WIDGET)
    put_i_th (v: [like item] EV_WIDGET; i: INTEGER)
    put_left (v: [like item] EV_WIDGET)
    put_right (v: [like item] EV_WIDGET)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    replace (v: [like item] EV_WIDGET)
    search (v: [like item] EV_WIDGET)
    select_item (an_item: EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_item_text (an_item: EV_WIDGET; a_text: STRING)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_tab_position (a_tab_position: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    tab position within range
    selected item not void
    selected item index within range
    selected item is i th of selected item index
    selected item index is index of selected item


EV_NOTEBOOK Flat contracts

indexing
    description: "Multiple widget container. Each widget is displayed on an individualpage. A tab is displayed for each page allow its selection. Only theselected page is visible."
    appearance: "  _______  _______  _______       _/ tab_1 \/_tab_2_\/_tab_3_\______|                                ||        `selected_item'         ||                                |----------------------------------"
    status: "See notice at end of class"
    keywrods: "notebook, tab, page"
    date: "$Date: 2001/07/14 11:02:40 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_NOTEBOOK

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_WIDGET
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_text (an_item: EV_WIDGET): STRING
            -- Label of an_item.
        require
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure
            bridge_ok: Result.is_equal (implementation.item_text (an_item))
            not_void: Result /= void

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_WIDGET): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        require -- from  FINITE
            True
        require -- from  SET
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    selected_item: EV_WIDGET
            -- Page displayed topmost.
        require
            not_destroyed: not is_destroyed
            item_is_selected: not is_empty
        ensure
            bridge_ok: Result = implementation.selected_item

    selected_item_index: INTEGER
            -- Index of selected_item.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.selected_item_index

    tab_position: INTEGER
            -- Position of tabs.
            -- One of Tab_left, Tab_right, Tab_top or Tab_bottom.
            -- Default: Tab_top
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.tab_position

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    position_tabs_bottom
            -- Display tabs at bottom of Current.
        require
            not_destroyed: not is_destroyed
        ensure
            tab_position_set: tab_position = tab_bottom

    position_tabs_left
            -- Display tabs at left of Current.
        require
            not_destroyed: not is_destroyed
        ensure
            tab_position_set: tab_position = tab_left

    position_tabs_right
            -- Display tabs at right of Current.
        require
            not_destroyed: not is_destroyed
        ensure
            tab_position_set: tab_position = tab_right

    position_tabs_top
            -- Display tabs at top of Current.
        require
            not_destroyed: not is_destroyed
        ensure
            tab_position_set: tab_position = tab_top

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    select_item (an_item: EV_WIDGET)
            -- Display an_item above all others.
        require
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure
            item_selected: selected_item = an_item

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_tab_position (a_tab_position: INTEGER)
            -- Display tabs at a_tab_position.
        require
            not_destroyed: not is_destroyed
            a_position_within_range: a_tab_position = tab_left or a_tab_position = tab_right or a_tab_position = tab_bottom or a_tab_position = tab_top
        ensure
            tab_position_set: tab_position = a_tab_position

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_WIDGET])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_item_text (an_item: EV_WIDGET; a_text: STRING)
            -- Assign a_text to label of an_item.
        require
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
            a_text_not_void: a_text /= void
        ensure
            item_text_assigned: item_text (an_item).is_equal (a_text)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Constants

    Tab_bottom: INTEGER is unique
            -- Value used to position tab at bottom.

    Tab_left: INTEGER is unique
            -- Value used to position tab at left.

    Tab_right: INTEGER is unique
            -- Value used to position tab at right.

    Tab_top: INTEGER is unique
            -- Value used to position tab at top.

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    selection_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when selected_item changes.
            -- (from EV_NOTEBOOK_ACTION_SEQUENCES)
        ensure -- from EV_NOTEBOOK_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    tab_position_within_range: is_usable implies tab_position = tab_left or tab_position = tab_right or tab_position = tab_bottom or tab_position = tab_top
    selected_item_not_void: not is_empty implies selected_item /= void
    selected_item_index_within_range: not is_empty implies (selected_item_index >= index_of (first, 1) and selected_item_index <= index_of (last, 1))
    selected_item_is_i_th_of_selected_item_index: not is_empty implies selected_item = i_th (selected_item_index)
    selected_item_index_is_index_of_selected_item: not is_empty implies selected_item_index = index_of (selected_item, 1)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_NOTEBOOK


EV_SCROLLABLE_AREA Chart

class
    EV_SCROLLABLE_AREA

General
    cluster: vision2.interface.widgets.containers
    description: "Displays a single widget that may be larger that the container.Scroll bars allow the user to select the area displayed."
    keywords: "container, scroll, scrollbar, viewport"
    create: default_create

Ancestors
    EV_VIEWPORT

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    horizontal_step: INTEGER
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_horizontal_scroll_bar_visible: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    is_vertical_scroll_bar_visible: BOOLEAN
    item: EV_WIDGET
    item_height: INTEGER
    item_width: INTEGER
    linear_representation: LINEAR [[like item] EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    vertical_step: INTEGER
    width: INTEGER
    writable: BOOLEAN
    x_offset: INTEGER
    x_position: INTEGER
    y_offset: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_SCROLLABLE_AREA)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    hide_horizontal_scroll_bar
    hide_vertical_scroll_bar
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    remove_help_context
    remove_pebble
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_horizontal_step (a_step: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_offset (an_x, a_y: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_vertical_step (a_step: INTEGER)
    set_x_offset (an_x: INTEGER)
    set_y_offset (a_y: INTEGER)
    show
    show_horizontal_scroll_bar
    show_vertical_scroll_bar
    wipe_out

Constraints
    horizontal step positive
    vertical step positive


EV_SCROLLABLE_AREA Flat contracts

indexing
    description: "Displays a single widget that may be larger that the container.Scroll bars allow the user to select the area displayed."
    appearance: "---------------|           |^||   `item'  | ||___________|v||<_________>|_|"
    status: "See notice at end of class"
    keywords: "container, scroll, scrollbar, viewport"
    date: "$Date: 2001/07/14 11:02:41 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_SCROLLABLE_AREA

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: EV_WIDGET): BOOLEAN
            -- Does Current include v?
            -- (from EV_CELL)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    horizontal_step: INTEGER
            -- Number of pixels scrolled up or down when user clicks
            -- an arrow on horizontal scroll bar.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.horizontal_step

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_horizontal_scroll_bar_visible: BOOLEAN
            -- Should horizontal scroll bar be displayed?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_horizontal_scroll_bar_visible

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    is_vertical_scroll_bar_visible: BOOLEAN
            -- Should vertical scroll bar be displayed?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_vertical_scroll_bar_visible

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    vertical_step: INTEGER
            -- Number of pixels scrolled left or right when user clicks
            -- an arrow on vertical scroll bar.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.vertical_step

    x_offset: INTEGER
            -- Horizontal position of viewport relative to item.
            -- (from EV_VIEWPORT)
        require -- from EV_VIEWPORT
            not_destroyed: not is_destroyed
        ensure -- from EV_VIEWPORT
            bridge_ok: Result = implementation.x_offset

    y_offset: INTEGER
            -- Vertical position of viewport relative to item.
            -- (from EV_VIEWPORT)
        require -- from EV_VIEWPORT
            not_destroyed: not is_destroyed
        ensure -- from EV_VIEWPORT
            bridge_ok: Result = implementation.y_offset

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    hide_horizontal_scroll_bar
            -- Do not display horizontal scroll bar.
        require
            not_destroyed: not is_destroyed
        ensure
            hidden: not is_horizontal_scroll_bar_visible

    hide_vertical_scroll_bar
            -- Do not display vertical scroll bar.
        require
            not_destroyed: not is_destroyed
        ensure
            hidden: not is_vertical_scroll_bar_visible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_horizontal_step (a_step: INTEGER)
            -- Assign a_step to horizontal_step.
        require
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure
            assigned: horizontal_step = a_step

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_offset (an_x, a_y: INTEGER)
            -- Assign an_x to x_offset.
            -- Assign a_y to y_offset.
            -- (from EV_VIEWPORT)
        require -- from EV_VIEWPORT
            not_destroyed: not is_destroyed
        ensure -- from EV_VIEWPORT
            assigned: x_offset = an_x
            assigned: y_offset = a_y

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_vertical_step (a_step: INTEGER)
            -- Assign a_step to vertical_step.
        require
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure
            assigned: vertical_step = a_step

    set_x_offset (an_x: INTEGER)
            -- Assign an_x to x_offset.
            -- (from EV_VIEWPORT)
        require -- from EV_VIEWPORT
            not_destroyed: not is_destroyed
        ensure -- from EV_VIEWPORT
            assigned: x_offset = an_x

    set_y_offset (a_y: INTEGER)
            -- Assign a_y to y_offset.
            -- (from EV_VIEWPORT)
        require -- from EV_VIEWPORT
            not_destroyed: not is_destroyed
        ensure -- from EV_VIEWPORT
            assigned: y_offset = a_y

    show_horizontal_scroll_bar
            -- Display horizontal scroll bar.
        require
            not_destroyed: not is_destroyed
        ensure
            shown: is_horizontal_scroll_bar_visible

    show_vertical_scroll_bar
            -- Display vertical scroll bar.
        require
            not_destroyed: not is_destroyed
        ensure
            shown: is_vertical_scroll_bar_visible

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    item_height: INTEGER
            -- Height of item. Zero if item Void.
            -- (from EV_VIEWPORT)

    item_width: INTEGER
            -- Width of item. Zero if item Void.
            -- (from EV_VIEWPORT)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    horizontal_step_positive: is_usable implies horizontal_step > 0
    vertical_step_positive: is_usable implies vertical_step > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_VIEWPORT
    item_void_means_offset_zero: is_usable implies (item = void implies x_offset = 0 and y_offset = 0)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_SCROLLABLE_AREA


EV_SPLIT_AREA Chart

deferred class
    EV_SPLIT_AREA

General
    cluster: vision2.interface.widgets.containers
    description: "Contains two widgets, each on either side of an adjustable separator."
    keywords: "container, split, devide"

Ancestors
    EV_CONTAINER

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    first: EV_WIDGET
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    maximum_split_position: INTEGER
    minimum_height: INTEGER
    minimum_split_position: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    Prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    second: EV_WIDGET
    split_position: INTEGER
    target_name: STRING
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_SPLIT_AREA)
    default_create
    destroy
    disable_capture
    disable_item_expand (an_item: EV_WIDGET)
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_item_expand (an_item: EV_WIDGET)
    enable_pebble_positioning
    enable_sensitive
    extend (an_item: EV_WIDGET)
    go_to_first
    go_to_second
    hide
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (an_item: EV_WIDGET)
    remove_help_context
    remove_pebble
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_first (an_item: EV_WIDGET)
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_second (an_item: EV_WIDGET)
    set_split_position (a_split_position: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    wipe_out

Constraints
    maximum greater or equal minimum
    splitter in valid position  minimum
    splitter in valid position  maximum


EV_SPLIT_AREA Flat contracts

indexing
    description: "Contains two widgets, each on either side of an adjustable separator."
    status: "See notice at end of class"
    keywords: "container, split, devide"
    date: "$Date: 2001/07/14 11:02:41 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_SPLIT_AREA

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: EV_WIDGET
            -- First item.
        require
            not_destroyed: not is_destroyed

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    second: EV_WIDGET
            -- Second item.
        require
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items.
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then
            count_not_negative: count >= 0
            count_valid: count <= 2

    extendible: BOOLEAN
            -- Is structure not full yet?

    full: BOOLEAN
            -- Is structure filled to capacity?

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
            -- Is an_item expanded relative to Current?
        require
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
        ensure
            bridge_ok: Result = implementation.is_item_expanded (an_item)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    maximum_split_position: INTEGER
            -- Maximum position splitter can have.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.maximum_split_position
            non_negative: Result >= 0

    minimum_split_position: INTEGER
            -- Minimum position splitter can have.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.minimum_split_position
            non_negative: Result >= 0

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    Prunable: BOOLEAN is True
            -- Items may be removed.

    readable: BOOLEAN
            -- Is there a current item that may be read?
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    split_position: INTEGER
            -- Offset of splitter from left or top.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.split_position

    writable: BOOLEAN
            -- Is there a current item that may be modified?
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_item_expand (an_item: EV_WIDGET)
            -- When Current is resized, do not resize an_item.
        require
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
            split_area_full: full
            other_item_is_expandable: (an_item = first and is_item_expanded (second)) or (an_item = second and is_item_expanded (first))
        ensure
            not_an_item_expanded: not is_item_expanded (an_item)

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_item_expand (an_item: EV_WIDGET)
            -- When Current is resized, resize an_item respectively.
        require
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
        ensure
            an_item_expanded: is_item_expanded (an_item)

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    go_to_first
            -- Make first current item.
        require
            not_destroyed: not is_destroyed
            first_exists: first /= void
        ensure
            item_is_first: item = first

    go_to_second
            -- Make first current item.
        require
            not_destroyed: not is_destroyed
            second_exists: second /= void
        ensure
            item_is_second: item = second

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Position split_position between minimum and maximum determined
            -- by a_proportion.
        require
            not_destroyed: not is_destroyed
            split_area_full: full
            a_proportion_in_valid_range: (a_proportion >= 0 and a_proportion <= 1)

    set_split_position (a_split_position: INTEGER)
            -- Make a_split_position position of splitter in pixels.
        require
            not_destroyed: not is_destroyed
            split_area_full: full
            a_split_position_within_bounds: is_displayed implies ((a_split_position >= minimum_split_position and a_split_position <= maximum_split_position))
        ensure
            split_position_assigned: split_position = a_split_position

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (an_item: EV_WIDGET)
            -- Assign an_item to first_item if not already assigned or to
            -- second_item otherwise.
            -- Was declared in EV_SPLIT_AREA as synonym of put.
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure then
            first_item_used_first: old first = void implies first = an_item
            second_item_used_second: old first /= void implies second = an_item
            has_an_item: has (an_item)

    put (an_item: EV_WIDGET)
            -- Assign an_item to first_item if not already assigned or to
            -- second_item otherwise.
            -- Was declared in EV_SPLIT_AREA as synonym of extend.
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure then
            first_item_used_first: old first = void implies first = an_item
            second_item_used_second: old first /= void implies second = an_item
            has_an_item: has (an_item)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_first (an_item: EV_WIDGET)
            -- Assign an_item to first.
        require
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            an_item_not_in_split_area: not has (an_item)
            an_item_parent_is_void: an_item.parent = void
            first_is_void: first = void
        ensure
            an_item_assigned: first = an_item
            an_item_not_expanded: not is_item_expanded (an_item)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_second (an_item: EV_WIDGET)
            -- Assign an_item to second.
        require
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            an_item_not_in_split_area: not has (an_item)
            an_item_parent_is_void: an_item.parent = void
            second_is_void: second = void
        ensure
            an_item_assigned: second = an_item
            an_item_expanded: is_item_expanded (an_item)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove one occurrence of v if any.
        require -- from COLLECTION
            prunable: prunable
        ensure then
            count_is_one_implies_child_expandable: (count = 1 implies (first /= void and is_item_expanded (first) or second /= void and is_item_expanded (second)))

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    maximum_greater_or_equal_minimum: is_usable implies minimum_split_position <= maximum_split_position
    splitter_in_valid_position__minimum: full implies split_position >= minimum_split_position
    splitter_in_valid_position__maximum: full implies split_position <= maximum_split_position
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_SPLIT_AREA


EV_STATUS_BAR Chart

class
    EV_STATUS_BAR

General
    cluster: vision2.interface.widgets.containers
    description: "Horizontal bar for display of status messages."
    create: default_create

Ancestors
    EV_FRAME_CONSTANTS
    EV_HORIZONTAL_BOX

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    border_width: INTEGER
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_WIDGET
    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_WIDGET
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_WIDGET; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_STATUS_BAR): BOOLEAN
    is_homogeneous: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_WIDGET
    last: [like item] EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_WIDGET): INTEGER
    off: BOOLEAN
    padding: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    sequential_occurrences (v: EV_WIDGET): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_frame_border (a_code: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_WIDGET])
    back
    center_pointer
    copy (other: [like Current] EV_STATUS_BAR)
    default_create
    destroy
    disable_capture
    disable_homogeneous
    disable_item_expand (an_item: EV_WIDGET)
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
    enable_capture
    enable_homogeneous
    enable_item_expand (an_item: EV_WIDGET)
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    finish
    force (v: [like item] EV_WIDGET)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_STATUS_BAR)
    merge_radio_button_groups (other: EV_CONTAINER)
    merge_right (other: [like Current] EV_STATUS_BAR)
    move (i: INTEGER)
    propagate_background_color
    propagate_foreground_color
    prune (v: [like item] EV_WIDGET)
    prune_all (v: [like item] EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    put_front (v: [like item] EV_WIDGET)
    put_i_th (v: [like item] EV_WIDGET; i: INTEGER)
    put_left (v: [like item] EV_WIDGET)
    put_right (v: [like item] EV_WIDGET)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    replace (v: [like item] EV_WIDGET)
    search (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_border_width (value: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_padding (value: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_STATUS_BAR Flat contracts

indexing
    description: "Horizontal bar for display of status messages."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:14:57 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_STATUS_BAR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_WIDGET
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_WIDGET): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        require -- from  FINITE
            True
        require -- from  SET
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    border_width: INTEGER
            -- Width of border around container in pixels.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.border_width
            positive: Result >= 0

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_homogeneous: BOOLEAN
            -- Are all items forced to have same dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.is_homogeneous

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
            -- Is an_item expanded to occupy available spare space?
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.is_item_expanded (an_item)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    padding: INTEGER
            -- Space between children in pixels.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.padding
            positive: Result >= 0

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_homogeneous
            -- Allow items to have different dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            not_is_homogeneous: not is_homogeneous

    disable_item_expand (an_item: EV_WIDGET)
            -- Do not expand an_item to occupy available spare space.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            not_an_item_expanded: not is_item_expanded (an_item)

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_homogeneous
            -- Force all items to have same dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            is_homogeneous: is_homogeneous

    enable_item_expand (an_item: EV_WIDGET)
            -- Expand an_item to occupy available spare space.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            an_item_expanded: is_item_expanded (an_item)

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_border_width (value: INTEGER)
            -- Assign value to border_width.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure -- from EV_BOX
            border_width_assigned: border_width = value

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_padding (value: INTEGER)
            -- Assign value to padding.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure -- from EV_BOX
            padding_assigned: padding = value

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_WIDGET])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature  -- Contract support

    valid_frame_border (a_code: INTEGER): BOOLEAN
            -- Is a_code a valid code ?
            -- (from EV_FRAME_CONSTANTS)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_STATUS_BAR


EV_TABLE Chart

class
    EV_TABLE

General
    cluster: vision2.interface.widgets.containers
    description:
        "EiffelVision table. Invisible container that allows
         unlimited number of other widgets to be packed inside it.
         A table controls the children's location and size
         automatically."
    create: default_create

Ancestors
    ARRAY [G]
    EV_CONTAINER

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    additional_space: INTEGER
    all_default: BOOLEAN
    area: SPECIAL [EV_WIDGET]
    area_clear (a_column, a_row, column_span, row_span: INTEGER): BOOLEAN
    background_color: EV_COLOR
    border_width: INTEGER
    capacity: INTEGER
    client_height: INTEGER
    client_width: INTEGER
    column_clear (a_column: INTEGER): BOOLEAN
    column_spacing: INTEGER
    columns: INTEGER
    columns_resizable_to (a_column: INTEGER): BOOLEAN
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    entry (i: INTEGER): EV_WIDGET
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item (a_column, a_row: INTEGER): EV_WIDGET
    item_list: ARRAYED_LIST [EV_WIDGET]
    linear_representation: LINEAR [EV_WIDGET]
    lower: INTEGER
    Minimal_increase: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: EV_WIDGET): INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    Readable: BOOLEAN
    resizable: BOOLEAN
    row_clear (a_row: INTEGER): BOOLEAN
    row_spacing: INTEGER
    rows: INTEGER
    rows_resizable_to (a_row: INTEGER): BOOLEAN
    same_items (other: [like Current] EV_TABLE): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    subarray (start_pos, end_pos: INTEGER): [like Current] EV_TABLE
    target_name: STRING
    to_c: ANY
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    widget_count: INTEGER
    width: INTEGER
    Writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    add (v: EV_WIDGET; a_column, a_row, column_span, row_span: INTEGER)
    automatic_grow
    center_pointer
    clear_all
    copy (other: [like Current] EV_TABLE)
    default_create
    destroy
    disable_capture
    disable_homogeneous
    disable_pebble_positioning
    disable_sensitive
    discard_items
    enable_capture
    enable_homogeneous
    enable_pebble_positioning
    enable_sensitive
    enter (v: [like item] EV_WIDGET; i: INTEGER)
    fill (other: CONTAINER [EV_WIDGET])
    grow (i: INTEGER)
    hide
    make_from_array (a: ARRAY [EV_WIDGET])
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: EV_WIDGET; a_column, a_row, column_span, row_span: INTEGER)
    remove (v: EV_WIDGET)
    remove_help_context
    remove_pebble
    resize (a_column, a_row: INTEGER)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_border_width (a_value: INTEGER)
    set_column_spacing (a_value: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_row_spacing (a_value: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    subcopy (other: [like Current] EV_TABLE; start_pos, end_pos, index_pos: INTEGER)


EV_TABLE Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description:
"EiffelVision table. Invisible container that allows %
% unlimited number of other widgets to be packed inside it.%
% A table controls the children's location and size%
% automatically."
status: "See notice at end of class"
date: "$Date: 2001/11/13 00:01:52 $"
revision: "$Revision: 1.6 $"

class interface
EV_TABLE

create

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

make_for_test
-- Create with action for testing purposes.

feature -- Initialization

make_from_array (a: ARRAY [ EV_WIDGET ])
-- Initialize from the items of a.
-- (Useful in proper descendants of class ARRAY ,
-- to initialize an array-like object from a manifest array.)
-- (from ARRAY )
require -- from ARRAY
array_exists: a /= void

feature -- Initialization
--
--
--

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

columns : INTEGER
-- Number of columns in Current.

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

entry (i: INTEGER ): EV_WIDGET
-- Entry at index i, if in index interval
-- (from ARRAY )
require -- from ARRAY
valid_key: valid_index (i)

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does v appear in array?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from ARRAY )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like container_item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursively included by structure,
-- include an_item.
-- (from EV_CONTAINER )

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursively, parent of parent .
-- (from EV_WIDGET )

item (a_column, a_row: INTEGER ): EV_WIDGET
-- Widget at coordinates (row, column)
require
valid_row: (1 <= a_row) and (a_row <= rows )
valid_column: (1 <= a_column) and (a_column <= columns )

item_list : ARRAYED_LIST [ EV_WIDGET ]
-- List of items in Current.

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATES
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )

rows : INTEGER
-- Number of rows in Current.

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

frozen infix " @ " (i: INTEGER ): EV_WIDGET
-- Entry at index i, if in index interval
-- Was declared in ARRAY as synonym of item .
-- (from ARRAY )
require -- from TABLE
valid_key: valid_index (k)

feature -- Access

area : SPECIAL [ EV_WIDGET ]
-- Special data zone
-- (from TO_SPECIAL )

feature -- Measurement

additional_space : INTEGER
-- Proposed number of additional items
-- (from RESIZABLE )
ensure -- from RESIZABLE
at_least_one: Result >= 1

capacity : INTEGER
-- Number of available indices
-- Was declared in ARRAY as synonym of count .
-- (from ARRAY )
ensure then -- from ARRAY
consistent_with_bounds: Result = upper - lower + 1

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

count : INTEGER
-- Number of available indices
-- Was declared in ARRAY as synonym of capacity .
-- (from ARRAY )
ensure then -- from ARRAY
consistent_with_bounds: Result = upper - lower + 1

Growth_percentage : INTEGER is 50
-- Percentage by which structure will grow automatically
-- (from RESIZABLE )

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from ARRAY )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from ARRAY
same_count: Result. count = count
same_bounds: ((Result. lower = lower ) and (Result. upper = upper ))

lower : INTEGER
-- Minimum index
-- (from ARRAY )

Minimal_increase : INTEGER is 5
-- Minimal number of additional items
-- (from RESIZABLE )

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

occurrences (v: EV_WIDGET ): INTEGER
-- Number of times v appears in structure
-- (from ARRAY )
ensure -- from BAG
non_negative_occurrences: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

upper : INTEGER
-- Maximum index
-- (from ARRAY )

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

all_default : BOOLEAN
-- Are all items set to default values?
-- (from ARRAY )
ensure -- from ARRAY
definition: Result = ( count = 0 or else (( array_item ( upper ) = void or else array_item ( upper ) = array_item ( upper ). default ) and subarray ( lower , upper - 1). all_default ))

area_clear (a_column, a_row, column_span, row_span: INTEGER ): BOOLEAN
-- Are the cells represented by parameters free of widgets?
require
table_wide_enough: a_column + (column_span - 1) <= columns
table_tall_enough: a_row + (row_span - 1) <= rows

border_width : INTEGER
-- Spacing between edge of Current and outside edge items,
-- in pixels.

column_clear (a_column: INTEGER ): BOOLEAN
-- Is column a_column free of widgets?
require
a_column_positive: a_column >= 1
a_column_in_table: a_column <= columns

column_spacing : INTEGER
-- Spacing between two consecutive columns, in pixels.

columns_resizable_to (a_column: INTEGER ): BOOLEAN
-- May the column count be resized to a_column?
require
a_column_positive: a_column >= 1

extendible : BOOLEAN
-- May items be added?
-- (Answer: no, although array may be resized.)
-- (from ARRAY )

full : BOOLEAN
-- Is structure filled to capacity? (Answer: yes)
-- (from ARRAY )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

frozen id_freed : BOOLEAN
-- Has Current been removed from the table?
-- (from IDENTIFIED )

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

prunable : BOOLEAN
-- May items be removed? (Answer: no.)
-- (from ARRAY )

Readable : BOOLEAN is True
-- Current is always readable.

resizable : BOOLEAN
-- May capacity be changed? (Answer: yes.)
-- (from RESIZABLE )

row_clear (a_row: INTEGER ): BOOLEAN
-- Is row a_row free of widgets?
require
a_row_positive: a_row >= 1
a_row_in_table: a_row <= rows

row_spacing : INTEGER
-- Spacing between two consecutive rows, in pixels.

rows_resizable_to (a_row: INTEGER ): BOOLEAN
-- May the row count be resized to a_row?
require
a_row_positive: a_row >= 1

same_items (other: like Current): BOOLEAN
-- Do other and Current have same items?
-- (from ARRAY )
require -- from ARRAY
other_not_void: other /= void
ensure -- from ARRAY
definition: Result = (( count = other. count ) and then ( count = 0 or else ( array_item ( upper ) = other. array_item (other. upper ) and subarray ( lower , upper - 1). same_items (other. subarray (other. lower , other. upper - 1)))))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within the bounds of the array?
-- (from ARRAY )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))

valid_index_set : BOOLEAN
-- (from ARRAY )

widget_count : INTEGER
-- Number of widgets in Current.

Writable : BOOLEAN is True
-- Current is always writeable.

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop,
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop,
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

add (v: like item ; a_column, a_row, column_span, row_span: INTEGER )
-- Set the position of the widgets in one-based coordinates.
--
-- 1 2
-- +----------+---------+
-- 1 |xxxxxxxxxxxxxxxxxxxx|
-- +----------+---------+
-- 2 | | |
-- +----------+---------+
--
-- To describe the widget in the table as shown above,
-- the corresponding coordinates would be (1, 1, 2, 1)
-- Was declared in EV_TABLE as synonym of put .
require
v_not_void: v /= void
v_not_current: v /= Current
v_not_contained: not has (v)
v_parent_void: v. parent = void
v_not_parent_of_current: not is_parent_recursive (v)
a_column_positive: a_column >= 1
a_row_positive: a_row >= 1
column_span_positive: column_span >= 1
row_span_positive: row_span >= 1
table_wide_enough: a_column + (column_span - 1) <= columns
table_tall_enough: a_row + (row_span - 1) <= rows
table_area_clear: area_clear (a_column, a_row, column_span, row_span)
ensure
item_inserted: has (v)

enter (v: like array_item ; i: INTEGER )
-- Replace i-th entry, if in index interval, by v.
-- (from ARRAY )
require -- from ARRAY
valid_key: valid_index (i)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item ; a_column, a_row, column_span, row_span: INTEGER )
-- Set the position of the widgets in one-based coordinates.
--
-- 1 2
-- +----------+---------+
-- 1 |xxxxxxxxxxxxxxxxxxxx|
-- +----------+---------+
-- 2 | | |
-- +----------+---------+
--
-- To describe the widget in the table as shown above,
-- the corresponding coordinates would be (1, 1, 2, 1)
-- Was declared in EV_TABLE as synonym of add .
require
v_not_void: v /= void
v_not_current: v /= Current
v_not_contained: not has (v)
v_parent_void: v. parent = void
v_not_parent_of_current: not is_parent_recursive (v)
a_column_positive: a_column >= 1
a_row_positive: a_row >= 1
column_span_positive: column_span >= 1
row_span_positive: row_span >= 1
table_wide_enough: a_column + (column_span - 1) <= columns
table_tall_enough: a_row + (row_span - 1) <= rows
table_area_clear: area_clear (a_column, a_row, column_span, row_span)
ensure
item_inserted: has (v)

remove (v: EV_WIDGET )
-- Remove v from Current if present.
require
item_not_void: v /= void
item_in_table: has (v)
ensure
item_removed: not has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER )
-- Copy items of other within bounds start_pos and end_pos
-- to current array starting at index index_pos.
-- (from ARRAY )
require -- from ARRAY
other_not_void: other /= void
valid_start_pos: other. valid_index (start_pos)
valid_end_pos: other. valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: ( upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

clear_all
-- Reset all items to default values.
-- (from ARRAY )
ensure -- from ARRAY
stable_lower: lower = old lower
stable_upper: upper = old upper
default_items: all_default

discard_items
-- Reset all items to default values with reallocation.
-- (from ARRAY )
ensure -- from ARRAY
default_items: all_default

frozen free_id
-- Free the entry associated with object_id if any
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
object_freed: id_freed

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

feature -- Resizing

automatic_grow
-- Change the capacity to accommodate at least
-- Growth_percentage more items.
-- (from RESIZABLE )
ensure -- from RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

grow (i: INTEGER )
-- Change the capacity to at least i.
-- (from ARRAY )
ensure -- from RESIZABLE
new_capacity: capacity >= i

feature -- Conversion

linear_representation : LINEAR [ EV_WIDGET ]
-- Representation as a linear structure

feature -- Conversion

to_c : ANY
-- Address of actual sequence of values,
-- for passing to external (non-Eiffel) routines.
-- (from ARRAY )

feature -- Duplication

frozen ev_clone : like Current
-- New object that is_equal to Current.
-- To change copying/cloning semantics, redefine copy .
-- (from EV_ANY )
ensure -- from EV_ANY
equal: equal (Result, Current)

subarray (start_pos, end_pos: INTEGER ): like Current
-- Array made of items of current array within
-- bounds start_pos and end_pos.
-- (from ARRAY )
require -- from ARRAY
valid_start_pos: valid_index (start_pos)
valid_end_pos: valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
ensure -- from ARRAY
lower: Result. lower = start_pos
upper: Result. upper = end_pos

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Inapplicable

prune (v: EV_WIDGET )
-- Remove first occurrence of v if any.
-- (Precondition is False.)
-- (from ARRAY )
require -- from COLLECTION
prunable: prunable

feature -- Implementation

Changeable_comparison_criterion : BOOLEAN is False
-- May object_comparison be changed?
-- (Answer: no by default.)
-- (from EV_CONTAINER )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

all_radio_buttons_connected : BOOLEAN
-- Are all radio buttons in this container connected?
-- (from EV_CONTAINER )

background_color_propagated : BOOLEAN
-- Do all children have same background color as Current?
-- (from EV_CONTAINER )

foreground_color_propagated : BOOLEAN
-- Do all children have same foreground color as Current?
-- (from EV_CONTAINER )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

new_item_actions : EV_NEW_ITEM_ACTION_SEQUENCE
-- Actions to be performed when a new item is added.
-- (from EV_CONTAINER_ACTION_SEQUENCES )
ensure -- from EV_CONTAINER_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

proximity_in_actions : EV_PROXIMITY_ACTION_SEQUENCE
-- Actions to be performed when pointing device comes into range.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

proximity_out_actions : EV_PROXIMITY_ACTION_SEQUENCE
-- Actions to be performed when pointing device goes out of range.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

default_create_called : BOOLEAN
-- Has default_create been called?
-- (from EV_ANY )

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

feature -- Status settings

disable_homogeneous
-- Allow items to have varying sizes.

enable_homogeneous
-- Set each item in Currnet to be equal in size
-- to that of the largest item.

resize (a_column, a_row: INTEGER )
-- Resize the table to hold a_column by a_row widgets.
require
a_column_positive: a_column >= 1
a_row_positive: a_row >= 1
columns_resizeable: columns_resizable_to (a_column)
rows_resizeable: rows_resizable_to (a_row)
ensure
columns_set: columns = a_column
rows_set: rows = a_row
upper_updated: upper = rows * columns
items_untouched: item_list . is_equal (old item_list )

set_border_width (a_value: INTEGER )
-- Assign a_value to border_width .
require
positive_value: a_value >= 0

set_column_spacing (a_value: INTEGER )
-- Assign a_value to the spacing in-between columns, in pixels.
require
positive_value: a_value >= 0

set_row_spacing (a_value: INTEGER )
-- Assign a_value to the spacing in-between rows, in pixels.
require
positive_value: a_value >= 0

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_CONTAINER
client_width_within_bounds: is_useable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_useable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_useable implies all_radio_buttons_connected
parent_of_items_is_current: is_useable implies parent_of_items_is_current
items_unique: is_useable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_useable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_useable and is_displayed implies is_show_requested
parent_contains_current: is_useable and parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_useable implies background_color /= void
foreground_color_not_void: is_useable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_useable implies width >= 0
height_not_negative: is_useable implies height >= 0
minimum_width_not_negative: is_useable implies minimum_width >= 0
minimum_height_not_negative: is_useable implies minimum_height >= 0
-- from ARRAY
consistent_size: capacity = upper - lower + 1
non_negative_count: count >= 0
index_set_has_same_count: valid_index_set
-- from RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
-- from BOUNDED
valid_count: count <= capacity
full_definition: full = ( count = capacity )
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from INDEXABLE
index_set_not_void: index_set /= void

end -- class EV_TABLE

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


EV_TITLED_WINDOW Chart

class
    EV_TITLED_WINDOW

General
    cluster: vision2.interface.widgets.containers
    description: "Top level titled window. Contains a single widget."
    keywords: "window, title bar, title"
    create: make_with_title, default_create

Ancestors
    EV_WINDOW

Action sequences
    close_request_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_TITLED_WINDOW)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    unlock_update
    wipe_out

Constraints
    accelerators not void


EV_TITLED_WINDOW Flat contracts

indexing
    description: "Top level titled window. Contains a single widget."
    appearance: " __________________ |`title'       _[]X||------------------||                  ||      `item'      ||__________________|"
    status: "See notice at end of class"
    keywords: "window, title bar, title"
    date: "$Date: 2001/07/14 11:02:42 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_TITLED_WINDOW

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_title (a_title: STRING)
            -- Initialize with a_title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            a_title_not_void: a_title /= void

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
        require
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_minimized

    is_modal: BOOLEAN
            -- Must the window be closed before application can
            -- receive user events again?
            --
            -- May be redefined in EV_DIALOG to return
            -- a different value
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
        require
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
        require
            not_destroyed: not is_destroyed
        ensure
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
        require
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
        require
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
        require
            not_destroyed: not is_destroyed
        ensure
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
        require
            not_destroyed: not is_destroyed
        ensure
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
        require
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
        require
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    close_request_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed whan a request to close window
            -- has been received.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    accelerators_not_void: is_usable implies accelerators /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_TITLED_WINDOW


EV_TREE_NODE_CONTAINER Chart

deferred class
    EV_TREE_NODE_CONTAINER

General
    cluster: vision2.interface.widgets.containers
    description: "Abstract class for container that hold tree nodes"
    keywords: "container"

Ancestors
    EV_ANY
    LINEAR [G]

Queries
    after: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    data: ANY
    exhausted: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    has (v: [like item] EV_TREE_NODE): BOOLEAN
    index: INTEGER
    index_of (v: [like item] EV_TREE_NODE; i: INTEGER): INTEGER
    is_destroyed: BOOLEAN
    is_empty: BOOLEAN
    item: EV_TREE_NODE
    linear_representation: LINEAR [EV_TREE_NODE]
    object_comparison: BOOLEAN
    occurrences (v: EV_TREE_NODE): INTEGER
    off: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN

Commands
    compare_objects
    compare_references
    copy (other: [like Current] EV_TREE_NODE_CONTAINER)
    default_create
    destroy
    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
    finish
    forth
    search (v: [like item] EV_TREE_NODE)
    set_data (some_data: [like data] ANY)
    start


EV_TREE_NODE_CONTAINER Flat contracts

indexing
    description: "Abstract class for container that hold tree nodes"
    status: "See notice at end of class"
    keywords: "container"
    date: "$Date: 2001/07/14 01:02:24 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_TREE_NODE_CONTAINER

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index: INTEGER
            -- Index of current position
            -- (from LINEAR)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: EV_TREE_NODE
            -- Item at current position
            -- (from TRAVERSABLE)
        require -- from TRAVERSABLE
            not_off: not off

    occurrences (v: EV_TREE_NODE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- If no such position ensure that exhausted will be true.
            -- (from LINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

feature -- Status report

    after: BOOLEAN
            -- Is there no valid position to the right of current one?
            -- (from LINEAR)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    is_empty: BOOLEAN
            -- Is there no element?
            -- (from CONTAINER)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINEAR)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    finish
            -- Move to last position.
            -- (from LINEAR)

    forth
            -- Move to next position; if no next position,
            -- ensure that exhausted will be true.
            -- (from LINEAR)
        require -- from LINEAR
            not_after: not after

    start
            -- Move to first position if any.
            -- (from TRAVERSABLE)

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Conversion

    linear_representation: LINEAR [EV_TREE_NODE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

end -- class EV_TREE_NODE_CONTAINER


EV_VERTICAL_BOX Chart

class
    EV_VERTICAL_BOX

General
    cluster: vision2.interface.widgets.containers
    description: "Horizontal linear widget container"
    keywords: "container, box, vertical"
    create: default_create

Ancestors
    EV_BOX

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    border_width: INTEGER
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_WIDGET
    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_WIDGET
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_WIDGET; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_VERTICAL_BOX): BOOLEAN
    is_homogeneous: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_WIDGET
    last: [like item] EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_WIDGET): INTEGER
    off: BOOLEAN
    padding: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    sequential_occurrences (v: EV_WIDGET): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_WIDGET])
    back
    center_pointer
    copy (other: [like Current] EV_VERTICAL_BOX)
    default_create
    destroy
    disable_capture
    disable_homogeneous
    disable_item_expand (an_item: EV_WIDGET)
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
    enable_capture
    enable_homogeneous
    enable_item_expand (an_item: EV_WIDGET)
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    finish
    force (v: [like item] EV_WIDGET)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_VERTICAL_BOX)
    merge_radio_button_groups (other: EV_CONTAINER)
    merge_right (other: [like Current] EV_VERTICAL_BOX)
    move (i: INTEGER)
    propagate_background_color
    propagate_foreground_color
    prune (v: [like item] EV_WIDGET)
    prune_all (v: [like item] EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    put_front (v: [like item] EV_WIDGET)
    put_i_th (v: [like item] EV_WIDGET; i: INTEGER)
    put_left (v: [like item] EV_WIDGET)
    put_right (v: [like item] EV_WIDGET)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    replace (v: [like item] EV_WIDGET)
    search (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_border_width (value: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_padding (value: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_VERTICAL_BOX Flat contracts

indexing
    description: "Horizontal linear widget container"
    appearance: "---------------|             ||   'first'   ||             ||-------------||             ||     ...     ||             ||-------------||             ||   `last'    ||             |---------------"
    status: "See notice at end of class"
    keywords: "container, box, vertical"
    date: "$Date: 2001/07/14 11:14:58 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_VERTICAL_BOX

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_WIDGET
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_WIDGET): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        require -- from  FINITE
            True
        require -- from  SET
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    border_width: INTEGER
            -- Width of border around container in pixels.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.border_width
            positive: Result >= 0

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_homogeneous: BOOLEAN
            -- Are all items forced to have same dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.is_homogeneous

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
            -- Is an_item expanded to occupy available spare space?
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.is_item_expanded (an_item)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    padding: INTEGER
            -- Space between children in pixels.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            bridge_ok: Result = implementation.padding
            positive: Result >= 0

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_homogeneous
            -- Allow items to have different dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            not_is_homogeneous: not is_homogeneous

    disable_item_expand (an_item: EV_WIDGET)
            -- Do not expand an_item to occupy available spare space.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            not_an_item_expanded: not is_item_expanded (an_item)

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_homogeneous
            -- Force all items to have same dimensions.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
        ensure -- from EV_BOX
            is_homogeneous: is_homogeneous

    enable_item_expand (an_item: EV_WIDGET)
            -- Expand an_item to occupy available spare space.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            has_an_item: has (an_item)
        ensure -- from EV_BOX
            an_item_expanded: is_item_expanded (an_item)

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_border_width (value: INTEGER)
            -- Assign value to border_width.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure -- from EV_BOX
            border_width_assigned: border_width = value

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_padding (value: INTEGER)
            -- Assign value to padding.
            -- (from EV_BOX)
        require -- from EV_BOX
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure -- from EV_BOX
            padding_assigned: padding = value

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_WIDGET])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_VERTICAL_BOX


EV_VERTICAL_SPLIT_AREA Chart

class
    EV_VERTICAL_SPLIT_AREA

General
    cluster: vision2.interface.widgets.containers
    description: "Displays two widgets one above the other separated by an adjustabledivider"
    create: default_create

Ancestors
    EV_SPLIT_AREA

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    first: EV_WIDGET
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    maximum_split_position: INTEGER
    minimum_height: INTEGER
    minimum_split_position: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    Prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    second: EV_WIDGET
    split_position: INTEGER
    target_name: STRING
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_VERTICAL_SPLIT_AREA)
    default_create
    destroy
    disable_capture
    disable_item_expand (an_item: EV_WIDGET)
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_item_expand (an_item: EV_WIDGET)
    enable_pebble_positioning
    enable_sensitive
    extend (an_item: EV_WIDGET)
    go_to_first
    go_to_second
    hide
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (an_item: EV_WIDGET)
    remove_help_context
    remove_pebble
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_first (an_item: EV_WIDGET)
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_second (an_item: EV_WIDGET)
    set_split_position (a_split_position: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    wipe_out


EV_VERTICAL_SPLIT_AREA Flat contracts

indexing
    description: "Displays two widgets one above the other separated by an adjustabledivider"
    appearance: "---------------|             ||   'first'   ||             ||_____________||-------------||             ||   `second'  ||             |---------------"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:42 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_VERTICAL_SPLIT_AREA

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: EV_WIDGET
            -- First item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    second: EV_WIDGET
            -- Second item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items.
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_SPLIT_AREA
            count_not_negative: count >= 0
            count_valid: count <= 2

    extendible: BOOLEAN
            -- Is structure not full yet?
            -- (from EV_SPLIT_AREA)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_SPLIT_AREA)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_SPLIT_AREA)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from EV_SPLIT_AREA)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_item_expanded (an_item: EV_WIDGET): BOOLEAN
            -- Is an_item expanded relative to Current?
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.is_item_expanded (an_item)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    maximum_split_position: INTEGER
            -- Maximum position splitter can have.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.maximum_split_position
            non_negative: Result >= 0

    minimum_split_position: INTEGER
            -- Minimum position splitter can have.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.minimum_split_position
            non_negative: Result >= 0

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    Prunable: BOOLEAN is True
            -- Items may be removed.
            -- (from EV_SPLIT_AREA)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    split_position: INTEGER
            -- Offset of splitter from left or top.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
        ensure -- from EV_SPLIT_AREA
            bridge_ok: Result = implementation.split_position

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_item_expand (an_item: EV_WIDGET)
            -- When Current is resized, do not resize an_item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
            split_area_full: full
            other_item_is_expandable: (an_item = first and is_item_expanded (second)) or (an_item = second and is_item_expanded (first))
        ensure -- from EV_SPLIT_AREA
            not_an_item_expanded: not is_item_expanded (an_item)

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_item_expand (an_item: EV_WIDGET)
            -- When Current is resized, resize an_item respectively.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            has_an_item: has (an_item)
        ensure -- from EV_SPLIT_AREA
            an_item_expanded: is_item_expanded (an_item)

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    go_to_first
            -- Make first current item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            first_exists: first /= void
        ensure -- from EV_SPLIT_AREA
            item_is_first: item = first

    go_to_second
            -- Make first current item.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            second_exists: second /= void
        ensure -- from EV_SPLIT_AREA
            item_is_second: item = second

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Position split_position between minimum and maximum determined
            -- by a_proportion.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            split_area_full: full
            a_proportion_in_valid_range: (a_proportion >= 0 and a_proportion <= 1)

    set_split_position (a_split_position: INTEGER)
            -- Make a_split_position position of splitter in pixels.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            split_area_full: full
            a_split_position_within_bounds: is_displayed implies ((a_split_position >= minimum_split_position and a_split_position <= maximum_split_position))
        ensure -- from EV_SPLIT_AREA
            split_position_assigned: split_position = a_split_position

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (an_item: EV_WIDGET)
            -- Assign an_item to first_item if not already assigned or to
            -- second_item otherwise.
            -- Was declared in EV_SPLIT_AREA as synonym of put.
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure then -- from EV_SPLIT_AREA
            first_item_used_first: old first = void implies first = an_item
            second_item_used_second: old first /= void implies second = an_item
            has_an_item: has (an_item)

    put (an_item: EV_WIDGET)
            -- Assign an_item to first_item if not already assigned or to
            -- second_item otherwise.
            -- Was declared in EV_SPLIT_AREA as synonym of extend.
            -- (from EV_SPLIT_AREA)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure then -- from EV_SPLIT_AREA
            first_item_used_first: old first = void implies first = an_item
            second_item_used_second: old first /= void implies second = an_item
            has_an_item: has (an_item)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_first (an_item: EV_WIDGET)
            -- Assign an_item to first.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            an_item_not_in_split_area: not has (an_item)
            an_item_parent_is_void: an_item.parent = void
            first_is_void: first = void
        ensure -- from EV_SPLIT_AREA
            an_item_assigned: first = an_item
            an_item_not_expanded: not is_item_expanded (an_item)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_second (an_item: EV_WIDGET)
            -- Assign an_item to second.
            -- (from EV_SPLIT_AREA)
        require -- from EV_SPLIT_AREA
            not_destroyed: not is_destroyed
            an_item_not_void: an_item /= void
            an_item_not_in_split_area: not has (an_item)
            an_item_parent_is_void: an_item.parent = void
            second_is_void: second = void
        ensure -- from EV_SPLIT_AREA
            an_item_assigned: second = an_item
            an_item_expanded: is_item_expanded (an_item)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove one occurrence of v if any.
            -- (from EV_SPLIT_AREA)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_SPLIT_AREA
            count_is_one_implies_child_expandable: (count = 1 implies (first /= void and is_item_expanded (first) or second /= void and is_item_expanded (second)))

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from EV_SPLIT_AREA)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from EV_SPLIT_AREA)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_SPLIT_AREA
    maximum_greater_or_equal_minimum: is_usable implies minimum_split_position <= maximum_split_position
    splitter_in_valid_position__minimum: full implies split_position >= minimum_split_position
    splitter_in_valid_position__maximum: full implies split_position <= maximum_split_position
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_VERTICAL_SPLIT_AREA


EV_VIEWPORT Chart

class
    EV_VIEWPORT

General
    cluster: vision2.interface.widgets.containers
    description: "Displays a single widget that may be larger than the container.Clipping may occur though item size is not effected by viewport"
    keywords: "container, virtual, display"
    create: default_create

Ancestors
    DOUBLE_MATH
    EV_CELL

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    item_height: INTEGER
    item_width: INTEGER
    linear_representation: LINEAR [[like item] EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    width: INTEGER
    writable: BOOLEAN
    x_offset: INTEGER
    x_position: INTEGER
    y_offset: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_VIEWPORT)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    remove_help_context
    remove_pebble
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_offset (an_x, a_y: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_x_offset (an_x: INTEGER)
    set_y_offset (a_y: INTEGER)
    show
    wipe_out

Constraints
    item void means offset zero


EV_VIEWPORT Flat contracts

indexing
    description: "Displays a single widget that may be larger than the container.Clipping may occur though item size is not effected by viewport"
    appearance: " - - - - - - - - - - - - - - -  ^|             `item'          |`y_offset'                                v|          ---------------    |           |             ||          |  viewport   |    |           |             ||          ---------------    | - - - - - - - - - - - - - - -<`x_offset'>"
    status: "See notice at end of class"
    keywords: "container, virtual, display"
    date: "$Date: 2001/07/14 11:02:42 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_VIEWPORT

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: EV_WIDGET): BOOLEAN
            -- Does Current include v?
            -- (from EV_CELL)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    x_offset: INTEGER
            -- Horizontal position of viewport relative to item.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.x_offset

    y_offset: INTEGER
            -- Vertical position of viewport relative to item.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.y_offset

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_offset (an_x, a_y: INTEGER)
            -- Assign an_x to x_offset.
            -- Assign a_y to y_offset.
        require
            not_destroyed: not is_destroyed
        ensure
            assigned: x_offset = an_x
            assigned: y_offset = a_y

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_x_offset (an_x: INTEGER)
            -- Assign an_x to x_offset.
        require
            not_destroyed: not is_destroyed
        ensure
            assigned: x_offset = an_x

    set_y_offset (a_y: INTEGER)
            -- Assign a_y to y_offset.
        require
            not_destroyed: not is_destroyed
        ensure
            assigned: y_offset = a_y

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    item_height: INTEGER
            -- Height of item. Zero if item Void.

    item_width: INTEGER
            -- Width of item. Zero if item Void.

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    item_void_means_offset_zero: is_usable implies (item = void implies x_offset = 0 and y_offset = 0)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_VIEWPORT


EV_WIDGET_LIST Chart

deferred class
    EV_WIDGET_LIST

General
    cluster: vision2.interface.widgets.containers
    description: "Multiple widget container accessible as a list."
    keywords: "widget list, container"

Ancestors
    EV_CONTAINER
    EV_DYNAMIC_LIST [G -> EV_CONTAINABLE]

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_WIDGET
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_WIDGET
    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_WIDGET
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_WIDGET; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_WIDGET_LIST): BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_WIDGET
    last: [like item] EV_WIDGET
    linear_representation: LINEAR [EV_WIDGET]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_WIDGET): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    sequential_occurrences (v: EV_WIDGET): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_WIDGET])
    back
    center_pointer
    copy (other: [like Current] EV_WIDGET_LIST)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    finish
    force (v: [like item] EV_WIDGET)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_WIDGET_LIST)
    merge_radio_button_groups (other: EV_CONTAINER)
    merge_right (other: [like Current] EV_WIDGET_LIST)
    move (i: INTEGER)
    propagate_background_color
    propagate_foreground_color
    prune (v: [like item] EV_WIDGET)
    prune_all (v: [like item] EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    put_front (v: [like item] EV_WIDGET)
    put_i_th (v: [like item] EV_WIDGET; i: INTEGER)
    put_left (v: [like item] EV_WIDGET)
    put_right (v: [like item] EV_WIDGET)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    replace (v: [like item] EV_WIDGET)
    search (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_WIDGET_LIST Flat contracts

indexing
    description: "Multiple widget container accessible as a list."
    status: "See notice at end of class"
    keywords: "widget list, container"
    date: "$Date: 2001/07/14 11:02:43 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_WIDGET_LIST

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_WIDGET]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_WIDGET
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_WIDGET): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        require -- from  FINITE
            True
        require -- from  SET
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_WIDGET])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count
        ensure -- from EV_CONTAINER
            has_v: has (v)

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_CONTAINER
            has_v: has (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_WIDGET]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_WIDGET]]; test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_WIDGET], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_WIDGET_LIST


EV_WINDOW Chart

class
    EV_WINDOW

General
    cluster: vision2.interface.widgets.containers
    description:
        "Top level window. Contains a single widget.
        `title' is not displayed."
    keywords: "toplevel, window, popup"
    create: make_with_title, default_create

Ancestors
    EV_CELL
    EV_POSITIONABLE
    EV_WINDOW_ACTION_SEQUENCES

Action sequences
    close_request_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_WINDOW)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    merge_radio_button_groups (other: EV_CONTAINER)
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    remove_help_context
    remove_menu_bar
    remove_pebble
    remove_title
    replace (v: [like item] EV_WIDGET)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    unlock_update
    wipe_out

Constraints
    consistent horizontal bounds
    consistent vertical bounds
    upper bar not void
    lower bar not void


EV_WINDOW Flat contracts

indexing
    description: "Top level window. Contains a single widget.`title' is not displayed."
    appearance: " _____________ |____________X||             ||   `item'    ||_____________|"
    status: "See notice at end of class"
    keywords: "toplevel, window, popup"
    date: "$Date: 2001/07/14 11:02:43 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_WINDOW

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_title (a_title: STRING)
            -- Initialize with a_title.
        require
            a_title_not_void: a_title /= void

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    title: STRING
            -- A textual name used by the window manager.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_modal: BOOLEAN
            -- Must the window be closed before application can
            -- receive user events again?
            --
            -- May be redefined in EV_DIALOG to return
            -- a different value
        require
            not_destroyed: not is_destroyed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    user_can_resize: BOOLEAN
            -- Can the user resize?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
        require
            not_destroyed: not is_destroyed
        ensure
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
        require
            not_destroyed: not is_destroyed
        ensure
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
        require
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    remove_menu_bar
            -- Make menu_bar Void.
        require
            not_destroyed: not is_destroyed
        ensure
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_title
            -- Make title Void.
        require
            not_destroyed: not is_destroyed
        ensure
            a_title_removed: title = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
        require
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
        require
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
        require
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
        require
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_title (a_title: STRING)
            -- Assign a_title to title.
        require
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
        require
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    close_request_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed whan a request to close window
            -- has been received.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_WINDOW


cluster vision2.interface.widgets.dialogs

Cluster
    vision2.interface.widgets.dialogs

Supercluster
    vision2.interface.widgets

Subclusters

Classes
    EV_COLOR_DIALOG
    EV_CONFIRMATION_DIALOG
    EV_DIALOG
    EV_DIRECTORY_DIALOG
    EV_ERROR_DIALOG
    EV_FILE_DIALOG
    EV_FILE_OPEN_DIALOG
    EV_FILE_SAVE_DIALOG
    EV_FONT_DIALOG
    EV_INFORMATION_DIALOG
    EV_MESSAGE_DIALOG
    EV_PRINT_DIALOG
    EV_QUESTION_DIALOG
    EV_STANDARD_DIALOG
    EV_WARNING_DIALOG


EV_COLOR_DIALOG Chart

class
    EV_COLOR_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision color selection dialog."
    create: default_create

Ancestors
    EV_STANDARD_DIALOG

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    blocking_window: EV_WINDOW
    color: EV_COLOR
    data: ANY
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    selected_button: STRING
    title: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_COLOR_DIALOG)
    default_create
    destroy
    set_color (a_color: EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)


EV_COLOR_DIALOG Flat contracts

indexing
    description: "EiffelVision color selection dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:24 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_COLOR_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result = implementation.blocking_window

    color: EV_COLOR
            -- Currently selected color.
        require
            not_destroyed: not is_destroyed
        ensure
            result_not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    title: STRING
            -- Title of Current displayed in title bar.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result.is_equal (implementation.title)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

feature -- Element change

    set_color (a_color: EV_COLOR)
            -- Assign a_color to color.
        require
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_STANDARD_DIALOG
    title_not_void: is_usable implies title /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_COLOR_DIALOG


EV_CONFIRMATION_DIALOG Chart

class
    EV_CONFIRMATION_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision confirmation dialog."
    create: make_with_text, make_with_text_and_actions, default_create

Ancestors
    EV_MESSAGE_DIALOG

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    button (a_text: STRING): EV_BUTTON
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    default_cancel_button: EV_BUTTON
    default_push_button: EV_BUTTON
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_button (a_text: STRING): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_button: STRING
    target_name: STRING
    text: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_CONFIRMATION_DIALOG)
    default_create
    destroy
    dialog_key_press_action (a_key: EV_KEY)
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_default_cancel_button
    remove_default_push_button
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_pixmap
    remove_text
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: EV_COLOR)
    set_buttons (button_labels: ARRAY [STRING])
    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
    set_data (some_data: [like data] ANY)
    set_default_cancel_button (a_button: EV_BUTTON)
    set_default_colors
    set_default_push_button (a_button: EV_BUTTON)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    show_modal_to_window (a_window: EV_WINDOW)
    show_relative_to_window (a_window: EV_WINDOW)
    unlock_update
    wipe_out


EV_CONFIRMATION_DIALOG Flat contracts

indexing
    description: "EiffelVision confirmation dialog."
    status: "See notice at end of class."
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_CONFIRMATION_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void

    make_with_text_and_actions (a_text: STRING; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create Current, assign a_text to text and actions to select_actions
            -- of buttons.
            -- (actions are added to buttons in order.)
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void
            actions_not_void: actions /= void
            actions_not_empty: actions.count > 0

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Background color of Current.
            -- (from EV_MESSAGE_DIALOG)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    default_cancel_button: EV_BUTTON
            -- Default cancel button. This is the button that
            -- is pushed if the user press the escape key or
            -- close the window using the close icon.
            -- If there is no default cancel button, the close
            -- icon is disabled.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    default_push_button: EV_BUTTON
            -- Default pushed button. This is the button that
            -- is pushed if the user press the enter key unless
            -- a push button is currently focused.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Foreground color of Current.
            -- (from EV_MESSAGE_DIALOG)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_modal: BOOLEAN
            -- Must Current be closed before application can
            -- receive user events again?
            -- (from EV_DIALOG)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Icon displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Message displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    button (a_text: STRING): EV_BUTTON
            -- Button that has a_text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            has_button_with_a_text: has_button (a_text)
        ensure -- from EV_MESSAGE_DIALOG
            not_void: Result /= void

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_button (a_text: STRING): BOOLEAN
            -- Does Current contain a button with text a_text?
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_minimized

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_MESSAGE_DIALOG)

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_pixmap
            -- Assign Void to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_void: pixmap = void

    remove_text
            -- Assign Void to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            text_void: text = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_background_color (a_color: EV_COLOR)
            -- Assign a_color to background_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_buttons (button_labels: ARRAY [STRING])
            -- Assign new buttons with button_labels to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0

    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Assign new buttons with button_labels and actions to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            actions_not_void: actions /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0
            enough_actions_for_labels: actions.count >= button_labels.count

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_assigned: pixmap.is_equal (a_pixmap)

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_MESSAGE_DIALOG
            assigned: text.is_equal (a_text)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure -- from EV_TITLED_WINDOW
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure -- from EV_TITLED_WINDOW
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    dialog_key_press_action (a_key: EV_KEY)
            -- The action performed to process default push and cancel
            -- buttons. This is inserted in key_press_actions and
            -- behaves is follows:
            -- If escape is pressed at any time then
            -- If there is a default_cancel_button then
            -- If it is sensitive, call its select_actions,
            -- otherwise, close the dialog.
            -- If there is no default_cancel_button, do nothing.
            -- If enter is pressed at any time then
            -- If a push button is currently focused then call its
            -- select_actions. If no push button has the focus, then
            -- call the select_actions of the default push button if
            -- it is sensitive.
            -- (from EV_DIALOG)

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show and wait until Current is closed.
            -- Current is shown modal with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            dialog_modeless: not is_modal
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

    show_relative_to_window (a_window: EV_WINDOW)
            -- Show Current with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- Status Setting

    remove_default_cancel_button
            -- Remove default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_cancel_button: default_cancel_button /= void
        ensure -- from EV_DIALOG
            not_has_default_cancel_button: default_cancel_button = void

    remove_default_push_button
            -- Remove default_push_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_push_button: default_push_button /= void
        ensure -- from EV_DIALOG
            not_has_default_push_button: default_push_button = void

    set_default_cancel_button (a_button: EV_BUTTON)
            -- Assign a_button to default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)
        ensure -- from EV_DIALOG
            default_cancel_button_set: default_cancel_button = a_button

    set_default_push_button (a_button: EV_BUTTON)
            -- Assign a_button to `default push button'.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TITLED_WINDOW
    accelerators_not_void: is_usable implies accelerators /= void
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_CONFIRMATION_DIALOG


EV_DIALOG Chart

class
    EV_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description:
        "Window intended for transient user interaction.
        Optionaly modal. A modal dialog blocks the rest of the applicationuntil closed."
    keywords: "dialog, dialogue, popup, window"
    create: default_create

Ancestors
    EV_TITLED_WINDOW

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    default_cancel_button: EV_BUTTON
    default_push_button: EV_BUTTON
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_DIALOG)
    default_create
    destroy
    dialog_key_press_action (a_key: EV_KEY)
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_default_cancel_button
    remove_default_push_button
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_cancel_button (a_button: EV_BUTTON)
    set_default_colors
    set_default_push_button (a_button: EV_BUTTON)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    show_modal_to_window (a_window: EV_WINDOW)
    show_relative_to_window (a_window: EV_WINDOW)
    unlock_update
    wipe_out


EV_DIALOG Flat contracts

indexing
    description: "Window intended for transient user interaction.Optionaly modal. A modal dialog blocks the rest of the applicationuntil closed."
    status: "See notice at end of class"
    keywords: "dialog, dialogue, popup, window"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    default_cancel_button: EV_BUTTON
            -- Default cancel button. This is the button that
            -- is pushed if the user press the escape key or
            -- close the window using the close icon.
            -- If there is no default cancel button, the close
            -- icon is disabled.
        require
            not_destroyed: not is_destroyed

    default_push_button: EV_BUTTON
            -- Default pushed button. This is the button that
            -- is pushed if the user press the enter key unless
            -- a push button is currently focused.
        require
            not_destroyed: not is_destroyed

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_modal: BOOLEAN
            -- Must Current be closed before application can
            -- receive user events again?

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_minimized

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure -- from EV_TITLED_WINDOW
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure -- from EV_TITLED_WINDOW
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    dialog_key_press_action (a_key: EV_KEY)
            -- The action performed to process default push and cancel
            -- buttons. This is inserted in key_press_actions and
            -- behaves is follows:
            -- If escape is pressed at any time then
            -- If there is a default_cancel_button then
            -- If it is sensitive, call its select_actions,
            -- otherwise, close the dialog.
            -- If there is no default_cancel_button, do nothing.
            -- If enter is pressed at any time then
            -- If a push button is currently focused then call its
            -- select_actions. If no push button has the focus, then
            -- call the select_actions of the default push button if
            -- it is sensitive.

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show and wait until Current is closed.
            -- Current is shown modal with respect to a_window.
        require
            not_destroyed: not is_destroyed
            dialog_modeless: not is_modal
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

    show_relative_to_window (a_window: EV_WINDOW)
            -- Show Current with respect to a_window.
        require
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- Status Setting

    remove_default_cancel_button
            -- Remove default_cancel_button.
        require
            not_destroyed: not is_destroyed
            has_default_cancel_button: default_cancel_button /= void
        ensure
            not_has_default_cancel_button: default_cancel_button = void

    remove_default_push_button
            -- Remove default_push_button.
        require
            not_destroyed: not is_destroyed
            has_default_push_button: default_push_button /= void
        ensure
            not_has_default_push_button: default_push_button = void

    set_default_cancel_button (a_button: EV_BUTTON)
            -- Assign a_button to default_cancel_button.
        require
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)
        ensure
            default_cancel_button_set: default_cancel_button = a_button

    set_default_push_button (a_button: EV_BUTTON)
            -- Assign a_button to `default push button'.
        require
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TITLED_WINDOW
    accelerators_not_void: is_usable implies accelerators /= void
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_DIALOG


EV_DIRECTORY_DIALOG Chart

class
    EV_DIRECTORY_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "Eiffel Vision directory dialog."
    create: default_create

Ancestors
    EV_STANDARD_DIALOG

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    blocking_window: EV_WINDOW
    data: ANY
    directory: STRING
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    selected_button: STRING
    start_directory: STRING
    title: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_DIRECTORY_DIALOG)
    default_create
    destroy
    set_data (some_data: [like data] ANY)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_start_directory (a_path: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)


EV_DIRECTORY_DIALOG Flat contracts

indexing
    description: "Eiffel Vision directory dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:25 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_DIRECTORY_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result = implementation.blocking_window

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    directory: STRING
            -- Path of currently selected directory.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result /= void implies Result.is_equal (implementation.directory)

    start_directory: STRING
            -- Base directory where browsing will start.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.start_directory)

    title: STRING
            -- Title of Current displayed in title bar.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result.is_equal (implementation.title)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_start_directory (a_path: STRING)
            -- Assign a_path to start_directory.
        require
            not_destroyed: not is_destroyed
            a_path_not_void: a_path /= void
            a_path_exists: (create {DIRECTORY}.make (a_path)).exists
        ensure
            assigned: start_directory.is_equal (a_path)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_STANDARD_DIALOG
    title_not_void: is_usable implies title /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_DIRECTORY_DIALOG


EV_ERROR_DIALOG Chart

class
    EV_ERROR_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision error dialog."
    create: make_with_text, make_with_text_and_actions, default_create

Ancestors
    EV_MESSAGE_DIALOG

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    button (a_text: STRING): EV_BUTTON
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    default_cancel_button: EV_BUTTON
    default_push_button: EV_BUTTON
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_button (a_text: STRING): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_button: STRING
    target_name: STRING
    text: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_ERROR_DIALOG)
    default_create
    destroy
    dialog_key_press_action (a_key: EV_KEY)
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_default_cancel_button
    remove_default_push_button
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_pixmap
    remove_text
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: EV_COLOR)
    set_buttons (button_labels: ARRAY [STRING])
    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
    set_data (some_data: [like data] ANY)
    set_default_cancel_button (a_button: EV_BUTTON)
    set_default_colors
    set_default_push_button (a_button: EV_BUTTON)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    show_modal_to_window (a_window: EV_WINDOW)
    show_relative_to_window (a_window: EV_WINDOW)
    unlock_update
    wipe_out


EV_ERROR_DIALOG Flat contracts

indexing
    description: "EiffelVision error dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_ERROR_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void

    make_with_text_and_actions (a_text: STRING; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create Current, assign a_text to text and actions to select_actions
            -- of buttons.
            -- (actions are added to buttons in order.)
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void
            actions_not_void: actions /= void
            actions_not_empty: actions.count > 0

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Background color of Current.
            -- (from EV_MESSAGE_DIALOG)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    default_cancel_button: EV_BUTTON
            -- Default cancel button. This is the button that
            -- is pushed if the user press the escape key or
            -- close the window using the close icon.
            -- If there is no default cancel button, the close
            -- icon is disabled.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    default_push_button: EV_BUTTON
            -- Default pushed button. This is the button that
            -- is pushed if the user press the enter key unless
            -- a push button is currently focused.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Foreground color of Current.
            -- (from EV_MESSAGE_DIALOG)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_modal: BOOLEAN
            -- Must Current be closed before application can
            -- receive user events again?
            -- (from EV_DIALOG)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Icon displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Message displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    button (a_text: STRING): EV_BUTTON
            -- Button that has a_text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            has_button_with_a_text: has_button (a_text)
        ensure -- from EV_MESSAGE_DIALOG
            not_void: Result /= void

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_button (a_text: STRING): BOOLEAN
            -- Does Current contain a button with text a_text?
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_minimized

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_MESSAGE_DIALOG)

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_pixmap
            -- Assign Void to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_void: pixmap = void

    remove_text
            -- Assign Void to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            text_void: text = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_background_color (a_color: EV_COLOR)
            -- Assign a_color to background_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_buttons (button_labels: ARRAY [STRING])
            -- Assign new buttons with button_labels to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0

    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Assign new buttons with button_labels and actions to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            actions_not_void: actions /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0
            enough_actions_for_labels: actions.count >= button_labels.count

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_assigned: pixmap.is_equal (a_pixmap)

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_MESSAGE_DIALOG
            assigned: text.is_equal (a_text)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure -- from EV_TITLED_WINDOW
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure -- from EV_TITLED_WINDOW
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    dialog_key_press_action (a_key: EV_KEY)
            -- The action performed to process default push and cancel
            -- buttons. This is inserted in key_press_actions and
            -- behaves is follows:
            -- If escape is pressed at any time then
            -- If there is a default_cancel_button then
            -- If it is sensitive, call its select_actions,
            -- otherwise, close the dialog.
            -- If there is no default_cancel_button, do nothing.
            -- If enter is pressed at any time then
            -- If a push button is currently focused then call its
            -- select_actions. If no push button has the focus, then
            -- call the select_actions of the default push button if
            -- it is sensitive.
            -- (from EV_DIALOG)

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show and wait until Current is closed.
            -- Current is shown modal with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            dialog_modeless: not is_modal
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

    show_relative_to_window (a_window: EV_WINDOW)
            -- Show Current with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- Status Setting

    remove_default_cancel_button
            -- Remove default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_cancel_button: default_cancel_button /= void
        ensure -- from EV_DIALOG
            not_has_default_cancel_button: default_cancel_button = void

    remove_default_push_button
            -- Remove default_push_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_push_button: default_push_button /= void
        ensure -- from EV_DIALOG
            not_has_default_push_button: default_push_button = void

    set_default_cancel_button (a_button: EV_BUTTON)
            -- Assign a_button to default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)
        ensure -- from EV_DIALOG
            default_cancel_button_set: default_cancel_button = a_button

    set_default_push_button (a_button: EV_BUTTON)
            -- Assign a_button to `default push button'.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TITLED_WINDOW
    accelerators_not_void: is_usable implies accelerators /= void
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_ERROR_DIALOG


EV_FILE_DIALOG Chart

deferred class
    EV_FILE_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision file selection dialog."

Ancestors
    EV_STANDARD_DIALOG

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    blocking_window: EV_WINDOW
    data: ANY
    file_name: STRING
    file_path: STRING
    file_title: STRING
    filter: STRING
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    selected_button: STRING
    start_directory: STRING
    title: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_FILE_DIALOG)
    default_create
    destroy
    set_data (some_data: [like data] ANY)
    set_file_name (a_name: STRING)
    set_filter (a_filter: STRING)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_start_directory (a_path: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)

Constraints
    filter not void
    start directory not void
    file name not void implies path and title not void
    path plus title equals name


EV_FILE_DIALOG Flat contracts

indexing
    description: "EiffelVision file selection dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:25 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_FILE_DIALOG

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result = implementation.blocking_window

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    file_name: STRING
            -- Full name of currently selected file including path.
            -- Void if user did not click "OK".
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_name)

    filter: STRING
            -- Filter currently applied to file list.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.filter)

    start_directory: STRING
            -- Base directory where browsing will start.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.start_directory)

    title: STRING
            -- Title of Current displayed in title bar.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result.is_equal (implementation.title)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    file_path: STRING
            -- Path of file_name.
            -- Void if user did not click "OK".
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_path)

    file_title: STRING
            -- file_name without its path.
            -- Void if user did not click "OK".
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_title)

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_file_name (a_name: STRING)
            -- Make a_name the selected file.
        require
            not_destroyed: not is_destroyed
            a_name_not_void: a_name /= void
        ensure
            assigned: file_name.is_equal (a_name)

    set_filter (a_filter: STRING)
            -- Set a_filter as new filter.
        require
            not_destroyed: not is_destroyed
            a_filter_not_void: a_filter /= void
        ensure
            assigned: filter.is_equal (a_filter)

    set_start_directory (a_path: STRING)
            -- Make a_path the base directory.
        require
            not_destroyed: not is_destroyed
            a_path_not_void: a_path /= void
        ensure
            assigned: start_directory.is_equal (a_path)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    filter_not_void: filter /= void
    start_directory_not_void: start_directory /= void
    file_name_not_void_implies_path_and_title_not_void: file_name /= void implies (file_title /= void and then file_path /= void)
    path_plus_title_equals_name: file_name /= void implies file_name.is_equal (file_path + file_title)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_STANDARD_DIALOG
    title_not_void: is_usable implies title /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_FILE_DIALOG


EV_FILE_OPEN_DIALOG Chart

class
    EV_FILE_OPEN_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "Eiffel Vision file open dialog."
    create: default_create

Ancestors
    EV_FILE_DIALOG

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    blocking_window: EV_WINDOW
    data: ANY
    file_name: STRING
    file_path: STRING
    file_title: STRING
    filter: STRING
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    selected_button: STRING
    start_directory: STRING
    title: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_FILE_OPEN_DIALOG)
    default_create
    destroy
    set_data (some_data: [like data] ANY)
    set_file_name (a_name: STRING)
    set_filter (a_filter: STRING)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_start_directory (a_path: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)


EV_FILE_OPEN_DIALOG Flat contracts

indexing
    description: "Eiffel Vision file open dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:25 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_FILE_OPEN_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result = implementation.blocking_window

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    file_name: STRING
            -- Full name of currently selected file including path.
            -- Void if user did not click "OK".
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_name)

    filter: STRING
            -- Filter currently applied to file list.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result.is_equal (implementation.filter)

    start_directory: STRING
            -- Base directory where browsing will start.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result.is_equal (implementation.start_directory)

    title: STRING
            -- Title of Current displayed in title bar.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result.is_equal (implementation.title)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    file_path: STRING
            -- Path of file_name.
            -- Void if user did not click "OK".
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_path)

    file_title: STRING
            -- file_name without its path.
            -- Void if user did not click "OK".
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_title)

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_file_name (a_name: STRING)
            -- Make a_name the selected file.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
            a_name_not_void: a_name /= void
        ensure -- from EV_FILE_DIALOG
            assigned: file_name.is_equal (a_name)

    set_filter (a_filter: STRING)
            -- Set a_filter as new filter.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
            a_filter_not_void: a_filter /= void
        ensure -- from EV_FILE_DIALOG
            assigned: filter.is_equal (a_filter)

    set_start_directory (a_path: STRING)
            -- Make a_path the base directory.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
            a_path_not_void: a_path /= void
        ensure -- from EV_FILE_DIALOG
            assigned: start_directory.is_equal (a_path)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_FILE_DIALOG
    filter_not_void: filter /= void
    start_directory_not_void: start_directory /= void
    file_name_not_void_implies_path_and_title_not_void: file_name /= void implies (file_title /= void and then file_path /= void)
    path_plus_title_equals_name: file_name /= void implies file_name.is_equal (file_path + file_title)
        -- from EV_STANDARD_DIALOG
    title_not_void: is_usable implies title /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_FILE_OPEN_DIALOG


EV_FILE_SAVE_DIALOG Chart

class
    EV_FILE_SAVE_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "Eiffel Vision file save dialog."
    create: default_create

Ancestors
    EV_FILE_DIALOG

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    blocking_window: EV_WINDOW
    data: ANY
    file_name: STRING
    file_path: STRING
    file_title: STRING
    filter: STRING
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    selected_button: STRING
    start_directory: STRING
    title: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_FILE_SAVE_DIALOG)
    default_create
    destroy
    set_data (some_data: [like data] ANY)
    set_file_name (a_name: STRING)
    set_filter (a_filter: STRING)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_start_directory (a_path: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)


EV_FILE_SAVE_DIALOG Flat contracts

indexing
    description: "Eiffel Vision file save dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:25 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_FILE_SAVE_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result = implementation.blocking_window

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    file_name: STRING
            -- Full name of currently selected file including path.
            -- Void if user did not click "OK".
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_name)

    filter: STRING
            -- Filter currently applied to file list.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result.is_equal (implementation.filter)

    start_directory: STRING
            -- Base directory where browsing will start.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result.is_equal (implementation.start_directory)

    title: STRING
            -- Title of Current displayed in title bar.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result.is_equal (implementation.title)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    file_path: STRING
            -- Path of file_name.
            -- Void if user did not click "OK".
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_path)

    file_title: STRING
            -- file_name without its path.
            -- Void if user did not click "OK".
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_FILE_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.file_title)

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_file_name (a_name: STRING)
            -- Make a_name the selected file.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
            a_name_not_void: a_name /= void
        ensure -- from EV_FILE_DIALOG
            assigned: file_name.is_equal (a_name)

    set_filter (a_filter: STRING)
            -- Set a_filter as new filter.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
            a_filter_not_void: a_filter /= void
        ensure -- from EV_FILE_DIALOG
            assigned: filter.is_equal (a_filter)

    set_start_directory (a_path: STRING)
            -- Make a_path the base directory.
            -- (from EV_FILE_DIALOG)
        require -- from EV_FILE_DIALOG
            not_destroyed: not is_destroyed
            a_path_not_void: a_path /= void
        ensure -- from EV_FILE_DIALOG
            assigned: start_directory.is_equal (a_path)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_FILE_DIALOG
    filter_not_void: filter /= void
    start_directory_not_void: start_directory /= void
    file_name_not_void_implies_path_and_title_not_void: file_name /= void implies (file_title /= void and then file_path /= void)
    path_plus_title_equals_name: file_name /= void implies file_name.is_equal (file_path + file_title)
        -- from EV_STANDARD_DIALOG
    title_not_void: is_usable implies title /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_FILE_SAVE_DIALOG


EV_FONT_DIALOG Chart

class
    EV_FONT_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision font selection dialog."
    create: default_create

Ancestors
    EV_STANDARD_DIALOG

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    blocking_window: EV_WINDOW
    data: ANY
    font: EV_FONT
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    selected_button: STRING
    title: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_FONT_DIALOG)
    default_create
    destroy
    set_data (some_data: [like data] ANY)
    set_font (a_font: EV_FONT)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)


EV_FONT_DIALOG Flat contracts

indexing
    description: "EiffelVision font selection dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:25 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_FONT_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result = implementation.blocking_window

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    font: EV_FONT
            -- Font selected in Current.
        require
            not_destroyed: not is_destroyed
        ensure
            result_not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

    title: STRING
            -- Title of Current displayed in title bar.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result.is_equal (implementation.title)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
        require
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_STANDARD_DIALOG
    title_not_void: is_usable implies title /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_FONT_DIALOG


EV_INFORMATION_DIALOG Chart

class
    EV_INFORMATION_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision information dialog."
    create: make_with_text, make_with_text_and_actions, default_create

Ancestors
    EV_MESSAGE_DIALOG

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    button (a_text: STRING): EV_BUTTON
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    default_cancel_button: EV_BUTTON
    default_push_button: EV_BUTTON
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_button (a_text: STRING): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_button: STRING
    target_name: STRING
    text: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_INFORMATION_DIALOG)
    default_create
    destroy
    dialog_key_press_action (a_key: EV_KEY)
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_default_cancel_button
    remove_default_push_button
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_pixmap
    remove_text
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: EV_COLOR)
    set_buttons (button_labels: ARRAY [STRING])
    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
    set_data (some_data: [like data] ANY)
    set_default_cancel_button (a_button: EV_BUTTON)
    set_default_colors
    set_default_push_button (a_button: EV_BUTTON)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    show_modal_to_window (a_window: EV_WINDOW)
    show_relative_to_window (a_window: EV_WINDOW)
    unlock_update
    wipe_out


EV_INFORMATION_DIALOG Flat contracts

indexing
    description: "EiffelVision information dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_INFORMATION_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void

    make_with_text_and_actions (a_text: STRING; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create Current, assign a_text to text and actions to select_actions
            -- of buttons.
            -- (actions are added to buttons in order.)
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void
            actions_not_void: actions /= void
            actions_not_empty: actions.count > 0

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Background color of Current.
            -- (from EV_MESSAGE_DIALOG)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    default_cancel_button: EV_BUTTON
            -- Default cancel button. This is the button that
            -- is pushed if the user press the escape key or
            -- close the window using the close icon.
            -- If there is no default cancel button, the close
            -- icon is disabled.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    default_push_button: EV_BUTTON
            -- Default pushed button. This is the button that
            -- is pushed if the user press the enter key unless
            -- a push button is currently focused.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Foreground color of Current.
            -- (from EV_MESSAGE_DIALOG)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_modal: BOOLEAN
            -- Must Current be closed before application can
            -- receive user events again?
            -- (from EV_DIALOG)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Icon displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Message displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    button (a_text: STRING): EV_BUTTON
            -- Button that has a_text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            has_button_with_a_text: has_button (a_text)
        ensure -- from EV_MESSAGE_DIALOG
            not_void: Result /= void

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_button (a_text: STRING): BOOLEAN
            -- Does Current contain a button with text a_text?
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_minimized

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_MESSAGE_DIALOG)

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_pixmap
            -- Assign Void to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_void: pixmap = void

    remove_text
            -- Assign Void to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            text_void: text = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_background_color (a_color: EV_COLOR)
            -- Assign a_color to background_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_buttons (button_labels: ARRAY [STRING])
            -- Assign new buttons with button_labels to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0

    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Assign new buttons with button_labels and actions to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            actions_not_void: actions /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0
            enough_actions_for_labels: actions.count >= button_labels.count

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_assigned: pixmap.is_equal (a_pixmap)

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_MESSAGE_DIALOG
            assigned: text.is_equal (a_text)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure -- from EV_TITLED_WINDOW
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure -- from EV_TITLED_WINDOW
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    dialog_key_press_action (a_key: EV_KEY)
            -- The action performed to process default push and cancel
            -- buttons. This is inserted in key_press_actions and
            -- behaves is follows:
            -- If escape is pressed at any time then
            -- If there is a default_cancel_button then
            -- If it is sensitive, call its select_actions,
            -- otherwise, close the dialog.
            -- If there is no default_cancel_button, do nothing.
            -- If enter is pressed at any time then
            -- If a push button is currently focused then call its
            -- select_actions. If no push button has the focus, then
            -- call the select_actions of the default push button if
            -- it is sensitive.
            -- (from EV_DIALOG)

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show and wait until Current is closed.
            -- Current is shown modal with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            dialog_modeless: not is_modal
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

    show_relative_to_window (a_window: EV_WINDOW)
            -- Show Current with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- Status Setting

    remove_default_cancel_button
            -- Remove default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_cancel_button: default_cancel_button /= void
        ensure -- from EV_DIALOG
            not_has_default_cancel_button: default_cancel_button = void

    remove_default_push_button
            -- Remove default_push_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_push_button: default_push_button /= void
        ensure -- from EV_DIALOG
            not_has_default_push_button: default_push_button = void

    set_default_cancel_button (a_button: EV_BUTTON)
            -- Assign a_button to default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)
        ensure -- from EV_DIALOG
            default_cancel_button_set: default_cancel_button = a_button

    set_default_push_button (a_button: EV_BUTTON)
            -- Assign a_button to `default push button'.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TITLED_WINDOW
    accelerators_not_void: is_usable implies accelerators /= void
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_INFORMATION_DIALOG


EV_MESSAGE_DIALOG Chart

deferred class
    EV_MESSAGE_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description:
        "EiffelVision message dialog. Dialogs that always consist of
        a pixmap, a text and one or more buttons."
    keywords: "dialog, standard, pixmap, text, button, modal"

Ancestors
    EV_DIALOG
    EV_DIALOG_CONSTANTS

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    button (a_text: STRING): EV_BUTTON
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    default_cancel_button: EV_BUTTON
    default_push_button: EV_BUTTON
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_button (a_text: STRING): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_button: STRING
    target_name: STRING
    text: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_MESSAGE_DIALOG)
    default_create
    destroy
    dialog_key_press_action (a_key: EV_KEY)
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_default_cancel_button
    remove_default_push_button
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_pixmap
    remove_text
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: EV_COLOR)
    set_buttons (button_labels: ARRAY [STRING])
    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
    set_data (some_data: [like data] ANY)
    set_default_cancel_button (a_button: EV_BUTTON)
    set_default_colors
    set_default_push_button (a_button: EV_BUTTON)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    show_modal_to_window (a_window: EV_WINDOW)
    show_relative_to_window (a_window: EV_WINDOW)
    unlock_update
    wipe_out


EV_MESSAGE_DIALOG Flat contracts

indexing
    description: "EiffelVision message dialog. Dialogs that always consist of a pixmap, a text and one or more buttons."
    status: "See notice at end of class"
    keywords: "dialog, standard, pixmap, text, button, modal"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_MESSAGE_DIALOG

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Background color of Current.

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    default_cancel_button: EV_BUTTON
            -- Default cancel button. This is the button that
            -- is pushed if the user press the escape key or
            -- close the window using the close icon.
            -- If there is no default cancel button, the close
            -- icon is disabled.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    default_push_button: EV_BUTTON
            -- Default pushed button. This is the button that
            -- is pushed if the user press the enter key unless
            -- a push button is currently focused.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Foreground color of Current.

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_modal: BOOLEAN
            -- Must Current be closed before application can
            -- receive user events again?
            -- (from EV_DIALOG)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Icon displayed by Current.
        require
            not_destroyed: not is_destroyed

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Message displayed by Current.
        require
            not_destroyed: not is_destroyed

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    button (a_text: STRING): EV_BUTTON
            -- Button that has a_text.
        require
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            has_button_with_a_text: has_button (a_text)
        ensure
            not_void: Result /= void

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_button (a_text: STRING): BOOLEAN
            -- Does Current contain a button with text a_text?
        require
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_minimized

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    selected_button: STRING
            -- Label of last clicked button.

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_pixmap
            -- Assign Void to pixmap.
        require
            not_destroyed: not is_destroyed
        ensure
            pixmap_void: pixmap = void

    remove_text
            -- Assign Void to text.
        require
            not_destroyed: not is_destroyed
        ensure
            text_void: text = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_background_color (a_color: EV_COLOR)
            -- Assign a_color to background_color.
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_buttons (button_labels: ARRAY [STRING])
            -- Assign new buttons with button_labels to buttons.
        require
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0

    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Assign new buttons with button_labels and actions to buttons.
        require
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            actions_not_void: actions /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0
            enough_actions_for_labels: actions.count >= button_labels.count

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
        require
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure
            pixmap_assigned: pixmap.is_equal (a_pixmap)

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_text (a_text: STRING)
            -- Assign a_text to text.
        require
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure
            assigned: text.is_equal (a_text)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure -- from EV_TITLED_WINDOW
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure -- from EV_TITLED_WINDOW
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    dialog_key_press_action (a_key: EV_KEY)
            -- The action performed to process default push and cancel
            -- buttons. This is inserted in key_press_actions and
            -- behaves is follows:
            -- If escape is pressed at any time then
            -- If there is a default_cancel_button then
            -- If it is sensitive, call its select_actions,
            -- otherwise, close the dialog.
            -- If there is no default_cancel_button, do nothing.
            -- If enter is pressed at any time then
            -- If a push button is currently focused then call its
            -- select_actions. If no push button has the focus, then
            -- call the select_actions of the default push button if
            -- it is sensitive.
            -- (from EV_DIALOG)

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show and wait until Current is closed.
            -- Current is shown modal with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            dialog_modeless: not is_modal
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

    show_relative_to_window (a_window: EV_WINDOW)
            -- Show Current with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- Status Setting

    remove_default_cancel_button
            -- Remove default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_cancel_button: default_cancel_button /= void
        ensure -- from EV_DIALOG
            not_has_default_cancel_button: default_cancel_button = void

    remove_default_push_button
            -- Remove default_push_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_push_button: default_push_button /= void
        ensure -- from EV_DIALOG
            not_has_default_push_button: default_push_button = void

    set_default_cancel_button (a_button: EV_BUTTON)
            -- Assign a_button to default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)
        ensure -- from EV_DIALOG
            default_cancel_button_set: default_cancel_button = a_button

    set_default_push_button (a_button: EV_BUTTON)
            -- Assign a_button to `default push button'.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TITLED_WINDOW
    accelerators_not_void: is_usable implies accelerators /= void
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_MESSAGE_DIALOG


EV_PRINT_DIALOG Chart

class
    EV_PRINT_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision print dialog."
    create: default_create

Ancestors
    EV_STANDARD_DIALOG

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    all_pages_selected: BOOLEAN
    blocking_window: EV_WINDOW
    collate_checked: BOOLEAN
    copies: INTEGER
    data: ANY
    from_page: INTEGER
    height: INTEGER
    is_destroyed: BOOLEAN
    landscape_checked: BOOLEAN
    maximum_to_page: INTEGER
    minimum_from_page: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    output_file_name: STRING
    page_numbers_enabled: BOOLEAN
    page_numbers_selected: BOOLEAN
    print_context: EV_PRINT_CONTEXT
    print_to_file_checked: BOOLEAN
    print_to_file_enabled: BOOLEAN
    print_to_file_shown: BOOLEAN
    printer_name: STRING
    selected_button: STRING
    selection_enabled: BOOLEAN
    selection_selected: BOOLEAN
    title: STRING
    to_page: INTEGER
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    check_collate
    check_print_to_file
    copy (other: [like Current] EV_PRINT_DIALOG)
    default_create
    destroy
    disable_page_numbers
    disable_print_to_file
    disable_selection
    enable_page_numbers
    enable_print_to_file
    enable_selection
    hide_print_to_file
    select_all_pages
    select_page_numbers
    select_selection
    set_copies (value: INTEGER)
    set_data (some_data: [like data] ANY)
    set_from_page (value: INTEGER)
    set_height (a_height: INTEGER)
    set_maximum_to_page (value: INTEGER)
    set_minimum_from_page (value: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_title (a_title: STRING)
    set_to_page (value: INTEGER)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)
    show_print_to_file
    uncheck_collate
    uncheck_print_to_file


EV_PRINT_DIALOG Flat contracts

indexing
    description: "EiffelVision print dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 01:02:25 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_PRINT_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result = implementation.blocking_window

    copies: INTEGER
            -- Number of copies for the Copies edit control.
        require
            not_destroyed: not is_destroyed
        ensure
            positive_result: Result >= 0

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    from_page: INTEGER
            -- Value for the starting page edit control.
        require
            not_destroyed: not is_destroyed
        ensure
            positive_result: Result >= 0

    maximum_to_page: INTEGER
            -- Maximum value for the page specified
            -- in the To page edit controls.
            -- 1 by default.
        require
            not_destroyed: not is_destroyed
        ensure
            positive_result: Result >= 0

    minimum_from_page: INTEGER
            -- Minimum value for the page specified
            -- in the From page edit controls.
            -- 1 by default.
        require
            not_destroyed: not is_destroyed
        ensure
            positive_result: Result >= 0

    output_file_name: STRING
            -- String representation of the path to output
            -- the printed area to.
        require
            not_destroyed: not is_destroyed
        ensure
            result_not_void: Result /= void

    printer_name: STRING
            -- String representation of the printer to output
            -- the printed area to.
        require
            not_destroyed: not is_destroyed
        ensure
            result_not_void: Result /= void

    title: STRING
            -- Title of Current displayed in title bar.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result.is_equal (implementation.title)

    to_page: INTEGER
            -- Value for the ending page edit control.
        require
            not_destroyed: not is_destroyed
        ensure
            positive_result: Result >= 0

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    all_pages_selected: BOOLEAN
            -- Is the "All pages" radio button selected?
        require
            not_destroyed: not is_destroyed

    collate_checked: BOOLEAN
            -- Is the "Collate" check box checked?
        require
            not_destroyed: not is_destroyed

    landscape_checked: BOOLEAN
            -- Is the landscape option selected.
        require
            not_destroyed: not is_destroyed

    page_numbers_enabled: BOOLEAN
            -- Is the "Range" radio button enabled?
        require
            not_destroyed: not is_destroyed

    page_numbers_selected: BOOLEAN
            -- Is the "Range" radio button selected?
        require
            not_destroyed: not is_destroyed

    print_context: EV_PRINT_CONTEXT
            -- Return a print context for the dialog box.
        require
            not_destroyed: not is_destroyed

    print_to_file_checked: BOOLEAN
            -- Is the "File" radio button checked?
        require
            not_destroyed: not is_destroyed

    print_to_file_enabled: BOOLEAN
            -- Is the "File" radio button enabled?
        require
            not_destroyed: not is_destroyed

    print_to_file_shown: BOOLEAN
            -- Is the "File" radio button visible?
        require
            not_destroyed: not is_destroyed

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

    selection_enabled: BOOLEAN
            -- Is the "Selection" radio button selected?
        require
            not_destroyed: not is_destroyed

    selection_selected: BOOLEAN
            -- Is the "Selection" radio button selected?
        require
            not_destroyed: not is_destroyed

feature -- Status setting

    check_collate
            -- Check the "Collate" check box.
        require
            not_destroyed: not is_destroyed
        ensure
            collate_checked: collate_checked

    check_print_to_file
            -- Check the "Print to file" check box.
        require
            not_destroyed: not is_destroyed
        ensure
            print_to_file_checked: print_to_file_checked

    disable_page_numbers
            -- Disable the "Range" radio button.
        require
            not_destroyed: not is_destroyed

    disable_print_to_file
            -- Disable the "Print to file" check box.
        require
            not_destroyed: not is_destroyed

    disable_selection
            -- Disable the "Selection" radio button.
        require
            not_destroyed: not is_destroyed

    enable_page_numbers
            -- Enable the "Range" radio button.
        require
            not_destroyed: not is_destroyed

    enable_print_to_file
            -- Enable the "Print to file" check box.
        require
            not_destroyed: not is_destroyed

    enable_selection
            -- Enable the "Selection" radio button.
        require
            not_destroyed: not is_destroyed

    hide_print_to_file
            -- Hide the "Print to file" check box.
        require
            not_destroyed: not is_destroyed

    select_all_pages
            -- Select the "All pages" radio button.
            -- Selected by default.
        require
            not_destroyed: not is_destroyed

    select_page_numbers
            -- Select the "Page numbers" radio button.
            -- By default, the "All pages" button is selected.
        require
            not_destroyed: not is_destroyed

    select_selection
            -- Select the "Selection" radio button.
            -- By default, the "All pages" button is selected.
        require
            not_destroyed: not is_destroyed

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_STANDARD_DIALOG
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
            -- (from EV_STANDARD_DIALOG)
        require -- from EV_STANDARD_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

    show_print_to_file
            -- Show the "Print to file" check box.
        require
            not_destroyed: not is_destroyed

    uncheck_collate
            -- Uncheck the "Collate" check box.
        require
            not_destroyed: not is_destroyed
        ensure
            colate_not_checked: not collate_checked

    uncheck_print_to_file
            -- Check the "Print to file" check box.
        require
            not_destroyed: not is_destroyed
        ensure
            print_to_file_not_checked: not print_to_file_checked

feature -- Element change

    set_copies (value: INTEGER)
            -- Make value the new copies number.
        require
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure
            copies_set: copies = value

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_from_page (value: INTEGER)
            -- Make value the new from_page number.
        require
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure
            from_page_set: from_page = value

    set_maximum_to_page (value: INTEGER)
            -- Make value the new maximum "to_page" value.
        require
            not_destroyed: not is_destroyed
            positive_value: value > 0
            not_less_than_minimum: value >= minimum_from_page
        ensure
            maximum_to_page_set: maximum_to_page = value

    set_minimum_from_page (value: INTEGER)
            -- Make value the new minimum "from_page" value.
        require
            not_destroyed: not is_destroyed
            positive_value: value > 0
            not_greater_than_maximum_value: value <= maximum_to_page
        ensure
            minimum_from_page_set: minimum_from_page = value

    set_to_page (value: INTEGER)
            -- Make value the new to_page number.
        require
            not_destroyed: not is_destroyed
            positive_value: value >= 0
        ensure
            to_page_set: to_page = value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_STANDARD_DIALOG
    title_not_void: is_usable implies title /= void
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_PRINT_DIALOG


EV_QUESTION_DIALOG Chart

class
    EV_QUESTION_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision question dialog."
    create: make_with_text, make_with_text_and_actions, default_create

Ancestors
    EV_MESSAGE_DIALOG

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    button (a_text: STRING): EV_BUTTON
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    default_cancel_button: EV_BUTTON
    default_push_button: EV_BUTTON
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_button (a_text: STRING): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_button: STRING
    target_name: STRING
    text: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_QUESTION_DIALOG)
    default_create
    destroy
    dialog_key_press_action (a_key: EV_KEY)
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_default_cancel_button
    remove_default_push_button
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_pixmap
    remove_text
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: EV_COLOR)
    set_buttons (button_labels: ARRAY [STRING])
    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
    set_data (some_data: [like data] ANY)
    set_default_cancel_button (a_button: EV_BUTTON)
    set_default_colors
    set_default_push_button (a_button: EV_BUTTON)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    show_modal_to_window (a_window: EV_WINDOW)
    show_relative_to_window (a_window: EV_WINDOW)
    unlock_update
    wipe_out


EV_QUESTION_DIALOG Flat contracts

indexing
    description: "EiffelVision question dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_QUESTION_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void

    make_with_text_and_actions (a_text: STRING; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create Current, assign a_text to text and actions to select_actions
            -- of buttons.
            -- (actions are added to buttons in order.)
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void
            actions_not_void: actions /= void
            actions_not_empty: actions.count > 0

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Background color of Current.
            -- (from EV_MESSAGE_DIALOG)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    default_cancel_button: EV_BUTTON
            -- Default cancel button. This is the button that
            -- is pushed if the user press the escape key or
            -- close the window using the close icon.
            -- If there is no default cancel button, the close
            -- icon is disabled.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    default_push_button: EV_BUTTON
            -- Default pushed button. This is the button that
            -- is pushed if the user press the enter key unless
            -- a push button is currently focused.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Foreground color of Current.
            -- (from EV_MESSAGE_DIALOG)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_modal: BOOLEAN
            -- Must Current be closed before application can
            -- receive user events again?
            -- (from EV_DIALOG)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Icon displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Message displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    button (a_text: STRING): EV_BUTTON
            -- Button that has a_text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            has_button_with_a_text: has_button (a_text)
        ensure -- from EV_MESSAGE_DIALOG
            not_void: Result /= void

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_button (a_text: STRING): BOOLEAN
            -- Does Current contain a button with text a_text?
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_minimized

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_MESSAGE_DIALOG)

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_pixmap
            -- Assign Void to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_void: pixmap = void

    remove_text
            -- Assign Void to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            text_void: text = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_background_color (a_color: EV_COLOR)
            -- Assign a_color to background_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_buttons (button_labels: ARRAY [STRING])
            -- Assign new buttons with button_labels to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0

    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Assign new buttons with button_labels and actions to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            actions_not_void: actions /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0
            enough_actions_for_labels: actions.count >= button_labels.count

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_assigned: pixmap.is_equal (a_pixmap)

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_MESSAGE_DIALOG
            assigned: text.is_equal (a_text)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure -- from EV_TITLED_WINDOW
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure -- from EV_TITLED_WINDOW
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    dialog_key_press_action (a_key: EV_KEY)
            -- The action performed to process default push and cancel
            -- buttons. This is inserted in key_press_actions and
            -- behaves is follows:
            -- If escape is pressed at any time then
            -- If there is a default_cancel_button then
            -- If it is sensitive, call its select_actions,
            -- otherwise, close the dialog.
            -- If there is no default_cancel_button, do nothing.
            -- If enter is pressed at any time then
            -- If a push button is currently focused then call its
            -- select_actions. If no push button has the focus, then
            -- call the select_actions of the default push button if
            -- it is sensitive.
            -- (from EV_DIALOG)

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show and wait until Current is closed.
            -- Current is shown modal with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            dialog_modeless: not is_modal
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

    show_relative_to_window (a_window: EV_WINDOW)
            -- Show Current with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- Status Setting

    remove_default_cancel_button
            -- Remove default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_cancel_button: default_cancel_button /= void
        ensure -- from EV_DIALOG
            not_has_default_cancel_button: default_cancel_button = void

    remove_default_push_button
            -- Remove default_push_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_push_button: default_push_button /= void
        ensure -- from EV_DIALOG
            not_has_default_push_button: default_push_button = void

    set_default_cancel_button (a_button: EV_BUTTON)
            -- Assign a_button to default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)
        ensure -- from EV_DIALOG
            default_cancel_button_set: default_cancel_button = a_button

    set_default_push_button (a_button: EV_BUTTON)
            -- Assign a_button to `default push button'.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TITLED_WINDOW
    accelerators_not_void: is_usable implies accelerators /= void
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_QUESTION_DIALOG


EV_STANDARD_DIALOG Chart

deferred class
    EV_STANDARD_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision standard dialog."
    keywords: "modal, ok, cancel"

Ancestors
    EV_ANY
    EV_POSITIONABLE
    EV_STANDARD_DIALOG_ACTION_SEQUENCES

Action sequences
    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
    ok_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    blocking_window: EV_WINDOW
    data: ANY
    height: INTEGER
    is_destroyed: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    selected_button: STRING
    title: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    copy (other: [like Current] EV_STANDARD_DIALOG)
    default_create
    destroy
    set_data (some_data: [like data] ANY)
    set_height (a_height: INTEGER)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show_modal_to_window (a_window: EV_WINDOW)

Constraints
    title not void


EV_STANDARD_DIALOG Flat contracts

indexing
    description: "EiffelVision standard dialog."
    status: "See notice at end of class"
    keywords: "modal, ok, cancel"
    date: "$Date: 2001/07/14 01:02:25 $"
    revision: "$Revision: 1.2 $"

deferred class interface
    EV_STANDARD_DIALOG

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    blocking_window: EV_WINDOW
            -- Window Current is a transient for.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.blocking_window

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    title: STRING
            -- Title of Current displayed in title bar.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.title)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    selected_button: STRING
            -- Label of last clicked button.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result /= void implies Result.is_equal (implementation.selected_button)

feature -- Status setting

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_title (a_title: STRING)
            -- Assign a_title to title.
        require
            not_destroyed: not is_destroyed
        ensure
            assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show Current modal with respect to a_window.
        require
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            dialog_modeless: blocking_window = void

feature -- Element change

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    cancel_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user cancels.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

    ok_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when user clicks OK.
            -- (from EV_STANDARD_DIALOG_ACTION_SEQUENCES)
        ensure -- from EV_STANDARD_DIALOG_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    title_not_void: is_usable implies title /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_STANDARD_DIALOG


EV_WARNING_DIALOG Chart

class
    EV_WARNING_DIALOG

General
    cluster: vision2.interface.widgets.dialogs
    description: "EiffelVision warning dialog."
    create: make_with_text, make_with_text_and_actions, default_create

Ancestors
    EV_MESSAGE_DIALOG

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    show_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accelerators: EV_ACCELERATOR_LIST
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    button (a_text: STRING): EV_BUTTON
    client_height: INTEGER
    client_width: INTEGER
    count: INTEGER
    data: ANY
    default_cancel_button: EV_BUTTON
    default_push_button: EV_BUTTON
    deny_cursor: EV_CURSOR
    extendible: BOOLEAN
    foreground_color: EV_COLOR
    full: BOOLEAN
    has (v: EV_WIDGET): BOOLEAN
    has_button (a_text: STRING): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursive (an_item: [like item] EV_WIDGET): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    icon_name: STRING
    icon_pixmap: EV_PIXMAP
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_inserted (v: EV_WIDGET): BOOLEAN
    is_maximized: BOOLEAN
    is_minimized: BOOLEAN
    is_modal: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    item: EV_WIDGET
    linear_representation: LINEAR [[like item] EV_WIDGET]
    lower_bar: EV_VERTICAL_BOX
    maximum_height: INTEGER
    maximum_width: INTEGER
    menu_bar: EV_MENU_BAR
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_button: STRING
    target_name: STRING
    text: STRING
    title: STRING
    upper_bar: EV_VERTICAL_BOX
    user_can_resize: BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_WARNING_DIALOG)
    default_create
    destroy
    dialog_key_press_action (a_key: EV_KEY)
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    disable_user_resize
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    enable_user_resize
    extend (v: [like item] EV_WIDGET)
    fill (other: CONTAINER [EV_WIDGET])
    hide
    lock_update
    lower
    maximize
    merge_radio_button_groups (other: EV_CONTAINER)
    minimize
    propagate_background_color
    propagate_foreground_color
    prune (v: EV_WIDGET)
    prune_all (v: EV_WIDGET)
    put (v: [like item] EV_WIDGET)
    raise
    remove_default_cancel_button
    remove_default_push_button
    remove_help_context
    remove_icon_name
    remove_menu_bar
    remove_pebble
    remove_pixmap
    remove_text
    remove_title
    replace (v: [like item] EV_WIDGET)
    restore
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: EV_COLOR)
    set_buttons (button_labels: ARRAY [STRING])
    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
    set_data (some_data: [like data] ANY)
    set_default_cancel_button (a_button: EV_BUTTON)
    set_default_colors
    set_default_push_button (a_button: EV_BUTTON)
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: EV_COLOR)
    set_height (a_height: INTEGER)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_icon_name (an_icon_name: STRING)
    set_icon_pixmap (an_icon: EV_PIXMAP)
    set_maximum_height (a_maximum_height: INTEGER)
    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
    set_maximum_width (a_maximum_width: INTEGER)
    set_menu_bar (a_menu_bar: EV_MENU_BAR)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_position (a_x, a_y: INTEGER)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_title (a_title: STRING)
    set_width (a_width: INTEGER)
    set_x_position (a_x: INTEGER)
    set_y_position (a_y: INTEGER)
    show
    show_modal_to_window (a_window: EV_WINDOW)
    show_relative_to_window (a_window: EV_WINDOW)
    unlock_update
    wipe_out


EV_WARNING_DIALOG Flat contracts

indexing
    description: "EiffelVision warning dialog."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_WARNING_DIALOG

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void

    make_with_text_and_actions (a_text: STRING; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Create Current, assign a_text to text and actions to select_actions
            -- of buttons.
            -- (actions are added to buttons in order.)
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            a_text_not_void: a_text /= void
            actions_not_void: actions /= void
            actions_not_empty: actions.count > 0

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accelerators: EV_ACCELERATOR_LIST
            -- Key combination shortcuts associated with this window.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Background color of Current.
            -- (from EV_MESSAGE_DIALOG)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    default_cancel_button: EV_BUTTON
            -- Default cancel button. This is the button that
            -- is pushed if the user press the escape key or
            -- close the window using the close icon.
            -- If there is no default cancel button, the close
            -- icon is disabled.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    default_push_button: EV_BUTTON
            -- Default pushed button. This is the button that
            -- is pushed if the user press the enter key unless
            -- a push button is currently focused.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Foreground color of Current.
            -- (from EV_MESSAGE_DIALOG)

    has_recursive (an_item: like item): BOOLEAN
            -- Does structure include an_item or
            -- does any structure recursively included by structure,
            -- include an_item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    icon_name: STRING
            -- Alternative name, displayed when window is minimised.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: equal (Result, implementation.icon_name)

    icon_pixmap: EV_PIXMAP
            -- Window icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result.is_equal (implementation.icon_pixmap)

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_modal: BOOLEAN
            -- Must Current be closed before application can
            -- receive user events again?
            -- (from EV_DIALOG)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_WIDGET
            -- Current item.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            readable: readable
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.item

    lower_bar: EV_VERTICAL_BOX
            -- Room at bottom of window. (Example use: statusbar.)
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.lower_bar

    maximum_height: INTEGER
            -- Upper bound on height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_height) or (Result = implementation.minimum_height)

    maximum_width: INTEGER
            -- Upper bound on width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: (Result = implementation.internal_maximum_width) or (Result = implementation.minimum_width)

    menu_bar: EV_MENU_BAR
            -- Horizontal bar at top of client area that contains menu's.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.menu_bar

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Icon displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Message displayed by Current.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed

    title: STRING
            -- A textual name used by the window manager.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: equal (Result, implementation.title)

    upper_bar: EV_VERTICAL_BOX
            -- Room at top of window. (Example use: toolbars.)
            -- Positioned below menu bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.upper_bar

feature -- Measurement

    client_height: INTEGER
            -- Height of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_height

    client_width: INTEGER
            -- Width of the area available to children in pixels.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            bridge_ok: Result = implementation.client_width

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    button (a_text: STRING): EV_BUTTON
            -- Button that has a_text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            has_button_with_a_text: has_button (a_text)
        ensure -- from EV_MESSAGE_DIALOG
            not_void: Result /= void

    count: INTEGER
            -- Number of items in Current.
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure then -- from EV_CELL
            valid_result: Result = 0 or Result = 1

    extendible: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of is_empty.
            -- (from EV_CELL)

    full: BOOLEAN
            -- Is structure filled to capacity?
            -- (from EV_CELL)

    has (v: EV_WIDGET): BOOLEAN
            -- Does structure include v?
            -- (from EV_WINDOW)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    has_button (a_text: STRING): BOOLEAN
            -- Does Current contain a button with text a_text?
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is there no element?
            -- Was declared in EV_CELL as synonym of extendible.
            -- (from EV_CELL)

    is_inserted (v: EV_WIDGET): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_maximized: BOOLEAN
            -- Is displayed at maximum size?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_maximized

    is_minimized: BOOLEAN
            -- Is displayed iconified/minimised?
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            bridge_ok: Result = implementation.is_minimized

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    prunable: BOOLEAN
            -- May items be removed?
            -- (from EV_CELL)

    readable: BOOLEAN
            -- Is there a current item that may be accessed?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

    selected_button: STRING
            -- Label of last clicked button.
            -- (from EV_MESSAGE_DIALOG)

    user_can_resize: BOOLEAN
            -- Can the user resize?
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            bridge_ok: Result = implementation.user_can_resize

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from EV_CELL)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    disable_user_resize
            -- Prevent user from resizing.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            not_user_can_resize: not user_can_resize

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    enable_user_resize
            -- Allow user to resize.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            user_can_resize: user_can_resize

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    lock_update
            -- Lock drawing updates for this window on certain platforms until
            -- unlock_update is called.
            --
            -- Note: - Only one window can be locked at a time.
            --       - The window cannot be moved while update is locked.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)
        ensure -- from EV_WINDOW
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current

    lower
            -- Request that window be displayed below all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    maximize
            -- Display at maximum size.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            is_maximized: is_maximized

    merge_radio_button_groups (other: EV_CONTAINER)
            -- Merge Current radio button group with that of other.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            other_not_void: other /= void

    minimize
            -- Display iconified/minimised.
            -- It is not possible to guarantee this on some
            -- platform configurations.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    raise
            -- Request that window be displayed above all other windows.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed

    remove_menu_bar
            -- Make menu_bar Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            void: menu_bar = void

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_pixmap
            -- Assign Void to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_void: pixmap = void

    remove_text
            -- Assign Void to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
        ensure -- from EV_MESSAGE_DIALOG
            text_void: text = void

    remove_title
            -- Make title Void.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_WINDOW
            a_title_removed: title = void

    restore
            -- Restore to original position when minimized or maximized.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            minimize_restored: old is_minimized implies not is_minimized
            maximize_restored: old is_maximized implies not is_maximized

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_background_color (a_color: EV_COLOR)
            -- Assign a_color to background_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_buttons (button_labels: ARRAY [STRING])
            -- Assign new buttons with button_labels to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0

    set_buttons_and_actions (button_labels: ARRAY [STRING]; actions: ARRAY [PROCEDURE [ANY, TUPLE]])
            -- Assign new buttons with button_labels and actions to buttons.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            button_labels_not_void: button_labels /= void
            actions_not_void: actions /= void
            all_button_labels_items_not_void: button_labels.occurrences (void) = 0
            enough_actions_for_labels: actions.count >= button_labels.count

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_foreground_color (a_color: EV_COLOR)
            -- Assign a_color to foreground_color.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_height (a_height: INTEGER)
            -- Assign a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            height_assigned: height = minimum_height or else height = a_height

    set_maximum_height (a_maximum_height: INTEGER)
            -- Assign a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_height_non_negative: a_maximum_height >= 0
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_size (a_maximum_width, a_maximum_height: INTEGER)
            -- Assign a_maximum_width to maximum_width
            -- and a_maximum_height to maximum_height in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
            a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width
            maximum_height_assigned: maximum_height = a_maximum_height

    set_maximum_width (a_maximum_width: INTEGER)
            -- Assign a_maximum_width to maximum_width in pixels.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_maximum_width_non_negative: a_maximum_width >= 0
            a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
        ensure -- from EV_WINDOW
            maximum_width_assigned: maximum_width = a_maximum_width

    set_menu_bar (a_menu_bar: EV_MENU_BAR)
            -- Assign a_menu_bar to menu_bar.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            no_menu_bar_assigned: menu_bar = void
            a_menu_bar_not_void: a_menu_bar /= void
        ensure -- from EV_WINDOW
            assigned: menu_bar = a_menu_bar

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_MESSAGE_DIALOG
            pixmap_assigned: pixmap.is_equal (a_pixmap)

    set_position (a_x, a_y: INTEGER)
            -- Assign a_x to x_position and a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x
            y_position_assigned: y_position = a_y

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width to width and a_height to height in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width
            height_assigned: height = minimum_height or else height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_MESSAGE_DIALOG)
        require -- from EV_MESSAGE_DIALOG
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_MESSAGE_DIALOG
            assigned: text.is_equal (a_text)

    set_title (a_title: STRING)
            -- Assign a_title to title.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            a_title_not_void: a_title /= void
            a_title_not_empty: not a_title.is_empty
        ensure -- from EV_WINDOW
            a_title_assigned: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Assign a_width to width in pixels.
            -- (from EV_POSITIONABLE)
        require -- from EV_POSITIONABLE
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_POSITIONABLE
            width_assigned: width = minimum_width or else width = a_width

    set_x_position (a_x: INTEGER)
            -- Assign a_x to x_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            x_position_assigned: x_position = a_x

    set_y_position (a_y: INTEGER)
            -- Assign a_y to y_position in pixels.
            -- (from EV_POSITIONABLE)
        ensure -- from EV_POSITIONABLE
            y_position_assigned: y_position = a_y

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    unlock_update
            -- Unlock updates for this widget on certain platforms.
            -- (from EV_WINDOW)
        require -- from EV_WINDOW
            not_destroyed: not is_destroyed
            locked_window_is_current: (create {EV_ENVIRONMENT}).application.locked_window = Current
        ensure -- from EV_WINDOW
            no_locked_window: ((create {EV_ENVIRONMENT}).application.locked_window = void)

feature -- Element change

    extend (v: like item)
            -- Ensure that structure includes v.
            -- Do not move cursor.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    fill (other: CONTAINER [EV_WIDGET])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    put (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of replace.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_icon_name
            -- Make icon_name Void.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
        ensure -- from EV_TITLED_WINDOW
            icon_name_removed: icon_name = void

    replace (v: like item)
            -- Replace item with v.
            -- Was declared in EV_CONTAINER as synonym of put.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: v /= Current
            v_not_parent_of_current: not is_parent_recursive (v)
            v_not_window: not v.conforms_to (create {EV_WINDOW})
        ensure -- from EV_CONTAINER
            has_v: has (v)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_icon_name (an_icon_name: STRING)
            -- Assign an_icon_name to icon_name.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            an_icon_name_not_void: an_icon_name /= void
            an_icon_name_not_empty: not an_icon_name.is_empty
        ensure -- from EV_TITLED_WINDOW
            icon_name_assigned: icon_name.is_equal (an_icon_name)

    set_icon_pixmap (an_icon: EV_PIXMAP)
            -- Assign an_icon to icon.
            -- (from EV_TITLED_WINDOW)
        require -- from EV_TITLED_WINDOW
            not_destroyed: not is_destroyed
            pixmap_not_void: an_icon /= void
        ensure -- from EV_TITLED_WINDOW
            icon_pixmap_assigned: icon_pixmap.is_equal (an_icon)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Removal

    prune (v: EV_WIDGET)
            -- Remove v if contained.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from EV_CELL
            not has (v)

    prune_all (v: EV_WIDGET)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove item.
            -- (from EV_CELL)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [like item]
            -- Representation as a linear structure
            -- (from EV_CELL)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    dialog_key_press_action (a_key: EV_KEY)
            -- The action performed to process default push and cancel
            -- buttons. This is inserted in key_press_actions and
            -- behaves is follows:
            -- If escape is pressed at any time then
            -- If there is a default_cancel_button then
            -- If it is sensitive, call its select_actions,
            -- otherwise, close the dialog.
            -- If there is no default_cancel_button, do nothing.
            -- If enter is pressed at any time then
            -- If a push button is currently focused then call its
            -- select_actions. If no push button has the focus, then
            -- call the select_actions of the default push button if
            -- it is sensitive.
            -- (from EV_DIALOG)

    propagate_background_color
            -- Propagate background_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            background_color_propagated: background_color_propagated

    propagate_foreground_color
            -- Propagate foreground_color to all children.
            -- (from EV_CONTAINER)
        require -- from EV_CONTAINER
            not_destroyed: not is_destroyed
        ensure -- from EV_CONTAINER
            foreground_color_propagated: foreground_color_propagated

    show_modal_to_window (a_window: EV_WINDOW)
            -- Show and wait until Current is closed.
            -- Current is shown modal with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            dialog_modeless: not is_modal
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

    show_relative_to_window (a_window: EV_WINDOW)
            -- Show Current with respect to a_window.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    move_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when window moves.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    show_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when window is shown.
            -- (from EV_WINDOW_ACTION_SEQUENCES)
        ensure -- from EV_WINDOW_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

feature -- Status Setting

    remove_default_cancel_button
            -- Remove default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_cancel_button: default_cancel_button /= void
        ensure -- from EV_DIALOG
            not_has_default_cancel_button: default_cancel_button = void

    remove_default_push_button
            -- Remove default_push_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            has_default_push_button: default_push_button /= void
        ensure -- from EV_DIALOG
            not_has_default_push_button: default_push_button = void

    set_default_cancel_button (a_button: EV_BUTTON)
            -- Assign a_button to default_cancel_button.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)
        ensure -- from EV_DIALOG
            default_cancel_button_set: default_cancel_button = a_button

    set_default_push_button (a_button: EV_BUTTON)
            -- Assign a_button to `default push button'.
            -- (from EV_DIALOG)
        require -- from EV_DIALOG
            not_destroyed: not is_destroyed
            a_button_not_void: a_button /= void
            has_button: has_recursive (a_button)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TITLED_WINDOW
    accelerators_not_void: is_usable implies accelerators /= void
        -- from EV_WINDOW
    consistent_horizontal_bounds: maximum_width >= minimum_width
    consistent_vertical_bounds: maximum_height >= minimum_height
    upper_bar_not_void: is_usable implies upper_bar /= void
    lower_bar_not_void: is_usable implies lower_bar /= void
        -- from EV_CONTAINER
    client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
    client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
    all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_WARNING_DIALOG


EV_WIDGET Chart

deferred class
    EV_WIDGET

General
    cluster: vision2.interface.widgets
    description:
        "Base class for all widgets.
        Facilities for geometry management and user input."
    keywords: "widget, component, control"

Ancestors
    EV_COLORIZABLE
    EV_CONTAINABLE
    EV_HELP_CONTEXTABLE
    EV_PICK_AND_DROPABLE
    EV_POSITIONED
    EV_SENSITIVE
    EV_WIDGET_ACTION_SEQUENCES

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_WIDGET)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    show

Constraints
    pointer position not void
    is displayed implies show requested
    parent contains current


EV_WIDGET Flat contracts

indexing
    description: "Base class for all widgets.Facilities for geometry management and user input."
    status: "See notice at end of class"
    keywords: "widget, component, control"
    date: "$Date: 2001/07/14 11:02:40 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_WIDGET

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
        require
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
        require
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
        require
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
        require
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
        require
            not_destroyed: not is_destroyed
        ensure
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
        require
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
        require
            not_destroyed: not is_destroyed
        ensure
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
        require
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
        require
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
        require
            not_destroyed: not is_destroyed
        ensure
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
        require
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
        require
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
        require
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
        require
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_WIDGET


cluster vision2.interface.widgets.primitives

Cluster
    vision2.interface.widgets.primitives

Supercluster
    vision2.interface.widgets

Subclusters

Classes
    EV_BUTTON
    EV_CHECK_BUTTON
    EV_COMBO_BOX
    EV_DRAWING_AREA
    EV_GAUGE
    EV_HORIZONTAL_PROGRESS_BAR
    EV_HORIZONTAL_RANGE
    EV_HORIZONTAL_SCROLL_BAR
    EV_HORIZONTAL_SEPARATOR
    EV_LABEL
    EV_LIST
    EV_LIST_ITEM_LIST
    EV_MULTI_COLUMN_LIST
    EV_OPTION_BUTTON
    EV_PASSWORD_FIELD
    EV_PIXMAP
    EV_PRIMITIVE
    EV_PROGRESS_BAR
    EV_RADIO_BUTTON
    EV_RANGE
    EV_SCROLL_BAR
    EV_SELECT_BUTTON
    EV_SEPARATOR
    EV_SPIN_BUTTON
    EV_TEXT
    EV_TEXT_COMPONENT
    EV_TEXT_FIELD
    EV_TOGGLE_BUTTON
    EV_TOOL_BAR
    EV_TREE
    EV_VERTICAL_PROGRESS_BAR
    EV_VERTICAL_RANGE
    EV_VERTICAL_SCROLL_BAR
    EV_VERTICAL_SEPARATOR


EV_BUTTON Chart

class
    EV_BUTTON

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Push button widget that displays text and/or a pixmap.
        (Also base class for other button widgets)"
    keywords: "press, push, label, pixmap"
    create: make_with_text, make_with_text_and_action, default_create

Ancestors
    EV_BUTTON_ACTION_SEQUENCES
    EV_PIXMAPABLE
    EV_PRIMITIVE
    EV_TEXTABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    text: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_BUTTON)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_BUTTON Flat contracts

indexing
    description: "Push button widget that displays text and/or a pixmap.(Also base class for other button widgets)"
    appearance: " ------------ |   `text'   | ============"
    status: "See notice at end of class"
    keywords: "press, push, label, pixmap"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_text_and_action (a_text: STRING; an_action: PROCEDURE [ANY, TUPLE])
            -- Create with 'a_text' as text and an_action in select_actions.
        require
            text_not_void: a_text /= void
            an_action_not_void: an_action /= void
        ensure
            text_assigned: text.is_equal (a_text)
            select_actions_has_an_action: select_actions.has (an_action)

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_BUTTON


EV_CHECK_BUTTON Chart

class
    EV_CHECK_BUTTON

General
    cluster: vision2.interface.widgets.primitives
    description: "Toggle button with state displayed as a check box."
    keywords: "toggle, check, tick, button, box"
    create: make_with_text, default_create

Ancestors
    EV_TOGGLE_BUTTON

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    text: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_CHECK_BUTTON)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_select
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_select
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    toggle


EV_CHECK_BUTTON Flat contracts

indexing
    description: "Toggle button with state displayed as a check box."
    appearance: " [X] `text' "
    status: "See notice at end of class"
    keywords: "toggle, check, tick, button, box"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_CHECK_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected

end -- class EV_CHECK_BUTTON


EV_COMBO_BOX Chart

class
    EV_COMBO_BOX

General
    cluster: vision2.interface.widgets.primitives
    description: "A text field with a button. When the button is pressed, a list oftext strings is displayed. Selecting one causes it to be copied intothe text field."
    keywords: "combo, box, button, option, menu"
    create: make_with_text, make_with_strings, default_create

Ancestors
    EV_LIST_ITEM_LIST
    EV_TEXT_FIELD

Action sequences
    change_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    return_actions: EV_NOTIFY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_LIST_ITEM
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    capacity: INTEGER
    caret_position: INTEGER
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_LIST_ITEM]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_LIST_ITEM
    for_all (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_LIST_ITEM): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_selection: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_LIST_ITEM
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_LIST_ITEM; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_editable: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_COMBO_BOX): BOOLEAN
    is_inserted (v: EV_LIST_ITEM): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_LIST_ITEM
    item_by_data (some_data: ANY): [like item] EV_LIST_ITEM
    last: [like item] EV_LIST_ITEM
    linear_representation: LINEAR [EV_LIST_ITEM]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_LIST_ITEM): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmaps_height: INTEGER
    pixmaps_width: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_item: EV_LIST_ITEM
    selected_text: STRING
    selection_end: INTEGER
    selection_start: INTEGER
    sequential_occurrences (v: EV_LIST_ITEM): INTEGER
    strings: LINKED_LIST [STRING]
    target_name: STRING
    text: STRING
    text_length: INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
    tooltip: STRING
    valid_caret_position (pos: INTEGER): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_LIST_ITEM])
    append_text (a_text: STRING)
    back
    center_pointer
    compare_objects
    compare_references
    copy (other: [like Current] EV_COMBO_BOX)
    copy_selection
    cut_selection
    default_create
    delete_selection
    deselect_all
    destroy
    disable_capture
    disable_edit
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN])
    enable_capture
    enable_edit
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_LIST_ITEM)
    fill (other: CONTAINER [EV_LIST_ITEM])
    finish
    force (v: [like item] EV_LIST_ITEM)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    insert_text (a_text: STRING)
    merge_left (other: [like Current] EV_COMBO_BOX)
    merge_right (other: [like Current] EV_COMBO_BOX)
    move (i: INTEGER)
    paste (a_position: INTEGER)
    prepend_text (a_text: STRING)
    prune (v: [like item] EV_LIST_ITEM)
    prune_all (v: [like item] EV_LIST_ITEM)
    put (v: [like item] EV_LIST_ITEM)
    put_front (v: [like item] EV_LIST_ITEM)
    put_i_th (v: [like item] EV_LIST_ITEM; i: INTEGER)
    put_left (v: [like item] EV_LIST_ITEM)
    put_right (v: [like item] EV_LIST_ITEM)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    remove_selection
    remove_text
    remove_tooltip
    replace (v: [like item] EV_LIST_ITEM)
    search (v: [like item] EV_LIST_ITEM)
    select_all
    select_region (start_pos, end_pos: INTEGER)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_capacity (a_capacity: INTEGER)
    set_caret_position (a_caret_position: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_minimum_width_in_characters (nb: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmaps_size (a_width, a_height: INTEGER)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_strings (a_string_array: INDEXABLE [STRING, INTEGER])
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_COMBO_BOX Flat contracts

indexing
    description: "A text field with a button. When the button is pressed, a list oftext strings is displayed. Selecting one causes it to be copied intothe text field."
    appearance: "+-----------+-+| `text'    |V|+-----------+-+ |`first'     | | ...        | |`last'      | +------------+"
    status: "See notice at end of class"
    keywords: "combo, box, button, option, menu"
    date: "$Date: 2001/07/14 11:02:45 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_COMBO_BOX

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_strings (a_string_array: INDEXABLE [STRING, INTEGER])
            -- Create with an item for each of a_string_array.
            -- (from EV_LIST_ITEM_LIST)
        ensure -- from EV_LIST_ITEM_LIST
            items_created: count = strings.count

    make_with_text (a_text: STRING)
            -- Create with a_text.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            a_text_not_void: a_text /= void

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    capacity: INTEGER
            -- Number of characters field can hold.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            not_destroyed: not is_destroyed

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_LIST_ITEM]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_LIST_ITEM
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_LIST_ITEM
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_LIST_ITEM): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmaps_height: INTEGER
            -- Height of pixmaps dispalyed in list.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_height

    pixmaps_width: INTEGER
            -- Width of pixmaps displayed in list.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_width

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_item: EV_LIST_ITEM
            -- Currently selected item.
            -- Topmost selected item if multiple items are selected.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            bridge_ok: Result = implementation.selected_item

    selected_text: STRING
            -- Currently selected text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result.is_equal (implementation.selected_text)

    strings: LINKED_LIST [STRING]
            -- Representation of Current.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            not_void: Result /= void
            same_size: Result.count = count

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text of Current.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    text_length: INTEGER
            -- Number of characters making up text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.text_length

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    caret_position: INTEGER
            -- Current position of caret.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.caret_position

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    has_selection: BOOLEAN
            -- Does current have a selection?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.has_selection

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_editable: BOOLEAN
            -- Is text editable?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.is_editable

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_LIST_ITEM): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    selection_end: INTEGER
            -- Index of last character selected
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_end
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_start: Result >= selection_start

    selection_start: INTEGER
            -- Index of first selected character.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_start
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_end: selection_end >= Result

    valid_caret_position (pos: INTEGER): BOOLEAN
            -- Is pos a valid caret position?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.valid_caret_position (pos)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_edit
            -- Make Current read-only.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: not is_editable

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_edit
            -- Make Current editable.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: is_editable

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_selection
            -- Ensure there is no selected_item.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            not_selected: selected_item = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_caret_position (a_caret_position: INTEGER)
            -- Assign a_caret_posiiton to caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_caret_position: valid_caret_position (a_caret_position)
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            caret_position_assigned: caret_position = a_caret_position

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_strings (a_string_array: INDEXABLE [STRING, INTEGER])
            -- Wipe out and re-initialize with an item
            -- for each of a_string_array.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            items_created: count = strings.count

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_LIST_ITEM])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    append_text (a_text: STRING)
            -- Append a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_appended: check_text_modification (old text, a_text)
            caret_not_moved: old caret_position = caret_position

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_LIST_ITEM])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    insert_text (a_text: STRING)
            -- Insert a_text to right of caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_insert_correctly: text.is_equal ((old text).substring (1, (old caret_position - 1)) + a_text + (old text).substring ((old caret_position), (old text.count)))
            caret_not_moved: old caret_position = caret_position

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    prepend_text (a_text: STRING)
            -- Prepend a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_prepended: text.is_equal (a_text + old text)
            caret_not_moved: old caret_position = caret_position

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_capacity (a_capacity: INTEGER)
            -- Assign a_capacity to capacity.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            not_destroyed: not is_destroyed
            a_capacity_not_negative: a_capacity >= 0

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pixmaps_size (a_width: INTEGER; a_height: INTEGER)
            -- Set the size of pixmaps displayed in Current.
            -- Note: The Default value is 16x16
        require
            not_destroyed: not is_destroyed
            valid_width: a_width > 0
            valid_height: a_height > 0
        ensure
            width_set: pixmaps_width = a_width
            height_set: pixmaps_height = a_height

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
        require
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
            a_text_not_empty: not a_text.is_empty
            combo_box_is_editable: is_editable
        ensure
            text_set: check_text_modification (void, a_text)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Resizing

    set_minimum_width_in_characters (nb: INTEGER)
            -- Make a minimum of nb of the widest character visible
            -- on one line.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_nb: nb > 0
        ensure -- from EV_TEXT_COMPONENT
            minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Conversion

    linear_representation: LINEAR [EV_LIST_ITEM]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Basic operation

    copy_selection
            -- Copy selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            selection_copied: clipboard_content.is_equal (selected_text)
            text_unchanged: text.is_equal (old text)
            caret_not_moved: caret_position = old caret_position

    cut_selection
            -- Move selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            selection_in_clipboard: clipboard_content.is_equal (old selected_text)
            selection_cut: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    delete_selection
            -- Delete current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            has_no_selection: not has_selection
            selection_deleted: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    deselect_all
            -- Unselect the current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            not_has_selection: not has_selection

    paste (a_position: INTEGER)
            -- Insert text from clipboard at a_position.
            -- No effect if clipboard is empty.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            a_position_within_range: a_position >= 1 and a_position <= text_length + 1
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            text_pasted_correctly: text.is_equal ((old text).substring (1, a_position - 1) + clipboard_content + ((old text).substring (a_position, ((old text).count))))
            caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
            caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content.count

    select_all
            -- Select all text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            positive_length: text_length > 0
        ensure -- from EV_TEXT_COMPONENT
            has_selection: has_selection
            selection_start_set: selection_start = 1
            selection_end_set: selection_end = text_length

    select_region (start_pos, end_pos: INTEGER)
            -- Select text between start_pos and end_pos inclusive.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            start_within_range: start_pos >= 1 and start_pos <= text_length
            end_within_range: end_pos >= 1 and end_pos <= text_length
        ensure -- from EV_TEXT_COMPONENT
            has_selection: (start_pos /= end_pos) implies has_selection
            selection_start_set: selection_start = start_pos
            selection_end_set: selection_end = end_pos

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    change_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when text changes.
            -- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is deselected.
            -- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    return_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when return key is pressed.
            -- (from EV_TEXT_FIELD_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_FIELD_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is selected.
            -- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TEXT_FIELD
    capacity_not_negative: capacity >= 0
        -- from EV_TEXT_COMPONENT
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_COMBO_BOX


EV_DRAWING_AREA Chart

class
    EV_DRAWING_AREA

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Widget onto which graphical primatives may be drawn.
        Primitives are drawn directly onto the screen without buffering.(When buffering is required use EV_PIXMAP.)"
    keywords: "drawable, expose, primitive, figure, draw, paint, image"
    create: default_create

Ancestors
    EV_DRAWABLE
    EV_DRAWING_AREA_ACTION_SEQUENCES
    EV_PRIMITIVE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    clip_area: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    data: ANY
    deny_cursor: EV_CURSOR
    drawing_mode: INTEGER
    font: EV_FONT
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    tile: EV_PIXMAP
    tooltip: STRING
    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    clear
    clear_and_redraw
    clear_and_redraw_rectangle (a_x, a_y, a_width, a_height: INTEGER)
    clear_rectangle (x, y, a_width, a_height: INTEGER)
    copy (other: [like Current] EV_DRAWING_AREA)
    default_create
    destroy
    disable_capture
    disable_dashed_line_style
    disable_pebble_positioning
    disable_sensitive
    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
    draw_point (x, y: INTEGER)
    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
    draw_rectangle (x, y, a_width, a_height: INTEGER)
    draw_segment (x1, y1, x2, y2: INTEGER)
    draw_straight_line (x1, y1, x2, y2: INTEGER)
    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
    draw_text (x, y: INTEGER; a_text: STRING)
    draw_text_top_left (x, y: INTEGER; a_text: STRING)
    enable_capture
    enable_dashed_line_style
    enable_pebble_positioning
    enable_sensitive
    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    fill_polygon (points: ARRAY [EV_COORDINATE])
    fill_rectangle (x, y, a_width, a_height: INTEGER)
    flush
    hide
    redraw
    redraw_rectangle (a_x, a_y, a_width, a_height: INTEGER)
    remove_clip_area
    remove_help_context
    remove_pebble
    remove_tile
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_and_mode
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_clip_area (an_area: EV_RECTANGLE)
    set_copy_mode
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_drawing_mode (a_mode: INTEGER)
    set_focus
    set_font (a_font: EV_FONT)
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_invert_mode
    set_line_width (a_width: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_or_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tile (a_pixmap: EV_PIXMAP)
    set_tooltip (a_tooltip: STRING)
    set_xor_mode
    show


EV_DRAWING_AREA Flat contracts

indexing
    description: "Widget onto which graphical primatives may be drawn.Primitives are drawn directly onto the screen without buffering.(When buffering is required use EV_PIXMAP.)"
    status: "See notice at end of class"
    keywords: "drawable, expose, primitive, figure, draw, paint, image"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_DRAWING_AREA

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    clip_area: EV_RECTANGLE
            -- Rectangular area to apply clipping on.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.clip_area = void)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.dashed_line_style

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    drawing_mode: INTEGER
            -- Logical operation on pixels when drawing.
            -- Default: drawing_mode_copy.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.drawing_mode

    font: EV_FONT
            -- Typeface appearance for Current.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_FONTABLE
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    line_width: INTEGER
            -- Line thickness. Default: 1.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.line_width

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tile: EV_PIXMAP
            -- Pixmap that is used to draw filled primitives with
            -- instead of foreground_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.tile = void)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_disabled: not dashed_line_style

    enable_dashed_line_style
            -- Draw lines dashed.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_enabled: dashed_line_style

    remove_clip_area
            -- Do not apply any clipping.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            clip_area_void: clip_area = void

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tile
            -- Do not apply a tile when filling.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            tile_void: tile = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_clip_area (an_area: EV_RECTANGLE)
            -- Set area which will be refreshed.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            an_area_not_void: an_area /= void
        ensure -- from EV_DRAWABLE
            clip_area_assigned: clip_area.is_equal (an_area)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_drawing_mode (a_mode: INTEGER)
            -- Set drawing mode to a_logical_mode.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_mode_valid: valid_drawing_mode (a_mode)
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = a_mode

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void
        ensure -- from EV_FONTABLE
            font_assigned: font.is_equal (a_font)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_DRAWABLE
            line_width_assigned: line_width = a_width

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tile (a_pixmap: EV_PIXMAP)
            -- Set tile used to fill figures.
            -- Set to Void to use background_color to fill.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_DRAWABLE
            tile_assigned: tile /= void

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operations

    clear_and_redraw
            -- Clear the window.
            -- Call expose_actions for Current when next idle.
        require
            not_destroyed: not is_destroyed

    clear_and_redraw_rectangle (a_x, a_y, a_width, a_height: INTEGER)
            -- Clear rectangle described with upper-left corner on (a_x, a_y)
            -- with size a_width and a_height.
            -- Call expose_actions for rectangle when next idle.
        require
            not_destroyed: not is_destroyed

    flush
            -- Execute any delayed calls to expose_actions without waiting
            -- for next idle. Delayed calls to expose_actions happen as a
            -- result of calling on of redraw, clear_and_redraw,
            -- redraw_rectangle or clear_and_redraw_rectngle.
            -- Call this feature to make the effects of one or more previous
            -- calls to these features immediately visible.
        require
            not_destroyed: not is_destroyed

    redraw
            -- Call expose_actions for Current when next idle.
        require
            not_destroyed: not is_destroyed

    redraw_rectangle (a_x, a_y, a_width, a_height: INTEGER)
            -- Call expose_actions for rectangle described with upper-left
            -- corner on (a_x, a_y) with size a_width and a_height when next idle.
        require
            not_destroyed: not is_destroyed

feature -- Clearing operations

    clear
            -- Erase Current with background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    clear_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height in background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature  -- Contract support

    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
            -- Is a_mode a valid drawing mode?
            -- (from EV_DRAWABLE_CONSTANTS)

feature -- Drawing mode setting

    set_and_mode
            -- Set drawing_mode to bitwise AND.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_and

    set_copy_mode
            -- Set drawing_mode to normal.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_copy

    set_invert_mode
            -- Set drawing_mode to bitwise invert.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_invert

    set_or_mode
            -- Set drawing_mode to bitwise OR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_or

    set_xor_mode
            -- Set drawing_mode to bitwise XOR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_xor

feature -- Drawing operations

    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- Angles are measured in radians, and go
            -- counterclockwise from the 3 o'clock angle.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_width >= 0

    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Draw an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the
            -- 3 o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
            -- Draw a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void

    draw_point (x, y: INTEGER)
            -- Draw point at (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
            -- Draw line segments between subsequent points in
            -- points. If is_closed draw line segment between first
            -- and last point in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    draw_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

    draw_segment (x1, y1, x2, y2: INTEGER)
            -- Draw line segment from (x1, y1) to (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_straight_line (x1, y1, x2, y2: INTEGER)
            -- Draw infinite straight line through (x1, y1) and
            -- (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
            -- Draw area of a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
            area_not_void: area /= void

    draw_text (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with left of baseline at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    draw_text_top_left (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with top left corner at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

feature -- Drawing operations (filled)

    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Fill an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Fill part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the 3
            -- o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_polygon (points: ARRAY [EV_COORDINATE])
            -- Draw filled polygon between subsequent points in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    fill_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw filled rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when an area needs to be redrawn.
            -- (from EV_DRAWING_AREA_ACTION_SEQUENCES)
        ensure -- from EV_DRAWING_AREA_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_DRAWABLE
    line_width_positive_or_zero: is_usable implies line_width >= 0
    drawing_mode_valid: is_usable implies valid_drawing_mode (drawing_mode)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_DRAWING_AREA


EV_GAUGE Chart

deferred class
    EV_GAUGE

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Base class for widgets that display `value' within a `value_range'.
        See EV_RANGE, EV_SCROLL_BAR, EV_SPIN_BUTTON and EV_PROGRESS_BAR."
    keywords: "value, step, increment, range"

Ancestors
    EV_GAUGE_ACTION_SEQUENCES
    EV_PRIMITIVE

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_GAUGE)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward

Constraints
    range not void
    range not empty
    value in range
    step positive
    leap positive
    change actions not void
    proportion within range
    proportion definition
    proportion correct value


EV_GAUGE Flat contracts

indexing
    description: "Base class for widgets that display `value' within a `value_range'.See EV_RANGE, EV_SCROLL_BAR, EV_SPIN_BUTTON and EV_PROGRESS_BAR."
    status: "See notice at end of class."
    keywords: "value, step, increment, range"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_GAUGE

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
        require
            not_destroyed: not is_destroyed
        ensure
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
        require
            not_destroyed: not is_destroyed
        ensure
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
        require
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
        require
            not_destroyed: not is_destroyed
        ensure
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
        require
            not_destroyed: not is_destroyed
        ensure
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
        require
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
        require
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
        require
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_GAUGE


EV_HORIZONTAL_PROGRESS_BAR Chart

class
    EV_HORIZONTAL_PROGRESS_BAR

General
    cluster: vision2.interface.widgets.primitives
    description: "Horizontal bar graph gauge for displaying progress of a process."
    keywords: "status, progress, bar, horizontal"
    create: make_with_value_range, default_create

Ancestors
    EV_PROGRESS_BAR

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_segmented: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_HORIZONTAL_PROGRESS_BAR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_segmentation
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_segmentation
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_HORIZONTAL_PROGRESS_BAR Flat contracts

indexing
    description: "Horizontal bar graph gauge for displaying progress of a process."
    appearance: "+-------------+|###   25%%    |+-------------+"
    status: "See notice at end of class"
    keywords: "status, progress, bar, horizontal"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_HORIZONTAL_PROGRESS_BAR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_value_range (a_value_range: INTEGER_INTERVAL)
            -- Create and assign a_value_range to value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            a_value_range_not_void: a_value_range /= void
            a_value_range_not_empty: not a_value_range.is_empty

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_segmented: BOOLEAN
            -- Is display segmented?
            -- (from EV_PROGRESS_BAR)
        require -- from EV_PROGRESS_BAR
            not_destroyed: not is_destroyed
        ensure -- from EV_PROGRESS_BAR
            bridge_ok: Result = implementation.is_segmented

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_segmentation
            -- Display continuous bar.
            -- (from EV_PROGRESS_BAR)
        require -- from EV_PROGRESS_BAR
            not_destroyed: not is_destroyed
        ensure -- from EV_PROGRESS_BAR
            not_is_segmented: not is_segmented

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_segmentation
            -- Divide display of bar into segments.
            -- (from EV_PROGRESS_BAR)
        require -- from EV_PROGRESS_BAR
            not_destroyed: not is_destroyed
        ensure -- from EV_PROGRESS_BAR
            is_segmented: is_segmented

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_HORIZONTAL_PROGRESS_BAR


EV_HORIZONTAL_RANGE Chart

class
    EV_HORIZONTAL_RANGE

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Interactive horizontal range widget. A sliding thumb displays the
        current `value' and allows it to be adjusted"
    keywords: "range, slide, adjust"
    create: make_with_value_range, default_create

Ancestors
    EV_RANGE

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_HORIZONTAL_RANGE)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_HORIZONTAL_RANGE Flat contracts

indexing
    description: "Interactive horizontal range widget. A sliding thumb displays thecurrent `value' and allows it to be adjusted"
    appearance: "+-------------+|  |#|        |+-------------+"
    status: "See notice at end of class"
    keywords: "range, slide, adjust"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_HORIZONTAL_RANGE

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_value_range (a_value_range: INTEGER_INTERVAL)
            -- Create and assign a_value_range to value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            a_value_range_not_void: a_value_range /= void
            a_value_range_not_empty: not a_value_range.is_empty

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_HORIZONTAL_RANGE


EV_HORIZONTAL_SCROLL_BAR Chart

class
    EV_HORIZONTAL_SCROLL_BAR

General
    cluster: vision2.interface.widgets.primitives
    description: "Interactive horizontal scrolling widget."
    keywords: "horizontal, scroll, bar, gauge"
    create: make_with_value_range, default_create

Ancestors
    EV_SCROLL_BAR

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_HORIZONTAL_SCROLL_BAR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_HORIZONTAL_SCROLL_BAR Flat contracts

indexing
    description: "Interactive horizontal scrolling widget."
    appearance: "+-+---------+-+|<| |#|     |>|+-+---------+-+"
    status: "See notice at end of class."
    keywords: "horizontal, scroll, bar, gauge"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_HORIZONTAL_SCROLL_BAR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_value_range (a_value_range: INTEGER_INTERVAL)
            -- Create and assign a_value_range to value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            a_value_range_not_void: a_value_range /= void
            a_value_range_not_empty: not a_value_range.is_empty

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_HORIZONTAL_SCROLL_BAR


EV_HORIZONTAL_SEPARATOR Chart

class
    EV_HORIZONTAL_SEPARATOR

General
    cluster: vision2.interface.widgets.primitives
    description: "Scored horizontal line."
    keywords: "seperator, horizontal, line, score"
    create: default_create

Ancestors
    EV_SEPARATOR

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_HORIZONTAL_SEPARATOR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_HORIZONTAL_SEPARATOR Flat contracts

indexing
    description: "Scored horizontal line."
    appearance: "---------------"
    status: "See notice at end of class"
    keywords: "seperator, horizontal, line, score"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_HORIZONTAL_SEPARATOR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_HORIZONTAL_SEPARATOR


EV_LABEL Chart

class
    EV_LABEL

General
    cluster: vision2.interface.widgets.primitives
    description: "Displays a textual label."
    keywords: "label, text"
    create: make_with_text, default_create

Ancestors
    EV_FONTABLE
    EV_PRIMITIVE
    EV_TEXTABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    font: EV_FONT
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    text: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_LABEL)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_font (a_font: EV_FONT)
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_LABEL Flat contracts

indexing
    description: "Displays a textual label."
    appearance: " `text' "
    status: "See notice at end of class"
    keywords: "label, text"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_LABEL

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    font: EV_FONT
            -- Typeface appearance for Current.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_FONTABLE
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void
        ensure -- from EV_FONTABLE
            font_assigned: font.is_equal (a_font)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_LABEL


EV_LIST Chart

class
    EV_LIST

General
    cluster: vision2.interface.widgets.primitives
    description: "Displays a list of items from which the user can select."
    keywords: "list, select, menu"
    create: make_with_strings, default_create

Ancestors
    EV_LIST_ITEM_LIST

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_LIST_ITEM
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_LIST_ITEM]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_LIST_ITEM
    for_all (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_LIST_ITEM): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_LIST_ITEM
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_LIST_ITEM; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_LIST): BOOLEAN
    is_inserted (v: EV_LIST_ITEM): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_LIST_ITEM
    item_by_data (some_data: ANY): [like item] EV_LIST_ITEM
    last: [like item] EV_LIST_ITEM
    linear_representation: LINEAR [EV_LIST_ITEM]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    multiple_selection_enabled: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_LIST_ITEM): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmaps_height: INTEGER
    pixmaps_width: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_item: EV_LIST_ITEM
    selected_items: DYNAMIC_LIST [EV_LIST_ITEM]
    sequential_occurrences (v: EV_LIST_ITEM): INTEGER
    strings: LINKED_LIST [STRING]
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
    tooltip: STRING
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_LIST_ITEM])
    back
    center_pointer
    compare_objects
    compare_references
    copy (other: [like Current] EV_LIST)
    default_create
    destroy
    disable_capture
    disable_multiple_selection
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN])
    enable_capture
    enable_multiple_selection
    enable_pebble_positioning
    enable_sensitive
    ensure_item_visible (an_item: EV_LIST_ITEM)
    extend (v: [like item] EV_LIST_ITEM)
    fill (other: CONTAINER [EV_LIST_ITEM])
    finish
    force (v: [like item] EV_LIST_ITEM)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_LIST)
    merge_right (other: [like Current] EV_LIST)
    move (i: INTEGER)
    prune (v: [like item] EV_LIST_ITEM)
    prune_all (v: [like item] EV_LIST_ITEM)
    put (v: [like item] EV_LIST_ITEM)
    put_front (v: [like item] EV_LIST_ITEM)
    put_i_th (v: [like item] EV_LIST_ITEM; i: INTEGER)
    put_left (v: [like item] EV_LIST_ITEM)
    put_right (v: [like item] EV_LIST_ITEM)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    remove_selection
    remove_tooltip
    replace (v: [like item] EV_LIST_ITEM)
    search (v: [like item] EV_LIST_ITEM)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmaps_size (a_width, a_height: INTEGER)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_strings (a_string_array: INDEXABLE [STRING, INTEGER])
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out

Constraints
    selected items not void
    selected items first is selected item
    selected items empty xor selected item not void
    single selection implies at most one selected item
    selection size within bounds


EV_LIST Flat contracts

indexing
    description: "Displays a list of items from which the user can select."
    appearance: "+-------------+| 'first'     ||  ...        || `last'      |+-------------+"
    status: "See notice at end of class"
    keywords: "list, select, menu"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_LIST

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_strings (a_string_array: INDEXABLE [STRING, INTEGER])
            -- Create with an item for each of a_string_array.
            -- (from EV_LIST_ITEM_LIST)
        ensure -- from EV_LIST_ITEM_LIST
            items_created: count = strings.count

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_LIST_ITEM]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_LIST_ITEM
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_LIST_ITEM
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_LIST_ITEM): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_item: EV_LIST_ITEM
            -- Currently selected item.
            -- Topmost selected item if multiple items are selected.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            bridge_ok: Result = implementation.selected_item

    selected_items: DYNAMIC_LIST [EV_LIST_ITEM]
            -- Currently selected items.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: lists_equal (Result, implementation.selected_items)

    strings: LINKED_LIST [STRING]
            -- Representation of Current.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            not_void: Result /= void
            same_size: Result.count = count

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_LIST_ITEM): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    multiple_selection_enabled: BOOLEAN
            -- Can more than one item be selected?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.multiple_selection_enabled

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    pixmaps_height: INTEGER
            -- Height of displayed pixmaps in the list.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_height

    pixmaps_width: INTEGER
            -- Width of displayed pixmaps in the list.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_width

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_multiple_selection
            -- Allow only one item to be selected.
        require
            not_destroyed: not is_destroyed
        ensure
            not_multiple_selection_enabled: not multiple_selection_enabled

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_multiple_selection
            -- Allow more than one item to be selected.
        require
            not_destroyed: not is_destroyed
        ensure
            multiple_selection_enabled: multiple_selection_enabled

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    ensure_item_visible (an_item: EV_LIST_ITEM)
            -- Ensure item an_item is visible in Current.
        require
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            an_item_contained: has (an_item)

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_selection
            -- Ensure there is no selected_item.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            not_selected: selected_item = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmaps_size (a_width: INTEGER; a_height: INTEGER)
            -- Set size of pixmaps disaplyed in Current.
            -- Note: Default value is 16x16
        require
            not_destroyed: not is_destroyed
            valid_width: a_width > 0
            valid_height: a_height > 0
        ensure
            width_set: pixmaps_width = a_width
            height_set: pixmaps_height = a_height

    set_strings (a_string_array: INDEXABLE [STRING, INTEGER])
            -- Wipe out and re-initialize with an item
            -- for each of a_string_array.
            -- (from EV_LIST_ITEM_LIST)
        require -- from EV_LIST_ITEM_LIST
            not_destroyed: not is_destroyed
        ensure -- from EV_LIST_ITEM_LIST
            items_created: count = strings.count

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_LIST_ITEM])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_LIST_ITEM])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_LIST_ITEM]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is deselected.
            -- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is selected.
            -- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    selected_items_not_void: is_usable implies selected_items /= void
    selected_items_first_is_selected_item: is_usable and not selected_items.is_empty implies selected_items.first = selected_item
    selected_items_empty_xor_selected_item_not_void: is_usable implies selected_items.is_empty xor selected_item /= void
    single_selection_implies_at_most_one_selected_item: is_usable and not multiple_selection_enabled implies selected_items.count <= 1
    selection_size_within_bounds: is_usable implies selected_items.count <= count
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_LIST


EV_LIST_ITEM_LIST Chart

deferred class
    EV_LIST_ITEM_LIST

General
    cluster: vision2.interface.widgets.primitives
    description: "Common ancestor for EV_LIST and EV_COMBO_BOX."
    keywords: "list, list_item"

Ancestors
    EV_ITEM_LIST [G -> EV_ITEM]
    EV_LIST_ITEM_LIST_ACTION_SEQUENCES
    EV_PRIMITIVE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_LIST_ITEM
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_LIST_ITEM]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_LIST_ITEM
    for_all (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_LIST_ITEM): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_LIST_ITEM
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_LIST_ITEM; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_LIST_ITEM_LIST): BOOLEAN
    is_inserted (v: EV_LIST_ITEM): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_LIST_ITEM
    item_by_data (some_data: ANY): [like item] EV_LIST_ITEM
    last: [like item] EV_LIST_ITEM
    linear_representation: LINEAR [EV_LIST_ITEM]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_LIST_ITEM): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_item: EV_LIST_ITEM
    sequential_occurrences (v: EV_LIST_ITEM): INTEGER
    strings: LINKED_LIST [STRING]
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
    tooltip: STRING
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_LIST_ITEM])
    back
    center_pointer
    compare_objects
    compare_references
    copy (other: [like Current] EV_LIST_ITEM_LIST)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN])
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_LIST_ITEM)
    fill (other: CONTAINER [EV_LIST_ITEM])
    finish
    force (v: [like item] EV_LIST_ITEM)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_LIST_ITEM_LIST)
    merge_right (other: [like Current] EV_LIST_ITEM_LIST)
    move (i: INTEGER)
    prune (v: [like item] EV_LIST_ITEM)
    prune_all (v: [like item] EV_LIST_ITEM)
    put (v: [like item] EV_LIST_ITEM)
    put_front (v: [like item] EV_LIST_ITEM)
    put_i_th (v: [like item] EV_LIST_ITEM; i: INTEGER)
    put_left (v: [like item] EV_LIST_ITEM)
    put_right (v: [like item] EV_LIST_ITEM)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    remove_selection
    remove_tooltip
    replace (v: [like item] EV_LIST_ITEM)
    search (v: [like item] EV_LIST_ITEM)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_strings (a_string_array: INDEXABLE [STRING, INTEGER])
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_LIST_ITEM_LIST Flat contracts

indexing
    description: "Common ancestor for EV_LIST and EV_COMBO_BOX."
    status: "See notice at end of class"
    keywords: "list, list_item"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_LIST_ITEM_LIST

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_LIST_ITEM]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_LIST_ITEM
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_LIST_ITEM
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_LIST_ITEM): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_item: EV_LIST_ITEM
            -- Currently selected item.
            -- Topmost selected item if multiple items are selected.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.selected_item

    strings: LINKED_LIST [STRING]
            -- Representation of Current.
        require
            not_destroyed: not is_destroyed
        ensure
            not_void: Result /= void
            same_size: Result.count = count

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_LIST_ITEM): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_selection
            -- Ensure there is no selected_item.
        require
            not_destroyed: not is_destroyed
        ensure
            not_selected: selected_item = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_strings (a_string_array: INDEXABLE [STRING, INTEGER])
            -- Wipe out and re-initialize with an item
            -- for each of a_string_array.
        require
            not_destroyed: not is_destroyed
        ensure
            items_created: count = strings.count

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_LIST_ITEM])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_LIST_ITEM])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_LIST_ITEM]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is deselected.
            -- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when an item is selected.
            -- (from EV_LIST_ITEM_LIST_ACTION_SEQUENCES)
        ensure -- from EV_LIST_ITEM_LIST_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_LIST_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_LIST_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_LIST_ITEM_LIST


EV_MULTI_COLUMN_LIST Chart

class
    EV_MULTI_COLUMN_LIST

General
    cluster: vision2.interface.widgets.primitives
    description: "Displays a list of multi item rows from which the user can select."
    keywords: "list, multi, column, row, table"
    create: default_create

Ancestors
    EV_ITEM_LIST [G -> EV_ITEM]
    EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
    EV_PRIMITIVE

Action sequences
    column_resize_actions: EV_COLUMN_ACTION_SEQUENCE
    column_title_click_actions: EV_COLUMN_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_MULTI_COLUMN_LIST_ROW
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    column_alignment (a_column: INTEGER): EV_TEXT_ALIGNMENT
    column_alignments_assigned (alignments: LINKED_LIST [EV_TEXT_ALIGNMENT]): BOOLEAN
    column_count: INTEGER
    column_title (a_column: INTEGER): STRING
    column_titles_assigned (titles: ARRAY [STRING]): BOOLEAN
    column_width (a_column: INTEGER): INTEGER
    column_widths_assigned (widths: ARRAY [INTEGER]): BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MULTI_COLUMN_LIST_ROW]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_MULTI_COLUMN_LIST_ROW
    for_all (test: FUNCTION [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_MULTI_COLUMN_LIST_ROW): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_MULTI_COLUMN_LIST_ROW
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_MULTI_COLUMN_LIST_ROW; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_MULTI_COLUMN_LIST): BOOLEAN
    is_inserted (v: EV_MULTI_COLUMN_LIST_ROW): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_MULTI_COLUMN_LIST_ROW
    item_by_data (some_data: ANY): [like item] EV_MULTI_COLUMN_LIST_ROW
    last: [like item] EV_MULTI_COLUMN_LIST_ROW
    linear_representation: LINEAR [EV_MULTI_COLUMN_LIST_ROW]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    multiple_selection_enabled: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_MULTI_COLUMN_LIST_ROW): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmaps_height: INTEGER
    pixmaps_width: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    row_height: INTEGER
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected_item: EV_MULTI_COLUMN_LIST_ROW
    selected_items: DYNAMIC_LIST [EV_MULTI_COLUMN_LIST_ROW]
    sequential_occurrences (v: EV_MULTI_COLUMN_LIST_ROW): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW], BOOLEAN]): BOOLEAN
    title_shown: BOOLEAN
    tooltip: STRING
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center (a_column: INTEGER)
    align_text_left (a_column: INTEGER)
    align_text_right (a_column: INTEGER)
    append (s: SEQUENCE [EV_MULTI_COLUMN_LIST_ROW])
    back
    center_pointer
    clear_selection
    compare_objects
    compare_references
    copy (other: [like Current] EV_MULTI_COLUMN_LIST)
    default_create
    destroy
    disable_capture
    disable_multiple_selection
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]; test: FUNCTION [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW], BOOLEAN])
    enable_capture
    enable_multiple_selection
    enable_pebble_positioning
    enable_sensitive
    ensure_item_visible (an_item: EV_MULTI_COLUMN_LIST_ROW)
    extend (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    fill (other: CONTAINER [EV_MULTI_COLUMN_LIST_ROW])
    finish
    force (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    hide_title_row
    merge_left (other: [like Current] EV_MULTI_COLUMN_LIST)
    merge_right (other: [like Current] EV_MULTI_COLUMN_LIST)
    move (i: INTEGER)
    prune (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    prune_all (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    put (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    put_front (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    put_i_th (v: [like item] EV_MULTI_COLUMN_LIST_ROW; i: INTEGER)
    put_left (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    put_right (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    remove_tooltip
    replace (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    resize_column_to_content (a_column: INTEGER)
    search (v: [like item] EV_MULTI_COLUMN_LIST_ROW)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_column_alignment (an_alignment: EV_TEXT_ALIGNMENT; a_column: INTEGER)
    set_column_alignments (alignments: LINKED_LIST [EV_TEXT_ALIGNMENT])
    set_column_title (a_title: STRING; a_column: INTEGER)
    set_column_titles (titles: ARRAY [STRING])
    set_column_width (a_width, a_column: INTEGER)
    set_column_widths (widths: ARRAY [INTEGER])
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmaps_size (a_width, a_height: INTEGER)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    show_title_row
    start
    swap (i: INTEGER)
    wipe_out


EV_MULTI_COLUMN_LIST Flat contracts

indexing
    description: "Displays a list of multi item rows from which the user can select."
    note: "The list start at the index 1, the titles are not count amongthe rows. The columns start also at the index 1."
    status: "See notice at end of class"
    keywords: "list, multi, column, row, table"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_MULTI_COLUMN_LIST

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    column_count: INTEGER
            -- Column count.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.column_count

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_MULTI_COLUMN_LIST_ROW]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_MULTI_COLUMN_LIST_ROW
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_MULTI_COLUMN_LIST_ROW
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_MULTI_COLUMN_LIST_ROW): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    row_height: INTEGER
            -- Height in pixels of each row.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.row_height

    selected_item: EV_MULTI_COLUMN_LIST_ROW
            -- Currently selected item.
            -- Topmost selected item if multiple items are selected.
            -- (For multiple selections see selected_items).
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.selected_item

    selected_items: DYNAMIC_LIST [EV_MULTI_COLUMN_LIST_ROW]
            -- Currently selected items.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: lists_equal (Result, implementation.selected_items)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    column_alignment (a_column: INTEGER): EV_TEXT_ALIGNMENT
            -- Result is alignment of column a_column.
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column >= 1 and a_column <= column_count
        ensure
            bridge_ok: Result.is_equal (implementation.column_alignment (a_column))

    column_title (a_column: INTEGER): STRING
            -- Title of a_column.
            -- Returns "" if no title given yet.
        require
            not_destroyed: not is_destroyed
            a_column_positive: a_column >= 1
        ensure
            bridge_ok: Result.is_equal (implementation.column_title (a_column))

    column_width (a_column: INTEGER): INTEGER
            -- Width of a_column in pixels.
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column >= 1 and a_column <= column_count
        ensure
            bridge_ok: Result = implementation.column_width (a_column)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_MULTI_COLUMN_LIST_ROW): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    multiple_selection_enabled: BOOLEAN
            -- Can more than one item be selected?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.multiple_selection_enabled

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    pixmaps_height: INTEGER
            -- Height of displayed pixmaps in Current.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_height

    pixmaps_width: INTEGER
            -- Width of displayed pixmaps in Current.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_width

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    title_shown: BOOLEAN
            -- Is a row displaying column titles shown?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.title_shown

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    align_text_center (a_column: INTEGER)
            -- Display text of a_column centered.
            -- First column is always left aligned.
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column > 1 and a_column <= column_count

    align_text_left (a_column: INTEGER)
            -- Display text of a_column left aligned.
            -- First column is always left aligned.
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column > 1 and a_column <= column_count

    align_text_right (a_column: INTEGER)
            -- Display text of a_column right aligned.
            -- First column is always left aligned.
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column > 1 and a_column <= column_count

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    clear_selection
            -- Make selected_items empty.
        require
            not_destroyed: not is_destroyed
        ensure
            selected_items_empty: selected_items.is_empty

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_multiple_selection
            -- Allow only one item to be selected.
        require
            not_destroyed: not is_destroyed
        ensure
            not_multiple_selection_enabled: not multiple_selection_enabled

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_multiple_selection
            -- Allow more than one item to be selected.
        require
            not_destroyed: not is_destroyed
        ensure
            multiple_selection_enabled: multiple_selection_enabled

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    ensure_item_visible (an_item: EV_MULTI_COLUMN_LIST_ROW)
            -- Ensure an_item is visible in Current.
        require
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            an_item_contained: has (an_item)

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    hide_title_row
            -- Hide row displaying column titles.
        require
            not_destroyed: not is_destroyed
        ensure
            not_title_shown: not title_shown

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmaps_size (a_width: INTEGER; a_height: INTEGER)
            -- Set the size of displayed pixmaps in the Multicolumn list.
            -- Note: The Default value is 16x16
        require
            not_destroyed: not is_destroyed
            valid_width: a_width > 0
            valid_height: a_height > 0
        ensure
            width_set: pixmaps_width = a_width
            height_set: pixmaps_height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    show_title_row
            -- Show row displaying column titles.
        require
            not_destroyed: not is_destroyed
        ensure
            title_shown: title_shown

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_MULTI_COLUMN_LIST_ROW])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_MULTI_COLUMN_LIST_ROW])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    resize_column_to_content (a_column: INTEGER)
            -- Resize column a_column to width of its widest text.
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column > 0 and a_column <= column_count

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_column_alignment (an_alignment: EV_TEXT_ALIGNMENT; a_column: INTEGER)
            -- Align the text of column a_column to an_alignment
            -- The first column must stay as left aligned as MSDN
            -- states that the first column can only be set as left aligned
            -- for Win32.
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column > 1 and a_column <= column_count
            alignment_not_void: an_alignment /= void
        ensure
            column_alignment_assigned: column_alignment (a_column).is_equal (an_alignment)

    set_column_alignments (alignments: LINKED_LIST [EV_TEXT_ALIGNMENT])
            -- Assign alignments to column text alignments in order.
            -- The first alignment element is ignored
            -- (see set_column_alignment).
        require
            not_destroyed: not is_destroyed
            alignments_not_void: alignments /= void
        ensure
            column_alignments_assigned: column_alignments_assigned (alignments)

    set_column_title (a_title: STRING; a_column: INTEGER)
            -- Assign a_title to the column_title(a_column).
        require
            not_destroyed: not is_destroyed
            a_column_positive: a_column > 0
            a_title_not_void: a_title /= void
        ensure
            a_title_assigned: a_title.is_equal (column_title (a_column))

    set_column_titles (titles: ARRAY [STRING])
            -- Assign titles to titles of columns in order.
            -- Current will resize if the number of titles exceeds
            -- Column_count.
        require
            not_destroyed: not is_destroyed
            titles_not_void: titles /= void
        ensure
            column_titles_assigned: column_titles_assigned (titles)

    set_column_width (a_width: INTEGER; a_column: INTEGER)
            -- Assign a_width column_width(a_column).
        require
            not_destroyed: not is_destroyed
            a_column_within_range: a_column > 0 and a_column <= column_count
            a_width_positive: a_width >= 0
        ensure
            a_width_assigned: a_width = column_width (a_column)

    set_column_widths (widths: ARRAY [INTEGER])
            -- Assign widths to column widths in order.
        require
            not_destroyed: not is_destroyed
            widths_not_void: widths /= void
        ensure
            column_widths_assigned: column_widths_assigned (widths)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_MULTI_COLUMN_LIST_ROW]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    column_alignments_assigned (alignments: LINKED_LIST [EV_TEXT_ALIGNMENT]): BOOLEAN
            -- Are alignments of columns equal to alignments.
        require
            alignment_not_void: alignments /= void

    column_titles_assigned (titles: ARRAY [STRING]): BOOLEAN
            -- Are titles of columns equal to titles?
        require
            titles_not_void: titles /= void

    column_widths_assigned (widths: ARRAY [INTEGER]): BOOLEAN
            -- Are widths of columns equal to widths?
        require
            widths_not_void: widths /= void

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    column_resize_actions: EV_COLUMN_ACTION_SEQUENCE
            -- Actions to be performed
            -- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES)
        ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
            not_void: Result /= void

    column_title_click_actions: EV_COLUMN_ACTION_SEQUENCE
            -- Actions to be performed
            -- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES)
        ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
            -- Actions to be performed
            -- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES)
        ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_MULTI_COLUMN_LIST_ROW_SELECT_ACTION_SEQUENCE
            -- Actions to be performed
            -- (from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES)
        ensure -- from EV_MULTI_COLUMN_LIST_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW]]; test: FUNCTION [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_MULTI_COLUMN_LIST_ROW], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_MULTI_COLUMN_LIST


EV_OPTION_BUTTON Chart

class
    EV_OPTION_BUTTON

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Button that displays a `menu' when pressed.
        The most recently `selected_item' is displayed on the button."
    keywords: "button, menu, option, drop down, popup"
    create: make_with_text, default_create

Ancestors
    EV_BUTTON

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    menu: EV_MENU
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    selected_item: EV_MENU_ITEM
    target_name: STRING
    text: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_OPTION_BUTTON)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_pixmap
    remove_selection
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_selected_item (an_item: EV_MENU_ITEM)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show

Constraints
    menu not void


EV_OPTION_BUTTON Flat contracts

indexing
    description: "Button that displays a `menu' when pressed.The most recently `selected_item' is displayed on the button."
    keywords: "button, menu, option, drop down, popup"
    date: "$Date: 2001/07/14 11:14:58 $"
    revision: "$Revision: 1.4 $"

class interface
    EV_OPTION_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    menu: EV_MENU
            -- Displayed when pressed.

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    selected_item: EV_MENU_ITEM
            -- Most recently selected menu item.

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    remove_selection
            -- Make selected_item Void.
            -- Assign menu.text to text if available,
            -- otherwise assign menu.first.text to text.
        require
            not_destroyed: not is_destroyed
        ensure
            selected_item_void: selected_item = void
            menu_text_used_first: menu.text /= void implies text.is_equal (menu.text)
            menu_first_text_used_otherwise: menu.text = void and menu.first /= void and menu.first.text /= void implies text.is_equal (menu.first.text)

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_selected_item (an_item: EV_MENU_ITEM)
        require
            not_destroyed: not is_destroyed
            menu_has_item: menu.has (an_item)
        ensure
            selected: selected_item = an_item

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text and to menu.text.
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    menu_not_void: is_usable implies menu /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_OPTION_BUTTON


EV_PASSWORD_FIELD Chart

class
    EV_PASSWORD_FIELD

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Input field for a single line of `text', displayed
        as a sequence of `*'."
    create: make_with_text, default_create

Ancestors
    EV_TEXT_FIELD

Action sequences
    change_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    return_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    capacity: INTEGER
    caret_position: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_selection: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_editable: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    selected_text: STRING
    selection_end: INTEGER
    selection_start: INTEGER
    target_name: STRING
    text: STRING
    text_length: INTEGER
    tooltip: STRING
    valid_caret_position (pos: INTEGER): BOOLEAN
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    append_text (a_text: STRING)
    center_pointer
    copy (other: [like Current] EV_PASSWORD_FIELD)
    copy_selection
    cut_selection
    default_create
    delete_selection
    deselect_all
    destroy
    disable_capture
    disable_edit
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_edit
    enable_pebble_positioning
    enable_sensitive
    hide
    insert_text (a_text: STRING)
    paste (a_position: INTEGER)
    prepend_text (a_text: STRING)
    remove_help_context
    remove_pebble
    remove_text
    remove_tooltip
    select_all
    select_region (start_pos, end_pos: INTEGER)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_capacity (a_capacity: INTEGER)
    set_caret_position (a_caret_position: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_minimum_width_in_characters (nb: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_PASSWORD_FIELD Flat contracts

indexing
    description: "Input field for a single line of `text', displayedas a sequence of `*'."
    appearance: "+-------------+| ********    |+-------------+"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_PASSWORD_FIELD

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create with a_text.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            a_text_not_void: a_text /= void

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    capacity: INTEGER
            -- Number of characters field can hold.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            not_destroyed: not is_destroyed

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_text: STRING
            -- Currently selected text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result.is_equal (implementation.selected_text)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text of Current.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    text_length: INTEGER
            -- Number of characters making up text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.text_length

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    caret_position: INTEGER
            -- Current position of caret.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.caret_position

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    has_selection: BOOLEAN
            -- Does current have a selection?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.has_selection

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_editable: BOOLEAN
            -- Is text editable?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.is_editable

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    selection_end: INTEGER
            -- Index of last character selected
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_end
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_start: Result >= selection_start

    selection_start: INTEGER
            -- Index of first selected character.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_start
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_end: selection_end >= Result

    valid_caret_position (pos: INTEGER): BOOLEAN
            -- Is pos a valid caret position?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.valid_caret_position (pos)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_edit
            -- Make Current read-only.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: not is_editable

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_edit
            -- Make Current editable.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: is_editable

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_caret_position (a_caret_position: INTEGER)
            -- Assign a_caret_posiiton to caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_caret_position: valid_caret_position (a_caret_position)
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            caret_position_assigned: caret_position = a_caret_position

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    append_text (a_text: STRING)
            -- Append a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_appended: check_text_modification (old text, a_text)
            caret_not_moved: old caret_position = caret_position

    insert_text (a_text: STRING)
            -- Insert a_text to right of caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_insert_correctly: text.is_equal ((old text).substring (1, (old caret_position - 1)) + a_text + (old text).substring ((old caret_position), (old text.count)))
            caret_not_moved: old caret_position = caret_position

    prepend_text (a_text: STRING)
            -- Prepend a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_prepended: text.is_equal (a_text + old text)
            caret_not_moved: old caret_position = caret_position

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_capacity (a_capacity: INTEGER)
            -- Assign a_capacity to capacity.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            not_destroyed: not is_destroyed
            a_capacity_not_negative: a_capacity >= 0

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXT_COMPONENT
            text_set: check_text_modification (void, a_text)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Resizing

    set_minimum_width_in_characters (nb: INTEGER)
            -- Make a minimum of nb of the widest character visible
            -- on one line.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_nb: nb > 0
        ensure -- from EV_TEXT_COMPONENT
            minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    copy_selection
            -- Copy selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            selection_copied: clipboard_content.is_equal (selected_text)
            text_unchanged: text.is_equal (old text)
            caret_not_moved: caret_position = old caret_position

    cut_selection
            -- Move selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            selection_in_clipboard: clipboard_content.is_equal (old selected_text)
            selection_cut: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    delete_selection
            -- Delete current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            has_no_selection: not has_selection
            selection_deleted: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    deselect_all
            -- Unselect the current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            not_has_selection: not has_selection

    paste (a_position: INTEGER)
            -- Insert text from clipboard at a_position.
            -- No effect if clipboard is empty.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            a_position_within_range: a_position >= 1 and a_position <= text_length + 1
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            text_pasted_correctly: text.is_equal ((old text).substring (1, a_position - 1) + clipboard_content + ((old text).substring (a_position, ((old text).count))))
            caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
            caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content.count

    select_all
            -- Select all text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            positive_length: text_length > 0
        ensure -- from EV_TEXT_COMPONENT
            has_selection: has_selection
            selection_start_set: selection_start = 1
            selection_end_set: selection_end = text_length

    select_region (start_pos, end_pos: INTEGER)
            -- Select text between start_pos and end_pos inclusive.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            start_within_range: start_pos >= 1 and start_pos <= text_length
            end_within_range: end_pos >= 1 and end_pos <= text_length
        ensure -- from EV_TEXT_COMPONENT
            has_selection: (start_pos /= end_pos) implies has_selection
            selection_start_set: selection_start = start_pos
            selection_end_set: selection_end = end_pos

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when text changes.
            -- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    return_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when return key is pressed.
            -- (from EV_TEXT_FIELD_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_FIELD_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TEXT_FIELD
    capacity_not_negative: capacity >= 0
        -- from EV_TEXT_COMPONENT
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_PASSWORD_FIELD


EV_PIXMAP Chart

class
    EV_PIXMAP

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Graphical picture stored as a two dimensional map of pixels.
        Can be modified and displayed."
    keywords: "drawable, primitives, figures, buffer, bitmap, picture"
    create: make_with_size, default_create

Ancestors
    EV_DRAWABLE
    EV_PIXMAP_ACTION_SEQUENCES
    EV_PRIMITIVE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    clip_area: EV_RECTANGLE
    dashed_line_style: BOOLEAN
    data: ANY
    deny_cursor: EV_CURSOR
    drawing_mode: INTEGER
    font: EV_FONT
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_equal (other: [like Current] EV_PIXMAP): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    line_width: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    tile: EV_PIXMAP
    tooltip: STRING
    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    clear
    clear_rectangle (x, y, a_width, a_height: INTEGER)
    copy (other: EV_PIXMAP)
    default_create
    destroy
    disable_capture
    disable_dashed_line_style
    disable_pebble_positioning
    disable_sensitive
    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
    draw_point (x, y: INTEGER)
    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
    draw_rectangle (x, y, a_width, a_height: INTEGER)
    draw_segment (x1, y1, x2, y2: INTEGER)
    draw_straight_line (x1, y1, x2, y2: INTEGER)
    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
    draw_text (x, y: INTEGER; a_text: STRING)
    draw_text_top_left (x, y: INTEGER; a_text: STRING)
    enable_capture
    enable_dashed_line_style
    enable_pebble_positioning
    enable_sensitive
    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
    fill_polygon (points: ARRAY [EV_COORDINATE])
    fill_rectangle (x, y, a_width, a_height: INTEGER)
    flush
    hide
    remove_clip_area
    remove_help_context
    remove_pebble
    remove_tile
    remove_tooltip
    save_to_named_file (a_format: EV_GRAPHICAL_FORMAT; a_filename: FILE_NAME)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_and_mode
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_clip_area (an_area: EV_RECTANGLE)
    set_copy_mode
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_drawing_mode (a_mode: INTEGER)
    set_focus
    set_font (a_font: EV_FONT)
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_invert_mode
    set_line_width (a_width: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_or_mode
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_size (a_width, a_height: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tile (a_pixmap: EV_PIXMAP)
    set_tooltip (a_tooltip: STRING)
    set_with_named_file (file_name: STRING)
    set_xor_mode
    show
    stretch (a_width, a_height: INTEGER)


EV_PIXMAP Flat contracts

indexing
    description: "Graphical picture stored as a two dimensional map of pixels.Can be modified and displayed."
    status: "See notice at end of class"
    keywords: "drawable, primitives, figures, buffer, bitmap, picture"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_PIXMAP

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_size (a_width, a_height: INTEGER)
            -- Create with a_width and a_height.
        require
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure then
            width_assigned: width = a_width
            height_assigned: height = a_height

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    clip_area: EV_RECTANGLE
            -- Rectangular area to apply clipping on.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.clip_area = void)

    dashed_line_style: BOOLEAN
            -- Are lines drawn dashed?
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.dashed_line_style

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    drawing_mode: INTEGER
            -- Logical operation on pixels when drawing.
            -- Default: drawing_mode_copy.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.drawing_mode

    font: EV_FONT
            -- Typeface appearance for Current.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_FONTABLE
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.font)

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    line_width: INTEGER
            -- Line thickness. Default: 1.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: Result = implementation.line_width

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tile: EV_PIXMAP
            -- Pixmap that is used to draw filled primitives with
            -- instead of foreground_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            bridge_ok: (Result = void) = (implementation.tile = void)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other have the same appearance as Current.
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_size (a_width, a_height: INTEGER)
            -- Assign a_width and a_height to width and weight.
            -- Do not stretch image.
            -- May cause cropping.
        require
            not_destroyed: not is_destroyed
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure
            width_assigned: width = a_width
            height_assigned: height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    set_with_named_file (file_name: STRING)
            -- Attempt to load pixmap data from a file specified by file_name.
            -- May raise Ev_unknow_image_format or Ev_courpt_image_data
            -- exceptions.
        require
            not_destroyed: not is_destroyed
            file_name_not_void: file_name /= void
            file_name_not_empty: not file_name.is_empty

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    stretch (a_width, a_height: INTEGER)
            -- Assign a_width and a_height to width and weight.
            -- Stretch the image to new size.
        require
            not_destroyed: not is_destroyed
            a_width_positive: a_width > 0
            a_height_positive: a_height > 0
        ensure
            width_assigned: width = a_width
            height_assigned: height = a_height

feature -- Element change

    disable_dashed_line_style
            -- Draw lines solid.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_disabled: not dashed_line_style

    enable_dashed_line_style
            -- Draw lines dashed.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            dashed_line_style_enabled: dashed_line_style

    remove_clip_area
            -- Do not apply any clipping.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            clip_area_void: clip_area = void

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tile
            -- Do not apply a tile when filling.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            tile_void: tile = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_clip_area (an_area: EV_RECTANGLE)
            -- Set area which will be refreshed.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            an_area_not_void: an_area /= void
        ensure -- from EV_DRAWABLE
            clip_area_assigned: clip_area.is_equal (an_area)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_drawing_mode (a_mode: INTEGER)
            -- Set drawing mode to a_logical_mode.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_mode_valid: valid_drawing_mode (a_mode)
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = a_mode

    set_font (a_font: EV_FONT)
            -- Assign a_font to font.
            -- (from EV_FONTABLE)
        require -- from EV_FONTABLE
            not_destroyed: not is_destroyed
            a_font_not_void: a_font /= void
        ensure -- from EV_FONTABLE
            font_assigned: font.is_equal (a_font)

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_line_width (a_width: INTEGER)
            -- Assign a_width to line_width.
            -- See note at top.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
        ensure -- from EV_DRAWABLE
            line_width_assigned: line_width = a_width

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tile (a_pixmap: EV_PIXMAP)
            -- Set tile used to fill figures.
            -- Set to Void to use background_color to fill.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
        ensure -- from EV_DRAWABLE
            tile_assigned: tile /= void

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: EV_PIXMAP)
            -- Update Current to have same appearence as other.
            -- (So as to satisfy is_equal.)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    save_to_named_file (a_format: EV_GRAPHICAL_FORMAT; a_filename: FILE_NAME)
            -- Save Current to a_filename in format a_format.
        require
            not_destroyed: not is_destroyed
            a_format_not_void: a_format /= void
            a_filename_not_void: a_filename /= void

feature -- Basic Operations

    flush
            -- Execute any delayed calls to expose_actions without waiting
            -- for next idle.
        require
            not_destroyed: not is_destroyed

feature -- Clearing operations

    clear
            -- Erase Current with background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    clear_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height in background_color.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature  -- Contract support

    valid_drawing_mode (a_mode: INTEGER): BOOLEAN
            -- Is a_mode a valid drawing mode?
            -- (from EV_DRAWABLE_CONSTANTS)

feature -- Drawing mode setting

    set_and_mode
            -- Set drawing_mode to bitwise AND.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_and

    set_copy_mode
            -- Set drawing_mode to normal.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_copy

    set_invert_mode
            -- Set drawing_mode to bitwise invert.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_invert

    set_or_mode
            -- Set drawing_mode to bitwise OR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_or

    set_xor_mode
            -- Set drawing_mode to bitwise XOR.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DRAWABLE
            drawing_mode_assigned: drawing_mode = drawing_mode_xor

feature -- Drawing operations

    draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- Angles are measured in radians, and go
            -- counterclockwise from the 3 o'clock angle.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_width >= 0

    draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Draw an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Draw part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the
            -- 3 o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
            -- Draw a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void

    draw_point (x, y: INTEGER)
            -- Draw point at (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
            -- Draw line segments between subsequent points in
            -- points. If is_closed draw line segment between first
            -- and last point in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    draw_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

    draw_segment (x1, y1, x2, y2: INTEGER)
            -- Draw line segment from (x1, y1) to (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_straight_line (x1, y1, x2, y2: INTEGER)
            -- Draw infinite straight line through (x1, y1) and
            -- (x2, y2).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed

    draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
            -- Draw area of a_pixmap with upper-left corner on (x, y).
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_pixmap_not_void: a_pixmap /= void
            area_not_void: area /= void

    draw_text (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with left of baseline at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

    draw_text_top_left (x, y: INTEGER; a_text: STRING)
            -- Draw a_text with top left corner at (x, y) using font.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void

feature -- Drawing operations (filled)

    fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
            -- Fill an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
            -- Fill part of an ellipse defined by a rectangular area with an
            -- upper left corner at x,y, width a_bounding_width and height
            -- a_bounding_height.
            -- Start at a_start_angle and stop at a_start_angle + an_aperture.
            -- The arc is then closed by two segments through (x, 'y').
            -- Angles are measured in radians, start at the 3
            -- o'clock angle and grow counterclockwise.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_bounding_width_positive_or_zero: a_bounding_width >= 0
            a_bounding_height_positive_or_zero: a_bounding_height >= 0

    fill_polygon (points: ARRAY [EV_COORDINATE])
            -- Draw filled polygon between subsequent points in points.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            points_not_void: points /= void

    fill_rectangle (x, y, a_width, a_height: INTEGER)
            -- Draw filled rectangle with upper-left corner on (x, y)
            -- with size a_width and a_height.
            -- (from EV_DRAWABLE)
        require -- from EV_DRAWABLE
            not_destroyed: not is_destroyed
            a_width_positive_or_zero: a_width >= 0
            a_height_positive_or_zero: a_height >= 0

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    expose_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when an area needs to be redrawn.
            -- (from EV_PIXMAP_ACTION_SEQUENCES)
        ensure -- from EV_PIXMAP_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_DRAWABLE
    line_width_positive_or_zero: is_usable implies line_width >= 0
    drawing_mode_valid: is_usable implies valid_drawing_mode (drawing_mode)
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_PIXMAP


EV_PRIMITIVE Chart

deferred class
    EV_PRIMITIVE

General
    cluster: vision2.interface.widgets.primitives
    description: "Base class for simple, non container widgets."
    keywords: "widget, primitive"

Ancestors
    EV_TOOLTIPABLE
    EV_WIDGET

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_PRIMITIVE)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_PRIMITIVE Flat contracts

indexing
    description: "Base class for simple, non container widgets."
    status: "See notice at end of class"
    keywords: "widget, primitive"
    date: "$Date: 2001/07/14 11:02:46 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_PRIMITIVE

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_PRIMITIVE


EV_PROGRESS_BAR Chart

deferred class
    EV_PROGRESS_BAR

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Base class for bar graph gauges that display progress of a process.
        See EV_HORIZONTAL_PROGRESS_BAR and EV_VERTICAL_PROGRESS_BAR"
    keywords: "status, progress, bar"

Ancestors
    EV_GAUGE

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_segmented: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_PROGRESS_BAR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_segmentation
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_segmentation
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_PROGRESS_BAR Flat contracts

indexing
    description: "Base class for bar graph gauges that display progress of a process.See EV_HORIZONTAL_PROGRESS_BAR and EV_VERTICAL_PROGRESS_BAR"
    status: "See notice at end of class"
    keywords: "status, progress, bar"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_PROGRESS_BAR

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_segmented: BOOLEAN
            -- Is display segmented?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_segmented

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_segmentation
            -- Display continuous bar.
        require
            not_destroyed: not is_destroyed
        ensure
            not_is_segmented: not is_segmented

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_segmentation
            -- Divide display of bar into segments.
        require
            not_destroyed: not is_destroyed
        ensure
            is_segmented: is_segmented

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_PROGRESS_BAR


EV_RADIO_BUTTON Chart

class
    EV_RADIO_BUTTON

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Toggle button with state displayed as a circular check box.
        `is_selected' is mutually exclusive with respect to otherradio buttons in `parent' container."
    keywords: "toggle, radio, button"
    create: make_with_text, make_with_text_and_action, default_create

Ancestors
    EV_BUTTON
    EV_RADIO_PEER
    EV_SELECTABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    peers: LINKED_LIST [[like Current] EV_RADIO_BUTTON]
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    selected_peer: [like Current] EV_RADIO_BUTTON
    target_name: STRING
    text: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_RADIO_BUTTON)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_select
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_RADIO_BUTTON Flat contracts

indexing
    description: "Toggle button with state displayed as a circular check box.`is_selected' is mutually exclusive with respect to otherradio buttons in `parent' container."
    appearance: " (*) `text' "
    status: "See notice at end of class"
    keywords: "toggle, radio, button"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_RADIO_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_text_and_action (a_text: STRING; an_action: PROCEDURE [ANY, TUPLE])
            -- Create with 'a_text' as text and an_action in select_actions.
            -- (from EV_BUTTON)
        require -- from EV_BUTTON
            text_not_void: a_text /= void
            an_action_not_void: an_action /= void
        ensure -- from EV_BUTTON
            text_assigned: text.is_equal (a_text)
            select_actions_has_an_action: select_actions.has (an_action)

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    peers: LINKED_LIST [like Current]
            -- All radio items in the group Current is in.
            -- Includes Current.
            -- (from EV_RADIO_PEER)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        ensure -- from EV_RADIO_PEER
            not_void: Result /= void
            bridge_ok: Result.count = implementation.peers.count

    selected_peer: like Current
            -- Item in peers that is currently selected.
            -- (from EV_RADIO_PEER)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        ensure -- from EV_RADIO_PEER
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.selected_peer)

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_RADIO_PEER
            not_destroyed: not is_destroyed
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_RADIO_PEER
            selected_peer_is_current: selected_peer = Current
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_RADIO_PEER
    peers_not_void: peers /= void
    selected_peer_not_void: selected_peer /= void
    peers_returns_new_copy_of_list: peers /= peers
    peers_has_current: peers.has (Current)
    is_selected_equals_selected_peer_is_current: is_selected = (selected_peer = Current)
    one_radio_item_selected: selected_count = 1

end -- class EV_RADIO_BUTTON


EV_RANGE Chart

deferred class
    EV_RANGE

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Interactive range widget. A sliding thumb displays the current `value'and allows it to be adjusted
        See EV_HORIZONTAL_RANGE and EV_VERTICAL_RANGE"
    keywords: "range, slide, adjust"

Ancestors
    EV_GAUGE

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_RANGE)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_RANGE Flat contracts

indexing
    description: "Interactive range widget. A sliding thumb displays the current `value'and allows it to be adjustedSee EV_HORIZONTAL_RANGE and EV_VERTICAL_RANGE"
    status: "See notice at end of class"
    keywords: "range, slide, adjust"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_RANGE

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_RANGE


EV_SCROLL_BAR Chart

deferred class
    EV_SCROLL_BAR

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Base class for interactive scrolling widgets.
        See EV_HORIZONTAL_SCROLL_BAR and EV_VERTICAL_SCROLL_BAR"
    keywords: "scroll, bar, horizontal, vertical, gauge, leap, step, page"

Ancestors
    EV_GAUGE

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_SCROLL_BAR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_SCROLL_BAR Flat contracts

indexing
    description: "Base class for interactive scrolling widgets.See EV_HORIZONTAL_SCROLL_BAR and EV_VERTICAL_SCROLL_BAR"
    status: "See notice at end of class."
    keywords: "scroll, bar, horizontal, vertical, gauge, leap, step, page"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_SCROLL_BAR

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_SCROLL_BAR


EV_SELECT_BUTTON Chart

deferred class
    EV_SELECT_BUTTON

General
    cluster: vision2.interface.widgets.primitives
    description: "Base class for buttons that have two states (See `is_selected')."
    keywords: "state, toggle, button"

Ancestors
    EV_BUTTON

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    text: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_SELECT_BUTTON)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_select
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_SELECT_BUTTON Flat contracts

indexing
    description: "Base class for buttons that have two states (See `is_selected')."
    status: "See notice at end of class"
    keywords: "state, toggle, button"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_SELECT_BUTTON

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_selected: BOOLEAN
            -- Is button depressed?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Set is_selected True.
        require
            not_destroyed: not is_destroyed
        ensure
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_SELECT_BUTTON


EV_SEPARATOR Chart

deferred class
    EV_SEPARATOR

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Base class for simple scored line separator widgets.
        See EV_HORIZONTAL_SEPARATOR and EV_VERTICAL_SEPARATOR"
    keywords: "separator, line, score"

Ancestors
    EV_PRIMITIVE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_SEPARATOR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_SEPARATOR Flat contracts

indexing
    description: "Base class for simple scored line separator widgets.See EV_HORIZONTAL_SEPARATOR and EV_VERTICAL_SEPARATOR"
    status: "See notice at end of class"
    keywords: "separator, line, score"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_SEPARATOR

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_SEPARATOR


EV_SPIN_BUTTON Chart

class
    EV_SPIN_BUTTON

General
    cluster: vision2.interface.widgets.primitives
    description: "Displays `value' and two buttons that allow it to be adjusted up anddown within `range'."
    keywords: "gauge, edit, text, number, up, down"
    create: make_with_value_range, make_with_text, default_create

Ancestors
    EV_GAUGE
    EV_TEXT_FIELD

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    return_actions: EV_NOTIFY_ACTION_SEQUENCE
    text_change_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    capacity: INTEGER
    caret_position: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_selection: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_editable: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    selected_text: STRING
    selection_end: INTEGER
    selection_start: INTEGER
    step: INTEGER
    target_name: STRING
    text: STRING
    text_length: INTEGER
    tooltip: STRING
    valid_caret_position (pos: INTEGER): BOOLEAN
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    append_text (a_text: STRING)
    center_pointer
    copy (other: [like Current] EV_SPIN_BUTTON)
    copy_selection
    cut_selection
    default_create
    delete_selection
    deselect_all
    destroy
    disable_capture
    disable_edit
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_edit
    enable_pebble_positioning
    enable_sensitive
    hide
    insert_text (a_text: STRING)
    leap_backward
    leap_forward
    paste (a_position: INTEGER)
    prepend_text (a_text: STRING)
    remove_help_context
    remove_pebble
    remove_text
    remove_tooltip
    select_all
    select_region (start_pos, end_pos: INTEGER)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_capacity (a_capacity: INTEGER)
    set_caret_position (a_caret_position: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_minimum_width_in_characters (nb: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_SPIN_BUTTON Flat contracts

indexing
    description: "Displays `value' and two buttons that allow it to be adjusted up anddown within `range'."
    status: "See notice at end of class"
    keywords: "gauge, edit, text, number, up, down"
    date: "$Date: 2001/11/13 00:01:52 $"
    revision: "$Revision: 1.5 $"

class interface
    EV_SPIN_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_value_range (a_value_range: INTEGER_INTERVAL)
            -- Create and assign a_value_range to value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            a_value_range_not_void: a_value_range /= void
            a_value_range_not_empty: not a_value_range.is_empty

    make_with_text (a_text: STRING)
            -- Create with a_text.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            a_text_not_void: a_text /= void

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    capacity: INTEGER
            -- Number of characters field can hold.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            not_destroyed: not is_destroyed

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_text: STRING
            -- Currently selected text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result.is_equal (implementation.selected_text)

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text of Current.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    text_length: INTEGER
            -- Number of characters making up text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.text_length

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    caret_position: INTEGER
            -- Current position of caret.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.caret_position

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    has_selection: BOOLEAN
            -- Does current have a selection?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.has_selection

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_editable: BOOLEAN
            -- Is text editable?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.is_editable

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

    selection_end: INTEGER
            -- Index of last character selected
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_end
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_start: Result >= selection_start

    selection_start: INTEGER
            -- Index of first selected character.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_start
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_end: selection_end >= Result

    valid_caret_position (pos: INTEGER): BOOLEAN
            -- Is pos a valid caret position?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.valid_caret_position (pos)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_edit
            -- Make Current read-only.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: not is_editable

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_edit
            -- Make Current editable.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: is_editable

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_caret_position (a_caret_position: INTEGER)
            -- Assign a_caret_posiiton to caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_caret_position: valid_caret_position (a_caret_position)
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            caret_position_assigned: caret_position = a_caret_position

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    append_text (a_text: STRING)
            -- Append a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_appended: check_text_modification (old text, a_text)
            caret_not_moved: old caret_position = caret_position

    insert_text (a_text: STRING)
            -- Insert a_text to right of caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_insert_correctly: text.is_equal ((old text).substring (1, (old caret_position - 1)) + a_text + (old text).substring ((old caret_position), (old text.count)))
            caret_not_moved: old caret_position = caret_position

    prepend_text (a_text: STRING)
            -- Prepend a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_prepended: text.is_equal (a_text + old text)
            caret_not_moved: old caret_position = caret_position

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_capacity (a_capacity: INTEGER)
            -- Assign a_capacity to capacity.
            -- (from EV_TEXT_FIELD)
        require -- from EV_TEXT_FIELD
            not_destroyed: not is_destroyed
            a_capacity_not_negative: a_capacity >= 0

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXT_COMPONENT
            text_set: check_text_modification (void, a_text)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Resizing

    set_minimum_width_in_characters (nb: INTEGER)
            -- Make a minimum of nb of the widest character visible
            -- on one line.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_nb: nb > 0
        ensure -- from EV_TEXT_COMPONENT
            minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    copy_selection
            -- Copy selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            selection_copied: clipboard_content.is_equal (selected_text)
            text_unchanged: text.is_equal (old text)
            caret_not_moved: caret_position = old caret_position

    cut_selection
            -- Move selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            selection_in_clipboard: clipboard_content.is_equal (old selected_text)
            selection_cut: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    delete_selection
            -- Delete current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            has_no_selection: not has_selection
            selection_deleted: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    deselect_all
            -- Unselect the current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            not_has_selection: not has_selection

    paste (a_position: INTEGER)
            -- Insert text from clipboard at a_position.
            -- No effect if clipboard is empty.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            a_position_within_range: a_position >= 1 and a_position <= text_length + 1
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            text_pasted_correctly: text.is_equal ((old text).substring (1, a_position - 1) + clipboard_content + ((old text).substring (a_position, ((old text).count))))
            caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
            caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content.count

    select_all
            -- Select all text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            positive_length: text_length > 0
        ensure -- from EV_TEXT_COMPONENT
            has_selection: has_selection
            selection_start_set: selection_start = 1
            selection_end_set: selection_end = text_length

    select_region (start_pos, end_pos: INTEGER)
            -- Select text between start_pos and end_pos inclusive.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            start_within_range: start_pos >= 1 and start_pos <= text_length
            end_within_range: end_pos >= 1 and end_pos <= text_length
        ensure -- from EV_TEXT_COMPONENT
            has_selection: (start_pos /= end_pos) implies has_selection
            selection_start_set: selection_start = start_pos
            selection_end_set: selection_end = end_pos

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    text_change_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when text changes.
            -- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    return_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when return key is pressed.
            -- (from EV_TEXT_FIELD_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_FIELD_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXT_FIELD
    capacity_not_negative: capacity >= 0
        -- from EV_TEXT_COMPONENT
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_SPIN_BUTTON


EV_TEXT_COMPONENT Chart

deferred class
    EV_TEXT_COMPONENT

General
    cluster: vision2.interface.widgets.primitives
    description: "Eiffel Vision text component. Base class for text editing widgets."

Ancestors
    EV_PRIMITIVE
    EV_TEXT_COMPONENT_ACTION_SEQUENCES

Action sequences
    change_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    caret_position: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_selection: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_editable: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    selected_text: STRING
    selection_end: INTEGER
    selection_start: INTEGER
    target_name: STRING
    text: STRING
    text_length: INTEGER
    tooltip: STRING
    valid_caret_position (pos: INTEGER): BOOLEAN
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    append_text (a_text: STRING)
    center_pointer
    copy (other: [like Current] EV_TEXT_COMPONENT)
    copy_selection
    cut_selection
    default_create
    delete_selection
    deselect_all
    destroy
    disable_capture
    disable_edit
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_edit
    enable_pebble_positioning
    enable_sensitive
    hide
    insert_text (a_text: STRING)
    paste (a_position: INTEGER)
    prepend_text (a_text: STRING)
    remove_help_context
    remove_pebble
    remove_text
    remove_tooltip
    select_all
    select_region (start_pos, end_pos: INTEGER)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_caret_position (a_caret_position: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_minimum_width_in_characters (nb: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show

Constraints
    text not void implies text not empty


EV_TEXT_COMPONENT Flat contracts

indexing
    description: "Eiffel Vision text component. Base class for text editing widgets."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    EV_TEXT_COMPONENT

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_text: STRING
            -- Currently selected text.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result.is_equal (implementation.selected_text)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text of Current.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    text_length: INTEGER
            -- Number of characters making up text.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.text_length

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    caret_position: INTEGER
            -- Current position of caret.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.caret_position

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    has_selection: BOOLEAN
            -- Does current have a selection?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.has_selection

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_editable: BOOLEAN
            -- Is text editable?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.is_editable

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    selection_end: INTEGER
            -- Index of last character selected
        require
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure
            bridge_ok: Result = implementation.selection_end
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_start: Result >= selection_start

    selection_start: INTEGER
            -- Index of first selected character.
        require
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure
            bridge_ok: Result = implementation.selection_start
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_end: selection_end >= Result

    valid_caret_position (pos: INTEGER): BOOLEAN
            -- Is pos a valid caret position?
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.valid_caret_position (pos)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_edit
            -- Make Current read-only.
        require
            not_destroyed: not is_destroyed
        ensure
            is_editable: not is_editable

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_edit
            -- Make Current editable.
        require
            not_destroyed: not is_destroyed
        ensure
            is_editable: is_editable

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_caret_position (a_caret_position: INTEGER)
            -- Assign a_caret_posiiton to caret_position.
        require
            not_destroyed: not is_destroyed
            valid_caret_position: valid_caret_position (a_caret_position)
            is_editable: is_editable
        ensure
            caret_position_assigned: caret_position = a_caret_position

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    append_text (a_text: STRING)
            -- Append a_text to text.
        require
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure
            text_appended: check_text_modification (old text, a_text)
            caret_not_moved: old caret_position = caret_position

    insert_text (a_text: STRING)
            -- Insert a_text to right of caret_position.
        require
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure
            text_insert_correctly: text.is_equal ((old text).substring (1, (old caret_position - 1)) + a_text + (old text).substring ((old caret_position), (old text.count)))
            caret_not_moved: old caret_position = caret_position

    prepend_text (a_text: STRING)
            -- Prepend a_text to text.
        require
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure
            text_prepended: text.is_equal (a_text + old text)
            caret_not_moved: old caret_position = caret_position

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
        require
            not_destroyed: not is_destroyed
        ensure
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
        require
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
            a_text_not_empty: not a_text.is_empty
        ensure
            text_set: check_text_modification (void, a_text)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Resizing

    set_minimum_width_in_characters (nb: INTEGER)
            -- Make a minimum of nb of the widest character visible
            -- on one line.
        require
            not_destroyed: not is_destroyed
            valid_nb: nb > 0
        ensure
            minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    copy_selection
            -- Copy selected_text to clipboard.
        require
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure
            selection_copied: clipboard_content.is_equal (selected_text)
            text_unchanged: text.is_equal (old text)
            caret_not_moved: caret_position = old caret_position

    cut_selection
            -- Move selected_text to clipboard.
        require
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure
            selection_in_clipboard: clipboard_content.is_equal (old selected_text)
            selection_cut: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    delete_selection
            -- Delete current selection.
        require
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure
            has_no_selection: not has_selection
            selection_deleted: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    deselect_all
            -- Unselect the current selection.
        require
            not_destroyed: not is_destroyed
        ensure
            not_has_selection: not has_selection

    paste (a_position: INTEGER)
            -- Insert text from clipboard at a_position.
            -- No effect if clipboard is empty.
        require
            not_destroyed: not is_destroyed
            a_position_within_range: a_position >= 1 and a_position <= text_length + 1
            is_editable: is_editable
        ensure
            text_pasted_correctly: text.is_equal ((old text).substring (1, a_position - 1) + clipboard_content + ((old text).substring (a_position, ((old text).count))))
            caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
            caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content.count

    select_all
            -- Select all text.
        require
            not_destroyed: not is_destroyed
            positive_length: text_length > 0
        ensure
            has_selection: has_selection
            selection_start_set: selection_start = 1
            selection_end_set: selection_end = text_length

    select_region (start_pos, end_pos: INTEGER)
            -- Select text between start_pos and end_pos inclusive.
        require
            not_destroyed: not is_destroyed
            start_within_range: start_pos >= 1 and start_pos <= text_length
            end_within_range: end_pos >= 1 and end_pos <= text_length
        ensure
            has_selection: (start_pos /= end_pos) implies has_selection
            selection_start_set: selection_start = start_pos
            selection_end_set: selection_end = end_pos

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when text changes.
            -- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_TEXT_COMPONENT


EV_TEXT_FIELD Chart

class
    EV_TEXT_FIELD

General
    cluster: vision2.interface.widgets.primitives
    description: "Input field for a single line of `text'."
    keywords: "input, text, field, query"
    create: make_with_text, default_create

Ancestors
    EV_TEXT_COMPONENT
    EV_TEXT_FIELD_ACTION_SEQUENCES

Action sequences
    change_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    return_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    capacity: INTEGER
    caret_position: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_selection: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_editable: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    selected_text: STRING
    selection_end: INTEGER
    selection_start: INTEGER
    target_name: STRING
    text: STRING
    text_length: INTEGER
    tooltip: STRING
    valid_caret_position (pos: INTEGER): BOOLEAN
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    append_text (a_text: STRING)
    center_pointer
    copy (other: [like Current] EV_TEXT_FIELD)
    copy_selection
    cut_selection
    default_create
    delete_selection
    deselect_all
    destroy
    disable_capture
    disable_edit
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_edit
    enable_pebble_positioning
    enable_sensitive
    hide
    insert_text (a_text: STRING)
    paste (a_position: INTEGER)
    prepend_text (a_text: STRING)
    remove_help_context
    remove_pebble
    remove_text
    remove_tooltip
    select_all
    select_region (start_pos, end_pos: INTEGER)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_capacity (a_capacity: INTEGER)
    set_caret_position (a_caret_position: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_minimum_width_in_characters (nb: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show

Constraints
    capacity not negative


EV_TEXT_FIELD Flat contracts

indexing
    description: "Input field for a single line of `text'."
    appearance: "+-------------+| 'text'      |+-------------+"
    status: "See notice at end of class"
    keywords: "input, text, field, query"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_TEXT_FIELD

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create with a_text.
        require
            a_text_not_void: a_text /= void

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    capacity: INTEGER
            -- Number of characters field can hold.
        require
            not_destroyed: not is_destroyed

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_text: STRING
            -- Currently selected text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result.is_equal (implementation.selected_text)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text of Current.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    text_length: INTEGER
            -- Number of characters making up text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.text_length

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    caret_position: INTEGER
            -- Current position of caret.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.caret_position

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    has_selection: BOOLEAN
            -- Does current have a selection?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.has_selection

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_editable: BOOLEAN
            -- Is text editable?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.is_editable

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    selection_end: INTEGER
            -- Index of last character selected
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_end
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_start: Result >= selection_start

    selection_start: INTEGER
            -- Index of first selected character.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_start
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_end: selection_end >= Result

    valid_caret_position (pos: INTEGER): BOOLEAN
            -- Is pos a valid caret position?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.valid_caret_position (pos)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_edit
            -- Make Current read-only.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: not is_editable

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_edit
            -- Make Current editable.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: is_editable

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_caret_position (a_caret_position: INTEGER)
            -- Assign a_caret_posiiton to caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_caret_position: valid_caret_position (a_caret_position)
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            caret_position_assigned: caret_position = a_caret_position

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    append_text (a_text: STRING)
            -- Append a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_appended: check_text_modification (old text, a_text)
            caret_not_moved: old caret_position = caret_position

    insert_text (a_text: STRING)
            -- Insert a_text to right of caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_insert_correctly: text.is_equal ((old text).substring (1, (old caret_position - 1)) + a_text + (old text).substring ((old caret_position), (old text.count)))
            caret_not_moved: old caret_position = caret_position

    prepend_text (a_text: STRING)
            -- Prepend a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_prepended: text.is_equal (a_text + old text)
            caret_not_moved: old caret_position = caret_position

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_capacity (a_capacity: INTEGER)
            -- Assign a_capacity to capacity.
        require
            not_destroyed: not is_destroyed
            a_capacity_not_negative: a_capacity >= 0

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXT_COMPONENT
            text_set: check_text_modification (void, a_text)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Resizing

    set_minimum_width_in_characters (nb: INTEGER)
            -- Make a minimum of nb of the widest character visible
            -- on one line.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_nb: nb > 0
        ensure -- from EV_TEXT_COMPONENT
            minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    copy_selection
            -- Copy selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            selection_copied: clipboard_content.is_equal (selected_text)
            text_unchanged: text.is_equal (old text)
            caret_not_moved: caret_position = old caret_position

    cut_selection
            -- Move selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            selection_in_clipboard: clipboard_content.is_equal (old selected_text)
            selection_cut: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    delete_selection
            -- Delete current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            has_no_selection: not has_selection
            selection_deleted: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    deselect_all
            -- Unselect the current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            not_has_selection: not has_selection

    paste (a_position: INTEGER)
            -- Insert text from clipboard at a_position.
            -- No effect if clipboard is empty.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            a_position_within_range: a_position >= 1 and a_position <= text_length + 1
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            text_pasted_correctly: text.is_equal ((old text).substring (1, a_position - 1) + clipboard_content + ((old text).substring (a_position, ((old text).count))))
            caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
            caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content.count

    select_all
            -- Select all text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            positive_length: text_length > 0
        ensure -- from EV_TEXT_COMPONENT
            has_selection: has_selection
            selection_start_set: selection_start = 1
            selection_end_set: selection_end = text_length

    select_region (start_pos, end_pos: INTEGER)
            -- Select text between start_pos and end_pos inclusive.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            start_within_range: start_pos >= 1 and start_pos <= text_length
            end_within_range: end_pos >= 1 and end_pos <= text_length
        ensure -- from EV_TEXT_COMPONENT
            has_selection: (start_pos /= end_pos) implies has_selection
            selection_start_set: selection_start = start_pos
            selection_end_set: selection_end = end_pos

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when text changes.
            -- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    return_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when return key is pressed.
            -- (from EV_TEXT_FIELD_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_FIELD_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

    capacity_not_negative: capacity >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TEXT_COMPONENT
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_TEXT_FIELD


EV_TEXT Chart

class
    EV_TEXT

General
    cluster: vision2.interface.widgets.primitives
    description: "EiffelVision text area. To query multiple lines of text from the user."
    create: make_with_text, default_create

Ancestors
    EV_TEXT_COMPONENT

Action sequences
    change_actions: EV_NOTIFY_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    caret_position: INTEGER
    current_line_number: INTEGER
    data: ANY
    deny_cursor: EV_CURSOR
    first_position_from_line_number (i: INTEGER): INTEGER
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_selection: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_editable: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    last_line_not_empty: BOOLEAN
    last_position_from_line_number (i: INTEGER): INTEGER
    line (i: INTEGER): STRING
    line_count: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    search (str: STRING; start: INTEGER): INTEGER
    selected_text: STRING
    selection_end: INTEGER
    selection_start: INTEGER
    target_name: STRING
    text: STRING
    text_length: INTEGER
    tooltip: STRING
    valid_caret_position (pos: INTEGER): BOOLEAN
    valid_line_index (i: INTEGER): BOOLEAN
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    append_text (a_text: STRING)
    center_pointer
    copy (other: [like Current] EV_TEXT)
    copy_selection
    cut_selection
    default_create
    delete_selection
    deselect_all
    destroy
    disable_capture
    disable_edit
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_edit
    enable_pebble_positioning
    enable_sensitive
    hide
    insert_text (a_text: STRING)
    paste (a_position: INTEGER)
    prepend_text (a_text: STRING)
    put_new_line
    remove_help_context
    remove_pebble
    remove_text
    remove_tooltip
    scroll_to_line (i: INTEGER)
    select_all
    select_lines (first_line, last_line: INTEGER)
    select_region (start_pos, end_pos: INTEGER)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_caret_position (a_caret_position: INTEGER)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_minimum_width_in_characters (nb: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_TEXT Flat contracts

indexing
    description: "EiffelVision text area. To query multiple lines of text from the user."
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_TEXT

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (txt: STRING)
            -- Create Current with txt assigned to text.
        require
            txt_not_void: txt /= void

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    line (i: INTEGER): STRING
            -- Result is content of ith line.
        require
            not_destroyed: not is_destroyed
            valid_line_index: valid_line_index (i) and then (i = line_count implies last_line_not_empty)
        ensure
            result_not_void: Result /= void

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_text: STRING
            -- Currently selected text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result.is_equal (implementation.selected_text)

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text of Current.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    text_length: INTEGER
            -- Number of characters making up text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.text_length

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    caret_position: INTEGER
            -- Current position of caret.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.caret_position

    current_line_number: INTEGER
            -- Line currently containing cursor.
        require
            not_destroyed: not is_destroyed
        ensure
            valid_line_index: valid_line_index (Result)

    first_position_from_line_number (i: INTEGER): INTEGER
            -- Position of first character on i-th line.
        require
            not_destroyed: not is_destroyed
            valid_line: valid_line_index (i) and then (i = line_count implies last_line_not_empty)
        ensure
            valid_caret_position: valid_caret_position (i)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    has_selection: BOOLEAN
            -- Does current have a selection?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.has_selection

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_editable: BOOLEAN
            -- Is text editable?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.is_editable

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    last_position_from_line_number (i: INTEGER): INTEGER
            -- Position of last character on i-th line.
        require
            not_destroyed: not is_destroyed
            valid_line: valid_line_index (i) and then (i = line_count implies last_line_not_empty)
        ensure
            valid_caret_position: valid_caret_position (i)

    line_count: INTEGER
            -- Number of lines in Current.
        require
            not_destroyed: not is_destroyed
        ensure
            result_greater_zero: Result > 0

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    selection_end: INTEGER
            -- Index of last character selected
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_end
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_start: Result >= selection_start

    selection_start: INTEGER
            -- Index of first selected character.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.selection_start
            within_range: Result >= 1 and Result <= text_length
            consistent_with_selection_end: selection_end >= Result

    valid_caret_position (pos: INTEGER): BOOLEAN
            -- Is pos a valid caret position?
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            bridge_ok: Result = implementation.valid_caret_position (pos)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_edit
            -- Make Current read-only.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: not is_editable

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_edit
            -- Make Current editable.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            is_editable: is_editable

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_caret_position (a_caret_position: INTEGER)
            -- Assign a_caret_posiiton to caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_caret_position: valid_caret_position (a_caret_position)
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            caret_position_assigned: caret_position = a_caret_position

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    append_text (a_text: STRING)
            -- Append a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_appended: check_text_modification (old text, a_text)
            caret_not_moved: old caret_position = caret_position

    insert_text (a_text: STRING)
            -- Insert a_text to right of caret_position.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_insert_correctly: text.is_equal ((old text).substring (1, (old caret_position - 1)) + a_text + (old text).substring ((old caret_position), (old text.count)))
            caret_not_moved: old caret_position = caret_position

    prepend_text (a_text: STRING)
            -- Prepend a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
        ensure -- from EV_TEXT_COMPONENT
            text_prepended: text.is_equal (a_text + old text)
            caret_not_moved: old caret_position = caret_position

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            text_not_void: a_text /= void
            no_carriage_returns: not a_text.has ('%R')
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXT_COMPONENT
            text_set: check_text_modification (void, a_text)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Resizing

    set_minimum_width_in_characters (nb: INTEGER)
            -- Make a minimum of nb of the widest character visible
            -- on one line.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            valid_nb: nb > 0
        ensure -- from EV_TEXT_COMPONENT
            minimum_width_in_characters_assigned: old minimum_width < minimum_width implies minimum_width >= maximum_character_width * nb

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic operation

    copy_selection
            -- Copy selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
        ensure -- from EV_TEXT_COMPONENT
            selection_copied: clipboard_content.is_equal (selected_text)
            text_unchanged: text.is_equal (old text)
            caret_not_moved: caret_position = old caret_position

    cut_selection
            -- Move selected_text to clipboard.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            selection_in_clipboard: clipboard_content.is_equal (old selected_text)
            selection_cut: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    delete_selection
            -- Delete current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            has_selection: has_selection
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            has_no_selection: not has_selection
            selection_deleted: text.is_equal ((old text).substring (1, old selection_start - 1) + (old text).substring (old selection_end + 1, (old text).count))

    deselect_all
            -- Unselect the current selection.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXT_COMPONENT
            not_has_selection: not has_selection

    paste (a_position: INTEGER)
            -- Insert text from clipboard at a_position.
            -- No effect if clipboard is empty.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            a_position_within_range: a_position >= 1 and a_position <= text_length + 1
            is_editable: is_editable
        ensure -- from EV_TEXT_COMPONENT
            text_pasted_correctly: text.is_equal ((old text).substring (1, a_position - 1) + clipboard_content + ((old text).substring (a_position, ((old text).count))))
            caret_position_consistent: old caret_position <= a_position implies caret_position = old caret_position
            caret_position_consistent: old caret_position > a_position implies caret_position = old caret_position + clipboard_content.count

    put_new_line
            -- Insert return character at caret_position.
        require
            not_destroyed: not is_destroyed

    scroll_to_line (i: INTEGER)
            -- Ensure that line i is visible in Current.
        require
            not_destroyed: not is_destroyed
            valid_line_index: valid_line_index (i) and then (i = line_count implies last_line_not_empty)

    search (str: STRING; start: INTEGER): INTEGER
            -- Position of first occurrence of str at or after start;
            -- 0 if none.
        require
            not_destroyed: not is_destroyed
            valid_string: str /= void

    select_all
            -- Select all text.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            positive_length: text_length > 0
        ensure -- from EV_TEXT_COMPONENT
            has_selection: has_selection
            selection_start_set: selection_start = 1
            selection_end_set: selection_end = text_length

    select_lines (first_line, last_line: INTEGER)
            -- Select all lines from first_line to last_line.
        require
            not_destroyed: not is_destroyed
            valid_line_index: valid_line_index (first_line) and valid_line_index (last_line)
        ensure
            has_selection: has_selection

    select_region (start_pos, end_pos: INTEGER)
            -- Select text between start_pos and end_pos inclusive.
            -- (from EV_TEXT_COMPONENT)
        require -- from EV_TEXT_COMPONENT
            not_destroyed: not is_destroyed
            start_within_range: start_pos >= 1 and start_pos <= text_length
            end_within_range: end_pos >= 1 and end_pos <= text_length
        ensure -- from EV_TEXT_COMPONENT
            has_selection: (start_pos /= end_pos) implies has_selection
            selection_start_set: selection_start = start_pos
            selection_end_set: selection_end = end_pos

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    last_line_not_empty: BOOLEAN
            -- Has last line at least one character?

    valid_line_index (i: INTEGER): BOOLEAN
            -- Is i a valid line index?

feature -- Event handling

    change_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when text changes.
            -- (from EV_TEXT_COMPONENT_ACTION_SEQUENCES)
        ensure -- from EV_TEXT_COMPONENT_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_TEXT_COMPONENT
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_TEXT


EV_TOGGLE_BUTTON Chart

class
    EV_TOGGLE_BUTTON

General
    cluster: vision2.interface.widgets.primitives
    description: "Button that toggles between states each time it is pressed."
    keywords: "toggle, button"
    create: make_with_text, make_with_text_and_action, default_create

Ancestors
    EV_BUTTON
    EV_DESELECTABLE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    alignment: EV_TEXT_ALIGNMENT
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_selectable: BOOLEAN
    is_selected: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmap: EV_PIXMAP
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    text: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    align_text_center
    align_text_left
    align_text_right
    center_pointer
    copy (other: [like Current] EV_TOGGLE_BUTTON)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_select
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_select
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_pixmap
    remove_text
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmap (a_pixmap: EV_PIXMAP)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_text (a_text: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    toggle


EV_TOGGLE_BUTTON Flat contracts

indexing
    description: "Button that toggles between states each time it is pressed."
    appearance: " ------------ |   `text'   | ============"
    status: "See notice at end of class"
    keywords: "toggle, button"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_TOGGLE_BUTTON

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_text (a_text: STRING)
            -- Create Current and assign a_text to text
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_assigned: text.is_equal (a_text) and text /= a_text

    make_with_text_and_action (a_text: STRING; an_action: PROCEDURE [ANY, TUPLE])
            -- Create with 'a_text' as text and an_action in select_actions.
            -- (from EV_BUTTON)
        require -- from EV_BUTTON
            text_not_void: a_text /= void
            an_action_not_void: an_action /= void
        ensure -- from EV_BUTTON
            text_assigned: text.is_equal (a_text)
            select_actions_has_an_action: select_actions.has (an_action)

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    alignment: EV_TEXT_ALIGNMENT
            -- Current text positioning.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_not_void: Result /= void

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pixmap: EV_PIXMAP
            -- Image displayed on Current.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            bridge_ok: (Result = void and implementation.pixmap = void) or Result.is_equal (implementation.pixmap)

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    text: STRING
            -- Text displayed in textable.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            bridge_ok: equal (Result, implementation.text)
            not_void_implies_cloned: Result /= void implies Result /= implementation.text

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_selectable: BOOLEAN
            -- May enable_select be called.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed

    is_selected: BOOLEAN
            -- Is selected.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_SELECTABLE
            bridge_ok: Result = implementation.is_selected

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    align_text_center
            -- Display text centered.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_center_aligned

    align_text_left
            -- Display text left aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_left_aligned

    align_text_right
            -- Display text right aligned.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            alignment_set: alignment.is_right_aligned

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_select
            -- Deselect the object.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_DESELECTABLE
            unselected: not is_selected

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_select
            -- Make is_selected True.
            -- (from EV_SELECTABLE)
        require -- from EV_SELECTABLE
            not_destroyed: not is_destroyed
            is_selectable: is_selectable
        ensure -- from EV_SELECTABLE
            is_selected: is_selected

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    toggle
            -- Change is_selected.
            -- (from EV_DESELECTABLE)
        require -- from EV_DESELECTABLE
            not_is_destroyed: not is_destroyed
            can_be_selected: not is_selected implies is_selectable
        ensure -- from EV_DESELECTABLE
            is_selected_changed: is_selected /= old is_selected

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_pixmap
            -- Make pixmap Void.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PIXMAPABLE
            pixmap_removed: pixmap = void

    remove_text
            -- Make text Void.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TEXTABLE
            text_removed: text = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pixmap (a_pixmap: EV_PIXMAP)
            -- Assign a_pixmap to pixmap.
            -- (from EV_PIXMAPABLE)
        require -- from EV_PIXMAPABLE
            not_destroyed: not is_destroyed
            pixmap_not_void: a_pixmap /= void
        ensure -- from EV_PIXMAPABLE
            pixmap_assigned: a_pixmap.is_equal (pixmap) and pixmap /= a_pixmap

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_text (a_text: STRING)
            -- Assign a_text to text.
            -- (from EV_TEXTABLE)
        require -- from EV_TEXTABLE
            not_destroyed: not is_destroyed
            a_text_not_void: a_text /= void
            a_text_not_empty: not a_text.is_empty
        ensure -- from EV_TEXTABLE
            text_cloned: text.is_equal (a_text) and then text /= a_text

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when button is pressed then released.
            -- (from EV_BUTTON_ACTION_SEQUENCES)
        ensure -- from EV_BUTTON_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0
        -- from EV_DESELECTABLE
    not_selectable_therefore_not_selected: not is_selectable implies not is_selected

end -- class EV_TOGGLE_BUTTON


EV_TOOL_BAR Chart

class
    EV_TOOL_BAR

General
    cluster: vision2.interface.widgets.primitives
    description: "EiffelVision toolbar. Can only contain tool bar items."
    create: default_create

Ancestors
    EV_ITEM_LIST [G -> EV_ITEM]
    EV_PRIMITIVE

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_TOOL_BAR_ITEM
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TOOL_BAR_ITEM]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] EV_TOOL_BAR_ITEM
    for_all (test: FUNCTION [ANY, TUPLE [EV_TOOL_BAR_ITEM], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_TOOL_BAR_ITEM): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_TOOL_BAR_ITEM
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_TOOL_BAR_ITEM; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_TOOL_BAR): BOOLEAN
    is_inserted (v: EV_TOOL_BAR_ITEM): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_TOOL_BAR_ITEM
    item_by_data (some_data: ANY): [like item] EV_TOOL_BAR_ITEM
    last: [like item] EV_TOOL_BAR_ITEM
    linear_representation: LINEAR [EV_TOOL_BAR_ITEM]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_TOOL_BAR_ITEM): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    sequential_occurrences (v: EV_TOOL_BAR_ITEM): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_TOOL_BAR_ITEM], BOOLEAN]): BOOLEAN
    tooltip: STRING
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_TOOL_BAR_ITEM])
    back
    center_pointer
    compare_objects
    compare_references
    copy (other: [like Current] EV_TOOL_BAR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_TOOL_BAR_ITEM]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_TOOL_BAR_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_TOOL_BAR_ITEM], BOOLEAN])
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    extend (v: [like item] EV_TOOL_BAR_ITEM)
    fill (other: CONTAINER [EV_TOOL_BAR_ITEM])
    finish
    force (v: [like item] EV_TOOL_BAR_ITEM)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_TOOL_BAR)
    merge_right (other: [like Current] EV_TOOL_BAR)
    move (i: INTEGER)
    prune (v: [like item] EV_TOOL_BAR_ITEM)
    prune_all (v: [like item] EV_TOOL_BAR_ITEM)
    put (v: [like item] EV_TOOL_BAR_ITEM)
    put_front (v: [like item] EV_TOOL_BAR_ITEM)
    put_i_th (v: [like item] EV_TOOL_BAR_ITEM; i: INTEGER)
    put_left (v: [like item] EV_TOOL_BAR_ITEM)
    put_right (v: [like item] EV_TOOL_BAR_ITEM)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    remove_tooltip
    replace (v: [like item] EV_TOOL_BAR_ITEM)
    search (v: [like item] EV_TOOL_BAR_ITEM)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_TOOL_BAR Flat contracts

indexing
    description: "EiffelVision toolbar. Can only contain tool bar items."
    status: "See notice at end of class."
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.6 $"

class interface
    EV_TOOL_BAR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TOOL_BAR_ITEM]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.implementation)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_TOOL_BAR_ITEM
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_TOOL_BAR_ITEM
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data(some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_TOOL_BAR_ITEM): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_TOOL_BAR_ITEM): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_TOOL_BAR_ITEM])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_TOOL_BAR_ITEM])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_TOOL_BAR_ITEM]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_TOOL_BAR_ITEM]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_TOOL_BAR_ITEM]]; test: FUNCTION [ANY, TUPLE [EV_TOOL_BAR_ITEM], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_TOOL_BAR_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_TOOL_BAR_ITEM], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_TOOL_BAR


EV_TREE Chart

class
    EV_TREE

General
    cluster: vision2.interface.widgets.primitives
    description: "EiffelVision tree."
    keywords: "tree, container"
    create: default_create

Ancestors
    EV_PRIMITIVE
    EV_TREE_ACTION_SEQUENCES
    EV_TREE_NODE_CONTAINER
    EV_TREE_NODE_LIST

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
    select_actions: EV_NOTIFY_ACTION_SEQUENCE

Queries
    infix "@" (i: INTEGER): [like item] EV_TREE_NODE
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    after: BOOLEAN
    background_color: EV_COLOR
    before: BOOLEAN
    Changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TREE_NODE]
    data: ANY
    deny_cursor: EV_CURSOR
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    find_item_recursively_by_data (some_data: ANY): EV_TREE_NODE
    first: [like item] EV_TREE_NODE
    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    foreground_color: EV_COLOR
    Full: BOOLEAN
    has (v: [like item] EV_TREE_NODE): BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_recursively (an_item: EV_TREE_ITEM): BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    i_th (i: INTEGER): EV_TREE_NODE
    id_object (an_id: INTEGER): IDENTIFIED
    index: INTEGER
    index_of (v: [like item] EV_TREE_NODE; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] EV_TREE): BOOLEAN
    is_inserted (v: EV_TREE_NODE): BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: EV_TREE_NODE
    item_by_data (some_data: ANY): [like item] EV_TREE_NODE
    last: [like item] EV_TREE_NODE
    linear_representation: LINEAR [EV_TREE_NODE]
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_comparison: BOOLEAN
    object_id: INTEGER
    occurrences (v: [like item] EV_TREE_NODE): INTEGER
    off: BOOLEAN
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pixmaps_height: INTEGER
    pixmaps_width: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    prunable: BOOLEAN
    readable: BOOLEAN
    same (other: EV_ANY): BOOLEAN
    screen_x: INTEGER
    screen_y: INTEGER
    selected: BOOLEAN
    selected_item: EV_TREE_NODE
    sequential_occurrences (v: EV_TREE_NODE): INTEGER
    target_name: STRING
    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
    tooltip: STRING
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    width: INTEGER
    writable: BOOLEAN
    x_position: INTEGER
    y_position: INTEGER

Commands
    append (s: SEQUENCE [EV_TREE_NODE])
    back
    center_pointer
    compare_objects
    compare_references
    copy (other: [like Current] EV_TREE)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    ensure_item_visible (an_item: EV_TREE_ITEM)
    extend (v: [like item] EV_TREE_NODE)
    fill (other: CONTAINER [EV_TREE_NODE])
    finish
    force (v: [like item] EV_TREE_NODE)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    hide
    merge_left (other: [like Current] EV_TREE)
    merge_right (other: [like Current] EV_TREE)
    move (i: INTEGER)
    prune (v: [like item] EV_TREE_NODE)
    prune_all (v: [like item] EV_TREE_NODE)
    put (v: [like item] EV_TREE_NODE)
    put_front (v: [like item] EV_TREE_NODE)
    put_i_th (v: [like item] EV_TREE_NODE; i: INTEGER)
    put_left (v: [like item] EV_TREE_NODE)
    put_right (v: [like item] EV_TREE_NODE)
    remove
    remove_help_context
    remove_left
    remove_pebble
    remove_right
    remove_tooltip
    replace (v: [like item] EV_TREE_NODE)
    search (v: [like item] EV_TREE_NODE)
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pixmaps_size (a_width, a_height: INTEGER)
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show
    start
    swap (i: INTEGER)
    wipe_out


EV_TREE Flat contracts

indexing
    description: "EiffelVision tree."
    status: "See notice at end of class"
    keywords: "tree, container"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_TREE

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    cursor: EV_DYNAMIC_LIST_CURSOR [EV_TREE_NODE]
            -- Current cursor position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.cursor)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    find_item_recursively_by_data (some_data: ANY): EV_TREE_NODE
            -- If data contained in a tree item at any level then
            -- assign this item to Result.

    first: like item
            -- Item at first position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    i_th (i: INTEGER): EV_TREE_NODE
            -- Item at i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result.is_equal (implementation.i_th (i))

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    index: INTEGER
            -- Current position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of ith occurence of v.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.index_of (v, i)

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_DYNAMIC_LIST
            a_list_not_void: a_list /= void
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    item: EV_TREE_NODE
            -- Item at current position.
            -- (from EV_DYNAMIC_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable
        ensure then -- from EV_DYNAMIC_LIST
            not_void: Result /= void
            bridge_ok: Result.is_equal (implementation.item)

    item_by_data (some_data: ANY): like item
            -- First item with some_data.
            -- (from EV_ITEM_LIST)
        require -- from EV_ITEM_LIST
            not_destroyed: not is_destroyed
            data_not_void: some_data /= void
        ensure -- from EV_ITEM_LIST
            bridge_ok: Result = implementation.item_by_data (some_data)

    last: like item
            -- Item at last position
            -- (from CHAIN)
        require -- from CHAIN
            not_empty: not is_empty

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    sequential_occurrences (v: EV_TREE_NODE): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    selected_item: EV_TREE_NODE
            -- Currently selected item.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.selected_item

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.count

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LIST)

    ensure_item_visible (an_item: EV_TREE_ITEM)
            -- Ensure an_item is visible in Current.
            -- Tree nodes may be expanded to achieve this.
        require
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            item_contained: has_recursively (an_item)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from EV_DYNAMIC_LIST)

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    has_recursively (an_item: EV_TREE_ITEM): BOOLEAN
            -- Is an_item contained in Current at any level?

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: EV_TREE_NODE): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from CHAIN)

    pixmaps_height: INTEGER
            -- Height in pixels of pixmaps displayed in Current.
            -- Note: The default value is 16.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_height

    pixmaps_width: INTEGER
            -- Width in pixels of pixmaps displayed in Current.
            -- Note: The default value is 16.
        require
            not_destroyed: not is_destroyed
        ensure
            bridge_ok: Result = implementation.pixmaps_width

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)

    selected: BOOLEAN
            -- Is an item selected in Current ?
        require
            not_destroyed: not is_destroyed

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- This is True if p conforms to EV_DYNAMIC_LIST_CURSOR and
            -- if it points to an item, Current must have it.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from EV_DYNAMIC_LIST
            bridge_ok: Result = implementation.valid_cursor (p)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_pixmaps_size (a_width: INTEGER; a_height: INTEGER)
            -- Set the size of displayed pixmaps in Current to
            -- a_width by a_height pixels.
            -- Note: The Default value is 16x16.
        require
            not_destroyed: not is_destroyed
            valid_width: a_width > 0
            valid_height: a_height > 0
        ensure
            width_set: pixmaps_width = a_width
            height_set: pixmaps_height = a_height

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Cursor movement

    back
            -- Move to previous position.
            -- (from EV_DYNAMIC_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (No effect if empty)
            -- (from CHAIN)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast

    forth
            -- Move cursor to next position.
            -- (from EV_DYNAMIC_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from EV_DYNAMIC_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions.
            -- (from EV_DYNAMIC_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from EV_DYNAMIC_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from EV_DYNAMIC_LIST
            empty_implies_after: is_empty implies after

feature -- Element change

    append (s: SEQUENCE [EV_TREE_NODE])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_is_last: v = last
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index) or (after and old after)

    fill (other: CONTAINER [EV_TREE_NODE])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SET
            in_set_already: old has (v) implies (count = old count)
            added_to_set: not old has (v) implies (count = old count + 1)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v at beginning. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_is_first: v = first
            count_increased: count = old count + 1
            cursor_not_moved: (index = old index + 1) or (before and old before)

    put_i_th (v: like item; i: INTEGER)
            -- Replace item at i-th position by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            valid_index: i > 0 and i <= count
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            item_replaced: v = i_th (i)
            not_has_old_item: not has (old i_th (i))
            old_item_parent_void: (old i_th (i)).old_parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    put_left (v: like item)
            -- Add v to the left of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_before: not before
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_at_index_plus_one: v = i_th (index - 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index + 1

    put_right (v: like item)
            -- Add v to right of cursor position. Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            extendible: extendible
            not_after: not after
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            v_at_index_plus_one: v = i_th (index + 1)
            count_increased: count = old count + 1
            cursor_not_moved: index = old index

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    replace (v: like item)
            -- Replace current item by v.
            -- (from EV_DYNAMIC_LIST)
        require -- from EV_DYNAMIC_LIST
            not_destroyed: not is_destroyed
            writable: writable
            v_not_void: v /= void
            v_parent_void: v.old_parent = void
            v_not_current: not same (v)
            v_not_parent_of_current: not is_parent_recursive (v)
        ensure -- from EV_DYNAMIC_LIST
            parent_is_current: v.old_parent = Current
            item_replaced: v = item
            not_has_old_item: not has (old item)
            old_item_parent_void: (old item).old_parent = void
            count_same: count = old count
            cursor_not_moved: index = old index

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    swap (i: INTEGER)
            -- Exchange_item at i-th position with item
            -- at cursor position.
            -- (from EV_DYNAMIC_LIST)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Removal

    prune (v: like item)
            -- Remove v if present. Do not move cursor, except if
            -- cursor was on v, move to right neighbor.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable: prunable
        ensure then -- from SET
            removed_count_change: old has (v) implies (count = old count - 1)
            not_removed_no_count_change: not old has (v) implies (count = old count)
            item_deleted: not has (v)
        ensure then -- from EV_DYNAMIC_LIST
            not_has_v: not has (v)
            had_item_implies_parent_void: old has (v) implies v.old_parent = void
            had_item_implies_count_decreased: old has (v) implies count = old count - 1
            had_item_and_was_after_implies_index_decreased: (old after and old has (v)) implies index = old index - 1

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item. Move cursor to right neighbor.
            -- (or after if no right neighbor).
            -- (from EV_DYNAMIC_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after
        ensure then -- from EV_DYNAMIC_LIST
            v_removed: not has (old item)
            parent_void: (old item).old_parent = void
            count_decreased: count = old count - 1
            index_same: index = old index

    remove_left
            -- Remove item to left of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1
        ensure then -- from EV_DYNAMIC_LIST
            left_neighbor_removed: not has (old i_th (index - 1))
            parent_void: (old i_th (index - 1)).old_parent = void
            index_decreased: index = old index - 1

    remove_right
            -- Remove item to right of cursor position.
            -- Do not move cursor.
            -- (from EV_DYNAMIC_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index
        ensure then -- from EV_DYNAMIC_LIST
            right_neighbor_removed: not has (old i_th (index + 1))
            parent_void: (old i_th (index + 1)).old_parent = void
            index_same: index = old index

    wipe_out
            -- Remove all items.
            -- (from EV_DYNAMIC_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Conversion

    linear_representation: LINEAR [EV_TREE_NODE]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Implementation

    Changeable_comparison_criterion: BOOLEAN is False
            -- May object_comparison be changed?
            -- (Answer: no by default.
            -- (from EV_ITEM_LIST)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Contract support

    same (other: EV_ANY): BOOLEAN
            -- Is other Current?
            -- (from EV_DYNAMIC_LIST)

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a tree item is deselected.
            -- (from EV_TREE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    select_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a tree item is selected.
            -- (from EV_TREE_ACTION_SEQUENCES)
        ensure -- from EV_TREE_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [EV_TREE_NODE]]; test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [EV_TREE_NODE], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0
        -- from EV_ITEM_LIST
    parent_of_items_is_current: is_usable implies parent_of_items_is_current
    items_unique: is_usable implies items_unique
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class EV_TREE


EV_VERTICAL_PROGRESS_BAR Chart

class
    EV_VERTICAL_PROGRESS_BAR

General
    cluster: vision2.interface.widgets.primitives
    description: "Vertical bar graph gauge for displaying progress of a process."
    keywords: "status, progress, bar, vertical"
    create: make_with_value_range, default_create

Ancestors
    EV_PROGRESS_BAR

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_segmented: BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_VERTICAL_PROGRESS_BAR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_segmentation
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_segmentation
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_VERTICAL_PROGRESS_BAR Flat contracts

indexing
    description: "Vertical bar graph gauge for displaying progress of a process."
    appearance: "+--+N|  ||  ||  ||25||  ||##||##|+--+"
    status: "See notice at end of class"
    keywords: "status, progress, bar, vertical"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_VERTICAL_PROGRESS_BAR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_value_range (a_value_range: INTEGER_INTERVAL)
            -- Create and assign a_value_range to value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            a_value_range_not_void: a_value_range /= void
            a_value_range_not_empty: not a_value_range.is_empty

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_segmented: BOOLEAN
            -- Is display segmented?
            -- (from EV_PROGRESS_BAR)
        require -- from EV_PROGRESS_BAR
            not_destroyed: not is_destroyed
        ensure -- from EV_PROGRESS_BAR
            bridge_ok: Result = implementation.is_segmented

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_segmentation
            -- Display continuous bar.
            -- (from EV_PROGRESS_BAR)
        require -- from EV_PROGRESS_BAR
            not_destroyed: not is_destroyed
        ensure -- from EV_PROGRESS_BAR
            not_is_segmented: not is_segmented

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_segmentation
            -- Divide display of bar into segments.
            -- (from EV_PROGRESS_BAR)
        require -- from EV_PROGRESS_BAR
            not_destroyed: not is_destroyed
        ensure -- from EV_PROGRESS_BAR
            is_segmented: is_segmented

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_VERTICAL_PROGRESS_BAR


EV_VERTICAL_RANGE Chart

class
    EV_VERTICAL_RANGE

General
    cluster: vision2.interface.widgets.primitives
    description:
        "Interactive vertical range widget. A sliding thumb displays the
        current `value' and allows it to be adjusted"
    create: make_with_value_range, default_create

Ancestors
    EV_RANGE

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_VERTICAL_RANGE)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_VERTICAL_RANGE Flat contracts

indexing
    description: "Interactive vertical range widget. A sliding thumb displays thecurrent `value' and allows it to be adjusted"
    appearance: "+-+| || || ||_||#||-|| |+-+"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:47 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_VERTICAL_RANGE

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_value_range (a_value_range: INTEGER_INTERVAL)
            -- Create and assign a_value_range to value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            a_value_range_not_void: a_value_range /= void
            a_value_range_not_empty: not a_value_range.is_empty

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_VERTICAL_RANGE


EV_VERTICAL_SCROLL_BAR Chart

class
    EV_VERTICAL_SCROLL_BAR

General
    cluster: vision2.interface.widgets.primitives
    description: "Interactive vertical scrolling widget."
    create: make_with_value_range, default_create

Ancestors
    EV_SCROLL_BAR

Action sequences
    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    leap: INTEGER
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    proportion: REAL
    screen_x: INTEGER
    screen_y: INTEGER
    step: INTEGER
    target_name: STRING
    tooltip: STRING
    value: INTEGER
    value_range: INTEGER_INTERVAL
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_VERTICAL_SCROLL_BAR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    leap_backward
    leap_forward
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_leap (a_leap: INTEGER)
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_proportion (a_proportion: REAL)
    set_step (a_step: INTEGER)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    set_value (a_value: INTEGER)
    show
    step_backward
    step_forward


EV_VERTICAL_SCROLL_BAR Flat contracts

indexing
    description: "Interactive vertical scrolling widget."
    appearance: "+-+|^||-|| ||_||#||-||_||V|+-+"
    status: "See notice at end of class."
    date: "$Date: 2001/07/14 11:02:48 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_VERTICAL_SCROLL_BAR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

    make_with_value_range (a_value_range: INTEGER_INTERVAL)
            -- Create and assign a_value_range to value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            a_value_range_not_void: a_value_range /= void
            a_value_range_not_empty: not a_value_range.is_empty

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    leap: INTEGER
            -- Size of change made by leap_forward or leap_backward.
            -- Default: 10
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.leap

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    step: INTEGER
            -- Size of change made by step_forward or step_backward.
            -- Default: 1
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.step

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

    value: INTEGER
            -- Current position within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.value

    value_range: INTEGER_INTERVAL
            -- Range of value.
            -- Default: 0 |..| 100
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result /= void and then Result.is_equal (implementation.value_range)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

    proportion: REAL
            -- Relative position of value in value_range.
            -- Range: [0, 1]. Default: 0.0
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            bridge_ok: Result = implementation.proportion

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    leap_backward
            -- Decrement value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - leap)

    leap_forward
            -- Increment value by leap if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + leap)

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_proportion (a_proportion: REAL)
            -- Move value to a_proportion within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_proportion_within_range: a_proportion >= 0 and a_proportion <= 1

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

    step_backward
            -- Decrement value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            decremented: value = value_range.lower.max (old value - step)

    step_forward
            -- Increment value by step if within value_range.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
        ensure -- from EV_GAUGE
            incremented: value = value_range.upper.min (old value + step)

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_leap (a_leap: INTEGER)
            -- Assign a_leap to leap.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_leap_positive: a_leap > 0
        ensure -- from EV_GAUGE
            a_leap_assigned: leap = a_leap

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_step (a_step: INTEGER)
            -- Assign a_step to step.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            a_step_positive: a_step > 0
        ensure -- from EV_GAUGE
            a_step_assigned: step = a_step

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

    set_value (a_value: INTEGER)
            -- Assign a_value to value.
            -- (from EV_GAUGE)
        require -- from EV_GAUGE
            not_destroyed: not is_destroyed
            value_in_range: value_range.has (a_value)
        ensure -- from EV_GAUGE
            a_value_assigned: value = a_value

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    change_actions: EV_VALUE_CHANGE_ACTION_SEQUENCE
            -- Actions to be performed when value changes.
            -- (from EV_GAUGE_ACTION_SEQUENCES)
        ensure -- from EV_GAUGE_ACTION_SEQUENCES
            not_void: Result /= void

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_GAUGE
    range_not_void: is_usable implies value_range /= void
    range_not_empty: is_usable implies not value_range.is_empty
    value_in_range: is_usable implies value_range.has (value)
    step_positive: is_usable implies step > 0
    leap_positive: is_usable implies leap > 0
    change_actions_not_void: is_usable implies change_actions /= void
    proportion_within_range: is_usable implies proportion >= 0.0 and proportion <= 1.0
    proportion_definition: is_usable implies (value_range.upper = value_range.lower implies proportion = 0.0)
    proportion_correct_value: (is_usable and value_range.upper /= value_range.lower) implies ((value - value_range.lower) / (value_range.upper - value_range.lower)).abs - proportion < delta
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_VERTICAL_SCROLL_BAR


EV_VERTICAL_SEPARATOR Chart

class
    EV_VERTICAL_SEPARATOR

General
    cluster: vision2.interface.widgets.primitives
    description: "Scored vertical line."
    create: default_create

Ancestors
    EV_SEPARATOR

Action sequences
    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
    drop_actions: EV_PND_ACTION_SEQUENCE
    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
    key_press_actions: EV_KEY_ACTION_SEQUENCE
    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
    key_release_actions: EV_KEY_ACTION_SEQUENCE
    pick_actions: EV_PND_START_ACTION_SEQUENCE
    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE

Queries
    accept_cursor: EV_CURSOR
    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
    background_color: EV_COLOR
    data: ANY
    deny_cursor: EV_CURSOR
    foreground_color: EV_COLOR
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    height: INTEGER
    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
    id_object (an_id: INTEGER): IDENTIFIED
    is_destroyed: BOOLEAN
    is_displayed: BOOLEAN
    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
    is_sensitive: BOOLEAN
    is_show_requested: BOOLEAN
    minimum_height: INTEGER
    minimum_width: INTEGER
    mode_is_drag_and_drop: BOOLEAN
    mode_is_pick_and_drop: BOOLEAN
    mode_is_target_menu: BOOLEAN
    object_id: INTEGER
    parent: EV_CONTAINER
    pebble: ANY
    pebble_function: FUNCTION [ANY, TUPLE, ANY]
    pebble_positioning_enabled: BOOLEAN
    pebble_x_position: INTEGER
    pebble_y_position: INTEGER
    pointer_position: EV_COORDINATE
    pointer_style: EV_CURSOR
    screen_x: INTEGER
    screen_y: INTEGER
    target_name: STRING
    tooltip: STRING
    width: INTEGER
    x_position: INTEGER
    y_position: INTEGER

Commands
    center_pointer
    copy (other: [like Current] EV_VERTICAL_SEPARATOR)
    default_create
    destroy
    disable_capture
    disable_pebble_positioning
    disable_sensitive
    enable_capture
    enable_pebble_positioning
    enable_sensitive
    hide
    remove_help_context
    remove_pebble
    remove_tooltip
    set_accept_cursor (a_cursor: EV_CURSOR)
    set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent] FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE])
    set_background_color (a_color: [like background_color] EV_COLOR)
    set_data (some_data: [like data] ANY)
    set_default_colors
    set_deny_cursor (a_cursor: EV_CURSOR)
    set_drag_and_drop_mode
    set_focus
    set_foreground_color (a_color: [like foreground_color] EV_COLOR)
    set_help_context (an_help_context: [like help_context] FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT])
    set_minimum_height (a_minimum_height: INTEGER)
    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
    set_minimum_width (a_minimum_width: INTEGER)
    set_pebble (a_pebble: [like pebble] ANY)
    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
    set_pebble_position (a_x, a_y: INTEGER)
    set_pick_and_drop_mode
    set_pointer_style (a_cursor: [like pointer_style] EV_CURSOR)
    set_target_menu_mode
    set_target_name (a_name: STRING)
    set_tooltip (a_tooltip: STRING)
    show


EV_VERTICAL_SEPARATOR Flat contracts

indexing
    description: "Scored vertical line."
    appearance: "||||||"
    status: "See notice at end of class"
    date: "$Date: 2001/07/14 11:02:48 $"
    revision: "$Revision: 1.3 $"

class interface
    EV_VERTICAL_SEPARATOR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Initialization

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

feature -- Access

    accept_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.accept_cursor

    actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER, INTEGER], EV_ABSTRACT_PICK_AND_DROPABLE]
            -- Overrides default drop target on a certain position.
            -- If Void, Current will use the default drop target.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.actual_drop_target_agent

    background_color: EV_COLOR
            -- Color displayed behind foreground features.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.background_color)

    data: ANY
            -- Arbitrary user data may be stored here.
            -- (from EV_ANY)

    deny_cursor: EV_CURSOR
            -- Result is cursor displayed when the screen pointer is over a
            -- target that does not accept pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.deny_cursor

    foreground_color: EV_COLOR
            -- Color of foreground features like text.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_COLORIZABLE
            bridge_ok: Result.is_equal (implementation.foreground_color)

    help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
            -- Agent that evaluates to help context sent to help engine when help is requested
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_HELP_CONTEXTABLE
            bridge_ok: Result = implementation.help_context

    frozen id_object (an_id: INTEGER): IDENTIFIED
            -- Object associated with an_id (void if no such object)
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            consistent: Result = void or else Result.object_id = an_id

    is_parent_recursive (a_widget: EV_WIDGET): BOOLEAN
            -- Is a_widget parent, or recursively, parent of parent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    frozen object_id: INTEGER
            -- Unique for current object in any given session
            -- (from IDENTIFIED)
        ensure -- from IDENTIFIED
            valid_id: id_object (Result) = Current

    parent: EV_CONTAINER
            -- Contains Current.
            -- (from EV_WIDGET)
        require -- from EV_CONTAINABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_WIDGET
            bridge_ok: Result = implementation.parent

    pebble: ANY
            -- Data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble

    pebble_function: FUNCTION [ANY, TUPLE, ANY]
            -- Returns data to be transported by pick and drop mechanism.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_function

    pebble_positioning_enabled: BOOLEAN
            -- If True then pick and drop start coordinates are
            -- pebble_x_position, pebble_y_position.
            -- If False then pick and drop start coordinates are
            -- the pointer coordinates.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_positioning_enabled

    pebble_x_position: INTEGER
            -- Initial x position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_x_position

    pebble_y_position: INTEGER
            -- Initial y position for pick and drop relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.pebble_y_position

    pointer_position: EV_COORDINATE
            -- Position of the screen pointer relative to Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_show_requested: is_show_requested

    pointer_style: EV_CURSOR
            -- Cursor displayed when pointer is over this widget.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    target_name: STRING
            -- Optional textual name describing Current pick and drop hole.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)

    tooltip: STRING
            -- Tooltip displayed on Current.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            bridge_ok: (Result = void and implementation.tooltip = void) or Result.is_equal (implementation.tooltip)

feature -- Measurement

    height: INTEGER
            -- Vertical size in pixels.
            -- Same as minimum_height when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.height

    minimum_height: INTEGER
            -- Lower bound on height in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_height
            positive_or_zero: Result >= 0

    minimum_width: INTEGER
            -- Lower bound on width in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.minimum_width
            positive_or_zero: Result >= 0

    screen_x: INTEGER
            -- Horizontal offset relative to left of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_x

    screen_y: INTEGER
            -- Vertical offset relative to top of screen in pixels.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.screen_y

    width: INTEGER
            -- Horizontal size in pixels.
            -- Same as minimum_width when not displayed.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.width

    x_position: INTEGER
            -- Horizontal offset relative to parent x_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.x_position

    y_position: INTEGER
            -- Vertical offset relative to parent y_position in pixels.
            -- (from EV_POSITIONED)
        require -- from EV_POSITIONED
            not_destroyed: not is_destroyed
        ensure -- from EV_POSITIONED
            bridge_ok: Result = implementation.y_position

feature -- Status report

    has_capture: BOOLEAN
            -- Does widget have capture?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_capture

    has_focus: BOOLEAN
            -- Does widget have the keyboard focus?
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.has_focus

    is_displayed: BOOLEAN
            -- Is Current visible on the screen?
            -- True when show requested and parent displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_displayed

    is_sensitive: BOOLEAN
            -- Is object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            bridge_ok: Result = implementation.user_is_sensitive

    is_show_requested: BOOLEAN
            -- Will Current be displayed when its parent is?
            -- See also is_displayed.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            bridge_ok: Result = implementation.is_show_requested

    mode_is_drag_and_drop: BOOLEAN
            -- Is the user interface mode drag and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_drag_and_drop

    mode_is_pick_and_drop: BOOLEAN
            -- Is the user interface mode pick and drop?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_pick_and_drop

    mode_is_target_menu: BOOLEAN
            -- Is the user interface mode a pop-up menu of targets?
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure then -- from EV_PICK_AND_DROPABLE
            bridge_ok: Result = implementation.mode_is_target_menu

feature -- Status setting

    center_pointer
            -- Position screen pointer over center of Current.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed

    disable_capture
            -- Disable grab of all user input events.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_has_capture: not has_capture

    disable_pebble_positioning
            -- Assign False to pebble_positioning_enabled.
            -- The pick and drop will start at the pointer position.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: not pebble_positioning_enabled

    disable_sensitive
            -- Make object non-sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_unsensitive: not is_sensitive

    enable_capture
            -- Grab all user input events (mouse and keyboard).
            -- disable_capture must be called to resume normal input handling.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
        ensure -- from EV_WIDGET
            has_capture: has_capture

    enable_pebble_positioning
            -- Assign True to pebble_positioning_enabled.
            -- Use pebble_x_position and pebble_y_position as the initial coordinates
            -- for the pick and drop in pixels relative to Current.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_positioning_updated: pebble_positioning_enabled

    enable_sensitive
            -- Make object sensitive to user input.
            -- (from EV_SENSITIVE)
        require -- from EV_SENSITIVE
            not_destroyed: not is_destroyed
        ensure -- from EV_SENSITIVE
            is_sensitive: (parent = void or parent_is_sensitive) implies is_sensitive

    hide
            -- Request that Current not be displayed even when its parent is.
            -- Make is_show_requested False.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            not_is_show_requested: not is_show_requested

    remove_pebble
            -- Make pebble Void and pebble_function `Void,
            -- Removing transport.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_removed: pebble = void and pebble_function = void

    set_accept_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is over a
            -- target that accepts pebble during pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            accept_cursor_assigned: accept_cursor.is_equal (a_cursor)

    set_actual_drop_target_agent (an_agent: like actual_drop_target_agent)
            -- Assign an_agent to actual_drop_target_agent.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            an_agent_not_void: an_agent /= void
        ensure -- from EV_WIDGET
            assigned: actual_drop_target_agent = an_agent

    set_default_colors
            -- Set foreground and background color to their default values.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed

    set_deny_cursor (a_cursor: EV_CURSOR)
            -- Set a_cursor to be displayed when the screen pointer is not
            -- over a valid target.
            -- (from EV_PICK_AND_DROPABLE)
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            deny_cursor_assigned: deny_cursor.is_equal (a_cursor)

    set_drag_and_drop_mode
            -- Set user interface mode to drag and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            drag_and_drop_set: mode_is_drag_and_drop

    set_focus
            -- Grab keyboard focus.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            is_displayed: is_displayed
            is_sensitive: is_sensitive
        ensure -- from EV_WIDGET
            has_focus: has_focus

    set_pebble (a_pebble: like pebble)
            -- Assign a_pebble to pebble.
            -- Overrides set_pebble_function.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_pebble_not_void: a_pebble /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_assigned: pebble = a_pebble

    set_pebble_function (a_function: FUNCTION [ANY, TUPLE, ANY])
            -- Set a_function to compute pebble.
            -- It will be called once each time a pick occurs, the result
            -- will be assigned to pebble for the duration of transport.
            -- When a pick occurs, the pick position in widget coordinates,
            -- <<x, y>> in pixels, is passed.
            -- To handle this data use a_function of type
            -- FUNCTION [ANY, TUPLE [INTEGER, INTEGER], ANY] and return the
            -- pebble as a function of x and y.
            -- Overrides set_pebble.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_function_not_void: a_function /= void
            a_function_takes_two_integer_open_operands: a_function.valid_operands ([1, 1])
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            pebble_function_assigned: pebble_function = a_function

    set_pebble_position (a_x, a_y: INTEGER)
            -- Set the initial position for pick and drop
            -- Coordinates are in pixels and are relative to position of Current.
            -- Pebble_positioning_enabled must be True for the position to be used,
            -- use enable_pebble_positioning.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

    set_pick_and_drop_mode
            -- Set user interface mode to pick and drop.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            pick_and_drop_set: mode_is_pick_and_drop

    set_target_menu_mode
            -- Set user interface mode to pop-up menu of targets.
            -- (from EV_PICK_AND_DROPABLE)
        require -- from EV_PICK_AND_DROPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_PICK_AND_DROPABLE
            target_menu_mode_set: mode_is_target_menu

    set_target_name (a_name: STRING)
            -- Assign a_name to target_name.
            -- (from EV_ABSTRACT_PICK_AND_DROPABLE)
        require -- from EV_ABSTRACT_PICK_AND_DROPABLE
            a_name_not_void: a_name /= void
        ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
            target_name_assigned: a_name /= target_name and a_name.is_equal (target_name)

    show
            -- Request that Current be displayed when its parent is.
            -- True by default.
            -- Make is_show_requested True.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
        ensure -- from EV_WIDGET
            is_show_requested: is_show_requested

feature -- Element change

    remove_help_context
            -- Remove key press action associated with EV_APPLICATION.help_key.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            help_context_not_void: help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            no_help_context: help_context = void

    remove_tooltip
            -- Make tooltip Void.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
        ensure -- from EV_TOOLTIPABLE
            tooltip_removed: tooltip = void

    set_background_color (a_color: like background_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            background_color_assigned: background_color.is_equal (a_color)

    set_data (some_data: like data)
            -- Assign some_data to data.
            -- (from EV_ANY)
        require -- from EV_ANY
            not_destroyed: not is_destroyed
        ensure -- from EV_ANY
            data_assigned: data = some_data

    set_foreground_color (a_color: like foreground_color)
            -- Assign a_color to foreground_color.
            -- (from EV_COLORIZABLE)
        require -- from EV_COLORIZABLE
            not_destroyed: not is_destroyed
            a_color_not_void: a_color /= void
        ensure -- from EV_COLORIZABLE
            foreground_color_assigned: foreground_color.is_equal (a_color)

    set_help_context (an_help_context: like help_context)
            -- Assign an_help_context to help_context.
            -- (from EV_HELP_CONTEXTABLE)
        require -- from EV_HELP_CONTEXTABLE
            not_destroyed: not is_destroyed
            an_help_context_not_void: an_help_context /= void
        ensure -- from EV_HELP_CONTEXTABLE
            help_context_assigned: help_context.is_equal (an_help_context)

    set_minimum_height (a_minimum_height: INTEGER)
            -- Set a_minimum_height in pixels to minimum_height.
            -- If height is less than a_minimim_height, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_height is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_size (a_minimum_width, a_minimum_height: INTEGER)
            -- Assign a_minimum_height to minimum_height
            -- and a_minimum_width to minimum_width in pixels.
            -- If width or height is less than minimum size, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum size is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
            a_minimum_height_positive: a_minimum_height > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width
            minimum_height_assigned: minimum_height = a_minimum_height

    set_minimum_width (a_minimum_width: INTEGER)
            -- Assign a_minimum_width in pixels to minimum_width.
            -- If width is less than a_minimim_width, resize.
            -- This setting takes effect next time application is idle.
            -- From now, minimum_width is fixed and will not be changed
            -- dynamically by the application anymore.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_minimum_width_positive: a_minimum_width > 0
        ensure -- from EV_WIDGET
            minimum_width_assigned: minimum_width = a_minimum_width

    set_pointer_style (a_cursor: like pointer_style)
            -- Assign a_cursor to pointer_style.
            -- (from EV_WIDGET)
        require -- from EV_WIDGET
            not_destroyed: not is_destroyed
            a_cursor_not_void: a_cursor /= void
        ensure -- from EV_WIDGET
            pointer_style_assigned: pointer_style.is_equal (a_cursor)

    set_tooltip (a_tooltip: STRING)
            -- Assign a_tooltip to tooltip.
            -- (from EV_TOOLTIPABLE)
        require -- from EV_TOOLTIPABLE
            not_destroyed: not is_destroyed
            tooltip: a_tooltip /= void
            a_tooltip_not_empty: not a_tooltip.is_empty
        ensure -- from EV_TOOLTIPABLE
            tooltip_assigned: a_tooltip.is_equal (tooltip) and tooltip /= a_tooltip

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from EV_ANY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Command

    destroy
            -- Destroy underlying native toolkit object.
            -- Render Current unusable.
            -- (from EV_ANY)
        ensure -- from EV_ANY
            is_destroyed: is_destroyed

feature -- Event handling

    conforming_pick_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when a pebble that fits here is picked.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    drop_actions: EV_PND_ACTION_SEQUENCE
            -- Actions to be performed when a pebble is dropped here.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    focus_in_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is gained.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    focus_out_actions: EV_FOCUS_ACTION_SEQUENCE
            -- Actions to be performed when keyboard focus is lost.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_press_string_actions: EV_KEY_STRING_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard press generates a displayable character.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    key_release_actions: EV_KEY_ACTION_SEQUENCE
            -- Actions to be performed when a keyboard key is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pick_actions: EV_PND_START_ACTION_SEQUENCE
            -- Actions to be performed when pebble is picked up.
            -- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES)
        ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is pressed.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_button_release_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer button is released.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_double_press_actions: EV_POINTER_BUTTON_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer is double clicked.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_enter_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer enters widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_leave_actions: EV_NOTIFY_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer leaves widget.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    pointer_motion_actions: EV_POINTER_MOTION_ACTION_SEQUENCE
            -- Actions to be performed when screen pointer moves.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

    resize_actions: EV_GEOMETRY_ACTION_SEQUENCE
            -- Actions to be performed when size changes.
            -- (from EV_WIDGET_ACTION_SEQUENCES)
        ensure -- from EV_WIDGET_ACTION_SEQUENCES
            not_void: Result /= void

feature -- Status Report

    is_destroyed: BOOLEAN
            -- Is Current no longer usable?
            -- (from EV_ANY)
        ensure -- from EV_ANY
            bridge_ok: Result = implementation.is_destroyed

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_WIDGET
    pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
    is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
    parent_contains_current: is_usable and then parent /= void implies parent.has (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_COLORIZABLE
    background_color_not_void: is_usable implies background_color /= void
    foreground_color_not_void: is_usable implies foreground_color /= void
        -- from EV_POSITIONED
    width_not_negative: is_usable implies width >= 0
    height_not_negative: is_usable implies height >= 0
    minimum_width_not_negative: is_usable implies minimum_width >= 0
    minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class EV_VERTICAL_SEPARATOR


EiffelVision 2 Samples

Vision2 ships with a number of samples provided to demonstrate different aspects of the library. If you are a new vision2 user then it is suggested that you first compile and run the Widgets sample. This will demonstrate both the appearence and behaviour of the available widgets.

The other samples provided are listed below:

  • Accelerator - Demonstrates the use of an EV_ACCELERATOR.
  • Cursor - Demonstrates how to modify the displayed EV_CURSOR for an EV_WIDGET.
  • Gauges - Demonstrates different types of EV_GAUGE.
  • Standard_dialogs - Demonstrates different types of EV_STANDARD_DIALOG.
  • Viewport - Demonstrates EV_VIEWPORT.


Accelerator sample

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. When the window has the focus, the key combination Ctrl + Q will exit the application.

Under the Hood

An EV_ACCELERATOR is created and associated with the EV_TITLED_WINDOW used for the main window of the application. The association is made by adding the accelerator to the accelerators list of the window.

This sample contains the following class:

  • ACCELERATOR

See Also
EV_ACCELERATOR
EV_KEY


cluster root_cluster

 Cluster
root_cluster

Classes
ACCELERATOR


ACCELERATOR Chart

 class
ACCELERATOR

General
cluster: root_cluster
description: "Accelerator example."
create: make_and_launch

Ancestors
EV_APPLICATION

Action sequences
drop_actions : EV_PND_ACTION_SEQUENCE
idle_actions : EV_NOTIFY_ACTION_SEQUENCE
pick_actions : EV_PND_ACTION_SEQUENCE
post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
alt_pressed : BOOLEAN
clipboard : EV_CLIPBOARD
contextual_help_accelerator : EV_ACCELERATOR
ctrl_pressed : BOOLEAN
data : ANY
Default_tooltip_delay : INTEGER
focused_widget : EV_WIDGET
help_accelerator : EV_ACCELERATOR
help_engine : EV_HELP_ENGINE
is_destroyed : BOOLEAN
is_launched : BOOLEAN
locked_window : EV_WINDOW
shift_pressed : BOOLEAN
tooltip_delay : INTEGER
windows : LINEAR [ EV_WINDOW ]

Commands
copy (other: [like Current] ACCELERATOR )
default_create
destroy
display_help_for_widget (a_widget: EV_WIDGET )
do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
enable_contextual_help
launch
make_and_launch
process_events
set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_data (some_data: [like data ] ANY )
set_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_help_engine (an_engine: EV_HELP_ENGINE )
set_tooltip_delay (a_delay: INTEGER )
sleep (msec: INTEGER )
test_accelerators


ACCELERATOR Flat contracts

 indexing
description: "Accelerator example."
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.3 $"

class interface
ACCELERATOR

create

make_and_launch
-- Create Current and launch application.

feature -- Initialization

make_and_launch
-- Create Current and launch application.

test_accelerators
-- Associate an accelerator to first_window .

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

clipboard : EV_CLIPBOARD
-- Native platform clipboard access.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

contextual_help_accelerator : EV_ACCELERATOR
-- Accelerator that enables contextual help mode
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .contextual_help_accelerator)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

help_accelerator : EV_ACCELERATOR
-- Accelerator that displays contextual help
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_accelerator)

help_engine : EV_HELP_ENGINE
-- Object that handles contextual help display requests
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_engine)

locked_window : EV_WINDOW
-- Window currently locked. Void if no window
-- is currently locked.
--
-- See `{ EV_WINDOW }. lock_update ' for more details
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

windows : LINEAR [ EV_WINDOW ]
-- All of the application's windows.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .windows)

feature -- Status report

alt_pressed : BOOLEAN
-- Is alt key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

ctrl_pressed : BOOLEAN
-- Is ctrl key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

Default_tooltip_delay : INTEGER is 500
-- Default delay in milleseconds of tool tips.
-- (from EV_APPLICATION )

focused_widget : EV_WIDGET
-- Widget that has keyboard focus.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .focused_widget

is_launched : BOOLEAN
-- Has launch been called?
-- (from EV_APPLICATION )

shift_pressed : BOOLEAN
-- Is shift key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

tooltip_delay : INTEGER
-- Time in milliseconds which the pointer must be stationary over
-- a widget before a tooltips apears.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .tooltip_delay

feature -- Status setting

set_tooltip_delay (a_delay: INTEGER )
-- Assign a_delay to tooltip_delay .
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_delay_non_negative: a_delay >= 0
ensure -- from EV_APPLICATION
assigned: tooltip_delay = a_delay

feature -- Element change

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operation

display_help_for_widget (a_widget: EV_WIDGET )
-- Display contextual help for a_widget, if any.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_widget_not_void: a_widget /= void

enable_contextual_help
-- Change mouse cursor to help cursor.
-- Capture mouse input.
-- Send help context of widget being clicked to help engine for
-- Processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

launch
-- Start the application.
-- Call prepare the Begin event processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
not_already_launched: not is_launched
ensure -- from EV_APPLICATION
is_launched: is_launched

process_events
-- Process any pending events.
-- Pass control to the underlying native toolkit so that it can
-- handle any events that may be in its queue.
-- (Should be called from time to time during extended computation.)
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
is_launched: is_launched

sleep (msec: INTEGER )
-- Wait for msec milliseconds and return.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
msec_non_negative: msec >= 0

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Element Change

set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to contextual_help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

set_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
help_accelerator_assigned: help_accelerator = an_accelerator

set_help_engine (an_engine: EV_HELP_ENGINE )
-- Assign an_engine to help_engine
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_engine_not_void: an_engine /= void
ensure -- from EV_APPLICATION
help_engine_set: help_engine = an_engine

feature -- Event handling

do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
-- Perform an_action one time when the application is next idle.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "drop" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

idle_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when the application is otherwise idle.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "pick" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed just after application launch .
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_APPLICATION
tooltip_delay_not_negative: tooltip_delay >= 0
windows_not_void: windows /= void
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called

end -- class ACCELERATOR


Cursor sample

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. Selecting "File", "Close" or pressing the close icon at any time will exit the application.

To the right hand side of the window you will see an EV_MULTI_COLUMN_LIST containing rows, each with an associated EV_PIXMAP. If you select one of the rows of the list, then press the button marked "Apply", the cursor displayed when over the label displayed to the right hand side of the window will be pixmap of the currently selected list row.

Under the Hood

The pixmaps used in the EV_MULTI_COLUMN_LIST were standard pixmaps provided with vision2, accessible through EV_STOCK_PIXMAPS. set_pixmap was used to set the EV_PIXMAP of the EV_MULTI_COLUMN_LIST_ROW. An agent was added to the select_actions of the EV_BUTTON which calls set_pointer_style on the desired widget.

This sample contains the following class:

  • CURSOR_TEST


cluster root_cluster

 Cluster
root_cluster

Classes
CURSOR_TEST


CURSOR_TEST Chart

 class
CURSOR_TEST

General
cluster: root_cluster
description: "Simple program demonstrating the use of cursors."
create: make_and_launch

Ancestors
EV_APPLICATION

Action sequences
drop_actions : EV_PND_ACTION_SEQUENCE
idle_actions : EV_NOTIFY_ACTION_SEQUENCE
pick_actions : EV_PND_ACTION_SEQUENCE
post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
alt_pressed : BOOLEAN
clipboard : EV_CLIPBOARD
contextual_help_accelerator : EV_ACCELERATOR
ctrl_pressed : BOOLEAN
data : ANY
Default_tooltip_delay : INTEGER
First_window : EV_TITLED_WINDOW
focused_widget : EV_WIDGET
help_accelerator : EV_ACCELERATOR
help_engine : EV_HELP_ENGINE
is_destroyed : BOOLEAN
is_launched : BOOLEAN
locked_window : EV_WINDOW
shift_pressed : BOOLEAN
tooltip_delay : INTEGER
windows : LINEAR [ EV_WINDOW ]

Commands
copy (other: [like Current] CURSOR_TEST )
default_create
destroy
display_help_for_widget (a_widget: EV_WIDGET )
do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
enable_contextual_help
launch
make_and_launch
prepare
process_events
set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_data (some_data: [like data ] ANY )
set_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_help_engine (an_engine: EV_HELP_ENGINE )
set_tooltip_delay (a_delay: INTEGER )
sleep (msec: INTEGER )


CURSOR_TEST Flat contracts

 indexing
description: "Simple program demonstrating the use of cursors."
date: "$Date: 2001/11/13 00:01:52 $"
revision: "$Revision: 1.5 $"

class interface
CURSOR_TEST

create

make_and_launch
-- Create and launch.

feature -- Initialization

first_window : EV_TITLED_WINDOW
-- The window with the drawable area.

make_and_launch
-- Create and launch.

prepare
-- Initialize world.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

clipboard : EV_CLIPBOARD
-- Native platform clipboard access.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

contextual_help_accelerator : EV_ACCELERATOR
-- Accelerator that enables contextual help mode
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .contextual_help_accelerator)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

help_accelerator : EV_ACCELERATOR
-- Accelerator that displays contextual help
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_accelerator)

help_engine : EV_HELP_ENGINE
-- Object that handles contextual help display requests
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_engine)

locked_window : EV_WINDOW
-- Window currently locked. Void if no window
-- is currently locked.
--
-- See `{ EV_WINDOW }. lock_update ' for more details
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

windows : LINEAR [ EV_WINDOW ]
-- All of the application's windows.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .windows)

feature -- Status report

alt_pressed : BOOLEAN
-- Is alt key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

ctrl_pressed : BOOLEAN
-- Is ctrl key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

Default_tooltip_delay : INTEGER is 500
-- Default delay in milleseconds of tool tips.
-- (from EV_APPLICATION )

focused_widget : EV_WIDGET
-- Widget that has keyboard focus.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .focused_widget

is_launched : BOOLEAN
-- Has launch been called?
-- (from EV_APPLICATION )

shift_pressed : BOOLEAN
-- Is shift key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

tooltip_delay : INTEGER
-- Time in milliseconds which the pointer must be stationary over
-- a widget before a tooltips apears.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .tooltip_delay

feature -- Status setting

set_tooltip_delay (a_delay: INTEGER )
-- Assign a_delay to tooltip_delay .
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_delay_non_negative: a_delay >= 0
ensure -- from EV_APPLICATION
assigned: tooltip_delay = a_delay

feature -- Element change

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operation

display_help_for_widget (a_widget: EV_WIDGET )
-- Display contextual help for a_widget, if any.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_widget_not_void: a_widget /= void

enable_contextual_help
-- Change mouse cursor to help cursor.
-- Capture mouse input.
-- Send help context of widget being clicked to help engine for
-- Processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

launch
-- Start the application.
-- Call prepare the Begin event processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
not_already_launched: not is_launched
ensure -- from EV_APPLICATION
is_launched: is_launched

process_events
-- Process any pending events.
-- Pass control to the underlying native toolkit so that it can
-- handle any events that may be in its queue.
-- (Should be called from time to time during extended computation.)
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
is_launched: is_launched

sleep (msec: INTEGER )
-- Wait for msec milliseconds and return.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
msec_non_negative: msec >= 0

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Element Change

set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to contextual_help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

set_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
help_accelerator_assigned: help_accelerator = an_accelerator

set_help_engine (an_engine: EV_HELP_ENGINE )
-- Assign an_engine to help_engine
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_engine_not_void: an_engine /= void
ensure -- from EV_APPLICATION
help_engine_set: help_engine = an_engine

feature -- Event handling

do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
-- Perform an_action one time when the application is next idle.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "drop" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

idle_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when the application is otherwise idle.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "pick" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed just after application launch .
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_APPLICATION
tooltip_delay_not_negative: tooltip_delay >= 0
windows_not_void: windows /= void
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called

end -- class CURSOR_TEST


Gauges sample

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. The spin buttons at the top of the window control the current minimum, maximum and value of the three gauges displayed below. Modifying the values of the spin buttons will alter the three gauges in real time. Also, if you interact with one of the three gauges, any change in one, will be reflected in the others and in the spin buttons.

Under the Hood

The change_actions of each EV_GAUGE are used to synchronise all of the gauges.

This sample contains the following class:

  • GAUGES

See Also
EV_GAUGE
EV_SCROLL_BAR
EV_RANGE
EV_PROGRESS_BAR
EV_SPIN_BUTTON


cluster root_cluster

 Cluster
root_cluster

Classes
GAUGES


GAUGES Chart

 class
GAUGES

General
cluster: root_cluster
description: "Test of EV_GAUGE ."
create: make_and_launch

Ancestors
EV_APPLICATION

Action sequences
drop_actions : EV_PND_ACTION_SEQUENCE
idle_actions : EV_NOTIFY_ACTION_SEQUENCE
pick_actions : EV_PND_ACTION_SEQUENCE
post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
alt_pressed : BOOLEAN
clipboard : EV_CLIPBOARD
contextual_help_accelerator : EV_ACCELERATOR
ctrl_pressed : BOOLEAN
data : ANY
Default_tooltip_delay : INTEGER
First_window : EV_TITLED_WINDOW
focused_widget : EV_WIDGET
help_accelerator : EV_ACCELERATOR
help_engine : EV_HELP_ENGINE
hr : EV_HORIZONTAL_RANGE
is_destroyed : BOOLEAN
is_launched : BOOLEAN
locked_window : EV_WINDOW
max_field : EV_SPIN_BUTTON
min_field : EV_SPIN_BUTTON
pb : EV_HORIZONTAL_PROGRESS_BAR
sb : EV_HORIZONTAL_SCROLL_BAR
shift_pressed : BOOLEAN
tooltip_delay : INTEGER
val_field : EV_SPIN_BUTTON
windows : LINEAR [ EV_WINDOW ]

Commands
copy (other: [like Current] GAUGES )
default_create
destroy
display_help_for_widget (a_widget: EV_WIDGET )
do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
enable_contextual_help
launch
on_hr_change (value: INTEGER )
on_max_change (value: INTEGER )
on_min_change (value: INTEGER )
on_sb_change (value: INTEGER )
on_val_change (value: INTEGER )
process_events
set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_data (some_data: [like data ] ANY )
set_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_help_engine (an_engine: EV_HELP_ENGINE )
set_tooltip_delay (a_delay: INTEGER )
sleep (msec: INTEGER )


GAUGES Flat contracts

 indexing
description: "Test of EV_GAUGE ."
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.3 $"

class interface
GAUGES

create

make_and_launch
-- Create Current, set up controls and launch.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

clipboard : EV_CLIPBOARD
-- Native platform clipboard access.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

contextual_help_accelerator : EV_ACCELERATOR
-- Accelerator that enables contextual help mode
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .contextual_help_accelerator)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

help_accelerator : EV_ACCELERATOR
-- Accelerator that displays contextual help
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_accelerator)

help_engine : EV_HELP_ENGINE
-- Object that handles contextual help display requests
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_engine)

locked_window : EV_WINDOW
-- Window currently locked. Void if no window
-- is currently locked.
--
-- See `{ EV_WINDOW }. lock_update ' for more details
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

windows : LINEAR [ EV_WINDOW ]
-- All of the application's windows.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .windows)

feature -- Status report

alt_pressed : BOOLEAN
-- Is alt key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

ctrl_pressed : BOOLEAN
-- Is ctrl key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

Default_tooltip_delay : INTEGER is 500
-- Default delay in milleseconds of tool tips.
-- (from EV_APPLICATION )

focused_widget : EV_WIDGET
-- Widget that has keyboard focus.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .focused_widget

is_launched : BOOLEAN
-- Has launch been called?
-- (from EV_APPLICATION )

shift_pressed : BOOLEAN
-- Is shift key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

tooltip_delay : INTEGER
-- Time in milliseconds which the pointer must be stationary over
-- a widget before a tooltips apears.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .tooltip_delay

feature -- Status setting

set_tooltip_delay (a_delay: INTEGER )
-- Assign a_delay to tooltip_delay .
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_delay_non_negative: a_delay >= 0
ensure -- from EV_APPLICATION
assigned: tooltip_delay = a_delay

feature -- Element change

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Implementation

first_window : EV_TITLED_WINDOW
-- Window for this sample.

hr : EV_HORIZONTAL_RANGE
-- Horizontal range for test.

max_field : EV_SPIN_BUTTON
-- Contains the maximum allowable value of sb , pb and hr .

min_field : EV_SPIN_BUTTON
-- Contains the minimu allowable value of sb , pb and hr .

on_hr_change (value: INTEGER )
-- Value of hr changed so update other controls.

on_max_change (value: INTEGER )
-- Adjust maximums of controls.

on_min_change (value: INTEGER )
-- Adjust minimums of controls.

on_sb_change (value: INTEGER )
-- Value of sb changed so update other controls.

on_val_change (value: INTEGER )
-- Value of val_field changed so update other controls.

pb : EV_HORIZONTAL_PROGRESS_BAR
-- Progress bar for test.

sb : EV_HORIZONTAL_SCROLL_BAR
-- Scroll bar for test.

val_field : EV_SPIN_BUTTON

feature -- Basic operation

display_help_for_widget (a_widget: EV_WIDGET )
-- Display contextual help for a_widget, if any.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_widget_not_void: a_widget /= void

enable_contextual_help
-- Change mouse cursor to help cursor.
-- Capture mouse input.
-- Send help context of widget being clicked to help engine for
-- Processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

launch
-- Start the application.
-- Call prepare the Begin event processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
not_already_launched: not is_launched
ensure -- from EV_APPLICATION
is_launched: is_launched

process_events
-- Process any pending events.
-- Pass control to the underlying native toolkit so that it can
-- handle any events that may be in its queue.
-- (Should be called from time to time during extended computation.)
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
is_launched: is_launched

sleep (msec: INTEGER )
-- Wait for msec milliseconds and return.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
msec_non_negative: msec >= 0

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Element Change

set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to contextual_help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

set_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
help_accelerator_assigned: help_accelerator = an_accelerator

set_help_engine (an_engine: EV_HELP_ENGINE )
-- Assign an_engine to help_engine
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_engine_not_void: an_engine /= void
ensure -- from EV_APPLICATION
help_engine_set: help_engine = an_engine

feature -- Event handling

do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
-- Perform an_action one time when the application is next idle.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "drop" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

idle_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when the application is otherwise idle.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "pick" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed just after application launch .
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_APPLICATION
tooltip_delay_not_negative: tooltip_delay >= 0
windows_not_void: windows /= void
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called

end -- class GAUGES


Standard_dialogs sample

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. If you select an item from the "Standard Dialog" menu, a dialog of that type will be displayed. Selecting "Exit" from the "File" menu will exit the application.

Under the Hood

This sample contains the following class:

  • STANDARD_DIALOGS

See Also


cluster standard_dialogs

 Cluster
standard_dialogs

Classes
STANDARD_DIALOGS


STANDARD_DIALOGS Chart

 class
STANDARD_DIALOGS

General
cluster: standard_dialogs
description: "Test of dialogs."
create: make_and_launch

Ancestors
EV_APPLICATION

Action sequences
drop_actions : EV_PND_ACTION_SEQUENCE
idle_actions : EV_NOTIFY_ACTION_SEQUENCE
pick_actions : EV_PND_ACTION_SEQUENCE
post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
alt_pressed : BOOLEAN
clipboard : EV_CLIPBOARD
contextual_help_accelerator : EV_ACCELERATOR
ctrl_pressed : BOOLEAN
data : ANY
Default_tooltip_delay : INTEGER
focused_widget : EV_WIDGET
help_accelerator : EV_ACCELERATOR
help_engine : EV_HELP_ENGINE
is_destroyed : BOOLEAN
is_launched : BOOLEAN
locked_window : EV_WINDOW
shift_pressed : BOOLEAN
tooltip_delay : INTEGER
windows : LINEAR [ EV_WINDOW ]

Commands
copy (other: [like Current] STANDARD_DIALOGS )
default_create
destroy
display_help_for_widget (a_widget: EV_WIDGET )
do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
enable_contextual_help
launch
process_events
set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_data (some_data: [like data ] ANY )
set_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_help_engine (an_engine: EV_HELP_ENGINE )
set_tooltip_delay (a_delay: INTEGER )
sleep (msec: INTEGER )


STANDARD_DIALOGS Flat contracts

 indexing
description: "Test of dialogs."
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.3 $"

class interface
STANDARD_DIALOGS

create

make_and_launch
-- Create Current and launch.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

clipboard : EV_CLIPBOARD
-- Native platform clipboard access.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

contextual_help_accelerator : EV_ACCELERATOR
-- Accelerator that enables contextual help mode
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .contextual_help_accelerator)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

help_accelerator : EV_ACCELERATOR
-- Accelerator that displays contextual help
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_accelerator)

help_engine : EV_HELP_ENGINE
-- Object that handles contextual help display requests
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_engine)

locked_window : EV_WINDOW
-- Window currently locked. Void if no window
-- is currently locked.
--
-- See `{ EV_WINDOW }. lock_update ' for more details
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

windows : LINEAR [ EV_WINDOW ]
-- All of the application's windows.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .windows)

feature -- Status report

alt_pressed : BOOLEAN
-- Is alt key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

ctrl_pressed : BOOLEAN
-- Is ctrl key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

Default_tooltip_delay : INTEGER is 500
-- Default delay in milleseconds of tool tips.
-- (from EV_APPLICATION )

focused_widget : EV_WIDGET
-- Widget that has keyboard focus.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .focused_widget

is_launched : BOOLEAN
-- Has launch been called?
-- (from EV_APPLICATION )

shift_pressed : BOOLEAN
-- Is shift key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

tooltip_delay : INTEGER
-- Time in milliseconds which the pointer must be stationary over
-- a widget before a tooltips apears.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .tooltip_delay

feature -- Status setting

set_tooltip_delay (a_delay: INTEGER )
-- Assign a_delay to tooltip_delay .
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_delay_non_negative: a_delay >= 0
ensure -- from EV_APPLICATION
assigned: tooltip_delay = a_delay

feature -- Element change

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operation

display_help_for_widget (a_widget: EV_WIDGET )
-- Display contextual help for a_widget, if any.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_widget_not_void: a_widget /= void

enable_contextual_help
-- Change mouse cursor to help cursor.
-- Capture mouse input.
-- Send help context of widget being clicked to help engine for
-- Processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

launch
-- Start the application.
-- Call prepare the Begin event processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
not_already_launched: not is_launched
ensure -- from EV_APPLICATION
is_launched: is_launched

process_events
-- Process any pending events.
-- Pass control to the underlying native toolkit so that it can
-- handle any events that may be in its queue.
-- (Should be called from time to time during extended computation.)
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
is_launched: is_launched

sleep (msec: INTEGER )
-- Wait for msec milliseconds and return.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
msec_non_negative: msec >= 0

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Element Change

set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to contextual_help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

set_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
help_accelerator_assigned: help_accelerator = an_accelerator

set_help_engine (an_engine: EV_HELP_ENGINE )
-- Assign an_engine to help_engine
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_engine_not_void: an_engine /= void
ensure -- from EV_APPLICATION
help_engine_set: help_engine = an_engine

feature -- Event handling

do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
-- Perform an_action one time when the application is next idle.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "drop" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

idle_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when the application is otherwise idle.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "pick" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed just after application launch .
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_APPLICATION
tooltip_delay_not_negative: tooltip_delay >= 0
windows_not_void: windows /= void
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called

end -- class STANDARD_DIALOGS


Viewport sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\vision2\viewport\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. Modifying the values of the spin buttons will alter the position of the pixmapped button, relative to the viewport in which it is contained.

Under the Hood

The features set_x_offset and set_y_offset are used to modify the position of the EV_VIEWPORT relative to the EV_BUTTON contained within.

This sample contains the following class:

  • VIEWPORT

See Also
EV_VIEWPORT
EV_SPIN_BUTTON
EV_BUTTON


cluster root_cluster

 Cluster
root_cluster

Classes
VIEWPORT


VIEWPORT Chart

 class
VIEWPORT

General
cluster: root_cluster
description: "Viewport example."
create: make_and_launch

Ancestors
EV_APPLICATION

Action sequences
drop_actions : EV_PND_ACTION_SEQUENCE
idle_actions : EV_NOTIFY_ACTION_SEQUENCE
pick_actions : EV_PND_ACTION_SEQUENCE
post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
alt_pressed : BOOLEAN
clipboard : EV_CLIPBOARD
contextual_help_accelerator : EV_ACCELERATOR
ctrl_pressed : BOOLEAN
data : ANY
Default_tooltip_delay : INTEGER
focused_widget : EV_WIDGET
help_accelerator : EV_ACCELERATOR
help_engine : EV_HELP_ENGINE
is_destroyed : BOOLEAN
is_launched : BOOLEAN
locked_window : EV_WINDOW
shift_pressed : BOOLEAN
tooltip_delay : INTEGER
windows : LINEAR [ EV_WINDOW ]

Commands
copy (other: [like Current] VIEWPORT )
default_create
destroy
display_help_for_widget (a_widget: EV_WIDGET )
do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
enable_contextual_help
launch
process_events
set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_data (some_data: [like data ] ANY )
set_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_help_engine (an_engine: EV_HELP_ENGINE )
set_tooltip_delay (a_delay: INTEGER )
sleep (msec: INTEGER )


VIEWPORT Flat contracts

 indexing
description: "Viewport example."
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.2 $"

class interface
VIEWPORT

create

make_and_launch
-- Create Current and launch.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

clipboard : EV_CLIPBOARD
-- Native platform clipboard access.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

contextual_help_accelerator : EV_ACCELERATOR
-- Accelerator that enables contextual help mode
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .contextual_help_accelerator)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

help_accelerator : EV_ACCELERATOR
-- Accelerator that displays contextual help
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_accelerator)

help_engine : EV_HELP_ENGINE
-- Object that handles contextual help display requests
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_engine)

locked_window : EV_WINDOW
-- Window currently locked. Void if no window
-- is currently locked.
--
-- See `{ EV_WINDOW }. lock_update ' for more details
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

windows : LINEAR [ EV_WINDOW ]
-- All of the application's windows.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .windows)

feature -- Status report

alt_pressed : BOOLEAN
-- Is alt key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

ctrl_pressed : BOOLEAN
-- Is ctrl key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

Default_tooltip_delay : INTEGER is 500
-- Default delay in milleseconds of tool tips.
-- (from EV_APPLICATION )

focused_widget : EV_WIDGET
-- Widget that has keyboard focus.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .focused_widget

is_launched : BOOLEAN
-- Has launch been called?
-- (from EV_APPLICATION )

shift_pressed : BOOLEAN
-- Is shift key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

tooltip_delay : INTEGER
-- Time in milliseconds which the pointer must be stationary over
-- a widget before a tooltips apears.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .tooltip_delay

feature -- Status setting

set_tooltip_delay (a_delay: INTEGER )
-- Assign a_delay to tooltip_delay .
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_delay_non_negative: a_delay >= 0
ensure -- from EV_APPLICATION
assigned: tooltip_delay = a_delay

feature -- Element change

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operation

display_help_for_widget (a_widget: EV_WIDGET )
-- Display contextual help for a_widget, if any.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_widget_not_void: a_widget /= void

enable_contextual_help
-- Change mouse cursor to help cursor.
-- Capture mouse input.
-- Send help context of widget being clicked to help engine for
-- Processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

launch
-- Start the application.
-- Call prepare the Begin event processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
not_already_launched: not is_launched
ensure -- from EV_APPLICATION
is_launched: is_launched

process_events
-- Process any pending events.
-- Pass control to the underlying native toolkit so that it can
-- handle any events that may be in its queue.
-- (Should be called from time to time during extended computation.)
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
is_launched: is_launched

sleep (msec: INTEGER )
-- Wait for msec milliseconds and return.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
msec_non_negative: msec >= 0

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Element Change

set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to contextual_help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

set_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
help_accelerator_assigned: help_accelerator = an_accelerator

set_help_engine (an_engine: EV_HELP_ENGINE )
-- Assign an_engine to help_engine
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_engine_not_void: an_engine /= void
ensure -- from EV_APPLICATION
help_engine_set: help_engine = an_engine

feature -- Event handling

do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
-- Perform an_action one time when the application is next idle.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "drop" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

idle_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when the application is otherwise idle.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "pick" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed just after application launch .
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_APPLICATION
tooltip_delay_not_negative: tooltip_delay >= 0
windows_not_void: windows /= void
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called

end -- class VIEWPORT


Widgets Sample

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. You may exit the application at any time, by clicking on the close icon, or you may select "exit" from the "File" menu. Selected "Help", "about" displays a dialog with details about the application.

The left hand side of the main window contains a tree, showing the widgets available within vision2. If you select one of these widgets in the tree, then the type of widget you selected will be displayed in the middle of the main_window. Controls will also the be available to the right hand side of the widget, which allow you to modify its state. These controls do not represent all the available feature of the widget, but demonstrate many of the most common. The text area below the currently selected widget displays the events that have occurred on the widget. Only those events inherited by EV_WIDGET are displayed.

Under the Hood

This sample contains the following classes:

  • ABOUT_DIALOG
  • COLORIZABLE_CONTROL
  • CONTAINER_CONTROL
  • DESELECTABLE_CONTROL
  • DRAWABLE_CONTROL
  • GAUGE_CONTROL
  • ITEM_LIST_CONTROL
  • MAIN_WINDOW
  • PIXMAPABLE_CONTROL
  • SELECTABLE_CONTROL
  • SENSITIVE_CONTROL
  • TEXT_COMPONENT_CONTROL
  • TEXTABLE_CONTROL
  • WIDGET_CONTROL
  • WIDGETS


cluster root_cluster

 Cluster
root_cluster

Classes
ABOUT_DIALOG
COLORIZABLE_CONTROL
CONTAINER_CONTROL
DESELECTABLE_CONTROL
DRAWABLE_CONTROL
GAUGE_CONTROL
ITEM_LIST_CONTROL
MAIN_WINDOW
PIXMAPABLE_CONTROL
SELECTABLE_CONTROL
SENSITIVE_CONTROL
TEXT_COMPONENT_CONTROL
TEXTABLE_CONTROL
WIDGET_CONTROL
WIDGETS


ABOUT_DIALOG Chart

 class
ABOUT_DIALOG

General
cluster: root_cluster
description: "About Dialog, displaying general information."
create: make

Ancestors
EV_DIALOG
EV_LAYOUT_CONSTANTS
EV_STOCK_COLORS

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
move_actions : EV_GEOMETRY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
show_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
accelerators : EV_ACCELERATOR_LIST
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
Default_border_size : INTEGER
Default_button_height : INTEGER
Default_button_width : INTEGER
default_cancel_button : EV_BUTTON
Default_padding_size : INTEGER
default_push_button : EV_BUTTON
deny_cursor : EV_CURSOR
dialog_unit_to_pixels (a_size: INTEGER ): INTEGER
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
icon_name : STRING
icon_pixmap : EV_PIXMAP
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_maximized : BOOLEAN
is_minimized : BOOLEAN
is_modal : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
Large_border_size : INTEGER
linear_representation : LINEAR [[like item ] EV_WIDGET ]
lower_bar : EV_VERTICAL_BOX
maximum_height : INTEGER
maximum_width : INTEGER
menu_bar : EV_MENU_BAR
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
Small_border_size : INTEGER
Small_padding_size : INTEGER
T_borland : STRING
T_copyright_info : STRING
T_info : STRING
target_name : STRING
Tiny_padding_size : INTEGER
title : STRING
upper_bar : EV_VERTICAL_BOX
user_can_resize : BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
center_pointer
copy (other: [like Current] ABOUT_DIALOG )
default_create
destroy
dialog_key_press_action (a_key: EV_KEY )
disable_capture
disable_pebble_positioning
disable_sensitive
disable_user_resize
enable_capture
enable_pebble_positioning
enable_sensitive
enable_user_resize
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
lock_update
lower
maximize
merge_radio_button_groups (other: EV_CONTAINER )
minimize
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
raise
remove_default_cancel_button
remove_default_push_button
remove_help_context
remove_icon_name
remove_menu_bar
remove_pebble
remove_title
replace (v: [like item ] EV_WIDGET )
restore
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_cancel_button (a_button: EV_BUTTON )
set_default_colors
set_default_push_button (a_button: EV_BUTTON )
set_default_size_for_button (a_button: EV_BUTTON )
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_height (a_height: INTEGER )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_icon_name (an_icon_name: STRING )
set_icon_pixmap (an_icon: EV_PIXMAP )
set_maximum_height (a_maximum_height: INTEGER )
set_maximum_size (a_maximum_width, a_maximum_height: INTEGER )
set_maximum_width (a_maximum_width: INTEGER )
set_menu_bar (a_menu_bar: EV_MENU_BAR )
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_position (a_x, a_y: INTEGER )
set_size (a_width, a_height: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_title (a_title: STRING )
set_width (a_width: INTEGER )
set_x_position (a_x: INTEGER )
set_y_position (a_y: INTEGER )
show
show_modal_to_window (a_window: EV_WINDOW )
show_relative_to_window (a_window: EV_WINDOW )
unlock_update
wipe_out


ABOUT_DIALOG Flat contracts

 indexing
description: "About Dialog, displaying general information."
date: "$Date: 2001/07/14 07:42:01 $"
revision: "$Revision: 1.4 $"

class interface
ABOUT_DIALOG

create

make
-- Create current.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accelerators : EV_ACCELERATOR_LIST
-- Key combination shortcuts associated with this window.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

default_cancel_button : EV_BUTTON
-- Default cancel button. This is the button that
-- is pushed if the user press the escape key or
-- close the window using the close icon.
-- If there is no default cancel button, the close
-- icon is disabled.
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed

default_push_button : EV_BUTTON
-- Default pushed button. This is the button that
-- is pushed if the user press the enter key unless
-- a push button is currently focused.
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

icon_name : STRING
-- Alternative name, displayed when window is minimised.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: equal (Result, implementation .icon_name)

icon_pixmap : EV_PIXMAP
-- Window icon.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result. is_equal ( implementation .icon_pixmap)

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_modal : BOOLEAN
-- Must Current be closed before application can
-- receive user events again?
-- (from EV_DIALOG )

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

lower_bar : EV_VERTICAL_BOX
-- Room at bottom of window. (Example use: statusbar.)
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .lower_bar

maximum_height : INTEGER
-- Upper bound on height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: (Result = implementation .internal_maximum_height) or (Result = implementation .minimum_height)

maximum_width : INTEGER
-- Upper bound on width in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: (Result = implementation .internal_maximum_width) or (Result = implementation .minimum_width)

menu_bar : EV_MENU_BAR
-- Horizontal bar at top of client area that contains menu's.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .menu_bar

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

title : STRING
-- A textual name used by the window manager.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: equal (Result, implementation .title)

upper_bar : EV_VERTICAL_BOX
-- Room at top of window. (Example use: toolbars.)
-- Positioned below menu bar.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .upper_bar

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has (v: EV_WIDGET ): BOOLEAN
-- Does structure include v?
-- (from EV_WINDOW )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_maximized : BOOLEAN
-- Is displayed at maximum size?
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result = implementation .is_maximized

is_minimized : BOOLEAN
-- Is displayed iconified/minimised?
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result = implementation .is_minimized

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

user_can_resize : BOOLEAN
-- Can the user resize?
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .user_can_resize

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

disable_user_resize
-- Prevent user from resizing.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
not_user_can_resize: not user_can_resize

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

enable_user_resize
-- Allow user to resize.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
user_can_resize: user_can_resize

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

lock_update
-- Lock drawing updates for this window on certain platforms until
-- unlock_update is called.
--
-- Note: - Only one window can be locked at a time.
-- - The window cannot be moved while update is locked.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
no_locked_window: ((create { EV_ENVIRONMENT }).application.locked_window = void )
ensure -- from EV_WINDOW
locked_window_is_current: (create { EV_ENVIRONMENT }).application.locked_window = Current

lower
-- Request that window be displayed below all other windows.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

maximize
-- Display at maximum size.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
is_maximized: is_maximized

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

minimize
-- Display iconified/minimised.
-- It is not possible to guarantee this on some
-- platform configurations.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

raise
-- Request that window be displayed above all other windows.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

remove_menu_bar
-- Make menu_bar Void.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
void: menu_bar = void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

remove_title
-- Make title Void.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
a_title_removed: title = void

restore
-- Restore to original position when minimized or maximized.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
minimize_restored: old is_minimized implies not is_minimized
maximize_restored: old is_maximized implies not is_maximized

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_height (a_height: INTEGER )
-- Assign a_height to height in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_height_positive_or_zero: a_height >= 0
ensure -- from EV_POSITIONABLE
height_assigned: height = minimum_height or else height = a_height

set_maximum_height (a_maximum_height: INTEGER )
-- Assign a_maximum_height to maximum_height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_height_non_negative: a_maximum_height >= 0
a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
ensure -- from EV_WINDOW
maximum_height_assigned: maximum_height = a_maximum_height

set_maximum_size (a_maximum_width, a_maximum_height: INTEGER )
-- Assign a_maximum_width to maximum_width
-- and a_maximum_height to maximum_height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
ensure -- from EV_WINDOW
maximum_width_assigned: maximum_width = a_maximum_width
maximum_height_assigned: maximum_height = a_maximum_height

set_maximum_width (a_maximum_width: INTEGER )
-- Assign a_maximum_width to maximum_width in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_width_non_negative: a_maximum_width >= 0
a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
ensure -- from EV_WINDOW
maximum_width_assigned: maximum_width = a_maximum_width

set_menu_bar (a_menu_bar: EV_MENU_BAR )
-- Assign a_menu_bar to menu_bar .
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
no_menu_bar_assigned: menu_bar = void
a_menu_bar_not_void: a_menu_bar /= void
ensure -- from EV_WINDOW
assigned: menu_bar = a_menu_bar

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_position (a_x, a_y: INTEGER )
-- Assign a_x to x_position and a_y to y_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
x_position_assigned: x_position = a_x
y_position_assigned: y_position = a_y

set_size (a_width, a_height: INTEGER )
-- Assign a_width to width and a_height to height in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_width_positive_or_zero: a_width >= 0
a_height_positive_or_zero: a_height >= 0
ensure -- from EV_POSITIONABLE
width_assigned: width = minimum_width or else width = a_width
height_assigned: height = minimum_height or else height = a_height

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

set_title (a_title: STRING )
-- Assign a_title to title .
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_title_not_void: a_title /= void
a_title_not_empty: not a_title. is_empty
ensure -- from EV_WINDOW
a_title_assigned: title . is_equal (a_title)

set_width (a_width: INTEGER )
-- Assign a_width to width in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_width_positive_or_zero: a_width >= 0
ensure -- from EV_POSITIONABLE
width_assigned: width = minimum_width or else width = a_width

set_x_position (a_x: INTEGER )
-- Assign a_x to x_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
x_position_assigned: x_position = a_x

set_y_position (a_y: INTEGER )
-- Assign a_y to y_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
y_position_assigned: y_position = a_y

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

unlock_update
-- Unlock updates for this widget on certain platforms.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
locked_window_is_current: (create { EV_ENVIRONMENT }).application.locked_window = Current
ensure -- from EV_WINDOW
no_locked_window: ((create { EV_ENVIRONMENT }).application.locked_window = void )

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_icon_name
-- Make icon_name Void.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
icon_name_removed: icon_name = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_icon_name (an_icon_name: STRING )
-- Assign an_icon_name to icon_name .
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
an_icon_name_not_void: an_icon_name /= void
an_icon_name_not_empty: not an_icon_name. is_empty
ensure -- from EV_TITLED_WINDOW
icon_name_assigned: icon_name . is_equal (an_icon_name)

set_icon_pixmap (an_icon: EV_PIXMAP )
-- Assign an_icon to icon.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
pixmap_not_void: an_icon /= void
ensure -- from EV_TITLED_WINDOW
icon_pixmap_assigned: icon_pixmap . is_equal (an_icon)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

dialog_unit_to_pixels (a_size: INTEGER ): INTEGER
-- Convert a_size dialog units into pixels.
-- Used to get the same look&feel under all platforms
-- (from EV_LAYOUT_CONSTANTS )

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

dialog_key_press_action (a_key: EV_KEY )
-- The action performed to process default push and cancel
-- buttons. This is inserted in key_press_actions and
-- behaves is follows:
-- If escape is pressed at any time then
-- If there is a default_cancel_button then
-- If it is sensitive, call its select_actions,
-- otherwise, close the dialog.
-- If there is no default_cancel_button , do nothing.
-- If enter is pressed at any time then
-- If a push button is currently focused then call its
-- select_actions. If no push button has the focus, then
-- call the select_actions of the default push button if
-- it is sensitive.
-- (from EV_DIALOG )

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

show_modal_to_window (a_window: EV_WINDOW )
-- Show and wait until Current is closed.
-- Current is shown modal with respect to a_window.
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed
dialog_modeless: not is_modal
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current

show_relative_to_window (a_window: EV_WINDOW )
-- Show Current with respect to a_window.
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current

feature -- Access (border constants)

default_border_size : INTEGER
-- Default size for borders
-- (from EV_LAYOUT_CONSTANTS )

small_border_size : INTEGER
-- Small size for borders
-- (from EV_LAYOUT_CONSTANTS )

feature -- Access (button size constants)

default_button_height : INTEGER
-- Default height for buttons
-- (from EV_LAYOUT_CONSTANTS )

default_button_width : INTEGER
-- Default width for buttons
-- (from EV_LAYOUT_CONSTANTS )

feature -- Access (padding constants)

default_padding_size : INTEGER
-- Default size for padding
-- (from EV_LAYOUT_CONSTANTS )

large_border_size : INTEGER
-- Default size for borders
-- (from EV_LAYOUT_CONSTANTS )

small_padding_size : INTEGER
-- Small size for padding
-- (from EV_LAYOUT_CONSTANTS )

tiny_padding_size : INTEGER
-- Tiny size for padding
-- (from EV_LAYOUT_CONSTANTS )

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Constant strings

t_borland : STRING
-- Text for Borland.

t_copyright_info : STRING

t_info : STRING

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

move_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when window moves.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

show_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when window is shown.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

feature -- Operation

set_default_size_for_button (a_button: EV_BUTTON )
-- Set the default size for a_button.
-- (from EV_LAYOUT_CONSTANTS )

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

feature -- Status Setting

remove_default_cancel_button
-- Remove default_cancel_button .
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed
has_default_cancel_button: default_cancel_button /= void
ensure -- from EV_DIALOG
not_has_default_cancel_button: default_cancel_button = void

remove_default_push_button
-- Remove default_push_button .
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed
has_default_push_button: default_push_button /= void
ensure -- from EV_DIALOG
not_has_default_push_button: default_push_button = void

set_default_cancel_button (a_button: EV_BUTTON )
-- Assign a_button to default_cancel_button .
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed
a_button_not_void: a_button /= void
has_button: has_recursive (a_button)
ensure -- from EV_DIALOG
default_cancel_button_set: default_cancel_button = a_button

set_default_push_button (a_button: EV_BUTTON )
-- Assign a_button to `default push button'.
-- (from EV_DIALOG )
require -- from EV_DIALOG
not_destroyed: not is_destroyed
a_button_not_void: a_button /= void
has_button: has_recursive (a_button)

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_TITLED_WINDOW
accelerators_not_void: is_usable implies accelerators /= void
-- from EV_WINDOW
consistent_horizontal_bounds: maximum_width >= minimum_width
consistent_vertical_bounds: maximum_height >= minimum_height
upper_bar_not_void: is_usable implies upper_bar /= void
lower_bar_not_void: is_usable implies lower_bar /= void
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_STOCK_COLORS
white_not_void: white /= void
black_not_void: black /= void
grey_not_void: grey /= void
gray_not_void: gray /= void
dark_grey_not_void: dark_grey /= void
dark_gray_not_void: dark_gray /= void
blue_not_void: blue /= void
dark_blue_not_void: dark_blue /= void
cyan_not_void: cyan /= void
dark_cyan_not_void: dark_cyan /= void
green_not_void: green /= void
dark_green_not_void: dark_green /= void
yellow_not_void: yellow /= void
dark_yellow_not_void: dark_yellow /= void
red_not_void: red /= void
dark_red_not_void: dark_red /= void
magenta_not_void: magenta /= void
dark_magenta_not_void: dark_magenta /= void
color_dialog_not_void: color_dialog /= void
color_read_only_not_void: color_read_only /= void
color_read_write_not_void: color_read_write /= void
default_background_color_not_void: default_background_color /= void
default_foreground_color_not_void: default_foreground_color /= void
all_colors_not_void: all_colors /= void
all_colors_count_is_sixteen: all_colors . count = 18

end -- class ABOUT_DIALOG


COLORIZABLE_CONTROL Chart

 class
COLORIZABLE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_COLORIZABLE ."
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] COLORIZABLE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


COLORIZABLE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_COLORIZABLE ."
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.3 $"

class interface
COLORIZABLE_CONTROL

create

make (box: EV_BOX ; colorizable: EV_COLORIZABLE ; output: EV_TEXT )
-- Create controls to manipulate colorizable, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class COLORIZABLE_CONTROL


CONTAINER_CONTROL Chart

 class
CONTAINER_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_CONTAINER "
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] CONTAINER_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


CONTAINER_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_CONTAINER "
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.3 $"

class interface
CONTAINER_CONTROL

create

make (box: EV_BOX ; a_container: EV_CONTAINER ; output: EV_TEXT )
-- Create controls to manipulate a_container, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class CONTAINER_CONTROL


DESELECTABLE_CONTROL Chart

 class
DESELECTABLE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_DESELECTABLE ."
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] DESELECTABLE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


DESELECTABLE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_DESELECTABLE ."
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.3 $"

class interface
DESELECTABLE_CONTROL

create

make (box: EV_BOX ; deselectable: EV_DESELECTABLE ; output: EV_TEXT )
-- Create controls to manipulate deselctable, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class DESELECTABLE_CONTROL


DRAWABLE_CONTROL Chart

 class
DRAWABLE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_DRAWABLE "
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] DRAWABLE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


DRAWABLE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_DRAWABLE "
date: "$Date: 2001/07/14 05:37:42 $"
revision: "$Revision: 1.3 $"

class interface
DRAWABLE_CONTROL

create

make (box: EV_BOX ; a_drawable: EV_DRAWABLE ; output: EV_TEXT )
-- Create controls to manipulate a_drawable, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class DRAWABLE_CONTROL


GAUGE_CONTROL Chart

 class
GAUGE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_GAUGE "
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] GAUGE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


GAUGE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_GAUGE "
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
GAUGE_CONTROL

create

make (box: EV_BOX ; gauge: EV_GAUGE ; output: EV_TEXT )
-- Create controls to manipulate gauge, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class GAUGE_CONTROL


ITEM_LIST_CONTROL Chart

 class
ITEM_LIST_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_ITEM_LIST [ EV_ITEM ]"
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] ITEM_LIST_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


ITEM_LIST_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_ITEM_LIST [ EV_ITEM ]"
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
ITEM_LIST_CONTROL

create

make (box: EV_BOX ; an_item_list: EV_ITEM_LIST [ EV_ITEM ]; output: EV_TEXT )
-- Create controls to manipulate an_item_list, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class ITEM_LIST_CONTROL


MAIN_WINDOW Chart

 class
MAIN_WINDOW

General
cluster: root_cluster
description: "The main window for the vision2 widget test."
create: default_create

Ancestors
EV_TITLED_WINDOW
INTERNAL

Action sequences
close_request_actions : EV_NOTIFY_ACTION_SEQUENCE
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
move_actions : EV_GEOMETRY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
show_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
a_menu_bar : EV_MENU_BAR
about_dialog : ABOUT_DIALOG
about_menu_item : EV_MENU_ITEM
accelerators : EV_ACCELERATOR_LIST
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
background_color : EV_COLOR
bit_size (i: INTEGER ; object: ANY ): INTEGER
Bit_type : INTEGER
boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
Boolean_type : INTEGER
button : EV_BUTTON
button1 : EV_BUTTON
character_field (i: INTEGER ; object: ANY ): CHARACTER
Character_type : INTEGER
class_name (object: ANY ): STRING
client_height : INTEGER
client_width : INTEGER
compiler_version : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
double_field (i: INTEGER ; object: ANY ): DOUBLE
Double_type : INTEGER
dynamic_type (object: ANY ): INTEGER
dynamic_type_from_string (class_type: STRING ): INTEGER
exit_menu_item : EV_MENU_ITEM
expanded_field_type (i: INTEGER ; object: ANY ): STRING
Expanded_type : INTEGER
extendible : BOOLEAN
field (i: INTEGER ; object: ANY ): ANY
field_count (object: ANY ): INTEGER
field_count_of_type (type_id: INTEGER ): INTEGER
field_name (i: INTEGER ; object: ANY ): STRING
field_name_of_type (i, type_id: INTEGER ): STRING
field_offset (i: INTEGER ; object: ANY ): INTEGER
field_type (i: INTEGER ; object: ANY ): INTEGER
field_type_of_type (i, type_id: INTEGER ): INTEGER
file_menu : EV_MENU
foreground_color : EV_COLOR
frame : EV_FRAME
full : BOOLEAN
generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
help_menu : EV_MENU
horizontal_box : EV_HORIZONTAL_BOX
icon_name : STRING
icon_pixmap : EV_PIXMAP
id_object (an_id: INTEGER ): IDENTIFIED
Integer_16_type : INTEGER
Integer_32_type : INTEGER
Integer_64_type : INTEGER
Integer_8_type : INTEGER
integer_field (i: INTEGER ; object: ANY ): INTEGER
Integer_type : INTEGER
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
is_maximized : BOOLEAN
is_minimized : BOOLEAN
is_modal : BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
is_special (object: ANY ): BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
lower_bar : EV_VERTICAL_BOX
maximum_height : INTEGER
maximum_width : INTEGER
menu_bar : EV_MENU_BAR
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
new_instance_of (type_id: INTEGER ): ANY
object_id : INTEGER
output : EV_TEXT
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
physical_size (object: ANY ): INTEGER
pointer_field (i: INTEGER ; object: ANY ): POINTER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
Pointer_type : INTEGER
prunable : BOOLEAN
readable : BOOLEAN
real_field (i: INTEGER ; object: ANY ): REAL
Real_type : INTEGER
Reference_type : INTEGER
screen_x : INTEGER
screen_y : INTEGER
scrollable_area : EV_SCROLLABLE_AREA
target_name : STRING
test_detail_selection : EV_NOTEBOOK
test_holder : EV_VERTICAL_BOX
text_field : EV_TEXT_FIELD
title : STRING
type_conforms_to (type1, type2: INTEGER ): BOOLEAN
upper_bar : EV_VERTICAL_BOX
user_can_resize : BOOLEAN
vertical_box : EV_VERTICAL_BOX
vertical_box1 : EV_VERTICAL_BOX
Wide_character_type : INTEGER
widget_area : EV_FRAME
widget_tree : EV_TREE
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
center_pointer
copy (other: [like Current] MAIN_WINDOW )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
disable_user_resize
enable_capture
enable_pebble_positioning
enable_sensitive
enable_user_resize
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
lock_update
lower
maximize
merge_radio_button_groups (other: EV_CONTAINER )
minimize
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
raise
remove_help_context
remove_icon_name
remove_menu_bar
remove_pebble
remove_title
replace (v: [like item ] EV_WIDGET )
restore
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_height (a_height: INTEGER )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_icon_name (an_icon_name: STRING )
set_icon_pixmap (an_icon: EV_PIXMAP )
set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
set_maximum_height (a_maximum_height: INTEGER )
set_maximum_size (a_maximum_width, a_maximum_height: INTEGER )
set_maximum_width (a_maximum_width: INTEGER )
set_menu_bar (a_menu_bar: EV_MENU_BAR )
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_position (a_x, a_y: INTEGER )
set_real_field (i: INTEGER ; object: ANY ; value: REAL )
set_reference_field (i: INTEGER ; object, value: ANY )
set_size (a_width, a_height: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_title (a_title: STRING )
set_width (a_width: INTEGER )
set_x_position (a_x: INTEGER )
set_y_position (a_y: INTEGER )
show
unlock_update
wipe_out


MAIN_WINDOW Flat contracts

 indexing
description: "The main window for the vision2 widget test."
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
MAIN_WINDOW

create

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

a_menu_bar : EV_MENU_BAR

about_dialog : ABOUT_DIALOG

about_menu_item : EV_MENU_ITEM
-- Was declared in MAIN_WINDOW as synonym of exit_menu_item .

accelerators : EV_ACCELERATOR_LIST
-- Key combination shortcuts associated with this window.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

Bit_type : INTEGER is 8
-- (from INTERNAL )

boolean_field (i: INTEGER ; object: ANY ): BOOLEAN
-- Boolean value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

Boolean_type : INTEGER is 3
-- (from INTERNAL )

button : EV_BUTTON
-- Was declared in MAIN_WINDOW as synonym of button1 .

button1 : EV_BUTTON
-- Was declared in MAIN_WINDOW as synonym of button .

character_field (i: INTEGER ; object: ANY ): CHARACTER
-- Character value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

Character_type : INTEGER is 2
-- (from INTERNAL )

class_name (object: ANY ): STRING
-- Name of the class associated with object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

double_field (i: INTEGER ; object: ANY ): DOUBLE
-- Double precision value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

Double_type : INTEGER is 6
-- (from INTERNAL )

dynamic_type (object: ANY ): INTEGER
-- Dynamic type of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

exit_menu_item : EV_MENU_ITEM
-- Was declared in MAIN_WINDOW as synonym of about_menu_item .

expanded_field_type (i: INTEGER ; object: ANY ): STRING
-- Class name associated with the i-th
-- expanded field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_expanded: field_type (i, object) = expanded_type
ensure -- from INTERNAL
result_exists: Result /= void

Expanded_type : INTEGER is 7
-- (from INTERNAL )

field (i: INTEGER ; object: ANY ): ANY
-- Object attached to the i-th field of object
-- (directly or through a reference)
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_name (i: INTEGER ; object: ANY ): STRING
-- Name of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)
ensure -- from INTERNAL
result_exists: Result /= void

field_name_of_type (i: INTEGER ; type_id: INTEGER ): STRING
-- Name of i-th field of dynamic type type_id.
-- (from INTERNAL )
require -- from INTERNAL
index_large_enough: i >= 1
index_small_enought: i <= field_count_of_type (type_id)

field_offset (i: INTEGER ; object: ANY ): INTEGER
-- Offset of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
not_special: not is_special (object)

field_type (i: INTEGER ; object: ANY ): INTEGER
-- Type of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)

field_type_of_type (i: INTEGER ; type_id: INTEGER ): INTEGER
-- Type of i-th field of dynamic type type_id
-- (from INTERNAL )
require -- from INTERNAL
index_large_enough: i >= 1
index_small_enough: i <= field_count_of_type (type_id)

file_menu : EV_MENU
-- Was declared in MAIN_WINDOW as synonym of help_menu .

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

frame : EV_FRAME

generic_dynamic_type (object: ANY ; i: INTEGER ): INTEGER
-- Dynamic type of generic parameter of object at
-- position i.
-- (from INTERNAL )

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

help_menu : EV_MENU
-- Was declared in MAIN_WINDOW as synonym of file_menu .

horizontal_box : EV_HORIZONTAL_BOX

icon_name : STRING
-- Alternative name, displayed when window is minimised.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: equal (Result, implementation .icon_name)

icon_pixmap : EV_PIXMAP
-- Window icon.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result. is_equal ( implementation .icon_pixmap)

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

Integer_16_type : INTEGER is 10
-- (from INTERNAL )

Integer_32_type : INTEGER is 4
-- (from INTERNAL )

Integer_64_type : INTEGER is 11
-- (from INTERNAL )

Integer_8_type : INTEGER is 9
-- (from INTERNAL )

integer_field (i: INTEGER ; object: ANY ): INTEGER
-- Integer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

Integer_type : INTEGER is 4
-- (from INTERNAL )

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

lower_bar : EV_VERTICAL_BOX
-- Room at bottom of window. (Example use: statusbar.)
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .lower_bar

maximum_height : INTEGER
-- Upper bound on height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: (Result = implementation .internal_maximum_height) or (Result = implementation .minimum_height)

maximum_width : INTEGER
-- Upper bound on width in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: (Result = implementation .internal_maximum_width) or (Result = implementation .minimum_width)

menu_bar : EV_MENU_BAR
-- Horizontal bar at top of client area that contains menu's.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .menu_bar

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

output : EV_TEXT
-- All event output occurs here.
-- The following widgets are used to build the interface
-- for the user.

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_field (i: INTEGER ; object: ANY ): POINTER
-- Pointer value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

Pointer_type : INTEGER is 0
-- (from INTERNAL )

real_field (i: INTEGER ; object: ANY ): REAL
-- Real value of i-th field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

Real_type : INTEGER is 5
-- (from INTERNAL )

Reference_type : INTEGER is 1
-- (from INTERNAL )

scrollable_area : EV_SCROLLABLE_AREA

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

test_detail_selection : EV_NOTEBOOK
-- This holds different details of the test for each widget.

test_holder : EV_VERTICAL_BOX

text_field : EV_TEXT_FIELD

title : STRING
-- A textual name used by the window manager.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: equal (Result, implementation .title)

upper_bar : EV_VERTICAL_BOX
-- Room at top of window. (Example use: toolbars.)
-- Positioned below menu bar.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .upper_bar

vertical_box : EV_VERTICAL_BOX
-- Was declared in MAIN_WINDOW as synonym of vertical_box1 .

vertical_box1 : EV_VERTICAL_BOX
-- Was declared in MAIN_WINDOW as synonym of vertical_box .

Wide_character_type : INTEGER is 12
-- (from INTERNAL )

widget_area : EV_FRAME
-- A cell to hold the currently selected and testable widget.

widget_tree : EV_TREE
-- A tree holding all testable widgets.

feature -- Measurement

bit_size (i: INTEGER ; object: ANY ): INTEGER
-- Size (in bit) of the i-th bit field of object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
is_bit: field_type (i, object) = bit_type
ensure -- from INTERNAL
positive_result: Result > 0

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

field_count (object: ANY ): INTEGER
-- Number of logical fields in object
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

field_count_of_type (type_id: INTEGER ): INTEGER
-- Number of logical fields in dynamic type type_id.
-- (from INTERNAL )

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

physical_size (object: ANY ): INTEGER
-- Space occupied by object in bytes
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has (v: EV_WIDGET ): BOOLEAN
-- Does structure include v?
-- (from EV_WINDOW )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_maximized : BOOLEAN
-- Is displayed at maximum size?
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result = implementation .is_maximized

is_minimized : BOOLEAN
-- Is displayed iconified/minimised?
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
bridge_ok: Result = implementation .is_minimized

is_modal : BOOLEAN
-- Must the window be closed before application can
-- receive user events again?
--
-- May be redefined in EV_DIALOG to return
-- a different value
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

is_special (object: ANY ): BOOLEAN
-- Is object a special object?
-- It only recognized a special object
-- initialized within a TO_SPECIAL object.
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

user_can_resize : BOOLEAN
-- Can the user resize?
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
bridge_ok: Result = implementation .user_can_resize

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

disable_user_resize
-- Prevent user from resizing.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
not_user_can_resize: not user_can_resize

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

enable_user_resize
-- Allow user to resize.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
user_can_resize: user_can_resize

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

lock_update
-- Lock drawing updates for this window on certain platforms until
-- unlock_update is called.
--
-- Note: - Only one window can be locked at a time.
-- - The window cannot be moved while update is locked.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
no_locked_window: ((create { EV_ENVIRONMENT }).application.locked_window = void )
ensure -- from EV_WINDOW
locked_window_is_current: (create { EV_ENVIRONMENT }).application.locked_window = Current

lower
-- Request that window be displayed below all other windows.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

maximize
-- Display at maximum size.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
is_maximized: is_maximized

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

minimize
-- Display iconified/minimised.
-- It is not possible to guarantee this on some
-- platform configurations.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

raise
-- Request that window be displayed above all other windows.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed

remove_menu_bar
-- Make menu_bar Void.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
void: menu_bar = void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

remove_title
-- Make title Void.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_WINDOW
a_title_removed: title = void

restore
-- Restore to original position when minimized or maximized.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
minimize_restored: old is_minimized implies not is_minimized
maximize_restored: old is_maximized implies not is_maximized

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_height (a_height: INTEGER )
-- Assign a_height to height in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_height_positive_or_zero: a_height >= 0
ensure -- from EV_POSITIONABLE
height_assigned: height = minimum_height or else height = a_height

set_maximum_height (a_maximum_height: INTEGER )
-- Assign a_maximum_height to maximum_height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_height_non_negative: a_maximum_height >= 0
a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
ensure -- from EV_WINDOW
maximum_height_assigned: maximum_height = a_maximum_height

set_maximum_size (a_maximum_width, a_maximum_height: INTEGER )
-- Assign a_maximum_width to maximum_width
-- and a_maximum_height to maximum_height in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
a_maximum_height_not_less_than_minimum_height: a_maximum_height >= minimum_height
ensure -- from EV_WINDOW
maximum_width_assigned: maximum_width = a_maximum_width
maximum_height_assigned: maximum_height = a_maximum_height

set_maximum_width (a_maximum_width: INTEGER )
-- Assign a_maximum_width to maximum_width in pixels.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_maximum_width_non_negative: a_maximum_width >= 0
a_maximum_width_not_less_than_minimum_width: a_maximum_width >= minimum_width
ensure -- from EV_WINDOW
maximum_width_assigned: maximum_width = a_maximum_width

set_menu_bar (a_menu_bar: EV_MENU_BAR )
-- Assign a_menu_bar to menu_bar .
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
no_menu_bar_assigned: menu_bar = void
a_menu_bar_not_void: a_menu_bar /= void
ensure -- from EV_WINDOW
assigned: menu_bar = a_menu_bar

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_position (a_x, a_y: INTEGER )
-- Assign a_x to x_position and a_y to y_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
x_position_assigned: x_position = a_x
y_position_assigned: y_position = a_y

set_size (a_width, a_height: INTEGER )
-- Assign a_width to width and a_height to height in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_width_positive_or_zero: a_width >= 0
a_height_positive_or_zero: a_height >= 0
ensure -- from EV_POSITIONABLE
width_assigned: width = minimum_width or else width = a_width
height_assigned: height = minimum_height or else height = a_height

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

set_title (a_title: STRING )
-- Assign a_title to title .
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
a_title_not_void: a_title /= void
a_title_not_empty: not a_title. is_empty
ensure -- from EV_WINDOW
a_title_assigned: title . is_equal (a_title)

set_width (a_width: INTEGER )
-- Assign a_width to width in pixels.
-- (from EV_POSITIONABLE )
require -- from EV_POSITIONABLE
a_width_positive_or_zero: a_width >= 0
ensure -- from EV_POSITIONABLE
width_assigned: width = minimum_width or else width = a_width

set_x_position (a_x: INTEGER )
-- Assign a_x to x_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
x_position_assigned: x_position = a_x

set_y_position (a_y: INTEGER )
-- Assign a_y to y_position in pixels.
-- (from EV_POSITIONABLE )
ensure -- from EV_POSITIONABLE
y_position_assigned: y_position = a_y

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

unlock_update
-- Unlock updates for this widget on certain platforms.
-- (from EV_WINDOW )
require -- from EV_WINDOW
not_destroyed: not is_destroyed
locked_window_is_current: (create { EV_ENVIRONMENT }).application.locked_window = Current
ensure -- from EV_WINDOW
no_locked_window: ((create { EV_ENVIRONMENT }).application.locked_window = void )

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_icon_name
-- Make icon_name Void.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
ensure -- from EV_TITLED_WINDOW
icon_name_removed: icon_name = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_boolean_field (i: INTEGER ; object: ANY ; value: BOOLEAN )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
boolean_field: field_type (i, object) = boolean_type

set_character_field (i: INTEGER ; object: ANY ; value: CHARACTER )
-- Set character value of i-th field of object to value
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
character_field: field_type (i, object) = character_type

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_double_field (i: INTEGER ; object: ANY ; value: DOUBLE )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
double_field: field_type (i, object) = double_type

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_icon_name (an_icon_name: STRING )
-- Assign an_icon_name to icon_name .
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
an_icon_name_not_void: an_icon_name /= void
an_icon_name_not_empty: not an_icon_name. is_empty
ensure -- from EV_TITLED_WINDOW
icon_name_assigned: icon_name . is_equal (an_icon_name)

set_icon_pixmap (an_icon: EV_PIXMAP )
-- Assign an_icon to icon.
-- (from EV_TITLED_WINDOW )
require -- from EV_TITLED_WINDOW
not_destroyed: not is_destroyed
pixmap_not_void: an_icon /= void
ensure -- from EV_TITLED_WINDOW
icon_pixmap_assigned: icon_pixmap . is_equal (an_icon)

set_integer_field (i: INTEGER ; object: ANY ; value: INTEGER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
integer_field: field_type (i, object) = integer_type

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_field (i: INTEGER ; object: ANY ; value: POINTER )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
pointer_field: field_type (i, object) = pointer_type

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_real_field (i: INTEGER ; object: ANY ; value: REAL )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
real_field: field_type (i, object) = real_type

set_reference_field (i: INTEGER ; object: ANY ; value: ANY )
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void
index_large_enough: i >= 1
index_small_enough: i <= field_count (object)
reference_field: field_type (i, object) = reference_type

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Conformance

is_instance_of (object: ANY ; type_id: INTEGER ): BOOLEAN
-- Is object an instance of type type_id?
-- (from INTERNAL )
require -- from INTERNAL
object_not_void: object /= void

type_conforms_to (type1, type2: INTEGER ): BOOLEAN
-- Does type1 conform to type2?
-- (from INTERNAL )

feature -- Creation

dynamic_type_from_string (class_type: STRING ): INTEGER
-- Dynamic type corresponding to class_type.
-- If no dynamic type available, returns -1.
-- (from INTERNAL )
require -- from INTERNAL
class_type_not_void: class_type /= void
ensure -- from INTERNAL
valid_result: Result = - 1 or else Result >= 0

new_instance_of (type_id: INTEGER ): ANY
-- New instance of dynamic type_id.
-- Note: returned object is not initialized and may
-- hence violate its invariant.
-- (from INTERNAL )

feature -- Event handling

close_request_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed whan a request to close window
-- has been received.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

move_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when window moves.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

show_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when window is shown.
-- (from EV_WINDOW_ACTION_SEQUENCES )
ensure -- from EV_WINDOW_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

feature -- Version

compiler_version : INTEGER
-- (from INTERNAL )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_TITLED_WINDOW
accelerators_not_void: is_usable implies accelerators /= void
-- from EV_WINDOW
consistent_horizontal_bounds: maximum_width >= minimum_width
consistent_vertical_bounds: maximum_height >= minimum_height
upper_bar_not_void: is_usable implies upper_bar /= void
lower_bar_not_void: is_usable implies lower_bar /= void
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0

end -- class MAIN_WINDOW


PIXMAPABLE_CONTROL Chart

 class
PIXMAPABLE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_PIXMAPABLE "
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] PIXMAPABLE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


PIXMAPABLE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_PIXMAPABLE "
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
PIXMAPABLE_CONTROL

create

make (box: EV_BOX ; pixmapable: EV_PIXMAPABLE ; output: EV_TEXT )
-- Create controls to manipulate pixmapable, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class PIXMAPABLE_CONTROL


SELECTABLE_CONTROL Chart

 class
SELECTABLE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_SELECTABLE "
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] SELECTABLE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


SELECTABLE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_SELECTABLE "
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
SELECTABLE_CONTROL

create

make (box: EV_BOX ; selectable: EV_SELECTABLE ; output: EV_TEXT )
-- Create controls to manipulate selectable, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class SELECTABLE_CONTROL


SENSITIVE_CONTROL Chart

 class
SENSITIVE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_SENSITIVE "
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] SENSITIVE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


SENSITIVE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_SENSITIVE "
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
SENSITIVE_CONTROL

create

make (box: EV_BOX ; sensitive: EV_SENSITIVE ; output: EV_TEXT )
-- Create controls to manipulate sensitive, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class SENSITIVE_CONTROL


TEXTABLE_CONTROL Chart

 class
TEXTABLE_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_TEXTABLE "
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] TEXTABLE_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


TEXTABLE_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_TEXTABLE "
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
TEXTABLE_CONTROL

create

make (box: EV_BOX ; textable: EV_TEXTABLE ; output: EV_TEXT )
-- Create controls to manipulate textable, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class TEXTABLE_CONTROL


TEXT_COMPONENT_CONTROL Chart

 class
TEXT_COMPONENT_CONTROL

General
cluster: root_cluster
description: "Controls used to modify objects of type EV_TEX_COMPONENT"
create: make

Ancestors
EV_FRAME

Action sequences
conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
drop_actions : EV_PND_ACTION_SEQUENCE
focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
key_press_actions : EV_KEY_ACTION_SEQUENCE
key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
key_release_actions : EV_KEY_ACTION_SEQUENCE
pick_actions : EV_PND_START_ACTION_SEQUENCE
pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
resize_actions : EV_GEOMETRY_ACTION_SEQUENCE

Queries
accept_cursor : EV_CURSOR
actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
alignment : EV_TEXT_ALIGNMENT
background_color : EV_COLOR
client_height : INTEGER
client_width : INTEGER
count : INTEGER
data : ANY
deny_cursor : EV_CURSOR
extendible : BOOLEAN
foreground_color : EV_COLOR
full : BOOLEAN
has (v: EV_WIDGET ): BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_recursive (an_item: [like item ] EV_WIDGET ): BOOLEAN
height : INTEGER
help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
id_object (an_id: INTEGER ): IDENTIFIED
is_destroyed : BOOLEAN
is_displayed : BOOLEAN
is_empty : BOOLEAN
is_inserted (v: EV_WIDGET ): BOOLEAN
is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
is_sensitive : BOOLEAN
is_show_requested : BOOLEAN
item : EV_WIDGET
linear_representation : LINEAR [[like item ] EV_WIDGET ]
minimum_height : INTEGER
minimum_width : INTEGER
mode_is_drag_and_drop : BOOLEAN
mode_is_pick_and_drop : BOOLEAN
mode_is_target_menu : BOOLEAN
object_id : INTEGER
parent : EV_CONTAINER
pebble : ANY
pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
pebble_positioning_enabled : BOOLEAN
pebble_x_position : INTEGER
pebble_y_position : INTEGER
pointer_position : EV_COORDINATE
pointer_style : EV_CURSOR
prunable : BOOLEAN
readable : BOOLEAN
screen_x : INTEGER
screen_y : INTEGER
style : INTEGER
target_name : STRING
text : STRING
valid_frame_border (a_code: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN
x_position : INTEGER
y_position : INTEGER

Commands
align_text_center
align_text_left
align_text_right
center_pointer
copy (other: [like Current] TEXT_COMPONENT_CONTROL )
default_create
destroy
disable_capture
disable_pebble_positioning
disable_sensitive
enable_capture
enable_pebble_positioning
enable_sensitive
extend (v: [like item ] EV_WIDGET )
fill (other: CONTAINER [ EV_WIDGET ])
hide
merge_radio_button_groups (other: EV_CONTAINER )
propagate_background_color
propagate_foreground_color
prune (v: EV_WIDGET )
prune_all (v: EV_WIDGET )
put (v: [like item ] EV_WIDGET )
remove_help_context
remove_pebble
remove_text
replace (v: [like item ] EV_WIDGET )
set_accept_cursor (a_cursor: EV_CURSOR )
set_actual_drop_target_agent (an_agent: [like actual_drop_target_agent ] FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ])
set_background_color (a_color: [like background_color ] EV_COLOR )
set_data (some_data: [like data ] ANY )
set_default_colors
set_deny_cursor (a_cursor: EV_CURSOR )
set_drag_and_drop_mode
set_focus
set_foreground_color (a_color: [like foreground_color ] EV_COLOR )
set_help_context (an_help_context: [like help_context ] FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ])
set_minimum_height (a_minimum_height: INTEGER )
set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
set_minimum_width (a_minimum_width: INTEGER )
set_pebble (a_pebble: [like pebble ] ANY )
set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
set_pebble_position (a_x, a_y: INTEGER )
set_pick_and_drop_mode
set_pointer_style (a_cursor: [like pointer_style ] EV_CURSOR )
set_style (a_style: INTEGER )
set_target_menu_mode
set_target_name (a_name: STRING )
set_text (a_text: STRING )
show
wipe_out


TEXT_COMPONENT_CONTROL Flat contracts

 indexing
description: "Controls used to modify objects of type EV_TEX_COMPONENT"
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
TEXT_COMPONENT_CONTROL

create

make (box: EV_BOX ; a_text_component: EV_TEXT_COMPONENT ; output: EV_TEXT )
-- Create controls to manipulate a_text_component, parented in box and
-- displaying output in output.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

accept_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .accept_cursor

actual_drop_target_agent : FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], EV_ABSTRACT_PICK_AND_DROPABLE ]
-- Overrides default drop target on a certain position.
-- If Void, Current will use the default drop target.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .actual_drop_target_agent

alignment : EV_TEXT_ALIGNMENT
-- Current text positioning.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_not_void: Result /= void

background_color : EV_COLOR
-- Color displayed behind foreground features.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .background_color)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

deny_cursor : EV_CURSOR
-- Result is cursor displayed when the screen pointer is over a
-- target that does not accept pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .deny_cursor

foreground_color : EV_COLOR
-- Color of foreground features like text.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure -- from EV_COLORIZABLE
bridge_ok: Result. is_equal ( implementation .foreground_color)

has (v: EV_WIDGET ): BOOLEAN
-- Does Current include v?
-- (from EV_CELL )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

has_recursive (an_item: like item ): BOOLEAN
-- Does structure include an_item or
-- does any structure recursivly included by structure,
-- include an_item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

help_context : FUNCTION [ ANY , TUPLE , EV_HELP_CONTEXT ]
-- Agent that evaluates to help context sent to help engine when help is requested
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_HELP_CONTEXTABLE
bridge_ok: Result = implementation .help_context

frozen id_object (an_id: INTEGER ): IDENTIFIED
-- Object associated with an_id (void if no such object)
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
consistent: Result = void or else Result. object_id = an_id

is_parent_recursive (a_widget: EV_WIDGET ): BOOLEAN
-- Is a_widget parent , or recursivly, parent of parent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

item : EV_WIDGET
-- Current item.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
readable: readable
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .item

frozen object_id : INTEGER
-- Unique for current object in any given session
-- (from IDENTIFIED )
ensure -- from IDENTIFIED
valid_id: id_object (Result) = Current

parent : EV_CONTAINER
-- Contains Current.
-- (from EV_WIDGET )
require -- from EV_CONTAINABLE
not_destroyed: not is_destroyed
ensure then -- from EV_WIDGET
bridge_ok: Result = implementation .parent

pebble : ANY
-- Data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble

pebble_function : FUNCTION [ ANY , TUPLE , ANY ]
-- Returns data to be transported by pick and drop mechanism.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_function

pebble_positioning_enabled : BOOLEAN
-- If True then pick and drop start coordinates are
-- pebble_x_position , pebble_y_position .
-- If False then pick and drop start coordinates are
-- the pointer coordinates.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_positioning_enabled

pebble_x_position : INTEGER
-- Initial x position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_x_position

pebble_y_position : INTEGER
-- Initial y position for pick and drop relative to Current.
-- (from EV_PICK_AND_DROPABLE )
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .pebble_y_position

pointer_position : EV_COORDINATE
-- Position of the screen pointer relative to Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_show_requested: is_show_requested

pointer_style : EV_CURSOR
-- Cursor displayed when pointer is over this widget.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

style : INTEGER
-- Visual appearance. See: EV_FRAME_CONSTANTS .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
ensure -- from EV_FRAME
bridge_ok: Result = implementation .style

target_name : STRING
-- Optional textual name describing Current pick and drop hole.
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )

text : STRING
-- Text displayed in textable.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
bridge_ok: equal (Result, implementation .text)
not_void_implies_cloned: Result /= void implies Result /= implementation .text

feature -- Measurement

client_height : INTEGER
-- Height of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_height

client_width : INTEGER
-- Width of the area available to children in pixels.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
bridge_ok: Result = implementation .client_width

height : INTEGER
-- Vertical size in pixels.
-- Same as minimum_height when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .height

minimum_height : INTEGER
-- Lower bound on height in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_height
positive_or_zero: Result >= 0

minimum_width : INTEGER
-- Lower bound on width in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .minimum_width
positive_or_zero: Result >= 0

screen_x : INTEGER
-- Horizontal offset relative to left of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_x

screen_y : INTEGER
-- Vertical offset relative to top of screen in pixels.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .screen_y

width : INTEGER
-- Horizontal size in pixels.
-- Same as minimum_width when not displayed.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .width

x_position : INTEGER
-- Horizontal offset relative to parent x_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .x_position

y_position : INTEGER
-- Vertical offset relative to parent y_position in pixels.
-- (from EV_POSITIONED )
require -- from EV_POSITIONED
not_destroyed: not is_destroyed
ensure -- from EV_POSITIONED
bridge_ok: Result = implementation .y_position

feature -- Status report

count : INTEGER
-- Number of items in Current.
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure then -- from EV_CELL
valid_result: Result = 0 or Result = 1

extendible : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of is_empty .
-- (from EV_CELL )

full : BOOLEAN
-- Is structure filled to capacity?
-- (from EV_CELL )

has_capture : BOOLEAN
-- Does widget have capture?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_capture

has_focus : BOOLEAN
-- Does widget have the keyboard focus?
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .has_focus

is_displayed : BOOLEAN
-- Is Current visible on the screen?
-- True when show requested and parent displayed.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_displayed

is_empty : BOOLEAN
-- Is there no element?
-- Was declared in EV_CELL as synonym of extendible .
-- (from EV_CELL )

is_inserted (v: EV_WIDGET ): BOOLEAN
-- Has v been inserted by the most recent insertion?
-- (By default, the value returned is equivalent to calling
-- `has (v)'. However, descendants might be able to provide more
-- efficient implementations.)
-- (from COLLECTION )

is_sensitive : BOOLEAN
-- Is object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
bridge_ok: Result = implementation .user_is_sensitive

is_show_requested : BOOLEAN
-- Will Current be displayed when its parent is?
-- See also is_displayed .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
bridge_ok: Result = implementation .is_show_requested

mode_is_drag_and_drop : BOOLEAN
-- Is the user interface mode drag and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_drag_and_drop

mode_is_pick_and_drop : BOOLEAN
-- Is the user interface mode pick and drop?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_pick_and_drop

mode_is_target_menu : BOOLEAN
-- Is the user interface mode a pop-up menu of targets?
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure then -- from EV_PICK_AND_DROPABLE
bridge_ok: Result = implementation .mode_is_target_menu

prunable : BOOLEAN
-- May items be removed?
-- (from EV_CELL )

readable : BOOLEAN
-- Is there a current item that may be accessed?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from EV_CELL )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed

feature -- Status setting

align_text_center
-- Display text centered.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_center_aligned

align_text_left
-- Display text left aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_left_aligned

align_text_right
-- Display text right aligned.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
alignment_set: alignment . is_right_aligned

center_pointer
-- Position screen pointer over center of Current.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed

disable_capture
-- Disable grab of all user input events.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_has_capture: not has_capture

disable_pebble_positioning
-- Assign False to pebble_positioning_enabled .
-- The pick and drop will start at the pointer position.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: not pebble_positioning_enabled

disable_sensitive
-- Make object non-sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_unsensitive: not is_sensitive

enable_capture
-- Grab all user input events (mouse and keyboard).
-- disable_capture must be called to resume normal input handling.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
ensure -- from EV_WIDGET
has_capture: has_capture

enable_pebble_positioning
-- Assign True to pebble_positioning_enabled .
-- Use pebble_x_position and pebble_y_position as the initial coordinates
-- for the pick and drop in pixels relative to Current.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_positioning_updated: pebble_positioning_enabled

enable_sensitive
-- Make object sensitive to user input.
-- (from EV_SENSITIVE )
require -- from EV_SENSITIVE
not_destroyed: not is_destroyed
ensure -- from EV_SENSITIVE
is_sensitive: ( parent = void or parent_is_sensitive ) implies is_sensitive

hide
-- Request that Current not be displayed even when its parent is.
-- Make is_show_requested False.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
not_is_show_requested: not is_show_requested

merge_radio_button_groups (other: EV_CONTAINER )
-- Merge Current radio button group with that of other.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
other_not_void: other /= void

remove_pebble
-- Make pebble Void and pebble_function `Void,
-- Removing transport.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_removed: pebble = void and pebble_function = void

set_accept_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is over a
-- target that accepts pebble during pick and drop.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
accept_cursor_assigned: accept_cursor . is_equal (a_cursor)

set_actual_drop_target_agent (an_agent: like actual_drop_target_agent )
-- Assign an_agent to actual_drop_target_agent .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
an_agent_not_void: an_agent /= void
ensure -- from EV_WIDGET
assigned: actual_drop_target_agent = an_agent

set_default_colors
-- Set foreground and background color to their default values.
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed

set_deny_cursor (a_cursor: EV_CURSOR )
-- Set a_cursor to be displayed when the screen pointer is not
-- over a valid target.
-- (from EV_PICK_AND_DROPABLE )
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
deny_cursor_assigned: deny_cursor . is_equal (a_cursor)

set_drag_and_drop_mode
-- Set user interface mode to drag and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
drag_and_drop_set: mode_is_drag_and_drop

set_focus
-- Grab keyboard focus.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
is_displayed: is_displayed
is_sensitive: is_sensitive
ensure -- from EV_WIDGET
has_focus: has_focus

set_pebble (a_pebble: like pebble )
-- Assign a_pebble to pebble .
-- Overrides set_pebble_function .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_pebble_not_void: a_pebble /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_assigned: pebble = a_pebble

set_pebble_function (a_function: FUNCTION [ ANY , TUPLE , ANY ])
-- Set a_function to compute pebble .
-- It will be called once each time a pick occurs, the result
-- will be assigned to pebble for the duration of transport.
-- When a pick occurs, the pick position in widget coordinates,
-- <<x, y>> in pixels, is passed.
-- To handle this data use a_function of type
-- FUNCTION [ ANY , TUPLE [ INTEGER , INTEGER ], ANY ] and return the
-- pebble as a function of x and y.
-- Overrides set_pebble .
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_function_not_void: a_function /= void
a_function_takes_two_integer_open_operands: a_function. valid_operands ([1, 1])
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
pebble_function_assigned: pebble_function = a_function

set_pebble_position (a_x, a_y: INTEGER )
-- Set the initial position for pick and drop
-- Coordinates are in pixels and are relative to position of Current.
-- Pebble_positioning_enabled must be True for the position to be used,
-- use enable_pebble_positioning.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pebble_position_assigned: pebble_x_position = a_x and pebble_y_position = a_y

set_pick_and_drop_mode
-- Set user interface mode to pick and drop.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
pick_and_drop_set: mode_is_pick_and_drop

set_target_menu_mode
-- Set user interface mode to pop-up menu of targets.
-- (from EV_PICK_AND_DROPABLE )
require -- from EV_PICK_AND_DROPABLE
not_destroyed: not is_destroyed
ensure -- from EV_PICK_AND_DROPABLE
target_menu_mode_set: mode_is_target_menu

set_target_name (a_name: STRING )
-- Assign a_name to target_name .
-- (from EV_ABSTRACT_PICK_AND_DROPABLE )
require -- from EV_ABSTRACT_PICK_AND_DROPABLE
a_name_not_void: a_name /= void
ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
target_name_assigned: a_name /= target_name and a_name. is_equal ( target_name )

show
-- Request that Current be displayed when its parent is.
-- True by default.
-- Make is_show_requested True.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
ensure -- from EV_WIDGET
is_show_requested: is_show_requested

feature -- Element change

extend (v: like item )
-- Ensure that structure includes v.
-- Do not move cursor.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
extendible: extendible
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

fill (other: CONTAINER [ EV_WIDGET ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

put (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of replace .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

remove_help_context
-- Remove key press action associated with EV_APPLICATION.help_key.
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
help_context_not_void: help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
no_help_context: help_context = void

remove_text
-- Make text Void.
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
ensure -- from EV_TEXTABLE
text_removed: text = void

replace (v: like item )
-- Replace item with v.
-- Was declared in EV_CONTAINER as synonym of put .
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
writable: writable
v_not_void: v /= void
v_parent_void: v. parent = void
v_not_current: v /= Current
v_not_parent_of_current: not is_parent_recursive (v)
v_not_window: not v. conforms_to (create { EV_WINDOW })
ensure -- from EV_CONTAINER
has_v: has (v)

set_background_color (a_color: like background_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
background_color_assigned: background_color . is_equal (a_color)

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

set_foreground_color (a_color: like foreground_color )
-- Assign a_color to foreground_color .
-- (from EV_COLORIZABLE )
require -- from EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure -- from EV_COLORIZABLE
foreground_color_assigned: foreground_color . is_equal (a_color)

set_help_context (an_help_context: like help_context )
-- Assign an_help_context to help_context .
-- (from EV_HELP_CONTEXTABLE )
require -- from EV_HELP_CONTEXTABLE
not_destroyed: not is_destroyed
an_help_context_not_void: an_help_context /= void
ensure -- from EV_HELP_CONTEXTABLE
help_context_assigned: help_context . is_equal (an_help_context)

set_minimum_height (a_minimum_height: INTEGER )
-- Set a_minimum_height in pixels to minimum_height .
-- If height is less than a_minimim_height, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_height is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_size (a_minimum_width, a_minimum_height: INTEGER )
-- Assign a_minimum_height to minimum_height
-- and a_minimum_width to minimum_width in pixels.
-- If width or height is less than minimum size, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum size is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
a_minimum_height_positive: a_minimum_height > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width
minimum_height_assigned: minimum_height = a_minimum_height

set_minimum_width (a_minimum_width: INTEGER )
-- Assign a_minimum_width in pixels to minimum_width .
-- If width is less than a_minimim_width, resize.
-- This setting takes effect next time application is idle.
-- From now, minimum_width is fixed and will not be changed
-- dynamically by the application anymore.
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_minimum_width_positive: a_minimum_width > 0
ensure -- from EV_WIDGET
minimum_width_assigned: minimum_width = a_minimum_width

set_pointer_style (a_cursor: like pointer_style )
-- Assign a_cursor to pointer_style .
-- (from EV_WIDGET )
require -- from EV_WIDGET
not_destroyed: not is_destroyed
a_cursor_not_void: a_cursor /= void
ensure -- from EV_WIDGET
pointer_style_assigned: pointer_style . is_equal (a_cursor)

set_style (a_style: INTEGER )
-- Assign a_style to style .
-- (from EV_FRAME )
require -- from EV_FRAME
not_destroyed: not is_destroyed
a_style_valid: valid_frame_border (a_style)
ensure -- from EV_FRAME
style_assigned: style = a_style

set_text (a_text: STRING )
-- Assign a_text to text .
-- (from EV_TEXTABLE )
require -- from EV_TEXTABLE
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
a_text_not_empty: not a_text. is_empty
ensure -- from EV_TEXTABLE
text_cloned: text . is_equal (a_text) and then text /= a_text

feature -- Removal

prune (v: EV_WIDGET )
-- Remove v if contained.
-- (from EV_CELL )
require -- from COLLECTION
prunable: prunable
ensure then -- from EV_CELL
not has (v)

prune_all (v: EV_WIDGET )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from COLLECTION )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)

wipe_out
-- Remove item .
-- (from EV_CELL )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty

feature -- Conversion

linear_representation : LINEAR [like item ]
-- Representation as a linear structure
-- (from EV_CELL )

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operations

propagate_background_color
-- Propagate background_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
background_color_propagated: background_color_propagated

propagate_foreground_color
-- Propagate foreground_color to all children.
-- (from EV_CONTAINER )
require -- from EV_CONTAINER
not_destroyed: not is_destroyed
ensure -- from EV_CONTAINER
foreground_color_propagated: foreground_color_propagated

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Contract support

valid_frame_border (a_code: INTEGER ): BOOLEAN
-- Is a_code a valid code ?
-- (from EV_FRAME_CONSTANTS )

feature -- Event handling

conforming_pick_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when a pebble that fits here is picked.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when a pebble is dropped here.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

focus_in_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is gained.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

focus_out_actions : EV_FOCUS_ACTION_SEQUENCE
-- Actions to be performed when keyboard focus is lost.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_press_string_actions : EV_KEY_STRING_ACTION_SEQUENCE
-- Actions to be performed when a keyboard press generates a displayable character.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

key_release_actions : EV_KEY_ACTION_SEQUENCE
-- Actions to be performed when a keyboard key is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_START_ACTION_SEQUENCE
-- Actions to be performed when pebble is picked up.
-- (from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES )
ensure -- from EV_PICK_AND_DROPABLE_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is pressed.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_button_release_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer button is released.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_double_press_actions : EV_POINTER_BUTTON_ACTION_SEQUENCE
-- Actions to be performed when screen pointer is double clicked.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_enter_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer enters widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_leave_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when screen pointer leaves widget.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

pointer_motion_actions : EV_POINTER_MOTION_ACTION_SEQUENCE
-- Actions to be performed when screen pointer moves.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

resize_actions : EV_GEOMETRY_ACTION_SEQUENCE
-- Actions to be performed when size changes.
-- (from EV_WIDGET_ACTION_SEQUENCES )
ensure -- from EV_WIDGET_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_FRAME
valid_style: is_usable implies valid_frame_border ( style )
-- from EV_CONTAINER
client_width_within_bounds: is_usable implies client_width >= 0 and client_width <= width
client_height_within_bounds: is_usable implies client_height >= 0 and client_height <= height
all_radio_buttons_connected: is_usable implies all_radio_buttons_connected
parent_of_items_is_current: is_usable implies parent_of_items_is_current
items_unique: is_usable implies items_unique
-- from EV_WIDGET
pointer_position_not_void: is_usable and is_show_requested implies pointer_position /= void
is_displayed_implies_show_requested: is_usable and then is_displayed implies is_show_requested
parent_contains_current: is_usable and then parent /= void implies parent . has (Current)
-- from EV_PICK_AND_DROPABLE
user_interface_modes_mutually_exclusive: mode_is_pick_and_drop . to_integer + mode_is_drag_and_drop . to_integer + mode_is_target_menu . to_integer = 1
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called
-- from EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
-- from EV_POSITIONED
width_not_negative: is_usable implies width >= 0
height_not_negative: is_usable implies height >= 0
minimum_width_not_negative: is_usable implies minimum_width >= 0
minimum_height_not_negative: is_usable implies minimum_height >= 0
-- from EV_TEXTABLE
text_not_void_implies_text_not_empty: is_usable and text /= void implies text . count > 0

end -- class TEXT_COMPONENT_CONTROL


WIDGETS Chart

 class
WIDGETS

General
cluster: root_cluster
description: "Vision2 widget test application"
keywords: "test"
create: start

Ancestors
EV_APPLICATION

Action sequences
drop_actions : EV_PND_ACTION_SEQUENCE
idle_actions : EV_NOTIFY_ACTION_SEQUENCE
pick_actions : EV_PND_ACTION_SEQUENCE
post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE

Queries
alt_pressed : BOOLEAN
clipboard : EV_CLIPBOARD
contextual_help_accelerator : EV_ACCELERATOR
ctrl_pressed : BOOLEAN
data : ANY
Default_tooltip_delay : INTEGER
focused_widget : EV_WIDGET
help_accelerator : EV_ACCELERATOR
help_engine : EV_HELP_ENGINE
is_destroyed : BOOLEAN
is_launched : BOOLEAN
locked_window : EV_WINDOW
main_window : MAIN_WINDOW
shift_pressed : BOOLEAN
tooltip_delay : INTEGER
windows : LINEAR [ EV_WINDOW ]

Commands
copy (other: [like Current] WIDGETS )
default_create
destroy
display_help_for_widget (a_widget: EV_WIDGET )
do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
enable_contextual_help
launch
process_events
set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_data (some_data: [like data ] ANY )
set_help_accelerator (an_accelerator: EV_ACCELERATOR )
set_help_engine (an_engine: EV_HELP_ENGINE )
set_tooltip_delay (a_delay: INTEGER )
sleep (msec: INTEGER )
start


WIDGETS Flat contracts

 indexing
description: "Vision2 widget test application"
status: "See notice at end of class"
keywords: "test"
date: "$Date: 2001/07/14 05:37:43 $"
revision: "$Revision: 1.3 $"

class interface
WIDGETS

create

start
-- Create the application, set up main_window
-- and then launch the application.

feature -- Initialization

main_window : MAIN_WINDOW
-- The window used in Current.

start
-- Create the application, set up main_window
-- and then launch the application.

feature -- Initialization

frozen default_create
-- Standard creation procedure.
-- (from EV_ANY )
ensure then -- from EV_ANY
is_coupled: implementation /= void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state

feature -- Access

clipboard : EV_CLIPBOARD
-- Native platform clipboard access.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

contextual_help_accelerator : EV_ACCELERATOR
-- Accelerator that enables contextual help mode
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .contextual_help_accelerator)

data : ANY
-- Arbitrary user data may be stored here.
-- (from EV_ANY )

help_accelerator : EV_ACCELERATOR
-- Accelerator that displays contextual help
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_accelerator)

help_engine : EV_HELP_ENGINE
-- Object that handles contextual help display requests
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .help_engine)

locked_window : EV_WINDOW
-- Window currently locked. Void if no window
-- is currently locked.
--
-- See `{ EV_WINDOW }. lock_update ' for more details
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

windows : LINEAR [ EV_WINDOW ]
-- All of the application's windows.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result. is_equal ( implementation .windows)

feature -- Status report

alt_pressed : BOOLEAN
-- Is alt key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

ctrl_pressed : BOOLEAN
-- Is ctrl key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

Default_tooltip_delay : INTEGER is 500
-- Default delay in milleseconds of tool tips.
-- (from EV_APPLICATION )

focused_widget : EV_WIDGET
-- Widget that has keyboard focus.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .focused_widget

is_launched : BOOLEAN
-- Has launch been called?
-- (from EV_APPLICATION )

shift_pressed : BOOLEAN
-- Is shift key currently pressed?
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

tooltip_delay : INTEGER
-- Time in milliseconds which the pointer must be stationary over
-- a widget before a tooltips apears.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
ensure -- from EV_APPLICATION
bridge_ok: Result = implementation .tooltip_delay

feature -- Status setting

set_tooltip_delay (a_delay: INTEGER )
-- Assign a_delay to tooltip_delay .
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_delay_non_negative: a_delay >= 0
ensure -- from EV_APPLICATION
assigned: tooltip_delay = a_delay

feature -- Element change

set_data (some_data: like data )
-- Assign some_data to data .
-- (from EV_ANY )
require -- from EV_ANY
not_destroyed: not is_destroyed
ensure -- from EV_ANY
data_assigned: data = some_data

feature -- Duplication

copy (other: like Current)
-- Update current object using fields of object attached
-- to other, so as to yield equal objects.
-- (from EV_ANY )
require -- from ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure -- from ANY
is_equal: is_equal (other)

feature -- Basic operation

display_help_for_widget (a_widget: EV_WIDGET )
-- Display contextual help for a_widget, if any.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
a_widget_not_void: a_widget /= void

enable_contextual_help
-- Change mouse cursor to help cursor.
-- Capture mouse input.
-- Send help context of widget being clicked to help engine for
-- Processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

launch
-- Start the application.
-- Call prepare the Begin event processing.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
not_already_launched: not is_launched
ensure -- from EV_APPLICATION
is_launched: is_launched

process_events
-- Process any pending events.
-- Pass control to the underlying native toolkit so that it can
-- handle any events that may be in its queue.
-- (Should be called from time to time during extended computation.)
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
is_launched: is_launched

sleep (msec: INTEGER )
-- Wait for msec milliseconds and return.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
msec_non_negative: msec >= 0

feature -- Command

destroy
-- Destroy underlying native toolkit object.
-- Render Current unusable.
-- (from EV_ANY )
ensure -- from EV_ANY
is_destroyed: is_destroyed

feature -- Element Change

set_contextual_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to contextual_help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
contextual_help_accelerator_assigned: contextual_help_accelerator = an_accelerator

set_help_accelerator (an_accelerator: EV_ACCELERATOR )
-- Assign an_accelerator to help_accelerator
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_accelerator_not_void: an_accelerator /= void
ensure -- from EV_APPLICATION
help_accelerator_assigned: help_accelerator = an_accelerator

set_help_engine (an_engine: EV_HELP_ENGINE )
-- Assign an_engine to help_engine
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed
an_engine_not_void: an_engine /= void
ensure -- from EV_APPLICATION
help_engine_set: help_engine = an_engine

feature -- Event handling

do_once_on_idle (an_action: PROCEDURE [ ANY , TUPLE ])
-- Perform an_action one time when the application is next idle.
-- (from EV_APPLICATION )
require -- from EV_APPLICATION
not_destroyed: not is_destroyed

drop_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "drop" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

idle_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed when the application is otherwise idle.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

pick_actions : EV_PND_ACTION_SEQUENCE
-- Actions to be performed when any "pick" occurs.
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

post_launch_actions : EV_NOTIFY_ACTION_SEQUENCE
-- Actions to be performed just after application launch .
-- (from EV_APPLICATION_ACTION_SEQUENCES )
ensure -- from EV_APPLICATION_ACTION_SEQUENCES
not_void: Result /= void

feature -- Status Report

is_destroyed : BOOLEAN
-- Is Current no longer usable?
-- (from EV_ANY )
ensure -- from EV_ANY
bridge_ok: Result = implementation .is_destroyed

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from EV_APPLICATION
tooltip_delay_not_negative: tooltip_delay >= 0
windows_not_void: windows /= void
-- from EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation .interface = Current
default_create_called: default_create_called

end -- class WIDGETS


WIDGET_CONTROL Chart

 class
WIDGET_CONTROL

General
cluster: root_cluster
description: "Controls used to manipulate objects of type EV_WIDGET "
create: make

Ancestors
ANY


EiffelWeb

Type: Library
Platform: Any
Version: 5.0

See:

  • Content
  • Samples
  • Reference


EiffelWeb Content

EiffelWeb Library Content

The Common Gateway Interface (CGI) emerged as the first way to present dynamically generated information on the World Wide Web. It allows the computer to process forms filled by the user and return appropriate information.
EiffelWeb was developed by Interactive Software Engineering to provide Eiffel developers access to the CGI technology. The library makes it possible to write Eiffel systems that interact directly with the WEB.

See Also:
Introduction to EiffelWeb
Processing forms with EiffelWeb


EiffelWeb Content Introduction

Introduction

CGI Applications

The way a CGI application communicates with the Web browser is simple: when the user presses a button on an HTML form, with an associated action (such as Submit), the browser starts the application whose path is indicated inside the HTML form declaration. It sends data corresponding to the HTTP request and to the input form information in the usual file descriptor In, stores within environment variables the transaction environment of the request, and waits for the application message, expected in its Out canal. The In and Out canals are accessible via the class CGI_IN_AND_OUT.

HTML forms are an easy way to collect user entries in a web page, which are sent by the browser to the CGI application. A simple example of a form is:

<form action="/cgi-bin/convert.exe" method="post">
   <input type="text" name="Celsius">
   <input type="submit">
</form >

When the user presses the submit button, the browser will launch the application located at /cgi-bin/convert.exe on the server, will use the HTTP Post protocol, and will store among others the environment variable Celsius with the value entered by the user.

Advantages of using EiffelWeb

With EiffelWeb, you can:

  • Design object-oriented systems
  • Access and use the Eiffel libraries
  • Increase maintainability because your code is reusable and readable
  • Deal with complexity because you use a language particularly efficient in the Business Modeling.
  • Use one/a few big Eiffel Web applications, which allow for an easier maintenance and provide better code readability and reusability than having a huge number of scripts.
  • Use the Design by Contract methodology, thanks to the debugging facilities provided by EiffelWeb.


Processing Requests

EiffelWeb provides a complete set of features and interface which helps building a wide range of possible requests.

Basic CGI Handling

Accessing Environment Variables

Much of the information needed by CGI applications is made available via environment variables. Programs using EiffelWeb can access this information through the class CGI_ENVIRONMENT.

These variables are usually used for the following purposes:

  • Getting information about the server itself
  • Checking the client browser
  • Restricting Access for specified Domains
  • Ensuring User Authentification and Identifications
  • Dealing with Cookies

Accessing Input Values

The browser sends in the In a stream containing the data relative to the user entry and selection at the applications starts. EiffelWeb stores each data element and its associated name within a Hash-Table, the feature form_data of class CGI_INTERFACE. You can access their values from your code with the interface defined in class CGI_FORMS, which allows you to retrieve text entries, to know whether a button was pressed or not, etc …

Sending answers to the browser

The response has to contain an HTTP header in order to be understood by the browser. Depending on the nature of the reply, an HTML page, a simple re-direction, an error notification … you will select different features and options. Your application must send at least a response header, indicating the status of the request if known. You may want to attach to it the text you wish to send back to the user. This text is usually written in HTML, so that it will display nicely on the user’s browser; you can use for this purpose the class HTML_PAGE. You may then send the header followed by your text using the features send_to_browser of classes CGI_RESPONSE_HEADER and HTML_PAGE.

Note: You may not write into a file before you have sent the answer to the browser.

Dealing with Cookies

You can access the cookies corresponding to a specific URL/domain thanks to the feature cookies, of class CGI_ENVIRONMENT. It is a hash-table, in which all the data with associated names as keys are stored.

To store a cookie on a machine, you can use the feature set_cookies, of class CGI_RESPONSE_HEADER.

Advanced Topics

EiffelWeb and Security

The information the server sends back may be confidential. Follow these steps to protect the page content:

  1. Create an HTML page, for example by using class HTML_PAGE.
  2. Store this page somewhere, with a random name.
  3. Create an instance of class CGI_RESPONSE_HEADER and choose the secure redirect option. Then call send_to_browser.

Complex Headers

The Eiffel-Web application has the possibility to send a selection of different HTTP headers. They can be found in class CGI_RESPONSE_HEADER. In particular, it is advised to generate a status for each request, the value of the most common ones may be found in class CGI_ COMMON_STATUS_TYPE.

Debugging facilities

Design by Contract is one of the greatest strengths of the Eiffel language. When you usually run your application from EiffelStudio, you are notified when an assertion is violated and the tool offers different options in order to be able to find out its sources (feature and class tools, object inspectors, etc…). However this cannot be applied to an EiffelWeb application, since it has to be run on the server.

Therefore, EiffelWeb provides its own facilities for debugging. To test your classes at run-time, all you need to do is to set the Boolean feature is_debug_mode to True in your root class (which should inherit from CGI_INTERFACE). When your application crashes (because of an assertion or a bug), the exception trace will be displayed on the screen.


cluster web

Cluster
    web

Subclusters
    web.cgi_facilities
    web.cgi_handling
    web.form
    web.html
    web.stdio
    web.table


cluster web.cgi_facilities

Cluster
    web.cgi_facilities

Supercluster
    web

Classes
    CGI_COMMON_STATUS_TYPES
    CGI_ERROR_HANDLING
    CGI_RESPONSE_HEADER


CGI_COMMON_STATUS_TYPES Chart

class
    CGI_COMMON_STATUS_TYPES

General
    cluster: web.cgi_facilities
    description: "Common Status Types that may be returned to the browser."

Ancestors
    ANY

Queries
    Document_moved_status: INTEGER
    Forbidden_status: INTEGER
    Internal_server_error_status: INTEGER
    No_response_status: INTEGER
    Not_found_status: INTEGER
    Not_implemented_status: INTEGER
    Success_status: INTEGER
    Unauthorized_status: INTEGER


CGI_COMMON_STATUS_TYPES Flat contracts

indexing
    description: "Common Status Types that may be returned to the browser."
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.5 $"

class interface
    CGI_COMMON_STATUS_TYPES

feature -- Access

    Document_moved_status: INTEGER is 301

    Forbidden_status: INTEGER is 403

    Internal_server_error_status: INTEGER is 500

    No_response_status: INTEGER is 204

    Not_found_status: INTEGER is 404

    Not_implemented_status: INTEGER is 501

    Success_status: INTEGER is 200

    Unauthorized_status: INTEGER is 401

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CGI_COMMON_STATUS_TYPES


CGI_ERROR_HANDLING Chart

class
    CGI_ERROR_HANDLING

General
    cluster: web.cgi_facilities
    description: "Error Handling"

Ancestors
    CGI_IN_AND_OUT
    EXCEPTIONS

Queries
    Output: STDOUT
    Response_header: CGI_RESPONSE_HEADER
    Stdin: STDIN

Commands
    handle_exception
    raise_error (msg: STRING)


CGI_ERROR_HANDLING Flat contracts

indexing
    description: "Error Handling"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.5 $"

class interface
    CGI_ERROR_HANDLING

feature -- Access

    output: STDOUT
            -- Shared standard output.
            -- (from CGI_IN_AND_OUT)

    response_header: CGI_RESPONSE_HEADER
            -- (from CGI_IN_AND_OUT)

    stdin: STDIN
            -- Shared standard input
            -- (from CGI_IN_AND_OUT)

feature -- Basic Operations

    handle_exception
            -- General exception hanlding.

    raise_error (msg: STRING)
            -- Raise an error
        require
            message_exists: msg /= void
        ensure
            exists: raised_error /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CGI_ERROR_HANDLING


CGI_RESPONSE_HEADER Chart

class
    CGI_RESPONSE_HEADER

General
    cluster: web.cgi_facilities
    description: "Class which deals with the output header"

Ancestors
    CGI_COMMON_STATUS_TYPES
    CGI_IN_AND_OUT

Queries
    Document_moved_status: INTEGER
    Forbidden_status: INTEGER
    header: STRING
    Internal_server_error_status: INTEGER
    is_complete_header: BOOLEAN
    is_sent: BOOLEAN
    No_response_status: INTEGER
    Not_found_status: INTEGER
    Not_implemented_status: INTEGER
    Output: STDOUT
    Response_header: CGI_RESPONSE_HEADER
    Stdin: STDIN
    Success_status: INTEGER
    Unauthorized_status: INTEGER

Commands
    generate_http_redirection (an_url: STRING; is_secure: BOOLEAN)
    generate_text_header
    reinitialize_header
    return_status (a_status: INTEGER; a_message: STRING)
    send_to_browser
    set_cookie (key, value, expiration, path, domain, secure: STRING)
    set_expiration (a_date: STRING)
    set_pragma (a_pragma: STRING)


CGI_RESPONSE_HEADER Flat contracts

indexing
    description: "Class which deals with the output header"
    date: "$Date: 2001/11/21 04:25:32 $"
    revision: "$Revision: 1.6 $"

class interface
    CGI_RESPONSE_HEADER

feature -- Access

    Document_moved_status: INTEGER is 301
            -- (from CGI_COMMON_STATUS_TYPES)

    Forbidden_status: INTEGER is 403
            -- (from CGI_COMMON_STATUS_TYPES)

    header: STRING
            -- Message Header which will be returned to the
            -- the browser.

    Internal_server_error_status: INTEGER is 500
            -- (from CGI_COMMON_STATUS_TYPES)

    is_complete_header: BOOLEAN
            -- Is Current header a complete header ?

    is_sent: BOOLEAN
            -- Is current header sent to the browser ?

    No_response_status: INTEGER is 204
            -- (from CGI_COMMON_STATUS_TYPES)

    Not_found_status: INTEGER is 404
            -- (from CGI_COMMON_STATUS_TYPES)

    Not_implemented_status: INTEGER is 501
            -- (from CGI_COMMON_STATUS_TYPES)

    output: STDOUT
            -- Shared standard output.
            -- (from CGI_IN_AND_OUT)

    response_header: CGI_RESPONSE_HEADER
            -- (from CGI_IN_AND_OUT)

    stdin: STDIN
            -- Shared standard input
            -- (from CGI_IN_AND_OUT)

    Success_status: INTEGER is 200
            -- (from CGI_COMMON_STATUS_TYPES)

    Unauthorized_status: INTEGER is 401
            -- (from CGI_COMMON_STATUS_TYPES)

feature -- Advanced Settings

    set_cookie (key, value, expiration, path, domain, secure: STRING)
            -- Set a cookie on the client's machine
            -- with key 'key' and value 'value'.
        require
            not_yet_sent: not is_sent
            make_sense: (key /= void and value /= void) and then (not key.is_empty and not value.is_empty)
            header_exists: header /= void
            header_is_complete: is_complete_header

    set_expiration (a_date: STRING)
            -- Set the expiration date before which the page needs to be
            -- refreshed
        require
            not_yet_sent: not is_sent
            date_exists: a_date /= void
            header_exists: header /= void
            header_is_complete: is_complete_header

    set_pragma (a_pragma: STRING)
            -- Set the pragma which indicates whether
            -- the page accepts to be cached
            -- or not. An example of pragam is "no-cache"
        require
            not_yet_sent: not is_sent
            pragma_exists: a_pragma /= void
            header_exists: header /= void
            header_is_complete: is_complete_header

feature -- Basic Operations

    generate_http_redirection (an_url: STRING; is_secure: BOOLEAN)
            -- Generate CGI secure re-direction, via 'https' protocol if secure,
            --	via http if not.
        require
            not_yet_sent: not is_sent
            url_not_void_and_not_empty: an_url /= void and then not an_url.is_empty
            header_void: header = void

    generate_text_header
            -- Generate header for a future text (generally HTML)
            -- you are going to send.
        require
            header_void: header = void
            not_yet_sent: not is_sent

    reinitialize_header
            -- Re-initialize header.
            -- May be called if the header built sor far
            -- has to be re-build from scratch.
        require
            not_yet_sent: not is_sent
        ensure
            reinitialized: header = void and not is_complete_header and not is_sent

    return_status (a_status: INTEGER; a_message: STRING)
            -- Set the status of the user request.
            -- A complete list of status may be found at :
            -- http://www.w3.org/hypertext/WWW/protocols/HTTP/HTRESP.html
            -- See also CGI_COMMON_STATUS_TYPES
        require
            not_yet_sent: not is_sent
            message_exists: a_message /= void
            header_void: header /= void

    send_to_browser
            -- Send the header to browser.
            -- This operation has to be performed before
            -- you send anything else to the browser.
        require
            header_exists: header /= void
            not_yet_sent: not is_sent
        ensure
            header_sent: is_sent

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CGI_RESPONSE_HEADER


cluster web.cgi_handling

Cluster
    web.cgi_handling

Supercluster
    web

Classes
    CGI_ENVIRONMENT
    CGI_IN_AND_OUT
    CGI_INTERFACE


CGI_ENVIRONMENT Chart

class
    CGI_ENVIRONMENT

General
    cluster: web.cgi_handling
    description: "Access to environment variables set by the HTTP server when the CGI application is executed. This class may be used as ancestor by classes needing its facilities."

Ancestors
    EXECUTION_ENVIRONMENT

Queries
    Auth_type: STRING
    Content_length: STRING
    Content_type: STRING
    Cookies: HASH_TABLE [STRING, STRING]
    Gateway_interface: STRING
    Http_accept: STRING
    Http_user_agent: STRING
    Path_info: STRING
    Path_translated: STRING
    Query_string: STRING
    Remote_addr: STRING
    Remote_host: STRING
    Remote_ident: STRING
    Remote_user: STRING
    Request_method: STRING
    Script_name: STRING
    Server_name: STRING
    Server_port: STRING
    Server_protocol: STRING
    Server_software: STRING

Commands
    set_environment_variable (variable, val: STRING)


CGI_ENVIRONMENT Flat contracts

indexing
    description: "Access to environment variables set by the HTTP server when the CGI application is executed. This class may be used as ancestor by classes needing its facilities."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.3 $"

class interface
    CGI_ENVIRONMENT

feature -- Cookies

    cookies: HASH_TABLE [STRING, STRING]
            -- Cookie Information relative to data

feature -- Environment variable setting

    set_environment_variable (variable, val: STRING)
            -- Set environment variable variable to val.
        require
            valid_variable: variable /= void and then variable.count > 0
            valid_value: val /= void

feature -- Headerline based environment variables

    http_accept: STRING
            -- MIME types which the client will accept.

    http_user_agent: STRING
            -- Browser the client is using to send the request.

feature -- Not request-specific environment variables

    gateway_interface: STRING
            -- Revision of the CGI specification to which this server complies.

    server_name: STRING
            -- Server's hostname, DNS alias, or IP address.

    server_software: STRING
            -- Name and version of information server answering the request.

feature -- Request specific environment variables

    auth_type: STRING
            -- Protocol-specific authentication method used to validate user.

    content_length: STRING
            -- Length of the said content as given by the client.

    content_type: STRING
            -- Content type of data.

    path_info: STRING
            -- Extra path information, as given by the client.

    path_translated: STRING
            -- Translated version of PATH_INFO provided by server.

    query_string: STRING
            -- Information which follows ? in URL referencing CGI program.

    remote_addr: STRING
            -- IP address of the remote host making the request.

    remote_host: STRING
            -- Hostname making the request.

    remote_ident: STRING
            -- User name retrieved from server if RFC 931 supported.

    remote_user: STRING
            -- Username, if applicable.

    request_method: STRING
            -- Method with which the request was made.

    script_name: STRING
            -- Virtual path to the script being executed.

    server_port: STRING
            -- Port number to which request was sent.

    server_protocol: STRING
            -- Name and revision of information protocol of this request.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CGI_ENVIRONMENT


CGI_INTERFACE Chart

deferred class
    CGI_INTERFACE

General
    cluster: web.cgi_handling
    description: "Access to information provided by a user through an HTML form. This class may be used as ancestor by classes needing its facilities."

Ancestors
    BASIC_ROUTINES
    CGI_ENVIRONMENT
    CGI_ERROR_HANDLING
    CGI_FORMS

Queries
    Auth_type: STRING
    button_value (field_name, overriding_value: STRING): BOOLEAN
    Content_length: STRING
    Content_type: STRING
    Cookies: HASH_TABLE [STRING, STRING]
    field_defined (field_name: STRING): BOOLEAN
    Fields: ARRAY [STRING]
    Gateway_interface: STRING
    Http_accept: STRING
    Http_user_agent: STRING
    menu_values (field_name: STRING): LINKED_LIST [STRING]
    Output: STDOUT
    Path_info: STRING
    Path_translated: STRING
    Query_string: STRING
    Remote_addr: STRING
    Remote_host: STRING
    Remote_ident: STRING
    Remote_user: STRING
    Request_method: STRING
    Response_header: CGI_RESPONSE_HEADER
    Script_name: STRING
    Server_name: STRING
    Server_port: STRING
    Server_protocol: STRING
    Server_software: STRING
    Stdin: STDIN
    text_field_value (field_name: STRING): STRING
    value_count (field_name: STRING): INTEGER
    value_list (field_name: STRING): LINKED_LIST [STRING]

Commands
    execute
    handle_exception
    make
    raise_error (msg: STRING)
    set_environment
    set_environment_variable (variable, val: STRING)


CGI_INTERFACE Flat contracts

indexing
    description: "Access to information provided by a user through an HTML form. This class may be used as ancestor by classes needing its facilities."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CGI_INTERFACE

feature -- Initialization

    make
            -- Initiate input data parsing and process information.

feature -- Access

    button_value (field_name: STRING; overriding_value: STRING): BOOLEAN
            -- Is Button relative to 'field_name' selected ?
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)

    menu_values (field_name: STRING): LINKED_LIST [STRING]
            -- Selected values for a list, whose name
            -- is 'field_name'.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            value_exists: Result /= void

    output: STDOUT
            -- Shared standard output.
            -- (from CGI_IN_AND_OUT)

    response_header: CGI_RESPONSE_HEADER
            -- (from CGI_IN_AND_OUT)

    stdin: STDIN
            -- Shared standard input
            -- (from CGI_IN_AND_OUT)

    text_field_value (field_name: STRING): STRING
            -- First (unique?) value for a text field.
            -- Applies for a password and a text area too.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            value_exists: Result /= void

feature -- Advanced Access

    fields: ARRAY [STRING]
            -- Names of fields in the form.
            -- (from CGI_FORMS)

    value_count (field_name: STRING): INTEGER
            -- Number of values for a field.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            valid_count: Result >= 0

    value_list (field_name: STRING): LINKED_LIST [STRING]
            -- List of values for a field.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            valid_count: Result.count = value_count (field_name)

feature -- Basic Operations

    handle_exception
            -- General exception hanlding.
            -- (from CGI_ERROR_HANDLING)

    raise_error (msg: STRING)
            -- Raise an error
            -- (from CGI_ERROR_HANDLING)
        require -- from CGI_ERROR_HANDLING
            message_exists: msg /= void
        ensure -- from CGI_ERROR_HANDLING
            exists: raised_error /= void

feature -- Cookies

    cookies: HASH_TABLE [STRING, STRING]
            -- Cookie Information relative to data
            -- (from CGI_ENVIRONMENT)

feature -- Environment variable setting

    set_environment_variable (variable, val: STRING)
            -- Set environment variable variable to val.
            -- (from CGI_ENVIRONMENT)
        require -- from CGI_ENVIRONMENT
            valid_variable: variable /= void and then variable.count > 0
            valid_value: val /= void

feature -- Headerline based environment variables

    http_accept: STRING
            -- MIME types which the client will accept.
            -- (from CGI_ENVIRONMENT)

    http_user_agent: STRING
            -- Browser the client is using to send the request.
            -- (from CGI_ENVIRONMENT)

feature -- Miscellanous

    execute
            -- Process user provided information.

    set_environment
            -- Set environment variable to user value.

feature -- Not request-specific environment variables

    gateway_interface: STRING
            -- Revision of the CGI specification to which this server complies.
            -- (from CGI_ENVIRONMENT)

    server_name: STRING
            -- Server's hostname, DNS alias, or IP address.
            -- (from CGI_ENVIRONMENT)

    server_software: STRING
            -- Name and version of information server answering the request.
            -- (from CGI_ENVIRONMENT)

feature -- Report

    field_defined (field_name: STRING): BOOLEAN
            -- Is field field_name defined?
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            filed_name_not_void: field_name /= void

feature -- Request specific environment variables

    auth_type: STRING
            -- Protocol-specific authentication method used to validate user.
            -- (from CGI_ENVIRONMENT)

    content_length: STRING
            -- Length of the said content as given by the client.
            -- (from CGI_ENVIRONMENT)

    content_type: STRING
            -- Content type of data.
            -- (from CGI_ENVIRONMENT)

    path_info: STRING
            -- Extra path information, as given by the client.
            -- (from CGI_ENVIRONMENT)

    path_translated: STRING
            -- Translated version of PATH_INFO provided by server.
            -- (from CGI_ENVIRONMENT)

    query_string: STRING
            -- Information which follows ? in URL referencing CGI program.
            -- (from CGI_ENVIRONMENT)

    remote_addr: STRING
            -- IP address of the remote host making the request.
            -- (from CGI_ENVIRONMENT)

    remote_host: STRING
            -- Hostname making the request.
            -- (from CGI_ENVIRONMENT)

    remote_ident: STRING
            -- User name retrieved from server if RFC 931 supported.
            -- (from CGI_ENVIRONMENT)

    remote_user: STRING
            -- Username, if applicable.
            -- (from CGI_ENVIRONMENT)

    request_method: STRING
            -- Method with which the request was made.
            -- (from CGI_ENVIRONMENT)

    script_name: STRING
            -- Virtual path to the script being executed.
            -- (from CGI_ENVIRONMENT)

    server_port: STRING
            -- Port number to which request was sent.
            -- (from CGI_ENVIRONMENT)

    server_protocol: STRING
            -- Name and revision of information protocol of this request.
            -- (from CGI_ENVIRONMENT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CGI_INTERFACE


CGI_IN_AND_OUT Chart

class
    CGI_IN_AND_OUT

General
    cluster: web.cgi_handling
    description: "Class which allows to access the files  corresponding to the in/out data flow"

Ancestors
    ANY

Queries
    Output: STDOUT
    Response_header: CGI_RESPONSE_HEADER
    Stdin: STDIN


CGI_IN_AND_OUT Flat contracts

indexing
    description: "Class which allows to access the files  corresponding to the in/out data flow"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.3 $"

class interface
    CGI_IN_AND_OUT

feature -- Access

    output: STDOUT
            -- Shared standard output.

    response_header: CGI_RESPONSE_HEADER

    stdin: STDIN
            -- Shared standard input

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CGI_IN_AND_OUT


cluster web.form

Cluster
    web.form

Supercluster
    web

Classes
    CGI_FORMS
    HTML_FORM
    HTML_FORM_CONSTANTS
    HTML_FORM_INPUT
    HTML_FORM_SELECT
    HTML_FORM_SELECT_OPTION
    HTML_FORM_TEXTAREA


CGI_FORMS Chart

deferred class
    CGI_FORMS

General
    cluster: web.form
    description: "Class which allows retrieving information relative to a specific type of form."

Ancestors
    ANY

Queries
    button_value (field_name, overriding_value: STRING): BOOLEAN
    field_defined (field_name: STRING): BOOLEAN
    Fields: ARRAY [STRING]
    form_data: HASH_TABLE [LINKED_LIST [STRING], STRING]
    menu_values (field_name: STRING): LINKED_LIST [STRING]
    text_field_value (field_name: STRING): STRING
    value_count (field_name: STRING): INTEGER
    value_list (field_name: STRING): LINKED_LIST [STRING]


CGI_FORMS Flat contracts

indexing
    description: "Class which allows retrieving information relative to a specific type of form."
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    CGI_FORMS

feature -- Access

    button_value (field_name: STRING; overriding_value: STRING): BOOLEAN
            -- Is Button relative to 'field_name' selected ?
        require
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)

    menu_values (field_name: STRING): LINKED_LIST [STRING]
            -- Selected values for a list, whose name
            -- is 'field_name'.
        require
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure
            value_exists: Result /= void

    text_field_value (field_name: STRING): STRING
            -- First (unique?) value for a text field.
            -- Applies for a password and a text area too.
        require
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure
            value_exists: Result /= void

feature -- Implementation

    form_data: HASH_TABLE [LINKED_LIST [STRING], STRING]
            -- Table in which is contained all the information
            -- relative to the different user inputs.

feature -- Advanced Access

    fields: ARRAY [STRING]
            -- Names of fields in the form.

    value_count (field_name: STRING): INTEGER
            -- Number of values for a field.
        require
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure
            valid_count: Result >= 0

    value_list (field_name: STRING): LINKED_LIST [STRING]
            -- List of values for a field.
        require
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure
            valid_count: Result.count = value_count (field_name)

feature -- Report

    field_defined (field_name: STRING): BOOLEAN
            -- Is field field_name defined?
        require
            filed_name_not_void: field_name /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class CGI_FORMS


HTML_FORM_CONSTANTS Chart

class
    HTML_FORM_CONSTANTS

General
    cluster: web.form

Ancestors
    ANY

Queries
    Action: STRING
    Align: STRING
    Checkbox: STRING
    Checked: STRING
    Cols: STRING
    Enctype: STRING
    Form_end: STRING
    Form_start: STRING
    Get: STRING
    Hidden: STRING
    Image: STRING
    Input_start: STRING
    Maxlength: STRING
    Method: STRING
    Multiple: STRING
    Name: STRING
    Newline: STRING
    Off: STRING
    Option_end: STRING
    Option_start: STRING
    Physical: STRING
    Post: STRING
    Radio: STRING
    Reset: STRING
    Rows: STRING
    Select_end: STRING
    Select_start: STRING
    Selected: STRING
    Sendfile: STRING
    Size: STRING
    Src: STRING
    Submit: STRING
    Tag_end: STRING
    Text: STRING
    Textarea_end: STRING
    Textarea_start: STRING
    Type: STRING
    Value: STRING
    Virtual: STRING
    Wrap: STRING


HTML_FORM_CONSTANTS Flat contracts

class interface
    HTML_FORM_CONSTANTS

feature

    Newline: STRING is ""

    Tag_end: STRING is ">"

feature -- Form

    Action: STRING is " ACTION="

    Enctype: STRING is " ENCTYPE="

    Form_end: STRING is "</FORM>"

    Form_start: STRING is "<FORM"

    Get: STRING is "GET"

    Method: STRING is " METHOD="

    Name: STRING is " NAME="

    Post: STRING is "POST"

feature -- Input

    Align: STRING is " ALIGN="

    Checkbox: STRING is "CHECKBOX"

    Checked: STRING is " CHECKED"

    Hidden: STRING is "HIDDEN"

    Image: STRING is "IMAGE"

    Input_start: STRING is "<INPUT"

    Maxlength: STRING is " MAXLENGTH="

    Radio: STRING is "RADIO"

    Reset: STRING is "RESET"

    Sendfile: STRING is ""SEND FILE""

    Size: STRING is " SIZE="

    Src: STRING is " SRC="

    Submit: STRING is "SUBMIT"

    Text: STRING is "TEXT"

    Type: STRING is " TYPE="

    Value: STRING is " VALUE="

feature -- Select

    Multiple: STRING is " MULTIPLE"

    Option_end: STRING is ""

    Option_start: STRING is "<OPTION"

    Select_end: STRING is "</SELECT>"

    Select_start: STRING is "<SELECT"

    Selected: STRING is " SELECTED"

feature -- TextArea

    Cols: STRING is " COLS="

    Off: STRING is "OFF"

    Physical: STRING is "PHYSICAL"

    Rows: STRING is " ROWS="

    Textarea_end: STRING is "</TEXTAREA>"

    Textarea_start: STRING is "<TEXTAREA"

    Virtual: STRING is "VIRTUAL"

    Wrap: STRING is " WRAP="

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_FORM_CONSTANTS


HTML_FORM Chart

class
    HTML_FORM

General
    cluster: web.form
    create: make

Ancestors
    ANY
    HTML_FORM_CONSTANTS

Queries
    Action: STRING
    Align: STRING
    attribute_out (an_attribute, its_value: STRING): STRING
    attributes_out: STRING
    body_out: STRING
    Checkbox: STRING
    Checked: STRING
    Cols: STRING
    Enctype: STRING
    Form_end: STRING
    Form_start: STRING
    Get: STRING
    Hidden: STRING
    Image: STRING
    Input_start: STRING
    Maxlength: STRING
    Method: STRING
    Multiple: STRING
    Name: STRING
    Newline: STRING
    Off: STRING
    Option_end: STRING
    Option_start: STRING
    out: STRING
    Physical: STRING
    Post: STRING
    Radio: STRING
    Reset: STRING
    Rows: STRING
    Select_end: STRING
    Select_start: STRING
    Selected: STRING
    Sendfile: STRING
    Size: STRING
    Src: STRING
    Submit: STRING
    Tag_end: STRING
    Text: STRING
    Textarea_end: STRING
    Textarea_start: STRING
    Type: STRING
    Value: STRING
    Virtual: STRING
    Wrap: STRING

Commands
    add_option (an_option: STRING)
    make
    set_action (s: STRING)
    set_enctype (s: STRING)
    set_method (s: STRING)
    set_name (s: STRING)
    wipe_out


HTML_FORM Flat contracts

class interface
    HTML_FORM

create

    make

feature

    make

    Newline: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Tag_end: STRING is ">"
            -- (from HTML_FORM_CONSTANTS)

feature -- Add new options

    add_option (an_option: STRING)
        require
            an_option /= void

feature -- Form

    Action: STRING is " ACTION="
            -- (from HTML_FORM_CONSTANTS)

    Enctype: STRING is " ENCTYPE="
            -- (from HTML_FORM_CONSTANTS)

    Form_end: STRING is "</FORM>"
            -- (from HTML_FORM_CONSTANTS)

    Form_start: STRING is "<FORM"
            -- (from HTML_FORM_CONSTANTS)

    Get: STRING is "GET"
            -- (from HTML_FORM_CONSTANTS)

    Method: STRING is " METHOD="
            -- (from HTML_FORM_CONSTANTS)

    Name: STRING is " NAME="
            -- (from HTML_FORM_CONSTANTS)

    Post: STRING is "POST"
            -- (from HTML_FORM_CONSTANTS)

feature -- Input

    Align: STRING is " ALIGN="
            -- (from HTML_FORM_CONSTANTS)

    Checkbox: STRING is "CHECKBOX"
            -- (from HTML_FORM_CONSTANTS)

    Checked: STRING is " CHECKED"
            -- (from HTML_FORM_CONSTANTS)

    Hidden: STRING is "HIDDEN"
            -- (from HTML_FORM_CONSTANTS)

    Image: STRING is "IMAGE"
            -- (from HTML_FORM_CONSTANTS)

    Input_start: STRING is "<INPUT"
            -- (from HTML_FORM_CONSTANTS)

    Maxlength: STRING is " MAXLENGTH="
            -- (from HTML_FORM_CONSTANTS)

    Radio: STRING is "RADIO"
            -- (from HTML_FORM_CONSTANTS)

    Reset: STRING is "RESET"
            -- (from HTML_FORM_CONSTANTS)

    Sendfile: STRING is ""SEND FILE""
            -- (from HTML_FORM_CONSTANTS)

    Size: STRING is " SIZE="
            -- (from HTML_FORM_CONSTANTS)

    Src: STRING is " SRC="
            -- (from HTML_FORM_CONSTANTS)

    Submit: STRING is "SUBMIT"
            -- (from HTML_FORM_CONSTANTS)

    Text: STRING is "TEXT"
            -- (from HTML_FORM_CONSTANTS)

    Type: STRING is " TYPE="
            -- (from HTML_FORM_CONSTANTS)

    Value: STRING is " VALUE="
            -- (from HTML_FORM_CONSTANTS)

feature -- Routines out

    attribute_out (an_attribute, its_value: STRING): STRING
            -- String representation for the pair 'an_attribute' and 'its_value'

    attributes_out: STRING

    body_out: STRING

    out: STRING

feature -- Select

    Multiple: STRING is " MULTIPLE"
            -- (from HTML_FORM_CONSTANTS)

    Option_end: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Option_start: STRING is "<OPTION"
            -- (from HTML_FORM_CONSTANTS)

    Select_end: STRING is "</SELECT>"
            -- (from HTML_FORM_CONSTANTS)

    Select_start: STRING is "<SELECT"
            -- (from HTML_FORM_CONSTANTS)

    Selected: STRING is " SELECTED"
            -- (from HTML_FORM_CONSTANTS)

feature -- Set attributes

    set_action (s: STRING)
        require
            s /= void

    set_enctype (s: STRING)
        require
            s /= void

    set_method (s: STRING)
        require
            s /= void

    set_name (s: STRING)
        require
            s /= void

feature -- TextArea

    Cols: STRING is " COLS="
            -- (from HTML_FORM_CONSTANTS)

    Off: STRING is "OFF"
            -- (from HTML_FORM_CONSTANTS)

    Physical: STRING is "PHYSICAL"
            -- (from HTML_FORM_CONSTANTS)

    Rows: STRING is " ROWS="
            -- (from HTML_FORM_CONSTANTS)

    Textarea_end: STRING is "</TEXTAREA>"
            -- (from HTML_FORM_CONSTANTS)

    Textarea_start: STRING is "<TEXTAREA"
            -- (from HTML_FORM_CONSTANTS)

    Virtual: STRING is "VIRTUAL"
            -- (from HTML_FORM_CONSTANTS)

    Wrap: STRING is " WRAP="
            -- (from HTML_FORM_CONSTANTS)

feature -- Wipe out

    wipe_out

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_FORM


HTML_FORM_INPUT Chart

class
    HTML_FORM_INPUT

General
    cluster: web.form
    create: make

Ancestors
    ANY
    HTML_FORM_CONSTANTS

Queries
    Action: STRING
    Align: STRING
    attribute_out (an_attribute, its_value: STRING): STRING
    attributes_out: STRING
    Checkbox: STRING
    Checked: STRING
    Cols: STRING
    Enctype: STRING
    Form_end: STRING
    Form_start: STRING
    Get: STRING
    Hidden: STRING
    Image: STRING
    Input_start: STRING
    Maxlength: STRING
    Method: STRING
    Multiple: STRING
    Name: STRING
    Newline: STRING
    Off: STRING
    Option_end: STRING
    Option_start: STRING
    out: STRING
    Physical: STRING
    Post: STRING
    Radio: STRING
    Reset: STRING
    Rows: STRING
    Select_end: STRING
    Select_start: STRING
    Selected: STRING
    Sendfile: STRING
    Size: STRING
    Src: STRING
    Submit: STRING
    Tag_end: STRING
    Text: STRING
    Textarea_end: STRING
    Textarea_start: STRING
    Type: STRING
    Value: STRING
    Virtual: STRING
    Wrap: STRING

Commands
    make
    set_checked
    set_file_src (s: STRING)
    set_image_align (s: STRING)
    set_image_src (s: STRING)
    set_maxlength (s: INTEGER)
    set_name (s: STRING)
    set_size (s: INTEGER)
    set_type (s: STRING)
    set_value (s: STRING)
    wipe_out


HTML_FORM_INPUT Flat contracts

class interface
    HTML_FORM_INPUT

create

    make

feature

    make

    Newline: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Tag_end: STRING is ">"
            -- (from HTML_FORM_CONSTANTS)

feature -- Form

    Action: STRING is " ACTION="
            -- (from HTML_FORM_CONSTANTS)

    Enctype: STRING is " ENCTYPE="
            -- (from HTML_FORM_CONSTANTS)

    Form_end: STRING is "</FORM>"
            -- (from HTML_FORM_CONSTANTS)

    Form_start: STRING is "<FORM"
            -- (from HTML_FORM_CONSTANTS)

    Get: STRING is "GET"
            -- (from HTML_FORM_CONSTANTS)

    Method: STRING is " METHOD="
            -- (from HTML_FORM_CONSTANTS)

    Name: STRING is " NAME="
            -- (from HTML_FORM_CONSTANTS)

    Post: STRING is "POST"
            -- (from HTML_FORM_CONSTANTS)

feature -- Input

    Align: STRING is " ALIGN="
            -- (from HTML_FORM_CONSTANTS)

    Checkbox: STRING is "CHECKBOX"
            -- (from HTML_FORM_CONSTANTS)

    Checked: STRING is " CHECKED"
            -- (from HTML_FORM_CONSTANTS)

    Hidden: STRING is "HIDDEN"
            -- (from HTML_FORM_CONSTANTS)

    Image: STRING is "IMAGE"
            -- (from HTML_FORM_CONSTANTS)

    Input_start: STRING is "<INPUT"
            -- (from HTML_FORM_CONSTANTS)

    Maxlength: STRING is " MAXLENGTH="
            -- (from HTML_FORM_CONSTANTS)

    Radio: STRING is "RADIO"
            -- (from HTML_FORM_CONSTANTS)

    Reset: STRING is "RESET"
            -- (from HTML_FORM_CONSTANTS)

    Sendfile: STRING is ""SEND FILE""
            -- (from HTML_FORM_CONSTANTS)

    Size: STRING is " SIZE="
            -- (from HTML_FORM_CONSTANTS)

    Src: STRING is " SRC="
            -- (from HTML_FORM_CONSTANTS)

    Submit: STRING is "SUBMIT"
            -- (from HTML_FORM_CONSTANTS)

    Text: STRING is "TEXT"
            -- (from HTML_FORM_CONSTANTS)

    Type: STRING is " TYPE="
            -- (from HTML_FORM_CONSTANTS)

    Value: STRING is " VALUE="
            -- (from HTML_FORM_CONSTANTS)

feature -- Routines out

    attribute_out (an_attribute, its_value: STRING): STRING
            -- String representation for the pair 'an_attribute' and 'its_value'

    attributes_out: STRING

    out: STRING

feature -- Select

    Multiple: STRING is " MULTIPLE"
            -- (from HTML_FORM_CONSTANTS)

    Option_end: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Option_start: STRING is "<OPTION"
            -- (from HTML_FORM_CONSTANTS)

    Select_end: STRING is "</SELECT>"
            -- (from HTML_FORM_CONSTANTS)

    Select_start: STRING is "<SELECT"
            -- (from HTML_FORM_CONSTANTS)

    Selected: STRING is " SELECTED"
            -- (from HTML_FORM_CONSTANTS)

feature -- Set attributes

    set_checked

    set_file_src (s: STRING)
            -- Was declared in HTML_FORM_INPUT as synonym of set_image_src.
        require
            s /= void

    set_image_align (s: STRING)
        require
            s /= void

    set_image_src (s: STRING)
            -- Was declared in HTML_FORM_INPUT as synonym of set_file_src.
        require
            s /= void

    set_maxlength (s: INTEGER)

    set_name (s: STRING)
        require
            s /= void

    set_size (s: INTEGER)

    set_type (s: STRING)
        require
            s /= void

    set_value (s: STRING)
        require
            s /= void

feature -- TextArea

    Cols: STRING is " COLS="
            -- (from HTML_FORM_CONSTANTS)

    Off: STRING is "OFF"
            -- (from HTML_FORM_CONSTANTS)

    Physical: STRING is "PHYSICAL"
            -- (from HTML_FORM_CONSTANTS)

    Rows: STRING is " ROWS="
            -- (from HTML_FORM_CONSTANTS)

    Textarea_end: STRING is "</TEXTAREA>"
            -- (from HTML_FORM_CONSTANTS)

    Textarea_start: STRING is "<TEXTAREA"
            -- (from HTML_FORM_CONSTANTS)

    Virtual: STRING is "VIRTUAL"
            -- (from HTML_FORM_CONSTANTS)

    Wrap: STRING is " WRAP="
            -- (from HTML_FORM_CONSTANTS)

feature -- Wipe out

    wipe_out

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_FORM_INPUT


HTML_FORM_SELECT Chart

class
    HTML_FORM_SELECT

General
    cluster: web.form
    create: make

Ancestors
    ANY
    HTML_FORM_CONSTANTS

Queries
    Action: STRING
    Align: STRING
    attribute_out (an_attribute, its_value: STRING): STRING
    attributes_out: STRING
    body_out: STRING
    Checkbox: STRING
    Checked: STRING
    Cols: STRING
    Enctype: STRING
    Form_end: STRING
    Form_start: STRING
    Get: STRING
    Hidden: STRING
    Image: STRING
    Input_start: STRING
    Maxlength: STRING
    Method: STRING
    Multiple: STRING
    Name: STRING
    Newline: STRING
    Off: STRING
    Option_end: STRING
    Option_start: STRING
    out: STRING
    Physical: STRING
    Post: STRING
    Radio: STRING
    Reset: STRING
    Rows: STRING
    Select_end: STRING
    Select_start: STRING
    Selected: STRING
    Sendfile: STRING
    Size: STRING
    Src: STRING
    Submit: STRING
    Tag_end: STRING
    Text: STRING
    Textarea_end: STRING
    Textarea_start: STRING
    Type: STRING
    Value: STRING
    Virtual: STRING
    Wrap: STRING

Commands
    add_option (an_option: STRING)
    make
    set_multiple_selection
    set_name (s: STRING)
    set_size (n: INTEGER)
    wipe_out


HTML_FORM_SELECT Flat contracts

class interface
    HTML_FORM_SELECT

create

    make

feature

    make

    Newline: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Tag_end: STRING is ">"
            -- (from HTML_FORM_CONSTANTS)

feature -- Add new options

    add_option (an_option: STRING)
        require
            an_option /= void

feature -- Form

    Action: STRING is " ACTION="
            -- (from HTML_FORM_CONSTANTS)

    Enctype: STRING is " ENCTYPE="
            -- (from HTML_FORM_CONSTANTS)

    Form_end: STRING is "</FORM>"
            -- (from HTML_FORM_CONSTANTS)

    Form_start: STRING is "<FORM"
            -- (from HTML_FORM_CONSTANTS)

    Get: STRING is "GET"
            -- (from HTML_FORM_CONSTANTS)

    Method: STRING is " METHOD="
            -- (from HTML_FORM_CONSTANTS)

    Name: STRING is " NAME="
            -- (from HTML_FORM_CONSTANTS)

    Post: STRING is "POST"
            -- (from HTML_FORM_CONSTANTS)

feature -- Input

    Align: STRING is " ALIGN="
            -- (from HTML_FORM_CONSTANTS)

    Checkbox: STRING is "CHECKBOX"
            -- (from HTML_FORM_CONSTANTS)

    Checked: STRING is " CHECKED"
            -- (from HTML_FORM_CONSTANTS)

    Hidden: STRING is "HIDDEN"
            -- (from HTML_FORM_CONSTANTS)

    Image: STRING is "IMAGE"
            -- (from HTML_FORM_CONSTANTS)

    Input_start: STRING is "<INPUT"
            -- (from HTML_FORM_CONSTANTS)

    Maxlength: STRING is " MAXLENGTH="
            -- (from HTML_FORM_CONSTANTS)

    Radio: STRING is "RADIO"
            -- (from HTML_FORM_CONSTANTS)

    Reset: STRING is "RESET"
            -- (from HTML_FORM_CONSTANTS)

    Sendfile: STRING is ""SEND FILE""
            -- (from HTML_FORM_CONSTANTS)

    Size: STRING is " SIZE="
            -- (from HTML_FORM_CONSTANTS)

    Src: STRING is " SRC="
            -- (from HTML_FORM_CONSTANTS)

    Submit: STRING is "SUBMIT"
            -- (from HTML_FORM_CONSTANTS)

    Text: STRING is "TEXT"
            -- (from HTML_FORM_CONSTANTS)

    Type: STRING is " TYPE="
            -- (from HTML_FORM_CONSTANTS)

    Value: STRING is " VALUE="
            -- (from HTML_FORM_CONSTANTS)

feature -- Routines out

    attribute_out (an_attribute, its_value: STRING): STRING
            -- String representation for the pair 'an_attribute' and 'its_value'

    attributes_out: STRING

    body_out: STRING

    out: STRING

feature -- Select

    Multiple: STRING is " MULTIPLE"
            -- (from HTML_FORM_CONSTANTS)

    Option_end: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Option_start: STRING is "<OPTION"
            -- (from HTML_FORM_CONSTANTS)

    Select_end: STRING is "</SELECT>"
            -- (from HTML_FORM_CONSTANTS)

    Select_start: STRING is "<SELECT"
            -- (from HTML_FORM_CONSTANTS)

    Selected: STRING is " SELECTED"
            -- (from HTML_FORM_CONSTANTS)

feature -- Set attributes

    set_multiple_selection

    set_name (s: STRING)
        require
            s /= void

    set_size (n: INTEGER)

feature -- TextArea

    Cols: STRING is " COLS="
            -- (from HTML_FORM_CONSTANTS)

    Off: STRING is "OFF"
            -- (from HTML_FORM_CONSTANTS)

    Physical: STRING is "PHYSICAL"
            -- (from HTML_FORM_CONSTANTS)

    Rows: STRING is " ROWS="
            -- (from HTML_FORM_CONSTANTS)

    Textarea_end: STRING is "</TEXTAREA>"
            -- (from HTML_FORM_CONSTANTS)

    Textarea_start: STRING is "<TEXTAREA"
            -- (from HTML_FORM_CONSTANTS)

    Virtual: STRING is "VIRTUAL"
            -- (from HTML_FORM_CONSTANTS)

    Wrap: STRING is " WRAP="
            -- (from HTML_FORM_CONSTANTS)

feature -- Wipe out

    wipe_out

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_FORM_SELECT


HTML_FORM_SELECT_OPTION Chart

class
    HTML_FORM_SELECT_OPTION

General
    cluster: web.form
    create: make

Ancestors
    ANY
    HTML_FORM_CONSTANTS

Queries
    Action: STRING
    Align: STRING
    attribute_out (an_attribute, its_value: STRING): STRING
    attributes_out: STRING
    body_out: STRING
    Checkbox: STRING
    Checked: STRING
    Cols: STRING
    Enctype: STRING
    Form_end: STRING
    Form_start: STRING
    Get: STRING
    Hidden: STRING
    Image: STRING
    Input_start: STRING
    Maxlength: STRING
    Method: STRING
    Multiple: STRING
    Name: STRING
    Newline: STRING
    Off: STRING
    Option_end: STRING
    Option_start: STRING
    out: STRING
    Physical: STRING
    Post: STRING
    Radio: STRING
    Reset: STRING
    Rows: STRING
    Select_end: STRING
    Select_start: STRING
    Selected: STRING
    Sendfile: STRING
    Size: STRING
    Src: STRING
    Submit: STRING
    Tag_end: STRING
    Text: STRING
    Textarea_end: STRING
    Textarea_start: STRING
    Type: STRING
    Value: STRING
    Virtual: STRING
    Wrap: STRING

Commands
    make
    set_selected
    set_text (s: STRING)
    set_value (s: STRING)
    wipe_out


HTML_FORM_SELECT_OPTION Flat contracts

class interface
    HTML_FORM_SELECT_OPTION

create

    make

feature

    make

    Newline: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Tag_end: STRING is ">"
            -- (from HTML_FORM_CONSTANTS)

feature -- Form

    Action: STRING is " ACTION="
            -- (from HTML_FORM_CONSTANTS)

    Enctype: STRING is " ENCTYPE="
            -- (from HTML_FORM_CONSTANTS)

    Form_end: STRING is "</FORM>"
            -- (from HTML_FORM_CONSTANTS)

    Form_start: STRING is "<FORM"
            -- (from HTML_FORM_CONSTANTS)

    Get: STRING is "GET"
            -- (from HTML_FORM_CONSTANTS)

    Method: STRING is " METHOD="
            -- (from HTML_FORM_CONSTANTS)

    Name: STRING is " NAME="
            -- (from HTML_FORM_CONSTANTS)

    Post: STRING is "POST"
            -- (from HTML_FORM_CONSTANTS)

feature -- Input

    Align: STRING is " ALIGN="
            -- (from HTML_FORM_CONSTANTS)

    Checkbox: STRING is "CHECKBOX"
            -- (from HTML_FORM_CONSTANTS)

    Checked: STRING is " CHECKED"
            -- (from HTML_FORM_CONSTANTS)

    Hidden: STRING is "HIDDEN"
            -- (from HTML_FORM_CONSTANTS)

    Image: STRING is "IMAGE"
            -- (from HTML_FORM_CONSTANTS)

    Input_start: STRING is "<INPUT"
            -- (from HTML_FORM_CONSTANTS)

    Maxlength: STRING is " MAXLENGTH="
            -- (from HTML_FORM_CONSTANTS)

    Radio: STRING is "RADIO"
            -- (from HTML_FORM_CONSTANTS)

    Reset: STRING is "RESET"
            -- (from HTML_FORM_CONSTANTS)

    Sendfile: STRING is ""SEND FILE""
            -- (from HTML_FORM_CONSTANTS)

    Size: STRING is " SIZE="
            -- (from HTML_FORM_CONSTANTS)

    Src: STRING is " SRC="
            -- (from HTML_FORM_CONSTANTS)

    Submit: STRING is "SUBMIT"
            -- (from HTML_FORM_CONSTANTS)

    Text: STRING is "TEXT"
            -- (from HTML_FORM_CONSTANTS)

    Type: STRING is " TYPE="
            -- (from HTML_FORM_CONSTANTS)

    Value: STRING is " VALUE="
            -- (from HTML_FORM_CONSTANTS)

feature -- Routines out

    attribute_out (an_attribute, its_value: STRING): STRING
            -- String representation for the pair 'an_attribute' and 'its_value'

    attributes_out: STRING

    body_out: STRING

    out: STRING

feature -- Select

    Multiple: STRING is " MULTIPLE"
            -- (from HTML_FORM_CONSTANTS)

    Option_end: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Option_start: STRING is "<OPTION"
            -- (from HTML_FORM_CONSTANTS)

    Select_end: STRING is "</SELECT>"
            -- (from HTML_FORM_CONSTANTS)

    Select_start: STRING is "<SELECT"
            -- (from HTML_FORM_CONSTANTS)

    Selected: STRING is " SELECTED"
            -- (from HTML_FORM_CONSTANTS)

feature -- Set attributes

    set_selected

    set_text (s: STRING)
        require
            s /= void

    set_value (s: STRING)
        require
            s /= void

feature -- TextArea

    Cols: STRING is " COLS="
            -- (from HTML_FORM_CONSTANTS)

    Off: STRING is "OFF"
            -- (from HTML_FORM_CONSTANTS)

    Physical: STRING is "PHYSICAL"
            -- (from HTML_FORM_CONSTANTS)

    Rows: STRING is " ROWS="
            -- (from HTML_FORM_CONSTANTS)

    Textarea_end: STRING is "</TEXTAREA>"
            -- (from HTML_FORM_CONSTANTS)

    Textarea_start: STRING is "<TEXTAREA"
            -- (from HTML_FORM_CONSTANTS)

    Virtual: STRING is "VIRTUAL"
            -- (from HTML_FORM_CONSTANTS)

    Wrap: STRING is " WRAP="
            -- (from HTML_FORM_CONSTANTS)

feature -- Wipe out

    wipe_out

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_FORM_SELECT_OPTION


HTML_FORM_TEXTAREA Chart

class
    HTML_FORM_TEXTAREA

General
    cluster: web.form
    create: make

Ancestors
    ANY
    HTML_FORM_CONSTANTS

Queries
    Action: STRING
    Align: STRING
    attribute_out (an_attribute, its_value: STRING): STRING
    attributes_out: STRING
    body_out: STRING
    Checkbox: STRING
    Checked: STRING
    Cols: STRING
    Enctype: STRING
    Form_end: STRING
    Form_start: STRING
    Get: STRING
    Hidden: STRING
    Image: STRING
    Input_start: STRING
    Maxlength: STRING
    Method: STRING
    Multiple: STRING
    Name: STRING
    Newline: STRING
    Off: STRING
    Option_end: STRING
    Option_start: STRING
    out: STRING
    Physical: STRING
    Post: STRING
    Radio: STRING
    Reset: STRING
    Rows: STRING
    Select_end: STRING
    Select_start: STRING
    Selected: STRING
    Sendfile: STRING
    Size: STRING
    Src: STRING
    Submit: STRING
    Tag_end: STRING
    Text: STRING
    Textarea_end: STRING
    Textarea_start: STRING
    Type: STRING
    Value: STRING
    Virtual: STRING
    Wrap: STRING

Commands
    make
    set_cols (n: INTEGER)
    set_name (s: STRING)
    set_rows (n: INTEGER)
    set_text (s: STRING)
    set_wrap (s: STRING)
    wipe_out


HTML_FORM_TEXTAREA Flat contracts

class interface
    HTML_FORM_TEXTAREA

create

    make

feature

    make

    Newline: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Tag_end: STRING is ">"
            -- (from HTML_FORM_CONSTANTS)

feature -- Form

    Action: STRING is " ACTION="
            -- (from HTML_FORM_CONSTANTS)

    Enctype: STRING is " ENCTYPE="
            -- (from HTML_FORM_CONSTANTS)

    Form_end: STRING is "</FORM>"
            -- (from HTML_FORM_CONSTANTS)

    Form_start: STRING is "<FORM"
            -- (from HTML_FORM_CONSTANTS)

    Get: STRING is "GET"
            -- (from HTML_FORM_CONSTANTS)

    Method: STRING is " METHOD="
            -- (from HTML_FORM_CONSTANTS)

    Name: STRING is " NAME="
            -- (from HTML_FORM_CONSTANTS)

    Post: STRING is "POST"
            -- (from HTML_FORM_CONSTANTS)

feature -- Input

    Align: STRING is " ALIGN="
            -- (from HTML_FORM_CONSTANTS)

    Checkbox: STRING is "CHECKBOX"
            -- (from HTML_FORM_CONSTANTS)

    Checked: STRING is " CHECKED"
            -- (from HTML_FORM_CONSTANTS)

    Hidden: STRING is "HIDDEN"
            -- (from HTML_FORM_CONSTANTS)

    Image: STRING is "IMAGE"
            -- (from HTML_FORM_CONSTANTS)

    Input_start: STRING is "<INPUT"
            -- (from HTML_FORM_CONSTANTS)

    Maxlength: STRING is " MAXLENGTH="
            -- (from HTML_FORM_CONSTANTS)

    Radio: STRING is "RADIO"
            -- (from HTML_FORM_CONSTANTS)

    Reset: STRING is "RESET"
            -- (from HTML_FORM_CONSTANTS)

    Sendfile: STRING is ""SEND FILE""
            -- (from HTML_FORM_CONSTANTS)

    Size: STRING is " SIZE="
            -- (from HTML_FORM_CONSTANTS)

    Src: STRING is " SRC="
            -- (from HTML_FORM_CONSTANTS)

    Submit: STRING is "SUBMIT"
            -- (from HTML_FORM_CONSTANTS)

    Text: STRING is "TEXT"
            -- (from HTML_FORM_CONSTANTS)

    Type: STRING is " TYPE="
            -- (from HTML_FORM_CONSTANTS)

    Value: STRING is " VALUE="
            -- (from HTML_FORM_CONSTANTS)

feature -- Routines out

    attribute_out (an_attribute, its_value: STRING): STRING
            -- String representation for the pair 'an_attribute' and 'its_value'

    attributes_out: STRING

    body_out: STRING

    out: STRING

feature -- Select

    Multiple: STRING is " MULTIPLE"
            -- (from HTML_FORM_CONSTANTS)

    Option_end: STRING is ""
            -- (from HTML_FORM_CONSTANTS)

    Option_start: STRING is "<OPTION"
            -- (from HTML_FORM_CONSTANTS)

    Select_end: STRING is "</SELECT>"
            -- (from HTML_FORM_CONSTANTS)

    Select_start: STRING is "<SELECT"
            -- (from HTML_FORM_CONSTANTS)

    Selected: STRING is " SELECTED"
            -- (from HTML_FORM_CONSTANTS)

feature -- Set attributes

    set_cols (n: INTEGER)

    set_name (s: STRING)
        require
            s /= void

    set_rows (n: INTEGER)

    set_text (s: STRING)
        require
            s /= void

    set_wrap (s: STRING)
        require
            s /= void

feature -- TextArea

    Cols: STRING is " COLS="
            -- (from HTML_FORM_CONSTANTS)

    Off: STRING is "OFF"
            -- (from HTML_FORM_CONSTANTS)

    Physical: STRING is "PHYSICAL"
            -- (from HTML_FORM_CONSTANTS)

    Rows: STRING is " ROWS="
            -- (from HTML_FORM_CONSTANTS)

    Textarea_end: STRING is "</TEXTAREA>"
            -- (from HTML_FORM_CONSTANTS)

    Textarea_start: STRING is "<TEXTAREA"
            -- (from HTML_FORM_CONSTANTS)

    Virtual: STRING is "VIRTUAL"
            -- (from HTML_FORM_CONSTANTS)

    Wrap: STRING is " WRAP="
            -- (from HTML_FORM_CONSTANTS)

feature -- Wipe out

    wipe_out

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_FORM_TEXTAREA


cluster web.html

Cluster
    web.html

Supercluster
    web

Classes
    HTML
    HTML_CONSTANTS
    HTML_GENERATOR
    HTML_PAGE
    HTML_TEXT


HTML_CONSTANTS Chart

class
    HTML_CONSTANTS

General
    cluster: web.html
    description: "Tags of subset of the HTML language. This class may be used as ancestor by classes needing its facilities"

Ancestors
    ANY

Queries
    Bold_end: STRING
    Bold_start: STRING
    Glossary_definition: STRING
    Glossary_end: STRING
    Glossary_start: STRING
    Glossary_term: STRING
    H1_end: STRING
    H1_start: STRING
    H2_end: STRING
    H2_start: STRING
    H3_end: STRING
    H3_start: STRING
    H4_end: STRING
    H4_start: STRING
    H5_end: STRING
    H5_start: STRING
    H6_end: STRING
    H6_start: STRING
    Horizontal_rule: STRING
    Italic_end: STRING
    Italic_start: STRING
    Line_break: STRING
    List_item_end: STRING
    List_item_start: STRING
    Ordered_list_end: STRING
    Ordered_list_start: STRING
    Paragraph_end: STRING
    Paragraph_start: STRING
    Preformatted_end: STRING
    Preformatted_start: STRING
    Unordered_list_end: STRING
    Unordered_list_start: STRING


HTML_CONSTANTS Flat contracts

indexing
    description: "Tags of subset of the HTML language. This class may be used as ancestor by classes needing its facilities"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.5 $"

class interface
    HTML_CONSTANTS

feature -- Constants

    Bold_end: STRING is "</B>"
            -- Bold face end tag.

    Bold_start: STRING is "<B>"
            -- Bold face start tag.

    Glossary_definition: STRING is "<DD>"
            -- Glossary list definition.

    Glossary_end: STRING is "</DL>"
            -- Glossary list end tag.

    Glossary_start: STRING is "<DL>"
            -- Glossary list start tag.

    Glossary_term: STRING is "<DT>"
            -- Glossary list term.

    H1_end: STRING is "</H1>"
            -- Header level 1 end tag.

    H1_start: STRING is "<H1>"
            -- Header level 1 start tag.

    H2_end: STRING is "</H2>"
            -- Header level 2 end tag.

    H2_start: STRING is "<H2>"
            -- Header level 2 start tag.

    H3_end: STRING is "</H3>"
            -- Header level 3 end tag.

    H3_start: STRING is "<H3>"
            -- Header level 3 start tag.

    H4_end: STRING is "</H4>"
            -- Header level 4 end tag.

    H4_start: STRING is "<H4>"
            -- Header level 4 start tag.

    H5_end: STRING is "</H5>"
            -- Header level 5 end tag.

    H5_start: STRING is "<H5>"
            -- Header level 5 start tag.

    H6_end: STRING is "</H6>"
            -- Header level 6 end tag.

    H6_start: STRING is "<H6>"
            -- Header level 6 start tag.

    Horizontal_rule: STRING is "<HR>"
            -- Horizontal rule tag.

    Italic_end: STRING is "</I>"
            -- Italic end tag.

    Italic_start: STRING is "<I>"
            -- Italic start tag.

    Line_break: STRING is "<BR>"
            -- Line break tag.

    List_item_end: STRING is "</LI>"
            -- List item end tag.

    List_item_start: STRING is "<LI>"
            -- List item start tag.

    Ordered_list_end: STRING is "</OL>"
            -- Ordered list end tag.

    Ordered_list_start: STRING is "<OL>"
            -- Ordered list start tag.

    Paragraph_end: STRING is "</P>"
            -- Paragraph end tag.

    Paragraph_start: STRING is "<P>"
            -- Paragraph start tag.

    Preformatted_end: STRING is "</PRE>"
            -- Preformatted text end tag.

    Preformatted_start: STRING is "<PRE>"
            -- Preformatted text start tag.

    Unordered_list_end: STRING is "</UL>"
            -- Unordered list end tag.

    Unordered_list_start: STRING is "<UL>"
            -- Unordered list start tag.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_CONSTANTS


HTML Chart

class
    HTML

General
    cluster: web.html
    create: make

Ancestors
    ANY

Queries
    attributes_out: STRING
    body_attributes_out: STRING
    body_out: STRING
    head_out: STRING
    out: STRING

Commands
    add_option (an_option: STRING)
    make
    set_title (s: STRING)
    wipe_out


HTML Flat contracts

class interface
    HTML

create

    make

feature

    make

feature -- Add new options

    add_option (an_option: STRING)
        require
            an_option /= void

feature -- Routines out

    attributes_out: STRING
            -- Was declared in HTML as synonym of body_attributes_out.

    body_attributes_out: STRING
            -- Was declared in HTML as synonym of attributes_out.

    body_out: STRING

    head_out: STRING

    out: STRING

feature -- Set

    set_title (s: STRING)

feature -- Wipe out

    wipe_out

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML


HTML_GENERATOR Chart

class
    HTML_GENERATOR

General
    cluster: web.html
    description: "HTML generation. This class may be used as ancestor by classes needing its facilities"

Ancestors
    HTML_CONSTANTS
    SHARED_STDOUT

Queries
    Bold_end: STRING
    Bold_start: STRING
    Glossary_definition: STRING
    Glossary_end: STRING
    Glossary_start: STRING
    Glossary_term: STRING
    H1_end: STRING
    H1_start: STRING
    H2_end: STRING
    H2_start: STRING
    H3_end: STRING
    H3_start: STRING
    H4_end: STRING
    H4_start: STRING
    H5_end: STRING
    H5_start: STRING
    H6_end: STRING
    H6_start: STRING
    Horizontal_rule: STRING
    Italic_end: STRING
    Italic_start: STRING
    Line_break: STRING
    List_item_end: STRING
    List_item_start: STRING
    Ordered_list_end: STRING
    Ordered_list_start: STRING
    Paragraph_end: STRING
    Paragraph_start: STRING
    Preformatted_end: STRING
    Preformatted_start: STRING
    Stdout: STDOUT
    Unordered_list_end: STRING
    Unordered_list_start: STRING

Commands
    put_basic (s: STRING)
    put_bold (text: STRING)
    put_glossary_definition
    put_glossary_end
    put_glossary_start
    put_glossary_term (text: STRING)
    put_header1 (title: STRING)
    put_header2 (title: STRING)
    put_header3 (title: STRING)
    put_header4 (title: STRING)
    put_header5 (title: STRING)
    put_header6 (title: STRING)
    put_horizontal_rule
    put_italic (text: STRING)
    put_line_break
    put_link (url, anchor: STRING)
    put_list_item_end
    put_list_item_start
    put_ordered_list_end
    put_ordered_list_start
    put_paragraph_end
    put_paragraph_start
    put_preformatted (text: STRING)
    put_unordered_list_end
    put_unordered_list_start


HTML_GENERATOR Flat contracts

indexing
    description: "HTML generation. This class may be used as ancestor by classes needing its facilities"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.5 $"

class interface
    HTML_GENERATOR

feature -- Access

    stdout: STDOUT
            -- Shared standard output (stdout).
            -- (from SHARED_STDOUT)

feature -- Transformation

    put_basic (s: STRING)
            -- Write s to medium.
        require
            string_not_void: s /= void

feature -- Miscellaneous

    put_bold (text: STRING)
            -- Put text in bold face.
        require
            text_not_void: text /= void

    put_glossary_definition
            -- Put glossary definition tag.

    put_glossary_end
            -- End glossary list.

    put_glossary_start
            -- Start glossary list.

    put_glossary_term (text: STRING)
            -- Put text as glossary term.
        require
            text_not_void: text /= void

    put_header1 (title: STRING)
            -- Put title as level 1 header.
        require
            title_not_void: title /= void

    put_header2 (title: STRING)
            -- Put title as level 2 header.
        require
            title_not_void: title /= void

    put_header3 (title: STRING)
            -- Put title as level 3 header.
        require
            title_not_void: title /= void

    put_header4 (title: STRING)
            -- Put title as level 4 header.
        require
            title_not_void: title /= void

    put_header5 (title: STRING)
            -- Put title as level 5 header.
        require
            title_not_void: title /= void

    put_header6 (title: STRING)
            -- Put title as level 6 header.
        require
            title_not_void: title /= void

    put_horizontal_rule
            -- Put a horizontal rule.

    put_italic (text: STRING)
            -- Put text in italic.
        require
            text_not_void: text /= void

    put_line_break
            -- Put line break.

    put_link (url, anchor: STRING)
            -- Attach text anchor to url
        require
            anchor_not_void: anchor /= void
            url_not_void: url /= void

    put_list_item_end
            -- Put list item end tag.

    put_list_item_start
            -- Put list item start tag.

    put_ordered_list_end
            -- End ordered list.

    put_ordered_list_start
            -- Start ordered list.

    put_paragraph_end
            -- End paragraph

    put_paragraph_start
            -- Start paragraph.

    put_preformatted (text: STRING)
            -- Put preformatted text text.
        require
            text_not_void: text /= void

    put_unordered_list_end
            -- End unordered list.

    put_unordered_list_start
            -- Start unordered list.

feature -- Constants

    Bold_end: STRING is "</B>"
            -- Bold face end tag.
            -- (from HTML_CONSTANTS)

    Bold_start: STRING is "<B>"
            -- Bold face start tag.
            -- (from HTML_CONSTANTS)

    Glossary_definition: STRING is "<DD>"
            -- Glossary list definition.
            -- (from HTML_CONSTANTS)

    Glossary_end: STRING is "</DL>"
            -- Glossary list end tag.
            -- (from HTML_CONSTANTS)

    Glossary_start: STRING is "<DL>"
            -- Glossary list start tag.
            -- (from HTML_CONSTANTS)

    Glossary_term: STRING is "<DT>"
            -- Glossary list term.
            -- (from HTML_CONSTANTS)

    H1_end: STRING is "</H1>"
            -- Header level 1 end tag.
            -- (from HTML_CONSTANTS)

    H1_start: STRING is "<H1>"
            -- Header level 1 start tag.
            -- (from HTML_CONSTANTS)

    H2_end: STRING is "</H2>"
            -- Header level 2 end tag.
            -- (from HTML_CONSTANTS)

    H2_start: STRING is "<H2>"
            -- Header level 2 start tag.
            -- (from HTML_CONSTANTS)

    H3_end: STRING is "</H3>"
            -- Header level 3 end tag.
            -- (from HTML_CONSTANTS)

    H3_start: STRING is "<H3>"
            -- Header level 3 start tag.
            -- (from HTML_CONSTANTS)

    H4_end: STRING is "</H4>"
            -- Header level 4 end tag.
            -- (from HTML_CONSTANTS)

    H4_start: STRING is "<H4>"
            -- Header level 4 start tag.
            -- (from HTML_CONSTANTS)

    H5_end: STRING is "</H5>"
            -- Header level 5 end tag.
            -- (from HTML_CONSTANTS)

    H5_start: STRING is "<H5>"
            -- Header level 5 start tag.
            -- (from HTML_CONSTANTS)

    H6_end: STRING is "</H6>"
            -- Header level 6 end tag.
            -- (from HTML_CONSTANTS)

    H6_start: STRING is "<H6>"
            -- Header level 6 start tag.
            -- (from HTML_CONSTANTS)

    Horizontal_rule: STRING is "<HR>"
            -- Horizontal rule tag.
            -- (from HTML_CONSTANTS)

    Italic_end: STRING is "</I>"
            -- Italic end tag.
            -- (from HTML_CONSTANTS)

    Italic_start: STRING is "<I>"
            -- Italic start tag.
            -- (from HTML_CONSTANTS)

    Line_break: STRING is "<BR>"
            -- Line break tag.
            -- (from HTML_CONSTANTS)

    List_item_end: STRING is "</LI>"
            -- List item end tag.
            -- (from HTML_CONSTANTS)

    List_item_start: STRING is "<LI>"
            -- List item start tag.
            -- (from HTML_CONSTANTS)

    Ordered_list_end: STRING is "</OL>"
            -- Ordered list end tag.
            -- (from HTML_CONSTANTS)

    Ordered_list_start: STRING is "<OL>"
            -- Ordered list start tag.
            -- (from HTML_CONSTANTS)

    Paragraph_end: STRING is "</P>"
            -- Paragraph end tag.
            -- (from HTML_CONSTANTS)

    Paragraph_start: STRING is "<P>"
            -- Paragraph start tag.
            -- (from HTML_CONSTANTS)

    Preformatted_end: STRING is "</PRE>"
            -- Preformatted text end tag.
            -- (from HTML_CONSTANTS)

    Preformatted_start: STRING is "<PRE>"
            -- Preformatted text start tag.
            -- (from HTML_CONSTANTS)

    Unordered_list_end: STRING is "</UL>"
            -- Unordered list end tag.
            -- (from HTML_CONSTANTS)

    Unordered_list_start: STRING is "<UL>"
            -- Unordered list start tag.
            -- (from HTML_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_GENERATOR


HTML_PAGE Chart

class
    HTML_PAGE

General
    cluster: web.html
    description: "Class which contains the information relative to an html page."
    create: make_from_template, make

Ancestors
    ANY

Queries
    out: STRING

Commands
    add_html_code (s: STRING)
    insert_hidden_field (name, value: STRING)
    make
    make_from_template (fi_n: STRING)
    replace_marker (a_marker, s: STRING)

Constraints
    page exists


HTML_PAGE Flat contracts

indexing
    description: "Class which contains the information relative to an html page."
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.3 $"

class interface
    HTML_PAGE

create

    make
            -- Create an HTML page.

    make_from_template (fi_n: STRING)
            -- Create an HTML page from a template whose path name is
            -- 'fi'. The template may contains special symbols/words, which
            -- will allow smart replacing (see feature 'replace').
        require
            path_not_void: fi_n /= void
        ensure
            image_exists: image /= void

feature -- Initialization

    make
            -- Create an HTML page.

    make_from_template (fi_n: STRING)
            -- Create an HTML page from a template whose path name is
            -- 'fi'. The template may contains special symbols/words, which
            -- will allow smart replacing (see feature 'replace').
        require
            path_not_void: fi_n /= void
        ensure
            image_exists: image /= void

feature -- Access

    out: STRING
            -- Usable copy of the output.

feature -- Basic Operations

    add_html_code (s: STRING)
            -- Add html code 's'.
        require
            code_exists: s /= void

    insert_hidden_field (name, value: STRING)
            -- Insert hidden field with name 'name' and value 'value'.
        require
            has_form: out.substring_index ("</form>", 1) > 0 or out.substring_index ("</FORM>", 1) > 0

    replace_marker (a_marker, s: STRING)
            -- Replace marker 'a_marker' by string 's'
            -- within the template.
            -- Do nothing if it does not exist.
        require
            not_void: a_marker /= void and s /= void

invariant

    page_exists: out /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_PAGE


HTML_TEXT Chart

class
    HTML_TEXT

General
    cluster: web.html
    create: make

Ancestors
    HTML_GENERATOR

Queries
    Bold_end: STRING
    Bold_start: STRING
    Glossary_definition: STRING
    Glossary_end: STRING
    Glossary_start: STRING
    Glossary_term: STRING
    H1_end: STRING
    H1_start: STRING
    H2_end: STRING
    H2_start: STRING
    H3_end: STRING
    H3_start: STRING
    H4_end: STRING
    H4_start: STRING
    H5_end: STRING
    H5_start: STRING
    H6_end: STRING
    H6_start: STRING
    Horizontal_rule: STRING
    Italic_end: STRING
    Italic_start: STRING
    Line_break: STRING
    List_item_end: STRING
    List_item_start: STRING
    Ordered_list_end: STRING
    Ordered_list_start: STRING
    out: STRING
    Paragraph_end: STRING
    Paragraph_start: STRING
    Preformatted_end: STRING
    Preformatted_start: STRING
    Stdout: STDOUT
    Unordered_list_end: STRING
    Unordered_list_start: STRING

Commands
    make
    put_address (s: STRING)
    put_basic (s: STRING)
    put_blink (s: STRING)
    put_bold (text: STRING)
    put_center (s: STRING)
    put_font (s: STRING; n: INTEGER)
    put_glossary_definition
    put_glossary_end
    put_glossary_start
    put_glossary_term (text: STRING)
    put_header1 (title: STRING)
    put_header2 (title: STRING)
    put_header3 (title: STRING)
    put_header4 (title: STRING)
    put_header5 (title: STRING)
    put_header6 (title: STRING)
    put_horizontal_rule
    put_indent (s: STRING)
    put_italic (text: STRING)
    put_line_break
    put_link (url, anchor: STRING)
    put_list_item_end
    put_list_item_start
    put_ordered_list_end
    put_ordered_list_start
    put_paragraph_end
    put_paragraph_start
    put_preformatted (text: STRING)
    put_unordered_list_end
    put_unordered_list_start
    wipe_out


HTML_TEXT Flat contracts

class interface
    HTML_TEXT

create

    make

feature -- Access

    stdout: STDOUT
            -- Shared standard output (stdout).
            -- (from SHARED_STDOUT)

feature -- Miscellaneous

    put_bold (text: STRING)
            -- Put text in bold face.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            text_not_void: text /= void

    put_glossary_definition
            -- Put glossary definition tag.
            -- (from HTML_GENERATOR)

    put_glossary_end
            -- End glossary list.
            -- (from HTML_GENERATOR)

    put_glossary_start
            -- Start glossary list.
            -- (from HTML_GENERATOR)

    put_glossary_term (text: STRING)
            -- Put text as glossary term.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            text_not_void: text /= void

    put_header1 (title: STRING)
            -- Put title as level 1 header.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            title_not_void: title /= void

    put_header2 (title: STRING)
            -- Put title as level 2 header.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            title_not_void: title /= void

    put_header3 (title: STRING)
            -- Put title as level 3 header.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            title_not_void: title /= void

    put_header4 (title: STRING)
            -- Put title as level 4 header.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            title_not_void: title /= void

    put_header5 (title: STRING)
            -- Put title as level 5 header.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            title_not_void: title /= void

    put_header6 (title: STRING)
            -- Put title as level 6 header.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            title_not_void: title /= void

    put_horizontal_rule
            -- Put a horizontal rule.
            -- (from HTML_GENERATOR)

    put_italic (text: STRING)
            -- Put text in italic.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            text_not_void: text /= void

    put_line_break
            -- Put line break.
            -- (from HTML_GENERATOR)

    put_link (url, anchor: STRING)
            -- Attach text anchor to url
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            anchor_not_void: anchor /= void
            url_not_void: url /= void

    put_list_item_end
            -- Put list item end tag.
            -- (from HTML_GENERATOR)

    put_list_item_start
            -- Put list item start tag.
            -- (from HTML_GENERATOR)

    put_ordered_list_end
            -- End ordered list.
            -- (from HTML_GENERATOR)

    put_ordered_list_start
            -- Start ordered list.
            -- (from HTML_GENERATOR)

    put_paragraph_end
            -- End paragraph
            -- (from HTML_GENERATOR)

    put_paragraph_start
            -- Start paragraph.
            -- (from HTML_GENERATOR)

    put_preformatted (text: STRING)
            -- Put preformatted text text.
            -- (from HTML_GENERATOR)
        require -- from HTML_GENERATOR
            text_not_void: text /= void

    put_unordered_list_end
            -- End unordered list.
            -- (from HTML_GENERATOR)

    put_unordered_list_start
            -- Start unordered list.
            -- (from HTML_GENERATOR)

feature

    make

feature -- Add some new features

    put_address (s: STRING)

    put_blink (s: STRING)

    put_center (s: STRING)
            -- Put 's' centered on the window

    put_font (s: STRING; n: INTEGER)
            -- Put 's' with font size set to 'n'

    put_indent (s: STRING)

    wipe_out
            -- Restore a empty HTML text

feature -- Constants

    Bold_end: STRING is "</B>"
            -- Bold face end tag.
            -- (from HTML_CONSTANTS)

    Bold_start: STRING is "<B>"
            -- Bold face start tag.
            -- (from HTML_CONSTANTS)

    Glossary_definition: STRING is "<DD>"
            -- Glossary list definition.
            -- (from HTML_CONSTANTS)

    Glossary_end: STRING is "</DL>"
            -- Glossary list end tag.
            -- (from HTML_CONSTANTS)

    Glossary_start: STRING is "<DL>"
            -- Glossary list start tag.
            -- (from HTML_CONSTANTS)

    Glossary_term: STRING is "<DT>"
            -- Glossary list term.
            -- (from HTML_CONSTANTS)

    H1_end: STRING is "</H1>"
            -- Header level 1 end tag.
            -- (from HTML_CONSTANTS)

    H1_start: STRING is "<H1>"
            -- Header level 1 start tag.
            -- (from HTML_CONSTANTS)

    H2_end: STRING is "</H2>"
            -- Header level 2 end tag.
            -- (from HTML_CONSTANTS)

    H2_start: STRING is "<H2>"
            -- Header level 2 start tag.
            -- (from HTML_CONSTANTS)

    H3_end: STRING is "</H3>"
            -- Header level 3 end tag.
            -- (from HTML_CONSTANTS)

    H3_start: STRING is "<H3>"
            -- Header level 3 start tag.
            -- (from HTML_CONSTANTS)

    H4_end: STRING is "</H4>"
            -- Header level 4 end tag.
            -- (from HTML_CONSTANTS)

    H4_start: STRING is "<H4>"
            -- Header level 4 start tag.
            -- (from HTML_CONSTANTS)

    H5_end: STRING is "</H5>"
            -- Header level 5 end tag.
            -- (from HTML_CONSTANTS)

    H5_start: STRING is "<H5>"
            -- Header level 5 start tag.
            -- (from HTML_CONSTANTS)

    H6_end: STRING is "</H6>"
            -- Header level 6 end tag.
            -- (from HTML_CONSTANTS)

    H6_start: STRING is "<H6>"
            -- Header level 6 start tag.
            -- (from HTML_CONSTANTS)

    Horizontal_rule: STRING is "<HR>"
            -- Horizontal rule tag.
            -- (from HTML_CONSTANTS)

    Italic_end: STRING is "</I>"
            -- Italic end tag.
            -- (from HTML_CONSTANTS)

    Italic_start: STRING is "<I>"
            -- Italic start tag.
            -- (from HTML_CONSTANTS)

    Line_break: STRING is "<BR>"
            -- Line break tag.
            -- (from HTML_CONSTANTS)

    List_item_end: STRING is "</LI>"
            -- List item end tag.
            -- (from HTML_CONSTANTS)

    List_item_start: STRING is "<LI>"
            -- List item start tag.
            -- (from HTML_CONSTANTS)

    Ordered_list_end: STRING is "</OL>"
            -- Ordered list end tag.
            -- (from HTML_CONSTANTS)

    Ordered_list_start: STRING is "<OL>"
            -- Ordered list start tag.
            -- (from HTML_CONSTANTS)

    Paragraph_end: STRING is "</P>"
            -- Paragraph end tag.
            -- (from HTML_CONSTANTS)

    Paragraph_start: STRING is "<P>"
            -- Paragraph start tag.
            -- (from HTML_CONSTANTS)

    Preformatted_end: STRING is "</PRE>"
            -- Preformatted text end tag.
            -- (from HTML_CONSTANTS)

    Preformatted_start: STRING is "<PRE>"
            -- Preformatted text start tag.
            -- (from HTML_CONSTANTS)

    Unordered_list_end: STRING is "</UL>"
            -- Unordered list end tag.
            -- (from HTML_CONSTANTS)

    Unordered_list_start: STRING is "<UL>"
            -- Unordered list start tag.
            -- (from HTML_CONSTANTS)

feature -- Out representation

    out: STRING
            -- Provide a STRING representation for the HTML text

feature -- Redefinition

    put_basic (s: STRING)
            -- Append 's' to the temporary string
        require -- from HTML_GENERATOR
            string_not_void: s /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_TEXT


cluster web.stdio

Cluster
    web.stdio

Supercluster
    web

Classes
    SHARED_STDIN
    SHARED_STDOUT
    STDIN
    STDOUT


SHARED_STDIN Chart

class
    SHARED_STDIN

General
    cluster: web.stdio
    description: "Shared standard input"

Ancestors
    ANY

Queries
    Stdin: STDIN


SHARED_STDIN Flat contracts

indexing
    description: "Shared standard input"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.5 $"

class interface
    SHARED_STDIN

feature -- Access

    stdin: STDIN
            -- Shared standard input (stdin).

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SHARED_STDIN


SHARED_STDOUT Chart

class
    SHARED_STDOUT

General
    cluster: web.stdio
    description: "Shared standard output"

Ancestors
    ANY

Queries
    Stdout: STDOUT


SHARED_STDOUT Flat contracts

indexing
    description: "Shared standard output"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.5 $"

class interface
    SHARED_STDOUT

feature -- Access

    stdout: STDOUT
            -- Shared standard output (stdout).

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SHARED_STDOUT


STDIN Chart

class
    STDIN

General
    cluster: web.stdio
    description: "Standard input in the Unix understanding."
    create: make

Ancestors
    PLAIN_TEXT_FILE

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    Count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    Support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] STDIN)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] STDIN)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    make_plain_text_file (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out


STDIN Flat contracts

indexing
    description: "Standard input in the Unix understanding."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.3 $"

class interface
    STDIN

create

    make

feature -- Initialization

    make

    make_plain_text_file (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.
            -- (from FILE)

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    item: CHARACTER
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    position: INTEGER
            -- Current cursor position.
            -- (from FILE)

    protection: INTEGER
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

feature -- Measurement

    Count: INTEGER is 1
            -- Useless for STDIN class.
            -- count is non zero not to invalidate invariant clauses.

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        ensure then -- from FILE
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?
            -- (from FILE)

    file_prunable: BOOLEAN
            -- May items be removed?
            -- (from FILE)

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from FILE)

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?
            -- (from FILE)

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)

    is_device: BOOLEAN
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?
            -- (from FILE)

    is_open_read: BOOLEAN
            -- Is file open for reading?
            -- (from FILE)

    is_open_write: BOOLEAN
            -- Is file open for writing?
            -- (from FILE)

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)? (Yes)
            -- (from PLAIN_TEXT_FILE)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?
            -- (from FILE)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?
            -- (from PLAIN_TEXT_FILE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then -- from FILE
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed

    forth
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed

    next_line
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure -- from FILE
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readdouble.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readint.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_real
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readreal.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_double.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_integer.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readreal
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_real.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    put_boolean (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putbool.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putdouble.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putint.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putreal.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putbool (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_boolean.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_double.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_integer.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_real.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from PLAIN_TEXT_FILE
    plain_text: is_plain_text
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

end -- class STDIN


STDOUT Chart

class
    STDOUT

General
    cluster: web.stdio
    description: "Standard output in the Unix understanding."
    create: make

Ancestors
    PLAIN_TEXT_FILE

Queries
    access_date: INTEGER
    access_exists: BOOLEAN
    after: BOOLEAN
    before: BOOLEAN
    change_date: INTEGER
    changeable_comparison_criterion: BOOLEAN
    Count: INTEGER
    date: INTEGER
    descriptor: INTEGER
    descriptor_available: BOOLEAN
    end_of_file: BOOLEAN
    exhausted: BOOLEAN
    exists: BOOLEAN
    extendible: BOOLEAN
    file_info: UNIX_FILE_INFO
    file_pointer: POINTER
    file_prunable: BOOLEAN
    file_readable: BOOLEAN
    file_writable: BOOLEAN
    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    group_id: INTEGER
    has (v: [like item] CHARACTER): BOOLEAN
    index_of (v: [like item] CHARACTER; i: INTEGER): INTEGER
    inode: INTEGER
    is_access_executable: BOOLEAN
    is_access_owner: BOOLEAN
    is_access_readable: BOOLEAN
    is_access_writable: BOOLEAN
    is_block: BOOLEAN
    is_character: BOOLEAN
    is_closed: BOOLEAN
    is_creatable: BOOLEAN
    is_device: BOOLEAN
    is_directory: BOOLEAN
    is_empty: BOOLEAN
    is_executable: BOOLEAN
    is_fifo: BOOLEAN
    is_inserted (v: CHARACTER): BOOLEAN
    is_open_append: BOOLEAN
    is_open_read: BOOLEAN
    is_open_write: BOOLEAN
    is_owner: BOOLEAN
    is_plain: BOOLEAN
    is_plain_text: BOOLEAN
    is_readable: BOOLEAN
    is_setgid: BOOLEAN
    is_setuid: BOOLEAN
    is_socket: BOOLEAN
    is_sticky: BOOLEAN
    is_symlink: BOOLEAN
    is_writable: BOOLEAN
    item: CHARACTER
    last_character: CHARACTER
    last_double: DOUBLE
    last_integer: INTEGER
    last_real: REAL
    last_string: STRING
    lastchar: CHARACTER
    lastdouble: DOUBLE
    lastint: INTEGER
    lastreal: REAL
    laststring: STRING
    linear_representation: LINEAR [CHARACTER]
    links: INTEGER
    name: STRING
    object_comparison: BOOLEAN
    occurrences (v: CHARACTER): INTEGER
    off: BOOLEAN
    owner_name: STRING
    position: INTEGER
    protection: INTEGER
    readable: BOOLEAN
    retrieved: ANY
    separator: CHARACTER
    Support_storable: BOOLEAN
    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
    user_id: INTEGER
    writable: BOOLEAN

Commands
    add_permission (who, what: STRING)
    append (f: [like Current] STDOUT)
    back
    basic_store (object: ANY)
    change_group (new_group_id: INTEGER)
    change_mode (mask: INTEGER)
    change_name (new_name: STRING)
    change_owner (new_owner_id: INTEGER)
    close
    compare_objects
    compare_references
    copy_to (file: [like Current] STDOUT)
    create_read_write
    delete
    dispose
    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
    extend (v: CHARACTER)
    fd_open_append (fd: INTEGER)
    fd_open_read (fd: INTEGER)
    fd_open_read_append (fd: INTEGER)
    fd_open_read_write (fd: INTEGER)
    fd_open_write (fd: INTEGER)
    fill (other: CONTAINER [CHARACTER])
    finish
    flush
    force (v: [like item] CHARACTER)
    forth
    general_store (object: ANY)
    go (abs_position: INTEGER)
    independent_store (object: ANY)
    link (fn: STRING)
    make
    make_create_read_write (fn: STRING)
    make_open_append (fn: STRING)
    make_open_read (fn: STRING)
    make_open_read_append (fn: STRING)
    make_open_read_write (fn: STRING)
    make_open_write (fn: STRING)
    make_plain_text_file (fn: STRING)
    move (offset: INTEGER)
    new_line
    next_line
    open_append
    open_read
    open_read_append
    open_read_write
    open_write
    prune_all (v: [like item] CHARACTER)
    put (v: [like item] CHARACTER)
    put_boolean (b: BOOLEAN)
    put_character (c: CHARACTER)
    put_double (d: DOUBLE)
    put_integer (i: INTEGER)
    put_new_line
    put_real (r: REAL)
    put_string (s: STRING)
    putbool (b: BOOLEAN)
    putchar (c: CHARACTER)
    putdouble (d: DOUBLE)
    putint (i: INTEGER)
    putreal (r: REAL)
    putstring (s: STRING)
    read_character
    read_double
    read_integer
    read_line
    read_real
    read_stream (nb_char: INTEGER)
    read_word
    readchar
    readdouble
    readint
    readline
    readreal
    readstream (nb_char: INTEGER)
    readword
    recede (abs_position: INTEGER)
    recreate_read_write (fname: STRING)
    remove_permission (who, what: STRING)
    reopen_append (fname: STRING)
    reopen_read (fname: STRING)
    reopen_read_append (fname: STRING)
    reopen_read_write (fname: STRING)
    reopen_write (fname: STRING)
    reset (fn: STRING)
    search (v: [like item] CHARACTER)
    set_access (time: INTEGER)
    set_date (time: INTEGER)
    stamp (time: INTEGER)
    start
    touch
    wipe_out


STDOUT Flat contracts

indexing
    description: "Standard output in the Unix understanding."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:02 $"
    revision: "$Revision: 1.3 $"

class interface
    STDOUT

create

    make

feature -- Initialization

    make

    make_plain_text_file (fn: STRING)
            -- Create file object with fn as file name.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            file_named: name.is_equal (fn)
            file_closed: is_closed

    make_create_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in append-only mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    make_open_read (fn: STRING)
            -- Create file object with fn as file name
            -- and open file in read mode.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    make_open_read_append (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for reading anywhere
            -- but writing at the end only.
            -- Create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    make_open_read_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for both reading and writing.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    make_open_write (fn: STRING)
            -- Create file object with fn as file name
            -- and open file for writing;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            string_exists: fn /= void
            string_not_empty: not fn.is_empty
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Access

    access_date: INTEGER
            -- Time stamp of last access made to the inode.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    date: INTEGER
            -- Time stamp (time of last modification)
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    descriptor: INTEGER
            -- File descriptor as used by the operating system.
            -- (from FILE)
        require -- from IO_MEDIUM
            valid_handle: descriptor_available
        require else -- from FILE
            file_opened: not is_closed

    descriptor_available: BOOLEAN
            -- (from FILE)

    file_info: UNIX_FILE_INFO
            -- Collected information about the file.
            -- (from FILE)

    file_pointer: POINTER
            -- File pointer as required in C
            -- (from FILE)

    group_id: INTEGER
            -- Group identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    has (v: like item): BOOLEAN
            -- Does structure include an occurrence of v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of v.
            -- 0 if none.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    inode: INTEGER
            -- I-node number
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    item: CHARACTER
            -- Current item
            -- (from FILE)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    links: INTEGER
            -- Number of links on file
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    name: STRING
            -- File name
            -- (from FILE)

    occurrences (v: CHARACTER): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    owner_name: STRING
            -- Name of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    position: INTEGER
            -- Current cursor position.
            -- (from FILE)

    protection: INTEGER
            -- Protection mode, in decimal value
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    retrieved: ANY
            -- Retrieved object structure
            -- To access resulting object under correct type,
            -- use assignment attempt.
            -- Will raise an exception (code Retrieve_exception)
            -- if content is not a stored Eiffel structure.
            -- (from FILE)
        require -- from IO_MEDIUM
            exists: exists
            is_open_read: is_open_read
            support_storable: support_storable
        ensure -- from IO_MEDIUM
            result_exists: Result /= void

    separator: CHARACTER
            -- ASCII code of character following last word read
            -- (from FILE)

    user_id: INTEGER
            -- User identification of owner
            -- (from FILE)
        require -- from FILE
            file_exists: exists

feature -- Measurement

    Count: INTEGER is 1
            -- Useless for STDOUT class.
            -- count is non zero not to invalidate invariant clauses.

feature -- Status report

    access_exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses real UID.)
            -- (from FILE)

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor position?
            -- (from FILE)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor position?
            -- (from FILE)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    end_of_file: BOOLEAN
            -- Has an EOF been detected?
            -- (from FILE)
        require -- from FILE
            opened: not is_closed

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    exists: BOOLEAN
            -- Does physical file exist?
            -- (Uses effective UID.)
            -- (from FILE)
        ensure then -- from FILE
            unchanged_mode: mode = old mode

    extendible: BOOLEAN
            -- May new items be added?
            -- (from FILE)

    file_prunable: BOOLEAN
            -- May items be removed?
            -- (from FILE)

    file_readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from FILE)

    file_writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from FILE)

    Full: BOOLEAN is False
            -- Is structure filled to capacity?
            -- (from FILE)

    is_access_executable: BOOLEAN
            -- Is file executable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_owner: BOOLEAN
            -- Is file owned by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_readable: BOOLEAN
            -- Is file readable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_access_writable: BOOLEAN
            -- Is file writable by real UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_block: BOOLEAN
            -- Is file a block special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_character: BOOLEAN
            -- Is file a character special file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_closed: BOOLEAN
            -- Is file closed?
            -- (from FILE)

    is_creatable: BOOLEAN
            -- Is file creatable in parent directory?
            -- (Uses effective UID to check that parent is writable
            -- and file does not exist.)
            -- (from FILE)

    is_device: BOOLEAN
            -- Is file a device?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_directory: BOOLEAN
            -- Is file a directory?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_executable: BOOLEAN
            -- Is file executable?
            -- (Checks execute permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_fifo: BOOLEAN
            -- Is file a named pipe?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_inserted (v: CHARACTER): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    is_open_append: BOOLEAN
            -- Is file open for appending?
            -- (from FILE)

    is_open_read: BOOLEAN
            -- Is file open for reading?
            -- (from FILE)

    is_open_write: BOOLEAN
            -- Is file open for writing?
            -- (from FILE)

    is_owner: BOOLEAN
            -- Is file owned by effective UID?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain: BOOLEAN
            -- Is file a plain file?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_plain_text: BOOLEAN
            -- Is file reserved for text (character sequences)? (Yes)
            -- (from PLAIN_TEXT_FILE)

    is_readable: BOOLEAN
            -- Is file readable?
            -- (Checks permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    is_setgid: BOOLEAN
            -- Is file setgid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_setuid: BOOLEAN
            -- Is file setuid?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_socket: BOOLEAN
            -- Is file a named socket?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_sticky: BOOLEAN
            -- Is file sticky (for memory swaps)?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_symlink: BOOLEAN
            -- Is file a symbolic link?
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    is_writable: BOOLEAN
            -- Is file writable?
            -- (Checks write permission for effective UID.)
            -- (from FILE)
        require -- from IO_MEDIUM
            handle_exists: exists

    last_character: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    last_double: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    last_integer: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    last_real: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    last_string: STRING
            -- Last string read
            -- (from IO_MEDIUM)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no item?
            -- (from FILE)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from SEQUENCE)
        require -- from  ACTIVE
            True
        require -- from IO_MEDIUM
            handle_exists: exists

    Support_storable: BOOLEAN is False
            -- Can medium be used to store an Eiffel structure?
            -- (from PLAIN_TEXT_FILE)

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    close
            -- Close file.
        require -- from IO_MEDIUM
            medium_is_open: not is_closed
        ensure then -- from FILE
            is_closed: is_closed

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

    create_read_write
            -- Open file in read and write mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_append (fd: INTEGER)
            -- Open file of descriptor fd in append mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    fd_open_read (fd: INTEGER)
            -- Open file of descriptor fd in read-only mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    fd_open_read_append (fd: INTEGER)
            -- Open file of descriptor fd
            -- in read and write-at-end mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    fd_open_read_write (fd: INTEGER)
            -- Open file of descriptor fd in read-write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    fd_open_write (fd: INTEGER)
            -- Open file of descriptor fd in write mode.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    open_append
            -- Open file in append-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    open_read
            -- Open file in read-only mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    open_read_append
            -- Open file in read and write-at-end mode;
            -- create it if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    open_read_write
            -- Open file in read and write mode.
            -- (from FILE)
        require -- from FILE
            is_closed: is_closed
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    open_write
            -- Open file in write-only mode;
            -- create it if it does not exist.
            -- (from FILE)
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

    recreate_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_append (fname: STRING)
            -- Reopen in append mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_append: is_open_append

    reopen_read (fname: STRING)
            -- Reopen in read-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read

    reopen_read_append (fname: STRING)
            -- Reopen in read and write-at-end mode with file
            -- of name fname; create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_append: is_open_append

    reopen_read_write (fname: STRING)
            -- Reopen in read-write mode with file of name fname.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_read: is_open_read
            open_write: is_open_write

    reopen_write (fname: STRING)
            -- Reopen in write-only mode with file of name fname;
            -- create file if it does not exist.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed
            valid_name: fname /= void
        ensure -- from FILE
            exists: exists
            open_write: is_open_write

feature -- Cursor movement

    back
            -- Go back one position.
            -- (from FILE)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Go to last position.
            -- (from FILE)
        require -- from  LINEAR
            True
        require else -- from FILE
            file_opened: not is_closed

    forth
            -- Go to next position.
            -- (from FILE)
        require -- from LINEAR
            not_after: not after
        require else -- from FILE
            file_opened: not is_closed

    go (abs_position: INTEGER)
            -- Go to the absolute position.
            -- (New position may be beyond physical length.)
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    move (offset: INTEGER)
            -- Advance by offset from current location.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed

    next_line
            -- Move to next input line.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    recede (abs_position: INTEGER)
            -- Go to the absolute position backwards,
            -- starting from end of file.
            -- (from FILE)
        require -- from FILE
            file_opened: not is_closed
            non_negative_argument: abs_position >= 0

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Go to first position.
            -- (from FILE)
        require -- from  TRAVERSABLE
            True
        require else -- from FILE
            file_opened: not is_closed

feature -- Element change

    add_permission (who, what: STRING)
            -- Add read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    append (f: like Current)
            -- Append a copy of the contents of f.
            -- (from FILE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        require else -- from FILE
            target_is_closed: is_closed
            source_is_closed: f.is_closed
        ensure -- from SEQUENCE
            new_count: count >= old count
        ensure then -- from FILE
            new_count: count = old count + f.count
            files_closed: f.is_closed and is_closed

    basic_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable within current system only.
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    change_date: INTEGER
            -- Time stamp of last change.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_group (new_group_id: INTEGER)
            -- Change group of file to new_group_id found in
            -- system password file.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_mode (mask: INTEGER)
            -- Replace mode by mask.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    change_name (new_name: STRING)
            -- Change file name to new_name
            -- (from FILE)
        require -- from FILE
            new_name_not_void: new_name /= void
            file_exists: exists
        ensure -- from FILE
            name_changed: name.is_equal (new_name)

    change_owner (new_owner_id: INTEGER)
            -- Change owner of file to new_owner_id found in
            -- system password file. On some systems this
            -- requires super-user privileges.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    extend (v: CHARACTER)
            -- Include v at end.
            -- (from FILE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [CHARACTER])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    flush
            -- Flush buffered data to disk.
            -- Note that there is no guarantee that the operating
            -- system will physically write the data to the disk.
            -- At least it will end up in the buffer cache,
            -- making the data visible to other processes.
            -- (from FILE)
        require -- from FILE
            is_open: not is_closed

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    general_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for same platform
            -- (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    independent_store (object: ANY)
            -- Produce an external representation of the
            -- entire object structure reachable from object.
            -- Retrievable from other systems for the same or other
            -- platform (machine architecture).
            -- (from FILE)
        require -- from IO_MEDIUM
            object_not_void: object /= void
            exists: exists
            is_open_write: is_open_write
            support_storable: support_storable

    link (fn: STRING)
            -- Link current file to fn.
            -- fn must not already exist.
            -- (from FILE)
        require -- from FILE
            file_exists: exists

    new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of put_new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from SEQUENCE
            new_count: count = old count + 1

    put_character (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of putchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_new_line
            -- Write a new line character at current position.
            -- Was declared in FILE as synonym of new_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_string (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of putstring.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    putchar (c: CHARACTER)
            -- Write c at current position.
            -- Was declared in FILE as synonym of put_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putstring (s: STRING)
            -- Write s at current position.
            -- Was declared in FILE as synonym of put_string.
            -- (from FILE)
        require -- from IO_MEDIUM
            extendible: extendible
            non_void: s /= void

    remove_permission (who, what: STRING)
            -- Remove read, write, execute or setuid permission
            -- for who ('u', 'g' or 'o') to what.
            -- (from FILE)
        require -- from FILE
            who_is_not_void: who /= void
            what_is_not_void: what /= void
            file_descriptor_exists: exists

    set_access (time: INTEGER)
            -- Stamp with time (access only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            acess_date_updated: access_date = time
            date_unchanged: date = old date

    set_date (time: INTEGER)
            -- Stamp with time (modification time only).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            access_date_unchanged: access_date = old access_date
            date_updated: date = time

    stamp (time: INTEGER)
            -- Stamp with time (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_updated: date = time

    touch
            -- Update time stamp (for both access and modification).
            -- (from FILE)
        require -- from FILE
            file_exists: exists
        ensure -- from FILE
            date_changed: date /= old date

feature -- Removal

    delete
            -- Remove link with physical file.
            -- File does not physically disappear from the disk
            -- until no more processes reference it.
            -- I/O operations on it are still possible.
            -- A directory must be empty to be deleted.
            -- (from FILE)
        require -- from FILE
            exists: exists

    dispose
            -- Ensure this medium is closed when garbage collected.
            -- (from IO_MEDIUM)

    prune_all (v: like item)
            -- Remove all occurrences of v; go off.
            -- (from SEQUENCE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    reset (fn: STRING)
            -- Change file name to fn and reset
            -- file descriptor and all information.
            -- (from FILE)
        require -- from FILE
            valid_file_name: fn /= void
        ensure -- from FILE
            file_renamed: name = fn
            file_closed: is_closed

    wipe_out
            -- Remove all items.
            -- (from FILE)
        require -- from COLLECTION
            prunable
        require else -- from FILE
            is_closed: is_closed
        ensure -- from COLLECTION
            wiped_out: is_empty

feature -- Conversion

    linear_representation: LINEAR [CHARACTER]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Obsolete

    lastchar: CHARACTER
            -- Last character read by read_character
            -- (from IO_MEDIUM)

    lastdouble: DOUBLE
            -- Last double read by read_double
            -- (from IO_MEDIUM)

    lastint: INTEGER
            -- Last integer read by read_integer
            -- (from IO_MEDIUM)

    lastreal: REAL
            -- Last real read by read_real
            -- (from IO_MEDIUM)

    laststring: STRING
            -- Last string read
            -- (from IO_MEDIUM)

feature -- Convenience

    copy_to (file: like Current)
            -- Copy content of current from current cursor
            -- position to end of file into file from
            -- current cursor position of file.
            -- (from FILE)
        require -- from FILE
            file_not_void: file /= void
            file_is_open_write: file.is_open_write
            current_is_open_read: is_open_read

feature -- Input

    read_character
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of readchar.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_double
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readdouble.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_integer
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readint.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_line
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of readline.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_real
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of readreal.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_stream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of readstream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    read_word
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of readword.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

    readchar
            -- Read a new character.
            -- Make result available in last_character.
            -- Was declared in FILE as synonym of read_character.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readdouble
            -- Read the ASCII representation of a new double
            -- from file. Make result available in last_double.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_double.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readint
            -- Read the ASCII representation of a new integer
            -- from file. Make result available in last_integer.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_integer.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readline
            -- Read a string until new line or end of file.
            -- Make result available in last_string.
            -- New line will be consumed but not part of last_string.
            -- Was declared in FILE as synonym of read_line.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readreal
            -- Read the ASCII representation of a new real
            -- from file. Make result available in last_real.
            -- Was declared in PLAIN_TEXT_FILE as synonym of read_real.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readstream (nb_char: INTEGER)
            -- Read a string of at most nb_char bound characters
            -- or until end of file.
            -- Make result available in last_string.
            -- Was declared in FILE as synonym of read_stream.
            -- (from FILE)
        require -- from IO_MEDIUM
            is_readable: readable
        require else -- from FILE
            is_readable: file_readable

    readword
            -- Read a string, excluding white space and stripping
            -- leading white space.
            -- Make result available in last_string.
            -- White space characters are: blank, new_line, tab,
            -- vertical tab, formfeed, end of file.
            -- Was declared in FILE as synonym of read_word.
            -- (from FILE)
        require -- from FILE
            is_readable: file_readable

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [CHARACTER]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [CHARACTER]]; test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [CHARACTER], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

feature -- Output

    put_boolean (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putbool.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_double (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putdouble.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_integer (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putint.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    put_real (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of putreal.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putbool (b: BOOLEAN)
            -- Write ASCII value of b at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_boolean.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putdouble (d: DOUBLE)
            -- Write ASCII value d at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_double.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putint (i: INTEGER)
            -- Write ASCII value of i at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_integer.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

    putreal (r: REAL)
            -- Write ASCII value of r at current position.
            -- Was declared in PLAIN_TEXT_FILE as synonym of put_real.
            -- (from PLAIN_TEXT_FILE)
        require -- from IO_MEDIUM
            extendible: extendible

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from PLAIN_TEXT_FILE
    plain_text: is_plain_text
        -- from FILE
    valid_mode: closed_file <= mode and mode <= append_read_file
    name_exists: name /= void
    name_not_empty: not name.is_empty
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off

end -- class STDOUT


cluster web.table

Cluster
    web.table

Supercluster
    web

Classes
    HTML_TABLE
    HTML_TABLE_CONSTANTS


HTML_TABLE_CONSTANTS Chart

class
    HTML_TABLE_CONSTANTS

General
    cluster: web.table

Ancestors
    ANY

Queries
    Align: STRING
    Background: STRING
    Bgcolor: STRING
    Border: STRING
    Bordercolor: STRING
    Bordercolordark: STRING
    Bordercolorlight: STRING
    Bottom: STRING
    Caption_end: STRING
    Caption_start: STRING
    Center: STRING
    Col_end: STRING
    Col_start: STRING
    Colspan: STRING
    Left: STRING
    Newline: STRING
    Nowrap: STRING
    Right: STRING
    Row_end: STRING
    Row_start: STRING
    Rowspan: STRING
    Table_end: STRING
    Table_start: STRING
    Tag_end: STRING
    Tag_start: STRING
    Top: STRING
    Valign: STRING
    Width: STRING


HTML_TABLE_CONSTANTS Flat contracts

class interface
    HTML_TABLE_CONSTANTS

feature

    Align: STRING is " ALIGN="

    Background: STRING is " BACKGROUND="

    Bgcolor: STRING is " BGCOLOR="

    Border: STRING is " BORDER="

    Bordercolor: STRING is " BORDERCOLOR="

    Bordercolordark: STRING is " BORDERCOLORDARK="

    Bordercolorlight: STRING is " BORDERCOLORLIGHT="

    Bottom: STRING is "BOTTOM"

    Caption_end: STRING is "</CAPTION>"

    Caption_start: STRING is "<CAPTION"

    Center: STRING is "CENTER"

    Col_end: STRING is "</TD>"

    Col_start: STRING is "<TD"

    Colspan: STRING is " COLSPAN="

    Left: STRING is "LEFT"

    Newline: STRING is ""

    Nowrap: STRING is " NOWRAP"

    Right: STRING is "RIGHT"

    Row_end: STRING is "</TR>"

    Row_start: STRING is "<TR"

    Rowspan: STRING is " ROWSPAN="

    Table_end: STRING is "</TABLE>"

    Table_start: STRING is "<TABLE"

    Tag_end: STRING is ">"

    Tag_start: STRING is "<"

    Top: STRING is "TOP"

    Valign: STRING is " VALIGN="

    Width: STRING is " WIDTH="

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HTML_TABLE_CONSTANTS


HTML_TABLE Chart

class
    HTML_TABLE

General
    cluster: web.table
    create: make

Ancestors
    ARRAY2 [G]
    HTML_TABLE_CONSTANTS

Queries
    infix "@" (i: INTEGER): STRING
    additional_space: INTEGER
    Align: STRING
    all_default: BOOLEAN
    area: SPECIAL [STRING]
    attribute_out (an_attribute, its_value: STRING): STRING
    attributes_out: STRING
    Background: STRING
    Bgcolor: STRING
    body_out: STRING
    Border: STRING
    border_value: INTEGER
    Bordercolor: STRING
    Bordercolordark: STRING
    Bordercolorlight: STRING
    Bottom: STRING
    capacity: INTEGER
    caption: STRING
    caption_attributes_out: STRING
    Caption_end: STRING
    caption_out: STRING
    Caption_start: STRING
    Center: STRING
    changeable_comparison_criterion: BOOLEAN
    col_attributes_out (row, col: INTEGER): STRING
    Col_end: STRING
    Col_start: STRING
    col_value: INTEGER
    Colspan: STRING
    count: INTEGER
    entry (i: INTEGER): STRING
    extendible: BOOLEAN
    full: BOOLEAN
    Growth_percentage: INTEGER
    has (v: STRING): BOOLEAN
    height: INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] HTML_TABLE): BOOLEAN
    is_inserted (v: STRING): BOOLEAN
    item (row, column: INTEGER): STRING
    Left: STRING
    linear_representation: LINEAR [STRING]
    lower: INTEGER
    Minimal_increase: INTEGER
    Newline: STRING
    Nowrap: STRING
    object_comparison: BOOLEAN
    occurrences (v: STRING): INTEGER
    out: STRING
    prunable: BOOLEAN
    resizable: BOOLEAN
    Right: STRING
    row_attributes_out (row, col: INTEGER): STRING
    Row_end: STRING
    Row_start: STRING
    row_value: INTEGER
    Rowspan: STRING
    same_items (other: [like Current] HTML_TABLE): BOOLEAN
    subarray (start_pos, end_pos: INTEGER): [like Current] HTML_TABLE
    Table_end: STRING
    Table_start: STRING
    Table_width: STRING
    Tag_end: STRING
    Tag_start: STRING
    to_c: ANY
    Top: STRING
    upper: INTEGER
    valid_index (i: INTEGER): BOOLEAN
    valid_index_set: BOOLEAN
    Valign: STRING
    width: INTEGER

Commands
    add_col (a_row: ARRAY [STRING])
    add_row (a_row: ARRAY [STRING])
    array2_make (nb_rows, nb_columns: INTEGER)
    automatic_grow
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] HTML_TABLE)
    discard_items
    enter (v: [like item] STRING; i: INTEGER)
    fill (other: CONTAINER [STRING])
    force (v: [like item] STRING; row, column: INTEGER)
    grow (i: INTEGER)
    initialize (v: STRING)
    make (nb_row, nb_col: INTEGER)
    make_from_array (a: ARRAY [STRING])
    prune_all (v: STRING)
    put (v: [like item] STRING; row, column: INTEGER)
    put_col (a_row: ARRAY [STRING])
    put_row (a_row: ARRAY [STRING])
    resize (nb_rows, nb_columns: INTEGER)
    set_border (n: INTEGER)
    set_caption (s: STRING)
    set_caption_to_bottom
    set_caption_to_top
    set_col (n: INTEGER)
    set_row (n: INTEGER)
    subcopy (other: [like Current] HTML_TABLE; start_pos, end_pos, index_pos: INTEGER)
    wipe_out


HTML_TABLE Flat contracts

class interface
    HTML_TABLE

create

    make (nb_row, nb_col: INTEGER)
            -- Create a table

feature -- Initialization

    initialize (v: STRING)
            -- Make each entry have value v.
            -- (from ARRAY2)

    array2_make (nb_rows, nb_columns: INTEGER)
            -- Create a two dimensional array which has nb_rows
            -- rows and nb_columns columns,
            -- with lower bounds starting at 1.
            -- (from ARRAY2)
        require -- from ARRAY2
            not_flat: nb_rows > 0
            not_thin: nb_columns > 0
        ensure -- from ARRAY2
            new_count: count = height * width

    make_from_array (a: ARRAY [STRING])
            -- Initialize from the items of a.
            -- (Useful in proper descendants of class ARRAY,
            -- to initialize an array-like object from a manifest array.)
            -- (from ARRAY)
        require -- from ARRAY
            array_exists: a /= void

feature -- Access

    entry (i: INTEGER): STRING
            -- Entry at index i, if in index interval
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    has (v: STRING): BOOLEAN
            -- Does v appear in array?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from ARRAY)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (row, column: INTEGER): STRING
            -- Entry at coordinates (row, column)
            -- (from ARRAY2)
        require -- from ARRAY2
            valid_row: (1 <= row) and (row <= height)
            valid_column: (1 <= column) and (column <= width)

    infix "@" (i: INTEGER): STRING
            -- Entry at index i, if in index interval
            -- Was declared in ARRAY as synonym of item.
            -- (from ARRAY)
        require -- from TABLE
            valid_key: valid_index (k)

feature  -- Access

    area: SPECIAL [STRING]
            -- Special data zone
            -- (from TO_SPECIAL)

feature -- Measurement

    additional_space: INTEGER
            -- Proposed number of additional items
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            at_least_one: Result >= 1

    capacity: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of count.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    count: INTEGER
            -- Number of available indices
            -- Was declared in ARRAY as synonym of capacity.
            -- (from ARRAY)
        ensure then -- from ARRAY
            consistent_with_bounds: Result = upper - lower + 1

    Growth_percentage: INTEGER is 50
            -- Percentage by which structure will grow automatically
            -- (from RESIZABLE)

    height: INTEGER
            -- Number of rows
            -- (from ARRAY2)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from ARRAY)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from ARRAY
            same_count: Result.count = count
            same_bounds: ((Result.lower = lower) and (Result.upper = upper))

    lower: INTEGER
            -- Minimum index
            -- (from ARRAY)

    Minimal_increase: INTEGER is 5
            -- Minimal number of additional items
            -- (from RESIZABLE)

    occurrences (v: STRING): INTEGER
            -- Number of times v appears in structure
            -- (from ARRAY)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    upper: INTEGER
            -- Maximum index
            -- (from ARRAY)

    width: INTEGER
            -- Number of columns
            -- (from ARRAY2)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is array made of the same items as other?
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    all_default: BOOLEAN
            -- Are all items set to default values?
            -- (from ARRAY)
        ensure -- from ARRAY
            definition: Result = (count = 0 or else ((array_item (upper) = void or else array_item (upper) = array_item (upper).default) and subarray (lower, upper - 1).all_default))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    extendible: BOOLEAN
            -- May items be added?
            -- (Answer: no, although array may be resized.)
            -- (from ARRAY)

    full: BOOLEAN
            -- Is structure filled to capacity? (Answer: yes)
            -- (from ARRAY)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: STRING): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    prunable: BOOLEAN
            -- May items be removed? (Answer: no.)
            -- (from ARRAY)

    resizable: BOOLEAN
            -- May capacity be changed? (Answer: yes.)
            -- (from RESIZABLE)

    same_items (other: like Current): BOOLEAN
            -- Do other and Current have same items?
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
        ensure -- from ARRAY
            definition: Result = ((count = other.count) and then (count = 0 or else (array_item (upper) = other.array_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within the bounds of the array?
            -- (from ARRAY)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))

    valid_index_set: BOOLEAN
            -- (from ARRAY)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Element change

    enter (v: like array_item; i: INTEGER)
            -- Replace i-th entry, if in index interval, by v.
            -- (from ARRAY)
        require -- from ARRAY
            valid_key: valid_index (i)

    fill (other: CONTAINER [STRING])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
            -- Resize if necessary.
            -- (from ARRAY2)
        require -- from ARRAY2
            row_large_enough: 1 <= row
            column_large_enough: 1 <= column

    put (v: like item; row, column: INTEGER)
            -- Assign item v at coordinates (row, column).
            -- (from ARRAY2)
        require -- from ARRAY2
            valid_row: 1 <= row and row <= height
            valid_column: 1 <= column and column <= width

    subcopy (other: like Current; start_pos, end_pos, index_pos: INTEGER)
            -- Copy items of other within bounds start_pos and end_pos
            -- to current array starting at index index_pos.
            -- (from ARRAY)
        require -- from ARRAY
            other_not_void: other /= void
            valid_start_pos: other.valid_index (start_pos)
            valid_end_pos: other.valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
            valid_index_pos: valid_index (index_pos)
            enough_space: (upper - index_pos) >= (end_pos - start_pos)

feature -- Removal

    clear_all
            -- Reset all items to default values.
            -- (from ARRAY)
        ensure -- from ARRAY
            stable_lower: lower = old lower
            stable_upper: upper = old upper
            default_items: all_default

    discard_items
            -- Reset all items to default values with reallocation.
            -- (from ARRAY)
        ensure -- from ARRAY
            default_items: all_default

    prune_all (v: STRING)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from COLLECTION)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)

    wipe_out
            -- Remove all items.
            -- (from ARRAY2)

feature -- Resizing

    automatic_grow
            -- Change the capacity to accommodate at least
            -- Growth_percentage more items.
            -- (from RESIZABLE)
        ensure -- from RESIZABLE
            increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100

    grow (i: INTEGER)
            -- Change the capacity to at least i.
            -- (from ARRAY)
        ensure -- from RESIZABLE
            new_capacity: capacity >= i

    resize (nb_rows, nb_columns: INTEGER)
            -- Rearrange array so that it can accommodate
            -- nb_rows rows and nb_columns columns,
            -- without losing any previously
            -- entered items, nor changing their coordinates;
            -- do nothing if not possible.
            -- (from ARRAY2)
        require -- from ARRAY2
            valid_row: nb_rows >= 1
            valid_column: nb_columns >= 1

feature  -- Conversion

    to_c: ANY
            -- Address of actual sequence of values,
            -- for passing to external (non-Eiffel) routines.
            -- (from ARRAY)

feature -- Conversion

    linear_representation: LINEAR [STRING]
            -- Representation as a linear structure
            -- (from ARRAY)

feature -- Duplication

    copy (other: like Current)
            -- Reinitialize by copying all the items of other.
            -- (This is also used by clone.)
            -- (from ARRAY)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)
        ensure then -- from ARRAY
            equal_areas: area.is_equal (other.area)

    subarray (start_pos, end_pos: INTEGER): like Current
            -- Array made of items of current array within
            -- bounds start_pos and end_pos.
            -- (from ARRAY)
        require -- from ARRAY
            valid_start_pos: valid_index (start_pos)
            valid_end_pos: valid_index (end_pos)
            valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
        ensure -- from ARRAY
            lower: Result.lower = start_pos
            upper: Result.upper = end_pos

feature

    Align: STRING is " ALIGN="
            -- (from HTML_TABLE_CONSTANTS)

    Background: STRING is " BACKGROUND="
            -- (from HTML_TABLE_CONSTANTS)

    Bgcolor: STRING is " BGCOLOR="
            -- (from HTML_TABLE_CONSTANTS)

    Border: STRING is " BORDER="
            -- (from HTML_TABLE_CONSTANTS)

    Bordercolor: STRING is " BORDERCOLOR="
            -- (from HTML_TABLE_CONSTANTS)

    Bordercolordark: STRING is " BORDERCOLORDARK="
            -- (from HTML_TABLE_CONSTANTS)

    Bordercolorlight: STRING is " BORDERCOLORLIGHT="
            -- (from HTML_TABLE_CONSTANTS)

    Bottom: STRING is "BOTTOM"
            -- (from HTML_TABLE_CONSTANTS)

    Caption_end: STRING is "</CAPTION>"
            -- (from HTML_TABLE_CONSTANTS)

    Caption_start: STRING is "<CAPTION"
            -- (from HTML_TABLE_CONSTANTS)

    Center: STRING is "CENTER"
            -- (from HTML_TABLE_CONSTANTS)

    Col_end: STRING is "</TD>"
            -- (from HTML_TABLE_CONSTANTS)

    Col_start: STRING is "<TD"
            -- (from HTML_TABLE_CONSTANTS)

    Colspan: STRING is " COLSPAN="
            -- (from HTML_TABLE_CONSTANTS)

    Left: STRING is "LEFT"
            -- (from HTML_TABLE_CONSTANTS)

    make (nb_row, nb_col: INTEGER)
            -- Create a table

    Newline: STRING is ""
            -- (from HTML_TABLE_CONSTANTS)

    Nowrap: STRING is " NOWRAP"
            -- (from HTML_TABLE_CONSTANTS)

    Right: STRING is "RIGHT"
            -- (from HTML_TABLE_CONSTANTS)

    Row_end: STRING is "</TR>"
            -- (from HTML_TABLE_CONSTANTS)

    Row_start: STRING is "<TR"
            -- (from HTML_TABLE_CONSTANTS)

    Rowspan: STRING is " ROWSPAN="
            -- (from HTML_TABLE_CONSTANTS)

    Table_end: STRING is "</TABLE>"
            -- (from HTML_TABLE_CONSTANTS)

    Table_start: STRING is "<TABLE"
            -- (from HTML_TABLE_CONSTANTS)

    Tag_end: STRING is ">"
            -- (from HTML_TABLE_CONSTANTS)

    Tag_start: STRING is "<"
            -- (from HTML_TABLE_CONSTANTS)

    Top: STRING is "TOP"
            -- (from HTML_TABLE_CONSTANTS)

    Valign: STRING is " VALIGN="
            -- (from HTML_TABLE_CONSTANTS)

    Table_width: STRING is " WIDTH="
            -- (from HTML_TABLE_CONSTANTS)

feature -- Attributes

    border_value: INTEGER

    caption: STRING

    col_value: INTEGER

    row_value: INTEGER

feature -- Inputs in the table

    add_col (a_row: ARRAY [STRING])
            -- Add a col in the table and update the current col
        require
            a_row /= void
            col_value <= width

    add_row (a_row: ARRAY [STRING])
            -- Add a row in the table and update the current row
        require
            a_row /= void
            row_value <= height

    put_col (a_row: ARRAY [STRING])
            -- Put a col (of STRING) in the table in the current col
        require
            a_row /= void
            col_value <= width

    put_row (a_row: ARRAY [STRING])
            -- Put a row (of STRING) in the table in the current row
        require
            a_row /= void
            row_value <= height

feature -- Routines out: provide STRING representations

    attribute_out (an_attribute, its_value: STRING): STRING
            -- String representation for the pair 'an_attribute' and 'its_value'

    attributes_out: STRING
            -- String representation for the attributes
            -- of the table

    body_out: STRING

    caption_attributes_out: STRING
            -- String representation for the attributes
            -- of the caption

    caption_out: STRING
            -- String representation for the caption

    col_attributes_out (row, col: INTEGER): STRING
            -- String representation for the attributes
            -- of the cell '(row, col)'
            -- Modify 'col_value'
        require
            row <= height
            col <= width

    out: STRING
            -- Provide a STRING representation for the current table

    row_attributes_out (row, col: INTEGER): STRING
            -- String representation for the attributes
            -- of the row 'row'
            -- Modify 'row_value'
        require
            row <= height

feature -- Set attributes

    set_border (n: INTEGER)
            -- Set the attribute 'BORDER' of the table to 'n'

    set_caption (s: STRING)
            -- Set the caption element

    set_caption_to_bottom
            -- Set the caption to be displayed on the bottom of the table

    set_caption_to_top
            -- Set the caption to be displayed on the top of the table

    set_col (n: INTEGER)
            -- Set the current working value for col to 'n'

    set_row (n: INTEGER)
            -- Set the current working value for row to 'n'

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from ARRAY2
    items_number: count = width * height
        -- from ARRAY
    area_exists: area /= void
    consistent_size: capacity = upper - lower + 1
    non_negative_count: count >= 0
    index_set_has_same_count: valid_index_set
        -- from RESIZABLE
    increase_by_at_least_one: minimal_increase >= 1
        -- from BOUNDED
    valid_count: count <= capacity
    full_definition: full = (count = capacity)
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from INDEXABLE
    index_set_not_void: index_set /= void

end -- class HTML_TABLE


EiffelWeb Sample

The basic sample will get you started on the development of forms processing in Eiffel.


EiffelWeb Sample

A Basic EiffelWeb Sample

This sample shows how to retrieve and display information from a basic form on a web page.

Note: This sample requires a web server supporting CGI in order to be run. Both the Internet Information Services web server from Microsoft and the GNU Apache server may be used.

Compiling

To compile the example:

  • Launch EiffelBench.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\web\basic\.
  • Choose Ace.mswin.ace on Windows platforms or Ace.unix.ace on Unix platforms.
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Installing

The workbench version of the example (i.e. the version compiled either by melting or freezing) relies on the file web_demo.melted to execute properly. However the process is launched by the web server which means that this file will not be in the path of the application. It is possible to set a registry entry that will tell the Eiffel runtime where to find this file. The sample includes the file web.reg that you can edit by replacing the line:

"MELT_PATH"="c:\\eiffel50\\examples\\web\\basic\\eifgen\\w_code"

with the path to the W_Code folder where you have compiled the example (the W_Code folder is located underneath the Eifgen folder). Once you have edited the file, simply double click it to register the changes in the registry (click Yes when prompted).

You should then copy the file web_demo.exe in the cgi_bin directory of your web server and the file sample.html in a directory on the web server.

Running

To run the example, access the page sample.html that you copied on the web server with a web browser (typically http://localhost/sample.html). Fill in the text field with a username and click Submit. You should see a page displaying the name you jsut entered. Although not earth-shattering, this sample shows the basis for building more complex forms processing in Eiffel.

Under the Hood

This basic sample has just one class SAMPLE which inherits from CGI_INTERFACE. SAMPLE implements execute which retrieves the name entered in the form and creates a new HTML page with it.

See the reference for the class interfaces.


cluster root_cluster

Cluster
    root_cluster

Classes
    SAMPLE


SAMPLE Flat contracts

indexing
    description: "Class which returns the name the user entered, in upper case."

class interface
    SAMPLE

create

    make
            -- Initiate input data parsing and process information.
            -- (from CGI_INTERFACE)

feature -- Initialization

    make
            -- Initiate input data parsing and process information.
            -- (from CGI_INTERFACE)

feature -- Access

    button_value (field_name: STRING; overriding_value: STRING): BOOLEAN
            -- Is Button relative to 'field_name' selected ?
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)

    Debug_mode: BOOLEAN is True
            -- Should exception trace be displayed in case a crash occurs?

    Document_moved_status: INTEGER is 301
            -- (from CGI_COMMON_STATUS_TYPES)

    Forbidden_status: INTEGER is 403
            -- (from CGI_COMMON_STATUS_TYPES)

    Internal_server_error_status: INTEGER is 500
            -- (from CGI_COMMON_STATUS_TYPES)

    menu_values (field_name: STRING): LINKED_LIST [STRING]
            -- Selected values for a list, whose name
            -- is 'field_name'.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            value_exists: Result /= void

    No_response_status: INTEGER is 204
            -- (from CGI_COMMON_STATUS_TYPES)

    Not_found_status: INTEGER is 404
            -- (from CGI_COMMON_STATUS_TYPES)

    Not_implemented_status: INTEGER is 501
            -- (from CGI_COMMON_STATUS_TYPES)

    output: STDOUT
            -- Shared standard output.
            -- (from CGI_IN_AND_OUT)

    reponse_header: CGI_RESPONSE_HEADER
            -- HTTP response header.

    response_header: CGI_RESPONSE_HEADER
            -- (from CGI_IN_AND_OUT)

    return_message: HTML_PAGE
            -- Message which is sent back to the browser.

    stdin: STDIN
            -- Shared standard input
            -- (from CGI_IN_AND_OUT)

    Success_status: INTEGER is 200
            -- (from CGI_COMMON_STATUS_TYPES)

    text_field_value (field_name: STRING): STRING
            -- First (unique?) value for a text field.
            -- Applies for a password and a text area too.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            value_exists: Result /= void

    Unauthorized_status: INTEGER is 401
            -- (from CGI_COMMON_STATUS_TYPES)

feature -- Advanced Access

    fields: ARRAY [STRING]
            -- Names of fields in the form.
            -- (from CGI_FORMS)

    value_count (field_name: STRING): INTEGER
            -- Number of values for a field.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            valid_count: Result >= 0

    value_list (field_name: STRING): LINKED_LIST [STRING]
            -- List of values for a field.
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            field_not_void: field_name /= void
            field_exists: field_defined (field_name)
        ensure -- from CGI_FORMS
            valid_count: Result.count = value_count (field_name)

feature -- Basic Operations

    execute
            -- Perform form entries processing, and send back the answer
            -- to the browser.

    handle_exception
            -- General exception hanlding.
            -- (from CGI_ERROR_HANDLING)

    raise_error (msg: STRING)
            -- Raise an error
            -- (from CGI_ERROR_HANDLING)
        require -- from CGI_ERROR_HANDLING
            message_exists: msg /= void
        ensure -- from CGI_ERROR_HANDLING
            exists: raised_error /= void

feature -- Cookies

    cookies: HASH_TABLE [STRING, STRING]
            -- Cookie Information relative to data
            -- (from CGI_ENVIRONMENT)

feature -- Environment variable setting

    set_environment_variable (variable, val: STRING)
            -- Set environment variable variable to val.
            -- (from CGI_ENVIRONMENT)
        require -- from CGI_ENVIRONMENT
            valid_variable: variable /= void and then variable.count > 0
            valid_value: val /= void

feature -- Headerline based environment variables

    http_accept: STRING
            -- MIME types which the client will accept.
            -- (from CGI_ENVIRONMENT)

    http_user_agent: STRING
            -- Browser the client is using to send the request.
            -- (from CGI_ENVIRONMENT)

feature -- Miscellanous

    set_environment
            -- Set environment variable to user value.
            -- (from CGI_INTERFACE)

feature -- Not request-specific environment variables

    gateway_interface: STRING
            -- Revision of the CGI specification to which this server complies.
            -- (from CGI_ENVIRONMENT)

    server_name: STRING
            -- Server's hostname, DNS alias, or IP address.
            -- (from CGI_ENVIRONMENT)

    server_software: STRING
            -- Name and version of information server answering the request.
            -- (from CGI_ENVIRONMENT)

feature -- Report

    field_defined (field_name: STRING): BOOLEAN
            -- Is field field_name defined?
            -- (from CGI_FORMS)
        require -- from CGI_FORMS
            filed_name_not_void: field_name /= void

feature -- Request specific environment variables

    auth_type: STRING
            -- Protocol-specific authentication method used to validate user.
            -- (from CGI_ENVIRONMENT)

    content_length: STRING
            -- Length of the said content as given by the client.
            -- (from CGI_ENVIRONMENT)

    content_type: STRING
            -- Content type of data.
            -- (from CGI_ENVIRONMENT)

    path_info: STRING
            -- Extra path information, as given by the client.
            -- (from CGI_ENVIRONMENT)

    path_translated: STRING
            -- Translated version of PATH_INFO provided by server.
            -- (from CGI_ENVIRONMENT)

    query_string: STRING
            -- Information which follows ? in URL referencing CGI program.
            -- (from CGI_ENVIRONMENT)

    remote_addr: STRING
            -- IP address of the remote host making the request.
            -- (from CGI_ENVIRONMENT)

    remote_host: STRING
            -- Hostname making the request.
            -- (from CGI_ENVIRONMENT)

    remote_ident: STRING
            -- User name retrieved from server if RFC 931 supported.
            -- (from CGI_ENVIRONMENT)

    remote_user: STRING
            -- Username, if applicable.
            -- (from CGI_ENVIRONMENT)

    request_method: STRING
            -- Method with which the request was made.
            -- (from CGI_ENVIRONMENT)

    script_name: STRING
            -- Virtual path to the script being executed.
            -- (from CGI_ENVIRONMENT)

    server_port: STRING
            -- Port number to which request was sent.
            -- (from CGI_ENVIRONMENT)

    server_protocol: STRING
            -- Name and revision of information protocol of this request.
            -- (from CGI_ENVIRONMENT)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class SAMPLE


SAMPLE Chart

class
    SAMPLE

General
    cluster: root_cluster
    description: "Class which returns the name the user entered, in upper case."
    create: make

Ancestors
    CGI_COMMON_STATUS_TYPES
    CGI_INTERFACE

Queries
    Auth_type: STRING
    button_value (field_name, overriding_value: STRING): BOOLEAN
    Content_length: STRING
    Content_type: STRING
    Cookies: HASH_TABLE [STRING, STRING]
    Debug_mode: BOOLEAN
    Document_moved_status: INTEGER
    field_defined (field_name: STRING): BOOLEAN
    Fields: ARRAY [STRING]
    Forbidden_status: INTEGER
    Gateway_interface: STRING
    Http_accept: STRING
    Http_user_agent: STRING
    Internal_server_error_status: INTEGER
    menu_values (field_name: STRING): LINKED_LIST [STRING]
    No_response_status: INTEGER
    Not_found_status: INTEGER
    Not_implemented_status: INTEGER
    Output: STDOUT
    Path_info: STRING
    Path_translated: STRING
    Query_string: STRING
    Remote_addr: STRING
    Remote_host: STRING
    Remote_ident: STRING
    Remote_user: STRING
    reponse_header: CGI_RESPONSE_HEADER
    Request_method: STRING
    Response_header: CGI_RESPONSE_HEADER
    return_message: HTML_PAGE
    Script_name: STRING
    Server_name: STRING
    Server_port: STRING
    Server_protocol: STRING
    Server_software: STRING
    Stdin: STDIN
    Success_status: INTEGER
    text_field_value (field_name: STRING): STRING
    Unauthorized_status: INTEGER
    value_count (field_name: STRING): INTEGER
    value_list (field_name: STRING): LINKED_LIST [STRING]

Commands
    execute
    handle_exception
    make
    raise_error (msg: STRING)
    set_environment
    set_environment_variable (variable, val: STRING)


WEL

Type: Library
Platform: Windows
Version: 5.0

See:

  • Content
  • Samples
  • Reference


WEL Introduction

Overview

WEL is an encapsulation of the Win32 Application Programming Interface (API), and provides users with a powerful means of creating Win32 Applications.

Components

The WEL library includes the following clusters:

  • A Windows cluster containing classes representing available windows types.
  • A Controls cluster containing classes representing available controls.
  • A Stddlgs cluster containing classes representing standard Win32 dialogs.
  • A Consts cluster which contains constants used by WEL
  • A Gdi cluster which contains classes allowing access to WIN32 Graphics Device Interfaces.
  • A Gdistock cluster which contains standard Graphic Device Interfaces used by WEL.
  • A Messages cluster which contains classes encapsulating windows messages.
  • A Shared cluster which contains classes encapsulating system wide shared .
  • A Structs cluster which contains classes for data structures required by Win32
  • A Support cluster which contains many supporting classes


WEL Introduction

WEL Library Content

WEL is an encapsulation of the Win32 Application Programming Interface (API), and provides users with a powerful means of creating Win32 Applications.

Getting started with WEL

If you are new to WEL, then the best place to begin is the tutorial which is a series of samples demonstrating the development of a simple WEL system.

Also take a look at WEL common concepts for details of some common concepts used in WEL programming.

Components

The WEL library includes the following clusters:

  • A Windows cluster containing classes representing available windows types.
  • A Controls cluster containing classes representing available controls.
  • A Stddlgs cluster containing classes representing standard Win32 dialogs.
  • A Consts cluster which contains constants used by WEL
  • A Gdi cluster which contains classes allowing access to WIN32 Graphics Device Interfaces.
  • A Gdistock cluster which contains standard Graphic Device Interfaces used by WEL.
  • A Messages cluster which contains classes encapsulating windows messages.
  • A Shared cluster which contains classes encapsulating system wide shared .
  • A Structs cluster which contains classes for data structures required by Win32
  • A Support cluster which contains many supporting classes

Samples

Wel ships with a large number of samples which can be found here.


WEL Concepts

WEL Common Concepts

Some useful WEL concepts are listed below:

  • Inheriting WEL_APPLICATION.
  • Redefining main_window.
  • Redefining init_application.
  • Common message hooks.


Common message hooks.

Each WEL library component implements a set of routines for processing the most common messages that a component receives. For example, looking at WEL_FRAME_WINDOW, you will see that there are many features which begin `on_'. Each of these features enable the user to know when a specific event has occured, and to perform the appropriate processing as a result of this event. Most of the time, you will only be interested in a small subset of these, necessary to your program. For example, below is the code for on_paint:

on_paint (paint_dc: WEL_PAINT_DC; invalid_rect: WEL_RECT) is
      --Draw a centered text
   do
   end

An on_paint message corresponds to the Wm_paint message generated by Windows whenever it needs to re-paint a window, and if you look at the feature, you can see that the arguments are a WEL_PAINT_DC and a WEL_RECT. which are relevent to this message. By redefining this feature (and others as required), your code will be able to respond appropriately to windows events.

Note. See step2 in the tutorial for a simple demonstration involving the re-definition of on_left_button_down.

For different messages received by a control, the arguments will differ (sometimes there are none), but those arguments will always be relevent to the message. For example, on_menu_command from WEL_COMPOSITE_WINDOW has an INTEGER as an argument, the value of which is a unique menu identifier.

Note. Not all windows events have a corresponding `on_' message hook defined in WEL. If you wish to process a Windows message that does not correspond to one of the available features, you will need to redefine process_message.


Inheriting WEL_APPLICATION.

For most WEL applications that you write, you will need to inherit WEL_APPLICATION.

Note. See step1 in the tutorial for a simple demonstration of how to do this


Redefining `init_application'.

WEL_APPLICATION. contains a feature `init_application' which does nothing by default, but is called before the application is started. This can be redefined to execute tasks that must be performed before the application is running. A common redefinition is to allow the loading of common dll's, see list_view sample for a demonstration of this technique.


Redefining main_window.

When you inherit WEL_APPLICATION, you will need to implement the deferred feature main_window as a once function. This will be the main window of your application, and can be any descendent of WEL_COMPOSITE_WINDOW.

Note. See step2 in the tutorial for a simple demonstration of how to do this.


Controls

WEL Controls

Overview

A Control is a window which provides a means of interacting with the application. For example, the WEL_EDIT control provides a user with the means of entering and modifying text. There are many common controls available within this cluster, each with a specific use. Click here to browse the controls cluster.

Note: Each control inherits from WEL_CONTROL which is a descendent of WEL_WINDOW This provides the control with a large number of general features (including full window functionality). Each control also provides its own feature set which give access to specific properties of that control.

Creating controls

Each type of control generally has its own creation procedure that is specific to the type of control. For example, WEL_SCROLL_BAR has two creation procedures; make_vertical and make_horizontal. Depending on which of these two creation procedures used, you will get a scroll bar aligned vertically or horizontally.

Control types

The following effective controls are available within this cluster:

  • WEL_BITMAP_BUTTON
  • WEL_CHECK_BOX
  • WEL_CHECK_BOX_3_STATE
  • WEL_DROP_DOWN_COMBO_BOX
  • WEL_DROP_DOWN_COMBO_BOX_EX
  • WEL_DROP_DOWN_LIST_COMBO_BOX
  • WEL_DROP_DOWN_LIST_COMBO_BOX_EX
  • WEL_FLAT_TOOL_BAR
  • WEL_GROUP_BOX
  • WEL_HEADER_CONTROL
  • WEL_IMAGE_LIST_TOOL_BAR
  • WEL_LIST_VIEW
  • WEL_MULTIPLE_LINE_EDIT
  • WEL_MULTIPLE_SELECTION_LIST_BOX
  • WEL_OWNER_DRAW_BUTTON
  • WEL_PROGRESS_BAR
  • WEL_PUSH_BUTTON
  • WEL_RADIO_BUTTON
  • WEL_REBAR
  • WEL_RICH_EDIT
  • WEL_SCROLL_BAR
  • WEL_SELECTABLE_BUTTON
  • WEL_SIMPLE_COMBO_BOX
  • WEL_SINGLE_LINE_EDIT
  • WEL_SINGLE_SELECTION_LIST_BOX
  • WEL_STATIC
  • WEL_STATIC_BITMAP
  • WEL_STATUS_WINDOW
  • WEL_TAB_CONTROL
  • WEL_TOOL_BAR
  • WEL_TOOLTIP
  • WEL_TRACK_BAR
  • WEL_TREE_VIEW
  • WEL_UP_DOWN_CONTROL

Click here to browse the controls cluster.


WEL_BITMAP_BUTTON


WEL_CHECK_BOX

A WEL_CHECK_BOX control can take two states, checked or unchecked.

Appearance

A WEL_CHECK_BOX

A checked WEL_CHECK_BOX

See Also
WEL_CHECK_BOX_3_STATE


WEL_CHECK_BOX_3_STATE

WEL_CHECK_BOX

A WEL_CHECK_BOX_3_STATE control can take three states, checked, indeterminate or unchecked.

Appearance

A WEL_CHECK_BOX_3_STATE

A checked WEL_CHECK_BOX_3_STATE

A indeterminate WEL_CHECK_BOX_3_STATE

See Also
WEL_CHECK_BOX


WEL_GROUP_BOX

A WEL_GROUP_BOX is used to enclose other controls, and certain controls such as a WEL_RADIO_BUTTON have special behaviour when parented in a WEL_GROUP_BOX.

Appearance


WEL_LIST_VIEW

A WEL_LIST_VIEW control is an encapsulation of the Windows List View control and provides several ways of displaying a collection of items. Each item can consist of a text and an icon. Certain styles allow additional information to be displayed in columns to the right of the icon and label.

Appearance

A WEL_LIST_VIEW with the Lvs_report style.

A WEL_LIST_VIEW with the Lvs_list style.

A WEL_LIST_VIEW with the Lvs_icon style.

A WEL_LIST_VIEW with the Lvs_smallicon style.


WEL_MULTIPLE_LINE_EDIT

A WEL_MULTIPLE_LINE_EDIT is used to display multiple lines of text. Using set_read_only, the text can be made non-editable.

Appearance


WEL_MULTIPLE_SELECTION_LIST_BOX

A WEL_MULTIPLE_SELECTION_LIST_BOX is a control used to display a list of STRING. Multiple items may be selected at once.

Appearance

See Also
WEL_SINGLE_SELECTION_LIST_BOX


WEL_OWNER_DRAW_BUTTON

A WEL_OWNER_DRAW_BUTTON is a control that the user can click to provide notification to the application, and behaves in a similar fashion to WEL_PUSH_BUTTON except that `on_paint' must be implemented to give the button the desired appearence.

Appearance

There is no sample appearence for this control.

See Also
WEL_PUSH_BUTTON


WEL_PROGRESS_BAR

A WEL_PROGRESS_BAR control is an encapsulation of the Win32 progress bar. It can be used to display the progress of a lengthy operation.

Note: By specifying the style Pbs_vertical, the progress bar will be displayed vertically.

Appearance

A WEL_PROGRESS_BAR.


WEL_PUSH_BUTTON

A WEL_PUSH_BUTTON is a control that the user can click to provide notification to the application.

Appearance


WEL_RADIO_BUTTON

A WEL_RADIO_BUTTON control can take two states, checked or unchecked. By placing more than one of these in a WEL_GROUP_BOX, they will become grouped, and only one may be checked at once.

Appearance

A WEL_RADIO_BUTTON

A checked WEL_RADIO_BUTTON


WEL_SCROLL_BAR

A WEL_SCROLL_BAR control is an encapsulation of the Windows scroll bar control and is often used to specify which portion of a large control that cannot be viewed completely, is currently visible.

Appearance

A WEL_SCROLL_BAR created with `make_horizontal'.

A WEL_SCROLL_BAR created with `make_vertical'.


WEL_SINGLE_LINE_EDIT

A WEL_SINGLE_LINE_EDIT is a control used to input a single line of text.

Appearance


WEL_SINGLE_SELECTION_LIST_BOX

A WEL_SINGLE_SELECTION_LIST_BOX is a control used to display a list of STRING. Only one item may be selected at once.

Appearance

See Also
WEL_MULTIPLE_SELECTION_LIST_BOX


WEL_TOOLTIP

A WEL_TOOLTIP is an encapsulation of the Win32 tooltip control, and controls pop-up windows which display text. Each tooltip may control multiple pop-up windows, which are added to the tooltip using add_tool.

Appearance


WEL_TRACK_BAR

A WEL_TRACK_BAR control has a sliding pointer and optional tick marks.

Appearance

A WEL_TRACK_BAR created with `make_horizontal'.

A WEL_TRACK_BAR created with `make_vertical'.


WEL_UP_DOWN_CONTROL

A WEL_UP_DOWN_CONTROL consists of a pair of arrows which are used to increment or decrement a value. Using set_buddy_window, a window of type WEL_WINDOW can be linked to this control, and is commonly used to display the current value.

Appearance


Stddlgs

Standard Dialogs

This cluster contains different standard dialogs provided by WEL as listed below:

  • WEL_CHOOSE_COLOR_DIALOG
  • WEL_CHOOSE_FOLDER_DIALOG
  • WEL_CHOOSE_FONT_DIALOG
  • WEL_OPEN_FILE_DIALOG
  • WEL_PRINT_DIALOG
  • WEL_SAVE_FILE_DIALOG

Click here to browse the stddlgs cluster.


WEL_CHOOSE_COLOR_DIALOG

The WEL_CHOOSE_COLOR_DIALOG is an encapsulation of the Win32 choose color dialog, and provides a means of selecting standard colors or creating custom colors.

Appearance

See Also
Standard dialogs


WEL_CHOOSE_FOLDER_DIALOG

The WEL_CHOOSE_FOLDER_DIALOG allows the directory structure to be viewed and a folder selected.

Appearance

See Also
Standard dialogs


WEL_CHOOSE_FONT_DIALOG

The WEL_CHOOSE_FONT_DIALOG is an encapsulation of the Win32 choose font dialog, and provides a means of selecting a font available on the system.

Appearance

See Also
Standard dialogs


WEL_OPEN_FILE_DIALOG

The WEL_OPEN_FILE_DIALOG is an encapsulation of the Win32 open file dialog, and provides a means of specifying a file to be opened.

Appearance

See Also
WEL_SAVE_FILE_DIALOG
Standard dialogs


WEL_PRINT_DIALOG

The WEL_PRINT_DIALOG is an encapsulation of the Win32 print dialog and provides a means of specifying print preferences.

Appearance

See Also
Standard dialogs


WEL_SAVE_FILE_DIALOG

The WEL_SAVE_FILE_DIALOG is an encapsulation of the Win32 save file dialog, and provides a means of specifying a file name and location for saving.

Appearance

See Also
WEL_OPEN_FILE_DIALOG
Standard dialogs


Windows

WEL Windows

This cluster contains the different types of windows availabe to a WEL_APPLICATION. Click here to browse the windows cluster.

The following effective window types are available:

  • WEL_POPUP_WINDOW
  • WEL_MODAL_DIALOG
  • WEL_MODELESS_DIALOG
  • WEL_MDI_FRAME_WINDOW
  • WEL_MDI_CLIENT_WINDOW
  • WEL_MDI_CHILD_WINDOW
  • WEL_MAIN_DIALOG
  • WEL_FRAME_WINDOW
  • WEL_CONTROL_WINDOW

Note: A WEL application must contain at least one window. See the WEL Tutorial for details of how to set up your first window within a WEL_APPLICATION.

Click here to browse the windows cluster.


cluster wel

Cluster
    wel

Subclusters
    wel.consts
    wel.controls
    wel.gdi
    wel.gdistock
    wel.messages
    wel.shared
    wel.stddlgs
    wel.structs
    wel.support
    wel.windows


cluster wel.consts

Cluster
    wel.consts

Supercluster
    wel

Subclusters
    wel.consts.new_consts

Classes
    WEL_ACCELERATOR_FLAG_CONSTANTS
    WEL_BIF_CONSTANTS
    WEL_BM_CONSTANTS
    WEL_BN_CONSTANTS
    WEL_BRUSH_STYLE_CONSTANTS
    WEL_BS_CONSTANTS
    WEL_CAPABILITIES_CONSTANTS
    WEL_CB_CONSTANTS
    WEL_CBEIF_CONSTANTS
    WEL_CBEM_CONSTANTS
    WEL_CBEN_CONSTANTS
    WEL_CBES_CONSTANTS
    WEL_CBN_CONSTANTS
    WEL_CBS_CONSTANTS
    WEL_CCS_CONSTANTS
    WEL_CF_CONSTANTS
    WEL_CFE_CONSTANTS
    WEL_CFM_CONSTANTS
    WEL_CHARACTER_SET_CONSTANTS
    WEL_CHOOSE_COLOR_CONSTANTS
    WEL_CLIP_PRECISION_CONSTANTS
    WEL_CLIPBOARD_CONSTANTS
    WEL_CLIPPING_CAPABILITIES_CONSTANTS
    WEL_COLOR_CONSTANTS
    WEL_CS_CONSTANTS
    WEL_CURVES_CAPABILITIES_CONSTANTS
    WEL_DDL_CONSTANTS
    WEL_DEVICE_TECHNOLOGY_CONSTANTS
    WEL_DIB_COLORS_CONSTANTS
    WEL_DRAWING_ROUTINES_CONSTANTS
    WEL_DS_CONSTANTS
    WEL_DT_CONSTANTS
    WEL_ECO_CONSTANTS
    WEL_EM_CONSTANTS
    WEL_EN_CONSTANTS
    WEL_ENM_CONSTANTS
    WEL_ES_CONSTANTS
    WEL_ESB_CONSTANTS
    WEL_FILL_ATTRIBUTES_CONSTANTS
    WEL_FIND_FLAGS_CONSTANTS
    WEL_FLOOD_FILL_CONSTANTS
    WEL_FONT_FAMILY_CONSTANTS
    WEL_FONT_PITCH_CONSTANTS
    WEL_FONT_QUALITY_CONSTANTS
    WEL_FONT_TYPE_CONSTANTS
    WEL_FONT_TYPE_ENUM_CONSTANTS
    WEL_FW_CONSTANTS
    WEL_GCL_CONSTANTS
    WEL_GW_CONSTANTS
    WEL_GWL_CONSTANTS
    WEL_HDF_CONSTANTS
    WEL_HDI_CONSTANTS
    WEL_HDM_CONSTANTS
    WEL_HDN_CONSTANTS
    WEL_HDS_CONSTANTS
    WEL_HELP_CONSTANTS
    WEL_HHT_CONSTANTS
    WEL_HKEY
    WEL_HS_CONSTANTS
    WEL_HT_CONSTANTS
    WEL_HWND_CONSTANTS
    WEL_ICC_CONSTANTS
    WEL_ICON_CONSTANTS
    WEL_ID_CONSTANTS
    WEL_IDB_CONSTANTS
    WEL_IDC_CONSTANTS
    WEL_IDI_CONSTANTS
    WEL_ILC_CONSTANTS
    WEL_IMAGE_CONSTANTS
    WEL_INPUT_EVENT_CONSTANTS
    WEL_LANGUAGE_CONSTANTS
    WEL_LB_CONSTANTS
    WEL_LBN_CONSTANTS
    WEL_LBS_CONSTANTS
    WEL_LINE_CAPABILITIES_CONSTANTS
    WEL_LVCF_CONSTANTS
    WEL_LVFI_CONSTANTS
    WEL_LVHT_CONSTANTS
    WEL_LVIF_CONSTANTS
    WEL_LVIS_CONSTANTS
    WEL_LVM_CONSTANTS
    WEL_LVN_CONSTANTS
    WEL_LVNI_CONSTANTS
    WEL_LVS_CONSTANTS
    WEL_LVS_EX_CONSTANTS
    WEL_LVSIL_CONSTANTS
    WEL_MA_CONSTANTS
    WEL_MB_CONSTANTS
    WEL_MDI_TILE_CONSTANTS
    WEL_MF_CONSTANTS
    WEL_MK_CONSTANTS
    WEL_MM_CONSTANTS
    WEL_MNC_CONSTANTS
    WEL_OCM_CONSTANTS
    WEL_ODA_CONSTANTS
    WEL_ODS_CONSTANTS
    WEL_ODT_CONSTANTS
    WEL_OFN_CONSTANTS
    WEL_OUT_PRECISION_CONSTANTS
    WEL_PBM_CONSTANTS
    WEL_PBS_CONSTANTS
    WEL_PC_CONSTANTS
    WEL_PD_CONSTANTS
    WEL_PFA_CONSTANTS
    WEL_PFM_CONSTANTS
    WEL_PM_CONSTANTS
    WEL_POLYGON_FILL_MODE_CONSTANTS
    WEL_POLYGONAL_CAPABILITIES_CONSTANTS
    WEL_PROCESS_CREATION_CONSTANTS
    WEL_PS_CONSTANTS
    WEL_RASTER_CAPABILITIES_CONSTANTS
    WEL_RASTER_OPERATIONS_CONSTANTS
    WEL_RB_CONSTANTS
    WEL_RBBIM_CONSTANTS
    WEL_RBBS_CONSTANTS
    WEL_RBIM_CONSTANTS
    WEL_RBN_CONSTANTS
    WEL_RBS_CONSTANTS
    WEL_RDW_CONSTANTS
    WEL_REGISTRY_ACCESS_MODE
    WEL_REGISTRY_KEY_VALUE_TYPE
    WEL_RGN_CONSTANTS
    WEL_RICH_EDIT_MESSAGE_CONSTANTS
    WEL_RICH_EDIT_STYLE_CONSTANTS
    WEL_ROP2_CONSTANTS
    WEL_RT_CONSTANTS
    WEL_SB_CONSTANTS
    WEL_SBS_CONSTANTS
    WEL_SBT_CONSTANTS
    WEL_SC_CONSTANTS
    WEL_SCF_CONSTANTS
    WEL_SF_CONSTANTS
    WEL_SIZE_CONSTANTS
    WEL_SM_CONSTANTS
    WEL_SPI_CONSTANTS
    WEL_SS_CONSTANTS
    WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS
    WEL_STARTUP_CONSTANTS
    WEL_STATUS_WINDOW_CONSTANTS
    WEL_STM_CONSTANTS
    WEL_STOCK_CONSTANTS
    WEL_STRETCH_MODE_CONSTANTS
    WEL_SW_CONSTANTS
    WEL_SWP_CONSTANTS
    WEL_TA_CONSTANTS
    WEL_TB_CONSTANTS
    WEL_TB_STATE_CONSTANTS
    WEL_TB_STYLE_CONSTANTS
    WEL_TBM_CONSTANTS
    WEL_TBN_CONSTANTS
    WEL_TBS_CONSTANTS
    WEL_TCIF_CONSTANTS
    WEL_TCM_CONSTANTS
    WEL_TCN_CONSTANTS
    WEL_TCS_CONSTANTS
    WEL_TEXT_CAPABILITIES_CONSTANTS
    WEL_TME_CONSTANTS
    WEL_TMPF_CONSTANTS
    WEL_TPM_CONSTANTS
    WEL_TTDT_CONSTANTS
    WEL_TTF_CONSTANTS
    WEL_TTM_CONSTANTS
    WEL_TTN_CONSTANTS
    WEL_TTS_CONSTANTS
    WEL_TVAF_CONSTANTS
    WEL_TVGN_CONSTANTS
    WEL_TVHT_CONSTANTS
    WEL_TVI_CONSTANTS
    WEL_TVIF_CONSTANTS
    WEL_TVIS_CONSTANTS
    WEL_TVM_CONSTANTS
    WEL_TVN_CONSTANTS
    WEL_TVS_CONSTANTS
    WEL_TVSIL_CONSTANTS
    WEL_UD_CONSTANTS
    WEL_UDM_CONSTANTS
    WEL_UDN_CONSTANTS
    WEL_UDS_CONSTANTS
    WEL_VK_CONSTANTS
    WEL_WA_CONSTANTS
    WEL_WM_CONSTANTS
    WEL_WM_CTLCOLOR_CONSTANTS
    WEL_WPF_CONSTANTS
    WEL_WS_CONSTANTS


cluster wel.consts.new_consts

Cluster
    wel.consts.new_consts

Supercluster
    wel.consts

Classes
    WEL_COMBO_BOX_CONSTANTS
    WEL_CONSTANTS
    WEL_DRAWING_CONSTANTS
    WEL_INPUT_CONSTANTS
    WEL_LIST_VIEW_CONSTANTS
    WEL_NETWORKING_CONSTANTS
    WEL_SCROLL_BAR_CONSTANTS
    WEL_WINDOW_CONSTANTS


WEL_COMBO_BOX_CONSTANTS Chart

class
    WEL_COMBO_BOX_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "ComboBox Windows Constants."

Ancestors
    ANY

Queries
    Cb_addstring: INTEGER
    Cb_deletestring: INTEGER
    Cb_dir: INTEGER
    Cb_err: INTEGER
    Cb_errspace: INTEGER
    Cb_findstring: INTEGER
    Cb_findstringexact: INTEGER
    Cb_getcount: INTEGER
    Cb_getcursel: INTEGER
    Cb_getdroppedcontrolrect: INTEGER
    Cb_getdroppedstate: INTEGER
    Cb_geteditsel: INTEGER
    Cb_getextendedui: INTEGER
    Cb_getitemdata: INTEGER
    Cb_getitemheight: INTEGER
    Cb_getlbtext: INTEGER
    Cb_getlbtextlen: INTEGER
    Cb_insertstring: INTEGER
    Cb_limittext: INTEGER
    Cb_okay: INTEGER
    Cb_resetcontent: INTEGER
    Cb_selectstring: INTEGER
    Cb_setcursel: INTEGER
    Cb_seteditsel: INTEGER
    Cb_setextendedui: INTEGER
    Cb_setitemdata: INTEGER
    Cb_setitemheight: INTEGER
    Cb_showdropdown: INTEGER
    Cbeif_di_setitem: INTEGER
    Cbeif_image: INTEGER
    Cbeif_indent: INTEGER
    Cbeif_lparam: INTEGER
    Cbeif_overlay: INTEGER
    Cbeif_selectedimage: INTEGER
    Cbeif_text: INTEGER
    Cbem_deleteitem: INTEGER
    Cbem_getcombocontrol: INTEGER
    Cbem_geteditcontrol: INTEGER
    Cbem_getexstyle: INTEGER
    Cbem_getimagelist: INTEGER
    Cbem_getitem: INTEGER
    Cbem_haseditchanged: INTEGER
    Cbem_insertitem: INTEGER
    Cbem_setexstyle: INTEGER
    Cbem_setimagelist: INTEGER
    Cbem_setitem: INTEGER
    Cben_beginedit: INTEGER
    Cben_deleteitem: INTEGER
    Cben_endedit: INTEGER
    Cben_getdispinfo: INTEGER
    Cben_insertitem: INTEGER
    Cbenf_dropdown: INTEGER
    Cbenf_escape: INTEGER
    Cbenf_killfocus: INTEGER
    Cbenf_return: INTEGER
    Cbes_ex_noeditimage: INTEGER
    Cbes_ex_noeditimageindent: INTEGER
    Cbn_closeup: INTEGER
    Cbn_dblclk: INTEGER
    Cbn_dropdown: INTEGER
    Cbn_editchange: INTEGER
    Cbn_editupdate: INTEGER
    Cbn_errspace: INTEGER
    Cbn_killfocus: INTEGER
    Cbn_selchange: INTEGER
    Cbn_selendcancel: INTEGER
    Cbn_selendok: INTEGER
    Cbn_setfocus: INTEGER
    Cbs_autohscroll: INTEGER
    Cbs_disablenoscroll: INTEGER
    Cbs_dropdown: INTEGER
    Cbs_dropdownlist: INTEGER
    Cbs_hasstrings: INTEGER
    Cbs_lowercase: INTEGER
    Cbs_nointegralheight: INTEGER
    Cbs_oemconvert: INTEGER
    Cbs_ownerdrawfixed: INTEGER
    Cbs_ownerdrawvariable: INTEGER
    Cbs_simple: INTEGER
    Cbs_sort: INTEGER
    Cbs_uppercase: INTEGER


WEL_COMBO_BOX_CONSTANTS Flat contracts

indexing
    description: "ComboBox Windows Constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:07 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMBO_BOX_CONSTANTS

feature -- Extended Messages

    Cbem_deleteitem: INTEGER is 324
            -- Removes an item from a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_DELETEITEM

    Cbem_getcombocontrol: INTEGER is 1030
            -- Retrieves the handle to the child combo box control.
            --
            -- Declared in Windows as CBEM_GETCOMBOCONTROL

    Cbem_geteditcontrol: INTEGER is 1031
            -- Retrieves the handke to the edit control portion of
            -- a ComboBoxEc control.
            --
            -- Declared in Windows as CBEM_GETEDITCONTROL

    Cbem_getexstyle: INTEGER is 1033
            -- Retrieves the extended styles of a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_GETEXSTYLE

    Cbem_getimagelist: INTEGER is 1027
            -- Retrieves the handle to an image list assigned
            -- to a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_GETIMAGELIST

    Cbem_getitem: INTEGER is 1028
            -- Retrieves item information for a given ComboBoxEx item.
            --
            -- Declared in Windows as CBEM_GETITEM

    Cbem_haseditchanged: INTEGER is 1034
            -- Determines if the user has changed the contents of the
            -- ComboBoxEx edit control by typing.
            --
            -- Declared in Windows as CBEM_HASEDITCHANGED

    Cbem_insertitem: INTEGER is 1025
            -- Inserts a new item in a ComboBoxEx.
            --
            -- Declared in Windows as CBEM_INSERTITEM

    Cbem_setexstyle: INTEGER is 1032
            -- Sets extended styles within a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_SETEXSTYLE

    Cbem_setimagelist: INTEGER is 1026
            -- Sets an image list for a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_SETIMAGELIST

    Cbem_setitem: INTEGER is 1029
            -- Sets the attributes for an item in a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_SETITEM

feature -- Extended Notification Flags

    Cbenf_dropdown: INTEGER is 4
            -- The user activated the drop-down list.
            --
            -- Declared in Windows as CBENF_DROPDOWN

    Cbenf_escape: INTEGER is 3
            -- The user pressed the ESCAPE key.
            --
            -- Declared in Windows as CBENF_ESCAPE

    Cbenf_killfocus: INTEGER is 1
            -- The edit box lost the keyboard focus.
            --
            -- Declared in Windows as CBENF_KILLFOCUS

    Cbenf_return: INTEGER is 2
            -- The user completed the edit operation by pressing
            -- the ENTER key.
            --
            -- Declared in Windows as CBENF_RETURN

feature -- Extended Notifications

    Cben_beginedit: INTEGER is -804
            -- Sent when the user activates the drop-down list in the
            -- control's edit box.
            --
            -- Declared in Windows as CBEN_BEGINEDIT

    Cben_deleteitem: INTEGER is -802
            -- Sent when an item has been deleted.
            --
            -- Declared in Windows as CBEN_DELETEITEM

    Cben_endedit: INTEGER is -805
            -- Sent when the user has concluded an operation within
            -- the edit box or has selected an item from the control's
            -- drop-down list.
            --
            -- Declared in Windows as CBEN_ENDEDIT

    Cben_getdispinfo: INTEGER is -800
            -- Sent to retrieve display information about a callback item.
            --
            -- Declared in Windows as CBEN_GETDISPINFO

    Cben_insertitem: INTEGER is -801
            -- Send when a new item has been inserted in the control.
            --
            -- Declared in Windows as CBEN_INSERTITEM

feature -- Extended Style

    Cbes_ex_noeditimage: INTEGER is 1
            -- The edit box will not display an item image.
            --
            -- Declared in Windows as CBES_EX_NOEDITIMAGE

    Cbes_ex_noeditimageindent: INTEGER is 2
            -- The edit box will not indend text to make room
            -- for an item image.
            --
            -- Declared in Windows as CBES_EX_NOEDITIMAGEINDENT

feature -- Messages

    Cb_addstring: INTEGER is 323
            -- Declared in Windows as CB_ADDSTRING

    Cb_deletestring: INTEGER is 324
            -- Declared in Windows as CB_DELETESTRING

    Cb_dir: INTEGER is 325
            -- Declared in Windows as CB_DIR

    Cb_err: INTEGER is -1
            -- Declared in Windows as CB_ERR

    Cb_errspace: INTEGER is -2
            -- Declared in Windows as CB_ERRSPACE

    Cb_findstring: INTEGER is 332
            -- Declared in Windows as CB_FINDSTRING

    Cb_findstringexact: INTEGER is 344
            -- Declared in Windows as CB_FINDSTRINGEXACT

    Cb_getcount: INTEGER is 326
            -- Declared in Windows as CB_GETCOUNT

    Cb_getcursel: INTEGER is 327
            -- Declared in Windows as CB_GETCURSEL

    Cb_getdroppedcontrolrect: INTEGER is 338
            -- Declared in Windows as CB_GETDROPPEDCONTROLRECT

    Cb_getdroppedstate: INTEGER is 343
            -- Declared in Windows as CB_GETDROPPEDSTATE

    Cb_geteditsel: INTEGER is 320
            -- Declared in Windows as CB_GETEDITSEL

    Cb_getextendedui: INTEGER is 342
            -- Declared in Windows as CB_GETEXTENDEDUI

    Cb_getitemdata: INTEGER is 336
            -- Declared in Windows as CB_GETITEMDATA

    Cb_getitemheight: INTEGER is 340
            -- Declared in Windows as CB_GETITEMHEIGHT

    Cb_getlbtext: INTEGER is 328
            -- Declared in Windows as CB_GETLBTEXT

    Cb_getlbtextlen: INTEGER is 329
            -- Declared in Windows as CB_GETLBTEXTLEN

    Cb_insertstring: INTEGER is 330
            -- Declared in Windows as CB_INSERTSTRING

    Cb_limittext: INTEGER is 321
            -- Declared in Windows as CB_LIMITTEXT

    Cb_okay: INTEGER is 0
            -- Declared in Windows as CB_OKAY

    Cb_resetcontent: INTEGER is 331
            -- Declared in Windows as CB_RESETCONTENT

    Cb_selectstring: INTEGER is 333
            -- Declared in Windows as CB_SELECTSTRING

    Cb_setcursel: INTEGER is 334
            -- Declared in Windows as CB_SETCURSEL

    Cb_seteditsel: INTEGER is 322
            -- Declared in Windows as CB_SETEDITSEL

    Cb_setextendedui: INTEGER is 341
            -- Declared in Windows as CB_SETEXTENDEDUI

    Cb_setitemdata: INTEGER is 337
            -- Declared in Windows as CB_SETITEMDATA

    Cb_setitemheight: INTEGER is 339
            -- Declared in Windows as CB_SETITEMHEIGHT

    Cb_showdropdown: INTEGER is 335
            -- Declared in Windows as CB_SHOWDROPDOWN

feature -- Notifications

    Cbn_closeup: INTEGER is 8
            -- Declared in Windows as CBN_CLOSEUP

    Cbn_dblclk: INTEGER is 2
            -- Declared in Windows as CBN_DBLCLK

    Cbn_dropdown: INTEGER is 7
            -- Declared in Windows as CBN_DROPDOWN

    Cbn_editchange: INTEGER is 5
            -- Declared in Windows as CBN_EDITCHANGE

    Cbn_editupdate: INTEGER is 6
            -- Declared in Windows as CBN_EDITUPDATE

    Cbn_errspace: INTEGER is -1
            -- Declared in Windows as CBN_ERRSPACE

    Cbn_killfocus: INTEGER is 4
            -- Declared in Windows as CBN_KILLFOCUS

    Cbn_selchange: INTEGER is 1
            -- Declared in Windows as CBN_SELCHANGE

    Cbn_selendcancel: INTEGER is 10
            -- Declared in Windows as CBN_SELENDCANCEL

    Cbn_selendok: INTEGER is 9
            -- Declared in Windows as CBN_SELENDOK

    Cbn_setfocus: INTEGER is 3
            -- Declared in Windows as CBN_SETFOCUS

feature -- Structure Information

    Cbeif_di_setitem: INTEGER is 268435456
            -- The control should store the item data and not ask
            -- for it again. This flag is used only with the
            -- CBEN_GETDISPINFO notification message.
            --
            -- Declared in Windows as CBEIF_DI_SETITEM

    Cbeif_image: INTEGER is 2
            -- The image member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_IMAGE

    Cbeif_indent: INTEGER is 16
            -- The indent member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_INDENT

    Cbeif_lparam: INTEGER is 32
            -- The lparam member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_LPARAM

    Cbeif_overlay: INTEGER is 8
            -- The overlay member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_OVERLAY

    Cbeif_selectedimage: INTEGER is 4
            -- The selected_image member is valid or must be
            -- filled in.
            --
            -- Declared in Windows as CBEIF_SELECTEDIMAGE

    Cbeif_text: INTEGER is 1
            -- The text member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_TEXT

feature -- Style

    Cbs_autohscroll: INTEGER is 64
            -- Automatically scrolls the text in an edit control to the right
            -- when the user types a character at the end of the line. If
            -- this style is not set, only text that fits within the
            -- rectangular boundary is allowed.
            --
            -- Declared in Windows as CBS_AUTOHSCROLL

    Cbs_disablenoscroll: INTEGER is 2048
            -- Shows a disabled vertical scroll bar in the list box when the
            -- box does not contain enough items to scroll. Without this
            -- style, the scroll bar is hidden when the list box does not
            -- contain enough items.
            -- Declared in Windows as CBS_DISABLENOSCROLL

    Cbs_dropdown: INTEGER is 2
            -- Similar to CBS_SIMPLE, except that the list box is not
            -- displayed unless the user selects an icon next to the edit
            -- control.
            --
            -- Declared in Windows as CBS_DROPDOWN

    Cbs_dropdownlist: INTEGER is 3
            -- Similar to CBS_DROPDOWN, except that the edit control is
            -- replaced by a static text item that displays the current
            -- selection in the list box.
            --
            -- Declared in Windows as CBS_DROPDOWNLIST

    Cbs_hasstrings: INTEGER is 512
            -- Specifies that an owner-drawn combo box contains items
            -- consisting of strings. The combo box maintains the memory and
            -- address for the strings so the application can use the
            -- CB_GETLBTEXT message to retrieve the text for a particular
            -- item.
            --
            -- Declared in Windows as CBS_HASSTRINGS

    Cbs_lowercase: INTEGER is 16384
            -- Converts to lowercase all text in both the selection field
            -- and the list.
            --
            -- Declared in Windows as CBS_LOWERCASE

    Cbs_nointegralheight: INTEGER is 1024
            -- Specifies that the size of the combo box is exactly the size
            -- specified by the application when it created the combo box.
            -- Normally, the system sizes a combo box so that it does not
            -- display partial items.
            --
            -- Declared in Windows as CBS_NOINTEGRALHEIGHT

    Cbs_oemconvert: INTEGER is 128
            -- Converts text entered in the combo box edit control from the
            -- Windows character set to the OEM character set and then back
            -- to the Windows set. This ensures proper character conversion
            -- when the application calls the CharToOem function to convert a
            -- Windows string in the combo box to OEM characters. This style
            -- is most useful for combo boxes that contain file names and
            -- applies only to combo boxes created with the CBS_SIMPLE or
            -- CBS_DROPDOWN style.
            --
            -- Declared in Windows as CBS_OEMCONVERT

    Cbs_ownerdrawfixed: INTEGER is 16
            -- Specifies that the owner of the list box is responsible for
            -- drawing its contents and that the items in the list box are
            -- all the same height. The owner window receives a
            -- WM_MEASUREITEM message when the combo box is created and a
            -- WM_DRAWITEM message when a visual aspect of the combo box has
            -- changed.
            --
            -- Declared in Windows as CBS_OWNERDRAWFIXED

    Cbs_ownerdrawvariable: INTEGER is 32
            -- Specifies that the owner of the list box is responsible for
            -- drawing its contents and that the items in the list box are
            -- variable in height. The owner window receives a WM_MEASUREITEM
            -- message for each item in the combo box when you create the
            -- combo box and a WM_DRAWITEM message when a visual aspect of
            -- the combo box has changed.
            --
            -- Declared in Windows as CBS_OWNERDRAWVARIABLE

    Cbs_simple: INTEGER is 1
            -- Displays the list box at all times. The current selection in
            -- the list box is displayed in the edit control.
            --
            -- Declared in Windows as CBS_SIMPLE

    Cbs_sort: INTEGER is 256
            -- Automatically sorts strings added to the list box.
            -- Declared in Windows as CBS_SORT

    Cbs_uppercase: INTEGER is 8192
            -- Converts to uppercase all text in both the selection field and
            -- the list.
            --
            -- Declared in Windows as CBS_UPPERCASE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMBO_BOX_CONSTANTS


WEL_CONSTANTS Chart

class
    WEL_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "Objects to retrieve WEL constants"
    create: default_create

Ancestors
    ANY

Queries
    Wel_color_constants: WEL_COLOR_CONSTANTS
    Wel_drawing_constants: WEL_DRAWING_CONSTANTS
    Wel_ht_constants: WEL_HT_CONSTANTS
    Wel_input_constants: WEL_INPUT_CONSTANTS
    Wel_list_view_constants: WEL_LIST_VIEW_CONSTANTS
    Wel_window_constants: WEL_WINDOW_CONSTANTS


WEL_CONSTANTS Flat contracts

indexing
    description: "Objects to retrieve WEL constants"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:07 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CONSTANTS

create

feature -- Access

    wel_color_constants: WEL_COLOR_CONSTANTS
            -- Access to COLOR_xxx constants.

    wel_drawing_constants: WEL_DRAWING_CONSTANTS
            -- Drawing Constants
            -- Include constants:
            --   DI_xxxx
            --   DT_xxxx
            --   ...

    wel_ht_constants: WEL_HT_CONSTANTS
            -- Access to Ht_xxxconstnats

    wel_input_constants: WEL_INPUT_CONSTANTS
            -- Mouse Constants
            -- Include constants:
            --   MA_xxxx
            --   ...

    wel_list_view_constants: WEL_LIST_VIEW_CONSTANTS
            -- ListView Control Constants
            -- Include constants:
            --   LVM_xxxx
            --   LVS_xxxx
            --   LVN_xxxx
            --   ...

    wel_window_constants: WEL_WINDOW_CONSTANTS
            -- Window managment constants:
            -- Include constants:
            --   WM_xxxx
            --   ...

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CONSTANTS


WEL_DRAWING_CONSTANTS Chart

class
    WEL_DRAWING_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "Window drawing constants (DT_xxxx, DI_xxxx, ...)"
    create: default_create

Ancestors
    ANY

Queries
    Bdr_raisedinner: INTEGER
    Bdr_raisedouter: INTEGER
    Bdr_sunkeninner: INTEGER
    Bdr_sunkenouter: INTEGER
    Bf_adjust: INTEGER
    Bf_bottom: INTEGER
    Bf_bottomleft: INTEGER
    Bf_bottomright: INTEGER
    Bf_diagonal: INTEGER
    Bf_diagonal_endbottomleft: INTEGER
    Bf_diagonal_endbottomright: INTEGER
    Bf_diagonal_endtopleft: INTEGER
    Bf_diagonal_endtopright: INTEGER
    Bf_flat: INTEGER
    Bf_left: INTEGER
    Bf_middle: INTEGER
    Bf_mono: INTEGER
    Bf_rect: INTEGER
    Bf_right: INTEGER
    Bf_soft: INTEGER
    Bf_top: INTEGER
    Bf_topleft: INTEGER
    Bf_topright: INTEGER
    Blackness: INTEGER
    Dfc_button: INTEGER
    Dfc_caption: INTEGER
    Dfc_menu: INTEGER
    Dfc_popupmenu: INTEGER
    Dfc_scroll: INTEGER
    Dfcs_adjustrect: INTEGER
    Dfcs_button3state: INTEGER
    Dfcs_buttoncheck: INTEGER
    Dfcs_buttonpush: INTEGER
    Dfcs_buttonradio: INTEGER
    Dfcs_buttonradioimage: INTEGER
    Dfcs_buttonradiomask: INTEGER
    Dfcs_captionclose: INTEGER
    Dfcs_captionhelp: INTEGER
    Dfcs_captionmax: INTEGER
    Dfcs_captionmin: INTEGER
    Dfcs_captionrestore: INTEGER
    Dfcs_checked: INTEGER
    Dfcs_flat: INTEGER
    Dfcs_hot: INTEGER
    Dfcs_inactive: INTEGER
    Dfcs_menuarrow: INTEGER
    Dfcs_menuarrowright: INTEGER
    Dfcs_menubullet: INTEGER
    Dfcs_menucheck: INTEGER
    Dfcs_mono: INTEGER
    Dfcs_pushed: INTEGER
    Dfcs_scrollcombobox: INTEGER
    Dfcs_scrolldown: INTEGER
    Dfcs_scrollleft: INTEGER
    Dfcs_scrollright: INTEGER
    Dfcs_scrollsizegrip: INTEGER
    Dfcs_scrollsizegripright: INTEGER
    Dfcs_scrollup: INTEGER
    Dfcs_transparent: INTEGER
    Di_compat: INTEGER
    Di_defaultsize: INTEGER
    Di_image: INTEGER
    Di_mask: INTEGER
    Di_normal: INTEGER
    Dss_disabled: INTEGER
    Dss_hideprefix: INTEGER
    Dss_mono: INTEGER
    Dss_normal: INTEGER
    Dss_prefixonly: INTEGER
    Dss_right: INTEGER
    Dss_union: INTEGER
    Dst_bitmap: INTEGER
    Dst_complex: INTEGER
    Dst_icon: INTEGER
    Dst_prefixtext: INTEGER
    Dst_text: INTEGER
    Dstinvert: INTEGER
    Dt_bottom: INTEGER
    Dt_calcrect: INTEGER
    Dt_center: INTEGER
    Dt_expandtabs: INTEGER
    Dt_externalleading: INTEGER
    Dt_hideprefix: INTEGER
    Dt_internal: INTEGER
    Dt_left: INTEGER
    Dt_noclip: INTEGER
    Dt_noprefix: INTEGER
    Dt_right: INTEGER
    Dt_singleline: INTEGER
    Dt_tabstop: INTEGER
    Dt_top: INTEGER
    Dt_vcenter: INTEGER
    Dt_wordbreak: INTEGER
    Edge_bump: INTEGER
    Edge_etched: INTEGER
    Edge_raised: INTEGER
    Edge_sunken: INTEGER
    maskcopy: INTEGER
    Maskpaint: INTEGER
    Mergecopy: INTEGER
    Mergepaint: INTEGER
    Notsrccopy: INTEGER
    Notsrcerase: INTEGER
    Patcopy: INTEGER
    Patinvert: INTEGER
    Patpaint: INTEGER
    R2_black: INTEGER
    R2_copypen: INTEGER
    R2_masknotpen: INTEGER
    R2_maskpen: INTEGER
    R2_maskpennot: INTEGER
    R2_mergenotpen: INTEGER
    R2_mergepen: INTEGER
    R2_mergepennot: INTEGER
    R2_nop: INTEGER
    R2_not: INTEGER
    R2_notcopypen: INTEGER
    R2_notmaskpen: INTEGER
    R2_notmergepen: INTEGER
    R2_notxorpen: INTEGER
    R2_white: INTEGER
    R2_xorpen: INTEGER
    Srcand: INTEGER
    Srccopy: INTEGER
    Srcerase: INTEGER
    Srcinvert: INTEGER
    Srcpaint: INTEGER
    valid_rop2_constant (c: INTEGER): BOOLEAN
    Whiteness: INTEGER


WEL_DRAWING_CONSTANTS Flat contracts

indexing
    description: "Window drawing constants (DT_xxxx, DI_xxxx, ...)"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:07 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DRAWING_CONSTANTS

create

feature -- Status report

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?

feature -- BitBlt and MaskBlt constants

    Blackness: INTEGER is 66
            -- Declared in Windows as BLACKNESS

    Dstinvert: INTEGER is 5570569
            -- Declared in Windows as DSTINVERT

    Maskpaint: INTEGER is 2229030
            -- 0x220326

    Mergecopy: INTEGER is 12583114
            -- Declared in Windows as MERGECOPY

    Mergepaint: INTEGER is 12255782
            -- Declared in Windows as MERGEPAINT

    Notsrccopy: INTEGER is 3342344
            -- Declared in Windows as NOTSRCCOPY

    Notsrcerase: INTEGER is 1114278
            -- Declared in Windows as NOTSRCERASE

    Patcopy: INTEGER is 15728673
            -- Declared in Windows as PATCOPY

    Patinvert: INTEGER is 5898313
            -- Declared in Windows as PATINVERT

    Patpaint: INTEGER is 16452105
            -- Declared in Windows as PATPAINT

    R2_black: INTEGER is 1

    R2_copypen: INTEGER is 13

    R2_masknotpen: INTEGER is 3

    R2_maskpen: INTEGER is 9

    R2_maskpennot: INTEGER is 5

    R2_mergenotpen: INTEGER is 12

    R2_mergepen: INTEGER is 15

    R2_mergepennot: INTEGER is 14

    R2_nop: INTEGER is 11

    R2_not: INTEGER is 6

    R2_notcopypen: INTEGER is 4

    R2_notmaskpen: INTEGER is 8

    R2_notmergepen: INTEGER is 2

    R2_notxorpen: INTEGER is 10

    R2_white: INTEGER is 16

    R2_xorpen: INTEGER is 7

    Srcand: INTEGER is 8913094
            -- Declared in Windows as SRCAND

    Srccopy: INTEGER is 13369376
            -- Declared in Windows as SRCCOPY

    Srcerase: INTEGER is 4457256
            -- Declared in Windows as SRCERASE

    Srcinvert: INTEGER is 6684742
            -- Declared in Windows as SRCINVERT

    Srcpaint: INTEGER is 15597702
            -- Declared in Windows as SRCPAINT

    Whiteness: INTEGER is 16711778
            -- Declared in Windows as WHITENESS

feature -- DrawEdge constants (BDR_xxxx, EDGE_xxxx, BF_xxxx)

    Bdr_raisedinner: INTEGER is 4
            -- Declared in Windows as BDR_RAISEDINNER

    Bdr_raisedouter: INTEGER is 1
            -- Declared in Windows as BDR_RAISEDOUTER

    Bdr_sunkeninner: INTEGER is 8
            -- Declared in Windows as BDR_SUNKENINNER

    Bdr_sunkenouter: INTEGER is 2
            -- Declared in Windows as BDR_SUNKENOUTER

    Bf_adjust: INTEGER is 8192
            -- Declared in Windows as BF_ADJUST

    Bf_bottom: INTEGER is 8
            -- Declared in Windows as BF_BOTTOM

    Bf_bottomleft: INTEGER is 9
            -- Declared in Windows as BF_BOTTOMLEFT

    Bf_bottomright: INTEGER is 12
            -- Declared in Windows as BF_BOTTOMRIGHT

    Bf_diagonal: INTEGER is 16
            -- Declared in Windows as BF_DIAGONAL

    Bf_diagonal_endbottomleft: INTEGER is 25
            -- Declared in Windows as BF_DIAGONAL_ENDBOTTOMLEFT

    Bf_diagonal_endbottomright: INTEGER is 28
            -- Declared in Windows as BF_DIAGONAL_ENDBOTTOMRIGHT

    Bf_diagonal_endtopleft: INTEGER is 19
            -- Declared in Windows as BF_DIAGONAL_ENDTOPLEFT

    Bf_diagonal_endtopright: INTEGER is 22
            -- Declared in Windows as BF_DIAGONAL_ENDTOPRIGHT

    Bf_flat: INTEGER is 16384
            -- Declared in Windows as BF_FLAT

    Bf_left: INTEGER is 1
            -- Declared in Windows as BF_LEFT

    Bf_middle: INTEGER is 2048
            -- Declared in Windows as BF_MIDDLE

    Bf_mono: INTEGER is 32768
            -- Declared in Windows as BF_MONO

    Bf_rect: INTEGER is 15
            -- Declared in Windows as BF_RECT

    Bf_right: INTEGER is 4
            -- Declared in Windows as BF_RIGHT

    Bf_soft: INTEGER is 4096
            -- Declared in Windows as BF_SOFT

    Bf_top: INTEGER is 2
            -- Declared in Windows as BF_TOP

    Bf_topleft: INTEGER is 3
            -- Declared in Windows as BF_TOPLEFT

    Bf_topright: INTEGER is 6
            -- Declared in Windows as BF_TOPRIGHT

    Edge_bump: INTEGER is 9
            -- Declared in Windows as EDGE_BUMP
            -- Equivalent to Bdr_sunkeninner | Bdr_raisedouter

    Edge_etched: INTEGER is 6
            -- Declared in Windows as EDGE_ETCHED
            -- Equivalent to Bdr_sunkenouter | Bdr_raisedinner

    Edge_raised: INTEGER is 5
            -- Declared in Windows as EDGE_RAISED
            -- Equivalent to Bdr_raisedouter | Bdr_raisedinner

    Edge_sunken: INTEGER is 10
            -- Declared in Windows as EDGE_SUNKEN
            -- Equivalent to Bdr_sunkeninner | Bdr_sunkenouter

feature -- DrawFrameControl constants (DFC_xxxx, DFCS_xxxx)

    Dfc_button: INTEGER is 4
            -- Declared in Windows as DFC_BUTTON

    Dfc_caption: INTEGER is 1
            -- Declared in Windows as DFC_CAPTION

    Dfc_menu: INTEGER is 2
            -- Declared in Windows as DFC_MENU

    Dfc_popupmenu: INTEGER is 5
            -- Declared in Windows as DFC_POPUPMENU

    Dfc_scroll: INTEGER is 3
            -- Declared in Windows as DFC_SCROLL

    Dfcs_adjustrect: INTEGER is 8192
            -- Declared in Windows as DFCS_ADJUSTRECT

    Dfcs_button3state: INTEGER is 8
            -- Declared in Windows as DFCS_BUTTON3STATE

    Dfcs_buttoncheck: INTEGER is 0
            -- Declared in Windows as DFCS_BUTTONCHECK

    Dfcs_buttonpush: INTEGER is 16
            -- Declared in Windows as DFCS_BUTTONPUSH

    Dfcs_buttonradio: INTEGER is 4
            -- Declared in Windows as DFCS_BUTTONRADIO

    Dfcs_buttonradioimage: INTEGER is 1
            -- Declared in Windows as DFCS_BUTTONRADIOIMAGE

    Dfcs_buttonradiomask: INTEGER is 2
            -- Declared in Windows as DFCS_BUTTONRADIOMASK

    Dfcs_captionclose: INTEGER is 0
            -- Declared in Windows as DFCS_CAPTIONCLOSE

    Dfcs_captionhelp: INTEGER is 4
            -- Declared in Windows as DFCS_CAPTIONHELP

    Dfcs_captionmax: INTEGER is 2
            -- Declared in Windows as DFCS_CAPTIONMAX

    Dfcs_captionmin: INTEGER is 1
            -- Declared in Windows as DFCS_CAPTIONMIN

    Dfcs_captionrestore: INTEGER is 3
            -- Declared in Windows as DFCS_CAPTIONRESTORE

    Dfcs_checked: INTEGER is 1024
            -- Declared in Windows as DFCS_CHECKED

    Dfcs_flat: INTEGER is 16384
            -- Declared in Windows as DFCS_FLAT

    Dfcs_hot: INTEGER is 4096
            -- Declared in Windows as DFCS_HOT

    Dfcs_inactive: INTEGER is 256
            -- Declared in Windows as DFCS_INACTIVE

    Dfcs_menuarrow: INTEGER is 0
            -- Declared in Windows as DFCS_MENUARROW

    Dfcs_menuarrowright: INTEGER is 4
            -- Declared in Windows as DFCS_MENUARROWRIGHT

    Dfcs_menubullet: INTEGER is 2
            -- Declared in Windows as DFCS_MENUBULLET

    Dfcs_menucheck: INTEGER is 1
            -- Declared in Windows as DFCS_MENUCHECK

    Dfcs_mono: INTEGER is 32768
            -- Declared in Windows as DFCS_MONO

    Dfcs_pushed: INTEGER is 512
            -- Declared in Windows as DFCS_PUSHED

    Dfcs_scrollcombobox: INTEGER is 5
            -- Declared in Windows as DFCS_SCROLLCOMBOBOX

    Dfcs_scrolldown: INTEGER is 1
            -- Declared in Windows as DFCS_SCROLLDOWN

    Dfcs_scrollleft: INTEGER is 2
            -- Declared in Windows as DFCS_SCROLLLEFT

    Dfcs_scrollright: INTEGER is 3
            -- Declared in Windows as DFCS_SCROLLRIGHT

    Dfcs_scrollsizegrip: INTEGER is 8
            -- Declared in Windows as DFCS_SCROLLSIZEGRIP

    Dfcs_scrollsizegripright: INTEGER is 16
            -- Declared in Windows as DFCS_SCROLLSIZEGRIPRIGHT

    Dfcs_scrollup: INTEGER is 0
            -- Declared in Windows as DFCS_SCROLLUP

    Dfcs_transparent: INTEGER is 2048
            -- Declared in Windows as DFCS_TRANSPARENT

feature -- DrawImage constants (DI_xxxx)

    Di_compat: INTEGER is 4
            -- Declared in Windows as DI_COMPAT

    Di_defaultsize: INTEGER is 8
            -- Declared in Windows as DI_DEFAULTSIZE

    Di_image: INTEGER is 2
            -- Declared in Windows as DI_IMAGE

    Di_mask: INTEGER is 1
            -- Declared in Windows as DI_MASK

    Di_normal: INTEGER is 3
            -- Declared in Windows as DI_NORMAL

feature -- DrawState constants (DSS_xxxx, DST_xxxx)

    Dss_disabled: INTEGER is 32
            -- Declared in Windows as DSS_DISABLED

    Dss_hideprefix: INTEGER is 512
            -- Declared in Windows as DSS_HIDEPREFIX

    Dss_mono: INTEGER is 128
            -- Declared in Windows as DSS_MONO

    Dss_normal: INTEGER is 0
            -- Declared in Windows as DSS_NORMAL

    Dss_prefixonly: INTEGER is 1024
            -- Declared in Windows as DSS_PREFIXONLY

    Dss_right: INTEGER is 32768
            -- Declared in Windows as DSS_RIGHT

    Dss_union: INTEGER is 16
            -- Declared in Windows as DSS_UNION

    Dst_bitmap: INTEGER is 4
            -- Declared in Windows as DST_BITMAP

    Dst_complex: INTEGER is 0
            -- Declared in Windows as DST_COMPLEX

    Dst_icon: INTEGER is 3
            -- Declared in Windows as DST_ICON

    Dst_prefixtext: INTEGER is 2
            -- Declared in Windows as DST_PREFIXTEXT

    Dst_text: INTEGER is 1
            -- Declared in Windows as DST_TEXT

feature -- DrawText constants (DT_xxxx)

    Dt_bottom: INTEGER is 8
            -- Declared in Windows as DT_BOTTOM

    Dt_calcrect: INTEGER is 1024
            -- Declared in Windows as DT_CALCRECT

    Dt_center: INTEGER is 1
            -- Declared in Windows as DT_CENTER

    Dt_expandtabs: INTEGER is 64
            -- Declared in Windows as DT_EXPANDTABS

    Dt_externalleading: INTEGER is 512
            -- Declared in Windows as DT_EXTERNALLEADING

    Dt_hideprefix: INTEGER is 1048576
            -- Declared in Windows as DT_HIDEPREFIX

    Dt_internal: INTEGER is 4096
            -- Declared in Windows as DT_INTERNAL

    Dt_left: INTEGER is 0
            -- Declared in Windows as DT_LEFT

    Dt_noclip: INTEGER is 256
            -- Declared in Windows as DT_NOCLIP

    Dt_noprefix: INTEGER is 2048
            -- Declared in Windows as DT_NOPREFIX

    Dt_right: INTEGER is 2
            -- Declared in Windows as DT_RIGHT

    Dt_singleline: INTEGER is 32
            -- Declared in Windows as DT_SINGLELINE

    Dt_tabstop: INTEGER is 128
            -- Declared in Windows as DT_TABSTOP

    Dt_top: INTEGER is 0
            -- Declared in Windows as DT_TOP

    Dt_vcenter: INTEGER is 4
            -- Declared in Windows as DT_VCENTER

    Dt_wordbreak: INTEGER is 16
            -- Declared in Windows as DT_WORDBREAK

feature -- MaskBlt only constants

    maskcopy: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DRAWING_CONSTANTS


WEL_INPUT_CONSTANTS Chart

class
    WEL_INPUT_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "Constants relative to input (Mouse, Keyboard, ...)"

Ancestors
    ANY

Queries
    Keyeventf_extendedkey: INTEGER
    Keyeventf_keyup: INTEGER
    Ma_activate: INTEGER
    Ma_activateandeat: INTEGER
    Ma_noactivate: INTEGER
    Ma_noactivateandeat: INTEGER
    Mk_control: INTEGER
    Mk_lbutton: INTEGER
    Mk_mbutton: INTEGER
    Mk_rbutton: INTEGER
    Mk_shift: INTEGER
    Mouseeventf_absolute: INTEGER
    Mouseeventf_leftdown: INTEGER
    Mouseeventf_leftup: INTEGER
    Mouseeventf_middledown: INTEGER
    Mouseeventf_middleup: INTEGER
    Mouseeventf_move: INTEGER
    Mouseeventf_rightdown: INTEGER
    Mouseeventf_rightup: INTEGER
    Mouseeventf_wheel: INTEGER
    Vk_0: INTEGER
    Vk_1: INTEGER
    Vk_2: INTEGER
    Vk_3: INTEGER
    Vk_4: INTEGER
    Vk_5: INTEGER
    Vk_6: INTEGER
    Vk_7: INTEGER
    Vk_8: INTEGER
    Vk_9: INTEGER
    Vk_a: INTEGER
    Vk_add: INTEGER
    Vk_b: INTEGER
    Vk_back: INTEGER
    Vk_c: INTEGER
    Vk_cancel: INTEGER
    Vk_capital: INTEGER
    Vk_clear: INTEGER
    Vk_control: INTEGER
    Vk_d: INTEGER
    Vk_decimal: INTEGER
    Vk_delete: INTEGER
    Vk_divide: INTEGER
    Vk_down: INTEGER
    Vk_e: INTEGER
    Vk_end: INTEGER
    Vk_escape: INTEGER
    Vk_execute: INTEGER
    Vk_f: INTEGER
    Vk_f1: INTEGER
    Vk_f10: INTEGER
    Vk_f11: INTEGER
    Vk_f12: INTEGER
    Vk_f13: INTEGER
    Vk_f14: INTEGER
    Vk_f15: INTEGER
    Vk_f16: INTEGER
    Vk_f17: INTEGER
    Vk_f18: INTEGER
    Vk_f19: INTEGER
    Vk_f2: INTEGER
    Vk_f20: INTEGER
    Vk_f21: INTEGER
    Vk_f22: INTEGER
    Vk_f23: INTEGER
    Vk_f24: INTEGER
    Vk_f3: INTEGER
    Vk_f4: INTEGER
    Vk_f5: INTEGER
    Vk_f6: INTEGER
    Vk_f7: INTEGER
    Vk_f8: INTEGER
    Vk_f9: INTEGER
    Vk_g: INTEGER
    Vk_h: INTEGER
    Vk_help: INTEGER
    Vk_home: INTEGER
    Vk_i: INTEGER
    Vk_insert: INTEGER
    Vk_j: INTEGER
    Vk_k: INTEGER
    Vk_l: INTEGER
    Vk_lbutton: INTEGER
    Vk_lcontrol: INTEGER
    Vk_left: INTEGER
    Vk_lmenu: INTEGER
    Vk_lshift: INTEGER
    Vk_m: INTEGER
    Vk_mbutton: INTEGER
    Vk_menu: INTEGER
    Vk_multiply: INTEGER
    Vk_n: INTEGER
    Vk_next: INTEGER
    Vk_numlock: INTEGER
    Vk_numpad0: INTEGER
    Vk_numpad1: INTEGER
    Vk_numpad2: INTEGER
    Vk_numpad3: INTEGER
    Vk_numpad4: INTEGER
    Vk_numpad5: INTEGER
    Vk_numpad6: INTEGER
    Vk_numpad7: INTEGER
    Vk_numpad8: INTEGER
    Vk_numpad9: INTEGER
    Vk_o: INTEGER
    Vk_p: INTEGER
    Vk_pause: INTEGER
    Vk_print: INTEGER
    Vk_prior: INTEGER
    Vk_q: INTEGER
    Vk_r: INTEGER
    Vk_rbutton: INTEGER
    Vk_rcontrol: INTEGER
    Vk_return: INTEGER
    Vk_right: INTEGER
    Vk_rmenu: INTEGER
    Vk_rshift: INTEGER
    Vk_s: INTEGER
    Vk_scroll: INTEGER
    Vk_select: INTEGER
    Vk_separator: INTEGER
    Vk_shift: INTEGER
    Vk_snapshot: INTEGER
    Vk_space: INTEGER
    Vk_subtract: INTEGER
    Vk_t: INTEGER
    Vk_tab: INTEGER
    Vk_u: INTEGER
    Vk_up: INTEGER
    Vk_v: INTEGER
    Vk_w: INTEGER
    Vk_x: INTEGER
    Vk_y: INTEGER
    Vk_z: INTEGER


WEL_INPUT_CONSTANTS Flat contracts

indexing
    description: "Constants relative to input (Mouse, Keyboard, ...)"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:07 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_INPUT_CONSTANTS

feature -- Keyboard event input constants

    Keyeventf_extendedkey: INTEGER is 1
            -- Declared in Windows as KEYEVENTF_EXTENDEDKEY

    Keyeventf_keyup: INTEGER is 2
            -- Declared in Windows as KEYEVENTF_KEYUP

feature -- Mouse Activate constants (MA_xxx).

    Ma_activate: INTEGER is 1
            -- Declared in Windows as MA_ACTIVATE

    Ma_activateandeat: INTEGER is 2
            -- Declared in Windows as MA_ACTIVATEANDEAT

    Ma_noactivate: INTEGER is 3
            -- Declared in Windows as MA_NOACTIVATE

    Ma_noactivateandeat: INTEGER is 4
            -- Declared in Windows as MA_NOACTIVATEANDEAT

feature -- Mouse and Key constants (MK_xxxx)

    Mk_control: INTEGER is 8
            -- Declared in Windows as MK_CONTROL

    Mk_lbutton: INTEGER is 1
            -- Declared in Windows as MK_LBUTTON

    Mk_mbutton: INTEGER is 16
            -- Declared in Windows as MK_MBUTTON

    Mk_rbutton: INTEGER is 2
            -- Declared in Windows as MK_RBUTTON

    Mk_shift: INTEGER is 4
            -- Declared in Windows as MK_SHIFT

feature -- Mouse event input constants

    Mouseeventf_absolute: INTEGER is 32768
            -- Declared in Windows as MOUSEEVENTF_ABSOLUTE

    Mouseeventf_leftdown: INTEGER is 2
            -- Declared in Windows as MOUSEEVENTF_LEFTDOWN

    Mouseeventf_leftup: INTEGER is 4
            -- Declared in Windows as MOUSEEVENTF_LEFTUP

    Mouseeventf_middledown: INTEGER is 32
            -- Declared in Windows as MOUSEEVENTF_MIDDLEDOWN

    Mouseeventf_middleup: INTEGER is 64
            -- Declared in Windows as MOUSEEVENTF_MIDDLEUP

    Mouseeventf_move: INTEGER is 1
            -- Declared in Windows as MOUSEEVENTF_MOVE

    Mouseeventf_rightdown: INTEGER is 8
            -- Declared in Windows as MOUSEEVENTF_RIGHTDOWN

    Mouseeventf_rightup: INTEGER is 16
            -- Declared in Windows as MOUSEEVENTF_RIGHTUP

    Mouseeventf_wheel: INTEGER is 2048
            -- Declared in Windows as MOUSEEVENTF_WHEEL

feature -- Virtual Key constants (VK_xxxx)

    Vk_0: INTEGER is 48

    Vk_1: INTEGER is 49

    Vk_2: INTEGER is 50

    Vk_3: INTEGER is 51

    Vk_4: INTEGER is 52

    Vk_5: INTEGER is 53

    Vk_6: INTEGER is 54

    Vk_7: INTEGER is 55

    Vk_8: INTEGER is 56

    Vk_9: INTEGER is 57
            -- Vk_a thru Vk_z are the same as their ASCII equivalents: 'A' thru 'Z'.

    Vk_a: INTEGER is 65

    Vk_add: INTEGER is 107
            -- Declared in Windows as VK_ADD

    Vk_b: INTEGER is 66

    Vk_back: INTEGER is 8
            -- Declared in Windows as VK_BACK

    Vk_c: INTEGER is 67

    Vk_cancel: INTEGER is 3
            -- Declared in Windows as VK_CANCEL

    Vk_capital: INTEGER is 20
            -- Declared in Windows as VK_CAPITAL

    Vk_clear: INTEGER is 12
            -- Declared in Windows as VK_CLEAR

    Vk_control: INTEGER is 17
            -- Declared in Windows as VK_CONTROL

    Vk_d: INTEGER is 68

    Vk_decimal: INTEGER is 110
            -- Declared in Windows as VK_DECIMAL

    Vk_delete: INTEGER is 46
            -- Declared in Windows as VK_DELETE

    Vk_divide: INTEGER is 111
            -- Declared in Windows as VK_DIVIDE

    Vk_down: INTEGER is 40
            -- Declared in Windows as VK_DOWN

    Vk_e: INTEGER is 69

    Vk_end: INTEGER is 35
            -- Declared in Windows as VK_END

    Vk_escape: INTEGER is 27
            -- Declared in Windows as VK_ESCAPE

    Vk_execute: INTEGER is 43
            -- Declared in Windows as VK_EXECUTE

    Vk_f: INTEGER is 70

    Vk_f1: INTEGER is 112
            -- Declared in Windows as VK_F1

    Vk_f10: INTEGER is 121
            -- Declared in Windows as VK_F10

    Vk_f11: INTEGER is 122
            -- Declared in Windows as VK_F11

    Vk_f12: INTEGER is 123
            -- Declared in Windows as VK_F12

    Vk_f13: INTEGER is 124
            -- Declared in Windows as VK_F13

    Vk_f14: INTEGER is 125
            -- Declared in Windows as VK_F14

    Vk_f15: INTEGER is 126
            -- Declared in Windows as VK_F15

    Vk_f16: INTEGER is 127
            -- Declared in Windows as VK_F16

    Vk_f17: INTEGER is 128
            -- Declared in Windows as VK_F17

    Vk_f18: INTEGER is 129
            -- Declared in Windows as VK_F18

    Vk_f19: INTEGER is 130
            -- Declared in Windows as VK_F19

    Vk_f2: INTEGER is 113
            -- Declared in Windows as VK_F2

    Vk_f20: INTEGER is 131
            -- Declared in Windows as VK_F20

    Vk_f21: INTEGER is 132
            -- Declared in Windows as VK_F21

    Vk_f22: INTEGER is 133
            -- Declared in Windows as VK_F22

    Vk_f23: INTEGER is 134
            -- Declared in Windows as VK_F23

    Vk_f24: INTEGER is 135
            -- Declared in Windows as VK_F24

    Vk_f3: INTEGER is 114
            -- Declared in Windows as VK_F3

    Vk_f4: INTEGER is 115
            -- Declared in Windows as VK_F4

    Vk_f5: INTEGER is 116
            -- Declared in Windows as VK_F5

    Vk_f6: INTEGER is 117
            -- Declared in Windows as VK_F6

    Vk_f7: INTEGER is 118
            -- Declared in Windows as VK_F7

    Vk_f8: INTEGER is 119
            -- Declared in Windows as VK_F8

    Vk_f9: INTEGER is 120
            -- Declared in Windows as VK_F9

    Vk_g: INTEGER is 71

    Vk_h: INTEGER is 72

    Vk_help: INTEGER is 47
            -- Declared in Windows as VK_HELP

    Vk_home: INTEGER is 36
            -- Declared in Windows as VK_HOME

    Vk_i: INTEGER is 73

    Vk_insert: INTEGER is 45
            -- Declared in Windows as VK_INSERT

    Vk_j: INTEGER is 74

    Vk_k: INTEGER is 75

    Vk_l: INTEGER is 76

    Vk_lbutton: INTEGER is 1
            -- Declared in Windows as VK_LBUTTON

    Vk_lcontrol: INTEGER is 162
            -- Declared in Windows as VK_LCONTROL

    Vk_left: INTEGER is 37
            -- Declared in Windows as VK_LEFT

    Vk_lmenu: INTEGER is 164
            -- Declared in Windows as VK_LMENU

    Vk_lshift: INTEGER is 160
            -- Declared in Windows as VK_LSHIFT

    Vk_m: INTEGER is 77

    Vk_mbutton: INTEGER is 4
            -- Declared in Windows as VK_MBUTTON

    Vk_menu: INTEGER is 18
            -- Declared in Windows as VK_MENU

    Vk_multiply: INTEGER is 106
            -- Declared in Windows as VK_MULTIPLY

    Vk_n: INTEGER is 78

    Vk_next: INTEGER is 34
            -- Declared in Windows as VK_NEXT

    Vk_numlock: INTEGER is 144
            -- Declared in Windows as VK_NUMLOCK

    Vk_numpad0: INTEGER is 96
            -- Declared in Windows as VK_NUMPAD0

    Vk_numpad1: INTEGER is 97
            -- Declared in Windows as VK_NUMPAD1

    Vk_numpad2: INTEGER is 98
            -- Declared in Windows as VK_NUMPAD2

    Vk_numpad3: INTEGER is 99
            -- Declared in Windows as VK_NUMPAD3

    Vk_numpad4: INTEGER is 100
            -- Declared in Windows as VK_NUMPAD4

    Vk_numpad5: INTEGER is 101
            -- Declared in Windows as VK_NUMPAD5

    Vk_numpad6: INTEGER is 102
            -- Declared in Windows as VK_NUMPAD6

    Vk_numpad7: INTEGER is 103
            -- Declared in Windows as VK_NUMPAD7

    Vk_numpad8: INTEGER is 104
            -- Declared in Windows as VK_NUMPAD8

    Vk_numpad9: INTEGER is 105
            -- Declared in Windows as VK_NUMPAD9

    Vk_o: INTEGER is 79

    Vk_p: INTEGER is 80

    Vk_pause: INTEGER is 19
            -- Declared in Windows as VK_PAUSE

    Vk_print: INTEGER is 42
            -- Declared in Windows as VK_PRINT

    Vk_prior: INTEGER is 33
            -- Declared in Windows as VK_PRIOR

    Vk_q: INTEGER is 81

    Vk_r: INTEGER is 82

    Vk_rbutton: INTEGER is 2
            -- Declared in Windows as VK_RBUTTON

    Vk_rcontrol: INTEGER is 163
            -- Declared in Windows as VK_RCONTROL

    Vk_return: INTEGER is 13
            -- Declared in Windows as VK_RETURN

    Vk_right: INTEGER is 39
            -- Declared in Windows as VK_RIGHT

    Vk_rmenu: INTEGER is 165
            -- Declared in Windows as VK_RMENU
            -- Vk_0 thru Vk_9 are the same as their ASCII equivalents: '0' thru '9'.

    Vk_rshift: INTEGER is 161
            -- Declared in Windows as VK_RSHIFT

    Vk_s: INTEGER is 83

    Vk_scroll: INTEGER is 145
            -- Declared in Windows as VK_SCROLL

    Vk_select: INTEGER is 41
            -- Declared in Windows as VK_SELECT

    Vk_separator: INTEGER is 108
            -- Declared in Windows as VK_SEPARATOR

    Vk_shift: INTEGER is 16
            -- Declared in Windows as VK_SHIFT

    Vk_snapshot: INTEGER is 44
            -- Declared in Windows as VK_SNAPSHOT

    Vk_space: INTEGER is 32
            -- Declared in Windows as VK_SPACE

    Vk_subtract: INTEGER is 109
            -- Declared in Windows as VK_SUBTRACT

    Vk_t: INTEGER is 84

    Vk_tab: INTEGER is 9
            -- Declared in Windows as VK_TAB

    Vk_u: INTEGER is 85

    Vk_up: INTEGER is 38
            -- Declared in Windows as VK_UP

    Vk_v: INTEGER is 86

    Vk_w: INTEGER is 87

    Vk_x: INTEGER is 88

    Vk_y: INTEGER is 89

    Vk_z: INTEGER is 90

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_INPUT_CONSTANTS


WEL_LIST_VIEW_CONSTANTS Chart

class
    WEL_LIST_VIEW_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "ListView Control Constants."

Ancestors
    ANY

Queries
    Hdn_begindrag: INTEGER
    Hdn_begintrack: INTEGER
    Hdn_begintracka: INTEGER
    Hdn_begintrackw: INTEGER
    Hdn_dividerdblclick: INTEGER
    Hdn_dividerdblclicka: INTEGER
    Hdn_dividerdblclickw: INTEGER
    Hdn_enddrag: INTEGER
    Hdn_endtrack: INTEGER
    Hdn_endtracka: INTEGER
    Hdn_endtrackw: INTEGER
    Hdn_getdispinfo: INTEGER
    Hdn_getdispinfoa: INTEGER
    Hdn_getdispinfow: INTEGER
    Hdn_itemchanged: INTEGER
    Hdn_itemchangeda: INTEGER
    Hdn_itemchangedw: INTEGER
    Hdn_itemchanging: INTEGER
    Hdn_itemchanginga: INTEGER
    Hdn_itemchangingw: INTEGER
    Hdn_itemclick: INTEGER
    Hdn_itemclicka: INTEGER
    Hdn_itemclickw: INTEGER
    Hdn_itemdblclick: INTEGER
    Hdn_itemdblclicka: INTEGER
    Hdn_itemdblclickw: INTEGER
    Hdn_track: INTEGER
    Hdn_tracka: INTEGER
    Hdn_trackw: INTEGER
    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
    Lvcf_fmt: INTEGER
    Lvcf_image: INTEGER
    Lvcf_subitem: INTEGER
    Lvcf_text: INTEGER
    Lvcf_width: INTEGER
    Lvcfmt_center: INTEGER
    Lvcfmt_justifymask: INTEGER
    Lvcfmt_left: INTEGER
    Lvcfmt_right: INTEGER
    Lvfi_nearestxy: INTEGER
    Lvfi_param: INTEGER
    Lvfi_partial: INTEGER
    Lvfi_string: INTEGER
    Lvfi_wrap: INTEGER
    Lvht_above: INTEGER
    Lvht_below: INTEGER
    Lvht_nowhere: INTEGER
    Lvht_onitemicon: INTEGER
    Lvht_onitemlabel: INTEGER
    Lvht_onitemstateicon: INTEGER
    Lvht_toleft: INTEGER
    Lvht_toright: INTEGER
    Lvif_image: INTEGER
    Lvif_param: INTEGER
    Lvif_state: INTEGER
    Lvif_text: INTEGER
    Lvir_bounds: INTEGER
    Lvir_icon: INTEGER
    Lvir_label: INTEGER
    Lvir_selectbounds: INTEGER
    Lvis_cut: INTEGER
    Lvis_drophilited: INTEGER
    Lvis_focused: INTEGER
    Lvis_selected: INTEGER
    Lvm_approximateviewrect: INTEGER
    Lvm_arrange: INTEGER
    Lvm_createdragimage: INTEGER
    Lvm_deleteallitems: INTEGER
    Lvm_deletecolumn: INTEGER
    Lvm_deleteitem: INTEGER
    Lvm_editlabel: INTEGER
    Lvm_ensurevisible: INTEGER
    Lvm_finditem: INTEGER
    Lvm_getbkcolor: INTEGER
    Lvm_getbkimage: INTEGER
    Lvm_getcallbackmask: INTEGER
    Lvm_getcolumn: INTEGER
    Lvm_getcolumnorderarray: INTEGER
    Lvm_getcolumnwidth: INTEGER
    Lvm_getcountperpage: INTEGER
    Lvm_geteditcontrol: INTEGER
    Lvm_getextendedlistviewstyle: INTEGER
    Lvm_getheader: INTEGER
    Lvm_gethotcursor: INTEGER
    Lvm_gethotitem: INTEGER
    Lvm_gethovertime: INTEGER
    Lvm_getimagelist: INTEGER
    Lvm_getisearchstring: INTEGER
    Lvm_getitem: INTEGER
    Lvm_getitemcount: INTEGER
    Lvm_getitemposition: INTEGER
    Lvm_getitemrect: INTEGER
    Lvm_getitemspacing: INTEGER
    Lvm_getitemstate: INTEGER
    Lvm_getitemtext: INTEGER
    Lvm_getnextitem: INTEGER
    Lvm_getnumberofworkareas: INTEGER
    Lvm_getorigin: INTEGER
    Lvm_getselectedcount: INTEGER
    Lvm_getstringwidth: INTEGER
    Lvm_getsubitemrect: INTEGER
    Lvm_gettextbkcolor: INTEGER
    Lvm_gettextcolor: INTEGER
    Lvm_gettooltips: INTEGER
    Lvm_gettopindex: INTEGER
    Lvm_getunicodeformat: INTEGER
    Lvm_getviewrect: INTEGER
    Lvm_getworkareas: INTEGER
    Lvm_hittest: INTEGER
    Lvm_insertcolumn: INTEGER
    Lvm_insertitem: INTEGER
    Lvm_redrawitems: INTEGER
    Lvm_scroll: INTEGER
    Lvm_setbkcolor: INTEGER
    Lvm_setbkimage: INTEGER
    Lvm_setcallbackmask: INTEGER
    Lvm_setcolumn: INTEGER
    Lvm_setcolumnwidth: INTEGER
    Lvm_setextendedlistviewstyle: INTEGER
    Lvm_sethotcursor: INTEGER
    Lvm_sethotitem: INTEGER
    Lvm_sethovertime: INTEGER
    Lvm_setimagelist: INTEGER
    Lvm_setitem: INTEGER
    Lvm_setitemcount: INTEGER
    Lvm_setitemposition: INTEGER
    Lvm_setitemposition32: INTEGER
    Lvm_setitemstate: INTEGER
    Lvm_setitemtext: INTEGER
    Lvm_setselectionmark: INTEGER
    Lvm_settextbkcolor: INTEGER
    Lvm_settextcolor: INTEGER
    Lvm_settooltips: INTEGER
    Lvm_setunicodeformat: INTEGER
    Lvm_setworkareas: INTEGER
    Lvm_sortitems: INTEGER
    Lvm_subitemhittest: INTEGER
    Lvm_update: INTEGER
    Lvn_begindrag: INTEGER
    Lvn_beginlabeledit: INTEGER
    Lvn_beginrdrag: INTEGER
    Lvn_columnclick: INTEGER
    Lvn_deleteallitems: INTEGER
    Lvn_deleteitem: INTEGER
    Lvn_endlabeledit: INTEGER
    Lvn_getdispinfo: INTEGER
    Lvn_getinfotip: INTEGER
    Lvn_insertitem: INTEGER
    Lvn_itemchanged: INTEGER
    Lvn_itemchanging: INTEGER
    Lvn_keydown: INTEGER
    Lvn_marqueebegin: INTEGER
    Lvn_setdispinfo: INTEGER
    Lvni_above: INTEGER
    Lvni_all: INTEGER
    Lvni_below: INTEGER
    Lvni_cut: INTEGER
    Lvni_drophilited: INTEGER
    Lvni_focused: INTEGER
    Lvni_selected: INTEGER
    Lvni_toleft: INTEGER
    Lvni_toright: INTEGER
    Lvs_alignleft: INTEGER
    Lvs_aligntop: INTEGER
    Lvs_autoarrange: INTEGER
    Lvs_editlabels: INTEGER
    Lvs_ex_checkboxes: INTEGER
    Lvs_ex_flatsb: INTEGER
    Lvs_ex_fullrowselect: INTEGER
    Lvs_ex_gridlines: INTEGER
    Lvs_ex_headerdragdrop: INTEGER
    Lvs_ex_infotip: INTEGER
    Lvs_ex_labeltip: INTEGER
    Lvs_ex_multiworkareas: INTEGER
    Lvs_ex_oneclickactivate: INTEGER
    Lvs_ex_regional: INTEGER
    Lvs_ex_subitemimages: INTEGER
    Lvs_ex_trackselect: INTEGER
    Lvs_ex_twoclickactivate: INTEGER
    Lvs_ex_underlinecold: INTEGER
    Lvs_ex_underlinehot: INTEGER
    Lvs_icon: INTEGER
    Lvs_list: INTEGER
    Lvs_nocolumnheader: INTEGER
    Lvs_nolabelwrap: INTEGER
    Lvs_noscroll: INTEGER
    Lvs_nosortheader: INTEGER
    Lvs_ownerdrawfixed: INTEGER
    Lvs_report: INTEGER
    Lvs_shareimagelists: INTEGER
    Lvs_showselalways: INTEGER
    Lvs_singlesel: INTEGER
    Lvs_smallicon: INTEGER
    Lvs_sortascending: INTEGER
    Lvs_sortdescending: INTEGER
    Lvscw_autosize: INTEGER
    Lvscw_autosize_useheader: INTEGER
    Lvsil_normal: INTEGER
    Lvsil_small: INTEGER
    Lvsil_state: INTEGER
    valid_lvcfmt_constant (value: INTEGER): BOOLEAN
    valid_lvis_constants (value: INTEGER): BOOLEAN


WEL_LIST_VIEW_CONSTANTS Flat contracts

indexing
    description: "ListView Control Constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:07 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LIST_VIEW_CONSTANTS

feature -- Column Flags (Format)

    Lvcfmt_center: INTEGER is 2
            -- alignment of the column : center.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_CENTER

    Lvcfmt_justifymask: INTEGER is 3
            -- alignment of the column : justify.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_JUSTIFYMASK

    Lvcfmt_left: INTEGER is 0
            -- alignment of the column : left.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_LEFT

    Lvcfmt_right: INTEGER is 1
            -- alignment of the column : right.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_RIGHT

feature -- Column Flags (General)

    Lvcf_fmt: INTEGER is 1
            -- The fmt member is valid.
            --
            -- Declared in Windows as LVCF_FMT

    Lvcf_image: INTEGER is 16
            -- The ilmage member is valid
            --
            -- Declared in Windows as LVCF_IMAGE

    Lvcf_subitem: INTEGER is 8
            -- The iSubItem member is valid.
            --
            -- Declared in Windows as LVCF_SUBITEM

    Lvcf_text: INTEGER is 4
            -- The pszText member is valid.
            --
            -- Declared in Windows as LVCF_TEXT

    Lvcf_width: INTEGER is 2
            -- The cx member is valid.
            --
            -- Declared in Windows as LVCF_WIDTH

feature -- Column Flags (Width)

    Lvscw_autosize: INTEGER is -1
            -- Automatically sizes the column.
            --
            -- Declared in Windows as LVSCW_AUTOSIZE

    Lvscw_autosize_useheader: INTEGER is -2
            -- Automatically sizes the column to fit the
            -- header text. If you use this value with the last
            -- column, its width is set to fill the remaining
            -- width of the list view control.
            --
            -- Declared in Windows as LVSCW_AUTOSIZE_USEHEADER

feature -- Extended Style

    Lvs_ex_checkboxes: INTEGER is 4
            -- Version 4.70.
            -- Enables check boxes for items in a list view
            -- control. Effectively, when set to this style, the control
            -- will create and set a state image list using
            -- DrawFrameControl. Check boxes are visible and functional
            -- with all list view modes. You can obtain the state of the
            -- check box for a given item with ListView_GetCheckState. To
            -- set the check state, use ListView_SetCheckState.

    Lvs_ex_flatsb: INTEGER is 256
            -- Version 4.71.
            -- Enables flat scroll bars in the list view.
            -- If you need more control over the appearance of the list
            -- view's scroll bars, you should manipulate the list view's
            -- scroll bars directly using the Flat Scroll Bar APIs. If
            -- the system metrics change, you are responsible for adjusting
            -- the scrollbar metrics with FlatSB_SetScrollProp. See Flat
            -- Scroll Bars for further details.

    Lvs_ex_fullrowselect: INTEGER is 32
            -- Version 4.70.
            -- When an item is selected, the item and all its subitems are
            -- highlighted. This style is available only in conjunction
            -- with the LVS_REPORT style.

    Lvs_ex_gridlines: INTEGER is 1
            -- Version 4.70. Displays gridlines around items and subitems.
            -- This style is available only in conjunction with the LVS_REPORT
            -- style.

    Lvs_ex_headerdragdrop: INTEGER is 16
            -- Version 4.70. Enables drag-and-drop reordering of columns in
            -- a list view control. This style is only available to list
            -- view controls that use the LVS_REPORT style.

    Lvs_ex_infotip: INTEGER is 1024
            -- Version 4.71. When a list view control uses the
            -- LVS_EX_INFOTIP style, the LVN_GETINFOTIP notification message
            -- is sent to the parent window before displaying an item's
            -- tooltip.

    Lvs_ex_labeltip: INTEGER is 16384
            -- Version 5.80. If a partially hidden label in any list view
            -- mode lacks tooltip text, the list view control will unfold
            -- the label. If this style is not set, the list view control
            -- will unfold partly hidden labels only for the large icon mode.

    Lvs_ex_multiworkareas: INTEGER is 8192
            -- Version 4.71. If the list view control has the LVS_AUTOARRANGE
            -- style, the control will not autoarrange its icons until one or
            -- more work areas are defined (see LVM_SETWORKAREAS). To be
            -- effective, this style must be set before any work areas are
            -- defined and any items have been added to the control.

    Lvs_ex_oneclickactivate: INTEGER is 64
            -- Version 4.70. The list view control sends an LVN_ITEMACTIVATE
            -- notification message to the parent window when the user clicks
            -- an item. This style also enables hot tracking in the list view
            -- control. Hot tracking means that when the cursor moves over an
            -- item, it is highlighted but not selected. See the Remarks for a
            -- discussion of item activation.

    Lvs_ex_regional: INTEGER is 512
            -- Version 4.71. The list view will create a region that includes
            -- only the item icons and text and set its window region to that
            -- using SetWindowRgn. This will exclude any area that is not part
            -- of an item from the window region. This style is only available
            -- to list view controls that use the LVS_ICON style.

    Lvs_ex_subitemimages: INTEGER is 2
            -- Version 4.70. Allows images to be displayed for subitems.
            -- This style is available only in conjunction with the LVS_REPORT
            -- style.

    Lvs_ex_trackselect: INTEGER is 8
            -- Version 4.70. Enables hot-track selection in a list view
            -- control. Hot track selection means that an item is
            -- automatically selected when the cursor remains over the item
            -- for a certain period of time. The delay can be changed from
            -- the default system setting with a LVM_SETHOVERTIME message.
            -- This style applies to all styles of list view control. You
            -- can check whether or not hot-track selection is enabled by
            -- calling SystemParametersInfo.

    Lvs_ex_twoclickactivate: INTEGER is 128
            -- Version 4.70. The list view control sends an LVN_ITEMACTIVATE
            -- notification message to the parent window when the user
            -- double-clicks an item. This style also enables hot tracking
            -- in the list view control. Hot tracking means that when the
            -- cursor moves over an item, it is highlighted but not
            -- selected. See the Remarks for a discussion of item
            -- activation.

    Lvs_ex_underlinecold: INTEGER is 4096
            -- Version 4.71. Causes non-hot items that are activatable to be
            -- displayed with underlined text. This style requires that
            -- LVS_EX_TWOCLICKACTIVATE also be set. See the Remarks for a
            -- discussion of item activation.

    Lvs_ex_underlinehot: INTEGER is 2048
            -- Version 4.71. Causes hot items that are activatable to be
            -- displayed with underlined text. This style requires that
            -- LVS_EX_ONECLICKACTIVATE or LVS_EX_TWOCLICKACTIVATE also be
            -- set. See the Remarks for a discussion of item activation.

feature -- Flags defining search in a list view.

    Lvfi_nearestxy: INTEGER is 64
            -- Search item nearest specified position in specified direction
            --
            -- Declared in Windows as LVFI_NEARESTXY

    Lvfi_param: INTEGER is 1
            -- Search item with corresponding lparam attribute
            --
            -- Declared in Windows as LVFI_PARAM

    Lvfi_partial: INTEGER is 8
            -- Search item including given string
            --
            -- Declared in Windows as LVFI_PARTIAL

    Lvfi_string: INTEGER is 2
            -- Search item with exact corresponding string
            --
            -- Declared in Windows as LVFI_STRING

    Lvfi_wrap: INTEGER is 32
            -- Start search from start when end of list view is reached
            --
            -- Declared in Windows as LVFI_WRAP

feature -- Header Notifications.

    Hdn_begindrag: INTEGER is -310
            -- Version 4.70 and later of Comctl32.dll
            -- Sent by a header control when a drag operation has begun on
            -- one of its items. This notification message is sent only by
            -- header controls that are set to the HDS_DRAGDROP style. This
            -- notification is sent in the form of a WM_NOTIFY message.
            --
            -- Declared in Windows as HDN_BEGINDRAG

    Hdn_begintrack: INTEGER is -306
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_begintracka.

    Hdn_begintracka: INTEGER is -306
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_begintrack.

    Hdn_begintrackw: INTEGER is -326
            -- Notifies a header control's parent window that the user has
            -- begun dragging a divider in the control (that is, the user
            -- has pressed the left mouse button while the mouse cursor is
            -- on a divider in the header control). This notification
            -- message is sent in the form of a WM_NOTIFY message.
            --
            -- Declared in Windows as HDN_BEGINTRACK

    Hdn_dividerdblclick: INTEGER is -305
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_dividerdblclicka.

    Hdn_dividerdblclicka: INTEGER is -305
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_dividerdblclick.

    Hdn_dividerdblclickw: INTEGER is -325
            -- Notifies a header control's parent window that the user
            -- double-clicked the divider area of the control. This
            -- notification message is sent in the form of a WM_NOTIFY
            -- message.
            --
            -- Declared in Windows as HDN_DIVIDERDBLCLICK

    Hdn_enddrag: INTEGER is -311
            -- Version 4.70 and later of Comctl32.dll
            -- Sent by a header control when a drag operation has ended on
            -- one of its items. This notification is sent as a WM_NOTIFY
            -- message. Only header controls that are set to the
            -- HDS_DRAGDROP style send this notification.
            --
            -- Declared in Windows as HDN_ENDDRAG

    Hdn_endtrack: INTEGER is -307
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_endtracka.

    Hdn_endtracka: INTEGER is -307
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_endtrack.

    Hdn_endtrackw: INTEGER is -327
            -- Notifies a header control's parent window that the user has
            -- finished dragging a divider. This notification message sent
            -- in the form of a WM_NOTIFY message.
            --
            -- Declared in Windows as HDN_ENDTRACK

    Hdn_getdispinfo: INTEGER is -309
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_getdispinfoa.

    Hdn_getdispinfoa: INTEGER is -309
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_getdispinfo.

    Hdn_getdispinfow: INTEGER is -329
            -- Version 4.70 and later of Comctl32.dll
            -- Notifies the header control's parent window when the filter
            -- button is clicked or in response to an HDM_SETITEM message.
            --
            -- Declared in Windows as HDN_GETDISPINFO

    Hdn_itemchanged: INTEGER is -301
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemchangeda.

    Hdn_itemchangeda: INTEGER is -301
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemchanged.

    Hdn_itemchangedw: INTEGER is -321
            -- Notifies a header control's parent window that the attributes
            -- of a header item have changed. This notification message is
            -- sent in the form of a WM_NOTIFY message.
            --
            -- Declared in Windows as HDN_ITEMCHANGED

    Hdn_itemchanging: INTEGER is -300
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemchanginga.

    Hdn_itemchanginga: INTEGER is -300
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemchanging.

    Hdn_itemchangingw: INTEGER is -320
            -- Notifies a header control's parent window that the attributes
            -- of a header item are about to change. This notification
            -- message is sent in the form of a WM_NOTIFY message.
            --
            -- Declared in Windows as HDN_ITEMCHANGING

    Hdn_itemclick: INTEGER is -302
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemclicka.

    Hdn_itemclicka: INTEGER is -302
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemclick.

    Hdn_itemclickw: INTEGER is -322
            -- Notifies a header control's parent window that the user
            -- clicked the control. This notification message is sent in the
            -- form of a WM_NOTIFY message.
            --
            -- Declared in Windows as HDN_ITEMCLICK

    Hdn_itemdblclick: INTEGER is -303
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemdblclicka.

    Hdn_itemdblclicka: INTEGER is -303
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_itemdblclick.

    Hdn_itemdblclickw: INTEGER is -323
            -- Notifies a header control's parent window that the user
            -- double-clicked the control. This notification message is sent
            -- in the form of a WM_NOTIFY message. Only header controls that
            -- are set to the HDS_BUTTONS style send this notification.
            --
            -- Declared in Windows as HDN_ITEMDBLCLICK

    Hdn_track: INTEGER is -308
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_tracka.

    Hdn_tracka: INTEGER is -308
            -- Was declared in WEL_LIST_VIEW_CONSTANTS as synonym of hdn_track.

    Hdn_trackw: INTEGER is -328
            -- Notifies a header control's parent window that the user is
            -- dragging a divider in the header control. This notification
            -- message is sent in the form of a WM_NOTIFY message.
            --
            -- Declared in Windows as HDN_TRACK

feature -- HitTest Info.

    Lvht_above: INTEGER is 8
            -- Above the client area.
            --
            -- Declared in Windows as LVHT_ABOVE

    Lvht_below: INTEGER is 16
            -- Below the client area.
            --
            -- Declared in Windows as LVHT_BELOW

    Lvht_nowhere: INTEGER is 1
            -- In the client area, but below the last item.
            --
            -- Declared in Windows as LVHT_NOWHERE

    Lvht_onitemicon: INTEGER is 2
            -- On the button associated with an item.
            --
            -- Declared in Windows as LVHT_ONITEMICON

    Lvht_onitemlabel: INTEGER is 4
            -- On the label (string) associated with an item.
            --
            -- Declared in Windows as LVHT_ONITEMLABEL

    Lvht_onitemstateicon: INTEGER is 8
            -- On the state icon for a tree view item that is in
            -- a user-defines state.
            --
            -- Declared in Windows as LVHT_ONITEMSTATEICON

    Lvht_toleft: INTEGER is 64
            -- To the left of the client area.
            --
            -- Declared in Windows as LVHT_TOLEFT

    Lvht_toright: INTEGER is 32
            -- To the right of the client area.
            --
            -- Declared in Windows as LVHT_TORIGHT

feature -- ImageList State

    Lvsil_normal: INTEGER is 0
            -- Indicates the normal image list, which contains
            -- selected, nonselected, and overlay images for the
            -- items of a list view control.
            -- This image list represents the large icons.
            --
            -- Declared in Windows as LVSIL_NORMAL

    Lvsil_small: INTEGER is 1
            -- Indicates the normal image list, which contains
            -- selected, nonselected, and overlay images for the
            -- items of a list view control.
            -- This image list represents the small icons.
            --
            -- Declared in Windows as LVSIL_SMALL

    Lvsil_state: INTEGER is 2
            -- Indicates the state image list. You can use state
            -- images to indicate application-defined item states.
            -- A state image is displayed to the left of an item's
            -- selected or nonselected image.
            --
            -- Declared in Windows as LVSIL_STATE

feature -- Item Styles

    Lvis_cut: INTEGER is 4
            -- The item is marked for a cut and paste operation.
            --
            -- Declared in Windows as LVIS_CUT

    Lvis_drophilited: INTEGER is 8
            -- The item is highlighted as a drag-and-dop target.
            --
            -- Declared in Windows as LVIS_DROPHILITED

    Lvis_focused: INTEGER is 1
            -- The item has the focus.
            --
            -- Declared in Windows as LVIS_FOCUSED

    Lvis_selected: INTEGER is 2
            -- The item is selected.
            --
            -- Declared in Windows as LVIS_SELECTED

feature -- Item flags

    Lvif_image: INTEGER is 2
            -- The iImage member is valid.
            --
            -- Declared in Windows as LVIF_IMAGE

    Lvif_param: INTEGER is 4
            -- The lParam member is valid.
            --
            -- Declared in Windows as LVIF_PARAM

    Lvif_state: INTEGER is 8
            -- The state member is valid
            --
            -- Declared in Windows as LVIF_STATE

    Lvif_text: INTEGER is 1
            -- The pszText member is valid.
            --
            -- Declared in Windows as LVIF_TEXT

feature -- List View Item Rectangle constants.

    Lvir_bounds: INTEGER is 0
            -- Returns the bounding rectangle of the entire item, including
            -- the icon and label.
            --
            -- Declared in Windows as LVIR_BOUNDS

    Lvir_icon: INTEGER is 1
            -- Returns the bounding rectangle of the icon or small icon.
            --
            -- Declared in Windows as LVIR_ICON

    Lvir_label: INTEGER is 2
            -- Returns the bounding rectangle of the item text.
            --
            -- Declared in Windows as LVIR_LABEL

    Lvir_selectbounds: INTEGER is 3
            -- Returns the union of the LVIR_ICON and LVIR_LABEL rectangles,
            -- but excludes columns in report view.
            --
            -- Declared in Windows as LVIR_SELECTBOUNDS

feature -- Messages

    Lvm_approximateviewrect: INTEGER is 4160
            -- Version 4.70. Calculates the approximate width and height
            -- required to display a given number of items.
            --
            -- Declared in Windows as LVM_APPROXIMATEVIEWRECT

    Lvm_arrange: INTEGER is 4118
            -- Declared in Windows as LVM_ARRANGE

    Lvm_createdragimage: INTEGER is 4129
            -- Declared in Windows as LVM_CREATEDRAGIMAGE

    Lvm_deleteallitems: INTEGER is 4105
            -- Declared in Windows as LVM_DELETEALLITEMS

    Lvm_deletecolumn: INTEGER is 4124
            -- Declared in Windows as LVM_DELETECOLUMN

    Lvm_deleteitem: INTEGER is 4104
            -- Declared in Windows as LVM_DELETEITEM

    Lvm_editlabel: INTEGER is 4119
            -- Declared in Windows as LVM_EDITLABEL

    Lvm_ensurevisible: INTEGER is 4115
            -- Declared in Windows as LVM_ENSUREVISIBLE

    Lvm_finditem: INTEGER is 4109
            -- Declared in Windows as LVM_FINDITEM

    Lvm_getbkcolor: INTEGER is 4096
            -- Declared in Windows as LVM_GETBKCOLOR

    Lvm_getbkimage: INTEGER is 4165
            -- Version 4.71. Retrieves the background image in a list view
            -- control.
            --
            -- Declared in Windows as LVM_GETBKIMAGE

    Lvm_getcallbackmask: INTEGER is 4106
            -- Declared in Windows as LVM_GETCALLBACKMASK

    Lvm_getcolumn: INTEGER is 4121
            -- Declared in Windows as LVM_GETCOLUMN

    Lvm_getcolumnorderarray: INTEGER is 4155
            -- Version 4.70. Retrieves the current left-to-right order of
            -- columns in a list view control.
            --
            -- Declared in Windows as LVM_GETCOLUMNORDERARRAY

    Lvm_getcolumnwidth: INTEGER is 4125
            -- Declared in Windows as LVM_GETCOLUMNWIDTH

    Lvm_getcountperpage: INTEGER is 4136
            -- Declared in Windows as LVM_GETCOUNTPERPAGE

    Lvm_geteditcontrol: INTEGER is 4120
            -- Declared in Windows as LVM_GETEDITCONTROL

    Lvm_getextendedlistviewstyle: INTEGER is 4151
            -- Version 4.70. Retrieves the extended styles that are
            -- currently in use for a given list view control.
            --
            -- Declared in Windows as LVM_GETEXTENDEDLISTVIEWSTYLE

    Lvm_getheader: INTEGER is 4127
            -- Version 4.70. Retrieves the handle to the header control used
            -- by the list view control.
            --
            -- Declared in Windows as LVM_GETHEADER

    Lvm_gethotcursor: INTEGER is 4159
            -- Version 4.70. Retrieves the HCURSOR value used when the
            -- pointer is over an item while hot tracking is enabled
            --
            -- Declared in Windows as LVM_GETHOTCURSOR

    Lvm_gethotitem: INTEGER is 4157
            -- Version 4.70. Retrieves the index of the hot item.
            --
            -- Declared in Windows as LVM_GETHOTITEM

    Lvm_gethovertime: INTEGER is 4168
            -- Version 4.71. Retrieves the amount of time that the mouse
            -- cursor must hover over an item before it is selected.
            --
            -- Declared in Windows as LVM_GETHOVERTIME

    Lvm_getimagelist: INTEGER is 4098
            -- Declared in Windows as LVM_GETIMAGELIST

    Lvm_getisearchstring: INTEGER is 4148
            -- Declared in Windows as LVM_GETISEARCHSTRING

    Lvm_getitem: INTEGER is 4101
            -- Declared in Windows as LVM_GETITEM

    Lvm_getitemcount: INTEGER is 4100
            -- Declared in Windows as LVM_GETITEMCOUNT

    Lvm_getitemposition: INTEGER is 4112
            -- Declared in Windows as LVM_GETITEMPOSITION

    Lvm_getitemrect: INTEGER is 4110
            -- Declared in Windows as LVM_GETITEMRECT

    Lvm_getitemspacing: INTEGER is 4147
            -- Declared in Windows as LVM_GETITEMSPACING

    Lvm_getitemstate: INTEGER is 4140
            -- Declared in Windows as LVM_GETITEMSTATE

    Lvm_getitemtext: INTEGER is 4141
            -- Declared in Windows as LVM_GETITEMTEXT

    Lvm_getnextitem: INTEGER is 4108
            -- Declared in Windows as LVM_GETNEXTITEM

    Lvm_getnumberofworkareas: INTEGER is 4169
            -- Version 4.71. Retrieves the number of working areas in a list
            -- view control.
            --
            -- Declared in Windows as LVM_GETNUMBEROFWORKAREAS

    Lvm_getorigin: INTEGER is 4137
            -- Declared in Windows as LVM_GETORIGIN

    Lvm_getselectedcount: INTEGER is 4146
            -- Declared in Windows as LVM_GETSELECTEDCOUNT

    Lvm_getstringwidth: INTEGER is 4113
            -- Declared in Windows as LVM_GETSTRINGWIDTH

    Lvm_getsubitemrect: INTEGER is 4152
            -- Version 4.70. Retrieves information about the bounding
            -- rectangle for a subitem in a list view control.
            -- This message is intended to be used only with list view
            -- controls that use the Lvs_report style.
            --
            -- Declared in Windows as LVM_GETSUBITEMRECT

    Lvm_gettextbkcolor: INTEGER is 4133
            -- Declared in Windows as LVM_GETTEXTBKCOLOR

    Lvm_gettextcolor: INTEGER is 4131
            -- Declared in Windows as LVM_GETTEXTCOLOR

    Lvm_gettooltips: INTEGER is 4174
            -- Retrieves the tooltip control that the list
            -- view control uses to display tooltips.
            --
            -- Declared in Windows as LVM_GETTOOLTIPS

    Lvm_gettopindex: INTEGER is 4135
            -- Declared in Windows as LVM_GETTOPINDEX

    Lvm_getunicodeformat: INTEGER is 8198
            -- Retrieves the UNICODE character format flag for
            -- the control
            --
            -- Declared in Windows as LVM_GETUNICODEFORMAT

    Lvm_getviewrect: INTEGER is 4130
            -- Declared in Windows as LVM_GETVIEWRECT

    Lvm_getworkareas: INTEGER is 4166
            -- Version 4.71. Retrieves the UNICODE character format flag for
            -- the control
            --
            -- Declared in Windows as LVM_GETWORKAREAS

    Lvm_hittest: INTEGER is 4114
            -- Declared in Windows as LVM_HITTEST

    Lvm_insertcolumn: INTEGER is 4123
            -- Declared in Windows as LVM_INSERTCOLUMN

    Lvm_insertitem: INTEGER is 4103
            -- Declared in Windows as LVM_INSERTITEM

    Lvm_redrawitems: INTEGER is 4117
            -- Declared in Windows as LVM_REDRAWITEMS

    Lvm_scroll: INTEGER is 4116
            -- Declared in Windows as LVM_SCROLL

    Lvm_setbkcolor: INTEGER is 4097
            -- Declared in Windows as LVM_SETBKCOLOR

    Lvm_setbkimage: INTEGER is 4164
            -- Version 4.71. Retrieves the UNICODE character format flag for
            -- the control
            --
            -- Declared in Windows as LVM_SETBKIMAGE

    Lvm_setcallbackmask: INTEGER is 4107
            -- Declared in Windows as LVM_SETCALLBACKMASK

    Lvm_setcolumn: INTEGER is 4122
            -- Declared in Windows as LVM_SETCOLUMN

    Lvm_setcolumnwidth: INTEGER is 4126
            -- Declared in Windows as LVM_SETCOLUMNWIDTH

    Lvm_setextendedlistviewstyle: INTEGER is 4150
            -- Version 4.70. Sets extended styles in list view controls.
            --
            -- Declared in Windows as LVM_SETEXTENDEDLISTVIEWSTYLE

    Lvm_sethotcursor: INTEGER is 4158
            -- Version 4.70. Sets the HCURSOR value that the list view
            -- control uses when the pointer is over an item while hot
            -- tracking is enabled. To check whether or not
            -- hot tracking is enabled, call SystemParametersInfo.
            --
            -- Declared in Windows as LVM_SETHOTCURSOR

    Lvm_sethotitem: INTEGER is 4156
            -- Version 4.70.
            --
            -- Declared in Windows as LVM_SETHOTITEM

    Lvm_sethovertime: INTEGER is 4167
            -- Version 4.71. Sets the hot item for a list view control.
            --
            -- Declared in Windows as LVM_SETHOVERTIME

    Lvm_setimagelist: INTEGER is 4099
            -- Declared in Windows as LVM_SETIMAGELIST

    Lvm_setitem: INTEGER is 4102
            -- Declared in Windows as LVM_SETITEM

    Lvm_setitemcount: INTEGER is 4143
            -- Declared in Windows as LVM_SETITEMCOUNT

    Lvm_setitemposition: INTEGER is 4111
            -- Declared in Windows as LVM_SETITEMPOSITION

    Lvm_setitemposition32: INTEGER is 4145
            -- Declared in Windows as LVM_SETITEMPOSITION32

    Lvm_setitemstate: INTEGER is 4139
            -- Declared in Windows as LVM_SETITEMSTATE

    Lvm_setitemtext: INTEGER is 4142
            -- Declared in Windows as LVM_SETITEMTEXT

    Lvm_setselectionmark: INTEGER is 4163
            -- Version 4.71. Sets the selection mark in a list view control.
            --
            -- Declared in Windows as LVM_SETSELECTIONMARK

    Lvm_settextbkcolor: INTEGER is 4134
            -- Declared in Windows as LVM_SETTEXTBKCOLOR

    Lvm_settextcolor: INTEGER is 4132
            -- Declared in Windows as LVM_SETTEXTCOLOR

    Lvm_settooltips: INTEGER is 4170
            -- Sets the tooltip control that the list view
            -- control will use to display tooltips. You can send this
            -- message explicitly or use the ListView_SetToolTips macro
            --
            -- Declared in Windows as LVM_SETTOOLTIPS

    Lvm_setunicodeformat: INTEGER is 8197
            -- Sets the UNICODE character format flag for the
            -- control. This message allows you to change the character set
            -- used by the control at run time rather than having to re
            -- create the control.
            --
            -- Declared in Windows as LVM_SETUNICODEFORMAT

    Lvm_setworkareas: INTEGER is 4161
            -- Version 4.71. Sets the working areas within a list view
            -- control.
            --
            -- Declared in Windows as LVM_SETWORKAREAS

    Lvm_sortitems: INTEGER is 4144
            -- Declared in Windows as LVM_SORTITEMS

    Lvm_subitemhittest: INTEGER is 4153
            -- Version 4.70. Determines which list view item or subitem is
            -- at a given position.
            --
            -- Declared in Windows as LVM_SUBITEMHITTEST

    Lvm_update: INTEGER is 4138
            -- Declared in Windows as LVM_UPDATE

feature -- Next item flags

    Lvni_above: INTEGER is 256
            -- Searches for an item that is above the specified item.
            --
            -- Declared in Windows as LVNI_ABOVE

    Lvni_all: INTEGER is 0
            -- Searches for a subsequent item by index.
            --
            -- Declared in Windows as LVNI_ALL

    Lvni_below: INTEGER is 512
            -- Searches for an item that is below the specified item.
            --
            -- Declared in Windows as LVNI_BELOW

    Lvni_cut: INTEGER is 4
            -- The item has the LVIS_CUT state flag set.
            --
            -- Declared in Windows as LVNI_CUT

    Lvni_drophilited: INTEGER is 8
            -- The item has the LVIS_DROPHILITED state flag set.
            --
            -- Declared in Windows as LVNI_DROPHILITED

    Lvni_focused: INTEGER is 1
            -- The item has the LVIS_FOCUSED state flag set.
            --
            -- Declared in Windows as LVNI_FOCUSED

    Lvni_selected: INTEGER is 2
            -- The item has the LVIS_SELECTED state flag set.
            --
            -- Declared in Windows as LVNI_SELECTED

    Lvni_toleft: INTEGER is 1024
            -- Searches for an item to the left of the specified item.
            --
            -- Declared in Windows as LVNI_TOLEFT

    Lvni_toright: INTEGER is 2048
            -- Searches for an item to the right of the specified item.
            --
            -- Declared in Windows as LVNI_TORIGHT

feature -- Notifications

    Lvn_begindrag: INTEGER is -109
            -- Declared in Windows as LVN_BEGINDRAG

    Lvn_beginlabeledit: INTEGER is -105
            -- Declared in Windows as LVN_BEGINLABELEDIT

    Lvn_beginrdrag: INTEGER is -111
            -- Declared in Windows as LVN_BEGINRDRAG

    Lvn_columnclick: INTEGER is -108
            -- Declared in Windows as LVN_COLUMNCLICK

    Lvn_deleteallitems: INTEGER is -104
            -- Declared in Windows as LVN_DELETEALLITEMS

    Lvn_deleteitem: INTEGER is -103
            -- Declared in Windows as LVN_DELETEITEM

    Lvn_endlabeledit: INTEGER is -106
            -- Declared in Windows as LVN_ENDLABELEDIT

    Lvn_getdispinfo: INTEGER is -150
            -- Declared in Windows as LVN_GETDISPINFO

    Lvn_getinfotip: INTEGER is -157
            -- Version 4.71 and later of Comctl32.dll
            -- Sent by a large icon view list view control that has the
            -- LVS_EX_INFOTIP extended style. This notification is sent when
            -- the list view control is requesting additional text
            -- information to be displayed in a tooltip. It is sent in the
            -- form of a WM_NOTIFY message.
            --
            -- Declared in Windows as LVN_GETINFOTIP

    Lvn_insertitem: INTEGER is -102
            -- Declared in Windows as LVN_INSERTITEM

    Lvn_itemchanged: INTEGER is -101
            -- Declared in Windows as LVN_ITEMCHANGED

    Lvn_itemchanging: INTEGER is -100
            -- Declared in Windows as LVN_ITEMCHANGING

    Lvn_keydown: INTEGER is -155
            -- Declared in Windows as LVN_KEYDOWN

    Lvn_marqueebegin: INTEGER is -156
            -- Declared in Windows as LVN_MARQUEEBEGIN

    Lvn_setdispinfo: INTEGER is -151
            -- Declared in Windows as LVN_SETDISPINFO

feature -- Style

    Lvs_alignleft: INTEGER is 2048
            -- Items are left-aligned in icon and small icon view.
            --
            -- Declared in Windows as LVS_ALIGNLEFT

    Lvs_aligntop: INTEGER is 0
            -- Items are aligned with the top of the list view control in
            -- icon and small icon view.
            --
            -- Declared in Windows as LVS_ALIGNTOP

    Lvs_autoarrange: INTEGER is 256
            -- Icons are automatically kept arranged in icon and small icon
            -- view.
            --
            -- Declared in Windows as LVS_AUTOARRANGE

    Lvs_editlabels: INTEGER is 512
            -- Item text can be edited in place. The parent window must
            -- process the LVN_ENDLABELEDIT notification message.
            --
            -- Declared in Windows as LVS_EDITLABELS

    Lvs_icon: INTEGER is 0
            -- This style specifies icon view.
            --
            -- Declared in Windows as LVS_ICON

    Lvs_list: INTEGER is 3
            -- This style specifies list view.
            --
            -- Declared in Windows as LVS_LIST

    Lvs_nocolumnheader: INTEGER is 16384
            -- Declared in Windows as LVS_NOCOLUMNHEADER

    Lvs_nolabelwrap: INTEGER is 128
            -- Item text is displayed on a single line in icon view. By
            -- default, item text may wrap in icon view.
            --
            -- Declared in Windows as LVS_NOLABELWRAP

    Lvs_noscroll: INTEGER is 8192
            -- Scrolling is disabled. All items must be within the client
            -- area. This style is not compatible with the LVS_LIST or
            -- LVS_REPORT styles.
            --
            -- Declared in Windows as LVS_NOSCROLL

    Lvs_nosortheader: INTEGER is 32768
            -- Column headers do not work like buttons. This style can be
            -- used if clicking a column header in report view does not
            -- carry out an action, such as sorting.
            --
            -- Declared in Windows as LVS_NOSORTHEADER

    Lvs_ownerdrawfixed: INTEGER is 1024
            -- The owner window can paint items in report view. The list
            -- view control sends a WM_DRAWITEM message to paint each item;
            -- it does not send separate messages for each subitem. The
            -- itemData member of the DRAWITEMSTRUCT structure contains the
            -- item data for the specified list view item.
            --
            -- Declared in Windows as LVS_OWNERDRAWFIXED

    Lvs_report: INTEGER is 1
            -- This style specifies report view. When using the LVS_REPORT
            -- style with a list view control, the first column is always
            -- left-aligned. You cannot use LVCFMT_RIGHT to change this
            -- alignment. See LVCOLUMN for further information on column
            -- alignment.
            --
            -- Declared in Windows as LVS_REPORT

    Lvs_shareimagelists: INTEGER is 64
            -- The image list will not be deleted when the control is
            -- destroyed. This style enables the use of the same image lists
            -- with multiple list view controls.
            --
            -- Declared in Windows as LVS_SHAREIMAGELISTS

    Lvs_showselalways: INTEGER is 8
            -- The selection, if any, is always shown, even if the control
            -- does not have the focus.
            --
            -- Declared in Windows as LVS_SHOWSELALWAYS

    Lvs_singlesel: INTEGER is 4
            -- Only one item at a time can be selected. By default, multiple
            -- items may be selected.
            --
            -- Declared in Windows as LVS_SINGLESEL

    Lvs_smallicon: INTEGER is 2
            -- This style specifies small icon view.
            --
            -- Declared in Windows as LVS_SMALLICON

    Lvs_sortascending: INTEGER is 16
            -- Item indices are sorted based on item text in ascending
            -- order.
            --
            -- Declared in Windows as LVS_SORTASCENDING

    Lvs_sortdescending: INTEGER is 32
            -- Item indices are sorted based on item text in descending
            -- order.
            --
            -- Declared in Windows as LVS_SORTDESCENDING

feature -- Validation

    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
            -- Is a_flag a valid list view search flag?

    valid_lvcfmt_constant (value: INTEGER): BOOLEAN
            -- Is value a valid lvcfmt constant?

    valid_lvis_constants (value: INTEGER): BOOLEAN
            -- Is value a valid "Item Styles" constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LIST_VIEW_CONSTANTS


WEL_NETWORKING_CONSTANTS Chart

class
    WEL_NETWORKING_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "Networking constants"

Ancestors
    ANY

Queries
    Connect_interactive: INTEGER
    Connect_localdrive: INTEGER
    Connect_prompt: INTEGER
    Connect_redirect: INTEGER
    Connect_update_profile: INTEGER
    Error_access_denied: INTEGER
    Error_already_assigned: INTEGER
    Error_bad_device: INTEGER
    Error_bad_net_name: INTEGER
    Error_bad_provider: INTEGER
    Error_cancelled: INTEGER
    Error_extended_error: INTEGER
    Error_invalid_address: INTEGER
    Error_invalid_parameter: INTEGER
    Error_invalid_password: INTEGER
    Error_more_data: INTEGER
    Error_no_more_items: INTEGER
    Error_no_net_or_bad_path: INTEGER
    Error_no_network: INTEGER
    Max_path: INTEGER
    Resource_connected: INTEGER
    Resource_display_type_domain: INTEGER
    Resource_display_type_generic: INTEGER
    Resource_display_type_server: INTEGER
    Resource_display_type_share: INTEGER
    Resource_globalnet: INTEGER
    Resource_remembered: INTEGER
    Resource_type_any: INTEGER
    Resource_type_disk: INTEGER
    Resource_type_print: INTEGER
    Resource_usage_connectable: INTEGER
    Resource_usage_container: INTEGER


WEL_NETWORKING_CONSTANTS Flat contracts

indexing
    description: "Networking constants"
    date: "$Date: 2001/11/12 17:58:08 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_NETWORKING_CONSTANTS

feature -- Connect constants

    Connect_interactive: INTEGER is 8
            -- If this flag is set, the operating system may interact with
            -- the user for authentication purposes.
            --
            -- Declared in Windows as CONNECT_INTERACTIVE

    Connect_localdrive: INTEGER is 256
            -- If this flag is set, the connection was made using a local
            -- device redirection. If the lpAccessName parameter points to a
            -- buffer, the local device name is copied to the buffer.
            --
            -- Declared in Windows as CONNECT_LOCALDRIVE

    Connect_prompt: INTEGER is 16
            -- This flag instructs the system not to use any default settings
            -- for user names or passwords without offering the user the
            -- opportunity to supply an alternative. This flag is ignored
            -- unless CONNECT_INTERACTIVE is also set.
            --
            -- Declared in Windows as CONNECT_PROMPT

    Connect_redirect: INTEGER is 128
            -- This flag forces the redirection of a local device when making
            -- the connection.
            --
            -- If the lpLocalName member of NETRESOURCE specifies a local
            -- device to redirect, this flag has no effect, because the
            -- operating system still attempts to redirect the specified
            -- device. When the operating system automatically chooses a local
            -- device, the lpAccessName parameter must point to a return
            -- buffer and the dwType member must not be equal to
            -- RESOURCETYPE_ANY.
            --
            -- If this flag is not set, a local device is automatically chosen
            -- for redirection only if the network requires a local device to
            -- be redirected.
            --
            -- Declared in Windows as CONNECT_REDIRECT

    Connect_update_profile: INTEGER is 1
            -- This flag instructs the operating system to store the network
            -- resource connection.
            --
            -- If this bit flag is set, the operating system automatically
            -- attempts to restore the connection when the user logs on. The
            -- system remembers only successful connections that redirect
            -- local devices. It does not remember connections that are
            -- unsuccessful or deviceless connections. (A deviceless
            -- connection occurs when lpLocalName is NULL or when it points
            -- to an empty string.)
            --
            -- If this bit flag is clear, the operating system does not
            -- automatically restore the connection at logon.
            --
            -- Declared in Windows as CONNECT_UPDATE_PROFILE

feature -- Generic constants

    Max_path: INTEGER is 260
            -- Maximum number of characters in full path
            --
            -- Declared in Windows as MAX_PATH

feature -- Net Errors

    Error_access_denied: INTEGER is 5
            -- Access to the network resource was denied.
            --
            -- Declared in Windows as ERROR_ACCESS_DENIED

    Error_already_assigned: INTEGER is 85
            -- The local device specified by the lpLocalName member is
            -- already connected to a network resource.
            --
            -- Declared in Windows as ERROR_ALREADY_ASSIGNED

    Error_bad_device: INTEGER is 1200
            -- The value specified by lpLocalName is invalid.
            --
            -- Declared in Windows as ERROR_BAD_DEVICE

    Error_bad_net_name: INTEGER is 67
            -- The value specified by the lpRemoteName member is not
            -- acceptable to any network resource provider because the
            -- resource name is invalid, or because the named resource
            -- cannot be located.
            --
            -- Declared in Windows as ERROR_BAD_NET_NAME

    Error_bad_provider: INTEGER is 1204
            -- The value specified by the lpProvider member does not match
            -- any provider.
            --
            -- Declared in Windows as ERROR_BAD_PROVIDER

    Error_cancelled: INTEGER is 1223
            -- The attempt to make the connection was canceled by the user
            -- through a dialog box from one of the network resource
            -- providers, or by a called resource.
            --
            -- Declared in Windows as ERROR_CANCELLED

    Error_extended_error: INTEGER is 1208
            -- A network-specific error occurred. To obtain a description of
            -- the error, call the WNetGetLastError function.
            --
            -- Declared in Windows as ERROR_EXTENDED_ERROR

    Error_invalid_address: INTEGER is 487
            -- The caller passed in a pointer to a buffer that could not be
            -- accessed.
            --
            -- Declared in Windows as ERROR_INVALID_ADDRESS

    Error_invalid_parameter: INTEGER is 87
            -- This error is a result of one of the following conditions:
            -- 1. The lpRemoteName member is NULL. In addition, lpAccessName
            --    is not NULL, but lpBufferSize is either NULL or points to
            --    zero.
            -- 2. The dwType member is neither RESOURCETYPE_DISK nor
            --    RESOURCETYPE_PRINT. In addition, either CONNECT_REDIRECT
            --    is set in dwFlags and lpLocalName is NULL, or the
            --    connection is to a network that requires the redirecting
            --    of a local device.
            --
            -- Declared in Windows as ERROR_INVALID_PARAMETER

    Error_invalid_password: INTEGER is 86
            -- The specified password is invalid and the CONNECT_INTERACTIVE
            -- flag is not set.
            --
            -- Declared in Windows as ERROR_INVALID_PASSWORD

    Error_more_data: INTEGER is 234
            -- The lpAccessName buffer is too small.
            -- If a local device is redirected, the buffer needs to be large
            -- enough to contain the local device name. Otherwise, the
            -- buffer needs to be large enough to contain either the string
            -- pointed to by lpRemoteName, or the name of the connectable
            -- resource whose alias is pointed to by lpRemoteName. If this
            -- error is returned, then no connection has been made.
            --
            -- Declared in Windows as ERROR_MORE_DATA

    Error_no_more_items: INTEGER is 259
            -- The operating system cannot automatically choose a local
            -- redirection because all the valid local devices are in use.
            --
            -- Declared in Windows as ERROR_NO_MORE_ITEMS

    Error_no_net_or_bad_path: INTEGER is 1203
            -- The operation could not be completed, either because a
            -- network component is not started, or because the specified
            -- resource name is not recognized.
            --
            -- Declared in Windows as ERROR_NO_NET_OR_BAD_PATH

    Error_no_network: INTEGER is 1222
            -- The network is unavailable.
            --
            -- Declared in Windows as ERROR_NO_NETWORK

feature -- Net Resource constants

    Resource_connected: INTEGER is 1
            -- Enumerate currently connected resources.
            --
            -- Declared in Windows as RESOURCE_CONNECTED

    Resource_display_type_domain: INTEGER is 1
            -- The object should be displayed as a domain.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_DOMAIN

    Resource_display_type_generic: INTEGER is 0
            -- The method used to display the object does not matter.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_GENERIC

    Resource_display_type_server: INTEGER is 2
            -- The object should be displayed as a server.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_SERVER

    Resource_display_type_share: INTEGER is 3
            -- The object should be displayed as a share.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_SHARE

    Resource_globalnet: INTEGER is 2
            -- Enumerate all resources on the network.
            --
            -- Declared in Windows as RESOURCE_GLOBALNET

    Resource_remembered: INTEGER is 3
            -- Enumerate remembered (persistent) connections.
            --
            -- Declared in Windows as RESOURCE_REMEMBERED

    Resource_type_any: INTEGER is 0
            -- All resources
            --
            -- Declared in Windows as RESOURCETYPE_ANY

    Resource_type_disk: INTEGER is 1
            -- Disk resources
            --
            -- Declared in Windows as RESOURCETYPE_DISK

    Resource_type_print: INTEGER is 2
            -- Print resources
            --
            -- Declared in Windows as RESOURCETYPE_PRINT

    Resource_usage_connectable: INTEGER is 1
            -- The resource is a connectable resource
            --
            -- Declared in Windows as RESOURCEUSAGE_CONNECTABLE

    Resource_usage_container: INTEGER is 2
            -- The resource is a container resource
            --
            -- Declared in Windows as RESOURCEUSAGE_CONTAINER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NETWORKING_CONSTANTS


WEL_SCROLL_BAR_CONSTANTS Chart

class
    WEL_SCROLL_BAR_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "Constants relative to scroll bar"

Ancestors
    WEL_SB_CONSTANTS
    WEL_SBS_CONSTANTS

Queries
    Sb_both: INTEGER
    Sb_bottom: INTEGER
    Sb_ctl: INTEGER
    Sb_endscroll: INTEGER
    Sb_horz: INTEGER
    Sb_left: INTEGER
    Sb_linedown: INTEGER
    Sb_lineleft: INTEGER
    Sb_lineright: INTEGER
    Sb_lineup: INTEGER
    Sb_pagedown: INTEGER
    Sb_pageleft: INTEGER
    Sb_pageright: INTEGER
    Sb_pageup: INTEGER
    Sb_right: INTEGER
    Sb_thumbposition: INTEGER
    Sb_thumbtrack: INTEGER
    Sb_top: INTEGER
    Sb_vert: INTEGER
    sbs_bottomalign: INTEGER
    sbs_horz: INTEGER
    sbs_leftalign: INTEGER
    sbs_rightalign: INTEGER
    sbs_sizebox: INTEGER
    sbs_sizeboxbottomrightalign: INTEGER
    sbs_sizeboxtopleftalign: INTEGER
    sbs_topalign: INTEGER
    sbs_vert: INTEGER
    Sif_all: INTEGER
    Sif_disablenoscroll: INTEGER
    Sif_page: INTEGER
    Sif_pos: INTEGER
    Sif_range: INTEGER
    Sif_trackpos: INTEGER
    valid_sif_constant (i: INTEGER): BOOLEAN


WEL_SCROLL_BAR_CONSTANTS Flat contracts

indexing
    description: "Constants relative to scroll bar"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:08 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SCROLL_BAR_CONSTANTS

feature -- Access

    Sb_both: INTEGER is 3
            -- Declared in Windows as SB_BOTH
            -- (from WEL_SB_CONSTANTS)

    Sb_bottom: INTEGER is 7
            -- Declared in Windows as SB_BOTTOM
            -- (from WEL_SB_CONSTANTS)

    Sb_ctl: INTEGER is 2
            -- Declared in Windows as SB_CTL
            -- (from WEL_SB_CONSTANTS)

    Sb_endscroll: INTEGER is 8
            -- Declared in Windows as SB_ENDSCROLL
            -- (from WEL_SB_CONSTANTS)

    Sb_horz: INTEGER is 0
            -- Declared in Windows as SB_HORZ
            -- (from WEL_SB_CONSTANTS)

    Sb_left: INTEGER is 6
            -- Declared in Windows as SB_LEFT
            -- (from WEL_SB_CONSTANTS)

    Sb_linedown: INTEGER is 1
            -- Declared in Windows as SB_LINEDOWN
            -- (from WEL_SB_CONSTANTS)

    Sb_lineleft: INTEGER is 0
            -- Declared in Windows as SB_LINELEFT
            -- (from WEL_SB_CONSTANTS)

    Sb_lineright: INTEGER is 1
            -- Declared in Windows as SB_LINERIGHT
            -- (from WEL_SB_CONSTANTS)

    Sb_lineup: INTEGER is 0
            -- Declared in Windows as SB_LINEUP
            -- (from WEL_SB_CONSTANTS)

    Sb_pagedown: INTEGER is 3
            -- Declared in Windows as SB_PAGEDOWN
            -- (from WEL_SB_CONSTANTS)

    Sb_pageleft: INTEGER is 2
            -- Declared in Windows as SB_PAGELEFT
            -- (from WEL_SB_CONSTANTS)

    Sb_pageright: INTEGER is 3
            -- Declared in Windows as SB_PAGERIGHT
            -- (from WEL_SB_CONSTANTS)

    Sb_pageup: INTEGER is 2
            -- Declared in Windows as SB_PAGEUP
            -- (from WEL_SB_CONSTANTS)

    Sb_right: INTEGER is 7
            -- Declared in Windows as SB_RIGHT
            -- (from WEL_SB_CONSTANTS)

    Sb_thumbposition: INTEGER is 4
            -- Declared in Windows as SB_THUMBPOSITION
            -- (from WEL_SB_CONSTANTS)

    Sb_thumbtrack: INTEGER is 5
            -- Declared in Windows as SB_THUMBTRACK
            -- (from WEL_SB_CONSTANTS)

    Sb_top: INTEGER is 6
            -- Declared in Windows as SB_TOP
            -- (from WEL_SB_CONSTANTS)

    Sb_vert: INTEGER is 1
            -- Declared in Windows as SB_VERT
            -- (from WEL_SB_CONSTANTS)

    sbs_bottomalign: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_horz: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_leftalign: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_rightalign: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_sizebox: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_sizeboxbottomrightalign: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_sizeboxtopleftalign: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_topalign: INTEGER
            -- (from WEL_SBS_CONSTANTS)

    sbs_vert: INTEGER
            -- (from WEL_SBS_CONSTANTS)

feature -- ScrollInfo

    Sif_all: INTEGER is 23
            -- 	Combination of SIF_PAGE, SIF_POS, SIF_RANGE, and SIF_TRACKPOS.

    Sif_disablenoscroll: INTEGER is 8
            -- This value is used only when setting a scroll bar's parameters.
            -- If the scroll bar's new parameters make the scroll bar
            -- unnecessary, disable the scroll bar instead of removing it.

    Sif_page: INTEGER is 2
            -- The nPage member contains the page size for a proportional scroll bar.

    Sif_pos: INTEGER is 4
            -- The nPos member contains the scroll box position, which is not
            -- updated while the user drags the scroll box.

    Sif_range: INTEGER is 1
            -- The nMin and nMax members contain the minimum and maximum
            -- values for the scrolling range.

    Sif_trackpos: INTEGER is 16
            -- The nTrackPos member contains the current position of the
            -- scroll box while the user is dragging it.

    valid_sif_constant (i: INTEGER): BOOLEAN
            -- Is i a valid Sif constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SCROLL_BAR_CONSTANTS


WEL_WINDOW_CONSTANTS Chart

class
    WEL_WINDOW_CONSTANTS

General
    cluster: wel.consts.new_consts
    description: "Window managment constants (WM_xxxx, ...)"

Ancestors
    ANY

Queries
    Cw_usedefault: INTEGER
    Ocm__base: INTEGER
    Ocm_chartoitem: INTEGER
    Ocm_command: INTEGER
    Ocm_compareitem: INTEGER
    Ocm_ctlcolor: INTEGER
    Ocm_ctlcolorbtn: INTEGER
    Ocm_ctlcolordlg: INTEGER
    Ocm_ctlcoloredit: INTEGER
    Ocm_ctlcolorlistbox: INTEGER
    Ocm_ctlcolormsgbox: INTEGER
    Ocm_ctlcolorscrollbar: INTEGER
    Ocm_ctlcolorstatic: INTEGER
    Ocm_deleteitem: INTEGER
    Ocm_drawitem: INTEGER
    Ocm_hscroll: INTEGER
    Ocm_measureitem: INTEGER
    Ocm_notify: INTEGER
    Ocm_parentnotify: INTEGER
    Ocm_vkeytoitem: INTEGER
    Ocm_vscroll: INTEGER
    Size_maxhide: INTEGER
    Size_maximized: INTEGER
    Size_maxshow: INTEGER
    Size_minimized: INTEGER
    Size_restored: INTEGER
    Sw_hide: INTEGER
    Sw_minimize: INTEGER
    Sw_otherunzoom: INTEGER
    Sw_otherzoom: INTEGER
    Sw_parentclosing: INTEGER
    Sw_parentopening: INTEGER
    Sw_restore: INTEGER
    Sw_show: INTEGER
    Sw_showmaximized: INTEGER
    Sw_showminimized: INTEGER
    Sw_showminnoactive: INTEGER
    Sw_showna: INTEGER
    Sw_shownoactivate: INTEGER
    Sw_shownormal: INTEGER
    Swp_drawframe: INTEGER
    Swp_framechanged: INTEGER
    Swp_hidewindow: INTEGER
    Swp_noactivate: INTEGER
    Swp_nocopybits: INTEGER
    Swp_nomove: INTEGER
    Swp_noownerzorder: INTEGER
    Swp_noredraw: INTEGER
    Swp_noreposition: INTEGER
    Swp_nosendchanging: INTEGER
    Swp_nosize: INTEGER
    Swp_nozorder: INTEGER
    Swp_showwindow: INTEGER
    Wa_active: INTEGER
    Wa_clickactive: INTEGER
    Wa_inactive: INTEGER
    Wm_activate: INTEGER
    Wm_activateapp: INTEGER
    Wm_afxfirst: INTEGER
    Wm_afxlast: INTEGER
    Wm_app: INTEGER
    Wm_appcommand: INTEGER
    Wm_askcbformatname: INTEGER
    Wm_canceljournal: INTEGER
    Wm_cancelmode: INTEGER
    Wm_capturechanged: INTEGER
    Wm_changecbchain: INTEGER
    Wm_changeuistate: INTEGER
    Wm_char: INTEGER
    Wm_chartoitem: INTEGER
    Wm_childactivate: INTEGER
    Wm_clear: INTEGER
    Wm_close: INTEGER
    Wm_command: INTEGER
    Wm_commnotify: INTEGER
    Wm_compacting: INTEGER
    Wm_compareitem: INTEGER
    Wm_contextmenu: INTEGER
    Wm_copy: INTEGER
    Wm_copydata: INTEGER
    Wm_create: INTEGER
    Wm_ctlcolor: INTEGER
    Wm_ctlcolorbtn: INTEGER
    Wm_ctlcolordlg: INTEGER
    Wm_ctlcoloredit: INTEGER
    Wm_ctlcolorlistbox: INTEGER
    Wm_ctlcolormsgbox: INTEGER
    Wm_ctlcolorscrollbar: INTEGER
    Wm_ctlcolorstatic: INTEGER
    Wm_cut: INTEGER
    Wm_deadchar: INTEGER
    Wm_deleteitem: INTEGER
    Wm_destroy: INTEGER
    Wm_destroyclipboard: INTEGER
    Wm_devicechange: INTEGER
    Wm_devmodechange: INTEGER
    Wm_displaychange: INTEGER
    Wm_drawclipboard: INTEGER
    Wm_drawitem: INTEGER
    Wm_dropfiles: INTEGER
    Wm_enable: INTEGER
    Wm_endsession: INTEGER
    Wm_enteridle: INTEGER
    Wm_entermenuloop: INTEGER
    Wm_entersizemove: INTEGER
    Wm_erasebkgnd: INTEGER
    Wm_exitmenuloop: INTEGER
    Wm_exitsizemove: INTEGER
    Wm_fontchange: INTEGER
    Wm_forwardmsg: INTEGER
    Wm_getdlgcode: INTEGER
    Wm_getfont: INTEGER
    Wm_gethotkey: INTEGER
    Wm_geticon: INTEGER
    Wm_getminmaxinfo: INTEGER
    Wm_getobject: INTEGER
    Wm_gettext: INTEGER
    Wm_gettextlength: INTEGER
    Wm_handheldfirst: INTEGER
    Wm_handheldlast: INTEGER
    Wm_help: INTEGER
    Wm_hotkey: INTEGER
    Wm_hscroll: INTEGER
    Wm_hscrollclipboard: INTEGER
    Wm_iconerasebkgnd: INTEGER
    Wm_ime_char: INTEGER
    Wm_ime_composition: INTEGER
    Wm_ime_compositionfull: INTEGER
    Wm_ime_control: INTEGER
    Wm_ime_endcomposition: INTEGER
    Wm_ime_keydown: INTEGER
    wm_ime_keylast: INTEGER
    Wm_ime_keyup: INTEGER
    Wm_ime_notify: INTEGER
    Wm_ime_request: INTEGER
    Wm_ime_select: INTEGER
    Wm_ime_setcontext: INTEGER
    Wm_ime_startcomposition: INTEGER
    Wm_initdialog: INTEGER
    Wm_initmenu: INTEGER
    Wm_initmenupopup: INTEGER
    Wm_inputlangchange: INTEGER
    Wm_inputlangchangerequest: INTEGER
    Wm_keydown: INTEGER
    Wm_keyfirst: INTEGER
    wm_keylast: INTEGER
    Wm_keyup: INTEGER
    Wm_killfocus: INTEGER
    Wm_lbuttondblclk: INTEGER
    Wm_lbuttondown: INTEGER
    Wm_lbuttonup: INTEGER
    Wm_mbuttondblclk: INTEGER
    Wm_mbuttondown: INTEGER
    Wm_mbuttonup: INTEGER
    Wm_mdiactivate: INTEGER
    Wm_mdicascade: INTEGER
    Wm_mdicreate: INTEGER
    Wm_mdidestroy: INTEGER
    Wm_mdigetactive: INTEGER
    Wm_mdiiconarrange: INTEGER
    Wm_mdimaximize: INTEGER
    Wm_mdinext: INTEGER
    Wm_mdirefreshmenu: INTEGER
    Wm_mdirestore: INTEGER
    Wm_mdisetmenu: INTEGER
    Wm_mditile: INTEGER
    Wm_measureitem: INTEGER
    Wm_menuchar: INTEGER
    Wm_menucommand: INTEGER
    Wm_menudrag: INTEGER
    Wm_menugetobject: INTEGER
    Wm_menurbuttonup: INTEGER
    Wm_menuselect: INTEGER
    Wm_mouseactivate: INTEGER
    Wm_mousefirst: INTEGER
    Wm_mousehover: INTEGER
    wm_mouselast: INTEGER
    Wm_mouseleave: INTEGER
    Wm_mousemove: INTEGER
    Wm_mousewheel: INTEGER
    Wm_move: INTEGER
    Wm_moving: INTEGER
    Wm_ncactivate: INTEGER
    Wm_nccalcsize: INTEGER
    Wm_nccreate: INTEGER
    Wm_ncdestroy: INTEGER
    Wm_nchittest: INTEGER
    Wm_nclbuttondblclk: INTEGER
    Wm_nclbuttondown: INTEGER
    Wm_nclbuttonup: INTEGER
    Wm_ncmbuttondblclk: INTEGER
    Wm_ncmbuttondown: INTEGER
    Wm_ncmbuttonup: INTEGER
    Wm_ncmousehover: INTEGER
    Wm_ncmouseleave: INTEGER
    Wm_ncmousemove: INTEGER
    Wm_ncpaint: INTEGER
    Wm_ncrbuttondblclk: INTEGER
    Wm_ncrbuttondown: INTEGER
    Wm_ncrbuttonup: INTEGER
    Wm_ncxbuttondblclk: INTEGER
    Wm_ncxbuttondown: INTEGER
    Wm_ncxbuttonup: INTEGER
    Wm_nextdlgctl: INTEGER
    Wm_nextmenu: INTEGER
    Wm_notify: INTEGER
    Wm_notifyformat: INTEGER
    Wm_null: INTEGER
    Wm_paint: INTEGER
    Wm_paintclipboard: INTEGER
    Wm_painticon: INTEGER
    Wm_palettechanged: INTEGER
    Wm_paletteischanging: INTEGER
    Wm_parentnotify: INTEGER
    Wm_paste: INTEGER
    Wm_penwinfirst: INTEGER
    Wm_penwinlast: INTEGER
    Wm_power: INTEGER
    Wm_powerbroadcast: INTEGER
    Wm_print: INTEGER
    Wm_printclient: INTEGER
    Wm_querydragicon: INTEGER
    Wm_queryendsession: INTEGER
    Wm_querynewpalette: INTEGER
    Wm_queryopen: INTEGER
    Wm_queryuistate: INTEGER
    Wm_queuesync: INTEGER
    Wm_quit: INTEGER
    Wm_rbuttondblclk: INTEGER
    Wm_rbuttondown: INTEGER
    Wm_rbuttonup: INTEGER
    Wm_renderallformats: INTEGER
    Wm_renderformat: INTEGER
    Wm_setcursor: INTEGER
    Wm_setfocus: INTEGER
    Wm_setfont: INTEGER
    Wm_sethotkey: INTEGER
    Wm_seticon: INTEGER
    Wm_setredraw: INTEGER
    Wm_settext: INTEGER
    Wm_settingchange: INTEGER
    Wm_showwindow: INTEGER
    Wm_size: INTEGER
    Wm_sizeclipboard: INTEGER
    Wm_sizing: INTEGER
    Wm_spoolerstatus: INTEGER
    Wm_stylechanged: INTEGER
    Wm_stylechanging: INTEGER
    Wm_syncpaint: INTEGER
    Wm_syschar: INTEGER
    Wm_syscolorchange: INTEGER
    Wm_syscommand: INTEGER
    Wm_sysdeadchar: INTEGER
    Wm_syskeydown: INTEGER
    Wm_syskeyup: INTEGER
    Wm_tcard: INTEGER
    Wm_timechange: INTEGER
    Wm_timer: INTEGER
    Wm_undo: INTEGER
    Wm_uninitmenupopup: INTEGER
    Wm_updateuistate: INTEGER
    Wm_user: INTEGER
    Wm_userchanged: INTEGER
    Wm_vkeytoitem: INTEGER
    Wm_vscroll: INTEGER
    Wm_vscrollclipboard: INTEGER
    Wm_windowposchanged: INTEGER
    Wm_windowposchanging: INTEGER
    Wm_wininichange: INTEGER
    Wm_xbuttondblclk: INTEGER
    Wm_xbuttondown: INTEGER
    Wm_xbuttonup: INTEGER
    Ws_border: INTEGER
    Ws_caption: INTEGER
    Ws_child: INTEGER
    Ws_childwindow: INTEGER
    Ws_clipchildren: INTEGER
    Ws_clipsiblings: INTEGER
    Ws_disabled: INTEGER
    Ws_dlgframe: INTEGER
    Ws_ex_acceptfiles: INTEGER
    Ws_ex_clientedge: INTEGER
    Ws_ex_contexthelp: INTEGER
    Ws_ex_controlparent: INTEGER
    Ws_ex_dlgmodalframe: INTEGER
    Ws_ex_left: INTEGER
    Ws_ex_leftscrollbar: INTEGER
    Ws_ex_ltrreading: INTEGER
    Ws_ex_mdichild: INTEGER
    Ws_ex_noparentnotify: INTEGER
    Ws_ex_overlappedwindow: INTEGER
    Ws_ex_palettewindow: INTEGER
    Ws_ex_right: INTEGER
    Ws_ex_rightscrollbar: INTEGER
    Ws_ex_rtlreading: INTEGER
    Ws_ex_staticedge: INTEGER
    Ws_ex_toolwindow: INTEGER
    Ws_ex_topmost: INTEGER
    Ws_ex_transparent: INTEGER
    Ws_ex_windowedge: INTEGER
    Ws_group: INTEGER
    Ws_hscroll: INTEGER
    Ws_iconic: INTEGER
    Ws_maximize: INTEGER
    Ws_maximizebox: INTEGER
    Ws_minimize: INTEGER
    Ws_minimizebox: INTEGER
    Ws_overlapped: INTEGER
    Ws_overlappedwindow: INTEGER
    Ws_popup: INTEGER
    Ws_popupwindow: INTEGER
    Ws_sizebox: INTEGER
    Ws_sysmenu: INTEGER
    Ws_tabstop: INTEGER
    Ws_thickframe: INTEGER
    Ws_tiled: INTEGER
    Ws_tiledwindow: INTEGER
    Ws_visible: INTEGER
    Ws_vscroll: INTEGER


WEL_WINDOW_CONSTANTS Flat contracts

indexing
    description: "Window managment constants (WM_xxxx, ...)"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:08 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOW_CONSTANTS

feature -- Extended window styles

    Cw_usedefault: INTEGER is -2147483648
            -- Declared in Windows as CW_USEDEFAULT

    Ws_ex_acceptfiles: INTEGER is 16
            -- Declared in Windows as WS_EX_ACCEPTFILES

    Ws_ex_clientedge: INTEGER is 512
            -- Declared in Windows as WS_EX_CLIENTEDGE

    Ws_ex_contexthelp: INTEGER is 1024
            -- Declared in Windows as WS_EX_CONTEXTHELP

    Ws_ex_controlparent: INTEGER is 65536
            -- Declared in Windows as WS_EX_CONTROLPARENT

    Ws_ex_dlgmodalframe: INTEGER is 1
            -- Declared in Windows as WS_EX_DLGMODALFRAME

    Ws_ex_left: INTEGER is 0
            -- Declared in Windows as WS_EX_LEFT

    Ws_ex_leftscrollbar: INTEGER is 16384
            -- Declared in Windows as WS_EX_LEFTSCROLLBAR

    Ws_ex_ltrreading: INTEGER is 0
            -- Declared in Windows as WS_EX_LTRREADING

    Ws_ex_mdichild: INTEGER is 64
            -- Declared in Windows as WS_EX_MDICHILD

    Ws_ex_noparentnotify: INTEGER is 4
            -- Declared in Windows as WS_EX_NOPARENTNOTIFY

    Ws_ex_overlappedwindow: INTEGER is 768
            -- Declared in Windows as WS_EX_OVERLAPPEDWINDOW

    Ws_ex_palettewindow: INTEGER is 392
            -- Declared in Windows as WS_EX_PALETTEWINDOW

    Ws_ex_right: INTEGER is 4096
            -- Declared in Windows as WS_EX_RIGHT

    Ws_ex_rightscrollbar: INTEGER is 0
            -- Declared in Windows as WS_EX_RIGHTSCROLLBAR

    Ws_ex_rtlreading: INTEGER is 8192
            -- Declared in Windows as WS_EX_RTLREADING

    Ws_ex_staticedge: INTEGER is 131072
            -- Declared in Windows as WS_EX_STATICEDGE

    Ws_ex_toolwindow: INTEGER is 128
            -- Declared in Windows as WS_EX_TOOLWINDOW

    Ws_ex_topmost: INTEGER is 8
            -- Declared in Windows as WS_EX_TOPMOST

    Ws_ex_transparent: INTEGER is 32
            -- Declared in Windows as WS_EX_TRANSPARENT

    Ws_ex_windowedge: INTEGER is 256
            -- Declared in Windows as WS_EX_WINDOWEDGE

feature -- Reflected Window Message IDs. Defined in OleCtl.h

    ocm__base: INTEGER
            -- Declared in Windows as OCM__BASE.

    ocm_chartoitem: INTEGER
            -- Declared in Windows as OCM_CHARTOITEM.

    ocm_command: INTEGER
            -- Declared in Windows as OCM_COMMAND.

    ocm_compareitem: INTEGER
            -- Declared in Windows as OCM_COMPAREITEM.

    ocm_ctlcolor: INTEGER
            -- Declared in Windows as OCM_CTLCOLOR.

    ocm_ctlcolorbtn: INTEGER
            -- Declared in Windows as OCM_CTLCOLORBTN.

    ocm_ctlcolordlg: INTEGER
            -- Declared in Windows as OCM_CTLCOLORDLG.

    ocm_ctlcoloredit: INTEGER
            -- Declared in Windows as OCM_CTLCOLOREDIT.

    ocm_ctlcolorlistbox: INTEGER
            -- Declared in Windows as OCM_CTLCOLORLISTBOX.

    ocm_ctlcolormsgbox: INTEGER
            -- Declared in Windows as OCM_CTLCOLORMSGBOX.

    ocm_ctlcolorscrollbar: INTEGER
            -- Declared in Windows as OCM_CTLCOLORSCROLLBAR.

    ocm_ctlcolorstatic: INTEGER
            -- Declared in Windows as OCM_CTLCOLORSTATIC.

    ocm_deleteitem: INTEGER
            -- Declared in Windows as OCM_DELETEITEM.

    ocm_drawitem: INTEGER
            -- Declared in Windows as OCM_DRAWITEM.

    ocm_hscroll: INTEGER
            -- Declared in Windows as OCM_HSCROLL.

    ocm_measureitem: INTEGER
            -- Declared in Windows as OCM_MEASUREITEM.

    ocm_notify: INTEGER
            -- Declared in Windows as OCM_NOTIFY.

    ocm_parentnotify: INTEGER
            -- Declared in Windows as OCM_PARENTNOTIFY.

    ocm_vkeytoitem: INTEGER
            -- Declared in Windows as OCM_VKEYTOITEM.

    ocm_vscroll: INTEGER
            -- Declared in Windows as OCM_VSCROLL.

feature -- Show Window (SW) constants

    Sw_hide: INTEGER is 0
            -- Declared in Windows as SW_HIDE

    Sw_minimize: INTEGER is 6
            -- Declared in Windows as SW_MINIMIZE

    Sw_otherunzoom: INTEGER is 4
            -- Declared in Windows as SW_OTHERUNZOOM

    Sw_otherzoom: INTEGER is 2
            -- Declared in Windows as SW_OTHERZOOM

    Sw_parentclosing: INTEGER is 1
            -- Declared in Windows as SW_PARENTCLOSING

    Sw_parentopening: INTEGER is 3
            -- Declared in Windows as SW_PARENTOPENING

    Sw_restore: INTEGER is 9
            -- Declared in Windows as SW_RESTORE

    Sw_show: INTEGER is 5
            -- Declared in Windows as SW_SHOW

    Sw_showmaximized: INTEGER is 3
            -- Declared in Windows as SW_SHOWMAXIMIZED

    Sw_showminimized: INTEGER is 2
            -- Declared in Windows as SW_SHOWMINIMIZED

    Sw_showminnoactive: INTEGER is 7
            -- Declared in Windows as SW_SHOWMINNOACTIVE

    Sw_showna: INTEGER is 8
            -- Declared in Windows as SW_SHOWNA

    Sw_shownoactivate: INTEGER is 4
            -- Declared in Windows as SW_SHOWNOACTIVATE

    Sw_shownormal: INTEGER is 1
            -- Declared in Windows as SW_SHOWNORMAL

feature -- Show Window Position (SWP) constants

    Swp_drawframe: INTEGER is 32
            -- Declared in Windows as SWP_FRAMECHANGED
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of swp_framechanged.

    Swp_framechanged: INTEGER is 32
            -- Declared in Windows as SWP_FRAMECHANGED
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of swp_drawframe.

    Swp_hidewindow: INTEGER is 128
            -- Declared in Windows as SWP_HIDEWINDOW

    Swp_noactivate: INTEGER is 16
            -- Declared in Windows as SWP_NOACTIVATE

    Swp_nocopybits: INTEGER is 256
            -- Declared in Windows as SWP_NOCOPYBITS

    Swp_nomove: INTEGER is 2
            -- Declared in Windows as SWP_NOMOVE

    Swp_noownerzorder: INTEGER is 512
            -- Declared in Windows as SWP_NOOWNERZORDER
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of swp_noreposition.

    Swp_noredraw: INTEGER is 8
            -- Declared in Windows as SWP_NOREDRAW

    Swp_noreposition: INTEGER is 512
            -- Declared in Windows as SWP_NOOWNERZORDER
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of swp_noownerzorder.

    Swp_nosendchanging: INTEGER is 1024
            -- Declared in Windows as SWP_NOSENDCHANGING

    Swp_nosize: INTEGER is 1
            -- Declared in Windows as SWP_NOSIZE

    Swp_nozorder: INTEGER is 4
            -- Declared in Windows as SWP_NOZORDER

    Swp_showwindow: INTEGER is 64
            -- Declared in Windows as SWP_SHOWWINDOW

feature -- Window Activate Mode

    Wa_active: INTEGER is 1
            -- Activated by some method other than a mouse click (for
            -- example, by a call to the SetActiveWindow function or by use
            -- of the keyboard interface to select the window).
            --
            -- Declared in Windows as WA_ACTIVE

    Wa_clickactive: INTEGER is 2
            -- Activated by a mouse click.
            --
            -- Declared in Windows as WA_CLICKACTIVE

    Wa_inactive: INTEGER is 0
            -- Deactivated.
            --
            -- Declared in Windows as WA_INACTIVE

feature -- Window Messages

    Wm_activate: INTEGER is 6
            -- Declared in Windows as WM_ACTIVATE

    Wm_activateapp: INTEGER is 28
            -- Declared in Windows as WM_ACTIVATEAPP

    Wm_afxfirst: INTEGER is 864
            -- Declared in Windows as WM_AFXFIRST

    Wm_afxlast: INTEGER is 895
            -- Declared in Windows as WM_AFXLAST

    Wm_app: INTEGER is 32768
            -- Declared in Windows as WM_APP

    Wm_appcommand: INTEGER is 793
            -- Declared in Windows as WM_APPCOMMAND

    Wm_askcbformatname: INTEGER is 780
            -- Declared in Windows as WM_ASKCBFORMATNAME

    Wm_canceljournal: INTEGER is 75
            -- Declared in Windows as WM_CANCELJOURNAL

    Wm_cancelmode: INTEGER is 31
            -- The WM_CANCELMODE message is sent to cancel certain modes, such as mouse
            -- capture.
            -- For example, the system sends this message to the active window when a dialog
            -- box or message box is displayed. Certain functions also send this message
            -- explicitly to the specified window regardless of whether it is the active
            -- window. For example, the EnableWindow function sends this message when
            -- disabling the specified window.
            --
            -- Declared in Windows as WM_CANCELMODE

    Wm_capturechanged: INTEGER is 533
            -- Declared in Windows as WM_CAPTURECHANGED

    Wm_changecbchain: INTEGER is 781
            -- Declared in Windows as WM_CHANGECBCHAIN

    Wm_changeuistate: INTEGER is 295
            -- Declared in Windows as WM_CHANGEUISTATE

    Wm_char: INTEGER is 258
            -- Declared in Windows as WM_CHAR

    Wm_chartoitem: INTEGER is 47
            -- Declared in Windows as WM_CHARTOITEM

    Wm_childactivate: INTEGER is 34
            -- Declared in Windows as WM_CHILDACTIVATE

    Wm_clear: INTEGER is 771
            -- Declared in Windows as WM_CLEAR

    Wm_close: INTEGER is 16
            -- Declared in Windows as WM_CLOSE

    Wm_command: INTEGER is 273
            -- Declared in Windows as WM_COMMAND

    Wm_commnotify: INTEGER is 68
            -- Declared in Windows as WM_COMMNOTIFY

    Wm_compacting: INTEGER is 65
            -- Declared in Windows as WM_COMPACTING

    Wm_compareitem: INTEGER is 57
            -- Declared in Windows as WM_COMPAREITEM

    Wm_contextmenu: INTEGER is 123
            -- Declared in Windows as WM_CONTEXTMENU

    Wm_copy: INTEGER is 769
            -- Declared in Windows as WM_COPY

    Wm_copydata: INTEGER is 74
            -- Declared in Windows as WM_COPYDATA

    Wm_create: INTEGER is 1
            -- Declared in Windows as WM_CREATE

    Wm_ctlcolor: INTEGER is 25
            -- Declared in Windows as WM_CTLCOLOR

    Wm_ctlcolorbtn: INTEGER is 309
            -- Declared in Windows as WM_CTLCOLORBTN

    Wm_ctlcolordlg: INTEGER is 310
            -- Declared in Windows as WM_CTLCOLORDLG

    Wm_ctlcoloredit: INTEGER is 307
            -- Declared in Windows as WM_CTLCOLOREDIT

    Wm_ctlcolorlistbox: INTEGER is 308
            -- Declared in Windows as WM_CTLCOLORLISTBOX

    Wm_ctlcolormsgbox: INTEGER is 306
            -- Declared in Windows as WM_CTLCOLORMSGBOX

    Wm_ctlcolorscrollbar: INTEGER is 311
            -- Declared in Windows as WM_CTLCOLORSCROLLBAR

    Wm_ctlcolorstatic: INTEGER is 312
            -- Declared in Windows as WM_CTLCOLORSTATIC

    Wm_cut: INTEGER is 768
            -- Declared in Windows as WM_CUT

    Wm_deadchar: INTEGER is 259
            -- Declared in Windows as WM_DEADCHAR

    Wm_deleteitem: INTEGER is 45
            -- Declared in Windows as WM_DELETEITEM

    Wm_destroy: INTEGER is 2
            -- Declared in Windows as WM_DESTROY

    Wm_destroyclipboard: INTEGER is 775
            -- Declared in Windows as WM_DESTROYCLIPBOARD

    Wm_devicechange: INTEGER is 537
            -- Declared in Windows as WM_DEVICECHANGE

    Wm_devmodechange: INTEGER is 27
            -- Declared in Windows as WM_DEVMODECHANGE

    Wm_displaychange: INTEGER is 126
            -- Declared in Windows as WM_DISPLAYCHANGE

    Wm_drawclipboard: INTEGER is 776
            -- Declared in Windows as WM_DRAWCLIPBOARD

    Wm_drawitem: INTEGER is 43
            -- Declared in Windows as WM_DRAWITEM

    Wm_dropfiles: INTEGER is 563
            -- Declared in Windows as WM_DROPFILES

    Wm_enable: INTEGER is 10
            -- Declared in Windows as WM_ENABLE

    Wm_endsession: INTEGER is 22
            -- Declared in Windows as WM_ENDSESSION

    Wm_enteridle: INTEGER is 289
            -- Declared in Windows as WM_ENTERIDLE

    Wm_entermenuloop: INTEGER is 529
            -- Declared in Windows as WM_ENTERMENULOOP

    Wm_entersizemove: INTEGER is 561
            -- Declared in Windows as WM_ENTERSIZEMOVE

    Wm_erasebkgnd: INTEGER is 20
            -- Declared in Windows as WM_ERASEBKGND

    Wm_exitmenuloop: INTEGER is 530
            -- Declared in Windows as WM_EXITMENULOOP

    Wm_exitsizemove: INTEGER is 562
            -- Declared in Windows as WM_EXITSIZEMOVE

    Wm_fontchange: INTEGER is 29
            -- Declared in Windows as WM_FONTCHANGE

    Wm_forwardmsg: INTEGER is 895
            -- Declared in Windows as WM_FORWARDMSG
            -- Used to forward a message to another window for processing.
            -- WPARAM - DWORD dwUserData - defined by user
            -- LPARAM - LPMSG pMsg - a pointer to the MSG structure
            -- return value - 0 if the message was not processed, nonzero if it was.

    Wm_getdlgcode: INTEGER is 135
            -- Declared in Windows as WM_GETDLGCODE

    Wm_getfont: INTEGER is 49
            -- Declared in Windows as WM_GETFONT

    Wm_gethotkey: INTEGER is 51
            -- Declared in Windows as WM_GETHOTKEY

    Wm_geticon: INTEGER is 127
            -- Declared in Windows as WM_GETICON

    Wm_getminmaxinfo: INTEGER is 36
            -- Declared in Windows as WM_GETMINMAXINFO

    Wm_getobject: INTEGER is 61
            -- Declared in Windows as WM_GETOBJECT

    Wm_gettext: INTEGER is 13
            -- Declared in Windows as WM_GETTEXT

    Wm_gettextlength: INTEGER is 14
            -- Declared in Windows as WM_GETTEXTLENGTH

    Wm_handheldfirst: INTEGER is 856
            -- Declared in Windows as WM_HANDHELDFIRST

    Wm_handheldlast: INTEGER is 863
            -- Declared in Windows as WM_HANDHELDLAST

    Wm_help: INTEGER is 83
            -- Declared in Windows as WM_HELP

    Wm_hotkey: INTEGER is 786
            -- Declared in Windows as WM_HOTKEY

    Wm_hscroll: INTEGER is 276
            -- Declared in Windows as WM_HSCROLL

    Wm_hscrollclipboard: INTEGER is 782
            -- Declared in Windows as WM_HSCROLLCLIPBOARD

    Wm_iconerasebkgnd: INTEGER is 39
            -- Declared in Windows as WM_ICONERASEBKGND

    Wm_ime_char: INTEGER is 646
            -- Declared in Windows as WM_IME_CHAR

    Wm_ime_composition: INTEGER is 271
            -- Declared in Windows as WM_IME_COMPOSITION

    Wm_ime_compositionfull: INTEGER is 644
            -- Declared in Windows as WM_IME_COMPOSITIONFULL

    Wm_ime_control: INTEGER is 643
            -- Declared in Windows as WM_IME_CONTROL

    Wm_ime_endcomposition: INTEGER is 270
            -- Declared in Windows as WM_IME_ENDCOMPOSITION

    Wm_ime_keydown: INTEGER is 656
            -- Declared in Windows as WM_IME_KEYDOWN

    wm_ime_keylast: INTEGER
            -- Declared in Windows as WM_IME_KEYLAST

    Wm_ime_keyup: INTEGER is 657
            -- Declared in Windows as WM_IME_KEYUP

    Wm_ime_notify: INTEGER is 642
            -- Declared in Windows as WM_IME_NOTIFY

    Wm_ime_request: INTEGER is 648
            -- Declared in Windows as WM_IME_REQUEST

    Wm_ime_select: INTEGER is 645
            -- Declared in Windows as WM_IME_SELECT

    Wm_ime_setcontext: INTEGER is 641
            -- Declared in Windows as WM_IME_SETCONTEXT

    Wm_ime_startcomposition: INTEGER is 269
            -- Declared in Windows as WM_IME_STARTCOMPOSITION

    Wm_initdialog: INTEGER is 272
            -- Declared in Windows as WM_INITDIALOG

    Wm_initmenu: INTEGER is 278
            -- Declared in Windows as WM_INITMENU

    Wm_initmenupopup: INTEGER is 279
            -- Declared in Windows as WM_INITMENUPOPUP

    Wm_inputlangchange: INTEGER is 81
            -- Declared in Windows as WM_INPUTLANGCHANGE

    Wm_inputlangchangerequest: INTEGER is 80
            -- Declared in Windows as WM_INPUTLANGCHANGEREQUEST

    Wm_keydown: INTEGER is 256
            -- Declared in Windows as WM_KEYDOWN

    Wm_keyfirst: INTEGER is 256
            -- Declared in Windows as WM_KEYFIRST

    wm_keylast: INTEGER
            -- Declared in Windows as WM_KEYLAST

    Wm_keyup: INTEGER is 257
            -- Declared in Windows as WM_KEYUP

    Wm_killfocus: INTEGER is 8
            -- Declared in Windows as WM_KILLFOCUS

    Wm_lbuttondblclk: INTEGER is 515
            -- Declared in Windows as WM_LBUTTONDBLCLK

    Wm_lbuttondown: INTEGER is 513
            -- Declared in Windows as WM_LBUTTONDOWN

    Wm_lbuttonup: INTEGER is 514
            -- Declared in Windows as WM_LBUTTONUP

    Wm_mbuttondblclk: INTEGER is 521
            -- Declared in Windows as WM_MBUTTONDBLCLK

    Wm_mbuttondown: INTEGER is 519
            -- Declared in Windows as WM_MBUTTONDOWN

    Wm_mbuttonup: INTEGER is 520
            -- Declared in Windows as WM_MBUTTONUP

    Wm_mdiactivate: INTEGER is 546
            -- Declared in Windows as WM_MDIACTIVATE

    Wm_mdicascade: INTEGER is 551
            -- Declared in Windows as WM_MDICASCADE

    Wm_mdicreate: INTEGER is 544
            -- Declared in Windows as WM_MDICREATE

    Wm_mdidestroy: INTEGER is 545
            -- Declared in Windows as WM_MDIDESTROY

    Wm_mdigetactive: INTEGER is 553
            -- Declared in Windows as WM_MDIGETACTIVE

    Wm_mdiiconarrange: INTEGER is 552
            -- Declared in Windows as WM_MDIICONARRANGE

    Wm_mdimaximize: INTEGER is 549
            -- Declared in Windows as WM_MDIMAXIMIZE

    Wm_mdinext: INTEGER is 548
            -- Declared in Windows as WM_MDINEXT

    Wm_mdirefreshmenu: INTEGER is 564
            -- Declared in Windows as WM_MDIREFRESHMENU

    Wm_mdirestore: INTEGER is 547
            -- Declared in Windows as WM_MDIRESTORE

    Wm_mdisetmenu: INTEGER is 560
            -- Declared in Windows as WM_MDISETMENU

    Wm_mditile: INTEGER is 550
            -- Declared in Windows as WM_MDITILE

    Wm_measureitem: INTEGER is 44
            -- Declared in Windows as WM_MEASUREITEM

    Wm_menuchar: INTEGER is 288
            -- Declared in Windows as WM_MENUCHAR

    Wm_menucommand: INTEGER is 294
            -- Declared in Windows as WM_MENUCOMMAND

    Wm_menudrag: INTEGER is 291
            -- Declared in Windows as WM_MENUDRAG

    Wm_menugetobject: INTEGER is 292
            -- Declared in Windows as WM_MENUGETOBJECT

    Wm_menurbuttonup: INTEGER is 290
            -- Declared in Windows as WM_MENURBUTTONUP

    Wm_menuselect: INTEGER is 287
            -- Declared in Windows as WM_MENUSELECT

    Wm_mouseactivate: INTEGER is 33
            -- Declared in Windows as WM_MOUSEACTIVATE

    Wm_mousefirst: INTEGER is 512
            -- Declared in Windows as WM_MOUSEFIRST

    Wm_mousehover: INTEGER is 673
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSEHOVER

    wm_mouselast: INTEGER
            -- Declared in Windows as WM_MOUSELAST

    Wm_mouseleave: INTEGER is 675
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSELEAVE

    Wm_mousemove: INTEGER is 512
            -- Declared in Windows as WM_MOUSEMOVE

    Wm_mousewheel: INTEGER is 522
            -- Declared in Windows as WM_MOUSEWHEEL

    Wm_move: INTEGER is 3
            -- Declared in Windows as WM_MOVE

    Wm_moving: INTEGER is 534
            -- Declared in Windows as WM_MOVING

    Wm_ncactivate: INTEGER is 134
            -- Declared in Windows as WM_NCACTIVATE

    Wm_nccalcsize: INTEGER is 131
            -- Declared in Windows as WM_NCCALCSIZE

    Wm_nccreate: INTEGER is 129
            -- Declared in Windows as WM_NCCREATE

    Wm_ncdestroy: INTEGER is 130
            -- Declared in Windows as WM_NCDESTROY

    Wm_nchittest: INTEGER is 132
            -- Declared in Windows as WM_NCHITTEST

    Wm_nclbuttondblclk: INTEGER is 163
            -- Declared in Windows as WM_NCLBUTTONDBLCLK

    Wm_nclbuttondown: INTEGER is 161
            -- Declared in Windows as WM_NCLBUTTONDOWN

    Wm_nclbuttonup: INTEGER is 162
            -- Declared in Windows as WM_NCLBUTTONUP

    Wm_ncmbuttondblclk: INTEGER is 169
            -- Declared in Windows as WM_NCMBUTTONDBLCLK

    Wm_ncmbuttondown: INTEGER is 167
            -- Declared in Windows as WM_NCMBUTTONDOWN

    Wm_ncmbuttonup: INTEGER is 168
            -- Declared in Windows as WM_NCMBUTTONUP

    Wm_ncmousehover: INTEGER is 672
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSEHOVER

    Wm_ncmouseleave: INTEGER is 674
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSELEAVE

    Wm_ncmousemove: INTEGER is 160
            -- Declared in Windows as WM_NCMOUSEMOVE

    Wm_ncpaint: INTEGER is 133
            -- Declared in Windows as WM_NCPAINT

    Wm_ncrbuttondblclk: INTEGER is 166
            -- Declared in Windows as WM_NCRBUTTONDBLCLK

    Wm_ncrbuttondown: INTEGER is 164
            -- Declared in Windows as WM_NCRBUTTONDOWN

    Wm_ncrbuttonup: INTEGER is 165
            -- Declared in Windows as WM_NCRBUTTONUP

    Wm_ncxbuttondblclk: INTEGER is 173
            -- Declared in Windows as WM_NCXBUTTONDBLCLK

    Wm_ncxbuttondown: INTEGER is 171
            -- Declared in Windows as WM_NCXBUTTONDOWN

    Wm_ncxbuttonup: INTEGER is 172
            -- Declared in Windows as WM_NCXBUTTONUP

    Wm_nextdlgctl: INTEGER is 40
            -- Declared in Windows as WM_NEXTDLGCTL

    Wm_nextmenu: INTEGER is 531
            -- Declared in Windows as WM_NEXTMENU

    Wm_notify: INTEGER is 78
            -- Declared in Windows as WM_NOTIFY

    Wm_notifyformat: INTEGER is 85
            -- Declared in Windows as WM_NOTIFYFORMAT

    Wm_null: INTEGER is 0
            -- Declared in Windows as WM_NULL

    Wm_paint: INTEGER is 15
            -- Declared in Windows as WM_PAINT

    Wm_paintclipboard: INTEGER is 777
            -- Declared in Windows as WM_PAINTCLIPBOARD

    Wm_painticon: INTEGER is 38
            -- Declared in Windows as WM_PAINTICON

    Wm_palettechanged: INTEGER is 785
            -- Declared in Windows as WM_PALETTECHANGED

    Wm_paletteischanging: INTEGER is 784
            -- Declared in Windows as WM_PALETTEISCHANGING

    Wm_parentnotify: INTEGER is 528
            -- Declared in Windows as WM_PARENTNOTIFY

    Wm_paste: INTEGER is 770
            -- Declared in Windows as WM_PASTE

    Wm_penwinfirst: INTEGER is 896
            -- Declared in Windows as WM_PENWINFIRST

    Wm_penwinlast: INTEGER is 911
            -- Declared in Windows as WM_PENWINLAST

    Wm_power: INTEGER is 72
            -- Declared in Windows as WM_POWER

    Wm_powerbroadcast: INTEGER is 536
            -- Declared in Windows as WM_POWERBROADCAST

    Wm_print: INTEGER is 791
            -- Declared in Windows as WM_PRINT

    Wm_printclient: INTEGER is 792
            -- Declared in Windows as WM_PRINTCLIENT

    Wm_querydragicon: INTEGER is 55
            -- Declared in Windows as WM_QUERYDRAGICON

    Wm_queryendsession: INTEGER is 17
            -- Declared in Windows as WM_QUERYENDSESSION

    Wm_querynewpalette: INTEGER is 783
            -- Declared in Windows as WM_QUERYNEWPALETTE

    Wm_queryopen: INTEGER is 19
            -- Declared in Windows as WM_QUERYOPEN

    Wm_queryuistate: INTEGER is 297
            -- Declared in Windows as WM_QUERYUISTATE

    Wm_queuesync: INTEGER is 35
            -- Declared in Windows as WM_QUEUESYNC

    Wm_quit: INTEGER is 18
            -- Declared in Windows as WM_QUIT

    Wm_rbuttondblclk: INTEGER is 518
            -- Declared in Windows as WM_RBUTTONDBLCLK

    Wm_rbuttondown: INTEGER is 516
            -- Declared in Windows as WM_RBUTTONDOWN

    Wm_rbuttonup: INTEGER is 517
            -- Declared in Windows as WM_RBUTTONUP

    Wm_renderallformats: INTEGER is 774
            -- Declared in Windows as WM_RENDERALLFORMATS

    Wm_renderformat: INTEGER is 773
            -- Declared in Windows as WM_RENDERFORMAT

    Wm_setcursor: INTEGER is 32
            -- Declared in Windows as WM_SETCURSOR

    Wm_setfocus: INTEGER is 7
            -- Declared in Windows as WM_SETFOCUS

    Wm_setfont: INTEGER is 48
            -- Declared in Windows as WM_SETFONT

    Wm_sethotkey: INTEGER is 50
            -- Declared in Windows as WM_SETHOTKEY

    Wm_seticon: INTEGER is 128
            -- Declared in Windows as WM_SETICON

    Wm_setredraw: INTEGER is 11
            -- Declared in Windows as WM_SETREDRAW

    Wm_settext: INTEGER is 12
            -- Declared in Windows as WM_SETTEXT

    Wm_settingchange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of wm_wininichange.

    Wm_showwindow: INTEGER is 24
            -- Declared in Windows as WM_SHOWWINDOW

    Wm_size: INTEGER is 5
            -- Declared in Windows as WM_SIZE

    Wm_sizeclipboard: INTEGER is 779
            -- Declared in Windows as WM_SIZECLIPBOARD

    Wm_sizing: INTEGER is 532
            -- Declared in Windows as WM_SIZING

    Wm_spoolerstatus: INTEGER is 42
            -- Declared in Windows as WM_SPOOLERSTATUS

    Wm_stylechanged: INTEGER is 125
            -- Declared in Windows as WM_STYLECHANGED

    Wm_stylechanging: INTEGER is 124
            -- Declared in Windows as WM_STYLECHANGING

    Wm_syncpaint: INTEGER is 136
            -- Declared in Windows as WM_SYNCPAINT

    Wm_syschar: INTEGER is 262
            -- Declared in Windows as WM_SYSCHAR

    Wm_syscolorchange: INTEGER is 21
            -- Declared in Windows as WM_SYSCOLORCHANGE

    Wm_syscommand: INTEGER is 274
            -- Declared in Windows as WM_SYSCOMMAND

    Wm_sysdeadchar: INTEGER is 263
            -- Declared in Windows as WM_SYSDEADCHAR

    Wm_syskeydown: INTEGER is 260
            -- Declared in Windows as WM_SYSKEYDOWN

    Wm_syskeyup: INTEGER is 261
            -- Declared in Windows as WM_SYSKEYUP

    Wm_tcard: INTEGER is 82
            -- Declared in Windows as WM_TCARD

    Wm_timechange: INTEGER is 30
            -- Declared in Windows as WM_TIMECHANGE

    Wm_timer: INTEGER is 275
            -- Declared in Windows as WM_TIMER

    Wm_undo: INTEGER is 772
            -- Declared in Windows as WM_UNDO

    Wm_uninitmenupopup: INTEGER is 293
            -- Declared in Windows as WM_UNINITMENUPOPUP

    Wm_updateuistate: INTEGER is 296
            -- Declared in Windows as WM_UPDATEUISTATE

    Wm_user: INTEGER is 1024
            -- Declared in Windows as WM_USER

    Wm_userchanged: INTEGER is 84
            -- Declared in Windows as WM_USERCHANGED

    Wm_vkeytoitem: INTEGER is 46
            -- Declared in Windows as WM_VKEYTOITEM

    Wm_vscroll: INTEGER is 277
            -- Declared in Windows as WM_VSCROLL

    Wm_vscrollclipboard: INTEGER is 778
            -- Declared in Windows as WM_VSCROLLCLIPBOARD

    Wm_windowposchanged: INTEGER is 71
            -- Declared in Windows as WM_WINDOWPOSCHANGED

    Wm_windowposchanging: INTEGER is 70
            -- Declared in Windows as WM_WINDOWPOSCHANGING

    Wm_wininichange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of wm_settingchange.

    Wm_xbuttondblclk: INTEGER is 525
            -- Declared in Windows as WM_XBUTTONDBLCLK

    Wm_xbuttondown: INTEGER is 523
            -- Declared in Windows as WM_XBUTTONDOWN

    Wm_xbuttonup: INTEGER is 524
            -- Declared in Windows as WM_XBUTTONUP

feature -- Window Size constants

    Size_maxhide: INTEGER is 4
            -- Declared in Windows as SIZE_MAXHIDE

    Size_maximized: INTEGER is 2
            -- Declared in Windows as SIZE_MAXIMIZED

    Size_maxshow: INTEGER is 3
            -- Declared in Windows as SIZE_MAXSHOW

    Size_minimized: INTEGER is 1
            -- Declared in Windows as SIZE_MINIMIZED

    Size_restored: INTEGER is 0
            -- Declared in Windows as SIZE_RESTORED

feature -- Window styles

    Ws_border: INTEGER is 8388608
            -- Declared in Windows as WS_BORDER

    Ws_caption: INTEGER is 12582912
            -- Declared in Windows as WS_CAPTION

    Ws_child: INTEGER is 1073741824
            -- Declared in Windows as WS_CHILD

    Ws_childwindow: INTEGER is 1073741824
            -- Declared in Windows as WS_CHILDWINDOW

    Ws_clipchildren: INTEGER is 33554432
            -- Declared in Windows as WS_CLIPCHILDREN

    Ws_clipsiblings: INTEGER is 67108864
            -- Declared in Windows as WS_CLIPSIBLINGS

    Ws_disabled: INTEGER is 134217728
            -- Declared in Windows as WS_DISABLED

    Ws_dlgframe: INTEGER is 4194304
            -- Declared in Windows as WS_DLGFRAME

    Ws_group: INTEGER is 131072
            -- Declared in Windows as WS_GROUP

    Ws_hscroll: INTEGER is 1048576
            -- Declared in Windows as WS_HSCROLL

    Ws_iconic: INTEGER is 536870912
            -- Declared in Windows as WS_MINIMIZE
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_minimize.

    Ws_maximize: INTEGER is 16777216
            -- Declared in Windows as WS_MAXIMIZE

    Ws_maximizebox: INTEGER is 65536
            -- Declared in Windows as WS_MAXIMIZEBOX

    Ws_minimize: INTEGER is 536870912
            -- Declared in Windows as WS_MINIMIZE
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_iconic.

    Ws_minimizebox: INTEGER is 131072
            -- Declared in Windows as WS_MINIMIZEBOX

    Ws_overlapped: INTEGER is 0
            -- Declared in Windows as WS_OVERLAPPED
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_tiled.

    Ws_overlappedwindow: INTEGER is 13565952
            -- Declared in Windows as WS_OVERLAPPEDWINDOW
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_tiledwindow.

    Ws_popup: INTEGER is -2147483648
            -- Declared in Windows as WS_POPUP

    Ws_popupwindow: INTEGER is -2138570752
            -- Declared in Windows as WS_POPUPWINDOW

    Ws_sizebox: INTEGER is 262144
            -- Declared in Windows as WS_THICKFRAME
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_thickframe.

    Ws_sysmenu: INTEGER is 524288
            -- Declared in Windows as WS_SYSMENU

    Ws_tabstop: INTEGER is 65536
            -- Declared in Windows as WS_TABSTOP

    Ws_thickframe: INTEGER is 262144
            -- Declared in Windows as WS_THICKFRAME
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_sizebox.

    Ws_tiled: INTEGER is 0
            -- Declared in Windows as WS_OVERLAPPED
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_overlapped.

    Ws_tiledwindow: INTEGER is 13565952
            -- Declared in Windows as WS_OVERLAPPEDWINDOW
            -- Was declared in WEL_WINDOW_CONSTANTS as synonym of ws_overlappedwindow.

    Ws_visible: INTEGER is 268435456
            -- Declared in Windows as WS_VISIBLE

    Ws_vscroll: INTEGER is 2097152
            -- Declared in Windows as WS_VSCROLL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOW_CONSTANTS


WEL_ACCELERATOR_FLAG_CONSTANTS Chart

class
    WEL_ACCELERATOR_FLAG_CONSTANTS

General
    cluster: wel.consts
    description: "Constants for defining accelerator keys in WEL_ACCELERATOR."

Ancestors
    ANY

Queries
    Falt: INTEGER
    Fcontrol: INTEGER
    Fnoinvert: INTEGER
    Fshift: INTEGER
    Fvirtkey: INTEGER


WEL_ACCELERATOR_FLAG_CONSTANTS Flat contracts

indexing
    description: "Constants for defining accelerator keys in WEL_ACCELERATOR."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ACCELERATOR_FLAG_CONSTANTS

feature -- Access

    Falt: INTEGER is 16
            -- The ALT key must be held down when the accelerator
            -- key is pressed.
            --
            -- Declared in Windows as FALT

    Fcontrol: INTEGER is 8
            -- The CTRL key must be held down when the accelerator
            -- key is pressed.
            --
            -- Declared in Windows as FCONTROL

    Fnoinvert: INTEGER is 2
            -- Specifies that no top-level menu item is highlighted
            -- when the accelerator is used. If this flag is not
            -- specified, a top-level menu item will be
            -- highlighted, if possible, when the accelerator is
            -- used.
            --
            -- Declared in Windows as FNOINVERT

    Fshift: INTEGER is 4
            -- The SHIFT key must be held down when the accelerator
            -- key is pressed.
            --
            -- Declared in Windows as FSHIFT

    Fvirtkey: INTEGER is 1
            -- The key member specifies a virtual-key code. If this
            -- flag is not specified, key is assumed to specify an
            -- ASCII character code.
            --
            -- Declared in Windows as FVIRTKEY

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ACCELERATOR_FLAG_CONSTANTS


WEL_BIF_CONSTANTS Chart

class
    WEL_BIF_CONSTANTS

General
    cluster: wel.consts
    description: "Browse Info Folder (BIF) constants."

Ancestors
    ANY

Queries
    Bif_browseforcomputer: INTEGER
    Bif_browseforprinter: INTEGER
    Bif_browseincludefiles: INTEGER
    Bif_dontgobelowdomain: INTEGER
    Bif_editbox: INTEGER
    Bif_returnfsancestors: INTEGER
    Bif_returnonlyfsdirs: INTEGER
    Bif_statustext: INTEGER
    Bif_usenewui: INTEGER
    Bif_validate: INTEGER


WEL_BIF_CONSTANTS Flat contracts

indexing
    description: "Browse Info Folder (BIF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BIF_CONSTANTS

feature -- Access

    Bif_browseforcomputer: INTEGER is 4096
            -- Only return computers. If the user selects
            -- anything other than a computer, the OK button is grayed.

    Bif_browseforprinter: INTEGER is 8192
            -- Only return printers. If the user selects
            -- anything other than a printer, the OK button is grayed.

    Bif_browseincludefiles: INTEGER is 16384
            -- Requires MVC Version 4.71 or greater. The browse dialog
            -- will display files as well as folders.

    Bif_dontgobelowdomain: INTEGER is 2
            -- Do not include network folders below the domain level
            -- in the tree view control.

    Bif_editbox: INTEGER is 16
            -- Requires MVC Version 4.71 or greater. The browse dialog
            -- includes an edit control in which the user can type
            -- the name of an item

    Bif_returnfsancestors: INTEGER is 8
            -- Only return file system ancestors. If the user selects
            -- anything other than a file system ancestor, the OK button
            -- is grayed.

    Bif_returnonlyfsdirs: INTEGER is 1
            -- Only return file system directories. If the user selects
            -- folders that are not part of the file system, the OK button
            -- is grayed.

    Bif_statustext: INTEGER is 4
            -- Include a status area in the dialog box. The callback
            -- function can set the status text by sending messages to the
            -- dialog box.

    Bif_usenewui: INTEGER is 80
            -- Use the new user-interface. Setting this flag provides the
            -- user with a larger dialog box that can be resized. It has
            -- several new capabilities including: drag and drop capability
            -- within the dialog box, reordering, context menus, new folders,
            -- delete, and other context menu commands. To use this flag,
            -- you must call OleInitialize or CoInitialize before
            -- calling SHBrowseForFolder.
            -- IMPORTANT: to use, requires SHELL32.DLL version 5.00 or higher.
            -- See class WEL_WINDOWS_VERSION. Is not defined as external
            -- because it is not yet included in latest versions of "shlobj.h".

    Bif_validate: INTEGER is 32
            -- Requires Shell32.dll Version 4.71 or greater. If the user types an
            -- invalid name into the edit box, the browse dialog will call
            -- the application's BrowseCallbackProc with the
            -- BFFM_VALIDATEFAILED message. This flag is ignored if
            -- BIF_EDITBOX is not specified.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BIF_CONSTANTS


WEL_BM_CONSTANTS Chart

class
    WEL_BM_CONSTANTS

General
    cluster: wel.consts
    description: "Button message (BM_...) constants."

Ancestors
    ANY

Queries
    Bm_click: INTEGER
    Bm_getcheck: INTEGER
    Bm_getimage: INTEGER
    Bm_getstate: INTEGER
    Bm_setcheck: INTEGER
    Bm_setimage: INTEGER
    Bm_setstate: INTEGER
    Bm_setstyle: INTEGER


WEL_BM_CONSTANTS Flat contracts

indexing
    description: "Button message (BM_...) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BM_CONSTANTS

feature -- Access

    Bm_click: INTEGER is 245
            -- An application sends a BM_CLICK message to simulate the user clicking
            -- a button. This message causes the button to receive the WM_LBUTTONDOWN
            -- and WM_LBUTTONUP messages, and the button's parent window to receive
            -- a BN_CLICKED notification message.

    Bm_getcheck: INTEGER is 240
            -- An application sends a BM_GETCHECK message to retrieve the
            -- check state of a radio button or check box.

    Bm_getimage: INTEGER is 246
            -- An application sends a BM_GETIMAGE message to retrieve a
            -- handle to the image (icon or bitmap) associated with the button.

    Bm_getstate: INTEGER is 242
            -- An application sends a BM_GETSTATE message to determine the
            -- state of a button or check box.

    Bm_setcheck: INTEGER is 241
            -- An application sends a BM_SETCHECK message to set the check
            -- state of a radio button or check box.

    Bm_setimage: INTEGER is 247
            -- An application sends a BM_SETIMAGE message to associate a new
            -- image (icon or bitmap) with the button.

    Bm_setstate: INTEGER is 243
            -- An application sends a BM_SETSTATE message to change the highlight
            -- state of a button. The highlight state indicates whether the button
            -- is highlighted as if the user had pushed it.

    Bm_setstyle: INTEGER is 244
            -- An application sends a BM_SETSTYLE message to change the style
            -- of a button.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BM_CONSTANTS


WEL_BN_CONSTANTS Chart

class
    WEL_BN_CONSTANTS

General
    cluster: wel.consts
    description: "Button notification (BN) constants."

Ancestors
    ANY

Queries
    Bn_clicked: INTEGER
    Bn_disable: INTEGER
    Bn_doubleclicked: INTEGER
    Bn_hilite: INTEGER
    Bn_killfocus: INTEGER
    Bn_paint: INTEGER
    Bn_setfocus: INTEGER
    Bn_unhilite: INTEGER


WEL_BN_CONSTANTS Flat contracts

indexing
    description: "Button notification (BN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BN_CONSTANTS

feature -- Access

    Bn_clicked: INTEGER is 0

    Bn_disable: INTEGER is 4

    Bn_doubleclicked: INTEGER is 5

    Bn_hilite: INTEGER is 2

    Bn_killfocus: INTEGER is 7

    Bn_paint: INTEGER is 1

    Bn_setfocus: INTEGER is 6

    Bn_unhilite: INTEGER is 3

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BN_CONSTANTS


WEL_BRUSH_STYLE_CONSTANTS Chart

class
    WEL_BRUSH_STYLE_CONSTANTS

General
    cluster: wel.consts
    description: "Brush style (BS) constants."

Ancestors
    ANY

Queries
    Bs_dibpattern: INTEGER
    Bs_dibpattern8x8: INTEGER
    Bs_dibpatternpt: INTEGER
    Bs_hatched: INTEGER
    Bs_hollow: INTEGER
    Bs_indexed: INTEGER
    Bs_null: INTEGER
    Bs_pattern: INTEGER
    Bs_pattern8x8: INTEGER
    Bs_solid: INTEGER


WEL_BRUSH_STYLE_CONSTANTS Flat contracts

indexing
    description: "Brush style (BS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BRUSH_STYLE_CONSTANTS

feature -- Access

    Bs_dibpattern: INTEGER is 5
            -- A pattern brush defined by a device-independent
            -- bitmap (DIB) specification.

    Bs_dibpattern8x8: INTEGER is 8
            -- Same as Bs_dibpattern.

    Bs_dibpatternpt: INTEGER is 6
            -- A pattern brush defined by a device-independent
            -- bitmap (DIB) specification

    Bs_hatched: INTEGER is 2
            -- Hatched brush.

    Bs_hollow: INTEGER is 1
            -- Hollow brush.

    Bs_indexed: INTEGER is 4

    Bs_null: INTEGER is 1
            -- Same as Bs_hollow.

    Bs_pattern: INTEGER is 3
            -- Pattern brush defined by a memory bitmap.

    Bs_pattern8x8: INTEGER is 7
            -- Same as Bs_pattern.

    Bs_solid: INTEGER is 0
            -- Solid brush.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BRUSH_STYLE_CONSTANTS


WEL_BS_CONSTANTS Chart

class
    WEL_BS_CONSTANTS

General
    cluster: wel.consts
    description: "Button style (BS) constants."

Ancestors
    ANY

Queries
    Bs_3state: INTEGER
    Bs_auto3state: INTEGER
    Bs_autocheckbox: INTEGER
    Bs_autoradiobutton: INTEGER
    Bs_bitmap: INTEGER
    Bs_bottom: INTEGER
    Bs_center: INTEGER
    Bs_checkbox: INTEGER
    Bs_defpushbutton: INTEGER
    Bs_flat: INTEGER
    Bs_groupbox: INTEGER
    Bs_icon: INTEGER
    Bs_left: INTEGER
    Bs_lefttext: INTEGER
    Bs_multiline: INTEGER
    Bs_notify: INTEGER
    Bs_ownerdraw: INTEGER
    Bs_pushbutton: INTEGER
    Bs_pushlike: INTEGER
    Bs_radiobutton: INTEGER
    Bs_right: INTEGER
    Bs_rightbutton: INTEGER
    Bs_text: INTEGER
    Bs_top: INTEGER
    Bs_userbutton: INTEGER
    Bs_vcenter: INTEGER


WEL_BS_CONSTANTS Flat contracts

indexing
    description: "Button style (BS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BS_CONSTANTS

feature -- Access

    Bs_3state: INTEGER is 5

    Bs_auto3state: INTEGER is 6

    Bs_autocheckbox: INTEGER is 3

    Bs_autoradiobutton: INTEGER is 9

    Bs_bitmap: INTEGER is 128

    Bs_bottom: INTEGER is 2048

    Bs_center: INTEGER is 768

    Bs_checkbox: INTEGER is 2

    Bs_defpushbutton: INTEGER is 1

    Bs_flat: INTEGER is 32768

    Bs_groupbox: INTEGER is 7

    Bs_icon: INTEGER is 64

    Bs_left: INTEGER is 256

    Bs_lefttext: INTEGER is 32

    Bs_multiline: INTEGER is 8192

    Bs_notify: INTEGER is 16384

    Bs_ownerdraw: INTEGER is 11

    Bs_pushbutton: INTEGER is 0

    Bs_pushlike: INTEGER is 4096

    Bs_radiobutton: INTEGER is 4

    Bs_right: INTEGER is 512

    Bs_rightbutton: INTEGER is 32
            -- Same as Bs_lefttext.

    Bs_text: INTEGER is 0

    Bs_top: INTEGER is 1024

    Bs_userbutton: INTEGER is 8

    Bs_vcenter: INTEGER is 3072

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BS_CONSTANTS


WEL_CAPABILITIES_CONSTANTS Chart

class
    WEL_CAPABILITIES_CONSTANTS

General
    cluster: wel.consts
    description: "Device-specific capabilities constants."

Ancestors
    ANY

Queries
    Aspect_x: INTEGER
    Aspect_x_y: INTEGER
    Aspect_y: INTEGER
    Bits_pixel: INTEGER
    Clip_caps: INTEGER
    Color_resolution: INTEGER
    Curve_caps: INTEGER
    Driver_version: INTEGER
    Horizontal_resolution: INTEGER
    Horizontal_size: INTEGER
    Line_caps: INTEGER
    Logical_pixels_x: INTEGER
    Logical_pixels_y: INTEGER
    Num_brushes: INTEGER
    Num_colors: INTEGER
    Num_fonts: INTEGER
    Num_markers: INTEGER
    Num_pens: INTEGER
    Num_reserved: INTEGER
    Pdevice_size: INTEGER
    Physical_offset_x: INTEGER
    Physical_offset_y: INTEGER
    Planes: INTEGER
    Polygonal_caps: INTEGER
    Raster_caps: INTEGER
    Scaling_factor_x: INTEGER
    Scaling_factor_y: INTEGER
    Size_palette: INTEGER
    Technology: INTEGER
    Text_caps: INTEGER
    Vertical_resolution: INTEGER
    Vertical_size: INTEGER


WEL_CAPABILITIES_CONSTANTS Flat contracts

indexing
    description: "Device-specific capabilities constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CAPABILITIES_CONSTANTS

feature -- Access

    Aspect_x: INTEGER is 40
            -- Relative width of a device pixel
            -- used for line drawing

    Aspect_x_y: INTEGER is 44
            -- Diagonal width of a device pixel
            -- used for line drawing

    Aspect_y: INTEGER is 42
            -- Relative height of a device pixel
            -- used for line drawing

    Bits_pixel: INTEGER is 12
            -- Number of adjacent color bits for each pixel

    Clip_caps: INTEGER is 36
            -- See class WEL_CLIPPING_CAPABILITIES_CONSTANTS

    Color_resolution: INTEGER is 108
            -- Color resolution of the device in bits

    Curve_caps: INTEGER is 28
            -- See class WEL_CURVE_CAPABILITIES_CONSTANTS

    Driver_version: INTEGER is 1
            -- Version number of the device driver

    Horizontal_resolution: INTEGER is 8
            -- Width of the display, in pixels

    Horizontal_size: INTEGER is 4
            -- Width of the physical display in millimeters

    Line_caps: INTEGER is 30
            -- See class WEL_LINE_CAPABILITIES_CONSTANTS

    Logical_pixels_x: INTEGER is 88
            -- Number of pixels per logical inch along
            -- the display width

    Logical_pixels_y: INTEGER is 90
            -- Number of pixels per logical inch along
            -- the display height

    Num_brushes: INTEGER is 16
            -- Number of device-specific brushes

    Num_colors: INTEGER is 24
            -- Number of entries in the device's color table

    Num_fonts: INTEGER is 22
            -- Number of device-specific fonts

    Num_markers: INTEGER is 20
            -- Number of device-specific markers

    Num_pens: INTEGER is 18
            -- Number of device-specific pens

    Num_reserved: INTEGER is 106
            -- Number of reserved entries in the system palette

    Pdevice_size: INTEGER is 26
            -- Size of the PDEVICE internal structure, in bytes

    Physical_offset_x: INTEGER is 112
            -- Distance from left edge of the printable area, in
            -- device units.

    Physical_offset_y: INTEGER is 113
            -- Distance from top edge of the printable area, in
            -- device units.

    Planes: INTEGER is 14
            -- Number of color planes

    Polygonal_caps: INTEGER is 32
            -- See class WEL_POLYGONAL_CAPABILITIES_CONSTANTS

    Raster_caps: INTEGER is 38
            -- See class WEL_RASTER_CAPABILITIES_CONSTANTS

    Scaling_factor_x: INTEGER is 114
            -- Scaling factor for the x-axis of the printer.

    Scaling_factor_y: INTEGER is 115
            -- Scaling factor for the y-axis of the printer.

    Size_palette: INTEGER is 104
            -- Number of entries in the system palette

    Technology: INTEGER is 2
            -- Device technology.
            -- See class WEL_DEVICE_TECHNOLOGY_CONSTANTS

    Text_caps: INTEGER is 34
            -- See class WEL_TEXT_CAPABILITIES_CONSTANTS

    Vertical_resolution: INTEGER is 10
            -- Height of the display, in raster lines

    Vertical_size: INTEGER is 6
            -- Height of the physical display in millimeters

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CAPABILITIES_CONSTANTS


WEL_CBEIF_CONSTANTS Chart

class
    WEL_CBEIF_CONSTANTS

General
    cluster: wel.consts
    description: "Combo-Box-Ex Item Flag (CBEIF) constants."

Ancestors
    ANY

Queries
    Cbeif_di_setitem: INTEGER
    Cbeif_image: INTEGER
    Cbeif_indent: INTEGER
    Cbeif_lparam: INTEGER
    Cbeif_overlay: INTEGER
    Cbeif_selectedimage: INTEGER
    Cbeif_text: INTEGER


WEL_CBEIF_CONSTANTS Flat contracts

indexing
    description: "Combo-Box-Ex Item Flag (CBEIF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CBEIF_CONSTANTS

feature -- Access

    Cbeif_di_setitem: INTEGER is 268435456
            -- The control should store the item data and not ask
            -- for it again. This flag is used only with the
            -- CBEN_GETDISPINFO notification message.
            --
            -- Declared in Windows as CBEIF_DI_SETITEM

    Cbeif_image: INTEGER is 2
            -- The image member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_IMAGE

    Cbeif_indent: INTEGER is 16
            -- The indent member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_INDENT

    Cbeif_lparam: INTEGER is 32
            -- The lparam member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_LPARAM

    Cbeif_overlay: INTEGER is 8
            -- The overlay member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_OVERLAY

    Cbeif_selectedimage: INTEGER is 4
            -- The selected_image member is valid or must be
            -- filled in.
            --
            -- Declared in Windows as CBEIF_SELECTEDIMAGE

    Cbeif_text: INTEGER is 1
            -- The text member is valid or must be filled in.
            --
            -- Declared in Windows as CBEIF_TEXT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CBEIF_CONSTANTS


WEL_CBEM_CONSTANTS Chart

class
    WEL_CBEM_CONSTANTS

General
    cluster: wel.consts
    description: "ComboBoxEx Message (CBEM) constants."

Ancestors
    ANY

Queries
    Cbem_deleteitem: INTEGER
    Cbem_getcombocontrol: INTEGER
    Cbem_geteditcontrol: INTEGER
    Cbem_getexstyle: INTEGER
    Cbem_getimagelist: INTEGER
    Cbem_getitem: INTEGER
    Cbem_haseditchanged: INTEGER
    Cbem_insertitem: INTEGER
    Cbem_setexstyle: INTEGER
    Cbem_setimagelist: INTEGER
    Cbem_setitem: INTEGER


WEL_CBEM_CONSTANTS Flat contracts

indexing
    description: "ComboBoxEx Message (CBEM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CBEM_CONSTANTS

feature -- Access

    Cbem_deleteitem: INTEGER is 324
            -- Removes an item from a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_DELETEITEM

    Cbem_getcombocontrol: INTEGER is 1030
            -- Retrieves the handle to the child combo box control.
            --
            -- Declared in Windows as CBEM_GETCOMBOCONTROL

    Cbem_geteditcontrol: INTEGER is 1031
            -- Retrieves the handke to the edit control portion of
            -- a ComboBoxEc control.
            --
            -- Declared in Windows as CBEM_GETEDITCONTROL

    Cbem_getexstyle: INTEGER is 1033
            -- Retrieves the extended styles of a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_GETEXSTYLE

    Cbem_getimagelist: INTEGER is 1027
            -- Retrieves the handle to an image list assigned
            -- to a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_GETIMAGELIST

    Cbem_getitem: INTEGER is 1028
            -- Retrieves item information for a given ComboBoxEx item.
            --
            -- Declared in Windows as CBEM_GETITEM

    Cbem_haseditchanged: INTEGER is 1034
            -- Determines if the user has changed the contents of the
            -- ComboBoxEx edit control by typing.
            --
            -- Declared in Windows as CBEM_HASEDITCHANGED

    Cbem_insertitem: INTEGER is 1025
            -- Inserts a new item in a ComboBoxEx.
            --
            -- Declared in Windows as CBEM_INSERTITEM

    Cbem_setexstyle: INTEGER is 1032
            -- Sets extended styles within a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_SETEXSTYLE

    Cbem_setimagelist: INTEGER is 1026
            -- Sets an image list for a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_SETIMAGELIST

    Cbem_setitem: INTEGER is 1029
            -- Sets the attributes for an item in a ComboBoxEx control.
            --
            -- Declared in Windows as CBEM_SETITEM

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CBEM_CONSTANTS


WEL_CBEN_CONSTANTS Chart

class
    WEL_CBEN_CONSTANTS

General
    cluster: wel.consts
    description: "ComboBoxEx Notifications (CBEN) constants."

Ancestors
    ANY

Queries
    Cben_beginedit: INTEGER
    Cben_deleteitem: INTEGER
    Cben_endedit: INTEGER
    Cben_getdispinfo: INTEGER
    Cben_insertitem: INTEGER
    Cbenf_dropdown: INTEGER
    Cbenf_escape: INTEGER
    Cbenf_killfocus: INTEGER
    Cbenf_return: INTEGER


WEL_CBEN_CONSTANTS Flat contracts

indexing
    description: "ComboBoxEx Notifications (CBEN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CBEN_CONSTANTS

feature -- Access

    Cben_beginedit: INTEGER is -804
            -- Sent when the user activates the drop-down list in the
            -- control's edit box.
            --
            -- Declared in Windows as CBEN_BEGINEDIT

    Cben_deleteitem: INTEGER is -802
            -- Sent when an item has been deleted.
            --
            -- Declared in Windows as CBEN_DELETEITEM

    Cben_endedit: INTEGER is -805
            -- Sent when the user has concluded an operation within
            -- the edit box or has selected an item from the control's
            -- drop-down list.
            --
            -- Declared in Windows as CBEN_ENDEDIT

    Cben_getdispinfo: INTEGER is -800
            -- Sent to retrieve display information about a callback item.
            --
            -- Declared in Windows as CBEN_GETDISPINFO

    Cben_insertitem: INTEGER is -801
            -- Send when a new item has been inserted in the control.
            --
            -- Declared in Windows as CBEN_INSERTITEM

feature -- Access : notification flags

    Cbenf_dropdown: INTEGER is 4
            -- The user activated the drop-down list.
            --
            -- Declared in Windows as CBENF_DROPDOWN

    Cbenf_escape: INTEGER is 3
            -- The user pressed the ESCAPE key.
            --
            -- Declared in Windows as CBENF_ESCAPE

    Cbenf_killfocus: INTEGER is 1
            -- The edit box lost the keyboard focus.
            --
            -- Declared in Windows as CBENF_KILLFOCUS

    Cbenf_return: INTEGER is 2
            -- The user completed the edit operation by pressing
            -- the ENTER key.
            --
            -- Declared in Windows as CBENF_RETURN

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CBEN_CONSTANTS


WEL_CBES_CONSTANTS Chart

class
    WEL_CBES_CONSTANTS

General
    cluster: wel.consts
    description: "ComboBoxEx Style (CBES) messages."

Ancestors
    ANY

Queries
    Cbes_ex_noeditimage: INTEGER
    Cbes_ex_noeditimageindent: INTEGER


WEL_CBES_CONSTANTS Flat contracts

indexing
    description: "ComboBoxEx Style (CBES) messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CBES_CONSTANTS

feature -- Access

    Cbes_ex_noeditimage: INTEGER is 1
            -- The edit box will not display an item image.
            --
            -- Declared in Windows as CBES_EX_NOEDITIMAGE

    Cbes_ex_noeditimageindent: INTEGER is 2
            -- The edit box will not indend text to make room
            -- for an item image.
            --
            -- Declared in Windows as CBES_EX_NOEDITIMAGEINDENT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CBES_CONSTANTS


WEL_CBN_CONSTANTS Chart

class
    WEL_CBN_CONSTANTS

General
    cluster: wel.consts
    description: "ComboBox notification message (CBN) constants."

Ancestors
    ANY

Queries
    Cbn_closeup: INTEGER
    Cbn_dblclk: INTEGER
    Cbn_dropdown: INTEGER
    Cbn_editchange: INTEGER
    Cbn_editupdate: INTEGER
    Cbn_errspace: INTEGER
    Cbn_killfocus: INTEGER
    Cbn_selchange: INTEGER
    Cbn_selendcancel: INTEGER
    Cbn_selendok: INTEGER
    Cbn_setfocus: INTEGER


WEL_CBN_CONSTANTS Flat contracts

indexing
    description: "ComboBox notification message (CBN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CBN_CONSTANTS

feature -- Access

    Cbn_closeup: INTEGER is 8
            -- Declared in Windows as CBN_CLOSEUP

    Cbn_dblclk: INTEGER is 2
            -- Declared in Windows as CBN_DBLCLK

    Cbn_dropdown: INTEGER is 7
            -- Declared in Windows as CBN_DROPDOWN

    Cbn_editchange: INTEGER is 5
            -- Declared in Windows as CBN_EDITCHANGE

    Cbn_editupdate: INTEGER is 6
            -- Declared in Windows as CBN_EDITUPDATE

    Cbn_errspace: INTEGER is -1
            -- Declared in Windows as CBN_ERRSPACE

    Cbn_killfocus: INTEGER is 4
            -- Declared in Windows as CBN_KILLFOCUS

    Cbn_selchange: INTEGER is 1
            -- Declared in Windows as CBN_SELCHANGE

    Cbn_selendcancel: INTEGER is 10
            -- Declared in Windows as CBN_SELENDCANCEL

    Cbn_selendok: INTEGER is 9
            -- Declared in Windows as CBN_SELENDOK

    Cbn_setfocus: INTEGER is 3
            -- Declared in Windows as CBN_SETFOCUS

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CBN_CONSTANTS


WEL_CBS_CONSTANTS Chart

class
    WEL_CBS_CONSTANTS

General
    cluster: wel.consts
    description: "ComboBox Style (CBS) messages."

Ancestors
    ANY

Queries
    Cbs_autohscroll: INTEGER
    Cbs_disablenoscroll: INTEGER
    Cbs_dropdown: INTEGER
    Cbs_dropdownlist: INTEGER
    Cbs_hasstrings: INTEGER
    Cbs_nointegralheight: INTEGER
    Cbs_oemconvert: INTEGER
    Cbs_ownerdrawfixed: INTEGER
    Cbs_ownerdrawvariable: INTEGER
    Cbs_simple: INTEGER
    Cbs_sort: INTEGER


WEL_CBS_CONSTANTS Flat contracts

indexing
    description: "ComboBox Style (CBS) messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CBS_CONSTANTS

feature -- Access

    Cbs_autohscroll: INTEGER is 64
            -- Declared in Windows as CBS_AUTOHSCROLL

    Cbs_disablenoscroll: INTEGER is 2048
            -- Declared in Windows as CBS_DISABLENOSCROLL

    Cbs_dropdown: INTEGER is 2
            -- Declared in Windows as CBS_DROPDOWN

    Cbs_dropdownlist: INTEGER is 3
            -- Declared in Windows as CBS_DROPDOWNLIST

    Cbs_hasstrings: INTEGER is 512
            -- Declared in Windows as CBS_HASSTRINGS

    Cbs_nointegralheight: INTEGER is 1024
            -- Declared in Windows as CBS_NOINTEGRALHEIGHT

    Cbs_oemconvert: INTEGER is 128
            -- Declared in Windows as CBS_OEMCONVERT

    Cbs_ownerdrawfixed: INTEGER is 16
            -- Declared in Windows as CBS_OWNERDRAWFIXED

    Cbs_ownerdrawvariable: INTEGER is 32
            -- Declared in Windows as CBS_OWNERDRAWVARIABLE

    Cbs_simple: INTEGER is 1
            -- Declared in Windows as CBS_SIMPLE

    Cbs_sort: INTEGER is 256
            -- Declared in Windows as CBS_SORT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CBS_CONSTANTS


WEL_CB_CONSTANTS Chart

class
    WEL_CB_CONSTANTS

General
    cluster: wel.consts
    description: "ComboBox message (CB) constants."

Ancestors
    ANY

Queries
    Cb_addstring: INTEGER
    Cb_deletestring: INTEGER
    Cb_dir: INTEGER
    Cb_err: INTEGER
    Cb_errspace: INTEGER
    Cb_findstring: INTEGER
    Cb_findstringexact: INTEGER
    Cb_getcount: INTEGER
    Cb_getcursel: INTEGER
    Cb_getdroppedcontrolrect: INTEGER
    Cb_getdroppedstate: INTEGER
    Cb_geteditsel: INTEGER
    Cb_getextendedui: INTEGER
    Cb_getitemdata: INTEGER
    Cb_getitemheight: INTEGER
    Cb_getlbtext: INTEGER
    Cb_getlbtextlen: INTEGER
    Cb_gettopindex: INTEGER
    Cb_insertstring: INTEGER
    Cb_limittext: INTEGER
    Cb_okay: INTEGER
    Cb_resetcontent: INTEGER
    Cb_selectstring: INTEGER
    Cb_setcursel: INTEGER
    Cb_seteditsel: INTEGER
    Cb_setextendedui: INTEGER
    Cb_setitemdata: INTEGER
    Cb_setitemheight: INTEGER
    Cb_settopindex: INTEGER
    Cb_showdropdown: INTEGER


WEL_CB_CONSTANTS Flat contracts

indexing
    description: "ComboBox message (CB) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CB_CONSTANTS

feature -- Access

    Cb_addstring: INTEGER is 323
            -- Declared in Windows as CB_ADDSTRING

    Cb_deletestring: INTEGER is 324
            -- Declared in Windows as CB_DELETESTRING

    Cb_dir: INTEGER is 325
            -- Declared in Windows as CB_DIR

    Cb_err: INTEGER is -1
            -- Declared in Windows as CB_ERR

    Cb_errspace: INTEGER is -2
            -- Declared in Windows as CB_ERRSPACE

    Cb_findstring: INTEGER is 332
            -- Declared in Windows as CB_FINDSTRING

    Cb_findstringexact: INTEGER is 344
            -- Declared in Windows as CB_FINDSTRINGEXACT

    Cb_getcount: INTEGER is 326
            -- Declared in Windows as CB_GETCOUNT

    Cb_getcursel: INTEGER is 327
            -- Declared in Windows as CB_GETCURSEL

    Cb_getdroppedcontrolrect: INTEGER is 338
            -- Declared in Windows as CB_GETDROPPEDCONTROLRECT

    Cb_getdroppedstate: INTEGER is 343
            -- Declared in Windows as CB_GETDROPPEDSTATE

    Cb_geteditsel: INTEGER is 320
            -- Declared in Windows as CB_GETEDITSEL

    Cb_getextendedui: INTEGER is 342
            -- Declared in Windows as CB_GETEXTENDEDUI

    Cb_getitemdata: INTEGER is 336
            -- Declared in Windows as CB_GETITEMDATA

    Cb_getitemheight: INTEGER is 340
            -- Declared in Windows as CB_GETITEMHEIGHT

    Cb_getlbtext: INTEGER is 328
            -- Declared in Windows as CB_GETLBTEXT

    Cb_getlbtextlen: INTEGER is 329
            -- Declared in Windows as CB_GETLBTEXTLEN

    Cb_gettopindex: INTEGER is 347
            -- An application sends the CB_GETTOPINDEX message to
            -- retrieve the zero-based index of the first visible
            -- item in the list box portion of a combo box.
            --
            -- Initially, the item with index 0 is at the top of
            -- the list box, but if the list box contents have
            -- been scrolled, another item may be at the top.

    Cb_insertstring: INTEGER is 330
            -- Declared in Windows as CB_INSERTSTRING

    Cb_limittext: INTEGER is 321
            -- Declared in Windows as CB_LIMITTEXT

    Cb_okay: INTEGER is 0
            -- Declared in Windows as CB_OKAY

    Cb_resetcontent: INTEGER is 331
            -- Declared in Windows as CB_RESETCONTENT

    Cb_selectstring: INTEGER is 333
            -- Declared in Windows as CB_SELECTSTRING

    Cb_setcursel: INTEGER is 334
            -- Declared in Windows as CB_SETCURSEL

    Cb_seteditsel: INTEGER is 322
            -- Declared in Windows as CB_SETEDITSEL

    Cb_setextendedui: INTEGER is 341
            -- Declared in Windows as CB_SETEXTENDEDUI

    Cb_setitemdata: INTEGER is 337
            -- Declared in Windows as CB_SETITEMDATA

    Cb_setitemheight: INTEGER is 339
            -- Declared in Windows as CB_SETITEMHEIGHT

    Cb_settopindex: INTEGER is 348
            -- An application sends the CB_SETTOPINDEX message to
            -- ensure that a particular item is visible in the
            -- list box of a combo box. The system scrolls the
            -- list box contents so that either the specified
            -- item appears at the top of the list box or the
            -- maximum scroll range has been reached.

    Cb_showdropdown: INTEGER is 335
            -- Declared in Windows as CB_SHOWDROPDOWN

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CB_CONSTANTS


WEL_CCS_CONSTANTS Chart

class
    WEL_CCS_CONSTANTS

General
    cluster: wel.consts
    description: "Common Control Style (CCS) constants"

Ancestors
    ANY

Queries
    Ccs_adjustable: INTEGER
    Ccs_bottom: INTEGER
    Ccs_nodivider: INTEGER
    Ccs_nomovey: INTEGER
    Ccs_noparentalign: INTEGER
    Ccs_noresize: INTEGER
    Ccs_top: INTEGER


WEL_CCS_CONSTANTS Flat contracts

indexing
    description: "Common Control Style (CCS) constants"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CCS_CONSTANTS

feature -- Access

    Ccs_adjustable: INTEGER is 32
            -- Enables a toolbar's built-in customization features,
            -- which allow the user to drag a button to a new
            -- position or to remove a button by dragging it off
            -- the toolbar. In addition, the user can double-click
            -- the toolbar to display the Customize Toolbar dialog
            -- box, allowing the user to add, delete, and
            -- rearrange toolbar buttons.

    Ccs_bottom: INTEGER is 3
            -- Causes the control to position itself at the bottom
            -- of the parent window's client area and sets the
            -- width to be the same as the parent window's width.
            -- Status windows have this style by default.

    Ccs_nodivider: INTEGER is 64
            -- Prevents a two-pixel highlight from being drawn at
            -- the top of the control.

    Ccs_nomovey: INTEGER is 2
            -- Causes the control to resize and move itself
            -- horizontally, but not vertically, in response to a
            -- Wm_size message. If Ccs_noresize is used, this
            -- style does not apply. Header windows have this style
            -- by default.

    Ccs_noparentalign: INTEGER is 8
            -- Prevents the control from automatically moving to
            -- the top or bottom of the parent window. Instead, the
            -- control keeps its position within the parent window
            -- despite changes to the size of the parent. If
            -- Ccs_top or Ccs_bottom is also used, the height is
            -- adjusted to the default, but the position and width
            -- remain unchanged.

    Ccs_noresize: INTEGER is 4
            -- Prevents the control from using the default width
            -- and height when setting its initial size or a new
            -- size. Instead, the control uses the width and
            -- height specified in the request for creation or
            -- sizing.

    Ccs_top: INTEGER is 1
            -- Causes the control to position itself at the top of
            -- the parent window's client area and sets the width
            -- to be the same as the parent window's width.
            -- Toolbars have this style by default.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CCS_CONSTANTS


WEL_CFE_CONSTANTS Chart

class
    WEL_CFE_CONSTANTS

General
    cluster: wel.consts
    description: "Char format effect (CFE) constants for the rich edit control."

Ancestors
    ANY

Queries
    Cfe_autocolor: INTEGER
    Cfe_bold: INTEGER
    Cfe_italic: INTEGER
    Cfe_protected: INTEGER
    Cfe_strikeout: INTEGER
    Cfe_underline: INTEGER


WEL_CFE_CONSTANTS Flat contracts

indexing
    description: "Char format effect (CFE) constants for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CFE_CONSTANTS

feature -- Access

    Cfe_autocolor: INTEGER is 1073741824
            -- The text color is the return value of
            -- GetSysColor (COLOR_WINDOWTEXT).

    Cfe_bold: INTEGER is 1
            -- Characters are bold.

    Cfe_italic: INTEGER is 2
            -- Characters are italic.

    Cfe_protected: INTEGER is 16
            -- Characters are protected; an attempt to modify them
            -- will cause an EN_PROTECTED notification message.

    Cfe_strikeout: INTEGER is 8
            -- Characters are struck out.

    Cfe_underline: INTEGER is 4
            -- Characters are underlined.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CFE_CONSTANTS


WEL_CFM_CONSTANTS Chart

class
    WEL_CFM_CONSTANTS

General
    cluster: wel.consts
    description: "Char format mask (CFM) constants for the rich edit control."

Ancestors
    ANY

Queries
    Cfm_bold: INTEGER
    Cfm_charset: INTEGER
    Cfm_color: INTEGER
    Cfm_face: INTEGER
    Cfm_italic: INTEGER
    Cfm_offset: INTEGER
    Cfm_protected: INTEGER
    Cfm_size: INTEGER
    Cfm_strikeout: INTEGER
    Cfm_underline: INTEGER


WEL_CFM_CONSTANTS Flat contracts

indexing
    description: "Char format mask (CFM) constants for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CFM_CONSTANTS

feature -- Access

    Cfm_bold: INTEGER is 1
            -- The CFE_BOLD value of the dwEffects member is valid.

    Cfm_charset: INTEGER is 134217728
            -- The bCharSet member is valid.

    Cfm_color: INTEGER is 1073741824
            -- The crTextColor member and the CFE_AUTOCOLOR value
            -- of the dwEffects member are valid.

    Cfm_face: INTEGER is 536870912
            -- The szFaceName member is valid.

    Cfm_italic: INTEGER is 2
            -- The CFE_ITALIC value of the dwEffects member is
            -- valid.

    Cfm_offset: INTEGER is 268435456
            -- The yOffset member is valid.

    Cfm_protected: INTEGER is 16
            -- The CFE_PROTECTED value of the dwEffects member is
            -- valid.

    Cfm_size: INTEGER is -2147483648
            -- The yHeight member is valid.

    Cfm_strikeout: INTEGER is 8
            -- The CFE_STRIKEOUT value of the dwEffects member is
            -- valid.

    Cfm_underline: INTEGER is 4
            -- The CFE_UNDERLINE value of the dwEffects member is
            -- valid.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CFM_CONSTANTS


WEL_CF_CONSTANTS Chart

class
    WEL_CF_CONSTANTS

General
    cluster: wel.consts
    description: "Choose font (CF) constants."

Ancestors
    ANY

Queries
    Cf_ansionly: INTEGER
    Cf_apply: INTEGER
    Cf_both: INTEGER
    Cf_effects: INTEGER
    Cf_enablehook: INTEGER
    Cf_enabletemplate: INTEGER
    Cf_enabletemplatehandle: INTEGER
    Cf_fixedpitchonly: INTEGER
    Cf_forcefontexist: INTEGER
    Cf_inittologfontstruct: INTEGER
    Cf_limitsize: INTEGER
    Cf_nofacesel: INTEGER
    Cf_nooemfonts: INTEGER
    Cf_noscriptsel: INTEGER
    Cf_nosimulations: INTEGER
    Cf_nosizesel: INTEGER
    Cf_nostylesel: INTEGER
    Cf_novectorfonts: INTEGER
    Cf_printerfonts: INTEGER
    Cf_scalableonly: INTEGER
    Cf_screenfonts: INTEGER
    Cf_showhelp: INTEGER
    Cf_ttonly: INTEGER
    Cf_usestyle: INTEGER
    Cf_wysiwyg: INTEGER


WEL_CF_CONSTANTS Flat contracts

indexing
    description: "Choose font (CF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CF_CONSTANTS

feature -- Access

    Cf_ansionly: INTEGER is 1024

    Cf_apply: INTEGER is 512

    Cf_both: INTEGER is 3
            -- Cf_screenfonts | Cf_printerfonts.

    Cf_effects: INTEGER is 256

    Cf_enablehook: INTEGER is 8

    Cf_enabletemplate: INTEGER is 16

    Cf_enabletemplatehandle: INTEGER is 32

    Cf_fixedpitchonly: INTEGER is 16384

    Cf_forcefontexist: INTEGER is 65536

    Cf_inittologfontstruct: INTEGER is 64

    Cf_limitsize: INTEGER is 8192

    Cf_nofacesel: INTEGER is 524288

    Cf_nooemfonts: INTEGER is 2048
            -- Same as Cf_novectorfonts.

    Cf_noscriptsel: INTEGER is 8388608

    Cf_nosimulations: INTEGER is 4096

    Cf_nosizesel: INTEGER is 2097152

    Cf_nostylesel: INTEGER is 1048576

    Cf_novectorfonts: INTEGER is 2048

    Cf_printerfonts: INTEGER is 2

    Cf_scalableonly: INTEGER is 131072

    Cf_screenfonts: INTEGER is 1

    Cf_showhelp: INTEGER is 4

    Cf_ttonly: INTEGER is 262144

    Cf_usestyle: INTEGER is 128

    Cf_wysiwyg: INTEGER is 32768
            -- To be used with Cf_both.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CF_CONSTANTS


WEL_CHARACTER_SET_CONSTANTS Chart

class
    WEL_CHARACTER_SET_CONSTANTS

General
    cluster: wel.consts
    description: "Character set constants."

Ancestors
    ANY

Queries
    Ansi_charset: INTEGER
    Chinesebig5_charset: INTEGER
    Default_charset: INTEGER
    Hangeul_charset: INTEGER
    Oem_charset: INTEGER
    Shiftjis_charset: INTEGER
    Symbol_charset: INTEGER
    Unicode_charset: INTEGER


WEL_CHARACTER_SET_CONSTANTS Flat contracts

indexing
    description: "Character set constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHARACTER_SET_CONSTANTS

feature -- Access

    Ansi_charset: INTEGER is 0

    Chinesebig5_charset: INTEGER is 136

    Default_charset: INTEGER is 1

    Hangeul_charset: INTEGER is 129

    Oem_charset: INTEGER is 255
            -- (is operating-system dependent)

    Shiftjis_charset: INTEGER is 128

    Symbol_charset: INTEGER is 2

    Unicode_charset: INTEGER is 1

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHARACTER_SET_CONSTANTS


WEL_CHOOSE_COLOR_CONSTANTS Chart

class
    WEL_CHOOSE_COLOR_CONSTANTS

General
    cluster: wel.consts
    description: "Choose color (CC) dialog constants."

Ancestors
    ANY

Queries
    cc_anycolor: INTEGER
    cc_enablehook: INTEGER
    cc_enabletemplate: INTEGER
    cc_enabletemplatehandle: INTEGER
    cc_fullopen: INTEGER
    cc_preventfullopen: INTEGER
    cc_rgbinit: INTEGER
    cc_showhelp: INTEGER
    cc_solidcolor: INTEGER


WEL_CHOOSE_COLOR_CONSTANTS Flat contracts

indexing
    description: "Choose color (CC) dialog constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHOOSE_COLOR_CONSTANTS

feature -- Access

    cc_anycolor: INTEGER

    cc_enablehook: INTEGER

    cc_enabletemplate: INTEGER

    cc_enabletemplatehandle: INTEGER

    cc_fullopen: INTEGER

    cc_preventfullopen: INTEGER

    cc_rgbinit: INTEGER

    cc_showhelp: INTEGER

    cc_solidcolor: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHOOSE_COLOR_CONSTANTS


WEL_CLIPBOARD_CONSTANTS Chart

class
    WEL_CLIPBOARD_CONSTANTS

General
    cluster: wel.consts
    description: "Choose font (CF) constants."

Ancestors
    ANY

Queries
    Cf_bitmap: INTEGER
    Cf_dib: INTEGER
    Cf_dif: INTEGER
    Cf_enhmetafile: INTEGER
    Cf_metafile_picture: INTEGER
    Cf_oemtext: INTEGER
    Cf_palette: INTEGER
    Cf_pendata: INTEGER
    Cf_riff: INTEGER
    Cf_sylk: INTEGER
    Cf_text: INTEGER
    Cf_tiff: INTEGER
    Cf_unicodetext: INTEGER
    Cf_wave: INTEGER


WEL_CLIPBOARD_CONSTANTS Flat contracts

indexing
    description: "Choose font (CF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CLIPBOARD_CONSTANTS

feature -- Access

    Cf_bitmap: INTEGER is 2

    Cf_dib: INTEGER is 8

    Cf_dif: INTEGER is 5

    Cf_enhmetafile: INTEGER is 14

    Cf_metafile_picture: INTEGER is 3

    Cf_oemtext: INTEGER is 7

    Cf_palette: INTEGER is 9

    Cf_pendata: INTEGER is 10

    Cf_riff: INTEGER is 11

    Cf_sylk: INTEGER is 4

    Cf_text: INTEGER is 1

    Cf_tiff: INTEGER is 6

    Cf_unicodetext: INTEGER is 13

    Cf_wave: INTEGER is 12

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CLIPBOARD_CONSTANTS


WEL_CLIPPING_CAPABILITIES_CONSTANTS Chart

class
    WEL_CLIPPING_CAPABILITIES_CONSTANTS

General
    cluster: wel.consts
    description: "Clipping capabilities (CP) constants."

Ancestors
    ANY

Queries
    cp_none: INTEGER
    cp_rectangle: INTEGER
    cp_region: INTEGER


WEL_CLIPPING_CAPABILITIES_CONSTANTS Flat contracts

indexing
    description: "Clipping capabilities (CP) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CLIPPING_CAPABILITIES_CONSTANTS

feature -- Access

    cp_none: INTEGER
            -- Output is not clipped

    cp_rectangle: INTEGER
            -- Output is clipped to rectangles

    cp_region: INTEGER
            -- Output is clipped to regions

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CLIPPING_CAPABILITIES_CONSTANTS


WEL_CLIP_PRECISION_CONSTANTS Chart

class
    WEL_CLIP_PRECISION_CONSTANTS

General
    cluster: wel.consts
    description: "Clipping precision (CLIP) constants."

Ancestors
    ANY

Queries
    Clip_character_precis: INTEGER
    Clip_default_precis: INTEGER
    Clip_embedded: INTEGER
    Clip_lh_angles: INTEGER
    Clip_mask: INTEGER
    Clip_stroke_precis: INTEGER
    Clip_tt_always: INTEGER


WEL_CLIP_PRECISION_CONSTANTS Flat contracts

indexing
    description: "Clipping precision (CLIP) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CLIP_PRECISION_CONSTANTS

feature -- Access

    Clip_character_precis: INTEGER is 1

    Clip_default_precis: INTEGER is 0

    Clip_embedded: INTEGER is 128
            -- Declared in Windows as CLIP_EMBEDDED

    Clip_lh_angles: INTEGER is 16
            -- Declared in Windows as CLIP_LH_ANGLES

    Clip_mask: INTEGER is 15

    Clip_stroke_precis: INTEGER is 2

    Clip_tt_always: INTEGER is 32
            -- Declared in Windows as CLIP_TT_ALWAYS

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CLIP_PRECISION_CONSTANTS


WEL_COLOR_CONSTANTS Chart

class
    WEL_COLOR_CONSTANTS

General
    cluster: wel.consts
    description: "Color (COLOR) constants."

Ancestors
    ANY

Queries
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN


WEL_COLOR_CONSTANTS Flat contracts

indexing
    description: "Color (COLOR) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COLOR_CONSTANTS

feature -- Access

    Color_activeborder: INTEGER is 10

    Color_activecaption: INTEGER is 2

    Color_appworkspace: INTEGER is 12

    Color_background: INTEGER is 1

    Color_btnface: INTEGER is 15

    Color_btnhighlight: INTEGER is 20

    Color_btnshadow: INTEGER is 16

    Color_btntext: INTEGER is 18

    Color_captiontext: INTEGER is 9

    Color_graytext: INTEGER is 17

    Color_highlight: INTEGER is 13

    Color_highlighttext: INTEGER is 14

    Color_inactiveborder: INTEGER is 11

    Color_inactivecaption: INTEGER is 3

    Color_inactivecaptiontext: INTEGER is 19

    Color_menu: INTEGER is 4

    Color_menutext: INTEGER is 7

    Color_scrollbar: INTEGER is 0

    Color_window: INTEGER is 5

    Color_windowframe: INTEGER is 6

    Color_windowtext: INTEGER is 8

feature -- Status report

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COLOR_CONSTANTS


WEL_CS_CONSTANTS Chart

class
    WEL_CS_CONSTANTS

General
    cluster: wel.consts
    description: "Class Style (CS) constants."

Ancestors
    ANY

Queries
    Cs_bytealignclient: INTEGER
    Cs_bytealignwindow: INTEGER
    Cs_classdc: INTEGER
    Cs_dblclks: INTEGER
    Cs_globalclass: INTEGER
    Cs_hredraw: INTEGER
    Cs_keycvtwindow: INTEGER
    Cs_noclose: INTEGER
    Cs_nokeycvt: INTEGER
    Cs_owndc: INTEGER
    Cs_parentdc: INTEGER
    Cs_savebits: INTEGER
    Cs_vredraw: INTEGER


WEL_CS_CONSTANTS Flat contracts

indexing
    description: "Class Style (CS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CS_CONSTANTS

feature -- Access

    Cs_bytealignclient: INTEGER is 4096

    Cs_bytealignwindow: INTEGER is 8192

    Cs_classdc: INTEGER is 64

    Cs_dblclks: INTEGER is 8

    Cs_globalclass: INTEGER is 16384

    Cs_hredraw: INTEGER is 2

    Cs_keycvtwindow: INTEGER is 4
            -- Not defined any more for some
            -- C compilers, returns old defined value

    Cs_noclose: INTEGER is 512

    Cs_nokeycvt: INTEGER is 256
            -- Not defined any more for some
            -- C compilers, returns old defined value

    Cs_owndc: INTEGER is 32

    Cs_parentdc: INTEGER is 128

    Cs_savebits: INTEGER is 2048

    Cs_vredraw: INTEGER is 1

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CS_CONSTANTS


WEL_CURVES_CAPABILITIES_CONSTANTS Chart

class
    WEL_CURVES_CAPABILITIES_CONSTANTS

General
    cluster: wel.consts
    description: "Curves capabilities (CC) constants."

Ancestors
    ANY

Queries
    cc_chord: INTEGER
    cc_circles: INTEGER
    cc_ellipses: INTEGER
    cc_interiors: INTEGER
    cc_none: INTEGER
    cc_pie: INTEGER
    cc_round_rect: INTEGER
    cc_styled: INTEGER
    cc_wide: INTEGER
    cc_wide_styled: INTEGER


WEL_CURVES_CAPABILITIES_CONSTANTS Flat contracts

indexing
    description: "Curves capabilities (CC) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CURVES_CAPABILITIES_CONSTANTS

feature -- Access

    cc_chord: INTEGER
            -- Supports chords

    cc_circles: INTEGER
            -- Supports circles

    cc_ellipses: INTEGER
            -- Supports ellipses

    cc_interiors: INTEGER
            -- Supports interiors

    cc_none: INTEGER
            -- Supports curves

    cc_pie: INTEGER
            -- Supports pie wedges

    cc_round_rect: INTEGER
            -- Supports rectangles with rounded corners

    cc_styled: INTEGER
            -- Supports styled borders

    cc_wide: INTEGER
            -- Supports wide borders

    cc_wide_styled: INTEGER
            -- Supports wide, styled borders

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CURVES_CAPABILITIES_CONSTANTS


WEL_DDL_CONSTANTS Chart

class
    WEL_DDL_CONSTANTS

General
    cluster: wel.consts
    description: "Dialog Dir List (DDL) constants."

Ancestors
    ANY

Queries
    Ddl_archive: INTEGER
    Ddl_directory: INTEGER
    Ddl_drives: INTEGER
    Ddl_exclusive: INTEGER
    Ddl_hidden: INTEGER
    Ddl_postmsgs: INTEGER
    Ddl_readonly: INTEGER
    Ddl_readwrite: INTEGER
    Ddl_system: INTEGER


WEL_DDL_CONSTANTS Flat contracts

indexing
    description: "Dialog Dir List (DDL) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DDL_CONSTANTS

feature -- Access

    Ddl_archive: INTEGER is 32

    Ddl_directory: INTEGER is 16

    Ddl_drives: INTEGER is 16384

    Ddl_exclusive: INTEGER is 32768

    Ddl_hidden: INTEGER is 2

    Ddl_postmsgs: INTEGER is 8192

    Ddl_readonly: INTEGER is 1

    Ddl_readwrite: INTEGER is 0

    Ddl_system: INTEGER is 4

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DDL_CONSTANTS


WEL_DEVICE_TECHNOLOGY_CONSTANTS Chart

class
    WEL_DEVICE_TECHNOLOGY_CONSTANTS

General
    cluster: wel.consts
    description: "Device technology (DT) constants."

Ancestors
    ANY

Queries
    dt_charstream: INTEGER
    dt_dispfile: INTEGER
    dt_metafile: INTEGER
    dt_plotter: INTEGER
    dt_rascamera: INTEGER
    dt_rasdisplay: INTEGER
    dt_rasprinter: INTEGER


WEL_DEVICE_TECHNOLOGY_CONSTANTS Flat contracts

indexing
    description: "Device technology (DT) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DEVICE_TECHNOLOGY_CONSTANTS

feature -- Access

    dt_charstream: INTEGER
            -- Character stream

    dt_dispfile: INTEGER
            -- Display file

    dt_metafile: INTEGER
            -- Metafile

    dt_plotter: INTEGER
            -- Vector plotter

    dt_rascamera: INTEGER
            -- Raster camera

    dt_rasdisplay: INTEGER
            -- Raster display

    dt_rasprinter: INTEGER
            -- Raster printer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DEVICE_TECHNOLOGY_CONSTANTS


WEL_DIB_COLORS_CONSTANTS Chart

class
    WEL_DIB_COLORS_CONSTANTS

General
    cluster: wel.consts
    description: "Dib colors (DIB) constants."

Ancestors
    ANY

Queries
    Dib_pal_colors: INTEGER
    Dib_rgb_colors: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN


WEL_DIB_COLORS_CONSTANTS Flat contracts

indexing
    description: "Dib colors (DIB) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DIB_COLORS_CONSTANTS

feature -- Access

    Dib_pal_colors: INTEGER is 1

    Dib_rgb_colors: INTEGER is 0

feature -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DIB_COLORS_CONSTANTS


WEL_DRAWING_ROUTINES_CONSTANTS Chart

class
    WEL_DRAWING_ROUTINES_CONSTANTS

General
    cluster: wel.consts
    description: "Some constants needed for the WEL_DRAWING_ROUTINES."

Ancestors
    ANY

Queries
    Bdr_raisedinner: INTEGER
    Bdr_raisedouter: INTEGER
    Bdr_sunkeninner: INTEGER
    Bdr_sunkenouter: INTEGER
    bf_adjust: INTEGER
    bf_flat: INTEGER
    bf_rect: INTEGER
    bf_soft: INTEGER
    dss_disabled: INTEGER
    dss_mono: INTEGER
    dss_normal: INTEGER
    dss_union: INTEGER
    dst_bitmap: INTEGER
    dst_complex: INTEGER
    dst_icon: INTEGER
    dst_prefixtext: INTEGER
    dst_text: INTEGER
    edge_bump: INTEGER
    edge_etched: INTEGER
    edge_raised: INTEGER
    edge_sunken: INTEGER


WEL_DRAWING_ROUTINES_CONSTANTS Flat contracts

indexing
    description: "Some constants needed for the WEL_DRAWING_ROUTINES."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DRAWING_ROUTINES_CONSTANTS

feature -- Constants fo draw_edge feature

    Bdr_raisedinner: INTEGER is 4
            -- Raised inner edge.

    Bdr_raisedouter: INTEGER is 1
            -- Raised outer edge.

    Bdr_sunkeninner: INTEGER is 8
            -- Sunken inner edge.

    Bdr_sunkenouter: INTEGER is 2
            -- Sunken outer edge.

    bf_adjust: INTEGER
            -- Rectangle to be adjusted to leave space for
            -- client area.

    bf_flat: INTEGER
            -- Flat border.

    bf_rect: INTEGER
            -- Entire border rectangle

    bf_soft: INTEGER
            -- Soft buttons instead of tiles.

    edge_bump: INTEGER
            -- Raised outer and sunken inner edges.

    edge_etched: INTEGER
            -- Sunken outer and raised inner edges.

    edge_raised: INTEGER
            -- Raised inner and outer edges.

    edge_sunken: INTEGER
            -- Sunken inner and outer edges.

feature -- Constants fo draw_state feature

    dss_disabled: INTEGER
            -- Embosses the image.

    dss_mono: INTEGER
            -- Draws the image using the brush specified by the
            -- hbr parameter.

    dss_normal: INTEGER
            -- Draws the image without any modification.

    dss_union: INTEGER
            -- Dithers the image.

    dst_bitmap: INTEGER
            -- The image is a bitmap. The low-order word of the lData
            -- parameter is the bitmap handle.

    dst_complex: INTEGER
            -- The image is application defined. To render the image,
            -- DrawState calls the callback function specified by the
            -- lpOutputFunc parameter.

    dst_icon: INTEGER
            -- The image is an icon. The low-order word of lData is
            -- the icon handle.

    dst_prefixtext: INTEGER
            -- The image is text that may contain an accelerator
            -- mnemonic. DrawState interprets the ampersand (&)
            -- prefix character as a directive to underscore the
            -- character that follows. The lData parameter specifies
            -- the address of the string, and the wData parameter
            -- specifies the length. If wData is zero, the string
            -- must be null-terminated.

    dst_text: INTEGER
            -- The image is text. The lData parameter specifies the
            -- address of the string, and the wData parameter
            -- specifies the length. If wData is zero, the string
            -- must be null-terminated.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DRAWING_ROUTINES_CONSTANTS


WEL_DS_CONSTANTS Chart

class
    WEL_DS_CONSTANTS

General
    cluster: wel.consts
    description: "Dialog style (DS) constants."

Ancestors
    ANY

Queries
    Ds_absalign: INTEGER
    Ds_modalframe: INTEGER
    Ds_noidlemsg: INTEGER
    Ds_setfont: INTEGER
    Ds_setforeground: INTEGER


WEL_DS_CONSTANTS Flat contracts

indexing
    description: "Dialog style (DS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DS_CONSTANTS

feature -- Constants

    Ds_absalign: INTEGER is 1
            -- Indicates that the coordinates of the dialog box are screen
            -- coordinates. If this style is not specified, the coordinates
            -- are client coordinates.

    Ds_modalframe: INTEGER is 128
            -- Creates a dialog box with a modal dialog-box frame that can be
            -- combined with a title bar and window menu by specifying the
            -- Ws_caption and Ws_sysmenu styles. (See: WEL_WS_CONSTANTS).

    Ds_noidlemsg: INTEGER is 256
            -- Wm_enteridle message will not be sent.

    Ds_setfont: INTEGER is 64
            -- User specified font for Dlg controls.

    Ds_setforeground: INTEGER is 512
            -- Causes the system to use the SetForegroundWindow function to
            -- bring the dialog box to the foreground. This style is useful
            -- for modal dialog boxes that require immediate attention from
            -- the user regardless of whether the owner window is the
            -- foreground window.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DS_CONSTANTS


WEL_DT_CONSTANTS Chart

class
    WEL_DT_CONSTANTS

General
    cluster: wel.consts
    description: "DrawText (DT) constants."

Ancestors
    ANY

Queries
    Dt_bottom: INTEGER
    Dt_calcrect: INTEGER
    Dt_center: INTEGER
    Dt_expandtabs: INTEGER
    Dt_externalleading: INTEGER
    Dt_internal: INTEGER
    Dt_left: INTEGER
    Dt_noclip: INTEGER
    Dt_noprefix: INTEGER
    Dt_right: INTEGER
    Dt_singleline: INTEGER
    Dt_tabstop: INTEGER
    Dt_top: INTEGER
    Dt_vcenter: INTEGER
    Dt_wordbreak: INTEGER


WEL_DT_CONSTANTS Flat contracts

indexing
    description: "DrawText (DT) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DT_CONSTANTS

feature -- Access

    Dt_bottom: INTEGER is 8
            -- Declared in Windows as DT_BOTTOM

    Dt_calcrect: INTEGER is 1024
            -- Declared in Windows as DT_CALCRECT

    Dt_center: INTEGER is 1
            -- Declared in Windows as DT_CENTER

    Dt_expandtabs: INTEGER is 64
            -- Declared in Windows as DT_EXPANDTABS

    Dt_externalleading: INTEGER is 512
            -- Declared in Windows as DT_EXTERNALLEADING

    Dt_internal: INTEGER is 4096
            -- Declared in Windows as DT_INTERNAL

    Dt_left: INTEGER is 0
            -- Declared in Windows as DT_LEFT

    Dt_noclip: INTEGER is 256
            -- Declared in Windows as DT_NOCLIP

    Dt_noprefix: INTEGER is 2048
            -- Declared in Windows as DT_NOPREFIX

    Dt_right: INTEGER is 2
            -- Declared in Windows as DT_RIGHT

    Dt_singleline: INTEGER is 32
            -- Declared in Windows as DT_SINGLELINE

    Dt_tabstop: INTEGER is 128
            -- Declared in Windows as DT_TABSTOP

    Dt_top: INTEGER is 0
            -- Declared in Windows as DT_TOP

    Dt_vcenter: INTEGER is 4
            -- Declared in Windows as DT_VCENTER

    Dt_wordbreak: INTEGER is 16
            -- Declared in Windows as DT_WORDBREAK

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DT_CONSTANTS


WEL_ECO_CONSTANTS Chart

class
    WEL_ECO_CONSTANTS

General
    cluster: wel.consts
    description: "Edit control options (ECO) for the rich edit control."

Ancestors
    ANY

Queries
    Eco_autohscroll: INTEGER
    Eco_autovscroll: INTEGER
    Eco_autowordselection: INTEGER
    Eco_nohidesel: INTEGER
    Eco_readonly: INTEGER
    Eco_savesel: INTEGER
    Eco_selectionbar: INTEGER
    Eco_vertical: INTEGER
    Eco_wantreturn: INTEGER
    Ecoop_and: INTEGER
    Ecoop_or: INTEGER
    Ecoop_set: INTEGER
    Ecoop_xor: INTEGER


WEL_ECO_CONSTANTS Flat contracts

indexing
    description: "Edit control options (ECO) for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ECO_CONSTANTS

feature -- Access

    Eco_autohscroll: INTEGER is 128
            -- Same as ES_AUTOHSCROLL style.

    Eco_autovscroll: INTEGER is 64
            -- Same as ES_AUTOVSCROLL style.

    Eco_autowordselection: INTEGER is 1
            -- Automatic selection of word on doubleclick.

    Eco_nohidesel: INTEGER is 256
            -- Same as ES_NOHIDESEL style.

    Eco_readonly: INTEGER is 2048
            -- Same as ES_READONLY style.

    Eco_savesel: INTEGER is 32768
            -- Same as ES_SAVESEL style.

    Eco_selectionbar: INTEGER is 16777216
            -- Same as ES_SELECTIONBAR style.

    Eco_vertical: INTEGER is 4194304
            -- Same as ES_VERTICAL style. Available in
            -- Asian-language versions only.

    Eco_wantreturn: INTEGER is 4096
            -- Same as ES_WANTRETURN style.

    Ecoop_and: INTEGER is 3
            -- Retain only those current options that are also
            -- specified by fOptions.

    Ecoop_or: INTEGER is 2
            -- Combine the specified options with the current
            -- options.

    Ecoop_set: INTEGER is 1
            -- Set the options to those specified by fOptions.

    Ecoop_xor: INTEGER is 4
            -- Retain only those current options that are not
            -- specified by fOptions.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ECO_CONSTANTS


WEL_EM_CONSTANTS Chart

class
    WEL_EM_CONSTANTS

General
    cluster: wel.consts
    description: "Edit control message (EM) constants."

Ancestors
    ANY

Queries
    Em_canundo: INTEGER
    Em_emptyundobuffer: INTEGER
    Em_fmtlines: INTEGER
    Em_getfirstvisibleline: INTEGER
    Em_gethandle: INTEGER
    Em_getlimittext: INTEGER
    Em_getline: INTEGER
    Em_getlinecount: INTEGER
    Em_getmodify: INTEGER
    Em_getpasswordchar: INTEGER
    Em_getrect: INTEGER
    Em_getsel: INTEGER
    Em_getthumb: INTEGER
    Em_getwordbreakproc: INTEGER
    Em_limittext: INTEGER
    Em_linefromchar: INTEGER
    Em_lineindex: INTEGER
    Em_linelength: INTEGER
    Em_linescroll: INTEGER
    Em_replacesel: INTEGER
    Em_scroll: INTEGER
    Em_scrollcaret: INTEGER
    Em_sethandle: INTEGER
    Em_setmodify: INTEGER
    Em_setpasswordchar: INTEGER
    Em_setreadonly: INTEGER
    Em_setrect: INTEGER
    Em_setrectnp: INTEGER
    Em_setsel: INTEGER
    Em_settabstops: INTEGER
    Em_setwordbreakproc: INTEGER
    Em_undo: INTEGER


WEL_EM_CONSTANTS Flat contracts

indexing
    description: "Edit control message (EM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_EM_CONSTANTS

feature -- Access

    Em_canundo: INTEGER is 198

    Em_emptyundobuffer: INTEGER is 205

    Em_fmtlines: INTEGER is 200

    Em_getfirstvisibleline: INTEGER is 206

    Em_gethandle: INTEGER is 189

    Em_getlimittext: INTEGER is 213

    Em_getline: INTEGER is 196

    Em_getlinecount: INTEGER is 186

    Em_getmodify: INTEGER is 184

    Em_getpasswordchar: INTEGER is 210

    Em_getrect: INTEGER is 178

    Em_getsel: INTEGER is 176

    Em_getthumb: INTEGER is 190

    Em_getwordbreakproc: INTEGER is 209

    Em_limittext: INTEGER is 197

    Em_linefromchar: INTEGER is 201

    Em_lineindex: INTEGER is 187

    Em_linelength: INTEGER is 193

    Em_linescroll: INTEGER is 182

    Em_replacesel: INTEGER is 194

    Em_scroll: INTEGER is 181

    Em_scrollcaret: INTEGER is 183

    Em_sethandle: INTEGER is 188

    Em_setmodify: INTEGER is 185

    Em_setpasswordchar: INTEGER is 204

    Em_setreadonly: INTEGER is 207

    Em_setrect: INTEGER is 179

    Em_setrectnp: INTEGER is 180

    Em_setsel: INTEGER is 177

    Em_settabstops: INTEGER is 203

    Em_setwordbreakproc: INTEGER is 208

    Em_undo: INTEGER is 199

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_EM_CONSTANTS


WEL_ENM_CONSTANTS Chart

class
    WEL_ENM_CONSTANTS

General
    cluster: wel.consts
    description: "Edit Notification mask (ENM) constants for the rich edit control."

Ancestors
    ANY

Queries
    Enm_change: INTEGER
    Enm_correcttext: INTEGER
    Enm_dropfiles: INTEGER
    Enm_imechange: INTEGER
    Enm_keyevents: INTEGER
    Enm_mouseevents: INTEGER
    Enm_none: INTEGER
    Enm_protected: INTEGER
    Enm_requestresize: INTEGER
    Enm_scroll: INTEGER
    Enm_selchange: INTEGER
    Enm_update: INTEGER


WEL_ENM_CONSTANTS Flat contracts

indexing
    description: "Edit Notification mask (ENM) constants for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ENM_CONSTANTS

feature -- Access

    Enm_change: INTEGER is 1

    Enm_correcttext: INTEGER is 4194304

    Enm_dropfiles: INTEGER is 1048576

    Enm_imechange: INTEGER is 8388608

    Enm_keyevents: INTEGER is 65536

    Enm_mouseevents: INTEGER is 131072

    Enm_none: INTEGER is 0

    Enm_protected: INTEGER is 2097152

    Enm_requestresize: INTEGER is 262144

    Enm_scroll: INTEGER is 4

    Enm_selchange: INTEGER is 524288

    Enm_update: INTEGER is 2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ENM_CONSTANTS


WEL_EN_CONSTANTS Chart

class
    WEL_EN_CONSTANTS

General
    cluster: wel.consts
    description: "Edit control notification (EN) constants."

Ancestors
    ANY

Queries
    En_change: INTEGER
    En_errspace: INTEGER
    En_hscroll: INTEGER
    En_killfocus: INTEGER
    En_maxtext: INTEGER
    En_msgfilter: INTEGER
    En_setfocus: INTEGER
    En_update: INTEGER
    En_vscroll: INTEGER


WEL_EN_CONSTANTS Flat contracts

indexing
    description: "Edit control notification (EN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_EN_CONSTANTS

feature -- Access

    En_change: INTEGER is 768

    En_errspace: INTEGER is 1280

    En_hscroll: INTEGER is 1537

    En_killfocus: INTEGER is 512

    En_maxtext: INTEGER is 1281

    En_msgfilter: INTEGER is 1792

    En_setfocus: INTEGER is 256

    En_update: INTEGER is 1024

    En_vscroll: INTEGER is 1538

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_EN_CONSTANTS


WEL_ESB_CONSTANTS Chart

class
    WEL_ESB_CONSTANTS

General
    cluster: wel.consts
    description: "Scroll bar arrows (ESB) constants.used in message SBM_ENABLE_ARROWS"

Ancestors
    ANY

Queries
    Esb_disable_both: INTEGER
    Esb_disable_down: INTEGER
    Esb_disable_left: INTEGER
    Esb_disable_ltup: INTEGER
    Esb_disable_rtdn: INTEGER
    Esb_disable_up: INTEGER
    Esb_enable_both: INTEGER


WEL_ESB_CONSTANTS Flat contracts

indexing
    description: "Scroll bar arrows (ESB) constants.used in message SBM_ENABLE_ARROWS"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ESB_CONSTANTS

feature -- Constants

    Esb_disable_both: INTEGER is 3
            -- Disables both arrows on a scroll bar.

    Esb_disable_down: INTEGER is 2
            -- Disables the down arrow on a vertical scroll bar.

    Esb_disable_left: INTEGER is 1
            -- Disables the left arrow on a horizontal scroll bar.

    Esb_disable_ltup: INTEGER is 1
            -- Disables the left arrow on a horizontal scroll bar
            -- or the up arrow on a vertical scroll bar.

    Esb_disable_rtdn: INTEGER is 2
            -- Disables the right arrow on a horizontal scroll bar
            -- or the down arrow on a vertical scroll bar.

    Esb_disable_up: INTEGER is 1
            -- Disables the up arrow on a vertical scroll bar.

    Esb_enable_both: INTEGER is 0
            -- Enables both arrows on a scroll bar.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ESB_CONSTANTS


WEL_ES_CONSTANTS Chart

class
    WEL_ES_CONSTANTS

General
    cluster: wel.consts
    description: "Edit control style (ES) constants."

Ancestors
    ANY

Queries
    Es_autohscroll: INTEGER
    Es_autovscroll: INTEGER
    Es_center: INTEGER
    Es_left: INTEGER
    Es_lowercase: INTEGER
    Es_multiline: INTEGER
    Es_nohidesel: INTEGER
    Es_oemconvert: INTEGER
    Es_password: INTEGER
    Es_readonly: INTEGER
    Es_right: INTEGER
    Es_uppercase: INTEGER
    Es_wantreturn: INTEGER


WEL_ES_CONSTANTS Flat contracts

indexing
    description: "Edit control style (ES) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ES_CONSTANTS

feature -- Access

    Es_autohscroll: INTEGER is 128

    Es_autovscroll: INTEGER is 64

    Es_center: INTEGER is 1

    Es_left: INTEGER is 0

    Es_lowercase: INTEGER is 16

    Es_multiline: INTEGER is 4

    Es_nohidesel: INTEGER is 256

    Es_oemconvert: INTEGER is 1024

    Es_password: INTEGER is 32

    Es_readonly: INTEGER is 2048

    Es_right: INTEGER is 2

    Es_uppercase: INTEGER is 8

    Es_wantreturn: INTEGER is 4096

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ES_CONSTANTS


WEL_FILL_ATTRIBUTES_CONSTANTS Chart

class
    WEL_FILL_ATTRIBUTES_CONSTANTS

General
    cluster: wel.consts
    description: "Console fill attributes."

Ancestors
    WEL_BIT_OPERATIONS

Queries
    background_blue: INTEGER
    background_green: INTEGER
    background_intensity: INTEGER
    background_red: INTEGER
    foreground_blue: INTEGER
    foreground_green: INTEGER
    foreground_intensity: INTEGER
    foreground_red: INTEGER
    is_valid_fill_attributes (an_integer: INTEGER): BOOLEAN


WEL_FILL_ATTRIBUTES_CONSTANTS Flat contracts

indexing
    description: "Console fill attributes."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FILL_ATTRIBUTES_CONSTANTS

feature -- Access

    background_blue: INTEGER
            -- Add blue to background

    background_green: INTEGER
            -- Add green to background

    background_intensity: INTEGER
            -- Increase console background intensity

    background_red: INTEGER
            -- Add red to background

    foreground_blue: INTEGER
            -- Add blue to foreground

    foreground_green: INTEGER
            -- Add green to foreground

    foreground_intensity: INTEGER
            -- Increase console foreground intensity

    foreground_red: INTEGER
            -- Add red to foreground

    is_valid_fill_attributes (an_integer: INTEGER): BOOLEAN
            -- Is an_integer a valid fill atrtibutes?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FILL_ATTRIBUTES_CONSTANTS


WEL_FIND_FLAGS_CONSTANTS Chart

class
    WEL_FIND_FLAGS_CONSTANTS

General
    cluster: wel.consts
    description: "Constants for defining type of text search"

Ancestors
    ANY

Queries
    Fr_matchcase: INTEGER
    Fr_wholeword: INTEGER


WEL_FIND_FLAGS_CONSTANTS Flat contracts

indexing
    description: "Constants for defining type of text search"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FIND_FLAGS_CONSTANTS

feature -- Access

    Fr_matchcase: INTEGER is 4
            -- Case sensitive search

    Fr_wholeword: INTEGER is 2
            -- Whole word search

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FIND_FLAGS_CONSTANTS


WEL_FLOOD_FILL_CONSTANTS Chart

class
    WEL_FLOOD_FILL_CONSTANTS

General
    cluster: wel.consts
    description: "Flood fill constants."

Ancestors
    ANY

Queries
    floodfillborder: INTEGER
    floodfillsurface: INTEGER


WEL_FLOOD_FILL_CONSTANTS Flat contracts

indexing
    description: "Flood fill constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FLOOD_FILL_CONSTANTS

feature -- Access

    floodfillborder: INTEGER

    floodfillsurface: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FLOOD_FILL_CONSTANTS


WEL_FONT_FAMILY_CONSTANTS Chart

class
    WEL_FONT_FAMILY_CONSTANTS

General
    cluster: wel.consts
    description: "Font family (FF) constants."

Ancestors
    ANY

Queries
    ff_decorative: INTEGER
    ff_dontcare: INTEGER
    ff_modern: INTEGER
    ff_roman: INTEGER
    ff_script: INTEGER
    ff_swiss: INTEGER


WEL_FONT_FAMILY_CONSTANTS Flat contracts

indexing
    description: "Font family (FF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FONT_FAMILY_CONSTANTS

feature -- Access

    ff_decorative: INTEGER
            -- Novelty fonts. Old English is an example.

    ff_dontcare: INTEGER
            -- Don't care or don't know

    ff_modern: INTEGER
            -- Fonts with constant stroke width (monospace),
            -- with or without serifs. Monospace fonts are usually
            -- modern. Pica, Elite, and CourierNew are examples.

    ff_roman: INTEGER
            -- Fonts with variable stroke width (proportional)
            -- and with serifs. MS Serif is an example.

    ff_script: INTEGER
            -- Fonts designed to look like handwriting.
            -- Script and Cursive are examples.

    ff_swiss: INTEGER
            -- Fonts with variable stroke width (proportional)
            -- and without serifs. MS Sans Serif is an example.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FONT_FAMILY_CONSTANTS


WEL_FONT_PITCH_CONSTANTS Chart

class
    WEL_FONT_PITCH_CONSTANTS

General
    cluster: wel.consts
    description: "Font pitch constants."

Ancestors
    ANY

Queries
    Default_pitch: INTEGER
    Fixed_pitch: INTEGER
    Variable_pitch: INTEGER


WEL_FONT_PITCH_CONSTANTS Flat contracts

indexing
    description: "Font pitch constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FONT_PITCH_CONSTANTS

feature -- Access

    Default_pitch: INTEGER is 0

    Fixed_pitch: INTEGER is 1

    Variable_pitch: INTEGER is 2

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FONT_PITCH_CONSTANTS


WEL_FONT_QUALITY_CONSTANTS Chart

class
    WEL_FONT_QUALITY_CONSTANTS

General
    cluster: wel.consts
    description: "Font quality constants."

Ancestors
    ANY

Queries
    Default_quality: INTEGER
    Draft_quality: INTEGER
    Proof_quality: INTEGER


WEL_FONT_QUALITY_CONSTANTS Flat contracts

indexing
    description: "Font quality constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FONT_QUALITY_CONSTANTS

feature -- Access

    Default_quality: INTEGER is 0
            -- Appearance of the font does not matter.

    Draft_quality: INTEGER is 1
            -- Appearance of the font is less important than when
            -- the Proof_quality value is used. For GDI raster
            -- fonts, scaling is enabled. Bold, italic, underline,
            -- and strikeout fonts are synthesized if necessary.

    Proof_quality: INTEGER is 2
            -- Character quality of the font is more important
            -- than exact matching of the logical-font attributes.
            -- For GDI raster fonts, scaling is disabled and the
            -- font closest in size is chosen. Bold, italic,
            -- underline, and strikeout fonts are synthesized
            -- if necessary.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FONT_QUALITY_CONSTANTS


WEL_FONT_TYPE_CONSTANTS Chart

class
    WEL_FONT_TYPE_CONSTANTS

General
    cluster: wel.consts
    description: "Font type constants for WEL_CHOOSE_FONT_DIALOG class."

Ancestors
    ANY

Queries
    bold_fonttype: INTEGER
    italic_fonttype: INTEGER
    printer_fonttype: INTEGER
    regular_fonttype: INTEGER
    screen_fonttype: INTEGER
    simulated_fonttype: INTEGER
    valid_font_type_constant (c: INTEGER): BOOLEAN


WEL_FONT_TYPE_CONSTANTS Flat contracts

indexing
    description: "Font type constants for WEL_CHOOSE_FONT_DIALOG class."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FONT_TYPE_CONSTANTS

feature -- Access

    bold_fonttype: INTEGER

    italic_fonttype: INTEGER

    printer_fonttype: INTEGER

    regular_fonttype: INTEGER

    screen_fonttype: INTEGER

    simulated_fonttype: INTEGER

feature -- Status report

    valid_font_type_constant (c: INTEGER): BOOLEAN
            -- Is c a valid font type constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FONT_TYPE_CONSTANTS


WEL_FONT_TYPE_ENUM_CONSTANTS Chart

class
    WEL_FONT_TYPE_ENUM_CONSTANTS

General
    cluster: wel.consts
    description: "Font type constants for WEL_FONT_FAMILY_ENUMERATOR class."

Ancestors
    ANY

Queries
    Device_fonttype: INTEGER
    Raster_fonttype: INTEGER
    Truetype_fonttype: INTEGER
    valid_font_type_enum_constant (c: INTEGER): BOOLEAN


WEL_FONT_TYPE_ENUM_CONSTANTS Flat contracts

indexing
    description: "Font type constants for WEL_FONT_FAMILY_ENUMERATOR class."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FONT_TYPE_ENUM_CONSTANTS

feature -- Access

    Device_fonttype: INTEGER is 2

    Raster_fonttype: INTEGER is 1

    Truetype_fonttype: INTEGER is 4

feature -- Status report

    valid_font_type_enum_constant (c: INTEGER): BOOLEAN
            -- Is c a valid font type enum constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FONT_TYPE_ENUM_CONSTANTS


WEL_FW_CONSTANTS Chart

class
    WEL_FW_CONSTANTS

General
    cluster: wel.consts
    description: "Font Weight (FW) constants."

Ancestors
    ANY

Queries
    fw_black: INTEGER
    fw_bold: INTEGER
    fw_demibold: INTEGER
    fw_dontcare: INTEGER
    fw_extrabold: INTEGER
    fw_extralight: INTEGER
    fw_heavy: INTEGER
    fw_light: INTEGER
    fw_medium: INTEGER
    fw_normal: INTEGER
    fw_regular: INTEGER
    fw_semibold: INTEGER
    fw_thin: INTEGER
    fw_ultrabold: INTEGER
    fw_ultralight: INTEGER


WEL_FW_CONSTANTS Flat contracts

indexing
    description: "Font Weight (FW) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FW_CONSTANTS

feature -- Access

    fw_black: INTEGER

    fw_bold: INTEGER

    fw_demibold: INTEGER

    fw_dontcare: INTEGER

    fw_extrabold: INTEGER

    fw_extralight: INTEGER

    fw_heavy: INTEGER

    fw_light: INTEGER

    fw_medium: INTEGER

    fw_normal: INTEGER

    fw_regular: INTEGER

    fw_semibold: INTEGER

    fw_thin: INTEGER

    fw_ultrabold: INTEGER

    fw_ultralight: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FW_CONSTANTS


WEL_GCL_CONSTANTS Chart

class
    WEL_GCL_CONSTANTS

General
    cluster: wel.consts
    description: "Constants used in function SetClassLong"
    create: default_create

Ancestors
    ANY

Queries
    Gcl_cbclsextra: INTEGER
    Gcl_cbwndextra: INTEGER
    Gcl_hbrbackground: INTEGER
    Gcl_hcursor: INTEGER
    Gcl_hicon: INTEGER
    Gcl_hiconsm: INTEGER
    Gcl_hmodule: INTEGER
    Gcl_menuname: INTEGER
    Gcl_style: INTEGER
    Gcl_wndproc: INTEGER


WEL_GCL_CONSTANTS Flat contracts

indexing
    description: "Constants used in function SetClassLong"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_GCL_CONSTANTS

create

feature -- GCL Constants

    Gcl_cbclsextra: INTEGER is -20
            -- Sets the size, in bytes, of the extra memory associated with
            -- the class. Setting this value does not change the number of
            -- extra bytes already allocated.
            --
            -- Declared in Windows as GCL_CBCLSEXTRA

    Gcl_cbwndextra: INTEGER is -18
            -- Sets the size, in bytes, of the extra window memory associated
            -- with each window in the class. Setting this value does not
            -- change the number of extra bytes already allocated. For
            -- information on how to access this memory, see SetWindowLong.
            --
            -- Declared in Windows as GCL_CBWNDEXTRA

    Gcl_hbrbackground: INTEGER is -10
            -- Replaces a handle to the background brush associated with the
            -- class.
            --
            -- Declared in Windows as GCL_HBRBACKGROUND

    Gcl_hcursor: INTEGER is -12
            -- Replaces a handle to the cursor associated with the class.
            --
            -- Declared in Windows as GCL_HCURSOR

    Gcl_hicon: INTEGER is -14
            -- Replaces a handle to the icon associated with the class.
            --
            -- Declared in Windows as GCL_HICON

    Gcl_hiconsm: INTEGER is -34
            -- Replace a handle to the small icon associated with the class.
            --
            -- Declared in Windows as GCL_HICONSM

    Gcl_hmodule: INTEGER is -16
            -- Replaces a handle to the module that registered the class.
            --
            -- Declared in Windows as GCL_HMODULE

    Gcl_menuname: INTEGER is -8
            -- Replaces the address of the menu name string. The string
            -- identifies the menu resource associated with the class.
            --
            -- Declared in Windows as GCL_MENUNAME

    Gcl_style: INTEGER is -26
            -- Replaces the window-class style bits.
            --
            -- Declared in Windows as GCL_STYLE

    Gcl_wndproc: INTEGER is -24
            -- Replaces the address of the window procedure associated with
            -- the class.
            --
            -- Declared in Windows as GCL_WNDPROC

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GCL_CONSTANTS


WEL_GWL_CONSTANTS Chart

class
    WEL_GWL_CONSTANTS

General
    cluster: wel.consts
    description: "GetWindowLong (GWL) constants."

Ancestors
    ANY

Queries
    Dwl_dlgproc: INTEGER
    Dwl_msgresult: INTEGER
    Dwl_user: INTEGER
    Gwl_exstyle: INTEGER
    Gwl_hinstance: INTEGER
    Gwl_hwndparent: INTEGER
    Gwl_id: INTEGER
    Gwl_style: INTEGER
    Gwl_userdata: INTEGER
    Gwl_wndproc: INTEGER


WEL_GWL_CONSTANTS Flat contracts

indexing
    description: "GetWindowLong (GWL) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_GWL_CONSTANTS

feature -- Access

    Dwl_dlgproc: INTEGER is 4

    Dwl_msgresult: INTEGER is 0

    Dwl_user: INTEGER is 8

    Gwl_exstyle: INTEGER is -20

    Gwl_hinstance: INTEGER is -6

    Gwl_hwndparent: INTEGER is -8

    Gwl_id: INTEGER is -12

    Gwl_style: INTEGER is -16

    Gwl_userdata: INTEGER is -21

    Gwl_wndproc: INTEGER is -4

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GWL_CONSTANTS


WEL_GW_CONSTANTS Chart

class
    WEL_GW_CONSTANTS

General
    cluster: wel.consts
    description: "GetWindow (GW) constants."

Ancestors
    ANY

Queries
    gw_child: INTEGER
    gw_hwndfirst: INTEGER
    gw_hwndlast: INTEGER
    gw_hwndnext: INTEGER
    gw_hwndprev: INTEGER
    gw_owner: INTEGER


WEL_GW_CONSTANTS Flat contracts

indexing
    description: "GetWindow (GW) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_GW_CONSTANTS

feature -- Access

    gw_child: INTEGER

    gw_hwndfirst: INTEGER

    gw_hwndlast: INTEGER

    gw_hwndnext: INTEGER

    gw_hwndprev: INTEGER

    gw_owner: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GW_CONSTANTS


WEL_HDF_CONSTANTS Chart

class
    WEL_HDF_CONSTANTS

General
    cluster: wel.consts
    description: "Format flags for feature format of class WEL_HD_ITEM."

Ancestors
    ANY

Queries
    hdf_bitmap: INTEGER
    hdf_center: INTEGER
    hdf_justify_mask: INTEGER
    hdf_left: INTEGER
    hdf_owner_draw: INTEGER
    hdf_right: INTEGER
    hdf_rtl_reading: INTEGER
    hdf_string: INTEGER


WEL_HDF_CONSTANTS Flat contracts

indexing
    description: "Format flags for feature format of class WEL_HD_ITEM."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HDF_CONSTANTS

feature -- Access

    hdf_bitmap: INTEGER
            -- The item displays a bitmap.

    hdf_center: INTEGER
            -- Centers the contents of the item.

    hdf_justify_mask: INTEGER
            -- You can use this mask to isolate the text justification
            -- portion of the fmt member.

    hdf_left: INTEGER
            -- Left aligns the contents of the item.

    hdf_owner_draw: INTEGER
            -- The owner window of the header control draws the item.

    hdf_right: INTEGER
            -- Right aligns the contents of the item.

    hdf_rtl_reading: INTEGER
            -- In addition, on Hebrew or Arabic systems you can specify this flag
            -- to display text using right-to-left reading order.

    hdf_string: INTEGER
            -- The item displays a string.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HDF_CONSTANTS


WEL_HDI_CONSTANTS Chart

class
    WEL_HDI_CONSTANTS

General
    cluster: wel.consts
    description: "Mask flags that indicate which of the structure members of WEL_HD_ITEM contain valid data."

Ancestors
    ANY

Queries
    hdi_bitmap: INTEGER
    hdi_format: INTEGER
    hdi_height: INTEGER
    hdi_lparam: INTEGER
    hdi_text: INTEGER
    hdi_width: INTEGER


WEL_HDI_CONSTANTS Flat contracts

indexing
    description: "Mask flags that indicate which of the structure members of WEL_HD_ITEM contain valid data."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HDI_CONSTANTS

feature -- Access

    hdi_bitmap: INTEGER

    hdi_format: INTEGER

    hdi_height: INTEGER

    hdi_lparam: INTEGER

    hdi_text: INTEGER

    hdi_width: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HDI_CONSTANTS


WEL_HDM_CONSTANTS Chart

class
    WEL_HDM_CONSTANTS

General
    cluster: wel.consts
    description: "Messages associated with WEL_HEADER_CONTROL."

Ancestors
    ANY

Queries
    hdm_delete_item: INTEGER
    hdm_get_item: INTEGER
    hdm_get_item_count: INTEGER
    hdm_hit_test: INTEGER
    hdm_insert_item: INTEGER
    hdm_layout: INTEGER
    hdm_set_item: INTEGER


WEL_HDM_CONSTANTS Flat contracts

indexing
    description: "Messages associated with WEL_HEADER_CONTROL."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HDM_CONSTANTS

feature -- Access

    hdm_delete_item: INTEGER
            -- Deletes an item from a header control

    hdm_get_item: INTEGER
            -- Retrieves information about an item in a header control

    hdm_get_item_count: INTEGER
            -- Retrieves number of items in a header control

    hdm_hit_test: INTEGER
            -- Tests a point to determine which header item, if any, is at the specified point.

    hdm_insert_item: INTEGER
            -- Inserts a new item into a header control.

    hdm_layout: INTEGER
            -- Retrieves the size and position of a header control within a given rectangle.
            -- This message is used to determine the appropriate dimensions for a new header
            -- control that is to occupy the given rectangle.

    hdm_set_item: INTEGER
            -- Sets the attributes of the specified item in a header control

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HDM_CONSTANTS


WEL_HDN_CONSTANTS Chart

class
    WEL_HDN_CONSTANTS

General
    cluster: wel.consts
    description: "Possible notification messages of class WEL_HEADER_CONTROL"

Ancestors
    ANY

Queries
    hdn_begin_track: INTEGER
    hdn_divider_dbl_click: INTEGER
    hdn_end_track: INTEGER
    hdn_item_changed: INTEGER
    hdn_item_changing: INTEGER
    hdn_item_click: INTEGER
    hdn_item_dbl_click: INTEGER
    hdn_track: INTEGER


WEL_HDN_CONSTANTS Flat contracts

indexing
    description: "Possible notification messages of class WEL_HEADER_CONTROL"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HDN_CONSTANTS

feature -- Access

    hdn_begin_track: INTEGER

    hdn_divider_dbl_click: INTEGER

    hdn_end_track: INTEGER

    hdn_item_changed: INTEGER

    hdn_item_changing: INTEGER

    hdn_item_click: INTEGER

    hdn_item_dbl_click: INTEGER

    hdn_track: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HDN_CONSTANTS


WEL_HDS_CONSTANTS Chart

class
    WEL_HDS_CONSTANTS

General
    cluster: wel.consts
    description: "WEL_HEADER_CONTROL styles."

Ancestors
    ANY

Queries
    hds_buttons: INTEGER
    hds_hidden: INTEGER
    hds_horz: INTEGER


WEL_HDS_CONSTANTS Flat contracts

indexing
    description: "WEL_HEADER_CONTROL styles."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HDS_CONSTANTS

feature -- Access

    hds_buttons: INTEGER
            -- Header items behave like buttons.

    hds_hidden: INTEGER
            -- Indicates a header control that is intended to be hidden.
            -- This style does not hide the control; instead, it causes the
            -- header control to return zero in the cy member of the WINDOWPOS
            -- structure returned by an HDM_LAYOUT message. You would then hide
            -- the control by setting its height to zero.

    hds_horz: INTEGER
            -- The header control is horizontal.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HDS_CONSTANTS


WEL_HELP_CONSTANTS Chart

class
    WEL_HELP_CONSTANTS

General
    cluster: wel.consts
    description: "Help constants.  See MSDN for more details discussion."

Ancestors
    ANY

Queries
    Help_command: INTEGER
    Help_contents: INTEGER
    Help_context: INTEGER
    Help_contextmenu: INTEGER
    Help_contextpopup: INTEGER
    Help_finder: INTEGER
    Help_forcefile: INTEGER
    Help_helponhelp: INTEGER
    Help_index: INTEGER
    Help_key: INTEGER
    Help_multikey: INTEGER
    Help_partialkey: INTEGER
    Help_quit: INTEGER
    Help_setcontents: INTEGER
    Help_setindex: INTEGER
    Help_setpopup_pos: INTEGER
    Help_setwinpos: INTEGER
    Help_tcard: INTEGER
    Help_wm_help: INTEGER


WEL_HELP_CONSTANTS Flat contracts

indexing
    description: "Help constants.  See MSDN for more details discussion."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HELP_CONSTANTS

feature -- Access

    Help_command: INTEGER is 258

    Help_contents: INTEGER is 3

    Help_context: INTEGER is 1
            -- Display topic identified by specified context identifier
            -- defined in [MAP] section of .hpj file

    Help_contextmenu: INTEGER is 10

    Help_contextpopup: INTEGER is 8

    Help_finder: INTEGER is 11

    Help_forcefile: INTEGER is 9

    Help_helponhelp: INTEGER is 4

    Help_index: INTEGER is 3

    Help_key: INTEGER is 257

    Help_multikey: INTEGER is 513

    Help_partialkey: INTEGER is 261

    Help_quit: INTEGER is 2

    Help_setcontents: INTEGER is 5

    Help_setindex: INTEGER is 5

    Help_setpopup_pos: INTEGER is 13

    Help_setwinpos: INTEGER is 515

    Help_tcard: INTEGER is 32768

    Help_wm_help: INTEGER is 12

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HELP_CONSTANTS


WEL_HHT_CONSTANTS Chart

class
    WEL_HHT_CONSTANTS

General
    cluster: wel.consts
    description: "Possible flags of the results of a hit test on aheader control"

Ancestors
    ANY

Queries
    hht_nowhere: INTEGER
    hht_on_div_open: INTEGER
    hht_on_divider: INTEGER
    hht_on_header: INTEGER
    hht_to_left: INTEGER
    hht_to_right: INTEGER


WEL_HHT_CONSTANTS Flat contracts

indexing
    description: "Possible flags of the results of a hit test on aheader control"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HHT_CONSTANTS

feature -- Access

    hht_nowhere: INTEGER
            -- The point is inside the bounding rectangle of the header control but
            -- is not over a header item.

    hht_on_div_open: INTEGER
            -- The point is on the divider of an item that has a width of zero.
            -- Dragging the divider reveals the item instead of resizing the item
            -- to the left of the divider.

    hht_on_divider: INTEGER
            -- The point is on the divider between two header items.

    hht_on_header: INTEGER
            -- The point is inside the bounding rectangle of the header control.

    hht_to_left: INTEGER
            -- The point is to the left of the bounding rectangle of the header control.

    hht_to_right: INTEGER
            -- The point is to the right of the bounding rectangle of the header control.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HHT_CONSTANTS


WEL_HKEY Chart

class
    WEL_HKEY

General
    cluster: wel.consts
    description: "Registry keys constants"

Ancestors
    ANY

Queries
    basic_valid_name_for_hkey (name: STRING): BOOLEAN
    basic_valid_value_for_hkey (value: POINTER): BOOLEAN
    hkey_classes_root: POINTER
    hkey_current_config: POINTER
    hkey_current_user: POINTER
    hkey_dyn_data: POINTER
    hkey_local_machine: POINTER
    hkey_performance_data: POINTER
    hkey_users: POINTER
    index_value_for_root_keys (name: STRING): POINTER


WEL_HKEY Flat contracts

indexing
    description: "Registry keys constants"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"
    note: "Changed the type of Keys from INTEGER to POINTER"

class interface
    WEL_HKEY

feature -- Access

    hkey_classes_root: POINTER

    hkey_current_config: POINTER

    hkey_current_user: POINTER

    hkey_dyn_data: POINTER

    hkey_local_machine: POINTER

    hkey_performance_data: POINTER

    hkey_users: POINTER

feature -- Status

    basic_valid_name_for_hkey (name: STRING): BOOLEAN
            -- Return TRUE if 'name' correspond to one of the
            -- value names below.
        require
            name_possible: name /= void

    basic_valid_value_for_hkey (value: POINTER): BOOLEAN
            -- Return TRUE if 'value' is one of the basic following values.

    index_value_for_root_keys (name: STRING): POINTER
            -- Return the index corresponding to a root key.
        require
            name_possible: name /= void and then basic_valid_name_for_hkey (name)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HKEY


WEL_HS_CONSTANTS Chart

class
    WEL_HS_CONSTANTS

General
    cluster: wel.consts
    description: "Hatch style (HS) constants."

Ancestors
    ANY

Queries
    hs_bdiagonal: INTEGER
    hs_cross: INTEGER
    hs_diagcross: INTEGER
    hs_fdiagonal: INTEGER
    hs_horizontal: INTEGER
    hs_vertical: INTEGER


WEL_HS_CONSTANTS Flat contracts

indexing
    description: "Hatch style (HS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HS_CONSTANTS

feature -- Access

    hs_bdiagonal: INTEGER

    hs_cross: INTEGER

    hs_diagcross: INTEGER

    hs_fdiagonal: INTEGER

    hs_horizontal: INTEGER

    hs_vertical: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HS_CONSTANTS


WEL_HT_CONSTANTS Chart

class
    WEL_HT_CONSTANTS

General
    cluster: wel.consts
    description: "Hit test (HT) code constants."

Ancestors
    ANY

Queries
    Htborder: INTEGER
    Htbottom: INTEGER
    Htbottomleft: INTEGER
    Htbottomright: INTEGER
    Htcaption: INTEGER
    Htclient: INTEGER
    Hterror: INTEGER
    Htgrowbox: INTEGER
    Hthscroll: INTEGER
    Htleft: INTEGER
    Htmaxbutton: INTEGER
    Htmenu: INTEGER
    Htminbutton: INTEGER
    Htnowhere: INTEGER
    Htreduce: INTEGER
    Htright: INTEGER
    Htsize: INTEGER
    Htsysmenu: INTEGER
    Httop: INTEGER
    Httopleft: INTEGER
    Httopright: INTEGER
    Httransparent: INTEGER
    Htvscroll: INTEGER
    Htzoom: INTEGER


WEL_HT_CONSTANTS Flat contracts

indexing
    description: "Hit test (HT) code constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HT_CONSTANTS

feature -- Access

    Htborder: INTEGER is 18
            -- Declared in Windows as HTBORDER

    Htbottom: INTEGER is 15
            -- Declared in Windows as HTBOTTOM

    Htbottomleft: INTEGER is 16
            -- Declared in Windows as HTBOTTOMLEFT

    Htbottomright: INTEGER is 17
            -- Declared in Windows as HTBOTTOMRIGHT

    Htcaption: INTEGER is 2
            -- Declared in Windows as HTCAPTION

    Htclient: INTEGER is 1
            -- Declared in Windows as HTCLIENT

    Hterror: INTEGER is -2
            -- Declared in Windows as HTERROR

    Htgrowbox: INTEGER is 4
            -- Declared in Windows as HTGROWBOX

    Hthscroll: INTEGER is 6
            -- Declared in Windows as HTHSCROLL

    Htleft: INTEGER is 10
            -- Declared in Windows as HTLEFT

    Htmaxbutton: INTEGER is 9
            -- Declared in Windows as HTMAXBUTTON

    Htmenu: INTEGER is 5
            -- Declared in Windows as HTMENU

    Htminbutton: INTEGER is 8
            -- Declared in Windows as HTMINBUTTON

    Htnowhere: INTEGER is 0
            -- Declared in Windows as HTNOWHERE

    Htreduce: INTEGER is 8
            -- Declared in Windows as HTREDUCE

    Htright: INTEGER is 11
            -- Declared in Windows as HTRIGHT

    Htsize: INTEGER is 4
            -- Declared in Windows as HTSIZE

    Htsysmenu: INTEGER is 3
            -- Declared in Windows as HTSYSMENU

    Httop: INTEGER is 12
            -- Declared in Windows as HTTOP

    Httopleft: INTEGER is 13
            -- Declared in Windows as HTTOPLEFT

    Httopright: INTEGER is 14
            -- Declared in Windows as HTTOPRIGHT

    Httransparent: INTEGER is -1
            -- Declared in Windows as HTTRANSPARENT

    Htvscroll: INTEGER is 7
            -- Declared in Windows as HTVSCROLL

    Htzoom: INTEGER is 9
            -- Declared in Windows as HTZOOM

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HT_CONSTANTS


WEL_HWND_CONSTANTS Chart

class
    WEL_HWND_CONSTANTS

General
    cluster: wel.consts
    description: "HWND constants used in SetWindowPos."

Ancestors
    ANY

Queries
    hwnd_bottom: POINTER
    hwnd_notopmost: POINTER
    hwnd_top: POINTER
    hwnd_topmost: POINTER
    valid_hwnd_constant (c: POINTER): BOOLEAN


WEL_HWND_CONSTANTS Flat contracts

indexing
    description: "HWND constants used in SetWindowPos."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HWND_CONSTANTS

feature -- Access

    hwnd_bottom: POINTER

    hwnd_notopmost: POINTER

    hwnd_top: POINTER

    hwnd_topmost: POINTER

feature -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HWND_CONSTANTS


WEL_ICC_CONSTANTS Chart

class
    WEL_ICC_CONSTANTS

General
    cluster: wel.consts
    description: "Common controls initialization constants."

Ancestors
    ANY

Queries
    icc_animate_class: INTEGER
    icc_bar_classes: INTEGER
    icc_cool_classes: INTEGER
    icc_date_classes: INTEGER
    icc_hotkey_class: INTEGER
    icc_listview_classes: INTEGER
    icc_progress_class: INTEGER
    icc_tab_classes: INTEGER
    icc_treeview_classes: INTEGER
    icc_updown_class: INTEGER
    icc_userex_classes: INTEGER
    icc_win95_classes: INTEGER


WEL_ICC_CONSTANTS Flat contracts

indexing
    description: "Common controls initialization constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ICC_CONSTANTS

feature -- Access

    icc_animate_class: INTEGER

    icc_bar_classes: INTEGER

    icc_cool_classes: INTEGER

    icc_date_classes: INTEGER

    icc_hotkey_class: INTEGER

    icc_listview_classes: INTEGER

    icc_progress_class: INTEGER

    icc_tab_classes: INTEGER

    icc_treeview_classes: INTEGER

    icc_updown_class: INTEGER

    icc_userex_classes: INTEGER

    icc_win95_classes: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ICC_CONSTANTS


WEL_ICON_CONSTANTS Chart

class
    WEL_ICON_CONSTANTS

General
    cluster: wel.consts
    description: "Icon constants"

Ancestors
    ANY

Queries
    Icon_big: INTEGER
    Icon_small: INTEGER


WEL_ICON_CONSTANTS Flat contracts

indexing
    description: "Icon constants"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ICON_CONSTANTS

feature -- Access

    Icon_big: INTEGER is 1
            -- Declared in Windows as ICON_BIG

    Icon_small: INTEGER is 0
            -- Declared in Windows as ICON_SMALL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ICON_CONSTANTS


WEL_IDB_CONSTANTS Chart

class
    WEL_IDB_CONSTANTS

General
    cluster: wel.consts
    description: "System-defined toolbar bitmap constants."

Ancestors
    ANY

Queries
    idb_std_large_color: INTEGER
    idb_std_small_color: INTEGER
    idb_view_large_color: INTEGER
    idb_view_small_color: INTEGER
    valid_tool_bar_bitmap_constant (c: INTEGER): BOOLEAN


WEL_IDB_CONSTANTS Flat contracts

indexing
    description: "System-defined toolbar bitmap constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_IDB_CONSTANTS

feature -- Access

    idb_std_large_color: INTEGER
            -- Large, color standard bitmaps.

    idb_std_small_color: INTEGER
            -- Small, color standard bitmaps.

    idb_view_large_color: INTEGER
            -- Large, color view bitmaps.

    idb_view_small_color: INTEGER
            -- Small, color view bitmaps.

feature -- Status report

    valid_tool_bar_bitmap_constant (c: INTEGER): BOOLEAN
            -- Is c a valid tool bar bitmap constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_IDB_CONSTANTS


WEL_IDC_CONSTANTS Chart

class
    WEL_IDC_CONSTANTS

General
    cluster: wel.consts
    description: "Images for default cursors (IDC) constants."

Ancestors
    ANY

Queries
    idc_appstarting: POINTER
    idc_arrow: POINTER
    idc_cross: POINTER
    idc_help: POINTER
    idc_ibeam: POINTER
    idc_no: POINTER
    idc_sizeall: POINTER
    idc_sizenesw: POINTER
    idc_sizens: POINTER
    idc_sizenwse: POINTER
    idc_sizewe: POINTER
    idc_uparrow: POINTER
    idc_wait: POINTER


WEL_IDC_CONSTANTS Flat contracts

indexing
    description: "Images for default cursors (IDC) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"
    note: "Constants changed from INTEGER to POINTER."

class interface
    WEL_IDC_CONSTANTS

feature -- Access

    idc_appstarting: POINTER

    idc_arrow: POINTER

    idc_cross: POINTER

    idc_help: POINTER

    idc_ibeam: POINTER

    idc_no: POINTER

    idc_sizeall: POINTER

    idc_sizenesw: POINTER

    idc_sizens: POINTER

    idc_sizenwse: POINTER

    idc_sizewe: POINTER

    idc_uparrow: POINTER

    idc_wait: POINTER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_IDC_CONSTANTS


WEL_IDI_CONSTANTS Chart

class
    WEL_IDI_CONSTANTS

General
    cluster: wel.consts
    description: "Icon (IDI) constants."

Ancestors
    ANY

Queries
    idi_application: POINTER
    idi_asterisk: POINTER
    idi_error: POINTER
    idi_exclamation: POINTER
    idi_hand: POINTER
    idi_information: POINTER
    idi_question: POINTER
    idi_warning: POINTER


WEL_IDI_CONSTANTS Flat contracts

indexing
    description: "Icon (IDI) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"
    note: "Constants changed from INTEGER to POINTER"

class interface
    WEL_IDI_CONSTANTS

feature -- Access

    idi_application: POINTER

    idi_asterisk: POINTER
            -- Was declared in WEL_IDI_CONSTANTS as synonym of idi_information.

    idi_error: POINTER
            -- Was declared in WEL_IDI_CONSTANTS as synonym of idi_hand.

    idi_exclamation: POINTER
            -- Was declared in WEL_IDI_CONSTANTS as synonym of idi_warning.

    idi_hand: POINTER
            -- Was declared in WEL_IDI_CONSTANTS as synonym of idi_error.

    idi_information: POINTER
            -- Was declared in WEL_IDI_CONSTANTS as synonym of idi_asterisk.

    idi_question: POINTER

    idi_warning: POINTER
            -- Was declared in WEL_IDI_CONSTANTS as synonym of idi_exclamation.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_IDI_CONSTANTS


WEL_ID_CONSTANTS Chart

class
    WEL_ID_CONSTANTS

General
    cluster: wel.consts
    description: "Dialog response (ID) constants."

Ancestors
    ANY

Queries
    Idabort: INTEGER
    Idcancel: INTEGER
    Idignore: INTEGER
    Idno: INTEGER
    Idok: INTEGER
    Idretry: INTEGER
    Idyes: INTEGER


WEL_ID_CONSTANTS Flat contracts

indexing
    description: "Dialog response (ID) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ID_CONSTANTS

feature -- Access

    Idabort: INTEGER is 3
            -- Abort button was selected.

    Idcancel: INTEGER is 2
            -- Cancel button was selected.

    Idignore: INTEGER is 5
            -- Ignore button was selected.

    Idno: INTEGER is 7
            -- No button was selected.

    Idok: INTEGER is 1
            -- OK button was selected.

    Idretry: INTEGER is 4
            -- Retry button was selected.

    Idyes: INTEGER is 6
            -- Yes button was selected.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ID_CONSTANTS


WEL_ILC_CONSTANTS Chart

class
    WEL_ILC_CONSTANTS

General
    cluster: wel.consts
    description: "Image List Color constants."

Ancestors
    ANY

Queries
    Ilc_color: INTEGER
    Ilc_color16: INTEGER
    Ilc_color24: INTEGER
    Ilc_color32: INTEGER
    Ilc_color4: INTEGER
    Ilc_color8: INTEGER
    Ilc_colorddb: INTEGER
    Ilc_mask: INTEGER
    Ild_normal: INTEGER


WEL_ILC_CONSTANTS Flat contracts

indexing
    description: "Image List Color constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ILC_CONSTANTS

feature -- Access

    Ilc_color: INTEGER is 0
            -- Use the default behavior if none of the other
            -- ILC_COLOR* flags is specified. Typically, the
            -- Default is Ilc_color4, but for older
            -- display drivers, the default is Ilc_colorddb.
            --
            -- Declared in Windows as ILC_COLOR

    Ilc_color16: INTEGER is 16
            -- Use a 16-bit (32/64k-color) DIB section.
            --
            -- Declared in Windows as ILC_COLOR16

    Ilc_color24: INTEGER is 24
            -- Use a 24-bit DIB section.
            --
            -- Declared in Windows as ILC_COLOR24

    Ilc_color32: INTEGER is 32
            -- Use a 32-bit DIB section.
            --
            -- Declared in Windows as ILC_COLOR32

    Ilc_color4: INTEGER is 4
            -- Use a 4-bit (16-color) device-independent bitmap (DIB)
            -- section as the bitmap for the image list.
            --
            -- Declared in Windows as ILC_COLOR4

    Ilc_color8: INTEGER is 8
            -- Use an 8-bit DIB section. The colors used for the color
            -- table are the same colors as the halftone palette.
            --
            -- Declared in Windows as ILC_COLOR8

    Ilc_colorddb: INTEGER is 254
            -- Use a device-dependent bitmap.
            --
            -- Declared in Windows as ILC_COLORDDB

    Ilc_mask: INTEGER is 1
            -- Use a mask. The image list contains two
            -- bitmaps, one of which is a monochrome bitmap
            -- used as a mask. If this value is not included,
            -- the image list contains only one bitmap.
            --
            -- Declared in Windows as ILC_MASK

feature -- Access (ILD constants)

    Ild_normal: INTEGER is 0
            -- Draws the image using the background color for the image
            -- list. If the background color is the CLR_NONE value, the
            -- image is drawn transparently using the mask.
            --
            -- Declared in Windows as ILD_NORMAL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ILC_CONSTANTS


WEL_IMAGE_CONSTANTS Chart

class
    WEL_IMAGE_CONSTANTS

General
    cluster: wel.consts
    description: "Image constants (Image type)"

Ancestors
    ANY

Queries
    Image_bitmap: INTEGER
    Image_cursor: INTEGER
    Image_enhmetafile: INTEGER
    Image_icon: INTEGER


WEL_IMAGE_CONSTANTS Flat contracts

indexing
    description: "Image constants (Image type)"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_IMAGE_CONSTANTS

feature -- Access

    Image_bitmap: INTEGER is 0
            -- Declared in Windows as IMAGE_BITMAP

    Image_cursor: INTEGER is 2
            -- Declared in Windows as IMAGE_CURSOR

    Image_enhmetafile: INTEGER is 3
            -- Declared in Windows as IMAGE_ENHMETAFILE

    Image_icon: INTEGER is 1
            -- Declared in Windows as IMAGE_ICON

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_IMAGE_CONSTANTS


WEL_INPUT_EVENT_CONSTANTS Chart

class
    WEL_INPUT_EVENT_CONSTANTS

General
    cluster: wel.consts
    description: "Constants used in WEL_INPUT_EVENT about mouse and keyboard events"

Ancestors
    ANY

Queries
    Keyeventf_extendedkey: INTEGER
    Keyeventf_keyup: INTEGER
    Mouseeventf_absolute: INTEGER
    Mouseeventf_leftdown: INTEGER
    Mouseeventf_leftup: INTEGER
    Mouseeventf_middledown: INTEGER
    Mouseeventf_middleup: INTEGER
    Mouseeventf_move: INTEGER
    Mouseeventf_rightdown: INTEGER
    Mouseeventf_rightup: INTEGER
    Mouseeventf_wheel: INTEGER


WEL_INPUT_EVENT_CONSTANTS Flat contracts

indexing
    description: "Constants used in WEL_INPUT_EVENT about mouse and keyboard events"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_INPUT_EVENT_CONSTANTS

feature -- Keyboard event input

    Keyeventf_extendedkey: INTEGER is 1
            -- Declared in Windows as KEYEVENTF_EXTENDEDKEY

    Keyeventf_keyup: INTEGER is 2
            -- Declared in Windows as KEYEVENTF_KEYUP

feature -- Mouse event input

    Mouseeventf_absolute: INTEGER is 32768
            -- Declared in Windows as MOUSEEVENTF_ABSOLUTE

    Mouseeventf_leftdown: INTEGER is 2
            -- Declared in Windows as MOUSEEVENTF_LEFTDOWN

    Mouseeventf_leftup: INTEGER is 4
            -- Declared in Windows as MOUSEEVENTF_LEFTUP

    Mouseeventf_middledown: INTEGER is 32
            -- Declared in Windows as MOUSEEVENTF_MIDDLEDOWN

    Mouseeventf_middleup: INTEGER is 64
            -- Declared in Windows as MOUSEEVENTF_MIDDLEUP

    Mouseeventf_move: INTEGER is 1
            -- Declared in Windows as MOUSEEVENTF_MOVE

    Mouseeventf_rightdown: INTEGER is 8
            -- Declared in Windows as MOUSEEVENTF_RIGHTDOWN

    Mouseeventf_rightup: INTEGER is 16
            -- Declared in Windows as MOUSEEVENTF_RIGHTUP

    Mouseeventf_wheel: INTEGER is 2048
            -- Declared in Windows as MOUSEEVENTF_WHEEL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_INPUT_EVENT_CONSTANTS


WEL_LANGUAGE_CONSTANTS Chart

class
    WEL_LANGUAGE_CONSTANTS

General
    cluster: wel.consts
    description: "Language (LANG) and sublanguage (SUBLANG) constants."

Ancestors
    ANY

Queries
    Lang_afrikaans: INTEGER
    Lang_albanian: INTEGER
    Lang_arabic: INTEGER
    Lang_basque: INTEGER
    Lang_belarusian: INTEGER
    Lang_bulgarian: INTEGER
    Lang_catalan: INTEGER
    Lang_chinese: INTEGER
    Lang_croatian: INTEGER
    Lang_czech: INTEGER
    Lang_danish: INTEGER
    Lang_dutch: INTEGER
    Lang_english: INTEGER
    Lang_estonian: INTEGER
    Lang_faeroese: INTEGER
    Lang_farsi: INTEGER
    Lang_finnish: INTEGER
    Lang_french: INTEGER
    Lang_german: INTEGER
    Lang_greek: INTEGER
    Lang_hebrew: INTEGER
    Lang_hungarian: INTEGER
    Lang_icelandic: INTEGER
    Lang_indonesian: INTEGER
    Lang_italian: INTEGER
    Lang_japanese: INTEGER
    Lang_korean: INTEGER
    Lang_latvian: INTEGER
    Lang_lithuanian: INTEGER
    Lang_neutral: INTEGER
    Lang_norwegian: INTEGER
    Lang_polish: INTEGER
    Lang_portuguese: INTEGER
    Lang_romanian: INTEGER
    Lang_russian: INTEGER
    Lang_serbian: INTEGER
    Lang_slovak: INTEGER
    Lang_slovenian: INTEGER
    Lang_spanish: INTEGER
    Lang_swedish: INTEGER
    Lang_thai: INTEGER
    Lang_turkish: INTEGER
    Lang_ukrainian: INTEGER
    Lang_vietnamese: INTEGER
    Sublang_arabic_algeria: INTEGER
    Sublang_arabic_bahrain: INTEGER
    Sublang_arabic_egypt: INTEGER
    Sublang_arabic_iraq: INTEGER
    Sublang_arabic_jordan: INTEGER
    Sublang_arabic_kuwait: INTEGER
    Sublang_arabic_lebanon: INTEGER
    Sublang_arabic_libya: INTEGER
    Sublang_arabic_morocco: INTEGER
    Sublang_arabic_oman: INTEGER
    Sublang_arabic_qatar: INTEGER
    Sublang_arabic_saudi_arabia: INTEGER
    Sublang_arabic_syria: INTEGER
    Sublang_arabic_tunisia: INTEGER
    Sublang_arabic_uae: INTEGER
    Sublang_arabic_yemen: INTEGER
    Sublang_chinese_hongkong: INTEGER
    Sublang_chinese_simplified: INTEGER
    Sublang_chinese_singapore: INTEGER
    Sublang_chinese_traditional: INTEGER
    Sublang_default: INTEGER
    Sublang_dutch: INTEGER
    Sublang_dutch_belgian: INTEGER
    Sublang_english_aus: INTEGER
    Sublang_english_belize: INTEGER
    Sublang_english_can: INTEGER
    Sublang_english_caribbean: INTEGER
    Sublang_english_eire: INTEGER
    Sublang_english_jamaica: INTEGER
    Sublang_english_nz: INTEGER
    Sublang_english_south_africa: INTEGER
    Sublang_english_trinidad: INTEGER
    Sublang_english_uk: INTEGER
    Sublang_english_us: INTEGER
    Sublang_french: INTEGER
    Sublang_french_belgian: INTEGER
    Sublang_french_canadian: INTEGER
    Sublang_french_luxembourg: INTEGER
    Sublang_french_swiss: INTEGER
    Sublang_german: INTEGER
    Sublang_german_austrian: INTEGER
    Sublang_german_liechtenstein: INTEGER
    Sublang_german_luxembourg: INTEGER
    Sublang_german_swiss: INTEGER
    Sublang_italian: INTEGER
    Sublang_italian_swiss: INTEGER
    Sublang_korean: INTEGER
    Sublang_neutral: INTEGER
    Sublang_norwegian_bokmal: INTEGER
    Sublang_norwegian_nynorsk: INTEGER
    Sublang_portuguese: INTEGER
    Sublang_portuguese_brazilian: INTEGER
    Sublang_serbian_cyrillic: INTEGER
    Sublang_serbian_latin: INTEGER
    Sublang_spanish: INTEGER
    Sublang_spanish_argentina: INTEGER
    Sublang_spanish_bolivia: INTEGER
    Sublang_spanish_chile: INTEGER
    Sublang_spanish_colombia: INTEGER
    Sublang_spanish_costa_rica: INTEGER
    Sublang_spanish_dominican_republic: INTEGER
    Sublang_spanish_ecuador: INTEGER
    Sublang_spanish_el_salvador: INTEGER
    Sublang_spanish_guatemala: INTEGER
    Sublang_spanish_honduras: INTEGER
    Sublang_spanish_mexican: INTEGER
    Sublang_spanish_modern: INTEGER
    Sublang_spanish_nicaragua: INTEGER
    Sublang_spanish_panama: INTEGER
    Sublang_spanish_paraguay: INTEGER
    Sublang_spanish_peru: INTEGER
    Sublang_spanish_puerto_rico: INTEGER
    Sublang_spanish_uruguay: INTEGER
    Sublang_spanish_venezuela: INTEGER
    Sublang_swedish: INTEGER
    Sublang_swedish_finland: INTEGER
    Sublang_sys_default: INTEGER


WEL_LANGUAGE_CONSTANTS Flat contracts

indexing
    description: "Language (LANG) and sublanguage (SUBLANG) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LANGUAGE_CONSTANTS

feature -- Access

    Lang_afrikaans: INTEGER is 54
            -- Declared in Windows as LANG_AFRIKAANS

    Lang_albanian: INTEGER is 28
            -- Declared in Windows as LANG_ALBANIAN

    Lang_arabic: INTEGER is 1
            -- Declared in Windows as LANG_ARABIC

    Lang_basque: INTEGER is 45
            -- Declared in Windows as LANG_BASQUE

    Lang_belarusian: INTEGER is 35
            -- Declared in Windows as LANG_BELARUSIAN

    Lang_bulgarian: INTEGER is 2
            -- Declared in Windows as LANG_BULGARIAN

    Lang_catalan: INTEGER is 3
            -- Declared in Windows as LANG_CATALAN

    Lang_chinese: INTEGER is 4
            -- Declared in Windows as LANG_CHINESE

    Lang_croatian: INTEGER is 26
            -- Declared in Windows as LANG_CROATIAN

    Lang_czech: INTEGER is 5
            -- Declared in Windows as LANG_CZECH

    Lang_danish: INTEGER is 6
            -- Declared in Windows as LANG_DANISH

    Lang_dutch: INTEGER is 19
            -- Declared in Windows as LANG_DUTCH

    Lang_english: INTEGER is 9
            -- Declared in Windows as LANG_ENGLISH

    Lang_estonian: INTEGER is 37
            -- Declared in Windows as LANG_ESTONIAN

    Lang_faeroese: INTEGER is 56
            -- Declared in Windows as LANG_FAEROESE

    Lang_farsi: INTEGER is 41
            -- Declared in Windows as LANG_FARSI

    Lang_finnish: INTEGER is 11
            -- Declared in Windows as LANG_FINNISH

    Lang_french: INTEGER is 12
            -- Declared in Windows as LANG_FRENCH

    Lang_german: INTEGER is 7
            -- Declared in Windows as LANG_GERMAN

    Lang_greek: INTEGER is 8
            -- Declared in Windows as LANG_GREEK

    Lang_hebrew: INTEGER is 13
            -- Declared in Windows as LANG_HEBREW

    Lang_hungarian: INTEGER is 14
            -- Declared in Windows as LANG_HUNGARIAN

    Lang_icelandic: INTEGER is 15
            -- Declared in Windows as LANG_ICELANDIC

    Lang_indonesian: INTEGER is 33
            -- Declared in Windows as LANG_INDONESIAN

    Lang_italian: INTEGER is 16
            -- Declared in Windows as LANG_ITALIAN

    Lang_japanese: INTEGER is 17
            -- Declared in Windows as LANG_JAPANESE

    Lang_korean: INTEGER is 18
            -- Declared in Windows as LANG_KOREAN

    Lang_latvian: INTEGER is 38
            -- Declared in Windows as LANG_LATVIAN

    Lang_lithuanian: INTEGER is 39
            -- Declared in Windows as LANG_LITHUANIAN

    Lang_neutral: INTEGER is 0
            -- Declared in Windows as LANG_NEUTRAL

    Lang_norwegian: INTEGER is 20
            -- Declared in Windows as LANG_NORWEGIAN

    Lang_polish: INTEGER is 21
            -- Declared in Windows as LANG_POLISH

    Lang_portuguese: INTEGER is 22
            -- Declared in Windows as LANG_PORTUGUESE

    Lang_romanian: INTEGER is 24
            -- Declared in Windows as LANG_ROMANIAN

    Lang_russian: INTEGER is 25
            -- Declared in Windows as LANG_RUSSIAN

    Lang_serbian: INTEGER is 26
            -- Declared in Windows as LANG_SERBIAN

    Lang_slovak: INTEGER is 27
            -- Declared in Windows as LANG_SLOVAK

    Lang_slovenian: INTEGER is 36
            -- Declared in Windows as LANG_SLOVENIAN

    Lang_spanish: INTEGER is 10
            -- Declared in Windows as LANG_SPANISH

    Lang_swedish: INTEGER is 29
            -- Declared in Windows as LANG_SWEDISH

    Lang_thai: INTEGER is 30
            -- Declared in Windows as LANG_THAI

    Lang_turkish: INTEGER is 31
            -- Declared in Windows as LANG_TURKISH

    Lang_ukrainian: INTEGER is 34
            -- Declared in Windows as LANG_UKRAINIAN

    Lang_vietnamese: INTEGER is 42
            -- Declared in Windows as LANG_VIETNAMESE

    Sublang_arabic_algeria: INTEGER is 5
            -- Declared in Windows as SUBLANG_ARABIC_ALGERIA

    Sublang_arabic_bahrain: INTEGER is 15
            -- Declared in Windows as SUBLANG_ARABIC_BAHRAIN

    Sublang_arabic_egypt: INTEGER is 3
            -- Declared in Windows as SUBLANG_ARABIC_EGYPT

    Sublang_arabic_iraq: INTEGER is 2
            -- Declared in Windows as SUBLANG_ARABIC_IRAQ

    Sublang_arabic_jordan: INTEGER is 11
            -- Declared in Windows as SUBLANG_ARABIC_JORDAN

    Sublang_arabic_kuwait: INTEGER is 13
            -- Declared in Windows as SUBLANG_ARABIC_KUWAIT

    Sublang_arabic_lebanon: INTEGER is 12
            -- Declared in Windows as SUBLANG_ARABIC_LEBANON

    Sublang_arabic_libya: INTEGER is 4
            -- Declared in Windows as SUBLANG_ARABIC_LIBYA

    Sublang_arabic_morocco: INTEGER is 6
            -- Declared in Windows as SUBLANG_ARABIC_MOROCCO

    Sublang_arabic_oman: INTEGER is 8
            -- Declared in Windows as SUBLANG_ARABIC_OMAN

    Sublang_arabic_qatar: INTEGER is 16
            -- Declared in Windows as SUBLANG_ARABIC_QATAR

    Sublang_arabic_saudi_arabia: INTEGER is 1
            -- Declared in Windows as SUBLANG_ARABIC_SAUDI_ARABIA

    Sublang_arabic_syria: INTEGER is 10
            -- Declared in Windows as SUBLANG_ARABIC_SYRIA

    Sublang_arabic_tunisia: INTEGER is 7
            -- Declared in Windows as SUBLANG_ARABIC_TUNISIA

    Sublang_arabic_uae: INTEGER is 14
            -- Declared in Windows as SUBLANG_ARABIC_UAE

    Sublang_arabic_yemen: INTEGER is 9
            -- Declared in Windows as SUBLANG_ARABIC_YEMEN

    Sublang_chinese_hongkong: INTEGER is 3
            -- Declared in Windows as SUBLANG_CHINESE_HONGKONG

    Sublang_chinese_simplified: INTEGER is 2
            -- Declared in Windows as SUBLANG_CHINESE_SIMPLIFIED

    Sublang_chinese_singapore: INTEGER is 4
            -- Declared in Windows as SUBLANG_CHINESE_SINGAPORE

    Sublang_chinese_traditional: INTEGER is 1
            -- Declared in Windows as SUBLANG_CHINESE_TRADITIONAL

    Sublang_default: INTEGER is 1
            -- Declared in Windows as SUBLANG_DEFAULT

    Sublang_dutch: INTEGER is 1
            -- Declared in Windows as SUBLANG_DUTCH

    Sublang_dutch_belgian: INTEGER is 2
            -- Declared in Windows as SUBLANG_DUTCH_BELGIAN

    Sublang_english_aus: INTEGER is 3
            -- Declared in Windows as SUBLANG_ENGLISH_AUS

    Sublang_english_belize: INTEGER is 10
            -- Declared in Windows as SUBLANG_ENGLISH_BELIZE

    Sublang_english_can: INTEGER is 4
            -- Declared in Windows as SUBLANG_ENGLISH_CAN

    Sublang_english_caribbean: INTEGER is 9
            -- Declared in Windows as SUBLANG_ENGLISH_CARIBBEAN

    Sublang_english_eire: INTEGER is 6
            -- Declared in Windows as SUBLANG_ENGLISH_EIRE

    Sublang_english_jamaica: INTEGER is 8
            -- Declared in Windows as SUBLANG_ENGLISH_JAMAICA

    Sublang_english_nz: INTEGER is 5
            -- Declared in Windows as SUBLANG_ENGLISH_NZ

    Sublang_english_south_africa: INTEGER is 7
            -- Declared in Windows as SUBLANG_ENGLISH_SOUTH_AFRICA

    Sublang_english_trinidad: INTEGER is 11
            -- Declared in Windows as SUBLANG_ENGLISH_TRINIDAD

    Sublang_english_uk: INTEGER is 2
            -- Declared in Windows as SUBLANG_ENGLISH_UK

    Sublang_english_us: INTEGER is 1
            -- Declared in Windows as SUBLANG_ENGLISH_US

    Sublang_french: INTEGER is 1
            -- Declared in Windows as SUBLANG_FRENCH

    Sublang_french_belgian: INTEGER is 2
            -- Declared in Windows as SUBLANG_FRENCH_BELGIAN

    Sublang_french_canadian: INTEGER is 3
            -- Declared in Windows as SUBLANG_FRENCH_CANADIAN

    Sublang_french_luxembourg: INTEGER is 5
            -- Declared in Windows as SUBLANG_FRENCH_LUXEMBOURG

    Sublang_french_swiss: INTEGER is 4
            -- Declared in Windows as SUBLANG_FRENCH_SWISS

    Sublang_german: INTEGER is 1
            -- Declared in Windows as SUBLANG_GERMAN

    Sublang_german_austrian: INTEGER is 3
            -- Declared in Windows as SUBLANG_GERMAN_AUSTRIAN

    Sublang_german_liechtenstein: INTEGER is 5
            -- Declared in Windows as SUBLANG_GERMAN_LIECHTENSTEIN

    Sublang_german_luxembourg: INTEGER is 4
            -- Declared in Windows as SUBLANG_GERMAN_LUXEMBOURG

    Sublang_german_swiss: INTEGER is 2
            -- Declared in Windows as SUBLANG_GERMAN_SWISS

    Sublang_italian: INTEGER is 1
            -- Declared in Windows as SUBLANG_ITALIAN

    Sublang_italian_swiss: INTEGER is 2
            -- Declared in Windows as SUBLANG_ITALIAN_SWISS

    Sublang_korean: INTEGER is 1
            -- Declared in Windows as SUBLANG_KOREAN

    Sublang_neutral: INTEGER is 0
            -- Declared in Windows as SUBLANG_NEUTRAL

    Sublang_norwegian_bokmal: INTEGER is 1
            -- Declared in Windows as SUBLANG_NORWEGIAN_BOKMAL

    Sublang_norwegian_nynorsk: INTEGER is 2
            -- Declared in Windows as SUBLANG_NORWEGIAN_NYNORSK

    Sublang_portuguese: INTEGER is 2
            -- Declared in Windows as SUBLANG_PORTUGUESE

    Sublang_portuguese_brazilian: INTEGER is 1
            -- Declared in Windows as SUBLANG_PORTUGUESE_BRAZILIAN

    Sublang_serbian_cyrillic: INTEGER is 3
            -- Declared in Windows as SUBLANG_SERBIAN_CYRILLIC

    Sublang_serbian_latin: INTEGER is 2
            -- Declared in Windows as SUBLANG_SERBIAN_LATIN

    Sublang_spanish: INTEGER is 1
            -- Declared in Windows as SUBLANG_SPANISH

    Sublang_spanish_argentina: INTEGER is 11
            -- Declared in Windows as SUBLANG_SPANISH_ARGENTINA

    Sublang_spanish_bolivia: INTEGER is 16
            -- Declared in Windows as SUBLANG_SPANISH_BOLIVIA

    Sublang_spanish_chile: INTEGER is 13
            -- Declared in Windows as SUBLANG_SPANISH_CHILE

    Sublang_spanish_colombia: INTEGER is 9
            -- Declared in Windows as SUBLANG_SPANISH_COLOMBIA

    Sublang_spanish_costa_rica: INTEGER is 5
            -- Declared in Windows as SUBLANG_SPANISH_COSTA_RICA

    Sublang_spanish_dominican_republic: INTEGER is 7
            -- Declared in Windows as SUBLANG_SPANISH_DOMINICAN_REPUBLIC

    Sublang_spanish_ecuador: INTEGER is 12
            -- Declared in Windows as SUBLANG_SPANISH_ECUADOR

    Sublang_spanish_el_salvador: INTEGER is 17
            -- Declared in Windows as SUBLANG_SPANISH_EL_SALVADOR

    Sublang_spanish_guatemala: INTEGER is 4
            -- Declared in Windows as SUBLANG_SPANISH_GUATEMALA

    Sublang_spanish_honduras: INTEGER is 18
            -- Declared in Windows as SUBLANG_SPANISH_HONDURAS

    Sublang_spanish_mexican: INTEGER is 2
            -- Declared in Windows as SUBLANG_SPANISH_MEXICAN

    Sublang_spanish_modern: INTEGER is 3
            -- Declared in Windows as SUBLANG_SPANISH_MODERN

    Sublang_spanish_nicaragua: INTEGER is 19
            -- Declared in Windows as SUBLANG_SPANISH_NICARAGUA

    Sublang_spanish_panama: INTEGER is 6
            -- Declared in Windows as SUBLANG_SPANISH_PANAMA

    Sublang_spanish_paraguay: INTEGER is 15
            -- Declared in Windows as SUBLANG_SPANISH_PARAGUAY

    Sublang_spanish_peru: INTEGER is 10
            -- Declared in Windows as SUBLANG_SPANISH_PERU

    Sublang_spanish_puerto_rico: INTEGER is 20
            -- Declared in Windows as SUBLANG_SPANISH_PUERTO_RICO

    Sublang_spanish_uruguay: INTEGER is 14
            -- Declared in Windows as SUBLANG_SPANISH_URUGUAY

    Sublang_spanish_venezuela: INTEGER is 8
            -- Declared in Windows as SUBLANG_SPANISH_VENEZUELA

    Sublang_swedish: INTEGER is 1
            -- Declared in Windows as SUBLANG_SWEDISH

    Sublang_swedish_finland: INTEGER is 2
            -- Declared in Windows as SUBLANG_SWEDISH_FINLAND

    Sublang_sys_default: INTEGER is 2
            -- Declared in Windows as SUBLANG_SYS_DEFAULT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LANGUAGE_CONSTANTS


WEL_LBN_CONSTANTS Chart

class
    WEL_LBN_CONSTANTS

General
    cluster: wel.consts
    description: "ListBox notification (LBN) messages."

Ancestors
    ANY

Queries
    Lbn_dblclk: INTEGER
    Lbn_errspace: INTEGER
    Lbn_killfocus: INTEGER
    Lbn_selcancel: INTEGER
    Lbn_selchange: INTEGER
    Lbn_setfocus: INTEGER


WEL_LBN_CONSTANTS Flat contracts

indexing
    description: "ListBox notification (LBN) messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LBN_CONSTANTS

feature -- Access

    Lbn_dblclk: INTEGER is 2

    Lbn_errspace: INTEGER is -2

    Lbn_killfocus: INTEGER is 5

    Lbn_selcancel: INTEGER is 3

    Lbn_selchange: INTEGER is 1

    Lbn_setfocus: INTEGER is 4

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LBN_CONSTANTS


WEL_LBS_CONSTANTS Chart

class
    WEL_LBS_CONSTANTS

General
    cluster: wel.consts
    description: "ListBox Style constants."

Ancestors
    ANY

Queries
    Lbs_disablenoscroll: INTEGER
    Lbs_extendedsel: INTEGER
    Lbs_hasstrings: INTEGER
    Lbs_multicolumn: INTEGER
    Lbs_multiplesel: INTEGER
    Lbs_nointegralheight: INTEGER
    Lbs_noredraw: INTEGER
    Lbs_notify: INTEGER
    Lbs_ownerdrawfixed: INTEGER
    Lbs_ownerdrawvariable: INTEGER
    Lbs_sort: INTEGER
    Lbs_standard: INTEGER
    Lbs_usetabstops: INTEGER
    Lbs_wantkeyboardinput: INTEGER


WEL_LBS_CONSTANTS Flat contracts

indexing
    description: "ListBox Style constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LBS_CONSTANTS

feature -- Access

    Lbs_disablenoscroll: INTEGER is 4096

    Lbs_extendedsel: INTEGER is 2048

    Lbs_hasstrings: INTEGER is 64

    Lbs_multicolumn: INTEGER is 512

    Lbs_multiplesel: INTEGER is 8

    Lbs_nointegralheight: INTEGER is 256

    Lbs_noredraw: INTEGER is 4

    Lbs_notify: INTEGER is 1

    Lbs_ownerdrawfixed: INTEGER is 16

    Lbs_ownerdrawvariable: INTEGER is 32

    Lbs_sort: INTEGER is 2

    Lbs_standard: INTEGER is 10485763
            -- Lbs_notify | Lbs_sort | Ws_vscroll | Ws_border.

    Lbs_usetabstops: INTEGER is 128

    Lbs_wantkeyboardinput: INTEGER is 1024

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LBS_CONSTANTS


WEL_LB_CONSTANTS Chart

class
    WEL_LB_CONSTANTS

General
    cluster: wel.consts
    description: "ListBox message (LB) constants."

Ancestors
    ANY

Queries
    Lb_addfile: INTEGER
    Lb_addstring: INTEGER
    Lb_ctlcode: INTEGER
    Lb_deletestring: INTEGER
    Lb_dir: INTEGER
    Lb_err: INTEGER
    Lb_errspace: INTEGER
    Lb_findstring: INTEGER
    Lb_findstringexact: INTEGER
    Lb_getanchorindex: INTEGER
    Lb_getcaretindex: INTEGER
    Lb_getcount: INTEGER
    Lb_getcursel: INTEGER
    Lb_gethorizontalextent: INTEGER
    Lb_getitemdata: INTEGER
    Lb_getitemheight: INTEGER
    Lb_getitemrect: INTEGER
    Lb_getsel: INTEGER
    Lb_getselcount: INTEGER
    Lb_getselitems: INTEGER
    Lb_gettext: INTEGER
    Lb_gettextlen: INTEGER
    Lb_gettopindex: INTEGER
    Lb_insertstring: INTEGER
    Lb_okay: INTEGER
    Lb_resetcontent: INTEGER
    Lb_selectstring: INTEGER
    Lb_selitemrange: INTEGER
    Lb_selitemrangeex: INTEGER
    Lb_setanchorindex: INTEGER
    Lb_setcaretindex: INTEGER
    Lb_setcolumnwidth: INTEGER
    Lb_setcursel: INTEGER
    Lb_sethorizontalextent: INTEGER
    Lb_setitemdata: INTEGER
    Lb_setitemheight: INTEGER
    Lb_setsel: INTEGER
    Lb_settabstops: INTEGER
    Lb_settopindex: INTEGER


WEL_LB_CONSTANTS Flat contracts

indexing
    description: "ListBox message (LB) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LB_CONSTANTS

feature -- Access

    Lb_addfile: INTEGER is 406

    Lb_addstring: INTEGER is 384

    Lb_ctlcode: INTEGER is 0

    Lb_deletestring: INTEGER is 386

    Lb_dir: INTEGER is 397

    Lb_err: INTEGER is -1

    Lb_errspace: INTEGER is -2

    Lb_findstring: INTEGER is 399

    Lb_findstringexact: INTEGER is 418

    Lb_getanchorindex: INTEGER is 413

    Lb_getcaretindex: INTEGER is 415

    Lb_getcount: INTEGER is 395

    Lb_getcursel: INTEGER is 392

    Lb_gethorizontalextent: INTEGER is 403

    Lb_getitemdata: INTEGER is 409

    Lb_getitemheight: INTEGER is 417

    Lb_getitemrect: INTEGER is 408

    Lb_getsel: INTEGER is 391

    Lb_getselcount: INTEGER is 400

    Lb_getselitems: INTEGER is 401

    Lb_gettext: INTEGER is 393

    Lb_gettextlen: INTEGER is 394

    Lb_gettopindex: INTEGER is 398

    Lb_insertstring: INTEGER is 385

    Lb_okay: INTEGER is 0

    Lb_resetcontent: INTEGER is 388

    Lb_selectstring: INTEGER is 396

    Lb_selitemrange: INTEGER is 411

    Lb_selitemrangeex: INTEGER is 387

    Lb_setanchorindex: INTEGER is 412

    Lb_setcaretindex: INTEGER is 414

    Lb_setcolumnwidth: INTEGER is 405

    Lb_setcursel: INTEGER is 390

    Lb_sethorizontalextent: INTEGER is 404

    Lb_setitemdata: INTEGER is 410

    Lb_setitemheight: INTEGER is 416

    Lb_setsel: INTEGER is 389

    Lb_settabstops: INTEGER is 402

    Lb_settopindex: INTEGER is 407

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LB_CONSTANTS


WEL_LINE_CAPABILITIES_CONSTANTS Chart

class
    WEL_LINE_CAPABILITIES_CONSTANTS

General
    cluster: wel.consts
    description: "Line capabilities (LC) constants."

Ancestors
    ANY

Queries
    lc_interiors: INTEGER
    lc_marker: INTEGER
    lc_none: INTEGER
    lc_polyline: INTEGER
    lc_polymarker: INTEGER
    lc_styled: INTEGER
    lc_wide: INTEGER
    lc_wide_styled: INTEGER


WEL_LINE_CAPABILITIES_CONSTANTS Flat contracts

indexing
    description: "Line capabilities (LC) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LINE_CAPABILITIES_CONSTANTS

feature -- Access

    lc_interiors: INTEGER
            -- Supports interiors

    lc_marker: INTEGER
            -- Supports markers

    lc_none: INTEGER
            -- Supports no lines

    lc_polyline: INTEGER
            -- Supports polylines

    lc_polymarker: INTEGER
            -- Supports polymarkers

    lc_styled: INTEGER
            -- Supports styled lines

    lc_wide: INTEGER
            -- Supports wide lines

    lc_wide_styled: INTEGER
            -- Supports wide, styled lines

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LINE_CAPABILITIES_CONSTANTS


WEL_LVCF_CONSTANTS Chart

class
    WEL_LVCF_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List view column flag (LVCF) constants"

Ancestors
    ANY

Queries
    Lvcf_fmt: INTEGER
    Lvcf_image: INTEGER
    Lvcf_subitem: INTEGER
    Lvcf_text: INTEGER
    Lvcf_width: INTEGER
    Lvcfmt_center: INTEGER
    Lvcfmt_justifymask: INTEGER
    Lvcfmt_left: INTEGER
    Lvcfmt_right: INTEGER
    valid_lvcfmt_constant (value: INTEGER): BOOLEAN


WEL_LVCF_CONSTANTS Flat contracts

indexing
    description: "List view column flag (LVCF) constants"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVCF_CONSTANTS

feature -- Column Flags (Format)

    Lvcfmt_center: INTEGER is 2
            -- alignment of the column : center.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_CENTER

    Lvcfmt_justifymask: INTEGER is 3
            -- alignment of the column : justify.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_JUSTIFYMASK

    Lvcfmt_left: INTEGER is 0
            -- alignment of the column : left.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_LEFT

    Lvcfmt_right: INTEGER is 1
            -- alignment of the column : right.
            -- Do not use for the first column of the list view
            -- that must always be left-aligned.
            --
            -- Declared in Windows as LVCFMT_RIGHT

feature -- Column Flags (General)

    Lvcf_fmt: INTEGER is 1
            -- The fmt member is valid.
            --
            -- Declared in Windows as LVCF_FMT

    Lvcf_image: INTEGER is 16
            -- The ilmage member is valid
            --
            -- Declared in Windows as LVCF_IMAGE

    Lvcf_subitem: INTEGER is 8
            -- The iSubItem member is valid.
            --
            -- Declared in Windows as LVCF_SUBITEM

    Lvcf_text: INTEGER is 4
            -- The pszText member is valid.
            --
            -- Declared in Windows as LVCF_TEXT

    Lvcf_width: INTEGER is 2
            -- The cx member is valid.
            --
            -- Declared in Windows as LVCF_WIDTH

feature -- Validation

    valid_lvcfmt_constant (value: INTEGER): BOOLEAN
            -- Is value a valid lvcfmt constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVCF_CONSTANTS


WEL_LVFI_CONSTANTS Chart

class
    WEL_LVFI_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "Flags defining search in a list view."

Ancestors
    ANY

Queries
    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
    Lvfi_nearestxy: INTEGER
    Lvfi_param: INTEGER
    Lvfi_partial: INTEGER
    Lvfi_string: INTEGER
    Lvfi_wrap: INTEGER


WEL_LVFI_CONSTANTS Flat contracts

indexing
    description: "Flags defining search in a list view."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"
    note: "Used in WEL_LIST_VIEW_SEARCH_INFO"

class interface
    WEL_LVFI_CONSTANTS

feature -- Acess

    Lvfi_nearestxy: INTEGER is 64
            -- Search item nearest specified position in specified direction
            --
            -- Declared in Windows as LVFI_NEARESTXY

    Lvfi_param: INTEGER is 1
            -- Search item with corresponding lparam attribute
            --
            -- Declared in Windows as LVFI_PARAM

    Lvfi_partial: INTEGER is 8
            -- Search item including given string
            --
            -- Declared in Windows as LVFI_PARTIAL

    Lvfi_string: INTEGER is 2
            -- Search item with exact corresponding string
            --
            -- Declared in Windows as LVFI_STRING

    Lvfi_wrap: INTEGER is 32
            -- Start search from start when end of list view is reached
            --
            -- Declared in Windows as LVFI_WRAP

feature -- Validation

    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
            -- Is a_flag a valid list view search flag?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVFI_CONSTANTS


WEL_LVHT_CONSTANTS Chart

class
    WEL_LVHT_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List View HitTest info (LVHT) constants."

Ancestors
    ANY

Queries
    Lvht_above: INTEGER
    Lvht_below: INTEGER
    Lvht_nowhere: INTEGER
    Lvht_onitemicon: INTEGER
    Lvht_onitemlabel: INTEGER
    Lvht_onitemstateicon: INTEGER
    Lvht_toleft: INTEGER
    Lvht_toright: INTEGER


WEL_LVHT_CONSTANTS Flat contracts

indexing
    description: "List View HitTest info (LVHT) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVHT_CONSTANTS

feature -- Access

    Lvht_above: INTEGER is 8
            -- Above the client area.
            --
            -- Declared in Windows as LVHT_ABOVE

    Lvht_below: INTEGER is 16
            -- Below the client area.
            --
            -- Declared in Windows as LVHT_BELOW

    Lvht_nowhere: INTEGER is 1
            -- In the client area, but below the last item.
            --
            -- Declared in Windows as LVHT_NOWHERE

    Lvht_onitemicon: INTEGER is 2
            -- On the button associated with an item.
            --
            -- Declared in Windows as LVHT_ONITEMICON

    Lvht_onitemlabel: INTEGER is 4
            -- On the label (string) associated with an item.
            --
            -- Declared in Windows as LVHT_ONITEMLABEL

    Lvht_onitemstateicon: INTEGER is 8
            -- On the state icon for a tree view item that is in
            -- a user-defines state.
            --
            -- Declared in Windows as LVHT_ONITEMSTATEICON

    Lvht_toleft: INTEGER is 64
            -- To the left of the client area.
            --
            -- Declared in Windows as LVHT_TOLEFT

    Lvht_toright: INTEGER is 32
            -- To the right of the client area.
            --
            -- Declared in Windows as LVHT_TORIGHT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVHT_CONSTANTS


WEL_LVIF_CONSTANTS Chart

class
    WEL_LVIF_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List view item flag (LVIF) constants."

Ancestors
    ANY

Queries
    Lvif_image: INTEGER
    Lvif_param: INTEGER
    Lvif_state: INTEGER
    Lvif_text: INTEGER


WEL_LVIF_CONSTANTS Flat contracts

indexing
    description: "List view item flag (LVIF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVIF_CONSTANTS

feature -- Access

    Lvif_image: INTEGER is 2
            -- The iImage member is valid.
            --
            -- Declared in Windows as LVIF_IMAGE

    Lvif_param: INTEGER is 4
            -- The lParam member is valid.
            --
            -- Declared in Windows as LVIF_PARAM

    Lvif_state: INTEGER is 8
            -- The state member is valid
            --
            -- Declared in Windows as LVIF_STATE

    Lvif_text: INTEGER is 1
            -- The pszText member is valid.
            --
            -- Declared in Windows as LVIF_TEXT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVIF_CONSTANTS


WEL_LVIS_CONSTANTS Chart

class
    WEL_LVIS_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List view item styles (LVIS) constants."

Ancestors
    ANY

Queries
    Lvis_cut: INTEGER
    Lvis_drophilited: INTEGER
    Lvis_focused: INTEGER
    Lvis_selected: INTEGER
    valid_lvis_constants (value: INTEGER): BOOLEAN


WEL_LVIS_CONSTANTS Flat contracts

indexing
    description: "List view item styles (LVIS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVIS_CONSTANTS

feature -- Access

    Lvis_cut: INTEGER is 4
            -- The item is marked for a cut and paste operation.
            --
            -- Declared in Windows as LVIS_CUT

    Lvis_drophilited: INTEGER is 8
            -- The item is highlighted as a drag-and-dop target.
            --
            -- Declared in Windows as LVIS_DROPHILITED

    Lvis_focused: INTEGER is 1
            -- The item has the focus.
            --
            -- Declared in Windows as LVIS_FOCUSED

    Lvis_selected: INTEGER is 2
            -- The item is selected.
            --
            -- Declared in Windows as LVIS_SELECTED

feature -- Status report

    valid_lvis_constants (value: INTEGER): BOOLEAN
            -- Is value a valid constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVIS_CONSTANTS


WEL_LVM_CONSTANTS Chart

class
    WEL_LVM_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List view message (LVM) constants."

Ancestors
    ANY

Queries
    Lvm_arrange: INTEGER
    Lvm_createdragimage: INTEGER
    Lvm_deleteallitems: INTEGER
    Lvm_deletecolumn: INTEGER
    Lvm_deleteitem: INTEGER
    Lvm_editlabel: INTEGER
    Lvm_ensurevisible: INTEGER
    Lvm_finditem: INTEGER
    Lvm_getbkcolor: INTEGER
    Lvm_getcallbackmask: INTEGER
    Lvm_getcolumn: INTEGER
    Lvm_getcolumnwidth: INTEGER
    Lvm_getcountperpage: INTEGER
    Lvm_geteditcontrol: INTEGER
    Lvm_getimagelist: INTEGER
    Lvm_getisearchstring: INTEGER
    Lvm_getitem: INTEGER
    Lvm_getitemcount: INTEGER
    Lvm_getitemposition: INTEGER
    Lvm_getitemrect: INTEGER
    Lvm_getitemspacing: INTEGER
    Lvm_getitemstate: INTEGER
    Lvm_getitemtext: INTEGER
    Lvm_getnextitem: INTEGER
    Lvm_getorigin: INTEGER
    Lvm_getselectedcount: INTEGER
    Lvm_getstringwidth: INTEGER
    Lvm_gettextbkcolor: INTEGER
    Lvm_gettextcolor: INTEGER
    Lvm_gettopindex: INTEGER
    Lvm_getviewrect: INTEGER
    Lvm_hittest: INTEGER
    Lvm_insertcolumn: INTEGER
    Lvm_insertitem: INTEGER
    Lvm_redrawitems: INTEGER
    Lvm_scroll: INTEGER
    Lvm_setbkcolor: INTEGER
    Lvm_setcallbackmask: INTEGER
    Lvm_setcolumn: INTEGER
    Lvm_setcolumnwidth: INTEGER
    Lvm_setimagelist: INTEGER
    Lvm_setitem: INTEGER
    Lvm_setitemcount: INTEGER
    Lvm_setitemposition: INTEGER
    Lvm_setitemposition32: INTEGER
    Lvm_setitemstate: INTEGER
    Lvm_setitemtext: INTEGER
    Lvm_settextbkcolor: INTEGER
    Lvm_settextcolor: INTEGER
    Lvm_sortitems: INTEGER
    Lvm_update: INTEGER


WEL_LVM_CONSTANTS Flat contracts

indexing
    description: "List view message (LVM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVM_CONSTANTS

feature -- Access

    Lvm_arrange: INTEGER is 4118
            -- Declared in Windows as LVM_ARRANGE

    Lvm_createdragimage: INTEGER is 4129
            -- Declared in Windows as LVM_CREATEDRAGIMAGE

    Lvm_deleteallitems: INTEGER is 4105
            -- Declared in Windows as LVM_DELETEALLITEMS

    Lvm_deletecolumn: INTEGER is 4124
            -- Declared in Windows as LVM_DELETECOLUMN

    Lvm_deleteitem: INTEGER is 4104
            -- Declared in Windows as LVM_DELETEITEM

    Lvm_editlabel: INTEGER is 4119
            -- Declared in Windows as LVM_EDITLABEL

    Lvm_ensurevisible: INTEGER is 4115
            -- Declared in Windows as LVM_ENSUREVISIBLE

    Lvm_finditem: INTEGER is 4109
            -- Declared in Windows as LVM_FINDITEM

    Lvm_getbkcolor: INTEGER is 4096
            -- Declared in Windows as LVM_GETBKCOLOR

    Lvm_getcallbackmask: INTEGER is 4106
            -- Declared in Windows as LVM_GETCALLBACKMASK

    Lvm_getcolumn: INTEGER is 4121
            -- Declared in Windows as LVM_GETCOLUMN

    Lvm_getcolumnwidth: INTEGER is 4125
            -- Declared in Windows as LVM_GETCOLUMNWIDTH

    Lvm_getcountperpage: INTEGER is 4136
            -- Declared in Windows as LVM_GETCOUNTPERPAGE

    Lvm_geteditcontrol: INTEGER is 4120
            -- Declared in Windows as LVM_GETEDITCONTROL

    Lvm_getimagelist: INTEGER is 4098
            -- Declared in Windows as LVM_GETIMAGELIST

    Lvm_getisearchstring: INTEGER is 4148
            -- Declared in Windows as LVM_GETISEARCHSTRING

    Lvm_getitem: INTEGER is 4101
            -- Declared in Windows as LVM_GETITEM

    Lvm_getitemcount: INTEGER is 4100
            -- Declared in Windows as LVM_GETITEMCOUNT

    Lvm_getitemposition: INTEGER is 4112
            -- Declared in Windows as LVM_GETITEMPOSITION

    Lvm_getitemrect: INTEGER is 4110
            -- Declared in Windows as LVM_GETITEMRECT

    Lvm_getitemspacing: INTEGER is 4147
            -- Declared in Windows as LVM_GETITEMSPACING

    Lvm_getitemstate: INTEGER is 4140
            -- Declared in Windows as LVM_GETITEMSTATE

    Lvm_getitemtext: INTEGER is 4141
            -- Declared in Windows as LVM_GETITEMTEXT

    Lvm_getnextitem: INTEGER is 4108
            -- Declared in Windows as LVM_GETNEXTITEM

    Lvm_getorigin: INTEGER is 4137
            -- Declared in Windows as LVM_GETORIGIN

    Lvm_getselectedcount: INTEGER is 4146
            -- Declared in Windows as LVM_GETSELECTEDCOUNT

    Lvm_getstringwidth: INTEGER is 4113
            -- Declared in Windows as LVM_GETSTRINGWIDTH

    Lvm_gettextbkcolor: INTEGER is 4133
            -- Declared in Windows as LVM_GETTEXTBKCOLOR

    Lvm_gettextcolor: INTEGER is 4131
            -- Declared in Windows as LVM_GETTEXTCOLOR

    Lvm_gettopindex: INTEGER is 4135
            -- Declared in Windows as LVM_GETTOPINDEX

    Lvm_getviewrect: INTEGER is 4130
            -- Declared in Windows as LVM_GETVIEWRECT

    Lvm_hittest: INTEGER is 4114
            -- Declared in Windows as LVM_HITTEST

    Lvm_insertcolumn: INTEGER is 4123
            -- Declared in Windows as LVM_INSERTCOLUMN

    Lvm_insertitem: INTEGER is 4103
            -- Declared in Windows as LVM_INSERTITEM

    Lvm_redrawitems: INTEGER is 4117
            -- Declared in Windows as LVM_REDRAWITEMS

    Lvm_scroll: INTEGER is 4116
            -- Declared in Windows as LVM_SCROLL

    Lvm_setbkcolor: INTEGER is 4097
            -- Declared in Windows as LVM_SETBKCOLOR

    Lvm_setcallbackmask: INTEGER is 4107
            -- Declared in Windows as LVM_SETCALLBACKMASK

    Lvm_setcolumn: INTEGER is 4122
            -- Declared in Windows as LVM_SETCOLUMN

    Lvm_setcolumnwidth: INTEGER is 4126
            -- Declared in Windows as LVM_SETCOLUMNWIDTH

    Lvm_setimagelist: INTEGER is 4099
            -- Declared in Windows as LVM_SETIMAGELIST

    Lvm_setitem: INTEGER is 4102
            -- Declared in Windows as LVM_SETITEM

    Lvm_setitemcount: INTEGER is 4143
            -- Declared in Windows as LVM_SETITEMCOUNT

    Lvm_setitemposition: INTEGER is 4111
            -- Declared in Windows as LVM_SETITEMPOSITION

    Lvm_setitemposition32: INTEGER is 4145
            -- Declared in Windows as LVM_SETITEMPOSITION32

    Lvm_setitemstate: INTEGER is 4139
            -- Declared in Windows as LVM_SETITEMSTATE

    Lvm_setitemtext: INTEGER is 4142
            -- Declared in Windows as LVM_SETITEMTEXT

    Lvm_settextbkcolor: INTEGER is 4134
            -- Declared in Windows as LVM_SETTEXTBKCOLOR

    Lvm_settextcolor: INTEGER is 4132
            -- Declared in Windows as LVM_SETTEXTCOLOR

    Lvm_sortitems: INTEGER is 4144
            -- Declared in Windows as LVM_SORTITEMS

    Lvm_update: INTEGER is 4138
            -- Declared in Windows as LVM_UPDATE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVM_CONSTANTS


WEL_LVNI_CONSTANTS Chart

class
    WEL_LVNI_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List view next item (LVNI) constants."

Ancestors
    ANY

Queries
    Lvni_above: INTEGER
    Lvni_all: INTEGER
    Lvni_below: INTEGER
    Lvni_cut: INTEGER
    Lvni_drophilited: INTEGER
    Lvni_focused: INTEGER
    Lvni_selected: INTEGER
    Lvni_toleft: INTEGER
    Lvni_toright: INTEGER


WEL_LVNI_CONSTANTS Flat contracts

indexing
    description: "List view next item (LVNI) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"
    note: "Used to find items in a list view with the given properties."

class interface
    WEL_LVNI_CONSTANTS

feature -- Geometric relation of the requested item to the
-- specified item.

    Lvni_above: INTEGER is 256
            -- Searches for an item that is above the specified item.
            --
            -- Declared in Windows as LVNI_ABOVE

    Lvni_all: INTEGER is 0
            -- Searches for a subsequent item by index.
            --
            -- Declared in Windows as LVNI_ALL

    Lvni_below: INTEGER is 512
            -- Searches for an item that is below the specified item.
            --
            -- Declared in Windows as LVNI_BELOW

    Lvni_toleft: INTEGER is 1024
            -- Searches for an item to the left of the specified item.
            --
            -- Declared in Windows as LVNI_TOLEFT

    Lvni_toright: INTEGER is 2048
            -- Searches for an item to the right of the specified item.
            --
            -- Declared in Windows as LVNI_TORIGHT

feature -- State of the item

    Lvni_cut: INTEGER is 4
            -- The item has the LVIS_CUT state flag set.
            --
            -- Declared in Windows as LVNI_CUT

    Lvni_drophilited: INTEGER is 8
            -- The item has the LVIS_DROPHILITED state flag set.
            --
            -- Declared in Windows as LVNI_DROPHILITED

    Lvni_focused: INTEGER is 1
            -- The item has the LVIS_FOCUSED state flag set.
            --
            -- Declared in Windows as LVNI_FOCUSED

    Lvni_selected: INTEGER is 2
            -- The item has the LVIS_SELECTED state flag set.
            --
            -- Declared in Windows as LVNI_SELECTED

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVNI_CONSTANTS


WEL_LVN_CONSTANTS Chart

class
    WEL_LVN_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List view selection type constants."

Ancestors
    ANY

Queries
    Lvn_begindrag: INTEGER
    Lvn_beginlabeledit: INTEGER
    Lvn_beginrdrag: INTEGER
    Lvn_columnclick: INTEGER
    Lvn_deleteallitems: INTEGER
    Lvn_deleteitem: INTEGER
    Lvn_endlabeledit: INTEGER
    Lvn_getdispinfo: INTEGER
    Lvn_insertitem: INTEGER
    Lvn_itemchanged: INTEGER
    Lvn_itemchanging: INTEGER
    Lvn_keydown: INTEGER
    Lvn_setdispinfo: INTEGER


WEL_LVN_CONSTANTS Flat contracts

indexing
    description: "List view selection type constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVN_CONSTANTS

feature -- Access

    Lvn_begindrag: INTEGER is -109
            -- Declared in Windows as LVN_BEGINDRAG

    Lvn_beginlabeledit: INTEGER is -105
            -- Declared in Windows as LVN_BEGINLABELEDIT

    Lvn_beginrdrag: INTEGER is -111
            -- Declared in Windows as LVN_BEGINRDRAG

    Lvn_columnclick: INTEGER is -108
            -- Declared in Windows as LVN_COLUMNCLICK

    Lvn_deleteallitems: INTEGER is -104
            -- Declared in Windows as LVN_DELETEALLITEMS

    Lvn_deleteitem: INTEGER is -103
            -- Declared in Windows as LVN_DELETEITEM

    Lvn_endlabeledit: INTEGER is -106
            -- Declared in Windows as LVN_ENDLABELEDIT

    Lvn_getdispinfo: INTEGER is -150
            -- Declared in Windows as LVN_GETDISPINFO

    Lvn_insertitem: INTEGER is -102
            -- Declared in Windows as LVN_INSERTITEM

    Lvn_itemchanged: INTEGER is -101
            -- Declared in Windows as LVN_ITEMCHANGED

    Lvn_itemchanging: INTEGER is -100
            -- Declared in Windows as LVN_ITEMCHANGING

    Lvn_keydown: INTEGER is -155
            -- Declared in Windows as LVN_KEYDOWN

    Lvn_setdispinfo: INTEGER is -151
            -- Declared in Windows as LVN_SETDISPINFO

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVN_CONSTANTS


WEL_LVSIL_CONSTANTS Chart

class
    WEL_LVSIL_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List View State Image List (TVSIL) constants."

Ancestors
    ANY

Queries
    Lvsil_normal: INTEGER
    Lvsil_small: INTEGER
    Lvsil_state: INTEGER


WEL_LVSIL_CONSTANTS Flat contracts

indexing
    description: "List View State Image List (TVSIL) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVSIL_CONSTANTS

feature -- Access

    Lvsil_normal: INTEGER is 0
            -- Indicates the normal image list, which contains
            -- selected, nonselected, and overlay images for the
            -- items of a list view control.
            -- This image list represents the large icons.
            --
            -- Declared in Windows as LVSIL_NORMAL

    Lvsil_small: INTEGER is 1
            -- Indicates the normal image list, which contains
            -- selected, nonselected, and overlay images for the
            -- items of a list view control.
            -- This image list represents the small icons.
            --
            -- Declared in Windows as LVSIL_SMALL

    Lvsil_state: INTEGER is 2
            -- Indicates the state image list. You can use state
            -- images to indicate application-defined item states.
            -- A state image is displayed to the left of an item's
            -- selected or nonselected image.
            --
            -- Declared in Windows as LVSIL_STATE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVSIL_CONSTANTS


WEL_LVS_CONSTANTS Chart

class
    WEL_LVS_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "List view style (LVS) constants."

Ancestors
    ANY

Queries
    Lvs_alignleft: INTEGER
    Lvs_aligntop: INTEGER
    Lvs_autoarrange: INTEGER
    Lvs_editlabels: INTEGER
    Lvs_icon: INTEGER
    Lvs_list: INTEGER
    Lvs_nocolumnheader: INTEGER
    Lvs_nolabelwrap: INTEGER
    Lvs_noscroll: INTEGER
    Lvs_ownerdrawfixed: INTEGER
    Lvs_report: INTEGER
    Lvs_shareimagelists: INTEGER
    Lvs_showselalways: INTEGER
    Lvs_singlesel: INTEGER
    Lvs_smallicon: INTEGER
    Lvs_sortascending: INTEGER
    Lvs_sortdescending: INTEGER


WEL_LVS_CONSTANTS Flat contracts

indexing
    description: "List view style (LVS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVS_CONSTANTS

feature -- Style

    Lvs_alignleft: INTEGER is 2048
            -- Declared in Windows as LVS_ALIGNLEFT

    Lvs_aligntop: INTEGER is 0
            -- Declared in Windows as LVS_ALIGNTOP

    Lvs_autoarrange: INTEGER is 256
            -- Declared in Windows as LVS_AUTOARRANGE

    Lvs_editlabels: INTEGER is 512
            -- Declared in Windows as LVS_EDITLABELS

    Lvs_icon: INTEGER is 0
            -- Declared in Windows as LVS_ICON

    Lvs_list: INTEGER is 3
            -- Declared in Windows as LVS_LIST

    Lvs_nocolumnheader: INTEGER is 16384
            -- Declared in Windows as LVS_NOCOLUMNHEADER

    Lvs_nolabelwrap: INTEGER is 128
            -- Declared in Windows as LVS_NOLABELWRAP

    Lvs_noscroll: INTEGER is 8192
            -- Declared in Windows as LVS_NOSCROLL

    Lvs_ownerdrawfixed: INTEGER is 1024
            -- Declared in Windows as LVS_OWNERDRAWFIXED

    Lvs_report: INTEGER is 1
            -- Declared in Windows as LVS_REPORT

    Lvs_shareimagelists: INTEGER is 64
            -- Declared in Windows as LVS_SHAREIMAGELISTS

    Lvs_showselalways: INTEGER is 8
            -- Declared in Windows as LVS_SHOWSELALWAYS

    Lvs_singlesel: INTEGER is 4
            -- Declared in Windows as LVS_SINGLESEL

    Lvs_smallicon: INTEGER is 2
            -- Declared in Windows as LVS_SMALLICON

    Lvs_sortascending: INTEGER is 16
            -- Declared in Windows as LVS_SORTASCENDING

    Lvs_sortdescending: INTEGER is 32
            -- Declared in Windows as LVS_SORTDESCENDING

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVS_CONSTANTS


WEL_LVS_EX_CONSTANTS Chart

class
    WEL_LVS_EX_CONSTANTS

General
    obsolete: "use WEL_LIST_VIEW_CONSTANTS instead"
    cluster: wel.consts
    description: "Extended list view styles (LVS_EX_...) constants."

Ancestors
    ANY

Queries
    Lvs_ex_checkboxes: INTEGER
    Lvs_ex_flatsb: INTEGER
    Lvs_ex_fullrowselect: INTEGER
    Lvs_ex_gridlines: INTEGER
    Lvs_ex_headerdragdrop: INTEGER
    Lvs_ex_infotip: INTEGER
    Lvs_ex_labeltip: INTEGER
    Lvs_ex_multiworkareas: INTEGER
    Lvs_ex_oneclickactivate: INTEGER
    Lvs_ex_regional: INTEGER
    Lvs_ex_subitemimages: INTEGER
    Lvs_ex_trackselect: INTEGER
    Lvs_ex_twoclickactivate: INTEGER
    Lvs_ex_underlinecold: INTEGER
    Lvs_ex_underlinehot: INTEGER


WEL_LVS_EX_CONSTANTS Flat contracts

indexing
    description: "Extended list view styles (LVS_EX_...) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LVS_EX_CONSTANTS

feature -- Access

    Lvs_ex_checkboxes: INTEGER is 4
            -- Version 4.70.
            -- Enables check boxes for items in a list view
            -- control. Effectively, when set to this style, the control
            -- will create and set a state image list using
            -- DrawFrameControl. Check boxes are visible and functional
            -- with all list view modes. You can obtain the state of the
            -- check box for a given item with ListView_GetCheckState. To
            -- set the check state, use ListView_SetCheckState.

    Lvs_ex_flatsb: INTEGER is 256
            -- Version 4.71.
            -- Enables flat scroll bars in the list view.
            -- If you need more control over the appearance of the list
            -- view's scroll bars, you should manipulate the list view's
            -- scroll bars directly using the Flat Scroll Bar APIs. If
            -- the system metrics change, you are responsible for adjusting
            -- the scrollbar metrics with FlatSB_SetScrollProp. See Flat
            -- Scroll Bars for further details.

    Lvs_ex_fullrowselect: INTEGER is 32
            -- Version 4.70.
            -- When an item is selected, the item and all its subitems are
            -- highlighted. This style is available only in conjunction
            -- with the LVS_REPORT style.

    Lvs_ex_gridlines: INTEGER is 1
            -- Version 4.70. Displays gridlines around items and subitems.
            -- This style is available only in conjunction with the LVS_REPORT
            -- style.

    Lvs_ex_headerdragdrop: INTEGER is 16
            -- Version 4.70. Enables drag-and-drop reordering of columns in
            -- a list view control. This style is only available to list
            -- view controls that use the LVS_REPORT style.

    Lvs_ex_infotip: INTEGER is 1024
            -- Version 4.71. When a list view control uses the
            -- LVS_EX_INFOTIP style, the LVN_GETINFOTIP notification message
            -- is sent to the parent window before displaying an item's
            -- tooltip.

    Lvs_ex_labeltip: INTEGER is 16384
            -- Version 5.80. If a partially hidden label in any list view
            -- mode lacks tooltip text, the list view control will unfold
            -- the label. If this style is not set, the list view control
            -- will unfold partly hidden labels only for the large icon mode.

    Lvs_ex_multiworkareas: INTEGER is 8192
            -- Version 4.71. If the list view control has the LVS_AUTOARRANGE
            -- style, the control will not autoarrange its icons until one or
            -- more work areas are defined (see LVM_SETWORKAREAS). To be
            -- effective, this style must be set before any work areas are
            -- defined and any items have been added to the control.

    Lvs_ex_oneclickactivate: INTEGER is 64
            -- Version 4.70. The list view control sends an LVN_ITEMACTIVATE
            -- notification message to the parent window when the user clicks
            -- an item. This style also enables hot tracking in the list view
            -- control. Hot tracking means that when the cursor moves over an
            -- item, it is highlighted but not selected. See the Remarks for a
            -- discussion of item activation.

    Lvs_ex_regional: INTEGER is 512
            -- Version 4.71. The list view will create a region that includes
            -- only the item icons and text and set its window region to that
            -- using SetWindowRgn. This will exclude any area that is not part
            -- of an item from the window region. This style is only available
            -- to list view controls that use the LVS_ICON style.

    Lvs_ex_subitemimages: INTEGER is 2
            -- Version 4.70. Allows images to be displayed for subitems.
            -- This style is available only in conjunction with the LVS_REPORT
            -- style.

    Lvs_ex_trackselect: INTEGER is 8
            -- Version 4.70. Enables hot-track selection in a list view
            -- control. Hot track selection means that an item is
            -- automatically selected when the cursor remains over the item
            -- for a certain period of time. The delay can be changed from
            -- the default system setting with a LVM_SETHOVERTIME message.
            -- This style applies to all styles of list view control. You
            -- can check whether or not hot-track selection is enabled by
            -- calling SystemParametersInfo.

    Lvs_ex_twoclickactivate: INTEGER is 128
            -- Version 4.70. The list view control sends an LVN_ITEMACTIVATE
            -- notification message to the parent window when the user
            -- double-clicks an item. This style also enables hot tracking
            -- in the list view control. Hot tracking means that when the
            -- cursor moves over an item, it is highlighted but not
            -- selected. See the Remarks for a discussion of item
            -- activation.

    Lvs_ex_underlinecold: INTEGER is 4096
            -- Version 4.71. Causes non-hot items that are activatable to be
            -- displayed with underlined text. This style requires that
            -- LVS_EX_TWOCLICKACTIVATE also be set. See the Remarks for a
            -- discussion of item activation.

    Lvs_ex_underlinehot: INTEGER is 2048
            -- Version 4.71. Causes hot items that are activatable to be
            -- displayed with underlined text. This style requires that
            -- LVS_EX_ONECLICKACTIVATE or LVS_EX_TWOCLICKACTIVATE also be
            -- set. See the Remarks for a discussion of item activation.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LVS_EX_CONSTANTS


WEL_MA_CONSTANTS Chart

class
    WEL_MA_CONSTANTS

General
    cluster: wel.consts
    description: "Mouse Activate (MA) constants."

Ancestors
    ANY

Queries
    Ma_activate: INTEGER
    Ma_activateandeat: INTEGER
    Ma_noactivate: INTEGER
    Ma_noactivateandeat: INTEGER


WEL_MA_CONSTANTS Flat contracts

indexing
    description: "Mouse Activate (MA) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MA_CONSTANTS

feature -- Access

    Ma_activate: INTEGER is 1
            -- Declared in Windows as MA_ACTIVATE

    Ma_activateandeat: INTEGER is 2
            -- Declared in Windows as MA_ACTIVATEANDEAT

    Ma_noactivate: INTEGER is 3
            -- Declared in Windows as MA_NOACTIVATE

    Ma_noactivateandeat: INTEGER is 4
            -- Declared in Windows as MA_NOACTIVATEANDEAT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MA_CONSTANTS


WEL_MB_CONSTANTS Chart

class
    WEL_MB_CONSTANTS

General
    cluster: wel.consts
    description: "MessageBox (MB) constants."

Ancestors
    ANY

Queries
    Mb_abortretryignore: INTEGER
    Mb_applmodal: INTEGER
    Mb_default_desktop_only: INTEGER
    Mb_defbutton1: INTEGER
    Mb_defbutton2: INTEGER
    Mb_defbutton3: INTEGER
    Mb_defmask: INTEGER
    Mb_help: INTEGER
    Mb_iconasterisk: INTEGER
    Mb_iconerror: INTEGER
    Mb_iconexclamation: INTEGER
    Mb_iconhand: INTEGER
    Mb_iconinformation: INTEGER
    Mb_iconmask: INTEGER
    Mb_iconquestion: INTEGER
    Mb_iconstop: INTEGER
    Mb_iconwarning: INTEGER
    Mb_nofocus: INTEGER
    Mb_ok: INTEGER
    Mb_okcancel: INTEGER
    Mb_retrycancel: INTEGER
    Mb_right: INTEGER
    Mb_rtlreading: INTEGER
    Mb_setforeground: INTEGER
    Mb_systemmodal: INTEGER
    Mb_taskmodal: INTEGER
    Mb_topmost: INTEGER
    Mb_typemask: INTEGER
    Mb_usericon: INTEGER
    Mb_yesno: INTEGER
    Mb_yesnocancel: INTEGER


WEL_MB_CONSTANTS Flat contracts

indexing
    description: "MessageBox (MB) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MB_CONSTANTS

feature -- Access

    Mb_abortretryignore: INTEGER is 2

    Mb_applmodal: INTEGER is 0

    Mb_default_desktop_only: INTEGER is 131072

    Mb_defbutton1: INTEGER is 0

    Mb_defbutton2: INTEGER is 256

    Mb_defbutton3: INTEGER is 512

    Mb_defmask: INTEGER is 3840

    Mb_help: INTEGER is 16384

    Mb_iconasterisk: INTEGER is 64

    Mb_iconerror: INTEGER is 16
            -- Same as Mb_iconhand.

    Mb_iconexclamation: INTEGER is 48

    Mb_iconhand: INTEGER is 16

    Mb_iconinformation: INTEGER is 64
            -- Same as Mb_iconasterisk.

    Mb_iconmask: INTEGER is 240

    Mb_iconquestion: INTEGER is 32

    Mb_iconstop: INTEGER is 16
            -- Same as Mb_iconhand.

    Mb_iconwarning: INTEGER is 48
            -- Same as Mb_iconexclamation.

    Mb_nofocus: INTEGER is 32768

    Mb_ok: INTEGER is 0

    Mb_okcancel: INTEGER is 1

    Mb_retrycancel: INTEGER is 5

    Mb_right: INTEGER is 524288

    Mb_rtlreading: INTEGER is 1048576

    Mb_setforeground: INTEGER is 65536

    Mb_systemmodal: INTEGER is 4096

    Mb_taskmodal: INTEGER is 8192

    Mb_topmost: INTEGER is 262144

    Mb_typemask: INTEGER is 15

    Mb_usericon: INTEGER is 128

    Mb_yesno: INTEGER is 4

    Mb_yesnocancel: INTEGER is 3

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MB_CONSTANTS


WEL_MDI_TILE_CONSTANTS Chart

class
    WEL_MDI_TILE_CONSTANTS

General
    cluster: wel.consts
    description: "Multiple Document Interface (MDI) tile constants."

Ancestors
    ANY

Queries
    mditile_horizontal: INTEGER
    mditile_skipdisabled: INTEGER
    mditile_vertical: INTEGER


WEL_MDI_TILE_CONSTANTS Flat contracts

indexing
    description: "Multiple Document Interface (MDI) tile constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MDI_TILE_CONSTANTS

feature -- Access

    mditile_horizontal: INTEGER

    mditile_skipdisabled: INTEGER

    mditile_vertical: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MDI_TILE_CONSTANTS


WEL_MF_CONSTANTS Chart

class
    WEL_MF_CONSTANTS

General
    cluster: wel.consts
    description: "Menu Flags (MF) constants."

Ancestors
    ANY

Queries
    Mf_append: INTEGER
    Mf_bitmap: INTEGER
    Mf_bycommand: INTEGER
    Mf_byposition: INTEGER
    Mf_change: INTEGER
    Mf_checked: INTEGER
    Mf_delete: INTEGER
    Mf_disabled: INTEGER
    Mf_enabled: INTEGER
    Mf_end: INTEGER
    Mf_grayed: INTEGER
    Mf_help: INTEGER
    Mf_hilite: INTEGER
    Mf_insert: INTEGER
    Mf_menubarbreak: INTEGER
    Mf_menubreak: INTEGER
    Mf_mouseselect: INTEGER
    Mf_ownerdraw: INTEGER
    Mf_popup: INTEGER
    Mf_remove: INTEGER
    Mf_separator: INTEGER
    Mf_string: INTEGER
    Mf_sysmenu: INTEGER
    Mf_unchecked: INTEGER
    Mf_unhilite: INTEGER
    Mf_usecheckbitmaps: INTEGER


WEL_MF_CONSTANTS Flat contracts

indexing
    description: "Menu Flags (MF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MF_CONSTANTS

feature -- Access

    Mf_append: INTEGER is 256

    Mf_bitmap: INTEGER is 4

    Mf_bycommand: INTEGER is 0

    Mf_byposition: INTEGER is 1024

    Mf_change: INTEGER is 128

    Mf_checked: INTEGER is 8

    Mf_delete: INTEGER is 512

    Mf_disabled: INTEGER is 2

    Mf_enabled: INTEGER is 0

    Mf_end: INTEGER is 128

    Mf_grayed: INTEGER is 1

    Mf_help: INTEGER is 16384

    Mf_hilite: INTEGER is 128

    Mf_insert: INTEGER is 0

    Mf_menubarbreak: INTEGER is 32

    Mf_menubreak: INTEGER is 64

    Mf_mouseselect: INTEGER is 32768

    Mf_ownerdraw: INTEGER is 256

    Mf_popup: INTEGER is 16

    Mf_remove: INTEGER is 4096

    Mf_separator: INTEGER is 2048

    Mf_string: INTEGER is 0

    Mf_sysmenu: INTEGER is 8192

    Mf_unchecked: INTEGER is 0

    Mf_unhilite: INTEGER is 0

    Mf_usecheckbitmaps: INTEGER is 512

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MF_CONSTANTS


WEL_MK_CONSTANTS Chart

class
    WEL_MK_CONSTANTS

General
    cluster: wel.consts
    description: "Mouse and Key (MK) constants."

Ancestors
    ANY

Queries
    Mk_control: INTEGER
    Mk_lbutton: INTEGER
    Mk_mbutton: INTEGER
    Mk_rbutton: INTEGER
    Mk_shift: INTEGER


WEL_MK_CONSTANTS Flat contracts

indexing
    description: "Mouse and Key (MK) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MK_CONSTANTS

feature -- Access

    Mk_control: INTEGER is 8
            -- Declared in Windows as MK_CONTROL

    Mk_lbutton: INTEGER is 1
            -- Declared in Windows as MK_LBUTTON

    Mk_mbutton: INTEGER is 16
            -- Declared in Windows as MK_MBUTTON

    Mk_rbutton: INTEGER is 2
            -- Declared in Windows as MK_RBUTTON

    Mk_shift: INTEGER is 4
            -- Declared in Windows as MK_SHIFT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MK_CONSTANTS


WEL_MM_CONSTANTS Chart

class
    WEL_MM_CONSTANTS

General
    cluster: wel.consts
    description: "Mapping mode (MM) constants."

Ancestors
    ANY

Queries
    mm_anisotropic: INTEGER
    mm_hienglish: INTEGER
    mm_himetric: INTEGER
    mm_isotropic: INTEGER
    mm_loenglish: INTEGER
    mm_lometric: INTEGER
    mm_text: INTEGER
    mm_twips: INTEGER
    valid_map_mode_constant (c: INTEGER): BOOLEAN


WEL_MM_CONSTANTS Flat contracts

indexing
    description: "Mapping mode (MM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MM_CONSTANTS

feature -- Access

    mm_anisotropic: INTEGER

    mm_hienglish: INTEGER

    mm_himetric: INTEGER

    mm_isotropic: INTEGER

    mm_loenglish: INTEGER

    mm_lometric: INTEGER

    mm_text: INTEGER

    mm_twips: INTEGER

feature -- Status report

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MM_CONSTANTS


WEL_MNC_CONSTANTS Chart

class
    WEL_MNC_CONSTANTS

General
    cluster: wel.consts
    description: "Window constants for WM_MENUCHAR message."

Ancestors
    ANY

Queries
    Mnc_close: INTEGER
    Mnc_execute: INTEGER
    Mnc_ignore: INTEGER
    Mnc_select: INTEGER


WEL_MNC_CONSTANTS Flat contracts

indexing
    description: "Window constants for WM_MENUCHAR message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_MNC_CONSTANTS

feature -- Access

    Mnc_close: INTEGER is 1
            -- Informs the system that it should close the active menu.
            --
            -- Declared in Windows as MNC_CLOSE

    Mnc_execute: INTEGER is 2
            -- Informs the system that it should choose the item specified in
            -- the low-order word of the return value. The owner window
            -- receives a WM_COMMAND message.
            --
            -- Declared in Windows as MNC_EXECUTE

    Mnc_ignore: INTEGER is 0
            -- Informs the system that it should discard the character the user
            -- pressed and create a short beep on the system speaker.
            --
            -- Declared in Windows as MNC_IGNORE

    Mnc_select: INTEGER is 3
            -- Informs the system that it should select the item specified in
            -- the low-order word of the return value.
            --
            -- Declared in Windows as MNC_SELECT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MNC_CONSTANTS


WEL_OCM_CONSTANTS Chart

class
    WEL_OCM_CONSTANTS

General
    cluster: wel.consts
    description: "Reflected Window Message IDs. Defined in OleCtl.h"

Ancestors
    WEL_WM_CONSTANTS
    WEL_WM_CTLCOLOR_CONSTANTS

Queries
    Ocm__base: INTEGER
    Ocm_chartoitem: INTEGER
    Ocm_command: INTEGER
    Ocm_compareitem: INTEGER
    Ocm_ctlcolor: INTEGER
    Ocm_ctlcolorbtn: INTEGER
    Ocm_ctlcolordlg: INTEGER
    Ocm_ctlcoloredit: INTEGER
    Ocm_ctlcolorlistbox: INTEGER
    Ocm_ctlcolormsgbox: INTEGER
    Ocm_ctlcolorscrollbar: INTEGER
    Ocm_ctlcolorstatic: INTEGER
    Ocm_deleteitem: INTEGER
    Ocm_drawitem: INTEGER
    Ocm_hscroll: INTEGER
    Ocm_measureitem: INTEGER
    Ocm_notify: INTEGER
    Ocm_parentnotify: INTEGER
    Ocm_vkeytoitem: INTEGER
    Ocm_vscroll: INTEGER
    Wm_activate: INTEGER
    Wm_activateapp: INTEGER
    Wm_afxfirst: INTEGER
    Wm_afxlast: INTEGER
    Wm_app: INTEGER
    Wm_appcommand: INTEGER
    Wm_askcbformatname: INTEGER
    Wm_canceljournal: INTEGER
    Wm_cancelmode: INTEGER
    Wm_capturechanged: INTEGER
    Wm_changecbchain: INTEGER
    Wm_changeuistate: INTEGER
    Wm_char: INTEGER
    Wm_chartoitem: INTEGER
    Wm_childactivate: INTEGER
    Wm_clear: INTEGER
    Wm_close: INTEGER
    Wm_command: INTEGER
    Wm_commnotify: INTEGER
    Wm_compacting: INTEGER
    Wm_compareitem: INTEGER
    Wm_contextmenu: INTEGER
    Wm_copy: INTEGER
    Wm_copydata: INTEGER
    Wm_create: INTEGER
    Wm_ctlcolor: INTEGER
    Wm_ctlcolorbtn: INTEGER
    Wm_ctlcolordlg: INTEGER
    Wm_ctlcoloredit: INTEGER
    Wm_ctlcolorlistbox: INTEGER
    Wm_ctlcolormsgbox: INTEGER
    Wm_ctlcolorscrollbar: INTEGER
    Wm_ctlcolorstatic: INTEGER
    Wm_cut: INTEGER
    Wm_deadchar: INTEGER
    Wm_deleteitem: INTEGER
    Wm_destroy: INTEGER
    Wm_destroyclipboard: INTEGER
    Wm_devicechange: INTEGER
    Wm_devmodechange: INTEGER
    Wm_displaychange: INTEGER
    Wm_drawclipboard: INTEGER
    Wm_drawitem: INTEGER
    Wm_dropfiles: INTEGER
    Wm_enable: INTEGER
    Wm_endsession: INTEGER
    Wm_enteridle: INTEGER
    Wm_entermenuloop: INTEGER
    Wm_entersizemove: INTEGER
    Wm_erasebkgnd: INTEGER
    Wm_exitmenuloop: INTEGER
    Wm_exitsizemove: INTEGER
    Wm_fontchange: INTEGER
    Wm_getdlgcode: INTEGER
    Wm_getfont: INTEGER
    Wm_gethotkey: INTEGER
    Wm_geticon: INTEGER
    Wm_getminmaxinfo: INTEGER
    Wm_getobject: INTEGER
    Wm_gettext: INTEGER
    Wm_gettextlength: INTEGER
    Wm_handheldfirst: INTEGER
    Wm_handheldlast: INTEGER
    Wm_help: INTEGER
    Wm_hotkey: INTEGER
    Wm_hscroll: INTEGER
    Wm_hscrollclipboard: INTEGER
    Wm_iconerasebkgnd: INTEGER
    Wm_ime_char: INTEGER
    Wm_ime_composition: INTEGER
    Wm_ime_compositionfull: INTEGER
    Wm_ime_control: INTEGER
    Wm_ime_endcomposition: INTEGER
    Wm_ime_keydown: INTEGER
    wm_ime_keylast: INTEGER
    Wm_ime_keyup: INTEGER
    Wm_ime_notify: INTEGER
    Wm_ime_request: INTEGER
    Wm_ime_select: INTEGER
    Wm_ime_setcontext: INTEGER
    Wm_ime_startcomposition: INTEGER
    Wm_initdialog: INTEGER
    Wm_initmenu: INTEGER
    Wm_initmenupopup: INTEGER
    Wm_inputlangchange: INTEGER
    Wm_inputlangchangerequest: INTEGER
    Wm_keydown: INTEGER
    Wm_keyfirst: INTEGER
    wm_keylast: INTEGER
    Wm_keyup: INTEGER
    Wm_killfocus: INTEGER
    Wm_lbuttondblclk: INTEGER
    Wm_lbuttondown: INTEGER
    Wm_lbuttonup: INTEGER
    Wm_mbuttondblclk: INTEGER
    Wm_mbuttondown: INTEGER
    Wm_mbuttonup: INTEGER
    Wm_mdiactivate: INTEGER
    Wm_mdicascade: INTEGER
    Wm_mdicreate: INTEGER
    Wm_mdidestroy: INTEGER
    Wm_mdigetactive: INTEGER
    Wm_mdiiconarrange: INTEGER
    Wm_mdimaximize: INTEGER
    Wm_mdinext: INTEGER
    Wm_mdirefreshmenu: INTEGER
    Wm_mdirestore: INTEGER
    Wm_mdisetmenu: INTEGER
    Wm_mditile: INTEGER
    Wm_measureitem: INTEGER
    Wm_menuchar: INTEGER
    Wm_menucommand: INTEGER
    Wm_menudrag: INTEGER
    Wm_menugetobject: INTEGER
    Wm_menurbuttonup: INTEGER
    Wm_menuselect: INTEGER
    Wm_mouseactivate: INTEGER
    Wm_mousefirst: INTEGER
    Wm_mousehover: INTEGER
    wm_mouselast: INTEGER
    Wm_mouseleave: INTEGER
    Wm_mousemove: INTEGER
    Wm_mousewheel: INTEGER
    Wm_move: INTEGER
    Wm_moving: INTEGER
    Wm_ncactivate: INTEGER
    Wm_nccalcsize: INTEGER
    Wm_nccreate: INTEGER
    Wm_ncdestroy: INTEGER
    Wm_nchittest: INTEGER
    Wm_nclbuttondblclk: INTEGER
    Wm_nclbuttondown: INTEGER
    Wm_nclbuttonup: INTEGER
    Wm_ncmbuttondblclk: INTEGER
    Wm_ncmbuttondown: INTEGER
    Wm_ncmbuttonup: INTEGER
    Wm_ncmousehover: INTEGER
    Wm_ncmouseleave: INTEGER
    Wm_ncmousemove: INTEGER
    Wm_ncpaint: INTEGER
    Wm_ncrbuttondblclk: INTEGER
    Wm_ncrbuttondown: INTEGER
    Wm_ncrbuttonup: INTEGER
    Wm_ncxbuttondblclk: INTEGER
    Wm_ncxbuttondown: INTEGER
    Wm_ncxbuttonup: INTEGER
    Wm_nextdlgctl: INTEGER
    Wm_nextmenu: INTEGER
    Wm_notify: INTEGER
    Wm_notifyformat: INTEGER
    Wm_null: INTEGER
    Wm_paint: INTEGER
    Wm_paintclipboard: INTEGER
    Wm_painticon: INTEGER
    Wm_palettechanged: INTEGER
    Wm_paletteischanging: INTEGER
    Wm_parentnotify: INTEGER
    Wm_paste: INTEGER
    Wm_penwinfirst: INTEGER
    Wm_penwinlast: INTEGER
    Wm_power: INTEGER
    Wm_powerbroadcast: INTEGER
    Wm_print: INTEGER
    Wm_printclient: INTEGER
    Wm_querydragicon: INTEGER
    Wm_queryendsession: INTEGER
    Wm_querynewpalette: INTEGER
    Wm_queryopen: INTEGER
    Wm_queryuistate: INTEGER
    Wm_queuesync: INTEGER
    Wm_quit: INTEGER
    Wm_rbuttondblclk: INTEGER
    Wm_rbuttondown: INTEGER
    Wm_rbuttonup: INTEGER
    Wm_renderallformats: INTEGER
    Wm_renderformat: INTEGER
    Wm_setcursor: INTEGER
    Wm_setfocus: INTEGER
    Wm_setfont: INTEGER
    Wm_sethotkey: INTEGER
    Wm_seticon: INTEGER
    Wm_setredraw: INTEGER
    Wm_settext: INTEGER
    Wm_settingchange: INTEGER
    Wm_showwindow: INTEGER
    Wm_size: INTEGER
    Wm_sizeclipboard: INTEGER
    Wm_sizing: INTEGER
    Wm_spoolerstatus: INTEGER
    Wm_stylechanged: INTEGER
    Wm_stylechanging: INTEGER
    Wm_syncpaint: INTEGER
    Wm_syschar: INTEGER
    Wm_syscolorchange: INTEGER
    Wm_syscommand: INTEGER
    Wm_sysdeadchar: INTEGER
    Wm_syskeydown: INTEGER
    Wm_syskeyup: INTEGER
    Wm_tcard: INTEGER
    Wm_timechange: INTEGER
    Wm_timer: INTEGER
    Wm_undo: INTEGER
    Wm_uninitmenupopup: INTEGER
    Wm_updateuistate: INTEGER
    Wm_user: INTEGER
    Wm_userchanged: INTEGER
    Wm_vkeytoitem: INTEGER
    Wm_vscroll: INTEGER
    Wm_vscrollclipboard: INTEGER
    Wm_windowposchanged: INTEGER
    Wm_windowposchanging: INTEGER
    Wm_wininichange: INTEGER
    Wm_xbuttondblclk: INTEGER
    Wm_xbuttondown: INTEGER
    Wm_xbuttonup: INTEGER


WEL_OCM_CONSTANTS Flat contracts

indexing
    description: "Reflected Window Message IDs. Defined in OleCtl.h"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_OCM_CONSTANTS

feature -- Access

    ocm__base: INTEGER
            -- Declared in Windows as OCM__BASE.

    ocm_chartoitem: INTEGER
            -- Declared in Windows as OCM_CHARTOITEM.

    ocm_command: INTEGER
            -- Declared in Windows as OCM_COMMAND.

    ocm_compareitem: INTEGER
            -- Declared in Windows as OCM_COMPAREITEM.

    ocm_ctlcolor: INTEGER
            -- Declared in Windows as OCM_CTLCOLOR.

    ocm_ctlcolorbtn: INTEGER
            -- Declared in Windows as OCM_CTLCOLORBTN.

    ocm_ctlcolordlg: INTEGER
            -- Declared in Windows as OCM_CTLCOLORDLG.

    ocm_ctlcoloredit: INTEGER
            -- Declared in Windows as OCM_CTLCOLOREDIT.

    ocm_ctlcolorlistbox: INTEGER
            -- Declared in Windows as OCM_CTLCOLORLISTBOX.

    ocm_ctlcolormsgbox: INTEGER
            -- Declared in Windows as OCM_CTLCOLORMSGBOX.

    ocm_ctlcolorscrollbar: INTEGER
            -- Declared in Windows as OCM_CTLCOLORSCROLLBAR.

    ocm_ctlcolorstatic: INTEGER
            -- Declared in Windows as OCM_CTLCOLORSTATIC.

    ocm_deleteitem: INTEGER
            -- Declared in Windows as OCM_DELETEITEM.

    ocm_drawitem: INTEGER
            -- Declared in Windows as OCM_DRAWITEM.

    ocm_hscroll: INTEGER
            -- Declared in Windows as OCM_HSCROLL.

    ocm_measureitem: INTEGER
            -- Declared in Windows as OCM_MEASUREITEM.

    ocm_notify: INTEGER
            -- Declared in Windows as OCM_NOTIFY.

    ocm_parentnotify: INTEGER
            -- Declared in Windows as OCM_PARENTNOTIFY.

    ocm_vkeytoitem: INTEGER
            -- Declared in Windows as OCM_VKEYTOITEM.

    ocm_vscroll: INTEGER
            -- Declared in Windows as OCM_VSCROLL.

    Wm_activate: INTEGER is 6
            -- Declared in Windows as WM_ACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_activateapp: INTEGER is 28
            -- Declared in Windows as WM_ACTIVATEAPP
            -- (from WEL_WM_CONSTANTS)

    Wm_afxfirst: INTEGER is 864
            -- Declared in Windows as WM_AFXFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_afxlast: INTEGER is 895
            -- Declared in Windows as WM_AFXLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_app: INTEGER is 32768
            -- Declared in Windows as WM_APP
            -- (from WEL_WM_CONSTANTS)

    Wm_appcommand: INTEGER is 793
            -- Declared in Windows as WM_APPCOMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_askcbformatname: INTEGER is 780
            -- Declared in Windows as WM_ASKCBFORMATNAME
            -- (from WEL_WM_CONSTANTS)

    Wm_canceljournal: INTEGER is 75
            -- Declared in Windows as WM_CANCELJOURNAL
            -- (from WEL_WM_CONSTANTS)

    Wm_cancelmode: INTEGER is 31
            -- Declared in Windows as WM_CANCELMODE
            -- (from WEL_WM_CONSTANTS)

    Wm_capturechanged: INTEGER is 533
            -- Declared in Windows as WM_CAPTURECHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_changecbchain: INTEGER is 781
            -- Declared in Windows as WM_CHANGECBCHAIN
            -- (from WEL_WM_CONSTANTS)

    Wm_changeuistate: INTEGER is 295
            -- Declared in Windows as WM_CHANGEUISTATE
            -- (from WEL_WM_CONSTANTS)

    Wm_char: INTEGER is 258
            -- Declared in Windows as WM_CHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_chartoitem: INTEGER is 47
            -- Declared in Windows as WM_CHARTOITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_childactivate: INTEGER is 34
            -- Declared in Windows as WM_CHILDACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_clear: INTEGER is 771
            -- Declared in Windows as WM_CLEAR
            -- (from WEL_WM_CONSTANTS)

    Wm_close: INTEGER is 16
            -- Declared in Windows as WM_CLOSE
            -- (from WEL_WM_CONSTANTS)

    Wm_command: INTEGER is 273
            -- Declared in Windows as WM_COMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_commnotify: INTEGER is 68
            -- Declared in Windows as WM_COMMNOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_compacting: INTEGER is 65
            -- Declared in Windows as WM_COMPACTING
            -- (from WEL_WM_CONSTANTS)

    Wm_compareitem: INTEGER is 57
            -- Declared in Windows as WM_COMPAREITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_contextmenu: INTEGER is 123
            -- Declared in Windows as WM_CONTEXTMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_copy: INTEGER is 769
            -- Declared in Windows as WM_COPY
            -- (from WEL_WM_CONSTANTS)

    Wm_copydata: INTEGER is 74
            -- Declared in Windows as WM_COPYDATA
            -- (from WEL_WM_CONSTANTS)

    Wm_create: INTEGER is 1
            -- Declared in Windows as WM_CREATE
            -- (from WEL_WM_CONSTANTS)

    Wm_ctlcolor: INTEGER is 25
            -- Declared in Windows as WM_CTLCOLOR
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_ctlcolorbtn: INTEGER is 309
            -- Declared in Windows as WM_CTLCOLORBTN
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_ctlcolordlg: INTEGER is 310
            -- Declared in Windows as WM_CTLCOLORDLG
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_ctlcoloredit: INTEGER is 307
            -- Declared in Windows as WM_CTLCOLOREDIT
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_ctlcolorlistbox: INTEGER is 308
            -- Declared in Windows as WM_CTLCOLORLISTBOX
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_ctlcolormsgbox: INTEGER is 306
            -- Declared in Windows as WM_CTLCOLORMSGBOX
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_ctlcolorscrollbar: INTEGER is 311
            -- Declared in Windows as WM_CTLCOLORSCROLLBAR
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_ctlcolorstatic: INTEGER is 312
            -- Declared in Windows as WM_CTLCOLORSTATIC
            -- (from WEL_WM_CTLCOLOR_CONSTANTS)

    Wm_cut: INTEGER is 768
            -- Declared in Windows as WM_CUT
            -- (from WEL_WM_CONSTANTS)

    Wm_deadchar: INTEGER is 259
            -- Declared in Windows as WM_DEADCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_deleteitem: INTEGER is 45
            -- Declared in Windows as WM_DELETEITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_destroy: INTEGER is 2
            -- Declared in Windows as WM_DESTROY
            -- (from WEL_WM_CONSTANTS)

    Wm_destroyclipboard: INTEGER is 775
            -- Declared in Windows as WM_DESTROYCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_devicechange: INTEGER is 537
            -- Declared in Windows as WM_DEVICECHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_devmodechange: INTEGER is 27
            -- Declared in Windows as WM_DEVMODECHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_displaychange: INTEGER is 126
            -- Declared in Windows as WM_DISPLAYCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_drawclipboard: INTEGER is 776
            -- Declared in Windows as WM_DRAWCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_drawitem: INTEGER is 43
            -- Declared in Windows as WM_DRAWITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_dropfiles: INTEGER is 563
            -- Declared in Windows as WM_DROPFILES
            -- (from WEL_WM_CONSTANTS)

    Wm_enable: INTEGER is 10
            -- Declared in Windows as WM_ENABLE
            -- (from WEL_WM_CONSTANTS)

    Wm_endsession: INTEGER is 22
            -- Declared in Windows as WM_ENDSESSION
            -- (from WEL_WM_CONSTANTS)

    Wm_enteridle: INTEGER is 289
            -- Declared in Windows as WM_ENTERIDLE
            -- (from WEL_WM_CONSTANTS)

    Wm_entermenuloop: INTEGER is 529
            -- Declared in Windows as WM_ENTERMENULOOP
            -- (from WEL_WM_CONSTANTS)

    Wm_entersizemove: INTEGER is 561
            -- Declared in Windows as WM_ENTERSIZEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_erasebkgnd: INTEGER is 20
            -- Declared in Windows as WM_ERASEBKGND
            -- (from WEL_WM_CONSTANTS)

    Wm_exitmenuloop: INTEGER is 530
            -- Declared in Windows as WM_EXITMENULOOP
            -- (from WEL_WM_CONSTANTS)

    Wm_exitsizemove: INTEGER is 562
            -- Declared in Windows as WM_EXITSIZEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_fontchange: INTEGER is 29
            -- Declared in Windows as WM_FONTCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_getdlgcode: INTEGER is 135
            -- Declared in Windows as WM_GETDLGCODE
            -- (from WEL_WM_CONSTANTS)

    Wm_getfont: INTEGER is 49
            -- Declared in Windows as WM_GETFONT
            -- (from WEL_WM_CONSTANTS)

    Wm_gethotkey: INTEGER is 51
            -- Declared in Windows as WM_GETHOTKEY
            -- (from WEL_WM_CONSTANTS)

    Wm_geticon: INTEGER is 127
            -- Declared in Windows as WM_GETICON
            -- (from WEL_WM_CONSTANTS)

    Wm_getminmaxinfo: INTEGER is 36
            -- Declared in Windows as WM_GETMINMAXINFO
            -- (from WEL_WM_CONSTANTS)

    Wm_getobject: INTEGER is 61
            -- Declared in Windows as WM_GETOBJECT
            -- (from WEL_WM_CONSTANTS)

    Wm_gettext: INTEGER is 13
            -- Declared in Windows as WM_GETTEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_gettextlength: INTEGER is 14
            -- Declared in Windows as WM_GETTEXTLENGTH
            -- (from WEL_WM_CONSTANTS)

    Wm_handheldfirst: INTEGER is 856
            -- Declared in Windows as WM_HANDHELDFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_handheldlast: INTEGER is 863
            -- Declared in Windows as WM_HANDHELDLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_help: INTEGER is 83
            -- Declared in Windows as WM_HELP
            -- (from WEL_WM_CONSTANTS)

    Wm_hotkey: INTEGER is 786
            -- Declared in Windows as WM_HOTKEY
            -- (from WEL_WM_CONSTANTS)

    Wm_hscroll: INTEGER is 276
            -- Declared in Windows as WM_HSCROLL
            -- (from WEL_WM_CONSTANTS)

    Wm_hscrollclipboard: INTEGER is 782
            -- Declared in Windows as WM_HSCROLLCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_iconerasebkgnd: INTEGER is 39
            -- Declared in Windows as WM_ICONERASEBKGND
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_char: INTEGER is 646
            -- Declared in Windows as WM_IME_CHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_composition: INTEGER is 271
            -- Declared in Windows as WM_IME_COMPOSITION
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_compositionfull: INTEGER is 644
            -- Declared in Windows as WM_IME_COMPOSITIONFULL
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_control: INTEGER is 643
            -- Declared in Windows as WM_IME_CONTROL
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_endcomposition: INTEGER is 270
            -- Declared in Windows as WM_IME_ENDCOMPOSITION
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_keydown: INTEGER is 656
            -- Declared in Windows as WM_IME_KEYDOWN
            -- (from WEL_WM_CONSTANTS)

    wm_ime_keylast: INTEGER
            -- Declared in Windows as WM_IME_KEYLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_keyup: INTEGER is 657
            -- Declared in Windows as WM_IME_KEYUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_notify: INTEGER is 642
            -- Declared in Windows as WM_IME_NOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_request: INTEGER is 648
            -- Declared in Windows as WM_IME_REQUEST
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_select: INTEGER is 645
            -- Declared in Windows as WM_IME_SELECT
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_setcontext: INTEGER is 641
            -- Declared in Windows as WM_IME_SETCONTEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_ime_startcomposition: INTEGER is 269
            -- Declared in Windows as WM_IME_STARTCOMPOSITION
            -- (from WEL_WM_CONSTANTS)

    Wm_initdialog: INTEGER is 272
            -- Declared in Windows as WM_INITDIALOG
            -- (from WEL_WM_CONSTANTS)

    Wm_initmenu: INTEGER is 278
            -- Declared in Windows as WM_INITMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_initmenupopup: INTEGER is 279
            -- Declared in Windows as WM_INITMENUPOPUP
            -- (from WEL_WM_CONSTANTS)

    Wm_inputlangchange: INTEGER is 81
            -- Declared in Windows as WM_INPUTLANGCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_inputlangchangerequest: INTEGER is 80
            -- Declared in Windows as WM_INPUTLANGCHANGEREQUEST
            -- (from WEL_WM_CONSTANTS)

    Wm_keydown: INTEGER is 256
            -- Declared in Windows as WM_KEYDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_keyfirst: INTEGER is 256
            -- Declared in Windows as WM_KEYFIRST
            -- (from WEL_WM_CONSTANTS)

    wm_keylast: INTEGER
            -- Declared in Windows as WM_KEYLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_keyup: INTEGER is 257
            -- Declared in Windows as WM_KEYUP
            -- (from WEL_WM_CONSTANTS)

    Wm_killfocus: INTEGER is 8
            -- Declared in Windows as WM_KILLFOCUS
            -- (from WEL_WM_CONSTANTS)

    Wm_lbuttondblclk: INTEGER is 515
            -- Declared in Windows as WM_LBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_lbuttondown: INTEGER is 513
            -- Declared in Windows as WM_LBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_lbuttonup: INTEGER is 514
            -- Declared in Windows as WM_LBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_mbuttondblclk: INTEGER is 521
            -- Declared in Windows as WM_MBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_mbuttondown: INTEGER is 519
            -- Declared in Windows as WM_MBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_mbuttonup: INTEGER is 520
            -- Declared in Windows as WM_MBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_mdiactivate: INTEGER is 546
            -- Declared in Windows as WM_MDIACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdicascade: INTEGER is 551
            -- Declared in Windows as WM_MDICASCADE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdicreate: INTEGER is 544
            -- Declared in Windows as WM_MDICREATE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdidestroy: INTEGER is 545
            -- Declared in Windows as WM_MDIDESTROY
            -- (from WEL_WM_CONSTANTS)

    Wm_mdigetactive: INTEGER is 553
            -- Declared in Windows as WM_MDIGETACTIVE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdiiconarrange: INTEGER is 552
            -- Declared in Windows as WM_MDIICONARRANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdimaximize: INTEGER is 549
            -- Declared in Windows as WM_MDIMAXIMIZE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdinext: INTEGER is 548
            -- Declared in Windows as WM_MDINEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_mdirefreshmenu: INTEGER is 564
            -- Declared in Windows as WM_MDIREFRESHMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_mdirestore: INTEGER is 547
            -- Declared in Windows as WM_MDIRESTORE
            -- (from WEL_WM_CONSTANTS)

    Wm_mdisetmenu: INTEGER is 560
            -- Declared in Windows as WM_MDISETMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_mditile: INTEGER is 550
            -- Declared in Windows as WM_MDITILE
            -- (from WEL_WM_CONSTANTS)

    Wm_measureitem: INTEGER is 44
            -- Declared in Windows as WM_MEASUREITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_menuchar: INTEGER is 288
            -- Declared in Windows as WM_MENUCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_menucommand: INTEGER is 294
            -- Declared in Windows as WM_MENUCOMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_menudrag: INTEGER is 291
            -- Declared in Windows as WM_MENUDRAG
            -- (from WEL_WM_CONSTANTS)

    Wm_menugetobject: INTEGER is 292
            -- Declared in Windows as WM_MENUGETOBJECT
            -- (from WEL_WM_CONSTANTS)

    Wm_menurbuttonup: INTEGER is 290
            -- Declared in Windows as WM_MENURBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_menuselect: INTEGER is 287
            -- Declared in Windows as WM_MENUSELECT
            -- (from WEL_WM_CONSTANTS)

    Wm_mouseactivate: INTEGER is 33
            -- Declared in Windows as WM_MOUSEACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_mousefirst: INTEGER is 512
            -- Declared in Windows as WM_MOUSEFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_mousehover: INTEGER is 673
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSEHOVER
            -- (from WEL_WM_CONSTANTS)

    wm_mouselast: INTEGER
            -- Declared in Windows as WM_MOUSELAST
            -- (from WEL_WM_CONSTANTS)

    Wm_mouseleave: INTEGER is 675
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSELEAVE
            -- (from WEL_WM_CONSTANTS)

    Wm_mousemove: INTEGER is 512
            -- Declared in Windows as WM_MOUSEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_mousewheel: INTEGER is 522
            -- Declared in Windows as WM_MOUSEWHEEL
            -- (from WEL_WM_CONSTANTS)

    Wm_move: INTEGER is 3
            -- Declared in Windows as WM_MOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_moving: INTEGER is 534
            -- Declared in Windows as WM_MOVING
            -- (from WEL_WM_CONSTANTS)

    Wm_ncactivate: INTEGER is 134
            -- Declared in Windows as WM_NCACTIVATE
            -- (from WEL_WM_CONSTANTS)

    Wm_nccalcsize: INTEGER is 131
            -- Declared in Windows as WM_NCCALCSIZE
            -- (from WEL_WM_CONSTANTS)

    Wm_nccreate: INTEGER is 129
            -- Declared in Windows as WM_NCCREATE
            -- (from WEL_WM_CONSTANTS)

    Wm_ncdestroy: INTEGER is 130
            -- Declared in Windows as WM_NCDESTROY
            -- (from WEL_WM_CONSTANTS)

    Wm_nchittest: INTEGER is 132
            -- Declared in Windows as WM_NCHITTEST
            -- (from WEL_WM_CONSTANTS)

    Wm_nclbuttondblclk: INTEGER is 163
            -- Declared in Windows as WM_NCLBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_nclbuttondown: INTEGER is 161
            -- Declared in Windows as WM_NCLBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_nclbuttonup: INTEGER is 162
            -- Declared in Windows as WM_NCLBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmbuttondblclk: INTEGER is 169
            -- Declared in Windows as WM_NCMBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmbuttondown: INTEGER is 167
            -- Declared in Windows as WM_NCMBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmbuttonup: INTEGER is 168
            -- Declared in Windows as WM_NCMBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmousehover: INTEGER is 672
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSEHOVER
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmouseleave: INTEGER is 674
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSELEAVE
            -- (from WEL_WM_CONSTANTS)

    Wm_ncmousemove: INTEGER is 160
            -- Declared in Windows as WM_NCMOUSEMOVE
            -- (from WEL_WM_CONSTANTS)

    Wm_ncpaint: INTEGER is 133
            -- Declared in Windows as WM_NCPAINT
            -- (from WEL_WM_CONSTANTS)

    Wm_ncrbuttondblclk: INTEGER is 166
            -- Declared in Windows as WM_NCRBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_ncrbuttondown: INTEGER is 164
            -- Declared in Windows as WM_NCRBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_ncrbuttonup: INTEGER is 165
            -- Declared in Windows as WM_NCRBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_ncxbuttondblclk: INTEGER is 173
            -- Declared in Windows as WM_NCXBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_ncxbuttondown: INTEGER is 171
            -- Declared in Windows as WM_NCXBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_ncxbuttonup: INTEGER is 172
            -- Declared in Windows as WM_NCXBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_nextdlgctl: INTEGER is 40
            -- Declared in Windows as WM_NEXTDLGCTL
            -- (from WEL_WM_CONSTANTS)

    Wm_nextmenu: INTEGER is 531
            -- Declared in Windows as WM_NEXTMENU
            -- (from WEL_WM_CONSTANTS)

    Wm_notify: INTEGER is 78
            -- Declared in Windows as WM_NOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_notifyformat: INTEGER is 85
            -- Declared in Windows as WM_NOTIFYFORMAT
            -- (from WEL_WM_CONSTANTS)

    Wm_null: INTEGER is 0
            -- Declared in Windows as WM_NULL
            -- (from WEL_WM_CONSTANTS)

    Wm_paint: INTEGER is 15
            -- Declared in Windows as WM_PAINT
            -- (from WEL_WM_CONSTANTS)

    Wm_paintclipboard: INTEGER is 777
            -- Declared in Windows as WM_PAINTCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_painticon: INTEGER is 38
            -- Declared in Windows as WM_PAINTICON
            -- (from WEL_WM_CONSTANTS)

    Wm_palettechanged: INTEGER is 785
            -- Declared in Windows as WM_PALETTECHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_paletteischanging: INTEGER is 784
            -- Declared in Windows as WM_PALETTEISCHANGING
            -- (from WEL_WM_CONSTANTS)

    Wm_parentnotify: INTEGER is 528
            -- Declared in Windows as WM_PARENTNOTIFY
            -- (from WEL_WM_CONSTANTS)

    Wm_paste: INTEGER is 770
            -- Declared in Windows as WM_PASTE
            -- (from WEL_WM_CONSTANTS)

    Wm_penwinfirst: INTEGER is 896
            -- Declared in Windows as WM_PENWINFIRST
            -- (from WEL_WM_CONSTANTS)

    Wm_penwinlast: INTEGER is 911
            -- Declared in Windows as WM_PENWINLAST
            -- (from WEL_WM_CONSTANTS)

    Wm_power: INTEGER is 72
            -- Declared in Windows as WM_POWER
            -- (from WEL_WM_CONSTANTS)

    Wm_powerbroadcast: INTEGER is 536
            -- Declared in Windows as WM_POWERBROADCAST
            -- (from WEL_WM_CONSTANTS)

    Wm_print: INTEGER is 791
            -- Declared in Windows as WM_PRINT
            -- (from WEL_WM_CONSTANTS)

    Wm_printclient: INTEGER is 792
            -- Declared in Windows as WM_PRINTCLIENT
            -- (from WEL_WM_CONSTANTS)

    Wm_querydragicon: INTEGER is 55
            -- Declared in Windows as WM_QUERYDRAGICON
            -- (from WEL_WM_CONSTANTS)

    Wm_queryendsession: INTEGER is 17
            -- Declared in Windows as WM_QUERYENDSESSION
            -- (from WEL_WM_CONSTANTS)

    Wm_querynewpalette: INTEGER is 783
            -- Declared in Windows as WM_QUERYNEWPALETTE
            -- (from WEL_WM_CONSTANTS)

    Wm_queryopen: INTEGER is 19
            -- Declared in Windows as WM_QUERYOPEN
            -- (from WEL_WM_CONSTANTS)

    Wm_queryuistate: INTEGER is 297
            -- Declared in Windows as WM_QUERYUISTATE
            -- (from WEL_WM_CONSTANTS)

    Wm_queuesync: INTEGER is 35
            -- Declared in Windows as WM_QUEUESYNC
            -- (from WEL_WM_CONSTANTS)

    Wm_quit: INTEGER is 18
            -- Declared in Windows as WM_QUIT
            -- (from WEL_WM_CONSTANTS)

    Wm_rbuttondblclk: INTEGER is 518
            -- Declared in Windows as WM_RBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_rbuttondown: INTEGER is 516
            -- Declared in Windows as WM_RBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_rbuttonup: INTEGER is 517
            -- Declared in Windows as WM_RBUTTONUP
            -- (from WEL_WM_CONSTANTS)

    Wm_renderallformats: INTEGER is 774
            -- Declared in Windows as WM_RENDERALLFORMATS
            -- (from WEL_WM_CONSTANTS)

    Wm_renderformat: INTEGER is 773
            -- Declared in Windows as WM_RENDERFORMAT
            -- (from WEL_WM_CONSTANTS)

    Wm_setcursor: INTEGER is 32
            -- Declared in Windows as WM_SETCURSOR
            -- (from WEL_WM_CONSTANTS)

    Wm_setfocus: INTEGER is 7
            -- Declared in Windows as WM_SETFOCUS
            -- (from WEL_WM_CONSTANTS)

    Wm_setfont: INTEGER is 48
            -- Declared in Windows as WM_SETFONT
            -- (from WEL_WM_CONSTANTS)

    Wm_sethotkey: INTEGER is 50
            -- Declared in Windows as WM_SETHOTKEY
            -- (from WEL_WM_CONSTANTS)

    Wm_seticon: INTEGER is 128
            -- Declared in Windows as WM_SETICON
            -- (from WEL_WM_CONSTANTS)

    Wm_setredraw: INTEGER is 11
            -- Declared in Windows as WM_SETREDRAW
            -- (from WEL_WM_CONSTANTS)

    Wm_settext: INTEGER is 12
            -- Declared in Windows as WM_SETTEXT
            -- (from WEL_WM_CONSTANTS)

    Wm_settingchange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WM_CONSTANTS as synonym of wm_wininichange.
            -- (from WEL_WM_CONSTANTS)

    Wm_showwindow: INTEGER is 24
            -- Declared in Windows as WM_SHOWWINDOW
            -- (from WEL_WM_CONSTANTS)

    Wm_size: INTEGER is 5
            -- Declared in Windows as WM_SIZE
            -- (from WEL_WM_CONSTANTS)

    Wm_sizeclipboard: INTEGER is 779
            -- Declared in Windows as WM_SIZECLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_sizing: INTEGER is 532
            -- Declared in Windows as WM_SIZING
            -- (from WEL_WM_CONSTANTS)

    Wm_spoolerstatus: INTEGER is 42
            -- Declared in Windows as WM_SPOOLERSTATUS
            -- (from WEL_WM_CONSTANTS)

    Wm_stylechanged: INTEGER is 125
            -- Declared in Windows as WM_STYLECHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_stylechanging: INTEGER is 124
            -- Declared in Windows as WM_STYLECHANGING
            -- (from WEL_WM_CONSTANTS)

    Wm_syncpaint: INTEGER is 136
            -- Declared in Windows as WM_SYNCPAINT
            -- (from WEL_WM_CONSTANTS)

    Wm_syschar: INTEGER is 262
            -- Declared in Windows as WM_SYSCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_syscolorchange: INTEGER is 21
            -- Declared in Windows as WM_SYSCOLORCHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_syscommand: INTEGER is 274
            -- Declared in Windows as WM_SYSCOMMAND
            -- (from WEL_WM_CONSTANTS)

    Wm_sysdeadchar: INTEGER is 263
            -- Declared in Windows as WM_SYSDEADCHAR
            -- (from WEL_WM_CONSTANTS)

    Wm_syskeydown: INTEGER is 260
            -- Declared in Windows as WM_SYSKEYDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_syskeyup: INTEGER is 261
            -- Declared in Windows as WM_SYSKEYUP
            -- (from WEL_WM_CONSTANTS)

    Wm_tcard: INTEGER is 82
            -- Declared in Windows as WM_TCARD
            -- (from WEL_WM_CONSTANTS)

    Wm_timechange: INTEGER is 30
            -- Declared in Windows as WM_TIMECHANGE
            -- (from WEL_WM_CONSTANTS)

    Wm_timer: INTEGER is 275
            -- Declared in Windows as WM_TIMER
            -- (from WEL_WM_CONSTANTS)

    Wm_undo: INTEGER is 772
            -- Declared in Windows as WM_UNDO
            -- (from WEL_WM_CONSTANTS)

    Wm_uninitmenupopup: INTEGER is 293
            -- Declared in Windows as WM_UNINITMENUPOPUP
            -- (from WEL_WM_CONSTANTS)

    Wm_updateuistate: INTEGER is 296
            -- Declared in Windows as WM_UPDATEUISTATE
            -- (from WEL_WM_CONSTANTS)

    Wm_user: INTEGER is 1024
            -- Declared in Windows as WM_USER
            -- (from WEL_WM_CONSTANTS)

    Wm_userchanged: INTEGER is 84
            -- Declared in Windows as WM_USERCHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_vkeytoitem: INTEGER is 46
            -- Declared in Windows as WM_VKEYTOITEM
            -- (from WEL_WM_CONSTANTS)

    Wm_vscroll: INTEGER is 277
            -- Declared in Windows as WM_VSCROLL
            -- (from WEL_WM_CONSTANTS)

    Wm_vscrollclipboard: INTEGER is 778
            -- Declared in Windows as WM_VSCROLLCLIPBOARD
            -- (from WEL_WM_CONSTANTS)

    Wm_windowposchanged: INTEGER is 71
            -- Declared in Windows as WM_WINDOWPOSCHANGED
            -- (from WEL_WM_CONSTANTS)

    Wm_windowposchanging: INTEGER is 70
            -- Declared in Windows as WM_WINDOWPOSCHANGING
            -- (from WEL_WM_CONSTANTS)

    Wm_wininichange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WM_CONSTANTS as synonym of wm_settingchange.
            -- (from WEL_WM_CONSTANTS)

    Wm_xbuttondblclk: INTEGER is 525
            -- Declared in Windows as WM_XBUTTONDBLCLK
            -- (from WEL_WM_CONSTANTS)

    Wm_xbuttondown: INTEGER is 523
            -- Declared in Windows as WM_XBUTTONDOWN
            -- (from WEL_WM_CONSTANTS)

    Wm_xbuttonup: INTEGER is 524
            -- Declared in Windows as WM_XBUTTONUP
            -- (from WEL_WM_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_OCM_CONSTANTS


WEL_ODA_CONSTANTS Chart

class
    WEL_ODA_CONSTANTS

General
    cluster: wel.consts
    description: "Owner Draw Action (ODA) constants."

Ancestors
    ANY

Queries
    oda_drawentire: INTEGER
    oda_focus: INTEGER
    oda_select: INTEGER


WEL_ODA_CONSTANTS Flat contracts

indexing
    description: "Owner Draw Action (ODA) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ODA_CONSTANTS

feature -- Access

    oda_drawentire: INTEGER

    oda_focus: INTEGER

    oda_select: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ODA_CONSTANTS


WEL_ODS_CONSTANTS Chart

class
    WEL_ODS_CONSTANTS

General
    cluster: wel.consts
    description: "Owner Draw State (ODS) constants."

Ancestors
    ANY

Queries
    Ods_checked: INTEGER
    Ods_comboboxedit: INTEGER
    Ods_default: INTEGER
    Ods_disabled: INTEGER
    Ods_focus: INTEGER
    Ods_grayed: INTEGER
    Ods_hotlight: INTEGER
    Ods_inactive: INTEGER
    Ods_noaccel: INTEGER
    Ods_nofocusrect: INTEGER
    Ods_selected: INTEGER


WEL_ODS_CONSTANTS Flat contracts

indexing
    description: "Owner Draw State (ODS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ODS_CONSTANTS

feature -- Access

    Ods_checked: INTEGER is 8
            -- Declared in Windows as ODS_CHECKED

    Ods_comboboxedit: INTEGER is 4096
            -- Declared in Windows as ODS_COMBOBOXEDIT

    Ods_default: INTEGER is 32
            -- Declared in Windows as ODS_DEFAULT

    Ods_disabled: INTEGER is 4
            -- Declared in Windows as ODS_DISABLED

    Ods_focus: INTEGER is 16
            -- Declared in Windows as ODS_FOCUS

    Ods_grayed: INTEGER is 2
            -- Declared in Windows as ODS_GRAYED

    Ods_hotlight: INTEGER is 64
            -- Declared in Windows as ODS_HOTLIGHT

    Ods_inactive: INTEGER is 128
            -- Declared in Windows as ODS_INACTIVE

    Ods_noaccel: INTEGER is 256
            -- Declared in Windows as ODS_NOACCEL

    Ods_nofocusrect: INTEGER is 512
            -- Declared in Windows as ODS_NOFOCUSRECT

    Ods_selected: INTEGER is 1
            -- Declared in Windows as ODS_SELECTED

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ODS_CONSTANTS


WEL_ODT_CONSTANTS Chart

class
    WEL_ODT_CONSTANTS

General
    cluster: wel.consts
    description: "Owner Draw Type (ODT) constants."

Ancestors
    ANY

Queries
    odt_button: INTEGER
    odt_combobox: INTEGER
    odt_listbox: INTEGER
    odt_menu: INTEGER
    odt_static: INTEGER


WEL_ODT_CONSTANTS Flat contracts

indexing
    description: "Owner Draw Type (ODT) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ODT_CONSTANTS

feature -- Access

    odt_button: INTEGER

    odt_combobox: INTEGER

    odt_listbox: INTEGER

    odt_menu: INTEGER

    odt_static: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ODT_CONSTANTS


WEL_OFN_CONSTANTS Chart

class
    WEL_OFN_CONSTANTS

General
    cluster: wel.consts
    description: "OpenFile common dialog (OFN) constants."

Ancestors
    ANY

Queries
    Ofn_allowmultiselect: INTEGER
    Ofn_createprompt: INTEGER
    Ofn_enablehook: INTEGER
    Ofn_enabletemplate: INTEGER
    Ofn_enabletemplatehandle: INTEGER
    Ofn_explorer: INTEGER
    Ofn_extensiondifferent: INTEGER
    Ofn_filemustexist: INTEGER
    Ofn_hidereadonly: INTEGER
    Ofn_nochangedir: INTEGER
    Ofn_nolongnames: INTEGER
    Ofn_nonetworkbutton: INTEGER
    Ofn_noreadonlyreturn: INTEGER
    Ofn_notestfilecreate: INTEGER
    Ofn_novalidate: INTEGER
    Ofn_overwriteprompt: INTEGER
    Ofn_pathmustexist: INTEGER
    Ofn_readonly: INTEGER
    Ofn_shareaware: INTEGER
    Ofn_sharefallthrough: INTEGER
    Ofn_sharenowarn: INTEGER
    Ofn_sharewarn: INTEGER
    Ofn_showhelp: INTEGER


WEL_OFN_CONSTANTS Flat contracts

indexing
    description: "OpenFile common dialog (OFN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_OFN_CONSTANTS

feature -- Access

    Ofn_allowmultiselect: INTEGER is 512

    Ofn_createprompt: INTEGER is 8192

    Ofn_enablehook: INTEGER is 32

    Ofn_enabletemplate: INTEGER is 64

    Ofn_enabletemplatehandle: INTEGER is 128

    Ofn_explorer: INTEGER is 524288

    Ofn_extensiondifferent: INTEGER is 1024

    Ofn_filemustexist: INTEGER is 4096

    Ofn_hidereadonly: INTEGER is 4

    Ofn_nochangedir: INTEGER is 8

    Ofn_nolongnames: INTEGER is 262144

    Ofn_nonetworkbutton: INTEGER is 131072

    Ofn_noreadonlyreturn: INTEGER is 32768

    Ofn_notestfilecreate: INTEGER is 65536

    Ofn_novalidate: INTEGER is 256

    Ofn_overwriteprompt: INTEGER is 2

    Ofn_pathmustexist: INTEGER is 2048

    Ofn_readonly: INTEGER is 1

    Ofn_shareaware: INTEGER is 16384

    Ofn_sharefallthrough: INTEGER is 2

    Ofn_sharenowarn: INTEGER is 1

    Ofn_sharewarn: INTEGER is 0

    Ofn_showhelp: INTEGER is 16

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_OFN_CONSTANTS


WEL_OUT_PRECISION_CONSTANTS Chart

class
    WEL_OUT_PRECISION_CONSTANTS

General
    cluster: wel.consts
    description: "Out (OUT) precision constants."

Ancestors
    ANY

Queries
    Out_character_precis: INTEGER
    Out_default_precis: INTEGER
    Out_device_precis: INTEGER
    Out_raster_precis: INTEGER
    Out_string_precis: INTEGER
    Out_stroke_precis: INTEGER
    Out_tt_only_precis: INTEGER
    Out_tt_precis: INTEGER


WEL_OUT_PRECISION_CONSTANTS Flat contracts

indexing
    description: "Out (OUT) precision constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_OUT_PRECISION_CONSTANTS

feature -- Access

    Out_character_precis: INTEGER is 2

    Out_default_precis: INTEGER is 0

    Out_device_precis: INTEGER is 5

    Out_raster_precis: INTEGER is 6

    Out_string_precis: INTEGER is 1

    Out_stroke_precis: INTEGER is 3

    Out_tt_only_precis: INTEGER is 7

    Out_tt_precis: INTEGER is 4

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_OUT_PRECISION_CONSTANTS


WEL_PBM_CONSTANTS Chart

class
    WEL_PBM_CONSTANTS

General
    cluster: wel.consts
    description: "Common control Progress Bar Message (PBM) constants."

Ancestors
    ANY

Queries
    pbm_deltapos: INTEGER
    pbm_getpos: INTEGER
    pbm_getrange: INTEGER
    pbm_setpos: INTEGER
    pbm_setrange: INTEGER
    pbm_setstep: INTEGER
    pbm_stepit: INTEGER


WEL_PBM_CONSTANTS Flat contracts

indexing
    description: "Common control Progress Bar Message (PBM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PBM_CONSTANTS

feature -- Access

    pbm_deltapos: INTEGER

    pbm_getpos: INTEGER

    pbm_getrange: INTEGER

    pbm_setpos: INTEGER

    pbm_setrange: INTEGER

    pbm_setstep: INTEGER

    pbm_stepit: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PBM_CONSTANTS


WEL_PBS_CONSTANTS Chart

class
    WEL_PBS_CONSTANTS

General
    cluster: wel.consts
    description: "Common control Progress Bar Style (PBS) constants."

Ancestors
    ANY

Queries
    Pbs_smooth: INTEGER
    Pbs_vertical: INTEGER


WEL_PBS_CONSTANTS Flat contracts

indexing
    description: "Common control Progress Bar Style (PBS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PBS_CONSTANTS

feature -- Access

    Pbs_smooth: INTEGER is 1
            -- Declared in Windows as PBS_SMOOTH

    Pbs_vertical: INTEGER is 4
            -- Declared in Windows as PBS_VERTICAL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PBS_CONSTANTS


WEL_PC_CONSTANTS Chart

class
    WEL_PC_CONSTANTS

General
    cluster: wel.consts
    description: "Palette entry flag constants."

Ancestors
    ANY

Queries
    pc_explicit: INTEGER
    pc_nocollapse: INTEGER
    pc_reserved: INTEGER


WEL_PC_CONSTANTS Flat contracts

indexing
    description: "Palette entry flag constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PC_CONSTANTS

feature -- Access

    pc_explicit: INTEGER

    pc_nocollapse: INTEGER

    pc_reserved: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PC_CONSTANTS


WEL_PD_CONSTANTS Chart

class
    WEL_PD_CONSTANTS

General
    cluster: wel.consts
    description: "Print dialog (PD) constants."

Ancestors
    ANY

Queries
    Pd_allpages: INTEGER
    Pd_collate: INTEGER
    Pd_disableprinttofile: INTEGER
    Pd_enableprinthook: INTEGER
    Pd_enableprinttemplate: INTEGER
    Pd_enableprinttemplatehandle: INTEGER
    Pd_enablesetuphook: INTEGER
    Pd_enablesetuptemplate: INTEGER
    Pd_enablesetuptemplatehandle: INTEGER
    Pd_hideprinttofile: INTEGER
    Pd_nopagenums: INTEGER
    Pd_noselection: INTEGER
    Pd_nowarning: INTEGER
    Pd_pagenums: INTEGER
    Pd_printsetup: INTEGER
    Pd_printtofile: INTEGER
    Pd_returndc: INTEGER
    Pd_returndefault: INTEGER
    Pd_returnic: INTEGER
    Pd_selection: INTEGER
    Pd_showhelp: INTEGER
    Pd_usedevmodecopies: INTEGER


WEL_PD_CONSTANTS Flat contracts

indexing
    description: "Print dialog (PD) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PD_CONSTANTS

feature -- Access

    Pd_allpages: INTEGER is 0

    Pd_collate: INTEGER is 16

    Pd_disableprinttofile: INTEGER is 524288

    Pd_enableprinthook: INTEGER is 4096

    Pd_enableprinttemplate: INTEGER is 16384

    Pd_enableprinttemplatehandle: INTEGER is 65536

    Pd_enablesetuphook: INTEGER is 8192

    Pd_enablesetuptemplate: INTEGER is 32768

    Pd_enablesetuptemplatehandle: INTEGER is 131072

    Pd_hideprinttofile: INTEGER is 1048576

    Pd_nopagenums: INTEGER is 8

    Pd_noselection: INTEGER is 4

    Pd_nowarning: INTEGER is 128

    Pd_pagenums: INTEGER is 2

    Pd_printsetup: INTEGER is 64

    Pd_printtofile: INTEGER is 32

    Pd_returndc: INTEGER is 256

    Pd_returndefault: INTEGER is 1024

    Pd_returnic: INTEGER is 512

    Pd_selection: INTEGER is 1

    Pd_showhelp: INTEGER is 2048

    Pd_usedevmodecopies: INTEGER is 262144

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PD_CONSTANTS


WEL_PFA_CONSTANTS Chart

class
    WEL_PFA_CONSTANTS

General
    cluster: wel.consts
    description: "Paragraph format alignment (PFA) constants for the rich edit control."

Ancestors
    ANY

Queries
    pfa_center: INTEGER
    pfa_left: INTEGER
    pfa_right: INTEGER


WEL_PFA_CONSTANTS Flat contracts

indexing
    description: "Paragraph format alignment (PFA) constants for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PFA_CONSTANTS

feature -- Access

    pfa_center: INTEGER
            -- Paragraphs are centered.

    pfa_left: INTEGER
            -- Paragraphs are aligned with the left margin.

    pfa_right: INTEGER
            -- Paragraphs are aligned with the right margin.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PFA_CONSTANTS


WEL_PFM_CONSTANTS Chart

class
    WEL_PFM_CONSTANTS

General
    cluster: wel.consts
    description: "Paragraph format mask (PFM) constants for the rich edit control."

Ancestors
    ANY

Queries
    Pfm_alignment: INTEGER
    Pfm_numbering: INTEGER
    Pfm_offset: INTEGER
    Pfm_offsetindent: INTEGER
    Pfm_rightindent: INTEGER
    Pfm_startindent: INTEGER
    Pfm_tabstops: INTEGER


WEL_PFM_CONSTANTS Flat contracts

indexing
    description: "Paragraph format mask (PFM) constants for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PFM_CONSTANTS

feature -- Access

    Pfm_alignment: INTEGER is 8
            -- The wAlignment member is valid.

    Pfm_numbering: INTEGER is 32
            -- The wNumbering member is valid.

    Pfm_offset: INTEGER is 4
            -- The dxStartIndent member is valid and specifies
            -- a relative value.

    Pfm_offsetindent: INTEGER is -2147483648
            -- The dxOffset member is valid.

    Pfm_rightindent: INTEGER is 2
            -- The dxRightIndent member is valid.

    Pfm_startindent: INTEGER is 1
            -- The dxStartIndent member is valid.

    Pfm_tabstops: INTEGER is 16
            -- The cTabStobs and rgxTabStops members are valid.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PFM_CONSTANTS


WEL_PM_CONSTANTS Chart

class
    WEL_PM_CONSTANTS

General
    cluster: wel.consts
    description: "PeekMessage (PM) constants."

Ancestors
    ANY

Queries
    Pm_noremove: INTEGER
    Pm_noyield: INTEGER
    Pm_remove: INTEGER


WEL_PM_CONSTANTS Flat contracts

indexing
    description: "PeekMessage (PM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PM_CONSTANTS

feature -- Access

    Pm_noremove: INTEGER is 0

    Pm_noyield: INTEGER is 2

    Pm_remove: INTEGER is 1

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PM_CONSTANTS


WEL_POLYGONAL_CAPABILITIES_CONSTANTS Chart

class
    WEL_POLYGONAL_CAPABILITIES_CONSTANTS

General
    cluster: wel.consts
    description: "Polygonal capabilities (PC) constants."

Ancestors
    ANY

Queries
    pc_interiors: INTEGER
    pc_none: INTEGER
    pc_polygon: INTEGER
    pc_rectangle: INTEGER
    pc_scanline: INTEGER
    pc_styled: INTEGER
    pc_wide: INTEGER
    pc_widestyled: INTEGER
    pc_windpolygon: INTEGER


WEL_POLYGONAL_CAPABILITIES_CONSTANTS Flat contracts

indexing
    description: "Polygonal capabilities (PC) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_POLYGONAL_CAPABILITIES_CONSTANTS

feature -- Access

    pc_interiors: INTEGER
            -- Supports interiors

    pc_none: INTEGER
            -- Supports no polygons

    pc_polygon: INTEGER
            -- Supports alternate fill polygons

    pc_rectangle: INTEGER
            -- Supports rectangles

    pc_scanline: INTEGER
            -- Supports scan lines

    pc_styled: INTEGER
            -- Supports styled borders

    pc_wide: INTEGER
            -- Supports wide borders

    pc_widestyled: INTEGER
            -- Supports wide, styled borders

    pc_windpolygon: INTEGER
            -- Supports winding number fill polygons

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_POLYGONAL_CAPABILITIES_CONSTANTS


WEL_POLYGON_FILL_MODE_CONSTANTS Chart

class
    WEL_POLYGON_FILL_MODE_CONSTANTS

General
    cluster: wel.consts
    description: "Polygon fill mode constants."

Ancestors
    ANY

Queries
    alternate: INTEGER
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    winding: INTEGER


WEL_POLYGON_FILL_MODE_CONSTANTS Flat contracts

indexing
    description: "Polygon fill mode constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_POLYGON_FILL_MODE_CONSTANTS

feature -- Access

    alternate: INTEGER
            -- Selects alternate mode (fills the area between
            -- odd-numbered and even-numbered polygon sides on
            -- each scan line).

    winding: INTEGER
            -- Selects winding mode (fills any region with a
            -- nonzero winding value).

feature -- Status report

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_POLYGON_FILL_MODE_CONSTANTS


WEL_PROCESS_CREATION_CONSTANTS Chart

class
    WEL_PROCESS_CREATION_CONSTANTS

General
    cluster: wel.consts
    description: "Constants for `create_process' from WEL_WINDOWS_ROUTINES."

Ancestors
    WEL_BIT_OPERATIONS

Queries
    create_default_error_mode: INTEGER
    create_new_console: INTEGER
    create_new_process_group: INTEGER
    detached_process: INTEGER
    is_valid_creation_constant (a_constant: INTEGER): BOOLEAN


WEL_PROCESS_CREATION_CONSTANTS Flat contracts

indexing
    description: "Constants for `create_process' from WEL_WINDOWS_ROUTINES."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PROCESS_CREATION_CONSTANTS

feature -- Access

    create_default_error_mode: INTEGER
            -- New process does not inherit error mode of calling process but use default error mode.

    create_new_console: INTEGER
            -- New process has a new console, instead of inheriting parent’s console.

    create_new_process_group: INTEGER
            -- New process is root process of a new process group.

    detached_process: INTEGER
            -- For console processes, new process does not have access to parent's console.

    is_valid_creation_constant (a_constant: INTEGER): BOOLEAN
            -- Is a_constant a valid process creation constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PROCESS_CREATION_CONSTANTS


WEL_PS_CONSTANTS Chart

class
    WEL_PS_CONSTANTS

General
    cluster: wel.consts
    description: "Pen style (PS) constants."

Ancestors
    ANY

Queries
    Ps_dash: INTEGER
    Ps_dashdot: INTEGER
    Ps_dashdotdot: INTEGER
    Ps_dot: INTEGER
    Ps_insideframe: INTEGER
    Ps_null: INTEGER
    Ps_solid: INTEGER
    valid_pen_style_constant (c: INTEGER): BOOLEAN


WEL_PS_CONSTANTS Flat contracts

indexing
    description: "Pen style (PS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PS_CONSTANTS

feature -- Access

    Ps_dash: INTEGER is 1

    Ps_dashdot: INTEGER is 3

    Ps_dashdotdot: INTEGER is 4

    Ps_dot: INTEGER is 2

    Ps_insideframe: INTEGER is 6

    Ps_null: INTEGER is 5

    Ps_solid: INTEGER is 0

feature -- Status report

    valid_pen_style_constant (c: INTEGER): BOOLEAN
            -- Is c a valid pen style constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PS_CONSTANTS


WEL_RASTER_CAPABILITIES_CONSTANTS Chart

class
    WEL_RASTER_CAPABILITIES_CONSTANTS

General
    cluster: wel.consts
    description: "Raster capabilities (RC) constants."

Ancestors
    ANY

Queries
    rc_banding: INTEGER
    rc_bigfont: INTEGER
    rc_bitblt: INTEGER
    rc_bitmap64: INTEGER
    rc_devbits: INTEGER
    rc_di_bitmap: INTEGER
    rc_dibtodev: INTEGER
    rc_floodfill: INTEGER
    rc_gdi20_output: INTEGER
    rc_gdi20_state: INTEGER
    rc_op_dx_output: INTEGER
    rc_palette: INTEGER
    rc_savebitmap: INTEGER
    rc_scaling: INTEGER
    rc_stretchblt: INTEGER
    rc_stretchdib: INTEGER


WEL_RASTER_CAPABILITIES_CONSTANTS Flat contracts

indexing
    description: "Raster capabilities (RC) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RASTER_CAPABILITIES_CONSTANTS

feature -- Access

    rc_banding: INTEGER
            -- Supports banding

    rc_bigfont: INTEGER
            -- Supports fonts larger then 64K

    rc_bitblt: INTEGER
            -- Transfers bitmaps

    rc_bitmap64: INTEGER
            -- Supports bitmaps larger than 64K

    rc_devbits: INTEGER
            -- Supports device bitmaps

    rc_di_bitmap: INTEGER
            -- Supports the set_di_bits feature

    rc_dibtodev: INTEGER
            -- Supports the set_di_bits_to_device feature

    rc_floodfill: INTEGER
            -- Performs flood fills

    rc_gdi20_output: INTEGER
            -- Supports Windows version 2.0 features

    rc_gdi20_state: INTEGER
            -- Includes a state block in the device context

    rc_op_dx_output: INTEGER
            -- Supports dev opaque and DX array

    rc_palette: INTEGER
            -- Specifies a palette-based device

    rc_savebitmap: INTEGER
            -- Saves bitmaps locally

    rc_scaling: INTEGER
            -- Supports scaling

    rc_stretchblt: INTEGER
            -- Supports the stretch_blt feature

    rc_stretchdib: INTEGER
            -- Supports the stretch_di_bits feature

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RASTER_CAPABILITIES_CONSTANTS


WEL_RASTER_OPERATIONS_CONSTANTS Chart

class
    WEL_RASTER_OPERATIONS_CONSTANTS

General
    cluster: wel.consts
    description: "Raster operations constants."

Ancestors
    ANY

Queries
    Blackness: INTEGER
    Dstinvert: INTEGER
    maskcopy: INTEGER
    Maskpaint: INTEGER
    Mergecopy: INTEGER
    Mergepaint: INTEGER
    Notsrccopy: INTEGER
    Notsrcerase: INTEGER
    Patcopy: INTEGER
    Patinvert: INTEGER
    Patpaint: INTEGER
    Srcand: INTEGER
    Srccopy: INTEGER
    Srcerase: INTEGER
    Srcinvert: INTEGER
    Srcpaint: INTEGER
    Whiteness: INTEGER


WEL_RASTER_OPERATIONS_CONSTANTS Flat contracts

indexing
    description: "Raster operations constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RASTER_OPERATIONS_CONSTANTS

feature -- Access

    Blackness: INTEGER is 66
            -- Declared in Windows as BLACKNESS

    Dstinvert: INTEGER is 5570569
            -- Declared in Windows as DSTINVERT

    maskcopy: INTEGER

    Maskpaint: INTEGER is 2229030
            -- 0x220326

    Mergecopy: INTEGER is 12583114
            -- Declared in Windows as MERGECOPY

    Mergepaint: INTEGER is 12255782
            -- Declared in Windows as MERGEPAINT

    Notsrccopy: INTEGER is 3342344
            -- Declared in Windows as NOTSRCCOPY

    Notsrcerase: INTEGER is 1114278
            -- Declared in Windows as NOTSRCERASE

    Patcopy: INTEGER is 15728673
            -- Declared in Windows as PATCOPY

    Patinvert: INTEGER is 5898313
            -- Declared in Windows as PATINVERT

    Patpaint: INTEGER is 16452105
            -- Declared in Windows as PATPAINT

    Srcand: INTEGER is 8913094
            -- Declared in Windows as SRCAND

    Srccopy: INTEGER is 13369376
            -- Declared in Windows as SRCCOPY

    Srcerase: INTEGER is 4457256
            -- Declared in Windows as SRCERASE

    Srcinvert: INTEGER is 6684742
            -- Declared in Windows as SRCINVERT

    Srcpaint: INTEGER is 15597702
            -- Declared in Windows as SRCPAINT

    Whiteness: INTEGER is 16711778
            -- Declared in Windows as WHITENESS

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RASTER_OPERATIONS_CONSTANTS


WEL_RBBIM_CONSTANTS Chart

class
    WEL_RBBIM_CONSTANTS

General
    cluster: wel.consts
    description: "Rebar Band Mask (RBBIM) messages."

Ancestors
    ANY

Queries
    rbbim_background: INTEGER
    rbbim_child: INTEGER
    rbbim_childsize: INTEGER
    rbbim_colors: INTEGER
    rbbim_id: INTEGER
    rbbim_image: INTEGER
    rbbim_size: INTEGER
    rbbim_style: INTEGER
    rbbim_text: INTEGER


WEL_RBBIM_CONSTANTS Flat contracts

indexing
    description: "Rebar Band Mask (RBBIM) messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RBBIM_CONSTANTS

feature -- Access

    rbbim_background: INTEGER

    rbbim_child: INTEGER

    rbbim_childsize: INTEGER

    rbbim_colors: INTEGER

    rbbim_id: INTEGER

    rbbim_image: INTEGER

    rbbim_size: INTEGER

    rbbim_style: INTEGER

    rbbim_text: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RBBIM_CONSTANTS


WEL_RBBS_CONSTANTS Chart

class
    WEL_RBBS_CONSTANTS

General
    cluster: wel.consts
    description: "Rebar Band Style (RBBS) constants."

Ancestors
    ANY

Queries
    rbbs_break: INTEGER
    rbbs_childedge: INTEGER
    rbbs_fixedbmp: INTEGER
    rbbs_fixedsize: INTEGER
    rbbs_hidden: INTEGER
    rbbs_novert: INTEGER


WEL_RBBS_CONSTANTS Flat contracts

indexing
    description: "Rebar Band Style (RBBS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RBBS_CONSTANTS

feature -- Access

    rbbs_break: INTEGER

    rbbs_childedge: INTEGER

    rbbs_fixedbmp: INTEGER

    rbbs_fixedsize: INTEGER

    rbbs_hidden: INTEGER

    rbbs_novert: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RBBS_CONSTANTS


WEL_RBIM_CONSTANTS Chart

class
    WEL_RBIM_CONSTANTS

General
    cluster: wel.consts
    description: "Rebar Mask (RBBIM) messages."

Ancestors
    ANY

Queries
    rbim_imagelist: INTEGER


WEL_RBIM_CONSTANTS Flat contracts

indexing
    description: "Rebar Mask (RBBIM) messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RBIM_CONSTANTS

feature -- Access

    rbim_imagelist: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RBIM_CONSTANTS


WEL_RBN_CONSTANTS Chart

class
    WEL_RBN_CONSTANTS

General
    cluster: wel.consts
    description: "Rebar notification (RBN) constants."

Ancestors
    ANY

Queries
    rbn_heightchange: INTEGER


WEL_RBN_CONSTANTS Flat contracts

indexing
    description: "Rebar notification (RBN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RBN_CONSTANTS

feature -- Access

    rbn_heightchange: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RBN_CONSTANTS


WEL_RBS_CONSTANTS Chart

class
    WEL_RBS_CONSTANTS

General
    cluster: wel.consts
    description: "Common control ReBar Style (TBS) constants."

Ancestors
    ANY

Queries
    rbs_bandborders: INTEGER
    rbs_fixedorder: INTEGER
    rbs_tooltips: INTEGER
    rbs_varheight: INTEGER


WEL_RBS_CONSTANTS Flat contracts

indexing
    description: "Common control ReBar Style (TBS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RBS_CONSTANTS

feature -- Access

    rbs_bandborders: INTEGER

    rbs_fixedorder: INTEGER

    rbs_tooltips: INTEGER

    rbs_varheight: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RBS_CONSTANTS


WEL_RB_CONSTANTS Chart

class
    WEL_RB_CONSTANTS

General
    cluster: wel.consts
    description: "Common control ReBar (RB) constants."

Ancestors
    ANY

Queries
    rb_deleteband: INTEGER
    rb_getbandcount: INTEGER
    rb_getbandinfo: INTEGER
    rb_getbarinfo: INTEGER
    rb_getrowcount: INTEGER
    rb_getrowheight: INTEGER
    rb_insertband: INTEGER
    rb_setbandinfo: INTEGER
    rb_setbarinfo: INTEGER
    rb_setparent: INTEGER


WEL_RB_CONSTANTS Flat contracts

indexing
    description: "Common control ReBar (RB) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RB_CONSTANTS

feature -- Access

    rb_deleteband: INTEGER

    rb_getbandcount: INTEGER

    rb_getbandinfo: INTEGER

    rb_getbarinfo: INTEGER

    rb_getrowcount: INTEGER

    rb_getrowheight: INTEGER

    rb_insertband: INTEGER

    rb_setbandinfo: INTEGER

    rb_setbarinfo: INTEGER

    rb_setparent: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RB_CONSTANTS


WEL_RDW_CONSTANTS Chart

class
    WEL_RDW_CONSTANTS

General
    cluster: wel.consts
    description: "RedrawWindow() flags."

Ancestors
    ANY

Queries
    Rdw_allchildren: INTEGER
    Rdw_erase: INTEGER
    Rdw_erasenow: INTEGER
    Rdw_frame: INTEGER
    Rdw_internalpaint: INTEGER
    Rdw_invalidate: INTEGER
    Rdw_nochildren: INTEGER
    Rdw_noerase: INTEGER
    Rdw_noframe: INTEGER
    Rdw_nointernalpaint: INTEGER
    Rdw_updatenow: INTEGER
    Rdw_validate: INTEGER


WEL_RDW_CONSTANTS Flat contracts

indexing
    description: "RedrawWindow() flags."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_RDW_CONSTANTS

feature -- Access

    Rdw_allchildren: INTEGER is 128
            -- Controls which windows are affected by the RedrawWindow function.
            -- Includes child windows, if any, in the repainting operation.

    Rdw_erase: INTEGER is 4
            -- invalidation
            -- Causes the window to receive a WM_ERASEBKGND
            -- message when the window is repainted.
            -- The RDW_INVALIDATE flag must also be specified;
            -- otherwise, RDW_ERASE has no effect.

    Rdw_erasenow: INTEGER is 512
            -- Controls when repainting occurs.
            -- Causes the affected windows (as specified
            -- by the RDW_ALLCHILDREN and RDW_NOCHILDREN flags)
            -- to receive WM_NCPAINT and WM_ERASEBKGND messages,
            -- if necessary, before the function returns.
            -- WM_PAINT messages are received at the ordinary time.

    Rdw_frame: INTEGER is 1024
            -- invalidation
            -- Causes any part of the nonclient area of
            -- the window that intersects the update region
            -- to receive a WM_NCPAINT message.
            -- The RDW_INVALIDATE flag must also be specified;
            -- otherwise, RDW_FRAME has no effect.
            -- The WM_NCPAINT message is typically not sent
            -- during the execution of RedrawWindow unless
            -- either RDW_UPDATENOW or RDW_ERASENOW is specified.

    Rdw_internalpaint: INTEGER is 2
            -- invalidation
            -- Causes a WM_PAINT message to be posted to
            -- the window regardless of whether any portion
            -- of the window is invalid.

    Rdw_invalidate: INTEGER is 1
            -- invalidation
            -- Invalidates lprcUpdate or hrgnUpdate
            -- (only one may be non-NULL). If both are NULL,
            -- the entire window is invalidated.

    Rdw_nochildren: INTEGER is 64
            -- Controls which windows are affected by the RedrawWindow function.
            -- Excludes child windows, if any, from the repainting operation.

    Rdw_noerase: INTEGER is 32
            -- validation
            -- Suppresses any pending WM_ERASEBKGND messages.

    Rdw_noframe: INTEGER is 2048
            -- validation
            -- Suppresses any pending WM_NCPAINT messages.
            -- This flag must be used with RDW_VALIDATE and
            -- is typically used with RDW_NOCHILDREN.
            -- RDW_NOFRAME should be used with care, as it
            -- could cause parts of a window to be painted
            -- improperly.

    Rdw_nointernalpaint: INTEGER is 16
            -- validation
            -- Suppresses any pending internal WM_PAINT
            -- messages. This flag does not affect WM_PAINT
            -- messages resulting from a non-NULL update area.

    Rdw_updatenow: INTEGER is 256
            -- Controls when repainting occurs.
            -- Causes the affected windows
            -- (as specified by the RDW_ALLCHILDREN
            -- and RDW_NOCHILDREN flags) to receive
            -- WM_NCPAINT, WM_ERASEBKGND, and WM_PAINT messages,
            -- if necessary, before the function returns.

    Rdw_validate: INTEGER is 8
            -- validation
            -- Validates lprcUpdate or hrgnUpdate
            -- (only one may be non-NULL).
            -- If both are NULL, the entire window is
            -- validated. This flag does not affect
            -- internal WM_PAINT messages.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RDW_CONSTANTS


WEL_REGISTRY_ACCESS_MODE Chart

class
    WEL_REGISTRY_ACCESS_MODE

General
    cluster: wel.consts
    description: "Hkey registry open access mode constants"

Ancestors
    ANY

Queries
    key_all_access: INTEGER
    key_create_link: INTEGER
    key_create_sub_key: INTEGER
    key_enumerate_sub_keys: INTEGER
    key_execute: INTEGER
    key_notify: INTEGER
    key_query_value: INTEGER
    key_read: INTEGER
    key_set_value: INTEGER
    key_write: INTEGER


WEL_REGISTRY_ACCESS_MODE Flat contracts

indexing
    description: "Hkey registry open access mode constants"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_REGISTRY_ACCESS_MODE

feature -- Access

    key_all_access: INTEGER
            -- Combines the KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS,
            -- KEY_NOTIFY, KEY_CREATE_SUB_KEY, KEY_CREATE_LINK, and
            -- KEY_SET_VALUE access rights, plus all the standard
            -- access rights except SYNCHRONIZE.

    key_create_link: INTEGER
            -- Permission to create a symbolic link.

    key_create_sub_key: INTEGER
            -- Permission to create subkeys.

    key_enumerate_sub_keys: INTEGER
            -- Permission to enumerate subkeys.

    key_execute: INTEGER
            -- Permission for read access.

    key_notify: INTEGER
            -- Permission for change notification.

    key_query_value: INTEGER
            -- Permission to query subkey data.

    key_read: INTEGER
            -- Combines the STANDARD_RIGHTS_READ, KEY_QUERY_VALUE,
            -- KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY access rights.

    key_set_value: INTEGER
            -- Permission to set subkey data.

    key_write: INTEGER
            -- Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE,
            -- and KEY_CREATE_SUB_KEY access rights.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REGISTRY_ACCESS_MODE


WEL_REGISTRY_KEY_VALUE_TYPE Chart

class
    WEL_REGISTRY_KEY_VALUE_TYPE

General
    cluster: wel.consts
    description: "Registry keys value types"

Ancestors
    ANY

Queries
    Reg_binary: INTEGER
    Reg_dword: INTEGER
    Reg_dword_big_endian: INTEGER
    Reg_dword_little_endian: INTEGER
    Reg_expand_sz: INTEGER
    Reg_link: INTEGER
    Reg_multi_sz: INTEGER
    Reg_none: INTEGER
    Reg_resource_list: INTEGER
    Reg_sz: INTEGER


WEL_REGISTRY_KEY_VALUE_TYPE Flat contracts

indexing
    description: "Registry keys value types"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_REGISTRY_KEY_VALUE_TYPE

feature -- Access

    Reg_binary: INTEGER is 3
            -- General binary value
            --
            -- Declared in Windows as REG_BINARY

    Reg_dword: INTEGER is 4
            -- Double word value
            --
            -- Declared in Windows as REG_DWORD

    Reg_dword_big_endian: INTEGER is 5
            -- Double word value in big-endian format
            --
            -- Declared in Windows as REG_DWORD_BIG_ENDIAN

    Reg_dword_little_endian: INTEGER is 4
            -- Synonym of Reg_dword
            --
            -- Declared in Windows as REG_DWORD_LITTLE_ENDIAN

    Reg_expand_sz: INTEGER is 2
            -- C-String that contains unexpanded references to environment
            -- variables
            --
            -- Declared in Windows as REG_EXPAND_SZ

    Reg_link: INTEGER is 6
            -- Unicode symbolic link
            --
            -- Declared in Windows as REG_LINK

    Reg_multi_sz: INTEGER is 7
            -- Array of C-strings, terminated by two null characters
            --
            -- Declared in Windows as REG_MULTI_SZ

    Reg_none: INTEGER is 0
            -- No defined value type
            --
            -- Declared in Windows as REG_NONE

    Reg_resource_list: INTEGER is 8
            -- Device-driver resource list
            --
            -- Declared in Windows as REG_RESOURCE_LIST

    Reg_sz: INTEGER is 1
            -- C-String
            --
            -- Declared in Windows as REG_SZ

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REGISTRY_KEY_VALUE_TYPE


WEL_RGN_CONSTANTS Chart

class
    WEL_RGN_CONSTANTS

General
    cluster: wel.consts
    description: "Regions (RGN) constants."

Ancestors
    ANY

Queries
    rgn_and: INTEGER
    rgn_copy: INTEGER
    rgn_diff: INTEGER
    rgn_or: INTEGER
    rgn_xor: INTEGER
    valid_region_constant (c: INTEGER): BOOLEAN


WEL_RGN_CONSTANTS Flat contracts

indexing
    description: "Regions (RGN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RGN_CONSTANTS

feature -- Access

    rgn_and: INTEGER

    rgn_copy: INTEGER

    rgn_diff: INTEGER

    rgn_or: INTEGER

    rgn_xor: INTEGER

feature -- Status report

    valid_region_constant (c: INTEGER): BOOLEAN
            -- Is c a valid region constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RGN_CONSTANTS


WEL_RICH_EDIT_MESSAGE_CONSTANTS Chart

class
    WEL_RICH_EDIT_MESSAGE_CONSTANTS

General
    cluster: wel.consts
    description: "Rich edit messages."

Ancestors
    ANY

Queries
    Em_canpaste: INTEGER
    Em_charfrompos: INTEGER
    Em_displayband: INTEGER
    Em_exgetsel: INTEGER
    Em_exlimittext: INTEGER
    Em_exlinefromchar: INTEGER
    Em_exsetsel: INTEGER
    Em_findtext: INTEGER
    Em_findtextex: INTEGER
    Em_findwordbreak: INTEGER
    Em_formatrange: INTEGER
    Em_getcharformat: INTEGER
    Em_geteventmask: INTEGER
    Em_getimecolor: INTEGER
    Em_getimeoptions: INTEGER
    Em_getoptions: INTEGER
    Em_getparaformat: INTEGER
    Em_getpunctuation: INTEGER
    Em_getseltext: INTEGER
    Em_gettextrange: INTEGER
    Em_getwordbreakprocex: INTEGER
    Em_getwordwrapmode: INTEGER
    Em_hideselection: INTEGER
    Em_pastespecial: INTEGER
    Em_posfromchar: INTEGER
    Em_requestresize: INTEGER
    Em_selectiontype: INTEGER
    Em_setbkgndcolor: INTEGER
    Em_setcharformat: INTEGER
    Em_seteventmask: INTEGER
    Em_setimecolor: INTEGER
    Em_setimeoptions: INTEGER
    Em_setlimittext: INTEGER
    Em_setoptions: INTEGER
    Em_setparaformat: INTEGER
    Em_setpunctuation: INTEGER
    Em_settargetdevice: INTEGER
    Em_setwordbreakprocex: INTEGER
    Em_setwordwrapmode: INTEGER
    Em_streamin: INTEGER
    Em_streamout: INTEGER
    En_selchange: INTEGER


WEL_RICH_EDIT_MESSAGE_CONSTANTS Flat contracts

indexing
    description: "Rich edit messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:03 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RICH_EDIT_MESSAGE_CONSTANTS

feature -- Access

    Em_canpaste: INTEGER is 1074
            -- Declared in Windows as EM_CANPASTE

    Em_charfrompos: INTEGER is 215
            -- Declared in Windows as EM_CHARFROMPOS

    Em_displayband: INTEGER is 1075
            -- Declared in Windows as EM_DISPLAYBAND

    Em_exgetsel: INTEGER is 1076
            -- Declared in Windows as EM_EXGETSEL

    Em_exlimittext: INTEGER is 1077
            -- Declared in Windows as EM_EXLIMITTEXT

    Em_exlinefromchar: INTEGER is 1078
            -- Declared in Windows as EM_EXLINEFROMCHAR

    Em_exsetsel: INTEGER is 1079
            -- Declared in Windows as EM_EXSETSEL

    Em_findtext: INTEGER is 1080
            -- Declared in Windows as EM_FINDTEXT

    Em_findtextex: INTEGER is 1103
            -- Declared in Windows as EM_FINDTEXTEX

    Em_findwordbreak: INTEGER is 1100
            -- Declared in Windows as EM_FINDWORDBREAK

    Em_formatrange: INTEGER is 1081
            -- Declared in Windows as EM_FORMATRANGE

    Em_getcharformat: INTEGER is 1082
            -- Declared in Windows as EM_GETCHARFORMAT

    Em_geteventmask: INTEGER is 1083
            -- Declared in Windows as EM_GETEVENTMASK

    Em_getimecolor: INTEGER is 1129
            -- Declared in Windows as EM_GETIMECOLOR

    Em_getimeoptions: INTEGER is 1131
            -- Declared in Windows as EM_GETIMEOPTIONS

    Em_getoptions: INTEGER is 1102
            -- Declared in Windows as EM_GETOPTIONS

    Em_getparaformat: INTEGER is 1085
            -- Declared in Windows as EM_GETPARAFORMAT

    Em_getpunctuation: INTEGER is 1125
            -- Declared in Windows as EM_GETPUNCTUATION

    Em_getseltext: INTEGER is 1086
            -- Declared in Windows as EM_GETSELTEXT

    Em_gettextrange: INTEGER is 1099
            -- Declared in Windows as EM_GETTEXTRANGE

    Em_getwordbreakprocex: INTEGER is 1104
            -- Declared in Windows as EM_GETWORDBREAKPROCEX

    Em_getwordwrapmode: INTEGER is 1127
            -- Declared in Windows as EM_GETWORDWRAPMODE

    Em_hideselection: INTEGER is 1087
            -- Declared in Windows as EM_HIDESELECTION

    Em_pastespecial: INTEGER is 1088
            -- Declared in Windows as EM_PASTESPECIAL

    Em_posfromchar: INTEGER is 214
            -- Declared in Windows as EM_POSFROMCHAR

    Em_requestresize: INTEGER is 1089
            -- Declared in Windows as EM_REQUESTRESIZE

    Em_selectiontype: INTEGER is 1090
            -- Declared in Windows as EM_SELECTIONTYPE

    Em_setbkgndcolor: INTEGER is 1091
            -- Declared in Windows as EM_SETBKGNDCOLOR

    Em_setcharformat: INTEGER is 1092
            -- Declared in Windows as EM_SETCHARFORMAT

    Em_seteventmask: INTEGER is 1093
            -- Declared in Windows as EM_SETEVENTMASK

    Em_setimecolor: INTEGER is 1128
            -- Declared in Windows as EM_SETIMECOLOR

    Em_setimeoptions: INTEGER is 1130
            -- Declared in Windows as EM_SETIMEOPTIONS

    Em_setlimittext: INTEGER is 197
            -- Declared in Windows as EM_SETLIMITTEXT

    Em_setoptions: INTEGER is 1101
            -- Declared in Windows as EM_SETOPTIONS

    Em_setparaformat: INTEGER is 1095
            -- Declared in Windows as EM_SETPARAFORMAT

    Em_setpunctuation: INTEGER is 1124
            -- Declared in Windows as EM_SETPUNCTUATION

    Em_settargetdevice: INTEGER is 1096
            -- Declared in Windows as EM_SETTARGETDEVICE

    Em_setwordbreakprocex: INTEGER is 1105
            -- Declared in Windows as EM_SETWORDBREAKPROCEX

    Em_setwordwrapmode: INTEGER is 1126
            -- Declared in Windows as EM_SETWORDWRAPMODE

    Em_streamin: INTEGER is 1097
            -- Declared in Windows as EM_STREAMIN

    Em_streamout: INTEGER is 1098
            -- Declared in Windows as EM_STREAMOUT

    En_selchange: INTEGER is 1794
            -- Declared in Windows as EN_SELCHANGE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_MESSAGE_CONSTANTS


WEL_RICH_EDIT_STYLE_CONSTANTS Chart

class
    WEL_RICH_EDIT_STYLE_CONSTANTS

General
    cluster: wel.consts
    description: "Rich edit styles."

Ancestors
    ANY

Queries
    Es_disablenoscroll: INTEGER
    Es_ex_nocalloleinit: INTEGER
    Es_noime: INTEGER
    Es_savesel: INTEGER
    Es_selfime: INTEGER
    Es_sunken: INTEGER
    Es_vertical: INTEGER


WEL_RICH_EDIT_STYLE_CONSTANTS Flat contracts

indexing
    description: "Rich edit styles."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RICH_EDIT_STYLE_CONSTANTS

feature -- Access

    Es_disablenoscroll: INTEGER is 8192
            -- Disables scrollbars instead of hiding them when they
            -- are not needed.

    Es_ex_nocalloleinit: INTEGER is 16777216
            -- Prevents the control from calling the OleInitialize function
            -- when created. This window style is useful only in dialog
            -- templates because CreateWindowEx does not accept this style.
            --
            -- Declared in Windows as ES_EX_NOCALLOLEINIT

    Es_noime: INTEGER is 524288
            -- Disables the input method editor (IME) operation.
            -- Available for Asian-languages only.

    Es_savesel: INTEGER is 32768
            -- Preserves the selection when the control loses the
            -- focus. By default, the entire contents of the
            -- control are selected when it regains the focus.

    Es_selfime: INTEGER is 262144
            -- Directs the rich edit control to allow the
            -- application to handle all IME operations.
            -- Available for Asian-languages only.

    Es_sunken: INTEGER is 16384
            -- Displays the control with a sunken border style so
            -- that the rich edit control appears recessed into
            -- its parent window. Applications developed for
            -- Windows 95 should use WS_EX_CLIENTEDGE instead of
            -- ES_SUNKEN.

    Es_vertical: INTEGER is 4194304
            -- Draws text and objects in a vertical direction.
            -- Available for Asian-languages only.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_STYLE_CONSTANTS


WEL_ROP2_CONSTANTS Chart

class
    WEL_ROP2_CONSTANTS

General
    cluster: wel.consts
    description: "Raster operation 2 (R2) constants."

Ancestors
    ANY

Queries
    R2_black: INTEGER
    R2_copypen: INTEGER
    R2_masknotpen: INTEGER
    R2_maskpen: INTEGER
    R2_maskpennot: INTEGER
    R2_mergenotpen: INTEGER
    R2_mergepen: INTEGER
    R2_mergepennot: INTEGER
    R2_nop: INTEGER
    R2_not: INTEGER
    R2_notcopypen: INTEGER
    R2_notmaskpen: INTEGER
    R2_notmergepen: INTEGER
    R2_notxorpen: INTEGER
    R2_white: INTEGER
    R2_xorpen: INTEGER
    valid_rop2_constant (c: INTEGER): BOOLEAN


WEL_ROP2_CONSTANTS Flat contracts

indexing
    description: "Raster operation 2 (R2) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ROP2_CONSTANTS

feature -- Access

    R2_black: INTEGER is 1

    R2_copypen: INTEGER is 13

    R2_masknotpen: INTEGER is 3

    R2_maskpen: INTEGER is 9

    R2_maskpennot: INTEGER is 5

    R2_mergenotpen: INTEGER is 12

    R2_mergepen: INTEGER is 15

    R2_mergepennot: INTEGER is 14

    R2_nop: INTEGER is 11

    R2_not: INTEGER is 6

    R2_notcopypen: INTEGER is 4

    R2_notmaskpen: INTEGER is 8

    R2_notmergepen: INTEGER is 2

    R2_notxorpen: INTEGER is 10

    R2_white: INTEGER is 16

    R2_xorpen: INTEGER is 7

feature -- Status report

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ROP2_CONSTANTS


WEL_RT_CONSTANTS Chart

class
    WEL_RT_CONSTANTS

General
    cluster: wel.consts
    description: "Resource Type (RT) constants."

Ancestors
    ANY

Queries
    rt_accelerator: POINTER
    rt_bitmap: POINTER
    rt_cursor: POINTER
    rt_dialog: POINTER
    rt_font: POINTER
    rt_fontdir: POINTER
    rt_group_cursor: POINTER
    rt_group_icon: POINTER
    rt_icon: POINTER
    rt_menu: POINTER
    rt_rcdata: POINTER
    rt_string: POINTER


WEL_RT_CONSTANTS Flat contracts

indexing
    description: "Resource Type (RT) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"
    note: "Changed all Resource Types from INTEGERto POINTER"

class interface
    WEL_RT_CONSTANTS

feature -- Access

    rt_accelerator: POINTER

    rt_bitmap: POINTER

    rt_cursor: POINTER

    rt_dialog: POINTER

    rt_font: POINTER

    rt_fontdir: POINTER

    rt_group_cursor: POINTER

    rt_group_icon: POINTER

    rt_icon: POINTER

    rt_menu: POINTER

    rt_rcdata: POINTER

    rt_string: POINTER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RT_CONSTANTS


WEL_SBS_CONSTANTS Chart

class
    WEL_SBS_CONSTANTS

General
    cluster: wel.consts
    description: "ScrollBar style (SBS) messages."

Ancestors
    ANY

Queries
    sbs_bottomalign: INTEGER
    sbs_horz: INTEGER
    sbs_leftalign: INTEGER
    sbs_rightalign: INTEGER
    sbs_sizebox: INTEGER
    sbs_sizeboxbottomrightalign: INTEGER
    sbs_sizeboxtopleftalign: INTEGER
    sbs_topalign: INTEGER
    sbs_vert: INTEGER


WEL_SBS_CONSTANTS Flat contracts

indexing
    description: "ScrollBar style (SBS) messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SBS_CONSTANTS

feature -- Access

    sbs_bottomalign: INTEGER

    sbs_horz: INTEGER

    sbs_leftalign: INTEGER

    sbs_rightalign: INTEGER

    sbs_sizebox: INTEGER

    sbs_sizeboxbottomrightalign: INTEGER

    sbs_sizeboxtopleftalign: INTEGER

    sbs_topalign: INTEGER

    sbs_vert: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SBS_CONSTANTS


WEL_SBT_CONSTANTS Chart

class
    WEL_SBT_CONSTANTS

General
    cluster: wel.consts
    description: "Status window text constants."

Ancestors
    ANY

Queries
    Sbt_borders: INTEGER
    sbt_noborders: INTEGER
    sbt_ownerdraw: INTEGER
    sbt_popout: INTEGER


WEL_SBT_CONSTANTS Flat contracts

indexing
    description: "Status window text constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SBT_CONSTANTS

feature -- Access

    Sbt_borders: INTEGER is 0
            -- The text is drawn with a border to appear
            -- lower than the plane of the window.

    sbt_noborders: INTEGER
            -- The text is drawn without borders.

    sbt_ownerdraw: INTEGER
            -- The text is drawn by the parent window.

    sbt_popout: INTEGER
            -- The text is drawn with a border to appear
            -- higher than the plane of the window.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SBT_CONSTANTS


WEL_SB_CONSTANTS Chart

class
    WEL_SB_CONSTANTS

General
    cluster: wel.consts
    description: "ScrollBar (SB) messages."

Ancestors
    ANY

Queries
    Sb_both: INTEGER
    Sb_bottom: INTEGER
    Sb_ctl: INTEGER
    Sb_endscroll: INTEGER
    Sb_horz: INTEGER
    Sb_left: INTEGER
    Sb_linedown: INTEGER
    Sb_lineleft: INTEGER
    Sb_lineright: INTEGER
    Sb_lineup: INTEGER
    Sb_pagedown: INTEGER
    Sb_pageleft: INTEGER
    Sb_pageright: INTEGER
    Sb_pageup: INTEGER
    Sb_right: INTEGER
    Sb_thumbposition: INTEGER
    Sb_thumbtrack: INTEGER
    Sb_top: INTEGER
    Sb_vert: INTEGER


WEL_SB_CONSTANTS Flat contracts

indexing
    description: "ScrollBar (SB) messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SB_CONSTANTS

feature -- Access

    Sb_both: INTEGER is 3
            -- Declared in Windows as SB_BOTH

    Sb_bottom: INTEGER is 7
            -- Declared in Windows as SB_BOTTOM

    Sb_ctl: INTEGER is 2
            -- Declared in Windows as SB_CTL

    Sb_endscroll: INTEGER is 8
            -- Declared in Windows as SB_ENDSCROLL

    Sb_horz: INTEGER is 0
            -- Declared in Windows as SB_HORZ

    Sb_left: INTEGER is 6
            -- Declared in Windows as SB_LEFT

    Sb_linedown: INTEGER is 1
            -- Declared in Windows as SB_LINEDOWN

    Sb_lineleft: INTEGER is 0
            -- Declared in Windows as SB_LINELEFT

    Sb_lineright: INTEGER is 1
            -- Declared in Windows as SB_LINERIGHT

    Sb_lineup: INTEGER is 0
            -- Declared in Windows as SB_LINEUP

    Sb_pagedown: INTEGER is 3
            -- Declared in Windows as SB_PAGEDOWN

    Sb_pageleft: INTEGER is 2
            -- Declared in Windows as SB_PAGELEFT

    Sb_pageright: INTEGER is 3
            -- Declared in Windows as SB_PAGERIGHT

    Sb_pageup: INTEGER is 2
            -- Declared in Windows as SB_PAGEUP

    Sb_right: INTEGER is 7
            -- Declared in Windows as SB_RIGHT

    Sb_thumbposition: INTEGER is 4
            -- Declared in Windows as SB_THUMBPOSITION

    Sb_thumbtrack: INTEGER is 5
            -- Declared in Windows as SB_THUMBTRACK

    Sb_top: INTEGER is 6
            -- Declared in Windows as SB_TOP

    Sb_vert: INTEGER is 1
            -- Declared in Windows as SB_VERT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SB_CONSTANTS


WEL_SCF_CONSTANTS Chart

class
    WEL_SCF_CONSTANTS

General
    cluster: wel.consts
    description: "Set Character Format constants."

Ancestors
    ANY

Queries
    Scf_all: INTEGER
    Scf_selection: INTEGER
    Scf_word: INTEGER


WEL_SCF_CONSTANTS Flat contracts

indexing
    description: "Set Character Format constants."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SCF_CONSTANTS

feature -- Access

    Scf_all: INTEGER is 4
            -- Apply format to all text.

    Scf_selection: INTEGER is 1
            -- Apply format to selection only.

    Scf_word: INTEGER is 2
            -- Apply format to word only.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SCF_CONSTANTS


WEL_SC_CONSTANTS Chart

class
    WEL_SC_CONSTANTS

General
    cluster: wel.consts
    description: "System Command (SC) constants for the Wm_syscommand message."

Ancestors
    ANY

Queries
    sc_arrange: INTEGER
    sc_close: INTEGER
    sc_hotkey: INTEGER
    sc_hscroll: INTEGER
    sc_keymenu: INTEGER
    sc_maximize: INTEGER
    sc_minimize: INTEGER
    sc_mousemenu: INTEGER
    sc_move: INTEGER
    sc_nextwindow: INTEGER
    sc_prevwindow: INTEGER
    sc_restore: INTEGER
    sc_screensave: INTEGER
    sc_size: INTEGER
    sc_tasklist: INTEGER
    sc_vscroll: INTEGER


WEL_SC_CONSTANTS Flat contracts

indexing
    description: "System Command (SC) constants for the Wm_syscommand message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SC_CONSTANTS

feature -- Access

    sc_arrange: INTEGER

    sc_close: INTEGER

    sc_hotkey: INTEGER

    sc_hscroll: INTEGER

    sc_keymenu: INTEGER

    sc_maximize: INTEGER

    sc_minimize: INTEGER

    sc_mousemenu: INTEGER

    sc_move: INTEGER

    sc_nextwindow: INTEGER

    sc_prevwindow: INTEGER

    sc_restore: INTEGER

    sc_screensave: INTEGER

    sc_size: INTEGER

    sc_tasklist: INTEGER

    sc_vscroll: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SC_CONSTANTS


WEL_SF_CONSTANTS Chart

class
    WEL_SF_CONSTANTS

General
    cluster: wel.consts
    description: "Stream format (SF) constants for the rich edit control."

Ancestors
    ANY

Queries
    Sf_rtf: INTEGER
    Sf_rtfnoobjs: INTEGER
    Sf_text: INTEGER
    Sf_textized: INTEGER
    Sff_selection: INTEGER


WEL_SF_CONSTANTS Flat contracts

indexing
    description: "Stream format (SF) constants for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SF_CONSTANTS

feature -- Access

    Sf_rtf: INTEGER is 2
            -- Rich-text format (RTF).

    Sf_rtfnoobjs: INTEGER is 3
            -- RTF with spaces in place of OLE object.

    Sf_text: INTEGER is 1
            -- Text with spaces in place of OLE objects.

    Sf_textized: INTEGER is 4
            -- Text with a text representation of OLE objects.

    Sff_selection: INTEGER is 32768
            -- Selection only.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SF_CONSTANTS


WEL_SIZE_CONSTANTS Chart

class
    WEL_SIZE_CONSTANTS

General
    cluster: wel.consts
    description: "Size (SIZE) constants."

Ancestors
    ANY

Queries
    Size_maxhide: INTEGER
    Size_maximized: INTEGER
    Size_maxshow: INTEGER
    Size_minimized: INTEGER
    Size_restored: INTEGER


WEL_SIZE_CONSTANTS Flat contracts

indexing
    description: "Size (SIZE) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SIZE_CONSTANTS

feature -- Access

    Size_maxhide: INTEGER is 4
            -- Declared in Windows as SIZE_MAXHIDE

    Size_maximized: INTEGER is 2
            -- Declared in Windows as SIZE_MAXIMIZED

    Size_maxshow: INTEGER is 3
            -- Declared in Windows as SIZE_MAXSHOW

    Size_minimized: INTEGER is 1
            -- Declared in Windows as SIZE_MINIMIZED

    Size_restored: INTEGER is 0
            -- Declared in Windows as SIZE_RESTORED

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SIZE_CONSTANTS


WEL_SM_CONSTANTS Chart

class
    WEL_SM_CONSTANTS

General
    cluster: wel.consts
    description: "SystemMetric (SM) constants."

Ancestors
    ANY

Queries
    Sm_cmetrics: INTEGER
    Sm_cxborder: INTEGER
    Sm_cxcursor: INTEGER
    Sm_cxdlgframe: INTEGER
    Sm_cxdoubleclk: INTEGER
    Sm_cxframe: INTEGER
    Sm_cxfullscreen: INTEGER
    Sm_cxhscroll: INTEGER
    Sm_cxhthumb: INTEGER
    Sm_cxicon: INTEGER
    Sm_cxiconspacing: INTEGER
    Sm_cxmaximized: INTEGER
    Sm_cxmin: INTEGER
    Sm_cxmintrack: INTEGER
    Sm_cxscreen: INTEGER
    Sm_cxsize: INTEGER
    Sm_cxvscroll: INTEGER
    Sm_cyborder: INTEGER
    Sm_cycaption: INTEGER
    Sm_cycursor: INTEGER
    Sm_cydlgframe: INTEGER
    Sm_cydoubleclk: INTEGER
    Sm_cyframe: INTEGER
    Sm_cyfullscreen: INTEGER
    Sm_cyhscroll: INTEGER
    Sm_cyicon: INTEGER
    Sm_cyiconspacing: INTEGER
    Sm_cykanjiwindow: INTEGER
    Sm_cymaximized: INTEGER
    Sm_cymenu: INTEGER
    Sm_cymin: INTEGER
    Sm_cymintrack: INTEGER
    Sm_cyscreen: INTEGER
    Sm_cysize: INTEGER
    Sm_cyvscroll: INTEGER
    Sm_cyvthumb: INTEGER
    Sm_dbcsenabled: INTEGER
    Sm_debug: INTEGER
    Sm_menudropalignment: INTEGER
    Sm_mousepresent: INTEGER
    Sm_penwindows: INTEGER
    Sm_reserved1: INTEGER
    Sm_reserved2: INTEGER
    Sm_reserved3: INTEGER
    Sm_reserved4: INTEGER
    Sm_swapbutton: INTEGER


WEL_SM_CONSTANTS Flat contracts

indexing
    description: "SystemMetric (SM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SM_CONSTANTS

feature -- Access

    Sm_cmetrics: INTEGER is 76

    Sm_cxborder: INTEGER is 5

    Sm_cxcursor: INTEGER is 13

    Sm_cxdlgframe: INTEGER is 7

    Sm_cxdoubleclk: INTEGER is 36

    Sm_cxframe: INTEGER is 32

    Sm_cxfullscreen: INTEGER is 16

    Sm_cxhscroll: INTEGER is 21

    Sm_cxhthumb: INTEGER is 10

    Sm_cxicon: INTEGER is 11

    Sm_cxiconspacing: INTEGER is 38

    Sm_cxmaximized: INTEGER is 61

    Sm_cxmin: INTEGER is 28

    Sm_cxmintrack: INTEGER is 34

    Sm_cxscreen: INTEGER is 0

    Sm_cxsize: INTEGER is 30

    Sm_cxvscroll: INTEGER is 2

    Sm_cyborder: INTEGER is 6

    Sm_cycaption: INTEGER is 4

    Sm_cycursor: INTEGER is 14

    Sm_cydlgframe: INTEGER is 8

    Sm_cydoubleclk: INTEGER is 37

    Sm_cyframe: INTEGER is 33

    Sm_cyfullscreen: INTEGER is 17

    Sm_cyhscroll: INTEGER is 3

    Sm_cyicon: INTEGER is 12

    Sm_cyiconspacing: INTEGER is 39

    Sm_cykanjiwindow: INTEGER is 18

    Sm_cymaximized: INTEGER is 62

    Sm_cymenu: INTEGER is 15

    Sm_cymin: INTEGER is 29

    Sm_cymintrack: INTEGER is 35

    Sm_cyscreen: INTEGER is 1

    Sm_cysize: INTEGER is 31

    Sm_cyvscroll: INTEGER is 20

    Sm_cyvthumb: INTEGER is 9

    Sm_dbcsenabled: INTEGER is 42

    Sm_debug: INTEGER is 22

    Sm_menudropalignment: INTEGER is 40

    Sm_mousepresent: INTEGER is 19

    Sm_penwindows: INTEGER is 41

    Sm_reserved1: INTEGER is 24

    Sm_reserved2: INTEGER is 25

    Sm_reserved3: INTEGER is 26

    Sm_reserved4: INTEGER is 27

    Sm_swapbutton: INTEGER is 23

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SM_CONSTANTS


WEL_SPI_CONSTANTS Chart

class
    WEL_SPI_CONSTANTS

General
    cluster: wel.consts
    description: "SPI constants for SystemParametersInfo."

Ancestors
    ANY

Queries
    Spi_getaccesstimeout: INTEGER
    Spi_getactivewindowtracking: INTEGER
    Spi_getactivewndtrktimeout: INTEGER
    Spi_getactivewndtrkzorder: INTEGER
    Spi_getanimation: INTEGER
    Spi_getbeep: INTEGER
    Spi_getborder: INTEGER
    Spi_getcaretwidth: INTEGER
    Spi_getcomboboxanimation: INTEGER
    Spi_getcursorshadow: INTEGER
    Spi_getdefaultinputlang: INTEGER
    Spi_getdeskwallpaper: INTEGER
    Spi_getdragfullwindows: INTEGER
    Spi_getfasttaskswitch: INTEGER
    Spi_getfilterkeys: INTEGER
    Spi_getfontsmoothing: INTEGER
    Spi_getforegroundflashcount: INTEGER
    Spi_getforegroundlocktimeout: INTEGER
    Spi_getgradientcaptions: INTEGER
    Spi_getgridgranularity: INTEGER
    Spi_gethighcontrast: INTEGER
    Spi_gethottracking: INTEGER
    Spi_geticonmetrics: INTEGER
    Spi_geticontitlelogfont: INTEGER
    Spi_geticontitlewrap: INTEGER
    Spi_getkeyboardcues: INTEGER
    Spi_getkeyboarddelay: INTEGER
    Spi_getkeyboardpref: INTEGER
    Spi_getkeyboardspeed: INTEGER
    Spi_getlistboxsmoothscrolling: INTEGER
    Spi_getlowpoweractive: INTEGER
    Spi_getlowpowertimeout: INTEGER
    Spi_getmenuanimation: INTEGER
    Spi_getmenudropalignment: INTEGER
    Spi_getmenufade: INTEGER
    Spi_getmenushowdelay: INTEGER
    Spi_getmenuunderlines: INTEGER
    Spi_getminimizedmetrics: INTEGER
    Spi_getmouse: INTEGER
    Spi_getmousehoverheight: INTEGER
    Spi_getmousehovertime: INTEGER
    Spi_getmousehoverwidth: INTEGER
    Spi_getmousekeys: INTEGER
    Spi_getmousespeed: INTEGER
    Spi_getmousetrails: INTEGER
    Spi_getnonclientmetrics: INTEGER
    Spi_getpoweroffactive: INTEGER
    Spi_getpowerofftimeout: INTEGER
    Spi_getscreenreader: INTEGER
    Spi_getscreensaveactive: INTEGER
    Spi_getscreensaverrunning: INTEGER
    Spi_getscreensavetimeout: INTEGER
    Spi_getselectionfade: INTEGER
    Spi_getserialkeys: INTEGER
    Spi_getshowimeui: INTEGER
    Spi_getshowsounds: INTEGER
    Spi_getsnaptodefbutton: INTEGER
    Spi_getsoundsentry: INTEGER
    Spi_getstickykeys: INTEGER
    Spi_gettogglekeys: INTEGER
    Spi_gettooltipanimation: INTEGER
    Spi_gettooltipfade: INTEGER
    Spi_getuieffects: INTEGER
    Spi_getwheelscrolllines: INTEGER
    Spi_getwindowsextension: INTEGER
    Spi_getworkarea: INTEGER
    Spi_iconhorizontalspacing: INTEGER
    Spi_iconverticalspacing: INTEGER
    Spi_langdriver: INTEGER
    Spi_screensaverrunning: INTEGER
    Spi_setaccesstimeout: INTEGER
    Spi_setactivewindowtracking: INTEGER
    Spi_setactivewndtrktimeout: INTEGER
    Spi_setactivewndtrkzorder: INTEGER
    Spi_setanimation: INTEGER
    Spi_setbeep: INTEGER
    Spi_setborder: INTEGER
    Spi_setcaretwidth: INTEGER
    Spi_setcomboboxanimation: INTEGER
    Spi_setcursors: INTEGER
    Spi_setcursorshadow: INTEGER
    Spi_setdefaultinputlang: INTEGER
    Spi_setdeskpattern: INTEGER
    Spi_setdeskwallpaper: INTEGER
    Spi_setdoubleclicktime: INTEGER
    Spi_setdoubleclkheight: INTEGER
    Spi_setdoubleclkwidth: INTEGER
    Spi_setdragfullwindows: INTEGER
    Spi_setdragheight: INTEGER
    Spi_setdragwidth: INTEGER
    Spi_setfasttaskswitch: INTEGER
    Spi_setfilterkeys: INTEGER
    Spi_setfontsmoothing: INTEGER
    Spi_setforegroundflashcount: INTEGER
    Spi_setforegroundlocktimeout: INTEGER
    Spi_setgradientcaptions: INTEGER
    Spi_setgridgranularity: INTEGER
    Spi_sethandheld: INTEGER
    Spi_sethighcontrast: INTEGER
    Spi_sethottracking: INTEGER
    Spi_seticonmetrics: INTEGER
    Spi_seticons: INTEGER
    Spi_seticontitlelogfont: INTEGER
    Spi_seticontitlewrap: INTEGER
    Spi_setkeyboardcues: INTEGER
    Spi_setkeyboarddelay: INTEGER
    Spi_setkeyboardpref: INTEGER
    Spi_setkeyboardspeed: INTEGER
    Spi_setlangtoggle: INTEGER
    Spi_setlistboxsmoothscrolling: INTEGER
    Spi_setlowpoweractive: INTEGER
    Spi_setlowpowertimeout: INTEGER
    Spi_setmenuanimation: INTEGER
    Spi_setmenudropalignment: INTEGER
    Spi_setmenufade: INTEGER
    Spi_setmenushowdelay: INTEGER
    Spi_setmenuunderlines: INTEGER
    Spi_setminimizedmetrics: INTEGER
    Spi_setmouse: INTEGER
    Spi_setmousebuttonswap: INTEGER
    Spi_setmousehoverheight: INTEGER
    Spi_setmousehovertime: INTEGER
    Spi_setmousehoverwidth: INTEGER
    Spi_setmousekeys: INTEGER
    Spi_setmousespeed: INTEGER
    Spi_setmousetrails: INTEGER
    Spi_setnonclientmetrics: INTEGER
    Spi_setpenwindows: INTEGER
    Spi_setpoweroffactive: INTEGER
    Spi_setpowerofftimeout: INTEGER
    Spi_setscreenreader: INTEGER
    Spi_setscreensaveactive: INTEGER
    Spi_setscreensaverrunning: INTEGER
    Spi_setscreensavetimeout: INTEGER
    Spi_setselectionfade: INTEGER
    Spi_setserialkeys: INTEGER
    Spi_setshowimeui: INTEGER
    Spi_setshowsounds: INTEGER
    Spi_setsnaptodefbutton: INTEGER
    Spi_setsoundsentry: INTEGER
    Spi_setstickykeys: INTEGER
    Spi_settogglekeys: INTEGER
    Spi_settooltipanimation: INTEGER
    Spi_settooltipfade: INTEGER
    Spi_setuieffects: INTEGER
    Spi_setwheelscrolllines: INTEGER
    Spi_setworkarea: INTEGER
    Spif_sendchange: INTEGER
    Spif_sendwininichange: INTEGER
    Spif_updateinifile: INTEGER


WEL_SPI_CONSTANTS Flat contracts

indexing
    description: "SPI constants for SystemParametersInfo."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SPI_CONSTANTS

feature -- SystemParameter (All Windows)

    Spi_getaccesstimeout: INTEGER is 60
            -- Declared in Windows as SPI_GETACCESSTIMEOUT

    Spi_getanimation: INTEGER is 72
            -- Declared in Windows as SPI_GETANIMATION

    Spi_getbeep: INTEGER is 1
            -- Declared in Windows as SPI_GETBEEP

    Spi_getborder: INTEGER is 5
            -- Declared in Windows as SPI_GETBORDER

    Spi_getdefaultinputlang: INTEGER is 89
            -- Declared in Windows as SPI_GETDEFAULTINPUTLANG

    Spi_getdragfullwindows: INTEGER is 38
            -- Declared in Windows as SPI_GETDRAGFULLWINDOWS

    Spi_getfasttaskswitch: INTEGER is 35
            -- Declared in Windows as SPI_GETFASTTASKSWITCH

    Spi_getfilterkeys: INTEGER is 50
            -- Declared in Windows as SPI_GETFILTERKEYS

    Spi_getfontsmoothing: INTEGER is 74
            -- Declared in Windows as SPI_GETFONTSMOOTHING

    Spi_getgridgranularity: INTEGER is 18
            -- Declared in Windows as SPI_GETGRIDGRANULARITY

    Spi_gethighcontrast: INTEGER is 66
            -- Declared in Windows as SPI_GETHIGHCONTRAST

    Spi_geticonmetrics: INTEGER is 45
            -- Declared in Windows as SPI_GETICONMETRICS

    Spi_geticontitlelogfont: INTEGER is 31
            -- Declared in Windows as SPI_GETICONTITLELOGFONT

    Spi_geticontitlewrap: INTEGER is 25
            -- Declared in Windows as SPI_GETICONTITLEWRAP

    Spi_getkeyboarddelay: INTEGER is 22
            -- Declared in Windows as SPI_GETKEYBOARDDELAY

    Spi_getkeyboardpref: INTEGER is 68
            -- Declared in Windows as SPI_GETKEYBOARDPREF

    Spi_getkeyboardspeed: INTEGER is 10
            -- Declared in Windows as SPI_GETKEYBOARDSPEED

    Spi_getlowpoweractive: INTEGER is 83
            -- Declared in Windows as SPI_GETLOWPOWERACTIVE

    Spi_getlowpowertimeout: INTEGER is 79
            -- Declared in Windows as SPI_GETLOWPOWERTIMEOUT

    Spi_getmenudropalignment: INTEGER is 27
            -- Declared in Windows as SPI_GETMENUDROPALIGNMENT

    Spi_getminimizedmetrics: INTEGER is 43
            -- Declared in Windows as SPI_GETMINIMIZEDMETRICS

    Spi_getmouse: INTEGER is 3
            -- Declared in Windows as SPI_GETMOUSE

    Spi_getmousekeys: INTEGER is 54
            -- Declared in Windows as SPI_GETMOUSEKEYS

    Spi_getmousetrails: INTEGER is 94
            -- Declared in Windows as SPI_GETMOUSETRAILS

    Spi_getnonclientmetrics: INTEGER is 41
            -- Declared in Windows as SPI_GETNONCLIENTMETRICS

    Spi_getpoweroffactive: INTEGER is 84
            -- Declared in Windows as SPI_GETPOWEROFFACTIVE

    Spi_getpowerofftimeout: INTEGER is 80
            -- Declared in Windows as SPI_GETPOWEROFFTIMEOUT

    Spi_getscreenreader: INTEGER is 70
            -- Declared in Windows as SPI_GETSCREENREADER

    Spi_getscreensaveactive: INTEGER is 16
            -- Declared in Windows as SPI_GETSCREENSAVEACTIVE

    Spi_getscreensavetimeout: INTEGER is 14
            -- Declared in Windows as SPI_GETSCREENSAVETIMEOUT

    Spi_getserialkeys: INTEGER is 62
            -- Declared in Windows as SPI_GETSERIALKEYS

    Spi_getshowsounds: INTEGER is 56
            -- Declared in Windows as SPI_GETSHOWSOUNDS

    Spi_getsnaptodefbutton: INTEGER is 95
            -- Declared in Windows as SPI_GETSNAPTODEFBUTTON

    Spi_getsoundsentry: INTEGER is 64
            -- Declared in Windows as SPI_GETSOUNDSENTRY

    Spi_getstickykeys: INTEGER is 58
            -- Declared in Windows as SPI_GETSTICKYKEYS

    Spi_gettogglekeys: INTEGER is 52
            -- Declared in Windows as SPI_GETTOGGLEKEYS

    Spi_getwindowsextension: INTEGER is 92
            -- Declared in Windows as SPI_GETWINDOWSEXTENSION

    Spi_getworkarea: INTEGER is 48
            -- Declared in Windows as SPI_GETWORKAREA

    Spi_iconhorizontalspacing: INTEGER is 13
            -- Declared in Windows as SPI_ICONHORIZONTALSPACING

    Spi_iconverticalspacing: INTEGER is 24
            -- Declared in Windows as SPI_ICONVERTICALSPACING

    Spi_langdriver: INTEGER is 12
            -- Declared in Windows as SPI_LANGDRIVER

    Spi_screensaverrunning: INTEGER is 97
            -- Declared in Windows as SPI_SCREENSAVERRUNNING

    Spi_setaccesstimeout: INTEGER is 61
            -- Declared in Windows as SPI_SETACCESSTIMEOUT

    Spi_setanimation: INTEGER is 73
            -- Declared in Windows as SPI_SETANIMATION

    Spi_setbeep: INTEGER is 2
            -- Declared in Windows as SPI_SETBEEP

    Spi_setborder: INTEGER is 6
            -- Declared in Windows as SPI_SETBORDER

    Spi_setcursors: INTEGER is 87
            -- Declared in Windows as SPI_SETCURSORS

    Spi_setdefaultinputlang: INTEGER is 90
            -- Declared in Windows as SPI_SETDEFAULTINPUTLANG

    Spi_setdeskpattern: INTEGER is 21
            -- Declared in Windows as SPI_SETDESKPATTERN

    Spi_setdeskwallpaper: INTEGER is 20
            -- Declared in Windows as SPI_SETDESKWALLPAPER

    Spi_setdoubleclicktime: INTEGER is 32
            -- Declared in Windows as SPI_SETDOUBLECLICKTIME

    Spi_setdoubleclkheight: INTEGER is 30
            -- Declared in Windows as SPI_SETDOUBLECLKHEIGHT

    Spi_setdoubleclkwidth: INTEGER is 29
            -- Declared in Windows as SPI_SETDOUBLECLKWIDTH

    Spi_setdragfullwindows: INTEGER is 37
            -- Declared in Windows as SPI_SETDRAGFULLWINDOWS

    Spi_setdragheight: INTEGER is 77
            -- Declared in Windows as SPI_SETDRAGHEIGHT

    Spi_setdragwidth: INTEGER is 76
            -- Declared in Windows as SPI_SETDRAGWIDTH

    Spi_setfasttaskswitch: INTEGER is 36
            -- Declared in Windows as SPI_SETFASTTASKSWITCH

    Spi_setfilterkeys: INTEGER is 51
            -- Declared in Windows as SPI_SETFILTERKEYS

    Spi_setfontsmoothing: INTEGER is 75
            -- Declared in Windows as SPI_SETFONTSMOOTHING

    Spi_setgridgranularity: INTEGER is 19
            -- Declared in Windows as SPI_SETGRIDGRANULARITY

    Spi_sethandheld: INTEGER is 78
            -- Declared in Windows as SPI_SETHANDHELD

    Spi_sethighcontrast: INTEGER is 67
            -- Declared in Windows as SPI_SETHIGHCONTRAST

    Spi_seticonmetrics: INTEGER is 46
            -- Declared in Windows as SPI_SETICONMETRICS

    Spi_seticons: INTEGER is 88
            -- Declared in Windows as SPI_SETICONS

    Spi_seticontitlelogfont: INTEGER is 34
            -- Declared in Windows as SPI_SETICONTITLELOGFONT

    Spi_seticontitlewrap: INTEGER is 26
            -- Declared in Windows as SPI_SETICONTITLEWRAP

    Spi_setkeyboarddelay: INTEGER is 23
            -- Declared in Windows as SPI_SETKEYBOARDDELAY

    Spi_setkeyboardpref: INTEGER is 69
            -- Declared in Windows as SPI_SETKEYBOARDPREF

    Spi_setkeyboardspeed: INTEGER is 11
            -- Declared in Windows as SPI_SETKEYBOARDSPEED

    Spi_setlangtoggle: INTEGER is 91
            -- Declared in Windows as SPI_SETLANGTOGGLE

    Spi_setlowpoweractive: INTEGER is 85
            -- Declared in Windows as SPI_SETLOWPOWERACTIVE

    Spi_setlowpowertimeout: INTEGER is 81
            -- Declared in Windows as SPI_SETLOWPOWERTIMEOUT

    Spi_setmenudropalignment: INTEGER is 28
            -- Declared in Windows as SPI_SETMENUDROPALIGNMENT

    Spi_setminimizedmetrics: INTEGER is 44
            -- Declared in Windows as SPI_SETMINIMIZEDMETRICS

    Spi_setmouse: INTEGER is 4
            -- Declared in Windows as SPI_SETMOUSE

    Spi_setmousebuttonswap: INTEGER is 33
            -- Declared in Windows as SPI_SETMOUSEBUTTONSWAP

    Spi_setmousekeys: INTEGER is 55
            -- Declared in Windows as SPI_SETMOUSEKEYS

    Spi_setmousetrails: INTEGER is 93
            -- Declared in Windows as SPI_SETMOUSETRAILS

    Spi_setnonclientmetrics: INTEGER is 42
            -- Declared in Windows as SPI_SETNONCLIENTMETRICS

    Spi_setpenwindows: INTEGER is 49
            -- Declared in Windows as SPI_SETPENWINDOWS

    Spi_setpoweroffactive: INTEGER is 86
            -- Declared in Windows as SPI_SETPOWEROFFACTIVE

    Spi_setpowerofftimeout: INTEGER is 82
            -- Declared in Windows as SPI_SETPOWEROFFTIMEOUT

    Spi_setscreenreader: INTEGER is 71
            -- Declared in Windows as SPI_SETSCREENREADER

    Spi_setscreensaveactive: INTEGER is 17
            -- Declared in Windows as SPI_SETSCREENSAVEACTIVE

    Spi_setscreensaverrunning: INTEGER is 97
            -- Declared in Windows as SPI_SETSCREENSAVERRUNNING

    Spi_setscreensavetimeout: INTEGER is 15
            -- Declared in Windows as SPI_SETSCREENSAVETIMEOUT

    Spi_setserialkeys: INTEGER is 63
            -- Declared in Windows as SPI_SETSERIALKEYS

    Spi_setshowsounds: INTEGER is 57
            -- Declared in Windows as SPI_SETSHOWSOUNDS

    Spi_setsnaptodefbutton: INTEGER is 96
            -- Declared in Windows as SPI_SETSNAPTODEFBUTTON

    Spi_setsoundsentry: INTEGER is 65
            -- Declared in Windows as SPI_SETSOUNDSENTRY

    Spi_setstickykeys: INTEGER is 59
            -- Declared in Windows as SPI_SETSTICKYKEYS

    Spi_settogglekeys: INTEGER is 53
            -- Declared in Windows as SPI_SETTOGGLEKEYS

    Spi_setworkarea: INTEGER is 47
            -- Declared in Windows as SPI_SETWORKAREA

feature -- SystemParameter (Windows 98, Windows 2000 and above)

    Spi_getactivewindowtracking: INTEGER is 4096
            -- Declared in Windows as SPI_GETACTIVEWINDOWTRACKING

    Spi_getactivewndtrktimeout: INTEGER is 8194
            -- Declared in Windows as SPI_GETACTIVEWNDTRKTIMEOUT

    Spi_getactivewndtrkzorder: INTEGER is 4108
            -- Declared in Windows as SPI_GETACTIVEWNDTRKZORDER

    Spi_getcaretwidth: INTEGER is 8198
            -- Declared in Windows as SPI_GETCARETWIDTH

    Spi_getcomboboxanimation: INTEGER is 4100
            -- Declared in Windows as SPI_GETCOMBOBOXANIMATION

    Spi_getcursorshadow: INTEGER is 4122
            -- Declared in Windows as SPI_GETCURSORSHADOW

    Spi_getdeskwallpaper: INTEGER is 115
            -- Declared in Windows as SPI_GETDESKWALLPAPER

    Spi_getforegroundflashcount: INTEGER is 8196
            -- Declared in Windows as SPI_GETFOREGROUNDFLASHCOUNT

    Spi_getforegroundlocktimeout: INTEGER is 8192
            -- Declared in Windows as SPI_GETFOREGROUNDLOCKTIMEOUT

    Spi_getgradientcaptions: INTEGER is 4104
            -- Declared in Windows as SPI_GETGRADIENTCAPTIONS

    Spi_gethottracking: INTEGER is 4110
            -- Declared in Windows as SPI_GETHOTTRACKING

    Spi_getkeyboardcues: INTEGER is 4106
            -- Declared in Windows as SPI_GETKEYBOARDCUES

    Spi_getlistboxsmoothscrolling: INTEGER is 4102
            -- Declared in Windows as SPI_GETLISTBOXSMOOTHSCROLLING

    Spi_getmenuanimation: INTEGER is 4098
            -- Declared in Windows as SPI_GETMENUANIMATION

    Spi_getmenufade: INTEGER is 4114
            -- Declared in Windows as SPI_GETMENUFADE

    Spi_getmenuunderlines: INTEGER is 4106
            -- Declared in Windows as SPI_GETMENUUNDERLINES

    Spi_getmousespeed: INTEGER is 112
            -- Declared in Windows as SPI_GETMOUSESPEED

    Spi_getscreensaverrunning: INTEGER is 114
            -- Declared in Windows as SPI_GETSCREENSAVERRUNNING

    Spi_getselectionfade: INTEGER is 4116
            -- Declared in Windows as SPI_GETSELECTIONFADE

    Spi_gettooltipanimation: INTEGER is 4118
            -- Declared in Windows as SPI_GETTOOLTIPANIMATION

    Spi_gettooltipfade: INTEGER is 4120
            -- Declared in Windows as SPI_GETTOOLTIPFADE

    Spi_getuieffects: INTEGER is 4158
            -- Declared in Windows as SPI_GETUIEFFECTS

    Spi_setactivewindowtracking: INTEGER is 4097
            -- Declared in Windows as SPI_SETACTIVEWINDOWTRACKING

    Spi_setactivewndtrktimeout: INTEGER is 8195
            -- Declared in Windows as SPI_SETACTIVEWNDTRKTIMEOUT

    Spi_setactivewndtrkzorder: INTEGER is 4109
            -- Declared in Windows as SPI_SETACTIVEWNDTRKZORDER

    Spi_setcaretwidth: INTEGER is 8199
            -- Declared in Windows as SPI_SETCARETWIDTH

    Spi_setcomboboxanimation: INTEGER is 4101
            -- Declared in Windows as SPI_SETCOMBOBOXANIMATION

    Spi_setcursorshadow: INTEGER is 4123
            -- Declared in Windows as SPI_SETCURSORSHADOW

    Spi_setforegroundflashcount: INTEGER is 8197
            -- Declared in Windows as SPI_SETFOREGROUNDFLASHCOUNT

    Spi_setforegroundlocktimeout: INTEGER is 8193
            -- Declared in Windows as SPI_SETFOREGROUNDLOCKTIMEOUT

    Spi_setgradientcaptions: INTEGER is 4105
            -- Declared in Windows as SPI_SETGRADIENTCAPTIONS

    Spi_sethottracking: INTEGER is 4111
            -- Declared in Windows as SPI_SETHOTTRACKING

    Spi_setkeyboardcues: INTEGER is 4107
            -- Declared in Windows as SPI_SETKEYBOARDCUES

    Spi_setlistboxsmoothscrolling: INTEGER is 4103
            -- Declared in Windows as SPI_SETLISTBOXSMOOTHSCROLLING

    Spi_setmenuanimation: INTEGER is 4099
            -- Declared in Windows as SPI_SETMENUANIMATION

    Spi_setmenufade: INTEGER is 4115
            -- Declared in Windows as SPI_SETMENUFADE

    Spi_setmenuunderlines: INTEGER is 4107
            -- Declared in Windows as SPI_SETMENUUNDERLINES

    Spi_setmousespeed: INTEGER is 113
            -- Declared in Windows as SPI_SETMOUSESPEED

    Spi_setselectionfade: INTEGER is 4117
            -- Declared in Windows as SPI_SETSELECTIONFADE

    Spi_settooltipanimation: INTEGER is 4119
            -- Declared in Windows as SPI_SETTOOLTIPANIMATION

    Spi_settooltipfade: INTEGER is 4121
            -- Declared in Windows as SPI_SETTOOLTIPFADE

    Spi_setuieffects: INTEGER is 4159
            -- Declared in Windows as SPI_SETUIEFFECTS

feature -- SystemParameter (Windows NT 4.0, Windows 98, Windows 2000 and above)

    Spi_getmenushowdelay: INTEGER is 106
            -- Declared in Windows as SPI_GETMENUSHOWDELAY

    Spi_getmousehoverheight: INTEGER is 100
            -- Declared in Windows as SPI_GETMOUSEHOVERHEIGHT

    Spi_getmousehovertime: INTEGER is 102
            -- Declared in Windows as SPI_GETMOUSEHOVERTIME

    Spi_getmousehoverwidth: INTEGER is 98
            -- Declared in Windows as SPI_GETMOUSEHOVERWIDTH

    Spi_getshowimeui: INTEGER is 110
            -- Declared in Windows as SPI_GETSHOWIMEUI

    Spi_getwheelscrolllines: INTEGER is 104
            -- Declared in Windows as SPI_GETWHEELSCROLLLINES

    Spi_setmenushowdelay: INTEGER is 107
            -- Declared in Windows as SPI_SETMENUSHOWDELAY

    Spi_setmousehoverheight: INTEGER is 101
            -- Declared in Windows as SPI_SETMOUSEHOVERHEIGHT

    Spi_setmousehovertime: INTEGER is 103
            -- Declared in Windows as SPI_SETMOUSEHOVERTIME

    Spi_setmousehoverwidth: INTEGER is 99
            -- Declared in Windows as SPI_SETMOUSEHOVERWIDTH

    Spi_setshowimeui: INTEGER is 111
            -- Declared in Windows as SPI_SETSHOWIMEUI

    Spi_setwheelscrolllines: INTEGER is 105
            -- Declared in Windows as SPI_SETWHEELSCROLLLINES

feature -- SystemParameterInfo Flags (all Windows)

    Spif_sendchange: INTEGER is 2
            -- Declared in Windows as SPIF_SENDCHANGE

    Spif_sendwininichange: INTEGER is 2
            -- Declared in Windows as SPIF_SENDWININICHANGE

    Spif_updateinifile: INTEGER is 1
            -- Declared in Windows as SPIF_UPDATEINIFILE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SPI_CONSTANTS


WEL_SS_CONSTANTS Chart

class
    WEL_SS_CONSTANTS

General
    cluster: wel.consts
    description: "Static style (SS) constants."

Ancestors
    ANY

Queries
    Ss_bitmap: INTEGER
    Ss_blackframe: INTEGER
    Ss_blackrect: INTEGER
    Ss_center: INTEGER
    Ss_centerimage: INTEGER
    Ss_grayframe: INTEGER
    Ss_grayrect: INTEGER
    Ss_icon: INTEGER
    Ss_left: INTEGER
    Ss_leftnowordwrap: INTEGER
    Ss_noprefix: INTEGER
    Ss_notify: INTEGER
    Ss_ownerdraw: INTEGER
    Ss_right: INTEGER
    Ss_simple: INTEGER
    Ss_useritem: INTEGER
    Ss_whiteframe: INTEGER
    Ss_whiterect: INTEGER


WEL_SS_CONSTANTS Flat contracts

indexing
    description: "Static style (SS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SS_CONSTANTS

feature -- Access

    Ss_bitmap: INTEGER is 14

    Ss_blackframe: INTEGER is 7

    Ss_blackrect: INTEGER is 4

    Ss_center: INTEGER is 1

    Ss_centerimage: INTEGER is 512

    Ss_grayframe: INTEGER is 8

    Ss_grayrect: INTEGER is 5

    Ss_icon: INTEGER is 3

    Ss_left: INTEGER is 0

    Ss_leftnowordwrap: INTEGER is 12

    Ss_noprefix: INTEGER is 128

    Ss_notify: INTEGER is 256

    Ss_ownerdraw: INTEGER is 13

    Ss_right: INTEGER is 2

    Ss_simple: INTEGER is 11

    Ss_useritem: INTEGER is 10

    Ss_whiteframe: INTEGER is 9

    Ss_whiterect: INTEGER is 6

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SS_CONSTANTS


WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS Chart

class
    WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS

General
    cluster: wel.consts
    description: "Toolbar system-defined standard and view bitmaps constants."

Ancestors
    ANY

Queries
    std_copy: INTEGER
    std_cut: INTEGER
    std_delete: INTEGER
    std_filenew: INTEGER
    std_fileopen: INTEGER
    std_filesave: INTEGER
    std_find: INTEGER
    std_help: INTEGER
    std_paste: INTEGER
    std_print: INTEGER
    std_printpre: INTEGER
    std_properties: INTEGER
    std_redow: INTEGER
    std_replace: INTEGER
    std_undo: INTEGER
    valid_standard_tool_bar_bitmap_constant (c: INTEGER): BOOLEAN
    view_details: INTEGER
    view_largeicons: INTEGER
    view_list: INTEGER
    view_smallicons: INTEGER
    view_sortdate: INTEGER
    view_sortname: INTEGER
    view_sortsize: INTEGER
    view_sorttype: INTEGER


WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS Flat contracts

indexing
    description: "Toolbar system-defined standard and view bitmaps constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS

feature -- Access

    std_copy: INTEGER

    std_cut: INTEGER

    std_delete: INTEGER

    std_filenew: INTEGER

    std_fileopen: INTEGER

    std_filesave: INTEGER

    std_find: INTEGER

    std_help: INTEGER

    std_paste: INTEGER

    std_print: INTEGER

    std_printpre: INTEGER

    std_properties: INTEGER

    std_redow: INTEGER

    std_replace: INTEGER

    std_undo: INTEGER

    view_details: INTEGER

    view_largeicons: INTEGER

    view_list: INTEGER

    view_smallicons: INTEGER

    view_sortdate: INTEGER

    view_sortname: INTEGER

    view_sortsize: INTEGER

    view_sorttype: INTEGER

feature -- Status report

    valid_standard_tool_bar_bitmap_constant (c: INTEGER): BOOLEAN
            -- Is c a valid standard tool bar bitmap constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS


WEL_STARTUP_CONSTANTS Chart

class
    WEL_STARTUP_CONSTANTS

General
    cluster: wel.consts
    description: "Process creation flags."

Ancestors
    WEL_BIT_OPERATIONS

Queries
    is_valid_startup_flag (a_flag: INTEGER): BOOLEAN
    is_valid_startup_flags (a_flags: INTEGER): BOOLEAN
    startf_force_off_feedback: INTEGER
    startf_force_on_feedback: INTEGER
    startf_use_count_chars: INTEGER
    startf_use_fill_attributes: INTEGER
    startf_use_position: INTEGER
    startf_use_show_window: INTEGER
    startf_use_size: INTEGER
    startf_use_std_handles: INTEGER


WEL_STARTUP_CONSTANTS Flat contracts

indexing
    description: "Process creation flags."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STARTUP_CONSTANTS

feature -- Access

    is_valid_startup_flag (a_flag: INTEGER): BOOLEAN
            -- Is a_flag a valid startup flag?

    is_valid_startup_flags (a_flags: INTEGER): BOOLEAN
            -- Is a_flags a valid startup flags combination?

    startf_force_off_feedback: INTEGER
            -- Feedback cursor forced off

    startf_force_on_feedback: INTEGER
            -- Cursor set to feedback until window intialization is done

    startf_use_count_chars: INTEGER
            -- Attributes x_character_count and y_character_count from WEL_STARTUP_INFO are meaningful

    startf_use_fill_attributes: INTEGER
            -- Attribute fill_attributes from WEL_STARTUP_INFO is meaningful

    startf_use_position: INTEGER
            -- Attributes x_offset and y_offset from WEL_STARTUP_INFO are meaningful

    startf_use_show_window: INTEGER
            -- Attribute show_command from WEL_STARTUP_INFO is meaningful

    startf_use_size: INTEGER
            -- Attributes width and height from WEL_STARTUP_INFO are meaningful

    startf_use_std_handles: INTEGER
            -- Attributes std_input, std_output and std_error from WEL_STARTUP_INFO are meaningful

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STARTUP_CONSTANTS


WEL_STATUS_WINDOW_CONSTANTS Chart

class
    WEL_STATUS_WINDOW_CONSTANTS

General
    cluster: wel.consts
    description: "Status window messages."

Ancestors
    ANY

Queries
    sb_getborders: INTEGER
    sb_getparts: INTEGER
    sb_getrect: INTEGER
    sb_gettext: INTEGER
    sb_gettextlength: INTEGER
    sb_setminheight: INTEGER
    sb_setparts: INTEGER
    sb_settext: INTEGER
    sb_simple: INTEGER


WEL_STATUS_WINDOW_CONSTANTS Flat contracts

indexing
    description: "Status window messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STATUS_WINDOW_CONSTANTS

feature -- Access

    sb_getborders: INTEGER

    sb_getparts: INTEGER

    sb_getrect: INTEGER

    sb_gettext: INTEGER

    sb_gettextlength: INTEGER

    sb_setminheight: INTEGER

    sb_setparts: INTEGER

    sb_settext: INTEGER

    sb_simple: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STATUS_WINDOW_CONSTANTS


WEL_STM_CONSTANTS Chart

class
    WEL_STM_CONSTANTS

General
    cluster: wel.consts
    description: "Static messages (STM) constants."

Ancestors
    ANY

Queries
    stm_geticon: INTEGER
    stm_getimage: INTEGER
    stm_seticon: INTEGER
    stm_setimage: INTEGER


WEL_STM_CONSTANTS Flat contracts

indexing
    description: "Static messages (STM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STM_CONSTANTS

feature -- Access

    stm_geticon: INTEGER

    stm_getimage: INTEGER

    stm_seticon: INTEGER

    stm_setimage: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STM_CONSTANTS


WEL_STOCK_CONSTANTS Chart

class
    WEL_STOCK_CONSTANTS

General
    cluster: wel.consts
    description: "Stock brushes, fonts, palette and pens."

Ancestors
    ANY

Queries
    Ansi_fixed_font: INTEGER
    Ansi_var_font: INTEGER
    Black_brush: INTEGER
    Black_pen: INTEGER
    Default_gui_font: INTEGER
    Default_palette: INTEGER
    Device_default_font: INTEGER
    Dkgray_brush: INTEGER
    Gray_brush: INTEGER
    Hollow_brush: INTEGER
    Ltgray_brush: INTEGER
    Null_brush: INTEGER
    Null_pen: INTEGER
    Oem_fixed_font: INTEGER
    System_fixed_font: INTEGER
    System_font: INTEGER
    White_brush: INTEGER
    White_pen: INTEGER


WEL_STOCK_CONSTANTS Flat contracts

indexing
    description: "Stock brushes, fonts, palette and pens."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STOCK_CONSTANTS

feature -- Brushes

    Black_brush: INTEGER is 4

    Dkgray_brush: INTEGER is 3

    Gray_brush: INTEGER is 2

    Hollow_brush: INTEGER is 5
            -- Same as Null_brush.

    Ltgray_brush: INTEGER is 1

    Null_brush: INTEGER is 5

    White_brush: INTEGER is 0

feature -- Fonts

    Ansi_fixed_font: INTEGER is 11

    Ansi_var_font: INTEGER is 12

    Default_gui_font: INTEGER is 17

    Device_default_font: INTEGER is 14

    Oem_fixed_font: INTEGER is 10

    System_fixed_font: INTEGER is 16

    System_font: INTEGER is 13

feature -- Palette

    Default_palette: INTEGER is 15

feature -- Pens

    Black_pen: INTEGER is 7

    Null_pen: INTEGER is 8

    White_pen: INTEGER is 6

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STOCK_CONSTANTS


WEL_STRETCH_MODE_CONSTANTS Chart

class
    WEL_STRETCH_MODE_CONSTANTS

General
    cluster: wel.consts
    description: "Stretch mode constants."

Ancestors
    ANY

Queries
    stretch_andscans: INTEGER
    stretch_deletescans: INTEGER
    stretch_orscans: INTEGER
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN


WEL_STRETCH_MODE_CONSTANTS Flat contracts

indexing
    description: "Stretch mode constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STRETCH_MODE_CONSTANTS

feature -- Access

    stretch_andscans: INTEGER

    stretch_deletescans: INTEGER

    stretch_orscans: INTEGER

feature -- Status report

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STRETCH_MODE_CONSTANTS


WEL_SWP_CONSTANTS Chart

class
    WEL_SWP_CONSTANTS

General
    cluster: wel.consts
    description: "SetWindowPosition (SWP) constants."

Ancestors
    ANY

Queries
    Swp_drawframe: INTEGER
    Swp_framechanged: INTEGER
    Swp_hidewindow: INTEGER
    Swp_noactivate: INTEGER
    Swp_nocopybits: INTEGER
    Swp_nomove: INTEGER
    Swp_noownerzorder: INTEGER
    Swp_noredraw: INTEGER
    Swp_noreposition: INTEGER
    Swp_nosendchanging: INTEGER
    Swp_nosize: INTEGER
    Swp_nozorder: INTEGER
    Swp_showwindow: INTEGER


WEL_SWP_CONSTANTS Flat contracts

indexing
    description: "SetWindowPosition (SWP) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SWP_CONSTANTS

feature -- Access

    Swp_drawframe: INTEGER is 32
            -- Same as Swp_drawframe.

    Swp_framechanged: INTEGER is 32
            -- Frame changed: send WM_NCCALCSIZE.

    Swp_hidewindow: INTEGER is 128

    Swp_noactivate: INTEGER is 16

    Swp_nocopybits: INTEGER is 256

    Swp_nomove: INTEGER is 2

    Swp_noownerzorder: INTEGER is 512

    Swp_noredraw: INTEGER is 8

    Swp_noreposition: INTEGER is 512
            -- Same as Swp_noownerzborder.

    Swp_nosendchanging: INTEGER is 1024
            -- Don't send WM_WINDOWPOSCHANGING.

    Swp_nosize: INTEGER is 1

    Swp_nozorder: INTEGER is 4

    Swp_showwindow: INTEGER is 64

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SWP_CONSTANTS


WEL_SW_CONSTANTS Chart

class
    WEL_SW_CONSTANTS

General
    cluster: wel.consts
    description: "ShowWindow (SW) constants."

Ancestors
    ANY

Queries
    Sw_hide: INTEGER
    Sw_minimize: INTEGER
    Sw_otherunzoom: INTEGER
    Sw_otherzoom: INTEGER
    Sw_parentclosing: INTEGER
    Sw_parentopening: INTEGER
    Sw_restore: INTEGER
    Sw_show: INTEGER
    Sw_showmaximized: INTEGER
    Sw_showminimized: INTEGER
    Sw_showminnoactive: INTEGER
    Sw_showna: INTEGER
    Sw_shownoactivate: INTEGER
    Sw_shownormal: INTEGER


WEL_SW_CONSTANTS Flat contracts

indexing
    description: "ShowWindow (SW) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SW_CONSTANTS

feature -- Access

    Sw_hide: INTEGER is 0
            -- Declared in Windows as SW_HIDE

    Sw_minimize: INTEGER is 6
            -- Declared in Windows as SW_MINIMIZE

    Sw_otherunzoom: INTEGER is 4
            -- Declared in Windows as SW_OTHERUNZOOM

    Sw_otherzoom: INTEGER is 2
            -- Declared in Windows as SW_OTHERZOOM

    Sw_parentclosing: INTEGER is 1
            -- Declared in Windows as SW_PARENTCLOSING

    Sw_parentopening: INTEGER is 3
            -- Declared in Windows as SW_PARENTOPENING

    Sw_restore: INTEGER is 9
            -- Declared in Windows as SW_RESTORE

    Sw_show: INTEGER is 5
            -- Declared in Windows as SW_SHOW

    Sw_showmaximized: INTEGER is 3
            -- Declared in Windows as SW_SHOWMAXIMIZED

    Sw_showminimized: INTEGER is 2
            -- Declared in Windows as SW_SHOWMINIMIZED

    Sw_showminnoactive: INTEGER is 7
            -- Declared in Windows as SW_SHOWMINNOACTIVE

    Sw_showna: INTEGER is 8
            -- Declared in Windows as SW_SHOWNA

    Sw_shownoactivate: INTEGER is 4
            -- Declared in Windows as SW_SHOWNOACTIVATE

    Sw_shownormal: INTEGER is 1
            -- Declared in Windows as SW_SHOWNORMAL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SW_CONSTANTS


WEL_TA_CONSTANTS Chart

class
    WEL_TA_CONSTANTS

General
    cluster: wel.consts
    description: "Text Alignment (TA) constants."

Ancestors
    ANY

Queries
    ta_baseline: INTEGER
    ta_bottom: INTEGER
    ta_center: INTEGER
    ta_left: INTEGER
    ta_noupdatecp: INTEGER
    ta_right: INTEGER
    ta_top: INTEGER
    ta_updatecp: INTEGER
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN


WEL_TA_CONSTANTS Flat contracts

indexing
    description: "Text Alignment (TA) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TA_CONSTANTS

feature -- Access

    ta_baseline: INTEGER

    ta_bottom: INTEGER

    ta_center: INTEGER

    ta_left: INTEGER

    ta_noupdatecp: INTEGER

    ta_right: INTEGER

    ta_top: INTEGER

    ta_updatecp: INTEGER

feature -- Status report

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TA_CONSTANTS


WEL_TBM_CONSTANTS Chart

class
    WEL_TBM_CONSTANTS

General
    cluster: wel.consts
    description: "Common control Track Bar Message (TBM) constants."

Ancestors
    ANY

Queries
    Tbm_clearsel: INTEGER
    Tbm_cleartics: INTEGER
    Tbm_getlinesize: INTEGER
    Tbm_getnumtics: INTEGER
    Tbm_getpagesize: INTEGER
    Tbm_getpos: INTEGER
    Tbm_getptics: INTEGER
    Tbm_getrangemax: INTEGER
    Tbm_getrangemin: INTEGER
    Tbm_getselend: INTEGER
    Tbm_getselstart: INTEGER
    Tbm_gettic: INTEGER
    Tbm_getticpos: INTEGER
    Tbm_setlinesize: INTEGER
    Tbm_setpagesize: INTEGER
    Tbm_setpos: INTEGER
    Tbm_setrange: INTEGER
    Tbm_setrangemax: INTEGER
    Tbm_setrangemin: INTEGER
    Tbm_setsel: INTEGER
    Tbm_setselend: INTEGER
    Tbm_setselstart: INTEGER
    Tbm_settic: INTEGER


WEL_TBM_CONSTANTS Flat contracts

indexing
    description: "Common control Track Bar Message (TBM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.7 $"

class interface
    WEL_TBM_CONSTANTS

feature -- Access

    Tbm_clearsel: INTEGER is 1043
            -- Declared in Windows as TBM_CLEARSEL

    Tbm_cleartics: INTEGER is 1033
            -- Declared in Windows as TBM_CLEARTICS

    Tbm_getlinesize: INTEGER is 1048
            -- Declared in Windows as TBM_GETLINESIZE

    Tbm_getnumtics: INTEGER is 1040
            -- Declared in Windows as TBM_GETNUMTICS

    Tbm_getpagesize: INTEGER is 1046
            -- Declared in Windows as TBM_GETPAGESIZE

    Tbm_getpos: INTEGER is 1024
            -- Declared in Windows as TBM_GETPOS

    Tbm_getptics: INTEGER is 1038
            -- Declared in Windows as TBM_GETPTICS

    Tbm_getrangemax: INTEGER is 1026
            -- Declared in Windows as TBM_GETRANGEMAX

    Tbm_getrangemin: INTEGER is 1025
            -- Declared in Windows as TBM_GETRANGEMIN

    Tbm_getselend: INTEGER is 1042
            -- Declared in Windows as TBM_GETSELEND

    Tbm_getselstart: INTEGER is 1041
            -- Declared in Windows as TBM_GETSELSTART

    Tbm_gettic: INTEGER is 1027
            -- Declared in Windows as TBM_GETTIC

    Tbm_getticpos: INTEGER is 1039
            -- Declared in Windows as TBM_GETTICPOS

    Tbm_setlinesize: INTEGER is 1047
            -- Declared in Windows as TBM_SETLINESIZE

    Tbm_setpagesize: INTEGER is 1045
            -- Declared in Windows as TBM_SETPAGESIZE

    Tbm_setpos: INTEGER is 1029
            -- Declared in Windows as TBM_SETPOS

    Tbm_setrange: INTEGER is 1030
            -- Declared in Windows as TBM_SETRANGE

    Tbm_setrangemax: INTEGER is 1032
            -- Declared in Windows as TBM_SETRANGEMAX

    Tbm_setrangemin: INTEGER is 1031
            -- Declared in Windows as TBM_SETRANGEMIN

    Tbm_setsel: INTEGER is 1034
            -- Declared in Windows as TBM_SETSEL

    Tbm_setselend: INTEGER is 1036
            -- Declared in Windows as TBM_SETSELEND

    Tbm_setselstart: INTEGER is 1035
            -- Declared in Windows as TBM_SETSELSTART

    Tbm_settic: INTEGER is 1028
            -- Declared in Windows as TBM_SETTIC

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TBM_CONSTANTS


WEL_TBN_CONSTANTS Chart

class
    WEL_TBN_CONSTANTS

General
    cluster: wel.consts
    description: "Toolbar notification (RBN) constants."

Ancestors
    ANY

Queries
    Tbn_beginadjust: INTEGER
    Tbn_begindrag: INTEGER
    Tbn_custhelp: INTEGER
    Tbn_dropdown: INTEGER
    Tbn_endadjust: INTEGER
    Tbn_enddrag: INTEGER
    Tbn_getbuttoninfo: INTEGER
    Tbn_querydelete: INTEGER
    Tbn_queryinsert: INTEGER
    Tbn_reset: INTEGER
    Tbn_toolbarchange: INTEGER


WEL_TBN_CONSTANTS Flat contracts

indexing
    description: "Toolbar notification (RBN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TBN_CONSTANTS

feature -- Access

    Tbn_beginadjust: INTEGER is -703
            -- Declared in Windows as TBN_BEGINADJUST

    Tbn_begindrag: INTEGER is -701
            -- Declared in Windows as TBN_BEGINDRAG

    Tbn_custhelp: INTEGER is -709
            -- Declared in Windows as TBN_CUSTHELP

    Tbn_dropdown: INTEGER is -710
            -- Declared in Windows as TBN_DROPDOWN

    Tbn_endadjust: INTEGER is -704
            -- Declared in Windows as TBN_ENDADJUST

    Tbn_enddrag: INTEGER is -702
            -- Declared in Windows as TBN_ENDDRAG

    Tbn_getbuttoninfo: INTEGER is -700
            -- Declared in Windows as TBN_GETBUTTONINFO

    Tbn_querydelete: INTEGER is -707
            -- Declared in Windows as TBN_QUERYDELETE

    Tbn_queryinsert: INTEGER is -706
            -- Declared in Windows as TBN_QUERYINSERT

    Tbn_reset: INTEGER is -705
            -- Declared in Windows as TBN_RESET

    Tbn_toolbarchange: INTEGER is -708
            -- Declared in Windows as TBN_TOOLBARCHANGE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TBN_CONSTANTS


WEL_TBS_CONSTANTS Chart

class
    WEL_TBS_CONSTANTS

General
    cluster: wel.consts
    description: "Common control Track Bar Style (TBS) constants."

Ancestors
    ANY

Queries
    Tbs_autoticks: INTEGER
    Tbs_both: INTEGER
    Tbs_bottom: INTEGER
    Tbs_enableselrange: INTEGER
    Tbs_fixedlength: INTEGER
    Tbs_horz: INTEGER
    Tbs_left: INTEGER
    Tbs_nothumb: INTEGER
    Tbs_noticks: INTEGER
    Tbs_right: INTEGER
    Tbs_tooltips: INTEGER
    Tbs_top: INTEGER
    Tbs_vert: INTEGER


WEL_TBS_CONSTANTS Flat contracts

indexing
    description: "Common control Track Bar Style (TBS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TBS_CONSTANTS

feature -- Access

    Tbs_autoticks: INTEGER is 1
            -- Declared in Windows as TBS_AUTOTICKS

    Tbs_both: INTEGER is 8
            -- Declared in Windows as TBS_BOTH

    Tbs_bottom: INTEGER is 0
            -- Declared in Windows as TBS_BOTTOM

    Tbs_enableselrange: INTEGER is 32
            -- Declared in Windows as TBS_ENABLESELRANGE

    Tbs_fixedlength: INTEGER is 64
            -- Declared in Windows as TBS_FIXEDLENGTH

    Tbs_horz: INTEGER is 0
            -- Declared in Windows as TBS_HORZ

    Tbs_left: INTEGER is 4
            -- Declared in Windows as TBS_LEFT

    Tbs_nothumb: INTEGER is 128
            -- Declared in Windows as TBS_NOTHUMB

    Tbs_noticks: INTEGER is 16
            -- Declared in Windows as TBS_NOTICKS

    Tbs_right: INTEGER is 0
            -- Declared in Windows as TBS_RIGHT

    Tbs_tooltips: INTEGER is 256
            -- Declared in Windows as TBS_TOOLTIPS

    Tbs_top: INTEGER is 4
            -- Declared in Windows as TBS_TOP

    Tbs_vert: INTEGER is 2
            -- Declared in Windows as TBS_VERT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TBS_CONSTANTS


WEL_TB_CONSTANTS Chart

class
    WEL_TB_CONSTANTS

General
    cluster: wel.consts
    description: "Toolbar message (TB_...) constants."

Ancestors
    ANY

Queries
    Tb_addbitmap: INTEGER
    Tb_addbuttons: INTEGER
    Tb_addstring: INTEGER
    Tb_autosize: INTEGER
    Tb_buttoncount: INTEGER
    Tb_buttonstructsize: INTEGER
    Tb_changebitmap: INTEGER
    Tb_checkbutton: INTEGER
    Tb_commandtoindex: INTEGER
    Tb_customize: INTEGER
    Tb_deletebutton: INTEGER
    Tb_enablebutton: INTEGER
    Tb_getanchorhighlight: INTEGER
    Tb_getbitmap: INTEGER
    Tb_getbitmapflags: INTEGER
    Tb_getbutton: INTEGER
    Tb_getbuttonsize: INTEGER
    Tb_getbuttontext: INTEGER
    Tb_getdisabledimagelist: INTEGER
    Tb_getextendedstyle: INTEGER
    Tb_gethotimagelist: INTEGER
    Tb_gethotitem: INTEGER
    Tb_getimagelist: INTEGER
    Tb_getinsertmark: INTEGER
    Tb_getinsertmarkcolor: INTEGER
    Tb_getitemrect: INTEGER
    Tb_getmaxsize: INTEGER
    Tb_getobject: INTEGER
    Tb_getpadding: INTEGER
    Tb_getrect: INTEGER
    Tb_getrows: INTEGER
    Tb_getstate: INTEGER
    Tb_getstyle: INTEGER
    Tb_gettextrows: INTEGER
    Tb_gettooltips: INTEGER
    Tb_hidebutton: INTEGER
    Tb_hittest: INTEGER
    Tb_indeterminate: INTEGER
    Tb_insertbutton: INTEGER
    Tb_insertmarkhittest: INTEGER
    Tb_isbuttonchecked: INTEGER
    Tb_isbuttonenabled: INTEGER
    Tb_isbuttonhidden: INTEGER
    Tb_isbuttonindeterminate: INTEGER
    Tb_isbuttonpressed: INTEGER
    Tb_loadimages: INTEGER
    Tb_movebutton: INTEGER
    Tb_pressbutton: INTEGER
    Tb_saverestore: INTEGER
    Tb_setanchorhighlight: INTEGER
    Tb_setbitmapsize: INTEGER
    Tb_setbuttonsize: INTEGER
    Tb_setbuttonwidth: INTEGER
    Tb_setcmdid: INTEGER
    Tb_setdisabledimagelist: INTEGER
    Tb_setextendedstyle: INTEGER
    Tb_sethotimagelist: INTEGER
    Tb_sethotitem: INTEGER
    Tb_setimagelist: INTEGER
    Tb_setindent: INTEGER
    Tb_setinsertmark: INTEGER
    Tb_setinsertmarkcolor: INTEGER
    Tb_setmaxtextrows: INTEGER
    Tb_setpadding: INTEGER
    Tb_setparent: INTEGER
    Tb_setrows: INTEGER
    Tb_setstate: INTEGER
    Tb_setstyle: INTEGER
    Tb_settooltips: INTEGER


WEL_TB_CONSTANTS Flat contracts

indexing
    description: "Toolbar message (TB_...) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TB_CONSTANTS

feature -- Access

    Tb_addbitmap: INTEGER is 1043
            -- Adds one or more images to the list of button images available
            -- for a toolbar.

    Tb_addbuttons: INTEGER is 1044
            -- Adds one or more buttons to a toolbar.

    Tb_addstring: INTEGER is 1052
            -- Adds a new string to the toolbar's string pool.
            -- (ANSI Version)

    Tb_autosize: INTEGER is 1057
            -- Causes a toolbar to be resized.

    Tb_buttoncount: INTEGER is 1048
            -- Retrieves a count of the buttons currently in the toolbar.

    Tb_buttonstructsize: INTEGER is 1054
            -- Specifies the size of the TBBUTTON structure.

    Tb_changebitmap: INTEGER is 1067
            -- Changes the bitmap for a button in a toolbar.

    Tb_checkbutton: INTEGER is 1026
            -- Checks or unchecks a given button in a toolbar.

    Tb_commandtoindex: INTEGER is 1049
            -- Retrieves the zero-based index for the button associated with the
            -- specified command identifier.

    Tb_customize: INTEGER is 1051
            -- Displays the Customize Toolbar dialog box.

    Tb_deletebutton: INTEGER is 1046
            -- Deletes a button from the toolbar.

    Tb_enablebutton: INTEGER is 1025
            -- Enables or disables the specified button in a toolbar.

    Tb_getbitmap: INTEGER is 1068
            -- Retrieves the index of the bitmap associated with a button
            -- in a toolbar.

    Tb_getbitmapflags: INTEGER is 1065
            -- Retrieves the flags that describe the type of bitmap to be used.

    Tb_getbutton: INTEGER is 1047
            -- Retrieves information about the specified button in a toolbar.

    Tb_getbuttontext: INTEGER is 1069
            -- Retrieves the display text of a button on a toolbar.

    Tb_getitemrect: INTEGER is 1053
            -- Retrieves the bounding rectangle of a button in a toolbar.

    Tb_getrows: INTEGER is 1064
            -- Retrieves the number of rows of buttons in a toolbar with the
            -- TBSTYLE_WRAPABLE style.

    Tb_getstate: INTEGER is 1042
            -- Retrieves information about the state of the specified button
            -- in a toolbar, such as whether it is enabled, pressed, or checked.

    Tb_gettooltips: INTEGER is 1059
            -- Retrieves the handle to the tooltip control, if any, associated
            -- with the toolbar.

    Tb_hidebutton: INTEGER is 1028
            -- Hides or shows the specified button in a toolbar.

    Tb_hittest: INTEGER is 1093
            -- Determines where a point lies in a toolbar control.

    Tb_indeterminate: INTEGER is 1029
            -- Sets or clears the indeterminate state of the specified button
            -- in a toolbar.

    Tb_insertbutton: INTEGER is 1045
            -- Inserts a button in a toolbar.

    Tb_isbuttonchecked: INTEGER is 1034
            -- Determines whether the specified button in a toolbar is checked.

    Tb_isbuttonenabled: INTEGER is 1033
            -- Determines whether the specified button in a toolbar is enabled.

    Tb_isbuttonhidden: INTEGER is 1036
            -- Determines whether the specified button in a toolbar is hidden.

    Tb_isbuttonindeterminate: INTEGER is 1037
            -- Determines whether the specified button in a toolbar is indeterminate.

    Tb_isbuttonpressed: INTEGER is 1035
            -- Determines whether the specified button in a toolbar is pressed.

    Tb_pressbutton: INTEGER is 1027
            -- Presses or releases the specified button in a toolbar.

    Tb_saverestore: INTEGER is 1050
            -- Send this message to initiate saving or restoring a toolbar state.

    Tb_setbitmapsize: INTEGER is 1056
            -- Sets the size of the bitmapped images to be added to a toolbar.

    Tb_setbuttonsize: INTEGER is 1055
            -- Sets the size of the buttons to be added to a toolbar.

    Tb_setcmdid: INTEGER is 1066
            -- Sets the command identifier of a toolbar button.

    Tb_setparent: INTEGER is 1061
            -- Sets the window to which the toolbar control sends notification messages.

    Tb_setrows: INTEGER is 1063
            -- Sets the number of rows of buttons in a toolbar.

    Tb_setstate: INTEGER is 1041
            -- Sets the state for the specified button in a toolbar.

    Tb_settooltips: INTEGER is 1060
            -- Associates a tooltip control with a toolbar.

feature -- Access Comctl32.dll >= 4.70 (Windows95 + IE4 and above)

    Tb_getbuttonsize: INTEGER is 1082
            -- Retrieves the current width and height of toolbar buttons, in
            -- pixels.

    Tb_getdisabledimagelist: INTEGER is 1079
            -- Retrieves the image list that a toolbar control uses to display
            -- disabled buttons.

    Tb_gethotimagelist: INTEGER is 1077
            -- Retrieves the image list that a toolbar control uses to display
            -- hot buttons.

    Tb_getimagelist: INTEGER is 1073
            -- Retrieves the image list that a toolbar control uses to display
            -- buttons in their default state. A toolbar control uses this
            -- image list to display buttons when they are not hot or disabled

    Tb_getrect: INTEGER is 1075
            -- Retrieves the bounding rectangle for a specified toolbar button

    Tb_getstyle: INTEGER is 1081
            -- Retrieves the styles currently in use for a toolbar control.

    Tb_gettextrows: INTEGER is 1085
            -- Retrieves the maximum number of text rows that can be
            -- displayed on a toolbar button.

    Tb_loadimages: INTEGER is 1074
            -- Loads bitmaps into a toolbar control's image list.

    Tb_setbuttonwidth: INTEGER is 1083
            -- Sets the minimum and maximum button widths in the toolbar
            -- control.

    Tb_setdisabledimagelist: INTEGER is 1078
            -- Sets the image list that the toolbar control will use to display
            -- disabled buttons.

    Tb_sethotimagelist: INTEGER is 1076
            -- Sets the image list that the toolbar control will use to
            -- display hot buttons.

    Tb_setimagelist: INTEGER is 1072
            -- Set the image list that the toolbar will use
            -- to display buttons that are in their default state.

    Tb_setindent: INTEGER is 1071
            -- Sets the indentation for the first button in a toolbar control

    Tb_setmaxtextrows: INTEGER is 1084
            -- Sets the maximum number of text rows displayed on a toolbar
            -- button.

    Tb_setstyle: INTEGER is 1080
            -- Sets the style for a toolbar control.

feature -- Access Comctl32.dll >= 4.71 (Windows95 + IE4 and above)

    Tb_getanchorhighlight: INTEGER is 1098
            -- Retrieves the anchor highlight setting for a toolbar.

    Tb_getextendedstyle: INTEGER is 1109
            -- Retrieves the extended styles for a toolbar control.

    Tb_gethotitem: INTEGER is 1095
            -- Retrieves the index of the hot item in a toolbar.

    Tb_getinsertmark: INTEGER is 1103
            -- Retrieves the current insertion mark for the toolbar.

    Tb_getinsertmarkcolor: INTEGER is 1113
            -- Retrieves the color used to draw the insertion mark for the toolbar.

    Tb_getmaxsize: INTEGER is 1107
            -- Retrieves the total size of all of the visible buttons and separators in the toolbar.

    Tb_getobject: INTEGER is 1086
            -- Retrieves the IDropTarget for a toolbar control.

    Tb_getpadding: INTEGER is 1110
            -- Retrieves the padding for a toolbar control.

    Tb_insertmarkhittest: INTEGER is 1105
            -- Retrieves the insertion mark information for a point in a toolbar.

    Tb_movebutton: INTEGER is 1106
            -- Moves a button from one index to another.

    Tb_setanchorhighlight: INTEGER is 1097
            -- Sets the anchor highlight setting for a toolbar.

    Tb_setextendedstyle: INTEGER is 1108
            -- Sets the extended styles for a toolbar control.

    Tb_sethotitem: INTEGER is 1096
            -- Sets the hot item in a toolbar.
            -- This message is ignored for toolbar controls that do not have the
            -- TBSTYLE_FLAT style.

    Tb_setinsertmark: INTEGER is 1104
            -- Sets the current insertion mark for the toolbar.

    Tb_setinsertmarkcolor: INTEGER is 1112
            -- Sets the color used to draw the insertion mark for the toolbar.

    Tb_setpadding: INTEGER is 1111
            -- Sets the padding for a toolbar control.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TB_CONSTANTS


WEL_TB_STATE_CONSTANTS Chart

class
    WEL_TB_STATE_CONSTANTS

General
    cluster: wel.consts
    description: "Toolbar button state (TB_STATE...) constants."

Ancestors
    ANY

Queries
    Tbstate_checked: INTEGER
    Tbstate_enabled: INTEGER
    Tbstate_hidden: INTEGER
    Tbstate_indeterminate: INTEGER
    Tbstate_pressed: INTEGER
    Tbstate_wrap: INTEGER


WEL_TB_STATE_CONSTANTS Flat contracts

indexing
    description: "Toolbar button state (TB_STATE...) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TB_STATE_CONSTANTS

feature -- Access

    Tbstate_checked: INTEGER is 1
            -- The button has the Tbstyle_checked style and is
            -- being pressed.

    Tbstate_enabled: INTEGER is 4
            -- The button accepts user input. A button not having
            -- this state does not accept user input and is grayed.

    Tbstate_hidden: INTEGER is 8
            -- The button is not visible and cannot receive user
            -- input.

    Tbstate_indeterminate: INTEGER is 16
            -- The button is grayed.

    Tbstate_pressed: INTEGER is 2
            -- The button is being pressed.

    Tbstate_wrap: INTEGER is 32
            -- A line break follows the button. The button must
            -- also have the Tbstate_enabled state.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TB_STATE_CONSTANTS


WEL_TB_STYLE_CONSTANTS Chart

class
    WEL_TB_STYLE_CONSTANTS

General
    cluster: wel.consts
    description: "Toolbar style (TB_STYLE...) constants."

Ancestors
    ANY

Queries
    Tbstyle_altdrag: INTEGER
    Tbstyle_button: INTEGER
    Tbstyle_check: INTEGER
    Tbstyle_checkgroup: INTEGER
    Tbstyle_customerase: INTEGER
    Tbstyle_dropdown: INTEGER
    Tbstyle_flat: INTEGER
    Tbstyle_group: INTEGER
    Tbstyle_list: INTEGER
    Tbstyle_sep: INTEGER
    Tbstyle_tooltips: INTEGER
    Tbstyle_wrapable: INTEGER


WEL_TB_STYLE_CONSTANTS Flat contracts

indexing
    description: "Toolbar style (TB_STYLE...) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:04 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TB_STYLE_CONSTANTS

feature -- Access
-- A toolbar can have a combination of the following styles.

    Tbstyle_altdrag: INTEGER is 1024
            -- Allows the user to change the position of a toolbar
            -- button by dragging it while holding down the ALT key.
            -- If this style is not specified, the user must hold
            -- down the SHIFT key while dragging a button. Note
            -- that the Ccs_adjustable style must be specified to
            -- enable toolbar buttons to be dragged.

    Tbstyle_button: INTEGER is 0
            -- Creates a standard push button.

    Tbstyle_check: INTEGER is 2
            -- Creates a button that toggles between the pressed
            -- and not pressed states each time the user clicks it.
            -- The button has a different background color when it
            -- is in the pressed state.

    Tbstyle_checkgroup: INTEGER is 6
            -- Creates a check button that stays pressed until
            -- another button in the group is pressed.

    Tbstyle_customerase: INTEGER is 8192
            -- Generates NM_CUSTOMDRAW notification messages when
            -- it processes WM_ERASEBKGND.
            -- A button in a toolbar can have a combination of the following styles.

    Tbstyle_dropdown: INTEGER is 8
            -- Creates a drop-down list button. If the toolbar has
            -- the TBSTYLE_EX_DRAWDDARROWS extended style, an arrow
            -- will be displayed next to the button.

    Tbstyle_flat: INTEGER is 2048
            -- Creates a transparent toolbar with flat buttons.
            -- The apparence of the button change when the user
            -- move the mouse on the button.

    Tbstyle_group: INTEGER is 4
            -- Creates a button that stays pressed until another
            -- button in the group is pressed.

    Tbstyle_list: INTEGER is 4096
            -- Places button text to the right of button bitmaps.
            -- To avoid repainting problems, this style should be
            -- set before the toolbar control becomes visible.

    Tbstyle_sep: INTEGER is 1
            -- Creates a separator, providing a small gap between
            -- button groups. A button that has this style does not
            -- receive user input.

    Tbstyle_tooltips: INTEGER is 256
            -- Creates a tooltip control that an application can
            -- use to display descriptive text for the buttons in
            -- the toolbar.

    Tbstyle_wrapable: INTEGER is 512
            -- Creates a toolbar that can have multiple lines of
            -- buttons. Toolbar buttons can "wrap" to the next
            -- line when the toolbar becomes too narrow to include
            -- all buttons on the same line. Wrapping occurs on
            -- separation and non-group boundaries.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TB_STYLE_CONSTANTS


WEL_TCIF_CONSTANTS Chart

class
    WEL_TCIF_CONSTANTS

General
    cluster: wel.consts
    description: "Tab control item flag (TCIF) constants."

Ancestors
    ANY

Queries
    Tcif_image: INTEGER
    Tcif_param: INTEGER
    Tcif_rtlreading: INTEGER
    Tcif_state: INTEGER
    Tcif_text: INTEGER


WEL_TCIF_CONSTANTS Flat contracts

indexing
    description: "Tab control item flag (TCIF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TCIF_CONSTANTS

feature -- Access

    Tcif_image: INTEGER is 2
            -- The iImage member is valid.
            --
            -- Declared in Windows as TCIF_IMAGE

    Tcif_param: INTEGER is 8
            -- The lParam member is valid.
            --
            -- Declared in Windows as TCIF_PARAM

    Tcif_rtlreading: INTEGER is 4
            -- Windows 95 only: Displays the text of pszText
            -- using right-to-left reading order on Hebrew or
            -- Arabic systems.
            --
            -- Declared in Windows as TCIF_RTLREADING

    Tcif_state: INTEGER is 16
            -- Declared in Windows as TCIF_STATE

    Tcif_text: INTEGER is 1
            -- The pszText member is valid.
            --
            -- Declared in Windows as TCIF_TEXT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TCIF_CONSTANTS


WEL_TCM_CONSTANTS Chart

class
    WEL_TCM_CONSTANTS

General
    cluster: wel.consts
    description: "Tab control message (TCM) constants."

Ancestors
    ANY

Queries
    Tcm_adjustrect: INTEGER
    Tcm_deleteallitems: INTEGER
    Tcm_deleteitem: INTEGER
    Tcm_getcurfocus: INTEGER
    Tcm_getcursel: INTEGER
    Tcm_getimagelist: INTEGER
    Tcm_getitem: INTEGER
    Tcm_getitemcount: INTEGER
    Tcm_getitemrect: INTEGER
    Tcm_getrowcount: INTEGER
    Tcm_gettooltips: INTEGER
    Tcm_highlightitem: INTEGER
    Tcm_hittest: INTEGER
    Tcm_insertitem: INTEGER
    Tcm_removeimage: INTEGER
    Tcm_setcursel: INTEGER
    Tcm_setimagelist: INTEGER
    Tcm_setitem: INTEGER
    Tcm_setitemextra: INTEGER
    Tcm_setitemsize: INTEGER
    Tcm_setpadding: INTEGER
    Tcm_settooltips: INTEGER


WEL_TCM_CONSTANTS Flat contracts

indexing
    description: "Tab control message (TCM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TCM_CONSTANTS

feature -- Access

    Tcm_adjustrect: INTEGER is 4904
            -- Declared in Windows as TCM_ADJUSTRECT

    Tcm_deleteallitems: INTEGER is 4873
            -- Declared in Windows as TCM_DELETEALLITEMS

    Tcm_deleteitem: INTEGER is 4872
            -- Declared in Windows as TCM_DELETEITEM

    Tcm_getcurfocus: INTEGER is 4911
            -- Declared in Windows as TCM_GETCURFOCUS

    Tcm_getcursel: INTEGER is 4875
            -- Declared in Windows as TCM_GETCURSEL

    Tcm_getimagelist: INTEGER is 4866
            -- Declared in Windows as TCM_GETIMAGELIST

    Tcm_getitem: INTEGER is 4869
            -- Declared in Windows as TCM_GETITEM

    Tcm_getitemcount: INTEGER is 4868
            -- Declared in Windows as TCM_GETITEMCOUNT

    Tcm_getitemrect: INTEGER is 4874
            -- Declared in Windows as TCM_GETITEMRECT

    Tcm_getrowcount: INTEGER is 4908
            -- Declared in Windows as TCM_GETROWCOUNT

    Tcm_gettooltips: INTEGER is 4909
            -- Declared in Windows as TCM_GETTOOLTIPS

    Tcm_highlightitem: INTEGER is 4915
            -- Declared in Windows as TCM_HIGHLIGHTITEM

    Tcm_hittest: INTEGER is 4877
            -- Declared in Windows as TCM_HITTEST

    Tcm_insertitem: INTEGER is 4871
            -- Declared in Windows as TCM_INSERTITEM

    Tcm_removeimage: INTEGER is 4906
            -- Declared in Windows as TCM_REMOVEIMAGE

    Tcm_setcursel: INTEGER is 4876
            -- Declared in Windows as TCM_SETCURSEL

    Tcm_setimagelist: INTEGER is 4867
            -- Declared in Windows as TCM_SETIMAGELIST

    Tcm_setitem: INTEGER is 4870
            -- Declared in Windows as TCM_SETITEM

    Tcm_setitemextra: INTEGER is 4878
            -- Declared in Windows as TCM_SETITEMEXTRA

    Tcm_setitemsize: INTEGER is 4905
            -- Declared in Windows as TCM_SETITEMSIZE

    Tcm_setpadding: INTEGER is 4907
            -- Declared in Windows as TCM_SETPADDING

    Tcm_settooltips: INTEGER is 4910
            -- Declared in Windows as TCM_SETTOOLTIPS

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TCM_CONSTANTS


WEL_TCN_CONSTANTS Chart

class
    WEL_TCN_CONSTANTS

General
    cluster: wel.consts
    description: "Tab control notification (TCN) constants."

Ancestors
    ANY

Queries
    tcn_keydown: INTEGER
    tcn_selchange: INTEGER
    tcn_selchanging: INTEGER


WEL_TCN_CONSTANTS Flat contracts

indexing
    description: "Tab control notification (TCN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TCN_CONSTANTS

feature -- Access

    tcn_keydown: INTEGER
            -- Notifies a tab control's parent window that a key
            -- has been pressed.

    tcn_selchange: INTEGER
            -- Notifies a tab control's parent window that the
            -- currently selected tab has changed.

    tcn_selchanging: INTEGER
            -- Notifies a tab control's parent window that the
            -- currently selected tab is about to change.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TCN_CONSTANTS


WEL_TCS_CONSTANTS Chart

class
    WEL_TCS_CONSTANTS

General
    cluster: wel.consts
    description: "Tab control style (TCS) constants."

Ancestors
    ANY

Queries
    Tcs_bottom: INTEGER
    Tcs_buttons: INTEGER
    Tcs_ex_flatseparators: INTEGER
    Tcs_ex_registerdrop: INTEGER
    Tcs_fixedwidth: INTEGER
    Tcs_flatbuttons: INTEGER
    Tcs_focusnever: INTEGER
    Tcs_focusonbuttondown: INTEGER
    Tcs_forceiconleft: INTEGER
    Tcs_forcelabelleft: INTEGER
    Tcs_hottrack: INTEGER
    Tcs_multiline: INTEGER
    Tcs_multiselect: INTEGER
    Tcs_ownerdrawfixed: INTEGER
    Tcs_raggedright: INTEGER
    Tcs_right: INTEGER
    Tcs_rightjustify: INTEGER
    Tcs_scrollopposite: INTEGER
    Tcs_singleline: INTEGER
    Tcs_tabs: INTEGER
    Tcs_tooltips: INTEGER
    Tcs_vertical: INTEGER


WEL_TCS_CONSTANTS Flat contracts

indexing
    description: "Tab control style (TCS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TCS_CONSTANTS

feature -- Extended Styles

    Tcs_ex_flatseparators: INTEGER is 1
            -- Version 4.71.
            -- The tab control will draw separators between the tab items.
            -- This extended style only affects tab controls that have the
            -- TCS_BUTTONS and TCS_FLATBUTTONS styles. By default, creating
            -- the tab control with the TCS_FLATBUTTONS style sets this
            -- extended style. If you do not require separators, you should
            -- remove this extended style after creating the control.
            --
            -- Declared in Windows as TCS_EX_FLATSEPARATORS

    Tcs_ex_registerdrop: INTEGER is 2
            -- Version 4.71.
            -- The tab control generates TCN_GETOBJECT notification messages
            -- to request a drop target object when an object is dragged over
            -- the tab items in the control. The application must call
            -- CoInitialize or OleInitialize before setting this style.
            --
            -- Declared in Windows as TCS_EX_REGISTERDROP

feature -- Styles

    Tcs_bottom: INTEGER is 2
            -- Version 4.70.
            -- Tabs appear at the bottom of the control. This value equals
            -- TCS_RIGHT.
            --
            -- Declared in Windows as TCS_BOTTOM

    Tcs_buttons: INTEGER is 256
            -- Tabs appear as buttons, and no border is drawn around the
            -- display area.
            --
            -- Declared in Windows as TCS_BUTTONS

    Tcs_fixedwidth: INTEGER is 1024
            -- All tabs are the same width. This style cannot be combined with
            -- the TCS_RIGHTJUSTIFY style.
            --
            -- Declared in Windows as TCS_FIXEDWIDTH

    Tcs_flatbuttons: INTEGER is 8
            -- Version 4.71.
            -- Selected tabs appear as being indented into the background while
            -- other tabs appear as being on the same plane as the background.
            -- This style only affects tab controls with the TCS_BUTTONS style.
            --
            -- Declared in Windows as TCS_FLATBUTTONS

    Tcs_focusnever: INTEGER is 32768
            -- The tab control does not receive the input focus when clicked.
            --
            -- Declared in Windows as TCS_FOCUSNEVER

    Tcs_focusonbuttondown: INTEGER is 4096
            -- The tab control receives the input focus when clicked.
            --
            -- Declared in Windows as TCS_FOCUSONBUTTONDOWN

    Tcs_forceiconleft: INTEGER is 16
            -- Icons are aligned with the left edge of each fixed-width tab.
            -- This style can only be used with the TCS_FIXEDWIDTH style.
            --
            -- Declared in Windows as TCS_FORCEICONLEFT

    Tcs_forcelabelleft: INTEGER is 32
            -- Labels are aligned with the left edge of each fixed-width tab;
            -- that is, the label is displayed immediately to the right of
            -- the icon instead of being centered.
            -- This style can only be used with the TCS_FIXEDWIDTH style,
            -- and it implies the TCS_FORCEICONLEFT style.
            --
            -- Declared in Windows as TCS_FORCELABELLEFT

    Tcs_hottrack: INTEGER is 64
            -- Version 4.70.
            -- Items under the pointer are automatically highlighted. You
            -- can check whether or not hot tracking is enabled by calling
            -- SystemParametersInfo.
            --
            -- Declared in Windows as TCS_HOTTRACK

    Tcs_multiline: INTEGER is 512
            -- Multiple rows of tabs are displayed, if necessary, so all
            -- tabs are visible at once.
            --
            -- Declared in Windows as TCS_MULTILINE

    Tcs_multiselect: INTEGER is 4
            -- Version 4.70.
            -- Multiple tabs can be selected by holding down CTRL when
            -- clicking. This style must be used with the TCS_BUTTONS style.
            --
            -- Declared in Windows as TCS_MULTISELECT

    Tcs_ownerdrawfixed: INTEGER is 8192
            -- The parent window is responsible for drawing tabs.
            --
            -- Declared in Windows as TCS_OWNERDRAWFIXED

    Tcs_raggedright: INTEGER is 2048
            -- Rows of tabs will not be stretched to fill the entire width of
            -- the control. This style is the default.
            --
            -- Declared in Windows as TCS_RAGGEDRIGHT

    Tcs_right: INTEGER is 2
            -- Version 4.70. Tabs appear vertically on the right side of
            -- controls that use the TCS_VERTICAL style. This value equals
            -- TCS_BOTTOM.
            --
            -- Declared in Windows as TCS_RIGHT

    Tcs_rightjustify: INTEGER is 0
            -- The width of each tab is increased, if necessary, so that each
            -- row of tabs fills the entire width of the tab control.
            -- This window style is ignored unless the TCS_MULTILINE style is
            -- also specified.
            --
            -- Declared in Windows as TCS_RIGHTJUSTIFY

    Tcs_scrollopposite: INTEGER is 1
            -- Version 4.70.
            -- Unneeded tabs scroll to the opposite side of the control when
            -- a tab is selected.
            --
            -- Declared in Windows as TCS_SCROLLOPPOSITE

    Tcs_singleline: INTEGER is 0
            -- Only one row of tabs is displayed. The user can scroll to see
            -- more tabs, if necessary. This style is the default.
            --
            -- Declared in Windows as TCS_SINGLELINE

    Tcs_tabs: INTEGER is 0
            -- Tabs appear as tabs, and a border is drawn around the display
            -- area. This style is the default.
            --
            -- Declared in Windows as TCS_TABS

    Tcs_tooltips: INTEGER is 16384
            -- The tab control has a tooltip control associated with it.
            --
            -- Declared in Windows as TCS_TOOLTIPS

    Tcs_vertical: INTEGER is 128
            -- Version 4.70.
            -- Tabs appear at the left side of the control, with tab text
            -- displayed vertically. This style is valid only when used with
            -- the TCS_MULTILINE style. To make tabs appear on the right side
            -- of the control, also use the TCS_RIGHT style.
            --
            -- Declared in Windows as TCS_VERTICAL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TCS_CONSTANTS


WEL_TEXT_CAPABILITIES_CONSTANTS Chart

class
    WEL_TEXT_CAPABILITIES_CONSTANTS

General
    cluster: wel.consts
    description: "Text capabilities (TC) constants."

Ancestors
    ANY

Queries
    Tc_cp_stroke: INTEGER
    Tc_cr_90: INTEGER
    Tc_cr_any: INTEGER
    Tc_ea_double: INTEGER
    Tc_ia_able: INTEGER
    Tc_op_character: INTEGER
    Tc_op_stroke: INTEGER
    Tc_ra_able: INTEGER
    Tc_reserved: INTEGER
    Tc_sa_contin: INTEGER
    Tc_sa_double: INTEGER
    Tc_sa_integer: INTEGER
    Tc_sf_x_yindep: INTEGER
    Tc_so_able: INTEGER
    Tc_ua_able: INTEGER
    Tc_va_able: INTEGER


WEL_TEXT_CAPABILITIES_CONSTANTS Flat contracts

indexing
    description: "Text capabilities (TC) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TEXT_CAPABILITIES_CONSTANTS

feature -- Access

    Tc_cp_stroke: INTEGER is 4
            -- Declared in Windows as TC_CP_STROKE

    Tc_cr_90: INTEGER is 8
            -- Declared in Windows as TC_CR_90

    Tc_cr_any: INTEGER is 16
            -- Declared in Windows as TC_CR_ANY

    Tc_ea_double: INTEGER is 512
            -- Declared in Windows as TC_EA_DOUBLE

    Tc_ia_able: INTEGER is 1024
            -- Declared in Windows as TC_IA_ABLE

    Tc_op_character: INTEGER is 1
            -- Declared in Windows as TC_OP_CHARACTER

    Tc_op_stroke: INTEGER is 2
            -- Declared in Windows as TC_OP_STROKE

    Tc_ra_able: INTEGER is 8192
            -- Declared in Windows as TC_RA_ABLE

    Tc_reserved: INTEGER is 32768
            -- Declared in Windows as TC_RESERVED

    Tc_sa_contin: INTEGER is 256
            -- Declared in Windows as TC_SA_CONTIN

    Tc_sa_double: INTEGER is 64
            -- Declared in Windows as TC_SA_DOUBLE

    Tc_sa_integer: INTEGER is 128
            -- Declared in Windows as TC_SA_INTEGER

    Tc_sf_x_yindep: INTEGER is 32
            -- Declared in Windows as TC_SF_X_YINDEP

    Tc_so_able: INTEGER is 4096
            -- Declared in Windows as TC_SO_ABLE

    Tc_ua_able: INTEGER is 2048
            -- Declared in Windows as TC_UA_ABLE

    Tc_va_able: INTEGER is 16384
            -- Declared in Windows as TC_VA_ABLE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TEXT_CAPABILITIES_CONSTANTS


WEL_TME_CONSTANTS Chart

class
    WEL_TME_CONSTANTS

General
    cluster: wel.consts
    description: "Track Mouse Event (TME) constants for use by  WEL_TRACK_MOUSE_EVENT."

Ancestors
    ANY

Queries
    Tme_cancel: INTEGER
    Tme_hover: INTEGER
    Tme_leave: INTEGER
    Tme_query: INTEGER


WEL_TME_CONSTANTS Flat contracts

indexing
    description: "Track Mouse Event (TME) constants for use by  WEL_TRACK_MOUSE_EVENT."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TME_CONSTANTS

feature -- Access

    Tme_cancel: INTEGER is -2147483648
            -- Declared in Windows as TME_CANCEL

    Tme_hover: INTEGER is 1
            -- Declared in Windows as TME_HOVER

    Tme_leave: INTEGER is 2
            -- Declared in Windows as TME_LEAVE

    Tme_query: INTEGER is 1073741824
            -- Declared in Windows as TME_QUERY

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TME_CONSTANTS


WEL_TMPF_CONSTANTS Chart

class
    WEL_TMPF_CONSTANTS

General
    cluster: wel.consts
    description: "Text Metric Pitch and Family (TMPF) constants."

Ancestors
    ANY

Queries
    tmpf_device: INTEGER
    tmpf_fixed_pitch: INTEGER
    tmpf_truetype: INTEGER
    tmpf_vector: INTEGER


WEL_TMPF_CONSTANTS Flat contracts

indexing
    description: "Text Metric Pitch and Family (TMPF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TMPF_CONSTANTS

feature -- Access

    tmpf_device: INTEGER

    tmpf_fixed_pitch: INTEGER

    tmpf_truetype: INTEGER

    tmpf_vector: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TMPF_CONSTANTS


WEL_TPM_CONSTANTS Chart

class
    WEL_TPM_CONSTANTS

General
    cluster: wel.consts
    description: "TrackPopupMenu (TPM) constants."

Ancestors
    ANY

Queries
    tpm_centeralign: INTEGER
    tpm_leftalign: INTEGER
    tpm_leftbutton: INTEGER
    tpm_rightalign: INTEGER
    tpm_rightbutton: INTEGER


WEL_TPM_CONSTANTS Flat contracts

indexing
    description: "TrackPopupMenu (TPM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TPM_CONSTANTS

feature -- Access

    tpm_centeralign: INTEGER

    tpm_leftalign: INTEGER

    tpm_leftbutton: INTEGER

    tpm_rightalign: INTEGER

    tpm_rightbutton: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TPM_CONSTANTS


WEL_TTDT_CONSTANTS Chart

class
    WEL_TTDT_CONSTANTS

General
    cluster: wel.consts
    description: "Tooltip Delay Time (TTDT) constants."

Ancestors
    ANY

Queries
    ttdt_automatic: INTEGER
    ttdt_autopop: INTEGER
    ttdt_initial: INTEGER
    ttdt_reshow: INTEGER


WEL_TTDT_CONSTANTS Flat contracts

indexing
    description: "Tooltip Delay Time (TTDT) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TTDT_CONSTANTS

feature -- Access

    ttdt_automatic: INTEGER

    ttdt_autopop: INTEGER

    ttdt_initial: INTEGER

    ttdt_reshow: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TTDT_CONSTANTS


WEL_TTF_CONSTANTS Chart

class
    WEL_TTF_CONSTANTS

General
    cluster: wel.consts
    description: "Tool Tip Flag (TTF) constants."

Ancestors
    ANY

Queries
    Ttf_centertip: INTEGER
    Ttf_idishwnd: INTEGER
    Ttf_rtlreading: INTEGER
    Ttf_subclass: INTEGER


WEL_TTF_CONSTANTS Flat contracts

indexing
    description: "Tool Tip Flag (TTF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TTF_CONSTANTS

feature -- Access

    Ttf_centertip: INTEGER is 2

    Ttf_idishwnd: INTEGER is 1

    Ttf_rtlreading: INTEGER is 4

    Ttf_subclass: INTEGER is 16

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TTF_CONSTANTS


WEL_TTM_CONSTANTS Chart

class
    WEL_TTM_CONSTANTS

General
    cluster: wel.consts
    description: "Tool Tip Message (TTM) constants."

Ancestors
    ANY

Queries
    ttm_activate: INTEGER
    ttm_addtool: INTEGER
    ttm_deltool: INTEGER
    ttm_enumtools: INTEGER
    ttm_getcurrenttool: INTEGER
    ttm_getdelaytime: INTEGER
    ttm_gettext: INTEGER
    ttm_gettipbkcolor: INTEGER
    ttm_gettiptextcolor: INTEGER
    ttm_gettoolcount: INTEGER
    ttm_gettoolinfo: INTEGER
    ttm_hittest: INTEGER
    ttm_newtoolrect: INTEGER
    ttm_relayevent: INTEGER
    ttm_setdelaytime: INTEGER
    ttm_settipbkcolor: INTEGER
    ttm_settiptextcolor: INTEGER
    ttm_settoolinfo: INTEGER
    ttm_updatetiptext: INTEGER
    ttm_windowfrompoint: INTEGER


WEL_TTM_CONSTANTS Flat contracts

indexing
    description: "Tool Tip Message (TTM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TTM_CONSTANTS

feature -- Access

    ttm_activate: INTEGER

    ttm_addtool: INTEGER

    ttm_deltool: INTEGER

    ttm_enumtools: INTEGER

    ttm_getcurrenttool: INTEGER

    ttm_getdelaytime: INTEGER

    ttm_gettext: INTEGER

    ttm_gettipbkcolor: INTEGER

    ttm_gettiptextcolor: INTEGER

    ttm_gettoolcount: INTEGER

    ttm_gettoolinfo: INTEGER

    ttm_hittest: INTEGER

    ttm_newtoolrect: INTEGER

    ttm_relayevent: INTEGER

    ttm_setdelaytime: INTEGER

    ttm_settipbkcolor: INTEGER

    ttm_settiptextcolor: INTEGER

    ttm_settoolinfo: INTEGER

    ttm_updatetiptext: INTEGER

    ttm_windowfrompoint: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TTM_CONSTANTS


WEL_TTN_CONSTANTS Chart

class
    WEL_TTN_CONSTANTS

General
    cluster: wel.consts
    description: "Tooltip Notification (TTN) constants."

Ancestors
    ANY

Queries
    ttn_needtext: INTEGER
    ttn_pop: INTEGER
    ttn_show: INTEGER


WEL_TTN_CONSTANTS Flat contracts

indexing
    description: "Tooltip Notification (TTN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TTN_CONSTANTS

feature -- Access

    ttn_needtext: INTEGER

    ttn_pop: INTEGER

    ttn_show: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TTN_CONSTANTS


WEL_TTS_CONSTANTS Chart

class
    WEL_TTS_CONSTANTS

General
    cluster: wel.consts
    description: "Tool Tip Style (TTS) constants."

Ancestors
    ANY

Queries
    tts_alwaystip: INTEGER
    tts_noprefix: INTEGER


WEL_TTS_CONSTANTS Flat contracts

indexing
    description: "Tool Tip Style (TTS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TTS_CONSTANTS

feature -- Access

    tts_alwaystip: INTEGER

    tts_noprefix: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TTS_CONSTANTS


WEL_TVAF_CONSTANTS Chart

class
    WEL_TVAF_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view action flag (TVAF) constants."

Ancestors
    ANY

Queries
    Tvc_bykeyboard: INTEGER
    Tvc_bymouse: INTEGER
    Tvc_unknown: INTEGER
    Tve_collapse: INTEGER
    Tve_collapsereset: INTEGER
    Tve_expand: INTEGER
    Tve_toggle: INTEGER


WEL_TVAF_CONSTANTS Flat contracts

indexing
    description: "Tree view action flag (TVAF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVAF_CONSTANTS

feature -- Access

    Tvc_bykeyboard: INTEGER is 2
            -- Used for the Tvn_selchanged and Tvn_selchanging
            -- notification messages.
            -- Action done by a key stroke.
            --
            -- Declared in Windows as TVC_BYKEYBOARD

    Tvc_bymouse: INTEGER is 1
            -- Used for the Tvn_selchanged and Tvn_selchanging
            -- notification messages.
            -- Action done by a mouse click.
            --
            -- Declared in Windows as TVC_BYMOUSE

    Tvc_unknown: INTEGER is 0
            -- Used for the Tvn_selchanged or Tvn_selchanging
            -- notification messages.
            -- Action done by unknown.
            --
            -- Declared in Windows as TVC_UNKNOWN

    Tve_collapse: INTEGER is 1
            -- Used for the Tvn_expand or Tvn_expanding
            -- notification messages.
            -- Action done by collapsing the list.
            --
            -- Declared in Windows as TVE_COLLAPSE

    Tve_collapsereset: INTEGER is 32768
            -- Used for the Tvn_expand and Tvn_expanding
            -- notification messages.
            -- Action done by collapsing the list and removing
            -- the child items.
            --
            -- Declared in Windows as TVE_COLLAPSERESET

    Tve_expand: INTEGER is 2
            -- Used for the Tvn_expand and Tvn_expanding
            -- notification messages.
            -- Action done by expanding the list.
            --
            -- Declared in Windows as TVE_EXPAND

    Tve_toggle: INTEGER is 3
            -- Used for the Tvn_expand and Tvn_expanding
            -- notification messages.
            -- Action done by changing the list of the list
            -- between collapse and expand.
            --
            -- Declared in Windows as TVE_TOGGLE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVAF_CONSTANTS


WEL_TVGN_CONSTANTS Chart

class
    WEL_TVGN_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view selection type constants."

Ancestors
    ANY

Queries
    Tvgn_caret: INTEGER
    Tvgn_child: INTEGER
    Tvgn_drophilite: INTEGER
    Tvgn_firstvisible: INTEGER
    Tvgn_next: INTEGER
    Tvgn_nextvisible: INTEGER
    Tvgn_parent: INTEGER
    Tvgn_previous: INTEGER
    Tvgn_previousvisible: INTEGER
    Tvgn_root: INTEGER


WEL_TVGN_CONSTANTS Flat contracts

indexing
    description: "Tree view selection type constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVGN_CONSTANTS

feature -- Access

    Tvgn_caret: INTEGER is 9
            -- Sets the selection to the given item or retrieves
            -- the currently selected item.
            --
            -- Declared in Windows as TVGN_CARET

    Tvgn_child: INTEGER is 4
            -- Retrieves the first child item.
            -- (the hitem parameter must be Void)
            --
            -- Declared in Windows as TVGN_CHILD

    Tvgn_drophilite: INTEGER is 8
            -- Redraws the given item in the style used to indicate
            -- the target of a drag and drop operation or retrieves
            -- the item that is the target of a drag and drop
            -- operation.
            --
            -- Declared in Windows as TVGN_DROPHILITE

    Tvgn_firstvisible: INTEGER is 5
            -- Scrolls the tree view vertically so that the given
            -- item is the first visible item or retrieves the
            -- first visible item.
            --
            -- Declared in Windows as TVGN_FIRSTVISIBLE

    Tvgn_next: INTEGER is 1
            -- Retrieves the next siblings item.
            --
            -- Declared in Windows as TVGN_NEXT

    Tvgn_nextvisible: INTEGER is 6
            -- Retrieves the next visible item.
            --
            -- Declared in Windows as TVGN_NEXTVISIBLE

    Tvgn_parent: INTEGER is 3
            -- Retrieves the parent of the specified item.
            --
            -- Declared in Windows as TVGN_PARENT

    Tvgn_previous: INTEGER is 2
            -- Retrieves the previous siblings item.
            --
            -- Declared in Windows as TVGN_PREVIOUS

    Tvgn_previousvisible: INTEGER is 7
            -- Retrieves the previous visible item.
            --
            -- Declared in Windows as TVGN_PREVIOUSVISIBLE

    Tvgn_root: INTEGER is 0
            -- Retrieves the top-most or very-first item
            -- of the tree-view control.
            --
            -- Declared in Windows as TVGN_ROOT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVGN_CONSTANTS


WEL_TVHT_CONSTANTS Chart

class
    WEL_TVHT_CONSTANTS

General
    cluster: wel.consts
    description: "Tree View HitTest info (TVHT) constants."

Ancestors
    ANY

Queries
    Tvht_above: INTEGER
    Tvht_below: INTEGER
    Tvht_nowhere: INTEGER
    Tvht_onitem: INTEGER
    Tvht_onitembutton: INTEGER
    Tvht_onitemicon: INTEGER
    Tvht_onitemindent: INTEGER
    Tvht_onitemlabel: INTEGER
    Tvht_onitemright: INTEGER
    Tvht_onitemstateicon: INTEGER
    Tvht_toleft: INTEGER
    Tvht_toright: INTEGER


WEL_TVHT_CONSTANTS Flat contracts

indexing
    description: "Tree View HitTest info (TVHT) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVHT_CONSTANTS

feature -- Access

    Tvht_above: INTEGER is 256
            -- Above the client area.
            --
            -- Declared in Windows as TVHT_ABOVE

    Tvht_below: INTEGER is 512
            -- Below the client area.
            --
            -- Declared in Windows as TVHT_BELOW

    Tvht_nowhere: INTEGER is 1
            -- In the client area, but below the last item.
            --
            -- Declared in Windows as TVHT_NOWHERE

    Tvht_onitem: INTEGER is 70
            -- On the bitmap or label associated with an item.
            --
            -- Declared in Windows as TVHT_ONITEM

    Tvht_onitembutton: INTEGER is 16
            -- On the button associated with an item.
            --
            -- Declared in Windows as TVHT_ONITEMBUTTON

    Tvht_onitemicon: INTEGER is 2
            -- On the bitmap associated with an item.
            --
            -- Declared in Windows as TVHT_ONITEMICON

    Tvht_onitemindent: INTEGER is 8
            -- In the indentation associated with an item.
            --
            -- Declared in Windows as TVHT_ONITEMINDENT

    Tvht_onitemlabel: INTEGER is 4
            -- On the label (string) associated with an item.
            --
            -- Declared in Windows as TVHT_ONITEMLABEL

    Tvht_onitemright: INTEGER is 32
            -- In the area to the right of an item.
            --
            -- Declared in Windows as TVHT_ONITEMRIGHT

    Tvht_onitemstateicon: INTEGER is 64
            -- On the state icon for a tree view item that is in
            -- a user-defines state.
            --
            -- Declared in Windows as TVHT_ONITEMSTATEICON

    Tvht_toleft: INTEGER is 2048
            -- To the left of the client area.
            --
            -- Declared in Windows as TVHT_TOLEFT

    Tvht_toright: INTEGER is 1024
            -- To the right of the client area.
            --
            -- Declared in Windows as TVHT_TORIGHT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVHT_CONSTANTS


WEL_TVIF_CONSTANTS Chart

class
    WEL_TVIF_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view item flag (TVIF) constants."

Ancestors
    ANY

Queries
    Tvif_children: INTEGER
    Tvif_handle: INTEGER
    Tvif_image: INTEGER
    Tvif_param: INTEGER
    Tvif_selectedimage: INTEGER
    Tvif_state: INTEGER
    Tvif_text: INTEGER


WEL_TVIF_CONSTANTS Flat contracts

indexing
    description: "Tree view item flag (TVIF) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVIF_CONSTANTS

feature -- Access

    Tvif_children: INTEGER is 64
            -- The cChildren member is valid.
            --
            -- Declared in Windows as TVIF_CHILDREN

    Tvif_handle: INTEGER is 16
            -- The hitem member is valid.
            --
            -- Declared in Windows as TVIF_HANDLE

    Tvif_image: INTEGER is 2
            -- The iImage member is valid.
            --
            -- Declared in Windows as TVIF_IMAGE

    Tvif_param: INTEGER is 4
            -- The lParam member is valid.
            --
            -- Declared in Windows as TVIF_PARAM

    Tvif_selectedimage: INTEGER is 32
            -- The iSelectedImage member is valid.
            --
            -- Declared in Windows as TVIF_SELECTEDIMAGE

    Tvif_state: INTEGER is 8
            -- The state and stateMask members are valid.
            --
            -- Declared in Windows as TVIF_STATE

    Tvif_text: INTEGER is 1
            -- The pszText and cchTextMax members are valid.
            --
            -- Declared in Windows as TVIF_TEXT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVIF_CONSTANTS


WEL_TVIS_CONSTANTS Chart

class
    WEL_TVIS_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view item state (TVIS) constants."

Ancestors
    ANY

Queries
    Tvis_bold: INTEGER
    Tvis_cut: INTEGER
    Tvis_drophilited: INTEGER
    Tvis_expanded: INTEGER
    Tvis_expandedonce: INTEGER
    Tvis_overlaymask: INTEGER
    Tvis_selected: INTEGER
    Tvis_stateimagemask: INTEGER
    Tvis_usermask: INTEGER
    valid_tvis_constants (value: INTEGER): BOOLEAN


WEL_TVIS_CONSTANTS Flat contracts

indexing
    description: "Tree view item state (TVIS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVIS_CONSTANTS

feature -- Access

    Tvis_bold: INTEGER is 16
            -- The cChildren member is valid.
            --
            -- Declared in Windows as TVIS_BOLD

    Tvis_cut: INTEGER is 4
            -- The iImage member is valid.
            --
            -- Declared in Windows as TVIS_CUT

    Tvis_drophilited: INTEGER is 8
            -- The lParam member is valid.
            --
            -- Declared in Windows as TVIS_DROPHILITED

    Tvis_expanded: INTEGER is 32
            -- The iSelectedImage member is valid.
            --
            -- Declared in Windows as TVIS_EXPANDED

    Tvis_expandedonce: INTEGER is 64
            -- The state and stateMask members are valid.
            --
            -- Declared in Windows as TVIS_EXPANDEDONCE

    Tvis_overlaymask: INTEGER is 3840
            -- The pszText and cchTextMax members are valid.
            --
            -- Declared in Windows as TVIS_OVERLAYMASK

    Tvis_selected: INTEGER is 2
            -- Declared in Windows as TVIS_SELECTED

    Tvis_stateimagemask: INTEGER is 61440
            -- Declared in Windows as TVIS_STATEIMAGEMASK

    Tvis_usermask: INTEGER is 61440
            -- Declared in Windows as TVIS_USERMASK

feature -- Status report

    valid_tvis_constants (value: INTEGER): BOOLEAN
            -- Is value a valid constant?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVIS_CONSTANTS


WEL_TVI_CONSTANTS Chart

class
    WEL_TVI_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view item (TVI) constants."

Ancestors
    ANY

Queries
    tvi_first: POINTER
    tvi_last: POINTER
    tvi_root: POINTER
    tvi_sort: POINTER


WEL_TVI_CONSTANTS Flat contracts

indexing
    description: "Tree view item (TVI) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVI_CONSTANTS

feature -- Access

    tvi_first: POINTER
            -- Inserts the item at the beginning of the list.

    tvi_last: POINTER
            -- Inserts the item at the end of the list.

    tvi_root: POINTER
            -- Inserts the item as the root of the list.

    tvi_sort: POINTER
            -- Inserts the item into the list in alphabetical order.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVI_CONSTANTS


WEL_TVM_CONSTANTS Chart

class
    WEL_TVM_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view message (TVM) constants."

Ancestors
    ANY

Queries
    Tvm_createdragimage: INTEGER
    Tvm_deleteitem: INTEGER
    Tvm_editlabel: INTEGER
    Tvm_endeditlabelnow: INTEGER
    Tvm_ensurevisible: INTEGER
    Tvm_expand: INTEGER
    Tvm_getcount: INTEGER
    Tvm_geteditcontrol: INTEGER
    Tvm_getimagelist: INTEGER
    Tvm_getindent: INTEGER
    Tvm_getisearchstring: INTEGER
    Tvm_getitem: INTEGER
    Tvm_getitemrect: INTEGER
    Tvm_getnextitem: INTEGER
    Tvm_getvisiblecount: INTEGER
    Tvm_hittest: INTEGER
    Tvm_insertitem: INTEGER
    Tvm_selectitem: INTEGER
    Tvm_setimagelist: INTEGER
    Tvm_setindent: INTEGER
    Tvm_setitem: INTEGER
    Tvm_sortchildren: INTEGER
    Tvm_sortchildrencb: INTEGER


WEL_TVM_CONSTANTS Flat contracts

indexing
    description: "Tree view message (TVM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVM_CONSTANTS

feature -- Access

    Tvm_createdragimage: INTEGER is 4370
            -- Declared in Windows as TVM_CREATEDRAGIMAGE

    Tvm_deleteitem: INTEGER is 4353
            -- Declared in Windows as TVM_DELETEITEM

    Tvm_editlabel: INTEGER is 4366
            -- Declared in Windows as TVM_EDITLABEL

    Tvm_endeditlabelnow: INTEGER is 4374
            -- Declared in Windows as TVM_ENDEDITLABELNOW

    Tvm_ensurevisible: INTEGER is 4372
            -- Declared in Windows as TVM_ENSUREVISIBLE

    Tvm_expand: INTEGER is 4354
            -- Declared in Windows as TVM_EXPAND

    Tvm_getcount: INTEGER is 4357
            -- Declared in Windows as TVM_GETCOUNT

    Tvm_geteditcontrol: INTEGER is 4367
            -- Declared in Windows as TVM_GETEDITCONTROL

    Tvm_getimagelist: INTEGER is 4360
            -- Declared in Windows as TVM_GETIMAGELIST

    Tvm_getindent: INTEGER is 4358
            -- Declared in Windows as TVM_GETINDENT

    Tvm_getisearchstring: INTEGER is 4375
            -- Declared in Windows as TVM_GETISEARCHSTRING

    Tvm_getitem: INTEGER is 4364
            -- Declared in Windows as TVM_GETITEM

    Tvm_getitemrect: INTEGER is 4356
            -- Declared in Windows as TVM_GETITEMRECT

    Tvm_getnextitem: INTEGER is 4362
            -- Declared in Windows as TVM_GETNEXTITEM

    Tvm_getvisiblecount: INTEGER is 4368
            -- Declared in Windows as TVM_GETVISIBLECOUNT

    Tvm_hittest: INTEGER is 4369
            -- Declared in Windows as TVM_HITTEST

    Tvm_insertitem: INTEGER is 4352
            -- Declared in Windows as TVM_INSERTITEM

    Tvm_selectitem: INTEGER is 4363
            -- Declared in Windows as TVM_SELECTITEM

    Tvm_setimagelist: INTEGER is 4361
            -- Declared in Windows as TVM_SETIMAGELIST

    Tvm_setindent: INTEGER is 4359
            -- Declared in Windows as TVM_SETINDENT

    Tvm_setitem: INTEGER is 4365
            -- Declared in Windows as TVM_SETITEM

    Tvm_sortchildren: INTEGER is 4371
            -- Declared in Windows as TVM_SORTCHILDREN

    Tvm_sortchildrencb: INTEGER is 4373
            -- Declared in Windows as TVM_SORTCHILDRENCB

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVM_CONSTANTS


WEL_TVN_CONSTANTS Chart

class
    WEL_TVN_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view notification (TVN) constants."

Ancestors
    ANY

Queries
    Tvn_begindrag: INTEGER
    Tvn_beginlabeledit: INTEGER
    Tvn_beginrdrag: INTEGER
    Tvn_deleteitem: INTEGER
    Tvn_endlabeledit: INTEGER
    Tvn_getdispinfo: INTEGER
    Tvn_getinfotip: INTEGER
    Tvn_itemexpanded: INTEGER
    Tvn_itemexpanding: INTEGER
    Tvn_keydown: INTEGER
    Tvn_selchanged: INTEGER
    Tvn_selchanging: INTEGER
    Tvn_setdispinfo: INTEGER


WEL_TVN_CONSTANTS Flat contracts

indexing
    description: "Tree view notification (TVN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVN_CONSTANTS

feature -- Access

    Tvn_begindrag: INTEGER is -407
            -- Declared in Windows as TVN_BEGINDRAG

    Tvn_beginlabeledit: INTEGER is -410
            -- Declared in Windows as TVN_BEGINLABELEDIT

    Tvn_beginrdrag: INTEGER is -408
            -- Declared in Windows as TVN_BEGINRDRAG

    Tvn_deleteitem: INTEGER is -409
            -- Declared in Windows as TVN_DELETEITEM

    Tvn_endlabeledit: INTEGER is -411
            -- Declared in Windows as TVN_ENDLABELEDIT

    Tvn_getdispinfo: INTEGER is -403
            -- Declared in Windows as TVN_GETDISPINFO

    Tvn_getinfotip: INTEGER is -413
            -- Declared in Windows as TVN_GETINFOTIP

    Tvn_itemexpanded: INTEGER is -406
            -- Declared in Windows as TVN_ITEMEXPANDED

    Tvn_itemexpanding: INTEGER is -405
            -- Declared in Windows as TVN_ITEMEXPANDING

    Tvn_keydown: INTEGER is -412
            -- Declared in Windows as TVN_KEYDOWN

    Tvn_selchanged: INTEGER is -402
            -- Declared in Windows as TVN_SELCHANGED

    Tvn_selchanging: INTEGER is -401
            -- Declared in Windows as TVN_SELCHANGING

    Tvn_setdispinfo: INTEGER is -404
            -- Declared in Windows as TVN_SETDISPINFO

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVN_CONSTANTS


WEL_TVSIL_CONSTANTS Chart

class
    WEL_TVSIL_CONSTANTS

General
    cluster: wel.consts
    description: "Tree View State Image List (TVSIL) constants."

Ancestors
    ANY

Queries
    Tvsil_normal: INTEGER
    Tvsil_state: INTEGER


WEL_TVSIL_CONSTANTS Flat contracts

indexing
    description: "Tree View State Image List (TVSIL) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVSIL_CONSTANTS

feature -- Access

    Tvsil_normal: INTEGER is 0
            -- Indicates the normal image list, which contains
            -- selected, nonselected, and overlay images for the
            -- items of a tree view control.
            --
            -- Declared in Windows as TVSIL_NORMAL

    Tvsil_state: INTEGER is 2
            -- Indicates the state image list. You can use state
            -- images to indicate application-defined item states.
            -- A state image is displayed to the left of an item's
            -- selected or nonselected image.
            --
            -- Declared in Windows as TVSIL_STATE

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVSIL_CONSTANTS


WEL_TVS_CONSTANTS Chart

class
    WEL_TVS_CONSTANTS

General
    cluster: wel.consts
    description: "Tree view style (TVS) constants."

Ancestors
    ANY

Queries
    Tvs_disabledragdrop: INTEGER
    Tvs_editlabels: INTEGER
    Tvs_hasbuttons: INTEGER
    Tvs_haslines: INTEGER
    Tvs_infotip: INTEGER
    Tvs_linesatroot: INTEGER
    Tvs_showselalways: INTEGER


WEL_TVS_CONSTANTS Flat contracts

indexing
    description: "Tree view style (TVS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TVS_CONSTANTS

feature -- Access

    Tvs_disabledragdrop: INTEGER is 16
            -- Prevents the tree-view control from sending
            -- Tvn_begindrag notification messages.
            --
            -- Declared in Windows as TVS_DISABLEDRAGDROP

    Tvs_editlabels: INTEGER is 8
            -- Allows the user to edit the labels of tree-view
            -- items.
            --
            -- Declared in Windows as TVS_EDITLABELS

    Tvs_hasbuttons: INTEGER is 1
            -- Displays plus (+) and minus (-) buttons next to
            -- parent items. The user clicks the buttons to expand
            -- or collapse a parent item's list of child items. To
            -- include buttons with items at the root of the tree
            -- view, Tvs_linesatroot must also be specified.
            --
            -- Declared in Windows as TVS_HASBUTTONS

    Tvs_haslines: INTEGER is 2
            -- Uses lines to show the hierarchy of items.
            --
            -- Declared in Windows as TVS_HASLINES

    Tvs_infotip: INTEGER is 2048
            -- Declared in Windows as TVS_INFOTIP

    Tvs_linesatroot: INTEGER is 4
            -- Uses lines to link items at the root of the
            -- tree-view control. This value is ignored if
            -- Tvs_haslines is not also specified.
            --
            -- Declared in Windows as TVS_LINESATROOT

    Tvs_showselalways: INTEGER is 32
            -- Causes a selected item to remain selected when the
            -- tree-view control loses focus.
            --
            -- Declared in Windows as TVS_SHOWSELALWAYS

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TVS_CONSTANTS


WEL_UDM_CONSTANTS Chart

class
    WEL_UDM_CONSTANTS

General
    cluster: wel.consts
    description: "Up-Down control message (UDM) constants."

Ancestors
    ANY

Queries
    udm_getaccel: INTEGER
    udm_getbase: INTEGER
    udm_getbuddy: INTEGER
    udm_getpos: INTEGER
    udm_getrange: INTEGER
    udm_getrange32: INTEGER
    udm_setaccel: INTEGER
    udm_setbase: INTEGER
    udm_setbuddy: INTEGER
    udm_setpos: INTEGER
    udm_setrange: INTEGER


WEL_UDM_CONSTANTS Flat contracts

indexing
    description: "Up-Down control message (UDM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_UDM_CONSTANTS

feature -- Access

    udm_getaccel: INTEGER
            -- Retrieves acceleration information for an up-down
            -- control.

    udm_getbase: INTEGER
            -- Retrieves the current radix base (that is, either
            -- base 10 or 16) for an up-down control.

    udm_getbuddy: INTEGER
            -- Retrieves the handle of the current buddy window.

    udm_getpos: INTEGER
            -- Retrieves the current position of an up-down control.

    udm_getrange: INTEGER
            -- Retrieves the minimum and maximum positions (range)
            -- for an up-down control.

    udm_getrange32: INTEGER
            -- Retrieves the minimum and maximum positions (range)
            -- for an up-down control.

    udm_setaccel: INTEGER
            -- Sets the acceleration for an up-down control.

    udm_setbase: INTEGER
            -- Sets the radix base for an up-down control. The
            -- base value determines whether the buddy window
            -- displays numbers in decimal or hexadecimal digits.
            -- Hexadecimal numbers are always unsigned, and decimal
            -- numbers are signed.

    udm_setbuddy: INTEGER
            -- Sets the buddy window for an up-down control.

    udm_setpos: INTEGER
            -- Sets the current position for an up-down control.

    udm_setrange: INTEGER
            -- Sets the minimum and maximum positions (range) for
            -- an up-down control.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UDM_CONSTANTS


WEL_UDN_CONSTANTS Chart

class
    WEL_UDN_CONSTANTS

General
    cluster: wel.consts
    description: "Up-down control notification (UDN) constants."

Ancestors
    ANY

Queries
    udn_deltapos: INTEGER


WEL_UDN_CONSTANTS Flat contracts

indexing
    description: "Up-down control notification (UDN) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_UDN_CONSTANTS

feature -- Access

    udn_deltapos: INTEGER
            -- The operating system sends the UDN_DELTAPOS
            -- notification message to the parent window of an
            -- up-down control when the position of the control is
            -- about to change.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UDN_CONSTANTS


WEL_UDS_CONSTANTS Chart

class
    WEL_UDS_CONSTANTS

General
    cluster: wel.consts
    description: "Up-Down control style (UDS) constants."

Ancestors
    ANY

Queries
    Uds_alignleft: INTEGER
    Uds_alignright: INTEGER
    Uds_arrowkeys: INTEGER
    Uds_autobuddy: INTEGER
    Uds_horz: INTEGER
    Uds_hottrack: INTEGER
    Uds_nothousands: INTEGER
    Uds_setbuddyint: INTEGER
    Uds_wrap: INTEGER


WEL_UDS_CONSTANTS Flat contracts

indexing
    description: "Up-Down control style (UDS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_UDS_CONSTANTS

feature -- Access

    Uds_alignleft: INTEGER is 8
            -- Positions the up-down control next to the left edge
            -- of the buddy window. The buddy window is moved to the
            -- right and its width decreased to accommodate the
            -- width of the up-down control.
            --
            -- Declared in Windows as UDS_ALIGNLEFT

    Uds_alignright: INTEGER is 4
            -- Positions the up-down control next to the right edge
            -- of the buddy window. The width of the buddy window is
            -- decreased to accommodate the width of the up-down
            -- control.
            --
            -- Declared in Windows as UDS_ALIGNRIGHT

    Uds_arrowkeys: INTEGER is 32
            -- Causes the up-down control to increment and
            -- decrement the position when the UP ARROW and DOWN
            -- ARROW keys are pressed.
            --
            -- Declared in Windows as UDS_ARROWKEYS

    Uds_autobuddy: INTEGER is 16
            -- Automatically selects the previous window in the
            -- Z order as the up-down control's buddy window.
            --
            -- Declared in Windows as UDS_AUTOBUDDY

    Uds_horz: INTEGER is 64
            -- Causes the up-down control's arrows to point left
            -- and right instead of up and down.
            --
            -- Declared in Windows as UDS_HORZ

    Uds_hottrack: INTEGER is 256
            -- Causes the control to exhibit "hot tracking" behavior. That
            -- is, it highlights the UP ARROW and DOWN ARROW on the control
            -- as the pointer passes over them. This style requires
            -- Microsoft® Windows® 98 or Windows® 2000. If the system is
            -- running Windows® 95 or Windows NT® 4.0, the flag is ignored.
            -- To check whether hot tracking is enabled, call
            -- SystemParametersInfo.
            --
            -- Declared in Windows as UDS_HOTTRACK

    Uds_nothousands: INTEGER is 128
            -- Does not insert a thousands separator between every
            -- three decimal digits.
            --
            -- Declared in Windows as UDS_NOTHOUSANDS

    Uds_setbuddyint: INTEGER is 2
            -- Causes the up-down control to set the text of the
            -- buddy window (using the WM_SETTEXT message) when the
            -- position changes. The text consists of the position
            -- formatted as a decimal or hexadecimal string.
            --
            -- Declared in Windows as UDS_SETBUDDYINT

    Uds_wrap: INTEGER is 1
            -- Causes the position to "wrap" if it is incremented
            -- or decremented beyond the ending or beginning of the
            -- range.
            --
            -- Declared in Windows as UDS_WRAP

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UDS_CONSTANTS


WEL_UD_CONSTANTS Chart

class
    WEL_UD_CONSTANTS

General
    cluster: wel.consts
    description: "Up-down control (UD) constants."

Ancestors
    ANY

Queries
    Ud_maxval: INTEGER
    Ud_minval: INTEGER


WEL_UD_CONSTANTS Flat contracts

indexing
    description: "Up-down control (UD) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_UD_CONSTANTS

feature -- Access

    Ud_maxval: INTEGER is 32767
            -- Maximum value allowed in an up-down control.
            --
            -- Declared in Windows as UD_MAXVAL

    Ud_minval: INTEGER is -32767
            -- Minimum value allowed in an up-down control.
            --
            -- Declared in Windows as UD_MINVAL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UD_CONSTANTS


WEL_VK_CONSTANTS Chart

class
    WEL_VK_CONSTANTS

General
    cluster: wel.consts
    description: "Virtual Key code (VK) constants."

Ancestors
    ANY

Queries
    Vk_0: INTEGER
    Vk_1: INTEGER
    Vk_2: INTEGER
    Vk_3: INTEGER
    Vk_4: INTEGER
    Vk_5: INTEGER
    Vk_6: INTEGER
    Vk_7: INTEGER
    Vk_8: INTEGER
    Vk_9: INTEGER
    Vk_a: INTEGER
    Vk_add: INTEGER
    Vk_b: INTEGER
    Vk_back: INTEGER
    Vk_c: INTEGER
    Vk_cancel: INTEGER
    Vk_capital: INTEGER
    Vk_clear: INTEGER
    Vk_control: INTEGER
    Vk_d: INTEGER
    Vk_decimal: INTEGER
    Vk_delete: INTEGER
    Vk_divide: INTEGER
    Vk_down: INTEGER
    Vk_e: INTEGER
    Vk_end: INTEGER
    Vk_escape: INTEGER
    Vk_execute: INTEGER
    Vk_f: INTEGER
    Vk_f1: INTEGER
    Vk_f10: INTEGER
    Vk_f11: INTEGER
    Vk_f12: INTEGER
    Vk_f13: INTEGER
    Vk_f14: INTEGER
    Vk_f15: INTEGER
    Vk_f16: INTEGER
    Vk_f17: INTEGER
    Vk_f18: INTEGER
    Vk_f19: INTEGER
    Vk_f2: INTEGER
    Vk_f20: INTEGER
    Vk_f21: INTEGER
    Vk_f22: INTEGER
    Vk_f23: INTEGER
    Vk_f24: INTEGER
    Vk_f3: INTEGER
    Vk_f4: INTEGER
    Vk_f5: INTEGER
    Vk_f6: INTEGER
    Vk_f7: INTEGER
    Vk_f8: INTEGER
    Vk_f9: INTEGER
    Vk_g: INTEGER
    Vk_h: INTEGER
    Vk_help: INTEGER
    Vk_home: INTEGER
    Vk_i: INTEGER
    Vk_insert: INTEGER
    Vk_j: INTEGER
    Vk_k: INTEGER
    Vk_l: INTEGER
    Vk_lbutton: INTEGER
    Vk_lcontrol: INTEGER
    Vk_left: INTEGER
    Vk_lmenu: INTEGER
    Vk_lshift: INTEGER
    Vk_m: INTEGER
    Vk_mbutton: INTEGER
    Vk_menu: INTEGER
    Vk_multiply: INTEGER
    Vk_n: INTEGER
    Vk_next: INTEGER
    Vk_numlock: INTEGER
    Vk_numpad0: INTEGER
    Vk_numpad1: INTEGER
    Vk_numpad2: INTEGER
    Vk_numpad3: INTEGER
    Vk_numpad4: INTEGER
    Vk_numpad5: INTEGER
    Vk_numpad6: INTEGER
    Vk_numpad7: INTEGER
    Vk_numpad8: INTEGER
    Vk_numpad9: INTEGER
    Vk_o: INTEGER
    Vk_p: INTEGER
    Vk_pause: INTEGER
    Vk_print: INTEGER
    Vk_prior: INTEGER
    Vk_q: INTEGER
    Vk_r: INTEGER
    Vk_rbutton: INTEGER
    Vk_rcontrol: INTEGER
    Vk_return: INTEGER
    Vk_right: INTEGER
    Vk_rmenu: INTEGER
    Vk_rshift: INTEGER
    Vk_s: INTEGER
    Vk_scroll: INTEGER
    Vk_select: INTEGER
    Vk_separator: INTEGER
    Vk_shift: INTEGER
    Vk_snapshot: INTEGER
    Vk_space: INTEGER
    Vk_subtract: INTEGER
    Vk_t: INTEGER
    Vk_tab: INTEGER
    Vk_u: INTEGER
    Vk_up: INTEGER
    Vk_v: INTEGER
    Vk_w: INTEGER
    Vk_x: INTEGER
    Vk_y: INTEGER
    Vk_z: INTEGER


WEL_VK_CONSTANTS Flat contracts

indexing
    description: "Virtual Key code (VK) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_VK_CONSTANTS

feature -- Access

    Vk_0: INTEGER is 48

    Vk_1: INTEGER is 49

    Vk_2: INTEGER is 50

    Vk_3: INTEGER is 51

    Vk_4: INTEGER is 52

    Vk_5: INTEGER is 53

    Vk_6: INTEGER is 54

    Vk_7: INTEGER is 55

    Vk_8: INTEGER is 56

    Vk_9: INTEGER is 57
            -- Vk_a thru Vk_z are the same as their ASCII equivalents: 'A' thru 'Z'.

    Vk_a: INTEGER is 65

    Vk_add: INTEGER is 107
            -- Declared in Windows as VK_ADD

    Vk_b: INTEGER is 66

    Vk_back: INTEGER is 8
            -- Declared in Windows as VK_BACK

    Vk_c: INTEGER is 67

    Vk_cancel: INTEGER is 3
            -- Declared in Windows as VK_CANCEL

    Vk_capital: INTEGER is 20
            -- Declared in Windows as VK_CAPITAL

    Vk_clear: INTEGER is 12
            -- Declared in Windows as VK_CLEAR

    Vk_control: INTEGER is 17
            -- Declared in Windows as VK_CONTROL

    Vk_d: INTEGER is 68

    Vk_decimal: INTEGER is 110
            -- Declared in Windows as VK_DECIMAL

    Vk_delete: INTEGER is 46
            -- Declared in Windows as VK_DELETE

    Vk_divide: INTEGER is 111
            -- Declared in Windows as VK_DIVIDE

    Vk_down: INTEGER is 40
            -- Declared in Windows as VK_DOWN

    Vk_e: INTEGER is 69

    Vk_end: INTEGER is 35
            -- Declared in Windows as VK_END

    Vk_escape: INTEGER is 27
            -- Declared in Windows as VK_ESCAPE

    Vk_execute: INTEGER is 43
            -- Declared in Windows as VK_EXECUTE

    Vk_f: INTEGER is 70

    Vk_f1: INTEGER is 112
            -- Declared in Windows as VK_F1

    Vk_f10: INTEGER is 121
            -- Declared in Windows as VK_F10

    Vk_f11: INTEGER is 122
            -- Declared in Windows as VK_F11

    Vk_f12: INTEGER is 123
            -- Declared in Windows as VK_F12

    Vk_f13: INTEGER is 124
            -- Declared in Windows as VK_F13

    Vk_f14: INTEGER is 125
            -- Declared in Windows as VK_F14

    Vk_f15: INTEGER is 126
            -- Declared in Windows as VK_F15

    Vk_f16: INTEGER is 127
            -- Declared in Windows as VK_F16

    Vk_f17: INTEGER is 128
            -- Declared in Windows as VK_F17

    Vk_f18: INTEGER is 129
            -- Declared in Windows as VK_F18

    Vk_f19: INTEGER is 130
            -- Declared in Windows as VK_F19

    Vk_f2: INTEGER is 113
            -- Declared in Windows as VK_F2

    Vk_f20: INTEGER is 131
            -- Declared in Windows as VK_F20

    Vk_f21: INTEGER is 132
            -- Declared in Windows as VK_F21

    Vk_f22: INTEGER is 133
            -- Declared in Windows as VK_F22

    Vk_f23: INTEGER is 134
            -- Declared in Windows as VK_F23

    Vk_f24: INTEGER is 135
            -- Declared in Windows as VK_F24

    Vk_f3: INTEGER is 114
            -- Declared in Windows as VK_F3

    Vk_f4: INTEGER is 115
            -- Declared in Windows as VK_F4

    Vk_f5: INTEGER is 116
            -- Declared in Windows as VK_F5

    Vk_f6: INTEGER is 117
            -- Declared in Windows as VK_F6

    Vk_f7: INTEGER is 118
            -- Declared in Windows as VK_F7

    Vk_f8: INTEGER is 119
            -- Declared in Windows as VK_F8

    Vk_f9: INTEGER is 120
            -- Declared in Windows as VK_F9

    Vk_g: INTEGER is 71

    Vk_h: INTEGER is 72

    Vk_help: INTEGER is 47
            -- Declared in Windows as VK_HELP

    Vk_home: INTEGER is 36
            -- Declared in Windows as VK_HOME

    Vk_i: INTEGER is 73

    Vk_insert: INTEGER is 45
            -- Declared in Windows as VK_INSERT

    Vk_j: INTEGER is 74

    Vk_k: INTEGER is 75

    Vk_l: INTEGER is 76

    Vk_lbutton: INTEGER is 1
            -- Declared in Windows as VK_LBUTTON

    Vk_lcontrol: INTEGER is 162
            -- Declared in Windows as VK_LCONTROL

    Vk_left: INTEGER is 37
            -- Declared in Windows as VK_LEFT

    Vk_lmenu: INTEGER is 164
            -- Declared in Windows as VK_LMENU

    Vk_lshift: INTEGER is 160
            -- Declared in Windows as VK_LSHIFT

    Vk_m: INTEGER is 77

    Vk_mbutton: INTEGER is 4
            -- Declared in Windows as VK_MBUTTON

    Vk_menu: INTEGER is 18
            -- Declared in Windows as VK_MENU

    Vk_multiply: INTEGER is 106
            -- Declared in Windows as VK_MULTIPLY

    Vk_n: INTEGER is 78

    Vk_next: INTEGER is 34
            -- Declared in Windows as VK_NEXT

    Vk_numlock: INTEGER is 144
            -- Declared in Windows as VK_NUMLOCK

    Vk_numpad0: INTEGER is 96
            -- Declared in Windows as VK_NUMPAD0

    Vk_numpad1: INTEGER is 97
            -- Declared in Windows as VK_NUMPAD1

    Vk_numpad2: INTEGER is 98
            -- Declared in Windows as VK_NUMPAD2

    Vk_numpad3: INTEGER is 99
            -- Declared in Windows as VK_NUMPAD3

    Vk_numpad4: INTEGER is 100
            -- Declared in Windows as VK_NUMPAD4

    Vk_numpad5: INTEGER is 101
            -- Declared in Windows as VK_NUMPAD5

    Vk_numpad6: INTEGER is 102
            -- Declared in Windows as VK_NUMPAD6

    Vk_numpad7: INTEGER is 103
            -- Declared in Windows as VK_NUMPAD7

    Vk_numpad8: INTEGER is 104
            -- Declared in Windows as VK_NUMPAD8

    Vk_numpad9: INTEGER is 105
            -- Declared in Windows as VK_NUMPAD9

    Vk_o: INTEGER is 79

    Vk_p: INTEGER is 80

    Vk_pause: INTEGER is 19
            -- Declared in Windows as VK_PAUSE

    Vk_print: INTEGER is 42
            -- Declared in Windows as VK_PRINT

    Vk_prior: INTEGER is 33
            -- Declared in Windows as VK_PRIOR

    Vk_q: INTEGER is 81

    Vk_r: INTEGER is 82

    Vk_rbutton: INTEGER is 2
            -- Declared in Windows as VK_RBUTTON

    Vk_rcontrol: INTEGER is 163
            -- Declared in Windows as VK_RCONTROL

    Vk_return: INTEGER is 13
            -- Declared in Windows as VK_RETURN

    Vk_right: INTEGER is 39
            -- Declared in Windows as VK_RIGHT

    Vk_rmenu: INTEGER is 165
            -- Declared in Windows as VK_RMENU
            -- Vk_0 thru Vk_9 are the same as their ASCII equivalents: '0' thru '9'.

    Vk_rshift: INTEGER is 161
            -- Declared in Windows as VK_RSHIFT

    Vk_s: INTEGER is 83

    Vk_scroll: INTEGER is 145
            -- Declared in Windows as VK_SCROLL

    Vk_select: INTEGER is 41
            -- Declared in Windows as VK_SELECT

    Vk_separator: INTEGER is 108
            -- Declared in Windows as VK_SEPARATOR

    Vk_shift: INTEGER is 16
            -- Declared in Windows as VK_SHIFT

    Vk_snapshot: INTEGER is 44
            -- Declared in Windows as VK_SNAPSHOT

    Vk_space: INTEGER is 32
            -- Declared in Windows as VK_SPACE

    Vk_subtract: INTEGER is 109
            -- Declared in Windows as VK_SUBTRACT

    Vk_t: INTEGER is 84

    Vk_tab: INTEGER is 9
            -- Declared in Windows as VK_TAB

    Vk_u: INTEGER is 85

    Vk_up: INTEGER is 38
            -- Declared in Windows as VK_UP

    Vk_v: INTEGER is 86

    Vk_w: INTEGER is 87

    Vk_x: INTEGER is 88

    Vk_y: INTEGER is 89

    Vk_z: INTEGER is 90

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_VK_CONSTANTS


WEL_WA_CONSTANTS Chart

class
    WEL_WA_CONSTANTS

General
    cluster: wel.consts
    description: "Window activation (WA) constants."

Ancestors
    ANY

Queries
    Wa_active: INTEGER
    Wa_clickactive: INTEGER
    Wa_inactivate: INTEGER


WEL_WA_CONSTANTS Flat contracts

indexing
    description: "Window activation (WA) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WA_CONSTANTS

feature -- Access

    Wa_active: INTEGER is 1
            -- Window gains activation via alt-tab

    Wa_clickactive: INTEGER is 2
            -- Window gains activation via mouse click

    Wa_inactivate: INTEGER is 0
            -- Window loses activation

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WA_CONSTANTS


WEL_WM_CONSTANTS Chart

class
    WEL_WM_CONSTANTS

General
    cluster: wel.consts
    description: "Window message (WM) constants."

Ancestors
    ANY

Queries
    Wm_activate: INTEGER
    Wm_activateapp: INTEGER
    Wm_afxfirst: INTEGER
    Wm_afxlast: INTEGER
    Wm_app: INTEGER
    Wm_appcommand: INTEGER
    Wm_askcbformatname: INTEGER
    Wm_canceljournal: INTEGER
    Wm_cancelmode: INTEGER
    Wm_capturechanged: INTEGER
    Wm_changecbchain: INTEGER
    Wm_changeuistate: INTEGER
    Wm_char: INTEGER
    Wm_chartoitem: INTEGER
    Wm_childactivate: INTEGER
    Wm_clear: INTEGER
    Wm_close: INTEGER
    Wm_command: INTEGER
    Wm_commnotify: INTEGER
    Wm_compacting: INTEGER
    Wm_compareitem: INTEGER
    Wm_contextmenu: INTEGER
    Wm_copy: INTEGER
    Wm_copydata: INTEGER
    Wm_create: INTEGER
    Wm_cut: INTEGER
    Wm_deadchar: INTEGER
    Wm_deleteitem: INTEGER
    Wm_destroy: INTEGER
    Wm_destroyclipboard: INTEGER
    Wm_devicechange: INTEGER
    Wm_devmodechange: INTEGER
    Wm_displaychange: INTEGER
    Wm_drawclipboard: INTEGER
    Wm_drawitem: INTEGER
    Wm_dropfiles: INTEGER
    Wm_enable: INTEGER
    Wm_endsession: INTEGER
    Wm_enteridle: INTEGER
    Wm_entermenuloop: INTEGER
    Wm_entersizemove: INTEGER
    Wm_erasebkgnd: INTEGER
    Wm_exitmenuloop: INTEGER
    Wm_exitsizemove: INTEGER
    Wm_fontchange: INTEGER
    Wm_getdlgcode: INTEGER
    Wm_getfont: INTEGER
    Wm_gethotkey: INTEGER
    Wm_geticon: INTEGER
    Wm_getminmaxinfo: INTEGER
    Wm_getobject: INTEGER
    Wm_gettext: INTEGER
    Wm_gettextlength: INTEGER
    Wm_handheldfirst: INTEGER
    Wm_handheldlast: INTEGER
    Wm_help: INTEGER
    Wm_hotkey: INTEGER
    Wm_hscroll: INTEGER
    Wm_hscrollclipboard: INTEGER
    Wm_iconerasebkgnd: INTEGER
    Wm_ime_char: INTEGER
    Wm_ime_composition: INTEGER
    Wm_ime_compositionfull: INTEGER
    Wm_ime_control: INTEGER
    Wm_ime_endcomposition: INTEGER
    Wm_ime_keydown: INTEGER
    wm_ime_keylast: INTEGER
    Wm_ime_keyup: INTEGER
    Wm_ime_notify: INTEGER
    Wm_ime_request: INTEGER
    Wm_ime_select: INTEGER
    Wm_ime_setcontext: INTEGER
    Wm_ime_startcomposition: INTEGER
    Wm_initdialog: INTEGER
    Wm_initmenu: INTEGER
    Wm_initmenupopup: INTEGER
    Wm_inputlangchange: INTEGER
    Wm_inputlangchangerequest: INTEGER
    Wm_keydown: INTEGER
    Wm_keyfirst: INTEGER
    wm_keylast: INTEGER
    Wm_keyup: INTEGER
    Wm_killfocus: INTEGER
    Wm_lbuttondblclk: INTEGER
    Wm_lbuttondown: INTEGER
    Wm_lbuttonup: INTEGER
    Wm_mbuttondblclk: INTEGER
    Wm_mbuttondown: INTEGER
    Wm_mbuttonup: INTEGER
    Wm_mdiactivate: INTEGER
    Wm_mdicascade: INTEGER
    Wm_mdicreate: INTEGER
    Wm_mdidestroy: INTEGER
    Wm_mdigetactive: INTEGER
    Wm_mdiiconarrange: INTEGER
    Wm_mdimaximize: INTEGER
    Wm_mdinext: INTEGER
    Wm_mdirefreshmenu: INTEGER
    Wm_mdirestore: INTEGER
    Wm_mdisetmenu: INTEGER
    Wm_mditile: INTEGER
    Wm_measureitem: INTEGER
    Wm_menuchar: INTEGER
    Wm_menucommand: INTEGER
    Wm_menudrag: INTEGER
    Wm_menugetobject: INTEGER
    Wm_menurbuttonup: INTEGER
    Wm_menuselect: INTEGER
    Wm_mouseactivate: INTEGER
    Wm_mousefirst: INTEGER
    Wm_mousehover: INTEGER
    wm_mouselast: INTEGER
    Wm_mouseleave: INTEGER
    Wm_mousemove: INTEGER
    Wm_mousewheel: INTEGER
    Wm_move: INTEGER
    Wm_moving: INTEGER
    Wm_ncactivate: INTEGER
    Wm_nccalcsize: INTEGER
    Wm_nccreate: INTEGER
    Wm_ncdestroy: INTEGER
    Wm_nchittest: INTEGER
    Wm_nclbuttondblclk: INTEGER
    Wm_nclbuttondown: INTEGER
    Wm_nclbuttonup: INTEGER
    Wm_ncmbuttondblclk: INTEGER
    Wm_ncmbuttondown: INTEGER
    Wm_ncmbuttonup: INTEGER
    Wm_ncmousehover: INTEGER
    Wm_ncmouseleave: INTEGER
    Wm_ncmousemove: INTEGER
    Wm_ncpaint: INTEGER
    Wm_ncrbuttondblclk: INTEGER
    Wm_ncrbuttondown: INTEGER
    Wm_ncrbuttonup: INTEGER
    Wm_ncxbuttondblclk: INTEGER
    Wm_ncxbuttondown: INTEGER
    Wm_ncxbuttonup: INTEGER
    Wm_nextdlgctl: INTEGER
    Wm_nextmenu: INTEGER
    Wm_notify: INTEGER
    Wm_notifyformat: INTEGER
    Wm_null: INTEGER
    Wm_paint: INTEGER
    Wm_paintclipboard: INTEGER
    Wm_painticon: INTEGER
    Wm_palettechanged: INTEGER
    Wm_paletteischanging: INTEGER
    Wm_parentnotify: INTEGER
    Wm_paste: INTEGER
    Wm_penwinfirst: INTEGER
    Wm_penwinlast: INTEGER
    Wm_power: INTEGER
    Wm_powerbroadcast: INTEGER
    Wm_print: INTEGER
    Wm_printclient: INTEGER
    Wm_querydragicon: INTEGER
    Wm_queryendsession: INTEGER
    Wm_querynewpalette: INTEGER
    Wm_queryopen: INTEGER
    Wm_queryuistate: INTEGER
    Wm_queuesync: INTEGER
    Wm_quit: INTEGER
    Wm_rbuttondblclk: INTEGER
    Wm_rbuttondown: INTEGER
    Wm_rbuttonup: INTEGER
    Wm_renderallformats: INTEGER
    Wm_renderformat: INTEGER
    Wm_setcursor: INTEGER
    Wm_setfocus: INTEGER
    Wm_setfont: INTEGER
    Wm_sethotkey: INTEGER
    Wm_seticon: INTEGER
    Wm_setredraw: INTEGER
    Wm_settext: INTEGER
    Wm_settingchange: INTEGER
    Wm_showwindow: INTEGER
    Wm_size: INTEGER
    Wm_sizeclipboard: INTEGER
    Wm_sizing: INTEGER
    Wm_spoolerstatus: INTEGER
    Wm_stylechanged: INTEGER
    Wm_stylechanging: INTEGER
    Wm_syncpaint: INTEGER
    Wm_syschar: INTEGER
    Wm_syscolorchange: INTEGER
    Wm_syscommand: INTEGER
    Wm_sysdeadchar: INTEGER
    Wm_syskeydown: INTEGER
    Wm_syskeyup: INTEGER
    Wm_tcard: INTEGER
    Wm_timechange: INTEGER
    Wm_timer: INTEGER
    Wm_undo: INTEGER
    Wm_uninitmenupopup: INTEGER
    Wm_updateuistate: INTEGER
    Wm_user: INTEGER
    Wm_userchanged: INTEGER
    Wm_vkeytoitem: INTEGER
    Wm_vscroll: INTEGER
    Wm_vscrollclipboard: INTEGER
    Wm_windowposchanged: INTEGER
    Wm_windowposchanging: INTEGER
    Wm_wininichange: INTEGER
    Wm_xbuttondblclk: INTEGER
    Wm_xbuttondown: INTEGER
    Wm_xbuttonup: INTEGER


WEL_WM_CONSTANTS Flat contracts

indexing
    description: "Window message (WM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:05 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WM_CONSTANTS

feature -- Access

    Wm_activate: INTEGER is 6
            -- Declared in Windows as WM_ACTIVATE

    Wm_activateapp: INTEGER is 28
            -- Declared in Windows as WM_ACTIVATEAPP

    Wm_afxfirst: INTEGER is 864
            -- Declared in Windows as WM_AFXFIRST

    Wm_afxlast: INTEGER is 895
            -- Declared in Windows as WM_AFXLAST

    Wm_app: INTEGER is 32768
            -- Declared in Windows as WM_APP

    Wm_appcommand: INTEGER is 793
            -- Declared in Windows as WM_APPCOMMAND

    Wm_askcbformatname: INTEGER is 780
            -- Declared in Windows as WM_ASKCBFORMATNAME

    Wm_canceljournal: INTEGER is 75
            -- Declared in Windows as WM_CANCELJOURNAL

    Wm_cancelmode: INTEGER is 31
            -- Declared in Windows as WM_CANCELMODE

    Wm_capturechanged: INTEGER is 533
            -- Declared in Windows as WM_CAPTURECHANGED

    Wm_changecbchain: INTEGER is 781
            -- Declared in Windows as WM_CHANGECBCHAIN

    Wm_changeuistate: INTEGER is 295
            -- Declared in Windows as WM_CHANGEUISTATE

    Wm_char: INTEGER is 258
            -- Declared in Windows as WM_CHAR

    Wm_chartoitem: INTEGER is 47
            -- Declared in Windows as WM_CHARTOITEM

    Wm_childactivate: INTEGER is 34
            -- Declared in Windows as WM_CHILDACTIVATE

    Wm_clear: INTEGER is 771
            -- Declared in Windows as WM_CLEAR

    Wm_close: INTEGER is 16
            -- Declared in Windows as WM_CLOSE

    Wm_command: INTEGER is 273
            -- Declared in Windows as WM_COMMAND

    Wm_commnotify: INTEGER is 68
            -- Declared in Windows as WM_COMMNOTIFY

    Wm_compacting: INTEGER is 65
            -- Declared in Windows as WM_COMPACTING

    Wm_compareitem: INTEGER is 57
            -- Declared in Windows as WM_COMPAREITEM

    Wm_contextmenu: INTEGER is 123
            -- Declared in Windows as WM_CONTEXTMENU

    Wm_copy: INTEGER is 769
            -- Declared in Windows as WM_COPY

    Wm_copydata: INTEGER is 74
            -- Declared in Windows as WM_COPYDATA

    Wm_create: INTEGER is 1
            -- Declared in Windows as WM_CREATE

    Wm_cut: INTEGER is 768
            -- Declared in Windows as WM_CUT

    Wm_deadchar: INTEGER is 259
            -- Declared in Windows as WM_DEADCHAR

    Wm_deleteitem: INTEGER is 45
            -- Declared in Windows as WM_DELETEITEM

    Wm_destroy: INTEGER is 2
            -- Declared in Windows as WM_DESTROY

    Wm_destroyclipboard: INTEGER is 775
            -- Declared in Windows as WM_DESTROYCLIPBOARD

    Wm_devicechange: INTEGER is 537
            -- Declared in Windows as WM_DEVICECHANGE

    Wm_devmodechange: INTEGER is 27
            -- Declared in Windows as WM_DEVMODECHANGE

    Wm_displaychange: INTEGER is 126
            -- Declared in Windows as WM_DISPLAYCHANGE

    Wm_drawclipboard: INTEGER is 776
            -- Declared in Windows as WM_DRAWCLIPBOARD

    Wm_drawitem: INTEGER is 43
            -- Declared in Windows as WM_DRAWITEM

    Wm_dropfiles: INTEGER is 563
            -- Declared in Windows as WM_DROPFILES

    Wm_enable: INTEGER is 10
            -- Declared in Windows as WM_ENABLE

    Wm_endsession: INTEGER is 22
            -- Declared in Windows as WM_ENDSESSION

    Wm_enteridle: INTEGER is 289
            -- Declared in Windows as WM_ENTERIDLE

    Wm_entermenuloop: INTEGER is 529
            -- Declared in Windows as WM_ENTERMENULOOP

    Wm_entersizemove: INTEGER is 561
            -- Declared in Windows as WM_ENTERSIZEMOVE

    Wm_erasebkgnd: INTEGER is 20
            -- Declared in Windows as WM_ERASEBKGND

    Wm_exitmenuloop: INTEGER is 530
            -- Declared in Windows as WM_EXITMENULOOP

    Wm_exitsizemove: INTEGER is 562
            -- Declared in Windows as WM_EXITSIZEMOVE

    Wm_fontchange: INTEGER is 29
            -- Declared in Windows as WM_FONTCHANGE

    Wm_getdlgcode: INTEGER is 135
            -- Declared in Windows as WM_GETDLGCODE

    Wm_getfont: INTEGER is 49
            -- Declared in Windows as WM_GETFONT

    Wm_gethotkey: INTEGER is 51
            -- Declared in Windows as WM_GETHOTKEY

    Wm_geticon: INTEGER is 127
            -- Declared in Windows as WM_GETICON

    Wm_getminmaxinfo: INTEGER is 36
            -- Declared in Windows as WM_GETMINMAXINFO

    Wm_getobject: INTEGER is 61
            -- Declared in Windows as WM_GETOBJECT

    Wm_gettext: INTEGER is 13
            -- Declared in Windows as WM_GETTEXT

    Wm_gettextlength: INTEGER is 14
            -- Declared in Windows as WM_GETTEXTLENGTH

    Wm_handheldfirst: INTEGER is 856
            -- Declared in Windows as WM_HANDHELDFIRST

    Wm_handheldlast: INTEGER is 863
            -- Declared in Windows as WM_HANDHELDLAST

    Wm_help: INTEGER is 83
            -- Declared in Windows as WM_HELP

    Wm_hotkey: INTEGER is 786
            -- Declared in Windows as WM_HOTKEY

    Wm_hscroll: INTEGER is 276
            -- Declared in Windows as WM_HSCROLL

    Wm_hscrollclipboard: INTEGER is 782
            -- Declared in Windows as WM_HSCROLLCLIPBOARD

    Wm_iconerasebkgnd: INTEGER is 39
            -- Declared in Windows as WM_ICONERASEBKGND

    Wm_ime_char: INTEGER is 646
            -- Declared in Windows as WM_IME_CHAR

    Wm_ime_composition: INTEGER is 271
            -- Declared in Windows as WM_IME_COMPOSITION

    Wm_ime_compositionfull: INTEGER is 644
            -- Declared in Windows as WM_IME_COMPOSITIONFULL

    Wm_ime_control: INTEGER is 643
            -- Declared in Windows as WM_IME_CONTROL

    Wm_ime_endcomposition: INTEGER is 270
            -- Declared in Windows as WM_IME_ENDCOMPOSITION

    Wm_ime_keydown: INTEGER is 656
            -- Declared in Windows as WM_IME_KEYDOWN

    wm_ime_keylast: INTEGER
            -- Declared in Windows as WM_IME_KEYLAST

    Wm_ime_keyup: INTEGER is 657
            -- Declared in Windows as WM_IME_KEYUP

    Wm_ime_notify: INTEGER is 642
            -- Declared in Windows as WM_IME_NOTIFY

    Wm_ime_request: INTEGER is 648
            -- Declared in Windows as WM_IME_REQUEST

    Wm_ime_select: INTEGER is 645
            -- Declared in Windows as WM_IME_SELECT

    Wm_ime_setcontext: INTEGER is 641
            -- Declared in Windows as WM_IME_SETCONTEXT

    Wm_ime_startcomposition: INTEGER is 269
            -- Declared in Windows as WM_IME_STARTCOMPOSITION

    Wm_initdialog: INTEGER is 272
            -- Declared in Windows as WM_INITDIALOG

    Wm_initmenu: INTEGER is 278
            -- Declared in Windows as WM_INITMENU

    Wm_initmenupopup: INTEGER is 279
            -- Declared in Windows as WM_INITMENUPOPUP

    Wm_inputlangchange: INTEGER is 81
            -- Declared in Windows as WM_INPUTLANGCHANGE

    Wm_inputlangchangerequest: INTEGER is 80
            -- Declared in Windows as WM_INPUTLANGCHANGEREQUEST

    Wm_keydown: INTEGER is 256
            -- Declared in Windows as WM_KEYDOWN

    Wm_keyfirst: INTEGER is 256
            -- Declared in Windows as WM_KEYFIRST

    wm_keylast: INTEGER
            -- Declared in Windows as WM_KEYLAST

    Wm_keyup: INTEGER is 257
            -- Declared in Windows as WM_KEYUP

    Wm_killfocus: INTEGER is 8
            -- Declared in Windows as WM_KILLFOCUS

    Wm_lbuttondblclk: INTEGER is 515
            -- Declared in Windows as WM_LBUTTONDBLCLK

    Wm_lbuttondown: INTEGER is 513
            -- Declared in Windows as WM_LBUTTONDOWN

    Wm_lbuttonup: INTEGER is 514
            -- Declared in Windows as WM_LBUTTONUP

    Wm_mbuttondblclk: INTEGER is 521
            -- Declared in Windows as WM_MBUTTONDBLCLK

    Wm_mbuttondown: INTEGER is 519
            -- Declared in Windows as WM_MBUTTONDOWN

    Wm_mbuttonup: INTEGER is 520
            -- Declared in Windows as WM_MBUTTONUP

    Wm_mdiactivate: INTEGER is 546
            -- Declared in Windows as WM_MDIACTIVATE

    Wm_mdicascade: INTEGER is 551
            -- Declared in Windows as WM_MDICASCADE

    Wm_mdicreate: INTEGER is 544
            -- Declared in Windows as WM_MDICREATE

    Wm_mdidestroy: INTEGER is 545
            -- Declared in Windows as WM_MDIDESTROY

    Wm_mdigetactive: INTEGER is 553
            -- Declared in Windows as WM_MDIGETACTIVE

    Wm_mdiiconarrange: INTEGER is 552
            -- Declared in Windows as WM_MDIICONARRANGE

    Wm_mdimaximize: INTEGER is 549
            -- Declared in Windows as WM_MDIMAXIMIZE

    Wm_mdinext: INTEGER is 548
            -- Declared in Windows as WM_MDINEXT

    Wm_mdirefreshmenu: INTEGER is 564
            -- Declared in Windows as WM_MDIREFRESHMENU

    Wm_mdirestore: INTEGER is 547
            -- Declared in Windows as WM_MDIRESTORE

    Wm_mdisetmenu: INTEGER is 560
            -- Declared in Windows as WM_MDISETMENU

    Wm_mditile: INTEGER is 550
            -- Declared in Windows as WM_MDITILE

    Wm_measureitem: INTEGER is 44
            -- Declared in Windows as WM_MEASUREITEM

    Wm_menuchar: INTEGER is 288
            -- Declared in Windows as WM_MENUCHAR

    Wm_menucommand: INTEGER is 294
            -- Declared in Windows as WM_MENUCOMMAND

    Wm_menudrag: INTEGER is 291
            -- Declared in Windows as WM_MENUDRAG

    Wm_menugetobject: INTEGER is 292
            -- Declared in Windows as WM_MENUGETOBJECT

    Wm_menurbuttonup: INTEGER is 290
            -- Declared in Windows as WM_MENURBUTTONUP

    Wm_menuselect: INTEGER is 287
            -- Declared in Windows as WM_MENUSELECT

    Wm_mouseactivate: INTEGER is 33
            -- Declared in Windows as WM_MOUSEACTIVATE

    Wm_mousefirst: INTEGER is 512
            -- Declared in Windows as WM_MOUSEFIRST

    Wm_mousehover: INTEGER is 673
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSEHOVER

    wm_mouselast: INTEGER
            -- Declared in Windows as WM_MOUSELAST

    Wm_mouseleave: INTEGER is 675
            -- Require Windows98, Windows NT 4.0 or later
            -- Declared in Windows as WM_MOUSELEAVE

    Wm_mousemove: INTEGER is 512
            -- Declared in Windows as WM_MOUSEMOVE

    Wm_mousewheel: INTEGER is 522
            -- Declared in Windows as WM_MOUSEWHEEL

    Wm_move: INTEGER is 3
            -- Declared in Windows as WM_MOVE

    Wm_moving: INTEGER is 534
            -- Declared in Windows as WM_MOVING

    Wm_ncactivate: INTEGER is 134
            -- Declared in Windows as WM_NCACTIVATE

    Wm_nccalcsize: INTEGER is 131
            -- Declared in Windows as WM_NCCALCSIZE

    Wm_nccreate: INTEGER is 129
            -- Declared in Windows as WM_NCCREATE

    Wm_ncdestroy: INTEGER is 130
            -- Declared in Windows as WM_NCDESTROY

    Wm_nchittest: INTEGER is 132
            -- Declared in Windows as WM_NCHITTEST

    Wm_nclbuttondblclk: INTEGER is 163
            -- Declared in Windows as WM_NCLBUTTONDBLCLK

    Wm_nclbuttondown: INTEGER is 161
            -- Declared in Windows as WM_NCLBUTTONDOWN

    Wm_nclbuttonup: INTEGER is 162
            -- Declared in Windows as WM_NCLBUTTONUP

    Wm_ncmbuttondblclk: INTEGER is 169
            -- Declared in Windows as WM_NCMBUTTONDBLCLK

    Wm_ncmbuttondown: INTEGER is 167
            -- Declared in Windows as WM_NCMBUTTONDOWN

    Wm_ncmbuttonup: INTEGER is 168
            -- Declared in Windows as WM_NCMBUTTONUP

    Wm_ncmousehover: INTEGER is 672
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSEHOVER

    Wm_ncmouseleave: INTEGER is 674
            -- Require Windows98, Windows NT 5.0 or later
            -- Declared in Windows as WM_NCMOUSELEAVE

    Wm_ncmousemove: INTEGER is 160
            -- Declared in Windows as WM_NCMOUSEMOVE

    Wm_ncpaint: INTEGER is 133
            -- Declared in Windows as WM_NCPAINT

    Wm_ncrbuttondblclk: INTEGER is 166
            -- Declared in Windows as WM_NCRBUTTONDBLCLK

    Wm_ncrbuttondown: INTEGER is 164
            -- Declared in Windows as WM_NCRBUTTONDOWN

    Wm_ncrbuttonup: INTEGER is 165
            -- Declared in Windows as WM_NCRBUTTONUP

    Wm_ncxbuttondblclk: INTEGER is 173
            -- Declared in Windows as WM_NCXBUTTONDBLCLK

    Wm_ncxbuttondown: INTEGER is 171
            -- Declared in Windows as WM_NCXBUTTONDOWN

    Wm_ncxbuttonup: INTEGER is 172
            -- Declared in Windows as WM_NCXBUTTONUP

    Wm_nextdlgctl: INTEGER is 40
            -- Declared in Windows as WM_NEXTDLGCTL

    Wm_nextmenu: INTEGER is 531
            -- Declared in Windows as WM_NEXTMENU

    Wm_notify: INTEGER is 78
            -- Declared in Windows as WM_NOTIFY

    Wm_notifyformat: INTEGER is 85
            -- Declared in Windows as WM_NOTIFYFORMAT

    Wm_null: INTEGER is 0
            -- Declared in Windows as WM_NULL

    Wm_paint: INTEGER is 15
            -- Declared in Windows as WM_PAINT

    Wm_paintclipboard: INTEGER is 777
            -- Declared in Windows as WM_PAINTCLIPBOARD

    Wm_painticon: INTEGER is 38
            -- Declared in Windows as WM_PAINTICON

    Wm_palettechanged: INTEGER is 785
            -- Declared in Windows as WM_PALETTECHANGED

    Wm_paletteischanging: INTEGER is 784
            -- Declared in Windows as WM_PALETTEISCHANGING

    Wm_parentnotify: INTEGER is 528
            -- Declared in Windows as WM_PARENTNOTIFY

    Wm_paste: INTEGER is 770
            -- Declared in Windows as WM_PASTE

    Wm_penwinfirst: INTEGER is 896
            -- Declared in Windows as WM_PENWINFIRST

    Wm_penwinlast: INTEGER is 911
            -- Declared in Windows as WM_PENWINLAST

    Wm_power: INTEGER is 72
            -- Declared in Windows as WM_POWER

    Wm_powerbroadcast: INTEGER is 536
            -- Declared in Windows as WM_POWERBROADCAST

    Wm_print: INTEGER is 791
            -- Declared in Windows as WM_PRINT

    Wm_printclient: INTEGER is 792
            -- Declared in Windows as WM_PRINTCLIENT

    Wm_querydragicon: INTEGER is 55
            -- Declared in Windows as WM_QUERYDRAGICON

    Wm_queryendsession: INTEGER is 17
            -- Declared in Windows as WM_QUERYENDSESSION

    Wm_querynewpalette: INTEGER is 783
            -- Declared in Windows as WM_QUERYNEWPALETTE

    Wm_queryopen: INTEGER is 19
            -- Declared in Windows as WM_QUERYOPEN

    Wm_queryuistate: INTEGER is 297
            -- Declared in Windows as WM_QUERYUISTATE

    Wm_queuesync: INTEGER is 35
            -- Declared in Windows as WM_QUEUESYNC

    Wm_quit: INTEGER is 18
            -- Declared in Windows as WM_QUIT

    Wm_rbuttondblclk: INTEGER is 518
            -- Declared in Windows as WM_RBUTTONDBLCLK

    Wm_rbuttondown: INTEGER is 516
            -- Declared in Windows as WM_RBUTTONDOWN

    Wm_rbuttonup: INTEGER is 517
            -- Declared in Windows as WM_RBUTTONUP

    Wm_renderallformats: INTEGER is 774
            -- Declared in Windows as WM_RENDERALLFORMATS

    Wm_renderformat: INTEGER is 773
            -- Declared in Windows as WM_RENDERFORMAT

    Wm_setcursor: INTEGER is 32
            -- Declared in Windows as WM_SETCURSOR

    Wm_setfocus: INTEGER is 7
            -- Declared in Windows as WM_SETFOCUS

    Wm_setfont: INTEGER is 48
            -- Declared in Windows as WM_SETFONT

    Wm_sethotkey: INTEGER is 50
            -- Declared in Windows as WM_SETHOTKEY

    Wm_seticon: INTEGER is 128
            -- Declared in Windows as WM_SETICON

    Wm_setredraw: INTEGER is 11
            -- Declared in Windows as WM_SETREDRAW

    Wm_settext: INTEGER is 12
            -- Declared in Windows as WM_SETTEXT

    Wm_settingchange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WM_CONSTANTS as synonym of wm_wininichange.

    Wm_showwindow: INTEGER is 24
            -- Declared in Windows as WM_SHOWWINDOW

    Wm_size: INTEGER is 5
            -- Declared in Windows as WM_SIZE

    Wm_sizeclipboard: INTEGER is 779
            -- Declared in Windows as WM_SIZECLIPBOARD

    Wm_sizing: INTEGER is 532
            -- Declared in Windows as WM_SIZING

    Wm_spoolerstatus: INTEGER is 42
            -- Declared in Windows as WM_SPOOLERSTATUS

    Wm_stylechanged: INTEGER is 125
            -- Declared in Windows as WM_STYLECHANGED

    Wm_stylechanging: INTEGER is 124
            -- Declared in Windows as WM_STYLECHANGING

    Wm_syncpaint: INTEGER is 136
            -- Declared in Windows as WM_SYNCPAINT

    Wm_syschar: INTEGER is 262
            -- Declared in Windows as WM_SYSCHAR

    Wm_syscolorchange: INTEGER is 21
            -- Declared in Windows as WM_SYSCOLORCHANGE

    Wm_syscommand: INTEGER is 274
            -- Declared in Windows as WM_SYSCOMMAND

    Wm_sysdeadchar: INTEGER is 263
            -- Declared in Windows as WM_SYSDEADCHAR

    Wm_syskeydown: INTEGER is 260
            -- Declared in Windows as WM_SYSKEYDOWN

    Wm_syskeyup: INTEGER is 261
            -- Declared in Windows as WM_SYSKEYUP

    Wm_tcard: INTEGER is 82
            -- Declared in Windows as WM_TCARD

    Wm_timechange: INTEGER is 30
            -- Declared in Windows as WM_TIMECHANGE

    Wm_timer: INTEGER is 275
            -- Declared in Windows as WM_TIMER

    Wm_undo: INTEGER is 772
            -- Declared in Windows as WM_UNDO

    Wm_uninitmenupopup: INTEGER is 293
            -- Declared in Windows as WM_UNINITMENUPOPUP

    Wm_updateuistate: INTEGER is 296
            -- Declared in Windows as WM_UPDATEUISTATE

    Wm_user: INTEGER is 1024
            -- Declared in Windows as WM_USER

    Wm_userchanged: INTEGER is 84
            -- Declared in Windows as WM_USERCHANGED

    Wm_vkeytoitem: INTEGER is 46
            -- Declared in Windows as WM_VKEYTOITEM

    Wm_vscroll: INTEGER is 277
            -- Declared in Windows as WM_VSCROLL

    Wm_vscrollclipboard: INTEGER is 778
            -- Declared in Windows as WM_VSCROLLCLIPBOARD

    Wm_windowposchanged: INTEGER is 71
            -- Declared in Windows as WM_WINDOWPOSCHANGED

    Wm_windowposchanging: INTEGER is 70
            -- Declared in Windows as WM_WINDOWPOSCHANGING

    Wm_wininichange: INTEGER is 26
            -- Declared in Windows as WM_WININICHANGE
            -- Was declared in WEL_WM_CONSTANTS as synonym of wm_settingchange.

    Wm_xbuttondblclk: INTEGER is 525
            -- Declared in Windows as WM_XBUTTONDBLCLK

    Wm_xbuttondown: INTEGER is 523
            -- Declared in Windows as WM_XBUTTONDOWN

    Wm_xbuttonup: INTEGER is 524
            -- Declared in Windows as WM_XBUTTONUP

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WM_CONSTANTS


WEL_WM_CTLCOLOR_CONSTANTS Chart

class
    WEL_WM_CTLCOLOR_CONSTANTS

General
    cluster: wel.consts
    description: "Window control color message (WM) constants."

Ancestors
    ANY

Queries
    Wm_ctlcolor: INTEGER
    Wm_ctlcolorbtn: INTEGER
    Wm_ctlcolordlg: INTEGER
    Wm_ctlcoloredit: INTEGER
    Wm_ctlcolorlistbox: INTEGER
    Wm_ctlcolormsgbox: INTEGER
    Wm_ctlcolorscrollbar: INTEGER
    Wm_ctlcolorstatic: INTEGER


WEL_WM_CTLCOLOR_CONSTANTS Flat contracts

indexing
    description: "Window control color message (WM) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:06 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WM_CTLCOLOR_CONSTANTS

feature -- Access

    Wm_ctlcolor: INTEGER is 25
            -- Declared in Windows as WM_CTLCOLOR

    Wm_ctlcolorbtn: INTEGER is 309
            -- Declared in Windows as WM_CTLCOLORBTN

    Wm_ctlcolordlg: INTEGER is 310
            -- Declared in Windows as WM_CTLCOLORDLG

    Wm_ctlcoloredit: INTEGER is 307
            -- Declared in Windows as WM_CTLCOLOREDIT

    Wm_ctlcolorlistbox: INTEGER is 308
            -- Declared in Windows as WM_CTLCOLORLISTBOX

    Wm_ctlcolormsgbox: INTEGER is 306
            -- Declared in Windows as WM_CTLCOLORMSGBOX

    Wm_ctlcolorscrollbar: INTEGER is 311
            -- Declared in Windows as WM_CTLCOLORSCROLLBAR

    Wm_ctlcolorstatic: INTEGER is 312
            -- Declared in Windows as WM_CTLCOLORSTATIC

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WM_CTLCOLOR_CONSTANTS


WEL_WPF_CONSTANTS Chart

class
    WEL_WPF_CONSTANTS

General
    cluster: wel.consts
    description: "WindowPlacement Flag (WPF) constant."

Ancestors
    ANY

Queries
    wpf_restoretomaximized: INTEGER
    wpf_setminposition: INTEGER


WEL_WPF_CONSTANTS Flat contracts

indexing
    description: "WindowPlacement Flag (WPF) constant."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:06 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WPF_CONSTANTS

feature -- Access

    wpf_restoretomaximized: INTEGER

    wpf_setminposition: INTEGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WPF_CONSTANTS


WEL_WS_CONSTANTS Chart

class
    WEL_WS_CONSTANTS

General
    cluster: wel.consts
    description: "Window style (WS) constants."

Ancestors
    ANY

Queries
    Cw_usedefault: INTEGER
    Ws_border: INTEGER
    Ws_caption: INTEGER
    Ws_child: INTEGER
    Ws_childwindow: INTEGER
    Ws_clipchildren: INTEGER
    Ws_clipsiblings: INTEGER
    Ws_disabled: INTEGER
    Ws_dlgframe: INTEGER
    Ws_ex_acceptfiles: INTEGER
    Ws_ex_clientedge: INTEGER
    Ws_ex_contexthelp: INTEGER
    Ws_ex_controlparent: INTEGER
    Ws_ex_dlgmodalframe: INTEGER
    Ws_ex_left: INTEGER
    Ws_ex_leftscrollbar: INTEGER
    Ws_ex_ltrreading: INTEGER
    Ws_ex_mdichild: INTEGER
    Ws_ex_noparentnotify: INTEGER
    Ws_ex_overlappedwindow: INTEGER
    Ws_ex_palettewindow: INTEGER
    Ws_ex_right: INTEGER
    Ws_ex_rightscrollbar: INTEGER
    Ws_ex_rtlreading: INTEGER
    Ws_ex_staticedge: INTEGER
    Ws_ex_toolwindow: INTEGER
    Ws_ex_topmost: INTEGER
    Ws_ex_transparent: INTEGER
    Ws_ex_windowedge: INTEGER
    Ws_group: INTEGER
    Ws_hscroll: INTEGER
    Ws_iconic: INTEGER
    Ws_maximize: INTEGER
    Ws_maximizebox: INTEGER
    Ws_minimize: INTEGER
    Ws_minimizebox: INTEGER
    Ws_overlapped: INTEGER
    Ws_overlappedwindow: INTEGER
    Ws_popup: INTEGER
    Ws_popupwindow: INTEGER
    Ws_sizebox: INTEGER
    Ws_sysmenu: INTEGER
    Ws_tabstop: INTEGER
    Ws_thickframe: INTEGER
    Ws_tiled: INTEGER
    Ws_tiledwindow: INTEGER
    Ws_visible: INTEGER
    Ws_vscroll: INTEGER


WEL_WS_CONSTANTS Flat contracts

indexing
    description: "Window style (WS) constants."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:06 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WS_CONSTANTS

feature -- Miscellaneous

    Cw_usedefault: INTEGER is -2147483648
            -- Declared in Windows as CW_USEDEFAULT

feature -- Basic window types

    Ws_child: INTEGER is 1073741824
            -- Declared in Windows as WS_CHILD

    Ws_overlapped: INTEGER is 0
            -- Declared in Windows as WS_OVERLAPPED
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_tiled.

    Ws_popup: INTEGER is -2147483648
            -- Declared in Windows as WS_POPUP

    Ws_tiled: INTEGER is 0
            -- Declared in Windows as WS_OVERLAPPED
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_overlapped.

feature -- Clipping styles

    Ws_clipchildren: INTEGER is 33554432
            -- Declared in Windows as WS_CLIPCHILDREN

    Ws_clipsiblings: INTEGER is 67108864
            -- Declared in Windows as WS_CLIPSIBLINGS

feature -- Common window styles

    Ws_childwindow: INTEGER is 1073741824
            -- Declared in Windows as WS_CHILDWINDOW

    Ws_overlappedwindow: INTEGER is 13565952
            -- Declared in Windows as WS_OVERLAPPEDWINDOW
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_tiledwindow.

    Ws_popupwindow: INTEGER is -2138570752
            -- Declared in Windows as WS_POPUPWINDOW

    Ws_tiledwindow: INTEGER is 13565952
            -- Declared in Windows as WS_OVERLAPPEDWINDOW
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_overlappedwindow.

feature -- Control window styles

    Ws_group: INTEGER is 131072
            -- Declared in Windows as WS_GROUP

    Ws_tabstop: INTEGER is 65536
            -- Declared in Windows as WS_TABSTOP

feature -- Extended window styles

    Ws_ex_acceptfiles: INTEGER is 16
            -- Declared in Windows as WS_EX_ACCEPTFILES

    Ws_ex_clientedge: INTEGER is 512
            -- Declared in Windows as WS_EX_CLIENTEDGE

    Ws_ex_contexthelp: INTEGER is 1024
            -- Declared in Windows as WS_EX_CONTEXTHELP

    Ws_ex_controlparent: INTEGER is 65536
            -- Declared in Windows as WS_EX_CONTROLPARENT

    Ws_ex_dlgmodalframe: INTEGER is 1
            -- Declared in Windows as WS_EX_DLGMODALFRAME

    Ws_ex_left: INTEGER is 0
            -- Declared in Windows as WS_EX_LEFT

    Ws_ex_leftscrollbar: INTEGER is 16384
            -- Declared in Windows as WS_EX_LEFTSCROLLBAR

    Ws_ex_ltrreading: INTEGER is 0
            -- Declared in Windows as WS_EX_LTRREADING

    Ws_ex_mdichild: INTEGER is 64
            -- Declared in Windows as WS_EX_MDICHILD

    Ws_ex_noparentnotify: INTEGER is 4
            -- Declared in Windows as WS_EX_NOPARENTNOTIFY

    Ws_ex_overlappedwindow: INTEGER is 768
            -- Declared in Windows as WS_EX_OVERLAPPEDWINDOW

    Ws_ex_palettewindow: INTEGER is 392
            -- Declared in Windows as WS_EX_PALETTEWINDOW

    Ws_ex_right: INTEGER is 4096
            -- Declared in Windows as WS_EX_RIGHT

    Ws_ex_rightscrollbar: INTEGER is 0
            -- Declared in Windows as WS_EX_RIGHTSCROLLBAR

    Ws_ex_rtlreading: INTEGER is 8192
            -- Declared in Windows as WS_EX_RTLREADING

    Ws_ex_staticedge: INTEGER is 131072
            -- Declared in Windows as WS_EX_STATICEDGE

    Ws_ex_toolwindow: INTEGER is 128
            -- Declared in Windows as WS_EX_TOOLWINDOW

    Ws_ex_topmost: INTEGER is 8
            -- Declared in Windows as WS_EX_TOPMOST

    Ws_ex_transparent: INTEGER is 32
            -- Declared in Windows as WS_EX_TRANSPARENT

    Ws_ex_windowedge: INTEGER is 256
            -- Declared in Windows as WS_EX_WINDOWEDGE

feature -- Generic window states

    Ws_disabled: INTEGER is 134217728
            -- Declared in Windows as WS_DISABLED

    Ws_visible: INTEGER is 268435456
            -- Declared in Windows as WS_VISIBLE

feature -- Main window states

    Ws_iconic: INTEGER is 536870912
            -- Declared in Windows as WS_MINIMIZE
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_minimize.

    Ws_maximize: INTEGER is 16777216
            -- Declared in Windows as WS_MAXIMIZE

    Ws_minimize: INTEGER is 536870912
            -- Declared in Windows as WS_MINIMIZE
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_iconic.

feature -- Main window styles

    Ws_border: INTEGER is 8388608
            -- Declared in Windows as WS_BORDER

    Ws_caption: INTEGER is 12582912
            -- Declared in Windows as WS_CAPTION

    Ws_dlgframe: INTEGER is 4194304
            -- Declared in Windows as WS_DLGFRAME

    Ws_hscroll: INTEGER is 1048576
            -- Declared in Windows as WS_HSCROLL

    Ws_maximizebox: INTEGER is 65536
            -- Declared in Windows as WS_MAXIMIZEBOX

    Ws_minimizebox: INTEGER is 131072
            -- Declared in Windows as WS_MINIMIZEBOX

    Ws_sizebox: INTEGER is 262144
            -- Declared in Windows as WS_THICKFRAME
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_thickframe.

    Ws_sysmenu: INTEGER is 524288
            -- Declared in Windows as WS_SYSMENU

    Ws_thickframe: INTEGER is 262144
            -- Declared in Windows as WS_THICKFRAME
            -- Was declared in WEL_WS_CONSTANTS as synonym of ws_sizebox.

    Ws_vscroll: INTEGER is 2097152
            -- Declared in Windows as WS_VSCROLL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WS_CONSTANTS


cluster wel.controls

Cluster
    wel.controls

Supercluster
    wel

Classes
    WEL_BAR
    WEL_BITMAP_BUTTON
    WEL_BUTTON
    WEL_CHECK_BOX
    WEL_CHECK_BOX_3_STATE
    WEL_COMBO_BOX
    WEL_COMBO_BOX_EX
    WEL_COMMON_CONTROLS_DLL
    WEL_CONTROL
    WEL_DROP_DOWN_COMBO_BOX
    WEL_DROP_DOWN_COMBO_BOX_EX
    WEL_DROP_DOWN_LIST_COMBO_BOX
    WEL_DROP_DOWN_LIST_COMBO_BOX_EX
    WEL_EDIT
    WEL_FLAT_TOOL_BAR
    WEL_GROUP_BOX
    WEL_HEADER_CONTROL
    WEL_IMAGELIST_TOOL_BAR
    WEL_LIST_BOX
    WEL_LIST_VIEW
    WEL_MULTIPLE_LINE_EDIT
    WEL_MULTIPLE_SELECTION_LIST_BOX
    WEL_OWNER_DRAW_BUTTON
    WEL_PROGRESS_BAR
    WEL_PUSH_BUTTON
    WEL_RADIO_BUTTON
    WEL_REBAR
    WEL_RICH_EDIT
    WEL_RICH_EDIT_DLL
    WEL_SCROLL_BAR
    WEL_SELECTABLE_BUTTON
    WEL_SIMPLE_COMBO_BOX
    WEL_SINGLE_LINE_EDIT
    WEL_SINGLE_SELECTION_LIST_BOX
    WEL_STATIC
    WEL_STATIC_BITMAP
    WEL_STATUS_WINDOW
    WEL_TAB_CONTROL
    WEL_TOOL_BAR
    WEL_TOOLTIP
    WEL_TRACK_BAR
    WEL_TREE_VIEW
    WEL_UP_DOWN_CONTROL


WEL_BAR Chart

deferred class
    WEL_BAR

General
    cluster: wel.controls
    description: "Ancestor to scroll bar and track bar."

Ancestors
    WEL_CONTROL

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    maximum: INTEGER
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    minimum: INTEGER
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    position: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_position (new_position: INTEGER)
    set_range (a_minimum, a_maximum: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_BAR Flat contracts

indexing
    description: "Ancestor to scroll bar and track bar."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:08 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_BAR

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    maximum: INTEGER
            -- Maximum position
        require
            exists: exists
        ensure
            maximum_ok: maximum >= minimum

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimum: INTEGER
            -- Minimum position
        require
            exists: exists
        ensure
            minimum_ok: minimum <= maximum

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    position: INTEGER
            -- Current position
        require
            exists: exists
        ensure
            valid_minimum: Result >= minimum
            valid_maximum: Result <= maximum

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_position (new_position: INTEGER)
            -- Set position with new_position
        require
            exists: exists
            valid_minimum: new_position >= minimum
            valid_maximum: new_position <= maximum
        ensure
            position_set: position = new_position

    set_range (a_minimum, a_maximum: INTEGER)
            -- Set minimum and maximum with
            -- a_minimum and a_maximum
        require
            exists: exists
            valid_range: a_minimum <= a_maximum
        ensure
            minimum_set: minimum = a_minimum
            maximum_set: maximum = a_maximum

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BAR


WEL_BITMAP_BUTTON Chart

class
    WEL_BITMAP_BUTTON

General
    cluster: wel.controls
    description: "A button with a pixmap OR a text on it."
    create: make_by_id, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_BM_CONSTANTS
    WEL_BS_CONSTANTS
    WEL_BUTTON
    WEL_IMAGE_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    current_pixmap: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    icon: WEL_ICON
    id: INTEGER
    Image_bitmap: INTEGER
    Image_cursor: INTEGER
    Image_enhmetafile: INTEGER
    Image_icon: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_bitmap (a_bitmap: WEL_BITMAP)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_icon (an_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_bitmap
    show_horizontal_scroll_bar
    show_icon
    show_scroll_bars
    show_text
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_bitmap
    unset_icon
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_BITMAP_BUTTON Flat contracts

indexing
    description: "A button with a pixmap OR a text on it."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:08 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BITMAP_BUTTON

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id
        ensure then
            pixmap_not_set: current_pixmap /= image_icon and current_pixmap /= image_bitmap

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id
        ensure then
            pixmap_not_set: current_pixmap /= image_icon and current_pixmap /= image_bitmap

feature -- Access

    bitmap: WEL_BITMAP
            -- Bitmap currently selected in the button.
            -- A global variable is needed because windows
            -- do not copy this object.
        require
            current_pixmap = image_bitmap

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    current_pixmap: INTEGER
            -- Value is Image_bitmap if a bitmap is set,
            -- and Image_icon if an icon is set.

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    icon: WEL_ICON
            -- Icon currently selected in the button.
            -- A global variable is needed because windows
            -- do not copy this object.
        require
            current_pixmap = image_icon

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    Image_bitmap: INTEGER is 0
            -- Declared in Windows as IMAGE_BITMAP
            -- (from WEL_IMAGE_CONSTANTS)

    Image_cursor: INTEGER is 2
            -- Declared in Windows as IMAGE_CURSOR
            -- (from WEL_IMAGE_CONSTANTS)

    Image_enhmetafile: INTEGER is 3
            -- Declared in Windows as IMAGE_ENHMETAFILE
            -- (from WEL_IMAGE_CONSTANTS)

    Image_icon: INTEGER is 1
            -- Declared in Windows as IMAGE_ICON
            -- (from WEL_IMAGE_CONSTANTS)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_bitmap
            -- Show the bitmap of the button and not the text.
        require
            exists: exists
            valid_bitmap: current_pixmap = image_bitmap implies bitmap /= void

    show_icon
            -- Show the icon of the button and not the text.
        require
            exists: exists
            valid_icon: current_pixmap = image_icon implies icon /= void

    show_text
            -- Show the text of the button and not the pixmap or icon.
        require
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_bitmap (a_bitmap: WEL_BITMAP)
            -- Make bmp the new bitmap of the button.
            -- Replace the old bitmap.
        require
            exists: exists
            valid_bitmap: a_bitmap /= void

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_icon (an_icon: WEL_ICON)
            -- Make ico the new icon of the button.
            -- Replace the old icon.
        require
            exists: exists
            valid_icon: an_icon /= void

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_bitmap
            -- Remove the bitmap or the icon from the button
            -- Was declared in WEL_BITMAP_BUTTON as synonym of unset_icon.
        require
            exists: exists
            valid_bitmap: bitmap /= void or icon /= void
        ensure
            pixmap_not_set: current_pixmap /= image_icon and current_pixmap /= image_bitmap

    unset_icon
            -- Remove the bitmap or the icon from the button
            -- Was declared in WEL_BITMAP_BUTTON as synonym of unset_bitmap.
        require
            exists: exists
            valid_bitmap: bitmap /= void or icon /= void
        ensure
            pixmap_not_set: current_pixmap /= image_icon and current_pixmap /= image_bitmap

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BITMAP_BUTTON


WEL_BUTTON Chart

deferred class
    WEL_BUTTON

General
    cluster: wel.controls
    description: "Ancestor to all buttons (check, push, etc.)."

Ancestors
    WEL_BN_CONSTANTS
    WEL_COLOR_CONTROL
    WEL_CONTROL

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_BUTTON Flat contracts

indexing
    description: "Ancestor to all buttons (check, push, etc.)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:08 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_BUTTON

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BUTTON


WEL_CHECK_BOX_3_STATE Chart

class
    WEL_CHECK_BOX_3_STATE

General
    cluster: wel.controls
    description: "Check box which has 3 states (on, off, indeterminate)."
    create: make_by_id, make

Ancestors
    WEL_CHECK_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    checked: BOOLEAN
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    indeterminate: BOOLEAN
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_checked
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_indeterminate
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unchecked
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    consistent state


WEL_CHECK_BOX_3_STATE Flat contracts

indexing
    description: "Check box which has 3 states (on, off, indeterminate)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:09 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHECK_BOX_3_STATE

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    checked: BOOLEAN
            -- Is the button checked?
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    indeterminate: BOOLEAN
            -- Is the state indeterminate?
        require
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_checked
            -- Check the button
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists
        ensure -- from WEL_CHECK_BOX
            checked: checked

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_indeterminate
            -- Set the indeterminate state.
        require
            exists: exists
        ensure
            indeterminate: indeterminate

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unchecked
            -- Uncheck the button
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists
        ensure -- from WEL_CHECK_BOX
            unchecked: not checked

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

    consistent_state: exists and then checked implies not indeterminate
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHECK_BOX_3_STATE


WEL_CHECK_BOX Chart

class
    WEL_CHECK_BOX

General
    cluster: wel.controls
    description: "Control that has a check box and a text."
    create: make_by_id, make

Ancestors
    WEL_BM_CONSTANTS
    WEL_BS_CONSTANTS
    WEL_BUTTON

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    checked: BOOLEAN
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_checked
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unchecked
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_CHECK_BOX Flat contracts

indexing
    description: "Control that has a check box and a text."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:09 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHECK_BOX

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    checked: BOOLEAN
            -- Is the button checked?
        require
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_checked
            -- Check the button
        require
            exists: exists
        ensure
            checked: checked

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unchecked
            -- Uncheck the button
        require
            exists: exists
        ensure
            unchecked: not checked

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHECK_BOX


WEL_COMBO_BOX_EX Chart

deferred class
    WEL_COMBO_BOX_EX

General
    cluster: wel.controls
    description: " WEL Combo Box Ex. A more powerfull combo-box that handles bitmaps."

Ancestors
    WEL_CBEIF_CONSTANTS
    WEL_CBEM_CONSTANTS
    WEL_CBEN_CONSTANTS
    WEL_CBES_CONSTANTS
    WEL_CBS_CONSTANTS
    WEL_COMBO_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    dropped_rect: WEL_RECT
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_image_list: WEL_IMAGE_LIST
    get_item_info (index: INTEGER): WEL_COMBO_BOX_EX_ITEM
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    list_item_height: INTEGER
    list_shown: BOOLEAN
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    selection_field_height: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_item (index: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_list
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_cben_beginedit_item
    on_cben_delete_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    on_cben_endedit_item (info: WEL_NM_COMBO_BOX_EX_ENDEDIT)
    on_cben_insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    on_cbn_closeup
    on_cbn_dblclk
    on_cbn_dropdown
    on_cbn_editchange
    on_cbn_editupdate
    on_cbn_errspace
    on_cbn_killfocus
    on_cbn_selchange
    on_cbn_selendcancel
    on_cbn_selendok
    on_cbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_image_list (an_imagelist: WEL_IMAGE_LIST)
    set_item (an_item: POINTER)
    set_item_info (index: INTEGER; an_item: WEL_COMBO_BOX_EX_ITEM)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_list
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_COMBO_BOX_EX Flat contracts

indexing
    description: " WEL Combo Box Ex. A more powerfull combo-box that handles bitmaps."
    note: "To use this control you need to create a WEL_INIT_COMMON_CONTROLS with the flag Icc_userex_classes in your application class."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:10 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_COMBO_BOX_EX

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            result_exists: Result /= void

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    dropped_rect: WEL_RECT
            -- Rectangle of the drop down list box
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_image_list: WEL_IMAGE_LIST
            -- Get the image list associated with this combination box.
            -- Returns Void if none.\

    get_item_info (index: INTEGER): WEL_COMBO_BOX_EX_ITEM
            -- Retrieves the information about the zero-based
            -- index item.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    get_text_limit: INTEGER
            -- Return the maximum text length.
            -- (from WEL_COMBO_BOX)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    list_item_height: INTEGER
            -- height of list items in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    list_shown: BOOLEAN
            -- Is the drop down list shown?
        require
            exists: exists

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- String currently selected
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    selection_field_height: INTEGER
            -- height of the selection field in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_COMBO_BOX)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Zero-based index of the first visible item in the list
            -- box portion of a combo box.
            -- Initially, the item with index 0 is at the top of the
            -- list box, but if the list box contents have been scrolled,
            -- another item may be at the top.
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_list
            -- Hide the drop down list.
        require
            exists: exists
        ensure
            list_not_shown: not list_shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            selected_item: selected and then selected_item = index

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_image_list (an_imagelist: WEL_IMAGE_LIST)
            -- Set the current image list to an_imagelist.
            -- If an_imagelist is set to Void, it removes
            -- the current associated image list (if any).

    set_item_info (index: INTEGER; an_item: WEL_COMBO_BOX_EX_ITEM)
            -- Sets the information about the zero-based
            -- index item.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_list
            -- Show the drop down list.
        require
            exists: exists
        ensure
            list_shown: list_shown

    unselect
            -- Clear the selection.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            selection_cleared: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_string (a_string: STRING)
            -- Add a_string in the combo box.
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    delete_item (index: INTEGER)
            -- Delete the zero-based index item.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            new_count: count = old count - 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- Insert an_item in the combo-box.
        require
            exists: exists
            an_item_not_void: an_item /= void
            an_item_exists: an_item.exists
            index_large_enough: an_item.index >= 0
            index_small_enough: an_item.index <= count
        ensure
            new_count: count = old count + 1

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index.
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_small_enough: index <= count
            index_large_enough: index >= 0
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Inapplicable

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the combo box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- To check
        require -- from WEL_COMBO_BOX
            exists: exists
            files_not_void: files /= void

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notification

    on_cben_beginedit_item
            -- The user activated the drop-down list or clicked in the
            -- control's edit box.

    on_cben_delete_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- An item has been deleted from the control.

    on_cben_endedit_item (info: WEL_NM_COMBO_BOX_EX_ENDEDIT)
            -- The user has concluded an operation within the edit box
            -- or has selected an item from the control's drop-down list.

    on_cben_insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- An item has been inserted in the control.

feature -- Notifications

    on_cbn_closeup
            -- The combo box has been closed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dblclk
            -- The user double-clicks a string in the list box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dropdown
            -- The list box is about to be made visible.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editchange
            -- The user has taken an action that may have altered
            -- the text in the edit control portion.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editupdate
            -- The edit control portion is about to
            -- display altered text.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_errspace
            -- The combo box cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_killfocus
            -- The combo box loses the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selchange
            -- The selection is about to be changed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendcancel
            -- The user selects an item, but then selects another
            -- control or closes the dialog box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendok
            -- The user selects a list item, or selects
            -- an item an then closes the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_setfocus
            -- The combo box receives the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMBO_BOX_EX


WEL_COMBO_BOX Chart

deferred class
    WEL_COMBO_BOX

General
    cluster: wel.controls
    description: "Control which combines a list box and an edit control."

Ancestors
    WEL_CB_CONSTANTS
    WEL_CBN_CONSTANTS
    WEL_CONTROL

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    dropped_rect: WEL_RECT
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    list_item_height: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    selection_field_height: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_cbn_closeup
    on_cbn_dblclk
    on_cbn_dropdown
    on_cbn_editchange
    on_cbn_editupdate
    on_cbn_errspace
    on_cbn_killfocus
    on_cbn_selchange
    on_cbn_selendcancel
    on_cbn_selendok
    on_cbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_COMBO_BOX Flat contracts

indexing
    description: "Control which combines a list box and an edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:09 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_COMBO_BOX

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
        require
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure
            result_exists: Result /= void

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
        require
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure
            positive_result: Result >= 0

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Measurement

    count: INTEGER
            -- Number of lines
        require
            exists: exists
        ensure
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    dropped_rect: WEL_RECT
            -- Rectangle of the drop down list box
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_text_limit: INTEGER
            -- Return the maximum text length.

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    list_item_height: INTEGER
            -- height of list items in a combo box
        ensure
            operation_successful: Result /= cb_err

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
        require
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
        require
            exists: exists
            selected: selected
        ensure
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- String currently selected
        require
            exists: exists
            selected: selected
        ensure
            result_not_void: Result /= void

    selection_field_height: INTEGER
            -- height of the selection field in a combo box
        ensure
            operation_successful: Result /= cb_err

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Zero-based index of the first visible item in the list
            -- box portion of a combo box.
            -- Initially, the item with index 0 is at the top of the
            -- list box, but if the list box contents have been scrolled,
            -- another item may be at the top.
        ensure
            operation_successful: Result /= cb_err

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            selected_item: selected and then selected_item = index

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unselect
            -- Clear the selection.
        require
            exists: exists
        ensure
            selection_cleared: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the combo box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
        require
            exists: exists
            files_not_void: files /= void

    add_string (a_string: STRING)
            -- Add a_string in the combo box.
        require
            exists: exists
            a_string_not_void: a_string /= void
        ensure
            new_count: count = old count + 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index.
        require
            exists: exists
            a_string_not_void: a_string /= void
            index_small_enough: index <= count
            index_large_enough: index >= 0
        ensure
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
        require
            exists: exists
        ensure
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_cbn_closeup
            -- The combo box has been closed.
        require
            exists: exists

    on_cbn_dblclk
            -- The user double-clicks a string in the list box.
        require
            exists: exists

    on_cbn_dropdown
            -- The list box is about to be made visible.
        require
            exists: exists

    on_cbn_editchange
            -- The user has taken an action that may have altered
            -- the text in the edit control portion.
        require
            exists: exists

    on_cbn_editupdate
            -- The edit control portion is about to
            -- display altered text.
        require
            exists: exists

    on_cbn_errspace
            -- The combo box cannot allocate enough memory to
            -- meet a specific request.
        require
            exists: exists

    on_cbn_killfocus
            -- The combo box loses the keyboard focus.
        require
            exists: exists

    on_cbn_selchange
            -- The selection is about to be changed.
        require
            exists: exists

    on_cbn_selendcancel
            -- The user selects an item, but then selects another
            -- control or closes the dialog box.
        require
            exists: exists

    on_cbn_selendok
            -- The user selects a list item, or selects
            -- an item an then closes the list.
        require
            exists: exists

    on_cbn_setfocus
            -- The combo box receives the keyboard focus.
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMBO_BOX


WEL_COMMON_CONTROLS_DLL Chart

class
    WEL_COMMON_CONTROLS_DLL

General
    cluster: wel.controls
    description: "This class is used to load the common controls dll."
    create: make

Ancestors
    WEL_DLL

Queries
    exists: BOOLEAN
    item: POINTER
    name: STRING
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    make
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_COMMON_CONTROLS_DLL Flat contracts

indexing
    description: "This class is used to load the common controls dll."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:10 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMMON_CONTROLS_DLL

create

    make
            -- Load the common controls DLL.

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    name: STRING
            -- DLL name (including the path)
            -- (from WEL_DLL)
        require -- from WEL_DLL
            exists: exists
        ensure -- from WEL_DLL
            result_not_void: Result /= void
            result_not_empty: not Result.is_empty

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature

    make
            -- Load the common controls DLL.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMMON_CONTROLS_DLL


WEL_CONTROL Chart

deferred class
    WEL_CONTROL

General
    cluster: wel.controls
    description: "Ancestor to all Windows controls (button, list box, etc.)."

Ancestors
    WEL_WINDOW
    WEL_WS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_CONTROL Flat contracts

indexing
    description: "Ancestor to all Windows controls (button, list box, etc.)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:10 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_CONTROL

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
        require
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
        require
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
        require
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
        require
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
        require
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CONTROL


WEL_DROP_DOWN_COMBO_BOX_EX Chart

class
    WEL_DROP_DOWN_COMBO_BOX_EX

General
    cluster: wel.controls
    description: "An editable combo-box that handles bitmaps."
    create: make

Ancestors
    WEL_COMBO_BOX_EX
    WEL_EM_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    dropped_rect: WEL_RECT
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_image_list: WEL_IMAGE_LIST
    get_item_info (index: INTEGER): WEL_COMBO_BOX_EX_ITEM
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    list_item_height: INTEGER
    list_shown: BOOLEAN
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    selection_field_height: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_item (index: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_list
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_cben_beginedit_item
    on_cben_delete_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    on_cben_endedit_item (info: WEL_NM_COMBO_BOX_EX_ENDEDIT)
    on_cben_insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    on_cbn_closeup
    on_cbn_dblclk
    on_cbn_dropdown
    on_cbn_editchange
    on_cbn_editupdate
    on_cbn_errspace
    on_cbn_killfocus
    on_cbn_selchange
    on_cbn_selendcancel
    on_cbn_selendok
    on_cbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_image_list (an_imagelist: WEL_IMAGE_LIST)
    set_item (an_item: POINTER)
    set_item_info (index: INTEGER; an_item: WEL_COMBO_BOX_EX_ITEM)
    set_limit_text (limit: INTEGER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_list
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_DROP_DOWN_COMBO_BOX_EX Flat contracts

indexing
    description: "An editable combo-box that handles bitmaps."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:11 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DROP_DOWN_COMBO_BOX_EX

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_COMBO_BOX
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            result_exists: Result /= void

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    dropped_rect: WEL_RECT
            -- Rectangle of the drop down list box
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_image_list: WEL_IMAGE_LIST
            -- Get the image list associated with this combination box.
            -- Returns Void if none.\
            -- (from WEL_COMBO_BOX_EX)

    get_item_info (index: INTEGER): WEL_COMBO_BOX_EX_ITEM
            -- Retrieves the information about the zero-based
            -- index item.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    get_text_limit: INTEGER
            -- Return the maximum text length.
            -- (from WEL_COMBO_BOX)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    list_item_height: INTEGER
            -- height of list items in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    list_shown: BOOLEAN
            -- Is the drop down list shown?
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- String currently selected
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    selection_field_height: INTEGER
            -- height of the selection field in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Zero-based index of the first visible item in the list
            -- box portion of a combo box.
            -- Initially, the item with index 0 is at the top of the
            -- list box, but if the list box contents have been scrolled,
            -- another item may be at the top.
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_list
            -- Hide the drop down list.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
        ensure -- from WEL_COMBO_BOX_EX
            list_not_shown: not list_shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            selected_item: selected and then selected_item = index

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_image_list (an_imagelist: WEL_IMAGE_LIST)
            -- Set the current image list to an_imagelist.
            -- If an_imagelist is set to Void, it removes
            -- the current associated image list (if any).
            -- (from WEL_COMBO_BOX_EX)

    set_item_info (index: INTEGER; an_item: WEL_COMBO_BOX_EX_ITEM)
            -- Sets the information about the zero-based
            -- index item.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_list
            -- Show the drop down list.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
        ensure -- from WEL_COMBO_BOX_EX
            list_shown: list_shown

    unselect
            -- Clear the selection.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            selection_cleared: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_string (a_string: STRING)
            -- Add a_string in the combo box.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    delete_item (index: INTEGER)
            -- Delete the zero-based index item.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX_EX
            new_count: count = old count - 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- Insert an_item in the combo-box.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            an_item_not_void: an_item /= void
            an_item_exists: an_item.exists
            index_large_enough: an_item.index >= 0
            index_small_enough: an_item.index <= count
        ensure -- from WEL_COMBO_BOX_EX
            new_count: count = old count + 1

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_small_enough: index <= count
            index_large_enough: index >= 0
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Inapplicable

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the combo box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- To check
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            files_not_void: files /= void

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notification

    on_cben_beginedit_item
            -- The user activated the drop-down list or clicked in the
            -- control's edit box.
            -- (from WEL_COMBO_BOX_EX)

    on_cben_delete_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- An item has been deleted from the control.
            -- (from WEL_COMBO_BOX_EX)

    on_cben_endedit_item (info: WEL_NM_COMBO_BOX_EX_ENDEDIT)
            -- The user has concluded an operation within the edit box
            -- or has selected an item from the control's drop-down list.
            -- (from WEL_COMBO_BOX_EX)

    on_cben_insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- An item has been inserted in the control.
            -- (from WEL_COMBO_BOX_EX)

feature -- Notifications

    on_cbn_closeup
            -- The combo box has been closed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dblclk
            -- The user double-clicks a string in the list box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dropdown
            -- The list box is about to be made visible.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editchange
            -- The user has taken an action that may have altered
            -- the text in the edit control portion.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editupdate
            -- The edit control portion is about to
            -- display altered text.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_errspace
            -- The combo box cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_killfocus
            -- The combo box loses the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selchange
            -- The selection is about to be changed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendcancel
            -- The user selects an item, but then selects another
            -- control or closes the dialog box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendok
            -- The user selects a list item, or selects
            -- an item an then closes the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_setfocus
            -- The combo box receives the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Status settings

    set_limit_text (limit: INTEGER)
            -- Set the length of the text the user may type.
        require
            exists: exists
            positive_limit: limit >= 0

    set_text (a_text: STRING)
            -- Set the window text
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DROP_DOWN_COMBO_BOX_EX


WEL_DROP_DOWN_COMBO_BOX Chart

class
    WEL_DROP_DOWN_COMBO_BOX

General
    cluster: wel.controls
    description: "A combo box with a list box and an edit control."
    create: make_by_id, make

Ancestors
    WEL_CBS_CONSTANTS
    WEL_COMBO_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    dropped_rect: WEL_RECT
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    list_item_height: INTEGER
    list_shown: BOOLEAN
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    selection_field_height: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_list
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_cbn_closeup
    on_cbn_dblclk
    on_cbn_dropdown
    on_cbn_editchange
    on_cbn_editupdate
    on_cbn_errspace
    on_cbn_killfocus
    on_cbn_selchange
    on_cbn_selendcancel
    on_cbn_selendok
    on_cbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_limit_text (limit: INTEGER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_list
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_DROP_DOWN_COMBO_BOX Flat contracts

indexing
    description: "A combo box with a list box and an edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:10 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DROP_DOWN_COMBO_BOX

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_COMBO_BOX
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    height: INTEGER
            -- Height including the list box
        require -- from WEL_WINDOW
            exists: exists

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            result_exists: Result /= void

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    dropped_rect: WEL_RECT
            -- Rectangle of the drop down list box
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_text_limit: INTEGER
            -- Return the maximum text length.
            -- (from WEL_COMBO_BOX)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    list_item_height: INTEGER
            -- height of list items in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    list_shown: BOOLEAN
            -- Is the drop down list shown?
        require
            exists: exists

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- String currently selected
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    selection_field_height: INTEGER
            -- height of the selection field in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_COMBO_BOX)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Zero-based index of the first visible item in the list
            -- box portion of a combo box.
            -- Initially, the item with index 0 is at the top of the
            -- list box, but if the list box contents have been scrolled,
            -- another item may be at the top.
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_list
            -- Hide the drop down list.
        require
            exists: exists
        ensure
            list_not_shown: not list_shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            selected_item: selected and then selected_item = index

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_limit_text (limit: INTEGER)
            -- Set the length of the text the user may type.
        require
            exists: exists
            positive_limit: limit >= 0

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_list
            -- Show the drop down list.
        require
            exists: exists
        ensure
            list_shown: list_shown

    unselect
            -- Clear the selection.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            selection_cleared: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the combo box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            files_not_void: files /= void

    add_string (a_string: STRING)
            -- Add a_string in the combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_small_enough: index <= count
            index_large_enough: index >= 0
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_cbn_closeup
            -- The combo box has been closed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dblclk
            -- The user double-clicks a string in the list box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dropdown
            -- The list box is about to be made visible.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editchange
            -- The user has taken an action that may have altered
            -- the text in the edit control portion.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editupdate
            -- The edit control portion is about to
            -- display altered text.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_errspace
            -- The combo box cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_killfocus
            -- The combo box loses the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selchange
            -- The selection is about to be changed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendcancel
            -- The user selects an item, but then selects another
            -- control or closes the dialog box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendok
            -- The user selects a list item, or selects
            -- an item an then closes the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_setfocus
            -- The combo box receives the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DROP_DOWN_COMBO_BOX


WEL_DROP_DOWN_LIST_COMBO_BOX_EX Chart

class
    WEL_DROP_DOWN_LIST_COMBO_BOX_EX

General
    cluster: wel.controls
    description: "Objects that ..."
    create: make

Ancestors
    WEL_COMBO_BOX_EX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    dropped_rect: WEL_RECT
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_image_list: WEL_IMAGE_LIST
    get_item_info (index: INTEGER): WEL_COMBO_BOX_EX_ITEM
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    list_item_height: INTEGER
    list_shown: BOOLEAN
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    selection_field_height: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_item (index: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_list
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_cben_beginedit_item
    on_cben_delete_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    on_cben_endedit_item (info: WEL_NM_COMBO_BOX_EX_ENDEDIT)
    on_cben_insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
    on_cbn_closeup
    on_cbn_dblclk
    on_cbn_dropdown
    on_cbn_editchange
    on_cbn_editupdate
    on_cbn_errspace
    on_cbn_killfocus
    on_cbn_selchange
    on_cbn_selendcancel
    on_cbn_selendok
    on_cbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_image_list (an_imagelist: WEL_IMAGE_LIST)
    set_item (an_item: POINTER)
    set_item_info (index: INTEGER; an_item: WEL_COMBO_BOX_EX_ITEM)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_list
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_DROP_DOWN_LIST_COMBO_BOX_EX Flat contracts

indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/11/12 17:58:13 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DROP_DOWN_LIST_COMBO_BOX_EX

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_COMBO_BOX
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            result_exists: Result /= void

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    dropped_rect: WEL_RECT
            -- Rectangle of the drop down list box
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_image_list: WEL_IMAGE_LIST
            -- Get the image list associated with this combination box.
            -- Returns Void if none.\
            -- (from WEL_COMBO_BOX_EX)

    get_item_info (index: INTEGER): WEL_COMBO_BOX_EX_ITEM
            -- Retrieves the information about the zero-based
            -- index item.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    get_text_limit: INTEGER
            -- Return the maximum text length.
            -- (from WEL_COMBO_BOX)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    list_item_height: INTEGER
            -- height of list items in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    list_shown: BOOLEAN
            -- Is the drop down list shown?
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- String currently selected
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    selection_field_height: INTEGER
            -- height of the selection field in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Zero-based index of the first visible item in the list
            -- box portion of a combo box.
            -- Initially, the item with index 0 is at the top of the
            -- list box, but if the list box contents have been scrolled,
            -- another item may be at the top.
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_list
            -- Hide the drop down list.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
        ensure -- from WEL_COMBO_BOX_EX
            list_not_shown: not list_shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            selected_item: selected and then selected_item = index

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_image_list (an_imagelist: WEL_IMAGE_LIST)
            -- Set the current image list to an_imagelist.
            -- If an_imagelist is set to Void, it removes
            -- the current associated image list (if any).
            -- (from WEL_COMBO_BOX_EX)

    set_item_info (index: INTEGER; an_item: WEL_COMBO_BOX_EX_ITEM)
            -- Sets the information about the zero-based
            -- index item.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_list
            -- Show the drop down list.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
        ensure -- from WEL_COMBO_BOX_EX
            list_shown: list_shown

    unselect
            -- Clear the selection.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            selection_cleared: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_string (a_string: STRING)
            -- Add a_string in the combo box.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    delete_item (index: INTEGER)
            -- Delete the zero-based index item.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX_EX
            new_count: count = old count - 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- Insert an_item in the combo-box.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX_EX
            exists: exists
            an_item_not_void: an_item /= void
            an_item_exists: an_item.exists
            index_large_enough: an_item.index >= 0
            index_small_enough: an_item.index <= count
        ensure -- from WEL_COMBO_BOX_EX
            new_count: count = old count + 1

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_small_enough: index <= count
            index_large_enough: index >= 0
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Inapplicable

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the combo box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- To check
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            files_not_void: files /= void

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX_EX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notification

    on_cben_beginedit_item
            -- The user activated the drop-down list or clicked in the
            -- control's edit box.
            -- (from WEL_COMBO_BOX_EX)

    on_cben_delete_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- An item has been deleted from the control.
            -- (from WEL_COMBO_BOX_EX)

    on_cben_endedit_item (info: WEL_NM_COMBO_BOX_EX_ENDEDIT)
            -- The user has concluded an operation within the edit box
            -- or has selected an item from the control's drop-down list.
            -- (from WEL_COMBO_BOX_EX)

    on_cben_insert_item (an_item: WEL_COMBO_BOX_EX_ITEM)
            -- An item has been inserted in the control.
            -- (from WEL_COMBO_BOX_EX)

feature -- Notifications

    on_cbn_closeup
            -- The combo box has been closed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dblclk
            -- The user double-clicks a string in the list box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dropdown
            -- The list box is about to be made visible.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editchange
            -- The user has taken an action that may have altered
            -- the text in the edit control portion.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editupdate
            -- The edit control portion is about to
            -- display altered text.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_errspace
            -- The combo box cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_killfocus
            -- The combo box loses the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selchange
            -- The selection is about to be changed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendcancel
            -- The user selects an item, but then selects another
            -- control or closes the dialog box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendok
            -- The user selects a list item, or selects
            -- an item an then closes the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_setfocus
            -- The combo box receives the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DROP_DOWN_LIST_COMBO_BOX_EX


WEL_DROP_DOWN_LIST_COMBO_BOX Chart

class
    WEL_DROP_DOWN_LIST_COMBO_BOX

General
    cluster: wel.controls
    description: "A combo box which has a drop down list box."
    create: make_by_id, make

Ancestors
    WEL_CBS_CONSTANTS
    WEL_COMBO_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    dropped_rect: WEL_RECT
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    list_item_height: INTEGER
    list_shown: BOOLEAN
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    selection_field_height: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_list
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_cbn_closeup
    on_cbn_dblclk
    on_cbn_dropdown
    on_cbn_editchange
    on_cbn_editupdate
    on_cbn_errspace
    on_cbn_killfocus
    on_cbn_selchange
    on_cbn_selendcancel
    on_cbn_selendok
    on_cbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_list
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_DROP_DOWN_LIST_COMBO_BOX Flat contracts

indexing
    description: "A combo box which has a drop down list box."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:12 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DROP_DOWN_LIST_COMBO_BOX

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_COMBO_BOX
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    height: INTEGER
            -- Height including the list box
        require -- from WEL_WINDOW
            exists: exists

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            result_exists: Result /= void

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    dropped_rect: WEL_RECT
            -- Rectangle of the drop down list box
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_text_limit: INTEGER
            -- Return the maximum text length.
            -- (from WEL_COMBO_BOX)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    list_item_height: INTEGER
            -- height of list items in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    list_shown: BOOLEAN
            -- Is the drop down list shown?
        require
            exists: exists

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- String currently selected
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    selection_field_height: INTEGER
            -- height of the selection field in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_COMBO_BOX)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Zero-based index of the first visible item in the list
            -- box portion of a combo box.
            -- Initially, the item with index 0 is at the top of the
            -- list box, but if the list box contents have been scrolled,
            -- another item may be at the top.
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_list
            -- Hide the drop down list
        require
            exists: exists
        ensure
            list_not_shown: not list_shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            selected_item: selected and then selected_item = index

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_list
            -- Show the drop down list
        require
            exists: exists
        ensure
            list_shown: list_shown

    unselect
            -- Clear the selection.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            selection_cleared: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the combo box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            files_not_void: files /= void

    add_string (a_string: STRING)
            -- Add a_string in the combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_small_enough: index <= count
            index_large_enough: index >= 0
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_cbn_closeup
            -- The combo box has been closed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dblclk
            -- The user double-clicks a string in the list box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dropdown
            -- The list box is about to be made visible.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editchange
            -- The user has taken an action that may have altered
            -- the text in the edit control portion.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editupdate
            -- The edit control portion is about to
            -- display altered text.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_errspace
            -- The combo box cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_killfocus
            -- The combo box loses the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selchange
            -- The selection is about to be changed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendcancel
            -- The user selects an item, but then selects another
            -- control or closes the dialog box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendok
            -- The user selects a list item, or selects
            -- an item an then closes the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_setfocus
            -- The combo box receives the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DROP_DOWN_LIST_COMBO_BOX


WEL_EDIT Chart

deferred class
    WEL_EDIT

General
    cluster: wel.controls
    description: "This control permits the user to enter and edit text from the keyboard. Ancestor of WEL_SINGLE_LINE_EDIT and WEL_MULTIPLE_LINE_EDIT."

Ancestors
    WEL_EM_CONSTANTS
    WEL_EN_CONSTANTS
    WEL_ES_CONSTANTS
    WEL_STATIC

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    can_undo: BOOLEAN
    captured_window: WEL_WINDOW
    caret_position: INTEGER
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    formatting_rect: WEL_RECT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_selection: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    modified: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    read_only: BOOLEAN
    selection_end: INTEGER
    selection_start: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    clear
    clip_copy
    clip_cut
    clip_paste
    default_process_notification (notification_code: INTEGER)
    delete_selection
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_en_change
    on_en_errspace
    on_en_hscroll
    on_en_killfocus
    on_en_maxtext
    on_en_setfocus
    on_en_update
    on_en_vscroll
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    replace_selection (new_text: STRING)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_all
    set_capture
    set_caret_position (position: INTEGER)
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_modify (modify: BOOLEAN)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_read_only
    set_read_write
    set_selection (start_position, end_position: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_text_limit (limit: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    undo
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    consistent selection
    valid caret position


WEL_EDIT Flat contracts

indexing
    description: "This control permits the user to enter and edit text from the keyboard. Ancestor of WEL_SINGLE_LINE_EDIT and WEL_MULTIPLE_LINE_EDIT."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:14 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_EDIT

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_STATIC)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    can_undo: BOOLEAN
            -- Can the last operation be undone?
        require
            exists: exists

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    caret_position: INTEGER
            -- Caret position
        require
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    formatting_rect: WEL_RECT
            -- Limiting rectangle the text. It is independent of
            -- the size of the edit-control window.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_selection: BOOLEAN
            -- Has a current selection?
        require
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    modified: BOOLEAN
            -- Has the text been modified?
        require
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    read_only: BOOLEAN
            -- Is the current edit control read-only?
        require
            exists: exists

    selection_end: INTEGER
            -- Index of the last character selected
        require
            exists: exists
            has_selection: has_selection
        ensure
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length + 2

    selection_start: INTEGER
            -- Index of the first character selected
        require
            exists: exists
            has_selection: has_selection
        ensure
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    get_text_limit: INTEGER
            -- Get the maximum length of text that the user
            -- can enter into the edit control.
        require
            exisits: exists
        ensure
            positive_result: Result >= 0

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_caret_position (position: INTEGER)
            -- Set the caret position with position.
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position <= text_length
        ensure
            has_no_selection: not has_selection
            caret_position_set: caret_position = position

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_modify (modify: BOOLEAN)
            -- Set modified with modify
        require
            exists: exists
        ensure
            modified_set: modified = modify

    set_read_only
            -- Set the read-only state.
        require
            exists: exists

    set_read_write
            -- Set the read-write state.
        require
            exists: exists

    set_selection (start_position, end_position: INTEGER)
            -- Set the selection between start_position
            -- and end_position.
        require
            exists: exists
            selection_in_lower_bound: start_position >= 0 and end_position >= 0
            selection_in_upper_bound: start_position <= text_length and end_position <= text_length
        ensure
            has_selection: (start_position /= end_position) implies has_selection

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_text_limit (limit: INTEGER)
            -- Set to limit the length of the text the user
            -- can enter into the edit control.
        require
            exists: exists
            positive_limit: limit >= 0

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    clear
            -- Clear the text
            -- (from WEL_STATIC)
        require -- from WEL_STATIC
            exists: exists
        ensure -- from WEL_STATIC
            text_empty: text.is_empty

    clip_copy
            -- Copy the current selection to the clipboard.
        require
            exists: exists
            has_selection: has_selection

    clip_cut
            -- Cut the current selection to the clipboard.
        require
            exists: exists
            has_selection: has_selection
        ensure
            has_no_selection: not has_selection

    clip_paste
            -- Paste at the current caret position the
            -- content of the clipboard.
        require
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    delete_selection
            -- Delete the current selection.
        require
            exists: exists
            has_selection: has_selection
        ensure
            has_no_selection: not has_selection

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    replace_selection (new_text: STRING)
            -- Replace the current selection with new_text.
            -- If there is no selection, new_text is inserted
            -- at the current caret_position.
        require
            exists: exists
            new_text_not_void: new_text /= void

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_all
            -- Select all the text.
        require
            exists: exists
            positive_length: text_length > 0
        ensure
            has_selection: has_selection
            selection_start_set: selection_start = 0
            selection_end_set: selection_end <= text_length + 2

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    undo
            -- Undo the last operation.
            -- The previously deleted text is restored or the
            -- previously added text is deleted.
        require
            exists: exists
            can_undo: can_undo

    unselect
            -- Unselect the current selection.
        require
            exists: exists
            has_selection: has_selection
        ensure
            has_no_selection: not has_selection

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_en_change
            -- The user has taken an action
            -- that may have altered the text.
        require
            exists: exists

    on_en_errspace
            -- Cannot allocate enough memory to
            -- meet a specific request.
        require
            exists: exists

    on_en_hscroll
            -- The user click on the horizontal scroll bar.
        require
            exists: exists

    on_en_killfocus
            -- Lose the keyboard focus.
        require
            exists: exists

    on_en_maxtext
            -- The current text insertion has exceeded
            -- the specified number of characters.
        require
            exists: exists

    on_en_setfocus
            -- Receive the keyboard focus.
        require
            exists: exists

    on_en_update
            -- The control is about to display altered text.
        require
            exists: exists

    on_en_vscroll
            -- The user click on the vertical scroll bar.
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

    consistent_selection: exists and then has_selection implies selection_start >= 0 and then selection_start <= text_length and then selection_end >= 0 and then selection_end <= text_length + 2 and then selection_start < selection_end
    valid_caret_position: exists implies caret_position >= 0 and then caret_position <= text_length + 2
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_EDIT


WEL_FLAT_TOOL_BAR Chart

class
    WEL_FLAT_TOOL_BAR

General
    cluster: wel.controls
    description: "Enhancement of the toolbar. This toolbar appears flat and use imagelist to store bitmaps - when available   "
    create: make

Ancestors
    WEL_ILC_CONSTANTS
    WEL_TOOL_BAR
    WEL_WINDOWS_VERSION

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    bitmaps_height: INTEGER
    bitmaps_width: INTEGER
    button_checked (command_id: INTEGER): BOOLEAN
    button_count: INTEGER
    button_enabled (command_id: INTEGER): BOOLEAN
    button_hidden (command_id: INTEGER): BOOLEAN
    button_indeterminate (command_id: INTEGER): BOOLEAN
    button_pressed (command_id: INTEGER): BOOLEAN
    button_rect (index: INTEGER): WEL_RECT
    buttons_height: INTEGER
    buttons_width: INTEGER
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Comctl32_version: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_image_list: WEL_IMAGE_LIST
    default_processing: BOOLEAN
    disabled_image_list: WEL_IMAGE_LIST
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_button (a_x, a_y: INTEGER): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_button_height: INTEGER
    get_button_width: INTEGER
    get_max_height: INTEGER
    get_max_size: WEL_SIZE
    get_max_width: INTEGER
    has_bitmap: BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    hot_image_list: WEL_IMAGE_LIST
    i_th_button (index: INTEGER): WEL_TOOL_BAR_BUTTON
    id: INTEGER
    is_inside: BOOLEAN
    Is_windows_2000: BOOLEAN
    Is_windows_95: BOOLEAN
    Is_windows_98: BOOLEAN
    Is_windows_9x: BOOLEAN
    Is_windows_me: BOOLEAN
    Is_windows_nt: BOOLEAN
    Is_windows_nt4: BOOLEAN
    item: POINTER
    last_bitmap_index: INTEGER
    last_disabled_bitmap_index: INTEGER
    last_hot_bitmap_index: INTEGER
    last_string_index: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    Shell32_version: INTEGER
    Shlwapi_version: INTEGER
    shown: BOOLEAN
    style: INTEGER
    to_integer: INTEGER
    tooltip: WEL_TOOLTIP
    tooltip_exists: BOOLEAN
    use_disabled_image_list: BOOLEAN
    use_hot_image_list: BOOLEAN
    use_image_list: BOOLEAN
    Use_image_list_supported: BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    Version_400: INTEGER
    Version_470: INTEGER
    Version_471: INTEGER
    Version_472: INTEGER
    Version_500: INTEGER
    Version_580: INTEGER
    Version_581: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_bitmap (a_bitmap: WEL_BITMAP)
    add_buttons (buttons: ARRAY [WEL_TOOL_BAR_BUTTON])
    add_disabled_bitmap (a_bitmap: WEL_BITMAP)
    add_disabled_icon (an_icon: WEL_GRAPHICAL_RESOURCE)
    add_disabled_masked_bitmap (a_bitmap, a_mask_bitmap: WEL_BITMAP)
    add_hot_bitmap (a_bitmap: WEL_BITMAP)
    add_hot_icon (an_icon: WEL_GRAPHICAL_RESOURCE)
    add_hot_masked_bitmap (a_bitmap, a_mask_bitmap: WEL_BITMAP)
    add_icon (a_icon: WEL_GRAPHICAL_RESOURCE)
    add_masked_bitmap (a_bitmap, a_mask_bitmap: WEL_BITMAP)
    add_strings (strings: ARRAY [STRING])
    auto_size
    bring_to_top
    check_button (command_id: INTEGER)
    clear_indeterminate_state (command_id: INTEGER)
    default_process_notification (notification_code: INTEGER)
    delete_button (index: INTEGER)
    destroy
    disable
    disable_button (command_id: INTEGER)
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_hot_item
    disable_use_image_list
    disable_vertical_scroll_bar
    dispose
    enable
    enable_button (command_id: INTEGER)
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_hot_item (command_id: INTEGER)
    enable_use_image_list
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_button (command_id: INTEGER)
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_button (index: INTEGER; button: WEL_TOOL_BAR_BUTTON)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_tbn_beginadjust
    on_tbn_begindrag (info: WEL_NM_TOOL_BAR)
    on_tbn_custhelp
    on_tbn_dropdown (info: WEL_NM_TOOL_BAR)
    on_tbn_endadjust
    on_tbn_enddrag (info: WEL_NM_TOOL_BAR)
    on_tbn_getbuttoninfo (info: WEL_NM_TOOL_BAR)
    on_tbn_querydelete (info: WEL_NM_TOOL_BAR)
    on_tbn_queryinsert (info: WEL_NM_TOOL_BAR)
    on_tbn_reset
    on_tbn_toolbarchange
    press_button (command_id: INTEGER)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_button (command_id: INTEGER)
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reposition
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_bitmap_size (a_width, a_height: INTEGER)
    set_button_size (a_width, a_height: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_identifier (index, an_id: INTEGER)
    set_indeterminate_state (command_id: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_tooltip (a_tooltip: WEL_TOOLTIP)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_button (command_id: INTEGER)
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    uncheck_button (command_id: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    image list used when available
    disabled image list only when bitmap
    hot image list only when bitmap


WEL_FLAT_TOOL_BAR Flat contracts

indexing
    description: "Enhancement of the toolbar. This toolbar appears flat and use imagelist to store bitmaps - when available   "
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL)     needs to be loaded to use this control.               "
    date: "$Date: 2001/11/12 17:58:14 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FLAT_TOOL_BAR

create

    make (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Create a toolbar with a_parent as parent and
            -- an_id as id.
        require -- from WEL_TOOL_BAR
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_TOOL_BAR
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    bitmaps_height: INTEGER
            -- 15 by default

    bitmaps_width: INTEGER
            -- 16 by default

    buttons_height: INTEGER
            -- Height of the buttons in the toolbar.

    buttons_width: INTEGER
            -- Width of the buttons in the toolbar.

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_image_list: WEL_IMAGE_LIST
            -- ImageList associated with the toolbar
            -- Note: only used in the "Win95+IE3" version

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    disabled_image_list: WEL_IMAGE_LIST
            -- ImageList associated with the toolbar for disabled
            -- buttons
            -- Note: only used in the "Win95+IE3" version

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    hot_image_list: WEL_IMAGE_LIST
            -- ImageList associated with the toolbar for hot buttons
            -- Note: only used in the "Win95+IE3" version

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    last_disabled_bitmap_index: INTEGER

    last_hot_bitmap_index: INTEGER

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    use_disabled_image_list: BOOLEAN
            -- Are we using disabled ImageList for the toolbar?

    use_hot_image_list: BOOLEAN
            -- Are we using hot ImageList for the toolbar?

    use_image_list: BOOLEAN
            -- Are we using ImageList for the toolbar?

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    button_checked (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id checked?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_count: INTEGER
            -- Number of buttons in toolbar
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            positive_result: Result >= 0

    button_enabled (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id enabled?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_hidden (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id hidden?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_indeterminate (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id
            -- indeterminate?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_pressed (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id pressed?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_rect (index: INTEGER): WEL_RECT
            -- Rectangle of button at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure -- from WEL_TOOL_BAR
            result_not_void: Result /= void

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    find_button (a_x, a_y: INTEGER): INTEGER
            -- Determines where a point lies in a toolbar control.
            --
            -- Returns an integer value. If the return value is zero or a positive value,
            -- it is the zero-based index of the nonseparator item in which the point lies.
            -- If the return value is negative, the point does not lie within a button.
            -- The absolute value of the return value is the index of a separator item
            -- or the nearest nonseparator item.

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_max_height: INTEGER
            -- Retrieves the common height of all of the visible buttons and separators in the toolbar.
        require
            function_supported: comctl32_version >= version_471

    get_max_size: WEL_SIZE
            -- Retrieves the total size of all of the visible buttons and separators in the toolbar
        require
            function_supported: comctl32_version >= version_471

    get_max_width: INTEGER
            -- Retrieves the total width of all of the visible buttons and separators in the toolbar.
        require
            function_supported: comctl32_version >= version_471

    has_bitmap: BOOLEAN
            -- Does the toolbar contains one bitmap or more?
            -- (from WEL_TOOL_BAR)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    i_th_button (index: INTEGER): WEL_TOOL_BAR_BUTTON
            -- Button at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure -- from WEL_TOOL_BAR
            result_not_void: Result /= void

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    last_bitmap_index: INTEGER
            -- Last bitmap index added by add_bitmaps.
            -- (from WEL_TOOL_BAR)

    last_string_index: INTEGER
            -- Last string index added by add_strings.
            -- (from WEL_TOOL_BAR)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    tooltip: WEL_TOOLTIP
            -- The tooltip associated with the toolbar
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            tooltip_exists: tooltip_exists

    tooltip_exists: BOOLEAN
            -- Is there a tooltip associated to the toolbar?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    use_image_list_supported: BOOLEAN
            -- Are ImageList in toolbars supported in the current
            -- version of Windows?

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    check_button (command_id: INTEGER)
            -- Checks a button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_is_checked: button_checked (command_id)

    clear_indeterminate_state (command_id: INTEGER)
            -- Clear the indeterminate state of the button
            -- identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_not_indeterminate: not button_indeterminate (command_id)

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_button (command_id: INTEGER)
            -- Disable the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_disabled: not button_enabled (command_id)

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    disable_hot_item
            -- Unset the hot item.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    disable_use_image_list
            -- Set the toolbar not to use image lists.
            -- Note: This is the Default.
        require
            no_bitmap_present: not has_bitmap
        ensure
            image_list_not_used: not use_image_list

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_button (command_id: INTEGER)
            -- Enable the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_enabled: button_enabled (command_id)

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    enable_hot_item (command_id: INTEGER)
            -- Set hot item for button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    enable_use_image_list
            -- Set the toolbar to use image lists.
            -- Note: Require Win95+IE3 or above
        require
            no_bitmap_present: not has_bitmap
            feature_supported: use_image_list_supported
        ensure
            image_list_in_use: use_image_list

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_button (command_id: INTEGER)
            -- Hide the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_hidden: button_hidden (command_id)

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    press_button (command_id: INTEGER)
            -- Press the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_pressed: button_pressed (command_id)

    release_button (command_id: INTEGER)
            -- Release the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_not_pressed: not button_pressed (command_id)

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_button_size (a_width, a_height: INTEGER)
            -- Set the size of the buttons to be added to the
            -- toolbar.
            -- The size can be set only before adding any buttons
            -- to the toolbar. If an application does not
            -- explicitly set the button size, the size defaults
            -- to 24 by 22 pixels.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            no_existing_buttons: button_count = 0

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_identifier (index, an_id: INTEGER)
            -- Set the identifier for the button at zero-based
            -- index to an_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count

    set_indeterminate_state (command_id: INTEGER)
            -- Set the indeterminate state of the button
            -- identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_indeterminate: button_indeterminate (command_id)

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_tooltip (a_tooltip: WEL_TOOLTIP)
            -- Associate a tooltip control with the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            a_tooltip_not_void: a_tooltip /= void
            a_tooltip_exists: a_tooltip.exists
        ensure -- from WEL_TOOL_BAR
            tooltip_exists: tooltip_exists
            tooltip_set: tooltip = a_tooltip

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_button (command_id: INTEGER)
            -- Show the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_shown: not button_hidden (command_id)

    uncheck_button (command_id: INTEGER)
            -- Unchecks a button identified by command_id
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_unchecked: not button_checked (command_id)

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_bitmap (a_bitmap: WEL_BITMAP)
            -- Add a bitmap to the list of currently used images.
        require
            exists: exists
            bitmap_not_void: a_bitmap /= void

    add_buttons (buttons: ARRAY [WEL_TOOL_BAR_BUTTON])
            -- Add buttons.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            buttons_not_void: buttons /= void
            buttons_not_empty: not buttons.is_empty
            no_void_button: not buttons.has (void)
        ensure -- from WEL_TOOL_BAR
            count_increased: button_count = old button_count + buttons.count

    add_disabled_bitmap (a_bitmap: WEL_BITMAP)
            -- Add a bitmap to the disabled image list.
            --
            -- The feature is only supported under Windows95+IE3
            -- If such a configuration is not available, the function will
            -- do nothing.
        require
            bitmap_not_void: a_bitmap /= void

    add_disabled_icon (an_icon: WEL_GRAPHICAL_RESOURCE)
            -- Add an icon to the disabled image list.
            --
            -- The feature is only supported under Windows95+IE3
            -- If such a configuration is not available, the function will
            -- do nothing.
        require
            icon_not_void: an_icon /= void

    add_disabled_masked_bitmap (a_bitmap: WEL_BITMAP; a_mask_bitmap: WEL_BITMAP)
            -- Add a masked bitmap to the disabled image list.
        require
            exists: exists
            bitmap_not_void: a_bitmap /= void
            mask_not_void: a_mask_bitmap /= void
            compatible_width_for_bitmaps: a_bitmap.width = a_mask_bitmap.width
            compatible_height_for_bitmaps: a_bitmap.height = a_mask_bitmap.height

    add_hot_bitmap (a_bitmap: WEL_BITMAP)
            -- Add a bitmap to the hot image list.
            --
            -- The feature is only supported under Windows95+IE3
            -- If such a configuration is not available, the function will
            -- do nothing.
        require
            bitmap_not_void: a_bitmap /= void

    add_hot_icon (an_icon: WEL_GRAPHICAL_RESOURCE)
            -- Add an icon to the hot image list.
            --
            -- The feature is only supported under Windows95+IE3
            -- If such a configuration is not available, the function will
            -- do nothing.
        require
            icon_not_void: an_icon /= void

    add_hot_masked_bitmap (a_bitmap: WEL_BITMAP; a_mask_bitmap: WEL_BITMAP)
            -- Add a masked bitmap to the hot image list.
        require
            exists: exists
            bitmap_not_void: a_bitmap /= void
            mask_not_void: a_mask_bitmap /= void
            compatible_width_for_bitmaps: a_bitmap.width = a_mask_bitmap.width
            compatible_height_for_bitmaps: a_bitmap.height = a_mask_bitmap.height

    add_icon (a_icon: WEL_GRAPHICAL_RESOURCE)
            -- Add an icon to the list of currently used images.
            --
            -- Note: The function will work with Comctrl32.dll version less
            -- than 4.70 but will not display the icon correctly: the background
            -- of the icons will always be set in black.
            -- With Comctrl32.dll >= 4.70 everything will run smoothly.
            -- Note2: Comctrl32.dll version 4.70 <=> Win95 + IE3
        require
            exists: exists
            icon_not_void: a_icon /= void

    add_masked_bitmap (a_bitmap: WEL_BITMAP; a_mask_bitmap: WEL_BITMAP)
            -- Add a masked bitmap to the list of currently used images.
        require
            exists: exists
            bitmap_not_void: a_bitmap /= void
            mask_not_void: a_mask_bitmap /= void
            compatible_width_for_bitmaps: a_bitmap.width = a_mask_bitmap.width
            compatible_height_for_bitmaps: a_bitmap.height = a_mask_bitmap.height

    add_strings (strings: ARRAY [STRING])
            -- Add strings to the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            string_not_void: strings /= void
            strings_not_empty: not strings.is_empty

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_button (index: INTEGER; button: WEL_TOOL_BAR_BUTTON)
            -- Insert button to the left of the button
            -- at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            button_not_void: button /= void
            index_large_enough: index >= 0
            index_small_enough: index <= button_count
        ensure -- from WEL_TOOL_BAR
            buttons_increased: button_count = old button_count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    delete_button (index: INTEGER)
            -- Delete the button at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure -- from WEL_TOOL_BAR
            buttons_decreased: button_count = old button_count - 1

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Resizing

    get_button_height: INTEGER
            -- Get the height of the buttons.
        require
            function_supported: comctl32_version >= version_470

    get_button_width: INTEGER
            -- Get the width of the buttons.
        require
            function_supported: comctl32_version >= version_470

    set_bitmap_size (a_width, a_height: INTEGER)
            -- Sets the size of the bitmapped images to be added to
            -- the toolbar.
            -- The size can be set only before adding any
            -- bitmaps to the toolbar otherwise all added bitmap
            -- are erased.
            --
            -- If an application does not explicitly set the bitmap
            -- size, the default size is 16 by 15 pixels.
        require -- from WEL_TOOL_BAR
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            no_bitmap_present: not has_bitmap

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    auto_size
            -- Resize tooolbar after changes.
            -- An application sends the TB_AUTOSIZE message after
            -- causing the size of a toolbar to change either by
            -- setting the button or bitmap size or by adding strings
            -- for the first time.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    reposition
            -- Reposition the bar according to the parent.
            -- This function needs to be called in the
            -- on_size function of the parent.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- "Shell and Common controls" Versions

    comctl32_version: INTEGER
            -- Version of Comctl32.dll
            -- (from WEL_WINDOWS_VERSION)

    shell32_version: INTEGER
            -- Version of Shell32.dll
            -- (from WEL_WINDOWS_VERSION)

    shlwapi_version: INTEGER
            -- Version of Shlwapi.dll
            -- (from WEL_WINDOWS_VERSION)

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_tbn_beginadjust
            -- The user has begun customizing the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_begindrag (info: WEL_NM_TOOL_BAR)
            -- The user has begun dragging a button in the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_custhelp
            -- The user has chosen the Help button in the
            -- customize toolbar dialog box.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_dropdown (info: WEL_NM_TOOL_BAR)
            -- The user clicks a button that uses the
            -- Tbstyle_dropdown style.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_endadjust
            -- The user has stopped customizing the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_enddrag (info: WEL_NM_TOOL_BAR)
            -- The user has stopped dragging a button in the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_getbuttoninfo (info: WEL_NM_TOOL_BAR)
            -- Retrieves toolbar customization.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_querydelete (info: WEL_NM_TOOL_BAR)
            -- A button may be deleted from the toolbar while
            -- the user is customizing the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_queryinsert (info: WEL_NM_TOOL_BAR)
            -- A button may be inserted to the left of the
            -- specified button while the user is customizing
            -- the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_reset
            -- The user has reset the content of the customise
            -- toolbar dialog box.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_toolbarchange
            -- The user has customized the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Version Constants

    version_400: INTEGER
            -- version_400 <=> Microsoft® Windows® 95/Windows NT® 4.0
            -- (from WEL_WINDOWS_VERSION)

    version_470: INTEGER
            -- version_470 <=> Microsoft® Internet Explorer 3.x
            -- (from WEL_WINDOWS_VERSION)

    version_471: INTEGER
            -- version_471 <=> Microsoft® Internet Explorer 4.0
            -- (from WEL_WINDOWS_VERSION)

    version_472: INTEGER
            -- version_472 <=> Microsoft® Internet Explorer 4.01 & Windows® 98
            -- (from WEL_WINDOWS_VERSION)

    version_500: INTEGER
            -- version_500 (Shlwapi.dll) <=> Microsoft® Internet Explorer 5
            -- version_500 (Shell32.dll) <=> Microsoft® Windows® 2000
            -- (from WEL_WINDOWS_VERSION)

    version_580: INTEGER
            -- version_580 (Comctl32.dll) <=> Microsoft® Internet Explorer 5
            -- (from WEL_WINDOWS_VERSION)

    version_581: INTEGER
            -- version_581 (Comctl32.dll)<=> Microsoft® Windows 2000
            -- (from WEL_WINDOWS_VERSION)

feature -- Windows Versions

    is_windows_2000: BOOLEAN
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows2000_is_nt: Result implies is_windows_nt

    is_windows_95: BOOLEAN
            -- Is the current program running under Windows 95
            -- (OSR1, OSR2 or OSR2.5)?
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows95_is_9x: Result implies is_windows_9x

    is_windows_98: BOOLEAN
            -- Is the current program running under Windows 98
            -- (1st or 2nd edition)?
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows98_is_9x: Result implies is_windows_9x

    is_windows_9x: BOOLEAN
            -- Is the current program running under Windows 9x
            -- (Windows 95, Windows 98, Windows Me, ...)?
            -- (from WEL_WINDOWS_VERSION)

    is_windows_me: BOOLEAN
            -- Is the current program running under Windows Millenium Edition?
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows_me_is_9x: Result implies is_windows_9x

    is_windows_nt: BOOLEAN
            -- Is the current program running under Windows NT
            -- (Windows NT 3.51, Windows NT4, Windows 2000, ...)?
            -- (from WEL_WINDOWS_VERSION)

    is_windows_nt4: BOOLEAN
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows_nt4_is_nt: Result implies is_windows_nt

invariant

    image_list_used_when_available: use_image_list implies use_image_list_supported
    disabled_image_list_only_when_bitmap: use_disabled_image_list implies has_bitmap
    hot_image_list_only_when_bitmap: use_hot_image_list implies has_bitmap
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FLAT_TOOL_BAR


WEL_GROUP_BOX Chart

class
    WEL_GROUP_BOX

General
    cluster: wel.controls
    description: "Rectangular outline with its window text at the top. Group boxes are often used to enclose other button controls."
    create: make_by_id, make

Ancestors
    WEL_BS_CONSTANTS
    WEL_BUTTON

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_GROUP_BOX Flat contracts

indexing
    description: "Rectangular outline with its window text at the top. Group boxes are often used to enclose other button controls."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:15 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_GROUP_BOX

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GROUP_BOX


WEL_HEADER_CONTROL Chart

class
    WEL_HEADER_CONTROL

General
    cluster: wel.controls
    description: "A header control is a window that is usually positionedabove columns of text or numbers. It contains a title foreach column, and it can be divided into parts. The usercan drag the dividers that separate the parts to set thewidth of each column."
    create: make_by_id, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_CONTROL
    WEL_HDF_CONSTANTS
    WEL_HDI_CONSTANTS
    WEL_HDM_CONSTANTS
    WEL_HDN_CONSTANTS
    WEL_HDS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    clear_flag (flags, mask: INTEGER): INTEGER
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    flag_set (flags, mask: INTEGER): BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    item_count: INTEGER
    item_info_from_point (a_point: WEL_POINT): WEL_HD_HIT_TEST_INFO
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    set_flag (flags, mask: INTEGER): INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    valid_index (index: INTEGER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_header_item (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_header_item (hd_item: WEL_HD_ITEM; insert_after_item_no: INTEGER)
    insert_text_header_item (a_label: STRING; a_width, a_format, insert_after_item_no: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_hdn_begin_track (info: WEL_HD_NOTIFY)
    on_hdn_divider_dbl_click (info: WEL_HD_NOTIFY)
    on_hdn_end_track (info: WEL_HD_NOTIFY)
    on_hdn_item_changed (info: WEL_HD_NOTIFY)
    on_hdn_item_changing (info: WEL_HD_NOTIFY)
    on_hdn_item_click (info: WEL_HD_NOTIFY)
    on_hdn_item_dbl_click (info: WEL_HD_NOTIFY)
    on_hdn_track (info: WEL_HD_NOTIFY)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    retrieve_and_set_windows_pos (parent_client_rect: WEL_RECT)
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_header_item (index: INTEGER; hd_item: WEL_HD_ITEM)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_HEADER_CONTROL Flat contracts

indexing
    description: "A header control is a window that is usually positionedabove columns of text or numbers. It contains a title foreach column, and it can be divided into parts. The usercan drag the dividers that separate the parts to set thewidth of each column."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:15 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HEADER_CONTROL

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a header control.
            -- a_x, a_y, a_width, a_height will not neccesarily
            -- determine the the size of the control. Rather the
            -- operating system will be asked which size the control
            -- should have, given a_x, etc. is the client rectangle of
            -- the controls parent window
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    item_count: INTEGER
            -- Retrieves the number of items that are in the header control
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    item_info_from_point (a_point: WEL_POINT): WEL_HD_HIT_TEST_INFO
            -- Tests a point to determine which header item, if any, is at the specified point.
        require
            exists: exists
            a_point_exists: a_point /= void and then a_point.exists

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_index (index: INTEGER): BOOLEAN

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    delete_header_item (index: INTEGER)
            -- delete item from header control at index index
        require
            exists: exists
            valid_index: valid_index (index)
        ensure
            item_count_decreased: item_count = old item_count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_header_item (hd_item: WEL_HD_ITEM; insert_after_item_no: INTEGER)
            -- Insert an item to the header control after the
            -- insert_item_item_no item. If there is no item in the list
            -- yet, or you want to insert the new item as the first
            -- one, use use 0 for insert_item
        require
            exists: exists
            hd_item_not_void: hd_item /= void
            insert_after_item_no_positive: insert_after_item_no >= 0
        ensure
            item_count_increased: item_count = old item_count + 1

    insert_text_header_item (a_label: STRING; a_width, a_format: INTEGER; insert_after_item_no: INTEGER)
            -- Insert a text item to the header control after the
            -- insert_item_item_no item. If there is no item in the list
            -- yet, or you want to insert the new item as the first
            -- one, use use 0 for insert_item
            -- The item will be a_width broad and use 'a_format` as format.
            -- For possible formats please look into WEL_HDF_CONSTANTS.
            -- (Hdf_string will be set automatically)
        require
            exists: exists
            label_not_void: a_label /= void
            insert_after_item_no_positive: insert_after_item_no >= 0
        ensure
            item_count_increased: item_count = old item_count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    retrieve_and_set_windows_pos (parent_client_rect: WEL_RECT)
            -- Asks the OS for the window position and size,
            -- given the parents client area is parent_client_rect
        require
            exists: exists
            rect_exists: parent_client_rect /= void and then parent_client_rect.exists

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_header_item (index: INTEGER; hd_item: WEL_HD_ITEM)
            -- This windows message sets the attributes of the specified item in a header control.
        require
            exists: exists
            hd_item_exists: hd_item /= void and then hd_item.exists
            valid_index: valid_index (index)

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_hdn_begin_track (info: WEL_HD_NOTIFY)
            -- The user has begun dragging a divider in the control
            -- (that is, the user has pressed the left mouse button while
            -- the mouse cursor is on a divider in the header control).
        require
            exists: exists
            info_exists: info /= void and then info.exists

    on_hdn_divider_dbl_click (info: WEL_HD_NOTIFY)
            -- The user double-clicked the divider area of the control.
        require
            exists: exists
            info_exists: info /= void and then info.exists

    on_hdn_end_track (info: WEL_HD_NOTIFY)
            -- The user has finished dragging a divider.
        require
            exists: exists
            info_exists: info /= void and then info.exists

    on_hdn_item_changed (info: WEL_HD_NOTIFY)
            -- The attributes of a header item have changed.
        require
            exists: exists
            info_exists: info /= void and then info.exists

    on_hdn_item_changing (info: WEL_HD_NOTIFY)
            -- The attributes of a header item are about to change.
        require
            exists: exists
            info_exists: info /= void and then info.exists

    on_hdn_item_click (info: WEL_HD_NOTIFY)
            -- The user clicked the control.
        require
            exists: exists
            info_exists: info /= void and then info.exists

    on_hdn_item_dbl_click (info: WEL_HD_NOTIFY)
            -- The user double-clicked the control.
        require
            exists: exists
            info_exists: info /= void and then info.exists

    on_hdn_track (info: WEL_HD_NOTIFY)
            -- The user is dragging a divider in the header control.
        require
            exists: exists
            info_exists: info /= void and then info.exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HEADER_CONTROL


WEL_IMAGELIST_TOOL_BAR Chart

class
    WEL_IMAGELIST_TOOL_BAR

General
    cluster: wel.controls
    description: "Enhancement of the toolbar. This toolbar appears flat and use imagelist to store bitmaps - Win95+IE3 required"
    create: make

Ancestors
    WEL_TOOL_BAR
    WEL_WINDOWS_VERSION

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    bitmaps_height: INTEGER
    bitmaps_width: INTEGER
    button_checked (command_id: INTEGER): BOOLEAN
    button_count: INTEGER
    button_enabled (command_id: INTEGER): BOOLEAN
    button_hidden (command_id: INTEGER): BOOLEAN
    button_indeterminate (command_id: INTEGER): BOOLEAN
    button_pressed (command_id: INTEGER): BOOLEAN
    button_rect (index: INTEGER): WEL_RECT
    buttons_height: INTEGER
    buttons_width: INTEGER
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_button (a_x, a_y: INTEGER): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_button_height: INTEGER
    get_button_width: INTEGER
    get_image_list: WEL_IMAGE_LIST
    get_max_height: INTEGER
    get_max_size: WEL_SIZE
    get_max_width: INTEGER
    has_bitmap: BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_button (index: INTEGER): WEL_TOOL_BAR_BUTTON
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    last_bitmap_index: INTEGER
    last_string_index: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    to_integer: INTEGER
    tooltip: WEL_TOOLTIP
    tooltip_exists: BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_bitmaps (tb_bitmap: WEL_TOOL_BAR_BITMAP; bitmap_count: INTEGER)
    add_buttons (buttons: ARRAY [WEL_TOOL_BAR_BUTTON])
    add_strings (strings: ARRAY [STRING])
    auto_size
    bring_to_top
    check_button (command_id: INTEGER)
    clear_indeterminate_state (command_id: INTEGER)
    default_process_notification (notification_code: INTEGER)
    delete_button (index: INTEGER)
    destroy
    disable
    disable_button (command_id: INTEGER)
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_hot_item
    disable_vertical_scroll_bar
    dispose
    enable
    enable_button (command_id: INTEGER)
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_hot_item (command_id: INTEGER)
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_button (command_id: INTEGER)
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_button (index: INTEGER; button: WEL_TOOL_BAR_BUTTON)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_tbn_beginadjust
    on_tbn_begindrag (info: WEL_NM_TOOL_BAR)
    on_tbn_custhelp
    on_tbn_dropdown (info: WEL_NM_TOOL_BAR)
    on_tbn_endadjust
    on_tbn_enddrag (info: WEL_NM_TOOL_BAR)
    on_tbn_getbuttoninfo (info: WEL_NM_TOOL_BAR)
    on_tbn_querydelete (info: WEL_NM_TOOL_BAR)
    on_tbn_queryinsert (info: WEL_NM_TOOL_BAR)
    on_tbn_reset
    on_tbn_toolbarchange
    press_button (command_id: INTEGER)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_button (command_id: INTEGER)
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reposition
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_bitmap_size (a_width, a_height: INTEGER)
    set_button_size (a_width, a_height: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_hot_image_list (an_image_list: WEL_IMAGE_LIST)
    set_identifier (index, an_id: INTEGER)
    set_image_list (an_image_list: WEL_IMAGE_LIST)
    set_indeterminate_state (command_id: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_tooltip (a_tooltip: WEL_TOOLTIP)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_button (command_id: INTEGER)
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    uncheck_button (command_id: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_IMAGELIST_TOOL_BAR Flat contracts

indexing
    description: "Enhancement of the toolbar. This toolbar appears flat and use imagelist to store bitmaps - Win95+IE3 required"
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL)     needs to be loaded to use this control and IE3 or     above installed"
    date: "$Date: 2001/11/12 17:58:15 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_IMAGELIST_TOOL_BAR

create

    make (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Create a toolbar with a_parent as parent and
            -- an_id as id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_TOOL_BAR
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    bitmaps_height: INTEGER
            -- height of all bitmaps located in this imageList

    bitmaps_width: INTEGER
            -- width of all bitmaps located in this imageList

    buttons_height: INTEGER
            -- Height of the buttons in the toolbar.

    buttons_width: INTEGER
            -- Width of the buttons in the toolbar.

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    button_checked (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id checked?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_count: INTEGER
            -- Number of buttons in toolbar
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            positive_result: Result >= 0

    button_enabled (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id enabled?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_hidden (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id hidden?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_indeterminate (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id
            -- indeterminate?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_pressed (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id pressed?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    button_rect (index: INTEGER): WEL_RECT
            -- Rectangle of button at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure -- from WEL_TOOL_BAR
            result_not_void: Result /= void

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    find_button (a_x, a_y: INTEGER): INTEGER
            -- Determines where a point lies in a toolbar control.
            --
            -- Returns an integer value. If the return value is zero or a positive value,
            -- it is the zero-based index of the nonseparator item in which the point lies.
            -- If the return value is negative, the point does not lie within a button.
            -- The absolute value of the return value is the index of a separator item
            -- or the nearest nonseparator item.

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_max_height: INTEGER
            -- Retrieves the common height of all of the visible buttons and separators in the toolbar.

    get_max_size: WEL_SIZE
            -- Retrieves the total size of all of the visible buttons and separators in the toolbar

    get_max_width: INTEGER
            -- Retrieves the total width of all of the visible buttons and separators in the toolbar.

    has_bitmap: BOOLEAN
            -- Does the toolbar contains one bitmap or more?
            -- (from WEL_TOOL_BAR)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    i_th_button (index: INTEGER): WEL_TOOL_BAR_BUTTON
            -- Button at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure -- from WEL_TOOL_BAR
            result_not_void: Result /= void

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    last_bitmap_index: INTEGER
            -- Last bitmap index added by add_bitmaps.
            -- (from WEL_TOOL_BAR)

    last_string_index: INTEGER
            -- Last string index added by add_strings.
            -- (from WEL_TOOL_BAR)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    tooltip: WEL_TOOLTIP
            -- The tooltip associated with the toolbar
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            tooltip_exists: tooltip_exists

    tooltip_exists: BOOLEAN
            -- Is there a tooltip associated to the toolbar?
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    check_button (command_id: INTEGER)
            -- Checks a button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_is_checked: button_checked (command_id)

    clear_indeterminate_state (command_id: INTEGER)
            -- Clear the indeterminate state of the button
            -- identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_not_indeterminate: not button_indeterminate (command_id)

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_button (command_id: INTEGER)
            -- Disable the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_disabled: not button_enabled (command_id)

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    disable_hot_item
            -- Unset the hot item.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_button (command_id: INTEGER)
            -- Enable the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_enabled: button_enabled (command_id)

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    enable_hot_item (command_id: INTEGER)
            -- Set hot item for button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_button (command_id: INTEGER)
            -- Hide the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_hidden: button_hidden (command_id)

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    press_button (command_id: INTEGER)
            -- Press the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_pressed: button_pressed (command_id)

    release_button (command_id: INTEGER)
            -- Release the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_not_pressed: not button_pressed (command_id)

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_bitmap_size (a_width, a_height: INTEGER)
            -- Sets the size of the bitmapped images to be added to
            -- the toolbar.
            -- The size can be set only before adding any
            -- bitmaps to the toolbar. If an application does
            -- not explicitly set the bitmap size, the size
            -- defaults to 16 by 15 pixels.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            no_bitmap_present: not has_bitmap

    set_button_size (a_width, a_height: INTEGER)
            -- Set the size of the buttons to be added to the
            -- toolbar.
            -- The size can be set only before adding any buttons
            -- to the toolbar. If an application does not
            -- explicitly set the button size, the size defaults
            -- to 24 by 22 pixels.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            no_existing_buttons: button_count = 0

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_identifier (index, an_id: INTEGER)
            -- Set the identifier for the button at zero-based
            -- index to an_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count

    set_indeterminate_state (command_id: INTEGER)
            -- Set the indeterminate state of the button
            -- identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_indeterminate: button_indeterminate (command_id)

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_tooltip (a_tooltip: WEL_TOOLTIP)
            -- Associate a tooltip control with the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            a_tooltip_not_void: a_tooltip /= void
            a_tooltip_exists: a_tooltip.exists
        ensure -- from WEL_TOOL_BAR
            tooltip_exists: tooltip_exists
            tooltip_set: tooltip = a_tooltip

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_button (command_id: INTEGER)
            -- Show the button identified by command_id.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_shown: not button_hidden (command_id)

    uncheck_button (command_id: INTEGER)
            -- Unchecks a button identified by command_id
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
        ensure -- from WEL_TOOL_BAR
            button_unchecked: not button_checked (command_id)

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_bitmaps (tb_bitmap: WEL_TOOL_BAR_BITMAP; bitmap_count: INTEGER)
            -- Add bitmaps.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            bitmap_not_void: tb_bitmap /= void
            positive_bitmap_count: bitmap_count > 0

    add_buttons (buttons: ARRAY [WEL_TOOL_BAR_BUTTON])
            -- Add buttons.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            buttons_not_void: buttons /= void
            buttons_not_empty: not buttons.is_empty
            no_void_button: not buttons.has (void)
        ensure -- from WEL_TOOL_BAR
            count_increased: button_count = old button_count + buttons.count

    add_strings (strings: ARRAY [STRING])
            -- Add strings to the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            string_not_void: strings /= void
            strings_not_empty: not strings.is_empty

    get_image_list: WEL_IMAGE_LIST

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_button (index: INTEGER; button: WEL_TOOL_BAR_BUTTON)
            -- Insert button to the left of the button
            -- at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            button_not_void: button /= void
            index_large_enough: index >= 0
            index_small_enough: index <= button_count
        ensure -- from WEL_TOOL_BAR
            buttons_increased: button_count = old button_count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_hot_image_list (an_image_list: WEL_IMAGE_LIST)
            -- Set the hot imageList to an_image_list.
            --
            -- To remove the imagelist, set an_image_list to Void.

    set_image_list (an_image_list: WEL_IMAGE_LIST)
            -- Set the default imageList to an_image_list.
            --
            -- To remove the imagelist, set an_image_list to Void.

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    delete_button (index: INTEGER)
            -- Delete the button at the zero-based index.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure -- from WEL_TOOL_BAR
            buttons_decreased: button_count = old button_count - 1

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Resizing

    get_button_height: INTEGER
            -- Get the height of the buttons.

    get_button_width: INTEGER
            -- Get the width of the buttons.

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    auto_size
            -- Resize tooolbar after changes.
            -- An application sends the TB_AUTOSIZE message after
            -- causing the size of a toolbar to change either by
            -- setting the button or bitmap size or by adding strings
            -- for the first time.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    reposition
            -- Reposition the bar according to the parent.
            -- This function needs to be called in the
            -- on_size function of the parent.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_tbn_beginadjust
            -- The user has begun customizing the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_begindrag (info: WEL_NM_TOOL_BAR)
            -- The user has begun dragging a button in the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_custhelp
            -- The user has chosen the Help button in the
            -- customize toolbar dialog box.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_dropdown (info: WEL_NM_TOOL_BAR)
            -- The user clicks a button that uses the
            -- Tbstyle_dropdown style.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_endadjust
            -- The user has stopped customizing the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_enddrag (info: WEL_NM_TOOL_BAR)
            -- The user has stopped dragging a button in the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_getbuttoninfo (info: WEL_NM_TOOL_BAR)
            -- Retrieves toolbar customization.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_querydelete (info: WEL_NM_TOOL_BAR)
            -- A button may be deleted from the toolbar while
            -- the user is customizing the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_queryinsert (info: WEL_NM_TOOL_BAR)
            -- A button may be inserted to the left of the
            -- specified button while the user is customizing
            -- the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_reset
            -- The user has reset the content of the customise
            -- toolbar dialog box.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

    on_tbn_toolbarchange
            -- The user has customized the toolbar.
            -- (from WEL_TOOL_BAR)
        require -- from WEL_TOOL_BAR
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_IMAGELIST_TOOL_BAR


WEL_LIST_BOX Chart

deferred class
    WEL_LIST_BOX

General
    cluster: wel.controls
    description: "Contains a list of strings from which the user can select. Common ancestor of WEL_SINGLE_SELECTION_LIST_BOX and WEL_MULTIPLE_SELECTION_LIST_BOX."

Ancestors
    WEL_COLOR_CONTROL
    WEL_CONTROL
    WEL_LB_CONSTANTS
    WEL_LBN_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_extent: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    is_selected (index: INTEGER): BOOLEAN
    item: POINTER
    item_height: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    shared: BOOLEAN
    shown: BOOLEAN
    strings: ARRAY [STRING]
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_lbn_dblclk
    on_lbn_errspace
    on_lbn_killfocus
    on_lbn_selcancel
    on_lbn_selchange
    on_lbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_extent (a_width: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_top_index (index: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    consistent count


WEL_LIST_BOX Flat contracts

indexing
    description: "Contains a list of strings from which the user can select. Common ancestor of WEL_SINGLE_SELECTION_LIST_BOX and WEL_MULTIPLE_SELECTION_LIST_BOX."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:16 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_LIST_BOX

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
        require
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure
            result_exists: Result /= void
            same_result_as_strings: Result.is_equal (strings.item (i))

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
        require
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure
            positive_result: Result >= 0
            same_result_as_strings: Result = strings.item (i).count

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    strings: ARRAY [STRING]
            -- Strings contained in the list box
        require
            exists: exists
        ensure
            result_not_void: Result /= void
            count_ok: Result.count = count

feature -- Measurement

    count: INTEGER
            -- Number of lines
        require
            exists: exists
        ensure
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_extent: INTEGER
            -- Width, in pixels, by which the list box can be
            -- scrolled horizontally
        require
            exists: exists
            has_horizontal_scroll_bar: has_horizontal_scroll_bar
        ensure
            positive_result: Result >= 0

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    is_selected (index: INTEGER): BOOLEAN
            -- Is item at position index selected?
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    item_height: INTEGER
            -- Height of an item
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
        require
            exists: exists

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Index of the first visible item
        require
            exists: exists
        ensure
            result_large_enough: Result >= 0
            result_small_enough: Result <= count

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
        require
            exists: exists
            index_small_enough: index < count
            index_large_enough: index >= 0
        ensure
            is_selected: is_selected (index)

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_extent (a_width: INTEGER)
            -- Set the width, in pixels, by which a list box can
            -- be scrolled horizontally.
        require
            exists: exists
            positive_width: width >= 0
        ensure
            horizontal_extent_set: horizontal_extent = a_width

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_top_index (index: INTEGER)
            -- Ensure that the zero-based index
            -- in the list box is visible.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            index_visible: top_index <= index

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the list box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
        require
            exists: exists
            files_not_void: files /= void

    add_string (a_string: STRING)
            -- Add a_string in the list box.
            -- If the list box does not have the
            -- Lbs_sort style, a_string is added
            -- to the end of the list otherwise it is
            -- inserted into the list and the list is
            -- sorted.
        require
            exists: exists
            a_string_not_void: a_string /= void
        ensure
            count_increased: count = old count + 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            count_decreased: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index
        require
            exists: exists
            a_string_not_void: a_string /= void
            index_large_enough: index >= 0
            index_small_enough: index <= count
        ensure
            count_increased: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
        require
            exists: exists
        ensure
            empty: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_lbn_dblclk
            -- Double click on a string
        require
            exists: exists

    on_lbn_errspace
            -- Cannot allocate enough memory
            -- to meet a specific request
        require
            exists: exists

    on_lbn_killfocus
            -- Lose the keyboard focus
        require
            exists: exists

    on_lbn_selcancel
            -- Cancel the selection
        require
            exists: exists

    on_lbn_selchange
            -- The selection is about to change
        require
            exists: exists

    on_lbn_setfocus
            -- Receive the keyboard focus
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

    consistent_count: exists and then selected implies count > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LIST_BOX


WEL_LIST_VIEW Chart

class
    WEL_LIST_VIEW

General
    cluster: wel.controls
    description: "Control that displays a multi-column list of items."
    create: make_by_id, make

Ancestors
    WEL_CONTROL
    WEL_ILC_CONSTANTS
    WEL_LIST_VIEW_CONSTANTS
    WEL_WINDOWS_VERSION

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    column_count: INTEGER
    Comctl32_version: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focus_item: INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_background_color: WEL_COLOR_REF
    get_column_width (column: INTEGER): INTEGER
    get_extended_view_style: INTEGER
    get_item (index, subitem: INTEGER): WEL_LIST_VIEW_ITEM
    get_item_position (index: INTEGER): WEL_POINT
    get_item_rect (index: INTEGER): WEL_RECT
    get_item_state (index, mask: INTEGER): INTEGER
    get_tooltip: WEL_TOOLTIP
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
    Is_windows_2000: BOOLEAN
    Is_windows_95: BOOLEAN
    Is_windows_98: BOOLEAN
    Is_windows_9x: BOOLEAN
    Is_windows_me: BOOLEAN
    Is_windows_nt: BOOLEAN
    Is_windows_nt4: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    search (a_search_info: WEL_LIST_VIEW_SEARCH_INFO; a_starting_index: INTEGER): INTEGER
    selected_count: INTEGER
    selected_item: INTEGER
    selected_items: ARRAY [INTEGER]
    shared: BOOLEAN
    Shell32_version: INTEGER
    Shlwapi_version: INTEGER
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    valid_lvcfmt_constant (value: INTEGER): BOOLEAN
    valid_lvis_constants (value: INTEGER): BOOLEAN
    Version_400: INTEGER
    Version_470: INTEGER
    Version_471: INTEGER
    Version_472: INTEGER
    Version_500: INTEGER
    Version_580: INTEGER
    Version_581: INTEGER
    visible_count: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    append_column (column: WEL_LIST_VIEW_COLUMN)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_column (index: INTEGER)
    delete_item (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    ensure_visible (an_index: INTEGER)
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_column (column: WEL_LIST_VIEW_COLUMN; index: INTEGER)
    insert_item (an_item: WEL_LIST_VIEW_ITEM)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_lvn_begindrag (info: WEL_NM_LIST_VIEW)
    on_lvn_beginlabeledit (info: WEL_LIST_VIEW_ITEM)
    on_lvn_beginrdrag (info: WEL_NM_LIST_VIEW)
    on_lvn_columnclick (info: WEL_NM_LIST_VIEW)
    on_lvn_deleteallitems (info: WEL_NM_LIST_VIEW)
    on_lvn_deleteitem (info: WEL_NM_LIST_VIEW)
    on_lvn_endlabeledit (info: WEL_LIST_VIEW_ITEM)
    on_lvn_getdispinfo (info: WEL_LIST_VIEW_ITEM)
    on_lvn_insertitem (info: WEL_NM_LIST_VIEW)
    on_lvn_itemchanged (info: WEL_NM_LIST_VIEW)
    on_lvn_itemchanging (info: WEL_NM_LIST_VIEW)
    on_lvn_keydown (virtual_key: INTEGER)
    on_lvn_setdispinfo (info: WEL_LIST_VIEW_ITEM)
    prepend_column (column: WEL_LIST_VIEW_COLUMN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    replace_item (an_item: WEL_LIST_VIEW_ITEM)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_background_color (a_color: WEL_COLOR_REF)
    set_capture
    set_cell_text (isub_item, iitem: INTEGER; txt: STRING)
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_column_format (index, fmt: INTEGER)
    set_column_title (txt: STRING; index: INTEGER)
    set_column_width (value, index: INTEGER)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_extended_view_style (a_new_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_image_list (an_imagelist: WEL_IMAGE_LIST)
    set_item (an_item: POINTER)
    set_item_count (value: INTEGER)
    set_item_state (index, state: INTEGER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_small_image_list (an_imagelist: WEL_IMAGE_LIST)
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    update_item (index: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_LIST_VIEW Flat contracts

indexing
    description: "Control that displays a multi-column list of items."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:16 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LIST_VIEW

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a List view control.
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    column_count: INTEGER
            -- Number of columns

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    count: INTEGER
            -- Number of item in the list view
        require
            exists: exists

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focus_item: INTEGER
            -- Zero-based index of the item that has the focus
            -- Return -1 if there is none.
        require
            exists: exists
        ensure
            result_large_enough: Result >= - 1
            result_small_enough: Result < count

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_background_color: WEL_COLOR_REF
            -- Result is background color used for control.

    get_column_width (column: INTEGER): INTEGER
            -- Width of the zero-based index-th item.
        require
            exists: exists
            index_large_enough: column >= 0
            index_small_enough: column < column_count

    get_extended_view_style: INTEGER
            -- Gets extended styles in list view controls.
        require
            function_supported: comctl32_version >= version_470

    get_item (index, subitem: INTEGER): WEL_LIST_VIEW_ITEM
            -- Return a representation of the item at the
            -- index position.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            subitem_large_enough: subitem >= 0
            subitem_small_enough: subitem < column_count

    get_item_position (index: INTEGER): WEL_POINT
            -- Retrieves the position of the zero-based index-th item.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    get_item_rect (index: INTEGER): WEL_RECT
            -- Retrieves the position of the zero-based index-th item.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index <= count

    get_item_state (index, mask: INTEGER): INTEGER
            -- State of the zero-based index-th item. The mask give
            -- the state informations to retrieve. See WEL_LVIS_CONSTANTS for
            -- the value of the mask.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    get_tooltip: WEL_TOOLTIP
            -- Result is tooltip associated with Current.

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected_count: INTEGER
            -- Number of selected items in the list view window
        require
            exists: exists

    selected_item: INTEGER
            -- Contains the top most selected index.
            -- -1 if no item is selected.
        require
            exists: exists
        ensure
            result_valid: selected_count > 0 implies Result >= 0

    selected_items: ARRAY [INTEGER]
            -- Contains all the selected index. Only one in
            -- case of a single selection list view.
        require
            exists: exists
        ensure
            result_not_void: Result /= void
            result_valid: Result.count = selected_count

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Index of the first visible item
        require
            exists
        ensure
            result_large_enough: Result >= 0
            result_small_enough: Result <= count

    visible_count: INTEGER
            -- Number of items that will fit in the list view window
        require
            exists: exists

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    ensure_visible (an_index: INTEGER)
            -- Ensure that column an_index is completely visible in Current.
        require
            exists: exists
            index_large_enough: an_index >= 0
            index_small_enough: an_index < count

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_background_color (a_color: WEL_COLOR_REF)

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_cell_text (isub_item, iitem: INTEGER; txt: STRING)
            -- Set the label of the cell with coordinates isub_item, item
            -- with txt.
        require
            exists: exists
            isub_item_large_enough: isub_item >= 0
            iitem_large_enough: iitem >= 0
            isub_item_small_enough: isub_item < column_count
            iitem_small_enough: iitem < count

    set_column_format (index: INTEGER; fmt: INTEGER)
            -- Set the alignment of the column, cannot be used for
            -- the first column that must be left aligned.
        require
            exists: exists
            index_large_enough: index > 0
            index_small_enough: index < column_count
            good_format: valid_lvcfmt_constant (fmt)

    set_column_title (txt: STRING; index: INTEGER)
            -- Make txt the new title of the index-th column.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < column_count

    set_column_width (value, index: INTEGER)
            -- Make value the new width of the zero-base index-th column.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < column_count

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_extended_view_style (a_new_style: INTEGER)
            -- Sets extended styles in list view controls.
        require
            function_supported: comctl32_version >= version_470

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_image_list (an_imagelist: WEL_IMAGE_LIST)
            -- Set the current "large" image list to an_imagelist.
            -- If an_imagelist is set to Void, it removes
            -- the current associated image list (if any).

    set_item_count (value: INTEGER)
            -- Prepares a list view control for adding a large number
            -- of items and make it then faster.
        require
            exists: exists
            value_big_enough: value >= 0

    set_item_state (index, state: INTEGER)
            -- Set state of item at index with state.
            -- See class WEL_LVIS_CONSTANTS for possible state values.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_small_image_list (an_imagelist: WEL_IMAGE_LIST)
            -- Set the current "small" image list to an_imagelist.
            -- If an_imagelist is set to Void, it removes
            -- the current associated image list (if any).

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    update_item (index: INTEGER)
            -- Update the list view.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

feature -- Element change

    append_column (column: WEL_LIST_VIEW_COLUMN)
            -- Append column to the list view.
        require
            exists: exists
        ensure
            new_column_count: column_count = old column_count + 1

    delete_column (index: INTEGER)
            -- Remove the zero-based index-th column of the list view.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < column_count
        ensure
            new_column_count: column_count = old column_count - 1

    delete_item (index: INTEGER)
            -- Remove the zero-based index-th item of the list view.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_column (column: WEL_LIST_VIEW_COLUMN; index: INTEGER)
            -- Insert column at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index <= column_count
        ensure
            new_column_count: column_count = old column_count + 1

    insert_item (an_item: WEL_LIST_VIEW_ITEM)
            -- Insert item in the list-view. The zero-based position of the item is
            -- given by the iitem attribute of the item.
        require
            exists: exists
            index_large_enough: an_item.iitem >= 0
            index_small_enough: an_item.iitem <= count
        ensure
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    prepend_column (column: WEL_LIST_VIEW_COLUMN)
            -- Prepend column to the list view.
        require
            exists: exists
        ensure
            new_column_count: column_count = old column_count + 1

    replace_item (an_item: WEL_LIST_VIEW_ITEM)
            -- Set the properties of an_item.
            -- The zero-based position of the item is given by the
            -- iitem attribute of the item.
        require
            exists: exists
            index_large_enough: an_item.iitem >= 0
            index_small_enough: an_item.iitem <= count

    reset_content
            -- Reset the content of the list.
        require
            exists: exists
        ensure
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- "Shell and Common controls" Versions

    comctl32_version: INTEGER
            -- Version of Comctl32.dll
            -- (from WEL_WINDOWS_VERSION)

    shell32_version: INTEGER
            -- Version of Shell32.dll
            -- (from WEL_WINDOWS_VERSION)

    shlwapi_version: INTEGER
            -- Version of Shlwapi.dll
            -- (from WEL_WINDOWS_VERSION)

feature -- Basic Operations

    search (a_search_info: WEL_LIST_VIEW_SEARCH_INFO; a_starting_index: INTEGER): INTEGER
            -- Search list view item according to a_search_info.
            -- Search starts after zero based index a_starting_index.
            -- If a_starting_index is -1 then search all items.
            -- Result is zero based index of found item or -1 if item was not found.
        require
            non_void_search_info: a_search_info /= void
            valid_search_info: a_search_info.exists
            valid_starting_index: a_starting_index >= - 1 and a_starting_index < count

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_lvn_begindrag (info: WEL_NM_LIST_VIEW)
            -- A drag-and-drop operation involving the left mouse
            -- button is being initiated.
        require
            exists: exists

    on_lvn_beginlabeledit (info: WEL_LIST_VIEW_ITEM)
            -- A label editing for an item has started.
        require
            exists: exists

    on_lvn_beginrdrag (info: WEL_NM_LIST_VIEW)
            -- A drag-and-drop operation involving the right mouse
            -- button is being initiated.
        require
            exists: exists

    on_lvn_columnclick (info: WEL_NM_LIST_VIEW)
            -- A column was tapped.
        require
            exists: exists

    on_lvn_deleteallitems (info: WEL_NM_LIST_VIEW)
            -- All the items were deleted.
        require
            exists: exists

    on_lvn_deleteitem (info: WEL_NM_LIST_VIEW)
            -- An item was deleted.
        require
            exists: exists

    on_lvn_endlabeledit (info: WEL_LIST_VIEW_ITEM)
            -- A label editing for an item has ended.
        require
            exists: exists

    on_lvn_getdispinfo (info: WEL_LIST_VIEW_ITEM)
            -- It is a request for the parent window to
            -- provide information needed to display or
            -- sort a list view item.
        require
            exists: exists

    on_lvn_insertitem (info: WEL_NM_LIST_VIEW)
            -- A new item was inserted.
        require
            exists: exists

    on_lvn_itemchanged (info: WEL_NM_LIST_VIEW)
            -- An item has changed.
        require
            exists: exists

    on_lvn_itemchanging (info: WEL_NM_LIST_VIEW)
            -- An item is changing
        require
            exists: exists

    on_lvn_keydown (virtual_key: INTEGER)
            -- A key has been pressed.
        require
            exists: exists

    on_lvn_setdispinfo (info: WEL_LIST_VIEW_ITEM)
            -- The list must update the information it maintains
            -- for an item.
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature  -- Validation

    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
            -- Is a_flag a valid list view search flag?
            -- (from WEL_LIST_VIEW_CONSTANTS)

    valid_lvcfmt_constant (value: INTEGER): BOOLEAN
            -- Is value a valid lvcfmt constant?
            -- (from WEL_LIST_VIEW_CONSTANTS)

    valid_lvis_constants (value: INTEGER): BOOLEAN
            -- Is value a valid "Item Styles" constant?
            -- (from WEL_LIST_VIEW_CONSTANTS)

feature -- Version Constants

    version_400: INTEGER
            -- version_400 <=> Microsoft® Windows® 95/Windows NT® 4.0
            -- (from WEL_WINDOWS_VERSION)

    version_470: INTEGER
            -- version_470 <=> Microsoft® Internet Explorer 3.x
            -- (from WEL_WINDOWS_VERSION)

    version_471: INTEGER
            -- version_471 <=> Microsoft® Internet Explorer 4.0
            -- (from WEL_WINDOWS_VERSION)

    version_472: INTEGER
            -- version_472 <=> Microsoft® Internet Explorer 4.01 & Windows® 98
            -- (from WEL_WINDOWS_VERSION)

    version_500: INTEGER
            -- version_500 (Shlwapi.dll) <=> Microsoft® Internet Explorer 5
            -- version_500 (Shell32.dll) <=> Microsoft® Windows® 2000
            -- (from WEL_WINDOWS_VERSION)

    version_580: INTEGER
            -- version_580 (Comctl32.dll) <=> Microsoft® Internet Explorer 5
            -- (from WEL_WINDOWS_VERSION)

    version_581: INTEGER
            -- version_581 (Comctl32.dll)<=> Microsoft® Windows 2000
            -- (from WEL_WINDOWS_VERSION)

feature -- Windows Versions

    is_windows_2000: BOOLEAN
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows2000_is_nt: Result implies is_windows_nt

    is_windows_95: BOOLEAN
            -- Is the current program running under Windows 95
            -- (OSR1, OSR2 or OSR2.5)?
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows95_is_9x: Result implies is_windows_9x

    is_windows_98: BOOLEAN
            -- Is the current program running under Windows 98
            -- (1st or 2nd edition)?
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows98_is_9x: Result implies is_windows_9x

    is_windows_9x: BOOLEAN
            -- Is the current program running under Windows 9x
            -- (Windows 95, Windows 98, Windows Me, ...)?
            -- (from WEL_WINDOWS_VERSION)

    is_windows_me: BOOLEAN
            -- Is the current program running under Windows Millenium Edition?
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows_me_is_9x: Result implies is_windows_9x

    is_windows_nt: BOOLEAN
            -- Is the current program running under Windows NT
            -- (Windows NT 3.51, Windows NT4, Windows 2000, ...)?
            -- (from WEL_WINDOWS_VERSION)

    is_windows_nt4: BOOLEAN
            -- (from WEL_WINDOWS_VERSION)
        ensure -- from WEL_WINDOWS_VERSION
            windows_nt4_is_nt: Result implies is_windows_nt

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LIST_VIEW


WEL_MULTIPLE_LINE_EDIT Chart

class
    WEL_MULTIPLE_LINE_EDIT

General
    cluster: wel.controls
    description: "Edit control which can contain multiple lines."
    create: make_by_id, make

Ancestors
    WEL_EDIT

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    can_undo: BOOLEAN
    captured_window: WEL_WINDOW
    caret_position: INTEGER
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    current_line_index: INTEGER
    current_line_number: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    first_visible_line: INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    formatting_rect: WEL_RECT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_selection: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    line (i: INTEGER): STRING
    line_count: INTEGER
    line_from_char (i: INTEGER): INTEGER
    line_index (i: INTEGER): INTEGER
    line_length (i: INTEGER): INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    modified: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    read_only: BOOLEAN
    scroll_caret_at_selection: BOOLEAN
    selection_end: INTEGER
    selection_start: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    clear
    clip_copy
    clip_cut
    clip_paste
    default_process_notification (notification_code: INTEGER)
    delete_selection
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_scroll_caret_at_selection
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_scroll_caret_at_selection
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_en_change
    on_en_errspace
    on_en_hscroll
    on_en_killfocus
    on_en_maxtext
    on_en_setfocus
    on_en_update
    on_en_vscroll
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    replace_selection (new_text: STRING)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (horizontal, vertical: INTEGER)
    select_all
    set_capture
    set_caret_position (position: INTEGER)
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_default_tab_stops
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_formatting_rect (rect: WEL_RECT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_modify (modify: BOOLEAN)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_read_only
    set_read_write
    set_selection (start_position, end_position: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_tab_stops (tab: INTEGER)
    set_tab_stops_array (tab: ARRAY [INTEGER])
    set_text (a_text: STRING)
    set_text_limit (limit: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    undo
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_MULTIPLE_LINE_EDIT Flat contracts

indexing
    description: "Edit control which can contain multiple lines."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:16 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MULTIPLE_LINE_EDIT

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a static control
            -- (from WEL_STATIC)
        require -- from WEL_STATIC
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_STATIC
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_EDIT)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_STATIC)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    can_undo: BOOLEAN
            -- Can the last operation be undone?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    caret_position: INTEGER
            -- Caret position
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    current_line_index: INTEGER
            -- Index of the line that contains the caret.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    current_line_number: INTEGER
            -- Line number of the line that contains the caret.
        require
            exists: exists
        ensure
            positive_result: Result >= 0
            result_small_enough: Result < line_count

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    first_visible_line: INTEGER
            -- Upper most visible line
        require
            exists: exists
        ensure
            positive_result: Result >= 0
            result_small_enough: Result < line_count

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    formatting_rect: WEL_RECT
            -- Limiting rectangle the text. It is independent of
            -- the size of the edit-control window.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
        ensure -- from WEL_EDIT
            result_not_void: Result /= void

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_selection: BOOLEAN
            -- Has a current selection?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    line (i: INTEGER): STRING
            -- ith line
        require
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < line_count
        ensure
            result_exists: Result /= void

    line_count: INTEGER
            -- Number of lines
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    line_from_char (i: INTEGER): INTEGER
            -- Index of the line that contains the character
            -- index i. A character index is the number of
            -- characters from the beginning of the edit control.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    line_index (i: INTEGER): INTEGER
            -- Number of characters from the beginning of the edit
            -- control to the zero-based line i.
            -- Retrieve a character index for a given line number.
        require
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < line_count
        ensure
            positive_result: Result >= 0

    line_length (i: INTEGER): INTEGER
            -- Length of the ith line
        require
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < line_count
        ensure
            positive_result: Result >= 0
            result_ok: Result = line (i).count

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    modified: BOOLEAN
            -- Has the text been modified?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    read_only: BOOLEAN
            -- Is the current edit control read-only?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    scroll_caret_at_selection: BOOLEAN
            -- Will the caret be scrolled at the selection after
            -- a call to set_selection?

    selection_end: INTEGER
            -- Index of the last character selected
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length + 2

    selection_start: INTEGER
            -- Index of the first character selected
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    disable_scroll_caret_at_selection
            -- Set scroll_caret_at_selection to False.
            -- The caret will not be scrolled at the selection
            -- after a call to set_selection.
        require
            exists: exists
        ensure
            scroll_caret_at_selection_disabled: not scroll_caret_at_selection

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    enable_scroll_caret_at_selection
            -- Set scroll_caret_at_selection to True.
            -- The caret will be scrolled at the selection after
            -- a call to set_selection.
        require
            exists: exists
        ensure
            scroll_caret_at_selection_enabled: scroll_caret_at_selection

    get_text_limit: INTEGER
            -- Get the maximum length of text that the user
            -- can enter into the edit control.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exisits: exists
        ensure -- from WEL_EDIT
            positive_result: Result >= 0

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_caret_position (position: INTEGER)
            -- Set the caret position with position.
            -- If scroll_caret_at_selection is True, the
            -- caret will be scrolled to position.
        require -- from WEL_EDIT
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position <= text_length
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection
            caret_position_set: caret_position = position

    set_default_tab_stops
            -- Set tab stops at every 32 dialog box units.
        require
            exists: exists

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_formatting_rect (rect: WEL_RECT)
            -- Set formatting_rect with rect.
        require
            exists: exists
            rect_not_void: rect /= void

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_modify (modify: BOOLEAN)
            -- Set modified with modify
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
        ensure -- from WEL_EDIT
            modified_set: modified = modify

    set_read_only
            -- Set the read-only state.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    set_read_write
            -- Set the read-write state.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    set_selection (start_position, end_position: INTEGER)
            -- Set the selection between start_position
            -- and end_position.
            -- If scroll_caret_at_selection is True, the
            -- caret will be scrolled to start_position.
        require -- from WEL_EDIT
            exists: exists
            selection_in_lower_bound: start_position >= 0 and end_position >= 0
            selection_in_upper_bound: start_position <= text_length and end_position <= text_length
        ensure -- from WEL_EDIT
            has_selection: (start_position /= end_position) implies has_selection

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_tab_stops (tab: INTEGER)
            -- Set tab stops at every tab dialog box units.
        require
            exists: exists
            positive_tab: tab > 0

    set_tab_stops_array (tab: ARRAY [INTEGER])
            -- Set tab stops using the values of tab.
        require
            exists: exists
            tab_not_void: tab /= void
            tab_large_enough: tab.count > 1

    set_text_limit (limit: INTEGER)
            -- Set to limit the length of the text the user
            -- can enter into the edit control.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            positive_limit: limit >= 0

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    clear
            -- Clear the text
            -- (from WEL_STATIC)
        require -- from WEL_STATIC
            exists: exists
        ensure -- from WEL_STATIC
            text_empty: text.is_empty

    clip_copy
            -- Copy the current selection to the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection

    clip_cut
            -- Cut the current selection to the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    clip_paste
            -- Paste at the current caret position the
            -- content of the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    delete_selection
            -- Delete the current selection.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    replace_selection (new_text: STRING)
            -- Replace the current selection with new_text.
            -- If there is no selection, new_text is inserted
            -- at the current caret_position.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            new_text_not_void: new_text /= void

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (horizontal, vertical: INTEGER)
            -- Scroll the text vertically and horizontally.
            -- horizontal is the number of characters to
            -- scroll horizontally, vertical is the number
            -- of lines to scroll vertically.
        require -- from WEL_WINDOW
            exists: exists

    select_all
            -- Select all the text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            positive_length: text_length > 0
        ensure -- from WEL_EDIT
            has_selection: has_selection
            selection_start_set: selection_start = 0
            selection_end_set: selection_end <= text_length + 2

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    undo
            -- Undo the last operation.
            -- The previously deleted text is restored or the
            -- previously added text is deleted.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            can_undo: can_undo

    unselect
            -- Unselect the current selection.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_en_change
            -- The user has taken an action
            -- that may have altered the text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_errspace
            -- Cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_hscroll
            -- The user click on the horizontal scroll bar.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_killfocus
            -- Lose the keyboard focus.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_maxtext
            -- The current text insertion has exceeded
            -- the specified number of characters.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_setfocus
            -- Receive the keyboard focus.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_update
            -- The control is about to display altered text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_vscroll
            -- The user click on the vertical scroll bar.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_EDIT
    consistent_selection: exists and then has_selection implies selection_start >= 0 and then selection_start <= text_length and then selection_end >= 0 and then selection_end <= text_length + 2 and then selection_start < selection_end
    valid_caret_position: exists implies caret_position >= 0 and then caret_position <= text_length + 2

end -- class WEL_MULTIPLE_LINE_EDIT


WEL_MULTIPLE_SELECTION_LIST_BOX Chart

class
    WEL_MULTIPLE_SELECTION_LIST_BOX

General
    cluster: wel.controls
    description: "List box which can have multiple selections."
    create: make_by_id, make

Ancestors
    WEL_LBS_CONSTANTS
    WEL_LIST_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    caret_index: INTEGER
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    count_selected_items: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_extent: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    is_selected (index: INTEGER): BOOLEAN
    item: POINTER
    item_height: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_items: ARRAY [INTEGER]
    selected_strings: ARRAY [STRING]
    shared: BOOLEAN
    shown: BOOLEAN
    strings: ARRAY [STRING]
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_lbn_dblclk
    on_lbn_errspace
    on_lbn_killfocus
    on_lbn_selcancel
    on_lbn_selchange
    on_lbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_all
    select_item (index: INTEGER)
    select_items (start_index, end_index: INTEGER)
    set_capture
    set_caret_index (index: INTEGER; scrolling: BOOLEAN)
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_extent (a_width: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_top_index (index: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect_all
    unselect_item (index: INTEGER)
    unselect_items (start_index, end_index: INTEGER)
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    valid count


WEL_MULTIPLE_SELECTION_LIST_BOX Flat contracts

indexing
    description: "List box which can have multiple selections."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:17 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MULTIPLE_SELECTION_LIST_BOX

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a list box
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_LIST_BOX
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_LIST_BOX)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_LIST_BOX)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_LIST_BOX
            result_exists: Result /= void
            same_result_as_strings: Result.is_equal (strings.item (i))

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0
            same_result_as_strings: Result = strings.item (i).count

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    strings: ARRAY [STRING]
            -- Strings contained in the list box
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            result_not_void: Result /= void
            count_ok: Result.count = count

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    caret_index: INTEGER
            -- Index of the item that has the focus
        require
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    count_selected_items: INTEGER
            -- Number of items selected
        require
            exits: exists
        ensure
            result_large_enough: Result >= 0
            result_small_enough: Result <= count

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_extent: INTEGER
            -- Width, in pixels, by which the list box can be
            -- scrolled horizontally
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            has_horizontal_scroll_bar: has_horizontal_scroll_bar
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    is_selected (index: INTEGER): BOOLEAN
            -- Is item at position index selected?
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    item_height: INTEGER
            -- Height of an item
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is at least one item selected?
        require -- from WEL_LIST_BOX
            exists: exists

    selected_items: ARRAY [INTEGER]
            -- Contains all the selected index
            -- The Result is an array beginning at index 0.
        require
            exits: exists
        ensure
            result_not_void: Result /= void
            count_ok: Result.count = count_selected_items

    selected_strings: ARRAY [STRING]
            -- Contains all the selected strings
        require
            exits: exists
        ensure
            result_not_void: Result /= void
            count_ok: Result.count = count_selected_items

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Index of the first visible item
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result <= count

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_all
            -- Select all items.
        require
            exists: exists
        ensure
            all_selected: count_selected_items = count

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
        require -- from WEL_LIST_BOX
            exists: exists
            index_small_enough: index < count
            index_large_enough: index >= 0
        ensure -- from WEL_LIST_BOX
            is_selected: is_selected (index)

    select_items (start_index, end_index: INTEGER)
            -- Select items between start_index
            -- and end_index (zero-based index).
        require
            exists: exists
            valid_range: end_index >= start_index
            start_index_small_enough: start_index < count
            start_index_large_enough: start_index >= 0
            end_index_small_enough: end_index < count
            end_index_large_enough: end_index >= 0
            valid_range: end_index >= start_index
        ensure
            selected: selected

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_caret_index (index: INTEGER; scrolling: BOOLEAN)
            -- Set the focus rectangle to the item at the
            -- specified zero-based index. If scrolling is
            -- True the item is scrolled until it is at least
            -- partially visible, otherwise the item is scrolled
            -- until it is fully visible.
        require
            exists: exists
            index_small_enough: index < count
            index_large_enough: index >= 0
        ensure
            caret_index_set: caret_index = index

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_extent (a_width: INTEGER)
            -- Set the width, in pixels, by which a list box can
            -- be scrolled horizontally.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            positive_width: width >= 0
        ensure -- from WEL_LIST_BOX
            horizontal_extent_set: horizontal_extent = a_width

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_top_index (index: INTEGER)
            -- Ensure that the zero-based index
            -- in the list box is visible.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_LIST_BOX
            index_visible: top_index <= index

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unselect_all
            -- Unselect all the selected items.
        require
            exists: exists
        ensure
            all_unselected: count_selected_items = 0

    unselect_item (index: INTEGER)
            -- Unselect item at the zero-based index.
        require
            exists: exists
            index_small_enough: index < count
            index_large_enough: index >= 0
        ensure
            is_not_selected: not is_selected (index)

    unselect_items (start_index, end_index: INTEGER)
            -- Unselect items between start_index
            -- and end_index (zero-based index).
        require
            exists: exists
            valid_range: end_index >= start_index
            start_index_small_enough: start_index < count
            start_index_large_enough: start_index >= 0
            end_index_small_enough: end_index < count
            end_index_large_enough: end_index >= 0
            valid_range: end_index >= start_index
        ensure
            no_item_selected: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the list box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            files_not_void: files /= void

    add_string (a_string: STRING)
            -- Add a_string in the list box.
            -- If the list box does not have the
            -- Lbs_sort style, a_string is added
            -- to the end of the list otherwise it is
            -- inserted into the list and the list is
            -- sorted.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_LIST_BOX
            count_increased: count = old count + 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_LIST_BOX
            count_decreased: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_large_enough: index >= 0
            index_small_enough: index <= count
        ensure -- from WEL_LIST_BOX
            count_increased: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            empty: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_lbn_dblclk
            -- Double click on a string
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_errspace
            -- Cannot allocate enough memory
            -- to meet a specific request
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_killfocus
            -- Lose the keyboard focus
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_selcancel
            -- Cancel the selection
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_selchange
            -- The selection is about to change
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_setfocus
            -- Receive the keyboard focus
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

    valid_count: exists implies selected_items.count = count_selected_items
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_LIST_BOX
    consistent_count: exists and then selected implies count > 0

end -- class WEL_MULTIPLE_SELECTION_LIST_BOX


WEL_OWNER_DRAW_BUTTON Chart

class
    WEL_OWNER_DRAW_BUTTON

General
    cluster: wel.controls
    description: "A button of which the paint operation must be defined by the developer."
    create: make_by_id, make

Ancestors
    WEL_BS_CONSTANTS
    WEL_BUTTON

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_OWNER_DRAW_BUTTON Flat contracts

indexing
    description: "A button of which the paint operation must be defined by the developer."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_OWNER_DRAW_BUTTON

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_OWNER_DRAW_BUTTON


WEL_PROGRESS_BAR Chart

class
    WEL_PROGRESS_BAR

General
    cluster: wel.controls
    description: "Control to indicate the progress of a lengthy operation."
    create: make_by_id, make

Ancestors
    WEL_BAR
    WEL_CONTROL
    WEL_PBM_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    maximum: INTEGER
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    minimum: INTEGER
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    position: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_delta_pos (increment: INTEGER)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_position (new_position: INTEGER)
    set_range (min, max: INTEGER)
    set_shared
    set_step (step: INTEGER)
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    step_it
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_PROGRESS_BAR Flat contracts

indexing
    description: "Control to indicate the progress of a lengthy operation."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PROGRESS_BAR

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a progress bar.
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    maximum: INTEGER
            -- Maximum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            maximum_ok: maximum >= minimum

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    minimum: INTEGER
            -- Minimum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            minimum_ok: minimum <= maximum

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    position: INTEGER
            -- Current position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            valid_minimum: Result >= minimum
            valid_maximum: Result <= maximum

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_delta_pos (increment: INTEGER)
            -- Advance the current position by a specified
            -- increment.
        require
            exists: exists

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_position (new_position: INTEGER)
            -- Set the current position with new_position.
        require -- from WEL_BAR
            exists: exists
            valid_minimum: new_position >= minimum
            valid_maximum: new_position <= maximum
        ensure -- from WEL_BAR
            position_set: position = new_position

    set_range (min, max: INTEGER)
            -- Set the range with minimum and maximum.
        require -- from WEL_BAR
            exists: exists
            valid_range: a_minimum <= a_maximum
        ensure -- from WEL_BAR
            minimum_set: minimum = a_minimum
            maximum_set: maximum = a_maximum

    set_step (step: INTEGER)
            -- Set the step increment with step.

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    step_it
            -- Advance the current position by the step increment.

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PROGRESS_BAR


WEL_PUSH_BUTTON Chart

class
    WEL_PUSH_BUTTON

General
    cluster: wel.controls
    description: "A button which can be pushed."
    create: make_by_id, make

Ancestors
    WEL_BS_CONSTANTS
    WEL_BUTTON

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_PUSH_BUTTON Flat contracts

indexing
    description: "A button which can be pushed."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PUSH_BUTTON

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PUSH_BUTTON


WEL_RADIO_BUTTON Chart

class
    WEL_RADIO_BUTTON

General
    cluster: wel.controls
    description: "Small circle with a text next to it. A bold dot within the circle indicates that the radio button has been checked."
    create: make_by_id, make

Ancestors
    WEL_CHECK_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    checked: BOOLEAN
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_checked
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unchecked
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_RADIO_BUTTON Flat contracts

indexing
    description: "Small circle with a text next to it. A bold dot within the circle indicates that the radio button has been checked."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RADIO_BUTTON

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    checked: BOOLEAN
            -- Is the button checked?
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_checked
            -- Check the button
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists
        ensure -- from WEL_CHECK_BOX
            checked: checked

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unchecked
            -- Uncheck the button
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists
        ensure -- from WEL_CHECK_BOX
            unchecked: not checked

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RADIO_BUTTON


WEL_REBAR Chart

class
    WEL_REBAR

General
    cluster: wel.controls
    description: "Control window that contains one or more bandsthat can be moved by the user."
    create: make

Ancestors
    WEL_CCS_CONSTANTS
    WEL_COMPOSITE_WINDOW
    WEL_CONTROL
    WEL_RB_CONSTANTS
    WEL_RBBIM_CONSTANTS
    WEL_RBIM_CONSTANTS
    WEL_RBN_CONSTANTS
    WEL_RBS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    band_count: INTEGER
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_band_info (index: INTEGER): WEL_REBARBANDINFO
    get_bar_info: WEL_REBARINFO
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    row_count: INTEGER
    row_height (index: INTEGER): INTEGER
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    append_band (band: WEL_REBARBANDINFO)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_band (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    insert_band (band: WEL_REBARBANDINFO; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_rbn_heightchanged
    prepend_band (band: WEL_REBARBANDINFO)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reposition
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_band_info (info: WEL_REBARBANDINFO; index: INTEGER)
    set_bar_info (info: WEL_REBARINFO)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_REBAR Flat contracts

indexing
    description: "Control window that contains one or more bandsthat can be moved by the user."
    note: "To use this control you need to create a WEL_INIT_COMMON_CONTROLS with the flags Icc_cool_Classes and Icc_bar_classes in your application class."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.4 $"

class interface
    WEL_REBAR

create

    make (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Create a rebar with a_parent as parent and
            -- an_id as id.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    band_count: INTEGER
            -- Number of bands in the rebar control.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_band_info (index: INTEGER): WEL_REBARBANDINFO
            -- Retrieve all the informations about the zero-based
            -- index band of the rebar.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < band_count

    get_bar_info: WEL_REBARINFO
            -- Retrieve all the informations about the current rebar
            -- control
        require
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    row_count: INTEGER
            -- Number of rows of bands in the rebar control.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    row_height (index: INTEGER): INTEGER
            -- Retrieve the height of the zero-based index band.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_band_info (info: WEL_REBARBANDINFO; index: INTEGER)
            -- Make info the new informations about the zero-based
            -- index band of the rebar.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < band_count
            info_not_void: info /= void
            info_exists: info.exists

    set_bar_info (info: WEL_REBARINFO)
            -- Make info the new informations about the rebar.
        require
            exists: exists
            info_not_void: info /= void
            info_exists: info.exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    append_band (band: WEL_REBARBANDINFO)
            -- Insert band in the rebar.
        require
            exists: exists
            valid_band: band /= void and then band.exists

    delete_band (index: INTEGER)
            -- Delete the zero-based index band from the rebar.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < band_count

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_band (band: WEL_REBARBANDINFO; index: INTEGER)
            -- Insert band in the rebar.
        require
            exists: exists
            band_not_void: band /= void
            band_exists: band.exists
            index_large_enough: index >= 0
            index_small_enough: index < band_count

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    prepend_band (band: WEL_REBARBANDINFO)
            -- Insert band in the rebar.
        require
            exists: exists
            valid_band: band /= void and then band.exists

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- We need to use both windows methods to reparent
            -- the rebar otherwise it doesn't work.
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    reposition
            -- Reposition the window according to the parent.
            -- This function needs to be called in the
            -- on_size routine of the parent.
        require
            exists: exists

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_rbn_heightchanged
            -- The height of the rebar have changed.
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REBAR


WEL_RICH_EDIT_DLL Chart

class
    WEL_RICH_EDIT_DLL

General
    cluster: wel.controls
    description: "This class is used to load the rich edit control dll. See class WEL_RICH_EDIT."
    create: make

Ancestors
    WEL_DLL

Queries
    exists: BOOLEAN
    item: POINTER
    name: STRING
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    make
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_RICH_EDIT_DLL Flat contracts

indexing
    description: "This class is used to load the rich edit control dll. See class WEL_RICH_EDIT."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RICH_EDIT_DLL

create

    make
            -- Load the rich edit DLL.

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    name: STRING
            -- DLL name (including the path)
            -- (from WEL_DLL)
        require -- from WEL_DLL
            exists: exists
        ensure -- from WEL_DLL
            result_not_void: Result /= void
            result_not_empty: not Result.is_empty

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature

    make
            -- Load the rich edit DLL.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_DLL


WEL_RICH_EDIT Chart

class
    WEL_RICH_EDIT

General
    cluster: wel.controls
    description: "A control in which the user can enter and edit rich text."
    create: make_by_id, make

Ancestors
    WEL_CAPABILITIES_CONSTANTS
    WEL_ECO_CONSTANTS
    WEL_ENM_CONSTANTS
    WEL_FIND_FLAGS_CONSTANTS
    WEL_MULTIPLE_LINE_EDIT
    WEL_RICH_EDIT_MESSAGE_CONSTANTS
    WEL_RICH_EDIT_STYLE_CONSTANTS
    WEL_SCF_CONSTANTS
    WEL_SF_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    can_undo: BOOLEAN
    captured_window: WEL_WINDOW
    caret_position: INTEGER
    character_index_from_position (a_x, a_y: INTEGER): INTEGER
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    current_line_index: INTEGER
    current_line_number: INTEGER
    current_selection_character_format: WEL_CHARACTER_FORMAT
    default_character_format: WEL_CHARACTER_FORMAT
    default_processing: BOOLEAN
    enabled: BOOLEAN
    event_mask: INTEGER
    ex_style: INTEGER
    exists: BOOLEAN
    find (text_to_find: STRING; match_case: BOOLEAN; start_from: INTEGER): INTEGER
    first_visible_line: INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    formatting_rect: WEL_RECT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_selection: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    line (i: INTEGER): STRING
    line_count: INTEGER
    line_from_char (i: INTEGER): INTEGER
    line_index (i: INTEGER): INTEGER
    line_length (i: INTEGER): INTEGER
    line_number_from_position (a_pos: INTEGER): INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    modified: BOOLEAN
    options: INTEGER
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    position_from_character_index (character_index: INTEGER): WEL_POINT
    read_only: BOOLEAN
    scroll_caret_at_selection: BOOLEAN
    selected_text: STRING
    selection: WEL_CHARACTER_RANGE
    selection_end: INTEGER
    selection_start: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_at (i, n: INTEGER): STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    clear
    clip_copy
    clip_cut
    clip_paste
    default_process_notification (notification_code: INTEGER)
    delete_selection
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_notifications
    disable_scroll_caret_at_selection
    disable_vertical_scroll_bar
    dispose
    enable
    enable_all_notifications
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_scroll_caret_at_selection
    enable_standard_notifications
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_selection
    hide_vertical_scroll_bar
    ignore_filtered_message
    insert_after (a_window: WEL_WINDOW)
    insert_rtf_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
    insert_text (a_text: STRING)
    insert_text_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    load_rtf_file (file: RAW_FILE)
    load_text_file (file: RAW_FILE)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    move_to_selection
    on_en_change
    on_en_errspace
    on_en_hscroll
    on_en_killfocus
    on_en_maxtext
    on_en_msgfilter (a_msg_filter: WEL_MSG_FILTER)
    on_en_setfocus
    on_en_update
    on_en_vscroll
    print_all (dc: WEL_PRINTER_DC; title: STRING)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    replace_selection (new_text: STRING)
    resize (a_width, a_height: INTEGER)
    restore
    rtf_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
    rtf_stream_out (stream: WEL_RICH_EDIT_STREAM_OUT)
    save_rtf_file (file: RAW_FILE)
    save_text_file (file: RAW_FILE)
    scroll (horizontal, vertical: INTEGER)
    select_all
    send_stream_in_message (format: INTEGER; stream: WEL_RICH_EDIT_STREAM_IN)
    send_stream_out_message (format: INTEGER; stream: WEL_RICH_EDIT_STREAM_OUT)
    set_background_color (color: WEL_COLOR_REF)
    set_background_system_color
    set_capture
    set_caret_position (position: INTEGER)
    set_character_format_all (a_char_format: WEL_CHARACTER_FORMAT)
    set_character_format_selection (a_char_format: WEL_CHARACTER_FORMAT)
    set_character_format_word (a_char_format: WEL_CHARACTER_FORMAT)
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_default_tab_stops
    set_event_mask (an_event_mask: INTEGER)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_formatting_rect (rect: WEL_RECT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_modify (modify: BOOLEAN)
    set_options (operation, an_options: INTEGER)
    set_paragraph_format (a_para_format: WEL_PARAGRAPH_FORMAT)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_read_only
    set_read_write
    set_selection (start_position, end_position: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_tab_stops (tab: INTEGER)
    set_tab_stops_array (tab: ARRAY [INTEGER])
    set_text (a_text: STRING)
    set_text_limit (limit: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_selection
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    text_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
    text_stream_out (stream: WEL_RICH_EDIT_STREAM_OUT)
    undo
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_RICH_EDIT Flat contracts

indexing
    description: "A control in which the user can enter and edit rich text."
    note: "Rich edit DLL needs to be loaded. See class WEL_RICH_EDIT_DLL. All paragraph measurements are in twips. A twip is 1/1440 of an inch or 1/20 of a point."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.5 $"

class interface
    WEL_RICH_EDIT

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a rich edit control.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_EDIT)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_STATIC)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    can_undo: BOOLEAN
            -- Can the last operation be undone?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    caret_position: INTEGER
        require -- from WEL_EDIT
            exists: exists

    character_index_from_position (a_x, a_y: INTEGER): INTEGER
            -- Zero-based character index of the character which is
            -- the nearest to a_x and a_y position in the client
            -- area.
            -- A returned coordinate can be negative if the
            -- character has been scrolled outside the edit
            -- control's client area. The coordinates are truncated
            -- to integer values and are in screen units relative
            -- to the upper-left corner of the client area of the
            -- control.
        require
            exists: exists
            a_x_large_enough: a_x >= 0
            a_y_large_enough: a_y >= 0

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    count: INTEGER
            -- Length of text.

    current_line_index: INTEGER
            -- Index of the line that contains the caret.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            positive_result: Result >= 0

    current_line_number: INTEGER
            -- Line number of the line that contains the caret.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            positive_result: Result >= 0
            result_small_enough: Result < line_count

    current_selection_character_format: WEL_CHARACTER_FORMAT
            -- Current selection character format information
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    default_character_format: WEL_CHARACTER_FORMAT
            -- Default character format information
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    event_mask: INTEGER
            -- Event mask which specifies notification message the
            -- control sends to its parent window.
            -- See class WEL_ENM_CONSTANTS for values.
        require
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    first_visible_line: INTEGER
            -- Upper most visible line
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            positive_result: Result >= 0
            result_small_enough: Result < line_count

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    formatting_rect: WEL_RECT
            -- Limiting rectangle the text. It is independent of
            -- the size of the edit-control window.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
        ensure -- from WEL_EDIT
            result_not_void: Result /= void

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_selection: BOOLEAN
            -- Has a current selection?
        require -- from WEL_EDIT
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    line (i: INTEGER): STRING
            -- ith line
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < line_count
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            result_exists: Result /= void

    line_count: INTEGER
            -- Number of lines
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            positive_result: Result >= 0

    line_from_char (i: INTEGER): INTEGER
            -- Index of the line that contains the character
            -- index i. A character index is the number of
            -- characters from the beginning of the edit control.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            positive_result: Result >= 0

    line_index (i: INTEGER): INTEGER
            -- Number of characters from the beginning of the edit
            -- control to the zero-based line i.
            -- Retrieve a character index for a given line number.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < line_count
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            positive_result: Result >= 0

    line_length (i: INTEGER): INTEGER
            -- Length of the ith line
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < line_count
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            positive_result: Result >= 0
            result_ok: Result = line (i).count

    line_number_from_position (a_pos: INTEGER): INTEGER
            -- Retrieves the line number from a character position.
            -- Line numbers start at 0.
        require
            exists: exists
            a_pos_large_enough: a_pos >= 0

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    modified: BOOLEAN
            -- Has the text been modified?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    options: INTEGER
            -- Give the current set of options.

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    position_from_character_index (character_index: INTEGER): WEL_POINT
            -- Coordinates of a character at character_index in
            -- the client area.
            -- A returned coordinate can be negative if the
            -- character has been scrolled outside the edit
            -- control's client area.
            -- The coordinates are truncated to integer values and
            -- are in screen units relative to the upper-left
            -- corner of the client area of the control.
        require
            exists: exists
            index_large_enough: character_index >= 0
            index_small_enough: character_index <= text_length + 2
        ensure
            result_not_void: Result /= void

    read_only: BOOLEAN
            -- Is the current edit control read-only?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    scroll_caret_at_selection: BOOLEAN
            -- Will the caret be scrolled at the selection after
            -- a call to set_selection?
            -- (from WEL_MULTIPLE_LINE_EDIT)

    selected_text: STRING
            -- Currently selected text
        require
            exists: exists
            has_selection: has_selection

    selection: WEL_CHARACTER_RANGE
            -- Structure which contains the starting and ending
            -- character positions of the selection.
        require
            exists: exists

    selection_end: INTEGER
            -- Index of the last character selected
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length + 2

    selection_start: INTEGER
            -- Index of the first character selected
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Contents of the rich edit control
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_at (i: INTEGER; n: INTEGER): STRING
            -- Text of length n at position i.
        require
            exists: exists
            valid_length: n > 0
            valid_index: text.valid_index (i + 1)
            valid_length: text.valid_index (i + n)

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    disable_notifications
            -- Disable all notifications.
        require
            exists: exists
        ensure
            no_notification: event_mask = enm_none

    disable_scroll_caret_at_selection
            -- Set scroll_caret_at_selection to False.
            -- The caret will not be scrolled at the selection
            -- after a call to set_selection.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            scroll_caret_at_selection_disabled: not scroll_caret_at_selection

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_all_notifications
            -- Enable all notifications.
        require
            exists: exists

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    enable_scroll_caret_at_selection
            -- Set scroll_caret_at_selection to True.
            -- The caret will be scrolled at the selection after
            -- a call to set_selection.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
        ensure -- from WEL_MULTIPLE_LINE_EDIT
            scroll_caret_at_selection_enabled: scroll_caret_at_selection

    enable_standard_notifications
            -- Enable the standard notifications.
            -- (Enm_change, Enm_update and Enm_scroll).
        require
            exists: exists

    get_text_limit: INTEGER
            -- Get the maximum length of text that the user
            -- can enter into the edit control.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exisits: exists
        ensure -- from WEL_EDIT
            positive_result: Result >= 0

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    insert_text (a_text: STRING)
            -- Insert a_text at the position of the cursor.
            -- Replace the current selection if there is one

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    move_to_selection
            -- Move the selected text to be visible

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background color with color.
        require
            exists: exists
            color_not_void: color /= void

    set_background_system_color
            -- Set the background color with the window
            -- background system color.
        require
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_caret_position (position: INTEGER)
            -- Set the caret position with position.
            -- If scroll_caret_at_selection is True, the
            -- caret will be scrolled to position.
        require -- from WEL_EDIT
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position <= text_length
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection
            caret_position_set: caret_position = position

    set_default_tab_stops
            -- Set default tab stops.
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists

    set_event_mask (an_event_mask: INTEGER)
            -- Set event_mask with an_event_mask.
            -- See class WEL_ENM_CONSTANTS for values.
        require
            exists: exists
        ensure
            event_mask_set: event_mask = an_event_mask

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_formatting_rect (rect: WEL_RECT)
            -- Set formatting_rect with rect.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
            rect_not_void: rect /= void

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_modify (modify: BOOLEAN)
            -- Set modified with modify
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
        ensure -- from WEL_EDIT
            modified_set: modified = modify

    set_options (operation, an_options: INTEGER)
            -- Set the opetions for the control.
            -- See class WEL_ECO_CONSTANTS for values.
        require
            exists: exists

    set_read_only
            -- Set the read-only state.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    set_read_write
            -- Set the read-write state.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    set_selection (start_position, end_position: INTEGER)
            -- Set the selection between start_position
            -- and end_position.
        require -- from WEL_EDIT
            exists: exists
            selection_in_lower_bound: start_position >= 0 and end_position >= 0
            selection_in_upper_bound: start_position <= text_length and end_position <= text_length
        ensure -- from WEL_EDIT
            has_selection: (start_position /= end_position) implies has_selection

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_tab_stops (tab: INTEGER)
            -- Set tab stops at every tab dialog box units.
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
            positive_tab: tab > 0

    set_tab_stops_array (tab: ARRAY [INTEGER])
            -- Set tab stops using the values of tab.
        require -- from WEL_MULTIPLE_LINE_EDIT
            exists: exists
            tab_not_void: tab /= void
            tab_large_enough: tab.count > 1

    set_text (a_text: STRING)
            -- Set text with a_text.
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_text_limit (limit: INTEGER)
            -- Set the length of the text the user can enter into
            -- the edit control.
        require -- from WEL_EDIT
            exists: exists
            positive_limit: limit >= 0

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    ignore_filtered_message
            -- Call this message from within on_en_msgfilter
            -- to prevent the filtered message to be handled
            -- by the Rich Edit Control.

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    print_all (dc: WEL_PRINTER_DC; title: STRING)
            -- Print the contents of the rich edit control on
            -- the printer dc. title is the printer job name.
        require
            exists: exists
            dc_not_void: dc /= void
            dc_exists: dc.exists
            title_not_void: title /= void

    set_character_format_all (a_char_format: WEL_CHARACTER_FORMAT)
            -- Apply a_char_format to all text.
        require
            exists: exists
            a_char_format_not_void: a_char_format /= void

    set_character_format_selection (a_char_format: WEL_CHARACTER_FORMAT)
            -- Apply a_char_format to current selection.
        require
            exists: exists
            a_char_format_not_void: a_char_format /= void

    set_character_format_word (a_char_format: WEL_CHARACTER_FORMAT)
            -- Set the current word with a_char_format.
        require
            exists: exists
            a_char_format_not_void: a_char_format /= void

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_paragraph_format (a_para_format: WEL_PARAGRAPH_FORMAT)
            -- Set the current paragraph with a_para_format.
        require
            exists: exists
            a_para_format_not_void: a_para_format /= void

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    clear
            -- Clear the text
            -- (from WEL_STATIC)
        require -- from WEL_STATIC
            exists: exists
        ensure -- from WEL_STATIC
            text_empty: text.is_empty

    clip_copy
            -- Copy the current selection to the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection

    clip_cut
            -- Cut the current selection to the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    clip_paste
            -- Paste at the current caret position the
            -- content of the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    delete_selection
            -- Delete the current selection.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find (text_to_find: STRING; match_case: BOOLEAN; start_from: INTEGER): INTEGER
            -- Find text_to_find in WEL_RICH_EDIT

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_selection
            -- Hide the selection.
        require
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    insert_rtf_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
            -- Start a rtf stream in operation with stream.
        require
            exists: exists
            stream_not_void: stream /= void

    insert_text_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
            -- Start a text stream in operation with stream.
        require
            exists: exists
            stream_not_void: stream /= void

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    load_rtf_file (file: RAW_FILE)
            -- Load a RTF file in the rich edit control.
        require
            exists: exists
            file_not_void: file /= void
            file_exists: file.exists
            file_is_open_read: file.is_open_read
        ensure
            file_closed: file.is_closed

    load_text_file (file: RAW_FILE)
            -- Load a text file in the rich edit control.
        require
            exists: exists
            file_not_void: file /= void
            file_exists: file.exists
            file_is_open_read: file.is_open_read
        ensure
            file_closed: file.is_closed

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    replace_selection (new_text: STRING)
            -- Replace the current selection with new_text.
            -- If there is no selection, new_text is inserted
            -- at the current caret_position.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            new_text_not_void: new_text /= void

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    rtf_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
            -- Start a rtf stream in operation with stream.
        require
            exists: exists
            stream_not_void: stream /= void

    rtf_stream_out (stream: WEL_RICH_EDIT_STREAM_OUT)
            -- Start a rtf stream out operation with stream.
        require
            exists: exists
            stream_not_void: stream /= void

    save_rtf_file (file: RAW_FILE)
            -- Save the contents of the rich edit control in RTF
            -- format in file.
        require
            exists: exists
            file_not_void: file /= void
            file_exists: file.exists
            file_is_open_read: file.is_open_write
        ensure
            file_closed: file.is_closed

    save_text_file (file: RAW_FILE)
            -- Save the contents of the rich edit control in text
            -- format in file.
        require
            exists: exists
            file_not_void: file /= void
            file_exists: file.exists
            file_is_open_write: file.is_open_write
        ensure
            file_closed: file.is_closed

    scroll (horizontal, vertical: INTEGER)
            -- Scroll the text vertically and horizontally.
            -- horizontal is the number of characters to
            -- scroll horizontally, vertical is the number
            -- of lines to scroll vertically.
            -- (from WEL_MULTIPLE_LINE_EDIT)
        require -- from WEL_WINDOW
            exists: exists

    select_all
            -- Select all the text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            positive_length: text_length > 0
        ensure -- from WEL_EDIT
            has_selection: has_selection
            selection_start_set: selection_start = 0
            selection_end_set: selection_end <= text_length + 2

    send_stream_in_message (format: INTEGER; stream: WEL_RICH_EDIT_STREAM_IN)
            -- Start stream in operation with stream.
            -- See class WEL_SF_CONSTANTS for format values.
            -- Lowest level stream in procedures.
        require
            exists: exists
            stream_not_void: stream /= void

    send_stream_out_message (format: INTEGER; stream: WEL_RICH_EDIT_STREAM_OUT)
            -- Start stream out operation with stream.
            -- See class WEL_SF_CONSTANTS for format values.
            -- Lowest level stream out procedures.
        require
            exists: exists
            stream_not_void: stream /= void

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_selection
            -- Show selection.
        require
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    text_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
            -- Start a text stream in operation with stream.
        require
            exists: exists
            stream_not_void: stream /= void

    text_stream_out (stream: WEL_RICH_EDIT_STREAM_OUT)
            -- Start a text stream out operation with stream.
        require
            exists: exists
            stream_not_void: stream /= void

    undo
            -- Undo the last operation.
            -- The previously deleted text is restored or the
            -- previously added text is deleted.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            can_undo: can_undo

    unselect
            -- Unselect the current selection.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_en_change
            -- The user has taken an action
            -- that may have altered the text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_errspace
            -- Cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_hscroll
            -- The user click on the horizontal scroll bar.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_killfocus
            -- Lose the keyboard focus.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_maxtext
            -- The current text insertion has exceeded
            -- the specified number of characters.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_msgfilter (a_msg_filter: WEL_MSG_FILTER)
            -- Notfication of a keyboard or mouse event in the control.
            -- Only notfications are sent that are enabled
            -- in the event_mask.
            -- Note:
            -- To prevent the Rich Edit Control from handling the message
            -- indicated with a_msg_filter call ignore_filtered_message
        require
            exists: exists
            msg_filter_exists: a_msg_filter /= void and then a_msg_filter.exists

    on_en_setfocus
            -- Receive the keyboard focus.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_update
            -- The control is about to display altered text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_vscroll
            -- The user click on the vertical scroll bar.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_EDIT
    consistent_selection: exists and then has_selection implies selection_start >= 0 and then selection_start <= text_length and then selection_end >= 0 and then selection_end <= text_length + 2 and then selection_start < selection_end
    valid_caret_position: exists implies caret_position >= 0 and then caret_position <= text_length + 2

end -- class WEL_RICH_EDIT


WEL_SCROLL_BAR Chart

class
    WEL_SCROLL_BAR

General
    cluster: wel.controls
    description: "A bar with a scroll box which indicates a position."
    create: make_horizontal, make_vertical, make_by_id

Ancestors
    WEL_BAR
    WEL_COLOR_CONTROL
    WEL_SCROLL_BAR_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_horizontal: BOOLEAN
    is_inside: BOOLEAN
    item: POINTER
    line: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    maximum: INTEGER
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    minimum: INTEGER
    page: INTEGER
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    position: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_scroll (scroll_code, pos: INTEGER)
    on_size (size_type, a_width, a_height: INTEGER)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_line (line_magnitude: INTEGER)
    set_message_return_value (value: INTEGER)
    set_page (page_magnitude: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_position (new_position: INTEGER)
    set_range (a_minimum, a_maximum: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    positive line
    positive page


WEL_SCROLL_BAR Flat contracts

indexing
    description: "A bar with a scroll box which indicates a position."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SCROLL_BAR

create

    make_vertical (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a vertical scroll bar.
        require
            a_parent_not_void: a_parent /= void
        ensure
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id
            position_equal_zero: position = 0
            minimum_equal_zero: minimum = 0
            maximum_equal_zero: maximum = 0

    make_horizontal (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a horizontal scroll bar.
        require
            a_parent_not_void: a_parent /= void
        ensure
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id
            position_equal_zero: position = 0
            minimum_equal_zero: minimum = 0
            maximum_equal_zero: maximum = 0

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    is_horizontal: BOOLEAN
            -- Is current scrollbar an horizontal one?

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    line: INTEGER
            -- Number of scroll units per line

    maximum: INTEGER
            -- Maximum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            maximum_ok: maximum >= minimum

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    minimum: INTEGER
            -- Minimum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            minimum_ok: minimum <= maximum

    page: INTEGER
            -- Number of scroll units per page

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    position: INTEGER
            -- Current position of the scroll box
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            valid_minimum: Result >= minimum
            valid_maximum: Result <= maximum

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_line (line_magnitude: INTEGER)
            -- Set line with line_magnitude.
        require
            positive_line: line >= 0
        ensure
            line_set: line = line_magnitude

    set_page (page_magnitude: INTEGER)
            -- Set page with page_magnitude.
        require
            positive_page: page_magnitude >= 0
        ensure
            page_set: page = page_magnitude

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_position (new_position: INTEGER)
            -- Set position with new_position
        require -- from WEL_BAR
            exists: exists
            valid_minimum: new_position >= minimum
            valid_maximum: new_position <= maximum
        ensure -- from WEL_BAR
            position_set: position = new_position

    set_range (a_minimum, a_maximum: INTEGER)
            -- Set minimum and maximum with
            -- a_minimum and a_maximum
        require -- from WEL_BAR
            exists: exists
            valid_range: a_minimum <= a_maximum
        ensure -- from WEL_BAR
            minimum_set: minimum = a_minimum
            maximum_set: maximum = a_maximum

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    on_scroll (scroll_code, pos: INTEGER)
            -- Process the scroll messages.
            -- Typically, this routine will be called from
            -- on_vertical_scroll_control or
            -- on_horizontal_scroll_control of the parent window.
        require
            exists: exists

    on_size (size_type, a_width, a_height: INTEGER)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

    positive_line: line >= 0
    positive_page: page >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SCROLL_BAR


WEL_SELECTABLE_BUTTON Chart

class
    WEL_SELECTABLE_BUTTON

General
    cluster: wel.controls
    description: "Control that looks and acts like a button. But  the button looks raised when it isn’t pushed or checked, and sunken when it is pushed or checked."
    create: make_by_id, make

Ancestors
    WEL_CHECK_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    checked: BOOLEAN
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_bn_clicked
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_checked
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unchecked
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_SELECTABLE_BUTTON Flat contracts

indexing
    description: "Control that looks and acts like a button. But  the button looks raised when it isn’t pushed or checked, and sunken when it is pushed or checked."
    note: "To create this kind of button  a ressource editor,    create a checkbox and then choose the pushlike option  for this checkbox"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SELECTABLE_BUTTON

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a button.
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_BUTTON
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    checked: BOOLEAN
            -- Is the button checked?
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_checked
            -- Check the button
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists
        ensure -- from WEL_CHECK_BOX
            checked: checked

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unchecked
            -- Uncheck the button
            -- (from WEL_CHECK_BOX)
        require -- from WEL_CHECK_BOX
            exists: exists
        ensure -- from WEL_CHECK_BOX
            unchecked: not checked

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Color

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    foreground_color: WEL_COLOR_REF
            -- Foreground color has no effect with SCROLL_BAR.
            -- Cannot be Void.
            -- (from WEL_BUTTON)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_bn_clicked
            -- Called when the button is clicked
            -- (from WEL_BUTTON)
        require -- from WEL_BUTTON
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SELECTABLE_BUTTON


WEL_SIMPLE_COMBO_BOX Chart

class
    WEL_SIMPLE_COMBO_BOX

General
    cluster: wel.controls
    description: "A combox box with an edit control and a list box always open."
    create: make_by_id, make

Ancestors
    WEL_CBS_CONSTANTS
    WEL_COMBO_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    dropped_rect: WEL_RECT
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    list_item_height: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    selection_field_height: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_cbn_closeup
    on_cbn_dblclk
    on_cbn_dropdown
    on_cbn_editchange
    on_cbn_editupdate
    on_cbn_errspace
    on_cbn_killfocus
    on_cbn_selchange
    on_cbn_selendcancel
    on_cbn_selendok
    on_cbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_limit_text (limit: INTEGER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_SIMPLE_COMBO_BOX Flat contracts

indexing
    description: "A combox box with an edit control and a list box always open."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:18 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SIMPLE_COMBO_BOX

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_COMBO_BOX
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            result_exists: Result /= void

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    dropped_rect: WEL_RECT
            -- Rectangle of the drop down list box
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_text_limit: INTEGER
            -- Return the maximum text length.
            -- (from WEL_COMBO_BOX)

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    list_item_height: INTEGER
            -- height of list items in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- String currently selected
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            selected: selected
        ensure -- from WEL_COMBO_BOX
            result_not_void: Result /= void

    selection_field_height: INTEGER
            -- height of the selection field in a combo box
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_COMBO_BOX)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Zero-based index of the first visible item in the list
            -- box portion of a combo box.
            -- Initially, the item with index 0 is at the top of the
            -- list box, but if the list box contents have been scrolled,
            -- another item may be at the top.
            -- (from WEL_COMBO_BOX)
        ensure -- from WEL_COMBO_BOX
            operation_successful: Result /= cb_err

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            selected_item: selected and then selected_item = index

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_limit_text (limit: INTEGER)
            -- Set the length of the text the user may type.
        require
            exists: exists
            positive_limit: limit >= 0

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unselect
            -- Clear the selection.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            selection_cleared: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the combo box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            files_not_void: files /= void

    add_string (a_string: STRING)
            -- Add a_string in the combo box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_small_enough: index <= count
            index_large_enough: index >= 0
        ensure -- from WEL_COMBO_BOX
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
        ensure -- from WEL_COMBO_BOX
            new_count: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_cbn_closeup
            -- The combo box has been closed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dblclk
            -- The user double-clicks a string in the list box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_dropdown
            -- The list box is about to be made visible.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editchange
            -- The user has taken an action that may have altered
            -- the text in the edit control portion.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_editupdate
            -- The edit control portion is about to
            -- display altered text.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_errspace
            -- The combo box cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_killfocus
            -- The combo box loses the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selchange
            -- The selection is about to be changed.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendcancel
            -- The user selects an item, but then selects another
            -- control or closes the dialog box.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_selendok
            -- The user selects a list item, or selects
            -- an item an then closes the list.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

    on_cbn_setfocus
            -- The combo box receives the keyboard focus.
            -- (from WEL_COMBO_BOX)
        require -- from WEL_COMBO_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SIMPLE_COMBO_BOX


WEL_SINGLE_LINE_EDIT Chart

class
    WEL_SINGLE_LINE_EDIT

General
    cluster: wel.controls
    description: "Edit control which only contains one line."
    create: make_by_id, make

Ancestors
    WEL_EDIT

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    can_undo: BOOLEAN
    captured_window: WEL_WINDOW
    caret_position: INTEGER
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    formatting_rect: WEL_RECT
    get_text_limit: INTEGER
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_selection: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    modified: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    read_only: BOOLEAN
    selection_end: INTEGER
    selection_start: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    clear
    clip_copy
    clip_cut
    clip_paste
    default_process_notification (notification_code: INTEGER)
    delete_selection
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_en_change
    on_en_errspace
    on_en_hscroll
    on_en_killfocus
    on_en_maxtext
    on_en_setfocus
    on_en_update
    on_en_vscroll
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    replace_selection (new_text: STRING)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_all
    set_capture
    set_caret_position (position: INTEGER)
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_modify (modify: BOOLEAN)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_read_only
    set_read_write
    set_selection (start_position, end_position: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_text_limit (limit: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    undo
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_SINGLE_LINE_EDIT Flat contracts

indexing
    description: "Edit control which only contains one line."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SINGLE_LINE_EDIT

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a static control
            -- (from WEL_STATIC)
        require -- from WEL_STATIC
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_STATIC
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_EDIT)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_STATIC)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    can_undo: BOOLEAN
            -- Can the last operation be undone?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    caret_position: INTEGER
            -- Caret position
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    formatting_rect: WEL_RECT
            -- Limiting rectangle the text. It is independent of
            -- the size of the edit-control window.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
        ensure -- from WEL_EDIT
            result_not_void: Result /= void

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_selection: BOOLEAN
            -- Has a current selection?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    modified: BOOLEAN
            -- Has the text been modified?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    read_only: BOOLEAN
            -- Is the current edit control read-only?
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    selection_end: INTEGER
            -- Index of the last character selected
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length + 2

    selection_start: INTEGER
            -- Index of the first character selected
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            result_large_enough: Result >= 0
            result_small_enough: Result <= text_length

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    get_text_limit: INTEGER
            -- Get the maximum length of text that the user
            -- can enter into the edit control.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exisits: exists
        ensure -- from WEL_EDIT
            positive_result: Result >= 0

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_caret_position (position: INTEGER)
            -- Set the caret position with position.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position <= text_length
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection
            caret_position_set: caret_position = position

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_modify (modify: BOOLEAN)
            -- Set modified with modify
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
        ensure -- from WEL_EDIT
            modified_set: modified = modify

    set_read_only
            -- Set the read-only state.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    set_read_write
            -- Set the read-write state.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    set_selection (start_position, end_position: INTEGER)
            -- Set the selection between start_position
            -- and end_position.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            selection_in_lower_bound: start_position >= 0 and end_position >= 0
            selection_in_upper_bound: start_position <= text_length and end_position <= text_length
        ensure -- from WEL_EDIT
            has_selection: (start_position /= end_position) implies has_selection

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_text_limit (limit: INTEGER)
            -- Set to limit the length of the text the user
            -- can enter into the edit control.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            positive_limit: limit >= 0

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    clear
            -- Clear the text
            -- (from WEL_STATIC)
        require -- from WEL_STATIC
            exists: exists
        ensure -- from WEL_STATIC
            text_empty: text.is_empty

    clip_copy
            -- Copy the current selection to the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection

    clip_cut
            -- Cut the current selection to the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    clip_paste
            -- Paste at the current caret position the
            -- content of the clipboard.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    delete_selection
            -- Delete the current selection.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    replace_selection (new_text: STRING)
            -- Replace the current selection with new_text.
            -- If there is no selection, new_text is inserted
            -- at the current caret_position.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            new_text_not_void: new_text /= void

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_all
            -- Select all the text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            positive_length: text_length > 0
        ensure -- from WEL_EDIT
            has_selection: has_selection
            selection_start_set: selection_start = 0
            selection_end_set: selection_end <= text_length + 2

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    undo
            -- Undo the last operation.
            -- The previously deleted text is restored or the
            -- previously added text is deleted.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            can_undo: can_undo

    unselect
            -- Unselect the current selection.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists
            has_selection: has_selection
        ensure -- from WEL_EDIT
            has_no_selection: not has_selection

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_en_change
            -- The user has taken an action
            -- that may have altered the text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_errspace
            -- Cannot allocate enough memory to
            -- meet a specific request.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_hscroll
            -- The user click on the horizontal scroll bar.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_killfocus
            -- Lose the keyboard focus.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_maxtext
            -- The current text insertion has exceeded
            -- the specified number of characters.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_setfocus
            -- Receive the keyboard focus.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_update
            -- The control is about to display altered text.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

    on_en_vscroll
            -- The user click on the vertical scroll bar.
            -- (from WEL_EDIT)
        require -- from WEL_EDIT
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_EDIT
    consistent_selection: exists and then has_selection implies selection_start >= 0 and then selection_start <= text_length and then selection_end >= 0 and then selection_end <= text_length + 2 and then selection_start < selection_end
    valid_caret_position: exists implies caret_position >= 0 and then caret_position <= text_length + 2

end -- class WEL_SINGLE_LINE_EDIT


WEL_SINGLE_SELECTION_LIST_BOX Chart

class
    WEL_SINGLE_SELECTION_LIST_BOX

General
    cluster: wel.controls
    description: "List box which can have only one selection."
    create: make_by_id, make

Ancestors
    WEL_LBS_CONSTANTS
    WEL_LIST_BOX

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    find_string (index: INTEGER; a_string: STRING): INTEGER
    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_extent: INTEGER
    i_th_text (i: INTEGER): STRING
    i_th_text_length (i: INTEGER): INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    is_selected (index: INTEGER): BOOLEAN
    item: POINTER
    item_height: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: INTEGER
    selected_string: STRING
    shared: BOOLEAN
    shown: BOOLEAN
    strings: ARRAY [STRING]
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    top_index: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_files (attribut: INTEGER; files: STRING)
    add_string (a_string: STRING)
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_string (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_string_at (a_string: STRING; index: INTEGER)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_lbn_dblclk
    on_lbn_errspace
    on_lbn_killfocus
    on_lbn_selcancel
    on_lbn_selchange
    on_lbn_setfocus
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_item (index: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_extent (a_width: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_top_index (index: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unselect
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    consistent selection


WEL_SINGLE_SELECTION_LIST_BOX Flat contracts

indexing
    description: "List box which can have only one selection."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SINGLE_SELECTION_LIST_BOX

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a list box
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure -- from WEL_LIST_BOX
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_LIST_BOX)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_LIST_BOX)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_text (i: INTEGER): STRING
            -- Text at the zero-based index i
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_LIST_BOX
            result_exists: Result /= void
            same_result_as_strings: Result.is_equal (strings.item (i))

    i_th_text_length (i: INTEGER): INTEGER
            -- Length text at the zero-based index i
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            i_large_enough: i >= 0
            i_small_enough: i < count
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0
            same_result_as_strings: Result = strings.item (i).count

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    strings: ARRAY [STRING]
            -- Strings contained in the list box
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            result_not_void: Result /= void
            count_ok: Result.count = count

feature -- Measurement

    count: INTEGER
            -- Number of lines
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_extent: INTEGER
            -- Width, in pixels, by which the list box can be
            -- scrolled horizontally
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            has_horizontal_scroll_bar: has_horizontal_scroll_bar
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    is_selected (index: INTEGER): BOOLEAN
            -- Is item at position index selected?
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count

    item_height: INTEGER
            -- Height of an item
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            positive_result: Result >= 0

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
        require -- from WEL_LIST_BOX
            exists: exists

    selected_item: INTEGER
            -- Zero-based index of the selected item
        require
            exists: exists
            selected: selected
        ensure
            result_large_enough: Result >= 0
            result_small_enough: Result < count

    selected_string: STRING
            -- Selected string
        require
            exists: exists
            selected: selected
        ensure
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    top_index: INTEGER
            -- Index of the first visible item
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            result_large_enough: Result >= 0
            result_small_enough: Result <= count

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_item (index: INTEGER)
            -- Select item at the zero-based index.
        require -- from WEL_LIST_BOX
            exists: exists
            index_small_enough: index < count
            index_large_enough: index >= 0
        ensure -- from WEL_LIST_BOX
            is_selected: is_selected (index)
        ensure then
            selected: selected
            selected_item: selected_item = index
            selected_string: strings.item (index).is_equal (selected_string)

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_extent (a_width: INTEGER)
            -- Set the width, in pixels, by which a list box can
            -- be scrolled horizontally.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            positive_width: width >= 0
        ensure -- from WEL_LIST_BOX
            horizontal_extent_set: horizontal_extent = a_width

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_top_index (index: INTEGER)
            -- Ensure that the zero-based index
            -- in the list box is visible.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_LIST_BOX
            index_visible: top_index <= index

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unselect
            -- Unselect the selected item.
        require
            exists: exists
        ensure
            unselected: not selected

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_files (attribut: INTEGER; files: STRING)
            -- Add files to the list box. files may contain
            -- wildcards (?*). See class WEL_DDL_CONSTANTS for
            -- attribut values.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            files_not_void: files /= void

    add_string (a_string: STRING)
            -- Add a_string in the list box.
            -- If the list box does not have the
            -- Lbs_sort style, a_string is added
            -- to the end of the list otherwise it is
            -- inserted into the list and the list is
            -- sorted.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            a_string_not_void: a_string /= void
        ensure -- from WEL_LIST_BOX
            count_increased: count = old count + 1

    delete_string (index: INTEGER)
            -- Delete the item at the zero-based index
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure -- from WEL_LIST_BOX
            count_decreased: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_string_at (a_string: STRING; index: INTEGER)
            -- Add a_string at the zero-based index
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            a_string_not_void: a_string /= void
            index_large_enough: index >= 0
            index_small_enough: index <= count
        ensure -- from WEL_LIST_BOX
            count_increased: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Reset the content of the list.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
        ensure -- from WEL_LIST_BOX
            empty: count = 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    find_string (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that contains the
            -- prefix a_string. index specifies the
            -- zero-based index of the item before the first
            -- item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    find_string_exact (index: INTEGER; a_string: STRING): INTEGER
            -- Find the first string that matches a_string.
            -- index specifies the zero-based index of the
            -- item before the first item to be searched.
            -- Returns -1 if the search was unsuccessful.
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
            a_string_not_void: a_string /= void

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_lbn_dblclk
            -- Double click on a string
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_errspace
            -- Cannot allocate enough memory
            -- to meet a specific request
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_killfocus
            -- Lose the keyboard focus
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_selcancel
            -- Cancel the selection
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_selchange
            -- The selection is about to change
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

    on_lbn_setfocus
            -- Receive the keyboard focus
            -- (from WEL_LIST_BOX)
        require -- from WEL_LIST_BOX
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

    consistent_selection: exists and then selected implies is_selected (selected_item) and strings.item (selected_item).is_equal (selected_string)
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_LIST_BOX
    consistent_count: exists and then selected implies count > 0

end -- class WEL_SINGLE_SELECTION_LIST_BOX


WEL_STATIC_BITMAP Chart

class
    WEL_STATIC_BITMAP

General
    cluster: wel.controls
    description: "Control with a text."
    create: make_by_bitmap_id, make

Ancestors
    WEL_DIB_COLORS_CONSTANTS
    WEL_IMAGE_CONSTANTS
    WEL_STATIC
    WEL_STM_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    clear
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_STATIC_BITMAP Flat contracts

indexing
    description: "Control with a text."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STATIC_BITMAP

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a static control
        require -- from WEL_STATIC
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_STATIC
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_bitmap_id (a_parent: WEL_WINDOW; bitmap_id: INTEGER; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a static control

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_STATIC)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    bitmap: WEL_BITMAP
            -- displayed bitmap

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
            -- (from WEL_STATIC)
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    clear
            -- Clear the text
            -- (from WEL_STATIC)
        require -- from WEL_STATIC
            exists: exists
        ensure -- from WEL_STATIC
            text_empty: text.is_empty

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STATIC_BITMAP


WEL_STATIC Chart

class
    WEL_STATIC

General
    cluster: wel.controls
    description: "Control with a text."
    create: make_by_id, make

Ancestors
    WEL_COLOR_CONTROL
    WEL_CONTROL
    WEL_SS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    clear
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_STATIC Flat contracts

indexing
    description: "Control with a text."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STATIC

create

    make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a static control
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
            -- Can be redefined by the user
        require -- from WEL_COLOR_CONTROL
            exists: exists
        ensure -- from WEL_COLOR_CONTROL
            color_not_void: foreground_color /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    clear
            -- Clear the text
        require
            exists: exists
        ensure
            text_empty: text.is_empty

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STATIC


WEL_STATUS_WINDOW Chart

class
    WEL_STATUS_WINDOW

General
    cluster: wel.controls
    description: "A window containing one or several parts which can display text or can be owner drawn."
    create: make_by_id, make

Ancestors
    WEL_CONTROL
    WEL_SBT_CONSTANTS
    WEL_STATUS_WINDOW_CONSTANTS
    WEL_WORD_OPERATIONS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    edges: ARRAY [INTEGER]
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_border_width: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    number_of_parts: INTEGER
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    rect_for_part (index: INTEGER): WEL_RECT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text_for_part (index: INTEGER): STRING
    text_length_for_part (index: INTEGER): INTEGER
    text_style_for_part (index: INTEGER): INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_border_width: INTEGER
    width: INTEGER
    width_between_rectangles: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reposition
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_minimum_height (a_height: INTEGER)
    set_multiple_mode
    set_parent (a_parent: WEL_WINDOW)
    set_part_owner_drawn (index, value, a_style: INTEGER)
    set_parts (a_edges: ARRAY [INTEGER])
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_simple_mode
    set_simple_text (a_text: STRING)
    set_simple_text_with_style (a_text: STRING; a_style: INTEGER)
    set_style (a_style: INTEGER)
    set_text_part (index: INTEGER; a_text: STRING)
    set_text_part_with_style (index: INTEGER; a_text: STRING; a_style: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_STATUS_WINDOW Flat contracts

indexing
    description: "A window containing one or several parts which can display text or can be owner drawn."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STATUS_WINDOW

create

    make (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Create a status window with a_parent as parent and
            -- an_id as id.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    edges: ARRAY [INTEGER]
            -- Zero-based integer array which contains
            -- all the edges currently present.
        require
            exists: exists
        ensure
            result_not_void: Result /= void
            consistent_count: Result.count = number_of_parts

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_border_width: INTEGER
            -- Width of the horizontal border
        require
            exists: exists
        ensure
            positive_result: Result > 0

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    number_of_parts: INTEGER
            -- Current number of parts
        require
            exists: exists
        ensure
            positive_result: Result > 0

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    rect_for_part (index: INTEGER): WEL_RECT
            -- Rectangle for a part identified by the
            -- zero-based index.
        require
            exists: exists
            index_small_enough: index < number_of_parts
            index_large_enough: index >= 0
        ensure
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text_for_part (index: INTEGER): STRING
            -- Text for the part identified by the zero-based
            -- index.
        require
            exists: exists
            index_small_enough: index < number_of_parts
            index_large_enough: index >= 0
        ensure
            result_not_void: Result /= void
            consistent_count: Result.count = text_length_for_part (index)

    text_length_for_part (index: INTEGER): INTEGER
            -- Length of the text in the part identified by the
            -- zero-based index.
        require
            exists: exists
            index_small_enough: index < number_of_parts
            index_large_enough: index >= 0
        ensure
            positive_result: Result >= 0

    text_style_for_part (index: INTEGER): INTEGER
            -- Style of the text in the part identified by the
            -- zero-based index
        require
            exists: exists
            index_small_enough: index < number_of_parts
            index_large_enough: index >= 0
        ensure
            positive_result: Result >= 0

    vertical_border_width: INTEGER
            -- Width of the vertical border
        require
            exists: exists
        ensure
            positive_result: Result > 0

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    width_between_rectangles: INTEGER
            -- Width between the rectangles
        require
            exists: exists
        ensure
            positive_result: Result > 0

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_minimum_height (a_height: INTEGER)
            -- Set the minimun height with a_height in pixels.
            -- To let the change take effect, call
            -- the reposition procedure.
        require
            exists: exists
            minimum_height: a_height >= 2 * vertical_border_width

    set_multiple_mode
            -- Switch to multiple parts mode.
        require
            exists: exists

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_part_owner_drawn (index, value, a_style: INTEGER)
            -- Set a part identified by the zero-based index to
            -- be owner drawn using a_style as extended style.
            -- value will be present in the on_draw_item
            -- routine of the parent as item_data in class
            -- WEL_DRAW_ITEM_STRUCT.
            -- See class WEL_SBT_CONSTANTS for a_style values.
        require
            exists: exists
            index_small_enough: index < number_of_parts
            index_large_enough: index >= 0
        ensure
            style_is_set: text_style_for_part (index) = sbt_ownerdraw + a_style

    set_parts (a_edges: ARRAY [INTEGER])
            -- Set the parts for a multiple parts status window
            -- according to the edged defined in a_edges.
            -- If an element is -1, the position of the right edge
            -- for that part extends to the right edge of the
            -- window.
        require
            exists: exists
            a_edges_not_void: a_edges /= void
            count_large_enough: a_edges.count > 0
            count_small_enough: a_edges.count < 255
        ensure
            edges_set: edges.same_items (a_edges)

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_simple_mode
            -- Switch to simple mode.
        require
            exists: exists

    set_simple_text (a_text: STRING)
            -- Set a_text for the simple mode
        require
            exists: exists
            a_text_not_void: a_text /= void

    set_simple_text_with_style (a_text: STRING; a_style: INTEGER)
            -- Set the text a_text with style a_style for a part
            -- identified by Simple_part.
            -- See class WEL_SBT_CONSTANTS for a_style values.
        require
            exists: exists
            a_text_not_void: a_text /= void

    set_text_part (index: INTEGER; a_text: STRING)
            -- Set the text for a part identified by the
            -- zero-based index.
        require
            exists: exists
            index_small_enough: index < number_of_parts
            index_large_enough: index >= 0
            a_text_not_void: a_text /= void
        ensure
            text_set: a_text.is_equal (text_for_part (index))

    set_text_part_with_style (index: INTEGER; a_text: STRING; a_style: INTEGER)
            -- Set the text for a part identified by the
            -- zero-based index.
            -- See class WEL_SBT_CONSTANTS for a_style values.
        require
            exists: exists
            index_small_enough: index < number_of_parts
            index_large_enough: index >= 0
            a_text_not_void: a_text /= void
        ensure
            text_set: a_text.is_equal (text_for_part (index))
            style_is_set: a_style = text_style_for_part (index)

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    reposition
            -- Reposition the window according to the parent.
            -- This function needs to be called in the
            -- on_size routine of the parent.
        require
            exists: exists

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STATUS_WINDOW


WEL_TAB_CONTROL Chart

class
    WEL_TAB_CONTROL

General
    cluster: wel.controls
    description: "This control is analogous to the dividers in a notebook or the labels in a file cabinet. By using a tab control, an application can define multiple pages for the same area of a window or dialog box. Each page consists of a set of information or a group of controls that the application displays when the user selects the corresponding tab. A special type of tab control displays tabs that look like buttons. Clicking a button should immediately perform a command instead of displaying a page."
    create: make_by_id, make

Ancestors
    WEL_COMPOSITE_WINDOW
    WEL_CONTROL
    WEL_RGN_CONSTANTS
    WEL_TCM_CONSTANTS
    WEL_TCN_CONSTANTS
    WEL_TCS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    current_selection: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_item (index: INTEGER): WEL_TAB_CONTROL_ITEM
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    label_index_rect: WEL_RECT
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    row_count: INTEGER
    scroller: WEL_SCROLLER
    selected_window: WEL_WINDOW
    shared: BOOLEAN
    sheet_rect: WEL_RECT
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    delete_all_items
    delete_item (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    insert_item (index: INTEGER; an_item: WEL_TAB_CONTROL_ITEM)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    on_tcn_keydown (virtual_key, key_data: INTEGER)
    on_tcn_selchange
    on_tcn_selchanging
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_current_selection (index: INTEGER)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_label_index_size (new_width, new_height: INTEGER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_font (fnt: WEL_FONT)
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    update_item (index: INTEGER; an_item: WEL_TAB_CONTROL_ITEM)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_TAB_CONTROL Flat contracts

indexing
    description: "This control is analogous to the dividers in a notebook or the labels in a file cabinet. By using a tab control, an application can define multiple pages for the same area of a window or dialog box. Each page consists of a set of information or a group of controls that the application displays when the user selects the corresponding tab. A special type of tab control displays tabs that look like buttons. Clicking a button should immediately perform a command instead of displaying a page."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control.Inheritance from WEL_COMPOSITE_WINDOW in order to propagate theevents (most especially wm_command and wm_notify) to the children."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TAB_CONTROL

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a tab control.
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    count: INTEGER
            -- Number of tabs in the tab control
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    label_index_rect: WEL_RECT
            -- Labeled index area of selected tab
            -- (excluding the tab sheet)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    row_count: INTEGER
            -- Number of tab rows in the tab control
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    sheet_rect: WEL_RECT
            -- Client area of each tab sheet
            -- (excluding the labeled index)
            -- Windows require in multiline mode to have at least
            -- two element in the notebook to have access to this
            -- data or to be currently showing the tab control.
            -- If this condition are not satisfied, Windows will raise
            -- a segmentation violation.
        require
            exists: exists

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    current_selection: INTEGER
            -- Selected zero-based tab
        require
            exists: exists
        ensure
            consistent_result: Result /= - 1 implies Result >= 0 and Result < count

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_item (index: INTEGER): WEL_TAB_CONTROL_ITEM
            -- Give the item at the zero-based index of tab.
            -- As we must give a maximum size for the retrieving
            -- of the label, we allow only buffer_size letters. If the
            -- label is longer, it will be cut.
        require
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected_window: WEL_WINDOW
            -- Window corresponding to currently selected tab

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_current_selection (index: INTEGER)
            -- Set the zero-based tab index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            current_selection_set: current_selection = index

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_font (fnt: WEL_FONT)
            -- Assign font to the vertical tabs of this tab control.
            -- (Cannot use set_font since its postcondition is not always fulfilled)
            -- To use for a notebook with the tabs on the left or
            -- the right.

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    delete_all_items
            -- Delete all items.
        require
            exists: exists
        ensure
            empty: count = 0

    delete_item (index: INTEGER)
            -- Delete the item at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            count_decreased: count = old count - 1

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_item (index: INTEGER; an_item: WEL_TAB_CONTROL_ITEM)
            -- Insert an_item at the zero-based index.
        require
            exists: exists
            an_item_not_void: an_item /= void
            index_large_enough: index >= 0
            index_small_enough: index <= count
        ensure
            count_increased: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_label_index_size (new_width, new_height: INTEGER)
            -- Set size of labeled index area of each tab
            -- Width is only reset if tabs are fixed-width; height is always reset

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_item (index: INTEGER; an_item: WEL_TAB_CONTROL_ITEM)
            -- Sets some or all of the index-th tab's attributes. Attributes values
            -- are taken from an_item. See an_item.mask for selected attributes.
        require
            exists: exists
            an_item_not_void: an_item /= void
            index_large_enough: index >= 0
            index_small_enough: index <= count

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_tcn_keydown (virtual_key, key_data: INTEGER)
            -- A key has been pressed
        require
            exists: exists

    on_tcn_selchange
            -- Selection has changed.
            -- Shows the current selected page by default.
        require
            exists: exists

    on_tcn_selchanging
            -- Selection is about to change.
            -- Hides the current selected page by default.
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TAB_CONTROL


WEL_TOOLTIP Chart

class
    WEL_TOOLTIP

General
    cluster: wel.controls
    description: "Small pop-up window that displays a single line of descriptive text giving the purpose of tools."
    create: make_by_pointer, make_by_id, make

Ancestors
    WEL_CONTROL
    WEL_TTDT_CONSTANTS
    WEL_TTM_CONSTANTS
    WEL_TTS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    autopop_delay_time: INTEGER
    background_brush: WEL_BRUSH
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_tool_info (index: INTEGER): WEL_TOOL_INFO
    id: INTEGER
    initial_delay_time: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    reshow_delay_time: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_color: WEL_COLOR_REF
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    activate
    add_tool (tool_info: WEL_TOOL_INFO)
    bring_to_top
    deactivate
    default_process_notification (notification_code: INTEGER)
    delete_tool (index: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_automatic_delay_time (delay: INTEGER)
    set_autopop_delay_time (delay: INTEGER)
    set_background_color (a_color: WEL_COLOR_REF)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_initial_delay_time (delay: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_reshow_delay_time (delay: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_text_color (a_color: WEL_COLOR_REF)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_TOOLTIP Flat contracts

indexing
    description: "Small pop-up window that displays a single line of descriptive text giving the purpose of tools."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TOOLTIP

create

    make (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Create a tooltip control with a_parent as parent
            -- and an_id as id.
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    i_th_tool_info (index: INTEGER): WEL_TOOL_INFO
            -- Tool info structure at the zero-based index
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            result_not_void: Result /= void

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    autopop_delay_time: INTEGER
            -- Length of time (in milliseconds) before the
            -- tooltip window is hidden if the cursor remains
            -- stationary in the tool's bounding rectangle after
            -- the tooltip window has appeared.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    background_color: WEL_COLOR_REF
            -- Background color used for the tooltip.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    count: INTEGER
            -- Count of tools
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    initial_delay_time: INTEGER
            -- Length of time (in milliseconds) that the
            -- cursor must remain stationary within the bounding
            -- rectangle of a tool before the tooltip window is
            -- displayed.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    reshow_delay_time: INTEGER
            -- Length of the delay (in milliseconds) before
            -- subsequent tooltip windows are displayed when the
            -- cursor is moved from one tool to another.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_color: WEL_COLOR_REF
            -- Color used for the text of the tooltip.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    activate
            -- Activate the tooltip control.
        require
            exists: exists

    deactivate
            -- Deactivate the tooltip control.
        require
            exists: exists

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_automatic_delay_time (delay: INTEGER)
            -- Set automatically the initial, reshow, and
            -- autopopup durations based on the value of
            -- delay (in milliseconds).
        require
            exists: exists
            positive_delay: delay >= 0

    set_autopop_delay_time (delay: INTEGER)
            -- Set the length of time (in milliseconds) before the
            -- tooltip window is hidden if the cursor remains
            -- stationary in the tool's bounding rectangle after
            -- the tooltip window has appeared.
        require
            exists: exists
            positive_delay: delay >= 0

    set_background_color (a_color: WEL_COLOR_REF)
            -- Background color used for the tooltip.
        require
            exists: exists
            color_not_void: a_color /= void
        ensure
            color_set: background_color.red = a_color.red and then background_color.green = a_color.green and then background_color.blue = a_color.blue

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_initial_delay_time (delay: INTEGER)
            -- Set the length of time (in milliseconds) that the
            -- cursor must remain stationary within the bounding
            -- rectangle of a tool before the tooltip window is
            -- displayed.
        require
            exists: exists
            positive_delay: delay >= 0

    set_reshow_delay_time (delay: INTEGER)
            -- Set the length of the delay (in milliseconds) before
            -- subsequent tooltip windows are displayed when the
            -- cursor is moved from one tool to another.
        require
            exists: exists
            positive_delay: delay >= 0

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_text_color (a_color: WEL_COLOR_REF)
            -- Color used for the text of the tooltip.
        require
            exists: exists
            color_not_void: a_color /= void
        ensure
            color_set: text_color.red = a_color.red and then text_color.green = a_color.green and then text_color.blue = a_color.blue

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    add_tool (tool_info: WEL_TOOL_INFO)
            -- Add a new tool_info in the tooltip control.
        require
            exists: exists
            tool_info_not_void: tool_info /= void
        ensure
            count_increased: count = old count + 1

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    delete_tool (index: INTEGER)
            -- Delete the tool at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < count
        ensure
            count_decreased: count = old count - 1

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOLTIP


WEL_TOOL_BAR Chart

class
    WEL_TOOL_BAR

General
    cluster: wel.controls
    description: "Control window that contains one or more buttons. Each buttons sends a command message to the parent window when the user chooses it."
    create: make

Ancestors
    WEL_CONTROL
    WEL_MAIN_ARGUMENTS
    WEL_TB_CONSTANTS
    WEL_TB_STYLE_CONSTANTS
    WEL_TBN_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    button_checked (command_id: INTEGER): BOOLEAN
    button_count: INTEGER
    button_enabled (command_id: INTEGER): BOOLEAN
    button_hidden (command_id: INTEGER): BOOLEAN
    button_indeterminate (command_id: INTEGER): BOOLEAN
    button_pressed (command_id: INTEGER): BOOLEAN
    button_rect (index: INTEGER): WEL_RECT
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_bitmap: BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    i_th_button (index: INTEGER): WEL_TOOL_BAR_BUTTON
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    last_bitmap_index: INTEGER
    last_string_index: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    to_integer: INTEGER
    tooltip: WEL_TOOLTIP
    tooltip_exists: BOOLEAN
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    add_bitmaps (tb_bitmap: WEL_TOOL_BAR_BITMAP; bitmap_count: INTEGER)
    add_buttons (buttons: ARRAY [WEL_TOOL_BAR_BUTTON])
    add_strings (strings: ARRAY [STRING])
    auto_size
    bring_to_top
    check_button (command_id: INTEGER)
    clear_indeterminate_state (command_id: INTEGER)
    default_process_notification (notification_code: INTEGER)
    delete_button (index: INTEGER)
    destroy
    disable
    disable_button (command_id: INTEGER)
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_hot_item
    disable_vertical_scroll_bar
    dispose
    enable
    enable_button (command_id: INTEGER)
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_hot_item (command_id: INTEGER)
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_button (command_id: INTEGER)
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_button (index: INTEGER; button: WEL_TOOL_BAR_BUTTON)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_tbn_beginadjust
    on_tbn_begindrag (info: WEL_NM_TOOL_BAR)
    on_tbn_custhelp
    on_tbn_dropdown (info: WEL_NM_TOOL_BAR)
    on_tbn_endadjust
    on_tbn_enddrag (info: WEL_NM_TOOL_BAR)
    on_tbn_getbuttoninfo (info: WEL_NM_TOOL_BAR)
    on_tbn_querydelete (info: WEL_NM_TOOL_BAR)
    on_tbn_queryinsert (info: WEL_NM_TOOL_BAR)
    on_tbn_reset
    on_tbn_toolbarchange
    press_button (command_id: INTEGER)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_button (command_id: INTEGER)
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reposition
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_bitmap_size (a_width, a_height: INTEGER)
    set_button_size (a_width, a_height: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_identifier (index, an_id: INTEGER)
    set_indeterminate_state (command_id: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_tooltip (a_tooltip: WEL_TOOLTIP)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_button (command_id: INTEGER)
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    uncheck_button (command_id: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_TOOL_BAR Flat contracts

indexing
    description: "Control window that contains one or more buttons. Each buttons sends a command message to the parent window when the user chooses it."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TOOL_BAR

create

    make (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Create a toolbar with a_parent as parent and
            -- an_id as id.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    button_checked (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id checked?
        require
            exists: exists

    button_count: INTEGER
            -- Number of buttons in toolbar
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    button_enabled (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id enabled?
        require
            exists: exists

    button_hidden (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id hidden?
        require
            exists: exists

    button_indeterminate (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id
            -- indeterminate?
        require
            exists: exists

    button_pressed (command_id: INTEGER): BOOLEAN
            -- Is the button identified by command_id pressed?
        require
            exists: exists

    button_rect (index: INTEGER): WEL_RECT
            -- Rectangle of button at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure
            result_not_void: Result /= void

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_bitmap: BOOLEAN
            -- Does the toolbar contains one bitmap or more?

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    i_th_button (index: INTEGER): WEL_TOOL_BAR_BUTTON
            -- Button at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure
            result_not_void: Result /= void

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    last_bitmap_index: INTEGER
            -- Last bitmap index added by add_bitmaps.

    last_string_index: INTEGER
            -- Last string index added by add_strings.

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    tooltip: WEL_TOOLTIP
            -- The tooltip associated with the toolbar
        require
            tooltip_exists: tooltip_exists

    tooltip_exists: BOOLEAN
            -- Is there a tooltip associated to the toolbar?
        require
            exists: exists

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    check_button (command_id: INTEGER)
            -- Checks a button identified by command_id.
        require
            exists: exists
        ensure
            button_is_checked: button_checked (command_id)

    clear_indeterminate_state (command_id: INTEGER)
            -- Clear the indeterminate state of the button
            -- identified by command_id.
        require
            exists: exists
        ensure
            button_not_indeterminate: not button_indeterminate (command_id)

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_button (command_id: INTEGER)
            -- Disable the button identified by command_id.
        require
            exists: exists
        ensure
            button_disabled: not button_enabled (command_id)

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    disable_hot_item
            -- Unset the hot item.
        require
            exists: exists

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_button (command_id: INTEGER)
            -- Enable the button identified by command_id.
        require
            exists: exists
        ensure
            button_enabled: button_enabled (command_id)

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    enable_hot_item (command_id: INTEGER)
            -- Set hot item for button identified by command_id.
        require
            exists: exists

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    hide_button (command_id: INTEGER)
            -- Hide the button identified by command_id.
        require
            exists: exists
        ensure
            button_hidden: button_hidden (command_id)

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    press_button (command_id: INTEGER)
            -- Press the button identified by command_id.
        require
            exists: exists
        ensure
            button_pressed: button_pressed (command_id)

    release_button (command_id: INTEGER)
            -- Release the button identified by command_id.
        require
            exists: exists
        ensure
            button_not_pressed: not button_pressed (command_id)

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_bitmap_size (a_width, a_height: INTEGER)
            -- Sets the size of the bitmapped images to be added to
            -- the toolbar.
            -- The size can be set only before adding any
            -- bitmaps to the toolbar. If an application does
            -- not explicitly set the bitmap size, the size
            -- defaults to 16 by 15 pixels.
        require
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            no_bitmap_present: not has_bitmap

    set_button_size (a_width, a_height: INTEGER)
            -- Set the size of the buttons to be added to the
            -- toolbar.
            -- The size can be set only before adding any buttons
            -- to the toolbar. If an application does not
            -- explicitly set the button size, the size defaults
            -- to 24 by 22 pixels.
        require
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            no_existing_buttons: button_count = 0

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_identifier (index, an_id: INTEGER)
            -- Set the identifier for the button at zero-based
            -- index to an_id.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count

    set_indeterminate_state (command_id: INTEGER)
            -- Set the indeterminate state of the button
            -- identified by command_id.
        require
            exists: exists
        ensure
            button_indeterminate: button_indeterminate (command_id)

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_tooltip (a_tooltip: WEL_TOOLTIP)
            -- Associate a tooltip control with the toolbar.
        require
            exists: exists
            a_tooltip_not_void: a_tooltip /= void
            a_tooltip_exists: a_tooltip.exists
        ensure
            tooltip_exists: tooltip_exists
            tooltip_set: tooltip = a_tooltip

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_button (command_id: INTEGER)
            -- Show the button identified by command_id.
        require
            exists: exists
        ensure
            button_shown: not button_hidden (command_id)

    uncheck_button (command_id: INTEGER)
            -- Unchecks a button identified by command_id
        require
            exists: exists
        ensure
            button_unchecked: not button_checked (command_id)

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    add_bitmaps (tb_bitmap: WEL_TOOL_BAR_BITMAP; bitmap_count: INTEGER)
            -- Add bitmaps.
        require
            exists: exists
            bitmap_not_void: tb_bitmap /= void
            positive_bitmap_count: bitmap_count > 0

    add_buttons (buttons: ARRAY [WEL_TOOL_BAR_BUTTON])
            -- Add buttons.
        require
            exists: exists
            buttons_not_void: buttons /= void
            buttons_not_empty: not buttons.is_empty
            no_void_button: not buttons.has (void)
        ensure
            count_increased: button_count = old button_count + buttons.count

    add_strings (strings: ARRAY [STRING])
            -- Add strings to the toolbar.
        require
            exists: exists
            string_not_void: strings /= void
            strings_not_empty: not strings.is_empty

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_button (index: INTEGER; button: WEL_TOOL_BAR_BUTTON)
            -- Insert button to the left of the button
            -- at the zero-based index.
        require
            exists: exists
            button_not_void: button /= void
            index_large_enough: index >= 0
            index_small_enough: index <= button_count
        ensure
            buttons_increased: button_count = old button_count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    delete_button (index: INTEGER)
            -- Delete the button at the zero-based index.
        require
            exists: exists
            index_large_enough: index >= 0
            index_small_enough: index < button_count
        ensure
            buttons_decreased: button_count = old button_count - 1

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    auto_size
            -- Resize tooolbar after changes.
            -- An application sends the TB_AUTOSIZE message after
            -- causing the size of a toolbar to change either by
            -- setting the button or bitmap size or by adding strings
            -- for the first time.
        require
            exists: exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    reposition
            -- Reposition the bar according to the parent.
            -- This function needs to be called in the
            -- on_size function of the parent.
        require
            exists: exists

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_tbn_beginadjust
            -- The user has begun customizing the toolbar.
        require
            exists: exists

    on_tbn_begindrag (info: WEL_NM_TOOL_BAR)
            -- The user has begun dragging a button in the toolbar.
        require
            exists: exists

    on_tbn_custhelp
            -- The user has chosen the Help button in the
            -- customize toolbar dialog box.
        require
            exists: exists

    on_tbn_dropdown (info: WEL_NM_TOOL_BAR)
            -- The user clicks a button that uses the
            -- Tbstyle_dropdown style.
        require
            exists: exists

    on_tbn_endadjust
            -- The user has stopped customizing the toolbar.
        require
            exists: exists

    on_tbn_enddrag (info: WEL_NM_TOOL_BAR)
            -- The user has stopped dragging a button in the toolbar.
        require
            exists: exists

    on_tbn_getbuttoninfo (info: WEL_NM_TOOL_BAR)
            -- Retrieves toolbar customization.
        require
            exists: exists

    on_tbn_querydelete (info: WEL_NM_TOOL_BAR)
            -- A button may be deleted from the toolbar while
            -- the user is customizing the toolbar.
        require
            exists: exists

    on_tbn_queryinsert (info: WEL_NM_TOOL_BAR)
            -- A button may be inserted to the left of the
            -- specified button while the user is customizing
            -- the toolbar.
        require
            exists: exists

    on_tbn_reset
            -- The user has reset the content of the customise
            -- toolbar dialog box.
        require
            exists: exists

    on_tbn_toolbarchange
            -- The user has customized the toolbar.
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOL_BAR


WEL_TRACK_BAR Chart

class
    WEL_TRACK_BAR

General
    cluster: wel.controls
    description: "Control that displays a slider and optional tick marks."
    create: make_horizontal, make_vertical, make_by_id

Ancestors
    WEL_BAR
    WEL_TBM_CONSTANTS
    WEL_TBS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    line: INTEGER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    maximum: INTEGER
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    minimum: INTEGER
    page: INTEGER
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    position: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    tick_mark_position (index: INTEGER): INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    valid_index (index: INTEGER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    clear_tick_marks
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_line (line_magnitude: INTEGER)
    set_message_return_value (value: INTEGER)
    set_page (page_magnitude: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_position (new_position: INTEGER)
    set_range (a_minimum, a_maximum: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_tick_mark (pos: INTEGER)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_TRACK_BAR Flat contracts

indexing
    description: "Control that displays a slider and optional tick marks."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TRACK_BAR

create

    make_vertical (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a vertical track bar.
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id
            position_equal_zero: position = 0

    make_horizontal (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a horizontal track bar.
        require
            a_parent_not_void: a_parent /= void
        ensure
            parent_set: parent = a_parent
            exists: exists
            id_set: id = an_id
            position_equal_zero: position = 0

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    line: INTEGER
            -- Number of scroll units per line
            -- Used when the user use the arrow keys.

    maximum: INTEGER
            -- Maximum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            maximum_ok: maximum >= minimum

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    minimum: INTEGER
            -- Minimum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            minimum_ok: minimum <= maximum

    page: INTEGER
            -- Number of scroll units per page
            -- Used when the user use the page-up,
            -- page down key or click on the range.

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    position: INTEGER
            -- Current position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            valid_minimum: Result >= minimum
            valid_maximum: Result <= maximum

    tick_mark_position (index: INTEGER): INTEGER
            -- Tick mark position at the zero-based index
        require
            exists: exists
            valid_index: valid_index (index)
        ensure
            positive_result: Result >= 0

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    valid_index (index: INTEGER): BOOLEAN
            -- Is index valid?
        require
            exists: exists

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    clear_tick_marks
            -- Clear the current tick marks from the track bar.
        require
            exists: exists

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_line (line_magnitude: INTEGER)
            -- Set line with line_magnitude.

    set_page (page_magnitude: INTEGER)
            -- Set page with page_magnitude.

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_position (new_position: INTEGER)
            -- Set position with new_position
        require -- from WEL_BAR
            exists: exists
            valid_minimum: new_position >= minimum
            valid_maximum: new_position <= maximum
        ensure -- from WEL_BAR
            position_set: position = new_position

    set_range (a_minimum, a_maximum: INTEGER)
            -- Set minimum and maximum with
            -- a_minimum and a_maximum
        require -- from WEL_BAR
            exists: exists
            valid_range: a_minimum <= a_maximum
        ensure -- from WEL_BAR
            minimum_set: minimum = a_minimum
            maximum_set: maximum = a_maximum

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_tick_mark (pos: INTEGER)
            -- Set a tick mark at pos.
        require
            exists: exists
            pos_large_enough: pos > minimum
            pos_small_enough: pos < maximum

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TRACK_BAR


WEL_TREE_VIEW Chart

class
    WEL_TREE_VIEW

General
    cluster: wel.controls
    description: "Control that displays a hierarchical list of items."
    create: make_by_id, make

Ancestors
    WEL_COLOR_CONSTANTS
    WEL_CONTROL
    WEL_ILC_CONSTANTS
    WEL_TVAF_CONSTANTS
    WEL_TVGN_CONSTANTS
    WEL_TVI_CONSTANTS
    WEL_TVIF_CONSTANTS
    WEL_TVIS_CONSTANTS
    WEL_TVM_CONSTANTS
    WEL_TVN_CONSTANTS
    WEL_TVS_CONSTANTS
    WEL_TVSIL_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    count: INTEGER
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    get_image_list: WEL_IMAGE_LIST
    get_item_rect (an_item: WEL_TREE_VIEW_ITEM): WEL_RECT
    get_parent_item (an_item: WEL_TREE_VIEW_ITEM): WEL_TREE_VIEW_ITEM
    get_tooltip: WEL_TOOLTIP
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_item (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    id: INTEGER
    indent: INTEGER
    is_bold (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
    is_cut (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
    is_drophilited (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
    is_expanded (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
    is_inside: BOOLEAN
    is_parent (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
    is_selected (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
    item: POINTER
    last_item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    selected: BOOLEAN
    selected_item: WEL_TREE_VIEW_ITEM
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    visible_count: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    collapse_item (an_item: WEL_TREE_VIEW_ITEM)
    default_process_notification (notification_code: INTEGER)
    delete_item (an_item: WEL_TREE_VIEW_ITEM)
    deselect_item (an_item: WEL_TREE_VIEW_ITEM)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    expand_item (an_item: WEL_TREE_VIEW_ITEM)
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    insert_item (an_item: WEL_TREE_VIEW_INSERT_STRUCT)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_tvn_begindrag (info: WEL_NM_TREE_VIEW)
    on_tvn_beginlabeledit (info: WEL_TREE_VIEW_ITEM)
    on_tvn_beginrdrag (info: WEL_NM_TREE_VIEW)
    on_tvn_deleteitem (info: WEL_NM_TREE_VIEW)
    on_tvn_endlabeledit (info: WEL_TREE_VIEW_ITEM)
    on_tvn_getdispinfo (info: WEL_TREE_VIEW_ITEM)
    on_tvn_itemexpanded (info: WEL_NM_TREE_VIEW)
    on_tvn_itemexpanding (info: WEL_NM_TREE_VIEW)
    on_tvn_keydown (virtual_key: INTEGER)
    on_tvn_selchanged (info: WEL_NM_TREE_VIEW)
    on_tvn_selchanging (info: WEL_NM_TREE_VIEW)
    on_tvn_setdispinfo (info: WEL_TREE_VIEW_ITEM)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    reset_content
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    select_drop_target (an_item: WEL_TREE_VIEW_ITEM)
    select_first_visible (an_item: WEL_TREE_VIEW_ITEM)
    select_item (an_item: WEL_TREE_VIEW_ITEM)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_image_list (an_imagelist: WEL_IMAGE_LIST)
    set_indent (an_indent: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_tooltip (tooltip: WEL_TOOLTIP)
    set_tree_item (an_item: WEL_TREE_VIEW_ITEM)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_TREE_VIEW Flat contracts

indexing
    description: "Control that displays a hierarchical list of items."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TREE_VIEW

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make a tree view control.
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    get_parent_item (an_item: WEL_TREE_VIEW_ITEM): WEL_TREE_VIEW_ITEM
            -- Return the parent item of the given item.

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    last_item: POINTER
            -- Handle of the last item inserted

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    count: INTEGER
            -- Number of items in the tree view window
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    get_image_list: WEL_IMAGE_LIST
            -- Get the image list associated with this treeview.
            -- Returns Void if none.

    get_item_rect (an_item: WEL_TREE_VIEW_ITEM): WEL_RECT

    get_tooltip: WEL_TOOLTIP
            -- Result is tooltip associated with Current.

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_item (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
            -- Does an_item exist in the tree?
        require
            exists: exists
            item_not_void: an_item /= void
            item_valid: an_item.exists
        ensure
            mask_unchanged: an_item.mask = old an_item.mask

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    indent: INTEGER
            -- Amout, in pixels, that child items are indented
            -- relative to their parent items.
        require
            exists: exists

    is_bold (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
            -- Is an_item bold?
        require
            exists: exists
            valid_item: has_item (an_item)

    is_cut (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
            -- Is an_item selected as part of a cut and paste
            -- operation?
        require
            exists: exists
            valid_item: has_item (an_item)

    is_drophilited (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
            -- Is an_item selected as a drag ans drop target?
        require
            exists: exists
            valid_item: has_item (an_item)

    is_expanded (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
            -- Is an_item expanded?
        require
            exists: exists
            valid_item: has_item (an_item)

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    is_parent (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
            -- Is an_item a parent of other items?
        require
            exists: exists
            valid_item: has_item (an_item)

    is_selected (an_item: WEL_TREE_VIEW_ITEM): BOOLEAN
            -- Is an_item selected?
        require
            exists: exists
            valid_item: has_item (an_item)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    selected: BOOLEAN
            -- Is an item selected?
        require
            exists: exists

    selected_item: WEL_TREE_VIEW_ITEM
            -- Return the currently selected item.
        require
            exists: exists
            selected: selected
        ensure
            item_valid: Result.exists

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    visible_count: INTEGER
            -- Number of items that will fit into the tree
            -- view window
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    collapse_item (an_item: WEL_TREE_VIEW_ITEM)
            -- Collapse the given item.
        require
            exists: exists
            is_parent (an_item)
            valid_item: has_item (an_item)
        ensure
            item_collapse: not is_expanded (an_item)

    deselect_item (an_item: WEL_TREE_VIEW_ITEM)
            -- Deselect the given item
        require
            exists: exists
            valid_item: has_item (an_item)
        ensure
            item_deselected: not is_selected (an_item)

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    expand_item (an_item: WEL_TREE_VIEW_ITEM)
            -- Expand the given item.
        require
            exists: exists
            is_parent: is_parent (an_item)
            valid_item: has_item (an_item)
        ensure
            item_expanded: is_expanded (an_item)

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    select_drop_target (an_item: WEL_TREE_VIEW_ITEM)
            -- Redraw the given an_item in the style used to
            -- indicate the target of a drag and drop operation.
        require
            exists: exists
            valid_item: has_item (an_item)

    select_first_visible (an_item: WEL_TREE_VIEW_ITEM)
            -- Scrolls the tree view vertically so that
            -- the given an_item is the first visible item.
        require
            exists: exists
            valid_item: has_item (an_item)

    select_item (an_item: WEL_TREE_VIEW_ITEM)
            -- Set the selection to the given an_item.
        require
            exists: exists
            valid_item: has_item (an_item)
        ensure
            item_selected: is_selected (an_item)

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_image_list (an_imagelist: WEL_IMAGE_LIST)
            -- Set the current image list to an_imagelist.
            -- If an_imagelist is set to Void, it removes
            -- the current associated image list (if any).

    set_indent (an_indent: INTEGER)
            -- Set indent with an_indent.
        require
            exists: exists

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_tooltip (tooltip: WEL_TOOLTIP)

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    delete_item (an_item: WEL_TREE_VIEW_ITEM)
            -- Remove an_item from the tree.
        require
            exists: exists
            item_not_void: an_item /= void
            valid_item: has_item (an_item)
            has_items: count > 0

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    insert_item (an_item: WEL_TREE_VIEW_INSERT_STRUCT)
            -- Insert an_item in the tree.
        require
            exists: exists
            an_item_not_void: an_item /= void
            an_item_exists: an_item.exists
        ensure
            new_count: count = old count + 1

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    reset_content
            -- Remove all items from Current.
        require
            exists: exists
            has_items: count > 0

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_tree_item (an_item: WEL_TREE_VIEW_ITEM)
            -- Set some or all of a tree view item's attributes.
        require
            exists: exists
            item_exists: an_item /= void and then an_item.exists
            valid_item: has_item (an_item)
            has_items: count > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Notifications

    on_tvn_begindrag (info: WEL_NM_TREE_VIEW)
            -- A drag-and-drop operation involving the left mouse
            -- button is being initiated.
        require
            exists: exists

    on_tvn_beginlabeledit (info: WEL_TREE_VIEW_ITEM)
            -- A label editing for an item has started.
        require
            exists: exists

    on_tvn_beginrdrag (info: WEL_NM_TREE_VIEW)
            -- A drag-and-drop operation involving the right mouse
            -- button is being initiated.
        require
            exists: exists

    on_tvn_deleteitem (info: WEL_NM_TREE_VIEW)
            -- An item has been deleted.
        require
            exists: exists

    on_tvn_endlabeledit (info: WEL_TREE_VIEW_ITEM)
            -- A label editing for an item has ended.
        require
            exists: exists

    on_tvn_getdispinfo (info: WEL_TREE_VIEW_ITEM)
            -- The parent window must provide information needed
            -- to display or sort an item.
        require
            exists: exists

    on_tvn_itemexpanded (info: WEL_NM_TREE_VIEW)
            -- a parent item's list of child items has expanded
            -- or collapsed.
        require
            exists: exists

    on_tvn_itemexpanding (info: WEL_NM_TREE_VIEW)
            -- a parent item's list of child items is about to
            -- expand or collapse.
        require
            exists: exists

    on_tvn_keydown (virtual_key: INTEGER)
            -- The user pressed a key and the tree-view control
            -- has the input focus.
        require
            exists: exists

    on_tvn_selchanged (info: WEL_NM_TREE_VIEW)
            -- Selection has changed from one item to another.
        require
            exists: exists

    on_tvn_selchanging (info: WEL_NM_TREE_VIEW)
            -- Selection is about to change from one item to
            -- another.
        require
            exists: exists

    on_tvn_setdispinfo (info: WEL_TREE_VIEW_ITEM)
            -- The parent window must update the informations
            -- it maintains about an item.
        require
            exists: exists

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TREE_VIEW


WEL_UP_DOWN_CONTROL Chart

class
    WEL_UP_DOWN_CONTROL

General
    cluster: wel.controls
    description: "This control is a pair of arrow buttons that the user can click to increment or decrement a value."
    create: make_by_id, make

Ancestors
    WEL_BAR
    WEL_UDM_CONSTANTS
    WEL_UDS_CONSTANTS
    WEL_WINDOW_MANAGER

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    buddy_window: WEL_WINDOW
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    decimal_base: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    hexadecimal_base: BOOLEAN
    id: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    maximum: INTEGER
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    minimum: INTEGER
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    position: INTEGER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    default_process_notification (notification_code: INTEGER)
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_buddy_window (a_window: WEL_WINDOW)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_decimal_base
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_hexadecimal_base
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_position (a_position: INTEGER)
    set_range (a_minimum, a_maximum: INTEGER)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_UP_DOWN_CONTROL Flat contracts

indexing
    description: "This control is a pair of arrow buttons that the user can click to increment or decrement a value."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:19 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_UP_DOWN_CONTROL

create

    make (a_parent: WEL_WINDOW; a_x, a_y, a_width, a_height, an_id: INTEGER)
            -- Make an up-down control.
        require
            a_parent_not_void: a_parent /= void
        ensure
            exists: exists
            parent_set: parent = a_parent
            id_set: id = an_id

    make_by_id (a_parent: WEL_DIALOG; an_id: INTEGER)
            -- Make a control identified by an_id with a_parent
            -- as parent.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            a_parent_not_void: a_parent /= void
            positive_id: an_id > 0
        ensure -- from WEL_CONTROL
            parent_set: parent = a_parent
            id_set: id = an_id

feature -- Access

    buddy_window: WEL_WINDOW
            -- Current buddy window
        require
            exists: exists

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
        ensure -- from WEL_CONTROL
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    id: INTEGER
            -- Control id
            -- (from WEL_CONTROL)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    maximum: INTEGER
            -- Maximum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            maximum_ok: maximum >= minimum

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    minimum: INTEGER
            -- Minimum position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            minimum_ok: minimum <= maximum

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    position: INTEGER
            -- Current position
        require -- from WEL_BAR
            exists: exists
        ensure -- from WEL_BAR
            valid_minimum: Result >= minimum
            valid_maximum: Result <= maximum

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    decimal_base: BOOLEAN
            -- Is the base decimal?
        require
            exists: exists

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hexadecimal_base: BOOLEAN
            -- Is the base hexadecimal?
        require
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_decimal_base
            -- Set the radix base to decimal.
        require
            exists: exists
        ensure
            decimal_base: decimal_base

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_hexadecimal_base
            -- Set the radix base to hexadecimal.
        require
            exists: exists
        ensure
            hexadecimal_base: hexadecimal_base

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_buddy_window (a_window: WEL_WINDOW)
            -- Set the buddy window with a_window.
        require
            exists: exists
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
        ensure
            window_set: buddy_window = a_window

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_position (a_position: INTEGER)
            -- Set position with new_position.
        require -- from WEL_BAR
            exists: exists
            valid_minimum: new_position >= minimum
            valid_maximum: new_position <= maximum
        ensure -- from WEL_BAR
            position_set: position = new_position

    set_range (a_minimum, a_maximum: INTEGER)
            -- Set minimum and maximum with a_minimum and
            -- a_maximum.
        require -- from WEL_BAR
            exists: exists
            valid_range: a_minimum <= a_maximum
        ensure -- from WEL_BAR
            minimum_set: minimum = a_minimum
            maximum_set: maximum = a_maximum

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    default_process_notification (notification_code: INTEGER)
            -- Process a notification_code which has not been
            -- processed by process_notification.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in the current group in a_parent
            -- depending on the value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN)
            -- Find the previous or following control with the
            -- Wm_tabstop style in `a_parent depending on the
            -- value of after.
            -- (from WEL_CONTROL)
        require -- from WEL_CONTROL
            valid_parent: a_parent /= void and then a_parent.exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UP_DOWN_CONTROL


cluster wel.gdi

Cluster
    wel.gdi

Supercluster
    wel

Classes
    WEL_BITMAP
    WEL_BRUSH
    WEL_CLIENT_DC
    WEL_COLOR_REF
    WEL_COMPATIBLE_DC
    WEL_DC
    WEL_DEFAULT_PRINTER_DC
    WEL_DESKTOP_DC
    WEL_DIB
    WEL_DISPLAY_DC
    WEL_DRAWING_ROUTINES
    WEL_FONT
    WEL_GDI_ANY
    WEL_LOG_BITMAP
    WEL_LOG_BRUSH
    WEL_LOG_FONT
    WEL_LOG_PALETTE
    WEL_LOG_PEN
    WEL_MEMORY_DC
    WEL_PAINT_DC
    WEL_PALETTE
    WEL_PEN
    WEL_PRINTER_DC
    WEL_REGION
    WEL_SCREEN_DC
    WEL_STANDARD_COLORS
    WEL_STANDARD_PENS
    WEL_SYSTEM_COLORS
    WEL_WINDOW_DC


WEL_BITMAP Chart

class
    WEL_BITMAP

General
    cluster: wel.gdi
    description: "Windows Bitmap, which can be loaded from a resource or created from an existing DIB."
    create: make_by_bitmap, make_by_id, make_compatible, make_by_name, make_by_dib, make_direct, make_by_pointer, make_indirect

Ancestors
    WEL_DIB_COLORS_CONSTANTS
    WEL_GDI_ANY
    WEL_IMAGE_CONSTANTS
    WEL_RESOURCE

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_bitmap: WEL_LOG_BITMAP
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_di_bits (a_dc: WEL_DC; start_line, length: INTEGER; dib: WEL_DIB; mode: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_BITMAP Flat contracts

indexing
    description: "Windows Bitmap, which can be loaded from a resource or created from an existing DIB."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BITMAP

create

    make_by_id (id: INTEGER)
            -- Load the resource by an id
        require -- from WEL_RESOURCE
            valid_id: id > 0
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_name (name: STRING)
            -- Load the resource by a name
        require -- from WEL_RESOURCE
            name_not_void: name /= void
            name_not_empty: not name.is_empty
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_dib (a_dc: WEL_DC; dib: WEL_DIB; mode: INTEGER)
            -- Create a WEL_BITMAP from a dib in the a_dc
            -- using mode. See class WEL_DIB_COLORS_CONSTANTS
            -- for mode values.
        require
            a_dc_not_void: a_dc /= void
            a_dc_exists: a_dc.exists
            dib_not_void: dib /= void
            valid_mode: valid_dib_colors_constant (mode)
        ensure
            bitmap_created: item /= item.default

    make_compatible (a_dc: WEL_DC; a_width, a_height: INTEGER)
            -- Initialize current bitmap to be compatible
            -- with a_dc and with a_width as width,
            -- a_height as height.
        require
            a_dc_not_void: a_dc /= void
            a_dc_exists: a_dc.exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    make_direct (a_width, a_height, a_planes, a_bits_per_pixel: INTEGER; a_data: STRING)
            -- Make a bitmap of dimension a_width x a_height that has a_planes number
            -- of color planes and a_bits_per_pixel (number of bits to identify color).
            -- a_data contains color data array.
        require
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            positive_planes: a_planes >= 0
            positive_bits_per_pixel: a_bits_per_pixel >= 0
            data_not_void: a_data /= void
            data_count_big_enough: a_data.count >= 2 * (a_width * a_height * a_bits_per_pixel * a_planes) // 8

    make_indirect (a_log_bitmap: WEL_LOG_BITMAP)
            -- Make a bitmap using a_log_bitmap.
        require
            a_log_bitmap_not_void: a_log_bitmap /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_by_bitmap (a_bitmap: WEL_BITMAP)
            -- Create a WEL_BITMAP from another WEL_BITMAP. The
            -- bitmap is copied by value

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Bitmap height
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_bitmap: WEL_LOG_BITMAP
            -- Log bitmap structure associated to Current
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    width: INTEGER
            -- Bitmap width
        require
            exists: exists
        ensure
            positive_result: Result >= 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    set_di_bits (a_dc: WEL_DC; start_line, length: INTEGER; dib: WEL_DIB; mode: INTEGER)
            -- Set the bits of the current bitmap to the values
            -- given in dib, starting at line start_line
            -- during length lines, using mode.
            -- See class WEL_DIB_COLORS_CONSTANTS for mode values.
        require
            exists: exists
            a_dc_not_void: a_dc /= void
            a_dc_exists: a_dc.exists
            dib_not_void: dib /= void
            valid_mode: valid_dib_colors_constant (mode)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BITMAP


WEL_BRUSH Chart

class
    WEL_BRUSH

General
    cluster: wel.gdi
    description: "Object brush which can be selected into a DC."
    create: make_by_pointer, make_hatch, make_solid, make_indirect, make_by_sys_color, make_by_pattern

Ancestors
    WEL_GDI_ANY

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_BRUSH Flat contracts

indexing
    description: "Object brush which can be selected into a DC."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BRUSH

create

    make_by_sys_color (sys_color: INTEGER)
            -- Make a brush using the system color sys_color.
            -- See class WEL_COLOR_CONSTANTS for sys_color value.
            -- Use only this creation routine for a WNDCLASS brush.
        ensure
            shared: shared
            item_not_void: item /= default_pointer

    make_solid (a_color: WEL_COLOR_REF)
            -- Make a brush that has the solid a_color
        require
            a_color_not_void: a_color /= void
        ensure
            color_set: exists implies color.item = a_color.item
            item_not_void: item /= default_pointer

    make_hatch (a_hatch: INTEGER; a_color: WEL_COLOR_REF)
            -- Make a brush that has the
            -- hatch_style pattern and a_color
            -- See class WEL_HS_CONSTANTS for a_hatch
        require
            a_color_not_void: a_color /= void
        ensure
            hatch_set: exists implies hatch = a_hatch
            color_set: exists implies color.item = a_color.item
            item_not_void: item /= default_pointer

    make_by_pattern (bitmap: WEL_BITMAP)
            -- Make a brush with the specified bitmap pattern.
        require
            bitmap_not_void: bitmap /= void
            bitmap_exists: bitmap.exists
        ensure
            item_not_void: item /= default_pointer

    make_indirect (a_log_brush: WEL_LOG_BRUSH)
            -- Make a brush using a_log_brush
        require
            a_log_brush_not_void: a_log_brush /= void
        ensure
            item_not_void: item /= default_pointer

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
        require
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
        require
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BRUSH


WEL_CLIENT_DC Chart

class
    WEL_CLIENT_DC

General
    cluster: wel.gdi
    description: "Window's client area device context."
    create: make_by_pointer, make

Ancestors
    WEL_DISPLAY_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window: WEL_WINDOW
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    quick_release
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_CLIENT_DC Flat contracts

indexing
    description: "Window's client area device context."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CLIENT_DC

create

    make (a_window: WEL_WINDOW)
            -- Makes a DC associated with a_window
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
        ensure
            window_set: window = a_window

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

    window: WEL_WINDOW
            -- Window associated with the device context

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    quick_release
            -- Release the device context
        require -- from WEL_DISPLAY_DC
            exists: exists
            no_selected_pen: not pen_selected
            no_selected_brush: not brush_selected
            no_selected_bitmap: not bitmap_selected
            no_selected_font: not font_selected
        ensure then -- from WEL_DISPLAY_DC
            not_exists: not exists

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_CLIENT_DC


WEL_COLOR_REF Chart

class
    WEL_COLOR_REF

General
    cluster: wel.gdi
    description: "Color defined by intensity of the red, green, blue color."
    create: make_by_color, make_rgb, make_system, make

Ancestors
    WEL_COLOR_CONSTANTS

Queries
    blue: INTEGER
    green: INTEGER
    item: INTEGER
    red: INTEGER
    valid_color_constant (c: INTEGER): BOOLEAN

Commands
    set_blue (a_blue: INTEGER)
    set_color (color: INTEGER)
    set_green (a_green: INTEGER)
    set_red (a_red: INTEGER)
    set_rgb (a_red, a_green, a_blue: INTEGER)

Constraints
    valid red inf
    valid red sup
    valid green inf
    valid green sup
    valid blue inf
    valid blue sup


WEL_COLOR_REF Flat contracts

indexing
    description: "Color defined by intensity of the red, green, blue color."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COLOR_REF

create

    make
            -- Make a black color
        ensure
            red_set: red = 0
            green_set: green = 0
            blue_set: blue = 0

    make_rgb (a_red, a_green, a_blue: INTEGER)
            -- Set red, green, blue with
            -- a_red, a_green, a_blue
        require
            valid_red_inf: a_red >= 0
            valid_red_sup: a_red <= 255
            valid_green_inf: a_green >= 0
            valid_green_sup: a_green <= 255
            valid_blue_inf: a_blue >= 0
            valid_blue_sup: a_blue <= 255
        ensure
            red_set: red = a_red
            green_set: green = a_green
            blue_set: blue = a_blue

    make_system (index: INTEGER)
            -- Make a system color identified by index.
            -- See WEL_COLOR_CONSTANTS for index values.
        require
            valid_color_constant: valid_color_constant (index)

    make_by_color (color: INTEGER)
            -- Set item with color.

feature -- Access

    blue: INTEGER
            -- Intensity value for the blue component

    green: INTEGER
            -- Intensity value for the green component

    item: INTEGER
            -- The Current color.

    red: INTEGER
            -- Intensity value for the red component

feature  -- Status report

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

feature -- Element change

    set_blue (a_blue: INTEGER)
            -- Set blue with a_blue
        require
            valid_blue_inf: a_blue >= 0
            valid_blue_sup: a_blue <= 255
        ensure
            blue_set: blue = a_blue

    set_color (color: INTEGER)
            -- Set item with color.
        ensure
            color_set: item = color

    set_green (a_green: INTEGER)
            -- Set green with a_green
        require
            valid_green_inf: a_green >= 0
            valid_green_sup: a_green <= 255
        ensure
            green_set: green = a_green

    set_red (a_red: INTEGER)
            -- Set red with a_red
        require
            valid_red_inf: a_red >= 0
            valid_red_sup: a_red <= 255
        ensure
            red_set: red = a_red

    set_rgb (a_red, a_green, a_blue: INTEGER)
            -- Set red, green, blue with
            -- a_red, a_green, a_blue
        require
            valid_red_inf: a_red >= 0
            valid_red_sup: a_red <= 255
            valid_green_inf: a_green >= 0
            valid_green_sup: a_green <= 255
            valid_blue_inf: a_blue >= 0
            valid_blue_sup: a_blue <= 255
        ensure
            red_set: red = a_red
            green_set: green = a_green
            blue_set: blue = a_blue

invariant

    valid_red_inf: red >= 0
    valid_red_sup: red <= 255
    valid_green_inf: green >= 0
    valid_green_sup: green <= 255
    valid_blue_inf: blue >= 0
    valid_blue_sup: blue <= 255
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COLOR_REF


WEL_COMPATIBLE_DC Chart

class
    WEL_COMPATIBLE_DC

General
    obsolete: "use WEL_MEMORY_DC"
    cluster: wel.gdi
    description: "Memory device context compatible with a given device context."
    create: make

Ancestors
    WEL_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_COMPATIBLE_DC Flat contracts

indexing
    description: "Memory device context compatible with a given device context."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMPATIBLE_DC

create

    make (a_dc: WEL_DC)
            -- Make a compatible dc with a_dc
        require
            a_dc_not: a_dc /= void
            a_dc_exists: a_dc.exists
        ensure
            exists: exists

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_COMPATIBLE_DC


WEL_DC Chart

deferred class
    WEL_DC

General
    cluster: wel.gdi
    description: "General notion of a device context."

Ancestors
    WEL_ANY
    WEL_BIT_OPERATIONS
    WEL_CAPABILITIES_CONSTANTS
    WEL_DIB_COLORS_CONSTANTS
    WEL_DRAWING_CONSTANTS
    WEL_FLOOD_FILL_CONSTANTS
    WEL_MM_CONSTANTS
    WEL_POLYGON_FILL_MODE_CONSTANTS
    WEL_REFERENCE_TRACKABLE
    WEL_STRETCH_MODE_CONSTANTS
    WEL_TA_CONSTANTS
    WEL_WORD_OPERATIONS

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region

Constraints
    valid background mode


WEL_DC Flat contracts

indexing
    description: "General notion of a device context."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_DC

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.

    brush: WEL_BRUSH
            -- Current brush selected.

    font: WEL_FONT
            -- Current font selected.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.

    pen: WEL_PEN
            -- Current pen selected.

    region: WEL_REGION
            -- Current region selected.

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?

    brush_selected: BOOLEAN
            -- Is a brush selected?

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
        require
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?

    height: INTEGER
            -- Height of screen (in raster lines).
        require
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
        require
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
        require
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
        require
            exists: exists
        ensure
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN

    palette_selected: BOOLEAN
            -- Is a palette selected?

    pen_selected: BOOLEAN
            -- Is a pen selected?

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
        require
            exists: exists
        ensure
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
        require
            exists: exists
        ensure
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?

    rop2: INTEGER
            -- Current drawing mode.
        require
            exists: exists
        ensure
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
        require
            exists: exists
        ensure
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
        require
            exists: exists
            s_exists: s /= void
        ensure
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
        require
            exists: exists
            s_exists: s /= void
        ensure
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
        require
            exists: exists
            s_exists: s /= void
        ensure
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
        require
            exists: exists
            text_not_void: text /= void
        ensure
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
        require
            exists: exists
            text_not_void: text /= void
        ensure
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
        require
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
        require
            exists: exists
            text_not_void: text /= void
        ensure
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
        require
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
        require
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
        require
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
        require
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
        require
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
        require
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
        require
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
        require
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
        require
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
        require
            exists: exists
            color_not_void: color /= void
        ensure
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
        require
            exists: exists
        ensure
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
        require
            exists: exists
        ensure
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
        require
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
        require
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
        require
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
        require
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
        require
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
        require
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
        require
            exists: exists
            color_not_void: color /= void
        ensure
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
        require
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
        require
            exists: exists
        ensure
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
        require
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
        require
            exists: exists
        ensure
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
        require
            exists: exists
        ensure
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
        require
            exists: exists
            bitmap_selected: bitmap_selected
        ensure
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
        require
            exists: exists
            brush_selected: brush_selected
        ensure
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
        require
            exists: exists
            font_selected: font_selected
        ensure
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
        require
            exists: exists
            palette_selected: palette_selected
        ensure
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
        require
            exists: exists
            pen_selected: pen_selected
        ensure
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
        require
            exists: exists
            region_selected: region_selected
        ensure
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
        require
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
        require
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
        require
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
        require
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
        require
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
        require
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
        require
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
        require
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
        require
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
        require
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
        require
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
        require
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
        require
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
        require
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
        require
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
        require
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
        require
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
        require
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
        require
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
        require
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
        require
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
        require
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
        require
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context.

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
        require
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
        require
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
        require
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
        require
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
        require
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
        require
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
        require
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
        require
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
        require
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
        require
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
        require
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
        require
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
        require
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
        require
            exists: exists

    release
            -- Release the device context.

    remove_clip_region
            -- Remove the current clipping region.
        require
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
        require
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
        require
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
        require
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
        require
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
        require
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
        require
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
        require
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
        require
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

    valid_background_mode: exists implies is_opaque /= is_transparent
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DC


WEL_DEFAULT_PRINTER_DC Chart

class
    WEL_DEFAULT_PRINTER_DC

General
    cluster: wel.gdi
    description: "Device context to use the default printer which is connected."
    create: make

Ancestors
    WEL_PRINTER_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device: STRING
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    driver: STRING
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    output: STRING
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    abort_document
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    end_document
    end_page
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    retrieve_default_printer
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    start_document (title: STRING)
    start_document_info (doc_info: WEL_DOC_INFO)
    start_page
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region

Constraints
    device not void
    driver not void
    output not void


WEL_DEFAULT_PRINTER_DC Flat contracts

indexing
    description: "Device context to use the default printer which is connected."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DEFAULT_PRINTER_DC

create

    make
            -- Make a dc associated to the default printer.
            -- If there is no default printer connected, exists
            -- is equal to False.

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    device: STRING
            -- Default printer device installed

    driver: STRING
            -- Default printer driver installed

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    output: STRING
            -- Device name for the physical output medium

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    abort_document
            -- Stops the current print job and erases everything
            -- drawn since the last call to start_doc.
            -- (from WEL_PRINTER_DC)
        require -- from WEL_PRINTER_DC
            exists: exists

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    end_document
            -- End the job on the printer.
            -- (from WEL_PRINTER_DC)
        require -- from WEL_PRINTER_DC
            exists: exists

    end_page
            -- Informs the device that the application has
            -- finished writing to a page. This procedure is
            -- typically used to direct the device driver to
            -- advance to a new page.
            -- (from WEL_PRINTER_DC)
        require -- from WEL_PRINTER_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context
            -- (from WEL_PRINTER_DC)

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context
            -- (from WEL_PRINTER_DC)

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    retrieve_default_printer
            -- Retrieve the default printer installed and set
            -- device, driver, output.

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    start_document (title: STRING)
            -- Start the job title on the printer.
            -- (from WEL_PRINTER_DC)
        require -- from WEL_PRINTER_DC
            exists: exists
            title_not_void: title /= void

    start_document_info (doc_info: WEL_DOC_INFO)
            -- Start the job using information from doc_info.
            -- (from WEL_PRINTER_DC)
        require -- from WEL_PRINTER_DC
            exists: exists
            doc_info_not_void: doc_info /= void

    start_page
            -- Prepare the printer driver to accept data.
            -- (from WEL_PRINTER_DC)
        require -- from WEL_PRINTER_DC
            exists: exists

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

    device_not_void: device /= void
    driver_not_void: driver /= void
    output_not_void: output /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_DEFAULT_PRINTER_DC


WEL_DESKTOP_DC Chart

class
    WEL_DESKTOP_DC

General
    cluster: wel.gdi
    description: "Desktop device context."
    create: make

Ancestors
    WEL_DISPLAY_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    quick_release
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_DESKTOP_DC Flat contracts

indexing
    description: "Desktop device context."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DESKTOP_DC

create

    make
            -- Makes a DC associated with the Desktop Window

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    quick_release
        require -- from WEL_DISPLAY_DC
            exists: exists
            no_selected_pen: not pen_selected
            no_selected_brush: not brush_selected
            no_selected_bitmap: not bitmap_selected
            no_selected_font: not font_selected
        ensure then -- from WEL_DISPLAY_DC
            not_exists: not exists

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_DESKTOP_DC


WEL_DIB Chart

class
    WEL_DIB

General
    cluster: wel.gdi
    description: "Device independent bitmap which can be created from a file."
    create: make_by_content_pointer, make_by_file

Ancestors
    WEL_OBJECT_ID_MANAGER
    WEL_STRUCTURE

Queries
    color_count: INTEGER
    exists: BOOLEAN
    height: INTEGER
    item: POINTER
    item_bits: POINTER
    palette: WEL_PALETTE
    shared: BOOLEAN
    to_integer: INTEGER
    width: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_pal_color
    set_shared
    set_unshared


WEL_DIB Flat contracts

indexing
    description: "Device independent bitmap which can be created from a file."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"
    note: "Not all variants of the bmp format can be read. If you haveproblems with a certain image please use i.e. MS Paint to convertthe image to the standard bmp format and then try again."

class interface
    WEL_DIB

create

    make_by_file (file: RAW_FILE)
            -- Create the dib by reading file.
        require
            file_not_void: file /= void
            file_exists: file.exists
            file_opened: file.is_open_read
        ensure
            palette_not_void: palette /= void
            palette_exists: palette.exists
            file_closed: file.is_closed

    make_by_content_pointer (bits_ptr: POINTER; size: INTEGER)
        ensure
            palette_not_void: palette /= void
            palette_exists: palette.exists

feature -- Access

    color_count: INTEGER
            -- How many colors in the dib?
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    height: INTEGER
            -- Dib height
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    item_bits: POINTER
        require
            exists: exists

    palette: WEL_PALETTE
            -- Dib palette.
            --
            -- You can track the references of palette if you want to
            -- free the GDI object contained in palette more quickly.

    width: INTEGER
            -- Dib width
        require
            exists: exists
        ensure
            positive_result: Result >= 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    set_pal_color
            -- Transform the dib to be compatible with
            -- Dib_pal_colors mode.
        require
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DIB


WEL_DISPLAY_DC Chart

deferred class
    WEL_DISPLAY_DC

General
    cluster: wel.gdi
    description: "General representation of a device context that can be displayed on the screen."

Ancestors
    WEL_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    quick_release
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_DISPLAY_DC Flat contracts

indexing
    description: "General representation of a device context that can be displayed on the screen."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_DISPLAY_DC

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context.
            -- (from WEL_DC)

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    quick_release
            -- Release the device context without unselecting
            -- selected item. To Avoid memory leak, the caller
            -- must be certain that everything is already unselected.
        require
            exists: exists
            no_selected_pen: not pen_selected
            no_selected_brush: not brush_selected
            no_selected_bitmap: not bitmap_selected
            no_selected_font: not font_selected
        ensure then
            not_exists: not exists

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context.
            -- (from WEL_DC)

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_DISPLAY_DC


WEL_DRAWING_ROUTINES Chart

class
    WEL_DRAWING_ROUTINES

General
    cluster: wel.gdi
    description: "Basic windows routines to draw controls like owner-draw-buttons."

Ancestors
    WEL_DIB_COLORS_CONSTANTS
    WEL_DRAWING_ROUTINES_CONSTANTS
    WEL_DT_CONSTANTS

Queries
    Dt_bottom: INTEGER
    Dt_calcrect: INTEGER
    Dt_center: INTEGER
    Dt_expandtabs: INTEGER
    Dt_externalleading: INTEGER
    Dt_internal: INTEGER
    Dt_left: INTEGER
    Dt_noclip: INTEGER
    Dt_noprefix: INTEGER
    Dt_right: INTEGER
    Dt_singleline: INTEGER
    Dt_tabstop: INTEGER
    Dt_top: INTEGER
    Dt_vcenter: INTEGER
    Dt_wordbreak: INTEGER

Commands
    draw_edge (dc: WEL_DC; rect: WEL_RECT; type, border: INTEGER)
    draw_focus_rect (dc: WEL_DC; rect: WEL_RECT)
    draw_insensitive_bitmap (dc: WEL_DC; bitmap: WEL_BITMAP; x, y: INTEGER)
    draw_insensitive_text (dc: WEL_DC; txt: STRING; x, y: INTEGER)


WEL_DRAWING_ROUTINES Flat contracts

indexing
    description: "Basic windows routines to draw controls like owner-draw-buttons."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DRAWING_ROUTINES

feature -- Access

    Dt_bottom: INTEGER is 8
            -- Declared in Windows as DT_BOTTOM
            -- (from WEL_DT_CONSTANTS)

    Dt_calcrect: INTEGER is 1024
            -- Declared in Windows as DT_CALCRECT
            -- (from WEL_DT_CONSTANTS)

    Dt_center: INTEGER is 1
            -- Declared in Windows as DT_CENTER
            -- (from WEL_DT_CONSTANTS)

    Dt_expandtabs: INTEGER is 64
            -- Declared in Windows as DT_EXPANDTABS
            -- (from WEL_DT_CONSTANTS)

    Dt_externalleading: INTEGER is 512
            -- Declared in Windows as DT_EXTERNALLEADING
            -- (from WEL_DT_CONSTANTS)

    Dt_internal: INTEGER is 4096
            -- Declared in Windows as DT_INTERNAL
            -- (from WEL_DT_CONSTANTS)

    Dt_left: INTEGER is 0
            -- Declared in Windows as DT_LEFT
            -- (from WEL_DT_CONSTANTS)

    Dt_noclip: INTEGER is 256
            -- Declared in Windows as DT_NOCLIP
            -- (from WEL_DT_CONSTANTS)

    Dt_noprefix: INTEGER is 2048
            -- Declared in Windows as DT_NOPREFIX
            -- (from WEL_DT_CONSTANTS)

    Dt_right: INTEGER is 2
            -- Declared in Windows as DT_RIGHT
            -- (from WEL_DT_CONSTANTS)

    Dt_singleline: INTEGER is 32
            -- Declared in Windows as DT_SINGLELINE
            -- (from WEL_DT_CONSTANTS)

    Dt_tabstop: INTEGER is 128
            -- Declared in Windows as DT_TABSTOP
            -- (from WEL_DT_CONSTANTS)

    Dt_top: INTEGER is 0
            -- Declared in Windows as DT_TOP
            -- (from WEL_DT_CONSTANTS)

    Dt_vcenter: INTEGER is 4
            -- Declared in Windows as DT_VCENTER
            -- (from WEL_DT_CONSTANTS)

    Dt_wordbreak: INTEGER is 16
            -- Declared in Windows as DT_WORDBREAK
            -- (from WEL_DT_CONSTANTS)

feature -- Basic operations

    draw_edge (dc: WEL_DC; rect: WEL_RECT; type, border: INTEGER)
            -- Draw a edge corresponding to the given options.
            -- See WEL_DRAWING_ROUTINES_CONSTANTS for type and
            -- border.
        require
            rect_not_void: rect /= void
            dc_not_void: dc /= void
            dc_exists: dc.exists

    draw_focus_rect (dc: WEL_DC; rect: WEL_RECT)
            -- Draw a focus line in the given rect.
        require
            rect_not_void: rect /= void
            dc_not_void: dc /= void
            dc_exists: dc.exists

    draw_insensitive_bitmap (dc: WEL_DC; bitmap: WEL_BITMAP; x, y: INTEGER)
            -- Draw the given bitmap converted to look insensitive
        require
            bitmap_not_void: bitmap /= void
            bitmap_exists: bitmap.exists
            dc_not_void: dc /= void
            dc_exists: dc.exists

    draw_insensitive_text (dc: WEL_DC; txt: STRING; x, y: INTEGER)
            -- Draw the given text with the insensitive
        require
            txt_not_void: txt /= void
            dc_not_void: dc /= void
            dc_exists: dc.exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DRAWING_ROUTINES


WEL_FONT Chart

class
    WEL_FONT

General
    cluster: wel.gdi
    description: "Object font which can be selected into a DC."
    create: make_indirect, make_by_pointer, make

Ancestors
    WEL_DT_CONSTANTS
    WEL_GDI_ANY
    WEL_UNIT_CONVERSION

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_FONT Flat contracts

indexing
    description: "Object font which can be selected into a DC."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FONT

create

    make (a_height, a_width, escapement, orientation, weight, italic, underline, strike_out, charset, output_precision, clip_precision, quality, pitch_and_family: INTEGER; a_face_name: STRING)
            -- Make font named a_face_name.
        require
            a_face_name_not_void: a_face_name /= void

    make_indirect (a_log_font: WEL_LOG_FONT)
            -- Make a font using a_log_font.
        require
            a_log_font_not_void: a_log_font /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
        ensure
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
        require
            exists
        ensure
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.

    width: INTEGER
            -- Character width of current fixed-width font.

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
        require
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
        require
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FONT


WEL_GDI_ANY Chart

class
    WEL_GDI_ANY

General
    cluster: wel.gdi
    description: "This class is an ancestor to all GDI classes."

Ancestors
    WEL_ANY
    WEL_REFERENCE_TRACKABLE

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_GDI_ANY Flat contracts

indexing
    description: "This class is an ancestor to all GDI classes."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_GDI_ANY

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GDI_ANY


WEL_LOG_BITMAP Chart

class
    WEL_LOG_BITMAP

General
    cluster: wel.gdi
    description: "Properties of a bitmap."
    create: make_by_bitmap, make

Ancestors
    WEL_STRUCTURE

Queries
    bits: POINTER
    bits_pixel: INTEGER
    exists: BOOLEAN
    height: INTEGER
    item: POINTER
    planes: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    type: INTEGER
    width: INTEGER
    width_bytes: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bits (a_bits: POINTER)
    set_bits_pixel (a_bits_pixel: INTEGER)
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_planes (a_planes: INTEGER)
    set_shared
    set_type (a_type: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_width_bytes (a_width_bytes: INTEGER)


WEL_LOG_BITMAP Flat contracts

indexing
    description: "Properties of a bitmap."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LOG_BITMAP

create

    make (a_width, a_height, a_width_bytes, a_planes, a_bits_pixel: INTEGER; a_bits: POINTER)
        require
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            positive_width_bytes: a_width_bytes >= 0
            positive_planes: a_planes >= 0
            positive_bits_pixel: a_bits_pixel >= 0
            count_width_bytes: (a_width_bytes \\ 2) = 0
        ensure
            type_set: type = 0
            width_set: width = a_width
            height_set: height = a_height
            width_bytes_set: width_bytes = a_width_bytes
            planes_set: planes = a_planes
            bits_pixel_set: bits_pixel = a_bits_pixel
            bits_set: bits = a_bits

    make_by_bitmap (bitmap: WEL_BITMAP)
            -- Make a log bitmap using the information of bitmap.
        require
            bitmap_not_void: bitmap /= void
            bitmap_exists: bitmap.exists

feature -- Access

    bits: POINTER
            -- Bitmap bits

    bits_pixel: INTEGER
            -- Bitmap bits_pixel
        ensure
            positive_result: Result >= 0

    height: INTEGER
            -- Bitmap height
        ensure
            positive_result: Result >= 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    planes: INTEGER
            -- Bitmap planes
        ensure
            positive_result: Result >= 0

    type: INTEGER
            -- Bitmap type

    width: INTEGER
            -- Bitmap width
        ensure
            positive_result: Result >= 0

    width_bytes: INTEGER
            -- Bitmap width_bytes
        ensure
            positive_result: Result >= 0

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bits (a_bits: POINTER)
            -- Set bits with a_bits
        ensure
            set_bits: bits = a_bits

    set_bits_pixel (a_bits_pixel: INTEGER)
            -- Set bits_pixel with a_bits_pixel
        require
            positive_bits_pixel: a_bits_pixel >= 0
        ensure
            set_bits_pixel: bits_pixel = a_bits_pixel

    set_height (a_height: INTEGER)
            -- Set height with a_height
        require
            positive_height: a_height >= 0
        ensure
            set_height: height = a_height

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_planes (a_planes: INTEGER)
            -- Set planes with a_planes
        require
            positive_planes: a_planes >= 0
        ensure
            set_planes: planes = a_planes

    set_type (a_type: INTEGER)
            -- Set type with a_type
        ensure
            set_type: type = a_type

    set_width (a_width: INTEGER)
            -- Set width with a_width
        require
            positive_width: a_width >= 0
        ensure
            set_width: width = a_width

    set_width_bytes (a_width_bytes: INTEGER)
            -- Set width_bytes with a_width_bytes
        require
            positive_width_bytes: a_width_bytes >= 0
        ensure
            set_width_bytes: width_bytes = a_width_bytes

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LOG_BITMAP


WEL_LOG_BRUSH Chart

class
    WEL_LOG_BRUSH

General
    cluster: wel.gdi
    description: "Defines the style, color and pattern of  a physical brush. Encapsulate the C struct LOGPEN  (a WEL_LOG_BRUSH is NOT a BRUSH, this is a structure.)"
    create: make_by_brush, make

Ancestors
    WEL_STRUCTURE

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    hatch: INTEGER
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    style: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_color (a_color: WEL_COLOR_REF)
    set_hatch (a_hatch: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_style (a_style: INTEGER)
    set_unshared

Constraints
    color not void


WEL_LOG_BRUSH Flat contracts

indexing
    description: "Defines the style, color and pattern of  a physical brush. Encapsulate the C struct LOGPEN  (a WEL_LOG_BRUSH is NOT a BRUSH, this is a structure.)"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LOG_BRUSH

create

    make (a_style: INTEGER; a_color: WEL_COLOR_REF; a_hatch: INTEGER)
            -- Make a log brush using a_style, a_color and
            -- a_hatch type.
            -- See class WEL_BRUSH_STYLE_CONSTANTS for a_style
            -- values.
            -- See class WEL_HS_CONSTANTS for a_hatch values.
        require
            color_not_void: a_color /= void
        ensure
            style_set: style = a_style
            hatch_set: hatch = a_hatch

    make_by_brush (brush: WEL_BRUSH)
            -- Make a log brush using the information of brush.
        require
            brush_not_void: brush /= void
            brush_exists: brush.exists
        ensure
            style_set: style = brush.style
            color_set: color.is_equal (brush.color)
            hatch_set: hatch = brush.hatch

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
        ensure
            result_not_void: Result /= void

    hatch: INTEGER
            -- Brush hatch

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    style: INTEGER
            -- Brush style

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_color (a_color: WEL_COLOR_REF)
            -- Set color with a_color
        require
            a_color_not_void: a_color /= void

    set_hatch (a_hatch: INTEGER)
            -- Set hatch with a_hatch
        ensure
            hatch_set: hatch = a_hatch

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_style (a_style: INTEGER)
            -- Set style with a_style
        ensure
            style_set: style = a_style

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    color_not_void: color /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LOG_BRUSH


WEL_LOG_FONT Chart

class
    WEL_LOG_FONT

General
    cluster: wel.gdi
    description: "Defines the attributes of a font."
    create: make_with_pointer, make_by_font, make

Ancestors
    WEL_CAPABILITIES_CONSTANTS
    WEL_CHARACTER_SET_CONSTANTS
    WEL_CLIP_PRECISION_CONSTANTS
    WEL_FONT_FAMILY_CONSTANTS
    WEL_FONT_PITCH_CONSTANTS
    WEL_FONT_QUALITY_CONSTANTS
    WEL_OUT_PRECISION_CONSTANTS
    WEL_STRUCTURE
    WEL_WORD_OPERATIONS

Queries
    char_set: INTEGER
    clip_precision: INTEGER
    escapement: INTEGER
    exists: BOOLEAN
    face_name: STRING
    family: INTEGER
    has_ansi_character_set: BOOLEAN
    has_character_clipping_precision: BOOLEAN
    has_character_output_precision: BOOLEAN
    has_default_character_set: BOOLEAN
    has_default_clipping_precision: BOOLEAN
    has_default_output_precision: BOOLEAN
    has_default_pitch: BOOLEAN
    has_default_quality: BOOLEAN
    has_draft_quality: BOOLEAN
    has_fixed_pitch: BOOLEAN
    has_oem_character_set: BOOLEAN
    has_proof_quality: BOOLEAN
    has_string_output_precision: BOOLEAN
    has_stroke_clipping_precision: BOOLEAN
    has_stroke_output_precision: BOOLEAN
    has_symbol_character_set: BOOLEAN
    has_unicode_character_set: BOOLEAN
    has_variable_pitch: BOOLEAN
    height: INTEGER
    height_in_points: INTEGER
    is_decorative_family: BOOLEAN
    is_dont_care_family: BOOLEAN
    is_modern_family: BOOLEAN
    is_roman_family: BOOLEAN
    is_script_family: BOOLEAN
    is_swiss_family: BOOLEAN
    italic: BOOLEAN
    item: POINTER
    Max_face_name_length: INTEGER
    orientation: INTEGER
    out_precision: INTEGER
    pitch: INTEGER
    pitch_and_family: INTEGER
    quality: INTEGER
    shared: BOOLEAN
    strike_out: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    underlined: BOOLEAN
    weight: INTEGER
    width: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_ansi_character_set
    set_char_set (a_char_set: INTEGER)
    set_character_clipping_precision
    set_character_output_precision
    set_clip_precision (a_precision: INTEGER)
    set_decorative_family
    set_default_character_set
    set_default_clipping_precision
    set_default_output_precision
    set_default_pitch
    set_default_quality
    set_dont_care_family
    set_draft_quality
    set_escapement (a_escapement: INTEGER)
    set_face_name (a_face_name: STRING)
    set_family (a_family: INTEGER)
    set_fixed_pitch
    set_height (a_height: INTEGER)
    set_italic
    set_item (an_item: POINTER)
    set_modern_family
    set_not_italic
    set_not_strike_out
    set_not_underlined
    set_oem_character_set
    set_orientation (a_orientation: INTEGER)
    set_out_precision (a_precision: INTEGER)
    set_pitch (a_pitch: INTEGER)
    set_pitch_and_family (a_pitch_and_family: INTEGER)
    set_proof_quality
    set_quality (a_quality: INTEGER)
    set_roman_family
    set_script_family
    set_shared
    set_strike_out
    set_string_output_precision
    set_stroke_clipping_precision
    set_stroke_output_precision
    set_swiss_family
    set_symbol_character_set
    set_underlined
    set_unicode_character_set
    set_unshared
    set_variable_pitch
    set_weight (a_weight: INTEGER)
    set_width (a_width: INTEGER)
    update_by_font (font: WEL_FONT)


WEL_LOG_FONT Flat contracts

indexing
    description: "Defines the attributes of a font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LOG_FONT

create

    make (a_height: INTEGER; a_face_name: STRING)
            -- Make a font with a_height as height and
            -- a_face_name as face_name.
        require
            a_face_name_not_void: a_face_name /= void
            valid_count: a_face_name.count <= max_face_name_length
        ensure
            height_set: height = a_height
            width_set: width = 0
            escapement_set: escapement = 0
            weight_set: weight = 0
            not_italic: not italic
            not_underlined: not underlined
            not_strike_out: not strike_out
            has_default_character_set: has_default_character_set
            has_default_clipping_precision: has_default_clipping_precision
            has_default_quality: has_default_quality
            has_default_pitch: has_default_pitch
            is_dont_care_family: is_dont_care_family
            face_name_set: face_name.is_equal (a_face_name)

    make_with_pointer (a_pointer: POINTER)
            -- Copy structure pointed by a_pointer in
            -- item.

    make_by_font (font: WEL_FONT)
            -- Make a log font using the information of font.
        require
            font_not_void: font /= void
            font_exists: font.exists

feature -- Access

    char_set: INTEGER
            -- Character set of current font

    clip_precision: INTEGER
            -- Clipping precision.
            -- Define how to clip characters that are
            -- partially outside clipping region.

    escapement: INTEGER
            -- Escapement of current font.
            -- The angle, in tenths of degrees, of each line of
            -- text written in the font (relative to the
            -- bottom of the page).

    face_name: STRING
            -- Face name of current font
        ensure
            result_exists: Result /= void

    family: INTEGER
            -- Family of current font

    height: INTEGER
            -- Height of current font.
            -- Specifies the height, in logical units, of the
            -- font. The font height can be specified in one of
            -- three ways. If height is greater than zero, it
            -- is transformed into device units and matched
            -- against the cell height of the available fonts. If
            -- it is zero, a reasonable default size is used. If
            -- it is less than zero, it is transformed into
            -- device units and the absolute value is matched
            -- against the character height of the available
            -- fonts.

    height_in_points: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)

    italic: BOOLEAN
            -- Is current font italic?

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    orientation: INTEGER
            -- Orientation of current font.
            -- The angle, in tenths of degrees, of each
            -- character's base line (relative to the bottom
            -- of the page).

    out_precision: INTEGER
            -- Output precision of current font.
            -- The output precision defines how closely the output
            -- must match the requested font's height, width,
            -- character orientation, escapement, and pitch.

    pitch: INTEGER
            -- Pitch of current font

    pitch_and_family: INTEGER
            -- Pitch and family of current font

    quality: INTEGER
            -- Quality of current font.
            -- Specifies the output quality. The output quality
            -- defines how carefully the graphics device interface
            -- (GDI) must attempt to match the logical-font
            -- attributes to those of an actual physical font.

    strike_out: BOOLEAN
            -- Is current font striked out?

    underlined: BOOLEAN
            -- Is current font underlined?

    weight: INTEGER
            -- Weight of current font.
            -- In the range 0 through 1000, for example,
            -- 400 is normal and 700 is bold).

    width: INTEGER
            -- Width of current font.
            -- Specifies the average width, in logical units, of
            -- characters in the font. If width is zero, the
            -- aspect ratio of the device is matched against the
            -- digitization aspect ratio of the available fonts to
            -- find the closest match, determined by the absolute
            -- value of the difference.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_ansi_character_set: BOOLEAN
            -- Has current font the ansi character set?

    has_character_clipping_precision: BOOLEAN
            -- Has current font the character clipping precision?

    has_character_output_precision: BOOLEAN
            -- Has current font the character output precision?

    has_default_character_set: BOOLEAN
            -- Has current font the default character set?

    has_default_clipping_precision: BOOLEAN
            -- Has current font the default clipping precision?

    has_default_output_precision: BOOLEAN
            -- Has current font the default output precision?

    has_default_pitch: BOOLEAN
            -- Has current font the default pitch?

    has_default_quality: BOOLEAN
            -- Has current font the default quality?

    has_draft_quality: BOOLEAN
            -- Has current font the draft quality?

    has_fixed_pitch: BOOLEAN
            -- Has current font the fixed pitch?

    has_oem_character_set: BOOLEAN
            -- Has current font the OEM character set?

    has_proof_quality: BOOLEAN
            -- Has current font the proof quality?

    has_string_output_precision: BOOLEAN
            -- Has current font the string output precision?

    has_stroke_clipping_precision: BOOLEAN
            -- Has current font the stroke clipping precision?

    has_stroke_output_precision: BOOLEAN
            -- Has current font the stroke output precision?

    has_symbol_character_set: BOOLEAN
            -- Has current font the symbol character set?

    has_unicode_character_set: BOOLEAN
            -- Has current font the unicode character set?

    has_variable_pitch: BOOLEAN
            -- Has current font the variable pitch?

    is_decorative_family: BOOLEAN
            -- Is current font in the decorative family?

    is_dont_care_family: BOOLEAN
            -- Is current font in the don t care family?

    is_modern_family: BOOLEAN
            -- Is current font in the modern family?

    is_roman_family: BOOLEAN
            -- Is current font in the roman family?

    is_script_family: BOOLEAN
            -- Is current font in the script family?

    is_swiss_family: BOOLEAN
            -- Is current font in the swiss family?

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    max_face_name_length: INTEGER
            -- Maximum face name length

    set_ansi_character_set
            -- Set char_set to ansi.
        ensure
            has_ansi_character_set: has_ansi_character_set

    set_char_set (a_char_set: INTEGER)
            -- Set char_set to a_char_set.
        ensure
            char_set_set: char_set = a_char_set

    set_character_clipping_precision
            -- Set clip_precision to character clipping precision.
        ensure
            has_character_clipping_precision: has_character_clipping_precision

    set_character_output_precision
            -- Set out_precision to character precision.
        ensure
            has_character_output_precision: has_character_output_precision

    set_clip_precision (a_precision: INTEGER)
            -- Set clip_precision to a_precision.
        ensure
            clip_precision_set: clip_precision = a_precision

    set_decorative_family
            -- Set family to decorative family.
        ensure
            is_decorative_family: is_decorative_family

    set_default_character_set
            -- Set char_set to the default value.
        ensure
            has_default_character_set: has_default_character_set

    set_default_clipping_precision
            -- Set clip_precision to the default value.
        ensure
            has_default_clipping_precision: has_default_clipping_precision

    set_default_output_precision
            -- Set out_precision to default output precision.
        ensure
            has_default_output_precision: has_default_output_precision

    set_default_pitch
            -- Set pitch to the default value.
        ensure
            has_default_pitch: has_default_pitch

    set_default_quality
            -- Set quality to the default value.
        ensure
            has_default_quality: has_default_quality

    set_dont_care_family
            -- Set family to dont care family.
        ensure
            is_dont_care_family: is_dont_care_family

    set_draft_quality
            -- Set quality to the draft quality.
        ensure
            has_draft_quality: has_draft_quality

    set_escapement (a_escapement: INTEGER)
            -- Set escapement to a_escapement.
        ensure
            escapement_set: escapement = a_escapement

    set_face_name (a_face_name: STRING)
            -- Set face_name to a_face_name.
        require
            a_face_name_not_void: a_face_name /= void
            valid_count: a_face_name.count <= max_face_name_length
        ensure
            face_name_set: face_name.is_equal (a_face_name)

    set_family (a_family: INTEGER)
            -- Set family to a_family.
        ensure
            family_set: family = a_family

    set_fixed_pitch
            -- Set pitch to fixed pitch.
        ensure
            has_fixed_pitch: has_fixed_pitch

    set_height (a_height: INTEGER)
            -- Set height to a_height.
        ensure
            height_set: height = a_height

    set_italic
            -- Set current font italic.
        ensure
            italic: italic

    set_modern_family
            -- Set family to modern family.
        ensure
            is_modern_family: is_modern_family

    set_not_italic
            -- Set current font not italic.
        ensure
            not_italic: not italic

    set_not_strike_out
            -- Set current font not striked out.
        ensure
            not_strike_out: not strike_out

    set_not_underlined
            -- Set current font not underlined.
        ensure
            not_underlined: not underlined

    set_oem_character_set
            -- Set char_set to OEM.
        ensure
            has_oem_character_set: has_oem_character_set

    set_orientation (a_orientation: INTEGER)
            -- Set orientation to a_orientation.
        ensure
            orientation_set: orientation = a_orientation

    set_out_precision (a_precision: INTEGER)
            -- Set out_precision to a_out_precision.
        ensure
            out_precision_set: out_precision = a_precision

    set_pitch (a_pitch: INTEGER)
            -- Set pitch to a_pitch.
        ensure
            pitch_set: pitch = a_pitch

    set_pitch_and_family (a_pitch_and_family: INTEGER)
            -- Set pitch_and_family with a_pitch_and_family.
        ensure
            pitch_and_family_set: pitch_and_family = a_pitch_and_family

    set_proof_quality
            -- Set quality to the proof quality.
        ensure
            has_proof_quality: has_proof_quality

    set_quality (a_quality: INTEGER)
            -- Set quality to a_quality.
        ensure
            quality_set: quality = a_quality

    set_roman_family
            -- Set family to roman family.
        ensure
            is_roman_family: is_roman_family

    set_script_family
            -- Set family to script family.
        ensure
            is_script_family: is_script_family

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_strike_out
            -- Set current font striked out.
        ensure
            strike_out: strike_out

    set_string_output_precision
            -- Set out_precision to string output precision.
        ensure
            has_string_output_precision: has_string_output_precision

    set_stroke_clipping_precision
            -- Set clip_precision to the storke clipping precision.
        ensure
            has_stroke_clipping_precision: has_stroke_clipping_precision

    set_stroke_output_precision
            -- Set out_precision to stroke output precision.
        ensure
            has_stroke_output_precision: has_stroke_output_precision

    set_swiss_family
            -- Set family to swiss family.
        ensure
            is_swiss_family: is_swiss_family

    set_symbol_character_set
            -- Set char_set to symbol.
        ensure
            has_symbol_character_set: has_symbol_character_set

    set_underlined
            -- Set current font underlined.
        ensure
            underlined: underlined

    set_unicode_character_set
            -- Set char_set to unicode.
        ensure
            has_unicode_character_set: has_unicode_character_set

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_variable_pitch
            -- Set pitch to variable pitch.
        ensure
            has_variable_pitch: has_variable_pitch

    set_weight (a_weight: INTEGER)
            -- Set weight to a_weight.
        ensure
            weight_set: weight = a_weight

    set_width (a_width: INTEGER)
            -- Set width to a_width.
        ensure
            width_set: width = a_width

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Re-initialisation

    update_by_font (font: WEL_FONT)
            -- Update object attributes using the information of font.
        require
            font_not_void: font /= void
            font_exists: font.exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LOG_FONT


WEL_LOG_PALETTE Chart

class
    WEL_LOG_PALETTE

General
    cluster: wel.gdi
    description: "Defines the attributes of a palette."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    num_entries: INTEGER
    pal_entry (index: INTEGER): WEL_PALETTE_ENTRY
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER
    version: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_num_entries (a_num_entries: INTEGER)
    set_pal_entry (index: INTEGER; a_pal_entry: WEL_PALETTE_ENTRY)
    set_shared
    set_unshared
    set_version (a_version: INTEGER)


WEL_LOG_PALETTE Flat contracts

indexing
    description: "Defines the attributes of a palette."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LOG_PALETTE

create

    make (a_version, a_num_entries: INTEGER)
            -- Make a logical palette version a_version
            -- with a_num_entries entries
        ensure
            version_set: version = a_version
            num_entries_set: num_entries = a_num_entries

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    num_entries: INTEGER
            -- Number of palette color entries

    pal_entry (index: INTEGER): WEL_PALETTE_ENTRY
            -- Palette entry at index
        require
            index_inf: index >= 0
            index_sup: index < num_entries
        ensure
            result_not_void: Result /= void

    version: INTEGER
            -- Windows version number for the structure
            -- Must be 768 for Windows 3.0 and later

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_num_entries (a_num_entries: INTEGER)
            -- Set num_entries with a_num_entries
        ensure
            num_entries_set: num_entries = a_num_entries

    set_pal_entry (index: INTEGER; a_pal_entry: WEL_PALETTE_ENTRY)
            -- Set a_pal_entry at index
        require
            a_pal_entry_not_void: a_pal_entry /= void

    set_version (a_version: INTEGER)
            -- Set version with a_version
        ensure
            version_set: version = a_version

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LOG_PALETTE


WEL_LOG_PEN Chart

class
    WEL_LOG_PEN

General
    cluster: wel.gdi
    description: "Defines the style, width and color of a pen."
    create: make_by_pen, make

Ancestors
    WEL_PS_CONSTANTS
    WEL_STRUCTURE

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    style: INTEGER
    to_integer: INTEGER
    valid_pen_style_constant (c: INTEGER): BOOLEAN
    width: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_color (a_color: WEL_COLOR_REF)
    set_item (an_item: POINTER)
    set_shared
    set_style (a_style: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)

Constraints
    color not void
    positive width


WEL_LOG_PEN Flat contracts

indexing
    description: "Defines the style, width and color of a pen."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LOG_PEN

create

    make (a_style, a_width: INTEGER; a_color: WEL_COLOR_REF)
            -- Make a log pen using a_style, a_width and
            -- a_color.
            -- See class WEL_PS_CONSTANTS for a_style values.
        require
            valid_pen_style_constant: valid_pen_style_constant (a_style)
            positive_width: a_width >= 0
            color_not_void: a_color /= void
        ensure
            set_style: style = a_style
            set_width: width = a_width
            set_color: color.item = a_color.item

    make_by_pen (pen: WEL_PEN)
            -- Make a log pen using the information of pen.
        require
            pen_not_void: pen /= void
            pen_exists: pen.exists

feature -- Access

    color: WEL_COLOR_REF
            -- Pen color
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    style: INTEGER
            -- Pen style
        ensure
            valid_result: valid_pen_style_constant (Result)

    width: INTEGER
            -- Pen width
        ensure
            positive_result: Result >= 0

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_pen_style_constant (c: INTEGER): BOOLEAN
            -- Is c a valid pen style constant?
            -- (from WEL_PS_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_color (a_color: WEL_COLOR_REF)
            -- Set color with a_color
        require
            a_color_not_void: a_color /= void
        ensure
            set_color: color.item = a_color.item

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_style (a_style: INTEGER)
            -- Set style with a_style
        require
            valid_pen_style_constant: valid_pen_style_constant (a_style)
        ensure
            set_style: style = a_style

    set_width (a_width: INTEGER)
            -- Set width with a_width
        require
            positive_width: a_width >= 0
        ensure
            set_width: width = a_width

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    color_not_void: color /= void
    positive_width: width >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LOG_PEN


WEL_MEMORY_DC Chart

class
    WEL_MEMORY_DC

General
    cluster: wel.gdi
    description: "Memory device context compatible with a given device context or the application's current screen."
    create: make_by_dc, make

Ancestors
    WEL_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_MEMORY_DC Flat contracts

indexing
    description: "Memory device context compatible with a given device context or the application's current screen."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.4 $"

class interface
    WEL_MEMORY_DC

create

    make
            -- Make a memory dc compatible with the application's
            -- current screen.

    make_by_dc (a_dc: WEL_DC)
            -- Make a memory dc compatible with a_dc.
        require
            a_dc_not: a_dc /= void
            a_dc_exists: a_dc.exists

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_MEMORY_DC


WEL_PAINT_DC Chart

class
    WEL_PAINT_DC

General
    cluster: wel.gdi
    description: "Device context used during a Wm_paint message."
    create: make_by_pointer, make

Ancestors
    WEL_DISPLAY_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    paint_struct: WEL_PAINT_STRUCT
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window: WEL_WINDOW
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    quick_release
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_PAINT_DC Flat contracts

indexing
    description: "Device context used during a Wm_paint message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:20 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PAINT_DC

create

    make (a_window: WEL_WINDOW)
            -- Makes a DC associated with a_window
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
        ensure
            window_set: window = a_window

    make_by_pointer (a_window: WEL_WINDOW; a_pointer: POINTER)
            -- Makes a DC associated with a_pointer and a_window
        ensure
            window_set: window = a_window

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    paint_struct: WEL_PAINT_STRUCT
            -- Information about the Wm_paint message

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

    window: WEL_WINDOW
            -- Window associated to the paint dc

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    quick_release
            -- Release the device context
            -- Was declared in WEL_PAINT_DC as synonym of release.
        require -- from WEL_DISPLAY_DC
            exists: exists
            no_selected_pen: not pen_selected
            no_selected_brush: not brush_selected
            no_selected_bitmap: not bitmap_selected
            no_selected_font: not font_selected
        ensure then -- from WEL_DISPLAY_DC
            not_exists: not exists

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context
            -- Was declared in WEL_PAINT_DC as synonym of quick_release.

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_PAINT_DC


WEL_PALETTE Chart

class
    WEL_PALETTE

General
    cluster: wel.gdi
    description: "Logical color palette."
    create: make_by_pointer, make

Ancestors
    WEL_GDI_ANY

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    object_id: INTEGER
    palette_index (i: INTEGER): WEL_COLOR_REF
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_PALETTE Flat contracts

indexing
    description: "Logical color palette."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PALETTE

create

    make (a_log_palette: WEL_LOG_PALETTE)
            -- Create a palette associated to a_log_palette
        require
            a_log_palette_not_void: a_log_palette /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette_index (i: INTEGER): WEL_COLOR_REF
            -- Color number i of the palette
        require
            exists: exists
        ensure
            result_not_void: Result /= void

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PALETTE


WEL_PEN Chart

class
    WEL_PEN

General
    cluster: wel.gdi
    description: "Drawing object used to draw lines and borders."
    create: make_solid, make_indirect, make_by_pointer, make

Ancestors
    WEL_GDI_ANY
    WEL_PS_CONSTANTS

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    log_pen: WEL_LOG_PEN
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER
    valid_pen_style_constant (c: INTEGER): BOOLEAN
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_PEN Flat contracts

indexing
    description: "Drawing object used to draw lines and borders."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PEN

create

    make (a_style, a_width: INTEGER; a_color: WEL_COLOR_REF)
            -- Make a pen using a_style, a_width and a_color.
            -- See class WEL_PS_CONSTANTS for a_style values.
        require
            valid_pen_style_constant: valid_pen_style_constant (a_style)
            positive_width: a_width >= 0
            color_not_void: a_color /= void
        ensure
            pen_created: item /= default_pointer

    make_solid (a_width: INTEGER; a_color: WEL_COLOR_REF)
            -- Make a solid pen using a_width and a_color.
        require
            positive_width: a_width >= 0
            a_color_not_void: a_color /= void
        ensure
            style_set: exists implies style = ps_solid
            width_set: exists implies width = a_width
            color_set: exists implies color.item = a_color.item

    make_indirect (a_log_pen: WEL_LOG_PEN)
            -- Make a pen using a_log_pen.
        require
            a_log_pen_not_void: a_log_pen /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Pen color
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_pen: WEL_LOG_PEN
            -- Log pen structure associated to Current
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    style: INTEGER
            -- Pen style
        require
            exists: exists
        ensure
            valid_result: valid_pen_style_constant (Result)

    width: INTEGER
            -- Pen width
        require
            exists: exists
        ensure
            positive_result: Result >= 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_pen_style_constant (c: INTEGER): BOOLEAN
            -- Is c a valid pen style constant?
            -- (from WEL_PS_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PEN


WEL_PRINTER_DC Chart

class
    WEL_PRINTER_DC

General
    cluster: wel.gdi
    description: "Device context associated to a printer."
    create: make_by_pointer

Ancestors
    WEL_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    abort_document
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    end_document
    end_page
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    start_document (title: STRING)
    start_document_info (doc_info: WEL_DOC_INFO)
    start_page
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_PRINTER_DC Flat contracts

indexing
    description: "Device context associated to a printer."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PRINTER_DC

create

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    abort_document
            -- Stops the current print job and erases everything
            -- drawn since the last call to start_doc.
        require
            exists: exists

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    end_document
            -- End the job on the printer.
        require
            exists: exists

    end_page
            -- Informs the device that the application has
            -- finished writing to a page. This procedure is
            -- typically used to direct the device driver to
            -- advance to a new page.
        require
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    start_document (title: STRING)
            -- Start the job title on the printer.
        require
            exists: exists
            title_not_void: title /= void

    start_document_info (doc_info: WEL_DOC_INFO)
            -- Start the job using information from doc_info.
        require
            exists: exists
            doc_info_not_void: doc_info /= void

    start_page
            -- Prepare the printer driver to accept data.
        require
            exists: exists

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_PRINTER_DC


WEL_REGION Chart

class
    WEL_REGION

General
    cluster: wel.gdi
    description: "A region is a rectangle, polygon, or ellipse (or a combination of two or more of these shapes) that can be filled, painted, inverted, framed, and used to perform hit testing."
    create: make_empty, make_by_pointer, make_elliptic_indirect, make_rect, make_rect_indirect, make_elliptic, make_polygon_winding, make_polygon_alternate

Ancestors
    WEL_GDI_ANY

Queries
    combine (region: WEL_REGION; mode: INTEGER): WEL_REGION
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    is_equal (other: [like Current] WEL_REGION): BOOLEAN
    item: POINTER
    object_id: INTEGER
    point_in (x, y: INTEGER): BOOLEAN
    rect_in (rect: WEL_RECT): BOOLEAN
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    offset (x_offset, y_offset: INTEGER)
    set_item (an_item: POINTER)
    set_rect (left, top, right, bottom: INTEGER)
    set_shared
    set_unshared


WEL_REGION Flat contracts

indexing
    description: "A region is a rectangle, polygon, or ellipse (or a combination of two or more of these shapes) that can be filled, painted, inverted, framed, and used to perform hit testing."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_REGION

create

    make_empty
            -- Make an empty rectangle region

    make_elliptic (left, top, right, bottom: INTEGER)
            -- Make an elliptical region specified by the
            -- bounding rectangle left, top, right, bottom

    make_elliptic_indirect (rect: WEL_RECT)
            -- Make an elliptical region specified by
            -- the bounding rectangle rect
        require
            rect_not_void: rect /= void

    make_polygon_alternate (points: ARRAY [INTEGER])
            -- Make a polygonal region specified by points
            -- using alternate mode. Fills area between
            -- odd-numbered and even-numbered polygon sides
            -- on each scan line.
        require
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    make_polygon_winding (points: ARRAY [INTEGER])
            -- Make a polygonal region specified by points
            -- using winding mode. Fills any region with a nonzero
            -- winding value.
        require
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    make_rect (left, top, right, bottom: INTEGER)
            -- Make a rectangle region specified by
            -- left, top, right, bottom.

    make_rect_indirect (rect: WEL_RECT)
            -- Make a rectangle region specified by
            -- the rectangle rect.
        require
            rect_not_void: rect /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is Current equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    point_in (x, y: INTEGER): BOOLEAN
            -- Is the point x, y is in the region?
        require
            exists: exists

    rect_in (rect: WEL_RECT): BOOLEAN
            -- Is any part of the rectangle rect is within
            -- the boundaries of the region?
        require
            exists: exists
            rect_not_void: rect /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    combine (region: WEL_REGION; mode: INTEGER): WEL_REGION
            -- Combine region with the current one using mode.
            -- See class WEL_RGN_CONSTANTS for mode values.
        require
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists
        ensure
            result_not_void: Result /= void

    offset (x_offset, y_offset: INTEGER)
            -- Move the region by the specified offsets
            -- x_offset and y_offset
        require
            exists: exists

    set_rect (left, top, right, bottom: INTEGER)
            -- Change the region to a rectangle region specified
            -- by left, top, right, bottom
        require
            exists: exists

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REGION


WEL_SCREEN_DC Chart

class
    WEL_SCREEN_DC

General
    cluster: wel.gdi
    description: "Screen device context."

Ancestors
    WEL_DISPLAY_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    quick_release
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_SCREEN_DC Flat contracts

indexing
    description: "Screen device context."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SCREEN_DC

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    quick_release
            -- Release the device context
        require -- from WEL_DISPLAY_DC
            exists: exists
            no_selected_pen: not pen_selected
            no_selected_brush: not brush_selected
            no_selected_bitmap: not bitmap_selected
            no_selected_font: not font_selected
        ensure then -- from WEL_DISPLAY_DC
            not_exists: not exists

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_SCREEN_DC


WEL_STANDARD_COLORS Chart

class
    WEL_STANDARD_COLORS

General
    cluster: wel.gdi
    description: "Definition of the sixteen standard colors."

Ancestors
    ANY

Queries
    Black: WEL_COLOR_REF
    Blue: WEL_COLOR_REF
    Cyan: WEL_COLOR_REF
    Dark_blue: WEL_COLOR_REF
    Dark_cyan: WEL_COLOR_REF
    Dark_green: WEL_COLOR_REF
    Dark_grey: WEL_COLOR_REF
    Dark_magenta: WEL_COLOR_REF
    Dark_red: WEL_COLOR_REF
    Dark_yellow: WEL_COLOR_REF
    Green: WEL_COLOR_REF
    Grey: WEL_COLOR_REF
    Magenta: WEL_COLOR_REF
    Red: WEL_COLOR_REF
    White: WEL_COLOR_REF
    Yellow: WEL_COLOR_REF


WEL_STANDARD_COLORS Flat contracts

indexing
    description: "Definition of the sixteen standard colors."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STANDARD_COLORS

feature -- Access

    black: WEL_COLOR_REF
            -- Black color
        ensure
            result_not_void: Result /= void

    blue: WEL_COLOR_REF
            -- Blue color
        ensure
            result_not_void: Result /= void

    cyan: WEL_COLOR_REF
            -- Cyan color
        ensure
            result_not_void: Result /= void

    dark_blue: WEL_COLOR_REF
            -- Dark blue color
        ensure
            result_not_void: Result /= void

    dark_cyan: WEL_COLOR_REF
            -- Dark cyan color
        ensure
            result_not_void: Result /= void

    dark_green: WEL_COLOR_REF
            -- Dark green color
        ensure
            result_not_void: Result /= void

    dark_grey: WEL_COLOR_REF
            -- Dark grey color
        ensure
            result_not_void: Result /= void

    dark_magenta: WEL_COLOR_REF
            -- Dark magenta color
        ensure
            result_not_void: Result /= void

    dark_red: WEL_COLOR_REF
            -- Dark red color
        ensure
            result_not_void: Result /= void

    dark_yellow: WEL_COLOR_REF
            -- Dark yellow color
        ensure
            result_not_void: Result /= void

    green: WEL_COLOR_REF
            -- Green color
        ensure
            result_not_void: Result /= void

    grey: WEL_COLOR_REF
            -- Grey color
        ensure
            result_not_void: Result /= void

    magenta: WEL_COLOR_REF
            -- Magenta color
        ensure
            result_not_void: Result /= void

    red: WEL_COLOR_REF
            -- Red color
        ensure
            result_not_void: Result /= void

    white: WEL_COLOR_REF
            -- White color
        ensure
            result_not_void: Result /= void

    yellow: WEL_COLOR_REF
            -- Yellow color
        ensure
            result_not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STANDARD_COLORS


WEL_STANDARD_PENS Chart

class
    WEL_STANDARD_PENS

General
    cluster: wel.gdi
    description: "Definition of the sixteen standard pens."

Ancestors
    WEL_PS_CONSTANTS
    WEL_STANDARD_COLORS

Queries
    Black_pen: WEL_PEN
    Blue_pen: WEL_PEN
    Cyan_pen: WEL_PEN
    Dark_blue_pen: WEL_PEN
    Dark_cyan_pen: WEL_PEN
    Dark_green_pen: WEL_PEN
    Dark_grey_pen: WEL_PEN
    Dark_magenta_pen: WEL_PEN
    Dark_red_pen: WEL_PEN
    Dark_yellow_pen: WEL_PEN
    Green_pen: WEL_PEN
    Grey_pen: WEL_PEN
    Magenta_pen: WEL_PEN
    Red_pen: WEL_PEN
    White_pen: WEL_PEN
    Yellow_pen: WEL_PEN


WEL_STANDARD_PENS Flat contracts

indexing
    description: "Definition of the sixteen standard pens."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STANDARD_PENS

feature -- Access

    black_pen: WEL_PEN
            -- Black pen
        ensure
            result_not_void: Result /= void

    blue_pen: WEL_PEN
            -- Blue pen
        ensure
            result_not_void: Result /= void

    cyan_pen: WEL_PEN
            -- Cyan pen
        ensure
            result_not_void: Result /= void

    dark_blue_pen: WEL_PEN
            -- Dark blue pen
        ensure
            result_not_void: Result /= void

    dark_cyan_pen: WEL_PEN
            -- Dark cyan pen
        ensure
            result_not_void: Result /= void

    dark_green_pen: WEL_PEN
            -- Dark green pen
        ensure
            result_not_void: Result /= void

    dark_grey_pen: WEL_PEN
            -- Dark grey pen
        ensure
            result_not_void: Result /= void

    dark_magenta_pen: WEL_PEN
            -- Dark magenta pen
        ensure
            result_not_void: Result /= void

    dark_red_pen: WEL_PEN
            -- Dark red pen
        ensure
            result_not_void: Result /= void

    dark_yellow_pen: WEL_PEN
            -- Dark yellow pen
        ensure
            result_not_void: Result /= void

    green_pen: WEL_PEN
            -- Green pen
        ensure
            result_not_void: Result /= void

    grey_pen: WEL_PEN
            -- Grey pen
        ensure
            result_not_void: Result /= void

    magenta_pen: WEL_PEN
            -- Magenta pen
        ensure
            result_not_void: Result /= void

    red_pen: WEL_PEN
            -- Red pen
        ensure
            result_not_void: Result /= void

    white_pen: WEL_PEN
            -- White pen
        ensure
            result_not_void: Result /= void

    yellow_pen: WEL_PEN
            -- Yellow pen
        ensure
            result_not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STANDARD_PENS


WEL_SYSTEM_COLORS Chart

class
    WEL_SYSTEM_COLORS

General
    cluster: wel.gdi
    description: "Definition of the system colors."

Ancestors
    WEL_CONSTANTS

Queries
    system_color_3dface: WEL_COLOR_REF
    system_color_3dhighlight: WEL_COLOR_REF
    system_color_3dhilight: WEL_COLOR_REF
    system_color_3dshadow: WEL_COLOR_REF
    system_color_activeborder: WEL_COLOR_REF
    system_color_activecaption: WEL_COLOR_REF
    system_color_appworkspace: WEL_COLOR_REF
    system_color_background: WEL_COLOR_REF
    system_color_btnface: WEL_COLOR_REF
    system_color_btnhighlight: WEL_COLOR_REF
    system_color_btnhilight: WEL_COLOR_REF
    system_color_btnshadow: WEL_COLOR_REF
    system_color_btntext: WEL_COLOR_REF
    system_color_captiontext: WEL_COLOR_REF
    system_color_desktop: WEL_COLOR_REF
    system_color_graytext: WEL_COLOR_REF
    system_color_highlight: WEL_COLOR_REF
    system_color_highlighttext: WEL_COLOR_REF
    system_color_inactiveborder: WEL_COLOR_REF
    system_color_inactivecaption: WEL_COLOR_REF
    system_color_inactivecaptiontext: WEL_COLOR_REF
    system_color_menu: WEL_COLOR_REF
    system_color_menutext: WEL_COLOR_REF
    system_color_scrollbar: WEL_COLOR_REF
    system_color_window: WEL_COLOR_REF
    system_color_windowframe: WEL_COLOR_REF
    system_color_windowtext: WEL_COLOR_REF


WEL_SYSTEM_COLORS Flat contracts

indexing
    description: "Definition of the system colors."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_SYSTEM_COLORS

feature -- Access

    system_color_3dface: WEL_COLOR_REF
            -- Face color for three-dimensional display elements and
            -- for dialog box backgrounds.
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_btnface.
        ensure
            result_exists: Result /= void

    system_color_3dhighlight: WEL_COLOR_REF
            -- Highlight color for three-dimensional display elements
            -- (for edges facing the light source.)
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_btnhighlight, system_color_btnhilight and system_color_3dhilight.
        ensure
            result_exists: Result /= void

    system_color_3dhilight: WEL_COLOR_REF
            -- Highlight color for three-dimensional display elements
            -- (for edges facing the light source.)
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_btnhighlight, system_color_btnhilight and system_color_3dhighlight.
        ensure
            result_exists: Result /= void

    system_color_3dshadow: WEL_COLOR_REF
            -- Shadow color for three-dimensional display elements
            -- (for edges facing away from the light source).
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_btnshadow.
        ensure
            result_exists: Result /= void

    system_color_activeborder: WEL_COLOR_REF
            -- Color for active window border.
        ensure
            result_exists: Result /= void

    system_color_activecaption: WEL_COLOR_REF
            -- Color for active window title bar.
            --
            -- Windows 98, Windows 2000: Specifies the left side color in the
            -- color gradient of an active window's title bar if the gradient
            -- effect is enabled.
        ensure
            result_exists: Result /= void

    system_color_appworkspace: WEL_COLOR_REF
            -- Background color of multiple document interface
            -- (MDI) applications.
        ensure
            result_exists: Result /= void

    system_color_background: WEL_COLOR_REF
            -- Color of the desktop
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_desktop.
        ensure
            result_exists: Result /= void

    system_color_btnface: WEL_COLOR_REF
            -- Face color for three-dimensional display elements and
            -- for dialog box backgrounds.
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_3dface.
        ensure
            result_exists: Result /= void

    system_color_btnhighlight: WEL_COLOR_REF
            -- Highlight color for three-dimensional display elements
            -- (for edges facing the light source.)
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_btnhilight, system_color_3dhighlight and system_color_3dhilight.
        ensure
            result_exists: Result /= void

    system_color_btnhilight: WEL_COLOR_REF
            -- Highlight color for three-dimensional display elements
            -- (for edges facing the light source.)
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_btnhighlight, system_color_3dhighlight and system_color_3dhilight.
        ensure
            result_exists: Result /= void

    system_color_btnshadow: WEL_COLOR_REF
            -- Shadow color for three-dimensional display elements
            -- (for edges facing away from the light source).
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_3dshadow.
        ensure
            result_exists: Result /= void

    system_color_btntext: WEL_COLOR_REF
            -- Color of text on push buttons.
        ensure
            result_exists: Result /= void

    system_color_captiontext: WEL_COLOR_REF
            -- Color for text in caption, size box, and
            -- scroll bar arrow box.
        ensure
            result_exists: Result /= void

    system_color_desktop: WEL_COLOR_REF
            -- Color of the desktop
            -- Was declared in WEL_SYSTEM_COLORS as synonym of system_color_background.
        ensure
            result_exists: Result /= void

    system_color_graytext: WEL_COLOR_REF
            -- Color for grayed (disabled) text.
        ensure
            result_exists: Result /= void

    system_color_highlight: WEL_COLOR_REF
            -- Color for item(s) selected in a control.
        ensure
            result_exists: Result /= void

    system_color_highlighttext: WEL_COLOR_REF
            -- Color for text of item(s) selected in a control.
        ensure
            result_exists: Result /= void

    system_color_inactiveborder: WEL_COLOR_REF
            -- Color for inactive window border.
        ensure
            result_exists: Result /= void

    system_color_inactivecaption: WEL_COLOR_REF
            -- Color for inactive window caption.
            --
            -- Windows 98, Windows 2000: Specifies the left side color in the
            -- color gradient of an inactive window's title bar if the gradient
            -- effect is enabled.
        ensure
            result_exists: Result /= void

    system_color_inactivecaptiontext: WEL_COLOR_REF
            -- Color of text in an inactive caption.
        ensure
            result_exists: Result /= void

    system_color_menu: WEL_COLOR_REF
            -- background color for menus.
        ensure
            result_exists: Result /= void

    system_color_menutext: WEL_COLOR_REF
            -- Color for text in menus.
        ensure
            result_exists: Result /= void

    system_color_scrollbar: WEL_COLOR_REF
            -- Color for the scroll bar gray area.
        ensure
            result_exists: Result /= void

    system_color_window: WEL_COLOR_REF
            -- background for windows.
        ensure
            result_exists: Result /= void

    system_color_windowframe: WEL_COLOR_REF
            -- Color for window frame.
        ensure
            result_exists: Result /= void

    system_color_windowtext: WEL_COLOR_REF
            -- Color for text in windows.
        ensure
            result_exists: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SYSTEM_COLORS


WEL_WINDOW_DC Chart

class
    WEL_WINDOW_DC

General
    cluster: wel.gdi
    description: "Window's area device context."
    create: make_by_pointer, make

Ancestors
    WEL_DISPLAY_DC

Queries
    background_color: WEL_COLOR_REF
    bitmap: WEL_BITMAP
    bitmap_selected: BOOLEAN
    brush: WEL_BRUSH
    brush_selected: BOOLEAN
    device_caps (capability: INTEGER): INTEGER
    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
    exists: BOOLEAN
    font: WEL_FONT
    font_selected: BOOLEAN
    height: INTEGER
    is_opaque: BOOLEAN
    is_transparent: BOOLEAN
    item: POINTER
    map_mode: INTEGER
    Mask_blt_supported: BOOLEAN
    object_id: INTEGER
    palette: WEL_PALETTE
    palette_selected: BOOLEAN
    pen: WEL_PEN
    pen_selected: BOOLEAN
    pixel_color (x, y: INTEGER): WEL_COLOR_REF
    polygon_fill_mode: INTEGER
    position: WEL_POINT
    reference_tracked: BOOLEAN
    references_count: INTEGER
    region: WEL_REGION
    region_selected: BOOLEAN
    rop2: INTEGER
    shared: BOOLEAN
    stretch_blt_mode: INTEGER
    string_height (s: STRING): INTEGER
    string_size (s: STRING): WEL_SIZE
    string_width (s: STRING): INTEGER
    tabbed_text_height (text: STRING): INTEGER
    tabbed_text_size (text: STRING): WEL_SIZE
    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
    tabbed_text_width (text: STRING): INTEGER
    text_alignment: INTEGER
    text_color: WEL_COLOR_REF
    text_face: STRING
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN
    valid_extent_map_mode (mode: INTEGER): BOOLEAN
    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
    valid_map_mode_constant (c: INTEGER): BOOLEAN
    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
    valid_rop2_constant (c: INTEGER): BOOLEAN
    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
    valid_text_alignment_constant (c: INTEGER): BOOLEAN
    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
    viewport_extent: WEL_SIZE
    viewport_origin: WEL_POINT
    width: INTEGER
    window: WEL_WINDOW
    window_extent: WEL_SIZE
    window_origin: WEL_POINT

Commands
    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
    decrement_reference
    delete
    dispose
    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
    draw_centered_text (string: STRING; rect: WEL_RECT)
    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    draw_edge (a_rect: WEL_RECT; edge_type, edge_border: INTEGER)
    draw_frame_control (a_rect: WEL_RECT; control_type, control_state: INTEGER)
    draw_icon (icon: WEL_ICON; x, y: INTEGER)
    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y, format: INTEGER)
    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y, format: INTEGER)
    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y, format: INTEGER)
    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
    ellipse (left, top, right, bottom: INTEGER)
    enable_reference_tracking
    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
    get
    increment_reference
    invert_rect (a_rect: WEL_RECT)
    invert_region (a_region: WEL_REGION)
    line (x1, y1, x2, y2: INTEGER)
    line_to (x, y: INTEGER)
    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
    move_to (x, y: INTEGER)
    pat_blt (x_destination, y_destination, a_width, a_height, raster_operation: INTEGER)
    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
    poly_bezier (points: ARRAY [INTEGER])
    poly_bezier_to (points: ARRAY [INTEGER])
    polygon (points: ARRAY [INTEGER])
    polyline (points: ARRAY [INTEGER])
    quick_release
    realize_palette
    rectangle (left, top, right, bottom: INTEGER)
    release
    remove_clip_region
    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
    select_bitmap (a_bitmap: WEL_BITMAP)
    select_brush (a_brush: WEL_BRUSH)
    select_clip_region (a_region: WEL_REGION)
    select_font (a_font: WEL_FONT)
    select_palette (a_palette: WEL_PALETTE)
    select_pen (a_pen: WEL_PEN)
    select_region (a_region: WEL_REGION)
    set_background_color (color: WEL_COLOR_REF)
    set_background_opaque
    set_background_transparent
    set_hv_text_alignment (h, v: INTEGER)
    set_item (an_item: POINTER)
    set_map_mode (mode: INTEGER)
    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
    set_polygon_fill_mode (mode: INTEGER)
    set_rop2 (a_rop2: INTEGER)
    set_shared
    set_stretch_blt_mode (a_mode: INTEGER)
    set_text_alignment (an_alignment: INTEGER)
    set_text_color (color: WEL_COLOR_REF)
    set_unshared
    set_viewport_extent (x_extent, y_extent: INTEGER)
    set_viewport_origin (x_origin, y_origin: INTEGER)
    set_window_extent (x_extent, y_extent: INTEGER)
    set_window_origin (x_origin, y_origin: INTEGER)
    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
    text_out (x, y: INTEGER; string: STRING)
    unselect_all
    unselect_bitmap
    unselect_brush
    unselect_font
    unselect_palette
    unselect_pen
    unselect_region


WEL_WINDOW_DC Flat contracts

indexing
    description: "Window's area device context."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOW_DC

create

    make (a_window: WEL_WINDOW)
            -- Makes a DC associated with a_window
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
        ensure
            window_set: window = a_window

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    bitmap: WEL_BITMAP
            -- Current bitmap selected.
            -- (from WEL_DC)

    brush: WEL_BRUSH
            -- Current brush selected.
            -- (from WEL_DC)

    font: WEL_FONT
            -- Current font selected.
            -- (from WEL_DC)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette: WEL_PALETTE
            -- Current palette selected.
            -- (from WEL_DC)

    pen: WEL_PEN
            -- Current pen selected.
            -- (from WEL_DC)

    region: WEL_REGION
            -- Current region selected.
            -- (from WEL_DC)

    window: WEL_WINDOW
            -- Window associated with the dc

feature -- Status report

    background_color: WEL_COLOR_REF
            -- Current color of the background.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    bitmap_selected: BOOLEAN
            -- Is a bitmap selected?
            -- (from WEL_DC)

    brush_selected: BOOLEAN
            -- Is a brush selected?
            -- (from WEL_DC)

    device_caps (capability: INTEGER): INTEGER
            -- Give device-specific information about
            -- the current display device.
            -- See class WEL_CAPABILITIES_CONSTANTS for
            -- capability values and results.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    font_selected: BOOLEAN
            -- Is a font selected?
            -- (from WEL_DC)

    height: INTEGER
            -- Height of screen (in raster lines).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_opaque: BOOLEAN
            -- Is the background mode opaque?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    is_transparent: BOOLEAN
            -- Is the background mode transparent?
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    map_mode: INTEGER
            -- Current mapping mode
            -- See class WEL_MM_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (Result)

    mask_blt_supported: BOOLEAN
            -- (from WEL_DC)

    palette_selected: BOOLEAN
            -- Is a palette selected?
            -- (from WEL_DC)

    pen_selected: BOOLEAN
            -- Is a pen selected?
            -- (from WEL_DC)

    pixel_color (x, y: INTEGER): WEL_COLOR_REF
            -- Color located at x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    polygon_fill_mode: INTEGER
            -- Current polygon fill mode
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (Result)

    position: WEL_POINT
            -- Current position in logical coordinates.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_exists: Result /= void

    region_selected: BOOLEAN
            -- Is a region selected?
            -- (from WEL_DC)

    rop2: INTEGER
            -- Current drawing mode.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_result: valid_rop2_constant (Result)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    stretch_blt_mode: INTEGER
            -- Current stretching mode. The stretching mode
            -- defines how color data is added to or removed from
            -- bitmaps that are stretched or compressed when
            -- stretch_blt is called.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            valid_stretch_mode: valid_stretch_mode_constant (Result)

    string_height (s: STRING): INTEGER
            -- Height of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    string_size (s: STRING): WEL_SIZE
            -- Size of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            result_exists: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    string_width (s: STRING): INTEGER
            -- Width of the string s using the selected font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            s_exists: s /= void
        ensure -- from WEL_DC
            positive_result: Result >= 0

    tabbed_text_height (text: STRING): INTEGER
            -- Height of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_height: Result >= 0

    tabbed_text_size (text: STRING): WEL_SIZE
            -- Size of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_size_with_tabulation (text: STRING; tabulations: ARRAY [INTEGER]): WEL_SIZE
            -- Size of a tabbed text, with tabulations as
            -- tabulation positions.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
            tabulations_not_void: tabulations /= void
        ensure -- from WEL_DC
            result_not_void: Result /= void
            positive_width: Result.width >= 0
            positive_height: Result.height >= 0

    tabbed_text_width (text: STRING): INTEGER
            -- Width of a tabbed text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            text_not_void: text /= void
        ensure -- from WEL_DC
            positive_width: Result >= 0

    text_alignment: INTEGER
            -- Current text alignment flags.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    text_color: WEL_COLOR_REF
            -- Current color of the text.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    text_face: STRING
            -- Typeface name of the font that is currently selected.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    valid_extent_map_mode (mode: INTEGER): BOOLEAN
            -- Is mode a valid window or viewport extent map mode?
            -- (from WEL_DC)
        require -- from WEL_DC
            valid_map_mode: valid_map_mode_constant (mode)

    viewport_extent: WEL_SIZE
            -- Retrieve the size of the current viewport for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    viewport_origin: WEL_POINT
            -- Viewport origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the screen (in pixels).
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    window_extent: WEL_SIZE
            -- Window extent for the dc
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

    window_origin: WEL_POINT
            -- Window origin for the dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            result_not_void: Result /= void

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

    valid_htext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for horizontal positioning?
            -- (from WEL_TA_CONSTANTS)

    valid_map_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid map mode constant?
            -- (from WEL_MM_CONSTANTS)

    valid_polygon_fill_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid polygon fill mode constant?
            -- (from WEL_POLYGON_FILL_MODE_CONSTANTS)

    valid_rop2_constant (c: INTEGER): BOOLEAN
            -- Is c a valid rop2 constant?
            -- (from WEL_DRAWING_CONSTANTS)

    valid_stretch_mode_constant (c: INTEGER): BOOLEAN
            -- Is c a valid stretch mode constant?
            -- (from WEL_STRETCH_MODE_CONSTANTS)

    valid_text_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant?
            -- (from WEL_TA_CONSTANTS)

    valid_vtext_alignment_constant (c: INTEGER): BOOLEAN
            -- Is c a valid text alignment constant for vertical positioning?
            -- (from WEL_TA_CONSTANTS)

feature -- Status setting

    select_bitmap (a_bitmap: WEL_BITMAP)
            -- Select the a_bitmap as the current bitmap.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
        ensure -- from WEL_DC
            bitmap_set: bitmap = a_bitmap
            bitmap_selected: bitmap_selected

    select_brush (a_brush: WEL_BRUSH)
            -- Select the a_brush as the current brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists
        ensure -- from WEL_DC
            brush_set: brush = a_brush
            brush_selected: brush_selected

    select_font (a_font: WEL_FONT)
            -- Select the a_font as the current font.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_DC
            font_set: font = a_font
            font_selected: font_selected

    select_palette (a_palette: WEL_PALETTE)
            -- Select the a_palette as the current palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_palette_not_void: a_palette /= void
            a_palette_exists: a_palette.exists

    select_pen (a_pen: WEL_PEN)
            -- Select the a_pen as the current pen.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_pen_not_void: a_pen /= void
            a_pen_exists: a_pen.exists
        ensure -- from WEL_DC
            pen_set: pen = a_pen
            pen_selected: pen_selected

    select_region (a_region: WEL_REGION)
            -- Select the a_region as the current region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists
        ensure -- from WEL_DC
            region_set: region = a_region
            region_selected: region_selected

    set_background_color (color: WEL_COLOR_REF)
            -- Set the background_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: background_color.item = color.item

    set_background_opaque
            -- Set the background mode to opaque.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_opaque: is_opaque

    set_background_transparent
            -- Set the background mode to transparent.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            is_transparent: is_transparent

    set_hv_text_alignment (h, v: INTEGER)
            -- Set the text alignment using the horizontal and
            -- vertical components in h and v.
            -- See class WEL_TA_CONSTANTS for valid alignments.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_horizontal_alignment: valid_htext_alignment_constant (h)
            valid_vertical_alignment: valid_vtext_alignment_constant (v)
        ensure -- from WEL_DC
            text_alignments_set: flag_set (text_alignment, h) and flag_set (text_alignment, v)

    set_map_mode (mode: INTEGER)
            -- Set the mapping mode mode of the device context.
            -- See class WEL_MM_CONSTANTS for mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_map_mode: valid_map_mode_constant (mode)
        ensure -- from WEL_DC
            map_mode_set: map_mode = mode

    set_polygon_fill_mode (mode: INTEGER)
            -- Set the polygon fill mode polygon_fill_mode with
            -- mode.
            -- See class WEL_POLYGON_FILL_MODE_CONSTANTS for
            -- mode values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_polygon_fill_mode: valid_polygon_fill_mode_constant (mode)
        ensure -- from WEL_DC
            polygon_fill_mode_set: polygon_fill_mode = mode

    set_rop2 (a_rop2: INTEGER)
            -- Set the current foreground mix mode. GDI uses the
            -- foreground mix mode to combine pens and interiors of
            -- filled objects with the colors already on the screen.
            -- The foreground mix mode defines how colors from the
            -- brush or pen and the colors in the existing image
            -- are to be combined.
            -- For a_rop2 values, see class WEL_ROP2_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rop2_constant: valid_rop2_constant (a_rop2)
        ensure -- from WEL_DC
            rop2_set: rop2 = a_rop2

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_stretch_blt_mode (a_mode: INTEGER)
            -- Set the bitmap stretching mode with a_mode.
            -- See class WEL_STRETCH_MODE_CONSTANTS for a_mode
            -- values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_stretch_mode_constant: valid_stretch_mode_constant (a_mode)
        ensure -- from WEL_DC
            stretch_blt_mode_set: stretch_blt_mode = a_mode

    set_text_alignment (an_alignment: INTEGER)
            -- Set the text alignment with an_alignment.
            -- See class WEL_TA_CONSTANTS for an_alignment.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_alignment: valid_text_alignment_constant (an_alignment)
        ensure -- from WEL_DC
            text_alignment_set: flag_set (text_alignment, an_alignment)

    set_text_color (color: WEL_COLOR_REF)
            -- Set the text_color to color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void
        ensure -- from WEL_DC
            color_set: text_color.item = color.item

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_viewport_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.width = x_extent
            y_viewport_extent_set: map_mode /= mm_isotropic implies viewport_extent.height = y_extent

    set_viewport_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the viewport
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_viewport_origin_set: viewport_origin.x = x_origin
            y_viewport_origin_set: viewport_origin.y = y_origin

    set_window_extent (x_extent, y_extent: INTEGER)
            -- Set the x_extent and y_extent of the window
            -- associated with the device context.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_current_map_mode: valid_extent_map_mode (map_mode)
        ensure -- from WEL_DC
            x_window_extent_set: map_mode /= mm_isotropic implies window_extent.width = x_extent
            y_window_extent_set: map_mode /= mm_isotropic implies window_extent.height = y_extent

    set_window_origin (x_origin, y_origin: INTEGER)
            -- Set the x_origin and y_origin of the window
            -- associated with the device context
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            x_window_origin_set: window_origin.x = x_origin
            y_window_origin_set: window_origin.y = y_origin

    unselect_all
            -- Deselect all objects and restore the old ones.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected
            brush_not_selected: not brush_selected
            region_not_selected: not region_selected
            palette_not_selected: not palette_selected
            font_not_selected: not font_selected
            bitmap_not_selected: not bitmap_selected

    unselect_bitmap
            -- Deselect the bitmap and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            bitmap_selected: bitmap_selected
        ensure -- from WEL_DC
            bitmap_not_selected: not bitmap_selected

    unselect_brush
            -- Deselect the brush and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            brush_selected: brush_selected
        ensure -- from WEL_DC
            brush_not_selected: not brush_selected

    unselect_font
            -- Deselect the font and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            font_selected: font_selected
        ensure -- from WEL_DC
            font_not_selected: not font_selected

    unselect_palette
            -- Deselect the palette and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected
        ensure -- from WEL_DC
            palette_not_selected: not palette_selected

    unselect_pen
            -- Deselect the pen and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            pen_selected: pen_selected
        ensure -- from WEL_DC
            pen_not_selected: not pen_selected

    unselect_region
            -- Deselect the region and restore the old one.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            region_selected: region_selected
        ensure -- from WEL_DC
            region_not_selected: not region_selected

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arc (left, top, right, bottom, x_start_arc, y_start_arc, x_end_arc, y_end_arc: INTEGER)
            -- Draw an elliptical arc into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_arc, y_start_arc and ending at
            -- x_end_arc, y_end_arc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    bit_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using a_width and a_height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    chord (left, top, right, bottom, x_start_line, y_start_line, x_end_line, y_end_line: INTEGER)
            -- Draw a chord into a rectangle specified
            -- by left, top and right, bottom, starting
            -- at x_start_line, y_start_line and ending at
            -- x_end_line, y_end_line.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    copy_dc (dc_source: WEL_DC; rect: WEL_RECT)
            -- Copy the content of rect in dc_source
            -- to the current dc.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            rect_not_void: rect /= void
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    di_bits (a_bitmap: WEL_BITMAP; start_scan, scan_lines: INTEGER; bitmap_info: WEL_BITMAP_INFO; usage: INTEGER): ARRAY [CHARACTER]
            -- Device-independent bits of a_bitmap.
            -- start_scan specifies the first scan line to
            -- retrieve and scan_lines specifies the number of
            -- scan lines to retrieve. bitmap_info specifies the
            -- desired format for the dib data.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            positive_start_scan: start_scan >= 0
            positive_scan_lines: scan_lines >= 0
            bitmap_info_not_void: bitmap_info /= void
            valid_usage: valid_dib_colors_constant (usage)
        ensure -- from WEL_DC
            result_not_void: Result /= void
            consistent_count: Result.count = bitmap_info.header.size_image

    draw_bitmap (a_bitmap: WEL_BITMAP; x, y, a_width, a_height: INTEGER)
            -- Draw bitmap at the x, y position
            -- using a_width and a_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists

    draw_centered_text (string: STRING; rect: WEL_RECT)
            -- Draw the text string centered in rect.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_cursor (cursor: WEL_CURSOR; x, y: INTEGER)
            -- Draw cursor at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            cursor_not_void: cursor /= void
            cursor_exists: cursor.exists

    draw_disabled_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string in disabled mode inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_edge (a_rect: WEL_RECT; edge_type: INTEGER; edge_border: INTEGER)
            -- Draw one or more edges depending on edge_type using the borders
            -- type edge_border in the bounding rectangle a_rect.
            --
            -- edge_type is a combination of the flags BDR_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- edge_type is a combination of the flags BF_xxxx and EDGE_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_frame_control (a_rect: WEL_RECT; control_type: INTEGER; control_state: INTEGER)
            -- Draws a frame control of the type control_type with the style
            -- control_state.
            --
            -- control_type is a combination of the flags DFC_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            --
            -- control_state is a combination of the flags DFCS_xxxx
            -- as found in WEL_DRAWING_CONSTANTS.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            valid_rect: a_rect /= void and then a_rect.exists

    draw_icon (icon: WEL_ICON; x, y: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_icon_ex (icon: WEL_ICON; x, y, icon_width, icon_height, frame_index: INTEGER; flicker_free_background: WEL_BRUSH; di_flags: INTEGER)
            -- Draw icon at the x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            icon_not_void: icon /= void
            icon_exists: icon.exists

    draw_state_bitmap (a_brush: WEL_BRUSH; a_bitmap: WEL_BITMAP; x, y: INTEGER; format: INTEGER)
            -- Draw the bitmap a_bitmap using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void

    draw_state_icon (a_brush: WEL_BRUSH; an_icon: WEL_GRAPHICAL_RESOURCE; x, y: INTEGER; format: INTEGER)
            -- Draw the icon/cursor an_icon using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            an_icon_not_void: an_icon /= void

    draw_state_text (a_brush: WEL_BRUSH; string: STRING; x, y: INTEGER; format: INTEGER)
            -- Draw the text string using format at the
            -- location (x,y) using the brush a_brush if format include Dss_mono.
            --
            -- See class DSS_xxx and DST_xxx constants in WEL_DRAWING_CONSTANTS for
            -- format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

    draw_text (string: STRING; rect: WEL_RECT; format: INTEGER)
            -- Draw the text string inside
            -- the rect using format
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    draw_text_with_result (string: STRING; rect: WEL_RECT; format: INTEGER): INTEGER
            -- Draw the text string inside the rect using format.
            -- Return the height of the text drawn.
            -- See class WEL_DT_CONSTANTS for format value.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            rect_not_void: rect /= void

    ellipse (left, top, right, bottom: INTEGER)
            -- Draw an ellipse into a rectangle specified by
            -- left, top and right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    fill_rect (a_rect: WEL_RECT; a_brush: WEL_BRUSH)
            -- Fill a a_rect using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    fill_region (a_region: WEL_REGION; a_brush: WEL_BRUSH)
            -- Fill a_region using a_brush.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_brush_not_void: a_brush /= void
            a_brush_exists: a_brush.exists

    flood_fill_border (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is bounded by color starting
            -- at x, y.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    flood_fill_surface (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Fill an area which is defined by color starting
            -- at x, y. Filling continues outward in all
            -- directions as long as the color is encountered.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    get
            -- Get the device context

    invert_rect (a_rect: WEL_RECT)
            -- Invert a_rect in a window by performing a logical
            -- NOT operation on the color values for each pixel.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_rect_not_void: a_rect /= void

    invert_region (a_region: WEL_REGION)
            -- Invert the colors in a_region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    line (x1, y1, x2, y2: INTEGER)
            -- Draw a line from x1, y1 to x2, y2.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    line_to (x, y: INTEGER)
            -- Draw a line from the current position
            -- to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    mask_blt (x_destination, y_destination, a_width, a_height: INTEGER; dc_source: WEL_DC; x_source, y_source: INTEGER; mask_bitmap: WEL_BITMAP; x_mask, y_mask, raster_operation: INTEGER)
            -- Combines the color data for the source and destination bitmaps using the specified mask and raster operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists
            mask_bitmap_not_void: mask_bitmap /= void
            function_is_supported: mask_blt_supported

    move_to (x, y: INTEGER)
            -- Set the current position to x, y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    pat_blt (x_destination, y_destination, a_width, a_height: INTEGER; raster_operation: INTEGER)
            -- Paint the rectangle specified by x_destination,
            -- y_destination, a_width, a_height using the brush
            -- that is currently selected into this device context.
            -- The brush color and the surface color or colors are
            -- combined by using the raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0

    pie (left, top, right, bottom, x_start_point, y_start_point, x_end_point, y_end_point: INTEGER)
            -- Draw a pie-shaped wedge by drawing an elliptical
            -- arc whose center and two endpoints are joined
            -- by lines. The pie is drawn into a rectangle
            -- specified by left, top and right, bottom,
            -- starting at x_start_point, y_start_point
            -- and ending at x_end_point, y_end_point.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    poly_bezier (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the
            -- endpoints and control points specified by points.
            -- The first curve is drawn from the first point to the
            -- fourth point by using the second and third points as
            -- control points. Each subsequent curve in the sequence
            -- needs exactly three more points: the ending point of
            -- the previous curve is used as the starting point, the
            -- next two points in the sequence are control points,
            -- and the third is the ending point.
            -- The current position is neither used nor updated by
            -- this procedure.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    poly_bezier_to (points: ARRAY [INTEGER])
            -- Draw one or more Bezier curves by using the control
            -- points specified by points. The first curve is
            -- drawn from the current position to the third point
            -- by using the first two points as control points.
            -- For each subsequent curve, the procedure needs
            -- exactly three more points, and uses the ending point
            -- of the previous curve as the starting point for the
            -- next.
            -- This procedure moves the current position to the
            -- ending point of the last Bezier curve.
            -- (from WEL_DC)
        require -- from WEL_DC
            points_not_void: points /= void
            points_count_ok: points.count \\ 2 = 0

    polygon (points: ARRAY [INTEGER])
            -- Draw a polygon consisting of two or more points
            -- connected by lines.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    polyline (points: ARRAY [INTEGER])
            -- Draws a series of line segments by connecting the
            -- points specified in points.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            points_not_void: points /= void
            points_count: points.count \\ 2 = 0

    quick_release
            -- Release the device context
            -- Call this feature only if you are sure
            -- that no object is selected in the device
            -- context. Otherwise, use release instead.
        require -- from WEL_DISPLAY_DC
            exists: exists
            no_selected_pen: not pen_selected
            no_selected_brush: not brush_selected
            no_selected_bitmap: not bitmap_selected
            no_selected_font: not font_selected
        ensure then -- from WEL_DISPLAY_DC
            not_exists: not exists

    realize_palette
            -- Map palette entries from the current logical
            -- palette on the system palette.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            palette_selected: palette_selected

    rectangle (left, top, right, bottom: INTEGER)
            -- Draw a rectangle from left, top
            -- to right, bottom.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    release
            -- Release the device context

    remove_clip_region
            -- Remove the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    round_rect (left, top, right, bottom, ellipse_width, ellipse_height: INTEGER)
            -- Draw a rectangle from left, top to
            -- right, bottom with rounded corners.
            -- The rounded corners are specified by the
            -- ellipse_width and ellipse_height.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists

    save_bitmap (a_bitmap: WEL_BITMAP; file: FILE_NAME)
            -- Save a_bitmap in file.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_bitmap_not_void: a_bitmap /= void
            a_bitmap_exists: a_bitmap.exists
            file_not_void: file /= void
            file_is_valid: file.is_valid

    select_clip_region (a_region: WEL_REGION)
            -- Select a_region as the current clipping region.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            a_region_not_void: a_region /= void
            a_region_exists: a_region.exists

    set_pixel (x, y: INTEGER; color: WEL_COLOR_REF)
            -- Set the pixel at x, y position.
            -- with the color color.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            color_not_void: color /= void

    stretch_blt (x_destination, y_destination, width_destination, height_destination: INTEGER; dc_source: WEL_DC; x_source, y_source, width_source, height_source, raster_operation: INTEGER)
            -- Copy a bitmap from the dc_source to
            -- the current device context, from x_source,
            -- y_source to x_destination, y_destination,
            -- using width and height with raster_operation.
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width_destination: width_destination >= 0
            positive_height_destination: height_destination >= 0
            positive_width_source: width_source >= 0
            positive_height_source: height_source >= 0
            dc_source_not_void: dc_source /= void
            dc_source_exists: dc_source.exists

    stretch_di_bits (x_destination, y_destination, a_width, a_height, x_source, y_source, dib_width, dib_height: INTEGER; dib: WEL_DIB; bitmap_info: WEL_BITMAP_INFO; rgb_mode, raster_operation: INTEGER)
            -- Copy a dib to the current device context, from
            -- x_source, y_source to x_destination,
            -- y_destination, using a_width and a_height
            -- with raster_operation and rgb_mode
            -- See class WEL_RASTER_OPERATIONS_CONSTANTS for
            -- raster_operation values
            -- See class WEL_DIB_COLORS_CONSTANTS for
            -- rgb_mode values
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            positive_width: a_width >= 0
            positive_height: a_height >= 0
            dib_not_void: dib /= void
            bitmap_not_void: bitmap_info /= void
            valid_rgb_mode: valid_dib_colors_constant (rgb_mode)

    tabbed_text_out (x, y: INTEGER; string: STRING; tabulations: ARRAY [INTEGER]; tabulations_origin: INTEGER)
            -- Write string on x and y position expanding
            -- tabs to the values specified in tabulations.
            -- tabulations_origin specifies the x-coordinate of
            -- the starting position from which tabs are expanded.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void
            tabulations_not_void: tabulations /= void

    text_out (x, y: INTEGER; string: STRING)
            -- Write string on x and y position.
            -- (from WEL_DC)
        require -- from WEL_DC
            exists: exists
            string_not_void: string /= void

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_DC
    valid_background_mode: exists implies is_opaque /= is_transparent

end -- class WEL_WINDOW_DC


cluster wel.gdistock

Cluster
    wel.gdistock

Supercluster
    wel

Classes
    WEL_ANSI_FIXED_FONT
    WEL_ANSI_VARIABLE_FONT
    WEL_BLACK_BRUSH
    WEL_BLACK_PEN
    WEL_DARK_GRAY_BRUSH
    WEL_DEFAULT_GUI_FONT
    WEL_DEFAULT_PALETTE
    WEL_DEVICE_DEFAULT_FONT
    WEL_GDI_STOCK
    WEL_GRAY_BRUSH
    WEL_HOLLOW_BRUSH
    WEL_LIGHT_GRAY_BRUSH
    WEL_NULL_BRUSH
    WEL_NULL_PEN
    WEL_OEM_FIXED_FONT
    WEL_SYSTEM_FIXED_FONT
    WEL_SYSTEM_FONT
    WEL_WHITE_BRUSH
    WEL_WHITE_PEN


WEL_ANSI_FIXED_FONT Chart

class
    WEL_ANSI_FIXED_FONT

General
    cluster: wel.gdistock
    description: "Ansi fixed font."
    create: make

Ancestors
    WEL_FONT
    WEL_GDI_STOCK

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_ANSI_FIXED_FONT Flat contracts

indexing
    description: "Ansi fixed font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ANSI_FIXED_FONT

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
            -- (from WEL_FONT)
        ensure -- from WEL_FONT
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
            -- (from WEL_FONT)
        require -- from WEL_FONT
            exists
        ensure -- from WEL_FONT
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)
            -- (from WEL_FONT)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.
            -- (from WEL_FONT)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.
            -- (from WEL_FONT)

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.
            -- (from WEL_FONT)

    width: INTEGER
            -- Character width of current fixed-width font.
            -- (from WEL_FONT)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ANSI_FIXED_FONT


WEL_ANSI_VARIABLE_FONT Chart

class
    WEL_ANSI_VARIABLE_FONT

General
    cluster: wel.gdistock
    description: "Ansi variable font."
    create: make

Ancestors
    WEL_FONT
    WEL_GDI_STOCK

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_ANSI_VARIABLE_FONT Flat contracts

indexing
    description: "Ansi variable font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ANSI_VARIABLE_FONT

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
            -- (from WEL_FONT)
        ensure -- from WEL_FONT
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
            -- (from WEL_FONT)
        require -- from WEL_FONT
            exists
        ensure -- from WEL_FONT
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)
            -- (from WEL_FONT)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.
            -- (from WEL_FONT)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.
            -- (from WEL_FONT)

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.
            -- (from WEL_FONT)

    width: INTEGER
            -- Character width of current fixed-width font.
            -- (from WEL_FONT)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ANSI_VARIABLE_FONT


WEL_BLACK_BRUSH Chart

class
    WEL_BLACK_BRUSH

General
    cluster: wel.gdistock
    description: "Black brush."
    create: make

Ancestors
    WEL_BRUSH
    WEL_GDI_STOCK

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_BLACK_BRUSH Flat contracts

indexing
    description: "Black brush."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BLACK_BRUSH

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BLACK_BRUSH


WEL_BLACK_PEN Chart

class
    WEL_BLACK_PEN

General
    cluster: wel.gdistock
    description: "Black pen."
    create: make

Ancestors
    WEL_GDI_STOCK
    WEL_PEN

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    log_pen: WEL_LOG_PEN
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER
    valid_pen_style_constant (c: INTEGER): BOOLEAN
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_BLACK_PEN Flat contracts

indexing
    description: "Black pen."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BLACK_PEN

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Pen color
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_pen: WEL_LOG_PEN
            -- Log pen structure associated to Current
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            result_not_void: Result /= void

    style: INTEGER
            -- Pen style
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            valid_result: valid_pen_style_constant (Result)

    width: INTEGER
            -- Pen width
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            positive_result: Result >= 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_pen_style_constant (c: INTEGER): BOOLEAN
            -- Is c a valid pen style constant?
            -- (from WEL_PS_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BLACK_PEN


WEL_DARK_GRAY_BRUSH Chart

class
    WEL_DARK_GRAY_BRUSH

General
    cluster: wel.gdistock
    description: "Dark gray brush."
    create: make

Ancestors
    WEL_BRUSH
    WEL_GDI_STOCK

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_DARK_GRAY_BRUSH Flat contracts

indexing
    description: "Dark gray brush."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DARK_GRAY_BRUSH

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DARK_GRAY_BRUSH


WEL_DEFAULT_GUI_FONT Chart

class
    WEL_DEFAULT_GUI_FONT

General
    cluster: wel.gdistock
    description: "Default GUI font (default font to draw dialogs)."
    create: make

Ancestors
    WEL_FONT
    WEL_GDI_STOCK

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_DEFAULT_GUI_FONT Flat contracts

indexing
    description: "Default GUI font (default font to draw dialogs)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DEFAULT_GUI_FONT

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
            -- (from WEL_FONT)
        ensure -- from WEL_FONT
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
            -- (from WEL_FONT)
        require -- from WEL_FONT
            exists
        ensure -- from WEL_FONT
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)
            -- (from WEL_FONT)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.
            -- (from WEL_FONT)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.
            -- (from WEL_FONT)

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.
            -- (from WEL_FONT)

    width: INTEGER
            -- Character width of current fixed-width font.
            -- (from WEL_FONT)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DEFAULT_GUI_FONT


WEL_DEFAULT_PALETTE Chart

class
    WEL_DEFAULT_PALETTE

General
    cluster: wel.gdistock
    description: "Default color palette. This palette consists of the static colors in the system palette."
    create: make

Ancestors
    WEL_GDI_STOCK
    WEL_PALETTE

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    object_id: INTEGER
    palette_index (i: INTEGER): WEL_COLOR_REF
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_DEFAULT_PALETTE Flat contracts

indexing
    description: "Default color palette. This palette consists of the static colors in the system palette."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DEFAULT_PALETTE

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    palette_index (i: INTEGER): WEL_COLOR_REF
            -- Color number i of the palette
            -- (from WEL_PALETTE)
        require -- from WEL_PALETTE
            exists: exists
        ensure -- from WEL_PALETTE
            result_not_void: Result /= void

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DEFAULT_PALETTE


WEL_DEVICE_DEFAULT_FONT Chart

class
    WEL_DEVICE_DEFAULT_FONT

General
    cluster: wel.gdistock
    description: "Device-dependent default font."
    create: make

Ancestors
    WEL_FONT
    WEL_GDI_STOCK

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_DEVICE_DEFAULT_FONT Flat contracts

indexing
    description: "Device-dependent default font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DEVICE_DEFAULT_FONT

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
            -- (from WEL_FONT)
        ensure -- from WEL_FONT
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
            -- (from WEL_FONT)
        require -- from WEL_FONT
            exists
        ensure -- from WEL_FONT
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)
            -- (from WEL_FONT)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.
            -- (from WEL_FONT)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.
            -- (from WEL_FONT)

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.
            -- (from WEL_FONT)

    width: INTEGER
            -- Character width of current fixed-width font.
            -- (from WEL_FONT)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DEVICE_DEFAULT_FONT


WEL_GDI_STOCK Chart

deferred class
    WEL_GDI_STOCK

General
    cluster: wel.gdistock
    description: "System-predefined GDI object."

Ancestors
    WEL_GDI_ANY
    WEL_STOCK_CONSTANTS

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_GDI_STOCK Flat contracts

indexing
    description: "System-predefined GDI object."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_GDI_STOCK

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GDI_STOCK


WEL_GRAY_BRUSH Chart

class
    WEL_GRAY_BRUSH

General
    cluster: wel.gdistock
    description: "Gray brush."
    create: make

Ancestors
    WEL_BRUSH
    WEL_GDI_STOCK

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_GRAY_BRUSH Flat contracts

indexing
    description: "Gray brush."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_GRAY_BRUSH

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GRAY_BRUSH


WEL_HOLLOW_BRUSH Chart

class
    WEL_HOLLOW_BRUSH

General
    cluster: wel.gdistock
    description: "Hollow brush."
    create: make

Ancestors
    WEL_BRUSH
    WEL_GDI_STOCK

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_HOLLOW_BRUSH Flat contracts

indexing
    description: "Hollow brush."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HOLLOW_BRUSH

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HOLLOW_BRUSH


WEL_LIGHT_GRAY_BRUSH Chart

class
    WEL_LIGHT_GRAY_BRUSH

General
    cluster: wel.gdistock
    description: "Light gray brush."
    create: make

Ancestors
    WEL_BRUSH
    WEL_GDI_STOCK

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_LIGHT_GRAY_BRUSH Flat contracts

indexing
    description: "Light gray brush."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LIGHT_GRAY_BRUSH

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LIGHT_GRAY_BRUSH


WEL_NULL_BRUSH Chart

class
    WEL_NULL_BRUSH

General
    cluster: wel.gdistock
    description: "Null brush."
    create: make

Ancestors
    WEL_BRUSH
    WEL_GDI_STOCK

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NULL_BRUSH Flat contracts

indexing
    description: "Null brush."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NULL_BRUSH

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NULL_BRUSH


WEL_NULL_PEN Chart

class
    WEL_NULL_PEN

General
    cluster: wel.gdistock
    description: "Null pen."
    create: make

Ancestors
    WEL_GDI_STOCK
    WEL_PEN

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    log_pen: WEL_LOG_PEN
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER
    valid_pen_style_constant (c: INTEGER): BOOLEAN
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NULL_PEN Flat contracts

indexing
    description: "Null pen."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NULL_PEN

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Pen color
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_pen: WEL_LOG_PEN
            -- Log pen structure associated to Current
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            result_not_void: Result /= void

    style: INTEGER
            -- Pen style
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            valid_result: valid_pen_style_constant (Result)

    width: INTEGER
            -- Pen width
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            positive_result: Result >= 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_pen_style_constant (c: INTEGER): BOOLEAN
            -- Is c a valid pen style constant?
            -- (from WEL_PS_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NULL_PEN


WEL_OEM_FIXED_FONT Chart

class
    WEL_OEM_FIXED_FONT

General
    cluster: wel.gdistock
    description: "OEM fixed font."
    create: make

Ancestors
    WEL_FONT
    WEL_GDI_STOCK

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_OEM_FIXED_FONT Flat contracts

indexing
    description: "OEM fixed font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_OEM_FIXED_FONT

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
            -- (from WEL_FONT)
        ensure -- from WEL_FONT
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
            -- (from WEL_FONT)
        require -- from WEL_FONT
            exists
        ensure -- from WEL_FONT
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)
            -- (from WEL_FONT)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.
            -- (from WEL_FONT)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.
            -- (from WEL_FONT)

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.
            -- (from WEL_FONT)

    width: INTEGER
            -- Character width of current fixed-width font.
            -- (from WEL_FONT)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_OEM_FIXED_FONT


WEL_SYSTEM_FIXED_FONT Chart

class
    WEL_SYSTEM_FIXED_FONT

General
    cluster: wel.gdistock
    description: "System fixed font."
    create: make

Ancestors
    WEL_FONT
    WEL_GDI_STOCK

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_SYSTEM_FIXED_FONT Flat contracts

indexing
    description: "System fixed font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SYSTEM_FIXED_FONT

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
            -- (from WEL_FONT)
        ensure -- from WEL_FONT
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
            -- (from WEL_FONT)
        require -- from WEL_FONT
            exists
        ensure -- from WEL_FONT
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)
            -- (from WEL_FONT)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.
            -- (from WEL_FONT)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.
            -- (from WEL_FONT)

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.
            -- (from WEL_FONT)

    width: INTEGER
            -- Character width of current fixed-width font.
            -- (from WEL_FONT)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SYSTEM_FIXED_FONT


WEL_SYSTEM_FONT Chart

class
    WEL_SYSTEM_FONT

General
    cluster: wel.gdistock
    description: "System font."
    create: make

Ancestors
    WEL_FONT
    WEL_GDI_STOCK

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    height: INTEGER
    item: POINTER
    log_font: WEL_LOG_FONT
    object_id: INTEGER
    point: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    string_height (a_string: STRING): INTEGER
    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
    string_width (a_string: STRING): INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_height (a_height: INTEGER)
    set_indirect (a_log_font: WEL_LOG_FONT)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_SYSTEM_FONT Flat contracts

indexing
    description: "System font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SYSTEM_FONT

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    height: INTEGER
            -- Size of font measured in pixels.
            -- (from WEL_FONT)
        ensure -- from WEL_FONT
            result_bigger_than_zero: Result > 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Log font structure associated to Current
            -- (from WEL_FONT)
        require -- from WEL_FONT
            exists
        ensure -- from WEL_FONT
            result_not_void: Result /= void

    point: INTEGER
            -- Size of font in points (1 point = 1/72 of an inch)
            -- (from WEL_FONT)

    string_height (a_string: STRING): INTEGER
            -- Height of a_string.
            -- (from WEL_FONT)

    string_size (a_string: STRING): TUPLE [INTEGER, INTEGER]
            -- [width, height] of a_string.
            -- (from WEL_FONT)

    string_width (a_string: STRING): INTEGER
            -- Width of a_string.
            -- (from WEL_FONT)

    width: INTEGER
            -- Character width of current fixed-width font.
            -- (from WEL_FONT)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Re-initialisation

    set_indirect (a_log_font: WEL_LOG_FONT)
            -- Reset the current font the 'a_log_font' without
            -- creating new object
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_log_font_not_void: a_log_font /= void

feature -- Setting

    set_height (a_height: INTEGER)
            -- Set height with a_height.
            -- (from WEL_FONT)
        require -- from WEL_FONT
            a_height_bigger_than_zero: a_height > 0

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SYSTEM_FONT


WEL_WHITE_BRUSH Chart

class
    WEL_WHITE_BRUSH

General
    cluster: wel.gdistock
    description: "White brush."
    create: make

Ancestors
    WEL_BRUSH
    WEL_GDI_STOCK

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    hatch: INTEGER
    item: POINTER
    log_brush: WEL_LOG_BRUSH
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_WHITE_BRUSH Flat contracts

indexing
    description: "White brush."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WHITE_BRUSH

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Brush color
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    hatch: INTEGER
            -- Brush hatch
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_brush: WEL_LOG_BRUSH
            -- Log brush structure associated to Current
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists
        ensure -- from WEL_BRUSH
            result_not_void: Result /= void

    style: INTEGER
            -- Brush style
            -- (from WEL_BRUSH)
        require -- from WEL_BRUSH
            exists: exists

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WHITE_BRUSH


WEL_WHITE_PEN Chart

class
    WEL_WHITE_PEN

General
    cluster: wel.gdistock
    description: "White pen."
    create: make

Ancestors
    WEL_GDI_STOCK
    WEL_PEN

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    item: POINTER
    log_pen: WEL_LOG_PEN
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    style: INTEGER
    to_integer: INTEGER
    valid_pen_style_constant (c: INTEGER): BOOLEAN
    width: INTEGER

Commands
    decrement_reference
    delete
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_WHITE_PEN Flat contracts

indexing
    description: "White pen."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WHITE_PEN

create

    make
            -- Make a gdi stock object identified by stock_id.
            -- (from WEL_GDI_STOCK)
        ensure -- from WEL_GDI_STOCK
            exists: exists
            shared: shared

feature -- Access

    color: WEL_COLOR_REF
            -- Pen color
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            result_not_void: Result /= void

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_pen: WEL_LOG_PEN
            -- Log pen structure associated to Current
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            result_not_void: Result /= void

    style: INTEGER
            -- Pen style
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            valid_result: valid_pen_style_constant (Result)

    width: INTEGER
            -- Pen width
            -- (from WEL_PEN)
        require -- from WEL_PEN
            exists: exists
        ensure -- from WEL_PEN
            positive_result: Result >= 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_pen_style_constant (c: INTEGER): BOOLEAN
            -- Is c a valid pen style constant?
            -- (from WEL_PS_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WHITE_PEN


cluster wel.messages

Cluster
    wel.messages

Supercluster
    wel

Classes
    WEL_COMMAND_MESSAGE
    WEL_KEY_MESSAGE
    WEL_MENU_SELECT_MESSAGE
    WEL_MESSAGE_INFORMATION
    WEL_MOUSE_MESSAGE
    WEL_MOVE_MESSAGE
    WEL_NOTIFY_MESSAGE
    WEL_SHOW_WINDOW_MESSAGE
    WEL_SIZE_MESSAGE
    WEL_SYSTEM_COMMAND_MESSAGE
    WEL_TIMER_MESSAGE
    WEL_WINDOW_POSITION_MESSAGE


WEL_COMMAND_MESSAGE Chart

class
    WEL_COMMAND_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_command which is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION
    WEL_WINDOW_MANAGER

Queries
    control: WEL_CONTROL
    from_accelerator: BOOLEAN
    from_control: BOOLEAN
    from_menu: BOOLEAN
    h_window: POINTER
    id: INTEGER
    l_param: INTEGER
    message: INTEGER
    notify_code: INTEGER
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_COMMAND_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_command which is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMMAND_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    control: WEL_CONTROL
            -- Control sending the message if the message is from a
            -- control.
        require
            from_control: from_control

    h_window: POINTER
            -- Handle of control

    id: INTEGER
            -- Identifier of the menu item, control, or accelerator.

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    notify_code: INTEGER
            -- Notification message

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

feature -- Status report

    from_accelerator: BOOLEAN
            -- Does the message come from an accelerator?

    from_control: BOOLEAN
            -- Does the message come from a control?

    from_menu: BOOLEAN
            -- Does the message come from a menu?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMMAND_MESSAGE


WEL_KEY_MESSAGE Chart

class
    WEL_KEY_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_char, Wm_syschar, Wm_keydown, Wm_keyup, Wm_syskeydown, Wm_syskeyup. These messages are sent when a key is pressed."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION

Queries
    code: INTEGER
    data: INTEGER
    l_param: INTEGER
    message: INTEGER
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_KEY_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_char, Wm_syschar, Wm_keydown, Wm_keyup, Wm_syskeydown, Wm_syskeyup. These messages are sent when a key is pressed."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_KEY_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    code: INTEGER
            -- Character code of the key
            -- See class WEL_VK_CONSTANTS for different values.

    data: INTEGER
            -- Key data

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_KEY_MESSAGE


WEL_MENU_SELECT_MESSAGE Chart

class
    WEL_MENU_SELECT_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_menuselect which is sent to a menu's owner window when the user highlights a menu item."
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_MESSAGE_INFORMATION
    WEL_MF_CONSTANTS

Queries
    checked: BOOLEAN
    disabled: BOOLEAN
    flags: INTEGER
    grayed: BOOLEAN
    h_menu: POINTER
    highlighted: BOOLEAN
    is_bitmap: BOOLEAN
    is_popup: BOOLEAN
    is_system_menu: BOOLEAN
    item: INTEGER
    l_param: INTEGER
    menu: WEL_MENU
    menu_exists: BOOLEAN
    message: INTEGER
    mouse_selected: BOOLEAN
    owner_drawn: BOOLEAN
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_MENU_SELECT_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_menuselect which is sent to a menu's owner window when the user highlights a menu item."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MENU_SELECT_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    flags: INTEGER
            -- Menu flags

    h_menu: POINTER
            -- Handle of menu clicked

    item: INTEGER
            -- Menu item

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    menu: WEL_MENU
            -- Menu clicked
        require
            menu_exists: menu_exists

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

feature -- Status report

    checked: BOOLEAN
            -- Is the item checked?

    disabled: BOOLEAN
            -- Is the item disabled?

    grayed: BOOLEAN
            -- Is the item grayed?

    highlighted: BOOLEAN
            -- Is the item highlighted?

    is_bitmap: BOOLEAN
            -- Is the item a bitmap?

    is_popup: BOOLEAN
            -- Is the item a popup menu?

    is_system_menu: BOOLEAN
            -- Is the item contained in the system menu?

    menu_exists: BOOLEAN
            -- Does the menu exist?

    mouse_selected: BOOLEAN
            -- Is the item selected with the mouse?

    owner_drawn: BOOLEAN
            -- Is the item owner-drawn?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MENU_SELECT_MESSAGE


WEL_MESSAGE_INFORMATION Chart

class
    WEL_MESSAGE_INFORMATION

General
    cluster: wel.messages
    description: "Generic message information."
    create: make

Ancestors
    WEL_WORD_OPERATIONS

Queries
    l_param: INTEGER
    message: INTEGER
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_MESSAGE_INFORMATION Flat contracts

indexing
    description: "Generic message information."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MESSAGE_INFORMATION

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
        ensure
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
        ensure
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.

    window: WEL_WINDOW
            -- Window which receives message

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MESSAGE_INFORMATION


WEL_MOUSE_MESSAGE Chart

class
    WEL_MOUSE_MESSAGE

General
    cluster: wel.messages
    description: "Information about messages Wm_mousemove, Wm_lbuttondown, Wm_mbuttondown, Wm_rbuttondown, Wm_lbuttonup, Wm_mbuttonup, Wm_rbuttonup, Wm_lbuttondblclk, Wm_mbuttondblclk, Wm_rbuttondblclk. Theses message are sent when the user clicks on the mouse."
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_MESSAGE_INFORMATION
    WEL_MK_CONSTANTS

Queries
    control_down: BOOLEAN
    keys: INTEGER
    l_param: INTEGER
    left_button_down: BOOLEAN
    message: INTEGER
    middle_button_down: BOOLEAN
    right_button_down: BOOLEAN
    shift_down: BOOLEAN
    w_param: INTEGER
    window: WEL_WINDOW
    x: INTEGER
    y: INTEGER

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_MOUSE_MESSAGE Flat contracts

indexing
    description: "Information about messages Wm_mousemove, Wm_lbuttondown, Wm_mbuttondown, Wm_rbuttondown, Wm_lbuttonup, Wm_mbuttonup, Wm_rbuttonup, Wm_lbuttondblclk, Wm_mbuttondblclk, Wm_rbuttondblclk. Theses message are sent when the user clicks on the mouse."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MOUSE_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    keys: INTEGER
            -- Keys flags.
            -- See class WEL_MK_CONSTANTS for different values.

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

    x: INTEGER
            -- Horizontal position of cursor

    y: INTEGER
            -- Vertical position of cursor

feature -- Status report

    control_down: BOOLEAN
            -- Is the CTRL key down?

    left_button_down: BOOLEAN
            -- Is the left mouse button down?

    middle_button_down: BOOLEAN
            -- Is the middle mouse button down?

    right_button_down: BOOLEAN
            -- Is the right mouse button down?

    shift_down: BOOLEAN
            -- Is the SHIFT key down?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MOUSE_MESSAGE


WEL_MOVE_MESSAGE Chart

class
    WEL_MOVE_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_move which is sent after a window has been moved."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION

Queries
    l_param: INTEGER
    message: INTEGER
    w_param: INTEGER
    window: WEL_WINDOW
    x: INTEGER
    y: INTEGER

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_MOVE_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_move which is sent after a window has been moved."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MOVE_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

    x: INTEGER
            -- x-coordinate of the upper-left corner of the client
            -- area of the window

    y: INTEGER
            -- y-coordinate of the upper-left corner of the client
            -- area of the window

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MOVE_MESSAGE


WEL_NOTIFY_MESSAGE Chart

class
    WEL_NOTIFY_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_notify which informs the parent window of a control that an event has occurred in the control or that the control requires some kind of information."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION

Queries
    id: INTEGER
    l_param: INTEGER
    message: INTEGER
    nmhdr: WEL_NMHDR
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_NOTIFY_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_notify which informs the parent window of a control that an event has occurred in the control or that the control requires some kind of information."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NOTIFY_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    id: INTEGER
            -- Identifier of the control sending the message

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    nmhdr: WEL_NMHDR
            -- Information about the notification
        ensure
            result_not_void: Result /= void

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NOTIFY_MESSAGE


WEL_SHOW_WINDOW_MESSAGE Chart

class
    WEL_SHOW_WINDOW_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_showwindow which is when a window is about to be hidden or shown."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION
    WEL_SW_CONSTANTS

Queries
    l_param: INTEGER
    message: INTEGER
    parent_closing: BOOLEAN
    parent_opening: BOOLEAN
    shown: BOOLEAN
    status: INTEGER
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_SHOW_WINDOW_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_showwindow which is when a window is about to be hidden or shown."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SHOW_WINDOW_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    status: INTEGER
            -- Status of the window being shown.
            -- See class WEL_SW_CONSTANTS for differents values.

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

feature -- Status report

    parent_closing: BOOLEAN
            -- Is window's owner window being minimized?

    parent_opening: BOOLEAN
            -- Is window's owner window being restored?

    shown: BOOLEAN
            -- Is the window being shown?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SHOW_WINDOW_MESSAGE


WEL_SIZE_MESSAGE Chart

class
    WEL_SIZE_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_size which is sent to a window after its size has changed."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION
    WEL_SIZE_CONSTANTS

Queries
    height: INTEGER
    l_param: INTEGER
    maximized: BOOLEAN
    message: INTEGER
    minimized: BOOLEAN
    restored: BOOLEAN
    size_type: INTEGER
    w_param: INTEGER
    width: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_SIZE_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_size which is sent to a window after its size has changed."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SIZE_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    height: INTEGER
            -- New height of the client area

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    size_type: INTEGER
            -- Type of resizing requested.
            -- See class WEL_SIZE_CONSTANTS for different values.

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    width: INTEGER
            -- New width of the client area

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

feature -- Status report

    maximized: BOOLEAN
            -- Has the window been maximized?

    minimized: BOOLEAN
            -- Has the window been minimized?

    restored: BOOLEAN
            -- Has the window been restored?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SIZE_MESSAGE


WEL_SYSTEM_COMMAND_MESSAGE Chart

class
    WEL_SYSTEM_COMMAND_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_syscommand which is sent when the user chooses a command from the System menu (also known as Control menu) or when the user chooses the Maximize button or Minimize button."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION
    WEL_SC_CONSTANTS

Queries
    is_arrange: BOOLEAN
    is_close: BOOLEAN
    is_horizontal_scroll: BOOLEAN
    is_hot_key: BOOLEAN
    is_key_menu: BOOLEAN
    is_maximize: BOOLEAN
    is_minimize: BOOLEAN
    is_mouse_menu: BOOLEAN
    is_move: BOOLEAN
    is_next_window: BOOLEAN
    is_previous_window: BOOLEAN
    is_restore: BOOLEAN
    is_screen_save: BOOLEAN
    is_size: BOOLEAN
    is_task_list: BOOLEAN
    is_vertical_scroll: BOOLEAN
    l_param: INTEGER
    message: INTEGER
    type: INTEGER
    w_param: INTEGER
    window: WEL_WINDOW
    x: INTEGER
    y: INTEGER

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_SYSTEM_COMMAND_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_syscommand which is sent when the user chooses a command from the System menu (also known as Control menu) or when the user chooses the Maximize button or Minimize button."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SYSTEM_COMMAND_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    type: INTEGER
            -- Type of system command requested.
            -- See class WEL_SC_CONSTANTS for different values.

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

    x: INTEGER
            -- Horizontal position in screen coordinates

    y: INTEGER
            -- Vertical position in screen coordinates

feature -- Status report

    is_arrange: BOOLEAN
            -- Is the command type "Arrange"?

    is_close: BOOLEAN
            -- Is the command type "Close"?

    is_horizontal_scroll: BOOLEAN
            -- Is the command type "Horizontal scroll"?

    is_hot_key: BOOLEAN
            -- Is the command type "Hot key"?

    is_key_menu: BOOLEAN
            -- Is the command type "Key menu"?

    is_maximize: BOOLEAN
            -- Is the command type "Maximize"?

    is_minimize: BOOLEAN
            -- Is the command type "Minimize"?

    is_mouse_menu: BOOLEAN
            -- Is the command type "Mouse menu"?

    is_move: BOOLEAN
            -- Is the command type "Move"?

    is_next_window: BOOLEAN
            -- Is the command type "Next window"?

    is_previous_window: BOOLEAN
            -- Is the command type "Previous window"?

    is_restore: BOOLEAN
            -- Is the command type "Restore"?

    is_screen_save: BOOLEAN
            -- Is the command type "Screen save"?

    is_size: BOOLEAN
            -- Is the command type "Size"?

    is_task_list: BOOLEAN
            -- Is the command type "Task list"?

    is_vertical_scroll: BOOLEAN
            -- Is the command type "Vertical scroll"?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SYSTEM_COMMAND_MESSAGE


WEL_TIMER_MESSAGE Chart

class
    WEL_TIMER_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_timer which is sent after each interval specified in the `set_timer' procedure used to install a timer."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION

Queries
    id: INTEGER
    l_param: INTEGER
    message: INTEGER
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_TIMER_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_timer which is sent after each interval specified in the `set_timer' procedure used to install a timer."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TIMER_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    id: INTEGER
            -- Timer id specified with set_timer.

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TIMER_MESSAGE


WEL_WINDOW_POSITION_MESSAGE Chart

class
    WEL_WINDOW_POSITION_MESSAGE

General
    cluster: wel.messages
    description: "Information about message Wm_windowposchanged, Wm_windowposchanging. These messages are sent to a window whose size, position, or place in the Z order has changed."
    create: make

Ancestors
    WEL_MESSAGE_INFORMATION

Queries
    l_param: INTEGER
    message: INTEGER
    position: WEL_WINDOW_POS
    w_param: INTEGER
    window: WEL_WINDOW

Commands
    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)


WEL_WINDOW_POSITION_MESSAGE Flat contracts

indexing
    description: "Information about message Wm_windowposchanged, Wm_windowposchanging. These messages are sent to a window whose size, position, or place in the Z order has changed."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOW_POSITION_MESSAGE

create

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Initialization

    make (a_window: WEL_WINDOW; a_message, a_w_param, a_l_param: INTEGER)
            -- Set window, message, w_param, l_param with
            -- a_window, a_message, a_w_param, a_l_param
            -- (from WEL_MESSAGE_INFORMATION)
        ensure -- from WEL_MESSAGE_INFORMATION
            window_set: window = a_window
            message_set: message = a_message
            w_param_set: w_param = a_w_param
            l_param_set: l_param = a_l_param

feature -- Access

    l_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    message: INTEGER
            -- Message number. See class WEL_WM_CONSTANTS for
            -- different values.
            -- (from WEL_MESSAGE_INFORMATION)

    position: WEL_WINDOW_POS

    w_param: INTEGER
            -- Additional information about message. The exact
            -- meaning depends on the value of message.
            -- (from WEL_MESSAGE_INFORMATION)

    window: WEL_WINDOW
            -- Window which receives message
            -- (from WEL_MESSAGE_INFORMATION)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOW_POSITION_MESSAGE


cluster wel.shared

Cluster
    wel.shared

Supercluster
    wel

Classes
    WEL_SHARED_FONTS


WEL_SHARED_FONTS Chart

class
    WEL_SHARED_FONTS

General
    cluster: wel.shared
    description: "Shared reference to predefined font object."

Ancestors
    ANY

Queries
    Caption_font: WEL_FONT
    Gui_font: WEL_DEFAULT_GUI_FONT
    Menu_font: WEL_FONT
    Message_font: WEL_FONT
    Small_caption_font: WEL_FONT
    Status_font: WEL_FONT
    System_font: WEL_SYSTEM_FONT


WEL_SHARED_FONTS Flat contracts

indexing
    description: "Shared reference to predefined font object."
    date: "$Date: 2001/11/12 17:58:21 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SHARED_FONTS

feature -- Access

    caption_font: WEL_FONT

    gui_font: WEL_DEFAULT_GUI_FONT
            -- Default screen (WEL) font.
        ensure
            font_created: Result /= void

    menu_font: WEL_FONT

    message_font: WEL_FONT

    small_caption_font: WEL_FONT

    status_font: WEL_FONT

    system_font: WEL_SYSTEM_FONT
            -- Default system font.
        ensure
            font_created: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SHARED_FONTS


cluster wel.stddlgs

Cluster
    wel.stddlgs

Supercluster
    wel

Classes
    WEL_CHOOSE_COLOR_DIALOG
    WEL_CHOOSE_FOLDER_DIALOG
    WEL_CHOOSE_FONT_DIALOG
    WEL_CUSTOM_COLORS
    WEL_FILE_DIALOG
    WEL_OPEN_FILE_DIALOG
    WEL_PRINT_DIALOG
    WEL_SAVE_FILE_DIALOG
    WEL_STANDARD_DIALOG


WEL_CHOOSE_COLOR_DIALOG Chart

class
    WEL_CHOOSE_COLOR_DIALOG

General
    cluster: wel.stddlgs
    description: "Standard dialog box to choose a color."
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_CHOOSE_COLOR_CONSTANTS
    WEL_STANDARD_DIALOG

Queries
    custom_colors: WEL_CUSTOM_COLORS
    exists: BOOLEAN
    flags: INTEGER
    full_open_allowed: BOOLEAN
    has_flag (a_flags: INTEGER): BOOLEAN
    item: POINTER
    rgb_result: WEL_COLOR_REF
    selected: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    add_flag (a_flags: INTEGER)
    allow_full_open
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    prevent_full_open
    remove_flag (a_flags: INTEGER)
    set_custom_colors (a_custom_colors: WEL_CUSTOM_COLORS)
    set_flags (a_flags: INTEGER)
    set_item (an_item: POINTER)
    set_rgb_result (color: WEL_COLOR_REF)
    set_shared
    set_unshared
    structure_initialize


WEL_CHOOSE_COLOR_DIALOG Flat contracts

indexing
    description: "Standard dialog box to choose a color."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:22 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHOOSE_COLOR_DIALOG

create

    make
            -- Make and setup the structure

feature -- Access

    custom_colors: WEL_CUSTOM_COLORS
            -- Custom colors chosen by the user

    flags: INTEGER
            -- Dialog box creation flags.
            -- Can be a combination of the values defined in
            -- class WEL_CHOOSE_COLOR_CONSTANTS.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    rgb_result: WEL_COLOR_REF
            -- Color selected by the user and default color
            -- selected when the dialog box is created.
        require
            selected: selected
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    full_open_allowed: BOOLEAN
            -- Is the define custom colors button enabled?
            -- This button allows the user to create custom colors.

    has_flag (a_flags: INTEGER): BOOLEAN
            -- Is a_flags set in flags?
            -- See class WEL_CHOOSE_COLOR_CONSTANTS for a_flags
            -- values.

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.
            -- (from WEL_STANDARD_DIALOG)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    allow_full_open
            -- Enable the define custom colors button,
            -- allowing the user from creating custom colors.
        ensure
            full_open_allowed: full_open_allowed

    prevent_full_open
            -- Disable the define custom colors button,
            -- preventing the user from creating custom colors.
        ensure
            full_open_prevented: not full_open_allowed

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_flag (a_flags: INTEGER)
            -- Add a_flags to flags.
            -- See class WEL_CHOOSE_COLOR_CONSTANTS for a_flags
            -- values.
        ensure
            has_flag: has_flag (a_flags)

    remove_flag (a_flags: INTEGER)
            -- Remove a_flags from flags.
            -- See class WEL_CHOOSE_COLOR_CONSTANTS for a_flags
            -- values.
        ensure
            has_not_flag: not has_flag (a_flags)

    set_custom_colors (a_custom_colors: WEL_CUSTOM_COLORS)
            -- Set custom_colors with a_custom_colors.
        require
            a_custom_colors_not_void: a_custom_colors /= void
        ensure
            custom_colors_set: custom_colors = a_custom_colors

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_CHOOSE_COLOR_CONSTANTS for a_flags
            -- values.
        ensure
            flags_set: flags = a_flags

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_rgb_result (color: WEL_COLOR_REF)
            -- Set rgb_result with color
        require
            color_not_void: color /= void
        ensure
            color_set: rgb_result.item = (color.item)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
        require -- from WEL_STANDARD_DIALOG
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHOOSE_COLOR_DIALOG


WEL_CHOOSE_FOLDER_DIALOG Chart

class
    WEL_CHOOSE_FOLDER_DIALOG

General
    cluster: wel.stddlgs
    description: "Browse for folder dialog."
    create: make

Ancestors
    WEL_BIF_CONSTANTS
    WEL_BIT_OPERATIONS
    WEL_STANDARD_DIALOG

Queries
    exists: BOOLEAN
    flags: INTEGER
    folder_name: STRING
    has_flag (a_flags: INTEGER): BOOLEAN
    item: POINTER
    selected: BOOLEAN
    shared: BOOLEAN
    starting_folder: STRING
    Structure_size: INTEGER
    title: STRING
    to_integer: INTEGER

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    add_flag (a_flags: INTEGER)
    dispose
    initialize_with_character (a_character: CHARACTER)
    make
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_flag (a_flags: INTEGER)
    set_default_title
    set_flags (a_flags: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_starting_folder (a_folder_name: STRING)
    set_title (a_title: STRING)
    set_unshared
    structure_initialize


WEL_CHOOSE_FOLDER_DIALOG Flat contracts

indexing
    description: "Browse for folder dialog."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:22 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHOOSE_FOLDER_DIALOG

create

    make
            -- Initialize structure

feature -- Initialization

    make
            -- Initialize structure

feature -- Access

    flags: INTEGER
            -- Dialog box creation flags
            -- Can be a combination of values defined in
            -- class WEL_BIF_CONSTANTS.

    folder_name: STRING
            -- Selected folder name
            -- Empty if no folder was selected.

    has_flag (a_flags: INTEGER): BOOLEAN
            -- Is a_flags set in flags?
            -- See class WEL_BIF_CONSTANTS for a_flags values.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    starting_folder: STRING
            -- Initial folder name

    title: STRING
            -- Dialog title

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.
            -- (from WEL_STANDARD_DIALOG)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
        require -- from WEL_STANDARD_DIALOG
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Element Change

    add_flag (a_flags: INTEGER)
            -- Add a_flags to flags.
            -- See class WEL_BIF_CONSTANTS for a_flags values.
        ensure
            has_flag: has_flag (a_flags)

    remove_flag (a_flags: INTEGER)
            -- Remove a_flags from flags.
            -- See class WEL_BIF_CONSTANTS for a_flags values.
        ensure
            has_not_flag: not has_flag (a_flags)

    set_default_title
            -- Set title with default title ("Please choose a folder")

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_BIF_CONSTANTS for a_flags values.
        ensure
            flags_set: flags = a_flags

    set_starting_folder (a_folder_name: STRING)
            -- Set the initial folder name
        require
            valid_folder_name: a_folder_name /= void and then not a_folder_name.is_empty
        ensure
            starting_folder_set: starting_folder.is_equal (a_folder_name)

    set_title (a_title: STRING)
            -- Set title with a_title
        require
            a_title_not_void: a_title /= void
        ensure
            title_set: title.is_equal (a_title)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHOOSE_FOLDER_DIALOG


WEL_CHOOSE_FONT_DIALOG Chart

class
    WEL_CHOOSE_FONT_DIALOG

General
    cluster: wel.stddlgs
    description: "Standard dialog box to choose a font."
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_CF_CONSTANTS
    WEL_FONT_TYPE_CONSTANTS
    WEL_STANDARD_DIALOG

Queries
    color: WEL_COLOR_REF
    exists: BOOLEAN
    flags: INTEGER
    font_type: INTEGER
    has_flag (a_flags: INTEGER): BOOLEAN
    item: POINTER
    log_font: WEL_LOG_FONT
    maximum_size: INTEGER
    minimum_size: INTEGER
    point_size: INTEGER
    selected: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    valid_font_type_constant (c: INTEGER): BOOLEAN

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    add_flag (a_flags: INTEGER)
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_flag (a_flags: INTEGER)
    set_color (a_color: WEL_COLOR_REF)
    set_dc (a_dc: WEL_DC)
    set_flags (a_flags: INTEGER)
    set_item (an_item: POINTER)
    set_log_font (a_log_font: WEL_LOG_FONT)
    set_maximum_size (size: INTEGER)
    set_minimum_size (size: INTEGER)
    set_shared
    set_unshared
    structure_initialize


WEL_CHOOSE_FONT_DIALOG Flat contracts

indexing
    description: "Standard dialog box to choose a font."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:22 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHOOSE_FONT_DIALOG

create

    make
            -- Make and setup the structure.
            -- By default the dialog will show the screen fonts.

feature -- Access

    color: WEL_COLOR_REF
            -- Font color
        require
            exits: exists
        ensure
            result_not_void: Result /= void

    flags: INTEGER
            -- Dialog box creation flags.
            -- Can be a combination of the values defined in
            -- class WEL_CF_CONSTANTS.

    font_type: INTEGER
            -- Type of the selected font.
            -- See class WEL_FONT_TYPE_CONSTANTS for values.
        require
            selected: selected
        ensure
            valid_font_type: valid_font_type_constant (Result)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Information about the selected font

    maximum_size: INTEGER
            -- Maximum point size a user can select

    minimum_size: INTEGER
            -- Minimum point size a user can select

    point_size: INTEGER
            -- Size of the selected font (in units of 1/10 of
            -- a point)
        require
            selected: selected

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_flag (a_flags: INTEGER): BOOLEAN
            -- Is a_flags set in flags?
            -- See class WEL_CF_CONSTANTS for a_flags values.

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.
            -- (from WEL_STANDARD_DIALOG)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_font_type_constant (c: INTEGER): BOOLEAN
            -- Is c a valid font type constant?
            -- (from WEL_FONT_TYPE_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_flag (a_flags: INTEGER)
            -- Add a_flags to flags.
            -- See class WEL_CF_CONSTANTS for a_flags values.
        ensure
            has_flag: has_flag (a_flags)

    remove_flag (a_flags: INTEGER)
            -- Remove a_flags from flags.
            -- See class WEL_CF_CONSTANTS for a_flags values.
        ensure
            has_not_flag: not has_flag (a_flags)

    set_color (a_color: WEL_COLOR_REF)
            -- Set color with a_color.
        ensure
            color_set: color.is_equal (a_color)

    set_dc (a_dc: WEL_DC)
            -- Set a device context a_dc of the printer whose
            -- fonts will be listed in the dialog box.
        require
            a_dc_not_void: a_dc /= void
            a_dc_exists: a_dc.exists

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_CF_CONSTANTS for a_flags values.
        ensure
            flags_set: flags = a_flags

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_log_font (a_log_font: WEL_LOG_FONT)
            -- Set log_font with a_log_font.
        require
            a_log_font_not_void: a_log_font /= void
        ensure
            log_font_set: log_font.item = a_log_font.item

    set_maximum_size (size: INTEGER)
            -- Set maximum_size with size.
        ensure
            maximum_size_set: maximum_size = size

    set_minimum_size (size: INTEGER)
            -- Set minimum_size with size.
        ensure
            minimum_size_set: minimum_size = size

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
        require -- from WEL_STANDARD_DIALOG
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHOOSE_FONT_DIALOG


WEL_CUSTOM_COLORS Chart

class
    WEL_CUSTOM_COLORS

General
    cluster: wel.stddlgs
    description: "Custom colors chosen in a choose color dialog box."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    Count: INTEGER
    exists: BOOLEAN
    i_th_color (i: INTEGER): WEL_COLOR_REF
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_color (a_color: WEL_COLOR_REF; i: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_CUSTOM_COLORS Flat contracts

indexing
    description: "Custom colors chosen in a choose color dialog box."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:22 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CUSTOM_COLORS

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    Count: INTEGER is 16
            -- Number of colors

    i_th_color (i: INTEGER): WEL_COLOR_REF
            -- Color at the position i
        require
            i_large_enough: i >= 1
            i_small_enough: i <= count
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_color (a_color: WEL_COLOR_REF; i: INTEGER)
            -- Set a_color at the position i.
        require
            i_large_enough: i >= 1
            i_small_enough: i <= count
            a_color_exists: a_color /= void
        ensure
            color_set: i_th_color (i).is_equal (a_color)

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CUSTOM_COLORS


WEL_FILE_DIALOG Chart

deferred class
    WEL_FILE_DIALOG

General
    cluster: wel.stddlgs
    description: "Ancestor of WEL_OPEN_FILE_DIALOG and WEL_SAVE_FILE_DIALOG."

Ancestors
    WEL_BIT_OPERATIONS
    WEL_OFN_CONSTANTS
    WEL_STANDARD_DIALOG

Queries
    exists: BOOLEAN
    file_extension_offset: INTEGER
    file_name: STRING
    file_name_offset: INTEGER
    file_title: STRING
    filter_index: INTEGER
    flags: INTEGER
    has_flag (a_flags: INTEGER): BOOLEAN
    item: POINTER
    Max_file_name_length: INTEGER
    multiple_file_names: LINKED_LIST [STRING]
    selected: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    title: STRING
    to_integer: INTEGER

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    add_flag (a_flags: INTEGER)
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_flag (a_flags: INTEGER)
    set_default_extension (extension: STRING)
    set_default_title
    set_file_name (a_file_name: STRING)
    set_filter (filter_names, filter_patterns: ARRAY [STRING])
    set_filter_index (a_filter_index: INTEGER)
    set_flags (a_flags: INTEGER)
    set_initial_directory (directory: STRING)
    set_initial_directory_as_current
    set_item (an_item: POINTER)
    set_shared
    set_title (a_title: STRING)
    set_unshared
    structure_initialize

Constraints
    str file name not void
    str file name exists
    str file title not void
    str file title exists
    str title not void
    str title exists


WEL_FILE_DIALOG Flat contracts

indexing
    description: "Ancestor of WEL_OPEN_FILE_DIALOG and WEL_SAVE_FILE_DIALOG."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:23 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_FILE_DIALOG

feature -- Access

    file_extension_offset: INTEGER
            -- Specifies the offset from the beginning of the path
            -- to the file name extension in the string file_name.
        require
            selected: selected
        ensure
            result_greater_than_or_equal_to_one: Result >= 1

    file_name: STRING
            -- File name selected (including path).
        require
            selected: selected
        ensure
            result_not_void: Result /= void

    file_name_offset: INTEGER
            -- Specifies the offset from the beginning of the path
            -- to the file name in the string file_name.
        require
            selected: selected
        ensure
            result_greater_than_or_equal_to_one: Result >= 1

    file_title: STRING
            -- Title of the selected file (without path).
        require
            selected: selected
        ensure
            result_not_void: Result /= void

    filter_index: INTEGER
            -- Index of the selected filter
        require
            selected: selected
        ensure
            positive_result: Result >= 0

    flags: INTEGER
            -- Dialog box creation flags.
            -- Can be a combination of the values defined in
            -- class WEL_OFN_CONSTANTS.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    Max_file_name_length: INTEGER is 1024
            -- Maximum file name length

    multiple_file_names: LINKED_LIST [STRING]
            -- return the full path name of all selected files.
        require
            multiple_files_flag_set: has_flag (ofn_allowmultiselect)
        ensure
            result_not_void: Result /= void

    title: STRING
            -- Title of the current dialog
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_flag (a_flags: INTEGER): BOOLEAN
            -- Is a_flags set in flags?
            -- See class WEL_OFN_CONSTANTS for a_flags values.

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.
            -- (from WEL_STANDARD_DIALOG)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_flag (a_flags: INTEGER)
            -- Add a_flags to flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
        ensure
            has_flag: has_flag (a_flags)

    remove_flag (a_flags: INTEGER)
            -- Remove a_flags from flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
        ensure
            has_not_flag: not has_flag (a_flags)

    set_default_extension (extension: STRING)
            -- Set the default extension with extension.
            -- This extension will be automatically added to the
            -- file name if the user fails to type an extension.
        require
            extension_not_void: extension /= void

    set_default_title
            -- Set the title bar with the default value ("Save As"
            -- or "Open")
        ensure
            default_title_set: title.is_equal ("")

    set_file_name (a_file_name: STRING)
            -- Set file_name with a_file and initialize
            -- the file name edit control.
        require
            a_file_name_not_void: a_file_name /= void
            a_file_name_count_ok: a_file_name.count <= max_file_name_length
        ensure
            file_name_set: file_name.is_equal (a_file_name)

    set_filter (filter_names, filter_patterns: ARRAY [STRING])
            -- Set the file type combo box.
            -- filter_names is an array of string containing
            -- the filter names and filter_patterns is an
            -- array of string containing the filter patterns.
            -- Example:
            --	filter_names = <<"Text file", "All file">>
            --	filter_patterns = <<"*.txt", "*.*">>
        require
            filter_names_not_void: filter_names /= void
            filter_patterns_not_void: filter_patterns /= void
            same_count: filter_names.count = filter_patterns.count
            no_void_name: not filter_names.has (void)
            no_void_pattern: not filter_patterns.has (void)

    set_filter_index (a_filter_index: INTEGER)
            -- Set filter_index with a_filter_index.
        require
            positive_filter_index: a_filter_index >= 0
        ensure
            filter_index_set: filter_index = a_filter_index

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
        ensure
            flags_set: flags = a_flags

    set_initial_directory (directory: STRING)
            -- Set the initial directory with directory.
        require
            directory_not_void: directory /= void

    set_initial_directory_as_current
            -- Set the initial directory as the current one.

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_title (a_title: STRING)
            -- Set title with a_title and use this string to
            -- display the title.
        require
            a_title_not_void: a_title /= void
        ensure
            title_set: title.is_equal (a_title)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
            -- (from WEL_STANDARD_DIALOG)
        require -- from WEL_STANDARD_DIALOG
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    str_file_name_not_void: str_file_name /= void
    str_file_name_exists: str_file_name.exists
    str_file_title_not_void: str_file_title /= void
    str_file_title_exists: str_file_title.exists
    str_title_not_void: str_title /= void
    str_title_exists: str_title.exists
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FILE_DIALOG


WEL_OPEN_FILE_DIALOG Chart

class
    WEL_OPEN_FILE_DIALOG

General
    cluster: wel.stddlgs
    description: "Standard dialog box to open a file."
    create: make

Ancestors
    WEL_FILE_DIALOG

Queries
    exists: BOOLEAN
    file_extension_offset: INTEGER
    file_name: STRING
    file_name_offset: INTEGER
    file_title: STRING
    filter_index: INTEGER
    flags: INTEGER
    has_flag (a_flags: INTEGER): BOOLEAN
    item: POINTER
    Max_file_name_length: INTEGER
    multiple_file_names: LINKED_LIST [STRING]
    selected: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    title: STRING
    to_integer: INTEGER

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    add_flag (a_flags: INTEGER)
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_flag (a_flags: INTEGER)
    set_default_extension (extension: STRING)
    set_default_title
    set_file_name (a_file_name: STRING)
    set_filter (filter_names, filter_patterns: ARRAY [STRING])
    set_filter_index (a_filter_index: INTEGER)
    set_flags (a_flags: INTEGER)
    set_initial_directory (directory: STRING)
    set_initial_directory_as_current
    set_item (an_item: POINTER)
    set_shared
    set_title (a_title: STRING)
    set_unshared
    structure_initialize


WEL_OPEN_FILE_DIALOG Flat contracts

indexing
    description: "Standard dialog box to open a file."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:23 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_OPEN_FILE_DIALOG

create

    make
            -- Make and setup the structure
            -- (from WEL_FILE_DIALOG)

feature -- Access

    file_extension_offset: INTEGER
            -- Specifies the offset from the beginning of the path
            -- to the file name extension in the string file_name.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_greater_than_or_equal_to_one: Result >= 1

    file_name: STRING
            -- File name selected (including path).
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

    file_name_offset: INTEGER
            -- Specifies the offset from the beginning of the path
            -- to the file name in the string file_name.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_greater_than_or_equal_to_one: Result >= 1

    file_title: STRING
            -- Title of the selected file (without path).
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

    filter_index: INTEGER
            -- Index of the selected filter
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            positive_result: Result >= 0

    flags: INTEGER
            -- Dialog box creation flags.
            -- Can be a combination of the values defined in
            -- class WEL_OFN_CONSTANTS.
            -- (from WEL_FILE_DIALOG)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    Max_file_name_length: INTEGER is 1024
            -- Maximum file name length
            -- (from WEL_FILE_DIALOG)

    multiple_file_names: LINKED_LIST [STRING]
            -- return the full path name of all selected files.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            multiple_files_flag_set: has_flag (ofn_allowmultiselect)
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

    title: STRING
            -- Title of the current dialog
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_flag (a_flags: INTEGER): BOOLEAN
            -- Is a_flags set in flags?
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.
            -- (from WEL_STANDARD_DIALOG)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_flag (a_flags: INTEGER)
            -- Add a_flags to flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            has_flag: has_flag (a_flags)

    remove_flag (a_flags: INTEGER)
            -- Remove a_flags from flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            has_not_flag: not has_flag (a_flags)

    set_default_extension (extension: STRING)
            -- Set the default extension with extension.
            -- This extension will be automatically added to the
            -- file name if the user fails to type an extension.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            extension_not_void: extension /= void

    set_default_title
            -- Set the title bar with the default value ("Save As"
            -- or "Open")
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            default_title_set: title.is_equal ("")

    set_file_name (a_file_name: STRING)
            -- Set file_name with a_file and initialize
            -- the file name edit control.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            a_file_name_not_void: a_file_name /= void
            a_file_name_count_ok: a_file_name.count <= max_file_name_length
        ensure -- from WEL_FILE_DIALOG
            file_name_set: file_name.is_equal (a_file_name)

    set_filter (filter_names, filter_patterns: ARRAY [STRING])
            -- Set the file type combo box.
            -- filter_names is an array of string containing
            -- the filter names and filter_patterns is an
            -- array of string containing the filter patterns.
            -- Example:
            --	filter_names = <<"Text file", "All file">>
            --	filter_patterns = <<"*.txt", "*.*">>
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            filter_names_not_void: filter_names /= void
            filter_patterns_not_void: filter_patterns /= void
            same_count: filter_names.count = filter_patterns.count
            no_void_name: not filter_names.has (void)
            no_void_pattern: not filter_patterns.has (void)

    set_filter_index (a_filter_index: INTEGER)
            -- Set filter_index with a_filter_index.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            positive_filter_index: a_filter_index >= 0
        ensure -- from WEL_FILE_DIALOG
            filter_index_set: filter_index = a_filter_index

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            flags_set: flags = a_flags

    set_initial_directory (directory: STRING)
            -- Set the initial directory with directory.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            directory_not_void: directory /= void

    set_initial_directory_as_current
            -- Set the initial directory as the current one.
            -- (from WEL_FILE_DIALOG)

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_title (a_title: STRING)
            -- Set title with a_title and use this string to
            -- display the title.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            a_title_not_void: a_title /= void
        ensure -- from WEL_FILE_DIALOG
            title_set: title.is_equal (a_title)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
        require -- from WEL_STANDARD_DIALOG
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_FILE_DIALOG
    str_file_name_not_void: str_file_name /= void
    str_file_name_exists: str_file_name.exists
    str_file_title_not_void: str_file_title /= void
    str_file_title_exists: str_file_title.exists
    str_title_not_void: str_title /= void
    str_title_exists: str_title.exists

end -- class WEL_OPEN_FILE_DIALOG


WEL_PRINT_DIALOG Chart

class
    WEL_PRINT_DIALOG

General
    cluster: wel.stddlgs
    description: "Standard dialog box to specify the properties of a particular print job."
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_PD_CONSTANTS
    WEL_STANDARD_DIALOG

Queries
    all_pages_selected: BOOLEAN
    collate_checked: BOOLEAN
    copies: INTEGER
    dc: WEL_PRINTER_DC
    exists: BOOLEAN
    flags: INTEGER
    from_page: INTEGER
    has_flag (a_flags: INTEGER): BOOLEAN
    item: POINTER
    maximum_page: INTEGER
    minimum_page: INTEGER
    page_numbers_enabled: BOOLEAN
    page_numbers_selected: BOOLEAN
    print_setup_enabled: BOOLEAN
    print_to_file_checked: BOOLEAN
    print_to_file_enabled: BOOLEAN
    print_to_file_shown: BOOLEAN
    selected: BOOLEAN
    selection_enabled: BOOLEAN
    selection_selected: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    to_page: INTEGER
    warning_enabled: BOOLEAN

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    add_flag (a_flags: INTEGER)
    check_collate
    check_print_to_file
    disable_page_numbers
    disable_print_setup
    disable_print_to_file
    disable_selection
    disable_warning
    dispose
    enable_page_numbers
    enable_print_setup
    enable_print_to_file
    enable_selection
    enable_warning
    hide_print_to_file
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_flag (a_flags: INTEGER)
    select_all_pages
    select_page_numbers
    select_selection
    set_copies (number: INTEGER)
    set_flags (a_flags: INTEGER)
    set_from_page (page: INTEGER)
    set_item (an_item: POINTER)
    set_maximum_page (page: INTEGER)
    set_minimum_page (page: INTEGER)
    set_shared
    set_to_page (page: INTEGER)
    set_unshared
    show_print_to_file
    structure_initialize
    uncheck_collate
    uncheck_print_to_file


WEL_PRINT_DIALOG Flat contracts

indexing
    description: "Standard dialog box to specify the properties of a particular print job."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:23 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PRINT_DIALOG

create

    make
            -- Make and setup the structure
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    copies: INTEGER
            -- Number of copies for the Copies edit control

    dc: WEL_PRINTER_DC
            -- Device context associated to the selected printer
        require
            selected: selected
        ensure
            result_not_void: Result /= void

    flags: INTEGER
            -- Dialog box creation flags.
            -- Can be a combination of the values defined in
            -- class WEL_PD_CONSTANTS.

    from_page: INTEGER
            -- Value for the starting page edit control
        ensure
            positive_result: Result >= 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    maximum_page: INTEGER
            -- Maximum value for the range of pages specified
            -- in the From and To page edit controls

    minimum_page: INTEGER
            -- Minimum value for the range of pages specified
            -- in the From and To page edit controls

    to_page: INTEGER
            -- Value for the ending page edit control
        ensure
            positive_result: Result >= 0

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    all_pages_selected: BOOLEAN
            -- Is the "All pages" radio button selected?

    collate_checked: BOOLEAN
            -- Is the "Collate" check box checked?

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_flag (a_flags: INTEGER): BOOLEAN
            -- Is a_flags set in flags?
            -- See class WEL_PD_CONSTANTS for a_flags
            -- values.

    page_numbers_enabled: BOOLEAN
            -- Is the "Page numbers" radio button enabled?

    page_numbers_selected: BOOLEAN
            -- Is the "Page" radio button selected?

    print_setup_enabled: BOOLEAN
            -- Is the Print setup dialog box enabled?

    print_to_file_checked: BOOLEAN
            -- Is the "Print to file" check box checked?

    print_to_file_enabled: BOOLEAN
            -- Is the "Print to file" check box enabled?

    print_to_file_shown: BOOLEAN
            -- Is the "Print to file" check box shown?

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.
            -- (from WEL_STANDARD_DIALOG)

    selection_enabled: BOOLEAN
            -- Is the "Selection" radio button enabled?

    selection_selected: BOOLEAN
            -- Is the "Selection" radio box selected?

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    warning_enabled: BOOLEAN
            -- Is the warning message from being displayed when
            -- there is no default printer enabled?

feature -- Status setting

    check_collate
            -- Check the "Collate" check box.
        ensure
            collate_checked: collate_checked

    check_print_to_file
            -- Check the "Print to file" check box.
        ensure
            print_to_file_checked: print_to_file_checked

    disable_page_numbers
            -- Disable the "Page numbers" radio button.
        ensure
            page_numbers_disabled: not page_numbers_enabled

    disable_print_setup
            -- Disable the system to display the Print setup dialog
            -- box rather than the Print dialog box.
        ensure
            print_setup_disabled: not print_setup_enabled

    disable_print_to_file
            -- Disable the "Print to file" check box.
        ensure
            print_to_file_disabled: not print_to_file_enabled

    disable_selection
            -- Disable the "Selection" radio button.
        ensure
            selection_disabled: not selection_enabled

    disable_warning
            -- Disable the warning message from being displayed when
            -- there is no default printer.
        ensure
            warning_disabled: not warning_enabled

    enable_page_numbers
            -- Enable the "Page numbers" radio button.
        ensure
            page_numbers_enabled: page_numbers_enabled

    enable_print_setup
            -- Enable the system to display the Print setup dialog
            -- box rather than the Print dialog box.
        ensure
            print_setup_enabled: print_setup_enabled

    enable_print_to_file
            -- Enable the "Print to file" check box.
        ensure
            print_to_file_enabled: print_to_file_enabled

    enable_selection
            -- Enable the "Selection" radio button.
        ensure
            selection_enabled: selection_enabled

    enable_warning
            -- Enable the warning message from being displayed when
            -- there is no default printer.
        ensure
            warning_enabled: warning_enabled

    hide_print_to_file
            -- Hide the "Print to file" check box.
        ensure
            print_to_file_hidden: not print_to_file_shown

    select_all_pages
            -- Select the "All pages" radio button.
        ensure
            all_pages_selected: all_pages_selected

    select_page_numbers
            -- Select the "Page numbers" radio button.
        ensure
            page_numbers_selected: page_numbers_selected

    select_selection
            -- Select the "Selection" radio button.
        ensure
            selection_selected: selection_selected

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show_print_to_file
            -- Show the "Print to file" check box.
        ensure
            print_to_file_shown: print_to_file_shown

    uncheck_collate
            -- Uncheck the "Collate" check box.
        ensure
            collate_unchecked: not collate_checked

    uncheck_print_to_file
            -- Uncheck the "Print to file" check box.
        ensure
            print_to_file_unchecked: not print_to_file_checked

feature -- Element change

    add_flag (a_flags: INTEGER)
            -- Add a_flags to flags.
            -- See class WEL_PD_CONSTANTS for a_flags values.
        ensure
            has_flag: has_flag (a_flags)

    remove_flag (a_flags: INTEGER)
            -- Remove a_flags from flags.
            -- See class WEL_PD_CONSTANTS for a_flags values.
        ensure
            has_not_flag: not has_flag (a_flags)

    set_copies (number: INTEGER)
            -- Set copies with number.
        ensure
            copies_set: copies = number

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_PD_CONSTANTS for a_flags values.
        ensure
            flags_set: flags = a_flags

    set_from_page (page: INTEGER)
            -- Set from_page with page.
        ensure
            from_page_set: from_page = page

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_maximum_page (page: INTEGER)
            -- Set maximum_page with page.
        ensure
            maximum_page_set: maximum_page = page

    set_minimum_page (page: INTEGER)
            -- Set minimum_page with page.
        ensure
            minimum_page_set: minimum_page = page

    set_to_page (page: INTEGER)
            -- Set to_page with page.
        ensure
            to_page_set: to_page = page

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
        require -- from WEL_STANDARD_DIALOG
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PRINT_DIALOG


WEL_SAVE_FILE_DIALOG Chart

class
    WEL_SAVE_FILE_DIALOG

General
    cluster: wel.stddlgs
    description: "Standard dialog box to save a file."
    create: make

Ancestors
    WEL_FILE_DIALOG

Queries
    exists: BOOLEAN
    file_extension_offset: INTEGER
    file_name: STRING
    file_name_offset: INTEGER
    file_title: STRING
    filter_index: INTEGER
    flags: INTEGER
    has_flag (a_flags: INTEGER): BOOLEAN
    item: POINTER
    Max_file_name_length: INTEGER
    multiple_file_names: LINKED_LIST [STRING]
    selected: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    title: STRING
    to_integer: INTEGER

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    add_flag (a_flags: INTEGER)
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_flag (a_flags: INTEGER)
    set_default_extension (extension: STRING)
    set_default_title
    set_file_name (a_file_name: STRING)
    set_filter (filter_names, filter_patterns: ARRAY [STRING])
    set_filter_index (a_filter_index: INTEGER)
    set_flags (a_flags: INTEGER)
    set_initial_directory (directory: STRING)
    set_initial_directory_as_current
    set_item (an_item: POINTER)
    set_shared
    set_title (a_title: STRING)
    set_unshared
    structure_initialize


WEL_SAVE_FILE_DIALOG Flat contracts

indexing
    description: "Standard dialog box to save a file."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:23 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SAVE_FILE_DIALOG

create

    make
            -- Make and setup the structure
            -- (from WEL_FILE_DIALOG)

feature -- Access

    file_extension_offset: INTEGER
            -- Specifies the offset from the beginning of the path
            -- to the file name extension in the string file_name.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_greater_than_or_equal_to_one: Result >= 1

    file_name: STRING
            -- File name selected (including path).
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

    file_name_offset: INTEGER
            -- Specifies the offset from the beginning of the path
            -- to the file name in the string file_name.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_greater_than_or_equal_to_one: Result >= 1

    file_title: STRING
            -- Title of the selected file (without path).
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

    filter_index: INTEGER
            -- Index of the selected filter
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            selected: selected
        ensure -- from WEL_FILE_DIALOG
            positive_result: Result >= 0

    flags: INTEGER
            -- Dialog box creation flags.
            -- Can be a combination of the values defined in
            -- class WEL_OFN_CONSTANTS.
            -- (from WEL_FILE_DIALOG)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    Max_file_name_length: INTEGER is 1024
            -- Maximum file name length
            -- (from WEL_FILE_DIALOG)

    multiple_file_names: LINKED_LIST [STRING]
            -- return the full path name of all selected files.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            multiple_files_flag_set: has_flag (ofn_allowmultiselect)
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

    title: STRING
            -- Title of the current dialog
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_flag (a_flags: INTEGER): BOOLEAN
            -- Is a_flags set in flags?
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.
            -- (from WEL_STANDARD_DIALOG)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_flag (a_flags: INTEGER)
            -- Add a_flags to flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            has_flag: has_flag (a_flags)

    remove_flag (a_flags: INTEGER)
            -- Remove a_flags from flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            has_not_flag: not has_flag (a_flags)

    set_default_extension (extension: STRING)
            -- Set the default extension with extension.
            -- This extension will be automatically added to the
            -- file name if the user fails to type an extension.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            extension_not_void: extension /= void

    set_default_title
            -- Set the title bar with the default value ("Save As"
            -- or "Open")
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            default_title_set: title.is_equal ("")

    set_file_name (a_file_name: STRING)
            -- Set file_name with a_file and initialize
            -- the file name edit control.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            a_file_name_not_void: a_file_name /= void
            a_file_name_count_ok: a_file_name.count <= max_file_name_length
        ensure -- from WEL_FILE_DIALOG
            file_name_set: file_name.is_equal (a_file_name)

    set_filter (filter_names, filter_patterns: ARRAY [STRING])
            -- Set the file type combo box.
            -- filter_names is an array of string containing
            -- the filter names and filter_patterns is an
            -- array of string containing the filter patterns.
            -- Example:
            --	filter_names = <<"Text file", "All file">>
            --	filter_patterns = <<"*.txt", "*.*">>
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            filter_names_not_void: filter_names /= void
            filter_patterns_not_void: filter_patterns /= void
            same_count: filter_names.count = filter_patterns.count
            no_void_name: not filter_names.has (void)
            no_void_pattern: not filter_patterns.has (void)

    set_filter_index (a_filter_index: INTEGER)
            -- Set filter_index with a_filter_index.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            positive_filter_index: a_filter_index >= 0
        ensure -- from WEL_FILE_DIALOG
            filter_index_set: filter_index = a_filter_index

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_OFN_CONSTANTS for a_flags values.
            -- (from WEL_FILE_DIALOG)
        ensure -- from WEL_FILE_DIALOG
            flags_set: flags = a_flags

    set_initial_directory (directory: STRING)
            -- Set the initial directory with directory.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            directory_not_void: directory /= void

    set_initial_directory_as_current
            -- Set the initial directory as the current one.
            -- (from WEL_FILE_DIALOG)

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_title (a_title: STRING)
            -- Set title with a_title and use this string to
            -- display the title.
            -- (from WEL_FILE_DIALOG)
        require -- from WEL_FILE_DIALOG
            a_title_not_void: a_title /= void
        ensure -- from WEL_FILE_DIALOG
            title_set: title.is_equal (a_title)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
        require -- from WEL_STANDARD_DIALOG
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from WEL_FILE_DIALOG
    str_file_name_not_void: str_file_name /= void
    str_file_name_exists: str_file_name.exists
    str_file_title_not_void: str_file_title /= void
    str_file_title_exists: str_file_title.exists
    str_title_not_void: str_title /= void
    str_title_exists: str_title.exists

end -- class WEL_SAVE_FILE_DIALOG


WEL_STANDARD_DIALOG Chart

deferred class
    WEL_STANDARD_DIALOG

General
    cluster: wel.stddlgs
    description: "Ancestor of all standard dialog boxes."

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    selected: BOOLEAN
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    activate (a_parent: WEL_COMPOSITE_WINDOW)
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    structure_initialize


WEL_STANDARD_DIALOG Flat contracts

indexing
    description: "Ancestor of all standard dialog boxes."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:23 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_STANDARD_DIALOG

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    selected: BOOLEAN
            -- Has the user selected something (file, color, etc.)?
            -- If True, the Ok button has been chosen. If False,
            -- the Cancel button has been chosen.

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate (a_parent: WEL_COMPOSITE_WINDOW)
            -- Activate the dialog box (modal mode) with
            -- a_parent as owner.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STANDARD_DIALOG


cluster wel.structs

Cluster
    wel.structs

Supercluster
    wel

Classes
    WEL_ACCELERATOR
    WEL_ARRAY [G -> WEL_STRUCTURE]
    WEL_BITMAP_CORE_HEADER
    WEL_BITMAP_FILE_HEADER
    WEL_BITMAP_INFO
    WEL_BITMAP_INFO_HEADER
    WEL_CHARACTER_ARRAY
    WEL_CHARACTER_FORMAT
    WEL_CHARACTER_RANGE
    WEL_CLIENT_CREATE_STRUCT
    WEL_COMBO_BOX_EX_ITEM
    WEL_COMPARE_ITEM_STRUCT
    WEL_DELETE_ITEM_STRUCT
    WEL_DLG_TEMPLATE
    WEL_DOC_INFO
    WEL_DRAW_ITEM_STRUCT
    WEL_ENUM_LOG_FONT
    WEL_FILE_TIME
    WEL_FIND_ARGUMENT
    WEL_FORMAT_RANGE
    WEL_HD_HIT_TEST_INFO
    WEL_HD_ITEM
    WEL_HD_LAYOUT
    WEL_HD_NOTIFY
    WEL_IMAGE_LIST
    WEL_IMALLOC
    WEL_INTEGER_ARRAY
    WEL_LIST_VIEW_COLUMN
    WEL_LIST_VIEW_ITEM
    WEL_LIST_VIEW_SEARCH_INFO
    WEL_LV_DISPINFO
    WEL_LV_HITTESTINFO
    WEL_LV_KEYDOWN
    WEL_MDI_CREATE_STRUCT
    WEL_MEASURE_ITEM_STRUCT
    WEL_MIN_MAX_INFO
    WEL_MSG
    WEL_MSG_FILTER
    WEL_MSGBOXPARAMS
    WEL_NET_RESOURCE
    WEL_NM_COMBO_BOX_EX
    WEL_NM_COMBO_BOX_EX_ENDEDIT
    WEL_NM_HEADER
    WEL_NM_LIST_VIEW
    WEL_NM_TOOL_BAR
    WEL_NM_TREE_VIEW
    WEL_NM_TREE_VIEW_GETINFOTIP
    WEL_NM_UP_DOWN_CONTROL
    WEL_NMHDR
    WEL_NON_CLIENT_METRICS
    WEL_PAINT_STRUCT
    WEL_PALETTE_ENTRY
    WEL_PARAGRAPH_FORMAT
    WEL_POINT
    WEL_PROCESS_INFO
    WEL_REBARBANDINFO
    WEL_REBARINFO
    WEL_RECT
    WEL_REGISTRY_KEY_VALUE
    WEL_RGB_QUAD
    WEL_RICH_EDIT_BUFFER_LOADER
    WEL_RICH_EDIT_BUFFER_SAVER
    WEL_RICH_EDIT_FILE_LOADER
    WEL_RICH_EDIT_FILE_SAVER
    WEL_RICH_EDIT_STREAM
    WEL_RICH_EDIT_STREAM_IN
    WEL_RICH_EDIT_STREAM_OUT
    WEL_SCROLL_BAR_INFO
    WEL_SECURITY_ATTRIBUTES
    WEL_SIZE
    WEL_STARTUP_INFO
    WEL_STRING
    WEL_STRUCTURE
    WEL_SYSTEM_TIME
    WEL_TAB_CONTROL_ITEM
    WEL_TC_KEYDOWN
    WEL_TEXT_METRIC
    WEL_TOOL_BAR_BITMAP
    WEL_TOOL_BAR_BUTTON
    WEL_TOOL_INFO
    WEL_TOOLTIP_TEXT
    WEL_TRACK_MOUSE_EVENT
    WEL_TREE_VIEW_INSERT_STRUCT
    WEL_TREE_VIEW_ITEM
    WEL_TV_DISPINFO
    WEL_TV_HITTESTINFO
    WEL_TV_KEYDOWN
    WEL_WINDOW_PLACEMENT
    WEL_WINDOW_POS
    WEL_WND_CLASS


WEL_ACCELERATOR Chart

class
    WEL_ACCELERATOR

General
    cluster: wel.structs
    description: "This class represents a Windows accelerator."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    command_id: INTEGER
    exists: BOOLEAN
    flags: INTEGER
    item: POINTER
    key: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_command_id (a_command_id: INTEGER)
    set_flags (a_flags: INTEGER)
    set_item (an_item: POINTER)
    set_key (a_key: INTEGER)
    set_shared
    set_unshared
    structure_initialize

Constraints
    valid command id


WEL_ACCELERATOR Flat contracts

indexing
    description: "This class represents a Windows accelerator."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:23 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ACCELERATOR

create

    make (a_key, a_command_id, a_flags: INTEGER)
            -- Create a definition of an accelerator.
            -- See class WEL_ACCELERATOR_FLAG_CONSTANTS
            -- for a_flags values.
        require
            valid_command_id: a_command_id >= 0
        ensure
            key_set: key = a_key
            command_id_set: command_id = a_command_id
            flags_set: flags = a_flags

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    command_id: INTEGER
            -- Command id of accelerator

    flags: INTEGER
            -- Flags of accelerator

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    key: INTEGER
            -- Key of accelerator

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_command_id (a_command_id: INTEGER)
            -- Set command_id to a_command_id.
        require
            valid_command_id: a_command_id >= 0
        ensure
            command_id_set: command_id = a_command_id

    set_flags (a_flags: INTEGER)
            -- Set flags to a_flags.
        ensure
            flags_set: flags = a_flags

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_key (a_key: INTEGER)
            -- Set key to a_key.
        ensure
            key_set: key = a_key

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    valid_command_id: command_id >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ACCELERATOR


WEL_ARRAY Chart

class
    WEL_ARRAY [G -> WEL_STRUCTURE]

General
    cluster: wel.structs
    description: "Fixed array for WEL_STRUCTURE. Used internally by WEL."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    count: INTEGER
    exists: BOOLEAN
    i_th_item (index: INTEGER): POINTER
    item: POINTER
    item_size: INTEGER
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    put (an_item: G; index: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    positive count
    positive item size


WEL_ARRAY Flat contracts

indexing
    description: "Fixed array for WEL_STRUCTURE. Used internally by WEL."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ARRAY [G -> WEL_STRUCTURE]

create

    make (a_count, an_item_size: INTEGER)
            -- Create a fixed array.
            -- a_count specifies the number of items and
            -- an_item_size specifies the item_size of an item.
        require
            positive_count: a_count >= 0
            positive_item_size: an_item_size >= 0
        ensure
            count_set: count = a_count
            item_size_set: item_size = an_item_size

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    count: INTEGER
            -- Number of items in the array

    item_size: INTEGER
            -- Size of an item (in bytes)

    structure_size: INTEGER
            -- Size of the array (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    i_th_item (index: INTEGER): POINTER
            -- Retrieve the pointer at the zero-based index.
        require
            index_large_enough: index >= 0
            index_small_enpugh: index < count

    put (an_item: G; index: INTEGER)
            -- Put an_item at zero based index index.
        require
            an_item_not_void: an_item /= void
            valid_item_size: item_size = an_item.structure_size
            index_large_enough: index >= 0
            index_small_enough: index < count

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    positive_count: count >= 0
    positive_item_size: item_size >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ARRAY


WEL_BITMAP_CORE_HEADER Chart

class
    WEL_BITMAP_CORE_HEADER

General
    cluster: wel.structs
    description: "Contains information about the dimensions and color format of a device-independent bitmap (DIB)."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    bit_count: INTEGER
    exists: BOOLEAN
    height: INTEGER
    item: POINTER
    planes: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bit_count (a_bit_count: INTEGER)
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_planes (a_planes: INTEGER)
    set_shared
    set_unshared
    set_width (a_width: INTEGER)


WEL_BITMAP_CORE_HEADER Flat contracts

indexing
    description: "Contains information about the dimensions and color format of a device-independent bitmap (DIB)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BITMAP_CORE_HEADER

create

    make (a_width, a_height, a_planes, a_bit_count: INTEGER)
        ensure
            width_set: width = a_width
            height_set: height = a_height
            planes_set: planes = a_planes
            bit_count_set: bit_count = a_bit_count

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    bit_count: INTEGER

    height: INTEGER

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    planes: INTEGER

    width: INTEGER

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bit_count (a_bit_count: INTEGER)
        ensure
            bit_count_set: bit_count = a_bit_count

    set_height (a_height: INTEGER)
        ensure
            height_set: height = a_height

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_planes (a_planes: INTEGER)
        ensure
            planes_set: planes = a_planes

    set_width (a_width: INTEGER)
        ensure
            width_set: width = a_width

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BITMAP_CORE_HEADER


WEL_BITMAP_FILE_HEADER Chart

class
    WEL_BITMAP_FILE_HEADER

General
    cluster: wel.structs
    description: "Contains information about the type, size, and layout of a file that contains a device-independent bitmap (DIB)."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    off_bits: INTEGER
    reserved1: INTEGER
    reserved2: INTEGER
    shared: BOOLEAN
    size: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER
    type: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_off_bits (a_off_bits: INTEGER)
    set_reserved1 (a_reserved1: INTEGER)
    set_reserved2 (a_reserved2: INTEGER)
    set_shared
    set_size (a_size: INTEGER)
    set_type (a_type: INTEGER)
    set_unshared


WEL_BITMAP_FILE_HEADER Flat contracts

indexing
    description: "Contains information about the type, size, and layout of a file that contains a device-independent bitmap (DIB)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BITMAP_FILE_HEADER

create

    make
        ensure
            type_set: type = 0
            size_set: size = 0
            reserved1_set: reserved1 = 0
            reserved2_set: reserved2 = 0
            off_bits_set: off_bits = 0

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    off_bits: INTEGER

    reserved1: INTEGER

    reserved2: INTEGER

    size: INTEGER

    type: INTEGER

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_off_bits (a_off_bits: INTEGER)
        ensure
            off_bits_set: off_bits = a_off_bits

    set_reserved1 (a_reserved1: INTEGER)
        ensure
            reserved1_set: reserved1 = a_reserved1

    set_reserved2 (a_reserved2: INTEGER)
        ensure
            reserved2_set: reserved2 = a_reserved2

    set_size (a_size: INTEGER)
        ensure
            size_set: size = a_size

    set_type (a_type: INTEGER)
        ensure
            type_set: type = a_type

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BITMAP_FILE_HEADER


WEL_BITMAP_INFO Chart

class
    WEL_BITMAP_INFO

General
    cluster: wel.structs
    description: "Defines the dimensions and color information for a Windows device-independent bitmap (DIB)."
    create: make_by_pointer, make_by_dc, make

Ancestors
    WEL_DIB_COLORS_CONSTANTS
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    header: WEL_BITMAP_INFO_HEADER
    item: POINTER
    rgb_quad (index: INTEGER): WEL_RGB_QUAD
    rgb_quad_count: INTEGER
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER
    valid_dib_colors_constant (c: INTEGER): BOOLEAN

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bitmap_info_header (a_header: WEL_BITMAP_INFO_HEADER)
    set_item (an_item: POINTER)
    set_rgb_quad (index: INTEGER; a_rgb_quad: WEL_RGB_QUAD)
    set_shared
    set_unshared


WEL_BITMAP_INFO Flat contracts

indexing
    description: "Defines the dimensions and color information for a Windows device-independent bitmap (DIB)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BITMAP_INFO

create

    make (a_bitmap_info_header: WEL_BITMAP_INFO_HEADER; a_rgb_quad_count: INTEGER)
            -- Make a BITMAPINFO structure
            -- with a_bitmap_info_header
        require
            a_bitmap_info_header_not_void: a_bitmap_info_header /= void
            positive_rgb_quad_count: a_rgb_quad_count >= 0

    make_by_dc (dc: WEL_DC; bitmap: WEL_BITMAP; usage: INTEGER)
            -- Make a bitmap info structure using dc and
            -- bitmap.
            -- See class WEL_DIB_COLORS_CONSTANTS for usage
            -- values.
        require
            dc_not_void: dc /= void
            dc_exists: dc.exists
            bitmap_not_void: bitmap /= void
            bitmap_exists: bitmap.exists
            valid_usage: valid_dib_colors_constant (usage)

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    header: WEL_BITMAP_INFO_HEADER
            -- Information about the dimensions and color
            -- format of a DIB
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    rgb_quad (index: INTEGER): WEL_RGB_QUAD
            -- Bitmap color at zero-based index
        require
            index_small_enough: index < rgb_quad_count
            index_large_enough: index >= 0
        ensure
            result_not_void: Result /= void

    rgb_quad_count: INTEGER
            -- Number of colors

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_dib_colors_constant (c: INTEGER): BOOLEAN
            -- Is c a valid dib colors constant?
            -- (from WEL_DIB_COLORS_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bitmap_info_header (a_header: WEL_BITMAP_INFO_HEADER)
            -- Set header with a_header.
        require
            a_header_not_void: a_header /= void

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_rgb_quad (index: INTEGER; a_rgb_quad: WEL_RGB_QUAD)
            -- Set rgb_quad with a_rgb_quad at
            -- zero-based index.
        require
            index_small_enough: index < rgb_quad_count
            index_large_enough: index >= 0
            a_rgb_quad_not_void: a_rgb_quad /= void

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BITMAP_INFO


WEL_BITMAP_INFO_HEADER Chart

class
    WEL_BITMAP_INFO_HEADER

General
    cluster: wel.structs
    description: "Contains information about the dimensions and color format of a device-independent bitmap (DIB)."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    bit_count: INTEGER
    clr_important: INTEGER
    clr_used: INTEGER
    compression: INTEGER
    exists: BOOLEAN
    height: INTEGER
    item: POINTER
    planes: INTEGER
    shared: BOOLEAN
    size_image: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER
    width: INTEGER
    x_pels_per_meter: INTEGER
    y_pels_per_meter: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bit_count (a_bit_count: INTEGER)
    set_clr_important (a_clr_important: INTEGER)
    set_clr_used (a_clr_used: INTEGER)
    set_compression (a_compression: INTEGER)
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_planes (a_planes: INTEGER)
    set_shared
    set_size_image (a_size_image: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x_pels_per_meter (a_x_pels_per_meter: INTEGER)
    set_y_pels_per_meter (a_y_pels_per_meter: INTEGER)


WEL_BITMAP_INFO_HEADER Flat contracts

indexing
    description: "Contains information about the dimensions and color format of a device-independent bitmap (DIB)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BITMAP_INFO_HEADER

create

    make
        ensure
            width_set: width = 0
            height_set: height = 0
            planes_set: planes = 0
            bit_count_set: bit_count = 0
            compression_set: compression = 0
            size_image_set: size_image = 0
            x_pels_per_meter_set: x_pels_per_meter = 0
            y_pels_per_meter_set: y_pels_per_meter = 0
            clr_used_set: clr_used = 0
            clr_important_set: clr_important = 0

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    bit_count: INTEGER

    clr_important: INTEGER

    clr_used: INTEGER

    compression: INTEGER

    height: INTEGER

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    planes: INTEGER

    size_image: INTEGER

    width: INTEGER

    x_pels_per_meter: INTEGER

    y_pels_per_meter: INTEGER

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bit_count (a_bit_count: INTEGER)
        ensure
            bit_count_set: bit_count = a_bit_count

    set_clr_important (a_clr_important: INTEGER)
        ensure
            clr_important_set: clr_important = a_clr_important

    set_clr_used (a_clr_used: INTEGER)
        ensure
            clr_used_set: clr_used = a_clr_used

    set_compression (a_compression: INTEGER)
        ensure
            compression_set: compression = a_compression

    set_height (a_height: INTEGER)
        ensure
            height_set: height = a_height

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_planes (a_planes: INTEGER)
        ensure
            planes_set: planes = a_planes

    set_size_image (a_size_image: INTEGER)
        ensure
            size_image_set: size_image = a_size_image

    set_width (a_width: INTEGER)
        ensure
            width_set: width = a_width

    set_x_pels_per_meter (a_x_pels_per_meter: INTEGER)
        ensure
            x_pels_per_meter_set: x_pels_per_meter = a_x_pels_per_meter

    set_y_pels_per_meter (a_y_pels_per_meter: INTEGER)
        ensure
            y_pels_per_meter_set: y_pels_per_meter = a_y_pels_per_meter

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BITMAP_INFO_HEADER


WEL_CHARACTER_ARRAY Chart

class
    WEL_CHARACTER_ARRAY

General
    cluster: wel.structs
    description: "Fixed character array for WEL_STRUCTURE. Used internally by WEL.  useful to protect character arrays within an external call"
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    count: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    structure_size: INTEGER
    to_array (a_lower: INTEGER): ARRAY [CHARACTER]
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    positive count


WEL_CHARACTER_ARRAY Flat contracts

indexing
    description: "Fixed character array for WEL_STRUCTURE. Used internally by WEL.  useful to protect character arrays within an external call"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHARACTER_ARRAY

create

    make (an_array: ARRAY [CHARACTER])
            -- Create a fixed character array
            -- from an existing standard character array.
        require
            an_array_not_void: an_array /= void
        ensure
            set: to_array (an_array.lower).is_equal (an_array)

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    count: INTEGER
            -- Number of items in the array

    structure_size: INTEGER
            -- Size of the array (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_array (a_lower: INTEGER): ARRAY [CHARACTER]
            -- Eiffel array
        ensure
            array_not_void: Result /= void
            lower_set: Result.lower = a_lower
            count_set: Result.count = count

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    positive_count: count >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHARACTER_ARRAY


WEL_CHARACTER_FORMAT Chart

class
    WEL_CHARACTER_FORMAT

General
    cluster: wel.structs
    description: "Contains information about character formatting in a rich edit control."
    create: make_by_pointer, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_CFE_CONSTANTS
    WEL_CFM_CONSTANTS
    WEL_STRUCTURE

Queries
    char_set: INTEGER
    effects: INTEGER
    exists: BOOLEAN
    face_name: STRING
    has_effects (an_effects: INTEGER): BOOLEAN
    has_mask (a_mask: INTEGER): BOOLEAN
    height: INTEGER
    item: POINTER
    mask: INTEGER
    Max_face_name_length: INTEGER
    offset: INTEGER
    pitch_and_family: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    text_color: WEL_COLOR_REF
    to_integer: INTEGER

Commands
    add_effects (an_effects: INTEGER)
    add_mask (a_mask: INTEGER)
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_effects (an_effects: INTEGER)
    remove_mask (a_mask: INTEGER)
    set_all_masks
    set_bold
    set_char_set (a_char_set: INTEGER)
    set_default_format
    set_effects (an_effects: INTEGER)
    set_face_name (a_face_name: STRING)
    set_height (a_height: INTEGER)
    set_italic
    set_item (an_item: POINTER)
    set_mask (a_mask: INTEGER)
    set_offset (an_offset: INTEGER)
    set_pitch_and_family (a_pitch_and_family: INTEGER)
    set_protected
    set_shared
    set_strike_out
    set_text_color (a_color: WEL_COLOR_REF)
    set_underline
    set_unshared
    unset_bold
    unset_italic
    unset_protected
    unset_strike_out
    unset_underline


WEL_CHARACTER_FORMAT Flat contracts

indexing
    description: "Contains information about character formatting in a rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHARACTER_FORMAT

create

    make
            -- Make a char format structure.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    char_set: INTEGER
            -- Character set value. Can be one of the values
            -- specified for the char_set function of the
            -- WEL_LOG_FONT structure.

    effects: INTEGER
            -- Character effects.
            -- See class WEL_CFE_CONSTANTS for values.

    face_name: STRING
            -- Font face name
        ensure
            result_not_void: Result /= void

    height: INTEGER
            -- Character height

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- Valid information or attributes to set.
            -- See class WEL_CFM_CONSTANTS for values.
            -- This attribut is automatically set by the
            -- features set_*.

    max_face_name_length: INTEGER
            -- Maximum face name length

    offset: INTEGER
            -- Character offset from the baseline. If the value
            -- is positive, the character is a superscript; if it
            -- is negative, the character is a subscript.

    pitch_and_family: INTEGER
            -- Font pitch and family. This value is the same as
            -- pitch_and_family of the WEL_LOG_FONT structure.

    text_color: WEL_COLOR_REF
            -- Text color
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_effects (an_effects: INTEGER): BOOLEAN
            -- Is an_effects set in effects?
            -- See class WEL_CFE_CONSTANTS for an_effects values.

    has_mask (a_mask: INTEGER): BOOLEAN
            -- Is a_mask set in mask?
            -- See class WEL_CFM_CONSTANTS for a_mask values.

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_effects (an_effects: INTEGER)
            -- Add an_effects to effects.
            -- See class WEL_CFE_CONSTANTS for a_mask values.
        ensure
            has_effects: has_effects (an_effects)

    add_mask (a_mask: INTEGER)
            -- Add a_mask to mask.
            -- See class WEL_CFM_CONSTANTS for a_mask values.
        ensure
            has_mask: has_mask (a_mask)

    remove_effects (an_effects: INTEGER)
            -- Remove an_effects from effects.
            -- See class WEL_CFE_CONSTANTS for a_mask values.
        ensure
            has_not_effects: not has_effects (an_effects)

    remove_mask (a_mask: INTEGER)
            -- Remove a_mask from mask.
            -- See class WEL_CFM_CONSTANTS for a_mask values.
        ensure
            has_not_mask: not has_mask (a_mask)

    set_all_masks
            -- Set mask with all possible values.

    set_bold
            -- Set bold characters.

    set_char_set (a_char_set: INTEGER)
            -- Set char_set with a_char_set.
        ensure
            char_set_set: char_set = a_char_set

    set_default_format
            -- Set Current to default formatting.

    set_effects (an_effects: INTEGER)
            -- Set effects with an_effects.
            -- See class WEL_CFE_CONSTANTS for a_mask values.
        ensure
            effects_set: effects = an_effects

    set_face_name (a_face_name: STRING)
            -- Set face_name with a_face_name.
        require
            a_face_name_not_void: a_face_name /= void
            valid_count: a_face_name.count <= max_face_name_length
        ensure
            face_name_set: face_name.is_equal (a_face_name)

    set_height (a_height: INTEGER)
            -- Set height with a_height (height specified in points).
        ensure
            height_set: height = a_height * 20

    set_italic
            -- Set italic characters.

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_mask (a_mask: INTEGER)
            -- Set mask with a_mask.
            -- See class WEL_CFM_CONSTANTS for a_mask values.
        ensure
            mask_set: mask = a_mask

    set_offset (an_offset: INTEGER)
            -- Set offset with an_offset.
        ensure
            offset_set: offset = an_offset

    set_pitch_and_family (a_pitch_and_family: INTEGER)
            -- Set pitch_and_family with a_pitch_and_family.
        ensure
            pitch_and_family_set: pitch_and_family = a_pitch_and_family

    set_protected
            -- Set protected characters.

    set_strike_out
            -- Set strike out characters.

    set_text_color (a_color: WEL_COLOR_REF)
            -- Set text_color with a_text_color.
        ensure
            text_color_set: text_color.item = a_color.item

    set_underline
            -- Set underline characters.

    unset_bold
            -- Unset bold characters.

    unset_italic
            -- Unset italic characters.

    unset_protected
            -- Unset protected characters.

    unset_strike_out
            -- Unset strike out characters.

    unset_underline
            -- Unset underline characters.

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHARACTER_FORMAT


WEL_CHARACTER_RANGE Chart

class
    WEL_CHARACTER_RANGE

General
    cluster: wel.structs
    description: "Specifies a range of characters in a rich edit control."
    create: make_by_pointer, make_empty, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    maximum: INTEGER
    minimum: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_range (a_minimum, a_maximum: INTEGER)
    set_shared
    set_unshared

Constraints
    positive minimum
    valid minumum maximum


WEL_CHARACTER_RANGE Flat contracts

indexing
    description: "Specifies a range of characters in a rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CHARACTER_RANGE

create

    make (a_minimum, a_maximum: INTEGER)
            -- Make a char range structure and set maximum,
            -- minimum, with a_maximum, a_minimum
        require
            positive_minimum: a_minimum >= 0
            valid_maximum: a_minimum = 0 implies a_maximum >= - 1
            positive_maximum: a_minimum > 0 implies a_maximum >= 0
        ensure
            minimum_set: minimum = a_minimum
            maximum_set: maximum = a_maximum

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_empty
            -- Make an empty character range structure.
        ensure
            minimum_set: minimum = 0
            maximum_set: maximum = 0

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    maximum: INTEGER
            -- Index of last intercharacter position

    minimum: INTEGER
            -- Index of first intercharacter position

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_range (a_minimum, a_maximum: INTEGER)
            -- Set minimum with a_minimum and
            -- maximum with a_maximum
        require
            positive_minimum: a_minimum >= 0
            valid_maximum: a_minimum = 0 implies a_maximum >= - 1
            positive_maximum: a_minimum > 0 implies a_maximum >= 0
        ensure
            minimum_set: minimum = a_minimum
            maximum_set: maximum = a_maximum

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    positive_minimum: minimum >= 0
    valid_minumum_maximum: maximum >= minimum
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CHARACTER_RANGE


WEL_CLIENT_CREATE_STRUCT Chart

class
    WEL_CLIENT_CREATE_STRUCT

General
    cluster: wel.structs
    description: "Contains information about the menu of a MDI application."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    first_child: INTEGER
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    window_menu: WEL_MENU

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_first_child (a_first_child: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    set_window_menu (a_window_menu: WEL_MENU)


WEL_CLIENT_CREATE_STRUCT Flat contracts

indexing
    description: "Contains information about the menu of a MDI application."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CLIENT_CREATE_STRUCT

create

    make (a_window_menu: WEL_MENU; a_first_child: INTEGER)
            -- Make a client structure with a_window_menu and
            -- a_first_child.
        require
            a_window_menu_not_void: a_window_menu /= void
            a_window_menu_exists: a_window_menu.exists
        ensure
            window_menu_set: window_menu.item = a_window_menu.item
            first_child_set: first_child = a_first_child

feature -- Access

    first_child: INTEGER
            -- Child window identifier of the first MDI child
            -- window created.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    window_menu: WEL_MENU
            -- MDI application's window menu
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_first_child (a_first_child: INTEGER)
            -- Set first_child with a_first_child.
        ensure
            first_child_set: first_child = a_first_child

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_window_menu (a_window_menu: WEL_MENU)
            -- Set window_menu with a_window_menu.
        require
            a_window_menu_not_void: a_window_menu /= void
            a_window_menu_exists: a_window_menu.exists
        ensure
            window_menu_set: window_menu.item = a_window_menu.item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CLIENT_CREATE_STRUCT


WEL_COMBO_BOX_EX_ITEM Chart

class
    WEL_COMBO_BOX_EX_ITEM

General
    cluster: wel.structs
    description: "Combo-box item. An item that handle a text and a bitmap."
    create: make_with_index, make_by_pointer, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_CBEIF_CONSTANTS
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    image: INTEGER
    indent: INTEGER
    index: INTEGER
    item: POINTER
    mask: INTEGER
    overlay: INTEGER
    selected_image: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    to_integer: INTEGER

Commands
    clear_mask
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_image (value: INTEGER)
    set_indent (value: INTEGER)
    set_index (value: INTEGER)
    set_item (an_item: POINTER)
    set_overlay (value: INTEGER)
    set_selected_image (value: INTEGER)
    set_shared
    set_text (txt: STRING)
    set_unshared


WEL_COMBO_BOX_EX_ITEM Flat contracts

indexing
    description: "Combo-box item. An item that handle a text and a bitmap."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMBO_BOX_EX_ITEM

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_with_index (value: INTEGER)
            -- Create an item with value as index.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    image: INTEGER
            -- Zero-based index of an image within the image list.
            -- The specified image will be displayed for the item
            -- when it is not selected.
        require
            exists: exists

    indent: INTEGER
            -- Number of indent space to display for the item.
            -- Each indentation equals 10 pixels.
        require
            exists: exists

    index: INTEGER
            -- Zero-based index of the item.
        require
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- Array of flags that indicate which of the other
            -- structure members contain valid data or which are
            -- to be filled in. This member can be a combination
            -- of the Cbeif_* values.
            -- See class WEL_CBEIF_CONSTANTS.
        require
            exists: exists

    overlay: INTEGER
            -- One-based index of an overlay image within the image
            -- list.
        require
            exists: exists

    selected_image: INTEGER
            -- Zero-based index of an image within the image list.
            -- The specified image will be displayed for the item
            -- when it is selected.
        require
            exists: exists

    text: STRING
            -- Text of the current item
        require
            exists: exists
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_image (value: INTEGER)
            -- Make value the new image index.
        require
            exists: exists
        ensure
            value_set: image = value

    set_indent (value: INTEGER)
            -- Make value the new indent.
        require
            exists: exists
        ensure
            value_set: indent = value

    set_index (value: INTEGER)
            -- Make value the new index.
        require
            exists: exists
        ensure
            value_set: index = value

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_overlay (value: INTEGER)
            -- Make value the new overlay.
        require
            exists: exists
        ensure
            value_set: overlay = value

    set_selected_image (value: INTEGER)
            -- Make value the new selected image index.
        require
            exists: exists
        ensure
            value_set: selected_image = value

    set_text (txt: STRING)
            -- Make txt the new text.
        require
            exists: exists
            valid_text: txt /= void
        ensure
            text_set: text.is_equal (txt)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic operation

    clear_mask
            -- Clear the current mask.
            -- Call it before to call a set_? feature when you
            -- want to change only one parameter.
        require
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMBO_BOX_EX_ITEM


WEL_COMPARE_ITEM_STRUCT Chart

class
    WEL_COMPARE_ITEM_STRUCT

General
    cluster: wel.structs
    description:
        "Supplies the identifiers and application-supplied data for two
        items in a sorted, owner-drawn list box or combo box.
        Whenever an application adds a new item to an owner-drawn
        list box or combo box created with the CBS_SORT or LBS_SORT
        style, the system sends the owner a Wm_compareitem message.
        The `lparam' parameter of the message contains a long pointer
        to a COMPAREITEMSTRUCT structure. Upon receiving the message,
        the owner compares the two items and returns a value indicating
        which item sorts before the other. "
    create: make_by_pointer

Ancestors
    WEL_STRUCTURE
    WEL_WINDOWS_ROUTINES

Queries
    ctl_id: INTEGER
    ctl_type: INTEGER
    exists: BOOLEAN
    foreground_window: WEL_WINDOW
    is_window (hwnd: POINTER): BOOLEAN
    item: POINTER
    item_data_1: POINTER
    item_data_2: POINTER
    item_id_1: INTEGER
    item_id_2: INTEGER
    key_down (virtual_key: INTEGER): BOOLEAN
    key_locked (virtual_key: INTEGER): BOOLEAN
    key_to_string (key_data: INTEGER): STRING
    locale_id: INTEGER
    resource_string_id (an_id: INTEGER): STRING
    shared: BOOLEAN
    Structure_size: INTEGER
    system_directory: STRING
    tick_count: INTEGER
    to_integer: INTEGER
    window_item: WEL_CONTROL
    window_of_item (hwnd: POINTER): WEL_WINDOW
    windows_directory: STRING

Commands
    dispose
    hide_cursor
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    message_beep_asterisk
    message_beep_exclamation
    message_beep_hand
    message_beep_ok
    message_beep_question
    output_debug_string (s: STRING)
    set_cursor_position_absolute (x, y: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    show_cursor


WEL_COMPARE_ITEM_STRUCT Flat contracts

indexing
    description: "[
            Supplies the identifiers and application-supplied data for two
            items in a sorted, owner-drawn list box or combo box.
            Whenever an application adds a new item to an owner-drawn
            list box or combo box created with the CBS_SORT or LBS_SORT
            style, the system sends the owner a Wm_compareitem message.
            The `lparam' parameter of the message contains a long pointer
            to a COMPAREITEMSTRUCT structure. Upon receiving the message,
            the owner compares the two items and returns a value indicating
            which item sorts before the other.
    ]"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_COMPARE_ITEM_STRUCT

create

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    ctl_id: INTEGER
            -- Specifies the identifier of the list box or combo box.

    ctl_type: INTEGER
            -- Control type.
            -- See class WEL_ODT_CONSTANTS.
            -- Specifies ODT_LISTBOX or ODT_COMBOBOX.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    item_data_1: POINTER
            -- Specifies application-supplied data for the
            -- first item being compared. (This value was
            -- passed as the lParam parameter of the message
            -- that added the item to the list box or combo box.)

    item_data_2: POINTER
            -- Specifies application-supplied data for the
            -- second item being compared. This value was
            -- passed as the lParam parameter of the message
            -- that added the item to the list box or combo box.
            -- This member will be -1 if the item has not been
            -- inserted or when searching for a potential item
            -- in the list box or combo box.

    item_id_1: INTEGER
            -- Specifies the index of the first item in
            -- the list box or combo box being compared.
            -- This member will be -1 if the item has not
            -- been inserted or when searching for a potential
            -- item in the list box or combo box.

    item_id_2: INTEGER
            -- Specifies the index of the second item in the
            -- list box or combo box being compared.

    locale_id: INTEGER
            -- Specifies the locale identifier. To create a
            -- locale identifier, use the MAKELCID macro.

    window_item: WEL_CONTROL
            -- Identifies the control.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    foreground_window: WEL_WINDOW
            -- Foreground window (window with focus)
            -- (from WEL_WINDOWS_ROUTINES)

    is_window (hwnd: POINTER): BOOLEAN
            -- Does hwnd point to a valid Window?
            -- (from WEL_WINDOWS_ROUTINES)

    key_down (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key pressed
            -- (from WEL_WINDOWS_ROUTINES)

    key_locked (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key locked
            -- (from WEL_WINDOWS_ROUTINES)

    key_to_string (key_data: INTEGER): STRING
            -- Give the string associated with the key given by
            -- virtual_key.
            -- (from WEL_WINDOWS_ROUTINES)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    system_directory: STRING
            -- Path of the Windows system directory
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

    tick_count: INTEGER
            -- Number of milliseconds that have
            -- elapsed since Windows was started.
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            positive_result: Result >= 0

    window_of_item (hwnd: POINTER): WEL_WINDOW
            -- Retrieve Eiffel object associated with hwnd pointer.
            -- (from WEL_WINDOWS_ROUTINES)
        require -- from WEL_WINDOWS_ROUTINES
            hwnd_not_null: hwnd /= default_pointer
            is_window_pointer: is_window (hwnd)
        ensure -- from WEL_WINDOWS_ROUTINES
            is_wel_window: Result /= void implies (create {INTERNAL}).type_conforms_to ((create {INTERNAL}).dynamic_type (Result), (create {INTERNAL}).dynamic_type_from_string ("WEL_WINDOW"))

    windows_directory: STRING
            -- Path of the Windows directory
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    hide_cursor
            -- Hide the cursor.
            -- (from WEL_WINDOWS_ROUTINES)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    message_beep_asterisk
            -- Play the system asterisk waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_exclamation
            -- Play the system exclamation waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_hand
            -- Play the system hand waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_ok
            -- Play the system ok waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_question
            -- Play the system question waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    output_debug_string (s: STRING)
            -- Send a string s to the system debugger.
            -- (from WEL_WINDOWS_ROUTINES)
        require -- from WEL_WINDOWS_ROUTINES
            s_not_void: s /= void

    resource_string_id (an_id: INTEGER): STRING
            -- String identified by an_id in the resource file.
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

    set_cursor_position_absolute (x, y: INTEGER)
            -- Set the cursor position to x, y.
            -- (from WEL_WINDOWS_ROUTINES)

    show_cursor
            -- Show the cursor.
            -- (from WEL_WINDOWS_ROUTINES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMPARE_ITEM_STRUCT


WEL_DELETE_ITEM_STRUCT Chart

class
    WEL_DELETE_ITEM_STRUCT

General
    cluster: wel.structs
    description:
        "Describes a deleted list box or combo box item.
        The `lparam' parameter of a Wm_deleteitem message
        contains a pointer to this structure. When an
        item is removed from a list box or combo box
        or when a list box or combo box is destroyed,
        the system sends the Wm_deleteitem message to
        the owner for each deleted item. "
    create: make_by_pointer

Ancestors
    WEL_STRUCTURE
    WEL_WINDOWS_ROUTINES

Queries
    ctl_id: INTEGER
    ctl_type: INTEGER
    exists: BOOLEAN
    foreground_window: WEL_WINDOW
    is_window (hwnd: POINTER): BOOLEAN
    item: POINTER
    item_data: POINTER
    item_id: INTEGER
    key_down (virtual_key: INTEGER): BOOLEAN
    key_locked (virtual_key: INTEGER): BOOLEAN
    key_to_string (key_data: INTEGER): STRING
    resource_string_id (an_id: INTEGER): STRING
    shared: BOOLEAN
    Structure_size: INTEGER
    system_directory: STRING
    tick_count: INTEGER
    to_integer: INTEGER
    window_item: WEL_CONTROL
    window_of_item (hwnd: POINTER): WEL_WINDOW
    windows_directory: STRING

Commands
    dispose
    hide_cursor
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    message_beep_asterisk
    message_beep_exclamation
    message_beep_hand
    message_beep_ok
    message_beep_question
    output_debug_string (s: STRING)
    set_cursor_position_absolute (x, y: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    show_cursor


WEL_DELETE_ITEM_STRUCT Flat contracts

indexing
    description: "[
            Describes a deleted list box or combo box item.
            The `lparam' parameter of a Wm_deleteitem message
            contains a pointer to this structure. When an
            item is removed from a list box or combo box
            or when a list box or combo box is destroyed,
            the system sends the Wm_deleteitem message to
            the owner for each deleted item.
    ]"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_DELETE_ITEM_STRUCT

create

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    ctl_id: INTEGER
            -- Specifies the identifier of the list box or combo box.

    ctl_type: INTEGER
            -- Specifies one of the following values to
            -- indicate whether the item was deleted from
            -- a list box or a combo box.
            -- See class WEL_ODT_CONSTANTS.
            -- Specifies ODT_LISTBOX or ODT_COMBOBOX.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    item_data: POINTER
            -- Specifies application-defined data for the item.
            -- This value is passed to the control in the
            -- lparam parameter of the message that adds
            -- the item to the list box or combo box.

    item_id: INTEGER
            -- Specifies index of the item in the list box or
            -- combo box being removed.

    window_item: WEL_CONTROL
            -- Identifies the control.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    foreground_window: WEL_WINDOW
            -- Foreground window (window with focus)
            -- (from WEL_WINDOWS_ROUTINES)

    is_window (hwnd: POINTER): BOOLEAN
            -- Does hwnd point to a valid Window?
            -- (from WEL_WINDOWS_ROUTINES)

    key_down (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key pressed
            -- (from WEL_WINDOWS_ROUTINES)

    key_locked (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key locked
            -- (from WEL_WINDOWS_ROUTINES)

    key_to_string (key_data: INTEGER): STRING
            -- Give the string associated with the key given by
            -- virtual_key.
            -- (from WEL_WINDOWS_ROUTINES)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    system_directory: STRING
            -- Path of the Windows system directory
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

    tick_count: INTEGER
            -- Number of milliseconds that have
            -- elapsed since Windows was started.
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            positive_result: Result >= 0

    window_of_item (hwnd: POINTER): WEL_WINDOW
            -- Retrieve Eiffel object associated with hwnd pointer.
            -- (from WEL_WINDOWS_ROUTINES)
        require -- from WEL_WINDOWS_ROUTINES
            hwnd_not_null: hwnd /= default_pointer
            is_window_pointer: is_window (hwnd)
        ensure -- from WEL_WINDOWS_ROUTINES
            is_wel_window: Result /= void implies (create {INTERNAL}).type_conforms_to ((create {INTERNAL}).dynamic_type (Result), (create {INTERNAL}).dynamic_type_from_string ("WEL_WINDOW"))

    windows_directory: STRING
            -- Path of the Windows directory
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    hide_cursor
            -- Hide the cursor.
            -- (from WEL_WINDOWS_ROUTINES)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    message_beep_asterisk
            -- Play the system asterisk waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_exclamation
            -- Play the system exclamation waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_hand
            -- Play the system hand waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_ok
            -- Play the system ok waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_question
            -- Play the system question waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    output_debug_string (s: STRING)
            -- Send a string s to the system debugger.
            -- (from WEL_WINDOWS_ROUTINES)
        require -- from WEL_WINDOWS_ROUTINES
            s_not_void: s /= void

    resource_string_id (an_id: INTEGER): STRING
            -- String identified by an_id in the resource file.
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

    set_cursor_position_absolute (x, y: INTEGER)
            -- Set the cursor position to x, y.
            -- (from WEL_WINDOWS_ROUTINES)

    show_cursor
            -- Show the cursor.
            -- (from WEL_WINDOWS_ROUTINES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DELETE_ITEM_STRUCT


WEL_DLG_TEMPLATE Chart

class
    WEL_DLG_TEMPLATE

General
    cluster: wel.structs
    description: "Objects that contain information about a dialog template."
    create: make_with_global_alloc, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    cdit: INTEGER
    cx: INTEGER
    cy: INTEGER
    dwextendedstyle: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    style: INTEGER
    to_integer: INTEGER
    x: INTEGER
    y: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_cdit (a_value: INTEGER)
    set_cx (a_cx: INTEGER)
    set_cy (a_cy: INTEGER)
    set_dwextendedstyle (a_style: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_style (a_style: INTEGER)
    set_unshared
    set_x (an_x: INTEGER)
    set_y (a_y: INTEGER)


WEL_DLG_TEMPLATE Flat contracts

indexing
    description: "Objects that contain information about a dialog template."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DLG_TEMPLATE

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_with_global_alloc
            -- Allocate item with call to GlobalAlloc instead of malloc
        ensure
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    cdit: INTEGER
            -- Number of items in dialog.

    cx: INTEGER
            -- Width of dialog.

    cy: INTEGER
            -- Height of dialog.

    dwextendedstyle: INTEGER
            -- Extended style of dialog.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    style: INTEGER
            -- Style of dialog.

    x: INTEGER
            -- X coordinate of dialog.

    y: INTEGER
            -- Y coordinate of dialog.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Status setting.

    set_cdit (a_value: INTEGER)
            -- Assign a_value to cdit.

    set_cx (a_cx: INTEGER)
            -- Assign a_cx to x.

    set_cy (a_cy: INTEGER)
            -- Assign a_cy to cy.

    set_dwextendedstyle (a_style: INTEGER)
            -- Assign a_style to dwextendedstyle.

    set_style (a_style: INTEGER)
            -- Assign a_style to style.

    set_x (an_x: INTEGER)
            -- Assign an_x to x.

    set_y (a_y: INTEGER)
            -- Assign a_y to y.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DLG_TEMPLATE


WEL_DOC_INFO Chart

class
    WEL_DOC_INFO

General
    cluster: wel.structs
    description: "Contains the input filename used by `start_doc' in WEL_PRINTER_DC."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    default_output_set: BOOLEAN
    document_name: STRING
    exists: BOOLEAN
    item: POINTER
    output: STRING
    shared: BOOLEAN
    str_document_name: WEL_STRING
    str_output: WEL_STRING
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_default_output
    set_document_name (a_document_name: STRING)
    set_item (an_item: POINTER)
    set_output (an_output: STRING)
    set_shared
    set_unshared


WEL_DOC_INFO Flat contracts

indexing
    description: "Contains the input filename used by `start_doc' in WEL_PRINTER_DC."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DOC_INFO

create

    make (a_document_name: STRING)
            -- Make doc info structure with document_name,
        ensure
            document_name_set: document_name.is_equal (a_document_name)

feature -- Access

    document_name: STRING
            -- Name of the document
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    output: STRING
            -- Name of the output file
        require
            default_output_not_set: not default_output_set
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    default_output_set: BOOLEAN
            -- Is the default output set?

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_default_output
            -- Set the output to the default system value.
        ensure
            default_output_set: default_output_set

    set_document_name (a_document_name: STRING)
            -- Set document_name with a_document_name.
        require
            a_document_name_not_void: a_document_name /= void
        ensure
            document_name_set: document_name.is_equal (a_document_name)

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_output (an_output: STRING)
            -- Set output with an_output.
        require
            an_output_not_void: an_output /= void
        ensure
            output_set: output.is_equal (an_output)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Implementation

    str_document_name: WEL_STRING
            -- C string to save the document name

    str_output: WEL_STRING
            -- C string to save the output

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DOC_INFO


WEL_DRAW_ITEM_STRUCT Chart

class
    WEL_DRAW_ITEM_STRUCT

General
    cluster: wel.structs
    description: "Contains information about the Wm_drawitem message."
    create: make_by_pointer

Ancestors
    WEL_STRUCTURE
    WEL_WINDOW_MANAGER

Queries
    ctl_id: INTEGER
    ctl_type: INTEGER
    dc: WEL_CLIENT_DC
    exists: BOOLEAN
    item: POINTER
    item_action: INTEGER
    item_data: INTEGER
    item_id: INTEGER
    item_state: INTEGER
    menu_item: WEL_MENU
    rect_item: WEL_RECT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    window_item: WEL_CONTROL

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    dc exists


WEL_DRAW_ITEM_STRUCT Flat contracts

indexing
    description: "Contains information about the Wm_drawitem message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DRAW_ITEM_STRUCT

create

    make_by_pointer (pointer: POINTER)

feature -- Access

    ctl_id: INTEGER
            -- Control identifier

    ctl_type: INTEGER
            -- Control type.
            -- See class WEL_ODT_CONSTANTS.

    dc: WEL_CLIENT_DC
            -- Device context used when performing drawing
            -- operations on the control.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    item_action: INTEGER
            -- Drawing action required.
            -- See class WEL_ODA_CONSTANTS.

    item_data: INTEGER
            -- 32-bit value associated with the menu item.

    item_id: INTEGER
            -- Menu item identifier for a menu item or
            -- the index of the item in a list box or
            -- combo box

    item_state: INTEGER
            -- Visual state of the item after the current
            -- drawing action takes place.
            -- See class WEL_ODS_CONSTANTS.

    menu_item: WEL_MENU
            -- Identifies the control (menus only).
        require
            feature_supported: ctl_type = (create {WEL_ODT_CONSTANTS}).odt_menu

    rect_item: WEL_RECT
            -- Rectangle that defines the boundaries
            -- of the control to be drawn.
        ensure
            result_not_void: Result /= void

    window_item: WEL_CONTROL
            -- Identifies the control (cver all cases except menus).
        require
            feature_supported: ctl_type /= (create {WEL_ODT_CONSTANTS}).odt_menu

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    dc_exists: dc /= void and then dc.exists
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DRAW_ITEM_STRUCT


WEL_ENUM_LOG_FONT Chart

class
    WEL_ENUM_LOG_FONT

General
    cluster: wel.structs
    description: "Defines the attributes, the complete name, the style of a font. This structure is used by WEL_FONT_FAMILY_ENUMERATOR."
    create: make_with_pointer

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    full_name: STRING
    item: POINTER
    log_font: WEL_LOG_FONT
    shared: BOOLEAN
    Structure_size: INTEGER
    style: STRING
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make_with_pointer (a_pointer: POINTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_ENUM_LOG_FONT Flat contracts

indexing
    description: "Defines the attributes, the complete name, the style of a font. This structure is used by WEL_FONT_FAMILY_ENUMERATOR."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ENUM_LOG_FONT

create

    make_with_pointer (a_pointer: POINTER)
            -- Copy structure pointed by a_pointer into item.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.

feature -- Access

    full_name: STRING
            -- Specifies a unique name for the font
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    log_font: WEL_LOG_FONT
            -- Defines the attribut of a font
        ensure
            result_not_void: Result /= void

    style: STRING
            -- Specifies the style of the font
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Creation

    make_with_pointer (a_pointer: POINTER)
            -- Copy structure pointed by a_pointer into item.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ENUM_LOG_FONT


WEL_FILE_TIME Chart

class
    WEL_FILE_TIME

General
    cluster: wel.structs
    description: "Wrapper of FILETIME structure"
    create: make_by_file_creation_time, make, make_by_file_modification_time, make_by_file_access_time, make_by_current_time, make_by_pointer

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    is_equal (a_file_time: WEL_FILE_TIME): BOOLEAN
    is_larger_than (a_file_time: WEL_FILE_TIME): BOOLEAN
    item: POINTER
    local_file_time: WEL_FILE_TIME
    shared: BOOLEAN
    structure_size: INTEGER
    system_time: WEL_SYSTEM_TIME
    to_integer: INTEGER
    universal_file_time: WEL_FILE_TIME

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_shared
    set_unshared


WEL_FILE_TIME Flat contracts

indexing
    description: "Wrapper of FILETIME structure"
    author: "Marina Nudelman"
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FILE_TIME

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_by_current_time
            -- Create FILETIME structure and initialize it
            -- to current universal time.
        ensure
            initialized: item /= default_pointer

    make_by_file_access_time (a_file: FILE)
            -- Create FILETIME structure and initialize
            -- it to universal access time of file a_file
        require
            non_void_file: a_file /= void
        ensure
            initialized: item /= default_pointer

    make_by_file_modification_time (a_file: FILE)
            -- Create FILETIME structure and initialize
            -- it to universal modification time of file a_file
        require
            non_void_file: a_file /= void
        ensure
            initialized: item /= default_pointer

    make_by_file_creation_time (a_file: FILE)
            -- Create FILETIME structure and initialize
            -- it to universal creation time of file a_file
        require
            non_void_file: a_file /= void
        ensure
            initialized: item /= default_pointer

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size of FILETIME structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    local_file_time: WEL_FILE_TIME
            -- universal FILETIME in local FILETIME form
            -- Current must be in universal time form

    system_time: WEL_SYSTEM_TIME
            -- FILETIME in SYSTEMTIME format

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

    universal_file_time: WEL_FILE_TIME
            -- local FILETIME in universal FILETIME form
            -- Current must be in local time form

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    is_equal (a_file_time: WEL_FILE_TIME): BOOLEAN
            -- is a_file_time equal to Current?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

    is_larger_than (a_file_time: WEL_FILE_TIME): BOOLEAN
            -- is Current larger than a_file_time?
        require
            non_default_item: item /= default_pointer

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FILE_TIME


WEL_FIND_ARGUMENT Chart

class
    WEL_FIND_ARGUMENT

General
    cluster: wel.structs
    description: "Contains information associated to 'EM_FINDTEXTEX' messages."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    range: WEL_CHARACTER_RANGE
    range_out: WEL_CHARACTER_RANGE
    shared: BOOLEAN
    string_to_find: WEL_STRING
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_range (a_range: WEL_CHARACTER_RANGE)
    set_shared
    set_string_to_find (a_string_to_find: WEL_STRING)
    set_unshared


WEL_FIND_ARGUMENT Flat contracts

indexing
    description: "Contains information associated to 'EM_FINDTEXTEX' messages."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:24 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FIND_ARGUMENT

create

    make (a_range: WEL_CHARACTER_RANGE; to_find: STRING)
        require
            string_to_find_valid: to_find /= void

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    range: WEL_CHARACTER_RANGE
            -- Range of search

    range_out: WEL_CHARACTER_RANGE
            -- Range in which text is found
            -- Return (0,0) if no text was found

    string_to_find: WEL_STRING
            -- String to find

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_range (a_range: WEL_CHARACTER_RANGE)

    set_string_to_find (a_string_to_find: WEL_STRING)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FIND_ARGUMENT


WEL_FORMAT_RANGE Chart

class
    WEL_FORMAT_RANGE

General
    cluster: wel.structs
    description: "Contains information that a rich edit control uses to format its output for a particular device."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    character_range: WEL_CHARACTER_RANGE
    exists: BOOLEAN
    item: POINTER
    rect: WEL_RECT
    rect_page: WEL_RECT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_character_range (a_character_range: WEL_CHARACTER_RANGE)
    set_dc (a_dc: WEL_DC)
    set_dc_target (a_dc: WEL_DC)
    set_item (an_item: POINTER)
    set_range (min, max: INTEGER)
    set_rect (a_rect: WEL_RECT)
    set_rect_page (a_rect: WEL_RECT)
    set_shared
    set_unshared


WEL_FORMAT_RANGE Flat contracts

indexing
    description: "Contains information that a rich edit control uses to format its output for a particular device."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FORMAT_RANGE

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    character_range: WEL_CHARACTER_RANGE
            -- Range of text to format
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    rect: WEL_RECT
            -- Area to render to.
            -- Units are in TWIPS.
        ensure
            result_not_void: Result /= void

    rect_page: WEL_RECT
            -- Entire area of rendering device.
            -- Units are in TWIPS.
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_character_range (a_character_range: WEL_CHARACTER_RANGE)
            -- Set character_range with a_character_range.
        require
            a_character_range_not_void: a_character_range /= void

    set_dc (a_dc: WEL_DC)
            -- Set the device to render to.
        require
            a_dc_not_void: a_dc /= void

    set_dc_target (a_dc: WEL_DC)
            -- Set the target device to format for.
        require
            a_dc_not_void: a_dc /= void

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_range (min, max: INTEGER)
            -- Set the range with min and max.
        require
            valid_min_max: max >= min
        ensure
            set_min: character_range.minimum = min
            set_max: character_range.maximum = max

    set_rect (a_rect: WEL_RECT)
            -- Set rect with a_rect.
            -- Units are in TWIPS.
        require
            a_rect_not_void: a_rect /= void

    set_rect_page (a_rect: WEL_RECT)
            -- Set rect_page with a_rect.
            -- Units are in TWIPS.
        require
            a_rect_not_void: a_rect /= void

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FORMAT_RANGE


WEL_HD_HIT_TEST_INFO Chart

class
    WEL_HD_HIT_TEST_INFO

General
    cluster: wel.structs
    description: "This class represents a structure that containsinformation about a hit test for a WEL_HEADER_CONTROL"
    create: make_by_pointer, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_STRUCTURE

Queries
    clear_flag (flags, mask: INTEGER): INTEGER
    exists: BOOLEAN
    flag_set (flags, mask: INTEGER): BOOLEAN
    flags: INTEGER
    index: INTEGER
    item: POINTER
    point: WEL_POINT
    set_flag (flags, mask: INTEGER): INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_flags (value: INTEGER)
    set_index (value: INTEGER)
    set_item (an_item: POINTER)
    set_point (a_point: WEL_POINT)
    set_shared
    set_unshared


WEL_HD_HIT_TEST_INFO Flat contracts

indexing
    description: "This class represents a structure that containsinformation about a hit test for a WEL_HEADER_CONTROL"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HD_HIT_TEST_INFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    flags: INTEGER
            -- Variable that receives information about the results of a hit test.
            -- This member can be one or more of the values defined in WEL_HHT_CONSTANTS
        require
            exists: exists

    index: INTEGER
            -- Retrieves the index of the item at point if any
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    point: WEL_POINT
            -- Points to test, in client coordinates
        require
            exists: exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_flags (value: INTEGER)
            -- Sets variable that receives information about the results of a hit test.
            -- This member can be one or more of the values defined in WEL_HHT_CONSTANTS
            -- (Usually set by the OS)
        require
            exists: exists

    set_index (value: INTEGER)
            -- Sets the index of the item at point if any
            -- (Usually set by the OS)
        require
            exists: exists
            positive_value: value >= 0

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_point (a_point: WEL_POINT)
            -- Sets the point to test, in client coordinates
        require
            exists: exists
            point_exists: a_point /= void and then a_point.exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HD_HIT_TEST_INFO


WEL_HD_ITEM Chart

class
    WEL_HD_ITEM

General
    cluster: wel.structs
    description: "Represents structure that is sent to the OS to add,modify, inspect, ... items of a WEL_HEADER_CONTROL"
    create: make_by_pointer, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_HDI_CONSTANTS
    WEL_STRUCTURE

Queries
    bitmap_handle: POINTER
    clear_flag (flags, mask: INTEGER): INTEGER
    custom_data: INTEGER
    exists: BOOLEAN
    flag_set (flags, mask: INTEGER): BOOLEAN
    format: INTEGER
    height: INTEGER
    item: POINTER
    mask: INTEGER
    set_flag (flags, mask: INTEGER): INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    text_count: INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bitmap (a_bitmap: WEL_BITMAP)
    set_custom_data (value: INTEGER)
    set_format (value: INTEGER)
    set_height (value: INTEGER)
    set_item (an_item: POINTER)
    set_mask (value: INTEGER)
    set_shared
    set_text (a_text: STRING)
    set_unshared
    set_width (value: INTEGER)


WEL_HD_ITEM Flat contracts

indexing
    description: "Represents structure that is sent to the OS to add,modify, inspect, ... items of a WEL_HEADER_CONTROL"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HD_ITEM

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    bitmap_handle: POINTER
            -- Handle to item bitmap.
        require
            exists: exists
            good_mask: flag_set (mask, hdi_bitmap)

    custom_data: INTEGER
            -- Application-defined item data.
        require
            exists: exists
            good_mask: flag_set (mask, hdi_lparam)

    format: INTEGER
            -- A set of bit flags that specify the item’s format.
            -- Constants are defined in class WEL_HDF_CONSTANTS.
            -- Constants may be combined.
        require
            exists: exists
            good_mask: flag_set (mask, hdi_format)

    height: INTEGER
            -- Height of item (Only availavle when mask contains Hdi_height
        require
            exists: exists
            good_mask: flag_set (mask, hdi_height)
        ensure
            positive_result: Result >= 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- Mask flags that indicate which of the other structure
            -- members contain valid data.
            -- Constants may be combined.
            -- The valid constants can be found in class WEL_HDI_CONSTANTS
        require
            exists: exists

    text: STRING
            -- Text of the button associated with the notification.
        require
            exists: exists

    text_count: INTEGER
            -- Count of characters in the button text.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    width: INTEGER
            -- Width of item (Only availavle when mask contains Hdi_width
        require
            exists: exists
            good_mask: flag_set (mask, hdi_width)
        ensure
            positive_result: Result >= 0

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bitmap (a_bitmap: WEL_BITMAP)
            -- Sets item bitmap.
            -- Also updates mask
        require
            exists: exists
            bitmap_exsits: a_bitmap.exists
        ensure
            mask_set: flag_set (mask, hdi_bitmap)

    set_custom_data (value: INTEGER)
            -- Sets application-defined item data.
            -- Also updates mask
        require
            exists: exists
        ensure
            mask_set: flag_set (mask, hdi_lparam)

    set_format (value: INTEGER)
            -- Sets a set of bit flags that specify the item’s format.
            -- Constants are defined in class WEL_HDF_CONSTANTS.
            -- Constants may be combined.
            -- Also updates mask
        require
            exists: exists
        ensure
            mask_set: flag_set (mask, hdi_format)

    set_height (value: INTEGER)
            -- Sets height of item with value
            -- Also updates mask
            -- Note: You can only specify either the width or the height
        require
            exists: exists
            positive_value: value >= 0
        ensure
            mask_set: flag_set (mask, hdi_height)

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_mask (value: INTEGER)
            -- Sets mask flags that indicate which of the other structure
            -- members contain valid data.
            -- Constants may be combined.
            -- The valid constants can be found in class WEL_HDI_CONSTANTS
        require
            exists: exists

    set_text (a_text: STRING)
            -- Set text with a_text.
            -- Also Updates text_count and mask
        require
            text_not_void: a_text /= void
        ensure
            text_set: text.is_equal (a_text)
            text_count_set: a_text.count = text_count
            mask_set: flag_set (mask, hdi_text)

    set_width (value: INTEGER)
            -- Sets width of item with value
            -- Also updates mask
            -- Note: You can only specify either the width or the height
        require
            exists: exists
            positive_value: value >= 0
        ensure
            mask_set: flag_set (mask, hdi_width)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HD_ITEM


WEL_HD_LAYOUT Chart

class
    WEL_HD_LAYOUT

General
    cluster: wel.structs
    description: "This class represents a structure that containsinformation used to set the size and position ofa WEL_HEADER_CONTROL"
    create: make_by_pointer, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_HDI_CONSTANTS
    WEL_STRUCTURE

Queries
    clear_flag (flags, mask: INTEGER): INTEGER
    exists: BOOLEAN
    flag_set (flags, mask: INTEGER): BOOLEAN
    item: POINTER
    rectangle: WEL_RECT
    set_flag (flags, mask: INTEGER): INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    window_pos: WEL_WINDOW_POS

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_rectangle (a_rect: WEL_RECT)
    set_shared
    set_unshared
    set_window_pos (value: WEL_WINDOW_POS)


WEL_HD_LAYOUT Flat contracts

indexing
    description: "This class represents a structure that containsinformation used to set the size and position ofa WEL_HEADER_CONTROL"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HD_LAYOUT

create

    make
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    rectangle: WEL_RECT
            -- Contains the coordinates of a rectangle that the header control is to occupy
        require
            exists: exists

    window_pos: WEL_WINDOW_POS
            -- Object that receives information about the appropriate size
            -- and position of the header control.
        require
            exists: exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_rectangle (a_rect: WEL_RECT)
            -- Contains the coordinates of a rectangle that the header control is to occupy
        require
            exists: exists
            rect_exists: a_rect.exists

    set_window_pos (value: WEL_WINDOW_POS)
            -- Filled usually by Windows
        require
            exists: exists
            window_pos_exists: value.exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HD_LAYOUT


WEL_HD_NOTIFY Chart

class
    WEL_HD_NOTIFY

General
    cluster: wel.structs
    description: "This class stores information deliverdwith notifactions to header controls"
    create: make_by_pointer, make_by_nmhdr, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_STRUCTURE

Queries
    button_index: INTEGER
    clear_flag (flags, mask: INTEGER): INTEGER
    exists: BOOLEAN
    flag_set (flags, mask: INTEGER): BOOLEAN
    header_item: WEL_HD_ITEM
    item: POINTER
    item_index: INTEGER
    nmhdr: WEL_NMHDR
    set_flag (flags, mask: INTEGER): INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_button_index (value: INTEGER)
    set_header_item (hd_item: WEL_HD_ITEM)
    set_item (an_item: POINTER)
    set_item_index (value: INTEGER)
    set_shared
    set_unshared


WEL_HD_NOTIFY Flat contracts

indexing
    description: "This class stores information deliverdwith notifactions to header controls"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_HD_NOTIFY

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

feature -- Access

    button_index: INTEGER
            -- Specifies the index of the mouse button involved in
            -- generating the notification message.
            -- This member can be one of these values:
            --
            -- Value			Meaning
            -- 0				Left button
            -- 1				Right button
            -- 2				Middle button
        require
            exists: exists

    header_item: WEL_HD_ITEM
            -- a WEL_HD_ITEM object that contains information about
            -- the header item associated with the notification message.
        require
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    item_index: INTEGER
            -- Specifies the index of item associated with notification.
        require
            exists: exists

    nmhdr: WEL_NMHDR
            -- Specifies a NMHDR structure.
            -- The code member of this object identifies the notification
            -- message being sent.
        require
            exists: exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_button_index (value: INTEGER)
            -- Sets the index of the mouse button involved in
            -- generating the notification message.
            -- This member can be one of these values:
            --
            -- Value			Meaning
            -- 0				Left button
            -- 1				Right button
            -- 2				Middle button
            -- (Usually set by the OS)
        require
            exists: exists
            good_value: value >= 0 and value <= 2

    set_header_item (hd_item: WEL_HD_ITEM)
            -- Sets the WEL_HD_ITEM object that contains information about
            -- the header item associated with the notification message.
            -- (Usually set by the OS)
        require
            exists: exists
            hd_item_exists: hd_item /= void and then hd_item.exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_item_index (value: INTEGER)
            -- Sets the index of item associated with notification.
            -- (Usually set by the OS)
        require
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_HD_NOTIFY


WEL_IMAGE_LIST Chart

class
    WEL_IMAGE_LIST

General
    cluster: wel.structs
    description: "Object that holds a list of images (Bitmaps or Icons)"
    create: make_by_pointer, make

Ancestors
    WEL_ANY
    WEL_ILC_CONSTANTS

Queries
    bitmaps_height: INTEGER
    bitmaps_width: INTEGER
    count: INTEGER
    exists: BOOLEAN
    get_background_color: WEL_COLOR_REF
    get_icon (index, flags: INTEGER): WEL_ICON
    item: POINTER
    last_position: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER
    use_masked_bitmap: BOOLEAN

Commands
    add_bitmap (bitmap_to_add: WEL_BITMAP)
    add_color_masked_bitmap (bitmap_to_add: WEL_BITMAP; mask_color: WEL_COLOR_REF)
    add_icon (icon_to_add: WEL_GRAPHICAL_RESOURCE)
    add_masked_bitmap (bitmap_to_add, bitmap_mask: WEL_BITMAP)
    destroy
    dispose
    make (given_width, given_height, color_depth: INTEGER; masked_bitmap: BOOLEAN)
    remove_all_images (index: INTEGER)
    remove_image (index: INTEGER)
    replace_bitmap (bitmap_to_add: WEL_BITMAP; index: INTEGER)
    replace_icon (icon_to_add: WEL_GRAPHICAL_RESOURCE; index: INTEGER)
    replace_masked_bitmap (bitmap_to_add, bitmap_mask: WEL_BITMAP; index: INTEGER)
    set_background_color (new_color: WEL_COLOR_REF)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_IMAGE_LIST Flat contracts

indexing
    description: "Object that holds a list of images (Bitmaps or Icons)"
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_IMAGE_LIST

create

    make (given_width: INTEGER; given_height: INTEGER; color_depth: INTEGER; masked_bitmap: BOOLEAN)
            -- Initialization with an empty image list. Images located
            -- in this imageList must have the a width equal to given_width
            -- and a height equal to given_height.
            --
            -- The flag color_depth determines the color depth of the bitmaps.
            -- (bitmaps with a different color depth than indicated in
            -- image_type will automatically be converted)
            -- See Ilc_colorXXXX in WEL_ILC_CONSTANTS for possible values
            --
            -- The flag masked_bitmap specify whether we are using Bitmaps with mask, or plain
            -- bitmaps.
        require
            valid_width: given_width > 0
            valid_height: given_height > 0

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Initialization

    make (given_width: INTEGER; given_height: INTEGER; color_depth: INTEGER; masked_bitmap: BOOLEAN)
            -- Initialization with an empty image list. Images located
            -- in this imageList must have the a width equal to given_width
            -- and a height equal to given_height.
            --
            -- The flag color_depth determines the color depth of the bitmaps.
            -- (bitmaps with a different color depth than indicated in
            -- image_type will automatically be converted)
            -- See Ilc_colorXXXX in WEL_ILC_CONSTANTS for possible values
            --
            -- The flag masked_bitmap specify whether we are using Bitmaps with mask, or plain
            -- bitmaps.
        require
            valid_width: given_width > 0
            valid_height: given_height > 0

feature -- Access

    count: INTEGER
            -- Retrieves the number of images in the image list.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    last_position: INTEGER
            -- Position of last image inserted/deleted.
            -- updated by add_image.

    use_masked_bitmap: BOOLEAN
            -- Does the ImageList contains 'Bitmap+Mask' or
            -- only 'Bitmap'
            --
            -- Note: to use masked bitmap, create the ImageList
            --       using `Ilc_mask + Ilc_colorXXXX' as image_type

feature -- Status report

    bitmaps_height: INTEGER
            -- height of all bitmaps located in this imageList

    bitmaps_width: INTEGER
            -- width of all bitmaps located in this imageList

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    get_background_color: WEL_COLOR_REF
            -- Retrieves the current background color for this image list.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    destroy
            -- destroy item by calling the
            -- corresponding Windows function and
            -- set item to default_pointer.

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    add_bitmap (bitmap_to_add: WEL_BITMAP)
            -- Add the bitmap bitmap_to_add into the image list.
        require
            bitmap_not_void: bitmap_to_add /= void
            compatible_width_for_bitmap: bitmap_to_add.width = bitmaps_width
            compatible_height_for_bitmap: bitmap_to_add.height = bitmaps_height
            exists: exists

    add_color_masked_bitmap (bitmap_to_add: WEL_BITMAP; mask_color: WEL_COLOR_REF)
            -- Add the bitmap bitmap_to_add into the image list.
            -- mask_color represents the color used to generate the mask.
            -- Each pixel of this color in the specified bitmap is changed to black
            -- and the corresponding bit in the mask is set to 1.
            --
            -- Note: Bitmaps with color depth greater than 8bpp are not supported
        require
            bitmap_not_void: bitmap_to_add /= void
            mask_color_not_void: mask_color /= void
            compatible_width_for_bitmap: bitmap_to_add.width = bitmaps_width
            compatible_height_for_bitmap: bitmap_to_add.height = bitmaps_height
            exists: exists

    add_icon (icon_to_add: WEL_GRAPHICAL_RESOURCE)
            -- Adds the icon or cursor icon_to_add to this image list
        require
            icon_not_void: icon_to_add /= void
            exists: exists

    add_masked_bitmap (bitmap_to_add: WEL_BITMAP; bitmap_mask: WEL_BITMAP)
            -- Add the bitmap bitmap_to_add into the image list.
            -- bitmap_mask represents the mask for the bitmap.
        require
            bitmap_not_void: bitmap_to_add /= void
            mask_not_void: bitmap_mask /= void
            compatible_width_for_bitmap: bitmap_to_add.width = bitmaps_width
            compatible_height_for_bitmap: bitmap_to_add.height = bitmaps_height
            compatible_width_for_mask: bitmap_mask.width = bitmaps_width
            compatible_height_for_mask: bitmap_mask.height = bitmaps_height
            masked_bitmap_in_use: use_masked_bitmap
            exists: exists

    get_icon (index, flags: INTEGER): WEL_ICON
        require
            index_not_too_small: index >= 0
            index_not_too_big: index < count
            exists: exists

    remove_all_images (index: INTEGER)
            -- Remove all images from the image list.
        require
            exists: exists

    remove_image (index: INTEGER)
            -- Remove the image at index index from the image list.
            --
            -- When an image is removed, the indexes of the remaining images are
            -- adjusted so that the image indexes always range from zero to one
            -- less than the number of images in the image list.
            -- For example, if you remove the image at index 0, then image 1 becomes
            -- image 0, image 2 becomes image 1, and so on.
        require
            index_not_too_small: index >= 0
            index_not_too_big: index < count
            exists: exists

    replace_bitmap (bitmap_to_add: WEL_BITMAP; index: INTEGER)
            -- Replace the bitmap at position index in the imageList by
            -- bitmap_to_add.
        require
            bitmap_not_void: bitmap_to_add /= void
            not_use_masked_bitmap: not use_masked_bitmap
            index_not_too_small: index >= 0
            index_not_too_big: index < count
            exists: exists

    replace_icon (icon_to_add: WEL_GRAPHICAL_RESOURCE; index: INTEGER)
            -- Replace the bitmap at position index in the imageList by
            -- the cursor or icon icon_to_add.
        require
            icon_not_void: icon_to_add /= void
            index_not_too_small: index >= 0
            index_not_too_big: index < count
            exists: exists

    replace_masked_bitmap (bitmap_to_add: WEL_BITMAP; bitmap_mask: WEL_BITMAP; index: INTEGER)
            -- Replace the bitmap at position index in the imageList by
            -- bitmap_to_add.
            -- bitmap_mask represents the mask for the bitmap.
        require
            bitmap_not_void: bitmap_to_add /= void
            mask_not_void: bitmap_mask /= void
            compatible_width_for_bitmap: bitmap_to_add.width = bitmaps_width
            compatible_height_for_bitmap: bitmap_to_add.height = bitmaps_height
            compatible_width_for_mask: bitmap_mask.width = bitmaps_width
            compatible_height_for_mask: bitmap_mask.height = bitmaps_height
            masked_bitmap_in_use: use_masked_bitmap
            index_not_too_small: index >= 0
            index_not_too_big: index < count
            exists: exists

    set_background_color (new_color: WEL_COLOR_REF)
            -- Sets the background color for this image list.
        require
            new_color_not_void: new_color /= void
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_IMAGE_LIST


WEL_IMALLOC Chart

class
    WEL_IMALLOC

General
    cluster: wel.structs
    description: "IMalloc interface wrapper."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    allocated (a_pointer: POINTER): BOOLEAN
    allocated_buffer (an_integer: INTEGER): POINTER
    allocated_not_reliable: BOOLEAN
    exists: BOOLEAN
    item: POINTER
    reallocated_buffer (a_pointer: POINTER; an_integer: INTEGER): POINTER
    shared: BOOLEAN
    size (a_pointer: POINTER): INTEGER
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    free_buffer (a_pointer: POINTER)
    initialize
    initialize_with_character (a_character: CHARACTER)
    make
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_IMALLOC Flat contracts

indexing
    description: "IMalloc interface wrapper."
    author: ""
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_IMALLOC

create

    make
            -- Initialize interface.
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Initialization

    make
            -- Initialize interface.
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    allocated (a_pointer: POINTER): BOOLEAN
            -- Was memory block pointed by a_pointer allocated with
            -- allocated_buffer?
            -- Default result is True.
            -- See allocated_not_reliable for validity of result.

    allocated_buffer (an_integer: INTEGER): POINTER
            -- Pointer to newly allocated buffer of an_integer bytes
            -- default_pointer if no enough memory is available

    allocated_not_reliable: BOOLEAN
            -- Is allocated reliable?

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    reallocated_buffer (a_pointer: POINTER; an_integer: INTEGER): POINTER
            -- Pointer to newly allocated buffer of an_integer bytes
            -- Allocated buffer contains same information as memory pointed by
            -- a_pointer (if an_integer is greater than orginal memory block
            -- pointed by a_pointer then additional bytes are not initialized).
        require
            was_allocated: allocated (a_pointer)

    size (a_pointer: POINTER): INTEGER
            -- Size (in bytes) of previously allocated memory block pointed by
            -- a_pointer
        require
            was_allocated: allocated (a_pointer)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic Operations

    free_buffer (a_pointer: POINTER)
            -- Free memory block pointed by a_pointer.
        require
            was_allocated: allocated (a_pointer)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_IMALLOC


WEL_INTEGER_ARRAY Chart

class
    WEL_INTEGER_ARRAY

General
    cluster: wel.structs
    description: "Fixed integer array for WEL_STRUCTURE. Used internally by WEL.  useful to protect integer arrays within an external call"
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    count: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    structure_size: INTEGER
    to_array (a_lower: INTEGER): ARRAY [INTEGER]
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    positive count


WEL_INTEGER_ARRAY Flat contracts

indexing
    description: "Fixed integer array for WEL_STRUCTURE. Used internally by WEL.  useful to protect integer arrays within an external call"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_INTEGER_ARRAY

create

    make (an_array: ARRAY [INTEGER])
            -- Create a fixed integer array
            -- from an existing standard integer array.
        require
            an_array_not_void: an_array /= void

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    count: INTEGER
            -- Number of items in the array

    structure_size: INTEGER
            -- Size of the array (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_array (a_lower: INTEGER): ARRAY [INTEGER]
            -- Eiffel array
        ensure
            array_not_void: Result /= void
            lower_set: Result.lower = a_lower
            count_set: Result.count = count

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

    positive_count: count > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_INTEGER_ARRAY


WEL_LIST_VIEW_COLUMN Chart

class
    WEL_LIST_VIEW_COLUMN

General
    cluster: wel.structs
    description: "Contains information about a list view control column."
    create: make_by_pointer, make_with_attributes, make

Ancestors
    WEL_LIST_VIEW_CONSTANTS
    WEL_STRUCTURE

Queries
    alignment: INTEGER
    exists: BOOLEAN
    is_alignment_valid: BOOLEAN
    is_in_mask (a_mask: INTEGER): BOOLEAN
    is_text_valid: BOOLEAN
    is_width_valid: BOOLEAN
    item: POINTER
    Lvscw_autosize: INTEGER
    Lvscw_autosize_useheader: INTEGER
    mask: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    to_integer: INTEGER
    valid_lvcfmt_constant (value: INTEGER): BOOLEAN
    width: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make
    make_with_attributes (a_mask, a_width, an_alignment: INTEGER; a_text: STRING)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    remove_alignment
    remove_mask
    remove_text
    remove_width
    set_alignment (an_alignment: INTEGER)
    set_item (an_item: POINTER)
    set_mask (a_mask: INTEGER)
    set_shared
    set_text (a_text: STRING)
    set_unshared
    set_width (a_width: INTEGER)


WEL_LIST_VIEW_COLUMN Flat contracts

indexing
    description: "Contains information about a list view control column."
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LIST_VIEW_COLUMN

create

    make
            -- Make a list view column structure

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_with_attributes (a_mask, a_width, an_alignment: INTEGER; a_text: STRING)
            -- Make a list view column structure with the given
            -- attributes:
            -- a_mask set the valid member (Lvcf_text, ...)
            -- a_width is the width of the column in pixels
            -- an_alignment is the alignment of the column header and
            --                items in the column.
            -- a_text is the text of of the header.
        require
            valid_fmt: valid_lvcfmt_constant (an_alignment)

feature -- Initialization

    make
            -- Make a list view column structure

    make_with_attributes (a_mask, a_width, an_alignment: INTEGER; a_text: STRING)
            -- Make a list view column structure with the given
            -- attributes:
            -- a_mask set the valid member (Lvcf_text, ...)
            -- a_width is the width of the column in pixels
            -- an_alignment is the alignment of the column header and
            --                items in the column.
            -- a_text is the text of of the header.
        require
            valid_fmt: valid_lvcfmt_constant (an_alignment)

feature -- Access

    alignment: INTEGER
            -- Specifies the alignment of the column
            -- See class WEL_LVCF_CONSTANTS for possible values.
        ensure
            valid_result: valid_lvcfmt_constant (Result)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- Array of flags that indicate which of the other
            -- structure members contain valid data or which are
            -- to be filled in. This member can be a combination
            -- of the Lvcf_* values.
            -- See class WEL_LVCF_CONSTANTS.

    text: STRING
            -- Title of the column
        require
            text_meaningfull: is_text_valid
        ensure
            result_not_void: Result /= void

    width: INTEGER
            -- Get the width, in pixel, of the column
        require
            width_meaningfull: is_width_valid
        ensure
            positive_result: Result >= 0

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    remove_alignment
            -- Remove any specified alignment on the column.
        ensure
            alignment_not_valid: not is_alignment_valid

    remove_mask
            -- Reset the mask to zero.
        ensure
            mask_reseted: mask = 0

    remove_text
            -- Remove any specified text on the column.
        ensure
            text_not_valid: not is_text_valid

    remove_width
            -- Remove any specified width on the column.
        ensure
            width_not_valid: not is_width_valid

    set_alignment (an_alignment: INTEGER)
            -- Set the alignment of the column to an_alignment.
            -- See class WEL_LVCF_CONSTANTS for possible values.
        require
            valid_alignment: valid_lvcfmt_constant (an_alignment)
        ensure
            fmt_set: alignment = an_alignment

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_mask (a_mask: INTEGER)
            -- Set mask with a_mask.
        ensure
            mask_set: mask = a_mask

    set_text (a_text: STRING)
            -- Set text with a_text.
        require
            a_text_not_void: a_text /= void
        ensure
            text_set: text.is_equal (a_text)

    set_width (a_width: INTEGER)
            -- Set the width of the column to a_width.
        require
            valid_width: a_width >= 0 or a_width = lvscw_autosize or a_width = lvscw_autosize_useheader
        ensure
            width_set: width = a_width

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature  -- Column Flags (Width)

    Lvscw_autosize: INTEGER is -1
            -- Automatically sizes the column.
            --
            -- Declared in Windows as LVSCW_AUTOSIZE
            -- (from WEL_LIST_VIEW_CONSTANTS)

    Lvscw_autosize_useheader: INTEGER is -2
            -- Automatically sizes the column to fit the
            -- header text. If you use this value with the last
            -- column, its width is set to fill the remaining
            -- width of the list view control.
            --
            -- Declared in Windows as LVSCW_AUTOSIZE_USEHEADER
            -- (from WEL_LIST_VIEW_CONSTANTS)

feature -- Status Report

    is_alignment_valid: BOOLEAN
            -- Is there any specified alignment for this column?

    is_in_mask (a_mask: INTEGER): BOOLEAN
            -- Is a_mask contained in the current mask?

    is_text_valid: BOOLEAN
            -- Is there any specified text for this column?

    is_width_valid: BOOLEAN
            -- Is there any specified width in pixel for this column?

feature  -- Validation

    valid_lvcfmt_constant (value: INTEGER): BOOLEAN
            -- Is value a valid lvcfmt constant?
            -- (from WEL_LIST_VIEW_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LIST_VIEW_COLUMN


WEL_LIST_VIEW_ITEM Chart

class
    WEL_LIST_VIEW_ITEM

General
    cluster: wel.structs
    description: "Contains information about a list view control item."
    create: make_by_pointer, make_with_attributes, make

Ancestors
    WEL_LVIF_CONSTANTS
    WEL_LVIS_CONSTANTS
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    iimage: INTEGER
    iitem: INTEGER
    isubitem: INTEGER
    item: POINTER
    lparam: INTEGER
    mask: INTEGER
    shared: BOOLEAN
    state: INTEGER
    Structure_size: INTEGER
    text: STRING
    to_integer: INTEGER

Commands
    add_mask (a_mask_value: INTEGER)
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_iitem (value: INTEGER)
    set_image (image_normal: INTEGER)
    set_isubitem (value: INTEGER)
    set_item (an_item: POINTER)
    set_lparam (value: INTEGER)
    set_mask (value: INTEGER)
    set_shared
    set_state (value: INTEGER)
    set_text (a_text: STRING)
    set_unshared
    structure_initialize


WEL_LIST_VIEW_ITEM Flat contracts

indexing
    description: "Contains information about a list view control item."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LIST_VIEW_ITEM

create

    make
            -- Make a list view item

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_with_attributes (a_mask, a_iitem, a_isubitem, an_iimage: INTEGER; a_text: STRING)

feature -- Access

    iimage: INTEGER
            -- Index of the icon.

    iitem: INTEGER
            -- Index of the row of the item.

    isubitem: INTEGER
            -- Index of the item in his row. 0 if it is an item and not a
            -- subitem.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    lparam: INTEGER
            -- User parameter.

    mask: INTEGER
            -- Array of flags that indicate which of the other
            -- structure members contain valid data or which are
            -- to be filled in. This member can be a combination
            -- of the Tvif_* values.
            -- See class WEL_TVIF_CONSTANTS.

    state: INTEGER
            -- Current state of the item.

    text: STRING
            -- Text of the item
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_mask (a_mask_value: INTEGER)
            -- add a_mask_value to the current mask.

    set_iitem (value: INTEGER)
            -- Set iitem with value.
        ensure
            iitem_set: iitem = value

    set_image (image_normal: INTEGER)
            -- Set the image for the list item to image_normal.
            -- image_normal is the index of an image in the
            -- image list associated with the listview.

    set_isubitem (value: INTEGER)
            -- Set isubitem with value.
        ensure
            isubitem_set: isubitem = value

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_lparam (value: INTEGER)
            -- Set lparam with value.
        ensure
            lparam_set: lparam = value

    set_mask (value: INTEGER)
            -- Set mask with value.
        ensure
            mask_set: mask = value

    set_state (value: INTEGER)
            -- Set state with value.
        ensure
            state_set: state = value

    set_text (a_text: STRING)
            -- Set text with a_text.
        require
            a_text_not_void: a_text /= void
        ensure
            text_set: text.is_equal (a_text)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LIST_VIEW_ITEM


WEL_LIST_VIEW_SEARCH_INFO Chart

class
    WEL_LIST_VIEW_SEARCH_INFO

General
    cluster: wel.structs
    description: "Information on how to search a list view"
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_LVFI_CONSTANTS
    WEL_LVFI_CONSTANTS
    WEL_STRUCTURE
    WEL_VK_CONSTANTS

Queries
    clear_flag (flags, mask: INTEGER): INTEGER
    downwards: BOOLEAN
    exists: BOOLEAN
    flag_set (flags, mask: INTEGER): BOOLEAN
    flags: INTEGER
    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
    item: POINTER
    left: BOOLEAN
    lparam: INTEGER
    Lvfi_nearestxy: INTEGER
    Lvfi_param: INTEGER
    Lvfi_partial: INTEGER
    Lvfi_string: INTEGER
    Lvfi_wrap: INTEGER
    right: BOOLEAN
    set_flag (flags, mask: INTEGER): INTEGER
    shared: BOOLEAN
    starting_position: WEL_POINT
    target: STRING
    to_integer: INTEGER
    upwards: BOOLEAN

Commands
    add_flag (a_flag: [like flags] INTEGER)
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_downwards
    set_flags (a_flags: [like flags] INTEGER)
    set_item (an_item: POINTER)
    set_left
    set_lparam (a_lparam: [like lparam] INTEGER)
    set_right
    set_shared
    set_starting_position (a_starting_position: [like starting_position] WEL_POINT)
    set_target (a_target: [like target] STRING)
    set_unshared
    set_upwards

Constraints
    valid direction


WEL_LIST_VIEW_SEARCH_INFO Flat contracts

indexing
    description: "Information on how to search a list view"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LIST_VIEW_SEARCH_INFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    downwards: BOOLEAN
            -- Will search be downwards?

    flags: INTEGER
            -- Flags specifying type of search
            -- See class WEL_LVFI_CONSTANTS for possible value

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    left: BOOLEAN
            -- Will search direction be left?

    lparam: INTEGER
            -- Search target
            -- Either target or lparam will be used during search according to flags.
        require
            valid_flags: flag_set (flags, lvfi_param)

    right: BOOLEAN
            -- Will search direction be right?

    starting_position: WEL_POINT
            -- Starting position of search
        require
            valid_flags: flag_set (flags, lvfi_nearestxy)

    target: STRING
            -- Search target
            -- Either target or lparam will be used during search according to flags.
        require
            valid_flags: flag_set (flags, lvfi_string)

    upwards: BOOLEAN
            -- Will search be upwards?

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

feature -- Acess

    Lvfi_nearestxy: INTEGER is 64
            -- Search item nearest specified position in specified direction
            --
            -- Declared in Windows as LVFI_NEARESTXY
            -- (from WEL_LVFI_CONSTANTS)

    Lvfi_param: INTEGER is 1
            -- Search item with corresponding lparam attribute
            --
            -- Declared in Windows as LVFI_PARAM
            -- (from WEL_LVFI_CONSTANTS)

    Lvfi_partial: INTEGER is 8
            -- Search item including given string
            --
            -- Declared in Windows as LVFI_PARTIAL
            -- (from WEL_LVFI_CONSTANTS)

    Lvfi_string: INTEGER is 2
            -- Search item with exact corresponding string
            --
            -- Declared in Windows as LVFI_STRING
            -- (from WEL_LVFI_CONSTANTS)

    Lvfi_wrap: INTEGER is 32
            -- Start search from start when end of list view is reached
            --
            -- Declared in Windows as LVFI_WRAP
            -- (from WEL_LVFI_CONSTANTS)

feature -- Element Change

    add_flag (a_flag: like flags)
            -- Add a_flag to flags.
        require
            valid_flags: is_valid_list_view_flag (a_flag)
        ensure
            added: flag_set (flags, a_flag)

    set_downwards
            -- Set search direction downwards

    set_flags (a_flags: like flags)
            -- Set flags with a_flags.
        require
            valid_flags: is_valid_list_view_flag (a_flags)
        ensure
            flags_set: flags = a_flags

    set_left
            -- Set search direction left

    set_lparam (a_lparam: like lparam)
            -- Set lparam with a_lparam.
        ensure
            lparam_set: lparam = a_lparam

    set_right
            -- Set search direction right

    set_starting_position (a_starting_position: like starting_position)
            -- Set starting_position with a_starting_position.
        require
            non_void_starting_position: a_starting_position /= void
            valid_starting_position: a_starting_position.exists

    set_target (a_target: like target)
            -- Set target with a_target.
        require
            non_void_target: a_target /= void
            valid_target: not a_target.is_empty
        ensure
            target_set: target.is_equal (a_target)

    set_upwards
            -- Set search direction upwards

feature -- Validation

    is_valid_list_view_flag (a_flag: INTEGER): BOOLEAN
            -- Is a_flag a valid list view search flag?
            -- (from WEL_LVFI_CONSTANTS)

invariant

    valid_direction: (upwards implies (not downwards and not right and not left)) and (downwards implies (not upwards and not right and not left)) and (right implies (not upwards and not downwards and not left)) and (left implies (not upwards and not downwards and not right))
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LIST_VIEW_SEARCH_INFO


WEL_LV_DISPINFO Chart

class
    WEL_LV_DISPINFO

General
    cluster: wel.structs
    description: "LV_DISPINFO structure contains information needed to display an owner-drawn item in a list view control."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    list_item: WEL_LIST_VIEW_ITEM
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_LV_DISPINFO Flat contracts

indexing
    description: "LV_DISPINFO structure contains information needed to display an owner-drawn item in a list view control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LV_DISPINFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    list_item: WEL_LIST_VIEW_ITEM
            -- Virtual key number.
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LV_DISPINFO


WEL_LV_HITTESTINFO Chart

class
    WEL_LV_HITTESTINFO

General
    cluster: wel.structs
    description: "Contains information about a list view hittestinfo notification message."
    create: make_by_pointer, make_with_point, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    flags: INTEGER
    iitem: INTEGER
    isubitem: INTEGER
    item: POINTER
    point: WEL_POINT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_point (pt: WEL_POINT)
    set_shared
    set_unshared


WEL_LV_HITTESTINFO Flat contracts

indexing
    description: "Contains information about a list view hittestinfo notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LV_HITTESTINFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_with_point (pt: WEL_POINT)
            -- Create a structure with pt.

feature -- Access

    flags: INTEGER
            -- Variable that receives information about the result of
            -- a hit test. See WEL_LVHT_CONSTANTS for values.

    iitem: INTEGER
            -- index of the item that occupies the point

    isubitem: INTEGER
            -- index of the subitem that occupies the point

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    point: WEL_POINT
            -- Client coordinates of the point to test.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_point (pt: WEL_POINT)
            -- Set point with pt.
        ensure
            point_set: point.is_equal (pt)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LV_HITTESTINFO


WEL_LV_KEYDOWN Chart

class
    WEL_LV_KEYDOWN

General
    cluster: wel.structs
    description: "Contains information about a list view keydown notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    virtual_key: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_LV_KEYDOWN Flat contracts

indexing
    description: "Contains information about a list view keydown notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_LV_KEYDOWN

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    virtual_key: INTEGER
            -- Virtual key number.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_LV_KEYDOWN


WEL_MDI_CREATE_STRUCT Chart

class
    WEL_MDI_CREATE_STRUCT

General
    cluster: wel.structs
    description: "Contains information about the class, title, owner, location, and size of a MDI child window."
    create: make

Ancestors
    WEL_STRUCTURE
    WEL_WS_CONSTANTS

Queries
    class_name: STRING
    exists: BOOLEAN
    height: INTEGER
    item: POINTER
    lparam: POINTER
    owner: WEL_INSTANCE
    shared: BOOLEAN
    Structure_size: INTEGER
    style: INTEGER
    title: STRING
    to_integer: INTEGER
    width: INTEGER
    x: INTEGER
    y: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_class_name (a_class_name: STRING)
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_lparam (a_lparam: POINTER)
    set_owner (an_owner: WEL_INSTANCE)
    set_shared
    set_style (a_style: INTEGER)
    set_title (a_title: STRING)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)


WEL_MDI_CREATE_STRUCT Flat contracts

indexing
    description: "Contains information about the class, title, owner, location, and size of a MDI child window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MDI_CREATE_STRUCT

create

    make (a_class_name: STRING; a_title: STRING)
            -- Make a MDI create structure with a_class_name and
            -- a_title.
        ensure
            class_name_set: class_name.is_equal (a_class_name)
            title_set: title.is_equal (a_title)
            owner_set: owner.item = main_args.current_instance.item
            style_set: style = 0
            lparam_set: lparam = default_pointer

feature -- Access

    class_name: STRING
            -- Class name of the MDI child window
        ensure
            result_not_void: Result /= void

    height: INTEGER
            -- Height of the MDI child window

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    lparam: POINTER
            -- Lparam of the MDI child window

    owner: WEL_INSTANCE
            -- Owner of the MDI child window
        ensure
            result_not_void: Result /= void

    style: INTEGER
            -- Style of the MDI child window

    title: STRING
            -- Title of the MDI child window
        ensure
            result_not_void: Result /= void

    width: INTEGER
            -- Width of the MDI child window

    x: INTEGER
            -- x position of the MDI child window

    y: INTEGER
            -- y position of the MDI child window

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_class_name (a_class_name: STRING)
            -- Set class_name with a_class_name
        require
            a_class_name_valid: a_class_name /= void
        ensure
            class_name_set: class_name.is_equal (a_class_name)

    set_height (a_height: INTEGER)
            -- Set height with a_height

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_lparam (a_lparam: POINTER)
            -- Set lparam with a_lparam
        ensure
            lparam_set: lparam = a_lparam

    set_owner (an_owner: WEL_INSTANCE)
            -- Set owner with an_owner
        require
            an_owner_not_void: an_owner /= void
        ensure
            owner_set: owner.item = an_owner.item

    set_style (a_style: INTEGER)
            -- Set style with a_style
        ensure
            style_set: style = a_style

    set_title (a_title: STRING)
            -- Set title with a_title
        require
            a_title_valid: a_title /= void
        ensure
            title_set: title.is_equal (a_title)

    set_width (a_width: INTEGER)
            -- Set width with a_width

    set_x (a_x: INTEGER)
            -- Set x with a_x

    set_y (a_y: INTEGER)
            -- Set y with a_y

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MDI_CREATE_STRUCT


WEL_MEASURE_ITEM_STRUCT Chart

class
    WEL_MEASURE_ITEM_STRUCT

General
    cluster: wel.structs
    description: "Contains information about the Wm_measureitem message."
    create: make_by_pointer

Ancestors
    WEL_STRUCTURE

Queries
    ctl_id: INTEGER
    ctl_type: INTEGER
    exists: BOOLEAN
    item: POINTER
    item_data: INTEGER
    item_height: INTEGER
    item_id: INTEGER
    item_width: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_item_height (a_height: INTEGER)
    set_item_width (a_width: INTEGER)
    set_shared
    set_unshared


WEL_MEASURE_ITEM_STRUCT Flat contracts

indexing
    description: "Contains information about the Wm_measureitem message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_MEASURE_ITEM_STRUCT

create

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    ctl_id: INTEGER
            -- Control identifier

    ctl_type: INTEGER
            -- Control type.
            -- See class WEL_ODT_CONSTANTS.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    item_data: INTEGER
            -- 32-bit value associated with the menu item.

    item_height: INTEGER
            -- Height, in pixels, of a menu item. Before returning from
            -- the message, the owner of the owner-drawn menu item must
            -- fill this member.

    item_id: INTEGER
            -- Menu item identifier for a menu item or
            -- the index of the item in a list box or
            -- combo box

    item_width: INTEGER
            -- Width, in pixels, of a menu item. Before returning from
            -- the message, the owner of the owner-drawn menu item must
            -- fill this member.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_item_height (a_height: INTEGER)
            -- Set item_height to a_height.

    set_item_width (a_width: INTEGER)
            -- Set item_width to a_width.

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MEASURE_ITEM_STRUCT


WEL_MIN_MAX_INFO Chart

class
    WEL_MIN_MAX_INFO

General
    cluster: wel.structs
    description: "Contains information about a window's maximized size and position and its minimum and maximum tracking size."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    max_position: WEL_POINT
    max_size: WEL_POINT
    max_track_size: WEL_POINT
    min_track_size: WEL_POINT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_max_position (point: WEL_POINT)
    set_max_size (point: WEL_POINT)
    set_max_track_size (point: WEL_POINT)
    set_min_track_size (point: WEL_POINT)
    set_shared
    set_unshared


WEL_MIN_MAX_INFO Flat contracts

indexing
    description: "Contains information about a window's maximized size and position and its minimum and maximum tracking size."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MIN_MAX_INFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    max_position: WEL_POINT
            -- Position of the left side of the maximized window
            -- and the position of the top of the maximized window
        ensure
            result_not_void: Result /= void

    max_size: WEL_POINT
            -- Maximized width and height of the window
        ensure
            result_not_void: Result /= void

    max_track_size: WEL_POINT
            -- Maximum tracking width and the minimum tracking
            -- height of the window
        ensure
            result_not_void: Result /= void

    min_track_size: WEL_POINT
            -- Minimum tracking width and the minimum tracking
            -- height of the window
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_max_position (point: WEL_POINT)
            -- Set max_position with point.
        require
            point_not_void: point /= void
        ensure
            point_set: max_position.is_equal (point)

    set_max_size (point: WEL_POINT)
            -- Set max_size with point.
        require
            point_not_void: point /= void
        ensure
            point_set: max_size.is_equal (point)

    set_max_track_size (point: WEL_POINT)
            -- Set max_track_size with point.
        require
            point_not_void: point /= void
        ensure
            point_set: max_track_size.is_equal (point)

    set_min_track_size (point: WEL_POINT)
            -- Set min_track_size with point.
        require
            point_not_void: point /= void
        ensure
            point_set: min_track_size.is_equal (point)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MIN_MAX_INFO


WEL_MSGBOXPARAMS Chart

class
    WEL_MSGBOXPARAMS

General
    cluster: wel.structs
    description: "MSBOXPARAMS structure used by cwin_message_box_indirect"
    create: make_basic, make_by_id

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_MSGBOXPARAMS Flat contracts

indexing
    description: "MSBOXPARAMS structure used by cwin_message_box_indirect"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MSGBOXPARAMS

create

    make_by_id (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style, an_id, a_language, a_sublanguage: INTEGER)
            -- create a MSGBOXPARAMS structure
            -- with user icon defined by `an_id, a_window as parent, a_text displayed as message,
            --a_title displayed in title bar and a_style as the window style.
            -- a_language and a_sublanguage specify in which language the text on the buttons is displayed.
            -- Note that in order for the langauge settings to work, the necessary components must be installed
            -- on the system.
        require
            text_not_void: a_text /= void
            title_not_void: a_title /= void
            valid_id: an_id > 0
            valid_lang: a_language > 0
            valid_sublang: a_sublanguage > 0

    make_basic (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style, a_language, a_sublanguage: INTEGER)
            -- create a MSGBOXPARAMS structure
            -- without user icon.
            -- With a_window as parent, a_text displayed as message, a_title displayed in title bar.
            -- a_style as the window style.
            -- a_language and a_sublanguage specify in which language the text on the buttons is displayed.
            -- Note that in order for the langauge settings to work, the necessary components must be installed
            -- on the system.
        require
            text_not_void: a_text /= void
            title_not_void: a_title /= void
            valid_language: a_language > 0
            valid_sublanguage: a_sublanguage > 0

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MSGBOXPARAMS


WEL_MSG_FILTER Chart

class
    WEL_MSG_FILTER

General
    cluster: wel.structs
    description: "Contains information about a message filter notification message (for Rich Edit Controls)."
    create: make_from_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    lparam: INTEGER
    msg: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    wparam: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make_from_nmhdr (nmhdr: WEL_NMHDR)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_MSG_FILTER Flat contracts

indexing
    description: "Contains information about a message filter notification message (for Rich Edit Controls)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MSG_FILTER

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_from_nmhdr (nmhdr: WEL_NMHDR)
        require
            nmhdr_exists: nmhdr /= void and then nmhdr.exists
        ensure
            exists: exists

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    lparam: INTEGER
            -- Specifies the lParam parameter of the message.
        require
            exists: exists

    msg: INTEGER
            -- Specifies the keyboard or mouse message identifier.
        require
            exists: exists

    wparam: INTEGER
            -- Specifies the wParam parameter of the message.
        require
            exists: exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Initialisation

    make_from_nmhdr (nmhdr: WEL_NMHDR)
        require
            nmhdr_exists: nmhdr /= void and then nmhdr.exists
        ensure
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MSG_FILTER


WEL_MSG Chart

class
    WEL_MSG

General
    cluster: wel.structs
    description: "Contains message information about thread's message queue."
    create: make

Ancestors
    WEL_PM_CONSTANTS
    WEL_STRUCTURE
    WEL_WM_CONSTANTS

Queries
    dispatch_result: INTEGER
    exists: BOOLEAN
    hwnd: POINTER
    item: POINTER
    last_boolean_result: BOOLEAN
    lparam: INTEGER
    message: INTEGER
    quit: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    wparam: INTEGER

Commands
    dispatch
    dispose
    get_all
    initialize
    initialize_with_character (a_character: CHARACTER)
    is_dialog_message (dialog: WEL_MODELESS_DIALOG)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    peek_all
    process_dialog_message (dialog: POINTER)
    set_hwnd (a_hwnd: POINTER)
    set_item (an_item: POINTER)
    set_lparam (a_lparam: INTEGER)
    set_message (a_message: INTEGER)
    set_shared
    set_unshared
    set_wparam (a_wparam: INTEGER)
    translate
    translate_accelerator (window: WEL_WINDOW; accelerators: WEL_ACCELERATORS)
    translate_mdi_accelarator (window: WEL_WINDOW)
    wait


WEL_MSG Flat contracts

indexing
    description: "Contains message information about thread's message queue."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:25 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MSG

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    hwnd: POINTER
            -- Window which has received the message

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    lparam: INTEGER
            -- Additional information about message

    message: INTEGER
            -- Message identifier

    wparam: INTEGER
            -- Additional information about message

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    dispatch_result: INTEGER
            -- Last result of dispatch routine.

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    last_boolean_result: BOOLEAN
            -- Last result of get, get_all, translate,
            -- translate_accelerator, dispatch, and
            -- peek_result routines.

    quit: BOOLEAN
            -- Is message equal to Wm_quit?

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_hwnd (a_hwnd: POINTER)
            -- Set hwnd with a_hwnd.
        ensure
            hwnd_set: hwnd = a_hwnd

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_lparam (a_lparam: INTEGER)
            -- Set lparam with a_lparam.
        ensure
            lparam_set: lparam = a_lparam

    set_message (a_message: INTEGER)
            -- Set message with a_message.
        ensure
            message_set: message = a_message

    set_wparam (a_wparam: INTEGER)
            -- Set wparam with a_wparam.
        ensure
            wparam_set: wparam = a_wparam

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    dispatch
            -- Dispatch the message to a window procedure

    get_all
            -- Get all messages.

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    is_dialog_message (dialog: WEL_MODELESS_DIALOG)
            -- Determines whether a message is intended for
            -- dialog and, if it is, processes the message.
        require
            dialog_not_void: dialog /= void
            dialog_exists: dialog.exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    peek_all
            -- Peek all messages.

    process_dialog_message (dialog: POINTER)
            -- Process a dialog message for dialog.

    translate
            -- Translate virtual-key messages
            -- into character messages.

    translate_accelerator (window: WEL_WINDOW; accelerators: WEL_ACCELERATORS)
            -- Process accelerator keys for menu commands
        require
            window_not_void: window /= void
            window_exists: window.exists
            accelerators_not_void: accelerators /= void
            accelerators_exists: accelerators.exists

    translate_mdi_accelarator (window: WEL_WINDOW)
            -- Process accelerator keys for system menu commands
            -- of MDI interface child windows.
        require
            window_not_void: window /= void
            window_exists: window.exists

    wait
            -- Wait for a message.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MSG


WEL_NET_RESOURCE Chart

class
    WEL_NET_RESOURCE

General
    cluster: wel.structs
    description:
        "Information about a network resource.
        The structure is returned during enumeration of network resources.
        It is also specified when making or querying a network connection
        with calls to various Windows Networking functions."
    create: make_by_pointer, make

Ancestors
    WEL_NETWORKING_CONSTANTS
    WEL_STRUCTURE

Queries
    comment: STRING
    Connect_interactive: INTEGER
    Connect_localdrive: INTEGER
    Connect_prompt: INTEGER
    Connect_redirect: INTEGER
    Connect_update_profile: INTEGER
    display_type: INTEGER
    Error_access_denied: INTEGER
    Error_already_assigned: INTEGER
    Error_bad_device: INTEGER
    Error_bad_net_name: INTEGER
    Error_bad_provider: INTEGER
    Error_cancelled: INTEGER
    Error_extended_error: INTEGER
    Error_invalid_address: INTEGER
    Error_invalid_parameter: INTEGER
    Error_invalid_password: INTEGER
    Error_more_data: INTEGER
    Error_no_more_items: INTEGER
    Error_no_net_or_bad_path: INTEGER
    Error_no_network: INTEGER
    exists: BOOLEAN
    item: POINTER
    local_name: STRING
    Max_path: INTEGER
    provider: STRING
    remote_name: STRING
    Resource_connected: INTEGER
    Resource_display_type_domain: INTEGER
    Resource_display_type_generic: INTEGER
    Resource_display_type_server: INTEGER
    Resource_display_type_share: INTEGER
    Resource_globalnet: INTEGER
    Resource_remembered: INTEGER
    Resource_type_any: INTEGER
    Resource_type_disk: INTEGER
    Resource_type_print: INTEGER
    Resource_usage_connectable: INTEGER
    Resource_usage_container: INTEGER
    scope: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER
    type: INTEGER
    usage: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_comment (a_value: STRING)
    set_display_type (a_value: INTEGER)
    set_item (an_item: POINTER)
    set_local_name (a_value: STRING)
    set_provider (a_value: STRING)
    set_remote_name (a_value: STRING)
    set_scope (a_value: INTEGER)
    set_shared
    set_type (a_value: INTEGER)
    set_unshared
    set_usage (a_value: INTEGER)


WEL_NET_RESOURCE Flat contracts

indexing
    description: "[
        Information about a network resource.
        The structure is returned during enumeration of network resources.
        It is also specified when making or querying a network connection
        with calls to various Windows Networking functions.
    ]"
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_NET_RESOURCE

create

    make
        ensure
            scope_set: scope = resource_globalnet
            type_set: type = resource_type_disk
            display_type_set: display_type = resource_display_type_generic
            usage_set: usage = resource_usage_connectable
            local_name_set: local_name = void
            remote_name_set: remote_name = void
            comment_set: comment = void
            provider_set: provider = void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    comment: STRING
            -- Comment supplied by the network provider.
            -- It can be Void if there is no supplied comment.

    display_type: INTEGER
            -- Value that indicates how the network object should be
            -- displayed in a network browsing user interface.
        ensure
            valid_result: Result = resource_display_type_domain or Result = resource_display_type_server or Result = resource_display_type_share or Result = resource_display_type_generic

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    local_name: STRING
            -- If scope is equal to Resource_connected or
            -- Resource_remembered, it specifies the name of a local
            -- device. It is Void if the connection does not use a device.
        ensure
            valid_result: (Result /= void) = (scope = resource_connected or scope = resource_remembered)

    provider: STRING
            -- Name of the provider that owns the resource.
            -- It can be Void if the provider name is unknown.
            --
            -- To retrieve the provider name, you can call
            -- WNetGetProviderName.

    remote_name: STRING
            -- If the entry is a network resource, it specifies the remote
            -- network name.
            --
            -- If the entry is a current or persistent connection, it points
            -- to the network name associated with the name pointed to by
            -- local_name.
            --
            -- The string can be MAX_PATH characters in length, and it must
            -- follow the network provider's naming conventions.

    scope: INTEGER
            -- Value that contains the scope of the enumeration.
        ensure
            valid_result: Result = resource_connected or Result = resource_globalnet or Result = resource_remembered

    type: INTEGER
            -- Value that contains a set of bit flags identifying the
            -- type of resource.
        ensure
            valid_result: Result = resource_type_any or Result = resource_type_disk or Result = resource_type_print

    usage: INTEGER
            -- Value that contains a set of bit flags describing how
            -- the resource can be used.
        ensure
            valid_result: Result = resource_usage_connectable or Result = resource_usage_container

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_comment (a_value: STRING)
            -- Set comment to a_value
        ensure
            value_set: equal (comment, a_value)

    set_display_type (a_value: INTEGER)
            -- Set display_type to a_value
        require
            valid_value: a_value = resource_display_type_domain or a_value = resource_display_type_server or a_value = resource_display_type_share or a_value = resource_display_type_generic
        ensure
            value_set: display_type = a_value

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_local_name (a_value: STRING)
            -- Set local_name to a_value
            --
            -- Can only be set if scope is equal to Resource_connected
            -- or Resource_remembered.
        require
            connection_use_device: scope = resource_connected or scope = resource_remembered
        ensure
            value_set: equal (local_name, a_value)

    set_provider (a_value: STRING)
            -- Set provider to a_value
        ensure
            value_set: equal (provider, a_value)

    set_remote_name (a_value: STRING)
            -- Set remote_name to a_value
            --
            -- The string can be MAX_PATH characters in length, and it must
            -- follow the network provider's naming conventions.
        require
            valid_value: a_value.count <= max_path
        ensure
            value_set: equal (remote_name, a_value)

    set_scope (a_value: INTEGER)
            -- Set scope to a_value
        require
            valid_value: a_value = resource_connected or a_value = resource_globalnet or a_value = resource_remembered
        ensure
            value_set: scope = a_value

    set_type (a_value: INTEGER)
            -- Set type to a_value
        require
            valid_value: a_value = resource_type_any or a_value = resource_type_disk or a_value = resource_type_print
        ensure
            value_set: type = a_value

    set_usage (a_value: INTEGER)
            -- Set usage to a_value
            --
            -- Note that this member can be specified only if scope
            -- is equal to Resource_globalnet
        require
            global_scope: scope = resource_globalnet
            valid_value: a_value = resource_usage_connectable or a_value = resource_usage_container
        ensure
            value_set: usage = a_value

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Connect constants

    Connect_interactive: INTEGER is 8
            -- If this flag is set, the operating system may interact with
            -- the user for authentication purposes.
            --
            -- Declared in Windows as CONNECT_INTERACTIVE
            -- (from WEL_NETWORKING_CONSTANTS)

    Connect_localdrive: INTEGER is 256
            -- If this flag is set, the connection was made using a local
            -- device redirection. If the lpAccessName parameter points to a
            -- buffer, the local device name is copied to the buffer.
            --
            -- Declared in Windows as CONNECT_LOCALDRIVE
            -- (from WEL_NETWORKING_CONSTANTS)

    Connect_prompt: INTEGER is 16
            -- This flag instructs the system not to use any default settings
            -- for user names or passwords without offering the user the
            -- opportunity to supply an alternative. This flag is ignored
            -- unless CONNECT_INTERACTIVE is also set.
            --
            -- Declared in Windows as CONNECT_PROMPT
            -- (from WEL_NETWORKING_CONSTANTS)

    Connect_redirect: INTEGER is 128
            -- This flag forces the redirection of a local device when making
            -- the connection.
            --
            -- If the lpLocalName member of NETRESOURCE specifies a local
            -- device to redirect, this flag has no effect, because the
            -- operating system still attempts to redirect the specified
            -- device. When the operating system automatically chooses a local
            -- device, the lpAccessName parameter must point to a return
            -- buffer and the dwType member must not be equal to
            -- RESOURCETYPE_ANY.
            --
            -- If this flag is not set, a local device is automatically chosen
            -- for redirection only if the network requires a local device to
            -- be redirected.
            --
            -- Declared in Windows as CONNECT_REDIRECT
            -- (from WEL_NETWORKING_CONSTANTS)

    Connect_update_profile: INTEGER is 1
            -- This flag instructs the operating system to store the network
            -- resource connection.
            --
            -- If this bit flag is set, the operating system automatically
            -- attempts to restore the connection when the user logs on. The
            -- system remembers only successful connections that redirect
            -- local devices. It does not remember connections that are
            -- unsuccessful or deviceless connections. (A deviceless
            -- connection occurs when lpLocalName is NULL or when it points
            -- to an empty string.)
            --
            -- If this bit flag is clear, the operating system does not
            -- automatically restore the connection at logon.
            --
            -- Declared in Windows as CONNECT_UPDATE_PROFILE
            -- (from WEL_NETWORKING_CONSTANTS)

feature -- Generic constants

    Max_path: INTEGER is 260
            -- Maximum number of characters in full path
            --
            -- Declared in Windows as MAX_PATH
            -- (from WEL_NETWORKING_CONSTANTS)

feature -- Net Errors

    Error_access_denied: INTEGER is 5
            -- Access to the network resource was denied.
            --
            -- Declared in Windows as ERROR_ACCESS_DENIED
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_already_assigned: INTEGER is 85
            -- The local device specified by the lpLocalName member is
            -- already connected to a network resource.
            --
            -- Declared in Windows as ERROR_ALREADY_ASSIGNED
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_bad_device: INTEGER is 1200
            -- The value specified by lpLocalName is invalid.
            --
            -- Declared in Windows as ERROR_BAD_DEVICE
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_bad_net_name: INTEGER is 67
            -- The value specified by the lpRemoteName member is not
            -- acceptable to any network resource provider because the
            -- resource name is invalid, or because the named resource
            -- cannot be located.
            --
            -- Declared in Windows as ERROR_BAD_NET_NAME
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_bad_provider: INTEGER is 1204
            -- The value specified by the lpProvider member does not match
            -- any provider.
            --
            -- Declared in Windows as ERROR_BAD_PROVIDER
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_cancelled: INTEGER is 1223
            -- The attempt to make the connection was canceled by the user
            -- through a dialog box from one of the network resource
            -- providers, or by a called resource.
            --
            -- Declared in Windows as ERROR_CANCELLED
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_extended_error: INTEGER is 1208
            -- A network-specific error occurred. To obtain a description of
            -- the error, call the WNetGetLastError function.
            --
            -- Declared in Windows as ERROR_EXTENDED_ERROR
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_invalid_address: INTEGER is 487
            -- The caller passed in a pointer to a buffer that could not be
            -- accessed.
            --
            -- Declared in Windows as ERROR_INVALID_ADDRESS
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_invalid_parameter: INTEGER is 87
            -- This error is a result of one of the following conditions:
            -- 1. The lpRemoteName member is NULL. In addition, lpAccessName
            --    is not NULL, but lpBufferSize is either NULL or points to
            --    zero.
            -- 2. The dwType member is neither RESOURCETYPE_DISK nor
            --    RESOURCETYPE_PRINT. In addition, either CONNECT_REDIRECT
            --    is set in dwFlags and lpLocalName is NULL, or the
            --    connection is to a network that requires the redirecting
            --    of a local device.
            --
            -- Declared in Windows as ERROR_INVALID_PARAMETER
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_invalid_password: INTEGER is 86
            -- The specified password is invalid and the CONNECT_INTERACTIVE
            -- flag is not set.
            --
            -- Declared in Windows as ERROR_INVALID_PASSWORD
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_more_data: INTEGER is 234
            -- The lpAccessName buffer is too small.
            -- If a local device is redirected, the buffer needs to be large
            -- enough to contain the local device name. Otherwise, the
            -- buffer needs to be large enough to contain either the string
            -- pointed to by lpRemoteName, or the name of the connectable
            -- resource whose alias is pointed to by lpRemoteName. If this
            -- error is returned, then no connection has been made.
            --
            -- Declared in Windows as ERROR_MORE_DATA
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_no_more_items: INTEGER is 259
            -- The operating system cannot automatically choose a local
            -- redirection because all the valid local devices are in use.
            --
            -- Declared in Windows as ERROR_NO_MORE_ITEMS
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_no_net_or_bad_path: INTEGER is 1203
            -- The operation could not be completed, either because a
            -- network component is not started, or because the specified
            -- resource name is not recognized.
            --
            -- Declared in Windows as ERROR_NO_NET_OR_BAD_PATH
            -- (from WEL_NETWORKING_CONSTANTS)

    Error_no_network: INTEGER is 1222
            -- The network is unavailable.
            --
            -- Declared in Windows as ERROR_NO_NETWORK
            -- (from WEL_NETWORKING_CONSTANTS)

feature -- Net Resource constants

    Resource_connected: INTEGER is 1
            -- Enumerate currently connected resources.
            --
            -- Declared in Windows as RESOURCE_CONNECTED
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_display_type_domain: INTEGER is 1
            -- The object should be displayed as a domain.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_DOMAIN
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_display_type_generic: INTEGER is 0
            -- The method used to display the object does not matter.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_GENERIC
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_display_type_server: INTEGER is 2
            -- The object should be displayed as a server.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_SERVER
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_display_type_share: INTEGER is 3
            -- The object should be displayed as a share.
            --
            -- Declared in Windows as RESOURCEDISPLAYTYPE_SHARE
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_globalnet: INTEGER is 2
            -- Enumerate all resources on the network.
            --
            -- Declared in Windows as RESOURCE_GLOBALNET
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_remembered: INTEGER is 3
            -- Enumerate remembered (persistent) connections.
            --
            -- Declared in Windows as RESOURCE_REMEMBERED
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_type_any: INTEGER is 0
            -- All resources
            --
            -- Declared in Windows as RESOURCETYPE_ANY
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_type_disk: INTEGER is 1
            -- Disk resources
            --
            -- Declared in Windows as RESOURCETYPE_DISK
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_type_print: INTEGER is 2
            -- Print resources
            --
            -- Declared in Windows as RESOURCETYPE_PRINT
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_usage_connectable: INTEGER is 1
            -- The resource is a connectable resource
            --
            -- Declared in Windows as RESOURCEUSAGE_CONNECTABLE
            -- (from WEL_NETWORKING_CONSTANTS)

    Resource_usage_container: INTEGER is 2
            -- The resource is a container resource
            --
            -- Declared in Windows as RESOURCEUSAGE_CONTAINER
            -- (from WEL_NETWORKING_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NET_RESOURCE


WEL_NMHDR Chart

class
    WEL_NMHDR

General
    cluster: wel.structs
    description: "Contains information about a notification message (Wm_notify)."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE
    WEL_WINDOW_MANAGER

Queries
    code: INTEGER
    exists: BOOLEAN
    id_from: INTEGER
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    window_from: WEL_WINDOW

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NMHDR Flat contracts

indexing
    description: "Contains information about a notification message (Wm_notify)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NMHDR

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    code: INTEGER
            -- Notification code

    id_from: INTEGER
            -- Identifier of control sending message

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    window_from: WEL_WINDOW
            -- Control sending message

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NMHDR


WEL_NM_COMBO_BOX_EX_ENDEDIT Chart

class
    WEL_NM_COMBO_BOX_EX_ENDEDIT

General
    cluster: wel.structs
    description: "Contains information about a combo-box-ex Cben_endedit notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    has_changed: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    selected_item: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    to_integer: INTEGER
    why: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NM_COMBO_BOX_EX_ENDEDIT Flat contracts

indexing
    description: "Contains information about a combo-box-ex Cben_endedit notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_COMBO_BOX_EX_ENDEDIT

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Initialization

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

feature -- Access

    has_changed: BOOLEAN
            -- Value indicating whether the contents of the control's
            -- edit box have changed.

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    selected_item: INTEGER
            -- Zero-based index of the item that will be selected
            -- after completing the edit operation.

    text: STRING
            -- Text from within the control's edit box.

    why: INTEGER
            -- Value that specifies the action that generated then
            -- Cben_endedit notification message.
            -- Can be any of the Cbenf_* constants.
            -- See class WEL_CBEN_CONSTANTS for values.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_COMBO_BOX_EX_ENDEDIT


WEL_NM_COMBO_BOX_EX Chart

class
    WEL_NM_COMBO_BOX_EX

General
    cluster: wel.structs
    description: "Contains information about a combo-box-ex notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    comboboxex_item: WEL_COMBO_BOX_EX_ITEM
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NM_COMBO_BOX_EX Flat contracts

indexing
    description: "Contains information about a combo-box-ex notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_COMBO_BOX_EX

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Initialization

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

feature -- Access

    comboboxex_item: WEL_COMBO_BOX_EX_ITEM
            -- Information about the notification-specific action flag.
            -- See class WEL_TVAF_CONSTANTS for the meaning of this parameter.

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_COMBO_BOX_EX


WEL_NM_HEADER Chart

class
    WEL_NM_HEADER

General
    cluster: wel.structs
    description: "Contains information about a header control notificationmessage."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    hditem: WEL_HD_ITEM
    hdr: WEL_NMHDR
    ibutton: INTEGER
    iitem: INTEGER
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NM_HEADER Flat contracts

indexing
    description: "Contains information about a header control notificationmessage."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_HEADER

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    hditem: WEL_HD_ITEM
            -- Result is information about iitem.

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    ibutton: INTEGER
            -- Value of mouse button used to generate message.

    iitem: INTEGER
            -- Zero-based index of the header item generating message.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_HEADER


WEL_NM_LIST_VIEW Chart

class
    WEL_NM_LIST_VIEW

General
    cluster: wel.structs
    description: "Contains information about a list view notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    hdr: WEL_NMHDR
    iitem: INTEGER
    isubitem: INTEGER
    item: POINTER
    position: WEL_POINT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    uchanged: INTEGER
    unewstate: INTEGER
    uoldstate: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NM_LIST_VIEW Flat contracts

indexing
    description: "Contains information about a list view notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_LIST_VIEW

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    iitem: INTEGER
            -- Information about the list view item or -1 if
            -- not used.

    isubitem: INTEGER
            -- Information about the subitem or 0 if none.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    position: WEL_POINT
            -- Location at which the event occurred.
            -- valid argument only for the Lvn_begindrag and
            -- Lvn_beginrdrag notification messages.

    uchanged: INTEGER
            -- Information about the item attributes that
            -- has changed.

    unewstate: INTEGER
            -- Information about the new item state or 0 if
            -- not used.
            -- See class WEL_LVIS_CONSTANTS.

    uoldstate: INTEGER
            -- Information about the old item state or 0 if
            -- not used.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_LIST_VIEW


WEL_NM_TOOL_BAR Chart

class
    WEL_NM_TOOL_BAR

General
    cluster: wel.structs
    description: "Contains information about a toolbar notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    button: WEL_TOOL_BAR_BUTTON
    button_id: INTEGER
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    text_count: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NM_TOOL_BAR Flat contracts

indexing
    description: "Contains information about a toolbar notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_TOOL_BAR

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    button: WEL_TOOL_BAR_BUTTON
            -- Button associated with the notification. This
            -- member contains valid informations only with the
            -- Tbn_queryinsert and Tbn_querydelete notification
            -- messages.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    button_id: INTEGER
            -- Information about the command identifier of the
            -- button associated with the notification.
        require
            exists: exists

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    text: STRING
            -- Text of the button associated with the notification.
        require
            exists: exists

    text_count: INTEGER
            -- Count of characters in the button text.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_TOOL_BAR


WEL_NM_TREE_VIEW Chart

class
    WEL_NM_TREE_VIEW

General
    cluster: wel.structs
    description: "Contains information about a tree view notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    action: INTEGER
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    new_item: WEL_TREE_VIEW_ITEM
    old_item: WEL_TREE_VIEW_ITEM
    position: WEL_POINT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NM_TREE_VIEW Flat contracts

indexing
    description: "Contains information about a tree view notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_TREE_VIEW

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    action: INTEGER
            -- Information about the notification-specific action flag.
            -- See class WEL_TVAF_CONSTANTS for the meaning of this parameter.

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    new_item: WEL_TREE_VIEW_ITEM
            -- Information about the new item state
        ensure
            result_not_void: Result /= void

    old_item: WEL_TREE_VIEW_ITEM
            -- Information about the old item state
        ensure
            result_not_void: Result /= void

    position: WEL_POINT
            -- Mouse coordinates when notification occurred.
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_TREE_VIEW


WEL_NM_TREE_VIEW_GETINFOTIP Chart

class
    WEL_NM_TREE_VIEW_GETINFOTIP

General
    cluster: wel.structs
    description: "Contains information about a tree view notificationmessage."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    cchtextmax: INTEGER
    exists: BOOLEAN
    hdr: WEL_NMHDR
    hitem: POINTER
    item: POINTER
    lparam: INTEGER
    psztext: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_NM_TREE_VIEW_GETINFOTIP Flat contracts

indexing
    description: "Contains information about a tree view notificationmessage."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_TREE_VIEW_GETINFOTIP

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- access

    cchtextmax: INTEGER
            -- Size of buffer at psztext.
        ensure
            result_not_void: Result /= void

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    hitem: POINTER
            -- Handle to item for which the tooltip is displayed.
        ensure
            result_not_void: Result /= void

    lparam: INTEGER
            -- Application defined data associated with hitem.
        ensure
            result_not_void: Result /= void

    psztext: POINTER
            -- Address of text to be displayed.
        ensure
            result_not_void: Result /= void

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_TREE_VIEW_GETINFOTIP


WEL_NM_UP_DOWN_CONTROL Chart

class
    WEL_NM_UP_DOWN_CONTROL

General
    cluster: wel.structs
    description: "Contains information about an up-down control notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    delta: INTEGER
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    position: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_delta (a_delta: INTEGER)
    set_item (an_item: POINTER)
    set_position (a_position: INTEGER)
    set_shared
    set_unshared


WEL_NM_UP_DOWN_CONTROL Flat contracts

indexing
    description: "Contains information about an up-down control notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NM_UP_DOWN_CONTROL

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    delta: INTEGER
            -- Proposed change in the position of the up-down
            -- control

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    position: INTEGER
            -- Current position of the up-down control

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_delta (a_delta: INTEGER)
            -- Set delta with a_delta.
        ensure
            delta_set: delta = a_delta

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_position (a_position: INTEGER)
            -- Set position with a_position.
        ensure
            position_set: position = a_position

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NM_UP_DOWN_CONTROL


WEL_NON_CLIENT_METRICS Chart

class
    WEL_NON_CLIENT_METRICS

General
    cluster: wel.structs
    description: "The NONCLIENTMETRICS structure contains the scalable metricsassociated with the nonclient area of a nonminimized window.This structure is used by the SPI_GETNONCLIENTMETRICS and SPI_SETNONCLIENTMETRICS actions of SystemParametersInfo"
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    border_width: INTEGER
    caption_font: WEL_LOG_FONT
    caption_height: INTEGER
    caption_width: INTEGER
    exists: BOOLEAN
    item: POINTER
    menu_font: WEL_LOG_FONT
    menu_height: INTEGER
    menu_width: INTEGER
    message_font: WEL_LOG_FONT
    scroll_height: INTEGER
    scroll_width: INTEGER
    shared: BOOLEAN
    small_caption_font: WEL_LOG_FONT
    small_caption_height: INTEGER
    small_caption_width: INTEGER
    status_font: WEL_LOG_FONT
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_structure_size (a_size: INTEGER)
    set_unshared


WEL_NON_CLIENT_METRICS Flat contracts

indexing
    description: "The NONCLIENTMETRICS structure contains the scalable metricsassociated with the nonclient area of a nonminimized window.This structure is used by the SPI_GETNONCLIENTMETRICS and SPI_SETNONCLIENTMETRICS actions of SystemParametersInfo"
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NON_CLIENT_METRICS

create

    make
            -- Create a new structure.

feature -- Access

    border_width: INTEGER
            -- Specifies the thickness, in pixels, of the sizing border.
        ensure
            positive_result: Result >= 0

    caption_font: WEL_LOG_FONT
            -- Contains information about the caption font.
        ensure
            valid_result: Result /= void and then Result.exists

    caption_height: INTEGER
            -- Specifies the height, in pixels, of caption buttons.
        ensure
            positive_result: Result >= 0

    caption_width: INTEGER
            -- Specifies the width, in pixels, of caption buttons.
        ensure
            positive_result: Result >= 0

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu_font: WEL_LOG_FONT
            -- Contains information about the font used in menu bars.
        ensure
            valid_result: Result /= void and then Result.exists

    menu_height: INTEGER
            -- Specifies the height, in pixels, of a menu bar.
        ensure
            positive_result: Result >= 0

    menu_width: INTEGER
            -- Specifies the width, in pixels, of menu-bar buttons.
        ensure
            positive_result: Result >= 0

    message_font: WEL_LOG_FONT
            -- Contains information about the font used in message boxes.
        ensure
            valid_result: Result /= void and then Result.exists

    scroll_height: INTEGER
            -- Specifies the height, in pixels, of a standard horizontal scroll bar.
        ensure
            positive_result: Result >= 0

    scroll_width: INTEGER
            -- Specifies the width, in pixels, of a standard vertical scroll bar.
        ensure
            positive_result: Result >= 0

    small_caption_font: WEL_LOG_FONT
            -- Contains information about the caption font.
        ensure
            valid_result: Result /= void and then Result.exists

    small_caption_height: INTEGER
            -- Specifies the height, in pixels, of caption buttons.
        ensure
            positive_result: Result >= 0

    small_caption_width: INTEGER
            -- Specifies the width, in pixels, of caption buttons.
        ensure
            positive_result: Result >= 0

    status_font: WEL_LOG_FONT
            -- Contains information about the font used in status bars and tooltips.
        ensure
            valid_result: Result /= void and then Result.exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_structure_size (a_size: INTEGER)
            -- Set the structure size to a_size.

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NON_CLIENT_METRICS


WEL_PAINT_STRUCT Chart

class
    WEL_PAINT_STRUCT

General
    cluster: wel.structs
    description: "Contains information about the Wm_paint message."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    erase: BOOLEAN
    exists: BOOLEAN
    item: POINTER
    rect_paint: WEL_RECT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_PAINT_STRUCT Flat contracts

indexing
    description: "Contains information about the Wm_paint message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:26 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PAINT_STRUCT

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    erase: BOOLEAN
            -- Must the background be erased?

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    rect_paint: WEL_RECT
            -- Rectangle that specifies which part
            -- must be painted.
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PAINT_STRUCT


WEL_PALETTE_ENTRY Chart

class
    WEL_PALETTE_ENTRY

General
    cluster: wel.structs
    description: "Specifies the color and usage of an entry in a logical color palette."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    blue: INTEGER
    exists: BOOLEAN
    flags: INTEGER
    green: INTEGER
    item: POINTER
    red: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_blue (a_blue: INTEGER)
    set_flags (a_flags: INTEGER)
    set_green (a_green: INTEGER)
    set_item (an_item: POINTER)
    set_red (a_red: INTEGER)
    set_shared
    set_unshared


WEL_PALETTE_ENTRY Flat contracts

indexing
    description: "Specifies the color and usage of an entry in a logical color palette."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PALETTE_ENTRY

create

    make (a_red, a_green, a_blue, a_flags: INTEGER)
            -- Make a palette entry with colors
            -- a_red, a_green, a_blue
            -- For a_flags, see class WEL_PC_FLAGS_CONSTANTS
        ensure
            red_set: red = a_red
            green_set: green = a_green
            blue_set: blue = a_blue
            flags_set: flags = a_flags

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    blue: INTEGER

    flags: INTEGER

    green: INTEGER

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    red: INTEGER

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_blue (a_blue: INTEGER)
        ensure
            blue_set: blue = a_blue

    set_flags (a_flags: INTEGER)
        ensure
            flags_set: flags = a_flags

    set_green (a_green: INTEGER)
        ensure
            green_set: green = a_green

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_red (a_red: INTEGER)
        ensure
            red_set: red = a_red

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PALETTE_ENTRY


WEL_PARAGRAPH_FORMAT Chart

class
    WEL_PARAGRAPH_FORMAT

General
    cluster: wel.structs
    description: "Contains information about paragraph formating attributes in a rich edit control."
    create: make_by_pointer, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_PFA_CONSTANTS
    WEL_PFM_CONSTANTS
    WEL_STRUCTURE

Queries
    alignment: INTEGER
    exists: BOOLEAN
    has_mask (a_mask: INTEGER): BOOLEAN
    item: POINTER
    mask: INTEGER
    max_tab_stops: INTEGER
    numbering: INTEGER
    offset: INTEGER
    right_indent: INTEGER
    shared: BOOLEAN
    start_indent: INTEGER
    Structure_size: INTEGER
    tabulations: ARRAY [INTEGER]
    to_integer: INTEGER

Commands
    add_mask (a_mask: INTEGER)
    bullet_numbering
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    no_numbering
    remove_mask (a_mask: INTEGER)
    set_alignment (an_alignment: INTEGER)
    set_center_alignment
    set_default_tabulation
    set_item (an_item: POINTER)
    set_left_alignment
    set_mask (a_mask: INTEGER)
    set_offset (an_offset: INTEGER)
    set_right_alignment
    set_right_indent (a_right_indent: INTEGER)
    set_shared
    set_start_indent (a_start_indent: INTEGER)
    set_tabulation (tab: INTEGER)
    set_tabulations (tabs: ARRAY [INTEGER])
    set_unshared


WEL_PARAGRAPH_FORMAT Flat contracts

indexing
    description: "Contains information about paragraph formating attributes in a rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PARAGRAPH_FORMAT

create

    make
            -- Make a paragraph format structure.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    alignment: INTEGER
            -- Alignment type.
            -- See class WEL_PFA_CONSTANTS for values.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- Valid information or attributes to set.
            -- See class WEL_PFM_CONSTANTS for values.
            -- This attribut is automatically set by the
            -- features set_*.

    numbering: INTEGER
            -- Numbering type

    offset: INTEGER
            -- Indentation of the second line and subsequent
            -- lines, relative to the starting indentation. The
            -- first line is indented if this member is negative,
            -- or outdented is this member is positive.

    right_indent: INTEGER
            -- Size of the right indentation, relative to the right
            -- margin

    start_indent: INTEGER
            -- Indentation of the first line in the paragraph

    tabulations: ARRAY [INTEGER]
            -- Contains tab stops
        ensure
            result_not_void: Result /= void

feature -- Measurement

    max_tab_stops: INTEGER

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    has_mask (a_mask: INTEGER): BOOLEAN
            -- Is a_mask set in mask?
            -- See class WEL_PFM_CONSTANTS for a_mask values.

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_mask (a_mask: INTEGER)
            -- Add a_mask to mask.
            -- See class WEL_PFM_CONSTANTS for a_mask values.
        ensure
            has_mask: has_mask (a_mask)

    bullet_numbering
            -- Add bullets.
        ensure
            bullet_numbering: numbering = pfn_bullet

    no_numbering
            -- Remove any numbering.
        ensure
            no_numbering: numbering = 0

    remove_mask (a_mask: INTEGER)
            -- Remove a_mask from mask.
            -- See class WEL_PFM_CONSTANTS for a_mask values.
        ensure
            has_not_mask: not has_mask (a_mask)

    set_alignment (an_alignment: INTEGER)
            -- Set alignment with an_alignment.
            -- See class WEL_PFA_CONSTANTS for values.
        ensure
            alignment_set: alignment = an_alignment

    set_center_alignment
            -- Paragraphs are centered.
        ensure
            alignment_set: alignment = pfa_center

    set_default_tabulation
            -- Set the default tabulation.

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_left_alignment
            -- Paragraphs are aligned with the left margin.
        ensure
            alignment_set: alignment = pfa_left

    set_mask (a_mask: INTEGER)
            -- Set mask with a_mask.
            -- See class WEL_PFM_CONSTANTS for a_mask values.
        ensure
            mask_set: mask = a_mask

    set_offset (an_offset: INTEGER)
            -- Set offset with an_offset.
        ensure
            offset_set: offset = an_offset

    set_right_alignment
            -- Paragraphs are aligned with the right margin.
        ensure
            alignment_set: alignment = pfa_right

    set_right_indent (a_right_indent: INTEGER)
            -- Set right_indent with a_right_indent.
        ensure
            right_indent_set: right_indent = a_right_indent

    set_start_indent (a_start_indent: INTEGER)
            -- Set start_indent with a_start_indent.
        ensure
            start_indent_set: start_indent = a_start_indent

    set_tabulation (tab: INTEGER)
            -- Set a tab stop at every tab.

    set_tabulations (tabs: ARRAY [INTEGER])
            -- Set tabulation stops using the values of tabs.
        require
            tabs_not_void: tabs /= void
            tabs_count: tabs.count <= max_tab_stops
        ensure
            tabulations_set: tabulations.is_equal (tabs)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PARAGRAPH_FORMAT


WEL_POINT Chart

class
    WEL_POINT

General
    cluster: wel.structs
    description: "Defines the x and y coordinates of a point."
    create: make_by_pointer, make_by_cursor_position, make

Ancestors
    WEL_STRUCTURE
    WEL_WINDOW_MANAGER

Queries
    exists: BOOLEAN
    is_equal (other: [like Current] WEL_POINT): BOOLEAN
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    window_at: WEL_WINDOW
    x: INTEGER
    y: INTEGER

Commands
    client_to_screen (window: WEL_WINDOW)
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    screen_to_client (window: WEL_WINDOW)
    set_cursor_position
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    set_x (a_x: INTEGER)
    set_x_y (a_x, a_y: INTEGER)
    set_y (a_y: INTEGER)


WEL_POINT Flat contracts

indexing
    description: "Defines the x and y coordinates of a point."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_POINT

create

    make (a_x, a_y: INTEGER)
            -- Make a point and set
            -- x, y with a_x, a_y
        ensure
            x_set: x = a_x
            y_set: y = a_y

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_by_cursor_position
            -- Make a point and set x and y with
            -- the current cursor position.

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    x: INTEGER
            -- x position

    y: INTEGER
            -- y position

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is Current equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    window_at: WEL_WINDOW
            -- Window containing current point

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_cursor_position
            -- Set x and y to the current cursor position.

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_x (a_x: INTEGER)
            -- Set x with a_x
        ensure
            x_set: x = a_x

    set_x_y (a_x, a_y: INTEGER)
            -- Set x with a_x and y with a_y.
        ensure
            x_set: x = a_x
            y_set: y = a_y

    set_y (a_y: INTEGER)
            -- Set y with a_y
        ensure
            y_set: y = a_y

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    client_to_screen (window: WEL_WINDOW)
            -- Converts Current to screen relative position
            -- window is the client area to be used for
            -- the conversion
        require
            window_not_void: window /= void
            window_exists: window.exists

    screen_to_client (window: WEL_WINDOW)
            -- Converts Current to client relative position
            -- window is the client area to be used for
            -- the conversion
        require
            window_not_void: window /= void
            window_exists: window.exists

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_POINT


WEL_PROCESS_INFO Chart

class
    WEL_PROCESS_INFO

General
    cluster: wel.structs
    description: "Information about a process."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    process_handle: INTEGER
    process_id: INTEGER
    shared: BOOLEAN
    thread_handle: INTEGER
    thread_id: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_process_handle (a_handle: [like process_handle] INTEGER)
    set_process_id (a_id: [like process_id] INTEGER)
    set_shared
    set_thread_handle (a_handle: [like thread_handle] INTEGER)
    set_thread_id (a_id: [like thread_id] INTEGER)
    set_unshared


WEL_PROCESS_INFO Flat contracts

indexing
    description: "Information about a process."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_PROCESS_INFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    process_handle: INTEGER
            -- Handle to process

    process_id: INTEGER
            -- Process identifier

    thread_handle: INTEGER
            -- Handle to thread

    thread_id: INTEGER
            -- Thread identifier

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Element Settings

    set_process_handle (a_handle: like process_handle)
            -- Set process_handle with a_handle.
        require
            valid_handle: a_handle > 0
        ensure
            handle_set: process_handle = a_handle

    set_process_id (a_id: like process_id)
            -- Set process_id with a_id.
        require
            valid_id: a_id > 0
        ensure
            id_set: process_id = a_id

    set_thread_handle (a_handle: like thread_handle)
            -- Set thread_handle with a_handle.
        require
            valid_handle: a_handle > 0
        ensure
            handle_set: thread_handle = a_handle

    set_thread_id (a_id: like thread_id)
            -- Set thread_id with a_id.
        require
            valid_id: a_id > 0
        ensure
            id_set: thread_id = a_id

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PROCESS_INFO


WEL_REBARBANDINFO Chart

class
    WEL_REBARBANDINFO

General
    cluster: wel.structs
    description: "Contains information about a rebar control band."
    create: make_by_pointer, make_with_id, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_BIT_OPERATIONS
    WEL_RBBIM_CONSTANTS
    WEL_STRUCTURE
    WEL_WINDOW_MANAGER

Queries
    background_color: WEL_COLOR_REF
    child: WEL_WINDOW
    child_minimum_height: INTEGER
    child_minimum_width: INTEGER
    exists: BOOLEAN
    foreground_color: WEL_COLOR_REF
    id: INTEGER
    item: POINTER
    length: INTEGER
    mask: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    style: INTEGER
    text: STRING
    to_integer: INTEGER

Commands
    clear_mask
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_background_bitmap (bmp: WEL_BITMAP)
    set_background_color (color: WEL_COLOR_REF)
    set_child (window: WEL_WINDOW)
    set_child_minimum_height (value: INTEGER)
    set_child_minimum_width (value: INTEGER)
    set_foreground_color (color: WEL_COLOR_REF)
    set_id (value: INTEGER)
    set_item (an_item: POINTER)
    set_length (value: INTEGER)
    set_shared
    set_style (value: INTEGER)
    set_text (txt: STRING)
    set_unpositionable_child (window: WEL_WINDOW)
    set_unshared


WEL_REBARBANDINFO Flat contracts

indexing
    description: "Contains information about a rebar control band."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_REBARBANDINFO

create

    make
            -- Create a band with no informations.

    make_with_id (an_id: INTEGER)
            -- Create a band with an_id as id.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
        require
            exists: exists
        ensure
            color_not_void: Result /= void

    child: WEL_WINDOW
            -- Child currently in the rebar.
        require
            exists: exists

    child_minimum_height: INTEGER
            -- Minimum width required by the child.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    child_minimum_width: INTEGER
            -- Minimum width required by the child.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
        require
            exists: exists
        ensure
            color_not_void: Result /= void

    id: INTEGER
            -- id of the band.
        require
            exists: exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    length: INTEGER
            -- Current length of the band.
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    mask: INTEGER
            -- Array of flags that indicate which of the other
            -- structure members contain valid data or which are
            -- to be filled in. This member can be a combination
            -- of the Rbbim_* values.
            -- See class WEL_RBBIM_CONSTANTS.
        require
            exists: exists

    style: INTEGER
            -- Array of flags that specify the band style.
            -- This value can be a combinaison of RBBS_* constants.
            -- See class WEL_RBBS_CONSTANTS.
        require
            exists: exists

    text: STRING
            -- Item text
        require
            exists: exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_background_bitmap (bmp: WEL_BITMAP)
            -- Set background_bitmap with bmp.
        require
            exists: exists
            bitmap_not_void: bmp /= void

    set_background_color (color: WEL_COLOR_REF)
            -- Set background_color as color.
        require
            exists: exists
            color_not_void: color /= void
        ensure
            color_set: background_color.is_equal (color)

    set_child (window: WEL_WINDOW)
            -- Set child as window.
            -- Do not use this features for controls as toolbars
            -- that reposition themself automaticaly at a specific
            -- place. Use set_reposition_child.
        require
            exists: exists
            window_not_void: window /= void
            window_is_inside: window.is_inside
        ensure
            window_set: child.is_equal (window)

    set_child_minimum_height (value: INTEGER)
            -- Set child_minimum_height as value.
        require
            exists: exists
            valid_value: value >= 0
        ensure
            value_set: child_minimum_height = value

    set_child_minimum_width (value: INTEGER)
            -- Set child_minimum_width as value.
        require
            exists: exists
            valid_value: value >= 0
        ensure
            value_set: child_minimum_width = value

    set_foreground_color (color: WEL_COLOR_REF)
            -- Set foreground_color as color.
        require
            exists: exists
            color_not_void: color /= void
        ensure
            color_set: foreground_color.is_equal (color)

    set_id (value: INTEGER)
            -- Set id as value.
        require
            exists: exists
        ensure
            id_set: id = value

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_length (value: INTEGER)
            -- Set length as value.
        require
            exists: exists
            valid_value: value >= 0
        ensure
            length_set: length = value

    set_style (value: INTEGER)
            -- Set cbSize (size of the structure) as value.
        require
            exists: exists
        ensure
            style_set: style = value

    set_text (txt: STRING)
            -- Set text as txt.
        require
            exists: exists
            a_text_not_void: txt /= void
        ensure
            text_set: text.is_equal (txt)

    set_unpositionable_child (window: WEL_WINDOW)
            -- Set child as window.
            -- Use this features for controls as toolbars
            -- that reposition themself automaticaly at a specific
            -- place. Use set_reposition_child.
            -- Do not use for usual controls.
        require
            exists: exists
            window_not_void: window /= void
            window_is_inside: window.is_inside
        ensure
            window_set: child.is_equal (window.parent)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Basic operation

    clear_mask
            -- Clear the current mask.
            -- Call it before to call a set_? feature when you
            -- want to change only one parameter.
        require
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REBARBANDINFO


WEL_REBARINFO Chart

class
    WEL_REBARINFO

General
    cluster: wel.structs
    description: "Contains information about a rebar control."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    mask: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_REBARINFO Flat contracts

indexing
    description: "Contains information about a rebar control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_REBARINFO

create

    make
            -- Make a REBARINFO structure.
            -- We have to set cbSize to the structure
            -- size before to use this object.
            -- As the imagelist are not implemented, we initialize
            -- the list to the default_pointer, otherwise,
            -- the bar has the wrong size.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- Array of flags that indicate which of the other
            -- structure members contain valid data or which are
            -- to be filled in. This member can be a combination
            -- of the Rbim_* values (only one for now).
            -- See class WEL_RBIM_CONSTANTS.
        require
            exists: exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REBARINFO


WEL_RECT Chart

class
    WEL_RECT

General
    cluster: wel.structs
    description: "Defines the coordinates of the upper-left and lower-right corners of a rectangle."
    create: make_by_pointer, make_window, make_client, make

Ancestors
    WEL_STRUCTURE

Queries
    bottom: INTEGER
    empty: BOOLEAN
    exists: BOOLEAN
    height: INTEGER
    is_equal (other: [like Current] WEL_RECT): BOOLEAN
    item: POINTER
    left: INTEGER
    point_in (point: WEL_POINT): BOOLEAN
    right: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    top: INTEGER
    width: INTEGER
    x: INTEGER
    y: INTEGER

Commands
    dispose
    inflate (a_x, a_y: INTEGER)
    initialize
    initialize_with_character (a_character: CHARACTER)
    intersect (rect1, rect2: WEL_RECT)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    offset (a_x, a_y: INTEGER)
    set_bottom (a_bottom: INTEGER)
    set_item (an_item: POINTER)
    set_left (a_left: INTEGER)
    set_rect (a_left, a_top, a_right, a_bottom: INTEGER)
    set_right (a_right: INTEGER)
    set_shared
    set_top (a_top: INTEGER)
    set_unshared
    subtract (rect1, rect2: WEL_RECT)
    union (rect1, rect2: WEL_RECT)

Constraints
    positive width
    positive height


WEL_RECT Flat contracts

indexing
    description: "Defines the coordinates of the upper-left and lower-right corners of a rectangle."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RECT

create

    make (a_left, a_top, a_right, a_bottom: INTEGER)
            -- Make a rectangle and set left, top,
            -- right, bottom with a_left, a_top,
            -- a_right, a_bottom
        ensure
            left_set: left = a_left
            top_set: top = a_top
            right_set: right = a_right
            bottom_set: bottom = a_bottom

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_client (window: WEL_WINDOW)
            -- Make a client rectangle with window
        require
            window_not_void: window /= void
            window_exists: window.exists
        ensure
            left_equal_zero: left = 0
            top_equal_zero: top = 0
            client_rect_set: is_equal (window.client_rect)

    make_window (window: WEL_WINDOW)
            -- Make a window rectangle with window
            -- (absolute position)
        require
            window_not_void: window /= void
            window_exists: window.exists
        ensure
            window_rect_set: is_equal (window.window_rect)

feature -- Access

    bottom: INTEGER
            -- Position of the bottom border

    height: INTEGER
            -- Height of current rect

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    left: INTEGER
            -- Position of the left border
            -- Was declared in WEL_RECT as synonym of x.

    right: INTEGER
            -- Position of the right border

    top: INTEGER
            -- Position of the top border
            -- Was declared in WEL_RECT as synonym of y.

    width: INTEGER
            -- Width of current rect

    x: INTEGER
            -- Position of the left border
            -- Was declared in WEL_RECT as synonym of left.

    y: INTEGER
            -- Position of the top border
            -- Was declared in WEL_RECT as synonym of top.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Is Current equal to other?
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    empty: BOOLEAN
            -- Is it empty?
            -- A rectangle is empty if the coordinate of the right
            -- side is less than or equal to the coordinate
            -- of the left side, or the coordinate of the bottom
            -- side is less than or equal to the coordinate of
            -- the top side.

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    point_in (point: WEL_POINT): BOOLEAN
            -- Is point in the rectangle?
        require
            point_not_void: point /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bottom (a_bottom: INTEGER)
            -- Set bottom with a_bottom
        ensure
            bottom_set: bottom = a_bottom

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_left (a_left: INTEGER)
            -- Set left with a_left
        ensure
            left_set: left = a_left

    set_rect (a_left, a_top, a_right, a_bottom: INTEGER)
            -- Quick set of left, top, right, bottom
            -- with a_left, a_top, a_right, a_bottom
            -- respectively.
        ensure
            left_set: left = a_left
            top_set: top = a_top
            right_set: right = a_right
            bottom_set: bottom = a_bottom

    set_right (a_right: INTEGER)
            -- Set right with a_right
        ensure
            right_set: right = a_right

    set_top (a_top: INTEGER)
            -- Set top with a_top
        ensure
            top_set: top = a_top

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    inflate (a_x, a_y: INTEGER)
            -- Inflate the rectangle by a_x and a_y.
            -- Positive values increase the width and height,
            -- and negative values decrease them.
        ensure
            left_set: left = old left - a_x
            top_set: top = old top - a_x
            right_set: right = old right + a_y
            bottom_set: bottom = old bottom + a_y

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    intersect (rect1, rect2: WEL_RECT)
            -- Calculates the intersection of rect1
            -- and rect2. If rect1 and rect2 do not
            -- intersect then empty becomes True.
        require
            rect1_not_void: rect1 /= void
            rect2_not_void: rect2 /= void

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    offset (a_x, a_y: INTEGER)
            -- Moves the rectangle by the specified
            -- offsets a_x and a_y.
        ensure
            x_set: x = old x + a_x
            y_set: y = old y + a_y
            right_set: right = old right + a_x
            bottom_set: bottom = old bottom + a_y

    subtract (rect1, rect2: WEL_RECT)
            -- Set the current rectangle by subtracting
            -- rect2 from rect1.
        require
            rect1_not_void: rect1 /= void
            rect2_not_void: rect2 /= void

    union (rect1, rect2: WEL_RECT)
            -- Set the current rectangle by the smallest
            -- rectangle that contains both source
            -- rectangles rect1 and rect2.
        require
            rect1_not_void: rect1 /= void
            rect2_not_void: rect2 /= void

invariant

    positive_width: width >= 0
    positive_height: height >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RECT


WEL_REGISTRY_KEY_VALUE Chart

class
    WEL_REGISTRY_KEY_VALUE

General
    cluster: wel.structs
    description: "Structure describing a registry key value"
    create: make

Ancestors
    WEL_REGISTRY_KEY_VALUE_TYPE

Queries
    dword_value: INTEGER
    Reg_binary: INTEGER
    Reg_dword: INTEGER
    Reg_dword_big_endian: INTEGER
    Reg_dword_little_endian: INTEGER
    Reg_expand_sz: INTEGER
    Reg_link: INTEGER
    Reg_multi_sz: INTEGER
    Reg_none: INTEGER
    Reg_resource_list: INTEGER
    Reg_sz: INTEGER
    string_value: STRING
    type: INTEGER
    value: STRING

Commands
    make (t: [like type] INTEGER; v: [like value] STRING)
    set_type (t: INTEGER)
    set_value (v: [like value] STRING)


WEL_REGISTRY_KEY_VALUE Flat contracts

indexing
    description: "Structure describing a registry key value"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_REGISTRY_KEY_VALUE

create

    make (t: like type; v: like value)
            -- Create
        require
            v_not_void: v /= void
        ensure
            type_set: type = t
            value_set: value = v

feature -- Initialization

    make (t: like type; v: like value)
            -- Create
        require
            v_not_void: v /= void
        ensure
            type_set: type = t
            value_set: value = v

feature -- Access

    dword_value: INTEGER
            -- Data converted as integer.
        require
            valid_type: type = reg_dword

    Reg_binary: INTEGER is 3
            -- General binary value
            --
            -- Declared in Windows as REG_BINARY
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_dword: INTEGER is 4
            -- Double word value
            --
            -- Declared in Windows as REG_DWORD
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_dword_big_endian: INTEGER is 5
            -- Double word value in big-endian format
            --
            -- Declared in Windows as REG_DWORD_BIG_ENDIAN
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_dword_little_endian: INTEGER is 4
            -- Synonym of Reg_dword
            --
            -- Declared in Windows as REG_DWORD_LITTLE_ENDIAN
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_expand_sz: INTEGER is 2
            -- C-String that contains unexpanded references to environment
            -- variables
            --
            -- Declared in Windows as REG_EXPAND_SZ
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_link: INTEGER is 6
            -- Unicode symbolic link
            --
            -- Declared in Windows as REG_LINK
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_multi_sz: INTEGER is 7
            -- Array of C-strings, terminated by two null characters
            --
            -- Declared in Windows as REG_MULTI_SZ
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_none: INTEGER is 0
            -- No defined value type
            --
            -- Declared in Windows as REG_NONE
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_resource_list: INTEGER is 8
            -- Device-driver resource list
            --
            -- Declared in Windows as REG_RESOURCE_LIST
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    Reg_sz: INTEGER is 1
            -- C-String
            --
            -- Declared in Windows as REG_SZ
            -- (from WEL_REGISTRY_KEY_VALUE_TYPE)

    string_value: STRING
            -- 	Data converted as string.
        require
            valid_type: type = reg_sz

    type: INTEGER
            -- Type of value
            -- See class WEL_REGISTRY_KEY_VALUE_TYPE for possible
            -- values.

    value: STRING
            -- Data.

feature -- Element Change

    set_type (t: INTEGER)
            -- Set type of value with t.
            -- See class WEL_REGISTRY_KEY_VALUE_TYPE for possible
            -- values for t.
        ensure
            type_set: type = t

    set_value (v: like value)
            -- Set value with v.
        require
            v_not_void: v /= void
        ensure
            value_set: value = v

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REGISTRY_KEY_VALUE


WEL_RGB_QUAD Chart

class
    WEL_RGB_QUAD

General
    cluster: wel.structs
    description: "Describes a color consisting of relative intensities of red, green, and blue."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    blue: INTEGER
    exists: BOOLEAN
    green: INTEGER
    item: POINTER
    red: INTEGER
    reserved: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_blue (a_blue: INTEGER)
    set_green (a_green: INTEGER)
    set_item (an_item: POINTER)
    set_red (a_red: INTEGER)
    set_reserved (a_reserved: INTEGER)
    set_shared
    set_unshared


WEL_RGB_QUAD Flat contracts

indexing
    description: "Describes a color consisting of relative intensities of red, green, and blue."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RGB_QUAD

create

    make
        ensure
            red_set: red = 0
            green_set: green = 0
            blue_set: blue = 0
            reserved_set: reserved = 0

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    blue: INTEGER

    green: INTEGER

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    red: INTEGER

    reserved: INTEGER

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_blue (a_blue: INTEGER)
            -- Set blue with a_blue
        ensure
            blue_set: blue = a_blue

    set_green (a_green: INTEGER)
            -- Set green with a_green
        ensure
            green_set: green = a_green

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_red (a_red: INTEGER)
            -- Set red with a_red
        ensure
            red_set: red = a_red

    set_reserved (a_reserved: INTEGER)
            -- Set reserved with a_reserved
        ensure
            reserved_set: reserved = a_reserved

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RGB_QUAD


WEL_RICH_EDIT_BUFFER_LOADER Chart

class
    WEL_RICH_EDIT_BUFFER_LOADER

General
    cluster: wel.structs
    description: "This class allows to set a buffer into a rich edit control. Used internally by WEL."
    create: make

Ancestors
    WEL_RICH_EDIT_STREAM_IN

Queries
    buffer: STRING
    error: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    stream_result: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    finish_action
    init_action
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    release_stream
    set_error (an_error: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    string not void
    positive last position


WEL_RICH_EDIT_BUFFER_LOADER Flat contracts

indexing
    description: "This class allows to set a buffer into a rich edit control. Used internally by WEL."
    note: "Do not use more than one instance of this class at the same time. Nested streams are not supported."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RICH_EDIT_BUFFER_LOADER

create

    make (a_string: STRING)
            -- Set a_string to the rich edit control.
        require
            a_string_not_void: a_string /= void
        ensure
            string_set: string = a_string

feature -- Access

    buffer: STRING
            -- Buffer to set in read_buffer.
            -- (from WEL_RICH_EDIT_STREAM_IN)

    error: INTEGER
            -- Error encountered while streaming. If there was no
            -- error, the value is zero.
            -- (from WEL_RICH_EDIT_STREAM)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    stream_result: INTEGER
            -- Result of the last stream operation. Must be zero if
            -- the read or write operation was successful.
            -- (from WEL_RICH_EDIT_STREAM)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_error (an_error: INTEGER)
            -- Set error with an_error.
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_RICH_EDIT_STREAM
            error_set: error = an_error

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    finish_action
            -- Called after the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    init_action
            -- Called before the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    release_stream
            -- In order to avoid a memory leak when using a WEL_RICH_EDIT_STREAM
            -- descendant, this need to be called.
            -- (from WEL_RICH_EDIT_STREAM)

invariant

    string_not_void: string /= void
    positive_last_position: last_position > 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_BUFFER_LOADER


WEL_RICH_EDIT_BUFFER_SAVER Chart

class
    WEL_RICH_EDIT_BUFFER_SAVER

General
    cluster: wel.structs
    description: "This class allows to get the contents of a rich edit control. Used internally by WEL."
    create: make

Ancestors
    WEL_RICH_EDIT_STREAM_OUT

Queries
    error: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    stream_result: INTEGER
    Structure_size: INTEGER
    text: STRING
    to_integer: INTEGER

Commands
    dispose
    finish_action
    init_action
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    release_stream
    set_error (an_error: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    text not void


WEL_RICH_EDIT_BUFFER_SAVER Flat contracts

indexing
    description: "This class allows to get the contents of a rich edit control. Used internally by WEL."
    note: "Do not use more than one instance of this class at the same time. Nested streams are not supported."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RICH_EDIT_BUFFER_SAVER

create

    make
            -- Create text.

feature -- Access

    error: INTEGER
            -- Error encountered while streaming. If there was no
            -- error, the value is zero.
            -- (from WEL_RICH_EDIT_STREAM)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    stream_result: INTEGER
            -- Result of the last stream operation. Must be zero if
            -- the read or write operation was successful.
            -- (from WEL_RICH_EDIT_STREAM)

    text: STRING
            -- Contents of the rich edit control

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_error (an_error: INTEGER)
            -- Set error with an_error.
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_RICH_EDIT_STREAM
            error_set: error = an_error

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    finish_action
            -- Called after the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    init_action
            -- Called before the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    release_stream
            -- In order to avoid a memory leak when using a WEL_RICH_EDIT_STREAM
            -- descendant, this need to be called.
            -- (from WEL_RICH_EDIT_STREAM)

invariant

    text_not_void: text /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_BUFFER_SAVER


WEL_RICH_EDIT_FILE_LOADER Chart

class
    WEL_RICH_EDIT_FILE_LOADER

General
    cluster: wel.structs
    description: "This class allows to load a file into a rich edit control."
    create: make

Ancestors
    WEL_RICH_EDIT_STREAM_IN

Queries
    buffer: STRING
    error: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    stream_result: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    init_action
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    release_stream
    set_error (an_error: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    file not void


WEL_RICH_EDIT_FILE_LOADER Flat contracts

indexing
    description: "This class allows to load a file into a rich edit control."
    note: "Do not use more than one instance of this class at the same time. Nested streams are not supported."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RICH_EDIT_FILE_LOADER

create

    make (a_file: RAW_FILE)
            -- Load a_file in the rich edit control.
        require
            a_file_not_void: a_file /= void
            a_file_exists: a_file.exists
            a_file_is_open_read: a_file.is_open_read
        ensure
            file_set: file = a_file

feature -- Access

    buffer: STRING
            -- Buffer to set in read_buffer.
            -- (from WEL_RICH_EDIT_STREAM_IN)

    error: INTEGER
            -- Error encountered while streaming. If there was no
            -- error, the value is zero.
            -- (from WEL_RICH_EDIT_STREAM)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    stream_result: INTEGER
            -- Result of the last stream operation. Must be zero if
            -- the read or write operation was successful.
            -- (from WEL_RICH_EDIT_STREAM)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_error (an_error: INTEGER)
            -- Set error with an_error.
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_RICH_EDIT_STREAM
            error_set: error = an_error

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    init_action
            -- Called before the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    release_stream
            -- In order to avoid a memory leak when using a WEL_RICH_EDIT_STREAM
            -- descendant, this need to be called.
            -- (from WEL_RICH_EDIT_STREAM)

invariant

    file_not_void: file /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_FILE_LOADER


WEL_RICH_EDIT_FILE_SAVER Chart

class
    WEL_RICH_EDIT_FILE_SAVER

General
    cluster: wel.structs
    description: "This class allows to save in a file the contents of a rich edit control."
    create: make

Ancestors
    WEL_RICH_EDIT_STREAM_OUT

Queries
    error: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    stream_result: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    init_action
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    release_stream
    set_error (an_error: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    file not void


WEL_RICH_EDIT_FILE_SAVER Flat contracts

indexing
    description: "This class allows to save in a file the contents of a rich edit control."
    note: "Do not use more than one instance of this class at the same time. Nested streams are not supported."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RICH_EDIT_FILE_SAVER

create

    make (a_file: RAW_FILE)
            -- Save the contents of the rich edit control
            -- in a_file.
        require
            a_file_not_void: a_file /= void
            a_file_exists: a_file.exists
            a_file_is_open_write: a_file.is_open_write
        ensure
            file_set: file = a_file

feature -- Access

    error: INTEGER
            -- Error encountered while streaming. If there was no
            -- error, the value is zero.
            -- (from WEL_RICH_EDIT_STREAM)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    stream_result: INTEGER
            -- Result of the last stream operation. Must be zero if
            -- the read or write operation was successful.
            -- (from WEL_RICH_EDIT_STREAM)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_error (an_error: INTEGER)
            -- Set error with an_error.
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_RICH_EDIT_STREAM
            error_set: error = an_error

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    init_action
            -- Called before the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    release_stream
            -- In order to avoid a memory leak when using a WEL_RICH_EDIT_STREAM
            -- descendant, this need to be called.
            -- (from WEL_RICH_EDIT_STREAM)

invariant

    file_not_void: file /= void
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_FILE_SAVER


WEL_RICH_EDIT_STREAM Chart

deferred class
    WEL_RICH_EDIT_STREAM

General
    cluster: wel.structs
    description: "Defines the general notions of a stream for the rich edit control."

Ancestors
    WEL_STRUCTURE

Queries
    error: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    stream_result: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    finish_action
    init_action
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    release_stream
    set_error (an_error: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_RICH_EDIT_STREAM Flat contracts

indexing
    description: "Defines the general notions of a stream for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_RICH_EDIT_STREAM

feature -- Access

    error: INTEGER
            -- Error encountered while streaming. If there was no
            -- error, the value is zero.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    stream_result: INTEGER
            -- Result of the last stream operation. Must be zero if
            -- the read or write operation was successful.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_error (an_error: INTEGER)
            -- Set error with an_error.
        ensure
            error_set: error = an_error

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    finish_action
            -- Called after the streams.
            -- May be redefined to make special operations.

    init_action
            -- Called before the streams.
            -- May be redefined to make special operations.

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    release_stream
            -- In order to avoid a memory leak when using a WEL_RICH_EDIT_STREAM
            -- descendant, this need to be called.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_STREAM


WEL_RICH_EDIT_STREAM_IN Chart

deferred class
    WEL_RICH_EDIT_STREAM_IN

General
    cluster: wel.structs
    description: "Defines the general notions of a stream in for the rich edit control."

Ancestors
    WEL_RICH_EDIT_STREAM

Queries
    buffer: STRING
    error: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    stream_result: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    finish_action
    init_action
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    read_buffer (length: INTEGER)
    release_stream
    set_error (an_error: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_RICH_EDIT_STREAM_IN Flat contracts

indexing
    description: "Defines the general notions of a stream in for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_RICH_EDIT_STREAM_IN

feature -- Access

    buffer: STRING
            -- Buffer to set in read_buffer.

    error: INTEGER
            -- Error encountered while streaming. If there was no
            -- error, the value is zero.
            -- (from WEL_RICH_EDIT_STREAM)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    stream_result: INTEGER
            -- Result of the last stream operation. Must be zero if
            -- the read or write operation was successful.
            -- (from WEL_RICH_EDIT_STREAM)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_error (an_error: INTEGER)
            -- Set error with an_error.
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_RICH_EDIT_STREAM
            error_set: error = an_error

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    finish_action
            -- Called after the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    init_action
            -- Called before the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    read_buffer (length: INTEGER)
            -- Set to buffer a string of length (or
            -- less) characters.
        require
            positive_length: length >= 0
        ensure
            buffer_not_void: buffer /= void
            valid_buffer_length: buffer.count <= length

    release_stream
            -- In order to avoid a memory leak when using a WEL_RICH_EDIT_STREAM
            -- descendant, this need to be called.
            -- (from WEL_RICH_EDIT_STREAM)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_STREAM_IN


WEL_RICH_EDIT_STREAM_OUT Chart

deferred class
    WEL_RICH_EDIT_STREAM_OUT

General
    cluster: wel.structs
    description: "Defines the general notions of a stream out for the rich edit control."

Ancestors
    WEL_RICH_EDIT_STREAM

Queries
    error: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    stream_result: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    finish_action
    init_action
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    release_stream
    set_error (an_error: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    write_buffer (buffer: STRING)


WEL_RICH_EDIT_STREAM_OUT Flat contracts

indexing
    description: "Defines the general notions of a stream out for the rich edit control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_RICH_EDIT_STREAM_OUT

feature -- Access

    error: INTEGER
            -- Error encountered while streaming. If there was no
            -- error, the value is zero.
            -- (from WEL_RICH_EDIT_STREAM)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    stream_result: INTEGER
            -- Result of the last stream operation. Must be zero if
            -- the read or write operation was successful.
            -- (from WEL_RICH_EDIT_STREAM)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_error (an_error: INTEGER)
            -- Set error with an_error.
            -- (from WEL_RICH_EDIT_STREAM)
        ensure -- from WEL_RICH_EDIT_STREAM
            error_set: error = an_error

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    finish_action
            -- Called after the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    init_action
            -- Called before the streams.
            -- May be redefined to make special operations.
            -- (from WEL_RICH_EDIT_STREAM)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    release_stream
            -- In order to avoid a memory leak when using a WEL_RICH_EDIT_STREAM
            -- descendant, this need to be called.
            -- (from WEL_RICH_EDIT_STREAM)

    write_buffer (buffer: STRING)
            -- Write buffer.
        require
            buffer_not_void: buffer /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RICH_EDIT_STREAM_OUT


WEL_SCROLL_BAR_INFO Chart

class
    WEL_SCROLL_BAR_INFO

General
    cluster: wel.structs
    description: "The TV_DISPINFO structure retrieves and sets information about a scroll bar item."
    create: make

Ancestors
    WEL_SCROLL_BAR_CONSTANTS
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    item: POINTER
    mask: INTEGER
    maximum: INTEGER
    minimum: INTEGER
    page: INTEGER
    position: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    track_position: INTEGER
    valid_sif_constant (i: INTEGER): BOOLEAN

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_mask (i: INTEGER)
    set_maximum (i: INTEGER)
    set_minimum (i: INTEGER)
    set_page (i: INTEGER)
    set_position (i: INTEGER)
    set_shared
    set_track_position (i: INTEGER)
    set_unshared


WEL_SCROLL_BAR_INFO Flat contracts

indexing
    description: "The TV_DISPINFO structure retrieves and sets information about a scroll bar item."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:27 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SCROLL_BAR_INFO

create

    make
            -- Create SCROLLINFO struct

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- fmask associated with Current
        require
            exists: exists
        ensure
            valid_mask: valid_sif_constant (Result)

    maximum: INTEGER
            -- nMax associated with Current
        require
            exists: exists

    minimum: INTEGER
            -- nMin associated with Current
        require
            exists: exists

    page: INTEGER
            -- nMax associated with Current
        require
            exists: exists

    position: INTEGER
            -- nPos associated with Current
        require
            exists: exists

    track_position: INTEGER
            -- nTrackPos associated with Current
        require
            exists: exists

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature  -- ScrollInfo

    valid_sif_constant (i: INTEGER): BOOLEAN
            -- Is i a valid Sif constant?
            -- (from WEL_SCROLL_BAR_CONSTANTS)

feature -- Setting

    set_mask (i: INTEGER)
            -- Assign i to fmask field of Current.
        require
            exists: exists
            valid_mask: valid_sif_constant (i)

    set_maximum (i: INTEGER)
            -- nMax associated with Current
        require
            exists: exists

    set_minimum (i: INTEGER)
            -- nMin associated with Current
        require
            exists: exists

    set_page (i: INTEGER)
            -- npage associated with Current
        require
            exists: exists

    set_position (i: INTEGER)
            -- nPos associated with Current
        require
            exists: exists

    set_track_position (i: INTEGER)
            -- nTrackPos associated with Current
        require
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SCROLL_BAR_INFO


WEL_SECURITY_ATTRIBUTES Chart

class
    WEL_SECURITY_ATTRIBUTES

General
    cluster: wel.structs
    description: "SECURITY_ATTRIBUTES structure wrapper"
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    is_handle_inherited: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_inherit_handle (a_boolean: [like is_handle_inherited] BOOLEAN)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_SECURITY_ATTRIBUTES Flat contracts

indexing
    description: "SECURITY_ATTRIBUTES structure wrapper"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SECURITY_ATTRIBUTES

create

    make
            -- Initialize structure.
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    is_handle_inherited: BOOLEAN
            -- Is returned handle inherited when new process is created?

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Element Change

    set_inherit_handle (a_boolean: like is_handle_inherited)
            -- Set inherit_handle with a_boolean.
        ensure
            inherit_handle_set: is_handle_inherited = a_boolean

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SECURITY_ATTRIBUTES


WEL_SIZE Chart

class
    WEL_SIZE

General
    cluster: wel.structs
    description: "Specifies the width and height of a rectangle."
    create: default_create, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    height: INTEGER
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    width: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    set_width (a_width: INTEGER)


WEL_SIZE Flat contracts

indexing
    description: "Specifies the width and height of a rectangle."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SIZE

create

    make (a_width, a_height: INTEGER)
            -- Make a size and set width,
            -- height, with a_width, a_height
        ensure
            width_set: width = a_width
            height_set: height = a_height

    default_create
            -- Make a size where all fields are set to zero.
        ensure then
            width_set: width = 0
            height_set: height = 0

feature -- Access

    height: INTEGER
            -- Height of the rectangle

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    width: INTEGER
            -- Width of the rectangle

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_height (a_height: INTEGER)
            -- Set height with a_height
        ensure
            height_set: height = a_height

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_width (a_width: INTEGER)
            -- Set width with a_width
        ensure
            width_set: width = a_width

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SIZE


WEL_STARTUP_INFO Chart

class
    WEL_STARTUP_INFO

General
    cluster: wel.structs
    description: "Process creation startup information."
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_FILL_ATTRIBUTES_CONSTANTS
    WEL_STARTUP_CONSTANTS
    WEL_STRUCTURE

Queries
    background_blue: INTEGER
    background_green: INTEGER
    background_intensity: INTEGER
    background_red: INTEGER
    clear_flag (flags, mask: INTEGER): INTEGER
    exists: BOOLEAN
    fill_attributes: INTEGER
    flag_set (flags, mask: INTEGER): BOOLEAN
    flags: INTEGER
    foreground_blue: INTEGER
    foreground_green: INTEGER
    foreground_intensity: INTEGER
    foreground_red: INTEGER
    height: INTEGER
    is_valid_fill_attributes (an_integer: INTEGER): BOOLEAN
    is_valid_startup_flag (a_flag: INTEGER): BOOLEAN
    is_valid_startup_flags (a_flags: INTEGER): BOOLEAN
    item: POINTER
    set_flag (flags, mask: INTEGER): INTEGER
    shared: BOOLEAN
    show_command: INTEGER
    startf_force_off_feedback: INTEGER
    startf_force_on_feedback: INTEGER
    startf_use_count_chars: INTEGER
    startf_use_fill_attributes: INTEGER
    startf_use_position: INTEGER
    startf_use_show_window: INTEGER
    startf_use_size: INTEGER
    startf_use_std_handles: INTEGER
    std_error: INTEGER
    std_input: INTEGER
    std_output: INTEGER
    title: STRING
    to_integer: INTEGER
    width: INTEGER
    x_character_count: INTEGER
    x_offset: INTEGER
    y_character_count: INTEGER
    y_offset: INTEGER

Commands
    add_flag (a_flag: INTEGER)
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_fill_attributes (a_fill_attributes: [like fill_attributes] INTEGER)
    set_flags (a_flags: INTEGER)
    set_height (a_height: [like height] INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_show_command (a_command: [like show_command] INTEGER)
    set_std_error (an_error_output: INTEGER)
    set_std_input (an_input: INTEGER)
    set_std_output (an_output: INTEGER)
    set_title (a_title: [like title] STRING)
    set_unshared
    set_width (a_width: [like width] INTEGER)
    set_x_character_count (a_character_count: [like x_character_count] INTEGER)
    set_x_offset (an_offset: [like x_offset] INTEGER)
    set_y_character_count (a_character_count: [like y_character_count] INTEGER)
    set_y_offset (an_offset: [like y_offset] INTEGER)


WEL_STARTUP_INFO Flat contracts

indexing
    description: "Process creation startup information."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STARTUP_INFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    background_blue: INTEGER
            -- Add blue to background
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    background_green: INTEGER
            -- Add green to background
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    background_intensity: INTEGER
            -- Increase console background intensity
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    background_red: INTEGER
            -- Add red to background
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    fill_attributes: INTEGER
            -- Color used for background and text of a console application
            -- See class WEL_FILL_ATTRIBUTE_CONSTANTS for possible value.
        require
            flag_has_startf_use_fill_attributes: flag_set (flags, startf_use_fill_attributes)

    flags: INTEGER
            -- Valid fields
            -- See WEL_STARTUP_FLAGS for possible values.

    foreground_blue: INTEGER
            -- Add blue to foreground
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    foreground_green: INTEGER
            -- Add green to foreground
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    foreground_intensity: INTEGER
            -- Increase console foreground intensity
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    foreground_red: INTEGER
            -- Add red to foreground
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    height: INTEGER
            -- Height of new window if any
        require
            flag_has_startf_use_size: flag_set (flags, startf_use_size)

    is_valid_fill_attributes (an_integer: INTEGER): BOOLEAN
            -- Is an_integer a valid fill atrtibutes?
            -- (from WEL_FILL_ATTRIBUTES_CONSTANTS)

    is_valid_startup_flag (a_flag: INTEGER): BOOLEAN
            -- Is a_flag a valid startup flag?
            -- (from WEL_STARTUP_CONSTANTS)

    is_valid_startup_flags (a_flags: INTEGER): BOOLEAN
            -- Is a_flags a valid startup flags combination?
            -- (from WEL_STARTUP_CONSTANTS)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    show_command: INTEGER
            -- Default show command used for a GUI application
        require
            flag_has_startf_use_show_window: flag_set (flags, startf_use_show_window)

    startf_force_off_feedback: INTEGER
            -- Feedback cursor forced off
            -- (from WEL_STARTUP_CONSTANTS)

    startf_force_on_feedback: INTEGER
            -- Cursor set to feedback until window intialization is done
            -- (from WEL_STARTUP_CONSTANTS)

    startf_use_count_chars: INTEGER
            -- Attributes x_character_count and y_character_count from WEL_STARTUP_INFO are meaningful
            -- (from WEL_STARTUP_CONSTANTS)

    startf_use_fill_attributes: INTEGER
            -- Attribute fill_attributes from WEL_STARTUP_INFO is meaningful
            -- (from WEL_STARTUP_CONSTANTS)

    startf_use_position: INTEGER
            -- Attributes x_offset and y_offset from WEL_STARTUP_INFO are meaningful
            -- (from WEL_STARTUP_CONSTANTS)

    startf_use_show_window: INTEGER
            -- Attribute show_command from WEL_STARTUP_INFO is meaningful
            -- (from WEL_STARTUP_CONSTANTS)

    startf_use_size: INTEGER
            -- Attributes width and height from WEL_STARTUP_INFO are meaningful
            -- (from WEL_STARTUP_CONSTANTS)

    startf_use_std_handles: INTEGER
            -- Attributes std_input, std_output and std_error from WEL_STARTUP_INFO are meaningful
            -- (from WEL_STARTUP_CONSTANTS)

    std_error: INTEGER
            -- Standard error output process handle
        require
            flag_has_startf_use_std_handles: flag_set (flags, startf_use_std_handles)

    std_input: INTEGER
            -- Standard input process handle
        require
            flag_has_startf_use_std_handles: flag_set (flags, startf_use_std_handles)

    std_output: INTEGER
            -- Standard output process handle
        require
            flag_has_startf_use_std_handles: flag_set (flags, startf_use_std_handles)

    title: STRING
            -- Console application title

    width: INTEGER
            -- Width of new window if any
        require
            flag_has_startf_use_size: flag_set (flags, startf_use_size)

    x_character_count: INTEGER
            -- Console application screen buffer in character columns
        require
            flag_has_startf_use_count_chars: flag_set (flags, startf_use_count_chars)

    x_offset: INTEGER
            -- X offset, in pixels, of upper left corner of window
            -- if a new window is created.
        require
            flag_has_startf_use_position: flag_set (flags, startf_use_position)

    y_character_count: INTEGER
            -- Console application screen buffer in character lines
        require
            flag_has_startf_use_count_chars: flag_set (flags, startf_use_count_chars)

    y_offset: INTEGER
            -- Y offset, in pixels, of upper left corner of window
            -- if a new window is created.
        require
            flag_has_startf_use_position: flag_set (flags, startf_use_position)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

feature -- Element Change

    add_flag (a_flag: INTEGER)
            -- Add a_flag to flags.
            -- See class WEL_STARTUP_FLAGS for possible a_flag value.
        require
            valid_flag: is_valid_startup_flag (a_flag)
        ensure
            flags_set: flag_set (flags, a_flag)

    set_fill_attributes (a_fill_attributes: like fill_attributes)
            -- Set fill_attributes with a_fill_attributes.
            -- See class WEL_FILL_ATTRIBUTES_CONSTANTS for possible a_fill_attributes value.
        require
            valid_fill_attributes: is_valid_fill_attributes (a_fill_attributes)
        ensure
            fill_attributes_set: fill_attributes = a_fill_attributes

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags
        require
            valid_flags: is_valid_startup_flags (a_flags)
        ensure
            flags_set: flags = a_flags

    set_height (a_height: like height)
            -- Set height with a_height.
        require
            valid_height: a_height > 0
        ensure
            height_set: height = a_height

    set_show_command (a_command: like show_command)
            -- Set show_command with a_command.
        ensure
            show_command_set: show_command = a_command

    set_std_error (an_error_output: INTEGER)
            -- Set std_error with an_error_output.
        ensure
            error_output_set: std_error = an_error_output

    set_std_input (an_input: INTEGER)
            -- Set std_input with an_input.
        ensure
            std_input_set: std_input = an_input

    set_std_output (an_output: INTEGER)
            -- Set std_output with an_output.
        ensure
            std_output_set: std_output = an_output

    set_title (a_title: like title)
            -- Set title with a_title.
        require
            non_void_title: a_title /= void
        ensure
            title_set: title.is_equal (a_title)

    set_width (a_width: like width)
            -- Set width with a_width.
        require
            valid_width: a_width > 0
        ensure
            width_set: width = a_width

    set_x_character_count (a_character_count: like x_character_count)
            -- Set character_count with a_character_count.
        require
            valid_count: a_character_count > 0
        ensure
            character_count_set: x_character_count = a_character_count

    set_x_offset (an_offset: like x_offset)
            -- Set x_offset with an_offset.
        ensure
            offset_set: x_offset = an_offset

    set_y_character_count (a_character_count: like y_character_count)
            -- Set character_count with a_character_count.
        require
            valid_count: a_character_count > 0
        ensure
            character_count_set: y_character_count = a_character_count

    set_y_offset (an_offset: like y_offset)
            -- Set y_offset with an_offset.
        ensure
            offset_set: y_offset = an_offset

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STARTUP_INFO


WEL_STRING Chart

class
    WEL_STRING

General
    cluster: wel.structs
    description: "A low-level string class to solve some garbage collector problems (object move). The end-user must not use this class. Use class STRING instead."
    create: make_by_pointer, make_empty, make

Ancestors
    WEL_STRUCTURE

Queries
    capacity: INTEGER
    count: INTEGER
    exists: BOOLEAN
    item: POINTER
    length: INTEGER
    null_separated_strings: LINKED_LIST [STRING]
    shared: BOOLEAN
    space_separated_strings: LINKED_LIST [STRING]
    string: STRING
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_null_character (offset: INTEGER)
    set_shared
    set_size_in_string (n: INTEGER)
    set_string (a_string: STRING)
    set_unshared


WEL_STRING Flat contracts

indexing
    description: "A low-level string class to solve some garbage collector problems (object move). The end-user must not use this class. Use class STRING instead."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_STRING

create

    make (a_string: STRING)
            -- Make a C string from a_string.
        require
            a_string_not_void: a_string /= void
        ensure
            not_shared: not shared

    make_empty (a_length: INTEGER)
            -- Make an empty C string of a_length characters.
            -- C memory area is not initialized.
        require
            positive_length: a_length >= 0

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    count: INTEGER
            -- String length
            -- Was declared in WEL_STRING as synonym of length.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    length: INTEGER
            -- String length
            -- Was declared in WEL_STRING as synonym of count.

    null_separated_strings: LINKED_LIST [STRING]
            -- Retrieve all string contained in item. Strings are
            -- NULL separared inside item.
        ensure
            result_not_void: Result /= void

    space_separated_strings: LINKED_LIST [STRING]
            -- Retrieve all string contained in item. Strings are
            -- space-separared inside item.
        ensure
            result_not_void: Result /= void

    string: STRING
            -- Eiffel string
        ensure
            result_not_void: Result /= void

feature -- Measurement

    capacity: INTEGER
            -- Size of initial string (Needed for set_string precondition).

    structure_size: INTEGER
            -- String length
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_null_character (offset: INTEGER)
            -- Set %U at offset position of Current.
            -- First position being  at 0 index.
        require
            valid_offset: offset >= 0 and offset < capacity

    set_size_in_string (n: INTEGER)
            -- Set two first bytes of string pointed by item to
            -- value represented by n in a two bytes representation.
        require
            valid_size: n > 0

    set_string (a_string: STRING)
            -- Set string with a_string.
        require
            a_string_not_void: a_string /= void
            valid_count: a_string.count < capacity
        ensure
            string_set: a_string.is_equal (string)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STRING


WEL_STRUCTURE Chart

deferred class
    WEL_STRUCTURE

General
    cluster: wel.structs
    description: "Abstract notions of a Windows data structure."

Ancestors
    WEL_ANY

Queries
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_STRUCTURE Flat contracts

indexing
    description: "Abstract notions of a Windows data structure."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_STRUCTURE

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
        require
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
        require
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
        require
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_STRUCTURE


WEL_SYSTEM_TIME Chart

class
    WEL_SYSTEM_TIME

General
    cluster: wel.structs
    description: "Wrapper of SYSTEMTIME structure"
    create: make_by_pointer, make_by_current_time, make

Ancestors
    WEL_STRUCTURE

Queries
    day: INTEGER
    day_of_week: INTEGER
    exists: BOOLEAN
    file_time: WEL_FILE_TIME
    hour: INTEGER
    item: POINTER
    milliseconds: INTEGER
    minute: INTEGER
    month: INTEGER
    second: INTEGER
    shared: BOOLEAN
    structure_size: INTEGER
    to_integer: INTEGER
    year: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    make_by_current_time
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_shared
    set_unshared


WEL_SYSTEM_TIME Flat contracts

indexing
    description: "Wrapper of SYSTEMTIME structure"
    author: "Marina Nudelman"
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SYSTEM_TIME

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_by_current_time
            -- Create SYSTEMTIME structure and initialize it to current time.

feature -- Initialization

    make_by_current_time
            -- Create SYSTEMTIME structure and initialize it to current time.

feature -- Access

    day: INTEGER
            -- Day

    day_of_week: INTEGER
            -- Day of week

    hour: INTEGER
            -- Hour

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    milliseconds: INTEGER
            -- Milliseconds

    minute: INTEGER
            -- Minute

    month: INTEGER
            -- Month

    second: INTEGER
            -- Second

    year: INTEGER
            -- Year

feature -- Measurement

    structure_size: INTEGER
            -- Size of SYSTEMTIME structure
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    file_time: WEL_FILE_TIME
            -- SYSTEMTIME in FILETIME format

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SYSTEM_TIME


WEL_TAB_CONTROL_ITEM Chart

class
    WEL_TAB_CONTROL_ITEM

General
    cluster: wel.structs
    description: "Contains information about a tab control item."
    create: make_by_pointer, make_with_window, make

Ancestors
    WEL_STRUCTURE
    WEL_TCIF_CONSTANTS
    WEL_WINDOW_MANAGER

Queries
    exists: BOOLEAN
    item: POINTER
    mask: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    to_integer: INTEGER
    window: WEL_WINDOW

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_mask (a_mask: INTEGER)
    set_shared
    set_text (a_text: STRING)
    set_unshared
    set_window (a_window: WEL_WINDOW)


WEL_TAB_CONTROL_ITEM Flat contracts

indexing
    description: "Contains information about a tab control item."
    note: "There are two creation procedure. If you want to create the item with make, you will then have to add a wel window by yourself. This window must be create with the tab control as parent and it must be added to the item before the item is added to the tab_control. If you use `make_with_window', you still can set another window, but you will have to do this before to add the item to the tab_control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TAB_CONTROL_ITEM

create

    make
            -- Make a tab item structure.

    make_with_window (a_parent: WEL_TAB_CONTROL)
            -- Make a tab item structure and create a window
            -- associated to the item.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask: INTEGER
            -- Array of flags that indicate which of the other
            -- structure members contain valid data or which are
            -- to be filled in. This member can be a combination
            -- of the Tcif_* values.
            -- See class WEL_TCIF_CONSTANTS.

    text: STRING
            -- Item text
        ensure
            result_not_void: Result /= void

    window: WEL_WINDOW
            -- The current window associated to the item.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_mask (a_mask: INTEGER)
            -- Set mask with a_mask.
        ensure
            mask_set: mask = a_mask

    set_text (a_text: STRING)
            -- Set text with a_text.
        require
            a_text_not_void: a_text /= void
        ensure
            text_set: text.is_equal (a_text)

    set_window (a_window: WEL_WINDOW)
            -- Associate a_window to the current item.
        require
            a_window_not_void: a_window /= void
            inside_window: a_window.is_inside
        ensure
            window_set: window = a_window

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TAB_CONTROL_ITEM


WEL_TC_KEYDOWN Chart

class
    WEL_TC_KEYDOWN

General
    cluster: wel.structs
    description: "Contains information about a tab control keydown notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    key_data: INTEGER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    virtual_key: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_TC_KEYDOWN Flat contracts

indexing
    description: "Contains information about a tab control keydown notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TC_KEYDOWN

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    key_data: INTEGER
            -- Data associated with the way to press the key

    virtual_key: INTEGER
            -- Virtual key number.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TC_KEYDOWN


WEL_TEXT_METRIC Chart

class
    WEL_TEXT_METRIC

General
    cluster: wel.structs
    description: "Contains basic information about a physical font. All size are given in logical units; that is, they depend on the current mapping mode of the display context."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    ascent: INTEGER
    average_character_width: INTEGER
    break_character: INTEGER
    character_set: INTEGER
    default_character: INTEGER
    descent: INTEGER
    digitized_aspect_x: INTEGER
    digitized_aspect_y: INTEGER
    exists: BOOLEAN
    external_leading: INTEGER
    first_character: INTEGER
    height: INTEGER
    internal_leading: INTEGER
    italic: INTEGER
    item: POINTER
    last_character: INTEGER
    maximum_character_width: INTEGER
    overhang: INTEGER
    pitch_and_family: INTEGER
    shared: BOOLEAN
    struckout: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER
    underlined: INTEGER
    weight: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_TEXT_METRIC Flat contracts

indexing
    description: "Contains basic information about a physical font. All size are given in logical units; that is, they depend on the current mapping mode of the display context."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TEXT_METRIC

create

    make (dc: WEL_DC)
            -- Make a text metrics structure for dc.
        require
            dc_not_void: dc /= void
            dc_exists: dc.exists

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    ascent: INTEGER
            -- Ascent (units above the base line) of characters

    average_character_width: INTEGER
            -- Average width of characters in the font (generally
            -- defined as the width of the letter x)

    break_character: INTEGER
            -- Value of the character that will be used to define
            -- word breaks for text justification

    character_set: INTEGER
            -- Character set of the font

    default_character: INTEGER
            -- Value of the character to be substituted for
            -- characters not in the font

    descent: INTEGER
            -- Descent (units below the base line) of characters

    digitized_aspect_x: INTEGER
            -- Horizontal aspect of the device for which the
            -- font was designed

    digitized_aspect_y: INTEGER
            -- Vertical aspect of the device for which the font
            -- was designed

    external_leading: INTEGER
            -- Amount of extra leading (space) that the application
            -- adds between rows

    first_character: INTEGER
            -- Value of the first character defined in the font

    height: INTEGER
            -- Height (ascent + descent) of characters

    internal_leading: INTEGER
            -- Amount of leading (space) inside the bounds set by
            -- height

    italic: INTEGER
            -- Italic font if it is nonzero

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    last_character: INTEGER
            -- Value of the last character defined in the font

    maximum_character_width: INTEGER
            -- Width of the widest character in the font

    overhang: INTEGER
            -- Extra width per string that may be added to some
            -- synthesized fonts

    pitch_and_family: INTEGER
            -- Information about the pitch, the technology, and
            -- the family of a physical font.
            -- See class WEL_TMPF_CONSTANTS for values.

    struckout: INTEGER
            -- Strikeout font if it is nonzero

    underlined: INTEGER
            -- Underlined font if it is nonzero

    weight: INTEGER
            -- Weight of the font.
            -- See class WEL_FW_CONSTANTS for values.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TEXT_METRIC


WEL_TOOLTIP_TEXT Chart

class
    WEL_TOOLTIP_TEXT

General
    cluster: wel.structs
    description: "This structure identifies a tool for which text is to be displayed and receives the text for the tool. This structure is used with the Ttn_needtext notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE
    WEL_WORD_OPERATIONS

Queries
    exists: BOOLEAN
    flags: INTEGER
    hdr: WEL_NMHDR
    instance: WEL_INSTANCE
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    text_id: INTEGER
    text_id_set: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_flags (a_flags: INTEGER)
    set_instance (an_instance: WEL_INSTANCE)
    set_item (an_item: POINTER)
    set_shared
    set_text (a_text: STRING)
    set_text_id (an_id: INTEGER)
    set_unshared


WEL_TOOLTIP_TEXT Flat contracts

indexing
    description: "This structure identifies a tool for which text is to be displayed and receives the text for the tool. This structure is used with the Ttn_needtext notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TOOLTIP_TEXT

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    flags: INTEGER
            -- Flag that indicates how to interpret id_from
            -- member of hdr.
            -- See class WEL_TTF_CONSTANTS for the different values.

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    instance: WEL_INSTANCE
            -- Instance that contains a string resource to be
            -- used as the text.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    text: STRING
            -- Text of the tooltip
        require
            text_id_not_set: not text_id_set
        ensure
            result_not_void: Result /= void

    text_id: INTEGER
            -- String resource identifier for the text
        require
            text_id_set: text_id_set

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    text_id_set: BOOLEAN
            -- Is text equal to a resource string identifer?

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
        require
            positive_flags: a_flags >= 0
        ensure
            flags_set: flags = a_flags

    set_instance (an_instance: WEL_INSTANCE)
            -- Set instance with an_instance.
        require
            an_instance_not_void: an_instance /= void
        ensure
            instance_set: instance.item = an_instance.item

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_text (a_text: STRING)
            -- Set text with a_text.
        require
            text_not_void: a_text /= void
        ensure
            text_set: text.is_equal (a_text)

    set_text_id (an_id: INTEGER)
            -- Set text with a string resource identifier an_id.
        ensure
            text_id_set: text_id = an_id

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOLTIP_TEXT


WEL_TOOL_BAR_BITMAP Chart

class
    WEL_TOOL_BAR_BITMAP

General
    cluster: wel.structs
    description: "Contains information about the button images of the toolbar."
    create: make_from_bitmap, make_by_predefined_id, make

Ancestors
    WEL_IDB_CONSTANTS
    WEL_OBJECT_ID_MANAGER
    WEL_STRUCTURE

Queries
    bitmap_id: INTEGER
    exists: BOOLEAN
    instance: WEL_INSTANCE
    item: POINTER
    predefined_id: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    valid_tool_bar_bitmap_constant (c: INTEGER): BOOLEAN

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bitmap_id (a_bitmap_id: INTEGER)
    set_item (an_item: POINTER)
    set_predefined_bitmap_id (a_bitmap_id: INTEGER)
    set_shared
    set_unshared


WEL_TOOL_BAR_BITMAP Flat contracts

indexing
    description: "Contains information about the button images of the toolbar."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TOOL_BAR_BITMAP

create

    make (a_bitmap_id: INTEGER)
            -- Initialize a toolbar bitmap with the resource bitmap
            -- identifier a_bitmap_id.
        require
            positive_bitmap_id: a_bitmap_id > 0
        ensure
            bitmap_id_set: bitmap_id = a_bitmap_id

    make_from_bitmap (a_bitmap: WEL_BITMAP)
            -- Create a toolbar bitmap with a common bitmap.
        require
            bitmap_not_void: a_bitmap /= void
            bitmap_exists: a_bitmap.exists
        ensure
            bitmap_set: bitmap_id = a_bitmap.to_integer

    make_by_predefined_id (a_bitmap_id: INTEGER)
            -- Initialize a toolbar bitmap with the system
            -- predefined resource bitmap identifier a_bitmap_id.
            -- See class WEL_IDB_CONSTANTS for a_bitmap_id values.
        require
            valid_tool_bar_bitmap_constant: valid_tool_bar_bitmap_constant (a_bitmap_id)
        ensure
            bitmap_id_set: bitmap_id = a_bitmap_id

feature -- Access

    bitmap_id: INTEGER
            -- Resource identifier of the bitmap resource that
            -- contains the button images.

    instance: WEL_INSTANCE
            -- Instance that contains the bitmap resource
            -- bitmap_id
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature  -- Status report

    valid_tool_bar_bitmap_constant (c: INTEGER): BOOLEAN
            -- Is c a valid tool bar bitmap constant?
            -- (from WEL_IDB_CONSTANTS)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bitmap_id (a_bitmap_id: INTEGER)
            -- Set bitmap_id with a_bitmap_id.
        require
            positive_bitmap_id: a_bitmap_id > 0
        ensure
            bitmap_id_set: bitmap_id = a_bitmap_id

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_predefined_bitmap_id (a_bitmap_id: INTEGER)
            -- Set bitmap_id with the system predefined resource
            -- bitmap identifier a_bitmap_id.
            -- See class WEL_IDB_CONSTANTS for a_bitmap_id values.
        require
            valid_tool_bar_bitmap_constant: valid_tool_bar_bitmap_constant (a_bitmap_id)
        ensure
            bitmap_id_set: bitmap_id = a_bitmap_id

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Status Report

    predefined_id: BOOLEAN
            -- Are we using predefined bitmap (Cut, Copy, ...) ?
            -- (This is not compatible with the ImageList)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOL_BAR_BITMAP


WEL_TOOL_BAR_BUTTON Chart

class
    WEL_TOOL_BAR_BUTTON

General
    cluster: wel.structs
    description: "Contains information about a button in a toolbar."
    create: make_button, make, make_group, make_check, make_check_group, make_separator, make_by_pointer

Ancestors
    WEL_STRUCTURE
    WEL_TB_STATE_CONSTANTS
    WEL_TB_STYLE_CONSTANTS

Queries
    bitmap_index: INTEGER
    command_id: INTEGER
    data: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    state: INTEGER
    string_index: INTEGER
    Structure_size: INTEGER
    style: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bitmap_index (a_bitmap_index: INTEGER)
    set_command_id (a_command_id: INTEGER)
    set_data (a_data: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_state (a_state: INTEGER)
    set_string_index (a_string_index: INTEGER)
    set_style (a_style: INTEGER)
    set_unshared


WEL_TOOL_BAR_BUTTON Flat contracts

indexing
    description: "Contains information about a button in a toolbar."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TOOL_BAR_BUTTON

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_button (a_bitmap_index, a_command_id: INTEGER)
            -- Make a button using a_bitmap_index and
            -- a_command_id.
        ensure
            bitmap_index_set: bitmap_index = a_bitmap_index
            command_id_set: command_id = a_command_id

    make_check (a_bitmap_index, a_command_id: INTEGER)
            -- Make a check button using a_bitmap_index and
            -- a_command_id.
        ensure
            bitmap_index_set: bitmap_index = a_bitmap_index
            command_id_set: command_id = a_command_id

    make_check_group (a_bitmap_index, a_command_id: INTEGER)
            -- Make a check group using a_bitmap_index and
            -- a_command_id.
        ensure
            bitmap_index_set: bitmap_index = a_bitmap_index
            command_id_set: command_id = a_command_id

    make_group (a_bitmap_index, a_command_id: INTEGER)
            -- Make an enabled check group using a_bitmap_index
            -- and a_command_id.
        ensure
            bitmap_index_set: bitmap_index = a_bitmap_index
            command_id_set: command_id = a_command_id

    make_separator
            -- Make a separator providing a small gap between
            -- groups.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    bitmap_index: INTEGER
            -- Zero-based index of button image

    command_id: INTEGER
            -- Command identifier associated with the button. This
            -- identifer is used in a Wm_command message when the
            -- button is chosen.

    data: INTEGER
            -- Application-defined value

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    state: INTEGER
            -- Button state flags.
            -- See class WEL_TB_STATE_CONSTANTS for values

    string_index: INTEGER
            -- Zero-based index of button string.
        ensure
            positive_result: Result >= 0

    style: INTEGER
            -- Button style flags.
            -- See class WEL_TB_STYLE_CONSTANTS for values

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bitmap_index (a_bitmap_index: INTEGER)
            -- Set bitmap_index with a_bitmap_index.
        ensure
            bitmap_index_set: bitmap_index = a_bitmap_index

    set_command_id (a_command_id: INTEGER)
            -- Set command_id with a_command_id.
        ensure
            command_id_set: command_id = a_command_id

    set_data (a_data: INTEGER)
            -- Set data with a_data.
        ensure
            data_set: data = a_data

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_state (a_state: INTEGER)
            -- Set state with a_state.
        ensure
            state_set: state = a_state

    set_string_index (a_string_index: INTEGER)
            -- Set string_index with a_string_index.
        require
            positive_index: a_string_index >= 0
        ensure
            string_index_set: string_index = a_string_index

    set_style (a_style: INTEGER)
            -- Set style with a_style.
        ensure
            style_set: style = a_style

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOL_BAR_BUTTON


WEL_TOOL_INFO Chart

class
    WEL_TOOL_INFO

General
    cluster: wel.structs
    description: "Contains information about a tool in a tooltip control."
    create: make

Ancestors
    WEL_STRUCTURE
    WEL_WORD_OPERATIONS

Queries
    exists: BOOLEAN
    flags: INTEGER
    id: INTEGER
    instance: WEL_INSTANCE
    item: POINTER
    rect: WEL_RECT
    shared: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    text_call_back_set: BOOLEAN
    text_id: INTEGER
    text_id_set: BOOLEAN
    to_integer: INTEGER
    window: WEL_WINDOW

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_flags (a_flags: INTEGER)
    set_id (an_id: INTEGER)
    set_id_with_window (a_window: WEL_WINDOW)
    set_instance (an_instance: WEL_INSTANCE)
    set_item (an_item: POINTER)
    set_rect (a_rect: WEL_RECT)
    set_shared
    set_text (a_text: STRING)
    set_text_call_back
    set_text_id (an_id: INTEGER)
    set_unshared
    set_window (a_window: WEL_WINDOW)


WEL_TOOL_INFO Flat contracts

indexing
    description: "Contains information about a tool in a tooltip control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TOOL_INFO

create

    make
            -- Make a tool info structure.

feature -- Access

    flags: INTEGER
            -- A set of bit flags. See class WEL_TTF_CONSTANTS
            -- for values.

    id: INTEGER
            -- Application-defined identifier of the tool

    instance: WEL_INSTANCE
            -- Instance that contains the string resource for the
            -- tool. If text specifies the identifier of a string
            -- resource, this information is used.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    rect: WEL_RECT
            -- Coordinates of the bounding rectangle of the tool
        ensure
            result_not_void: Result /= void

    text: STRING
            -- Text for the tool
        require
            text_id_not_set: not text_id_set
        ensure
            result_not_void: Result /= void

    text_id: INTEGER
            -- String resource identifier for the text
        require
            text_id_set: text_id_set

    window: WEL_WINDOW
            -- Window that contains the tool

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    text_call_back_set: BOOLEAN
            -- Is text equal to Lpstr_textcallback?

    text_id_set: BOOLEAN
            -- Is text equal to a resource string identifer?

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
        ensure
            flags_set: flags = a_flags

    set_id (an_id: INTEGER)
            -- Set id with an_id.
        ensure
            id_set: id = an_id

    set_id_with_window (a_window: WEL_WINDOW)
            -- Set id with a_window.
        ensure
            id_set: id = cwel_pointer_to_integer (a_window.item)

    set_instance (an_instance: WEL_INSTANCE)
            -- Set instance with an_instance.
        require
            an_instance_not_void: an_instance /= void
        ensure
            instance_set: instance.item = an_instance.item

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_rect (a_rect: WEL_RECT)
            -- Set rect with a_rect.
        require
            a_rect_not_void: a_rect /= void
        ensure
            rect_set: rect.is_equal (a_rect)

    set_text (a_text: STRING)
            -- Set text with a_text.
        require
            a_text_not_void: a_text /= void
        ensure
            text_set: text.is_equal (a_text)

    set_text_call_back
            -- Set text with Lpstr_textcallback.
        ensure
            text_call_back_set: text_call_back_set

    set_text_id (an_id: INTEGER)
            -- Set text with a string resource identifier an_id.
        ensure
            text_id_set: text_id = an_id

    set_window (a_window: WEL_WINDOW)
            -- Set window with a_window.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
        ensure
            window_set: window = a_window

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TOOL_INFO


WEL_TRACK_MOUSE_EVENT Chart

class
    WEL_TRACK_MOUSE_EVENT

General
    cluster: wel.structs
    description: "Contains information for tracking mouse events."
    create: make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    dwflags: INTEGER
    dwhovertime: INTEGER
    exists: BOOLEAN
    hwndtrack: POINTER
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_dwflags (flags: INTEGER)
    set_dwhovertime (time: INTEGER)
    set_hwndtrack (window: POINTER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_TRACK_MOUSE_EVENT Flat contracts

indexing
    description: "Contains information for tracking mouse events."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TRACK_MOUSE_EVENT

create

    make
            -- Create TRACKMOUSEEVENT struct.

    make_by_pointer (a_pointer: POINTER)
            -- Create TRACKMOUSEEVENT from a_pointer.

feature -- Access

    dwflags: INTEGER
            -- Requested tracking service.
        ensure
            result_not_void: Result /= void

    dwhovertime: INTEGER
            -- Hover time-out.
        ensure
            result_not_void: Result /= void

    hwndtrack: POINTER
            -- Window to track.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_dwflags (flags: INTEGER)
            -- Assign flags to dwflags.
        ensure
            dwflags_set: dwflags = flags

    set_dwhovertime (time: INTEGER)
            -- Assign time to dwhovertime.
        ensure
            dwhovertime_set: dwhovertime = time

    set_hwndtrack (window: POINTER)
            -- Assign window to hwndtrack.
        ensure
            hwndtrack_set: hwndtrack = window

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TRACK_MOUSE_EVENT


WEL_TREE_VIEW_INSERT_STRUCT Chart

class
    WEL_TREE_VIEW_INSERT_STRUCT

General
    cluster: wel.structs
    description: "contains information used to add a new item to a tree-view control."
    create: make

Ancestors
    WEL_STRUCTURE
    WEL_TVI_CONSTANTS

Queries
    exists: BOOLEAN
    insert_after: POINTER
    item: POINTER
    parent: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    tree_view_item: WEL_TREE_VIEW_ITEM

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_first
    set_insert_after (a_insert_after: POINTER)
    set_item (an_item: POINTER)
    set_last
    set_parent (a_parent: POINTER)
    set_root
    set_shared
    set_sort
    set_tree_view_item (a_tree_view_item: WEL_TREE_VIEW_ITEM)
    set_unshared


WEL_TREE_VIEW_INSERT_STRUCT Flat contracts

indexing
    description: "contains information used to add a new item to a tree-view control."
    note: "The common controls dll (WEL_COMMON_CONTROLS_DLL) needs to be loaded to use this control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TREE_VIEW_INSERT_STRUCT

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    insert_after: POINTER
            -- Handle to the item after which the new item is to
            -- be inserted or one of the Tvi_* values.
            -- See class WEL_TVI_CONSTANTS.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    parent: POINTER
            -- Handle to the parent item. If this member is
            -- the Tvi_root value or NULL, the item is inserted
            -- at the root of the tree-view control.

    tree_view_item: WEL_TREE_VIEW_ITEM
            -- Item to insert
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_first
            -- Insert the item at the beginning of the list.

    set_insert_after (a_insert_after: POINTER)
            -- Set insert_after with a_insert_after.
        ensure
            insert_after_set: insert_after = a_insert_after

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_last
            -- Insert the item at the end of the list.

    set_parent (a_parent: POINTER)
            -- Set parent with a_parent.
        ensure
            parent_set: parent = a_parent

    set_root
            -- Insert the item as the root of the list.

    set_sort
            -- Insert the item into the list in alphabetical order.

    set_tree_view_item (a_tree_view_item: WEL_TREE_VIEW_ITEM)
            -- Set tree_view_item with a_tree_view_item.
            -- In this case, windows copy the structure we
            -- send into another structure. Therefore, we need
            -- to keep a reference on the first structure in case
            -- the user is using it.
            -- At insertion time, the h_item paremeter of both
            -- structure will be set at the good value.

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TREE_VIEW_INSERT_STRUCT


WEL_TREE_VIEW_ITEM Chart

class
    WEL_TREE_VIEW_ITEM

General
    cluster: wel.structs
    description: "Contains information about a tree view control item."
    create: make_by_pointer, make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_STRUCTURE
    WEL_TVIF_CONSTANTS

Queries
    children: INTEGER
    children_is_valid: BOOLEAN
    exists: BOOLEAN
    h_item: POINTER
    item: POINTER
    lparam: INTEGER
    lparam_is_valid: BOOLEAN
    mask: INTEGER
    shared: BOOLEAN
    state: INTEGER
    state_is_valid: BOOLEAN
    Structure_size: INTEGER
    text: STRING
    text_is_valid: BOOLEAN
    to_integer: INTEGER

Commands
    add_mask (a_mask_value: INTEGER)
    dispose
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_h_item (a_h_item: POINTER)
    set_image (image_normal, image_selected: INTEGER)
    set_item (an_item: POINTER)
    set_lparam (a_lparam: INTEGER)
    set_mask (a_mask_value: INTEGER)
    set_shared
    set_state (a_state: INTEGER)
    set_text (a_text: STRING)
    set_unshared
    structure_initialize


WEL_TREE_VIEW_ITEM Flat contracts

indexing
    description: "Contains information about a tree view control item."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TREE_VIEW_ITEM

create

    make
            -- Make a tree item structure.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    children: INTEGER
            -- Information about the children of the item
        require
            valid_member: children_is_valid

    h_item: POINTER
            -- Item to which this structure refers.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    lparam: INTEGER
            -- Information about the lparam of the item
        require
            valid_member: lparam_is_valid

    mask: INTEGER
            -- Array of flags that indicate which of the other
            -- structure members contain valid data or which are
            -- to be filled in. This member can be a combination
            -- of the Tvif_* values.
            -- See class WEL_TVIF_CONSTANTS.

    state: INTEGER
            -- Current state of the item.
        require
            valid_member: state_is_valid

    text: STRING
            -- Item text
        require
            valid_member: text_is_valid
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    children_is_valid: BOOLEAN
            -- Is the structure member children valid?

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    lparam_is_valid: BOOLEAN
            -- Is the structure member lParam valid?

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    state_is_valid: BOOLEAN
            -- Is the structure member state valid?

    text_is_valid: BOOLEAN
            -- Is the structure member text valid?

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    add_mask (a_mask_value: INTEGER)
            -- add a_mask_value to the current mask.

    set_h_item (a_h_item: POINTER)
            -- Set h_item with a_h_item.
        ensure
            h_item_set: h_item = a_h_item

    set_image (image_normal: INTEGER; image_selected: INTEGER)
            -- Set the image for the tree item to image_normal.
            -- and image_selected for the image displayed when this
            -- item is selected.
            -- image_normal and image_selected are the index of
            -- an image in the image list associated with the treeview.

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_lparam (a_lparam: INTEGER)
            -- Set a_lparam as current lparam.
        ensure
            lparam_set: lparam = a_lparam

    set_mask (a_mask_value: INTEGER)
            -- Set mask with a_mask_value.

    set_state (a_state: INTEGER)
            -- Set a_state as current state.
        ensure
            state_set: state = a_state

    set_text (a_text: STRING)
            -- Set text with a_text.
        require
            a_text_not_void: a_text /= void
        ensure
            text_set: text.is_equal (a_text)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    structure_initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TREE_VIEW_ITEM


WEL_TV_DISPINFO Chart

class
    WEL_TV_DISPINFO

General
    cluster: wel.structs
    description: "The TV_DISPINFO structure retrieves and sets information about a tree-view item."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    tree_item: WEL_TREE_VIEW_ITEM

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_TV_DISPINFO Flat contracts

indexing
    description: "The TV_DISPINFO structure retrieves and sets information about a tree-view item."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TV_DISPINFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    tree_item: WEL_TREE_VIEW_ITEM
            -- Virtual key number.
        ensure
            result_not_void: Result /= void

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TV_DISPINFO


WEL_TV_HITTESTINFO Chart

class
    WEL_TV_HITTESTINFO

General
    cluster: wel.structs
    description: "Contains information about a tree view hittestinfo notification message."
    create: make_by_pointer, make_with_point, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    flags: INTEGER
    hitem: POINTER
    item: POINTER
    point: WEL_POINT
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_point (pt: WEL_POINT)
    set_shared
    set_unshared


WEL_TV_HITTESTINFO Flat contracts

indexing
    description: "Contains information about a tree view hittestinfo notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TV_HITTESTINFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_with_point (pt: WEL_POINT)
            -- Create a structure with pt.

feature -- Access

    flags: INTEGER
            -- Variable that receives information about the result of
            -- a hit test. See WEL_TVHT_CONSTANTS for values.

    hitem: POINTER
            -- Handle of the item that occupies the point

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    point: WEL_POINT
            -- Client coordinates of the point to test.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_point (pt: WEL_POINT)
            -- Set point with pt.
        ensure
            point_set: point.is_equal (pt)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TV_HITTESTINFO


WEL_TV_KEYDOWN Chart

class
    WEL_TV_KEYDOWN

General
    cluster: wel.structs
    description: "Contains information about a tree view keydown notification message."
    create: make_by_nmhdr, make_by_pointer, make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    hdr: WEL_NMHDR
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    virtual_key: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_TV_KEYDOWN Flat contracts

indexing
    description: "Contains information about a tree view keydown notification message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_TV_KEYDOWN

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_nmhdr (a_nmhdr: WEL_NMHDR)
            -- Make the structure with a_nmhdr.
        require
            a_nmhdr_not_void: a_nmhdr /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    hdr: WEL_NMHDR
            -- Information about the Wm_notify message.
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    virtual_key: INTEGER
            -- Virtual key number.

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_TV_KEYDOWN


WEL_WINDOW_PLACEMENT Chart

class
    WEL_WINDOW_PLACEMENT

General
    cluster: wel.structs
    description: "Contains information about the placement of a window on the screen."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    exists: BOOLEAN
    flags: INTEGER
    item: POINTER
    maximum_position: WEL_POINT
    minimum_position: WEL_POINT
    normal_position: WEL_RECT
    shared: BOOLEAN
    show_command: INTEGER
    Structure_size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_flags (a_flags: INTEGER)
    set_item (an_item: POINTER)
    set_maximum_position (a_point: WEL_POINT)
    set_minimum_position (a_point: WEL_POINT)
    set_normal_position (a_rect: WEL_RECT)
    set_shared
    set_show_command (a_show_command: INTEGER)
    set_unshared


WEL_WINDOW_PLACEMENT Flat contracts

indexing
    description: "Contains information about the placement of a window on the screen."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOW_PLACEMENT

create

    make (a_window: WEL_WINDOW)
            -- Make a window placement for a_window.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists

feature -- Access

    flags: INTEGER
            -- Flags that control the position of the
            -- minimized window and the method by which
            -- the window is restored.
            -- See class WEL_WPF_CONSTANTS for possible values.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    maximum_position: WEL_POINT
            -- Coordinates of the window's upper left
            -- corner when the window is maximized.
        ensure
            result_not_void: Result /= void

    minimum_position: WEL_POINT
            -- Coordinates of the window's upper left
            -- corner when the window is minimized.
        ensure
            result_not_void: Result /= void

    normal_position: WEL_RECT
            -- Window's coordinates when the
            -- windows is in the restored position
        ensure
            result_not_void: Result /= void

    show_command: INTEGER
            -- Show state of the window.
            -- See class WEL_SW_CONSTANTS for possible values

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags
        ensure
            flags_set: flags = a_flags

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_maximum_position (a_point: WEL_POINT)
            -- Set maximum_position with a_point
        require
            a_point_not_void: a_point /= void

    set_minimum_position (a_point: WEL_POINT)
            -- Set minimum_position with a_point
        require
            a_point_not_void: a_point /= void

    set_normal_position (a_rect: WEL_RECT)
            -- Set normal_position with a_rect
        require
            a_rect_not_void: a_rect /= void

    set_show_command (a_show_command: INTEGER)
            -- Set show_command with a_show_command
        ensure
            show_command_set: show_command = a_show_command

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOW_PLACEMENT


WEL_WINDOW_POS Chart

class
    WEL_WINDOW_POS

General
    cluster: wel.structs
    description: "Contains information about the size and position of a window."
    create: make_by_pointer, make

Ancestors
    WEL_HWND_CONSTANTS
    WEL_STRUCTURE
    WEL_WINDOW_MANAGER

Queries
    exists: BOOLEAN
    flags: INTEGER
    height: INTEGER
    hwindow_insert_after: POINTER
    item: POINTER
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    width: INTEGER
    window: WEL_WINDOW
    window_insert_after: WEL_WINDOW
    x: INTEGER
    y: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_bottom
    set_flags (a_flags: INTEGER)
    set_height (a_height: INTEGER)
    set_hwindow_insert_after (a_window: POINTER)
    set_item (an_item: POINTER)
    set_no_topmost
    set_shared
    set_top
    set_topmost
    set_unshared
    set_width (a_width: INTEGER)
    set_window (a_window: WEL_WINDOW)
    set_window_insert_after (a_window: WEL_WINDOW)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)


WEL_WINDOW_POS Flat contracts

indexing
    description: "Contains information about the size and position of a window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:28 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOW_POS

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

feature -- Access

    flags: INTEGER
            -- Window position flags
            -- See class WEL_SWP_CONSTANTS for values
        ensure
            positive_result: Result >= 0

    height: INTEGER
            -- Window height
        ensure
            positive_result: Result >= 0

    hwindow_insert_after: POINTER
            -- Position of the window in Z order (front-to-back
            -- position). This window can be the window behind
            -- which this window is placed.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    width: INTEGER
            -- Window width
        ensure
            positive_result: Result >= 0

    window: WEL_WINDOW
            -- Identifies the window

    window_insert_after: WEL_WINDOW
            -- Position of the window in Z order (front-to-back
            -- position). This window can be the window behind
            -- which this window is placed.

    x: INTEGER
            -- Position of the left edge of the window

    y: INTEGER
            -- Position of the top edge of the window

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_bottom
            -- Place the window at the bottom of the Z order.
            -- If window identifies a topmost window, the window
            -- loses its topmost status and is placed at the bottom
            -- of all other windows.

    set_flags (a_flags: INTEGER)
            -- Set flags with a_flags.
            -- See class WEL_SWP_CONSTANTS for a_flags values.
        ensure
            flags_set: flags = a_flags

    set_height (a_height: INTEGER)
            -- Set height with a_height.
        ensure
            height_set: height = a_height

    set_hwindow_insert_after (a_window: POINTER)
            -- Set window_insert_after with a_window.

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_no_topmost
            -- Places the window above all non-topmost windows
            -- (that is, behind all topmost windows). No effect
            -- if the window is already a non-topmost window.

    set_top
            -- Place the window at the top of the Z order.

    set_topmost
            -- Places the window above all non-topmost windows.
            -- The window maintains its topmost position even when
            -- it is deactivated.

    set_width (a_width: INTEGER)
            -- Set width with a_width.
        ensure
            width_set: width = a_width

    set_window (a_window: WEL_WINDOW)
            -- Set window with a_window.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
        ensure
            window_set: window = a_window

    set_window_insert_after (a_window: WEL_WINDOW)
            -- Set window_insert_after with a_window.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
        ensure
            window_insert_after_set: window_insert_after = a_window

    set_x (a_x: INTEGER)
            -- Set x with a_x.
        ensure
            x_set: x = a_x

    set_y (a_y: INTEGER)
            -- Set y with a_y.
        ensure
            y_set: y = a_y

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOW_POS


WEL_WND_CLASS Chart

class
    WEL_WND_CLASS

General
    cluster: wel.structs
    description: "Contains information about the window class."
    create: make

Ancestors
    WEL_STRUCTURE

Queries
    atom: INTEGER
    background: WEL_BRUSH
    background_set: BOOLEAN
    class_extra: INTEGER
    class_name: STRING
    cursor: WEL_CURSOR
    cursor_set: BOOLEAN
    exists: BOOLEAN
    icon: WEL_ICON
    icon_set: BOOLEAN
    instance: WEL_INSTANCE
    instance_set: BOOLEAN
    item: POINTER
    menu_name: STRING
    menu_name_set: BOOLEAN
    registered: BOOLEAN
    shared: BOOLEAN
    Structure_size: INTEGER
    style: INTEGER
    to_integer: INTEGER
    window_extra: INTEGER
    window_procedure: POINTER
    window_procedure_set: BOOLEAN

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    register
    set_background (a_background: WEL_BRUSH)
    set_class_extra (a_class_extra: INTEGER)
    set_class_name (a_class_name: STRING)
    set_cursor (a_cursor: WEL_CURSOR)
    set_icon (an_icon: WEL_ICON)
    set_instance (an_instance: WEL_INSTANCE)
    set_item (an_item: POINTER)
    set_menu_name (a_menu_name: STRING)
    set_shared
    set_style (a_style: INTEGER)
    set_unshared
    set_window_extra (a_window_extra: INTEGER)
    set_window_procedure (a_window_procedure: POINTER)
    unregister
    unset_background
    unset_cursor
    unset_icon
    unset_menu_name
    unset_window_procedure


WEL_WND_CLASS Flat contracts

indexing
    description: "Contains information about the window class."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WND_CLASS

create

    make (a_class_name: STRING)
            -- Make a window class named a_class_name.
        require
            class_name_not_void: a_class_name /= void
            class_name_not_empty: not a_class_name.is_empty
        ensure
            style_set: style = 0
            window_procedure_unset: not window_procedure_set
            class_extra_set: class_extra = 0
            window_extra_set: window_extra = 0
            instance_set: instance.item = main_args.current_instance.item
            icon_unset: not icon_set
            cursor_unset: not cursor_set
            background_unset: not background_set
            menu_nameunset: not menu_name_set
            class_name_set: class_name.is_equal (a_class_name)
            atom_set: atom = 0

feature -- Access

    atom: INTEGER
            -- Class atom that uniquely identifies class being registered.

    background: WEL_BRUSH
            -- Background color of the window
        require
            background_set: background_set
        ensure
            result_not_void: Result /= void
            result_exists: Result.exists

    class_extra: INTEGER
            -- Class extra information size
        ensure
            positive_result: Result >= 0

    class_name: STRING
            -- Class name
        ensure
            result_not_void: Result /= void
            result_not_empty: not Result.is_empty

    cursor: WEL_CURSOR
            -- Cursor to use when the mouse is into the window.
        require
            cursor_set: cursor_set
        ensure
            result_not_void: Result /= void
            result_exists: Result.exists

    icon: WEL_ICON
            -- Icon to draw when the window is minimized.
        require
            icon_set: icon_set
        ensure
            result_not_void: Result /= void
            result_exists: Result.exists

    instance: WEL_INSTANCE
            -- Instance of the class.
        require
            instance_set: instance_set
        ensure
            result_not_void: Result /= void

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu_name: STRING
            -- Menu name to load from the resource
        require
            menu_name_set: menu_name_set
        ensure
            result_not_void: Result /= void

    style: INTEGER
            -- Class style

    window_extra: INTEGER
            -- Window extra information size
        ensure
            positive_result: Result >= 0

    window_procedure: POINTER
            -- Window procedure to call
        require
            window_procedure_set: window_procedure_set
        ensure
            Result /= default_pointer

feature -- Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    background_set: BOOLEAN
            -- Is the background set?

    cursor_set: BOOLEAN
            -- Is the cursor set?

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    icon_set: BOOLEAN
            -- Is the icon set?

    instance_set: BOOLEAN
            -- Is the instance set?

    menu_name_set: BOOLEAN
            -- Is the menu name set?

    registered: BOOLEAN
            -- Is the class registered?

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    window_procedure_set: BOOLEAN
            -- Is the window procedure set?

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_background (a_background: WEL_BRUSH)
            -- Set background with a_background.
        require
            a_background_not_void: a_background /= void
        ensure
            background_equal: background.item = a_background.item

    set_class_extra (a_class_extra: INTEGER)
            -- Set class_extra with a_class_extra.
        require
            positive_extra: a_class_extra >= 0
        ensure
            class_extra = a_class_extra

    set_class_name (a_class_name: STRING)
            -- Set class_name with a_class_name.
        require
            a_class_name_valid: a_class_name /= void
            a_class_name_not_empty: not a_class_name.is_empty
        ensure
            class_name_set: class_name.is_equal (a_class_name)

    set_cursor (a_cursor: WEL_CURSOR)
            -- Set cursor with a_cursor.
        require
            a_cursor_not_void: a_cursor /= void
            a_cursor_exists: a_cursor.exists
        ensure
            cursor_equal: cursor.item = a_cursor.item

    set_icon (an_icon: WEL_ICON)
            -- Set icon with an_icon.
        require
            an_icon_not_void: an_icon /= void
            an_icon_exists: an_icon.exists
        ensure
            icon_equal: icon.item = an_icon.item

    set_instance (an_instance: WEL_INSTANCE)
            -- Set instance with an_instance.
        require
            an_instance_not_void: an_instance /= void
            an_instance_exists: an_instance.exists
        ensure
            instance_equal: instance.item = an_instance.item

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_menu_name (a_menu_name: STRING)
            -- Set menu_name with a_menu_name.
        require
            a_menu_name_valid: a_menu_name /= void
        ensure
            menu_name_equal: menu_name.is_equal (a_menu_name)

    set_style (a_style: INTEGER)
            -- Set style with a_style.
        ensure
            style = a_style

    set_window_extra (a_window_extra: INTEGER)
            -- Set window_extra with a_window_extra.
        require
            positive_extra: a_window_extra >= 0
        ensure
            window_extra = a_window_extra

    set_window_procedure (a_window_procedure: POINTER)
            -- Set window_procedure with a_window_procedure.
        ensure
            window_procedure_equal: window_procedure = a_window_procedure

    unset_background
            -- Unset the background (becomes null).
        ensure
            background_unset: not background_set

    unset_cursor
            -- Unset the cursor (becomes null).
        ensure
            cursor_unset: not cursor_set

    unset_icon
            -- Unset the icon (becomes null).
        ensure
            icon_unset: not icon_set

    unset_menu_name
            -- Unset the menu (becomes null).
        ensure
            menu_name_unset: not menu_name_set

    unset_window_procedure
            -- Unset the window procedure (becomes null).
        ensure
            window_procedure_unset: not window_procedure_set

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

    register
            -- Register the window class.
        ensure
            registered: registered

    unregister
            -- Unregister the window class.
            -- All windows using this class must be destroyed.
        require
            registered: registered
        ensure
            no_registered: not registered

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WND_CLASS


cluster wel.support

Cluster
    wel.support

Supercluster
    wel

Classes
    WEL_ACCELERATORS
    WEL_ANY
    WEL_APPLICATION
    WEL_APPLICATION_MAIN_WINDOW
    WEL_ATOM
    WEL_BIT_OPERATIONS
    WEL_BLOCKING_DISPATCHER
    WEL_CLIPBOARD
    WEL_COLOR_CONTROL
    WEL_COMMAND
    WEL_COMMAND_EXEC
    WEL_COMMAND_LIST
    WEL_COMMAND_MANAGER
    WEL_CURSOR
    WEL_DISK_SPACE
    WEL_DISPATCHER
    WEL_DLL
    WEL_DOUBLE_CLICK
    WEL_ERROR
    WEL_FONT_FAMILY_ENUMERATOR
    WEL_GRAPHICAL_RESOURCE
    WEL_ICON
    WEL_ICON_INFO
    WEL_INIT_COMMCTRL_EX
    WEL_INPUT_EVENT
    WEL_INSTANCE
    WEL_MAIN_ARGUMENTS
    WEL_MENU
    WEL_MESSAGE_BOX
    WEL_MESSAGE_INFORMATION_CREATOR
    WEL_MSG_BOX
    WEL_NULL_CURSOR
    WEL_NULL_ICON
    WEL_OBJECT_ID_MANAGER
    WEL_PIPE
    WEL_PROCESS_LAUNCHER
    WEL_REFERENCE_TRACKABLE
    WEL_REGISTRY
    WEL_REGISTRY_KEY
    WEL_RESOURCE
    WEL_RETURN_VALUE
    WEL_SCROLLER
    WEL_SHARED_MEMORY
    WEL_SHARED_MEMORY_STRING
    WEL_SYSTEM_METRICS
    WEL_SYSTEM_PARAMETERS_INFO
    WEL_UNC_PATH_MAPPER
    WEL_UNIT_CONVERSION
    WEL_UNPOSITIONABLE_CONTROL_CONTAINER
    WEL_VERSION
    WEL_WINDOW_MANAGER
    WEL_WINDOWS_ERROR_MESSAGES
    WEL_WINDOWS_ROUTINES
    WEL_WINDOWS_VERSION
    WEL_WORD_OPERATIONS


WEL_ACCELERATORS Chart

class
    WEL_ACCELERATORS

General
    cluster: wel.support
    description: "Keyboard accelerators that generates a WM_COMMAND message."
    create: make_by_name, make_by_id, make_with_array

Ancestors
    WEL_RESOURCE

Queries
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_ACCELERATORS Flat contracts

indexing
    description: "Keyboard accelerators that generates a WM_COMMAND message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ACCELERATORS

create

    make_by_id (id: INTEGER)
            -- Load the resource by an id
            -- (from WEL_RESOURCE)
        require -- from WEL_RESOURCE
            valid_id: id > 0
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_name (name: STRING)
            -- Load the resource by a name
            -- (from WEL_RESOURCE)
        require -- from WEL_RESOURCE
            name_not_void: name /= void
            name_not_empty: not name.is_empty
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_with_array (an_array: WEL_ARRAY [WEL_ACCELERATOR])
            -- Initialize with accelerators in an_array.
        require
            an_array_not_void: an_array /= void
            an_array_exists: an_array.exists

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ACCELERATORS


WEL_ANY Chart

deferred class
    WEL_ANY

General
    cluster: wel.support
    description: "Ancestor to all Windows objects and structures."

Ancestors
    ANY
    MEMORY

Queries
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_ANY Flat contracts

indexing
    description: "Ancestor to all Windows objects and structures."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_ANY

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
        ensure
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.

feature -- Status setting

    set_shared
            -- Set shared to True.
        ensure
            shared: shared

    set_unshared
            -- Set shared to False.
        ensure
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
        ensure
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
        ensure
            Result = cwel_pointer_to_integer (item)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ANY


WEL_APPLICATION Chart

deferred class
    WEL_APPLICATION

General
    cluster: wel.support
    description: "General notions of a Windows application. All WEL applications must define its own descendant of WEL_APPLICATION."

Ancestors
    WEL_APPLICATION_MAIN_WINDOW
    WEL_GWL_CONSTANTS
    WEL_WINDOWS_ROUTINES

Queries
    Accelerators: WEL_ACCELERATORS
    application: WEL_APPLICATION
    application_main_window: WEL_COMPOSITE_WINDOW
    Default_show_command: INTEGER
    idle_action_enabled: BOOLEAN
    is_application_main_window (window: WEL_COMPOSITE_WINDOW): BOOLEAN
    is_dialog (hwnd: POINTER): BOOLEAN
    main_window: WEL_COMPOSITE_WINDOW
    runable: BOOLEAN

Commands
    disable_idle_action
    enable_idle_action
    idle_action
    run


WEL_APPLICATION Flat contracts

indexing
    description: "General notions of a Windows application. All WEL applications must define its own descendant of WEL_APPLICATION."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_APPLICATION

feature -- Access

    accelerators: WEL_ACCELERATORS
            -- Application's accelerators
            -- May be redefined (in once) to associate accelerators.

    application: WEL_APPLICATION
            -- Current application
            -- (from WEL_APPLICATION_MAIN_WINDOW)

    application_main_window: WEL_COMPOSITE_WINDOW
            -- Application's main window
            -- (from WEL_APPLICATION_MAIN_WINDOW)

    default_show_command: INTEGER
            -- Default command used to show main_window.
            -- May be redefined to have a maximized window for
            -- instance.
            -- See class WEL_SW_CONSTANTS for values.

    main_window: WEL_COMPOSITE_WINDOW
            -- Must be defined as a once funtion to create the
            -- application's main_window.
        require
            once_declaration: application_main_window = void
        ensure
            result_not_void: Result /= void
            parent_main_window_is_void: Result.parent = void

feature -- Status report

    idle_action_enabled: BOOLEAN
            -- Is the idle action enabled?
            -- (False by default)

    is_application_main_window (window: WEL_COMPOSITE_WINDOW): BOOLEAN
            -- Is window the application's main window?
            -- (from WEL_APPLICATION_MAIN_WINDOW)
        require -- from WEL_APPLICATION_MAIN_WINDOW
            window_not_void: window /= void
        ensure -- from WEL_APPLICATION_MAIN_WINDOW
            Result = (window = application_main_window)

    is_dialog (hwnd: POINTER): BOOLEAN
            -- Is the window corresponding to hwnd a dialog box?
            -- We call the function with a dialog box option,
            -- if it is indeed a dialog, the result will always
            -- be non zero, otherwise it is zero.

    runable: BOOLEAN
            -- Can the application be run?
            -- (True by default)
            -- The user may want to return False if the application
            -- cannot be executed for any reason.

feature -- Status setting

    disable_idle_action
            -- Disable the call to idle_action when the message
            -- queue is empty.
        ensure
            idle_action_disabled: not idle_action_enabled

    enable_idle_action
            -- Enable the call to idle_action when the message
            -- queue is empty.
        ensure
            idle_action_enabled: idle_action_enabled

feature -- Basic operations

    idle_action
            -- Called when the message queue is empty.
            -- Useful to perform background operations.
        require
            idle_action_enabled: idle_action_enabled

    run
            -- Create main_window and start the message loop.
        require
            runable: runable
            main_window_not_void: application_main_window /= void
            parent_main_window_is_void: application_main_window.parent = void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_APPLICATION


WEL_APPLICATION_MAIN_WINDOW Chart

class
    WEL_APPLICATION_MAIN_WINDOW

General
    cluster: wel.support
    description: "Class to share the application's main window object."

Ancestors
    ANY

Queries
    application: WEL_APPLICATION
    application_main_window: WEL_COMPOSITE_WINDOW
    is_application_main_window (window: WEL_COMPOSITE_WINDOW): BOOLEAN


WEL_APPLICATION_MAIN_WINDOW Flat contracts

indexing
    description: "Class to share the application's main window object."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_APPLICATION_MAIN_WINDOW

feature -- Access

    application: WEL_APPLICATION
            -- Current application

    application_main_window: WEL_COMPOSITE_WINDOW
            -- Application's main window

feature -- Status report

    is_application_main_window (window: WEL_COMPOSITE_WINDOW): BOOLEAN
            -- Is window the application's main window?
        require
            window_not_void: window /= void
        ensure
            Result = (window = application_main_window)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_APPLICATION_MAIN_WINDOW


WEL_ATOM Chart

class
    WEL_ATOM

General
    cluster: wel.support
    description: "Atom associated to a string."
    create: make

Ancestors
    MEMORY

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    item: INTEGER
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    Max_name_length: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    name: STRING
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    Total_memory: INTEGER

Commands
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    disable_time_accounting
    enable_time_accounting
    free (object: ANY)
    full_coalesce
    full_collect
    mem_free (addr: POINTER)
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)


WEL_ATOM Flat contracts

indexing
    description: "Atom associated to a string."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ATOM

create

    make (a_name: STRING)
            -- Make an atom named a_name.
        require
            a_name_not_void: a_name /= void
            a_name_not_empty: not a_name.is_empty
            a_name_not_too_long: a_name.count <= max_name_length
        ensure
            name_is_equal: item /= 0 implies name.is_equal (a_name)

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    item: INTEGER
            -- Eiffel representation of ATOM.

    Max_name_length: INTEGER is 80
            -- Maximum atom name length

    name: STRING
            -- Atom name
        ensure
            result_not_void: Result /= void
            result_not_empty: not Result.is_empty

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)

    collecting: BOOLEAN
            -- Is garbage collection enabled?
            -- (from MEMORY)

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.
            -- (from MEMORY)

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.
            -- (from MEMORY)

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)

    collection_off
            -- Disable garbage collection.
            -- (from MEMORY)

    collection_on
            -- Enable garbage collection.
            -- (from MEMORY)

    disable_time_accounting
            -- Disable GC time accounting (default).
            -- (from MEMORY)

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ATOM


WEL_BIT_OPERATIONS Chart

class
    WEL_BIT_OPERATIONS

General
    cluster: wel.support
    description: "Bit operations on integer (or, and not)."

Ancestors
    ANY

Queries
    clear_flag (flags, mask: INTEGER): INTEGER
    flag_set (flags, mask: INTEGER): BOOLEAN
    set_flag (flags, mask: INTEGER): INTEGER


WEL_BIT_OPERATIONS Flat contracts

indexing
    description: "Bit operations on integer (or, and not)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BIT_OPERATIONS

feature -- Status report

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?

feature -- Basic operations

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
        ensure
            flag_unset: not flag_set (Result, mask)

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
        ensure
            flag_set: flag_set (Result, mask)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BIT_OPERATIONS


WEL_BLOCKING_DISPATCHER Chart

class
    WEL_BLOCKING_DISPATCHER

General
    cluster: wel.support
    description:
        "Receive and dispatch the Windows messages to the Eiffel objects.
        block the message if a blocking window is present"
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_CONSTANTS
    WEL_DISPATCHER
    WEL_WORD_OPERATIONS

Queries
    blocking_dispatcher_enabled: BOOLEAN
    blocking_dispatcher_window: WEL_WINDOW
    En_change: INTEGER
    En_errspace: INTEGER
    En_hscroll: INTEGER
    En_killfocus: INTEGER
    En_maxtext: INTEGER
    En_msgfilter: INTEGER
    En_setfocus: INTEGER
    En_update: INTEGER
    En_vscroll: INTEGER

Commands
    disable_blocking_dispatcher
    enable_blocking_dispatcher
    remove_blocking_dispatcher_window
    set_blocking_dispatcher_window (a_window: WEL_WINDOW)


WEL_BLOCKING_DISPATCHER Flat contracts

indexing
    description: "Receive and dispatch the Windows messages to the Eiffel objects.block the message if a blocking window is present"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_BLOCKING_DISPATCHER

create

    make
            -- Initialize the C variables
            -- (from WEL_DISPATCHER)

feature -- Access

    En_change: INTEGER is 768
            -- (from WEL_EN_CONSTANTS)

    En_errspace: INTEGER is 1280
            -- (from WEL_EN_CONSTANTS)

    En_hscroll: INTEGER is 1537
            -- (from WEL_EN_CONSTANTS)

    En_killfocus: INTEGER is 512
            -- (from WEL_EN_CONSTANTS)

    En_maxtext: INTEGER is 1281
            -- (from WEL_EN_CONSTANTS)

    En_msgfilter: INTEGER is 1792
            -- (from WEL_EN_CONSTANTS)

    En_setfocus: INTEGER is 256
            -- (from WEL_EN_CONSTANTS)

    En_update: INTEGER is 1024
            -- (from WEL_EN_CONSTANTS)

    En_vscroll: INTEGER is 1538
            -- (from WEL_EN_CONSTANTS)

feature -- Status setting

    blocking_dispatcher_enabled: BOOLEAN
            -- Is the dispatcher with blocking window handling enabled?

    blocking_dispatcher_window: WEL_WINDOW
            -- Current blocking window

    disable_blocking_dispatcher
            -- Disable the blocking window dispatcher

    enable_blocking_dispatcher
            -- Enable the blocking window dispatcher

    remove_blocking_dispatcher_window
            -- Remove the current blocking window

    set_blocking_dispatcher_window (a_window: WEL_WINDOW)
            -- Set the blocking window to a_window

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_BLOCKING_DISPATCHER


WEL_CLIPBOARD Chart

class
    WEL_CLIPBOARD

General
    cluster: wel.support
    description: "Class that handles Windows Clipboard operations"

Ancestors
    WEL_CLIPBOARD_CONSTANTS

Queries
    clipboard_open: BOOLEAN
    is_clipboard_format_available (format: INTEGER): BOOLEAN
    last_string: STRING

Commands
    close_clipboard
    empty_clipboard
    open_clipboard (window: WEL_WINDOW)
    retrieve_clipboard_text
    set_clipboard_text (a_text: STRING)


WEL_CLIPBOARD Flat contracts

indexing
    description: "Class that handles Windows Clipboard operations"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CLIPBOARD

feature -- Access

    clipboard_open: BOOLEAN
            -- Is clipboard open?

    is_clipboard_format_available (format: INTEGER): BOOLEAN

    last_string: STRING
            -- Text retrieved from Clipboard
            -- Only valid after a successfull call to
            -- retrieve_clipboard_text

feature -- Element Change

    close_clipboard
            -- Close clipboard.

    empty_clipboard
            -- Empty clipboard.

    open_clipboard (window: WEL_WINDOW)
        require
            window_exists: window /= void and then window.exists

    retrieve_clipboard_text
            -- Retrieves text from the clipboard
        require
            clipboard_open: clipboard_open
            text_available: is_clipboard_format_available (cf_text)

    set_clipboard_text (a_text: STRING)
            -- Assign a_text to the clipboard
        require
            clipboard_open: clipboard_open

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CLIPBOARD


WEL_COLOR_CONTROL Chart

deferred class
    WEL_COLOR_CONTROL

General
    cluster: wel.support
    description: "Common type for several control which backgound and foreground colors can be changed"

Ancestors
    WEL_COLOR_CONSTANTS

Queries
    background_color: WEL_COLOR_REF
    Color_activeborder: INTEGER
    Color_activecaption: INTEGER
    Color_appworkspace: INTEGER
    Color_background: INTEGER
    Color_btnface: INTEGER
    Color_btnhighlight: INTEGER
    Color_btnshadow: INTEGER
    Color_btntext: INTEGER
    Color_captiontext: INTEGER
    Color_graytext: INTEGER
    Color_highlight: INTEGER
    Color_highlighttext: INTEGER
    Color_inactiveborder: INTEGER
    Color_inactivecaption: INTEGER
    Color_inactivecaptiontext: INTEGER
    Color_menu: INTEGER
    Color_menutext: INTEGER
    Color_scrollbar: INTEGER
    Color_window: INTEGER
    Color_windowframe: INTEGER
    Color_windowtext: INTEGER
    exists: BOOLEAN
    foreground_color: WEL_COLOR_REF
    valid_color_constant (c: INTEGER): BOOLEAN


WEL_COLOR_CONTROL Flat contracts

indexing
    description: "Common type for several control which backgound and foreground colors can be changed"
    author: ""
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_COLOR_CONTROL

feature -- Access

    background_color: WEL_COLOR_REF
            -- Background color used for the background of the
            -- control
        require
            exists: exists
        ensure
            color_not_void: background_color /= void

    Color_activeborder: INTEGER is 10
            -- (from WEL_COLOR_CONSTANTS)

    Color_activecaption: INTEGER is 2
            -- (from WEL_COLOR_CONSTANTS)

    Color_appworkspace: INTEGER is 12
            -- (from WEL_COLOR_CONSTANTS)

    Color_background: INTEGER is 1
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnface: INTEGER is 15
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnhighlight: INTEGER is 20
            -- (from WEL_COLOR_CONSTANTS)

    Color_btnshadow: INTEGER is 16
            -- (from WEL_COLOR_CONSTANTS)

    Color_btntext: INTEGER is 18
            -- (from WEL_COLOR_CONSTANTS)

    Color_captiontext: INTEGER is 9
            -- (from WEL_COLOR_CONSTANTS)

    Color_graytext: INTEGER is 17
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlight: INTEGER is 13
            -- (from WEL_COLOR_CONSTANTS)

    Color_highlighttext: INTEGER is 14
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactiveborder: INTEGER is 11
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaption: INTEGER is 3
            -- (from WEL_COLOR_CONSTANTS)

    Color_inactivecaptiontext: INTEGER is 19
            -- (from WEL_COLOR_CONSTANTS)

    Color_menu: INTEGER is 4
            -- (from WEL_COLOR_CONSTANTS)

    Color_menutext: INTEGER is 7
            -- (from WEL_COLOR_CONSTANTS)

    Color_scrollbar: INTEGER is 0
            -- (from WEL_COLOR_CONSTANTS)

    Color_window: INTEGER is 5
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowframe: INTEGER is 6
            -- (from WEL_COLOR_CONSTANTS)

    Color_windowtext: INTEGER is 8
            -- (from WEL_COLOR_CONSTANTS)

    foreground_color: WEL_COLOR_REF
            -- foreground color used for the text of the
            -- control
        require
            exists: exists
        ensure
            color_not_void: foreground_color /= void

feature -- Status report

    exists: BOOLEAN
            -- Does the control exists ?

    valid_color_constant (c: INTEGER): BOOLEAN
            -- Is c a valid color constant?
            -- (from WEL_COLOR_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COLOR_CONTROL


WEL_COMMAND_EXEC Chart

class
    WEL_COMMAND_EXEC

General
    cluster: wel.support
    description: "Execute commands."
    create: make

Ancestors
    ANY

Queries
    argument: ANY
    command: WEL_COMMAND

Commands
    execute (window: WEL_WINDOW; message, wparam, lparam: INTEGER)
    make (a_command: WEL_COMMAND; an_argument: ANY)


WEL_COMMAND_EXEC Flat contracts

indexing
    description: "Execute commands."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMMAND_EXEC

create

    make (a_command: WEL_COMMAND; an_argument: ANY)
            -- Set command and argument with
            -- a_command and an_argument.
        require
            a_command_not_void: a_command /= void
        ensure
            command_set: command = a_command
            argument_set: argument = an_argument

feature -- Initialization

    make (a_command: WEL_COMMAND; an_argument: ANY)
            -- Set command and argument with
            -- a_command and an_argument.
        require
            a_command_not_void: a_command /= void
        ensure
            command_set: command = a_command
            argument_set: argument = an_argument

feature -- Access

    argument: ANY
            -- Argument to be given to command before execution

    command: WEL_COMMAND
            -- User-defined command to execute

feature -- Execution

    execute (window: WEL_WINDOW; message, wparam, lparam: INTEGER)
            -- Create message information corresponding to message
            -- and execute command.
        require
            window_not_void: window /= void
            positive_message: message >= 0

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMMAND_EXEC


WEL_COMMAND Chart

deferred class
    WEL_COMMAND

General
    cluster: wel.support
    description: "General notion of command. To write an actual command inherit from this class and implement the `execute' feature."

Ancestors
    ANY

Queries
    message_information: WEL_MESSAGE_INFORMATION

Commands
    execute (argument: ANY)
    set_message_information (mi: WEL_MESSAGE_INFORMATION)


WEL_COMMAND Flat contracts

indexing
    description: "General notion of command. To write an actual command inherit from this class and implement the `execute' feature."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_COMMAND

feature -- Access

    message_information: WEL_MESSAGE_INFORMATION
            -- Information associated to the message

feature -- Element change

    set_message_information (mi: WEL_MESSAGE_INFORMATION)
            -- Set message_information with mi.
        ensure
            message_information_set: message_information = mi

feature -- Execution

    execute (argument: ANY)
            -- Execute the command with argument.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMMAND


WEL_COMMAND_LIST Chart

class
    WEL_COMMAND_LIST

General
    cluster: wel.support
    description: "A command which executes a list of commands."
    create: make

Ancestors
    LINKED_LIST [G]
    WEL_COMMAND

Queries
    infix "@" (i: INTEGER): [like item] WEL_COMMAND_EXEC
    after: BOOLEAN
    before: BOOLEAN
    changeable_comparison_criterion: BOOLEAN
    count: INTEGER
    cursor: CURSOR
    duplicate (n: INTEGER): [like Current] WEL_COMMAND_LIST
    exhausted: BOOLEAN
    Extendible: BOOLEAN
    first: [like item] WEL_COMMAND_EXEC
    for_all (test: FUNCTION [ANY, TUPLE [WEL_COMMAND_EXEC], BOOLEAN]): BOOLEAN
    Full: BOOLEAN
    has (v: [like item] WEL_COMMAND_EXEC): BOOLEAN
    i_th (i: INTEGER): [like item] WEL_COMMAND_EXEC
    index: INTEGER
    index_of (v: [like item] WEL_COMMAND_EXEC; i: INTEGER): INTEGER
    index_set: INTEGER_INTERVAL
    is_empty: BOOLEAN
    is_equal (other: [like Current] WEL_COMMAND_LIST): BOOLEAN
    is_inserted (v: WEL_COMMAND_EXEC): BOOLEAN
    isfirst: BOOLEAN
    islast: BOOLEAN
    item: WEL_COMMAND_EXEC
    last: [like item] WEL_COMMAND_EXEC
    linear_representation: LINEAR [WEL_COMMAND_EXEC]
    message_information: WEL_MESSAGE_INFORMATION
    object_comparison: BOOLEAN
    occurrences (v: [like item] WEL_COMMAND_EXEC): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    readable: BOOLEAN
    sequential_occurrences (v: WEL_COMMAND_EXEC): INTEGER
    there_exists (test: FUNCTION [ANY, TUPLE [WEL_COMMAND_EXEC], BOOLEAN]): BOOLEAN
    valid_cursor (p: CURSOR): BOOLEAN
    valid_cursor_index (i: INTEGER): BOOLEAN
    valid_index (i: INTEGER): BOOLEAN
    writable: BOOLEAN

Commands
    add_command (command: WEL_COMMAND; argument: ANY)
    append (s: SEQUENCE [WEL_COMMAND_EXEC])
    back
    compare_objects
    compare_references
    copy (other: [like Current] WEL_COMMAND_LIST)
    do_all (action: PROCEDURE [ANY, TUPLE [WEL_COMMAND_EXEC]])
    do_if (action: PROCEDURE [ANY, TUPLE [WEL_COMMAND_EXEC]]; test: FUNCTION [ANY, TUPLE [WEL_COMMAND_EXEC], BOOLEAN])
    execute (argument: ANY)
    extend (v: [like item] WEL_COMMAND_EXEC)
    fill (other: CONTAINER [WEL_COMMAND_EXEC])
    finish
    force (v: [like item] WEL_COMMAND_EXEC)
    forth
    go_i_th (i: INTEGER)
    go_to (p: CURSOR)
    make
    merge_left (other: [like Current] WEL_COMMAND_LIST)
    merge_right (other: [like Current] WEL_COMMAND_LIST)
    move (i: INTEGER)
    prune (v: [like item] WEL_COMMAND_EXEC)
    prune_all (v: [like item] WEL_COMMAND_EXEC)
    put (v: [like item] WEL_COMMAND_EXEC)
    put_front (v: [like item] WEL_COMMAND_EXEC)
    put_i_th (v: [like item] WEL_COMMAND_EXEC; i: INTEGER)
    put_left (v: [like item] WEL_COMMAND_EXEC)
    put_right (v: [like item] WEL_COMMAND_EXEC)
    remove
    remove_command (command: WEL_COMMAND; argument: ANY)
    remove_left
    remove_right
    replace (v: [like item] WEL_COMMAND_EXEC)
    search (v: [like item] WEL_COMMAND_EXEC)
    set_message_information (mi: WEL_MESSAGE_INFORMATION)
    start
    swap (i: INTEGER)
    wipe_out


WEL_COMMAND_LIST Flat contracts

indexing
    description: "A command which executes a list of commands."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMMAND_LIST

create

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Initialization

    make
            -- Create an empty list.
            -- (from LINKED_LIST)
        ensure -- from LINKED_LIST
            is_before: before

feature -- Access

    cursor: CURSOR
            -- Current cursor position
            -- (from LINKED_LIST)

    first: like item
            -- Item at first position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    has (v: like item): BOOLEAN
            -- Does chain include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    i_th (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of @.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

    index: INTEGER
            -- Index of current position
            -- (from LINKED_LIST)

    index_of (v: like item; i: INTEGER): INTEGER
            -- Index of i-th occurrence of item identical to v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- 0 if none.
            -- (from CHAIN)
        require -- from LINEAR
            positive_occurrences: i > 0
        ensure -- from LINEAR
            non_negative_result: Result >= 0

    item: WEL_COMMAND_EXEC
            -- Current item
            -- (from LINKED_LIST)
        require -- from TRAVERSABLE
            not_off: not off
        require -- from ACTIVE
            readable: readable

    last: like item
            -- Item at last position
            -- (from LINKED_LIST)
        require -- from CHAIN
            not_empty: not is_empty

    message_information: WEL_MESSAGE_INFORMATION
            -- Information associated to the message
            -- (from WEL_COMMAND)

    sequential_occurrences (v: WEL_COMMAND_EXEC): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from LINEAR)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    infix "@" (i: INTEGER): like item
            -- Item at i-th position
            -- Was declared in CHAIN as synonym of i_th.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)

feature -- Measurement

    count: INTEGER
            -- Number of items
            -- (from LINKED_LIST)

    index_set: INTEGER_INTERVAL
            -- Range of acceptable indexes
            -- (from CHAIN)
        ensure -- from INDEXABLE
            not_void: Result /= void
        ensure then -- from CHAIN
            count_definition: Result.count = count

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

    occurrences (v: like item): INTEGER
            -- Number of times v appears.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from CHAIN)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does other contain the same elements?
            -- (from LIST)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result
        ensure then -- from LIST
            indices_unchanged: index = old index and other.index = old other.index
            true_implies_same_size: Result implies count = other.count

feature -- Status report

    after: BOOLEAN
            -- Is there no valid cursor position to the right of cursor?
            -- (from LINKED_LIST)

    before: BOOLEAN
            -- Is there no valid cursor position to the left of cursor?
            -- (from LINKED_LIST)

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    exhausted: BOOLEAN
            -- Has structure been completely explored?
            -- (from LINEAR)
        ensure -- from LINEAR
            exhausted_when_off: off implies Result

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    Full: BOOLEAN is False
            -- Is structured filled to capacity? (Answer: no.)
            -- (from LINKED_LIST)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: WEL_COMMAND_EXEC): BOOLEAN
            -- Has v been inserted at the end by the most recent put or
            -- extend?
            -- (from LINKED_LIST)

    isfirst: BOOLEAN
            -- Is cursor at first position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    islast: BOOLEAN
            -- Is cursor at last position?
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            valid_position: Result implies not is_empty

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is there no current item?
            -- (from LINKED_LIST)

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from DYNAMIC_CHAIN)

    readable: BOOLEAN
            -- Is there a current item that may be read?
            -- (from LINKED_LIST)

    valid_cursor (p: CURSOR): BOOLEAN
            -- Can the cursor be moved to position p?
            -- (from LINKED_LIST)

    valid_cursor_index (i: INTEGER): BOOLEAN
            -- Is i correctly bounded for cursor movement?
            -- (from CHAIN)
        ensure -- from CHAIN
            valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

    valid_index (i: INTEGER): BOOLEAN
            -- Is i within allowable bounds?
            -- (from CHAIN)
        ensure then -- from INDEXABLE
            only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
        ensure then -- from CHAIN
            valid_index_definition: Result = ((i >= 1) and (i <= count))

    writable: BOOLEAN
            -- Is there a current item that may be modified?
            -- (from SEQUENCE)

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    back
            -- Move to previous item.
            -- (from LINKED_LIST)
        require -- from BILINEAR
            not_before: not before

    finish
            -- Move cursor to last position.
            -- (Go before if empty)
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_last: not is_empty implies islast
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies before

    forth
            -- Move cursor to next position.
            -- (from LINKED_LIST)
        require -- from LINEAR
            not_after: not after
        ensure then -- from LIST
            moved_forth: index = old index + 1

    go_i_th (i: INTEGER)
            -- Move cursor to i-th position.
            -- (from LINKED_LIST)
        require -- from CHAIN
            valid_cursor_index: valid_cursor_index (i)
        ensure -- from CHAIN
            position_expected: index = i

    go_to (p: CURSOR)
            -- Move cursor to position p.
            -- (from LINKED_LIST)
        require -- from CURSOR_STRUCTURE
            cursor_position_valid: valid_cursor (p)

    move (i: INTEGER)
            -- Move cursor i positions. The cursor
            -- may end up off if the offset is too big.
            -- (from LINKED_LIST)
        ensure -- from CHAIN
            too_far_right: (old index + i > count) implies exhausted
            too_far_left: (old index + i < 1) implies exhausted
            expected_index: (not exhausted) implies (index = old index + i)
        ensure then -- from LINKED_LIST
            moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= (count + 1)) implies index = (old index + i)
            before_set: (old index + i) <= 0 implies before
            after_set: (old index + i) >= (count + 1) implies after

    search (v: like item)
            -- Move to first position (at or after current
            -- position) where item and v are equal.
            -- If structure does not include v ensure that
            -- exhausted will be true.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from BILINEAR)
        ensure -- from LINEAR
            object_found: (not exhausted and object_comparison) implies equal (v, item)
            item_found: (not exhausted and not object_comparison) implies v = item

    start
            -- Move cursor to first position.
            -- (from LINKED_LIST)
        ensure then -- from CHAIN
            at_first: not is_empty implies isfirst
        ensure then -- from LINKED_LIST
            empty_convention: is_empty implies after

feature -- Element change

    add_command (command: WEL_COMMAND; argument: ANY)
            -- Add command with argument to list of commands.

    append (s: SEQUENCE [WEL_COMMAND_EXEC])
            -- Append a copy of s.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            argument_not_void: s /= void
        ensure -- from SEQUENCE
            new_count: count >= old count

    extend (v: like item)
            -- Add v to end.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from BAG
            one_more_occurrence: occurrences (v) = old (occurrences (v)) + 1

    fill (other: CONTAINER [WEL_COMMAND_EXEC])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    force (v: like item)
            -- Add v to end.
            -- (from SEQUENCE)
        require -- from SEQUENCE
            extendible: extendible
        ensure then -- from SEQUENCE
            new_count: count = old count + 1
            item_inserted: has (v)

    merge_left (other: like Current)
            -- Merge other into current structure before cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            new_index: index = old index + old other.count
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    merge_right (other: like Current)
            -- Merge other into current structure after cursor
            -- position. Do not move cursor. Empty other.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
            other_exists: other /= void
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + old other.count
            same_index: index = old index
            other_is_empty: other.is_empty
        ensure then -- from DYNAMIC_LIST
            other_empty: other.is_empty

    put (v: like item)
            -- Replace current item by v.
            -- (Synonym for replace)
            -- (from CHAIN)
        require -- from COLLECTION
            extendible: extendible
        ensure -- from COLLECTION
            item_inserted: is_inserted (v)
        ensure then -- from CHAIN
            same_count: count = old count

    put_front (v: like item)
            -- Add v to beginning.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            item_inserted: first = v

    put_i_th (v: like item; i: INTEGER)
            -- Put v at i-th position.
            -- (from CHAIN)
        require -- from TABLE
            valid_key: valid_index (k)
        ensure then -- from INDEXABLE
            insertion_done: i_th (k) = v

    put_left (v: like item)
            -- Add v to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            new_index: index = old index + 1
        ensure then -- from LINKED_LIST
            previous_exists: previous /= void
            item_inserted: previous.item = v

    put_right (v: like item)
            -- Add v to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            extendible: extendible
            not_after: not after
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count + 1
            same_index: index = old index
        ensure then -- from LINKED_LIST
            next_exists: next /= void
            item_inserted: not old before implies next.item = v
            item_inserted_before: old before implies active.item = v

    remove_command (command: WEL_COMMAND; argument: ANY)
            -- Remove all command with argument from the list of commands.
        require
            command_not_void: command /= void

    replace (v: like item)
            -- Replace current item by v.
            -- (from LINKED_LIST)
        require -- from ACTIVE
            writable: writable
        ensure -- from ACTIVE
            item_replaced: item = v

    set_message_information (mi: WEL_MESSAGE_INFORMATION)
            -- Set message_information with mi.
            -- (from WEL_COMMAND)
        ensure -- from WEL_COMMAND
            message_information_set: message_information = mi

feature -- Removal

    prune (v: like item)
            -- Remove first occurrence of v, if any,
            -- after cursor position.
            -- If found, move cursor to right neighbor;
            -- if not, make structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable: prunable

    prune_all (v: like item)
            -- Remove all occurrences of v.
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- Leave structure exhausted.
            -- (from DYNAMIC_CHAIN)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            no_more_occurrences: not has (v)
        ensure then -- from DYNAMIC_CHAIN
            is_exhausted: exhausted

    remove
            -- Remove current item.
            -- Move cursor to right neighbor
            -- (or after if no right neighbor).
            -- (from LINKED_LIST)
        require -- from ACTIVE
            prunable: prunable
            writable: writable
        ensure then -- from DYNAMIC_LIST
            after_when_empty: is_empty implies after

    remove_left
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            left_exists: index > 1
        require else -- from DYNAMIC_LIST
            not_before: not before
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            new_index: index = old index - 1

    remove_right
            -- Remove item to the right of cursor position.
            -- Do not move cursor.
            -- (from LINKED_LIST)
        require -- from DYNAMIC_CHAIN
            right_exists: index < count
        ensure -- from DYNAMIC_CHAIN
            new_count: count = old count - 1
            same_index: index = old index

    wipe_out
            -- Remove all items.
            -- (from LINKED_LIST)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from DYNAMIC_LIST
            is_before: before

feature -- Transformation

    swap (i: INTEGER)
            -- Exchange item at i-th position with item
            -- at cursor position.
            -- (from CHAIN)
        require -- from CHAIN
            not_off: not off
            valid_index: valid_index (i)
        ensure -- from CHAIN
            swapped_to_item: item = old i_th (i)
            swapped_from_item: i_th (i) = old item

feature -- Conversion

    linear_representation: LINEAR [WEL_COMMAND_EXEC]
            -- Representation as a linear structure
            -- (from LINEAR)

feature -- Duplication

    copy (other: like Current)
            -- Update current object using fields of object attached
            -- to other, so as to yield equal objects.
            -- (from LINKED_LIST)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

    duplicate (n: INTEGER): like Current
            -- Copy of sub-chain beginning at current position
            -- and having min (n, from_here) items,
            -- where from_here is the number of items
            -- at or to the right of current position.
            -- (from DYNAMIC_CHAIN)
        require -- from CHAIN
            not_off_unless_after: off implies after
            valid_subchain: n >= 0

feature -- Execution

    execute (argument: ANY)
            -- Execute list of commands

feature -- Iteration

    do_all (action: PROCEDURE [ANY, TUPLE [WEL_COMMAND_EXEC]])
            -- Apply action to every item.
            -- Semantics not guaranteed if action changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void

    do_if (action: PROCEDURE [ANY, TUPLE [WEL_COMMAND_EXEC]]; test: FUNCTION [ANY, TUPLE [WEL_COMMAND_EXEC], BOOLEAN])
            -- Apply action to every item that satisfies test.
            -- Semantics not guaranteed if action or test changes the structure;
            -- in such a case, apply iterator to clone of structure instead.
            -- (from LINEAR)
        require -- from TRAVERSABLE
            action_exists: action /= void
            test_exits: test /= void

    for_all (test: FUNCTION [ANY, TUPLE [WEL_COMMAND_EXEC], BOOLEAN]): BOOLEAN
            -- Is test true for all items?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

    there_exists (test: FUNCTION [ANY, TUPLE [WEL_COMMAND_EXEC], BOOLEAN]): BOOLEAN
            -- Is test true for at least one item?
            -- (from LINEAR)
        require -- from TRAVERSABLE
            test_exits: test /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from LINKED_LIST
    prunable: prunable
    empty_constraint: is_empty implies ((first_element = void) and (active = void))
    not_void_unless_empty: (active = void) implies is_empty
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
        -- from LIST
    before_definition: before = (index = 0)
    after_definition: after = (index = count + 1)
        -- from CHAIN
    non_negative_index: index >= 0
    index_small_enough: index <= count + 1
    off_definition: off = ((index = 0) or (index = count + 1))
    isfirst_definition: isfirst = ((not is_empty) and (index = 1))
    islast_definition: islast = ((not is_empty) and (index = count))
    item_corresponds_to_index: (not off) implies (item = i_th (index))
    index_set_has_same_count: index_set.count = count
        -- from ACTIVE
    writable_constraint: writable implies readable
    empty_constraint: is_empty implies (not readable) and (not writable)
        -- from INDEXABLE
    index_set_not_void: index_set /= void
        -- from BILINEAR
    not_both: not (after and before)
    before_constraint: before implies off
        -- from LINEAR
    after_constraint: after implies off
        -- from TRAVERSABLE
    empty_constraint: is_empty implies off
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0
        -- from DYNAMIC_CHAIN
    extendible: extendible

end -- class WEL_COMMAND_LIST


WEL_COMMAND_MANAGER Chart

class
    WEL_COMMAND_MANAGER

General
    cluster: wel.support
    description: "Command manager which is able to retrieve the command associated to a Windows message."
    create: make

Ancestors
    HASH_TABLE [G, H -> HASHABLE]

Queries
    infix "@" (key: INTEGER): WEL_COMMAND_EXEC
    after: BOOLEAN
    capacity: INTEGER
    changeable_comparison_criterion: BOOLEAN
    conflict: BOOLEAN
    count: INTEGER
    current_keys: ARRAY [INTEGER]
    cursor: CURSOR
    exists (message: INTEGER): BOOLEAN
    Extendible: BOOLEAN
    found: BOOLEAN
    found_item: WEL_COMMAND_EXEC
    Full: BOOLEAN
    has (key: INTEGER): BOOLEAN
    has_item (v: WEL_COMMAND_EXEC): BOOLEAN
    inserted: BOOLEAN
    is_empty: BOOLEAN
    is_equal (other: [like Current] WEL_COMMAND_MANAGER): BOOLEAN
    is_inserted (v: WEL_COMMAND_EXEC): BOOLEAN
    item (key: INTEGER): WEL_COMMAND_EXEC
    item_for_iteration: WEL_COMMAND_EXEC
    key_for_iteration: INTEGER
    linear_representation: ARRAYED_LIST [WEL_COMMAND_EXEC]
    not_found: BOOLEAN
    object_comparison: BOOLEAN
    occurrences (v: WEL_COMMAND_EXEC): INTEGER
    off: BOOLEAN
    prunable: BOOLEAN
    removed: BOOLEAN
    replaced: BOOLEAN
    valid_cursor (c: CURSOR): BOOLEAN
    valid_key (k: INTEGER): BOOLEAN

Commands
    accommodate (n: INTEGER)
    clear_all
    compare_objects
    compare_references
    copy (other: [like Current] WEL_COMMAND_MANAGER)
    extend (new: WEL_COMMAND_EXEC; key: INTEGER)
    fill (other: CONTAINER [WEL_COMMAND_EXEC])
    force (command: WEL_COMMAND_EXEC; message: INTEGER)
    forth
    go_to (c: CURSOR)
    hash_table_force (new: WEL_COMMAND_EXEC; key: INTEGER)
    hash_table_make (n: INTEGER)
    hash_table_remove (key: INTEGER)
    make
    put (new: WEL_COMMAND_EXEC; key: INTEGER)
    remove (message: INTEGER)
    replace (new: WEL_COMMAND_EXEC; key: INTEGER)
    replace_key (new_key, old_key: INTEGER)
    search (key: INTEGER)
    start


WEL_COMMAND_MANAGER Flat contracts

indexing
    description: "Command manager which is able to retrieve the command associated to a Windows message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_COMMAND_MANAGER

create

    make
            -- Make a command manager.

feature -- Initialization

    accommodate (n: INTEGER)
            -- Reallocate table with enough space for n items;
            -- keep all current items.
            -- (from HASH_TABLE)
        require -- from HASH_TABLE
            n >= 0
        ensure -- from HASH_TABLE
            count_not_changed: count = old count
            slot_count_same_as_count: used_slot_count = count
            breathing_space: count * 100 < capacity * initial_occupation

    make
            -- Make a command manager.

    hash_table_make (n: INTEGER)
            -- Allocate hash table for at least n items.
            -- The table will be resized automatically
            -- if more than n items are inserted.
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            breathing_space: n * 100 < capacity * initial_occupation
            minimum_space: minimum_capacity * 100 < capacity * initial_occupation
            more_than_minimum: capacity >= minimum_capacity
            no_status: not special_status

feature -- Access

    current_keys: ARRAY [INTEGER]
            -- New array containing actually used keys, from 1 to count
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            good_count: Result.count = count

    cursor: CURSOR
            -- Current cursor position
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            cursor_not_void: Result /= void

    found_item: WEL_COMMAND_EXEC
            -- Item, if any, yielded by last search operation
            -- (from HASH_TABLE)

    has (key: INTEGER): BOOLEAN
            -- Is there an item in the table with key key?
            -- (from HASH_TABLE)
        ensure then -- from HASH_TABLE
            default_case: (key = computed_default_key) implies (Result = has_default)

    has_item (v: WEL_COMMAND_EXEC): BOOLEAN
            -- Does structure include v?
            -- (Reference or object equality,
            -- based on object_comparison.)
            -- (from HASH_TABLE)
        ensure -- from CONTAINER
            not_found_in_empty: Result implies not is_empty

    item (key: INTEGER): WEL_COMMAND_EXEC
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of @.
            -- (from HASH_TABLE)
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then -- from HASH_TABLE
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

    item_for_iteration: WEL_COMMAND_EXEC
            -- Element at current iteration position
            -- (from HASH_TABLE)
        require -- from HASH_TABLE
            not_off: not off

    key_for_iteration: INTEGER
            -- Key at current iteration position
            -- (from HASH_TABLE)
        require -- from HASH_TABLE
            not_off: not off
        ensure -- from HASH_TABLE
            at_iteration_position: Result = key_at (iteration_position)

    infix "@" (key: INTEGER): WEL_COMMAND_EXEC
            -- Item associated with key, if present
            -- otherwise default value of type G
            -- Was declared in HASH_TABLE as synonym of item.
            -- (from HASH_TABLE)
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then -- from HASH_TABLE
            default_value_if_not_present: (not (has (key))) implies (Result = computed_default_value)

feature -- Measurement

    capacity: INTEGER
            -- Number of items that may be stored.
            -- (from HASH_TABLE)

    count: INTEGER
            -- Number of items in table
            -- (from HASH_TABLE)

    occurrences (v: WEL_COMMAND_EXEC): INTEGER
            -- Number of table items equal to v.
            -- (from HASH_TABLE)
        ensure -- from BAG
            non_negative_occurrences: Result >= 0

feature -- Comparison

    is_equal (other: like Current): BOOLEAN
            -- Does table contain the same information as other?
            -- (from HASH_TABLE)
        require -- from ANY
            other_not_void: other /= void
        ensure -- from ANY
            symmetric: Result implies other.is_equal (Current)
            consistent: standard_is_equal (other) implies Result

feature -- Status report

    after: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of off.
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    changeable_comparison_criterion: BOOLEAN
            -- May object_comparison be changed?
            -- (Answer: yes by default.)
            -- (from CONTAINER)

    conflict: BOOLEAN
            -- Did last operation cause a conflict?
            -- (from HASH_TABLE)

    exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
        require
            positive_message: message >= 0

    Extendible: BOOLEAN is True
            -- May new items be added? (Answer: yes.)
            -- (from HASH_TABLE)

    found: BOOLEAN
            -- Did last operation find the item sought?
            -- (from HASH_TABLE)

    Full: BOOLEAN is False
            -- Is structure filled to capacity? (Answer: no.)
            -- (from HASH_TABLE)

    inserted: BOOLEAN
            -- Did last operation insert an item?
            -- (from HASH_TABLE)

    is_empty: BOOLEAN
            -- Is structure empty?
            -- (from FINITE)

    is_inserted (v: WEL_COMMAND_EXEC): BOOLEAN
            -- Has v been inserted by the most recent insertion?
            -- (By default, the value returned is equivalent to calling
            -- `has (v)'. However, descendants might be able to provide more
            -- efficient implementations.)
            -- (from COLLECTION)

    not_found: BOOLEAN
            -- Did last operation fail to find the item sought?
            -- (from HASH_TABLE)

    object_comparison: BOOLEAN
            -- Must search operations use equal rather than =
            -- for comparing references? (Default: no, use =.)
            -- (from CONTAINER)

    off: BOOLEAN
            -- Is cursor past last item?
            -- Was declared in HASH_TABLE as synonym of after.
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            definition: Result = ((not has_default and (iteration_position >= capacity)) or (has_default and (iteration_position = (capacity + 1))))

    prunable: BOOLEAN
            -- May items be removed? (Answer: yes.)
            -- (from HASH_TABLE)

    removed: BOOLEAN
            -- Did last operation remove an item?
            -- (from HASH_TABLE)

    replaced: BOOLEAN
            -- Did last operation replace an item?
            -- (from HASH_TABLE)

    valid_cursor (c: CURSOR): BOOLEAN
            -- Can cursor be moved to position c?
            -- (from HASH_TABLE)
        require -- from HASH_TABLE
            c_not_void: c /= void

    valid_key (k: INTEGER): BOOLEAN
            -- Is k a valid key?
            -- (Answer: always yes for hash tables in this version)
            -- (from HASH_TABLE)
        ensure then -- from HASH_TABLE
            Result

feature -- Status setting

    compare_objects
            -- Ensure that future search operations will use equal
            -- rather than = for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            object_comparison

    compare_references
            -- Ensure that future search operations will use =
            -- rather than equal for comparing references.
            -- (from CONTAINER)
        require -- from CONTAINER
            changeable_comparison_criterion
        ensure -- from CONTAINER
            reference_comparison: not object_comparison

feature -- Cursor movement

    forth
            -- Advance cursor to next occupied position,
            -- or off if no such position remains.
            -- (from HASH_TABLE)
        require -- from HASH_TABLE
            not_off: not off

    go_to (c: CURSOR)
            -- Move to position c.
            -- (from HASH_TABLE)
        require -- from HASH_TABLE
            c_not_void: c /= void
            valid_cursor: valid_cursor (c)

    search (key: INTEGER)
            -- Search for item of key key.
            -- If found, set found to true, and set
            -- found_item to item associated with key.
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            found_or_not_found: found or not_found
            item_if_found: found implies (found_item = content.item (position))

    start
            -- Bring cursor to first position.
            -- (from HASH_TABLE)

feature -- Element change

    extend (new: WEL_COMMAND_EXEC; key: INTEGER)
            -- Assuming there is no item of key key,
            -- insert new with key.
            -- Set inserted.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
            -- (from HASH_TABLE)
        require -- from HASH_TABLE
            not_present: not has (key)
        ensure -- from HASH_TABLE
            inserted: inserted
            insertion_done: item (key) = new
            one_more: count = old count + 1
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            default_property: has_default = ((key = computed_default_key) or (old has_default))

    fill (other: CONTAINER [WEL_COMMAND_EXEC])
            -- Fill with as many items of other as possible.
            -- The representations of other and current structure
            -- need not be the same.
            -- (from COLLECTION)
        require -- from COLLECTION
            other_not_void: other /= void
            extendible

    hash_table_force (new: WEL_COMMAND_EXEC; key: INTEGER)
            -- Update table so that new will be the item associated
            -- with key.
            -- If there was an item for that key, set found
            -- and set found_item to that item.
            -- If there was none, set not_found and set
            -- found_item to the default value.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
            -- (from HASH_TABLE)
        require else -- from HASH_TABLE
            True
        ensure then -- from HASH_TABLE
            insertion_done: item (key) = new
            now_present: has (key)
            found_or_not_found: found or not_found
            not_found_if_was_not_present: not_found = not (old has (key))
            same_count_or_one_more: (count = old count) or (count = old count + 1)
            same_slot_count_or_one_more_unless_reallocated: (used_slot_count = old used_slot_count) or (used_slot_count = old used_slot_count + 1) or (used_slot_count = count)
            found_item_is_old_item: found implies (found_item = old (item (key)))
            default_value_if_not_found: not_found implies (found_item = computed_default_value)
            default_property: has_default = ((key = computed_default_key) or ((key /= computed_default_key) and (old has_default)))

    put (new: WEL_COMMAND_EXEC; key: INTEGER)
            -- Insert new with key if there is no other item
            -- associated with the same key.
            -- Set inserted if and only if an insertion has
            -- been made (i.e. key was not present).
            -- If so, set position to the insertion position.
            -- If not, set conflict.
            -- In either case, set found_item to the item
            -- now associated with key (previous item if
            -- there was one, new otherwise).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
            -- (from HASH_TABLE)
        require -- from TABLE
            valid_key: valid_key (k)
        ensure then -- from HASH_TABLE
            conflict_or_inserted: conflict or inserted
            insertion_done: inserted implies item (key) = new
            now_present: inserted implies has (key)
            one_more_if_inserted: inserted implies (count = old count + 1)
            one_more_slot_if_inserted_unless_reallocated: inserted implies ((used_slot_count = old used_slot_count + 1) or (used_slot_count = count))
            unchanged_if_conflict: conflict implies (count = old count)
            same_item_if_conflict: conflict implies (item (key) = old (item (key)))
            slot_count_unchanged_if_conflict: conflict implies (used_slot_count = old used_slot_count)
            found_item_associated_with_key: found_item = item (key)
            new_item_if_inserted: inserted implies (found_item = new)
            old_item_if_conflict: conflict implies (found_item = old (item (key)))
            default_property: has_default = ((inserted and (key = computed_default_key)) or ((conflict or (key /= computed_default_key)) and (old has_default)))

    replace (new: WEL_COMMAND_EXEC; key: INTEGER)
            -- Replace item at key, if present,
            -- with new; do not change associated key.
            -- Set replaced if and only if a replacement has been made
            -- (i.e. key was present); otherwise set not_found.
            -- Set found_item to the item previously associated
            -- with key (default value if there was none).
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            replaced_or_not_found: replaced or not_found
            insertion_done: replaced implies item (key) = new
            no_change_if_not_found: not_found implies item (key) = old (item (key))
            found_item_is_old_item: found_item = old (item (key))

    replace_key (new_key: INTEGER; old_key: INTEGER)
            -- If there is an item of key old_key and no item of key
            -- new_key, replace the former's key by new_key,
            -- set replaced, and set found_item to the item
            -- previously associated with old_key.
            -- Otherwise set not_found or conflict respectively.
            -- If conflict, set found_item to the item previously
            -- associated with new_key.
            --
            -- To choose between various insert/replace procedures,
            -- see instructions in the Indexing clause.
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            same_count: count = old count
            same_slot_count: used_slot_count = old used_slot_count
            replaced_or_conflict_or_not_found: replaced or conflict or not_found
            old_absent: (replaced and not equal (new_key, old_key)) implies (not has (old_key))
            new_present: (replaced or conflict) = has (new_key)
            new_item: replaced implies (item (new_key) = old (item (old_key)))
            not_found_iff_no_old_key: not_found = old (not has (old_key))
            conflict_iff_already_present: conflict = old (has (new_key))
            not_inserted_if_conflict: conflict implies (item (new_key) = old (item (new_key)))
            default_property: has_default = ((new_key = computed_default_key) or ((new_key /= computed_default_key) and (old has_default)))

feature -- Removal

    clear_all
            -- Reset all items to default values; reset status.
            -- (from HASH_TABLE)
        require -- from COLLECTION
            prunable
        ensure -- from COLLECTION
            wiped_out: is_empty
        ensure then -- from HASH_TABLE
            position_equal_to_zero: position = 0
            count_equal_to_zero: count = 0
            used_slot_count_equal_to_zero: used_slot_count = 0
            has_default_set: not has_default
            no_status: not special_status

    hash_table_remove (key: INTEGER)
            -- Remove item associated with key, if present.
            -- Set removed if and only if an item has been
            -- removed (i.e. key was present);
            -- if so, set position to index of removed element.
            -- If not, set not_found.
            -- (from HASH_TABLE)
        ensure -- from HASH_TABLE
            removed_or_not_found: removed or not_found
            not_present: not has (key)
            one_less: found implies (count = old count - 1)
            same_slot_count: used_slot_count = old used_slot_count
            default_case: (key = computed_default_key) implies (not has_default)
            non_default_case: (key /= computed_default_key) implies (has_default = old has_default)

feature -- Conversion

    linear_representation: ARRAYED_LIST [WEL_COMMAND_EXEC]
            -- Representation as a linear structure
            -- (from HASH_TABLE)
        ensure then -- from HASH_TABLE
            result_exists: Result /= void
            good_count: Result.count = count

feature -- Duplication

    copy (other: like Current)
            -- Re-initialize from other.
            -- (from HASH_TABLE)
        require -- from ANY
            other_not_void: other /= void
            type_identity: same_type (other)
        ensure -- from ANY
            is_equal: is_equal (other)

feature -- Basic routines

    force (command: WEL_COMMAND_EXEC; message: INTEGER)
            -- Put command associated to message.
        require
            command_not_void: command /= void
            positive_message: message >= 0
        ensure
            exists: exists (message)

    remove (message: INTEGER)
            -- Remove the command associated to message.
        require
            positive_message: message >= 0
        ensure
            not_exists: not exists (message)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from HASH_TABLE
    keys_not_void: keys /= void
    content_not_void: content /= void
    keys_same_capacity_plus_one: keys.count = capacity + 1
    content_same_capacity_plus_one: content.count = capacity + 1
    deleted_same_capacity: deleted_marks.count = capacity
    keys_starts_at_zero: keys.lower = 0
    content_starts_at_zero: content.lower = 0
    deleted_starts_at_zero: deleted_marks.lower = 0
    valid_iteration_position: off or truly_occupied (iteration_position)
    control_non_negative: control >= 0
    special_status: special_status = (conflict or inserted or replaced or removed or found or not_found)
    max_occupation_meaningful: (max_occupation > 0) and (max_occupation < 100)
    initial_occupation_meaningful: (initial_occupation > 0) and (initial_occupation < 100)
    sized_generously_enough: initial_occupation < max_occupation
    count_big_enough: 0 <= count
    count_small_enough: count <= capacity
    breathing_space: count * 100 <= capacity * max_occupation
    count_no_more_than_slot_count: count <= used_slot_count
    slot_count_big_enough: 0 <= count
    slot_count_small_enough: used_slot_count <= capacity
    extra_space_non_negative: extra_space >= 0
        -- from FINITE
    empty_definition: is_empty = (count = 0)
    non_negative_count: count >= 0

end -- class WEL_COMMAND_MANAGER


WEL_CURSOR Chart

class
    WEL_CURSOR

General
    cluster: wel.support
    description: "Small picture whose location on the screen is controlled by a pointing device."
    create: make_by_file, make_by_id, make_by_bitmask, make_by_name, make_by_icon_info, make_by_predefined_id, make_by_pointer

Ancestors
    WEL_GRAPHICAL_RESOURCE
    WEL_SYSTEM_METRICS

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    get_icon_info: WEL_ICON_INFO
    item: POINTER
    object_id: INTEGER
    previous_cursor: WEL_CURSOR
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER
    x_hotspot: INTEGER
    y_hotspot: INTEGER

Commands
    decrement_reference
    delete
    delete_gdi_object
    dispose
    enable_reference_tracking
    increment_reference
    restore_previous
    set
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_CURSOR Flat contracts

indexing
    description: "Small picture whose location on the screen is controlled by a pointing device."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CURSOR

create

    make_by_id (id: INTEGER)
            -- Load the resource by an id
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_RESOURCE
            valid_id: id > 0
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_name (name: STRING)
            -- Load the resource by a name
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_RESOURCE
            name_not_void: name /= void
            name_not_empty: not name.is_empty
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_file (file_name: STRING)
            -- Load an icon file named file_name.
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_GRAPHICAL_RESOURCE
            file_name_not_void: file_name /= void

    make_by_bitmask (x_hot_spot, y_hot_spot: INTEGER; and_plane, xor_plane: ARRAY [CHARACTER])
            -- Make a cursor using bitmask arrays.
            -- and_plane and xor_plane points to an array of
            -- byte that contains the bit values for the AND and XOR
            -- bitmasks of the cursor, as in a device-dependent
            -- monochrome bitmap. x_hot_spot, and y_hot_spot
            -- specify the horizontal and vertical position of
            -- the cursor's hot spot.
        require
            x_hot_spot_large_enough: x_hot_spot >= 0
            x_hot_spot_small_enough: x_hot_spot < cursor_width
            y_hot_spot_large_enough: y_hot_spot >= 0
            y_hot_spot_small_enough: y_hot_spot < cursor_height
            and_plane_not_void: and_plane /= void
            xor_plane_not_void: xor_plane /= void
            and_plane_not_empty: not and_plane.is_empty
            xor_plane_not_empty: not xor_plane.is_empty

    make_by_predefined_id (id: POINTER)
            -- Load the resource by an id, predefined by Windows
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_RESOURCE
            shared: shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_by_icon_info (icon_info: WEL_ICON_INFO)
            -- Create an icon from an icon_info structure
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GRAPHICAL_RESOURCE
            item_not_void: item /= void

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    get_icon_info: WEL_ICON_INFO
            -- Retrieve information about a icon/cusor
            --
            -- Return Void if an error occurred while retrieving
            -- the information.
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GRAPHICAL_RESOURCE
            result_void_or_valid: Result = void or else Result.is_initialized

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    previous_cursor: WEL_CURSOR
            -- Previously assigned cursor

    x_hotspot: INTEGER
            -- X-coordinate of Currents hot spot.

    y_hotspot: INTEGER
            -- Y-coordinate of a Currents hot spot.

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    delete_gdi_object
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GDI_ANY
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    restore_previous
            -- Restore previous_cursor.
        require
            previous_cursor_not_void: previous_cursor /= void
        ensure
            previous_cursor_void: previous_cursor = void

    set
            -- Set current cursor for entire application and
            -- save old one in previous_cursor if there was
            -- one.
        require
            exists: exists

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CURSOR


WEL_DISK_SPACE Chart

class
    WEL_DISK_SPACE

General
    cluster: wel.support
    description: "Object used to retrieve total and free disk space on anylocal hard drive. Remote drive are not yet supported"
    create: default_create

Ancestors
    ANY

Queries
    last_free_space: INTEGER
    last_free_space_in_bytes: INTEGER
    last_free_space_in_string: STRING
    last_query_success: BOOLEAN
    last_total_space: INTEGER
    last_total_space_in_bytes: INTEGER
    last_total_space_in_string: STRING

Commands
    query_local_drive (drive_letter: CHARACTER)


WEL_DISK_SPACE Flat contracts

indexing
    description: "Object used to retrieve total and free disk space on anylocal hard drive. Remote drive are not yet supported"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DISK_SPACE

create

feature -- Access

    last_free_space: INTEGER
            -- Free space available on the last requested drive via the
            -- query query_disk_space. This value is updated by
            -- the feature query_disk_space.
            --
            -- THIS FEATURE RETURNS THE RESULT IN MEGABYTES
            -- Use last_free_space_in_bytes to get an accurate result
            -- in bytes.
        require
            last_query_successful: last_query_success = True

    last_free_space_in_bytes: INTEGER
            -- Free space available on the last requested drive via the
            -- query query_disk_space. This value is updated by
            -- the feature query_disk_space.
            --
            -- This value is only valid if the free disk space
            -- is less than 2 Gb. Otherwise, it cannot be represented
            -- by an INTEGER which is a signed 32 bits value.
        require
            result_meaningfull: last_free_space < 2047
            last_query_successful: last_query_success = True

    last_free_space_in_string: STRING
            -- Compute the string representing the value of the free space
            -- as computed on the last call to query_disk_space.
            -- Example of possible returned strings: "600 Mb", "30.1 Mb", "1.33 Mb",
            -- "320 Kb", "52.7 Kb", "75 bytes", "30 Tb", ...
        require
            last_query_successful: last_query_success = True

    last_query_success: BOOLEAN
            -- Was the last call to query_disk_space successful?

    last_total_space: INTEGER
            -- Total space available on the last requested drive via the
            -- query query_disk_space. This value is updated by
            -- the feature query_disk_space.
            --
            -- THIS FEATURE RETURNS THE RESULT IN MEGABYTES
            -- Use last_total_space_in_bytes to get an accurate result
            -- in bytes.
        require
            last_query_successful: last_query_success = True

    last_total_space_in_bytes: INTEGER
            -- Total space available on the last requested drive via the
            -- query query_disk_space. This value is updated by
            -- the feature query_disk_space.
            --
            -- This value is only valid if the free disk space
            -- is less than 2 Gb. Otherwise, it cannot be represented
            -- by an INTEGER which is a signed 32 bits value.
        require
            result_meaningfull: last_total_space < 2047
            last_query_successful: last_query_success = True

    last_total_space_in_string: STRING
            -- Compute the string representing the value of the total space
            -- as computed on the last call to query_disk_space.
            -- Example of possible returned strings: "600 Mb", "30.1 Mb", "1.33 Mb",
            -- "320 Kb", "52.7 Kb", "75 bytes", "30 Tb", ...
        require
            last_query_successful: last_query_success = True

feature -- Status report

    query_local_drive (drive_letter: CHARACTER)
            -- Query the disk space available on the local drice
            -- designated by the letter drive_letter.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DISK_SPACE


WEL_DISPATCHER Chart

class
    WEL_DISPATCHER

General
    cluster: wel.support
    description: "Receives and dispatch the Windows messages to the Eiffel objects."
    create: make

Ancestors
    MEMORY
    WEL_EN_CONSTANTS
    WEL_WINDOW_MANAGER
    WEL_WM_CONSTANTS

Queries
    En_change: INTEGER
    En_errspace: INTEGER
    En_hscroll: INTEGER
    En_killfocus: INTEGER
    En_maxtext: INTEGER
    En_msgfilter: INTEGER
    En_setfocus: INTEGER
    En_update: INTEGER
    En_vscroll: INTEGER


WEL_DISPATCHER Flat contracts

indexing
    description: "Receives and dispatch the Windows messages to the Eiffel objects."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DISPATCHER

create

    make
            -- Initialize the C variables

feature -- Access

    En_change: INTEGER is 768
            -- (from WEL_EN_CONSTANTS)

    En_errspace: INTEGER is 1280
            -- (from WEL_EN_CONSTANTS)

    En_hscroll: INTEGER is 1537
            -- (from WEL_EN_CONSTANTS)

    En_killfocus: INTEGER is 512
            -- (from WEL_EN_CONSTANTS)

    En_maxtext: INTEGER is 1281
            -- (from WEL_EN_CONSTANTS)

    En_msgfilter: INTEGER is 1792
            -- (from WEL_EN_CONSTANTS)

    En_setfocus: INTEGER is 256
            -- (from WEL_EN_CONSTANTS)

    En_update: INTEGER is 1024
            -- (from WEL_EN_CONSTANTS)

    En_vscroll: INTEGER is 1538
            -- (from WEL_EN_CONSTANTS)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DISPATCHER


WEL_DLL Chart

class
    WEL_DLL

General
    cluster: wel.support
    description: "Dynamic-link library containing one or more functions that are compiled, linked, and stored separately from the processes using them."
    create: make

Ancestors
    WEL_ANY

Queries
    exists: BOOLEAN
    item: POINTER
    name: STRING
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_DLL Flat contracts

indexing
    description: "Dynamic-link library containing one or more functions that are compiled, linked, and stored separately from the processes using them."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DLL

create

    make (dll_name: STRING)
            -- Load the DLL dll_name
        require
            dll_name_not_void: dll_name /= void
            dll_name_not_empty: not dll_name.is_empty

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    name: STRING
            -- DLL name (including the path)
        require
            exists: exists
        ensure
            result_not_void: Result /= void
            result_not_empty: not Result.is_empty

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DLL


WEL_DOUBLE_CLICK Chart

class
    WEL_DOUBLE_CLICK

General
    cluster: wel.support
    description: "Set and get the double-click time for the mouse."

Ancestors
    ANY

Queries
    double_click_time: INTEGER

Commands
    set_double_click_time (time: INTEGER)


WEL_DOUBLE_CLICK Flat contracts

indexing
    description: "Set and get the double-click time for the mouse."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_DOUBLE_CLICK

feature -- Status report

    double_click_time: INTEGER
            -- Current double-click time for the mouse (in milliseconds)
        ensure
            positive_result: Result > 0

feature -- Status setting

    set_double_click_time (time: INTEGER)
            -- Set double_click_time with time (in milliseconds).
        require
            positive_time: time > 0
        ensure
            double_click_time_set: double_click_time = time

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DOUBLE_CLICK


WEL_ERROR Chart

class
    WEL_ERROR

General
    cluster: wel.support
    description: "Analyzes Windows errors."

Ancestors
    ANY

Queries
    last_error_code: INTEGER

Commands
    display_last_error


WEL_ERROR Flat contracts

indexing
    description: "Analyzes Windows errors."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ERROR

feature -- Status

    display_last_error
            -- Display string corresponding to last
            -- error in a message dialog box.

    last_error_code: INTEGER
            -- Integer code corresponding to last error.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ERROR


WEL_FONT_FAMILY_ENUMERATOR Chart

deferred class
    WEL_FONT_FAMILY_ENUMERATOR

General
    cluster: wel.support
    description: "Font family enumerator. The user must inherit from this class and define the routine `action'."

Ancestors
    MEMORY
    WEL_FONT_TYPE_ENUM_CONSTANTS

Queries
    C_memory: INTEGER
    chunk_size: INTEGER
    coalesce_period: INTEGER
    collecting: BOOLEAN
    collection_period: INTEGER
    Eiffel_memory: INTEGER
    Full_collector: INTEGER
    gc_statistics (collector_type: INTEGER): GC_INFO
    generation_object_limit: INTEGER
    Incremental_collector: INTEGER
    is_in_final_collect: BOOLEAN
    largest_coalesced_block: INTEGER
    max_mem: INTEGER
    memory_statistics (memory_type: INTEGER): MEM_INFO
    memory_threshold: INTEGER
    referers (an_object: ANY): ARRAY [ANY]
    scavenge_zone_size: INTEGER
    tenure: INTEGER
    Total_memory: INTEGER

Commands
    action (elf: WEL_ENUM_LOG_FONT; tm: WEL_TEXT_METRIC; font_type: INTEGER)
    allocate_compact
    allocate_fast
    allocate_tiny
    collect
    collection_off
    collection_on
    disable_time_accounting
    enable_time_accounting
    finish_action
    free (object: ANY)
    full_coalesce
    full_collect
    init_action
    mem_free (addr: POINTER)
    set_coalesce_period (value: INTEGER)
    set_collection_period (value: INTEGER)
    set_max_mem (value: INTEGER)
    set_memory_threshold (value: INTEGER)


WEL_FONT_FAMILY_ENUMERATOR Flat contracts

indexing
    description: "Font family enumerator. The user must inherit from this class and define the routine `action'."
    note: "Do not use more than one instance of this class at the same time. Nested enumerations are not supported."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_FONT_FAMILY_ENUMERATOR

feature -- Access

    C_memory: INTEGER is 2
            -- Code for the C memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Eiffel_memory: INTEGER is 1
            -- Code for the Eiffel memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

    Full_collector: INTEGER is 0
            -- Statistics for full collections
            -- (from MEM_CONST)

    Incremental_collector: INTEGER is 1
            -- Statistics for incremental collections
            -- (from MEM_CONST)

    Total_memory: INTEGER is 0
            -- Code for all the memory managed
            -- by the garbage collector
            -- (from MEM_CONST)

feature -- Measurement

    gc_statistics (collector_type: INTEGER): GC_INFO
            -- Garbage collection information for collector_type.
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: collector_type = full_collector or collector_type = incremental_collector

    memory_statistics (memory_type: INTEGER): MEM_INFO
            -- Memory usage information for memory_type
            -- (from MEMORY)
        require -- from MEMORY
            type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

    chunk_size: INTEGER
            -- Minimal size of a memory chunk. The run-time always
            -- allocates a multiple of this size.
            -- If the environment variable EIF_MEMORY_CHUNK
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    coalesce_period: INTEGER
            -- Period of full coalesce (in number of collections)
            -- If the environment variable EIF_FULL_COALESCE_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full coalescing is launched.
            -- (from MEMORY)

    collecting: BOOLEAN
            -- Is garbage collection enabled?
            -- (from MEMORY)

    collection_period: INTEGER
            -- Period of full collection.
            -- If the environment variable EIF_FULL_COLLECTION_PERIOD
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- If null, no full collection is launched.
            -- (from MEMORY)

    generation_object_limit: INTEGER
            -- Maximum size of object in generational scavenge zone.
            -- If the environment variable EIF_GS_LIMIT
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    is_in_final_collect: BOOLEAN
            -- Is GC currently performing final collection
            -- after execution of current program?
            -- Safe to use in dispose.
            -- (from MEMORY)

    largest_coalesced_block: INTEGER
            -- Size of largest coalesced block since last call to
            -- largest_coalesced; 0 if none.
            -- (from MEMORY)

    max_mem: INTEGER
            -- Maximum amount of bytes the run-time can allocate.
            -- (from MEMORY)

    memory_threshold: INTEGER
            -- Minimum amount of bytes to be allocated before
            -- starting an automatic garbage collection.
            -- (from MEMORY)

    referers (an_object: ANY): ARRAY [ANY]
            -- Objects that refer to an_object.
            -- (from MEMORY)

    scavenge_zone_size: INTEGER
            -- Size of generational scavenge zone.
            -- If the environment variable EIF_MEMORY_SCAVENGE
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

    tenure: INTEGER
            -- Maximum age of object before being considered
            -- as old (old objects are not scanned during
            -- partial collection).
            -- If the environment variable EIF_TENURE_MAX
            -- is defined, it is set to the closest reasonable
            -- value from it.
            -- (from MEMORY)

feature -- Status setting

    allocate_compact
            -- Enter `memory' mode: will try to compact memory
            -- before requesting more from the operating system.
            -- (from MEMORY)

    allocate_fast
            -- Enter `speed' mode: will optimize speed of memory
            -- allocation rather than memory usage.
            -- (from MEMORY)

    allocate_tiny
            -- Enter `tiny' mode: will enter `memory' mode
            -- after having freed as much memory as possible.
            -- (from MEMORY)

    collection_off
            -- Disable garbage collection.
            -- (from MEMORY)

    collection_on
            -- Enable garbage collection.
            -- (from MEMORY)

    disable_time_accounting
            -- Disable GC time accounting (default).
            -- (from MEMORY)

    enable_time_accounting
            -- Enable GC time accouting, accessible in gc_statistics.
            -- (from MEMORY)

    set_coalesce_period (value: INTEGER)
            -- Set coalesce_period. Every value collection,
            -- the Garbage Collector will coalesce
            -- the whole memory.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_collection_period (value: INTEGER)
            -- Set collection_period. Every value collection,
            -- the Garbage collector will perform a collection
            -- on the whole memory (full collection), otherwise
            -- a simple partial collection is done.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value >= 0

    set_max_mem (value: INTEGER)
            -- Set the maximum amount of memory the run-time can allocate.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

    set_memory_threshold (value: INTEGER)
            -- Set a new memory_threshold in bytes. Whenever the memory
            -- allocated for Eiffel reaches this value, an automatic
            -- collection is performed.
            -- (from MEMORY)
        require -- from MEMORY
            positive_value: value > 0

feature -- Removal

    collect
            -- Force a partial collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    free (object: ANY)
            -- Free object, by-passing garbage collection.
            -- Erratic behavior will result if the object is still
            -- referenced.
            -- (from MEMORY)

    full_coalesce
            -- Coalesce the whole memory: merge adjacent free
            -- blocks to reduce fragmentation. Useful, when
            -- a lot of memory is allocated with garbage collector off.
            -- (from MEMORY)

    full_collect
            -- Force a full collection cycle if garbage
            -- collection is enabled; do nothing otherwise.
            -- (from MEMORY)

    mem_free (addr: POINTER)
            -- Free memory of object at addr.
            -- (Preferred interface is free.)
            -- (from MEMORY)

feature -- Basic operations

    action (elf: WEL_ENUM_LOG_FONT; tm: WEL_TEXT_METRIC; font_type: INTEGER)
            -- Called for each font found.
            -- elf, tm and font_type contain informations
            -- about the font.
            -- See class WEL_FONT_TYPE_ENUM_CONSTANTS for
            -- font_type values.
        require
            elf_not_void: elf /= void
            tm_not_void: tm /= void

    finish_action
            -- Called after the enumeration.
            -- May be redefined to make special operations.

    init_action
            -- Called before the enumeration.
            -- May be redefined to make special operations.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FONT_FAMILY_ENUMERATOR


WEL_GRAPHICAL_RESOURCE Chart

deferred class
    WEL_GRAPHICAL_RESOURCE

General
    cluster: wel.support
    description: "Graphical resource common features (Icons & Cursors)"

Ancestors
    WEL_GDI_ANY
    WEL_IMAGE_CONSTANTS
    WEL_RESOURCE

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    get_icon_info: WEL_ICON_INFO
    item: POINTER
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    delete_gdi_object
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_GRAPHICAL_RESOURCE Flat contracts

indexing
    description: "Graphical resource common features (Icons & Cursors)"
    date: "$Date: 2001/11/12 17:58:29 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_GRAPHICAL_RESOURCE

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    get_icon_info: WEL_ICON_INFO
            -- Retrieve information about a icon/cusor
            --
            -- Return Void if an error occurred while retrieving
            -- the information.
        ensure
            result_void_or_valid: Result = void or else Result.is_initialized

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Delete the current gdi object
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    delete_gdi_object
            -- Delete the current gdi object
        ensure -- from WEL_GDI_ANY
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_GRAPHICAL_RESOURCE


WEL_ICON Chart

class
    WEL_ICON

General
    cluster: wel.support
    description: "Picture that consists of a bitmapped image."
    create: make_by_file, make_by_id, make_by_name, make_by_icon_info, make_by_predefined_id, make_by_pointer

Ancestors
    WEL_GRAPHICAL_RESOURCE

Queries
    exists: BOOLEAN
    gdi_objects_count: INTEGER
    get_icon_info: WEL_ICON_INFO
    item: POINTER
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    delete_gdi_object
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_ICON Flat contracts

indexing
    description: "Picture that consists of a bitmapped image."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:30 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ICON

create

    make_by_id (id: INTEGER)
            -- Load the resource by an id
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_RESOURCE
            valid_id: id > 0
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_name (name: STRING)
            -- Load the resource by a name
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_RESOURCE
            name_not_void: name /= void
            name_not_empty: not name.is_empty
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_predefined_id (id: POINTER)
            -- Load the resource by an id, predefined by Windows
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_RESOURCE
            shared: shared

    make_by_file (file_name: STRING)
            -- Load an icon file named file_name.
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_GRAPHICAL_RESOURCE
            file_name_not_void: file_name /= void

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_GDI_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_by_icon_info (icon_info: WEL_ICON_INFO)
            -- Create an icon from an icon_info structure
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GRAPHICAL_RESOURCE
            item_not_void: item /= void

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    get_icon_info: WEL_ICON_INFO
            -- Retrieve information about a icon/cusor
            --
            -- Return Void if an error occurred while retrieving
            -- the information.
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GRAPHICAL_RESOURCE
            result_void_or_valid: Result = void or else Result.is_initialized

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    delete_gdi_object
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GDI_ANY
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ICON


WEL_ICON_INFO Chart

class
    WEL_ICON_INFO

General
    cluster: wel.support
    description: "Information about an icon or a cursor."
    create: make

Ancestors
    WEL_OBJECT_ID_MANAGER
    WEL_STRUCTURE

Queries
    color_bitmap: WEL_BITMAP
    exists: BOOLEAN
    has_color_bitmap: BOOLEAN
    is_icon: BOOLEAN
    is_initialized: BOOLEAN
    item: POINTER
    mask_bitmap: WEL_BITMAP
    shared: BOOLEAN
    Structure_size: INTEGER
    to_integer: INTEGER
    x_hotspot: INTEGER
    y_hotspot: INTEGER

Commands
    delete
    dispose
    enable_reference_tracking_on_bitmaps
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_color_bitmap (a_color_bitmap: WEL_BITMAP)
    set_is_icon (a_is_icon: BOOLEAN)
    set_item (an_item: POINTER)
    set_mask_bitmap (a_mask_bitmap: WEL_BITMAP)
    set_shared
    set_unshared
    set_x_hotspot (xvalue: INTEGER)
    set_y_hotspot (yvalue: INTEGER)


WEL_ICON_INFO Flat contracts

indexing
    description: "Information about an icon or a cursor."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:30 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_ICON_INFO

create

    make
            -- Allocate item
            -- (from WEL_STRUCTURE)
        ensure -- from WEL_STRUCTURE
            not_shared: not shared

feature -- Access

    color_bitmap: WEL_BITMAP
            -- bitmap representing the image (as opposed to the mask)
            --
            -- Handle to the icon color bitmap. This member can be optional if
            -- this structure defines a black and white icon. The AND bitmask of
            -- hbmMask is applied with the SRCAND flag to the destination;
            -- subsequently, the color bitmap is applied (using XOR) to the
            -- destination by using the SRCINVERT flag.
        require
            initialized: is_initialized
            has_color_bitmap: has_color_bitmap
        ensure
            result_not_void: Result /= void
            result_exists: Result.exists

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    mask_bitmap: WEL_BITMAP
            -- bitmap representing the mask.
            --
            -- Specifies the icon bitmask bitmap. If this structure defines a black
            -- and white icon, this bitmask is formatted so that the upper half is
            -- the icon AND bitmask and the lower half is the icon XOR bitmask.
            -- Under this condition, the height should be an even multiple of two.
            -- If this structure defines a color icon, this mask only defines the
            -- AND bitmask of the icon.
        require
            initialized: is_initialized
        ensure
            result_not_void: Result /= void
            result_exists: Result.exists

feature --  Measurement

    structure_size: INTEGER
            -- Size to allocate (in bytes)
        ensure -- from WEL_STRUCTURE
            positive_result: Result > 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Free allocated C memory and GDI objects.
        require
            not_shared: not shared

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

feature -- Status Report

    has_color_bitmap: BOOLEAN
            -- Is color_bitmap valid?
            --
            -- In the case of a black & white icon/cursor, mask_bitmap is
            -- formatted so that the upper half is the icon AND bitmask and
            -- the lower half is the icon XOR bitmask. In this case,
            -- color_bitmap is not defined.

    is_icon: BOOLEAN
            -- Specifies whether this structure defines and icon or a cursor.
            -- True specifies an icon; False specifies a cursor.

    is_initialized: BOOLEAN
            -- Is the structure initialized (i.e. filled)?

    x_hotspot: INTEGER
            -- Specifies the x-coordinate of a cursor's hotspot.
            -- If this structure defines an icon, the hot spot is
            -- always in the center of the icon, and this member is ignored.

    y_hotspot: INTEGER
            -- Specifies the y-coordinate of a cursor's hotspot.
            -- If this structure defines an icon, the hot spot is
            -- always in the center of the icon, and this member is ignored.

feature -- Status Setting

    enable_reference_tracking_on_bitmaps
            -- Enable the tracking of references on mask_bitmap and
            -- color_bitmap.
            --
            -- When Current will be disposed, the reference number of
            -- mask_bitmap and color_bitmap will be decreased.
        require
            initialized: is_initialized

    set_color_bitmap (a_color_bitmap: WEL_BITMAP)
            -- Assign a_color_bitmap to hbmColor

    set_is_icon (a_is_icon: BOOLEAN)
            -- Assign a_is_icon to fIcon.

    set_mask_bitmap (a_mask_bitmap: WEL_BITMAP)
            -- Assign a_mask_bitmap to hbmMask

    set_x_hotspot (xvalue: INTEGER)
            -- Assign xvalue to xHotspot.

    set_y_hotspot (yvalue: INTEGER)
            -- Assign yvalue to yHotspot.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_ICON_INFO


WEL_INIT_COMMCTRL_EX Chart

class
    WEL_INIT_COMMCTRL_EX

General
    cluster: wel.support
    description: "Contains information about the initialization of the common controls dll. Note: Require Windows98 or Windows95+IE4 or WindowsNT4+IE4 or Windows2000"
    create: make_by_pointer, make_with_flags, make

Ancestors
    WEL_ICC_CONSTANTS
    WEL_STRUCTURE

Queries
    dwicc: INTEGER
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    initialize
    initialize_with_character (a_character: CHARACTER)
    memory_copy (source_pointer: POINTER; length: INTEGER)
    set_dwicc (value: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_INIT_COMMCTRL_EX Flat contracts

indexing
    description: "Contains information about the initialization of the common controls dll. Note: Require Windows98 or Windows95+IE4 or WindowsNT4+IE4 or Windows2000"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:30 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_INIT_COMMCTRL_EX

create

    make
            -- Initialize the Win32 dlls only.

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_with_flags (flags: INTEGER)
            -- initialize the given dll.

feature -- Access

    dwicc: INTEGER
            -- Set of bit flags that indicate which common control
            -- classes will be loaded from the DLL.
            -- This value can be a combination of WEL_ICC_CONSTANTS.

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_dwicc (value: INTEGER)
            -- Set dwicc with value.
        ensure
            dwicc_set: dwicc = value

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    initialize
            -- Fill Current with zeros.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    initialize_with_character (a_character: CHARACTER)
            -- Fill current with a_character.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            exists: exists

    memory_copy (source_pointer: POINTER; length: INTEGER)
            -- Copy length bytes from source_pointer to item.
            -- (from WEL_STRUCTURE)
        require -- from WEL_STRUCTURE
            length_small_enough: length <= structure_size
            length_large_enough: length > 0
            exists: exists

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_INIT_COMMCTRL_EX


WEL_INPUT_EVENT Chart

class
    WEL_INPUT_EVENT

General
    cluster: wel.support
    description: "Objects to synthesize keystrokes, mouse motions and button clicks."

Ancestors
    WEL_INPUT_CONSTANTS

Commands
    send_keyboard_key_down (virtual_key_code: INTEGER)
    send_keyboard_key_up (virtual_key_code: INTEGER)
    send_mouse_absolute_move (a_x, a_y: INTEGER)
    send_mouse_left_button_down
    send_mouse_left_button_up
    send_mouse_middle_button_down
    send_mouse_middle_button_up
    send_mouse_relative_move (a_x, a_y: INTEGER)
    send_mouse_right_button_down
    send_mouse_right_button_up


WEL_INPUT_EVENT Flat contracts

indexing
    description: "Objects to synthesize keystrokes, mouse motions and button clicks."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:30 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_INPUT_EVENT

feature -- Keyboard events

    send_keyboard_key_down (virtual_key_code: INTEGER)
            -- The keybd_event function synthesizes a keystroke. The system
            -- can use such a synthesized keystroke to generate a
            -- WM_KEYDOWN message.
            --
            -- An application can simulate a press of the PRINTSCRN key in
            -- order to obtain a screen snapshot and save it to the
            -- clipboard.
            -- To do this, call `send_keyboard_key_down(Vk_snapshot)'.
            --
            -- Windows NT: The send_keyboard_key_down can toggle the
            -- NUM LOCK, CAPS LOCK, and SCROLL LOCK keys.
            --
            -- Windows 95: The send_keyboard_key_down function can toggle
            -- only the CAPS LOCK and SCROLL LOCK keys. It cannot toggle
            -- the NUM LOCK key.

    send_keyboard_key_up (virtual_key_code: INTEGER)
            -- The keybd_event function synthesizes a keystroke. The system
            -- can use such a synthesized keystroke to generate a
            -- WM_KEYUP message.
            --
            -- Windows NT: The send_keyboard_key_down can toggle the
            -- NUM LOCK, CAPS LOCK, and SCROLL LOCK keys.
            --
            -- Windows 95: The send_keyboard_key_down function can toggle
            -- only the CAPS LOCK and SCROLL LOCK keys. It cannot toggle
            -- the NUM LOCK key.

feature -- Mouse events

    send_mouse_absolute_move (a_x, a_y: INTEGER)
            -- Synthesize a fake mouse move to absolute
            -- screen position a_x, a_y.
            --
            -- a_x and a_y contain normalized absolute coordinates
            -- between 0 and 65,535. The event procedure maps these
            -- coordinates onto the display surface. Coordinate (0,0)
            -- maps onto the upper-left corner of the display surface,
            -- (65535,65535) maps onto the lower-right corner.
            --
            -- To determine the size of the screen use
            -- {WEL_SYSTEM_METRICS}.screen_width and
            -- {WEL_SYSTEM_METRICS}.screen_height.

    send_mouse_left_button_down
            -- Synthesize a fake press on the left button of the
            -- mouse.

    send_mouse_left_button_up
            -- Synthesize a fake press on the left button of the
            -- mouse.

    send_mouse_middle_button_down
            -- Synthesize a fake press on the middle button of the
            -- mouse.

    send_mouse_middle_button_up
            -- Synthesize a fake press on the middle button of the
            -- mouse.

    send_mouse_relative_move (a_x, a_y: INTEGER)
            -- Synthesize a fake mouse move.
            -- a_x and a_y are the number of mickeys moved.
            --
            -- A mickey is the amount that a mouse has to move
            -- for it to report that it has moved.

    send_mouse_right_button_down
            -- Synthesize a fake press on the right button of the
            -- mouse.

    send_mouse_right_button_up
            -- Synthesize a fake press on the right button of the
            -- mouse.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_INPUT_EVENT


WEL_INSTANCE Chart

class
    WEL_INSTANCE

General
    cluster: wel.support
    description: "Instance of an application."
    create: make

Ancestors
    WEL_ANY

Queries
    exists: BOOLEAN
    item: POINTER
    name: STRING
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_INSTANCE Flat contracts

indexing
    description: "Instance of an application."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:30 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_INSTANCE

create

    make (a_hinstance: POINTER)
            -- Make an instance identified by a_hinstance.
        ensure
            item_set: item = a_hinstance

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    name: STRING
            -- Module name
        ensure
            result_not_void: Result /= void
            result_not_empty: not Result.is_empty

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_INSTANCE


WEL_MAIN_ARGUMENTS Chart

class
    WEL_MAIN_ARGUMENTS

General
    cluster: wel.support
    description: "Main arguments received in the WinMain Windows function."

Ancestors
    ANY

Queries
    Command_line: STRING
    Command_show: INTEGER
    Current_instance: WEL_INSTANCE
    Previous_instance: WEL_INSTANCE


WEL_MAIN_ARGUMENTS Flat contracts

indexing
    description: "Main arguments received in the WinMain Windows function."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:30 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MAIN_ARGUMENTS

feature -- Access

    command_line: STRING
            -- Command line argument received in WinMain
        ensure
            result_not_void: Result /= void

    command_show: INTEGER
            -- Command show argument received in WinMain

    current_instance: WEL_INSTANCE
            -- Current instance argument received in WinMain
        ensure
            result_not_void: Result /= void

    previous_instance: WEL_INSTANCE
            -- Previous instance argument received in WinMain
        ensure
            result_not_void: Result /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MAIN_ARGUMENTS


WEL_MENU Chart

class
    WEL_MENU

General
    cluster: wel.support
    description: "List of items which can be selected by the user."
    create: make_by_id, make_track, make, make_by_name, make_by_pointer

Ancestors
    WEL_BIT_OPERATIONS
    WEL_MF_CONSTANTS
    WEL_RESOURCE
    WEL_TPM_CONSTANTS

Queries
    count: INTEGER
    exists: BOOLEAN
    id_string (an_id: INTEGER): STRING
    item: POINTER
    item_checked (an_id: INTEGER): BOOLEAN
    item_enabled (an_id: INTEGER): BOOLEAN
    item_exists (an_id: INTEGER): BOOLEAN
    popup_exists (position: INTEGER): BOOLEAN
    popup_menu (position: INTEGER): WEL_MENU
    position_enabled (position: INTEGER): BOOLEAN
    position_to_item_id (position: INTEGER): INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    append_bitmap (bitmap: WEL_BITMAP; an_id: INTEGER)
    append_popup (a_menu: WEL_MENU; a_title: STRING)
    append_separator
    append_string (a_string: STRING; an_id: INTEGER)
    append_string_with_break (a_string: STRING; an_id: INTEGER; has_separator: BOOLEAN)
    check_item (an_id: INTEGER)
    delete_item (an_id: INTEGER)
    delete_position (position: INTEGER)
    disable_item (an_id: INTEGER)
    disable_position (position: INTEGER)
    dispose
    enable_item (an_id: INTEGER)
    enable_position (position: INTEGER)
    hilite_menu_item (window: WEL_COMPOSITE_WINDOW; an_id: INTEGER)
    insert_bitmap (bitmap: WEL_BITMAP; a_position, an_id: INTEGER)
    insert_popup (a_menu: WEL_MENU; a_position: INTEGER; a_title: STRING)
    insert_separator (a_position: INTEGER)
    insert_string (a_string: STRING; a_position, an_id: INTEGER)
    modify_string (a_string: STRING; an_id: INTEGER)
    remove_position (position: INTEGER)
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    show_track (x, y: INTEGER; window: WEL_COMPOSITE_WINDOW)
    show_track_with_option (x, y: INTEGER; window: WEL_COMPOSITE_WINDOW; option: INTEGER; rect: WEL_RECT)
    uncheck_item (an_id: INTEGER)
    unhilite_menu_item (window: WEL_COMPOSITE_WINDOW; an_id: INTEGER)


WEL_MENU Flat contracts

indexing
    description: "List of items which can be selected by the user."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:30 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MENU

create

    make
            -- Make an empty menu

    make_by_id (id: INTEGER)
            -- Load the resource by an id
            -- (from WEL_RESOURCE)
        require -- from WEL_RESOURCE
            valid_id: id > 0
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_name (name: STRING)
            -- Load the resource by a name
            -- (from WEL_RESOURCE)
        require -- from WEL_RESOURCE
            name_not_void: name /= void
            name_not_empty: not name.is_empty
        ensure -- from WEL_RESOURCE
            not_shared: not shared

    make_by_pointer (a_pointer: POINTER)
            -- Set item with a_pointer.
            -- Since item is shared, it does not need
            -- to be freed.
            -- Caution: a_pointer must be a pointer
            -- coming from Windows.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = a_pointer
            shared: shared

    make_track
            -- Make an empty track popup menu

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    popup_menu (position: INTEGER): WEL_MENU
            -- Popup menu at the zero-based relative position
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position < count
            popup_exists: popup_exists (position)
        ensure
            result_not_void: Result /= void

feature -- Measurement

    count: INTEGER
            -- Number of items
        require
            exists: exists
        ensure
            positive_result: Result >= 0

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    id_string (an_id: INTEGER): STRING
            -- String associated with an_id
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)
        ensure
            result_not_void: Result /= void

    item_checked (an_id: INTEGER): BOOLEAN
            -- Is the item idenfied by an_id checked?
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)

    item_enabled (an_id: INTEGER): BOOLEAN
            -- Is the item idenfied by an_id enabled?
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)

    item_exists (an_id: INTEGER): BOOLEAN
            -- Does an_id exist in the menu?
        require
            exists: exists
            positive_id: an_id > 0

    popup_exists (position: INTEGER): BOOLEAN
            -- Does a popup menu exists at the zero-based position?
        require
            exists: exists
            positive_position: position >= 0

    position_enabled (position: INTEGER): BOOLEAN
            -- Is the item at zero-based position enabled?
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position < count

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    check_item (an_id: INTEGER)
            -- Put a check mark for the item identified by an_id.
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)
        ensure
            item_checked: item_checked (an_id)

    disable_item (an_id: INTEGER)
            -- Disable the item identified by an_id.
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)
        ensure
            item_disabled: not item_enabled (an_id)

    disable_position (position: INTEGER)
            -- Disable the item at zero-based position.
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position < count
        ensure
            position_disabled: not position_enabled (position)

    enable_item (an_id: INTEGER)
            -- Enable the item idenfied by an_id.
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)
        ensure
            item_enabled: item_enabled (an_id)

    enable_position (position: INTEGER)
            -- Enable the item at zero-based position.
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position < count
        ensure
            position_enabled: position_enabled (position)

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    uncheck_item (an_id: INTEGER)
            -- Remove the check mark for the item identified
            -- by an_id.
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)
        ensure
            item_unchecked: not item_checked (an_id)

feature -- Element change

    append_bitmap (bitmap: WEL_BITMAP; an_id: INTEGER)
            -- Append bitmap with the identifier an_id to the
            -- menu.
        require
            exists: exists
            bitmap_not_void: bitmap /= void
            bitmap_exists: bitmap.exists
            positive_id: an_id > 0
            item_not_exists: not item_exists (an_id)
        ensure
            new_count: count = old count + 1
            item_exists: item_exists (an_id)

    append_popup (a_menu: WEL_MENU; a_title: STRING)
            -- Append a popup menu a_menu with a_title to the
            -- current menu.
        require
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
            a_title_not_void: a_title /= void
        ensure
            new_count: count = old count + 1

    append_separator
            -- Append a separator to the current menu.
        require
            exists: exists
        ensure
            new_count: count = old count + 1

    append_string (a_string: STRING; an_id: INTEGER)
            -- Append a_string with the identifier an_id to the
            -- menu.
        require
            exists: exists
            a_string_not_void: a_string /= void
            positive_id: an_id > 0
            item_not_exists: not item_exists (an_id)
        ensure
            new_count: count = old count + 1
            item_exists: item_exists (an_id)
            string_set: id_string (an_id).is_equal (a_string)

    append_string_with_break (a_string: STRING; an_id: INTEGER; has_separator: BOOLEAN)
            -- Append an item with a break to the menu.
            -- All the following items will be set in a new column.
            -- If has_separator is True, then a vertical separator
            -- appears between the two columns.
        require
            exists: exists
            a_string_not_void: a_string /= void
            positive_id: an_id > 0
            item_not_exists: not item_exists (an_id)
        ensure
            new_count: count = old count + 1
            item_exists: item_exists (an_id)
            string_set: id_string (an_id).is_equal (a_string)

    insert_bitmap (bitmap: WEL_BITMAP; a_position, an_id: INTEGER)
            -- Insert bitmap at zero-based a_position with
            -- an_id.
        require
            exists: exists
            a_position_large_enough: a_position >= 0
            a_position_small_enough: a_position <= count
            bitmap_not_void: bitmap /= void
            bitmap_exists: bitmap.exists
            positive_id: an_id > 0
            item_not_exists: not item_exists (an_id)
        ensure
            new_count: count = old count + 1

    insert_popup (a_menu: WEL_MENU; a_position: INTEGER; a_title: STRING)
            -- Insert a popup menu a_menu at zero-based a_position
            -- with a_title.
        require
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
            a_title_not_void: a_title /= void
            a_position_large_enough: a_position >= 0
            a_position_small_enough: a_position <= count
        ensure
            new_count: count = old count + 1
            popup_menu_set: popup_menu (a_position).item = a_menu.item

    insert_separator (a_position: INTEGER)
            -- Insert a separator at zero-based a_position.
        require
            exists: exists
            a_position_large_enough: a_position >= 0
            a_position_small_enough: a_position <= count
        ensure
            new_count: count = old count + 1

    insert_string (a_string: STRING; a_position, an_id: INTEGER)
            -- Insert a_string at zero-based a_position with
            -- an_id.
        require
            exists: exists
            a_position_large_enough: a_position >= 0
            a_position_small_enough: a_position <= count
            a_string_not_void: a_string /= void
            positive_id: an_id > 0
            item_not_exists: not item_exists (an_id)
        ensure
            new_count: count = old count + 1
            string_set: id_string (an_id).is_equal (a_string)

    modify_string (a_string: STRING; an_id: INTEGER)
            -- Modify the menu title identified by an_id to
            -- a_string.
        require
            exists: exists
            a_string_not_void: a_string /= void
            positive_id: an_id > 0
            item_exists: item_exists (an_id)
        ensure
            string_set: id_string (an_id).is_equal (a_string)

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete_item (an_id: INTEGER)
            -- Delete an_id from the menu.
        require
            exists: exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)
        ensure
            new_count: count = old count - 1
            item_not_exists: not item_exists (an_id)

    delete_position (position: INTEGER)
            -- Delete the item at zero-based position.
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position < count
        ensure
            new_count: count = old count - 1

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

    remove_position (position: INTEGER)
            -- Remove the item at zero-based position.
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position < count
        ensure
            new_count: count = old count - 1

feature -- Conversion

    position_to_item_id (position: INTEGER): INTEGER
            -- Retrieve the menu item identifier of a menu item at
            -- the zero-based position.
            -- Return 0 if the item at the zero-based
            -- position is a separator or a pop-up menu.
        require
            exists: exists
            position_large_enough: position >= 0
            position_small_enough: position < count

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    hilite_menu_item (window: WEL_COMPOSITE_WINDOW; an_id: INTEGER)
            -- Hilite the item identified by an_id in the
            -- window's menu.
        require
            exists: exists
            window_not_void: window /= void
            window_exists: window.exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)

    show_track (x, y: INTEGER; window: WEL_COMPOSITE_WINDOW)
            -- Show a track popup menu at the x and y absolute
            -- position. window will receive the selection in
            -- on_menu_command.
        require
            exists: exists
            not_empty: count > 0
            window_not_void: window /= void
            window_exists: window.exists

    show_track_with_option (x, y: INTEGER; window: WEL_COMPOSITE_WINDOW; option: INTEGER; rect: WEL_RECT)
            -- Show a track popup menu with option at
            -- the x and y absolute position.
            -- window will receive the selection in
            -- on_menu_command.
            -- rect specifies the portion of the screen
            -- in which the user can select without
            -- dismissing the popup menu. If this parameter
            -- is Void the popup menu is dismissed if the
            -- user clicks outside the popup menu
        require
            exists: exists
            not_empty: count > 0
            window_not_void: window /= void
            window_exists: window.exists

    unhilite_menu_item (window: WEL_COMPOSITE_WINDOW; an_id: INTEGER)
            -- unhilite the item identified by an_id in the
            -- window's menu.
        require
            exists: exists
            window_not_void: window /= void
            window_exists: window.exists
            positive_id: an_id > 0
            item_exists: item_exists (an_id)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MENU


WEL_MESSAGE_BOX Chart

class
    WEL_MESSAGE_BOX

General
    obsolete: "Use WEL_MSG_BOX instead"
    cluster: wel.support
    description: "Interface on the MessageBox function."

Ancestors
    ANY

Queries
    message_box_result: INTEGER

Commands
    error_message_box (a_text: STRING; a_style: INTEGER)
    message_box (a_text, a_title: STRING; a_style: INTEGER)


WEL_MESSAGE_BOX Flat contracts

indexing
    description: "Interface on the MessageBox function."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MESSAGE_BOX

feature -- Status report

    message_box_result: INTEGER
            -- Last result for the message_box and
            -- error_message_box routines.
            -- See class WEL_ID_CONSTANTS for values.

feature -- Basic operations

    error_message_box (a_text: STRING; a_style: INTEGER)
            -- Show a error message box with a_text
            -- inside using a_style.
            -- See class WEL_MB_CONSTANTS for a_style value.
        require
            text_not_void: a_text /= void

    message_box (a_text, a_title: STRING; a_style: INTEGER)
            -- Show a message box with a_text inside and
            -- a_title using a_style.
            -- See class WEL_MB_CONSTANTS for a_style value.
        require
            text_not_void: a_text /= void
            title_not_void: a_title /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MESSAGE_BOX


WEL_MESSAGE_INFORMATION_CREATOR Chart

class
    WEL_MESSAGE_INFORMATION_CREATOR

General
    cluster: wel.support
    description: "This class creates a message information object corresponding to a given message."
    create: make

Ancestors
    WEL_WM_CONSTANTS

Queries
    message_information: WEL_MESSAGE_INFORMATION

Commands
    make (window: WEL_WINDOW; message, wparam, lparam: INTEGER)


WEL_MESSAGE_INFORMATION_CREATOR Flat contracts

indexing
    description: "This class creates a message information object corresponding to a given message."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MESSAGE_INFORMATION_CREATOR

create

    make (window: WEL_WINDOW; message, wparam, lparam: INTEGER)
            -- Make message_information corresponding to
            -- message by using wparam and lparam.
        require
            window_not_void: window /= void
            positive_message: message >= 0

feature -- Initialization

    make (window: WEL_WINDOW; message, wparam, lparam: INTEGER)
            -- Make message_information corresponding to
            -- message by using wparam and lparam.
        require
            window_not_void: window /= void
            positive_message: message >= 0

feature -- Access

    message_information: WEL_MESSAGE_INFORMATION
            -- Information about message.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MESSAGE_INFORMATION_CREATOR


WEL_MSG_BOX Chart

class
    WEL_MSG_BOX

General
    cluster: wel.support
    description: "Interface on the MessageBox function."
    create: make

Ancestors
    WEL_BIT_OPERATIONS
    WEL_LANGUAGE_CONSTANTS
    WEL_MB_CONSTANTS

Queries
    basic_msg_box (a_style: INTEGER): BOOLEAN
    clear_flag (flags, mask: INTEGER): INTEGER
    flag_set (flags, mask: INTEGER): BOOLEAN
    language: INTEGER
    message_box_result: INTEGER
    set_flag (flags, mask: INTEGER): INTEGER
    sublanguage: INTEGER

Commands
    basic_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style: INTEGER)
    error_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
    information_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
    make
    question_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
    set_language (a_language_id, a_sublanguage_id: INTEGER)
    user_icon_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style, an_id: INTEGER)
    warning_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)


WEL_MSG_BOX Flat contracts

indexing
    description: "Interface on the MessageBox function."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MSG_BOX

create

    make
            -- initialize language

feature -- Status report

    flag_set (flags, mask: INTEGER): BOOLEAN
            -- Is mask set in flags?
            -- (from WEL_BIT_OPERATIONS)

    language: INTEGER
            -- Actual language for "push buttons"

    message_box_result: INTEGER
            -- Last result for all xxx_message_box routines.
            -- See class WEL_ID_CONSTANTS for values.

    sublanguage: INTEGER
            -- Sublanguage of language for "push buttons"

feature -- Basic operations

    basic_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style: INTEGER)
            -- Show a basic message box with a_text inside and
            -- a_title using a_style. Basic means a_style should not contain
            -- the flag MB_USERICON.
            -- See class WEL_MB_CONSTANTS for a_style value.
        require
            basic_message_box: basic_msg_box (a_style)
            text_not_void: a_text /= void
            title_not_void: a_title /= void

    clear_flag (flags, mask: INTEGER): INTEGER
            -- Clear the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_unset: not flag_set (Result, mask)

    error_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
            -- Show an error message box with message a_text
            -- and caption a_title
        require
            text_not_void: a_text /= void
            title_not_void: a_title /= void

    information_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
            -- Show an information message box with message a_text
            -- and caption a_title
        require
            text_not_void: a_text /= void
            title_not_void: a_title /= void

    make
            -- initialize language

    question_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
            -- Show a question message box with message a_text
            -- and caption a_title
        require
            text_not_void: a_text /= void
            title_not_void: a_title /= void

    set_flag (flags, mask: INTEGER): INTEGER
            -- Set the mask in flags
            -- (from WEL_BIT_OPERATIONS)
        ensure -- from WEL_BIT_OPERATIONS
            flag_set: flag_set (Result, mask)

    set_language (a_language_id, a_sublanguage_id: INTEGER)
            -- set language to a_language_id
            -- and sublanguage to a_sublanguage_id
        require
            valid_langid: a_language_id > 0
            valid_sublangid: a_sublanguage_id > 0
        ensure
            language_set: language = a_language_id
            sublanguage_set: sublanguage = a_sublanguage_id

    user_icon_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING; a_style, an_id: INTEGER)
            -- Show a message box with a user icon an_id,
            -- a_text inside and a_title using a_style.
            -- the flag MB_USERICON must be present in a_style.
            -- See class WEL_MB_CONSTANTS for a_style value.
        require
            user_message_box: not basic_msg_box (a_style)
            text_not_void: a_text /= void
            title_not_void: a_title /= void

    warning_message_box (a_window: WEL_WINDOW; a_text, a_title: STRING)
            -- Show a warning message box with message a_text
            -- and caption a_title
        require
            text_not_void: a_text /= void
            title_not_void: a_title /= void

feature -- Implementation

    basic_msg_box (a_style: INTEGER): BOOLEAN
            -- does a_style contain the flag Mb_usericon?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MSG_BOX


WEL_NULL_CURSOR Chart

class
    WEL_NULL_CURSOR

General
    cluster: wel.support
    description: "Special cursor used for creating a WEL_WND_CLASS structure when an application must explicitly set the cursor shape whenever the mouse moves into the window."

Ancestors
    WEL_CURSOR

Queries
    Exists: BOOLEAN
    gdi_objects_count: INTEGER
    get_icon_info: WEL_ICON_INFO
    item: POINTER
    object_id: INTEGER
    previous_cursor: WEL_CURSOR
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER
    x_hotspot: INTEGER
    y_hotspot: INTEGER

Commands
    decrement_reference
    delete
    delete_gdi_object
    dispose
    enable_reference_tracking
    increment_reference
    restore_previous
    set
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    exists
    no item


WEL_NULL_CURSOR Flat contracts

indexing
    description: "Special cursor used for creating a WEL_WND_CLASS structure when an application must explicitly set the cursor shape whenever the mouse moves into the window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NULL_CURSOR

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    get_icon_info: WEL_ICON_INFO
            -- Retrieve information about a icon/cusor
            --
            -- Return Void if an error occurred while retrieving
            -- the information.
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GRAPHICAL_RESOURCE
            result_void_or_valid: Result = void or else Result.is_initialized

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    previous_cursor: WEL_CURSOR
            -- Previously assigned cursor
            -- (from WEL_CURSOR)

    x_hotspot: INTEGER
            -- X-coordinate of Currents hot spot.
            -- (from WEL_CURSOR)

    y_hotspot: INTEGER
            -- Y-coordinate of a Currents hot spot.
            -- (from WEL_CURSOR)

feature -- Status report

    Exists: BOOLEAN is True
            -- A null cursor always exists.

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    delete_gdi_object
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GDI_ANY
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    restore_previous
            -- Restore previous_cursor.
            -- (from WEL_CURSOR)
        require -- from WEL_CURSOR
            previous_cursor_not_void: previous_cursor /= void
        ensure -- from WEL_CURSOR
            previous_cursor_void: previous_cursor = void

    set
            -- Set current cursor for entire application and
            -- save old one in previous_cursor if there was
            -- one.
            -- (from WEL_CURSOR)
        require -- from WEL_CURSOR
            exists: exists

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

    exists: exists
    no_item: item = default_pointer
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NULL_CURSOR


WEL_NULL_ICON Chart

class
    WEL_NULL_ICON

General
    cluster: wel.support
    description: "Special icon used for creating a WEL_WND_CLASS structure when an application must explicitly draw an icon whenever the user minimizes the window."

Ancestors
    WEL_ICON

Queries
    Exists: BOOLEAN
    gdi_objects_count: INTEGER
    get_icon_info: WEL_ICON_INFO
    item: POINTER
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    decrement_reference
    delete
    delete_gdi_object
    dispose
    enable_reference_tracking
    increment_reference
    set_item (an_item: POINTER)
    set_shared
    set_unshared

Constraints
    exists
    no item


WEL_NULL_ICON Flat contracts

indexing
    description: "Special icon used for creating a WEL_WND_CLASS structure when an application must explicitly draw an icon whenever the user minimizes the window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_NULL_ICON

feature -- Access

    gdi_objects_count: INTEGER
            -- Number of GDI object currently allocated by the
            -- program.
            --
            -- Note: debug option "WEL_GDI_COUNT" should be enabled, otherwise
            -- this function will return zero.
            -- (from WEL_GDI_ANY)

    get_icon_info: WEL_ICON_INFO
            -- Retrieve information about a icon/cusor
            --
            -- Return Void if an error occurred while retrieving
            -- the information.
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GRAPHICAL_RESOURCE
            result_void_or_valid: Result = void or else Result.is_initialized

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    Exists: BOOLEAN is True
            -- A null icon always exists.

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    delete
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        require -- from WEL_REFERENCE_TRACKABLE
            reference_not_tracked: not reference_tracked
        ensure -- from WEL_REFERENCE_TRACKABLE
            destroyed: not shared implies not exists

    delete_gdi_object
            -- Delete the current gdi object
            -- (from WEL_GRAPHICAL_RESOURCE)
        ensure -- from WEL_GDI_ANY
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function is called by the GC when the
            -- object is collected, the developer should
            -- use delete.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Status Report

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?
            -- (from WEL_REFERENCE_TRACKABLE)

    references_count: INTEGER
            -- Number of object referring this object.
            -- (from WEL_REFERENCE_TRACKABLE)

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
            -- (from WEL_REFERENCE_TRACKABLE)
        require -- from WEL_REFERENCE_TRACKABLE
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.
            -- (from WEL_REFERENCE_TRACKABLE)

invariant

    exists: exists
    no_item: item = default_pointer
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_NULL_ICON


WEL_OBJECT_ID_MANAGER Chart

class
    WEL_OBJECT_ID_MANAGER

General
    cluster: wel.support
    description: "Ancestor for every class using a 'Object vs Id' conversion in WEL."

Ancestors
    ANY


WEL_PIPE Chart

class
    WEL_PIPE

General
    cluster: wel.support
    description: "Windows pipe, used in WEL_PROCESS_LAUNCHER"
    create: make

Ancestors
    EXCEPTIONS
    STRING_HANDLER

Queries
    exists: BOOLEAN
    input_closed: BOOLEAN
    input_handle: INTEGER
    last_read_bytes: INTEGER
    last_read_successful: BOOLEAN
    last_string: STRING
    last_write_successful: BOOLEAN
    last_written_bytes: INTEGER
    output_closed: BOOLEAN
    output_handle: INTEGER

Commands
    close
    close_input
    close_output
    put_string (a_string: STRING)
    read_stream (count: INTEGER)


WEL_PIPE Flat contracts

indexing
    description: "Windows pipe, used in WEL_PROCESS_LAUNCHER"

class interface
    WEL_PIPE

create

    make
            -- Initialize pipe.

feature -- Status setting

    close
            -- Close pipe.
        require
            output_open: not output_closed
            input_open: not input_closed

    close_input
            -- Close pipe input.
        require
            input_open: not input_closed

    close_output
            -- Close pipe output.
        require
            output_open: not output_closed

feature -- Input

    put_string (a_string: STRING)
            -- Write a_string to pipe.
            -- Put number of written bytes in last_written_bytes.
        require
            non_void_string: a_string /= void
            input_open: not input_closed

feature -- Output

    read_stream (count: INTEGER)
            -- Read a string of at most count bound characters
            -- or until end of pipe is encountered.
            -- Put number of read bytes in last_read_bytes.
            -- Make result available in last_string.
        require
            valid_count: count > 0
            output_open: not output_closed

feature -- Status Report

    exists: BOOLEAN
            -- Does pipe exist?

    input_closed: BOOLEAN
            -- Is pipe input closed?

    input_handle: INTEGER
            -- Pipe output handle

    last_read_bytes: INTEGER
            -- Last amount of bytes read from pipe

    last_read_successful: BOOLEAN
            -- Was last read operation successful?

    last_string: STRING
            -- Last read string

    last_write_successful: BOOLEAN
            -- Was last write operation successful?

    last_written_bytes: INTEGER
            -- Last amount of bytes written to pipe

    output_closed: BOOLEAN
            -- Is pipe output closed?

    output_handle: INTEGER
            -- Pipe input handle

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PIPE


WEL_PROCESS_LAUNCHER Chart

class
    WEL_PROCESS_LAUNCHER

General
    cluster: wel.support
    description:
        "Launch processes and redirect output:
          - Use `spawn' to launch a process asynchronously.
          Note: you cannot retrieve the ouput from a
          process that was spawned
          - Use `launch' to launch a process synchronously
          and process its output if needed."

Ancestors
    WEL_PROCESS_CREATION_CONSTANTS
    WEL_STARTUP_CONSTANTS
    WEL_SW_CONSTANTS

Queries
    last_launch_successful: BOOLEAN
    last_process_result: INTEGER

Commands
    launch (a_command_line, a_working_directory: STRING; a_output_handler: ROUTINE [ANY, TUPLE [STRING]])
    launch_and_refresh (a_command_line, a_working_directory: STRING; a_refresh_handler: ROUTINE [ANY, TUPLE])
    spawn (a_command_line, a_working_directory: STRING)


WEL_PROCESS_LAUNCHER Flat contracts

indexing
    description: "[
                    Launch processes and redirect output:
                      - Use `spawn' to launch a process asynchronously.
                              Note: you cannot retrieve the ouput from a
                              process that was spawned
                      - Use `launch' to launch a process synchronously
                              and process its output if needed.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_PROCESS_LAUNCHER

feature -- Access

    last_launch_successful: BOOLEAN
            -- Was last call to launch successful (i.e. was process started)?

    last_process_result: INTEGER
            -- Last launched process return value

feature -- Basic Operations

    launch (a_command_line, a_working_directory: STRING; a_output_handler: ROUTINE [ANY, TUPLE [STRING]])
            -- Launch process described in a_command_line from a_working_directory.
            -- Wait for end of process and send output to a_output_handler if not void.
        require
            non_void_command_line: a_command_line /= void
            valid_command_line: not a_command_line.is_empty
            non_void_working_directory: a_working_directory /= void

    launch_and_refresh (a_command_line, a_working_directory: STRING; a_refresh_handler: ROUTINE [ANY, TUPLE])
            -- Launch process described in a_command_line from a_working_directory.
            -- Calls a_refresh_handler regularly while waiting for end of process.
        require
            non_void_command_line: a_command_line /= void
            valid_command_line: not a_command_line.is_empty
            non_void_working_directory: a_working_directory /= void

    spawn (a_command_line, a_working_directory: STRING)
            -- Spawn asynchronously process described in a_command_line from a_working_directory.
        require
            non_void_command_line: a_command_line /= void
            valid_command_line: not a_command_line.is_empty
            non_void_working_directory: a_working_directory /= void

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_PROCESS_LAUNCHER


WEL_REFERENCE_TRACKABLE Chart

deferred class
    WEL_REFERENCE_TRACKABLE

General
    cluster: wel.support
    description: "Facility to track references of an object."

Ancestors
    WEL_OBJECT_ID_MANAGER

Queries
    exists: BOOLEAN
    object_id: INTEGER
    reference_tracked: BOOLEAN
    references_count: INTEGER
    shared: BOOLEAN

Commands
    decrement_reference
    delete
    enable_reference_tracking
    increment_reference


WEL_REFERENCE_TRACKABLE Flat contracts

indexing
    description: "Facility to track references of an object."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_REFERENCE_TRACKABLE

feature -- Removal

    delete
            -- Destroy the inner structure of Current.
            --
            -- Call this function when Current is no more needed
        require
            reference_not_tracked: not reference_tracked
        ensure
            destroyed: not shared implies not exists

feature -- Status Report

    exists: BOOLEAN
            -- Is Current valid?

    reference_tracked: BOOLEAN
            -- Are the number references of Current tracked?

    references_count: INTEGER
            -- Number of object referring this object.

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.

feature -- Status Setting

    decrement_reference
            -- Decrement the number of references to this object.
            --
            -- When the number of references reach zero,
            -- delete is called if the object is not protected.
        require
            exists: exists
            tracking_references_started: reference_tracked

    enable_reference_tracking
            -- Set references_tracked to True.
            --
        require
            exists: exists
            tracking_reference_not_started: not reference_tracked

    increment_reference
            -- Increment the number of references to this object.
        require
            exists: exists
            tracking_references_started: reference_tracked

    object_id: INTEGER
            -- Runtime Id of Current.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REFERENCE_TRACKABLE


WEL_REGISTRY Chart

class
    WEL_REGISTRY

General
    cluster: wel.support
    description: "Registry manager"

Ancestors
    STRING_HANDLER
    WEL_HKEY
    WEL_REGISTRY_ACCESS_MODE

Queries
    basic_valid_name_for_hkey (name: STRING): BOOLEAN
    basic_valid_value_for_hkey (value: POINTER): BOOLEAN
    create_key (parent_key: POINTER; key_name: STRING; sam: INTEGER): POINTER
    default_key_value (key: POINTER; path: STRING): WEL_REGISTRY_KEY_VALUE
    enumerate_key (key: POINTER; index: INTEGER): WEL_REGISTRY_KEY
    enumerate_value (key: POINTER; index: INTEGER): STRING
    enumerate_values (key: POINTER): LINKED_LIST [STRING]
    hkey_classes_root: POINTER
    hkey_current_config: POINTER
    hkey_current_user: POINTER
    hkey_dyn_data: POINTER
    hkey_local_machine: POINTER
    hkey_performance_data: POINTER
    hkey_users: POINTER
    index_value_for_root_keys (name: STRING): POINTER
    key_from_remote_host (host_name: STRING; root_key: POINTER): POINTER
    key_value (key: POINTER; value_name: STRING): WEL_REGISTRY_KEY_VALUE
    last_call_successful: BOOLEAN
    number_of_subkeys (key: POINTER): INTEGER
    number_of_values (key: POINTER): INTEGER
    open_key (parent_key: POINTER; key_name: STRING; access_mode: INTEGER): POINTER
    open_key_value (key_path, value_name: STRING): WEL_REGISTRY_KEY_VALUE
    open_key_with_access (key_path: STRING; acc: INTEGER): POINTER
    valid_value_for_hkey (key: POINTER): BOOLEAN

Commands
    close_key (key: POINTER)
    create_new_key (key_path: STRING)
    delete_key (parent_key: POINTER; key_name: STRING)
    delete_value (parent_key: POINTER; name: STRING)
    set_key_value (key: POINTER; value_name: STRING; value: WEL_REGISTRY_KEY_VALUE)


WEL_REGISTRY Flat contracts

indexing
    description: "Registry manager"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"
    note: "Changed the type of Keys from INTEGER to POINTER"

class interface
    WEL_REGISTRY

feature -- Access

    default_key_value (key: POINTER; path: STRING): WEL_REGISTRY_KEY_VALUE
            -- Retrieve value of value_name associated with open
            -- key.
        require
            key_possible: valid_value_for_hkey (key)

    enumerate_key (key: POINTER; index: INTEGER): WEL_REGISTRY_KEY
            -- indexth subkey of key,
            -- Void if key has less than index subkeys.
        require
            key_possible: valid_value_for_hkey (key)
            index_possible: index <= number_of_subkeys (key)

    hkey_classes_root: POINTER
            -- (from WEL_HKEY)

    hkey_current_config: POINTER
            -- (from WEL_HKEY)

    hkey_current_user: POINTER
            -- (from WEL_HKEY)

    hkey_dyn_data: POINTER
            -- (from WEL_HKEY)

    hkey_local_machine: POINTER
            -- (from WEL_HKEY)

    hkey_performance_data: POINTER
            -- (from WEL_HKEY)

    hkey_users: POINTER
            -- (from WEL_HKEY)

    key_from_remote_host (host_name: STRING; root_key: POINTER): POINTER
            -- Connect the computer designed by its name 'host_name'.
            -- 'Host_name' should be under the format: \\computer_name
            -- 'root_key' is the key from where we want to start the
            -- investigations on the remote machine.
            -- If 'Host_name' is empty, then the local computer is used by default.
        require
            root_key_possible: root_key = hkey_local_machine or root_key = hkey_users or root_key = hkey_performance_data
            host_name_possible: host_name /= void

    key_value (key: POINTER; value_name: STRING): WEL_REGISTRY_KEY_VALUE
            -- Retrieve value of value_name associated with open
            -- key.
            -- The identifier 'key' relative to the parent key must
            -- have been opened with the KEY_QUERY_VALUE access.
        require
            value_name_possible: value_name /= void and then not value_name.is_empty
            key_valid: valid_value_for_hkey (key)

feature -- Actions

    create_new_key (key_path: STRING)
            -- Create a new key, with as path 'path'
            -- The path should be like "a\b\c"
            -- Please refer to WEL_HKEY for possible value for a.
        require
            at_least_one_back_slash: key_path /= void and then key_path.has ('\')

    open_key_value (key_path: STRING; value_name: STRING): WEL_REGISTRY_KEY_VALUE
            -- Open a key, with as path 'path' and
            -- name 'key_name'.
            -- The path should be like "a\b\c"
            -- Please refer to WEL_HKEY for possible value for a.
            -- Return Void if the operation did not correctly terminate.
        require
            key_name_possible: value_name /= void and then not value_name.is_empty
            at_least_one_back_slash: key_path /= void and then key_path.has ('\')

    open_key_with_access (key_path: STRING; acc: INTEGER): POINTER
            -- Open the key relative to the path 'key_path', with
            -- the access 'acc'.
            -- Return the key reference (defaul_pointer if the operation failed).
        require
            at_least_one_back_slash: key_path /= void and then key_path.has ('\')

feature -- Basic Actions

    close_key (key: POINTER)
            -- Close key.
            -- Return True if succeeded, False otherwise.
        require
            key_possible: valid_value_for_hkey (key)

    create_key (parent_key: POINTER; key_name: STRING; sam: INTEGER): POINTER
            -- Create key_name under parent_key according to sam.
            -- Return handle to created key or default_pointer on failure.
        require
            key_name_possible: key_name /= void and then not key_name.is_empty
            parent_key_possible: valid_value_for_hkey (parent_key)

    delete_key (parent_key: POINTER; key_name: STRING)
            -- Delete subkey key_name of parent_key.
            -- Return True if succeeded, False otherwise.
            -- Under Windows 95, all subkeys are deleted.
            -- Under Windows NT, only specified key is deleted
            -- it should not have subkeys.
        require
            key_name_possible: key_name /= void and then not key_name.is_empty
            parent_key_possible: valid_value_for_hkey (parent_key)

    enumerate_values (key: POINTER): LINKED_LIST [STRING]
            -- Find the names of the key values within the
            -- key referenced by 'key'.

    open_key (parent_key: POINTER; key_name: STRING; access_mode: INTEGER): POINTER
            -- Open subkey key_name of parent_key according to access_mode.
            -- Return handle to created key or default_pointer on failure.
        require
            key_name_possible: key_name /= void and then not key_name.is_empty
            parent_key_possible: valid_value_for_hkey (parent_key)

feature -- New actions

    delete_value (parent_key: POINTER; name: STRING)
        require
            key_possible: valid_value_for_hkey (parent_key)
            name_possible: name /= void

    enumerate_value (key: POINTER; index: INTEGER): STRING
            -- Find the name of the key_value corresponding
            -- to the key 'key and the index 'index'.

    number_of_subkeys (key: POINTER): INTEGER

    number_of_values (key: POINTER): INTEGER

    valid_value_for_hkey (key: POINTER): BOOLEAN
            -- Does key pointed by 'key' exists

feature -- Settings

    set_key_value (key: POINTER; value_name: STRING; value: WEL_REGISTRY_KEY_VALUE)
            -- Change value defined by key and value_name to value.
            -- The key identified by the hKey parameter must have been
            -- opened with KEY_SET_VALUE access
        require
            valid_value: value /= void
            valid_value_name: value_name /= void
            key_possible: valid_value_for_hkey (key)

feature -- Status

    basic_valid_name_for_hkey (name: STRING): BOOLEAN
            -- Return TRUE if 'name' correspond to one of the
            -- value names below.
            -- (from WEL_HKEY)
        require -- from WEL_HKEY
            name_possible: name /= void

    basic_valid_value_for_hkey (value: POINTER): BOOLEAN
            -- Return TRUE if 'value' is one of the basic following values.
            -- (from WEL_HKEY)

    index_value_for_root_keys (name: STRING): POINTER
            -- Return the index corresponding to a root key.
            -- (from WEL_HKEY)
        require -- from WEL_HKEY
            name_possible: name /= void and then basic_valid_name_for_hkey (name)

    last_call_successful: BOOLEAN
            -- Did last call succeed?

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REGISTRY


WEL_REGISTRY_KEY Chart

class
    WEL_REGISTRY_KEY

General
    cluster: wel.support
    description: "Registry manager"
    create: make

Ancestors
    ANY

Queries
    class_id: STRING
    last_change: WEL_FILE_TIME
    name: STRING

Commands
    make (a_name, a_class_id: STRING; a_modification_time: WEL_FILE_TIME)


WEL_REGISTRY_KEY Flat contracts

indexing
    description: "Registry manager"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_REGISTRY_KEY

create

    make (a_name, a_class_id: STRING; a_modification_time: WEL_FILE_TIME)
            -- Create current instance.
        ensure
            name_set: name = a_name
            class_id_set: class_id = a_class_id
            last_change_set: last_change = a_modification_time

feature -- Initialization

    make (a_name, a_class_id: STRING; a_modification_time: WEL_FILE_TIME)
            -- Create current instance.
        ensure
            name_set: name = a_name
            class_id_set: class_id = a_class_id
            last_change_set: last_change = a_modification_time

feature -- Access

    class_id: STRING
            -- Class of key

    last_change: WEL_FILE_TIME
            -- Last modification time

    name: STRING
            -- Name of key

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_REGISTRY_KEY


WEL_RESOURCE Chart

deferred class
    WEL_RESOURCE

General
    cluster: wel.support
    description: "General notions of a loadable resource."

Ancestors
    WEL_ANY

Queries
    exists: BOOLEAN
    item: POINTER
    shared: BOOLEAN
    to_integer: INTEGER

Commands
    dispose
    set_item (an_item: POINTER)
    set_shared
    set_unshared


WEL_RESOURCE Flat contracts

indexing
    description: "General notions of a loadable resource."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"
    note: "`make_by_predefined_id' does now take a POINTER as argument.Please change any external clauses of existing prefedefinedIDs to POINTER too. Predefined IDs are correctly casted onthe C-side already"

deferred class interface
    WEL_RESOURCE

feature -- Access

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RESOURCE


WEL_RETURN_VALUE Chart

class
    WEL_RETURN_VALUE

General
    cluster: wel.support
    description: "Manages nested window-procedure-return-values."

Ancestors
    ANY

Queries
    default_processing: BOOLEAN
    has_return_value: BOOLEAN
    message_return_value: INTEGER

Commands
    set_default_processing (value: BOOLEAN)
    set_message_return_value (value: INTEGER)


WEL_RETURN_VALUE Flat contracts

indexing
    description: "Manages nested window-procedure-return-values."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_RETURN_VALUE

feature -- Access

    default_processing: BOOLEAN

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?

    message_return_value: INTEGER
            -- Return value of the window procedure.
        require
            has_return_value: has_return_value

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
        ensure
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
        ensure
            has_return_value: has_return_value
            value_set: message_return_value = value

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_RETURN_VALUE


WEL_SCROLLER Chart

class
    WEL_SCROLLER

General
    cluster: wel.support
    description: "This class processes the scroll messages associated to a window."
    create: make_with_options, make

Ancestors
    WEL_SB_CONSTANTS
    WEL_SCROLL_BAR_CONSTANTS

Queries
    horizontal_line: INTEGER
    horizontal_page: INTEGER
    horizontal_position: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    vertical_line: INTEGER
    vertical_page: INTEGER
    vertical_position: INTEGER
    window: WEL_COMPOSITE_WINDOW

Commands
    horizontal_update (inc, position: INTEGER)
    make (a_window: WEL_COMPOSITE_WINDOW; horizontal_size, vertical_size, line, page: INTEGER)
    make_with_options (a_window: WEL_COMPOSITE_WINDOW; a_minimal_horizontal_position, a_maximal_horizontal_position, a_minimal_vertical_position, a_maximal_vertical_position, a_horizontal_line, a_horizontal_page, a_vertical_line, a_vertical_page: INTEGER)
    on_horizontal_scroll (scroll_code, pos: INTEGER)
    on_vertical_scroll (scroll_code, pos: INTEGER)
    set_horizontal_line (unit: INTEGER)
    set_horizontal_page (page_magnitude: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_vertical_line (unit: INTEGER)
    set_vertical_page (page_magnitude: INTEGER)
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    vertical_update (inc, position: INTEGER)

Constraints
    window not void
    horizontal position small enough
    horizontal position large enough
    vertical position small enough
    vertical position large enough
    consistent horizontal range
    consistent vertical range
    positive horizontal line
    positive vertical line
    positive horizontal page
    positive vertical page


WEL_SCROLLER Flat contracts

indexing
    description: "This class processes the scroll messages associated to a window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SCROLLER

create

    make (a_window: WEL_COMPOSITE_WINDOW; horizontal_size, vertical_size, line, page: INTEGER)
            -- Make a scroller associated to a_window using
            -- horizontal_size and vertical_size as the
            -- size of the scrollable area. line and page
            -- specify the scroll incrementation for a line and
            -- a page.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
            positive_horizontal_size: horizontal_size > 0
            positive_vertical_size: vertical_size > 0
            positive_line: line >= 0
            valid_line: line < horizontal_size and then line < vertical_size
            positive_page: page >= 0
            valid_page: page < horizontal_size and then page < vertical_size
        ensure
            window_set: window = a_window

    make_with_options (a_window: WEL_COMPOSITE_WINDOW; a_minimal_horizontal_position, a_maximal_horizontal_position, a_minimal_vertical_position, a_maximal_vertical_position, a_horizontal_line, a_horizontal_page, a_vertical_line, a_vertical_page: INTEGER)
            -- Make a scroller associated to a_window.
            -- a_minimal_horizontal_position and
            -- a_maximal_horizontal_position specify the
            -- horizontal scroll range.
            -- a_minimal_vertical_position and
            -- a_maximal_vertical_position specify the
            -- vertical scroll range.
            -- a_horizontal_line and a_horizontal_page specify
            -- the scroll incrementation for a horizontal line and
            -- page.
            -- a_vertical_line and a_vertical_page specify
            -- the scroll incrementation for a vertical line and
            -- page.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
            consistent_horizontal_range: a_minimal_horizontal_position < a_maximal_horizontal_position
            consistent_vertical_range: a_minimal_vertical_position < a_maximal_vertical_position
            positive_horizontal_line: a_horizontal_line >= 0
            positive_vertical_line: a_vertical_line >= 0
            positive_horizontal_page: a_horizontal_page >= 0
            positive_vertical_page: a_vertical_page >= 0
        ensure
            window_set: window = a_window
            minimal_horizontal_position_set: minimal_horizontal_position = a_minimal_horizontal_position
            maximal_horizontal_position_set: maximal_horizontal_position = a_maximal_horizontal_position
            minimal_vertical_position_set: minimal_vertical_position = a_minimal_vertical_position
            maximal_vertical_position_set: maximal_vertical_position = a_maximal_vertical_position

feature -- Initialization

    make (a_window: WEL_COMPOSITE_WINDOW; horizontal_size, vertical_size, line, page: INTEGER)
            -- Make a scroller associated to a_window using
            -- horizontal_size and vertical_size as the
            -- size of the scrollable area. line and page
            -- specify the scroll incrementation for a line and
            -- a page.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
            positive_horizontal_size: horizontal_size > 0
            positive_vertical_size: vertical_size > 0
            positive_line: line >= 0
            valid_line: line < horizontal_size and then line < vertical_size
            positive_page: page >= 0
            valid_page: page < horizontal_size and then page < vertical_size
        ensure
            window_set: window = a_window

    make_with_options (a_window: WEL_COMPOSITE_WINDOW; a_minimal_horizontal_position, a_maximal_horizontal_position, a_minimal_vertical_position, a_maximal_vertical_position, a_horizontal_line, a_horizontal_page, a_vertical_line, a_vertical_page: INTEGER)
            -- Make a scroller associated to a_window.
            -- a_minimal_horizontal_position and
            -- a_maximal_horizontal_position specify the
            -- horizontal scroll range.
            -- a_minimal_vertical_position and
            -- a_maximal_vertical_position specify the
            -- vertical scroll range.
            -- a_horizontal_line and a_horizontal_page specify
            -- the scroll incrementation for a horizontal line and
            -- page.
            -- a_vertical_line and a_vertical_page specify
            -- the scroll incrementation for a vertical line and
            -- page.
        require
            a_window_not_void: a_window /= void
            a_window_exists: a_window.exists
            consistent_horizontal_range: a_minimal_horizontal_position < a_maximal_horizontal_position
            consistent_vertical_range: a_minimal_vertical_position < a_maximal_vertical_position
            positive_horizontal_line: a_horizontal_line >= 0
            positive_vertical_line: a_vertical_line >= 0
            positive_horizontal_page: a_horizontal_page >= 0
            positive_vertical_page: a_vertical_page >= 0
        ensure
            window_set: window = a_window
            minimal_horizontal_position_set: minimal_horizontal_position = a_minimal_horizontal_position
            maximal_horizontal_position_set: maximal_horizontal_position = a_maximal_horizontal_position
            minimal_vertical_position_set: minimal_vertical_position = a_minimal_vertical_position
            maximal_vertical_position_set: maximal_vertical_position = a_maximal_vertical_position

feature -- Access

    horizontal_line: INTEGER
            -- Number of horizontal scroll units per line

    horizontal_page: INTEGER
            -- Number of scroll units per page
        require
            window_exists: window.exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
        require
            window_exists: window.exists

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
        require
            window_exists: window.exists

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
        require
            window_exists: window.exists

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
        require
            window_exists: window.exists

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
        require
            window_exists: window.exists

    vertical_line: INTEGER
            -- Number of vertical scroll units per line

    vertical_page: INTEGER
            -- Number of scroll units per page
        require
            window_exists: window.exists

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
        require
            window_exists: window.exists

    window: WEL_COMPOSITE_WINDOW
            -- Window which has the scroller

feature -- Element change

    set_horizontal_line (unit: INTEGER)
            -- Set horizontal_line with unit.
        require
            positive_unit: unit >= 0
        ensure
            horizontal_line_set: horizontal_line = unit

    set_horizontal_page (page_magnitude: INTEGER)
            -- Set horizontal_page with unit.
        require
            window_exists: window.exists
            positive_unit: page_magnitude >= 0
        ensure
            horizontal_page_set: horizontal_page = page_magnitude

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
        require
            window_exists: window.exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set horizontal_minimum_range and
            -- horizontal_maximal_range with minimum and
            -- maximum.
        require
            window_exists: window.exists
            consistent_range: minimum <= maximum
        ensure
            horizontal_minimum_range_set: minimal_horizontal_position = minimum
            horizontal_maximal_range_set: maximal_horizontal_position = maximum

    set_vertical_line (unit: INTEGER)
            -- Set vertical_line with unit.
        require
            positive_unit: unit >= 0
        ensure
            vertical_line_set: vertical_line = unit

    set_vertical_page (page_magnitude: INTEGER)
            -- Set vertical_page with unit.
        require
            window_exists: window.exists
            positive_unit: page_magnitude >= 0
        ensure
            vertical_page_set: vertical_page = page_magnitude

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
        require
            window_exists: window.exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
        require
            window_exists: window.exists
            consistent_range: minimum <= maximum
        ensure
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

feature -- Basic operations

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
        require
            window_exists: window.exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure
            horizontal_position_set: horizontal_position = position

    on_horizontal_scroll (scroll_code, pos: INTEGER)
            -- Scroll the window horizontaly.
        require
            window_exists: window.exists

    on_vertical_scroll (scroll_code, pos: INTEGER)
            -- Scroll the window verticaly.
        require
            window_exists: window.exists

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
        require
            window_exists: window.exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure
            vertical_position_set: vertical_position = position

invariant

    window_not_void: window /= void
    horizontal_position_small_enough: window.exists implies horizontal_position <= maximal_horizontal_position
    horizontal_position_large_enough: window.exists implies horizontal_position >= minimal_horizontal_position
    vertical_position_small_enough: window.exists implies vertical_position <= maximal_vertical_position
    vertical_position_large_enough: window.exists implies vertical_position >= minimal_vertical_position
    consistent_horizontal_range: window.exists implies minimal_horizontal_position <= maximal_horizontal_position
    consistent_vertical_range: window.exists implies minimal_vertical_position <= maximal_vertical_position
    positive_horizontal_line: horizontal_line >= 0
    positive_vertical_line: vertical_line >= 0
    positive_horizontal_page: horizontal_page >= 0
    positive_vertical_page: vertical_page >= 0
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SCROLLER


WEL_SHARED_MEMORY Chart

deferred class
    WEL_SHARED_MEMORY

General
    cluster: wel.support
    description: "Represents windows shared memory"

Ancestors
    WEL_ANY

Queries
    accessible: BOOLEAN
    exists: BOOLEAN
    handle: POINTER
    item: POINTER
    shared: BOOLEAN
    size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    lock
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    unlock


WEL_SHARED_MEMORY Flat contracts

indexing
    description: "Represents windows shared memory"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_SHARED_MEMORY

feature -- Access

    accessible: BOOLEAN
            -- Is the memory (memory_item) locked and thus can be accessed?

    handle: POINTER
            -- Handle of access shared memory

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    size: INTEGER

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    lock
            -- Locks the memory and returns a pointer to the actual data

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    unlock
            -- Unlocks the memory

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SHARED_MEMORY


WEL_SHARED_MEMORY_STRING Chart

class
    WEL_SHARED_MEMORY_STRING

General
    cluster: wel.support
    description: "Represents windows shared memory"
    create: make_from_handle, make_from_string

Ancestors
    WEL_SHARED_MEMORY

Queries
    accessible: BOOLEAN
    exists: BOOLEAN
    handle: POINTER
    item: POINTER
    last_string: STRING
    shared: BOOLEAN
    size: INTEGER
    to_integer: INTEGER

Commands
    dispose
    lock
    make_from_string (a_string: STRING)
    retrieve_string
    set_item (an_item: POINTER)
    set_shared
    set_unshared
    unlock


WEL_SHARED_MEMORY_STRING Flat contracts

indexing
    description: "Represents windows shared memory"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SHARED_MEMORY_STRING

create

    make_from_handle (a_handle: POINTER)
            -- Set handle with a_handle.
            -- Since item is shared, it does not need
            -- to be freed.
            -- (from WEL_SHARED_MEMORY)
        ensure -- from WEL_SHARED_MEMORY
            handle_set: handle = a_handle
            shared: shared

    make_from_string (a_string: STRING)
            -- Create Current from a_string.

feature -- Initialization

    make_from_string (a_string: STRING)
            -- Create Current from a_string.

feature -- Access

    accessible: BOOLEAN
            -- Is the memory (memory_item) locked and thus can be accessed?
            -- (from WEL_SHARED_MEMORY)

    handle: POINTER
            -- Handle of access shared memory
            -- (from WEL_SHARED_MEMORY)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    last_string: STRING
            -- String created from shared memory.
            -- Only valid after a call to retrieve_string
            -- Note: Changes to this object will not be
            -- reflected in the shared memory

feature -- Status report

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    size: INTEGER
            -- (from WEL_SHARED_MEMORY)

feature -- Status setting

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

feature -- Element change

    lock
            -- Locks the memory and returns a pointer to the actual data
            -- (from WEL_SHARED_MEMORY)

    retrieve_string

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    unlock
            -- Unlocks the memory
            -- (from WEL_SHARED_MEMORY)

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SHARED_MEMORY_STRING


WEL_SYSTEM_METRICS Chart

class
    WEL_SYSTEM_METRICS

General
    cluster: wel.support
    description: "System metrics and system configuration settings informations."

Ancestors
    WEL_SM_CONSTANTS

Queries
    caption_height: INTEGER
    cursor_height: INTEGER
    cursor_width: INTEGER
    dbcs_installed: BOOLEAN
    debug_installed: BOOLEAN
    dialog_window_frame_height: INTEGER
    dialog_window_frame_width: INTEGER
    double_click_height: INTEGER
    double_click_width: INTEGER
    full_screen_client_area_height: INTEGER
    full_screen_client_area_width: INTEGER
    horizontal_scroll_bar_arrow_height: INTEGER
    horizontal_scroll_bar_arrow_width: INTEGER
    horizontal_scroll_bar_thumb_width: INTEGER
    icon_height: INTEGER
    icon_spacing_height: INTEGER
    icon_spacing_width: INTEGER
    icon_width: INTEGER
    kanji_window_height: INTEGER
    maximized_window_height: INTEGER
    maximized_window_width: INTEGER
    menu_bar_height: INTEGER
    mouse_button_swapped: BOOLEAN
    mouse_installed: BOOLEAN
    pen_installed: BOOLEAN
    popup_menu_right_aligned: BOOLEAN
    screen_height: INTEGER
    screen_width: INTEGER
    title_bar_height: INTEGER
    title_bar_width: INTEGER
    vertical_scroll_bar_arrow_height: INTEGER
    vertical_scroll_bar_arrow_width: INTEGER
    vertical_scroll_bar_thumb_height: INTEGER
    window_border_height: INTEGER
    window_border_width: INTEGER
    window_frame_height: INTEGER
    window_frame_width: INTEGER
    window_minimum_height: INTEGER
    window_minimum_width: INTEGER


WEL_SYSTEM_METRICS Flat contracts

indexing
    description: "System metrics and system configuration settings informations."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:32 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SYSTEM_METRICS

feature -- Status report

    caption_height: INTEGER
            -- Height of normal caption area

    cursor_height: INTEGER
            -- Height of the cursor

    cursor_width: INTEGER
            -- Width of the cursor

    dbcs_installed: BOOLEAN
            -- Is the double-byte character set (DBCS) version
            -- of USER.EXE installed?

    debug_installed: BOOLEAN
            -- Is the debugging version of USER.EXE installed?

    dialog_window_frame_height: INTEGER
            -- Height of window frame for window that
            -- has the Ws_dlgframe style

    dialog_window_frame_width: INTEGER
            -- Width of window frame for window that
            -- has the Ws_dlgframe style

    double_click_height: INTEGER
            -- Height of a rectangle around the location of a
            -- first click in a double-click sequence. The second
            -- click must occur within this rectangle for the
            -- system to consider the two clicks a double-click.

    double_click_width: INTEGER
            -- Width of a rectangle around the location of a
            -- first click in a double-click sequence. The second
            -- click must occur within this rectangle for the
            -- system to consider the two clicks a double-click.

    full_screen_client_area_height: INTEGER
            -- Height of the client area for a full-screen window

    full_screen_client_area_width: INTEGER
            -- Width of the client area for a full-screen window

    horizontal_scroll_bar_arrow_height: INTEGER
            -- Height of arrow bitmap on horizontal scrollbar

    horizontal_scroll_bar_arrow_width: INTEGER
            -- Width of arrow bitmap on horizontal scrollbar

    horizontal_scroll_bar_thumb_width: INTEGER

    icon_height: INTEGER
            -- Height of an icon

    icon_spacing_height: INTEGER
            -- Height of rectangular cell that Program Manager
            -- uses to position tiled icons

    icon_spacing_width: INTEGER
            -- Width of rectangular cell that Program Manager
            -- uses to position tiled icons

    icon_width: INTEGER
            -- Width of an icon

    kanji_window_height: INTEGER
            -- Height of the Kanji window at the bottom of the
            -- screen. For double-byte character set versions of
            -- Windows only.

    maximized_window_height: INTEGER
            -- Height of a maximized window

    maximized_window_width: INTEGER
            -- Width of a maximized window

    menu_bar_height: INTEGER
            -- Height of single-line menu bar

    mouse_button_swapped: BOOLEAN
            -- Are the meanings of the left and right mouse
            -- buttons swapped?

    mouse_installed: BOOLEAN
            -- Is a mouse installed?

    pen_installed: BOOLEAN
            -- Is a pen installed?

    popup_menu_right_aligned: BOOLEAN
            -- Are pop-up menus right-aligned relative to the
            -- corresponding menu-bar item?

    screen_height: INTEGER
            -- Screen height

    screen_width: INTEGER
            -- Screen width

    title_bar_height: INTEGER
            -- Height of bitmaps contained in title bar

    title_bar_width: INTEGER
            -- Width of bitmaps contained in title bar

    vertical_scroll_bar_arrow_height: INTEGER
            -- Height of arrow bitmap on vertical scrollbar

    vertical_scroll_bar_arrow_width: INTEGER
            -- Width of arrow bitmap on vertical scrollbar

    vertical_scroll_bar_thumb_height: INTEGER
            -- Height of vertical scrollbar thumb

    window_border_height: INTEGER
            -- Height of the border of a window

    window_border_width: INTEGER
            -- Width of the border of a window

    window_frame_height: INTEGER
            -- Height of window frame for a window
            -- that can be resized

    window_frame_width: INTEGER
            -- Width of window frame for a window
            -- that can be resized

    window_minimum_height: INTEGER
            -- Minimum height of a window

    window_minimum_width: INTEGER
            -- Minimum width of a window

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SYSTEM_METRICS


WEL_SYSTEM_PARAMETERS_INFO Chart

class
    WEL_SYSTEM_PARAMETERS_INFO

General
    cluster: wel.support
    description: "System Parameters and configuration settings informations."

Ancestors
    WEL_SPI_CONSTANTS

Queries
    get_non_client_metrics: WEL_NON_CLIENT_METRICS
    has_drag_full_windows: BOOLEAN
    has_windows_plus: BOOLEAN


WEL_SYSTEM_PARAMETERS_INFO Flat contracts

indexing
    description: "System Parameters and configuration settings informations."
    date: "$Date: 2001/11/12 17:58:32 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_SYSTEM_PARAMETERS_INFO

feature -- Status

    get_non_client_metrics: WEL_NON_CLIENT_METRICS
            -- Retrieves the metrics associated with the nonclient area of
            -- nonminimized windows.
            --
            -- Void if an error occurred.

    has_drag_full_windows: BOOLEAN
            -- Determines whether dragging of full windows is enabled.
            -- The pvParam parameter must point to a BOOL variable that
            -- receives TRUE if enabled, or FALSE otherwise.
            --
            -- Windows 95: This flag is supported only if Windows Plus!
            -- is installed. See SPI_GETWINDOWSEXTENSION.

    has_windows_plus: BOOLEAN
            -- Windows 95: Indicates whether the Windows extension,
            -- Windows Plus!, is installed. Set the uiParam parameter to 1.
            -- The pvParam parameter is not used. The function returns TRUE
            -- if the extension is installed, or FALSE if it is not.
        require
            is_windows_95: (create {WEL_WINDOWS_VERSION}).is_windows_95

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_SYSTEM_PARAMETERS_INFO


WEL_UNC_PATH_MAPPER Chart

class
    WEL_UNC_PATH_MAPPER

General
    cluster: wel.support
    description: "Objects that map a networking path to a local drive"
    create: make

Ancestors
    WEL_NETWORKING_CONSTANTS

Queries
    access_name: STRING

Commands
    destroy


WEL_UNC_PATH_MAPPER Flat contracts

indexing
    description: "Objects that map a networking path to a local drive"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:32 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_UNC_PATH_MAPPER

create

    make (a_path: STRING)
            -- Map the networking path a_path to a temporary path

feature -- Access

    access_name: STRING
            -- Local access to the mapped path.
            -- Example: "I:"

feature -- Removal

    destroy
            -- Unmap the network path

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UNC_PATH_MAPPER


WEL_UNIT_CONVERSION Chart

class
    WEL_UNIT_CONVERSION

General
    cluster: wel.support
    description: "Unit conversion."

Ancestors
    WEL_CAPABILITIES_CONSTANTS
    WEL_DT_CONSTANTS

Queries
    Himetric_per_inch: INTEGER
    himetric_to_pixel (a_size_in_himetric: WEL_SIZE): WEL_SIZE
    logical_to_pixel (hdc: WEL_DC; lo: INTEGER): INTEGER
    logical_to_point (hdc: WEL_DC; lo: INTEGER): INTEGER
    map_loghim_to_pixel (x, ppli: INTEGER): INTEGER
    map_pixel_to_loghim (x, ppli: INTEGER): INTEGER
    pixel_to_himetric (a_size_in_pixel: WEL_SIZE): WEL_SIZE
    pixel_to_logical (hdc: WEL_DC; pi: INTEGER): INTEGER
    pixel_to_point (hdc: WEL_DC; pi: INTEGER): INTEGER
    point_to_logical (hdc: WEL_DC; pt, divisor: INTEGER): INTEGER
    point_to_pixel (hdc: WEL_DC; pt, divisor: INTEGER): INTEGER


WEL_UNIT_CONVERSION Flat contracts

indexing
    description: "Unit conversion."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:32 $"
    revision: "$Revision: 1.1 $"

class interface
    WEL_UNIT_CONVERSION

feature -- Access

    Himetric_per_inch: INTEGER is 2540
            -- Defined as HIMETRIC_PER_INCH in AtlWin.h

feature -- Basic Operations

    himetric_to_pixel (a_size_in_himetric: WEL_SIZE): WEL_SIZE
            -- Convert himetric into pixels.
        require
            non_void_size: a_size_in_himetric /= void
        ensure
            non_void_result: Result /= void

    logical_to_pixel (hdc: WEL_DC; lo: INTEGER): INTEGER
            -- Convert lo expressed in logical unit into pixel unit.

    logical_to_point (hdc: WEL_DC; lo: INTEGER): INTEGER
            -- Convert a size lo expressed in logical unit into point.

    map_loghim_to_pixel (x, ppli: INTEGER): INTEGER
            -- Defined as MAP_LOGHIM_TO_PIX in AtlWin.h

    map_pixel_to_loghim (x, ppli: INTEGER): INTEGER
            -- Defined as MAP_PIX_TO_LOGHIM in AtlWin.h

    pixel_to_himetric (a_size_in_pixel: WEL_SIZE): WEL_SIZE
            -- Convert pixels into himetric.
        require
            non_void_size: a_size_in_pixel /= void
        ensure
            non_void_result: Result /= void

    pixel_to_logical (hdc: WEL_DC; pi: INTEGER): INTEGER
            -- Convert pi expressed in pixel unit into logical unit.

    pixel_to_point (hdc: WEL_DC; pi: INTEGER): INTEGER
            -- Convert a size pi expressed in pixel into point.

    point_to_logical (hdc: WEL_DC; pt, divisor: INTEGER): INTEGER
            -- Convert a size pt/divisor expressed in point into logical units.

    point_to_pixel (hdc: WEL_DC; pt, divisor: INTEGER): INTEGER
            -- Convert a size pt/divisor expressed in point into pixel.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UNIT_CONVERSION


WEL_UNPOSITIONABLE_CONTROL_CONTAINER Chart

class
    WEL_UNPOSITIONABLE_CONTROL_CONTAINER

General
    cluster: wel.support
    description: "A invisible control window used to store an unpositionnable window as a toolbar. This one is repositionned automatically. You can then put the window anywhere in another window."
    create: make

Ancestors
    WEL_CONTROL_WINDOW

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    Class_cursor: WEL_CURSOR
    Class_icon: WEL_ICON
    Class_menu_name: STRING
    Class_style: INTEGER
    Class_window_procedure: POINTER
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    Default_height: INTEGER
    Default_id: INTEGER
    default_processing: BOOLEAN
    Default_width: INTEGER
    Default_x: INTEGER
    Default_y: INTEGER
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    Maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    Maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window: WEL_WINDOW
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_window (a_window: WEL_WINDOW)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)

Constraints
    window not void
    window exists


WEL_UNPOSITIONABLE_CONTROL_CONTAINER Flat contracts

indexing
    description: "A invisible control window used to store an unpositionnable window as a toolbar. This one is repositionned automatically. You can then put the window anywhere in another window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:32 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_UNPOSITIONABLE_CONTROL_CONTAINER

create

    make (a_parent: WEL_COMPOSITE_WINDOW; a_window: WEL_WINDOW)
            -- Make the window as a child of a_parent and
            -- a_window as window.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
            -- (from WEL_CONTROL_WINDOW)
        require -- from WEL_CONTROL_WINDOW
            exists: exists
        ensure -- from WEL_CONTROL_WINDOW
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    window: WEL_WINDOW
            -- window inside the container window

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
            -- (from WEL_CONTROL_WINDOW)
        require -- from WEL_CONTROL_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_CONTROL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_CONTROL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_CONTROL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_CONTROL_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
            -- (from WEL_CONTROL_WINDOW)
        require -- from WEL_CONTROL_WINDOW
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure -- from WEL_CONTROL_WINDOW
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_window (a_window: WEL_WINDOW)
            -- Make a_window the new window.

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Destroy the window and quit the application
            -- if Current is the application's main window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_CONTROL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_CONTROL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Default creation values

    default_height: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_width.
            -- (from WEL_FRAME_WINDOW)

    default_id: INTEGER
            -- Default window id.
            -- (Zero by default).
            -- (from WEL_FRAME_WINDOW)

    default_width: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_x: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_y, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_y: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Standard window class values

    class_cursor: WEL_CURSOR
            -- Standard arrow cursor used to create the window
            -- class.
            -- Can be redefined to return a user-defined cursor.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_icon: WEL_ICON
            -- Standard application icon used to create the
            -- window class.
            -- Can be redefined to return a user-defined icon.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_menu_name: STRING
            -- Window's menu used to create the window class.
            -- Can be redefined to return a user-defined menu.
            -- (None by default).
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void

    class_style: INTEGER
            -- Standard style used to create the window class.
            -- Can be redefined to return a user-defined style.
            -- (from WEL_FRAME_WINDOW)

    class_window_procedure: POINTER
            -- Standard window procedure
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_null: Result /= default_pointer

invariant

    window_not_void: window /= void
    window_exists: window.exists
        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_UNPOSITIONABLE_CONTROL_CONTAINER


WEL_VERSION Chart

class
    WEL_VERSION

General
    cluster: wel.support
    description: "WEL version"

Ancestors
    ANY

Queries
    Description: STRING
    Major_version: INTEGER
    Minor_version: INTEGER


WEL_VERSION Flat contracts

indexing
    description: "WEL version"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:33 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_VERSION

feature -- Access

    Description: STRING is "Windows Eiffel Library version 2.4"

    Major_version: INTEGER is 2
            -- Major version of WEL

    Minor_version: INTEGER is 4
            -- Minor version of WEL

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_VERSION


WEL_WINDOWS_ERROR_MESSAGES Chart

class
    WEL_WINDOWS_ERROR_MESSAGES

General
    cluster: wel.support
    description: "Windows error messages in human-readable form."

Ancestors
    ANY

Queries
    Dns_error_autozone_already_exists_text: STRING
    Dns_error_autozone_already_exists_value: INTEGER
    Dns_error_axfr_text: STRING
    Dns_error_axfr_value: INTEGER
    Dns_error_bad_packet_text: STRING
    Dns_error_bad_packet_value: INTEGER
    Dns_error_cname_collision_text: STRING
    Dns_error_cname_collision_value: INTEGER
    Dns_error_cname_loop_text: STRING
    Dns_error_cname_loop_value: INTEGER
    Dns_error_datafile_open_failure_text: STRING
    Dns_error_datafile_open_failure_value: INTEGER
    Dns_error_datafile_parsing_text: STRING
    Dns_error_datafile_parsing_value: INTEGER
    Dns_error_ds_unavailable_text: STRING
    Dns_error_ds_unavailable_value: INTEGER
    Dns_error_ds_zone_already_exists_text: STRING
    Dns_error_ds_zone_already_exists_value: INTEGER
    Dns_error_file_writeback_failed_text: STRING
    Dns_error_file_writeback_failed_value: INTEGER
    Dns_error_invalid_datafile_name_text: STRING
    Dns_error_invalid_datafile_name_value: INTEGER
    Dns_error_invalid_ip_address_text: STRING
    Dns_error_invalid_ip_address_value: INTEGER
    Dns_error_invalid_name_char_text: STRING
    Dns_error_invalid_name_char_value: INTEGER
    Dns_error_invalid_property_text: STRING
    Dns_error_invalid_property_value: INTEGER
    Dns_error_invalid_type_text: STRING
    Dns_error_invalid_type_value: INTEGER
    Dns_error_invalid_zone_operation_text: STRING
    Dns_error_invalid_zone_operation_value: INTEGER
    Dns_error_invalid_zone_type_text: STRING
    Dns_error_invalid_zone_type_value: INTEGER
    Dns_error_name_does_not_exist_text: STRING
    Dns_error_name_does_not_exist_value: INTEGER
    Dns_error_name_not_in_zone_text: STRING
    Dns_error_name_not_in_zone_value: INTEGER
    Dns_error_nbstat_init_failed_text: STRING
    Dns_error_nbstat_init_failed_value: INTEGER
    Dns_error_need_secondary_addresses_text: STRING
    Dns_error_need_secondary_addresses_value: INTEGER
    Dns_error_need_wins_servers_text: STRING
    Dns_error_need_wins_servers_value: INTEGER
    Dns_error_no_bootfile_if_ds_zone_text: STRING
    Dns_error_no_bootfile_if_ds_zone_value: INTEGER
    Dns_error_no_create_cache_data_text: STRING
    Dns_error_no_create_cache_data_value: INTEGER
    Dns_error_no_dns_servers_text: STRING
    Dns_error_no_dns_servers_value: INTEGER
    Dns_error_no_packet_text: STRING
    Dns_error_no_packet_value: INTEGER
    Dns_error_no_tcpip_text: STRING
    Dns_error_no_tcpip_value: INTEGER
    Dns_error_no_zone_info_text: STRING
    Dns_error_no_zone_info_value: INTEGER
    Dns_error_node_creation_failed_text: STRING
    Dns_error_node_creation_failed_value: INTEGER
    Dns_error_node_is_cname_text: STRING
    Dns_error_node_is_cname_value: INTEGER
    Dns_error_non_rfc_name_text: STRING
    Dns_error_non_rfc_name_value: INTEGER
    Dns_error_not_unique_text: STRING
    Dns_error_not_unique_value: INTEGER
    Dns_error_numeric_name_text: STRING
    Dns_error_numeric_name_value: INTEGER
    Dns_error_primary_requires_datafile_text: STRING
    Dns_error_primary_requires_datafile_value: INTEGER
    Dns_error_rcode_badkey_text: STRING
    Dns_error_rcode_badkey_value: INTEGER
    Dns_error_rcode_badsig_text: STRING
    Dns_error_rcode_badsig_value: INTEGER
    Dns_error_rcode_badtime_text: STRING
    Dns_error_rcode_badtime_value: INTEGER
    Dns_error_rcode_format_error_text: STRING
    Dns_error_rcode_format_error_value: INTEGER
    Dns_error_rcode_name_error_text: STRING
    Dns_error_rcode_name_error_value: INTEGER
    Dns_error_rcode_not_implemented_text: STRING
    Dns_error_rcode_not_implemented_value: INTEGER
    Dns_error_rcode_notauth_text: STRING
    Dns_error_rcode_notauth_value: INTEGER
    Dns_error_rcode_notzone_text: STRING
    Dns_error_rcode_notzone_value: INTEGER
    Dns_error_rcode_nxrrset_text: STRING
    Dns_error_rcode_nxrrset_value: INTEGER
    Dns_error_rcode_refused_text: STRING
    Dns_error_rcode_refused_value: INTEGER
    Dns_error_rcode_server_failure_text: STRING
    Dns_error_rcode_server_failure_value: INTEGER
    Dns_error_rcode_text: STRING
    Dns_error_rcode_value: INTEGER
    Dns_error_rcode_yxdomain_text: STRING
    Dns_error_rcode_yxdomain_value: INTEGER
    Dns_error_rcode_yxrrset_text: STRING
    Dns_error_rcode_yxrrset_value: INTEGER
    Dns_error_record_already_exists_text: STRING
    Dns_error_record_already_exists_value: INTEGER
    Dns_error_record_does_not_exist_text: STRING
    Dns_error_record_does_not_exist_value: INTEGER
    Dns_error_record_format_text: STRING
    Dns_error_record_format_value: INTEGER
    Dns_error_record_only_at_zone_root_text: STRING
    Dns_error_record_only_at_zone_root_value: INTEGER
    Dns_error_record_timed_out_text: STRING
    Dns_error_record_timed_out_value: INTEGER
    Dns_error_secondary_data_text: STRING
    Dns_error_secondary_data_value: INTEGER
    Dns_error_secondary_requires_master_ip_text: STRING
    Dns_error_secondary_requires_master_ip_value: INTEGER
    Dns_error_soa_delete_invalid_text: STRING
    Dns_error_soa_delete_invalid_value: INTEGER
    Dns_error_try_again_later_text: STRING
    Dns_error_try_again_later_value: INTEGER
    Dns_error_unknown_record_type_text: STRING
    Dns_error_unknown_record_type_value: INTEGER
    Dns_error_unsecure_packet_text: STRING
    Dns_error_unsecure_packet_value: INTEGER
    Dns_error_wins_init_failed_text: STRING
    Dns_error_wins_init_failed_value: INTEGER
    Dns_error_zone_already_exists_text: STRING
    Dns_error_zone_already_exists_value: INTEGER
    Dns_error_zone_configuration_error_text: STRING
    Dns_error_zone_configuration_error_value: INTEGER
    Dns_error_zone_creation_failed_text: STRING
    Dns_error_zone_creation_failed_value: INTEGER
    Dns_error_zone_does_not_exist_text: STRING
    Dns_error_zone_does_not_exist_value: INTEGER
    Dns_error_zone_has_no_ns_records_text: STRING
    Dns_error_zone_has_no_ns_records_value: INTEGER
    Dns_error_zone_has_no_soa_record_text: STRING
    Dns_error_zone_has_no_soa_record_value: INTEGER
    Dns_error_zone_locked_text: STRING
    Dns_error_zone_locked_value: INTEGER
    Dns_error_zone_not_secondary_text: STRING
    Dns_error_zone_not_secondary_value: INTEGER
    Dns_info_added_local_wins_text: STRING
    Dns_info_added_local_wins_value: INTEGER
    Dns_info_axfr_complete_text: STRING
    Dns_info_axfr_complete_value: INTEGER
    Dns_info_no_records_text: STRING
    Dns_info_no_records_value: INTEGER
    Dns_status_continue_needed_text: STRING
    Dns_status_continue_needed_value: INTEGER
    Dns_status_dotted_name_text: STRING
    Dns_status_dotted_name_value: INTEGER
    Dns_status_fqdn_text: STRING
    Dns_status_fqdn_value: INTEGER
    Dns_status_single_part_name_text: STRING
    Dns_status_single_part_name_value: INTEGER
    Dns_warning_domain_undeleted_text: STRING
    Dns_warning_domain_undeleted_value: INTEGER
    Dns_warning_ptr_create_failed_text: STRING
    Dns_warning_ptr_create_failed_value: INTEGER
    Ept_s_cant_create_text: STRING
    Ept_s_cant_create_value: INTEGER
    Ept_s_cant_perform_op_text: STRING
    Ept_s_cant_perform_op_value: INTEGER
    Ept_s_invalid_entry_text: STRING
    Ept_s_invalid_entry_value: INTEGER
    Ept_s_not_registered_text: STRING
    Ept_s_not_registered_value: INTEGER
    Error_access_denied_text: STRING
    Error_access_denied_value: INTEGER
    Error_account_disabled_text: STRING
    Error_account_disabled_value: INTEGER
    Error_account_expired_text: STRING
    Error_account_expired_value: INTEGER
    Error_account_locked_out_text: STRING
    Error_account_locked_out_value: INTEGER
    Error_account_restriction_text: STRING
    Error_account_restriction_value: INTEGER
    Error_active_connections_text: STRING
    Error_active_connections_value: INTEGER
    Error_adap_hdw_err_text: STRING
    Error_adap_hdw_err_value: INTEGER
    Error_address_already_associated_text: STRING
    Error_address_already_associated_value: INTEGER
    Error_address_not_associated_text: STRING
    Error_address_not_associated_value: INTEGER
    Error_alias_exists_text: STRING
    Error_alias_exists_value: INTEGER
    Error_all_nodes_not_available_text: STRING
    Error_all_nodes_not_available_value: INTEGER
    Error_allotted_space_exceeded_text: STRING
    Error_allotted_space_exceeded_value: INTEGER
    Error_already_assigned_text: STRING
    Error_already_assigned_value: INTEGER
    Error_already_exists_text: STRING
    Error_already_exists_value: INTEGER
    Error_already_initialized_text: STRING
    Error_already_initialized_value: INTEGER
    Error_already_registered_text: STRING
    Error_already_registered_value: INTEGER
    Error_already_running_lkg_text: STRING
    Error_already_running_lkg_value: INTEGER
    Error_already_waiting_text: STRING
    Error_already_waiting_value: INTEGER
    Error_app_wrong_os_text: STRING
    Error_app_wrong_os_value: INTEGER
    Error_arena_trashed_text: STRING
    Error_arena_trashed_value: INTEGER
    Error_arithmetic_overflow_text: STRING
    Error_arithmetic_overflow_value: INTEGER
    Error_atomic_locks_not_supported_text: STRING
    Error_atomic_locks_not_supported_value: INTEGER
    Error_autodataseg_exceeds_64k_text: STRING
    Error_autodataseg_exceeds_64k_value: INTEGER
    Error_bad_arguments_text: STRING
    Error_bad_arguments_value: INTEGER
    Error_bad_command_text: STRING
    Error_bad_command_value: INTEGER
    Error_bad_configuration_text: STRING
    Error_bad_configuration_value: INTEGER
    Error_bad_descriptor_format_text: STRING
    Error_bad_descriptor_format_value: INTEGER
    Error_bad_dev_type_text: STRING
    Error_bad_dev_type_value: INTEGER
    Error_bad_device_text: STRING
    Error_bad_device_value: INTEGER
    Error_bad_driver_level_text: STRING
    Error_bad_driver_level_value: INTEGER
    Error_bad_driver_text: STRING
    Error_bad_driver_value: INTEGER
    Error_bad_environment_text: STRING
    Error_bad_environment_value: INTEGER
    Error_bad_exe_format_text: STRING
    Error_bad_exe_format_value: INTEGER
    Error_bad_format_text: STRING
    Error_bad_format_value: INTEGER
    Error_bad_impersonation_level_text: STRING
    Error_bad_impersonation_level_value: INTEGER
    Error_bad_inheritance_acl_text: STRING
    Error_bad_inheritance_acl_value: INTEGER
    Error_bad_length_text: STRING
    Error_bad_length_value: INTEGER
    Error_bad_logon_session_state_text: STRING
    Error_bad_logon_session_state_value: INTEGER
    Error_bad_net_name_text: STRING
    Error_bad_net_name_value: INTEGER
    Error_bad_net_resp_text: STRING
    Error_bad_net_resp_value: INTEGER
    Error_bad_netpath_text: STRING
    Error_bad_netpath_value: INTEGER
    Error_bad_pathname_text: STRING
    Error_bad_pathname_value: INTEGER
    Error_bad_pipe_text: STRING
    Error_bad_pipe_value: INTEGER
    Error_bad_profile_text: STRING
    Error_bad_profile_value: INTEGER
    Error_bad_provider_text: STRING
    Error_bad_provider_value: INTEGER
    Error_bad_query_syntax_text: STRING
    Error_bad_query_syntax_value: INTEGER
    Error_bad_rem_adap_text: STRING
    Error_bad_rem_adap_value: INTEGER
    Error_bad_threadid_addr_text: STRING
    Error_bad_threadid_addr_value: INTEGER
    Error_bad_token_type_text: STRING
    Error_bad_token_type_value: INTEGER
    Error_bad_unit_text: STRING
    Error_bad_unit_value: INTEGER
    Error_bad_user_profile_text: STRING
    Error_bad_user_profile_value: INTEGER
    Error_bad_username_text: STRING
    Error_bad_username_value: INTEGER
    Error_bad_validation_class_text: STRING
    Error_bad_validation_class_value: INTEGER
    Error_baddb_text: STRING
    Error_baddb_value: INTEGER
    Error_badkey_text: STRING
    Error_badkey_value: INTEGER
    Error_beginning_of_media_text: STRING
    Error_beginning_of_media_value: INTEGER
    Error_boot_already_accepted_text: STRING
    Error_boot_already_accepted_value: INTEGER
    Error_broken_pipe_text: STRING
    Error_broken_pipe_value: INTEGER
    Error_buffer_overflow_text: STRING
    Error_buffer_overflow_value: INTEGER
    Error_bus_reset_text: STRING
    Error_bus_reset_value: INTEGER
    Error_busy_drive_text: STRING
    Error_busy_drive_value: INTEGER
    Error_busy_text: STRING
    Error_busy_value: INTEGER
    Error_call_not_implemented_text: STRING
    Error_call_not_implemented_value: INTEGER
    Error_can_not_complete_text: STRING
    Error_can_not_complete_value: INTEGER
    Error_can_not_del_local_wins_text: STRING
    Error_can_not_del_local_wins_value: INTEGER
    Error_cancel_violation_text: STRING
    Error_cancel_violation_value: INTEGER
    Error_cancelled_text: STRING
    Error_cancelled_value: INTEGER
    Error_cannot_copy_text: STRING
    Error_cannot_copy_value: INTEGER
    Error_cannot_detect_driver_failure_text: STRING
    Error_cannot_detect_driver_failure_value: INTEGER
    Error_cannot_detect_process_abort_text: STRING
    Error_cannot_detect_process_abort_value: INTEGER
    Error_cannot_find_wnd_class_text: STRING
    Error_cannot_find_wnd_class_value: INTEGER
    Error_cannot_impersonate_text: STRING
    Error_cannot_impersonate_value: INTEGER
    Error_cannot_make_text: STRING
    Error_cannot_make_value: INTEGER
    Error_cannot_open_profile_text: STRING
    Error_cannot_open_profile_value: INTEGER
    Error_cant_access_domain_info_text: STRING
    Error_cant_access_domain_info_value: INTEGER
    Error_cant_access_file_text: STRING
    Error_cant_access_file_value: INTEGER
    Error_cant_delete_last_item_text: STRING
    Error_cant_delete_last_item_value: INTEGER
    Error_cant_disable_mandatory_text: STRING
    Error_cant_disable_mandatory_value: INTEGER
    Error_cant_evict_active_node_text: STRING
    Error_cant_evict_active_node_value: INTEGER
    Error_cant_open_anonymous_text: STRING
    Error_cant_open_anonymous_value: INTEGER
    Error_cant_resolve_filename_text: STRING
    Error_cant_resolve_filename_value: INTEGER
    Error_cantopen_text: STRING
    Error_cantopen_value: INTEGER
    Error_cantread_text: STRING
    Error_cantread_value: INTEGER
    Error_cantwrite_text: STRING
    Error_cantwrite_value: INTEGER
    Error_child_must_be_volatile_text: STRING
    Error_child_must_be_volatile_value: INTEGER
    Error_child_not_complete_text: STRING
    Error_child_not_complete_value: INTEGER
    Error_child_window_menu_text: STRING
    Error_child_window_menu_value: INTEGER
    Error_circular_dependency_text: STRING
    Error_circular_dependency_value: INTEGER
    Error_class_already_exists_text: STRING
    Error_class_already_exists_value: INTEGER
    Error_class_does_not_exist_text: STRING
    Error_class_does_not_exist_value: INTEGER
    Error_class_has_windows_text: STRING
    Error_class_has_windows_value: INTEGER
    Error_cleaner_cartridge_spent_text: STRING
    Error_cleaner_cartridge_spent_value: INTEGER
    Error_cleaner_slot_not_set_text: STRING
    Error_cleaner_slot_not_set_value: INTEGER
    Error_cleaner_slot_set_text: STRING
    Error_cleaner_slot_set_value: INTEGER
    Error_clipboard_not_open_text: STRING
    Error_clipboard_not_open_value: INTEGER
    Error_clipping_not_supported_text: STRING
    Error_clipping_not_supported_value: INTEGER
    Error_cluster_database_seqmismatch_text: STRING
    Error_cluster_database_seqmismatch_value: INTEGER
    Error_cluster_gum_not_locker_text: STRING
    Error_cluster_gum_not_locker_value: INTEGER
    Error_cluster_incompatible_versions_text: STRING
    Error_cluster_incompatible_versions_value: INTEGER
    Error_cluster_invalid_network_provider_text: STRING
    Error_cluster_invalid_network_provider_value: INTEGER
    Error_cluster_invalid_network_text: STRING
    Error_cluster_invalid_network_value: INTEGER
    Error_cluster_invalid_node_text: STRING
    Error_cluster_invalid_node_value: INTEGER
    Error_cluster_invalid_request_text: STRING
    Error_cluster_invalid_request_value: INTEGER
    Error_cluster_ipaddr_in_use_text: STRING
    Error_cluster_ipaddr_in_use_value: INTEGER
    Error_cluster_join_aborted_text: STRING
    Error_cluster_join_aborted_value: INTEGER
    Error_cluster_join_in_progress_text: STRING
    Error_cluster_join_in_progress_value: INTEGER
    Error_cluster_join_not_in_progress_text: STRING
    Error_cluster_join_not_in_progress_value: INTEGER
    Error_cluster_last_internal_network_text: STRING
    Error_cluster_last_internal_network_value: INTEGER
    Error_cluster_local_node_not_found_text: STRING
    Error_cluster_local_node_not_found_value: INTEGER
    Error_cluster_maxnum_of_resources_exceeded_text: STRING
    Error_cluster_maxnum_of_resources_exceeded_value: INTEGER
    Error_cluster_netinterface_exists_text: STRING
    Error_cluster_netinterface_exists_value: INTEGER
    Error_cluster_netinterface_not_found_text: STRING
    Error_cluster_netinterface_not_found_value: INTEGER
    Error_cluster_network_already_offline_text: STRING
    Error_cluster_network_already_offline_value: INTEGER
    Error_cluster_network_already_online_text: STRING
    Error_cluster_network_already_online_value: INTEGER
    Error_cluster_network_exists_text: STRING
    Error_cluster_network_exists_value: INTEGER
    Error_cluster_network_has_dependents_text: STRING
    Error_cluster_network_has_dependents_value: INTEGER
    Error_cluster_network_not_found_text: STRING
    Error_cluster_network_not_found_value: INTEGER
    Error_cluster_network_not_internal_text: STRING
    Error_cluster_network_not_internal_value: INTEGER
    Error_cluster_no_rpc_packages_registered_text: STRING
    Error_cluster_no_rpc_packages_registered_value: INTEGER
    Error_cluster_no_security_context_text: STRING
    Error_cluster_no_security_context_value: INTEGER
    Error_cluster_node_already_down_text: STRING
    Error_cluster_node_already_down_value: INTEGER
    Error_cluster_node_already_has_dfs_root_text: STRING
    Error_cluster_node_already_has_dfs_root_value: INTEGER
    Error_cluster_node_already_member_text: STRING
    Error_cluster_node_already_member_value: INTEGER
    Error_cluster_node_already_up_text: STRING
    Error_cluster_node_already_up_value: INTEGER
    Error_cluster_node_down_text: STRING
    Error_cluster_node_down_value: INTEGER
    Error_cluster_node_exists_text: STRING
    Error_cluster_node_exists_value: INTEGER
    Error_cluster_node_not_found_text: STRING
    Error_cluster_node_not_found_value: INTEGER
    Error_cluster_node_not_member_text: STRING
    Error_cluster_node_not_member_value: INTEGER
    Error_cluster_node_not_paused_text: STRING
    Error_cluster_node_not_paused_value: INTEGER
    Error_cluster_node_not_ready_text: STRING
    Error_cluster_node_not_ready_value: INTEGER
    Error_cluster_node_paused_text: STRING
    Error_cluster_node_paused_value: INTEGER
    Error_cluster_node_shutting_down_text: STRING
    Error_cluster_node_shutting_down_value: INTEGER
    Error_cluster_node_unreachable_text: STRING
    Error_cluster_node_unreachable_value: INTEGER
    Error_cluster_node_up_text: STRING
    Error_cluster_node_up_value: INTEGER
    Error_cluster_owner_not_in_preflist_text: STRING
    Error_cluster_owner_not_in_preflist_value: INTEGER
    Error_cluster_resname_not_found_text: STRING
    Error_cluster_resname_not_found_value: INTEGER
    Error_cluster_resource_type_not_found_text: STRING
    Error_cluster_resource_type_not_found_value: INTEGER
    Error_cluster_restype_not_supported_text: STRING
    Error_cluster_restype_not_supported_value: INTEGER
    Error_cluster_shutting_down_text: STRING
    Error_cluster_shutting_down_value: INTEGER
    Error_cluster_system_config_changed_text: STRING
    Error_cluster_system_config_changed_value: INTEGER
    Error_clusterlog_chkpoint_not_found_text: STRING
    Error_clusterlog_chkpoint_not_found_value: INTEGER
    Error_clusterlog_corrupt_text: STRING
    Error_clusterlog_corrupt_value: INTEGER
    Error_clusterlog_exceeds_maxsize_text: STRING
    Error_clusterlog_exceeds_maxsize_value: INTEGER
    Error_clusterlog_not_enough_space_text: STRING
    Error_clusterlog_not_enough_space_value: INTEGER
    Error_clusterlog_record_exceeds_maxsize_text: STRING
    Error_clusterlog_record_exceeds_maxsize_value: INTEGER
    Error_colorspace_mismatch_text: STRING
    Error_colorspace_mismatch_value: INTEGER
    Error_commitment_limit_text: STRING
    Error_commitment_limit_value: INTEGER
    Error_connected_other_password_text: STRING
    Error_connected_other_password_value: INTEGER
    Error_connection_aborted_text: STRING
    Error_connection_aborted_value: INTEGER
    Error_connection_active_text: STRING
    Error_connection_active_value: INTEGER
    Error_connection_count_limit_text: STRING
    Error_connection_count_limit_value: INTEGER
    Error_connection_invalid_text: STRING
    Error_connection_invalid_value: INTEGER
    Error_connection_refused_text: STRING
    Error_connection_refused_value: INTEGER
    Error_connection_unavail_text: STRING
    Error_connection_unavail_value: INTEGER
    Error_continue_text: STRING
    Error_continue_value: INTEGER
    Error_control_id_not_found_text: STRING
    Error_control_id_not_found_value: INTEGER
    Error_controlling_ieport_text: STRING
    Error_controlling_ieport_value: INTEGER
    Error_core_resource_text: STRING
    Error_core_resource_value: INTEGER
    Error_counter_timeout_text: STRING
    Error_counter_timeout_value: INTEGER
    Error_crc_text: STRING
    Error_crc_value: INTEGER
    Error_create_failed_text: STRING
    Error_create_failed_value: INTEGER
    Error_ctx_bad_video_mode_text: STRING
    Error_ctx_bad_video_mode_value: INTEGER
    Error_ctx_cannot_make_eventlog_entry_text: STRING
    Error_ctx_cannot_make_eventlog_entry_value: INTEGER
    Error_ctx_client_license_in_use_text: STRING
    Error_ctx_client_license_in_use_value: INTEGER
    Error_ctx_client_license_not_set_text: STRING
    Error_ctx_client_license_not_set_value: INTEGER
    Error_ctx_client_query_timeout_text: STRING
    Error_ctx_client_query_timeout_value: INTEGER
    Error_ctx_close_pending_text: STRING
    Error_ctx_close_pending_value: INTEGER
    Error_ctx_console_connect_text: STRING
    Error_ctx_console_connect_value: INTEGER
    Error_ctx_console_disconnect_text: STRING
    Error_ctx_console_disconnect_value: INTEGER
    Error_ctx_graphics_invalid_text: STRING
    Error_ctx_graphics_invalid_value: INTEGER
    Error_ctx_invalid_modemname_text: STRING
    Error_ctx_invalid_modemname_value: INTEGER
    Error_ctx_invalid_pd_text: STRING
    Error_ctx_invalid_pd_value: INTEGER
    Error_ctx_invalid_wd_text: STRING
    Error_ctx_invalid_wd_value: INTEGER
    Error_ctx_license_client_invalid_text: STRING
    Error_ctx_license_client_invalid_value: INTEGER
    Error_ctx_license_expired_text: STRING
    Error_ctx_license_expired_value: INTEGER
    Error_ctx_license_not_available_text: STRING
    Error_ctx_license_not_available_value: INTEGER
    Error_ctx_logon_disabled_text: STRING
    Error_ctx_logon_disabled_value: INTEGER
    Error_ctx_modem_inf_not_found_text: STRING
    Error_ctx_modem_inf_not_found_value: INTEGER
    Error_ctx_modem_response_busy_text: STRING
    Error_ctx_modem_response_busy_value: INTEGER
    Error_ctx_modem_response_error_text: STRING
    Error_ctx_modem_response_error_value: INTEGER
    Error_ctx_modem_response_no_carrier_text: STRING
    Error_ctx_modem_response_no_carrier_value: INTEGER
    Error_ctx_modem_response_no_dialtone_text: STRING
    Error_ctx_modem_response_no_dialtone_value: INTEGER
    Error_ctx_modem_response_timeout_text: STRING
    Error_ctx_modem_response_timeout_value: INTEGER
    Error_ctx_modem_response_voice_text: STRING
    Error_ctx_modem_response_voice_value: INTEGER
    Error_ctx_no_outbuf_text: STRING
    Error_ctx_no_outbuf_value: INTEGER
    Error_ctx_not_console_text: STRING
    Error_ctx_not_console_value: INTEGER
    Error_ctx_pd_not_found_text: STRING
    Error_ctx_pd_not_found_value: INTEGER
    Error_ctx_service_name_collision_text: STRING
    Error_ctx_service_name_collision_value: INTEGER
    Error_ctx_shadow_denied_text: STRING
    Error_ctx_shadow_denied_value: INTEGER
    Error_ctx_shadow_disabled_text: STRING
    Error_ctx_shadow_disabled_value: INTEGER
    Error_ctx_shadow_invalid_text: STRING
    Error_ctx_shadow_invalid_value: INTEGER
    Error_ctx_td_error_text: STRING
    Error_ctx_td_error_value: INTEGER
    Error_ctx_wd_not_found_text: STRING
    Error_ctx_wd_not_found_value: INTEGER
    Error_ctx_winstation_access_denied_text: STRING
    Error_ctx_winstation_access_denied_value: INTEGER
    Error_ctx_winstation_already_exists_text: STRING
    Error_ctx_winstation_already_exists_value: INTEGER
    Error_ctx_winstation_busy_text: STRING
    Error_ctx_winstation_busy_value: INTEGER
    Error_ctx_winstation_name_invalid_text: STRING
    Error_ctx_winstation_name_invalid_value: INTEGER
    Error_ctx_winstation_not_found_text: STRING
    Error_ctx_winstation_not_found_value: INTEGER
    Error_current_directory_text: STRING
    Error_current_directory_value: INTEGER
    Error_database_backup_corrupt_text: STRING
    Error_database_backup_corrupt_value: INTEGER
    Error_database_does_not_exist_text: STRING
    Error_database_does_not_exist_value: INTEGER
    Error_database_failure_text: STRING
    Error_database_failure_value: INTEGER
    Error_database_full_text: STRING
    Error_database_full_value: INTEGER
    Error_datatype_mismatch_text: STRING
    Error_datatype_mismatch_value: INTEGER
    Error_dc_not_found_text: STRING
    Error_dc_not_found_value: INTEGER
    Error_dde_fail_text: STRING
    Error_dde_fail_value: INTEGER
    Error_decryption_failed_text: STRING
    Error_decryption_failed_value: INTEGER
    Error_deleting_icm_xform_text: STRING
    Error_deleting_icm_xform_value: INTEGER
    Error_dependency_already_exists_text: STRING
    Error_dependency_already_exists_value: INTEGER
    Error_dependency_not_allowed_text: STRING
    Error_dependency_not_allowed_value: INTEGER
    Error_dependency_not_found_text: STRING
    Error_dependency_not_found_value: INTEGER
    Error_dependent_resource_exists_text: STRING
    Error_dependent_resource_exists_value: INTEGER
    Error_dependent_services_running_text: STRING
    Error_dependent_services_running_value: INTEGER
    Error_destination_element_full_text: STRING
    Error_destination_element_full_value: INTEGER
    Error_destroy_object_of_other_thread_text: STRING
    Error_destroy_object_of_other_thread_value: INTEGER
    Error_dev_not_exist_text: STRING
    Error_dev_not_exist_value: INTEGER
    Error_device_already_remembered_text: STRING
    Error_device_already_remembered_value: INTEGER
    Error_device_door_open_text: STRING
    Error_device_door_open_value: INTEGER
    Error_device_in_use_text: STRING
    Error_device_in_use_value: INTEGER
    Error_device_not_available_text: STRING
    Error_device_not_available_value: INTEGER
    Error_device_not_connected_text: STRING
    Error_device_not_connected_value: INTEGER
    Error_device_not_partitioned_text: STRING
    Error_device_not_partitioned_value: INTEGER
    Error_device_reinitialization_needed_text: STRING
    Error_device_reinitialization_needed_value: INTEGER
    Error_device_removed_text: STRING
    Error_device_removed_value: INTEGER
    Error_device_requires_cleaning_text: STRING
    Error_device_requires_cleaning_value: INTEGER
    Error_dhcp_address_conflict_text: STRING
    Error_dhcp_address_conflict_value: INTEGER
    Error_different_service_account_text: STRING
    Error_different_service_account_value: INTEGER
    Error_dir_efs_disallowed_text: STRING
    Error_dir_efs_disallowed_value: INTEGER
    Error_dir_not_empty_text: STRING
    Error_dir_not_empty_value: INTEGER
    Error_dir_not_root_text: STRING
    Error_dir_not_root_value: INTEGER
    Error_direct_access_handle_text: STRING
    Error_direct_access_handle_value: INTEGER
    Error_directory_text: STRING
    Error_directory_value: INTEGER
    Error_discarded_text: STRING
    Error_discarded_value: INTEGER
    Error_disk_change_text: STRING
    Error_disk_change_value: INTEGER
    Error_disk_corrupt_text: STRING
    Error_disk_corrupt_value: INTEGER
    Error_disk_full_text: STRING
    Error_disk_full_value: INTEGER
    Error_disk_operation_failed_text: STRING
    Error_disk_operation_failed_value: INTEGER
    Error_disk_recalibrate_failed_text: STRING
    Error_disk_recalibrate_failed_value: INTEGER
    Error_disk_reset_failed_text: STRING
    Error_disk_reset_failed_value: INTEGER
    Error_dll_init_failed_text: STRING
    Error_dll_init_failed_value: INTEGER
    Error_dll_not_found_text: STRING
    Error_dll_not_found_value: INTEGER
    Error_domain_controller_exists_text: STRING
    Error_domain_controller_exists_value: INTEGER
    Error_domain_controller_not_found_text: STRING
    Error_domain_controller_not_found_value: INTEGER
    Error_domain_exists_text: STRING
    Error_domain_exists_value: INTEGER
    Error_domain_limit_exceeded_text: STRING
    Error_domain_limit_exceeded_value: INTEGER
    Error_domain_trust_inconsistent_text: STRING
    Error_domain_trust_inconsistent_value: INTEGER
    Error_drive_locked_text: STRING
    Error_drive_locked_value: INTEGER
    Error_drive_media_mismatch_text: STRING
    Error_drive_media_mismatch_value: INTEGER
    Error_ds_add_replica_inhibited_text: STRING
    Error_ds_add_replica_inhibited_value: INTEGER
    Error_ds_admin_limit_exceeded_text: STRING
    Error_ds_admin_limit_exceeded_value: INTEGER
    Error_ds_affects_multiple_dsas_text: STRING
    Error_ds_affects_multiple_dsas_value: INTEGER
    Error_ds_alias_deref_problem_text: STRING
    Error_ds_alias_deref_problem_value: INTEGER
    Error_ds_alias_points_to_alias_text: STRING
    Error_ds_alias_points_to_alias_value: INTEGER
    Error_ds_alias_problem_text: STRING
    Error_ds_alias_problem_value: INTEGER
    Error_ds_aliased_obj_missing_text: STRING
    Error_ds_aliased_obj_missing_value: INTEGER
    Error_ds_att_already_exists_text: STRING
    Error_ds_att_already_exists_value: INTEGER
    Error_ds_att_is_not_on_obj_text: STRING
    Error_ds_att_is_not_on_obj_value: INTEGER
    Error_ds_att_not_def_for_class_text: STRING
    Error_ds_att_not_def_for_class_value: INTEGER
    Error_ds_att_not_def_in_schema_text: STRING
    Error_ds_att_not_def_in_schema_value: INTEGER
    Error_ds_att_schema_req_id_text: STRING
    Error_ds_att_schema_req_id_value: INTEGER
    Error_ds_att_schema_req_syntax_text: STRING
    Error_ds_att_schema_req_syntax_value: INTEGER
    Error_ds_att_val_already_exists_text: STRING
    Error_ds_att_val_already_exists_value: INTEGER
    Error_ds_attribute_or_value_exists_text: STRING
    Error_ds_attribute_or_value_exists_value: INTEGER
    Error_ds_attribute_owned_by_sam_text: STRING
    Error_ds_attribute_owned_by_sam_value: INTEGER
    Error_ds_attribute_type_undefined_text: STRING
    Error_ds_attribute_type_undefined_value: INTEGER
    Error_ds_auth_method_not_supported_text: STRING
    Error_ds_auth_method_not_supported_value: INTEGER
    Error_ds_auth_unknown_text: STRING
    Error_ds_auth_unknown_value: INTEGER
    Error_ds_aux_cls_test_fail_text: STRING
    Error_ds_aux_cls_test_fail_value: INTEGER
    Error_ds_backlink_without_link_text: STRING
    Error_ds_backlink_without_link_value: INTEGER
    Error_ds_bad_att_schema_syntax_text: STRING
    Error_ds_bad_att_schema_syntax_value: INTEGER
    Error_ds_bad_hierarchy_file_text: STRING
    Error_ds_bad_hierarchy_file_value: INTEGER
    Error_ds_bad_instance_type_text: STRING
    Error_ds_bad_instance_type_value: INTEGER
    Error_ds_bad_name_syntax_text: STRING
    Error_ds_bad_name_syntax_value: INTEGER
    Error_ds_bad_rdn_att_id_syntax_text: STRING
    Error_ds_bad_rdn_att_id_syntax_value: INTEGER
    Error_ds_build_hierarchy_table_failed_text: STRING
    Error_ds_build_hierarchy_table_failed_value: INTEGER
    Error_ds_busy_text: STRING
    Error_ds_busy_value: INTEGER
    Error_ds_cant_add_att_values_text: STRING
    Error_ds_cant_add_att_values_value: INTEGER
    Error_ds_cant_add_system_only_text: STRING
    Error_ds_cant_add_system_only_value: INTEGER
    Error_ds_cant_add_to_gc_text: STRING
    Error_ds_cant_add_to_gc_value: INTEGER
    Error_ds_cant_cache_att_text: STRING
    Error_ds_cant_cache_att_value: INTEGER
    Error_ds_cant_cache_class_text: STRING
    Error_ds_cant_cache_class_value: INTEGER
    Error_ds_cant_create_in_nondomain_nc_text: STRING
    Error_ds_cant_create_in_nondomain_nc_value: INTEGER
    Error_ds_cant_create_under_schema_text: STRING
    Error_ds_cant_create_under_schema_value: INTEGER
    Error_ds_cant_del_master_crossref_text: STRING
    Error_ds_cant_del_master_crossref_value: INTEGER
    Error_ds_cant_delete_dsa_obj_text: STRING
    Error_ds_cant_delete_dsa_obj_value: INTEGER
    Error_ds_cant_delete_text: STRING
    Error_ds_cant_delete_value: INTEGER
    Error_ds_cant_deref_alias_text: STRING
    Error_ds_cant_deref_alias_value: INTEGER
    Error_ds_cant_find_dc_for_src_domain_text: STRING
    Error_ds_cant_find_dc_for_src_domain_value: INTEGER
    Error_ds_cant_find_dsa_obj_text: STRING
    Error_ds_cant_find_dsa_obj_value: INTEGER
    Error_ds_cant_find_expected_nc_text: STRING
    Error_ds_cant_find_expected_nc_value: INTEGER
    Error_ds_cant_find_nc_in_cache_text: STRING
    Error_ds_cant_find_nc_in_cache_value: INTEGER
    Error_ds_cant_mix_master_and_reps_text: STRING
    Error_ds_cant_mix_master_and_reps_value: INTEGER
    Error_ds_cant_mod_obj_class_text: STRING
    Error_ds_cant_mod_obj_class_value: INTEGER
    Error_ds_cant_mod_primarygroupid_text: STRING
    Error_ds_cant_mod_primarygroupid_value: INTEGER
    Error_ds_cant_mod_system_only_text: STRING
    Error_ds_cant_mod_system_only_value: INTEGER
    Error_ds_cant_move_account_group_text: STRING
    Error_ds_cant_move_account_group_value: INTEGER
    Error_ds_cant_move_deleted_object_text: STRING
    Error_ds_cant_move_deleted_object_value: INTEGER
    Error_ds_cant_move_resource_group_text: STRING
    Error_ds_cant_move_resource_group_value: INTEGER
    Error_ds_cant_on_non_leaf_text: STRING
    Error_ds_cant_on_non_leaf_value: INTEGER
    Error_ds_cant_on_rdn_text: STRING
    Error_ds_cant_on_rdn_value: INTEGER
    Error_ds_cant_rem_missing_att_text: STRING
    Error_ds_cant_rem_missing_att_val_text: STRING
    Error_ds_cant_rem_missing_att_val_value: INTEGER
    Error_ds_cant_rem_missing_att_value: INTEGER
    Error_ds_cant_remove_att_cache_text: STRING
    Error_ds_cant_remove_att_cache_value: INTEGER
    Error_ds_cant_remove_class_cache_text: STRING
    Error_ds_cant_remove_class_cache_value: INTEGER
    Error_ds_cant_replace_hidden_rec_text: STRING
    Error_ds_cant_replace_hidden_rec_value: INTEGER
    Error_ds_cant_retrieve_atts_text: STRING
    Error_ds_cant_retrieve_atts_value: INTEGER
    Error_ds_cant_retrieve_child_text: STRING
    Error_ds_cant_retrieve_child_value: INTEGER
    Error_ds_cant_retrieve_dn_text: STRING
    Error_ds_cant_retrieve_dn_value: INTEGER
    Error_ds_cant_retrieve_instance_text: STRING
    Error_ds_cant_retrieve_instance_value: INTEGER
    Error_ds_cant_retrieve_sd_text: STRING
    Error_ds_cant_retrieve_sd_value: INTEGER
    Error_ds_cant_start_text: STRING
    Error_ds_cant_start_value: INTEGER
    Error_ds_cant_tree_delete_critical_obj_text: STRING
    Error_ds_cant_tree_delete_critical_obj_value: INTEGER
    Error_ds_cant_with_acct_group_membershps_text: STRING
    Error_ds_cant_with_acct_group_membershps_value: INTEGER
    Error_ds_children_exist_text: STRING
    Error_ds_children_exist_value: INTEGER
    Error_ds_class_must_be_concrete_text: STRING
    Error_ds_class_must_be_concrete_value: INTEGER
    Error_ds_class_not_dsa_text: STRING
    Error_ds_class_not_dsa_value: INTEGER
    Error_ds_client_loop_text: STRING
    Error_ds_client_loop_value: INTEGER
    Error_ds_code_inconsistency_text: STRING
    Error_ds_code_inconsistency_value: INTEGER
    Error_ds_compare_false_text: STRING
    Error_ds_compare_false_value: INTEGER
    Error_ds_compare_true_text: STRING
    Error_ds_compare_true_value: INTEGER
    Error_ds_confidentiality_required_text: STRING
    Error_ds_confidentiality_required_value: INTEGER
    Error_ds_config_param_missing_text: STRING
    Error_ds_config_param_missing_value: INTEGER
    Error_ds_constraint_violation_text: STRING
    Error_ds_constraint_violation_value: INTEGER
    Error_ds_constructed_att_mod_text: STRING
    Error_ds_constructed_att_mod_value: INTEGER
    Error_ds_control_not_found_text: STRING
    Error_ds_control_not_found_value: INTEGER
    Error_ds_couldnt_contact_fsmo_text: STRING
    Error_ds_couldnt_contact_fsmo_value: INTEGER
    Error_ds_couldnt_identify_objects_for_tree_delete_text: STRING
    Error_ds_couldnt_identify_objects_for_tree_delete_value: INTEGER
    Error_ds_couldnt_lock_tree_for_delete_text: STRING
    Error_ds_couldnt_lock_tree_for_delete_value: INTEGER
    Error_ds_couldnt_update_spns_text: STRING
    Error_ds_couldnt_update_spns_value: INTEGER
    Error_ds_counting_ab_indices_failed_text: STRING
    Error_ds_counting_ab_indices_failed_value: INTEGER
    Error_ds_cr_impossible_to_validate_text: STRING
    Error_ds_cr_impossible_to_validate_value: INTEGER
    Error_ds_cross_dom_move_error_text: STRING
    Error_ds_cross_dom_move_error_value: INTEGER
    Error_ds_cross_domain_cleanup_reqd_text: STRING
    Error_ds_cross_domain_cleanup_reqd_value: INTEGER
    Error_ds_cross_nc_dn_rename_text: STRING
    Error_ds_cross_nc_dn_rename_value: INTEGER
    Error_ds_cross_ref_exists_text: STRING
    Error_ds_cross_ref_exists_value: INTEGER
    Error_ds_database_error_text: STRING
    Error_ds_database_error_value: INTEGER
    Error_ds_decoding_error_text: STRING
    Error_ds_decoding_error_value: INTEGER
    Error_ds_destination_auditing_not_enabled_text: STRING
    Error_ds_destination_auditing_not_enabled_value: INTEGER
    Error_ds_destination_domain_not_in_forest_text: STRING
    Error_ds_destination_domain_not_in_forest_value: INTEGER
    Error_ds_dns_lookup_failure_text: STRING
    Error_ds_dns_lookup_failure_value: INTEGER
    Error_ds_dra_abandon_sync_text: STRING
    Error_ds_dra_abandon_sync_value: INTEGER
    Error_ds_dra_access_denied_text: STRING
    Error_ds_dra_access_denied_value: INTEGER
    Error_ds_dra_bad_dn_text: STRING
    Error_ds_dra_bad_dn_value: INTEGER
    Error_ds_dra_bad_instance_type_text: STRING
    Error_ds_dra_bad_instance_type_value: INTEGER
    Error_ds_dra_bad_nc_text: STRING
    Error_ds_dra_bad_nc_value: INTEGER
    Error_ds_dra_busy_text: STRING
    Error_ds_dra_busy_value: INTEGER
    Error_ds_dra_connection_failed_text: STRING
    Error_ds_dra_connection_failed_value: INTEGER
    Error_ds_dra_db_error_text: STRING
    Error_ds_dra_db_error_value: INTEGER
    Error_ds_dra_dn_exists_text: STRING
    Error_ds_dra_dn_exists_value: INTEGER
    Error_ds_dra_earlier_schema_conflict_text: STRING
    Error_ds_dra_earlier_schema_conflict_value: INTEGER
    Error_ds_dra_extn_connection_failed_text: STRING
    Error_ds_dra_extn_connection_failed_value: INTEGER
    Error_ds_dra_generic_text: STRING
    Error_ds_dra_generic_value: INTEGER
    Error_ds_dra_incompatible_partial_set_text: STRING
    Error_ds_dra_incompatible_partial_set_value: INTEGER
    Error_ds_dra_inconsistent_dit_text: STRING
    Error_ds_dra_inconsistent_dit_value: INTEGER
    Error_ds_dra_internal_error_text: STRING
    Error_ds_dra_internal_error_value: INTEGER
    Error_ds_dra_invalid_parameter_text: STRING
    Error_ds_dra_invalid_parameter_value: INTEGER
    Error_ds_dra_mail_problem_text: STRING
    Error_ds_dra_mail_problem_value: INTEGER
    Error_ds_dra_missing_parent_text: STRING
    Error_ds_dra_missing_parent_value: INTEGER
    Error_ds_dra_name_collision_text: STRING
    Error_ds_dra_name_collision_value: INTEGER
    Error_ds_dra_no_replica_text: STRING
    Error_ds_dra_no_replica_value: INTEGER
    Error_ds_dra_not_supported_text: STRING
    Error_ds_dra_not_supported_value: INTEGER
    Error_ds_dra_obj_is_rep_source_text: STRING
    Error_ds_dra_obj_is_rep_source_value: INTEGER
    Error_ds_dra_obj_nc_mismatch_text: STRING
    Error_ds_dra_obj_nc_mismatch_value: INTEGER
    Error_ds_dra_out_of_mem_text: STRING
    Error_ds_dra_out_of_mem_value: INTEGER
    Error_ds_dra_preempted_text: STRING
    Error_ds_dra_preempted_value: INTEGER
    Error_ds_dra_ref_already_exists_text: STRING
    Error_ds_dra_ref_already_exists_value: INTEGER
    Error_ds_dra_ref_not_found_text: STRING
    Error_ds_dra_ref_not_found_value: INTEGER
    Error_ds_dra_repl_pending_text: STRING
    Error_ds_dra_repl_pending_value: INTEGER
    Error_ds_dra_rpc_cancelled_text: STRING
    Error_ds_dra_rpc_cancelled_value: INTEGER
    Error_ds_dra_schema_conflict_text: STRING
    Error_ds_dra_schema_conflict_value: INTEGER
    Error_ds_dra_schema_info_ship_text: STRING
    Error_ds_dra_schema_info_ship_value: INTEGER
    Error_ds_dra_schema_mismatch_text: STRING
    Error_ds_dra_schema_mismatch_value: INTEGER
    Error_ds_dra_shutdown_text: STRING
    Error_ds_dra_shutdown_value: INTEGER
    Error_ds_dra_sink_disabled_text: STRING
    Error_ds_dra_sink_disabled_value: INTEGER
    Error_ds_dra_source_disabled_text: STRING
    Error_ds_dra_source_disabled_value: INTEGER
    Error_ds_dra_source_is_partial_replica_text: STRING
    Error_ds_dra_source_is_partial_replica_value: INTEGER
    Error_ds_dra_source_reinstalled_text: STRING
    Error_ds_dra_source_reinstalled_value: INTEGER
    Error_ds_ds_required_text: STRING
    Error_ds_ds_required_value: INTEGER
    Error_ds_dsa_must_be_int_master_text: STRING
    Error_ds_dsa_must_be_int_master_value: INTEGER
    Error_ds_dst_domain_not_native_text: STRING
    Error_ds_dst_domain_not_native_value: INTEGER
    Error_ds_dst_nc_mismatch_text: STRING
    Error_ds_dst_nc_mismatch_value: INTEGER
    Error_ds_dup_ldap_display_name_text: STRING
    Error_ds_dup_ldap_display_name_value: INTEGER
    Error_ds_dup_link_id_text: STRING
    Error_ds_dup_link_id_value: INTEGER
    Error_ds_dup_mapi_id_text: STRING
    Error_ds_dup_mapi_id_value: INTEGER
    Error_ds_dup_oid_text: STRING
    Error_ds_dup_oid_value: INTEGER
    Error_ds_dup_rdn_text: STRING
    Error_ds_dup_rdn_value: INTEGER
    Error_ds_dup_schema_id_guid_text: STRING
    Error_ds_dup_schema_id_guid_value: INTEGER
    Error_ds_encoding_error_text: STRING
    Error_ds_encoding_error_value: INTEGER
    Error_ds_epoch_mismatch_text: STRING
    Error_ds_epoch_mismatch_value: INTEGER
    Error_ds_exists_in_aux_cls_text: STRING
    Error_ds_exists_in_aux_cls_value: INTEGER
    Error_ds_exists_in_may_have_text: STRING
    Error_ds_exists_in_may_have_value: INTEGER
    Error_ds_exists_in_must_have_text: STRING
    Error_ds_exists_in_must_have_value: INTEGER
    Error_ds_exists_in_poss_sup_text: STRING
    Error_ds_exists_in_poss_sup_value: INTEGER
    Error_ds_exists_in_sub_cls_text: STRING
    Error_ds_exists_in_sub_cls_value: INTEGER
    Error_ds_filter_unknown_text: STRING
    Error_ds_filter_unknown_value: INTEGER
    Error_ds_filter_uses_contructed_attrs_text: STRING
    Error_ds_filter_uses_contructed_attrs_value: INTEGER
    Error_ds_gc_not_available_text: STRING
    Error_ds_gc_not_available_value: INTEGER
    Error_ds_gc_required_text: STRING
    Error_ds_gc_required_value: INTEGER
    Error_ds_gcverify_error_text: STRING
    Error_ds_gcverify_error_value: INTEGER
    Error_ds_generic_error_text: STRING
    Error_ds_generic_error_value: INTEGER
    Error_ds_global_cant_have_crossdomain_member_text: STRING
    Error_ds_global_cant_have_crossdomain_member_value: INTEGER
    Error_ds_global_cant_have_local_member_text: STRING
    Error_ds_global_cant_have_local_member_value: INTEGER
    Error_ds_global_cant_have_universal_member_text: STRING
    Error_ds_global_cant_have_universal_member_value: INTEGER
    Error_ds_governsid_missing_text: STRING
    Error_ds_governsid_missing_value: INTEGER
    Error_ds_have_primary_members_text: STRING
    Error_ds_have_primary_members_value: INTEGER
    Error_ds_hierarchy_table_malloc_failed_text: STRING
    Error_ds_hierarchy_table_malloc_failed_value: INTEGER
    Error_ds_illegal_base_schema_mod_text: STRING
    Error_ds_illegal_base_schema_mod_value: INTEGER
    Error_ds_illegal_mod_operation_text: STRING
    Error_ds_illegal_mod_operation_value: INTEGER
    Error_ds_illegal_superior_text: STRING
    Error_ds_illegal_superior_value: INTEGER
    Error_ds_illegal_xdom_move_operation_text: STRING
    Error_ds_illegal_xdom_move_operation_value: INTEGER
    Error_ds_inappropriate_auth_text: STRING
    Error_ds_inappropriate_auth_value: INTEGER
    Error_ds_inappropriate_matching_text: STRING
    Error_ds_inappropriate_matching_value: INTEGER
    Error_ds_incorrect_role_owner_text: STRING
    Error_ds_incorrect_role_owner_value: INTEGER
    Error_ds_init_failure_text: STRING
    Error_ds_init_failure_value: INTEGER
    Error_ds_install_no_sch_version_in_inifile_text: STRING
    Error_ds_install_no_sch_version_in_inifile_value: INTEGER
    Error_ds_install_no_src_sch_version_text: STRING
    Error_ds_install_no_src_sch_version_value: INTEGER
    Error_ds_install_schema_mismatch_text: STRING
    Error_ds_install_schema_mismatch_value: INTEGER
    Error_ds_insuff_access_rights_text: STRING
    Error_ds_insuff_access_rights_value: INTEGER
    Error_ds_internal_failure_text: STRING
    Error_ds_internal_failure_value: INTEGER
    Error_ds_invalid_attribute_syntax_text: STRING
    Error_ds_invalid_attribute_syntax_value: INTEGER
    Error_ds_invalid_dmd_text: STRING
    Error_ds_invalid_dmd_value: INTEGER
    Error_ds_invalid_dn_syntax_text: STRING
    Error_ds_invalid_dn_syntax_value: INTEGER
    Error_ds_invalid_group_type_text: STRING
    Error_ds_invalid_group_type_value: INTEGER
    Error_ds_invalid_ldap_display_name_text: STRING
    Error_ds_invalid_ldap_display_name_value: INTEGER
    Error_ds_invalid_name_for_spn_text: STRING
    Error_ds_invalid_name_for_spn_value: INTEGER
    Error_ds_invalid_role_owner_text: STRING
    Error_ds_invalid_role_owner_value: INTEGER
    Error_ds_invalid_search_flag_text: STRING
    Error_ds_invalid_search_flag_value: INTEGER
    Error_ds_is_leaf_text: STRING
    Error_ds_is_leaf_value: INTEGER
    Error_ds_key_not_unique_text: STRING
    Error_ds_key_not_unique_value: INTEGER
    Error_ds_local_cant_have_crossdomain_local_member_text: STRING
    Error_ds_local_cant_have_crossdomain_local_member_value: INTEGER
    Error_ds_local_error_text: STRING
    Error_ds_local_error_value: INTEGER
    Error_ds_local_member_of_local_only_text: STRING
    Error_ds_local_member_of_local_only_value: INTEGER
    Error_ds_loop_detect_text: STRING
    Error_ds_loop_detect_value: INTEGER
    Error_ds_machine_account_quota_exceeded_text: STRING
    Error_ds_machine_account_quota_exceeded_value: INTEGER
    Error_ds_masterdsa_required_text: STRING
    Error_ds_masterdsa_required_value: INTEGER
    Error_ds_max_obj_size_exceeded_text: STRING
    Error_ds_max_obj_size_exceeded_value: INTEGER
    Error_ds_membership_evaluated_locally_text: STRING
    Error_ds_membership_evaluated_locally_value: INTEGER
    Error_ds_missing_expected_att_text: STRING
    Error_ds_missing_expected_att_value: INTEGER
    Error_ds_missing_fsmo_settings_text: STRING
    Error_ds_missing_fsmo_settings_value: INTEGER
    Error_ds_missing_infrastructure_container_text: STRING
    Error_ds_missing_infrastructure_container_value: INTEGER
    Error_ds_missing_required_att_text: STRING
    Error_ds_missing_required_att_value: INTEGER
    Error_ds_missing_supref_text: STRING
    Error_ds_missing_supref_value: INTEGER
    Error_ds_must_be_run_on_dst_dc_text: STRING
    Error_ds_must_be_run_on_dst_dc_value: INTEGER
    Error_ds_name_error_domain_only_text: STRING
    Error_ds_name_error_domain_only_value: INTEGER
    Error_ds_name_error_no_mapping_text: STRING
    Error_ds_name_error_no_mapping_value: INTEGER
    Error_ds_name_error_no_syntactical_mapping_text: STRING
    Error_ds_name_error_no_syntactical_mapping_value: INTEGER
    Error_ds_name_error_not_found_text: STRING
    Error_ds_name_error_not_found_value: INTEGER
    Error_ds_name_error_not_unique_text: STRING
    Error_ds_name_error_not_unique_value: INTEGER
    Error_ds_name_error_resolving_text: STRING
    Error_ds_name_error_resolving_value: INTEGER
    Error_ds_name_reference_invalid_text: STRING
    Error_ds_name_reference_invalid_value: INTEGER
    Error_ds_name_too_long_text: STRING
    Error_ds_name_too_long_value: INTEGER
    Error_ds_name_too_many_parts_text: STRING
    Error_ds_name_too_many_parts_value: INTEGER
    Error_ds_name_type_unknown_text: STRING
    Error_ds_name_type_unknown_value: INTEGER
    Error_ds_name_unparseable_text: STRING
    Error_ds_name_unparseable_value: INTEGER
    Error_ds_name_value_too_long_text: STRING
    Error_ds_name_value_too_long_value: INTEGER
    Error_ds_naming_master_gc_text: STRING
    Error_ds_naming_master_gc_value: INTEGER
    Error_ds_naming_violation_text: STRING
    Error_ds_naming_violation_value: INTEGER
    Error_ds_nc_must_have_nc_parent_text: STRING
    Error_ds_nc_must_have_nc_parent_value: INTEGER
    Error_ds_nc_still_has_dsas_text: STRING
    Error_ds_nc_still_has_dsas_value: INTEGER
    Error_ds_ncname_missing_cr_ref_text: STRING
    Error_ds_ncname_missing_cr_ref_value: INTEGER
    Error_ds_ncname_must_be_nc_text: STRING
    Error_ds_ncname_must_be_nc_value: INTEGER
    Error_ds_no_attribute_or_value_text: STRING
    Error_ds_no_attribute_or_value_value: INTEGER
    Error_ds_no_chained_eval_text: STRING
    Error_ds_no_chained_eval_value: INTEGER
    Error_ds_no_chaining_text: STRING
    Error_ds_no_chaining_value: INTEGER
    Error_ds_no_checkpoint_with_pdc_text: STRING
    Error_ds_no_checkpoint_with_pdc_value: INTEGER
    Error_ds_no_crossref_for_nc_text: STRING
    Error_ds_no_crossref_for_nc_value: INTEGER
    Error_ds_no_deleted_name_text: STRING
    Error_ds_no_deleted_name_value: INTEGER
    Error_ds_no_fpo_in_universal_groups_text: STRING
    Error_ds_no_fpo_in_universal_groups_value: INTEGER
    Error_ds_no_more_rids_text: STRING
    Error_ds_no_more_rids_value: INTEGER
    Error_ds_no_nest_globalgroup_in_mixeddomain_text: STRING
    Error_ds_no_nest_globalgroup_in_mixeddomain_value: INTEGER
    Error_ds_no_nest_localgroup_in_mixeddomain_text: STRING
    Error_ds_no_nest_localgroup_in_mixeddomain_value: INTEGER
    Error_ds_no_parent_object_text: STRING
    Error_ds_no_parent_object_value: INTEGER
    Error_ds_no_pkt_privacy_on_connection_text: STRING
    Error_ds_no_pkt_privacy_on_connection_value: INTEGER
    Error_ds_no_rdn_defined_in_schema_text: STRING
    Error_ds_no_rdn_defined_in_schema_value: INTEGER
    Error_ds_no_requested_atts_found_text: STRING
    Error_ds_no_requested_atts_found_value: INTEGER
    Error_ds_no_results_returned_text: STRING
    Error_ds_no_results_returned_value: INTEGER
    Error_ds_no_rids_allocated_text: STRING
    Error_ds_no_rids_allocated_value: INTEGER
    Error_ds_no_such_object_text: STRING
    Error_ds_no_such_object_value: INTEGER
    Error_ds_no_tree_delete_above_nc_text: STRING
    Error_ds_no_tree_delete_above_nc_value: INTEGER
    Error_ds_non_base_search_text: STRING
    Error_ds_non_base_search_value: INTEGER
    Error_ds_nonexistent_may_have_text: STRING
    Error_ds_nonexistent_may_have_value: INTEGER
    Error_ds_nonexistent_must_have_text: STRING
    Error_ds_nonexistent_must_have_value: INTEGER
    Error_ds_nonexistent_poss_sup_text: STRING
    Error_ds_nonexistent_poss_sup_value: INTEGER
    Error_ds_nonsafe_schema_change_text: STRING
    Error_ds_nonsafe_schema_change_value: INTEGER
    Error_ds_not_an_object_text: STRING
    Error_ds_not_an_object_value: INTEGER
    Error_ds_not_authoritive_for_dst_nc_text: STRING
    Error_ds_not_authoritive_for_dst_nc_value: INTEGER
    Error_ds_not_installed_text: STRING
    Error_ds_not_installed_value: INTEGER
    Error_ds_not_on_backlink_text: STRING
    Error_ds_not_on_backlink_value: INTEGER
    Error_ds_not_supported_text: STRING
    Error_ds_not_supported_value: INTEGER
    Error_ds_notify_filter_too_complex_text: STRING
    Error_ds_notify_filter_too_complex_value: INTEGER
    Error_ds_obj_class_not_defined_text: STRING
    Error_ds_obj_class_not_defined_value: INTEGER
    Error_ds_obj_class_not_subclass_text: STRING
    Error_ds_obj_class_not_subclass_value: INTEGER
    Error_ds_obj_class_violation_text: STRING
    Error_ds_obj_class_violation_value: INTEGER
    Error_ds_obj_guid_exists_text: STRING
    Error_ds_obj_guid_exists_value: INTEGER
    Error_ds_obj_not_found_text: STRING
    Error_ds_obj_not_found_value: INTEGER
    Error_ds_obj_string_name_exists_text: STRING
    Error_ds_obj_string_name_exists_value: INTEGER
    Error_ds_obj_too_large_text: STRING
    Error_ds_obj_too_large_value: INTEGER
    Error_ds_object_class_required_text: STRING
    Error_ds_object_class_required_value: INTEGER
    Error_ds_object_results_too_large_text: STRING
    Error_ds_object_results_too_large_value: INTEGER
    Error_ds_operations_error_text: STRING
    Error_ds_operations_error_value: INTEGER
    Error_ds_out_of_scope_text: STRING
    Error_ds_out_of_scope_value: INTEGER
    Error_ds_param_error_text: STRING
    Error_ds_param_error_value: INTEGER
    Error_ds_parent_is_an_alias_text: STRING
    Error_ds_parent_is_an_alias_value: INTEGER
    Error_ds_pdc_operation_in_progress_text: STRING
    Error_ds_pdc_operation_in_progress_value: INTEGER
    Error_ds_protocol_error_text: STRING
    Error_ds_protocol_error_value: INTEGER
    Error_ds_range_constraint_text: STRING
    Error_ds_range_constraint_value: INTEGER
    Error_ds_rdn_doesnt_match_schema_text: STRING
    Error_ds_rdn_doesnt_match_schema_value: INTEGER
    Error_ds_recalcschema_failed_text: STRING
    Error_ds_recalcschema_failed_value: INTEGER
    Error_ds_referral_limit_exceeded_text: STRING
    Error_ds_referral_limit_exceeded_value: INTEGER
    Error_ds_referral_text: STRING
    Error_ds_referral_value: INTEGER
    Error_ds_refusing_fsmo_roles_text: STRING
    Error_ds_refusing_fsmo_roles_value: INTEGER
    Error_ds_replicator_only_text: STRING
    Error_ds_replicator_only_value: INTEGER
    Error_ds_ridmgr_init_error_text: STRING
    Error_ds_ridmgr_init_error_value: INTEGER
    Error_ds_root_cant_be_subref_text: STRING
    Error_ds_root_cant_be_subref_value: INTEGER
    Error_ds_root_must_be_nc_text: STRING
    Error_ds_root_must_be_nc_value: INTEGER
    Error_ds_root_requires_class_top_text: STRING
    Error_ds_root_requires_class_top_value: INTEGER
    Error_ds_sam_init_failure_text: STRING
    Error_ds_sam_init_failure_value: INTEGER
    Error_ds_sam_need_bootkey_floppy_text: STRING
    Error_ds_sam_need_bootkey_floppy_value: INTEGER
    Error_ds_sam_need_bootkey_password_text: STRING
    Error_ds_sam_need_bootkey_password_value: INTEGER
    Error_ds_schema_alloc_failed_text: STRING
    Error_ds_schema_alloc_failed_value: INTEGER
    Error_ds_schema_not_loaded_text: STRING
    Error_ds_schema_not_loaded_value: INTEGER
    Error_ds_schema_update_disallowed_text: STRING
    Error_ds_schema_update_disallowed_value: INTEGER
    Error_ds_sec_desc_invalid_text: STRING
    Error_ds_sec_desc_invalid_value: INTEGER
    Error_ds_sec_desc_too_short_text: STRING
    Error_ds_sec_desc_too_short_value: INTEGER
    Error_ds_security_checking_error_text: STRING
    Error_ds_security_checking_error_value: INTEGER
    Error_ds_security_illegal_modify_text: STRING
    Error_ds_security_illegal_modify_value: INTEGER
    Error_ds_semantic_att_test_text: STRING
    Error_ds_semantic_att_test_value: INTEGER
    Error_ds_sensitive_group_violation_text: STRING
    Error_ds_sensitive_group_violation_value: INTEGER
    Error_ds_server_down_text: STRING
    Error_ds_server_down_value: INTEGER
    Error_ds_shutting_down_text: STRING
    Error_ds_shutting_down_value: INTEGER
    Error_ds_single_value_constraint_text: STRING
    Error_ds_single_value_constraint_value: INTEGER
    Error_ds_sizelimit_exceeded_text: STRING
    Error_ds_sizelimit_exceeded_value: INTEGER
    Error_ds_source_auditing_not_enabled_text: STRING
    Error_ds_source_auditing_not_enabled_value: INTEGER
    Error_ds_source_domain_in_forest_text: STRING
    Error_ds_source_domain_in_forest_value: INTEGER
    Error_ds_src_and_dst_nc_identical_text: STRING
    Error_ds_src_and_dst_nc_identical_value: INTEGER
    Error_ds_src_and_dst_object_class_mismatch_text: STRING
    Error_ds_src_and_dst_object_class_mismatch_value: INTEGER
    Error_ds_src_dc_must_be_sp4_or_greater_text: STRING
    Error_ds_src_dc_must_be_sp4_or_greater_value: INTEGER
    Error_ds_src_guid_mismatch_text: STRING
    Error_ds_src_guid_mismatch_value: INTEGER
    Error_ds_src_name_mismatch_text: STRING
    Error_ds_src_name_mismatch_value: INTEGER
    Error_ds_src_obj_not_group_or_user_text: STRING
    Error_ds_src_obj_not_group_or_user_value: INTEGER
    Error_ds_src_sid_exists_in_forest_text: STRING
    Error_ds_src_sid_exists_in_forest_value: INTEGER
    Error_ds_string_sd_conversion_failed_text: STRING
    Error_ds_string_sd_conversion_failed_value: INTEGER
    Error_ds_strong_auth_required_text: STRING
    Error_ds_strong_auth_required_value: INTEGER
    Error_ds_sub_cls_test_fail_text: STRING
    Error_ds_sub_cls_test_fail_value: INTEGER
    Error_ds_subref_must_have_parent_text: STRING
    Error_ds_subref_must_have_parent_value: INTEGER
    Error_ds_subtree_notify_not_nc_head_text: STRING
    Error_ds_subtree_notify_not_nc_head_value: INTEGER
    Error_ds_syntax_mismatch_text: STRING
    Error_ds_syntax_mismatch_value: INTEGER
    Error_ds_timelimit_exceeded_text: STRING
    Error_ds_timelimit_exceeded_value: INTEGER
    Error_ds_tree_delete_not_finished_text: STRING
    Error_ds_tree_delete_not_finished_value: INTEGER
    Error_ds_unable_to_surrender_roles_text: STRING
    Error_ds_unable_to_surrender_roles_value: INTEGER
    Error_ds_unavailable_crit_extension_text: STRING
    Error_ds_unavailable_crit_extension_value: INTEGER
    Error_ds_unavailable_text: STRING
    Error_ds_unavailable_value: INTEGER
    Error_ds_unicodepwd_not_in_quotes_text: STRING
    Error_ds_unicodepwd_not_in_quotes_value: INTEGER
    Error_ds_universal_cant_have_local_member_text: STRING
    Error_ds_universal_cant_have_local_member_value: INTEGER
    Error_ds_unknown_error_text: STRING
    Error_ds_unknown_error_value: INTEGER
    Error_ds_unknown_operation_text: STRING
    Error_ds_unknown_operation_value: INTEGER
    Error_ds_unwilling_to_perform_text: STRING
    Error_ds_unwilling_to_perform_value: INTEGER
    Error_ds_user_buffer_to_small_text: STRING
    Error_ds_user_buffer_to_small_value: INTEGER
    Error_ds_wrong_linked_att_syntax_text: STRING
    Error_ds_wrong_linked_att_syntax_value: INTEGER
    Error_ds_wrong_om_obj_class_text: STRING
    Error_ds_wrong_om_obj_class_value: INTEGER
    Error_dup_domainname_text: STRING
    Error_dup_domainname_value: INTEGER
    Error_dup_name_text: STRING
    Error_dup_name_value: INTEGER
    Error_duplicate_service_name_text: STRING
    Error_duplicate_service_name_value: INTEGER
    Error_duplicate_tag_text: STRING
    Error_duplicate_tag_value: INTEGER
    Error_dynlink_from_invalid_ring_text: STRING
    Error_dynlink_from_invalid_ring_value: INTEGER
    Error_ea_access_denied_text: STRING
    Error_ea_access_denied_value: INTEGER
    Error_ea_file_corrupt_text: STRING
    Error_ea_file_corrupt_value: INTEGER
    Error_ea_list_inconsistent_text: STRING
    Error_ea_list_inconsistent_value: INTEGER
    Error_ea_table_full_text: STRING
    Error_ea_table_full_value: INTEGER
    Error_eas_didnt_fit_text: STRING
    Error_eas_didnt_fit_value: INTEGER
    Error_eas_not_supported_text: STRING
    Error_eas_not_supported_value: INTEGER
    Error_efs_server_not_trusted_text: STRING
    Error_efs_server_not_trusted_value: INTEGER
    Error_empty_text: STRING
    Error_empty_value: INTEGER
    Error_encryption_failed_text: STRING
    Error_encryption_failed_value: INTEGER
    Error_end_of_media_text: STRING
    Error_end_of_media_value: INTEGER
    Error_envvar_not_found_text: STRING
    Error_envvar_not_found_value: INTEGER
    Error_eom_overflow_text: STRING
    Error_eom_overflow_value: INTEGER
    Error_eventlog_cant_start_text: STRING
    Error_eventlog_cant_start_value: INTEGER
    Error_eventlog_file_changed_text: STRING
    Error_eventlog_file_changed_value: INTEGER
    Error_eventlog_file_corrupt_text: STRING
    Error_eventlog_file_corrupt_value: INTEGER
    Error_exception_in_service_text: STRING
    Error_exception_in_service_value: INTEGER
    Error_excl_sem_already_owned_text: STRING
    Error_excl_sem_already_owned_value: INTEGER
    Error_exe_machine_type_mismatch_text: STRING
    Error_exe_machine_type_mismatch_value: INTEGER
    Error_exe_marked_invalid_text: STRING
    Error_exe_marked_invalid_value: INTEGER
    Error_extended_error_text: STRING
    Error_extended_error_value: INTEGER
    Error_fail_i24_text: STRING
    Error_fail_i24_value: INTEGER
    Error_failed_service_controller_connect_text: STRING
    Error_failed_service_controller_connect_value: INTEGER
    Error_file_corrupt_text: STRING
    Error_file_corrupt_value: INTEGER
    Error_file_encrypted_text: STRING
    Error_file_encrypted_value: INTEGER
    Error_file_exists_text: STRING
    Error_file_exists_value: INTEGER
    Error_file_invalid_text: STRING
    Error_file_invalid_value: INTEGER
    Error_file_not_encrypted_text: STRING
    Error_file_not_encrypted_value: INTEGER
    Error_file_not_found_text: STRING
    Error_file_not_found_value: INTEGER
    Error_file_offline_text: STRING
    Error_file_offline_value: INTEGER
    Error_file_read_only_text: STRING
    Error_file_read_only_value: INTEGER
    Error_filemark_detected_text: STRING
    Error_filemark_detected_value: INTEGER
    Error_filename_exced_range_text: STRING
    Error_filename_exced_range_value: INTEGER
    Error_floppy_bad_registers_text: STRING
    Error_floppy_bad_registers_value: INTEGER
    Error_floppy_id_mark_not_found_text: STRING
    Error_floppy_id_mark_not_found_value: INTEGER
    Error_floppy_unknown_error_text: STRING
    Error_floppy_unknown_error_value: INTEGER
    Error_floppy_wrong_cylinder_text: STRING
    Error_floppy_wrong_cylinder_value: INTEGER
    Error_full_backup_text: STRING
    Error_full_backup_value: INTEGER
    Error_fullscreen_mode_text: STRING
    Error_fullscreen_mode_value: INTEGER
    Error_function_failed_text: STRING
    Error_function_failed_value: INTEGER
    Error_function_not_called_text: STRING
    Error_function_not_called_value: INTEGER
    Error_gen_failure_text: STRING
    Error_gen_failure_value: INTEGER
    Error_generic_not_mapped_text: STRING
    Error_generic_not_mapped_value: INTEGER
    Error_global_only_hook_text: STRING
    Error_global_only_hook_value: INTEGER
    Error_graceful_disconnect_text: STRING
    Error_graceful_disconnect_value: INTEGER
    Error_group_exists_text: STRING
    Error_group_exists_value: INTEGER
    Error_group_not_available_text: STRING
    Error_group_not_available_value: INTEGER
    Error_group_not_found_text: STRING
    Error_group_not_found_value: INTEGER
    Error_group_not_online_text: STRING
    Error_group_not_online_value: INTEGER
    Error_handle_disk_full_text: STRING
    Error_handle_disk_full_value: INTEGER
    Error_handle_eof_text: STRING
    Error_handle_eof_value: INTEGER
    Error_hook_needs_hmod_text: STRING
    Error_hook_needs_hmod_value: INTEGER
    Error_hook_not_installed_text: STRING
    Error_hook_not_installed_value: INTEGER
    Error_hook_type_not_allowed_text: STRING
    Error_hook_type_not_allowed_value: INTEGER
    Error_host_node_not_available_text: STRING
    Error_host_node_not_available_value: INTEGER
    Error_host_node_not_group_owner_text: STRING
    Error_host_node_not_group_owner_value: INTEGER
    Error_host_node_not_resource_owner_text: STRING
    Error_host_node_not_resource_owner_value: INTEGER
    Error_host_unreachable_text: STRING
    Error_host_unreachable_value: INTEGER
    Error_hotkey_already_registered_text: STRING
    Error_hotkey_already_registered_value: INTEGER
    Error_hotkey_not_registered_text: STRING
    Error_hotkey_not_registered_value: INTEGER
    Error_hwnds_have_diff_parent_text: STRING
    Error_hwnds_have_diff_parent_value: INTEGER
    Error_icm_not_enabled_text: STRING
    Error_icm_not_enabled_value: INTEGER
    Error_ill_formed_password_text: STRING
    Error_ill_formed_password_value: INTEGER
    Error_illegal_element_address_text: STRING
    Error_illegal_element_address_value: INTEGER
    Error_inc_backup_text: STRING
    Error_inc_backup_value: INTEGER
    Error_incorrect_address_text: STRING
    Error_incorrect_address_value: INTEGER
    Error_index_absent_text: STRING
    Error_index_absent_value: INTEGER
    Error_indigenous_type_text: STRING
    Error_indigenous_type_value: INTEGER
    Error_infloop_in_reloc_chain_text: STRING
    Error_infloop_in_reloc_chain_value: INTEGER
    Error_install_already_running_text: STRING
    Error_install_already_running_value: INTEGER
    Error_install_failure_text: STRING
    Error_install_failure_value: INTEGER
    Error_install_language_unsupported_text: STRING
    Error_install_language_unsupported_value: INTEGER
    Error_install_log_failure_text: STRING
    Error_install_log_failure_value: INTEGER
    Error_install_notused_text: STRING
    Error_install_notused_value: INTEGER
    Error_install_package_invalid_text: STRING
    Error_install_package_invalid_value: INTEGER
    Error_install_package_open_failed_text: STRING
    Error_install_package_open_failed_value: INTEGER
    Error_install_package_rejected_text: STRING
    Error_install_package_rejected_value: INTEGER
    Error_install_package_version_text: STRING
    Error_install_package_version_value: INTEGER
    Error_install_platform_unsupported_text: STRING
    Error_install_platform_unsupported_value: INTEGER
    Error_install_remote_disallowed_text: STRING
    Error_install_remote_disallowed_value: INTEGER
    Error_install_service_failure_text: STRING
    Error_install_service_failure_value: INTEGER
    Error_install_source_absent_text: STRING
    Error_install_source_absent_value: INTEGER
    Error_install_suspend_text: STRING
    Error_install_suspend_value: INTEGER
    Error_install_temp_unwritable_text: STRING
    Error_install_temp_unwritable_value: INTEGER
    Error_install_transform_failure_text: STRING
    Error_install_transform_failure_value: INTEGER
    Error_install_ui_failure_text: STRING
    Error_install_ui_failure_value: INTEGER
    Error_install_userexit_text: STRING
    Error_install_userexit_value: INTEGER
    Error_insufficient_buffer_text: STRING
    Error_insufficient_buffer_value: INTEGER
    Error_internal_db_corruption_text: STRING
    Error_internal_db_corruption_value: INTEGER
    Error_internal_db_error_text: STRING
    Error_internal_db_error_value: INTEGER
    Error_internal_error_text: STRING
    Error_internal_error_value: INTEGER
    Error_invalid_accel_handle_text: STRING
    Error_invalid_accel_handle_value: INTEGER
    Error_invalid_access_text: STRING
    Error_invalid_access_value: INTEGER
    Error_invalid_account_name_text: STRING
    Error_invalid_account_name_value: INTEGER
    Error_invalid_acl_text: STRING
    Error_invalid_acl_value: INTEGER
    Error_invalid_address_text: STRING
    Error_invalid_address_value: INTEGER
    Error_invalid_at_interrupt_time_text: STRING
    Error_invalid_at_interrupt_time_value: INTEGER
    Error_invalid_block_length_text: STRING
    Error_invalid_block_length_value: INTEGER
    Error_invalid_block_text: STRING
    Error_invalid_block_value: INTEGER
    Error_invalid_category_text: STRING
    Error_invalid_category_value: INTEGER
    Error_invalid_cleaner_text: STRING
    Error_invalid_cleaner_value: INTEGER
    Error_invalid_cmm_text: STRING
    Error_invalid_cmm_value: INTEGER
    Error_invalid_colorindex_text: STRING
    Error_invalid_colorindex_value: INTEGER
    Error_invalid_colorspace_text: STRING
    Error_invalid_colorspace_value: INTEGER
    Error_invalid_combobox_message_text: STRING
    Error_invalid_combobox_message_value: INTEGER
    Error_invalid_command_line_text: STRING
    Error_invalid_command_line_value: INTEGER
    Error_invalid_computername_text: STRING
    Error_invalid_computername_value: INTEGER
    Error_invalid_cursor_handle_text: STRING
    Error_invalid_cursor_handle_value: INTEGER
    Error_invalid_data_text: STRING
    Error_invalid_data_value: INTEGER
    Error_invalid_datatype_text: STRING
    Error_invalid_datatype_value: INTEGER
    Error_invalid_dll_text: STRING
    Error_invalid_dll_value: INTEGER
    Error_invalid_domain_role_text: STRING
    Error_invalid_domain_role_value: INTEGER
    Error_invalid_domain_state_text: STRING
    Error_invalid_domain_state_value: INTEGER
    Error_invalid_domainname_text: STRING
    Error_invalid_domainname_value: INTEGER
    Error_invalid_drive_object_text: STRING
    Error_invalid_drive_object_value: INTEGER
    Error_invalid_drive_text: STRING
    Error_invalid_drive_value: INTEGER
    Error_invalid_dwp_handle_text: STRING
    Error_invalid_dwp_handle_value: INTEGER
    Error_invalid_ea_handle_text: STRING
    Error_invalid_ea_handle_value: INTEGER
    Error_invalid_ea_name_text: STRING
    Error_invalid_ea_name_value: INTEGER
    Error_invalid_edit_height_text: STRING
    Error_invalid_edit_height_value: INTEGER
    Error_invalid_environment_text: STRING
    Error_invalid_environment_value: INTEGER
    Error_invalid_event_count_text: STRING
    Error_invalid_event_count_value: INTEGER
    Error_invalid_eventname_text: STRING
    Error_invalid_eventname_value: INTEGER
    Error_invalid_exe_signature_text: STRING
    Error_invalid_exe_signature_value: INTEGER
    Error_invalid_field_text: STRING
    Error_invalid_field_value: INTEGER
    Error_invalid_filter_proc_text: STRING
    Error_invalid_filter_proc_value: INTEGER
    Error_invalid_flag_number_text: STRING
    Error_invalid_flag_number_value: INTEGER
    Error_invalid_flags_text: STRING
    Error_invalid_flags_value: INTEGER
    Error_invalid_form_name_text: STRING
    Error_invalid_form_name_value: INTEGER
    Error_invalid_form_size_text: STRING
    Error_invalid_form_size_value: INTEGER
    Error_invalid_function_text: STRING
    Error_invalid_function_value: INTEGER
    Error_invalid_group_attributes_text: STRING
    Error_invalid_group_attributes_value: INTEGER
    Error_invalid_groupname_text: STRING
    Error_invalid_groupname_value: INTEGER
    Error_invalid_gw_command_text: STRING
    Error_invalid_gw_command_value: INTEGER
    Error_invalid_handle_state_text: STRING
    Error_invalid_handle_state_value: INTEGER
    Error_invalid_handle_text: STRING
    Error_invalid_handle_value: INTEGER
    Error_invalid_hook_filter_text: STRING
    Error_invalid_hook_filter_value: INTEGER
    Error_invalid_hook_handle_text: STRING
    Error_invalid_hook_handle_value: INTEGER
    Error_invalid_icon_handle_text: STRING
    Error_invalid_icon_handle_value: INTEGER
    Error_invalid_id_authority_text: STRING
    Error_invalid_id_authority_value: INTEGER
    Error_invalid_index_text: STRING
    Error_invalid_index_value: INTEGER
    Error_invalid_keyboard_handle_text: STRING
    Error_invalid_keyboard_handle_value: INTEGER
    Error_invalid_lb_message_text: STRING
    Error_invalid_lb_message_value: INTEGER
    Error_invalid_level_text: STRING
    Error_invalid_level_value: INTEGER
    Error_invalid_library_text: STRING
    Error_invalid_library_value: INTEGER
    Error_invalid_list_format_text: STRING
    Error_invalid_list_format_value: INTEGER
    Error_invalid_logon_hours_text: STRING
    Error_invalid_logon_hours_value: INTEGER
    Error_invalid_logon_type_text: STRING
    Error_invalid_logon_type_value: INTEGER
    Error_invalid_media_pool_text: STRING
    Error_invalid_media_pool_value: INTEGER
    Error_invalid_media_text: STRING
    Error_invalid_media_value: INTEGER
    Error_invalid_member_text: STRING
    Error_invalid_member_value: INTEGER
    Error_invalid_menu_handle_text: STRING
    Error_invalid_menu_handle_value: INTEGER
    Error_invalid_message_text: STRING
    Error_invalid_message_value: INTEGER
    Error_invalid_messagedest_text: STRING
    Error_invalid_messagedest_value: INTEGER
    Error_invalid_messagename_text: STRING
    Error_invalid_messagename_value: INTEGER
    Error_invalid_minallocsize_text: STRING
    Error_invalid_minallocsize_value: INTEGER
    Error_invalid_moduletype_text: STRING
    Error_invalid_moduletype_value: INTEGER
    Error_invalid_monitor_handle_text: STRING
    Error_invalid_monitor_handle_value: INTEGER
    Error_invalid_msgbox_style_text: STRING
    Error_invalid_msgbox_style_value: INTEGER
    Error_invalid_name_text: STRING
    Error_invalid_name_value: INTEGER
    Error_invalid_netname_text: STRING
    Error_invalid_netname_value: INTEGER
    Error_invalid_operation_on_quorum_text: STRING
    Error_invalid_operation_on_quorum_value: INTEGER
    Error_invalid_operation_text: STRING
    Error_invalid_operation_value: INTEGER
    Error_invalid_oplock_protocol_text: STRING
    Error_invalid_oplock_protocol_value: INTEGER
    Error_invalid_ordinal_text: STRING
    Error_invalid_ordinal_value: INTEGER
    Error_invalid_owner_text: STRING
    Error_invalid_owner_value: INTEGER
    Error_invalid_parameter_text: STRING
    Error_invalid_parameter_value: INTEGER
    Error_invalid_password_text: STRING
    Error_invalid_password_value: INTEGER
    Error_invalid_passwordname_text: STRING
    Error_invalid_passwordname_value: INTEGER
    Error_invalid_pixel_format_text: STRING
    Error_invalid_pixel_format_value: INTEGER
    Error_invalid_primary_group_text: STRING
    Error_invalid_primary_group_value: INTEGER
    Error_invalid_print_monitor_text: STRING
    Error_invalid_print_monitor_value: INTEGER
    Error_invalid_printer_command_text: STRING
    Error_invalid_printer_command_value: INTEGER
    Error_invalid_printer_name_text: STRING
    Error_invalid_printer_name_value: INTEGER
    Error_invalid_printer_state_text: STRING
    Error_invalid_printer_state_value: INTEGER
    Error_invalid_priority_text: STRING
    Error_invalid_priority_value: INTEGER
    Error_invalid_profile_text: STRING
    Error_invalid_profile_value: INTEGER
    Error_invalid_reparse_data_text: STRING
    Error_invalid_reparse_data_value: INTEGER
    Error_invalid_scrollbar_range_text: STRING
    Error_invalid_scrollbar_range_value: INTEGER
    Error_invalid_security_descr_text: STRING
    Error_invalid_security_descr_value: INTEGER
    Error_invalid_segdpl_text: STRING
    Error_invalid_segdpl_value: INTEGER
    Error_invalid_segment_number_text: STRING
    Error_invalid_segment_number_value: INTEGER
    Error_invalid_separator_file_text: STRING
    Error_invalid_separator_file_value: INTEGER
    Error_invalid_server_state_text: STRING
    Error_invalid_server_state_value: INTEGER
    Error_invalid_service_account_text: STRING
    Error_invalid_service_account_value: INTEGER
    Error_invalid_service_control_text: STRING
    Error_invalid_service_control_value: INTEGER
    Error_invalid_service_lock_text: STRING
    Error_invalid_service_lock_value: INTEGER
    Error_invalid_servicename_text: STRING
    Error_invalid_servicename_value: INTEGER
    Error_invalid_sharename_text: STRING
    Error_invalid_sharename_value: INTEGER
    Error_invalid_showwin_command_text: STRING
    Error_invalid_showwin_command_value: INTEGER
    Error_invalid_sid_text: STRING
    Error_invalid_sid_value: INTEGER
    Error_invalid_signal_number_text: STRING
    Error_invalid_signal_number_value: INTEGER
    Error_invalid_spi_value_text: STRING
    Error_invalid_spi_value_value: INTEGER
    Error_invalid_stackseg_text: STRING
    Error_invalid_stackseg_value: INTEGER
    Error_invalid_starting_codeseg_text: STRING
    Error_invalid_starting_codeseg_value: INTEGER
    Error_invalid_state_text: STRING
    Error_invalid_state_value: INTEGER
    Error_invalid_sub_authority_text: STRING
    Error_invalid_sub_authority_value: INTEGER
    Error_invalid_table_text: STRING
    Error_invalid_table_value: INTEGER
    Error_invalid_target_handle_text: STRING
    Error_invalid_target_handle_value: INTEGER
    Error_invalid_thread_id_text: STRING
    Error_invalid_thread_id_value: INTEGER
    Error_invalid_time_text: STRING
    Error_invalid_time_value: INTEGER
    Error_invalid_transform_text: STRING
    Error_invalid_transform_value: INTEGER
    Error_invalid_user_buffer_text: STRING
    Error_invalid_user_buffer_value: INTEGER
    Error_invalid_verify_switch_text: STRING
    Error_invalid_verify_switch_value: INTEGER
    Error_invalid_window_handle_text: STRING
    Error_invalid_window_handle_value: INTEGER
    Error_invalid_window_style_text: STRING
    Error_invalid_window_style_value: INTEGER
    Error_invalid_workstation_text: STRING
    Error_invalid_workstation_value: INTEGER
    Error_io_device_text: STRING
    Error_io_device_value: INTEGER
    Error_io_incomplete_text: STRING
    Error_io_incomplete_value: INTEGER
    Error_io_pending_text: STRING
    Error_io_pending_value: INTEGER
    Error_iopl_not_enabled_text: STRING
    Error_iopl_not_enabled_value: INTEGER
    Error_irq_busy_text: STRING
    Error_irq_busy_value: INTEGER
    Error_is_join_path_text: STRING
    Error_is_join_path_value: INTEGER
    Error_is_join_target_text: STRING
    Error_is_join_target_value: INTEGER
    Error_is_joined_text: STRING
    Error_is_joined_value: INTEGER
    Error_is_subst_path_text: STRING
    Error_is_subst_path_value: INTEGER
    Error_is_subst_target_text: STRING
    Error_is_subst_target_value: INTEGER
    Error_is_substed_text: STRING
    Error_is_substed_value: INTEGER
    Error_iterated_data_exceeds_64k_text: STRING
    Error_iterated_data_exceeds_64k_value: INTEGER
    Error_join_to_join_text: STRING
    Error_join_to_join_value: INTEGER
    Error_join_to_subst_text: STRING
    Error_join_to_subst_value: INTEGER
    Error_journal_delete_in_progress_text: STRING
    Error_journal_delete_in_progress_value: INTEGER
    Error_journal_entry_deleted_text: STRING
    Error_journal_entry_deleted_value: INTEGER
    Error_journal_hook_set_text: STRING
    Error_journal_hook_set_value: INTEGER
    Error_journal_not_active_text: STRING
    Error_journal_not_active_value: INTEGER
    Error_key_deleted_text: STRING
    Error_key_deleted_value: INTEGER
    Error_key_has_children_text: STRING
    Error_key_has_children_value: INTEGER
    Error_label_too_long_text: STRING
    Error_label_too_long_value: INTEGER
    Error_last_admin_text: STRING
    Error_last_admin_value: INTEGER
    Error_lb_without_tabstops_text: STRING
    Error_lb_without_tabstops_value: INTEGER
    Error_library_full_text: STRING
    Error_library_full_value: INTEGER
    Error_library_offline_text: STRING
    Error_library_offline_value: INTEGER
    Error_license_quota_exceeded_text: STRING
    Error_license_quota_exceeded_value: INTEGER
    Error_listbox_id_not_found_text: STRING
    Error_listbox_id_not_found_value: INTEGER
    Error_lm_cross_encryption_required_text: STRING
    Error_lm_cross_encryption_required_value: INTEGER
    Error_local_user_session_key_text: STRING
    Error_local_user_session_key_value: INTEGER
    Error_lock_failed_text: STRING
    Error_lock_failed_value: INTEGER
    Error_lock_violation_text: STRING
    Error_lock_violation_value: INTEGER
    Error_locked_text: STRING
    Error_locked_value: INTEGER
    Error_log_file_full_text: STRING
    Error_log_file_full_value: INTEGER
    Error_login_time_restriction_text: STRING
    Error_login_time_restriction_value: INTEGER
    Error_login_wksta_restriction_text: STRING
    Error_login_wksta_restriction_value: INTEGER
    Error_logon_failure_text: STRING
    Error_logon_failure_value: INTEGER
    Error_logon_not_granted_text: STRING
    Error_logon_not_granted_value: INTEGER
    Error_logon_session_collision_text: STRING
    Error_logon_session_collision_value: INTEGER
    Error_logon_session_exists_text: STRING
    Error_logon_session_exists_value: INTEGER
    Error_logon_type_not_granted_text: STRING
    Error_logon_type_not_granted_value: INTEGER
    Error_luids_exhausted_text: STRING
    Error_luids_exhausted_value: INTEGER
    Error_magazine_not_present_text: STRING
    Error_magazine_not_present_value: INTEGER
    Error_mapped_alignment_text: STRING
    Error_mapped_alignment_value: INTEGER
    Error_max_thrds_reached_text: STRING
    Error_max_thrds_reached_value: INTEGER
    Error_media_changed_text: STRING
    Error_media_changed_value: INTEGER
    Error_media_incompatible_text: STRING
    Error_media_incompatible_value: INTEGER
    Error_media_not_available_text: STRING
    Error_media_not_available_value: INTEGER
    Error_media_offline_text: STRING
    Error_media_offline_value: INTEGER
    Error_media_unavailable_text: STRING
    Error_media_unavailable_value: INTEGER
    Error_medium_not_accessible_text: STRING
    Error_medium_not_accessible_value: INTEGER
    Error_member_in_alias_text: STRING
    Error_member_in_alias_value: INTEGER
    Error_member_in_group_text: STRING
    Error_member_in_group_value: INTEGER
    Error_member_not_in_alias_text: STRING
    Error_member_not_in_alias_value: INTEGER
    Error_member_not_in_group_text: STRING
    Error_member_not_in_group_value: INTEGER
    Error_members_primary_group_text: STRING
    Error_members_primary_group_value: INTEGER
    Error_menu_item_not_found_text: STRING
    Error_menu_item_not_found_value: INTEGER
    Error_message_exceeds_max_size_text: STRING
    Error_message_exceeds_max_size_value: INTEGER
    Error_message_sync_only_text: STRING
    Error_message_sync_only_value: INTEGER
    Error_messages: HASH_TABLE [STRING, INTEGER]
    Error_meta_expansion_too_long_text: STRING
    Error_meta_expansion_too_long_value: INTEGER
    Error_metafile_not_supported_text: STRING
    Error_metafile_not_supported_value: INTEGER
    Error_mod_not_found_text: STRING
    Error_mod_not_found_value: INTEGER
    Error_more_data_text: STRING
    Error_more_data_value: INTEGER
    Error_more_writes_text: STRING
    Error_more_writes_value: INTEGER
    Error_mr_mid_not_found_text: STRING
    Error_mr_mid_not_found_value: INTEGER
    Error_mutual_auth_failed_text: STRING
    Error_mutual_auth_failed_value: INTEGER
    Error_negative_seek_text: STRING
    Error_negative_seek_value: INTEGER
    Error_nesting_not_allowed_text: STRING
    Error_nesting_not_allowed_value: INTEGER
    Error_net_write_fault_text: STRING
    Error_net_write_fault_value: INTEGER
    Error_netlogon_not_started_text: STRING
    Error_netlogon_not_started_value: INTEGER
    Error_netname_deleted_text: STRING
    Error_netname_deleted_value: INTEGER
    Error_network_access_denied_text: STRING
    Error_network_access_denied_value: INTEGER
    Error_network_busy_text: STRING
    Error_network_busy_value: INTEGER
    Error_network_not_available_text: STRING
    Error_network_not_available_value: INTEGER
    Error_network_unreachable_text: STRING
    Error_network_unreachable_value: INTEGER
    Error_no_association_text: STRING
    Error_no_association_value: INTEGER
    Error_no_browser_servers_found_text: STRING
    Error_no_browser_servers_found_value: INTEGER
    Error_no_data_detected_text: STRING
    Error_no_data_detected_value: INTEGER
    Error_no_data_text: STRING
    Error_no_data_value: INTEGER
    Error_no_efs_text: STRING
    Error_no_efs_value: INTEGER
    Error_no_impersonation_token_text: STRING
    Error_no_impersonation_token_value: INTEGER
    Error_no_inheritance_text: STRING
    Error_no_inheritance_value: INTEGER
    Error_no_log_space_text: STRING
    Error_no_log_space_value: INTEGER
    Error_no_logon_servers_text: STRING
    Error_no_logon_servers_value: INTEGER
    Error_no_match_text: STRING
    Error_no_match_value: INTEGER
    Error_no_media_in_drive_text: STRING
    Error_no_media_in_drive_value: INTEGER
    Error_no_more_devices_text: STRING
    Error_no_more_devices_value: INTEGER
    Error_no_more_files_text: STRING
    Error_no_more_files_value: INTEGER
    Error_no_more_items_text: STRING
    Error_no_more_items_value: INTEGER
    Error_no_more_search_handles_text: STRING
    Error_no_more_search_handles_value: INTEGER
    Error_no_more_user_handles_text: STRING
    Error_no_more_user_handles_value: INTEGER
    Error_no_net_or_bad_path_text: STRING
    Error_no_net_or_bad_path_value: INTEGER
    Error_no_network_text: STRING
    Error_no_network_value: INTEGER
    Error_no_proc_slots_text: STRING
    Error_no_proc_slots_value: INTEGER
    Error_no_promotion_active_text: STRING
    Error_no_promotion_active_value: INTEGER
    Error_no_quotas_for_account_text: STRING
    Error_no_quotas_for_account_value: INTEGER
    Error_no_recovery_policy_text: STRING
    Error_no_recovery_policy_value: INTEGER
    Error_no_recovery_program_text: STRING
    Error_no_recovery_program_value: INTEGER
    Error_no_scrollbars_text: STRING
    Error_no_scrollbars_value: INTEGER
    Error_no_security_on_object_text: STRING
    Error_no_security_on_object_value: INTEGER
    Error_no_shutdown_in_progress_text: STRING
    Error_no_shutdown_in_progress_value: INTEGER
    Error_no_signal_sent_text: STRING
    Error_no_signal_sent_value: INTEGER
    Error_no_sitename_text: STRING
    Error_no_sitename_value: INTEGER
    Error_no_spool_space_text: STRING
    Error_no_spool_space_value: INTEGER
    Error_no_such_alias_text: STRING
    Error_no_such_alias_value: INTEGER
    Error_no_such_domain_text: STRING
    Error_no_such_domain_value: INTEGER
    Error_no_such_group_text: STRING
    Error_no_such_group_value: INTEGER
    Error_no_such_logon_session_text: STRING
    Error_no_such_logon_session_value: INTEGER
    Error_no_such_member_text: STRING
    Error_no_such_member_value: INTEGER
    Error_no_such_package_text: STRING
    Error_no_such_package_value: INTEGER
    Error_no_such_privilege_text: STRING
    Error_no_such_privilege_value: INTEGER
    Error_no_such_site_text: STRING
    Error_no_such_site_value: INTEGER
    Error_no_such_user_text: STRING
    Error_no_such_user_value: INTEGER
    Error_no_supporting_drives_text: STRING
    Error_no_supporting_drives_value: INTEGER
    Error_no_system_menu_text: STRING
    Error_no_system_menu_value: INTEGER
    Error_no_system_resources_text: STRING
    Error_no_system_resources_value: INTEGER
    Error_no_token_text: STRING
    Error_no_token_value: INTEGER
    Error_no_tracking_service_text: STRING
    Error_no_tracking_service_value: INTEGER
    Error_no_trust_lsa_secret_text: STRING
    Error_no_trust_lsa_secret_value: INTEGER
    Error_no_trust_sam_account_text: STRING
    Error_no_trust_sam_account_value: INTEGER
    Error_no_unicode_translation_text: STRING
    Error_no_unicode_translation_value: INTEGER
    Error_no_user_keys_text: STRING
    Error_no_user_keys_value: INTEGER
    Error_no_user_session_key_text: STRING
    Error_no_user_session_key_value: INTEGER
    Error_no_volume_id_text: STRING
    Error_no_volume_id_value: INTEGER
    Error_no_volume_label_text: STRING
    Error_no_volume_label_value: INTEGER
    Error_no_wildcard_characters_text: STRING
    Error_no_wildcard_characters_value: INTEGER
    Error_noaccess_text: STRING
    Error_noaccess_value: INTEGER
    Error_node_cant_host_resource_text: STRING
    Error_node_cant_host_resource_value: INTEGER
    Error_node_not_available_text: STRING
    Error_node_not_available_value: INTEGER
    Error_nologon_interdomain_trust_account_text: STRING
    Error_nologon_interdomain_trust_account_value: INTEGER
    Error_nologon_server_trust_account_text: STRING
    Error_nologon_server_trust_account_value: INTEGER
    Error_nologon_workstation_trust_account_text: STRING
    Error_nologon_workstation_trust_account_value: INTEGER
    Error_non_mdichild_window_text: STRING
    Error_non_mdichild_window_value: INTEGER
    Error_none_mapped_text: STRING
    Error_none_mapped_value: INTEGER
    Error_nonpaged_system_resources_text: STRING
    Error_nonpaged_system_resources_value: INTEGER
    Error_not_a_reparse_point_text: STRING
    Error_not_a_reparse_point_value: INTEGER
    Error_not_all_assigned_text: STRING
    Error_not_all_assigned_value: INTEGER
    Error_not_authenticated_text: STRING
    Error_not_authenticated_value: INTEGER
    Error_not_child_window_text: STRING
    Error_not_child_window_value: INTEGER
    Error_not_connected_text: STRING
    Error_not_connected_value: INTEGER
    Error_not_container_text: STRING
    Error_not_container_value: INTEGER
    Error_not_dos_disk_text: STRING
    Error_not_dos_disk_value: INTEGER
    Error_not_empty_text: STRING
    Error_not_empty_value: INTEGER
    Error_not_enough_memory_text: STRING
    Error_not_enough_memory_value: INTEGER
    Error_not_enough_quota_text: STRING
    Error_not_enough_quota_value: INTEGER
    Error_not_enough_server_memory_text: STRING
    Error_not_enough_server_memory_value: INTEGER
    Error_not_export_format_text: STRING
    Error_not_export_format_value: INTEGER
    Error_not_found_text: STRING
    Error_not_found_value: INTEGER
    Error_not_joined_text: STRING
    Error_not_joined_value: INTEGER
    Error_not_locked_text: STRING
    Error_not_locked_value: INTEGER
    Error_not_logged_on_text: STRING
    Error_not_logged_on_value: INTEGER
    Error_not_logon_process_text: STRING
    Error_not_logon_process_value: INTEGER
    Error_not_owner_text: STRING
    Error_not_owner_value: INTEGER
    Error_not_quorum_capable_text: STRING
    Error_not_quorum_capable_value: INTEGER
    Error_not_quorum_class_text: STRING
    Error_not_quorum_class_value: INTEGER
    Error_not_ready_text: STRING
    Error_not_ready_value: INTEGER
    Error_not_registry_file_text: STRING
    Error_not_registry_file_value: INTEGER
    Error_not_same_device_text: STRING
    Error_not_same_device_value: INTEGER
    Error_not_substed_text: STRING
    Error_not_substed_value: INTEGER
    Error_not_supported_on_sbs_text: STRING
    Error_not_supported_on_sbs_value: INTEGER
    Error_not_supported_text: STRING
    Error_not_supported_value: INTEGER
    Error_notify_enum_dir_text: STRING
    Error_notify_enum_dir_value: INTEGER
    Error_nt_cross_encryption_required_text: STRING
    Error_nt_cross_encryption_required_value: INTEGER
    Error_null_lm_password_text: STRING
    Error_null_lm_password_value: INTEGER
    Error_object_already_exists_text: STRING
    Error_object_already_exists_value: INTEGER
    Error_object_in_list_text: STRING
    Error_object_in_list_value: INTEGER
    Error_object_not_found_text: STRING
    Error_object_not_found_value: INTEGER
    Error_old_win_version_text: STRING
    Error_old_win_version_value: INTEGER
    Error_only_if_connected_text: STRING
    Error_only_if_connected_value: INTEGER
    Error_open_failed_text: STRING
    Error_open_failed_value: INTEGER
    Error_open_files_text: STRING
    Error_open_files_value: INTEGER
    Error_operation_aborted_text: STRING
    Error_operation_aborted_value: INTEGER
    Error_oplock_not_granted_text: STRING
    Error_oplock_not_granted_value: INTEGER
    Error_out_of_paper_text: STRING
    Error_out_of_paper_value: INTEGER
    Error_out_of_structures_text: STRING
    Error_out_of_structures_value: INTEGER
    Error_outofmemory_text: STRING
    Error_outofmemory_value: INTEGER
    Error_override_nochanges_text: STRING
    Error_override_nochanges_value: INTEGER
    Error_paged_system_resources_text: STRING
    Error_paged_system_resources_value: INTEGER
    Error_pagefile_quota_text: STRING
    Error_pagefile_quota_value: INTEGER
    Error_partial_copy_text: STRING
    Error_partial_copy_value: INTEGER
    Error_partition_failure_text: STRING
    Error_partition_failure_value: INTEGER
    Error_password_expired_text: STRING
    Error_password_expired_value: INTEGER
    Error_password_must_change_text: STRING
    Error_password_must_change_value: INTEGER
    Error_password_restriction_text: STRING
    Error_password_restriction_value: INTEGER
    Error_patch_package_invalid_text: STRING
    Error_patch_package_invalid_value: INTEGER
    Error_patch_package_open_failed_text: STRING
    Error_patch_package_open_failed_value: INTEGER
    Error_patch_package_unsupported_text: STRING
    Error_patch_package_unsupported_value: INTEGER
    Error_patch_target_not_found_text: STRING
    Error_patch_target_not_found_value: INTEGER
    Error_path_busy_text: STRING
    Error_path_busy_value: INTEGER
    Error_path_not_found_text: STRING
    Error_path_not_found_value: INTEGER
    Error_pipe_busy_text: STRING
    Error_pipe_busy_value: INTEGER
    Error_pipe_connected_text: STRING
    Error_pipe_connected_value: INTEGER
    Error_pipe_listening_text: STRING
    Error_pipe_listening_value: INTEGER
    Error_pipe_not_connected_text: STRING
    Error_pipe_not_connected_value: INTEGER
    Error_point_not_found_text: STRING
    Error_point_not_found_value: INTEGER
    Error_policy_object_not_found_text: STRING
    Error_policy_object_not_found_value: INTEGER
    Error_policy_only_in_ds_text: STRING
    Error_policy_only_in_ds_value: INTEGER
    Error_popup_already_active_text: STRING
    Error_popup_already_active_value: INTEGER
    Error_port_unreachable_text: STRING
    Error_port_unreachable_value: INTEGER
    Error_possible_deadlock_text: STRING
    Error_possible_deadlock_value: INTEGER
    Error_potential_file_found_text: STRING
    Error_potential_file_found_value: INTEGER
    Error_print_cancelled_text: STRING
    Error_print_cancelled_value: INTEGER
    Error_print_monitor_already_installed_text: STRING
    Error_print_monitor_already_installed_value: INTEGER
    Error_print_monitor_in_use_text: STRING
    Error_print_monitor_in_use_value: INTEGER
    Error_print_processor_already_installed_text: STRING
    Error_print_processor_already_installed_value: INTEGER
    Error_printer_already_exists_text: STRING
    Error_printer_already_exists_value: INTEGER
    Error_printer_deleted_text: STRING
    Error_printer_deleted_value: INTEGER
    Error_printer_driver_already_installed_text: STRING
    Error_printer_driver_already_installed_value: INTEGER
    Error_printer_driver_in_use_text: STRING
    Error_printer_driver_in_use_value: INTEGER
    Error_printer_has_jobs_queued_text: STRING
    Error_printer_has_jobs_queued_value: INTEGER
    Error_printer_not_found_text: STRING
    Error_printer_not_found_value: INTEGER
    Error_printq_full_text: STRING
    Error_printq_full_value: INTEGER
    Error_private_dialog_index_text: STRING
    Error_private_dialog_index_value: INTEGER
    Error_privilege_not_held_text: STRING
    Error_privilege_not_held_value: INTEGER
    Error_proc_not_found_text: STRING
    Error_proc_not_found_value: INTEGER
    Error_process_aborted_text: STRING
    Error_process_aborted_value: INTEGER
    Error_product_uninstalled_text: STRING
    Error_product_uninstalled_value: INTEGER
    Error_product_version_text: STRING
    Error_product_version_value: INTEGER
    Error_profile_not_associated_with_device_text: STRING
    Error_profile_not_associated_with_device_value: INTEGER
    Error_profile_not_found_text: STRING
    Error_profile_not_found_value: INTEGER
    Error_promotion_active_text: STRING
    Error_promotion_active_value: INTEGER
    Error_protocol_unreachable_text: STRING
    Error_protocol_unreachable_value: INTEGER
    Error_quorum_disk_not_found_text: STRING
    Error_quorum_disk_not_found_value: INTEGER
    Error_quorum_owner_alive_text: STRING
    Error_quorum_owner_alive_value: INTEGER
    Error_quorum_resource_online_failed_text: STRING
    Error_quorum_resource_online_failed_value: INTEGER
    Error_quorum_resource_text: STRING
    Error_quorum_resource_value: INTEGER
    Error_quorumlog_open_failed_text: STRING
    Error_quorumlog_open_failed_value: INTEGER
    Error_read_fault_text: STRING
    Error_read_fault_value: INTEGER
    Error_rec_non_existent_text: STRING
    Error_rec_non_existent_value: INTEGER
    Error_redir_paused_text: STRING
    Error_redir_paused_value: INTEGER
    Error_redirector_has_open_handles_text: STRING
    Error_redirector_has_open_handles_value: INTEGER
    Error_registry_corrupt_text: STRING
    Error_registry_corrupt_value: INTEGER
    Error_registry_io_failed_text: STRING
    Error_registry_io_failed_value: INTEGER
    Error_registry_recovered_text: STRING
    Error_registry_recovered_value: INTEGER
    Error_reloc_chain_xeeds_seglim_text: STRING
    Error_reloc_chain_xeeds_seglim_value: INTEGER
    Error_rem_not_list_text: STRING
    Error_rem_not_list_value: INTEGER
    Error_remote_session_limit_exceeded_text: STRING
    Error_remote_session_limit_exceeded_value: INTEGER
    Error_remote_storage_media_error_text: STRING
    Error_remote_storage_media_error_value: INTEGER
    Error_remote_storage_not_active_text: STRING
    Error_remote_storage_not_active_value: INTEGER
    Error_reparse_attribute_conflict_text: STRING
    Error_reparse_attribute_conflict_value: INTEGER
    Error_reparse_tag_invalid_text: STRING
    Error_reparse_tag_invalid_value: INTEGER
    Error_reparse_tag_mismatch_text: STRING
    Error_reparse_tag_mismatch_value: INTEGER
    Error_req_not_accep_text: STRING
    Error_req_not_accep_value: INTEGER
    Error_request_aborted_text: STRING
    Error_request_aborted_value: INTEGER
    Error_request_refused_text: STRING
    Error_request_refused_value: INTEGER
    Error_requires_interactive_windowstation_text: STRING
    Error_requires_interactive_windowstation_value: INTEGER
    Error_resmon_create_failed_text: STRING
    Error_resmon_create_failed_value: INTEGER
    Error_resmon_invalid_state_text: STRING
    Error_resmon_invalid_state_value: INTEGER
    Error_resmon_online_failed_text: STRING
    Error_resmon_online_failed_value: INTEGER
    Error_resource_data_not_found_text: STRING
    Error_resource_data_not_found_value: INTEGER
    Error_resource_disabled_text: STRING
    Error_resource_disabled_value: INTEGER
    Error_resource_failed_text: STRING
    Error_resource_failed_value: INTEGER
    Error_resource_lang_not_found_text: STRING
    Error_resource_lang_not_found_value: INTEGER
    Error_resource_name_not_found_text: STRING
    Error_resource_name_not_found_value: INTEGER
    Error_resource_not_available_text: STRING
    Error_resource_not_available_value: INTEGER
    Error_resource_not_found_text: STRING
    Error_resource_not_found_value: INTEGER
    Error_resource_not_online_text: STRING
    Error_resource_not_online_value: INTEGER
    Error_resource_not_present_text: STRING
    Error_resource_not_present_value: INTEGER
    Error_resource_online_text: STRING
    Error_resource_online_value: INTEGER
    Error_resource_properties_stored_text: STRING
    Error_resource_properties_stored_value: INTEGER
    Error_resource_property_unchangeable_text: STRING
    Error_resource_property_unchangeable_value: INTEGER
    Error_resource_type_not_found_text: STRING
    Error_resource_type_not_found_value: INTEGER
    Error_retry_text: STRING
    Error_retry_value: INTEGER
    Error_revision_mismatch_text: STRING
    Error_revision_mismatch_value: INTEGER
    Error_ring2_stack_in_use_text: STRING
    Error_ring2_stack_in_use_value: INTEGER
    Error_ring2seg_must_be_movable_text: STRING
    Error_ring2seg_must_be_movable_value: INTEGER
    Error_rmode_app_text: STRING
    Error_rmode_app_value: INTEGER
    Error_rpl_not_allowed_text: STRING
    Error_rpl_not_allowed_value: INTEGER
    Error_rxact_commit_failure_text: STRING
    Error_rxact_commit_failure_value: INTEGER
    Error_rxact_invalid_state_text: STRING
    Error_rxact_invalid_state_value: INTEGER
    Error_sam_init_failure_text: STRING
    Error_sam_init_failure_value: INTEGER
    Error_same_drive_text: STRING
    Error_same_drive_value: INTEGER
    Error_screen_already_locked_text: STRING
    Error_screen_already_locked_value: INTEGER
    Error_secret_too_long_text: STRING
    Error_secret_too_long_value: INTEGER
    Error_sector_not_found_text: STRING
    Error_sector_not_found_value: INTEGER
    Error_seek_on_device_text: STRING
    Error_seek_on_device_value: INTEGER
    Error_seek_text: STRING
    Error_seek_value: INTEGER
    Error_sem_is_set_text: STRING
    Error_sem_is_set_value: INTEGER
    Error_sem_not_found_text: STRING
    Error_sem_not_found_value: INTEGER
    Error_sem_owner_died_text: STRING
    Error_sem_owner_died_value: INTEGER
    Error_sem_timeout_text: STRING
    Error_sem_timeout_value: INTEGER
    Error_sem_user_limit_text: STRING
    Error_sem_user_limit_value: INTEGER
    Error_serial_no_device_text: STRING
    Error_serial_no_device_value: INTEGER
    Error_server_disabled_text: STRING
    Error_server_disabled_value: INTEGER
    Error_server_has_open_handles_text: STRING
    Error_server_has_open_handles_value: INTEGER
    Error_server_not_disabled_text: STRING
    Error_server_not_disabled_value: INTEGER
    Error_service_already_running_text: STRING
    Error_service_already_running_value: INTEGER
    Error_service_cannot_accept_ctrl_text: STRING
    Error_service_cannot_accept_ctrl_value: INTEGER
    Error_service_database_locked_text: STRING
    Error_service_database_locked_value: INTEGER
    Error_service_dependency_deleted_text: STRING
    Error_service_dependency_deleted_value: INTEGER
    Error_service_dependency_fail_text: STRING
    Error_service_dependency_fail_value: INTEGER
    Error_service_disabled_text: STRING
    Error_service_disabled_value: INTEGER
    Error_service_does_not_exist_text: STRING
    Error_service_does_not_exist_value: INTEGER
    Error_service_exists_text: STRING
    Error_service_exists_value: INTEGER
    Error_service_logon_failed_text: STRING
    Error_service_logon_failed_value: INTEGER
    Error_service_marked_for_delete_text: STRING
    Error_service_marked_for_delete_value: INTEGER
    Error_service_never_started_text: STRING
    Error_service_never_started_value: INTEGER
    Error_service_no_thread_text: STRING
    Error_service_no_thread_value: INTEGER
    Error_service_not_active_text: STRING
    Error_service_not_active_value: INTEGER
    Error_service_not_found_text: STRING
    Error_service_not_found_value: INTEGER
    Error_service_not_in_exe_text: STRING
    Error_service_not_in_exe_value: INTEGER
    Error_service_request_timeout_text: STRING
    Error_service_request_timeout_value: INTEGER
    Error_service_specific_error_text: STRING
    Error_service_specific_error_value: INTEGER
    Error_service_start_hang_text: STRING
    Error_service_start_hang_value: INTEGER
    Error_session_credential_conflict_text: STRING
    Error_session_credential_conflict_value: INTEGER
    Error_set_not_found_text: STRING
    Error_set_not_found_value: INTEGER
    Error_set_power_state_failed_text: STRING
    Error_set_power_state_failed_value: INTEGER
    Error_set_power_state_vetoed_text: STRING
    Error_set_power_state_vetoed_value: INTEGER
    Error_setcount_on_bad_lb_text: STRING
    Error_setcount_on_bad_lb_value: INTEGER
    Error_setmark_detected_text: STRING
    Error_setmark_detected_value: INTEGER
    Error_shared_policy_text: STRING
    Error_shared_policy_value: INTEGER
    Error_sharing_buffer_exceeded_text: STRING
    Error_sharing_buffer_exceeded_value: INTEGER
    Error_sharing_paused_text: STRING
    Error_sharing_paused_value: INTEGER
    Error_sharing_violation_text: STRING
    Error_sharing_violation_value: INTEGER
    Error_shutdown_cluster_text: STRING
    Error_shutdown_cluster_value: INTEGER
    Error_shutdown_in_progress_text: STRING
    Error_shutdown_in_progress_value: INTEGER
    Error_signal_pending_text: STRING
    Error_signal_pending_value: INTEGER
    Error_signal_refused_text: STRING
    Error_signal_refused_value: INTEGER
    Error_single_instance_app_text: STRING
    Error_single_instance_app_value: INTEGER
    Error_some_not_mapped_text: STRING
    Error_some_not_mapped_value: INTEGER
    Error_source_element_empty_text: STRING
    Error_source_element_empty_value: INTEGER
    Error_special_account_text: STRING
    Error_special_account_value: INTEGER
    Error_special_group_text: STRING
    Error_special_group_value: INTEGER
    Error_special_user_text: STRING
    Error_special_user_value: INTEGER
    Error_spl_no_addjob_text: STRING
    Error_spl_no_addjob_value: INTEGER
    Error_spl_no_startdoc_text: STRING
    Error_spl_no_startdoc_value: INTEGER
    Error_spool_file_not_found_text: STRING
    Error_spool_file_not_found_value: INTEGER
    Error_stack_overflow_text: STRING
    Error_stack_overflow_value: INTEGER
    Error_static_init_text: STRING
    Error_static_init_value: INTEGER
    Error_subst_to_join_text: STRING
    Error_subst_to_join_value: INTEGER
    Error_subst_to_subst_text: STRING
    Error_subst_to_subst_value: INTEGER
    Error_success_reboot_initiated_text: STRING
    Error_success_reboot_initiated_value: INTEGER
    Error_success_reboot_required_text: STRING
    Error_success_reboot_required_value: INTEGER
    Error_success_restart_required_text: STRING
    Error_success_restart_required_value: INTEGER
    Error_success_text: STRING
    Error_success_value: INTEGER
    Error_swaperror_text: STRING
    Error_swaperror_value: INTEGER
    Error_system_trace_text: STRING
    Error_system_trace_value: INTEGER
    Error_tag_not_found_text: STRING
    Error_tag_not_found_value: INTEGER
    Error_tag_not_present_text: STRING
    Error_tag_not_present_value: INTEGER
    Error_thread_1_inactive_text: STRING
    Error_thread_1_inactive_value: INTEGER
    Error_time_skew_text: STRING
    Error_time_skew_value: INTEGER
    Error_timeout_text: STRING
    Error_timeout_value: INTEGER
    Error_tlw_with_wschild_text: STRING
    Error_tlw_with_wschild_value: INTEGER
    Error_token_already_in_use_text: STRING
    Error_token_already_in_use_value: INTEGER
    Error_too_many_cmds_text: STRING
    Error_too_many_cmds_value: INTEGER
    Error_too_many_context_ids_text: STRING
    Error_too_many_context_ids_value: INTEGER
    Error_too_many_links_text: STRING
    Error_too_many_links_value: INTEGER
    Error_too_many_luids_requested_text: STRING
    Error_too_many_luids_requested_value: INTEGER
    Error_too_many_modules_text: STRING
    Error_too_many_modules_value: INTEGER
    Error_too_many_muxwaiters_text: STRING
    Error_too_many_muxwaiters_value: INTEGER
    Error_too_many_names_text: STRING
    Error_too_many_names_value: INTEGER
    Error_too_many_open_files_text: STRING
    Error_too_many_open_files_value: INTEGER
    Error_too_many_posts_text: STRING
    Error_too_many_posts_value: INTEGER
    Error_too_many_secrets_text: STRING
    Error_too_many_secrets_value: INTEGER
    Error_too_many_sem_requests_text: STRING
    Error_too_many_sem_requests_value: INTEGER
    Error_too_many_semaphores_text: STRING
    Error_too_many_semaphores_value: INTEGER
    Error_too_many_sess_text: STRING
    Error_too_many_sess_value: INTEGER
    Error_too_many_sids_text: STRING
    Error_too_many_sids_value: INTEGER
    Error_too_many_tcbs_text: STRING
    Error_too_many_tcbs_value: INTEGER
    Error_transform_not_supported_text: STRING
    Error_transform_not_supported_value: INTEGER
    Error_transport_full_text: STRING
    Error_transport_full_value: INTEGER
    Error_trust_failure_text: STRING
    Error_trust_failure_value: INTEGER
    Error_trusted_domain_failure_text: STRING
    Error_trusted_domain_failure_value: INTEGER
    Error_trusted_relationship_failure_text: STRING
    Error_trusted_relationship_failure_value: INTEGER
    Error_unable_to_clean_text: STRING
    Error_unable_to_clean_value: INTEGER
    Error_unable_to_eject_mounted_media_text: STRING
    Error_unable_to_eject_mounted_media_value: INTEGER
    Error_unable_to_inventory_drive_text: STRING
    Error_unable_to_inventory_drive_value: INTEGER
    Error_unable_to_inventory_slot_text: STRING
    Error_unable_to_inventory_slot_value: INTEGER
    Error_unable_to_inventory_transport_text: STRING
    Error_unable_to_inventory_transport_value: INTEGER
    Error_unable_to_load_medium_text: STRING
    Error_unable_to_load_medium_value: INTEGER
    Error_unable_to_lock_media_text: STRING
    Error_unable_to_lock_media_value: INTEGER
    Error_unable_to_move_replacement_2_text: STRING
    Error_unable_to_move_replacement_2_value: INTEGER
    Error_unable_to_move_replacement_text: STRING
    Error_unable_to_move_replacement_value: INTEGER
    Error_unable_to_remove_replaced_text: STRING
    Error_unable_to_remove_replaced_value: INTEGER
    Error_unable_to_unload_media_text: STRING
    Error_unable_to_unload_media_value: INTEGER
    Error_unexp_net_err_text: STRING
    Error_unexp_net_err_value: INTEGER
    Error_unexpected_omid_text: STRING
    Error_unexpected_omid_value: INTEGER
    Error_unknown_component_text: STRING
    Error_unknown_component_value: INTEGER
    Error_unknown_feature_text: STRING
    Error_unknown_feature_value: INTEGER
    Error_unknown_port_text: STRING
    Error_unknown_port_value: INTEGER
    Error_unknown_print_monitor_text: STRING
    Error_unknown_print_monitor_value: INTEGER
    Error_unknown_printer_driver_text: STRING
    Error_unknown_printer_driver_value: INTEGER
    Error_unknown_printprocessor_text: STRING
    Error_unknown_printprocessor_value: INTEGER
    Error_unknown_product_text: STRING
    Error_unknown_product_value: INTEGER
    Error_unknown_property_text: STRING
    Error_unknown_property_value: INTEGER
    Error_unknown_revision_text: STRING
    Error_unknown_revision_value: INTEGER
    Error_unrecognized_media_text: STRING
    Error_unrecognized_media_value: INTEGER
    Error_unrecognized_volume_text: STRING
    Error_unrecognized_volume_value: INTEGER
    Error_unsupported_type_text: STRING
    Error_unsupported_type_value: INTEGER
    Error_user_exists_text: STRING
    Error_user_exists_value: INTEGER
    Error_user_mapped_file_text: STRING
    Error_user_mapped_file_value: INTEGER
    Error_vc_disconnected_text: STRING
    Error_vc_disconnected_value: INTEGER
    Error_volume_contains_sys_files_text: STRING
    Error_volume_contains_sys_files_value: INTEGER
    Error_volume_not_sis_enabled_text: STRING
    Error_volume_not_sis_enabled_value: INTEGER
    Error_wait_no_children_text: STRING
    Error_wait_no_children_value: INTEGER
    Error_window_not_combobox_text: STRING
    Error_window_not_combobox_value: INTEGER
    Error_window_not_dialog_text: STRING
    Error_window_not_dialog_value: INTEGER
    Error_window_of_other_thread_text: STRING
    Error_window_of_other_thread_value: INTEGER
    Error_wins_internal_text: STRING
    Error_wins_internal_value: INTEGER
    Error_wmi_already_disabled_text: STRING
    Error_wmi_already_disabled_value: INTEGER
    Error_wmi_already_enabled_text: STRING
    Error_wmi_already_enabled_value: INTEGER
    Error_wmi_dp_failed_text: STRING
    Error_wmi_dp_failed_value: INTEGER
    Error_wmi_dp_not_found_text: STRING
    Error_wmi_dp_not_found_value: INTEGER
    Error_wmi_guid_disconnected_text: STRING
    Error_wmi_guid_disconnected_value: INTEGER
    Error_wmi_guid_not_found_text: STRING
    Error_wmi_guid_not_found_value: INTEGER
    Error_wmi_instance_not_found_text: STRING
    Error_wmi_instance_not_found_value: INTEGER
    Error_wmi_invalid_mof_text: STRING
    Error_wmi_invalid_mof_value: INTEGER
    Error_wmi_invalid_reginfo_text: STRING
    Error_wmi_invalid_reginfo_value: INTEGER
    Error_wmi_itemid_not_found_text: STRING
    Error_wmi_itemid_not_found_value: INTEGER
    Error_wmi_read_only_text: STRING
    Error_wmi_read_only_value: INTEGER
    Error_wmi_server_unavailable_text: STRING
    Error_wmi_server_unavailable_value: INTEGER
    Error_wmi_set_failure_text: STRING
    Error_wmi_set_failure_value: INTEGER
    Error_wmi_try_again_text: STRING
    Error_wmi_try_again_value: INTEGER
    Error_wmi_unresolved_instance_ref_text: STRING
    Error_wmi_unresolved_instance_ref_value: INTEGER
    Error_working_set_quota_text: STRING
    Error_working_set_quota_value: INTEGER
    Error_write_fault_text: STRING
    Error_write_fault_value: INTEGER
    Error_write_protect_text: STRING
    Error_write_protect_value: INTEGER
    Error_wrong_disk_text: STRING
    Error_wrong_disk_value: INTEGER
    Error_wrong_efs_text: STRING
    Error_wrong_efs_value: INTEGER
    Error_wrong_password_text: STRING
    Error_wrong_password_value: INTEGER
    Error_wrong_target_name_text: STRING
    Error_wrong_target_name_value: INTEGER
    Frs_err_authentication_text: STRING
    Frs_err_authentication_value: INTEGER
    Frs_err_child_to_parent_comm_text: STRING
    Frs_err_child_to_parent_comm_value: INTEGER
    Frs_err_insufficient_priv_text: STRING
    Frs_err_insufficient_priv_value: INTEGER
    Frs_err_internal_api_text: STRING
    Frs_err_internal_api_value: INTEGER
    Frs_err_internal_text: STRING
    Frs_err_internal_value: INTEGER
    Frs_err_invalid_api_sequence_text: STRING
    Frs_err_invalid_api_sequence_value: INTEGER
    Frs_err_invalid_service_parameter_text: STRING
    Frs_err_invalid_service_parameter_value: INTEGER
    Frs_err_parent_authentication_text: STRING
    Frs_err_parent_authentication_value: INTEGER
    Frs_err_parent_insufficient_priv_text: STRING
    Frs_err_parent_insufficient_priv_value: INTEGER
    Frs_err_parent_to_child_comm_text: STRING
    Frs_err_parent_to_child_comm_value: INTEGER
    Frs_err_service_comm_text: STRING
    Frs_err_service_comm_value: INTEGER
    Frs_err_starting_service_text: STRING
    Frs_err_starting_service_value: INTEGER
    Frs_err_stopping_service_text: STRING
    Frs_err_stopping_service_value: INTEGER
    Frs_err_sysvol_demote_text: STRING
    Frs_err_sysvol_demote_value: INTEGER
    Frs_err_sysvol_is_busy_text: STRING
    Frs_err_sysvol_is_busy_value: INTEGER
    Frs_err_sysvol_populate_text: STRING
    Frs_err_sysvol_populate_timeout_text: STRING
    Frs_err_sysvol_populate_timeout_value: INTEGER
    Frs_err_sysvol_populate_value: INTEGER
    Or_invalid_oid_text: STRING
    Or_invalid_oid_value: INTEGER
    Or_invalid_oxid_text: STRING
    Or_invalid_oxid_value: INTEGER
    Or_invalid_set_text: STRING
    Or_invalid_set_value: INTEGER
    Rpc_s_address_error_text: STRING
    Rpc_s_address_error_value: INTEGER
    Rpc_s_already_listening_text: STRING
    Rpc_s_already_listening_value: INTEGER
    Rpc_s_already_registered_text: STRING
    Rpc_s_already_registered_value: INTEGER
    Rpc_s_binding_has_no_auth_text: STRING
    Rpc_s_binding_has_no_auth_value: INTEGER
    Rpc_s_binding_incomplete_text: STRING
    Rpc_s_binding_incomplete_value: INTEGER
    Rpc_s_call_cancelled_text: STRING
    Rpc_s_call_cancelled_value: INTEGER
    Rpc_s_call_failed_dne_text: STRING
    Rpc_s_call_failed_dne_value: INTEGER
    Rpc_s_call_failed_text: STRING
    Rpc_s_call_failed_value: INTEGER
    Rpc_s_call_in_progress_text: STRING
    Rpc_s_call_in_progress_value: INTEGER
    Rpc_s_cannot_support_text: STRING
    Rpc_s_cannot_support_value: INTEGER
    Rpc_s_cant_create_endpoint_text: STRING
    Rpc_s_cant_create_endpoint_value: INTEGER
    Rpc_s_comm_failure_text: STRING
    Rpc_s_comm_failure_value: INTEGER
    Rpc_s_duplicate_endpoint_text: STRING
    Rpc_s_duplicate_endpoint_value: INTEGER
    Rpc_s_entry_already_exists_text: STRING
    Rpc_s_entry_already_exists_value: INTEGER
    Rpc_s_entry_not_found_text: STRING
    Rpc_s_entry_not_found_value: INTEGER
    Rpc_s_entry_type_mismatch_text: STRING
    Rpc_s_entry_type_mismatch_value: INTEGER
    Rpc_s_fp_div_zero_text: STRING
    Rpc_s_fp_div_zero_value: INTEGER
    Rpc_s_fp_overflow_text: STRING
    Rpc_s_fp_overflow_value: INTEGER
    Rpc_s_fp_underflow_text: STRING
    Rpc_s_fp_underflow_value: INTEGER
    Rpc_s_group_member_not_found_text: STRING
    Rpc_s_group_member_not_found_value: INTEGER
    Rpc_s_grp_elt_not_added_text: STRING
    Rpc_s_grp_elt_not_added_value: INTEGER
    Rpc_s_grp_elt_not_removed_text: STRING
    Rpc_s_grp_elt_not_removed_value: INTEGER
    Rpc_s_incomplete_name_text: STRING
    Rpc_s_incomplete_name_value: INTEGER
    Rpc_s_interface_not_exported_text: STRING
    Rpc_s_interface_not_exported_value: INTEGER
    Rpc_s_interface_not_found_text: STRING
    Rpc_s_interface_not_found_value: INTEGER
    Rpc_s_internal_error_text: STRING
    Rpc_s_internal_error_value: INTEGER
    Rpc_s_invalid_async_call_text: STRING
    Rpc_s_invalid_async_call_value: INTEGER
    Rpc_s_invalid_async_handle_text: STRING
    Rpc_s_invalid_async_handle_value: INTEGER
    Rpc_s_invalid_auth_identity_text: STRING
    Rpc_s_invalid_auth_identity_value: INTEGER
    Rpc_s_invalid_binding_text: STRING
    Rpc_s_invalid_binding_value: INTEGER
    Rpc_s_invalid_bound_text: STRING
    Rpc_s_invalid_bound_value: INTEGER
    Rpc_s_invalid_endpoint_format_text: STRING
    Rpc_s_invalid_endpoint_format_value: INTEGER
    Rpc_s_invalid_naf_id_text: STRING
    Rpc_s_invalid_naf_id_value: INTEGER
    Rpc_s_invalid_name_syntax_text: STRING
    Rpc_s_invalid_name_syntax_value: INTEGER
    Rpc_s_invalid_net_addr_text: STRING
    Rpc_s_invalid_net_addr_value: INTEGER
    Rpc_s_invalid_network_options_text: STRING
    Rpc_s_invalid_network_options_value: INTEGER
    Rpc_s_invalid_object_text: STRING
    Rpc_s_invalid_object_value: INTEGER
    Rpc_s_invalid_rpc_protseq_text: STRING
    Rpc_s_invalid_rpc_protseq_value: INTEGER
    Rpc_s_invalid_string_binding_text: STRING
    Rpc_s_invalid_string_binding_value: INTEGER
    Rpc_s_invalid_string_uuid_text: STRING
    Rpc_s_invalid_string_uuid_value: INTEGER
    Rpc_s_invalid_tag_text: STRING
    Rpc_s_invalid_tag_value: INTEGER
    Rpc_s_invalid_timeout_text: STRING
    Rpc_s_invalid_timeout_value: INTEGER
    Rpc_s_invalid_vers_option_text: STRING
    Rpc_s_invalid_vers_option_value: INTEGER
    Rpc_s_max_calls_too_small_text: STRING
    Rpc_s_max_calls_too_small_value: INTEGER
    Rpc_s_name_service_unavailable_text: STRING
    Rpc_s_name_service_unavailable_value: INTEGER
    Rpc_s_no_bindings_text: STRING
    Rpc_s_no_bindings_value: INTEGER
    Rpc_s_no_call_active_text: STRING
    Rpc_s_no_call_active_value: INTEGER
    Rpc_s_no_context_available_text: STRING
    Rpc_s_no_context_available_value: INTEGER
    Rpc_s_no_endpoint_found_text: STRING
    Rpc_s_no_endpoint_found_value: INTEGER
    Rpc_s_no_entry_name_text: STRING
    Rpc_s_no_entry_name_value: INTEGER
    Rpc_s_no_interfaces_text: STRING
    Rpc_s_no_interfaces_value: INTEGER
    Rpc_s_no_more_bindings_text: STRING
    Rpc_s_no_more_bindings_value: INTEGER
    Rpc_s_no_more_members_text: STRING
    Rpc_s_no_more_members_value: INTEGER
    Rpc_s_no_princ_name_text: STRING
    Rpc_s_no_princ_name_value: INTEGER
    Rpc_s_no_protseqs_registered_text: STRING
    Rpc_s_no_protseqs_registered_value: INTEGER
    Rpc_s_no_protseqs_text: STRING
    Rpc_s_no_protseqs_value: INTEGER
    Rpc_s_not_all_objs_exported_text: STRING
    Rpc_s_not_all_objs_exported_value: INTEGER
    Rpc_s_not_all_objs_unexported_text: STRING
    Rpc_s_not_all_objs_unexported_value: INTEGER
    Rpc_s_not_cancelled_text: STRING
    Rpc_s_not_cancelled_value: INTEGER
    Rpc_s_not_listening_text: STRING
    Rpc_s_not_listening_value: INTEGER
    Rpc_s_not_rpc_error_text: STRING
    Rpc_s_not_rpc_error_value: INTEGER
    Rpc_s_nothing_to_export_text: STRING
    Rpc_s_nothing_to_export_value: INTEGER
    Rpc_s_object_not_found_text: STRING
    Rpc_s_object_not_found_value: INTEGER
    Rpc_s_out_of_resources_text: STRING
    Rpc_s_out_of_resources_value: INTEGER
    Rpc_s_prf_elt_not_added_text: STRING
    Rpc_s_prf_elt_not_added_value: INTEGER
    Rpc_s_prf_elt_not_removed_text: STRING
    Rpc_s_prf_elt_not_removed_value: INTEGER
    Rpc_s_procnum_out_of_range_text: STRING
    Rpc_s_procnum_out_of_range_value: INTEGER
    Rpc_s_profile_not_added_text: STRING
    Rpc_s_profile_not_added_value: INTEGER
    Rpc_s_protocol_error_text: STRING
    Rpc_s_protocol_error_value: INTEGER
    Rpc_s_protseq_not_found_text: STRING
    Rpc_s_protseq_not_found_value: INTEGER
    Rpc_s_protseq_not_supported_text: STRING
    Rpc_s_protseq_not_supported_value: INTEGER
    Rpc_s_sec_pkg_error_text: STRING
    Rpc_s_sec_pkg_error_value: INTEGER
    Rpc_s_send_incomplete_text: STRING
    Rpc_s_send_incomplete_value: INTEGER
    Rpc_s_server_too_busy_text: STRING
    Rpc_s_server_too_busy_value: INTEGER
    Rpc_s_server_unavailable_text: STRING
    Rpc_s_server_unavailable_value: INTEGER
    Rpc_s_string_too_long_text: STRING
    Rpc_s_string_too_long_value: INTEGER
    Rpc_s_type_already_registered_text: STRING
    Rpc_s_type_already_registered_value: INTEGER
    Rpc_s_unknown_authn_level_text: STRING
    Rpc_s_unknown_authn_level_value: INTEGER
    Rpc_s_unknown_authn_service_text: STRING
    Rpc_s_unknown_authn_service_value: INTEGER
    Rpc_s_unknown_authn_type_text: STRING
    Rpc_s_unknown_authn_type_value: INTEGER
    Rpc_s_unknown_authz_service_text: STRING
    Rpc_s_unknown_authz_service_value: INTEGER
    Rpc_s_unknown_if_text: STRING
    Rpc_s_unknown_if_value: INTEGER
    Rpc_s_unknown_mgr_type_text: STRING
    Rpc_s_unknown_mgr_type_value: INTEGER
    Rpc_s_unsupported_authn_level_text: STRING
    Rpc_s_unsupported_authn_level_value: INTEGER
    Rpc_s_unsupported_name_syntax_text: STRING
    Rpc_s_unsupported_name_syntax_value: INTEGER
    Rpc_s_unsupported_trans_syn_text: STRING
    Rpc_s_unsupported_trans_syn_value: INTEGER
    Rpc_s_unsupported_type_text: STRING
    Rpc_s_unsupported_type_value: INTEGER
    Rpc_s_uuid_local_only_text: STRING
    Rpc_s_uuid_local_only_value: INTEGER
    Rpc_s_uuid_no_address_text: STRING
    Rpc_s_uuid_no_address_value: INTEGER
    Rpc_s_wrong_kind_of_binding_text: STRING
    Rpc_s_wrong_kind_of_binding_value: INTEGER
    Rpc_s_zero_divide_text: STRING
    Rpc_s_zero_divide_value: INTEGER
    Rpc_x_bad_stub_data_text: STRING
    Rpc_x_bad_stub_data_value: INTEGER
    Rpc_x_byte_count_too_small_text: STRING
    Rpc_x_byte_count_too_small_value: INTEGER
    Rpc_x_enum_value_out_of_range_text: STRING
    Rpc_x_enum_value_out_of_range_value: INTEGER
    Rpc_x_invalid_es_action_text: STRING
    Rpc_x_invalid_es_action_value: INTEGER
    Rpc_x_invalid_pipe_object_text: STRING
    Rpc_x_invalid_pipe_object_value: INTEGER
    Rpc_x_no_more_entries_text: STRING
    Rpc_x_no_more_entries_value: INTEGER
    Rpc_x_null_ref_pointer_text: STRING
    Rpc_x_null_ref_pointer_value: INTEGER
    Rpc_x_pipe_closed_text: STRING
    Rpc_x_pipe_closed_value: INTEGER
    Rpc_x_pipe_discipline_error_text: STRING
    Rpc_x_pipe_discipline_error_value: INTEGER
    Rpc_x_pipe_empty_text: STRING
    Rpc_x_pipe_empty_value: INTEGER
    Rpc_x_ss_cannot_get_call_handle_text: STRING
    Rpc_x_ss_cannot_get_call_handle_value: INTEGER
    Rpc_x_ss_char_trans_open_fail_text: STRING
    Rpc_x_ss_char_trans_open_fail_value: INTEGER
    Rpc_x_ss_char_trans_short_file_text: STRING
    Rpc_x_ss_char_trans_short_file_value: INTEGER
    Rpc_x_ss_context_damaged_text: STRING
    Rpc_x_ss_context_damaged_value: INTEGER
    Rpc_x_ss_handles_mismatch_text: STRING
    Rpc_x_ss_handles_mismatch_value: INTEGER
    Rpc_x_ss_in_null_context_text: STRING
    Rpc_x_ss_in_null_context_value: INTEGER
    Rpc_x_wrong_es_version_text: STRING
    Rpc_x_wrong_es_version_value: INTEGER
    Rpc_x_wrong_pipe_order_text: STRING
    Rpc_x_wrong_pipe_order_value: INTEGER
    Rpc_x_wrong_pipe_version_text: STRING
    Rpc_x_wrong_pipe_version_value: INTEGER
    Rpc_x_wrong_stub_version_text: STRING
    Rpc_x_wrong_stub_version_value: INTEGER
    Sched_e_service_not_localsystem_text: STRING
    Sched_e_service_not_localsystem_value: INTEGER
    Wait_timeout_text: STRING
    Wait_timeout_value: INTEGER
    Wsa_e_cancelled_text: STRING
    Wsa_e_cancelled_value: INTEGER
    Wsa_e_no_more_text: STRING
    Wsa_e_no_more_value: INTEGER
    Wsa_qos_admission_failure_text: STRING
    Wsa_qos_admission_failure_value: INTEGER
    Wsa_qos_bad_object_text: STRING
    Wsa_qos_bad_object_value: INTEGER
    Wsa_qos_bad_style_text: STRING
    Wsa_qos_bad_style_value: INTEGER
    Wsa_qos_efiltercount_text: STRING
    Wsa_qos_efiltercount_value: INTEGER
    Wsa_qos_efilterstyle_text: STRING
    Wsa_qos_efilterstyle_value: INTEGER
    Wsa_qos_efiltertype_text: STRING
    Wsa_qos_efiltertype_value: INTEGER
    Wsa_qos_eflowcount_text: STRING
    Wsa_qos_eflowcount_value: INTEGER
    Wsa_qos_eflowdesc_text: STRING
    Wsa_qos_eflowdesc_value: INTEGER
    Wsa_qos_eflowspec_text: STRING
    Wsa_qos_eflowspec_value: INTEGER
    Wsa_qos_eobjlength_text: STRING
    Wsa_qos_eobjlength_value: INTEGER
    Wsa_qos_epolicyobj_text: STRING
    Wsa_qos_epolicyobj_value: INTEGER
    Wsa_qos_eprovspecbuf_text: STRING
    Wsa_qos_eprovspecbuf_value: INTEGER
    Wsa_qos_epsfilterspec_text: STRING
    Wsa_qos_epsfilterspec_value: INTEGER
    Wsa_qos_epsflowspec_text: STRING
    Wsa_qos_epsflowspec_value: INTEGER
    Wsa_qos_esdmodeobj_text: STRING
    Wsa_qos_esdmodeobj_value: INTEGER
    Wsa_qos_eservicetype_text: STRING
    Wsa_qos_eservicetype_value: INTEGER
    Wsa_qos_eshaperateobj_text: STRING
    Wsa_qos_eshaperateobj_value: INTEGER
    Wsa_qos_eunkownpsobj_text: STRING
    Wsa_qos_eunkownpsobj_value: INTEGER
    Wsa_qos_generic_error_text: STRING
    Wsa_qos_generic_error_value: INTEGER
    Wsa_qos_no_receivers_text: STRING
    Wsa_qos_no_receivers_value: INTEGER
    Wsa_qos_no_senders_text: STRING
    Wsa_qos_no_senders_value: INTEGER
    Wsa_qos_policy_failure_text: STRING
    Wsa_qos_policy_failure_value: INTEGER
    Wsa_qos_receivers_text: STRING
    Wsa_qos_receivers_value: INTEGER
    Wsa_qos_request_confirmed_text: STRING
    Wsa_qos_request_confirmed_value: INTEGER
    Wsa_qos_reserved_petype_text: STRING
    Wsa_qos_reserved_petype_value: INTEGER
    Wsa_qos_senders_text: STRING
    Wsa_qos_senders_value: INTEGER
    Wsa_qos_traffic_ctrl_error_text: STRING
    Wsa_qos_traffic_ctrl_error_value: INTEGER
    Wsaeacces_text: STRING
    Wsaeacces_value: INTEGER
    Wsaeaddrinuse_text: STRING
    Wsaeaddrinuse_value: INTEGER
    Wsaeaddrnotavail_text: STRING
    Wsaeaddrnotavail_value: INTEGER
    Wsaeafnosupport_text: STRING
    Wsaeafnosupport_value: INTEGER
    Wsaealready_text: STRING
    Wsaealready_value: INTEGER
    Wsaebadf_text: STRING
    Wsaebadf_value: INTEGER
    Wsaecancelled_text: STRING
    Wsaecancelled_value: INTEGER
    Wsaeconnaborted_text: STRING
    Wsaeconnaborted_value: INTEGER
    Wsaeconnrefused_text: STRING
    Wsaeconnrefused_value: INTEGER
    Wsaeconnreset_text: STRING
    Wsaeconnreset_value: INTEGER
    Wsaedestaddrreq_text: STRING
    Wsaedestaddrreq_value: INTEGER
    Wsaediscon_text: STRING
    Wsaediscon_value: INTEGER
    Wsaedquot_text: STRING
    Wsaedquot_value: INTEGER
    Wsaefault_text: STRING
    Wsaefault_value: INTEGER
    Wsaehostdown_text: STRING
    Wsaehostdown_value: INTEGER
    Wsaehostunreach_text: STRING
    Wsaehostunreach_value: INTEGER
    Wsaeinprogress_text: STRING
    Wsaeinprogress_value: INTEGER
    Wsaeintr_text: STRING
    Wsaeintr_value: INTEGER
    Wsaeinval_text: STRING
    Wsaeinval_value: INTEGER
    Wsaeinvalidproctable_text: STRING
    Wsaeinvalidproctable_value: INTEGER
    Wsaeinvalidprovider_text: STRING
    Wsaeinvalidprovider_value: INTEGER
    Wsaeisconn_text: STRING
    Wsaeisconn_value: INTEGER
    Wsaeloop_text: STRING
    Wsaeloop_value: INTEGER
    Wsaemfile_text: STRING
    Wsaemfile_value: INTEGER
    Wsaemsgsize_text: STRING
    Wsaemsgsize_value: INTEGER
    Wsaenametoolong_text: STRING
    Wsaenametoolong_value: INTEGER
    Wsaenetdown_text: STRING
    Wsaenetdown_value: INTEGER
    Wsaenetreset_text: STRING
    Wsaenetreset_value: INTEGER
    Wsaenetunreach_text: STRING
    Wsaenetunreach_value: INTEGER
    Wsaenobufs_text: STRING
    Wsaenobufs_value: INTEGER
    Wsaenomore_text: STRING
    Wsaenomore_value: INTEGER
    Wsaenoprotoopt_text: STRING
    Wsaenoprotoopt_value: INTEGER
    Wsaenotconn_text: STRING
    Wsaenotconn_value: INTEGER
    Wsaenotempty_text: STRING
    Wsaenotempty_value: INTEGER
    Wsaenotsock_text: STRING
    Wsaenotsock_value: INTEGER
    Wsaeopnotsupp_text: STRING
    Wsaeopnotsupp_value: INTEGER
    Wsaepfnosupport_text: STRING
    Wsaepfnosupport_value: INTEGER
    Wsaeproclim_text: STRING
    Wsaeproclim_value: INTEGER
    Wsaeprotonosupport_text: STRING
    Wsaeprotonosupport_value: INTEGER
    Wsaeprototype_text: STRING
    Wsaeprototype_value: INTEGER
    Wsaeproviderfailedinit_text: STRING
    Wsaeproviderfailedinit_value: INTEGER
    Wsaerefused_text: STRING
    Wsaerefused_value: INTEGER
    Wsaeremote_text: STRING
    Wsaeremote_value: INTEGER
    Wsaeshutdown_text: STRING
    Wsaeshutdown_value: INTEGER
    Wsaesocktnosupport_text: STRING
    Wsaesocktnosupport_value: INTEGER
    Wsaestale_text: STRING
    Wsaestale_value: INTEGER
    Wsaetimedout_text: STRING
    Wsaetimedout_value: INTEGER
    Wsaetoomanyrefs_text: STRING
    Wsaetoomanyrefs_value: INTEGER
    Wsaeusers_text: STRING
    Wsaeusers_value: INTEGER
    Wsaewouldblock_text: STRING
    Wsaewouldblock_value: INTEGER
    Wsahost_not_found_text: STRING
    Wsahost_not_found_value: INTEGER
    Wsano_data_text: STRING
    Wsano_data_value: INTEGER
    Wsano_recovery_text: STRING
    Wsano_recovery_value: INTEGER
    Wsanotinitialised_text: STRING
    Wsanotinitialised_value: INTEGER
    Wsaservice_not_found_text: STRING
    Wsaservice_not_found_value: INTEGER
    Wsasyscallfailure_text: STRING
    Wsasyscallfailure_value: INTEGER
    Wsasysnotready_text: STRING
    Wsasysnotready_value: INTEGER
    Wsatry_again_text: STRING
    Wsatry_again_value: INTEGER
    Wsatype_not_found_text: STRING
    Wsatype_not_found_value: INTEGER
    Wsavernotsupported_text: STRING
    Wsavernotsupported_value: INTEGER


WEL_WINDOWS_ERROR_MESSAGES Flat contracts

indexing
    description: "Windows error messages in human-readable form."
    note: "Automatically generated from WinError.h"

class interface
    WEL_WINDOWS_ERROR_MESSAGES

feature -- Access

    Dns_error_autozone_already_exists_text: STRING is "DNS automatic zone already exists."

    Dns_error_autozone_already_exists_value: INTEGER is 9610

    Dns_error_axfr_text: STRING is "DNS zone transfer failed."

    Dns_error_axfr_value: INTEGER is 9752

    Dns_error_bad_packet_text: STRING is "Bad DNS packet."

    Dns_error_bad_packet_value: INTEGER is 9502

    Dns_error_cname_collision_text: STRING is "A CNAME record already exists for given name."

    Dns_error_cname_collision_value: INTEGER is 9709

    Dns_error_cname_loop_text: STRING is "CNAME loop detected."

    Dns_error_cname_loop_value: INTEGER is 9707

    Dns_error_datafile_open_failure_text: STRING is "Failed to open datafile for DNS zone."

    Dns_error_datafile_open_failure_value: INTEGER is 9653

    Dns_error_datafile_parsing_text: STRING is "Failure while reading datafile for DNS zone."

    Dns_error_datafile_parsing_value: INTEGER is 9655

    Dns_error_ds_unavailable_text: STRING is "The directory service is unavailable."

    Dns_error_ds_unavailable_value: INTEGER is 9717

    Dns_error_ds_zone_already_exists_text: STRING is "DNS zone already exists in the directory service."

    Dns_error_ds_zone_already_exists_value: INTEGER is 9718

    Dns_error_file_writeback_failed_text: STRING is "Failed to write datafile for DNS zone."

    Dns_error_file_writeback_failed_value: INTEGER is 9654

    Dns_error_invalid_datafile_name_text: STRING is "Invalid datafile name for DNS zone."

    Dns_error_invalid_datafile_name_value: INTEGER is 9652

    Dns_error_invalid_ip_address_text: STRING is "Invalid IP address."

    Dns_error_invalid_ip_address_value: INTEGER is 9552

    Dns_error_invalid_name_char_text: STRING is "DNS name contains an invalid character."

    Dns_error_invalid_name_char_value: INTEGER is 9560

    Dns_error_invalid_property_text: STRING is "Invalid property."

    Dns_error_invalid_property_value: INTEGER is 9553

    Dns_error_invalid_type_text: STRING is "Invalid DNS type."

    Dns_error_invalid_type_value: INTEGER is 9551

    Dns_error_invalid_zone_operation_text: STRING is "Invalid operation for DNS zone."

    Dns_error_invalid_zone_operation_value: INTEGER is 9603

    Dns_error_invalid_zone_type_text: STRING is "Invalid DNS zone type."

    Dns_error_invalid_zone_type_value: INTEGER is 9611

    Dns_error_name_does_not_exist_text: STRING is "DNS name does not exist."

    Dns_error_name_does_not_exist_value: INTEGER is 9714

    Dns_error_name_not_in_zone_text: STRING is "Name not in DNS zone."

    Dns_error_name_not_in_zone_value: INTEGER is 9706

    Dns_error_nbstat_init_failed_text: STRING is "NBTSTAT initialization call failed."

    Dns_error_nbstat_init_failed_value: INTEGER is 9617

    Dns_error_need_secondary_addresses_text: STRING is "Need secondary IP address."

    Dns_error_need_secondary_addresses_value: INTEGER is 9614

    Dns_error_need_wins_servers_text: STRING is "Need WINS servers."

    Dns_error_need_wins_servers_value: INTEGER is 9616

    Dns_error_no_bootfile_if_ds_zone_text: STRING is "DNS server not creating or reading the boot file for the directory service integrated DNS zone."

    Dns_error_no_bootfile_if_ds_zone_value: INTEGER is 9719

    Dns_error_no_create_cache_data_text: STRING is "Could not create DNS cache data."

    Dns_error_no_create_cache_data_value: INTEGER is 9713

    Dns_error_no_dns_servers_text: STRING is "No DNS servers configured for local system."

    Dns_error_no_dns_servers_value: INTEGER is 9852

    Dns_error_no_packet_text: STRING is "No DNS packet."

    Dns_error_no_packet_value: INTEGER is 9503

    Dns_error_no_tcpip_text: STRING is "TCP/IP network protocol not installed."

    Dns_error_no_tcpip_value: INTEGER is 9851

    Dns_error_no_zone_info_text: STRING is "DNS zone information not available."

    Dns_error_no_zone_info_value: INTEGER is 9602

    Dns_error_node_creation_failed_text: STRING is "Node creation failure in DNS."

    Dns_error_node_creation_failed_value: INTEGER is 9703

    Dns_error_node_is_cname_text: STRING is "Node is a CNAME DNS record."

    Dns_error_node_is_cname_value: INTEGER is 9708

    Dns_error_non_rfc_name_text: STRING is "DNS name does not comply with RFC specifications."

    Dns_error_non_rfc_name_value: INTEGER is 9556

    Dns_error_not_unique_text: STRING is "Record for given name and type is not unique."

    Dns_error_not_unique_value: INTEGER is 9555

    Dns_error_numeric_name_text: STRING is "DNS name is entirely numeric."

    Dns_error_numeric_name_value: INTEGER is 9561

    Dns_error_primary_requires_datafile_text: STRING is "Primary DNS zone requires datafile."

    Dns_error_primary_requires_datafile_value: INTEGER is 9651

    Dns_error_rcode_badkey_text: STRING is "DNS bad key."

    Dns_error_rcode_badkey_value: INTEGER is 9017

    Dns_error_rcode_badsig_text: STRING is "DNS signature failed to verify."

    Dns_error_rcode_badsig_value: INTEGER is 9016

    Dns_error_rcode_badtime_text: STRING is "DNS signature validity expired."

    Dns_error_rcode_badtime_value: INTEGER is 9018

    Dns_error_rcode_format_error_text: STRING is "DNS server unable to interpret format."

    Dns_error_rcode_format_error_value: INTEGER is 9001

    Dns_error_rcode_name_error_text: STRING is "DNS name does not exist."

    Dns_error_rcode_name_error_value: INTEGER is 9003

    Dns_error_rcode_not_implemented_text: STRING is "DNS request not supported by name server."

    Dns_error_rcode_not_implemented_value: INTEGER is 9004

    Dns_error_rcode_notauth_text: STRING is "DNS server not authoritative for zone."

    Dns_error_rcode_notauth_value: INTEGER is 9009

    Dns_error_rcode_notzone_text: STRING is "DNS name in update or prereq is not in zone."

    Dns_error_rcode_notzone_value: INTEGER is 9010

    Dns_error_rcode_nxrrset_text: STRING is "DNS RR set that ought to exist, does not exist."

    Dns_error_rcode_nxrrset_value: INTEGER is 9008

    Dns_error_rcode_refused_text: STRING is "DNS operation refused."

    Dns_error_rcode_refused_value: INTEGER is 9005

    Dns_error_rcode_server_failure_text: STRING is "DNS server failure."

    Dns_error_rcode_server_failure_value: INTEGER is 9002

    Dns_error_rcode_text: STRING is "DNS error, check rcode."

    Dns_error_rcode_value: INTEGER is 9504

    Dns_error_rcode_yxdomain_text: STRING is "DNS name that ought not exist, does exist."

    Dns_error_rcode_yxdomain_value: INTEGER is 9006

    Dns_error_rcode_yxrrset_text: STRING is "DNS RR set that ought not exist, does exist."

    Dns_error_rcode_yxrrset_value: INTEGER is 9007

    Dns_error_record_already_exists_text: STRING is "DNS record already exists."

    Dns_error_record_already_exists_value: INTEGER is 9711

    Dns_error_record_does_not_exist_text: STRING is "DNS record does not exist."

    Dns_error_record_does_not_exist_value: INTEGER is 9701

    Dns_error_record_format_text: STRING is "DNS record format error."

    Dns_error_record_format_value: INTEGER is 9702

    Dns_error_record_only_at_zone_root_text: STRING is "Record only at DNS zone root."

    Dns_error_record_only_at_zone_root_value: INTEGER is 9710

    Dns_error_record_timed_out_text: STRING is "DNS record timed out."

    Dns_error_record_timed_out_value: INTEGER is 9705

    Dns_error_secondary_data_text: STRING is "Secondary DNS zone data error."

    Dns_error_secondary_data_value: INTEGER is 9712

    Dns_error_secondary_requires_master_ip_text: STRING is "Secondary DNS zone requires master IP address."

    Dns_error_secondary_requires_master_ip_value: INTEGER is 9612

    Dns_error_soa_delete_invalid_text: STRING is "Invalid delete of start of authority (SOA)"

    Dns_error_soa_delete_invalid_value: INTEGER is 9618

    Dns_error_try_again_later_text: STRING is "Try DNS operation again later."

    Dns_error_try_again_later_value: INTEGER is 9554

    Dns_error_unknown_record_type_text: STRING is "Unknown DNS record type."

    Dns_error_unknown_record_type_value: INTEGER is 9704

    Dns_error_unsecure_packet_text: STRING is "Unsecured DNS packet."

    Dns_error_unsecure_packet_value: INTEGER is 9505

    Dns_error_wins_init_failed_text: STRING is "WINS initialization failed."

    Dns_error_wins_init_failed_value: INTEGER is 9615

    Dns_error_zone_already_exists_text: STRING is "DNS zone already exists."

    Dns_error_zone_already_exists_value: INTEGER is 9609

    Dns_error_zone_configuration_error_text: STRING is "Invalid DNS zone configuration."

    Dns_error_zone_configuration_error_value: INTEGER is 9604

    Dns_error_zone_creation_failed_text: STRING is "DNS zone creation failed."

    Dns_error_zone_creation_failed_value: INTEGER is 9608

    Dns_error_zone_does_not_exist_text: STRING is "DNS zone does not exist."

    Dns_error_zone_does_not_exist_value: INTEGER is 9601

    Dns_error_zone_has_no_ns_records_text: STRING is "DNS zone has no Name Server (NS) record."

    Dns_error_zone_has_no_ns_records_value: INTEGER is 9606

    Dns_error_zone_has_no_soa_record_text: STRING is "DNS zone has no start of authority (SOA) record."

    Dns_error_zone_has_no_soa_record_value: INTEGER is 9605

    Dns_error_zone_locked_text: STRING is "DNS zone is locked."

    Dns_error_zone_locked_value: INTEGER is 9607

    Dns_error_zone_not_secondary_text: STRING is "DNS zone not secondary."

    Dns_error_zone_not_secondary_value: INTEGER is 9613

    Dns_info_added_local_wins_text: STRING is "Added local WINS server."

    Dns_info_added_local_wins_value: INTEGER is 9753

    Dns_info_axfr_complete_text: STRING is "DNS AXFR (zone transfer) complete."

    Dns_info_axfr_complete_value: INTEGER is 9751

    Dns_info_no_records_text: STRING is "No records found for given DNS query."

    Dns_info_no_records_value: INTEGER is 9501

    Dns_status_continue_needed_text: STRING is "Secure update call needs to continue update request."

    Dns_status_continue_needed_value: INTEGER is 9801

    Dns_status_dotted_name_text: STRING is "DNS name is dotted (multi-label)."

    Dns_status_dotted_name_value: INTEGER is 9558

    Dns_status_fqdn_text: STRING is "DNS name is a fully-qualified DNS name."

    Dns_status_fqdn_value: INTEGER is 9557

    Dns_status_single_part_name_text: STRING is "DNS name is a single-part name."

    Dns_status_single_part_name_value: INTEGER is 9559

    Dns_warning_domain_undeleted_text: STRING is "DNS domain was undeleted."

    Dns_warning_domain_undeleted_value: INTEGER is 9716

    Dns_warning_ptr_create_failed_text: STRING is "Could not create pointer (PTR) record."

    Dns_warning_ptr_create_failed_value: INTEGER is 9715

    Ept_s_cant_create_text: STRING is "The endpoint mapper database entry could not be created."

    Ept_s_cant_create_value: INTEGER is 1899

    Ept_s_cant_perform_op_text: STRING is "The server endpoint cannot perform the operation."

    Ept_s_cant_perform_op_value: INTEGER is 1752

    Ept_s_invalid_entry_text: STRING is "The entry is invalid."

    Ept_s_invalid_entry_value: INTEGER is 1751

    Ept_s_not_registered_text: STRING is "There are no more endpoints available from the endpoint mapper."

    Ept_s_not_registered_value: INTEGER is 1753

    Error_access_denied_text: STRING is "Access is denied."

    Error_access_denied_value: INTEGER is 5

    Error_account_disabled_text: STRING is "Logon failure: account currently disabled."

    Error_account_disabled_value: INTEGER is 1331

    Error_account_expired_text: STRING is "The user's account has expired."

    Error_account_expired_value: INTEGER is 1793

    Error_account_locked_out_text: STRING is "The referenced account is currently locked out and may not be logged on to."

    Error_account_locked_out_value: INTEGER is 1909

    Error_account_restriction_text: STRING is "Logon failure: user account restriction."

    Error_account_restriction_value: INTEGER is 1327

    Error_active_connections_text: STRING is "Active connections still exist."

    Error_active_connections_value: INTEGER is 2402

    Error_adap_hdw_err_text: STRING is "A network adapter hardware error occurred."

    Error_adap_hdw_err_value: INTEGER is 57

    Error_address_already_associated_text: STRING is "The network transport endpoint already has an address associated with it."

    Error_address_already_associated_value: INTEGER is 1227

    Error_address_not_associated_text: STRING is "An address has not yet been associated with the network endpoint."

    Error_address_not_associated_value: INTEGER is 1228

    Error_alias_exists_text: STRING is "The specified local group already exists."

    Error_alias_exists_value: INTEGER is 1379

    Error_all_nodes_not_available_text: STRING is "All cluster nodes must be running to perform this operation."

    Error_all_nodes_not_available_value: INTEGER is 5037

    Error_allotted_space_exceeded_text: STRING is "No more memory is available for security information updates."

    Error_allotted_space_exceeded_value: INTEGER is 1344

    Error_already_assigned_text: STRING is "The local device name is already in use."

    Error_already_assigned_value: INTEGER is 85

    Error_already_exists_text: STRING is "Cannot create a file when that file already exists."

    Error_already_exists_value: INTEGER is 183

    Error_already_initialized_text: STRING is "An attempt was made to perform an initialization operation when initialization has already been completed."

    Error_already_initialized_value: INTEGER is 1247

    Error_already_registered_text: STRING is "The service is already registered."

    Error_already_registered_value: INTEGER is 1242

    Error_already_running_lkg_text: STRING is "The system is currently running with the last-known-good configuration."

    Error_already_running_lkg_value: INTEGER is 1074

    Error_already_waiting_text: STRING is "The specified printer handle is already being waited on"

    Error_already_waiting_value: INTEGER is 1904

    Error_app_wrong_os_text: STRING is "The specified program is not a Windows or MS-DOS program."

    Error_app_wrong_os_value: INTEGER is 1151

    Error_arena_trashed_text: STRING is "The storage control blocks were destroyed."

    Error_arena_trashed_value: INTEGER is 7

    Error_arithmetic_overflow_text: STRING is "Arithmetic result exceeded 32 bits."

    Error_arithmetic_overflow_value: INTEGER is 534

    Error_atomic_locks_not_supported_text: STRING is "The file system does not support atomic changes to the lock type."

    Error_atomic_locks_not_supported_value: INTEGER is 174

    Error_autodataseg_exceeds_64k_text: STRING is "The operating system cannot run this application program."

    Error_autodataseg_exceeds_64k_value: INTEGER is 199

    Error_bad_arguments_text: STRING is "The argument string passed to DosExecPgm is not correct."

    Error_bad_arguments_value: INTEGER is 160

    Error_bad_command_text: STRING is "The device does not recognize the command."

    Error_bad_command_value: INTEGER is 22

    Error_bad_configuration_text: STRING is "The configuration data for this product is corrupt.  Contact your support personnel."

    Error_bad_configuration_value: INTEGER is 1610

    Error_bad_descriptor_format_text: STRING is "A security descriptor is not in the right format (absolute or self-relative)."

    Error_bad_descriptor_format_value: INTEGER is 1361

    Error_bad_dev_type_text: STRING is "The network resource type is not correct."

    Error_bad_dev_type_value: INTEGER is 66

    Error_bad_device_text: STRING is "The specified device name is invalid."

    Error_bad_device_value: INTEGER is 1200

    Error_bad_driver_level_text: STRING is "The system does not support the command requested."

    Error_bad_driver_level_value: INTEGER is 119

    Error_bad_driver_text: STRING is "The specified driver is invalid."

    Error_bad_driver_value: INTEGER is 2001

    Error_bad_environment_text: STRING is "The environment is incorrect."

    Error_bad_environment_value: INTEGER is 10

    Error_bad_exe_format_text: STRING is "%%1 is not a valid Win32 application."

    Error_bad_exe_format_value: INTEGER is 193

    Error_bad_format_text: STRING is "An attempt was made to load a program with an incorrect format."

    Error_bad_format_value: INTEGER is 11

    Error_bad_impersonation_level_text: STRING is "Either a required impersonation level was not provided, or the provided impersonation level is invalid."

    Error_bad_impersonation_level_value: INTEGER is 1346

    Error_bad_inheritance_acl_text: STRING is "The inherited access control list (ACL) or access control entry (ACE) could not be built."

    Error_bad_inheritance_acl_value: INTEGER is 1340

    Error_bad_length_text: STRING is "The program issued a command but the command length is incorrect."

    Error_bad_length_value: INTEGER is 24

    Error_bad_logon_session_state_text: STRING is "The logon session is not in a state that is consistent with the requested operation."

    Error_bad_logon_session_state_value: INTEGER is 1365

    Error_bad_net_name_text: STRING is "The network name cannot be found."

    Error_bad_net_name_value: INTEGER is 67

    Error_bad_net_resp_text: STRING is "The specified server cannot perform the requested operation."

    Error_bad_net_resp_value: INTEGER is 58

    Error_bad_netpath_text: STRING is "The network path was not found."

    Error_bad_netpath_value: INTEGER is 53

    Error_bad_pathname_text: STRING is "The specified path is invalid."

    Error_bad_pathname_value: INTEGER is 161

    Error_bad_pipe_text: STRING is "The pipe state is invalid."

    Error_bad_pipe_value: INTEGER is 230

    Error_bad_profile_text: STRING is "The network connection profile is corrupted."

    Error_bad_profile_value: INTEGER is 1206

    Error_bad_provider_text: STRING is "The specified network provider name is invalid."

    Error_bad_provider_value: INTEGER is 1204

    Error_bad_query_syntax_text: STRING is "SQL query syntax invalid or unsupported."

    Error_bad_query_syntax_value: INTEGER is 1615

    Error_bad_rem_adap_text: STRING is "The remote adapter is not compatible."

    Error_bad_rem_adap_value: INTEGER is 60

    Error_bad_threadid_addr_text: STRING is "The address for the thread ID is not correct."

    Error_bad_threadid_addr_value: INTEGER is 159

    Error_bad_token_type_text: STRING is "The type of the token is inappropriate for its attempted use."

    Error_bad_token_type_value: INTEGER is 1349

    Error_bad_unit_text: STRING is "The system cannot find the device specified."

    Error_bad_unit_value: INTEGER is 20

    Error_bad_user_profile_text: STRING is "The specified user does not have a valid profile."

    Error_bad_user_profile_value: INTEGER is 1253

    Error_bad_username_text: STRING is "The specified username is invalid."

    Error_bad_username_value: INTEGER is 2202

    Error_bad_validation_class_text: STRING is "The validation information class requested was invalid."

    Error_bad_validation_class_value: INTEGER is 1348

    Error_baddb_text: STRING is "The configuration registry database is corrupt."

    Error_baddb_value: INTEGER is 1009

    Error_badkey_text: STRING is "The configuration registry key is invalid."

    Error_badkey_value: INTEGER is 1010

    Error_beginning_of_media_text: STRING is "The beginning of the tape or a partition was encountered."

    Error_beginning_of_media_value: INTEGER is 1102

    Error_boot_already_accepted_text: STRING is "The current boot has already been accepted for use as the last-known-good control set."

    Error_boot_already_accepted_value: INTEGER is 1076

    Error_broken_pipe_text: STRING is "The pipe has been ended."

    Error_broken_pipe_value: INTEGER is 109

    Error_buffer_overflow_text: STRING is "The file name is too long."

    Error_buffer_overflow_value: INTEGER is 111

    Error_bus_reset_text: STRING is "The I/O bus was reset."

    Error_bus_reset_value: INTEGER is 1111

    Error_busy_drive_text: STRING is "The system cannot perform a JOIN or SUBST at this time."

    Error_busy_drive_value: INTEGER is 142

    Error_busy_text: STRING is "The requested resource is in use."

    Error_busy_value: INTEGER is 170

    Error_call_not_implemented_text: STRING is "This function is not supported on this system."

    Error_call_not_implemented_value: INTEGER is 120

    Error_can_not_complete_text: STRING is "Cannot complete this function."

    Error_can_not_complete_value: INTEGER is 1003

    Error_can_not_del_local_wins_text: STRING is "The local WINS cannot be deleted."

    Error_can_not_del_local_wins_value: INTEGER is 4001

    Error_cancel_violation_text: STRING is "A lock request was not outstanding for the supplied cancel region."

    Error_cancel_violation_value: INTEGER is 173

    Error_cancelled_text: STRING is "The operation was canceled by the user."

    Error_cancelled_value: INTEGER is 1223

    Error_cannot_copy_text: STRING is "The copy functions cannot be used."

    Error_cannot_copy_value: INTEGER is 266

    Error_cannot_detect_driver_failure_text: STRING is "Failure actions can only be set for Win32 services, not for drivers."

    Error_cannot_detect_driver_failure_value: INTEGER is 1080

    Error_cannot_detect_process_abort_text: STRING is "This service runs in the same process as the service control manager.  Therefore, the service control manager cannot take action if this service's process terminates unexpectedly."

    Error_cannot_detect_process_abort_value: INTEGER is 1081

    Error_cannot_find_wnd_class_text: STRING is "Cannot find window class."

    Error_cannot_find_wnd_class_value: INTEGER is 1407

    Error_cannot_impersonate_text: STRING is "Unable to impersonate using a named pipe until data has been read from that pipe."

    Error_cannot_impersonate_value: INTEGER is 1368

    Error_cannot_make_text: STRING is "The directory or file cannot be created."

    Error_cannot_make_value: INTEGER is 82

    Error_cannot_open_profile_text: STRING is "Unable to open the network connection profile."

    Error_cannot_open_profile_value: INTEGER is 1205

    Error_cant_access_domain_info_text: STRING is "Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied."

    Error_cant_access_domain_info_value: INTEGER is 1351

    Error_cant_access_file_text: STRING is "The file cannot be accessed by the system."

    Error_cant_access_file_value: INTEGER is 1920

    Error_cant_delete_last_item_text: STRING is "The last remaining item in this group or resource cannot be deleted."

    Error_cant_delete_last_item_value: INTEGER is 4335

    Error_cant_disable_mandatory_text: STRING is "The group may not be disabled."

    Error_cant_disable_mandatory_value: INTEGER is 1310

    Error_cant_evict_active_node_text: STRING is "A cluster node cannot be evicted from the cluster while it is online."

    Error_cant_evict_active_node_value: INTEGER is 5009

    Error_cant_open_anonymous_text: STRING is "Cannot open an anonymous level security token."

    Error_cant_open_anonymous_value: INTEGER is 1347

    Error_cant_resolve_filename_text: STRING is "The name of the file cannot be resolved by the system."

    Error_cant_resolve_filename_value: INTEGER is 1921

    Error_cantopen_text: STRING is "The configuration registry key could not be opened."

    Error_cantopen_value: INTEGER is 1011

    Error_cantread_text: STRING is "The configuration registry key could not be read."

    Error_cantread_value: INTEGER is 1012

    Error_cantwrite_text: STRING is "The configuration registry key could not be written."

    Error_cantwrite_value: INTEGER is 1013

    Error_child_must_be_volatile_text: STRING is "Cannot create a stable subkey under a volatile parent key."

    Error_child_must_be_volatile_value: INTEGER is 1021

    Error_child_not_complete_text: STRING is "The %%1 application cannot be run in Win32 mode."

    Error_child_not_complete_value: INTEGER is 129

    Error_child_window_menu_text: STRING is "Child windows cannot have menus."

    Error_child_window_menu_value: INTEGER is 1436

    Error_circular_dependency_text: STRING is "Circular service dependency was specified."

    Error_circular_dependency_value: INTEGER is 1059

    Error_class_already_exists_text: STRING is "Class already exists."

    Error_class_already_exists_value: INTEGER is 1410

    Error_class_does_not_exist_text: STRING is "Class does not exist."

    Error_class_does_not_exist_value: INTEGER is 1411

    Error_class_has_windows_text: STRING is "Class still has open windows."

    Error_class_has_windows_value: INTEGER is 1412

    Error_cleaner_cartridge_spent_text: STRING is "The cleaner cartridge has performed the maximum number of drive cleanings."

    Error_cleaner_cartridge_spent_value: INTEGER is 4333

    Error_cleaner_slot_not_set_text: STRING is "A cleaner slot is not reserved."

    Error_cleaner_slot_not_set_value: INTEGER is 4332

    Error_cleaner_slot_set_text: STRING is "A cleaner slot is already reserved."

    Error_cleaner_slot_set_value: INTEGER is 4331

    Error_clipboard_not_open_text: STRING is "Thread does not have a clipboard open."

    Error_clipboard_not_open_value: INTEGER is 1418

    Error_clipping_not_supported_text: STRING is "The requested clipping operation is not supported."

    Error_clipping_not_supported_value: INTEGER is 2005

    Error_cluster_database_seqmismatch_text: STRING is "The join operation failed because the cluster database sequence number has changed or is incompatible with the locker node. This may happen during a join operation if the cluster database was changing during the join."

    Error_cluster_database_seqmismatch_value: INTEGER is 5083

    Error_cluster_gum_not_locker_text: STRING is "A non locker code got a request to reserve the lock for making global updates."

    Error_cluster_gum_not_locker_value: INTEGER is 5085

    Error_cluster_incompatible_versions_text: STRING is "The cluster join operation failed due to incompatible software versions between the joining node and its sponsor."

    Error_cluster_incompatible_versions_value: INTEGER is 5075

    Error_cluster_invalid_network_provider_text: STRING is "The cluster network provider is not valid."

    Error_cluster_invalid_network_provider_value: INTEGER is 5049

    Error_cluster_invalid_network_text: STRING is "The cluster network is not valid."

    Error_cluster_invalid_network_value: INTEGER is 5054

    Error_cluster_invalid_node_text: STRING is "The cluster node is not valid."

    Error_cluster_invalid_node_value: INTEGER is 5039

    Error_cluster_invalid_request_text: STRING is "The cluster request is not valid for this object."

    Error_cluster_invalid_request_value: INTEGER is 5048

    Error_cluster_ipaddr_in_use_text: STRING is "The cluster IP address is already in use."

    Error_cluster_ipaddr_in_use_value: INTEGER is 5057

    Error_cluster_join_aborted_text: STRING is "The cluster join operation was aborted."

    Error_cluster_join_aborted_value: INTEGER is 5074

    Error_cluster_join_in_progress_text: STRING is "A node is in the process of joining the cluster."

    Error_cluster_join_in_progress_value: INTEGER is 5041

    Error_cluster_join_not_in_progress_text: STRING is "A cluster join operation is not in progress."

    Error_cluster_join_not_in_progress_value: INTEGER is 5053

    Error_cluster_last_internal_network_text: STRING is "The cluster network is the only one configured for internal cluster communication between two or more active cluster nodes. The internal communication capability cannot be removed from the network."

    Error_cluster_last_internal_network_value: INTEGER is 5066

    Error_cluster_local_node_not_found_text: STRING is "The cluster local node information was not found."

    Error_cluster_local_node_not_found_value: INTEGER is 5043

    Error_cluster_maxnum_of_resources_exceeded_text: STRING is "This resource cannot be created because the cluster has reached the limit on the number of resources it can monitor."

    Error_cluster_maxnum_of_resources_exceeded_value: INTEGER is 5076

    Error_cluster_netinterface_exists_text: STRING is "The cluster network interface already exists."

    Error_cluster_netinterface_exists_value: INTEGER is 5046

    Error_cluster_netinterface_not_found_text: STRING is "The cluster network interface was not found."

    Error_cluster_netinterface_not_found_value: INTEGER is 5047

    Error_cluster_network_already_offline_text: STRING is "The cluster network is already offline."

    Error_cluster_network_already_offline_value: INTEGER is 5064

    Error_cluster_network_already_online_text: STRING is "The cluster network is already online."

    Error_cluster_network_already_online_value: INTEGER is 5063

    Error_cluster_network_exists_text: STRING is "The cluster network already exists."

    Error_cluster_network_exists_value: INTEGER is 5044

    Error_cluster_network_has_dependents_text: STRING is "One or more cluster resources depend on the network to provide service to clients. The client access capability cannot be removed from the network."

    Error_cluster_network_has_dependents_value: INTEGER is 5067

    Error_cluster_network_not_found_text: STRING is "The cluster network was not found."

    Error_cluster_network_not_found_value: INTEGER is 5045

    Error_cluster_network_not_internal_text: STRING is "The cluster network is not configured for internal cluster communication."

    Error_cluster_network_not_internal_value: INTEGER is 5060

    Error_cluster_no_rpc_packages_registered_text: STRING is "No authentication package could be registered with the RPC server."

    Error_cluster_no_rpc_packages_registered_value: INTEGER is 5081

    Error_cluster_no_security_context_text: STRING is "No cluster security context is available."

    Error_cluster_no_security_context_value: INTEGER is 5059

    Error_cluster_node_already_down_text: STRING is "The cluster node is already down."

    Error_cluster_node_already_down_value: INTEGER is 5062

    Error_cluster_node_already_has_dfs_root_text: STRING is "A DFS root already exists in this cluster node."

    Error_cluster_node_already_has_dfs_root_value: INTEGER is 5088

    Error_cluster_node_already_member_text: STRING is "The cluster node is already a member of the cluster."

    Error_cluster_node_already_member_value: INTEGER is 5065

    Error_cluster_node_already_up_text: STRING is "The cluster node is already up."

    Error_cluster_node_already_up_value: INTEGER is 5061

    Error_cluster_node_down_text: STRING is "The cluster node is down."

    Error_cluster_node_down_value: INTEGER is 5050

    Error_cluster_node_exists_text: STRING is "The cluster node already exists."

    Error_cluster_node_exists_value: INTEGER is 5040

    Error_cluster_node_not_found_text: STRING is "The cluster node was not found."

    Error_cluster_node_not_found_value: INTEGER is 5042

    Error_cluster_node_not_member_text: STRING is "The cluster node is not a member of the cluster."

    Error_cluster_node_not_member_value: INTEGER is 5052

    Error_cluster_node_not_paused_text: STRING is "The cluster node is not paused."

    Error_cluster_node_not_paused_value: INTEGER is 5058

    Error_cluster_node_not_ready_text: STRING is "The cluster node is not ready to perform the requested operation."

    Error_cluster_node_not_ready_value: INTEGER is 5072

    Error_cluster_node_paused_text: STRING is "The cluster node is paused."

    Error_cluster_node_paused_value: INTEGER is 5070

    Error_cluster_node_shutting_down_text: STRING is "The cluster node is shutting down."

    Error_cluster_node_shutting_down_value: INTEGER is 5073

    Error_cluster_node_unreachable_text: STRING is "The cluster node is not reachable."

    Error_cluster_node_unreachable_value: INTEGER is 5051

    Error_cluster_node_up_text: STRING is "The cluster node is up."

    Error_cluster_node_up_value: INTEGER is 5056

    Error_cluster_owner_not_in_preflist_text: STRING is "You cannot bring the group online because the owner of the group is not in the preferred list for the group. To change the owner node for the group, move the group."

    Error_cluster_owner_not_in_preflist_value: INTEGER is 5082

    Error_cluster_resname_not_found_text: STRING is "The specified resource name is not supported by this resource DLL. This may be due to a bad (or changed) name supplied to the resource DLL."

    Error_cluster_resname_not_found_value: INTEGER is 5080

    Error_cluster_resource_type_not_found_text: STRING is "The specified resource type was not found."

    Error_cluster_resource_type_not_found_value: INTEGER is 5078

    Error_cluster_restype_not_supported_text: STRING is "The specified node does not support a resource of this type.  This may be due to version inconsistencies or due to the absence of the resource DLL on this node."

    Error_cluster_restype_not_supported_value: INTEGER is 5079

    Error_cluster_shutting_down_text: STRING is "The cluster software is shutting down."

    Error_cluster_shutting_down_value: INTEGER is 5022

    Error_cluster_system_config_changed_text: STRING is "The system configuration changed during the cluster join or form operation. The join or form operation was aborted."

    Error_cluster_system_config_changed_value: INTEGER is 5077

    Error_clusterlog_chkpoint_not_found_text: STRING is "No checkpoint record was found in the cluster log."

    Error_clusterlog_chkpoint_not_found_value: INTEGER is 5032

    Error_clusterlog_corrupt_text: STRING is "The cluster log is corrupt."

    Error_clusterlog_corrupt_value: INTEGER is 5029

    Error_clusterlog_exceeds_maxsize_text: STRING is "The cluster log exceeds its maximum size."

    Error_clusterlog_exceeds_maxsize_value: INTEGER is 5031

    Error_clusterlog_not_enough_space_text: STRING is "The minimum required disk space needed for logging is not available."

    Error_clusterlog_not_enough_space_value: INTEGER is 5033

    Error_clusterlog_record_exceeds_maxsize_text: STRING is "The record could not be written to the cluster log since it exceeds the maximum size."

    Error_clusterlog_record_exceeds_maxsize_value: INTEGER is 5030

    Error_colorspace_mismatch_text: STRING is "The specified transform does not match the bitmap's color space."

    Error_colorspace_mismatch_value: INTEGER is 2021

    Error_commitment_limit_text: STRING is "The paging file is too small for this operation to complete."

    Error_commitment_limit_value: INTEGER is 1455

    Error_connected_other_password_text: STRING is "The network connection was made successfully, but the user had to be prompted for a password other than the one originally specified."

    Error_connected_other_password_value: INTEGER is 2108

    Error_connection_aborted_text: STRING is "The network connection was aborted by the local system."

    Error_connection_aborted_value: INTEGER is 1236

    Error_connection_active_text: STRING is "An invalid operation was attempted on an active network connection."

    Error_connection_active_value: INTEGER is 1230

    Error_connection_count_limit_text: STRING is "A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached."

    Error_connection_count_limit_value: INTEGER is 1238

    Error_connection_invalid_text: STRING is "An operation was attempted on a nonexistent network connection."

    Error_connection_invalid_value: INTEGER is 1229

    Error_connection_refused_text: STRING is "The remote system refused the network connection."

    Error_connection_refused_value: INTEGER is 1225

    Error_connection_unavail_text: STRING is "The device is not currently connected but it is a remembered connection."

    Error_connection_unavail_value: INTEGER is 1201

    Error_continue_text: STRING is "Continue with work in progress."

    Error_continue_value: INTEGER is 1246

    Error_control_id_not_found_text: STRING is "Control ID not found."

    Error_control_id_not_found_value: INTEGER is 1421

    Error_controlling_ieport_text: STRING is "Unable to open or close the inject/eject port."

    Error_controlling_ieport_value: INTEGER is 4329

    Error_core_resource_text: STRING is "The cluster resource could not be deleted since it is a core resource."

    Error_core_resource_value: INTEGER is 5026

    Error_counter_timeout_text: STRING is "A serial I/O operation completed because the timeout period expired.  (The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)"

    Error_counter_timeout_value: INTEGER is 1121

    Error_crc_text: STRING is "Data error (cyclic redundancy check)."

    Error_crc_value: INTEGER is 23

    Error_create_failed_text: STRING is "The Windows Installer service failed to start.  Contact your support personnel."

    Error_create_failed_value: INTEGER is 1631

    Error_ctx_bad_video_mode_text: STRING is "An attempt has been made to connect to a session whose video mode is not supported by the current client."

    Error_ctx_bad_video_mode_value: INTEGER is 7025

    Error_ctx_cannot_make_eventlog_entry_text: STRING is "A registry key for event logging could not be created for this session."

    Error_ctx_cannot_make_eventlog_entry_value: INTEGER is 7005

    Error_ctx_client_license_in_use_text: STRING is "Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number is currently being used by another user.  Please call your system administrator to obtain a new copy of the Terminal Server client with a valid, unique license number."

    Error_ctx_client_license_in_use_value: INTEGER is 7052

    Error_ctx_client_license_not_set_text: STRING is "Your request to connect to this Terminal Server has been rejected. Your Terminal Server client license number has not been entered for this copy of the Terminal Server client.  Please call your system administrator for help in entering a valid, unique license number for this Terminal Server client."

    Error_ctx_client_license_not_set_value: INTEGER is 7053

    Error_ctx_client_query_timeout_text: STRING is "The client failed to respond to the server connect message."

    Error_ctx_client_query_timeout_value: INTEGER is 7040

    Error_ctx_close_pending_text: STRING is "A close operation is pending on the session."

    Error_ctx_close_pending_value: INTEGER is 7007

    Error_ctx_console_connect_text: STRING is "Reconnecting a disconnected session to the console is not supported."

    Error_ctx_console_connect_value: INTEGER is 7042

    Error_ctx_console_disconnect_text: STRING is "Disconnecting the console session is not supported."

    Error_ctx_console_disconnect_value: INTEGER is 7041

    Error_ctx_graphics_invalid_text: STRING is "The application attempted to enable DOS graphics mode.  DOS graphics mode is not supported."

    Error_ctx_graphics_invalid_value: INTEGER is 7035

    Error_ctx_invalid_modemname_text: STRING is "The modem name was not found in MODEM.INF."

    Error_ctx_invalid_modemname_value: INTEGER is 7010

    Error_ctx_invalid_pd_text: STRING is "The specified protocol driver is invalid."

    Error_ctx_invalid_pd_value: INTEGER is 7002

    Error_ctx_invalid_wd_text: STRING is "The specified terminal connection driver is invalid."

    Error_ctx_invalid_wd_value: INTEGER is 7049

    Error_ctx_license_client_invalid_text: STRING is "The client you are using is not licensed to use this system.  Your logon request is denied."

    Error_ctx_license_client_invalid_value: INTEGER is 7055

    Error_ctx_license_expired_text: STRING is "The system license has expired.  Your logon request is denied."

    Error_ctx_license_expired_value: INTEGER is 7056

    Error_ctx_license_not_available_text: STRING is "The system has reached its licensed logon limit.  Please try again later."

    Error_ctx_license_not_available_value: INTEGER is 7054

    Error_ctx_logon_disabled_text: STRING is "Your interactive logon privilege has been disabled.  Please contact your administrator."

    Error_ctx_logon_disabled_value: INTEGER is 7037

    Error_ctx_modem_inf_not_found_text: STRING is "The MODEM.INF file was not found."

    Error_ctx_modem_inf_not_found_value: INTEGER is 7009

    Error_ctx_modem_response_busy_text: STRING is "Busy signal detected at remote site on callback."

    Error_ctx_modem_response_busy_value: INTEGER is 7015

    Error_ctx_modem_response_error_text: STRING is "The modem did not accept the command sent to it. Verify that the configured modem name matches the attached modem."

    Error_ctx_modem_response_error_value: INTEGER is 7011

    Error_ctx_modem_response_no_carrier_text: STRING is "Carrier detect has failed or carrier has been dropped due to disconnect."

    Error_ctx_modem_response_no_carrier_value: INTEGER is 7013

    Error_ctx_modem_response_no_dialtone_text: STRING is "Dial tone not detected within the required time. Verify that the phone cable is properly attached and functional."

    Error_ctx_modem_response_no_dialtone_value: INTEGER is 7014

    Error_ctx_modem_response_timeout_text: STRING is "The modem did not respond to the command sent to it. Verify that the modem is properly cabled and powered on."

    Error_ctx_modem_response_timeout_value: INTEGER is 7012

    Error_ctx_modem_response_voice_text: STRING is "Voice detected at remote site on callback."

    Error_ctx_modem_response_voice_value: INTEGER is 7016

    Error_ctx_no_outbuf_text: STRING is "There are no free output buffers available."

    Error_ctx_no_outbuf_value: INTEGER is 7008

    Error_ctx_not_console_text: STRING is "The requested operation can be performed only on the system console.  This is most often the result of a driver or system DLL requiring direct console access."

    Error_ctx_not_console_value: INTEGER is 7038

    Error_ctx_pd_not_found_text: STRING is "The specified protocol driver was not found in the system path."

    Error_ctx_pd_not_found_value: INTEGER is 7003

    Error_ctx_service_name_collision_text: STRING is "A service with the same name already exists on the system."

    Error_ctx_service_name_collision_value: INTEGER is 7006

    Error_ctx_shadow_denied_text: STRING is "The request to control another session remotely was denied."

    Error_ctx_shadow_denied_value: INTEGER is 7044

    Error_ctx_shadow_disabled_text: STRING is "The requested session is not configured to allow remote control."

    Error_ctx_shadow_disabled_value: INTEGER is 7051

    Error_ctx_shadow_invalid_text: STRING is "The requested session cannot be controlled remotely.  This may be because the session is disconnected or does not currently have a user logged on. Also, you cannot control a session remotely from the system console or control the system console remotely. And you cannot remote control your own current session."

    Error_ctx_shadow_invalid_value: INTEGER is 7050

    Error_ctx_td_error_text: STRING is "Transport driver error"

    Error_ctx_td_error_value: INTEGER is 7017

    Error_ctx_wd_not_found_text: STRING is "The specified terminal connection driver was not found in the system path."

    Error_ctx_wd_not_found_value: INTEGER is 7004

    Error_ctx_winstation_access_denied_text: STRING is "The requested session access is denied."

    Error_ctx_winstation_access_denied_value: INTEGER is 7045

    Error_ctx_winstation_already_exists_text: STRING is "The specified session name is already in use."

    Error_ctx_winstation_already_exists_value: INTEGER is 7023

    Error_ctx_winstation_busy_text: STRING is "The requested operation cannot be completed because the terminal connection is currently busy processing a connect, disconnect, reset, or delete operation."

    Error_ctx_winstation_busy_value: INTEGER is 7024

    Error_ctx_winstation_name_invalid_text: STRING is "The specified session name is invalid."

    Error_ctx_winstation_name_invalid_value: INTEGER is 7001

    Error_ctx_winstation_not_found_text: STRING is "The specified session cannot be found."

    Error_ctx_winstation_not_found_value: INTEGER is 7022

    Error_current_directory_text: STRING is "The directory cannot be removed."

    Error_current_directory_value: INTEGER is 16

    Error_database_backup_corrupt_text: STRING is "The backed up cluster database is possibly corrupt."

    Error_database_backup_corrupt_value: INTEGER is 5087

    Error_database_does_not_exist_text: STRING is "The database specified does not exist."

    Error_database_does_not_exist_value: INTEGER is 1065

    Error_database_failure_text: STRING is "Unable to read from or write to the database."

    Error_database_failure_value: INTEGER is 4313

    Error_database_full_text: STRING is "The database is full."

    Error_database_full_value: INTEGER is 4314

    Error_datatype_mismatch_text: STRING is "Data supplied is of wrong type."

    Error_datatype_mismatch_value: INTEGER is 1629

    Error_dc_not_found_text: STRING is "Invalid device context (DC) handle."

    Error_dc_not_found_value: INTEGER is 1425

    Error_dde_fail_text: STRING is "An error occurred in sending the command to the application."

    Error_dde_fail_value: INTEGER is 1156

    Error_decryption_failed_text: STRING is "The specified file could not be decrypted."

    Error_decryption_failed_value: INTEGER is 6001

    Error_deleting_icm_xform_text: STRING is "There was an error while deleting the color transform."

    Error_deleting_icm_xform_value: INTEGER is 2019

    Error_dependency_already_exists_text: STRING is "The cluster resource cannot be made dependent on the specified resource because it is already dependent."

    Error_dependency_already_exists_value: INTEGER is 5003

    Error_dependency_not_allowed_text: STRING is "The cluster quorum resource is not allowed to have any dependencies."

    Error_dependency_not_allowed_value: INTEGER is 5069

    Error_dependency_not_found_text: STRING is "The cluster resource dependency cannot be found."

    Error_dependency_not_found_value: INTEGER is 5002

    Error_dependent_resource_exists_text: STRING is "The cluster resource cannot be moved to another group because other resources are dependent on it."

    Error_dependent_resource_exists_value: INTEGER is 5001

    Error_dependent_services_running_text: STRING is "A stop control has been sent to a service that other running services are dependent on."

    Error_dependent_services_running_value: INTEGER is 1051

    Error_destination_element_full_text: STRING is "The indicated destination element already contains media."

    Error_destination_element_full_value: INTEGER is 1161

    Error_destroy_object_of_other_thread_text: STRING is "Cannot destroy object created by another thread."

    Error_destroy_object_of_other_thread_value: INTEGER is 1435

    Error_dev_not_exist_text: STRING is "The specified network resource or device is no longer available."

    Error_dev_not_exist_value: INTEGER is 55

    Error_device_already_remembered_text: STRING is "An attempt was made to remember a device that had previously been remembered."

    Error_device_already_remembered_value: INTEGER is 1202

    Error_device_door_open_text: STRING is "The device has indicated that its door is open."

    Error_device_door_open_value: INTEGER is 1166

    Error_device_in_use_text: STRING is "The device is in use by an active process and cannot be disconnected."

    Error_device_in_use_value: INTEGER is 2404

    Error_device_not_available_text: STRING is "The device is not ready for use."

    Error_device_not_available_value: INTEGER is 4319

    Error_device_not_connected_text: STRING is "The device is not connected."

    Error_device_not_connected_value: INTEGER is 1167

    Error_device_not_partitioned_text: STRING is "Tape partition information could not be found when loading a tape."

    Error_device_not_partitioned_value: INTEGER is 1107

    Error_device_reinitialization_needed_text: STRING is "The indicated device requires reinitialization due to hardware errors."

    Error_device_reinitialization_needed_value: INTEGER is 1164

    Error_device_removed_text: STRING is "The device has been removed."

    Error_device_removed_value: INTEGER is 1617

    Error_device_requires_cleaning_text: STRING is "The device has indicated that cleaning is required before further operations are attempted."

    Error_device_requires_cleaning_value: INTEGER is 1165

    Error_dhcp_address_conflict_text: STRING is "The DHCP client has obtained an IP address that is already in use on the network. The local interface will be disabled until the DHCP client can obtain a new address."

    Error_dhcp_address_conflict_value: INTEGER is 4100

    Error_different_service_account_text: STRING is "The account specified for this service is different from the account specified for other services running in the same process."

    Error_different_service_account_value: INTEGER is 1079

    Error_dir_efs_disallowed_text: STRING is "The directory has been disabled for encryption."

    Error_dir_efs_disallowed_value: INTEGER is 6010

    Error_dir_not_empty_text: STRING is "The directory is not empty."

    Error_dir_not_empty_value: INTEGER is 145

    Error_dir_not_root_text: STRING is "The directory is not a subdirectory of the root directory."

    Error_dir_not_root_value: INTEGER is 144

    Error_direct_access_handle_text: STRING is "Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O."

    Error_direct_access_handle_value: INTEGER is 130

    Error_directory_text: STRING is "The directory name is invalid."

    Error_directory_value: INTEGER is 267

    Error_discarded_text: STRING is "The segment is already discarded and cannot be locked."

    Error_discarded_value: INTEGER is 157

    Error_disk_change_text: STRING is "The program stopped because an alternate diskette was not inserted."

    Error_disk_change_value: INTEGER is 107

    Error_disk_corrupt_text: STRING is "The disk structure is corrupted and unreadable."

    Error_disk_corrupt_value: INTEGER is 1393

    Error_disk_full_text: STRING is "There is not enough space on the disk."

    Error_disk_full_value: INTEGER is 112

    Error_disk_operation_failed_text: STRING is "While accessing the hard disk, a disk operation failed even after retries."

    Error_disk_operation_failed_value: INTEGER is 1127

    Error_disk_recalibrate_failed_text: STRING is "While accessing the hard disk, a recalibrate operation failed, even after retries."

    Error_disk_recalibrate_failed_value: INTEGER is 1126

    Error_disk_reset_failed_text: STRING is "While accessing the hard disk, a disk controller reset was needed, but even that failed."

    Error_disk_reset_failed_value: INTEGER is 1128

    Error_dll_init_failed_text: STRING is "A dynamic link library (DLL) initialization routine failed."

    Error_dll_init_failed_value: INTEGER is 1114

    Error_dll_not_found_text: STRING is "One of the library files needed to run this application cannot be found."

    Error_dll_not_found_value: INTEGER is 1157

    Error_domain_controller_exists_text: STRING is "A domain controller with the specified name already exists."

    Error_domain_controller_exists_value: INTEGER is 1250

    Error_domain_controller_not_found_text: STRING is "Could not find the domain controller for this domain."

    Error_domain_controller_not_found_value: INTEGER is 1908

    Error_domain_exists_text: STRING is "The specified domain already exists."

    Error_domain_exists_value: INTEGER is 1356

    Error_domain_limit_exceeded_text: STRING is "An attempt was made to exceed the limit on the number of domains per server."

    Error_domain_limit_exceeded_value: INTEGER is 1357

    Error_domain_trust_inconsistent_text: STRING is "The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain."

    Error_domain_trust_inconsistent_value: INTEGER is 1810

    Error_drive_locked_text: STRING is "The disk is in use or locked by  another process."

    Error_drive_locked_value: INTEGER is 108

    Error_drive_media_mismatch_text: STRING is "The drive and medium are not compatible or exist in different libraries."

    Error_drive_media_mismatch_value: INTEGER is 4303

    Error_ds_add_replica_inhibited_text: STRING is "The add replica operation cannot be performed. The naming context must be writable in order to create the replica."

    Error_ds_add_replica_inhibited_value: INTEGER is 8302

    Error_ds_admin_limit_exceeded_text: STRING is "The administrative limit for this request was exceeded."

    Error_ds_admin_limit_exceeded_value: INTEGER is 8228

    Error_ds_affects_multiple_dsas_text: STRING is "The operation affects multiple DSAs"

    Error_ds_affects_multiple_dsas_value: INTEGER is 8249

    Error_ds_alias_deref_problem_text: STRING is "There is an alias dereferencing problem."

    Error_ds_alias_deref_problem_value: INTEGER is 8244

    Error_ds_alias_points_to_alias_text: STRING is "It is not permitted for an alias to refer to another alias."

    Error_ds_alias_points_to_alias_value: INTEGER is 8336

    Error_ds_alias_problem_text: STRING is "There is an alias problem."

    Error_ds_alias_problem_value: INTEGER is 8241

    Error_ds_aliased_obj_missing_text: STRING is "The aliased object is missing."

    Error_ds_aliased_obj_missing_value: INTEGER is 8334

    Error_ds_att_already_exists_text: STRING is "The specified attribute is already present on the object."

    Error_ds_att_already_exists_value: INTEGER is 8318

    Error_ds_att_is_not_on_obj_text: STRING is "The attribute specified in the operation is not present on the object."

    Error_ds_att_is_not_on_obj_value: INTEGER is 8310

    Error_ds_att_not_def_for_class_text: STRING is "An attempt was made to modify an object to include an attribute that is not legal for its class."

    Error_ds_att_not_def_for_class_value: INTEGER is 8317

    Error_ds_att_not_def_in_schema_text: STRING is "A reference to an attribute that is not defined in the schema occurred."

    Error_ds_att_not_def_in_schema_value: INTEGER is 8303

    Error_ds_att_schema_req_id_text: STRING is "Cannot read the governs class identifier for the schema record."

    Error_ds_att_schema_req_id_value: INTEGER is 8399

    Error_ds_att_schema_req_syntax_text: STRING is "Failed to obtain the required syntax for the attribute schema."

    Error_ds_att_schema_req_syntax_value: INTEGER is 8416

    Error_ds_att_val_already_exists_text: STRING is "The specified value already exists."

    Error_ds_att_val_already_exists_value: INTEGER is 8323

    Error_ds_attribute_or_value_exists_text: STRING is "The specified directory service attribute or value already exists."

    Error_ds_attribute_or_value_exists_value: INTEGER is 8205

    Error_ds_attribute_owned_by_sam_text: STRING is "Access to the attribute is not permitted because the attribute is owned by the Security Accounts Manager (SAM)."

    Error_ds_attribute_owned_by_sam_value: INTEGER is 8346

    Error_ds_attribute_type_undefined_text: STRING is "The attribute type specified to the directory service is not defined."

    Error_ds_attribute_type_undefined_value: INTEGER is 8204

    Error_ds_auth_method_not_supported_text: STRING is "The requested authentication method is not supported by the server."

    Error_ds_auth_method_not_supported_value: INTEGER is 8231

    Error_ds_auth_unknown_text: STRING is "The authentication mechanism is unknown."

    Error_ds_auth_unknown_value: INTEGER is 8234

    Error_ds_aux_cls_test_fail_text: STRING is "Schema update failed: class in aux-class list does not exist or is not an auxiliary class."

    Error_ds_aux_cls_test_fail_value: INTEGER is 8389

    Error_ds_backlink_without_link_text: STRING is "The schema update operation tried to add a backward link attribute that has no corresponding forward link."

    Error_ds_backlink_without_link_value: INTEGER is 8482

    Error_ds_bad_att_schema_syntax_text: STRING is "The attribute schema has bad syntax."

    Error_ds_bad_att_schema_syntax_value: INTEGER is 8400

    Error_ds_bad_hierarchy_file_text: STRING is "The hierarchy file is invalid."

    Error_ds_bad_hierarchy_file_value: INTEGER is 8425

    Error_ds_bad_instance_type_text: STRING is "The specified instance type is not valid."

    Error_ds_bad_instance_type_value: INTEGER is 8313

    Error_ds_bad_name_syntax_text: STRING is "The object name has bad syntax."

    Error_ds_bad_name_syntax_value: INTEGER is 8335

    Error_ds_bad_rdn_att_id_syntax_text: STRING is "Schema update failed: Rdn-Att-Id has wrong syntax."

    Error_ds_bad_rdn_att_id_syntax_value: INTEGER is 8392

    Error_ds_build_hierarchy_table_failed_text: STRING is "The attempt to build the hierarchy table failed."

    Error_ds_build_hierarchy_table_failed_value: INTEGER is 8426

    Error_ds_busy_text: STRING is "The directory service is busy."

    Error_ds_busy_value: INTEGER is 8206

    Error_ds_cant_add_att_values_text: STRING is "The specified attribute is not present, or has no values."

    Error_ds_cant_add_att_values_value: INTEGER is 8320

    Error_ds_cant_add_system_only_text: STRING is "It is not permitted to add an attribute which is owned by the system."

    Error_ds_cant_add_system_only_value: INTEGER is 8358

    Error_ds_cant_add_to_gc_text: STRING is "The attribute is not allowed to be replicated to the GC because of security reasons."

    Error_ds_cant_add_to_gc_value: INTEGER is 8550

    Error_ds_cant_cache_att_text: STRING is "The attribute could not be cached."

    Error_ds_cant_cache_att_value: INTEGER is 8401

    Error_ds_cant_cache_class_text: STRING is "The class could not be cached."

    Error_ds_cant_cache_class_value: INTEGER is 8402

    Error_ds_cant_create_in_nondomain_nc_text: STRING is "Security principal objects can only be created inside domain naming contexts."

    Error_ds_cant_create_in_nondomain_nc_value: INTEGER is 8553

    Error_ds_cant_create_under_schema_text: STRING is "An object of this class cannot be created under the schema container. You can only create attribute-schema and class-schema objects under the schema container."

    Error_ds_cant_create_under_schema_value: INTEGER is 8510

    Error_ds_cant_del_master_crossref_text: STRING is "It is not permitted to delete a master cross reference."

    Error_ds_cant_del_master_crossref_value: INTEGER is 8375

    Error_ds_cant_delete_dsa_obj_text: STRING is "The DSA object cannot be deleted."

    Error_ds_cant_delete_dsa_obj_value: INTEGER is 8340

    Error_ds_cant_delete_text: STRING is "The requested delete operation could not be performed."

    Error_ds_cant_delete_value: INTEGER is 8398

    Error_ds_cant_deref_alias_text: STRING is "The alias cannot be dereferenced."

    Error_ds_cant_deref_alias_value: INTEGER is 8337

    Error_ds_cant_find_dc_for_src_domain_text: STRING is "The operation couldn't locate a DC for the source domain."

    Error_ds_cant_find_dc_for_src_domain_value: INTEGER is 8537

    Error_ds_cant_find_dsa_obj_text: STRING is "The DSA object could not be found."

    Error_ds_cant_find_dsa_obj_value: INTEGER is 8419

    Error_ds_cant_find_expected_nc_text: STRING is "The naming context could not be found."

    Error_ds_cant_find_expected_nc_value: INTEGER is 8420

    Error_ds_cant_find_nc_in_cache_text: STRING is "The naming context could not be found in the cache."

    Error_ds_cant_find_nc_in_cache_value: INTEGER is 8421

    Error_ds_cant_mix_master_and_reps_text: STRING is "The object and parent must be of the same type, either both masters or  both replicas."

    Error_ds_cant_mix_master_and_reps_value: INTEGER is 8331

    Error_ds_cant_mod_obj_class_text: STRING is "The directory service detected an attempt to modify the object class of an object."

    Error_ds_cant_mod_obj_class_value: INTEGER is 8215

    Error_ds_cant_mod_primarygroupid_text: STRING is "Cannot change the primary group ID of a domain controller account."

    Error_ds_cant_mod_primarygroupid_value: INTEGER is 8506

    Error_ds_cant_mod_system_only_text: STRING is "The attribute cannot be modified because it is owned by the system."

    Error_ds_cant_mod_system_only_value: INTEGER is 8369

    Error_ds_cant_move_account_group_text: STRING is "Cross-domain move of account groups is not allowed."

    Error_ds_cant_move_account_group_value: INTEGER is 8498

    Error_ds_cant_move_deleted_object_text: STRING is "Object being moved across-domains is already known to be deleted by the destination server.  The source server does not have the latest version of the source object."

    Error_ds_cant_move_deleted_object_value: INTEGER is 8489

    Error_ds_cant_move_resource_group_text: STRING is "Cross-domain move of resource groups is not allowed."

    Error_ds_cant_move_resource_group_value: INTEGER is 8499

    Error_ds_cant_on_non_leaf_text: STRING is "The directory service can perform the requested operation only on a leaf object."

    Error_ds_cant_on_non_leaf_value: INTEGER is 8213

    Error_ds_cant_on_rdn_text: STRING is "The directory service cannot perform the requested operation on the RDN attribute of an object."

    Error_ds_cant_on_rdn_value: INTEGER is 8214

    Error_ds_cant_rem_missing_att_text: STRING is "The attribute cannot be removed because it is not present on the object."

    Error_ds_cant_rem_missing_att_val_text: STRING is "The attribute value cannot be removed because it is not present on the object."

    Error_ds_cant_rem_missing_att_val_value: INTEGER is 8325

    Error_ds_cant_rem_missing_att_value: INTEGER is 8324

    Error_ds_cant_remove_att_cache_text: STRING is "The attribute could not be removed from the cache."

    Error_ds_cant_remove_att_cache_value: INTEGER is 8403

    Error_ds_cant_remove_class_cache_text: STRING is "The class could not be removed from the cache."

    Error_ds_cant_remove_class_cache_value: INTEGER is 8404

    Error_ds_cant_replace_hidden_rec_text: STRING is "The operation cannot replace the hidden record."

    Error_ds_cant_replace_hidden_rec_value: INTEGER is 8424

    Error_ds_cant_retrieve_atts_text: STRING is "The search failed to retrieve attributes from the database."

    Error_ds_cant_retrieve_atts_value: INTEGER is 8481

    Error_ds_cant_retrieve_child_text: STRING is "The child object could not be retrieved."

    Error_ds_cant_retrieve_child_value: INTEGER is 8422

    Error_ds_cant_retrieve_dn_text: STRING is "The distinguished name attribute could not be read."

    Error_ds_cant_retrieve_dn_value: INTEGER is 8405

    Error_ds_cant_retrieve_instance_text: STRING is "The instance type attribute could not be retrieved."

    Error_ds_cant_retrieve_instance_value: INTEGER is 8407

    Error_ds_cant_retrieve_sd_text: STRING is "The Security Descriptor attribute could not be read."

    Error_ds_cant_retrieve_sd_value: INTEGER is 8526

    Error_ds_cant_start_text: STRING is "Directory Service cannot start."

    Error_ds_cant_start_value: INTEGER is 8531

    Error_ds_cant_tree_delete_critical_obj_text: STRING is "Critical Directory Service System objects cannot be deleted during tree delete operations.  The tree delete may have been partially performed."

    Error_ds_cant_tree_delete_critical_obj_value: INTEGER is 8560

    Error_ds_cant_with_acct_group_membershps_text: STRING is "Can't move objects with memberships across domain boundaries as once moved, this would violate the membership conditions of the account group.  Remove the object from any account group memberships and retry."

    Error_ds_cant_with_acct_group_membershps_value: INTEGER is 8493

    Error_ds_children_exist_text: STRING is "The operation cannot be performed because child objects exist. This operation can only be performed on a leaf object."

    Error_ds_children_exist_value: INTEGER is 8332

    Error_ds_class_must_be_concrete_text: STRING is "The class of the object must be structural; you cannot instantiate an abstract class."

    Error_ds_class_must_be_concrete_value: INTEGER is 8359

    Error_ds_class_not_dsa_text: STRING is "The object must be of class DSA."

    Error_ds_class_not_dsa_value: INTEGER is 8343

    Error_ds_client_loop_text: STRING is "A referral loop was detected by the client."

    Error_ds_client_loop_value: INTEGER is 8259

    Error_ds_code_inconsistency_text: STRING is "An internal error has occurred."

    Error_ds_code_inconsistency_value: INTEGER is 8408

    Error_ds_compare_false_text: STRING is "The compare response was false."

    Error_ds_compare_false_value: INTEGER is 8229

    Error_ds_compare_true_text: STRING is "The compare response was true."

    Error_ds_compare_true_value: INTEGER is 8230

    Error_ds_confidentiality_required_text: STRING is "This request requires a secure connection."

    Error_ds_confidentiality_required_value: INTEGER is 8237

    Error_ds_config_param_missing_text: STRING is "The directory configuration parameter is missing from the registry."

    Error_ds_config_param_missing_value: INTEGER is 8427

    Error_ds_constraint_violation_text: STRING is "A constraint violation occurred."

    Error_ds_constraint_violation_value: INTEGER is 8239

    Error_ds_constructed_att_mod_text: STRING is "Modification of a constructed att is not allowed."

    Error_ds_constructed_att_mod_value: INTEGER is 8475

    Error_ds_control_not_found_text: STRING is "The specified control is not supported by the server."

    Error_ds_control_not_found_value: INTEGER is 8258

    Error_ds_couldnt_contact_fsmo_text: STRING is "The requested FSMO operation failed. The current FSMO holder could not be contacted."

    Error_ds_couldnt_contact_fsmo_value: INTEGER is 8367

    Error_ds_couldnt_identify_objects_for_tree_delete_text: STRING is "The directory service failed to identify the list of objects to delete while attempting a tree deletion."

    Error_ds_couldnt_identify_objects_for_tree_delete_value: INTEGER is 8503

    Error_ds_couldnt_lock_tree_for_delete_text: STRING is "The directory service failed to lock a tree in preparation for a tree deletion because the tree was in use."

    Error_ds_couldnt_lock_tree_for_delete_value: INTEGER is 8502

    Error_ds_couldnt_update_spns_text: STRING is "While processing a change to the DNS Host Name for an object, the Service Principal Name values could not be kept in sync."

    Error_ds_couldnt_update_spns_value: INTEGER is 8525

    Error_ds_counting_ab_indices_failed_text: STRING is "The attempt to count the address book indices failed."

    Error_ds_counting_ab_indices_failed_value: INTEGER is 8428

    Error_ds_cr_impossible_to_validate_text: STRING is "The directory cannot validate the proposed naming context name because it does not hold a replica of the naming context above the proposed naming context.  Please ensure that the domain naming master role is held by a server that is configured as a global catalog server, and that the server is up to date with its replication partners."

    Error_ds_cr_impossible_to_validate_value: INTEGER is 8495

    Error_ds_cross_dom_move_error_text: STRING is "The requested cross-domain move operation could not be performed."

    Error_ds_cross_dom_move_error_value: INTEGER is 8216

    Error_ds_cross_domain_cleanup_reqd_text: STRING is "A cross-domain move operation failed such that two versions of the moved object exist - one each in the source and destination domains.  The destination object needs to be removed to restore the system to a consistent state."

    Error_ds_cross_domain_cleanup_reqd_value: INTEGER is 8491

    Error_ds_cross_nc_dn_rename_text: STRING is "Modification of a DN across a naming context is not permitted."

    Error_ds_cross_nc_dn_rename_value: INTEGER is 8368

    Error_ds_cross_ref_exists_text: STRING is "A cross reference already exists."

    Error_ds_cross_ref_exists_value: INTEGER is 8374

    Error_ds_database_error_text: STRING is "A database error has occurred."

    Error_ds_database_error_value: INTEGER is 8409

    Error_ds_decoding_error_text: STRING is "A decoding error has occurred."

    Error_ds_decoding_error_value: INTEGER is 8253

    Error_ds_destination_auditing_not_enabled_text: STRING is "The operation requires that destination domain auditing be enabled."

    Error_ds_destination_auditing_not_enabled_value: INTEGER is 8536

    Error_ds_destination_domain_not_in_forest_text: STRING is "The destination domain must be in the forest."

    Error_ds_destination_domain_not_in_forest_value: INTEGER is 8535

    Error_ds_dns_lookup_failure_text: STRING is "The DSA operation is unable to proceed because of a DNS lookup failure."

    Error_ds_dns_lookup_failure_value: INTEGER is 8524

    Error_ds_dra_abandon_sync_text: STRING is "The replication synchronization attempt was abandoned because of a lack of updates."

    Error_ds_dra_abandon_sync_value: INTEGER is 8462

    Error_ds_dra_access_denied_text: STRING is "Replication access was denied."

    Error_ds_dra_access_denied_value: INTEGER is 8453

    Error_ds_dra_bad_dn_text: STRING is "The distinguished name specified for this replication operation is invalid."

    Error_ds_dra_bad_dn_value: INTEGER is 8439

    Error_ds_dra_bad_instance_type_text: STRING is "The replication operation encountered an object with an invalid instance type."

    Error_ds_dra_bad_instance_type_value: INTEGER is 8445

    Error_ds_dra_bad_nc_text: STRING is "The naming context specified for this replication operation is invalid."

    Error_ds_dra_bad_nc_value: INTEGER is 8440

    Error_ds_dra_busy_text: STRING is "The directory service is too busy to complete the replication operation at this time."

    Error_ds_dra_busy_value: INTEGER is 8438

    Error_ds_dra_connection_failed_text: STRING is "The server specified for this replication operation could not be contacted."

    Error_ds_dra_connection_failed_value: INTEGER is 8444

    Error_ds_dra_db_error_text: STRING is "The replication operation encountered a database error."

    Error_ds_dra_db_error_value: INTEGER is 8451

    Error_ds_dra_dn_exists_text: STRING is "The distinguished name specified for this replication operation already exists."

    Error_ds_dra_dn_exists_value: INTEGER is 8441

    Error_ds_dra_earlier_schema_conflict_text: STRING is "The replication operation could not be completed due to a previous schema incompatibility."

    Error_ds_dra_earlier_schema_conflict_value: INTEGER is 8544

    Error_ds_dra_extn_connection_failed_text: STRING is "The server specified for this replication operation was contacted, but that server was unable to contact an additional server needed to complete the operation."

    Error_ds_dra_extn_connection_failed_value: INTEGER is 8466

    Error_ds_dra_generic_text: STRING is "The replication operation failed."

    Error_ds_dra_generic_value: INTEGER is 8436

    Error_ds_dra_incompatible_partial_set_text: STRING is "The replication synchronization attempt failed as the destination partial attribute set is not a subset of source partial attribute set."

    Error_ds_dra_incompatible_partial_set_value: INTEGER is 8464

    Error_ds_dra_inconsistent_dit_text: STRING is "The replication operation encountered a database inconsistency."

    Error_ds_dra_inconsistent_dit_value: INTEGER is 8443

    Error_ds_dra_internal_error_text: STRING is "The replication system encountered an internal error."

    Error_ds_dra_internal_error_value: INTEGER is 8442

    Error_ds_dra_invalid_parameter_text: STRING is "An invalid parameter was specified for this replication operation."

    Error_ds_dra_invalid_parameter_value: INTEGER is 8437

    Error_ds_dra_mail_problem_text: STRING is "The replication operation encountered an error with the mail system."

    Error_ds_dra_mail_problem_value: INTEGER is 8447

    Error_ds_dra_missing_parent_text: STRING is "The replication operation failed because a required parent object is missing."

    Error_ds_dra_missing_parent_value: INTEGER is 8460

    Error_ds_dra_name_collision_text: STRING is "The replication operation failed due to a collision of object names."

    Error_ds_dra_name_collision_value: INTEGER is 8458

    Error_ds_dra_no_replica_text: STRING is "The naming context is in the process of being removed or is not replicated from the specified server."

    Error_ds_dra_no_replica_value: INTEGER is 8452

    Error_ds_dra_not_supported_text: STRING is "The requested operation is not supported by this version of the directory service."

    Error_ds_dra_not_supported_value: INTEGER is 8454

    Error_ds_dra_obj_is_rep_source_text: STRING is "The naming context cannot be removed because it is replicated to another server."

    Error_ds_dra_obj_is_rep_source_value: INTEGER is 8450

    Error_ds_dra_obj_nc_mismatch_text: STRING is "The replication update could not be applied because either the source or the destination has not yet received information regarding a recent cross-domain move operation."

    Error_ds_dra_obj_nc_mismatch_value: INTEGER is 8545

    Error_ds_dra_out_of_mem_text: STRING is "The replication operation failed to allocate memory."

    Error_ds_dra_out_of_mem_value: INTEGER is 8446

    Error_ds_dra_preempted_text: STRING is "The replication operation was preempted."

    Error_ds_dra_preempted_value: INTEGER is 8461

    Error_ds_dra_ref_already_exists_text: STRING is "The replication reference information for the target server already exists."

    Error_ds_dra_ref_already_exists_value: INTEGER is 8448

    Error_ds_dra_ref_not_found_text: STRING is "The replication reference information for the target server does not exist."

    Error_ds_dra_ref_not_found_value: INTEGER is 8449

    Error_ds_dra_repl_pending_text: STRING is "The replication request has been posted; waiting for reply."

    Error_ds_dra_repl_pending_value: INTEGER is 8477

    Error_ds_dra_rpc_cancelled_text: STRING is "The replication remote procedure call was cancelled."

    Error_ds_dra_rpc_cancelled_value: INTEGER is 8455

    Error_ds_dra_schema_conflict_text: STRING is "The replication operation could not be completed due to a schema  incompatibility."

    Error_ds_dra_schema_conflict_value: INTEGER is 8543

    Error_ds_dra_schema_info_ship_text: STRING is "Schema information could not be included in the replication request."

    Error_ds_dra_schema_info_ship_value: INTEGER is 8542

    Error_ds_dra_schema_mismatch_text: STRING is "The replication operation failed because of a schema mismatch between the servers involved."

    Error_ds_dra_schema_mismatch_value: INTEGER is 8418

    Error_ds_dra_shutdown_text: STRING is "The replication operation was terminated because the system is shutting down."

    Error_ds_dra_shutdown_value: INTEGER is 8463

    Error_ds_dra_sink_disabled_text: STRING is "The destination server is currently rejecting replication requests."

    Error_ds_dra_sink_disabled_value: INTEGER is 8457

    Error_ds_dra_source_disabled_text: STRING is "The source server is currently rejecting replication requests."

    Error_ds_dra_source_disabled_value: INTEGER is 8456

    Error_ds_dra_source_is_partial_replica_text: STRING is "The replication synchronization attempt failed because a master replica attempted to sync from a partial replica."

    Error_ds_dra_source_is_partial_replica_value: INTEGER is 8465

    Error_ds_dra_source_reinstalled_text: STRING is "The replication source has been reinstalled."

    Error_ds_dra_source_reinstalled_value: INTEGER is 8459

    Error_ds_ds_required_text: STRING is "The requested operation requires a directory service, and none was available."

    Error_ds_ds_required_value: INTEGER is 8478

    Error_ds_dsa_must_be_int_master_text: STRING is "The operation can only be performed on an internal master DSA object."

    Error_ds_dsa_must_be_int_master_value: INTEGER is 8342

    Error_ds_dst_domain_not_native_text: STRING is "Destination domain must be in native mode."

    Error_ds_dst_domain_not_native_value: INTEGER is 8496

    Error_ds_dst_nc_mismatch_text: STRING is "Source and destination for a cross-domain move are not in agreement on the naming contexts in the forest.  Either source or destination does not have the latest version of the Partitions container."

    Error_ds_dst_nc_mismatch_value: INTEGER is 8486

    Error_ds_dup_ldap_display_name_text: STRING is "Schema update failed: duplicate LDAP display name."

    Error_ds_dup_ldap_display_name_value: INTEGER is 8382

    Error_ds_dup_link_id_text: STRING is "Schema update failed: An attribute with the same link identifier already exists."

    Error_ds_dup_link_id_value: INTEGER is 8468

    Error_ds_dup_mapi_id_text: STRING is "Schema update failed: duplicate MAPI identifier."

    Error_ds_dup_mapi_id_value: INTEGER is 8380

    Error_ds_dup_oid_text: STRING is "Schema update failed: duplicate OID."

    Error_ds_dup_oid_value: INTEGER is 8379

    Error_ds_dup_rdn_text: STRING is "Schema update failed: duplicate RDN."

    Error_ds_dup_rdn_value: INTEGER is 8378

    Error_ds_dup_schema_id_guid_text: STRING is "Schema update failed: duplicate schema-id GUID."

    Error_ds_dup_schema_id_guid_value: INTEGER is 8381

    Error_ds_encoding_error_text: STRING is "An encoding error has occurred."

    Error_ds_encoding_error_value: INTEGER is 8252

    Error_ds_epoch_mismatch_text: STRING is "Source and destination of a cross-domain move do not agree on the object's epoch number.  Either source or destination does not have the latest version of the object."

    Error_ds_epoch_mismatch_value: INTEGER is 8483

    Error_ds_exists_in_aux_cls_text: STRING is "Schema deletion failed: class is used as auxiliary class."

    Error_ds_exists_in_aux_cls_value: INTEGER is 8393

    Error_ds_exists_in_may_have_text: STRING is "Schema deletion failed: attribute is used in may-contain."

    Error_ds_exists_in_may_have_value: INTEGER is 8386

    Error_ds_exists_in_must_have_text: STRING is "Schema deletion failed: attribute is used in must-contain."

    Error_ds_exists_in_must_have_value: INTEGER is 8385

    Error_ds_exists_in_poss_sup_text: STRING is "Schema deletion failed: class is used as poss superior."

    Error_ds_exists_in_poss_sup_value: INTEGER is 8395

    Error_ds_exists_in_sub_cls_text: STRING is "Schema deletion failed: class is used as sub class."

    Error_ds_exists_in_sub_cls_value: INTEGER is 8394

    Error_ds_filter_unknown_text: STRING is "The search filter cannot be recognized."

    Error_ds_filter_unknown_value: INTEGER is 8254

    Error_ds_filter_uses_contructed_attrs_text: STRING is "A Filter was passed that uses constructed attributes."

    Error_ds_filter_uses_contructed_attrs_value: INTEGER is 8555

    Error_ds_gc_not_available_text: STRING is "Unable to contact the global catalog server."

    Error_ds_gc_not_available_value: INTEGER is 8217

    Error_ds_gc_required_text: STRING is "The requested operation can be performed only on a global catalog server."

    Error_ds_gc_required_value: INTEGER is 8547

    Error_ds_gcverify_error_text: STRING is "The global catalog verification failed. The global catalog is not available or does not support the operation. Some part of the directory is currently not available."

    Error_ds_gcverify_error_value: INTEGER is 8417

    Error_ds_generic_error_text: STRING is "A directory service error has occurred."

    Error_ds_generic_error_value: INTEGER is 8341

    Error_ds_global_cant_have_crossdomain_member_text: STRING is "A global group cannot have a cross-domain member."

    Error_ds_global_cant_have_crossdomain_member_value: INTEGER is 8519

    Error_ds_global_cant_have_local_member_text: STRING is "A global group cannot have a local group as a member."

    Error_ds_global_cant_have_local_member_value: INTEGER is 8516

    Error_ds_global_cant_have_universal_member_text: STRING is "A global group cannot have a universal group as a member."

    Error_ds_global_cant_have_universal_member_value: INTEGER is 8517

    Error_ds_governsid_missing_text: STRING is "The attribute GOVERNSID is missing."

    Error_ds_governsid_missing_value: INTEGER is 8410

    Error_ds_have_primary_members_text: STRING is "A group with primary members cannot change to a security-disabled group."

    Error_ds_have_primary_members_value: INTEGER is 8521

    Error_ds_hierarchy_table_malloc_failed_text: STRING is "The allocation of the hierarchy table failed."

    Error_ds_hierarchy_table_malloc_failed_value: INTEGER is 8429

    Error_ds_illegal_base_schema_mod_text: STRING is "An attempt is made to modify the base schema."

    Error_ds_illegal_base_schema_mod_value: INTEGER is 8507

    Error_ds_illegal_mod_operation_text: STRING is "Illegal modify operation. Some aspect of the modification is not permitted."

    Error_ds_illegal_mod_operation_value: INTEGER is 8311

    Error_ds_illegal_superior_text: STRING is "The object cannot be added because the parent is not on the list of possible superiors."

    Error_ds_illegal_superior_value: INTEGER is 8345

    Error_ds_illegal_xdom_move_operation_text: STRING is "This object may not be moved across domain boundaries either because cross-domain moves for this class are disallowed, or the object has some special characteristics, eg: trust account or restricted RID, which prevent its move."

    Error_ds_illegal_xdom_move_operation_value: INTEGER is 8492

    Error_ds_inappropriate_auth_text: STRING is "Inappropriate authentication."

    Error_ds_inappropriate_auth_value: INTEGER is 8233

    Error_ds_inappropriate_matching_text: STRING is "Inappropriate matching."

    Error_ds_inappropriate_matching_value: INTEGER is 8238

    Error_ds_incorrect_role_owner_text: STRING is "The requested operation could not be performed because the directory service is not the master for that type of operation."

    Error_ds_incorrect_role_owner_value: INTEGER is 8210

    Error_ds_init_failure_text: STRING is "Directory Services could not start."

    Error_ds_init_failure_value: INTEGER is 8532

    Error_ds_install_no_sch_version_in_inifile_text: STRING is "The replica/child install failed to read the objectVersion attribute in the SCHEMA section of the file schema.ini in the system32 directory."

    Error_ds_install_no_sch_version_in_inifile_value: INTEGER is 8512

    Error_ds_install_no_src_sch_version_text: STRING is "The replica/child install failed to get the objectVersion attribute on the schema container on the source DC. Either the attribute is missing on the schema container or the credentials supplied do not have permission to read it."

    Error_ds_install_no_src_sch_version_value: INTEGER is 8511

    Error_ds_install_schema_mismatch_text: STRING is "A schema mismatch is detected between the source and the build used during a replica install. The replica cannot be installed."

    Error_ds_install_schema_mismatch_value: INTEGER is 8467

    Error_ds_insuff_access_rights_text: STRING is "Insufficient access rights to perform the operation."

    Error_ds_insuff_access_rights_value: INTEGER is 8344

    Error_ds_internal_failure_text: STRING is "The directory service encountered an internal failure."

    Error_ds_internal_failure_value: INTEGER is 8430

    Error_ds_invalid_attribute_syntax_text: STRING is "The attribute syntax specified to the directory service is invalid."

    Error_ds_invalid_attribute_syntax_value: INTEGER is 8203

    Error_ds_invalid_dmd_text: STRING is "The schema object could not be found."

    Error_ds_invalid_dmd_value: INTEGER is 8360

    Error_ds_invalid_dn_syntax_text: STRING is "An invalid dn syntax has been specified."

    Error_ds_invalid_dn_syntax_value: INTEGER is 8242

    Error_ds_invalid_group_type_text: STRING is "The specified group type is invalid."

    Error_ds_invalid_group_type_value: INTEGER is 8513

    Error_ds_invalid_ldap_display_name_text: STRING is "The LDAP display name of the class or attribute contains non-ASCII characters."

    Error_ds_invalid_ldap_display_name_value: INTEGER is 8479

    Error_ds_invalid_name_for_spn_text: STRING is "A Service Principal Name (SPN) could not be constructed because the provided hostname is not in the necessary format."

    Error_ds_invalid_name_for_spn_value: INTEGER is 8554

    Error_ds_invalid_role_owner_text: STRING is "The role owner attribute could not be read."

    Error_ds_invalid_role_owner_value: INTEGER is 8366

    Error_ds_invalid_search_flag_text: STRING is "The search flags for the attribute are invalid. The ANR bit is valid only on attributes of Unicode or Teletex strings."

    Error_ds_invalid_search_flag_value: INTEGER is 8500

    Error_ds_is_leaf_text: STRING is "The object is a leaf object."

    Error_ds_is_leaf_value: INTEGER is 8243

    Error_ds_key_not_unique_text: STRING is "The object requested was not found, but an object with that key was found."

    Error_ds_key_not_unique_value: INTEGER is 8527

    Error_ds_local_cant_have_crossdomain_local_member_text: STRING is "A local group cannot have another cross domain local group as a member."

    Error_ds_local_cant_have_crossdomain_local_member_value: INTEGER is 8520

    Error_ds_local_error_text: STRING is "A local error has occurred."

    Error_ds_local_error_value: INTEGER is 8251

    Error_ds_local_member_of_local_only_text: STRING is "A local group can only be a member of other local groups in the same domain."

    Error_ds_local_member_of_local_only_value: INTEGER is 8548

    Error_ds_loop_detect_text: STRING is "A loop has been detected."

    Error_ds_loop_detect_value: INTEGER is 8246

    Error_ds_machine_account_quota_exceeded_text: STRING is "Your computer could not be joined to the domain. You have exceeded the maximum number of computer accounts you are allowed to create in this domain. Contact your system administrator to have this limit reset or increased."

    Error_ds_machine_account_quota_exceeded_value: INTEGER is 8557

    Error_ds_masterdsa_required_text: STRING is "The operation must be performed at a master DSA."

    Error_ds_masterdsa_required_value: INTEGER is 8314

    Error_ds_max_obj_size_exceeded_text: STRING is "The maximum size of an object has been exceeded."

    Error_ds_max_obj_size_exceeded_value: INTEGER is 8304

    Error_ds_membership_evaluated_locally_text: STRING is "The directory service evaluated group memberships locally."

    Error_ds_membership_evaluated_locally_value: INTEGER is 8201

    Error_ds_missing_expected_att_text: STRING is "An expected attribute is missing."

    Error_ds_missing_expected_att_value: INTEGER is 8411

    Error_ds_missing_fsmo_settings_text: STRING is "The directory service is missing mandatory configuration information, and is unable to determine the ownership of floating single-master operation roles."

    Error_ds_missing_fsmo_settings_value: INTEGER is 8434

    Error_ds_missing_infrastructure_container_text: STRING is "The operation cannot be performed because the server does not have an infrastructure container in the domain of interest."

    Error_ds_missing_infrastructure_container_value: INTEGER is 8497

    Error_ds_missing_required_att_text: STRING is "A required attribute is missing."

    Error_ds_missing_required_att_value: INTEGER is 8316

    Error_ds_missing_supref_text: STRING is "A required subref is missing."

    Error_ds_missing_supref_value: INTEGER is 8406

    Error_ds_must_be_run_on_dst_dc_text: STRING is "For security reasons, the operation must be run on the destination DC."

    Error_ds_must_be_run_on_dst_dc_value: INTEGER is 8558

    Error_ds_name_error_domain_only_text: STRING is "Name translation: Unable to resolve completely, only the domain was found."

    Error_ds_name_error_domain_only_value: INTEGER is 8473

    Error_ds_name_error_no_mapping_text: STRING is "Name translation: Input name found, but not the associated output format."

    Error_ds_name_error_no_mapping_value: INTEGER is 8472

    Error_ds_name_error_no_syntactical_mapping_text: STRING is "Name translation: Unable to perform purely syntactical mapping at the client without going out to the wire."

    Error_ds_name_error_no_syntactical_mapping_value: INTEGER is 8474

    Error_ds_name_error_not_found_text: STRING is "Name translation: Could not find the name or insufficient right to see name."

    Error_ds_name_error_not_found_value: INTEGER is 8470

    Error_ds_name_error_not_unique_text: STRING is "Name translation: Input name mapped to more than one output name."

    Error_ds_name_error_not_unique_value: INTEGER is 8471

    Error_ds_name_error_resolving_text: STRING is "Name translation: Generic processing error."

    Error_ds_name_error_resolving_value: INTEGER is 8469

    Error_ds_name_reference_invalid_text: STRING is "The name reference is invalid."

    Error_ds_name_reference_invalid_value: INTEGER is 8373

    Error_ds_name_too_long_text: STRING is "The name is too long."

    Error_ds_name_too_long_value: INTEGER is 8348

    Error_ds_name_too_many_parts_text: STRING is "The name has too many parts."

    Error_ds_name_too_many_parts_value: INTEGER is 8347

    Error_ds_name_type_unknown_text: STRING is "The directory service cannot get the attribute type for a name."

    Error_ds_name_type_unknown_value: INTEGER is 8351

    Error_ds_name_unparseable_text: STRING is "The directory service encountered an error parsing a name."

    Error_ds_name_unparseable_value: INTEGER is 8350

    Error_ds_name_value_too_long_text: STRING is "The name value is too long."

    Error_ds_name_value_too_long_value: INTEGER is 8349

    Error_ds_naming_master_gc_text: STRING is "Only DSAs configured to be Global Catalog servers should be allowed to hold the Domain Naming Master FSMO role."

    Error_ds_naming_master_gc_value: INTEGER is 8523

    Error_ds_naming_violation_text: STRING is "There is a naming violation."

    Error_ds_naming_violation_value: INTEGER is 8247

    Error_ds_nc_must_have_nc_parent_text: STRING is "A naming context head must be the immediate child of another naming context head, not of an interior node."

    Error_ds_nc_must_have_nc_parent_value: INTEGER is 8494

    Error_ds_nc_still_has_dsas_text: STRING is "The requested domain could not be deleted because there exist domain controllers that still host this domain."

    Error_ds_nc_still_has_dsas_value: INTEGER is 8546

    Error_ds_ncname_missing_cr_ref_text: STRING is "The specified naming context is missing a cross reference."

    Error_ds_ncname_missing_cr_ref_value: INTEGER is 8412

    Error_ds_ncname_must_be_nc_text: STRING is "The object must be a naming context."

    Error_ds_ncname_must_be_nc_value: INTEGER is 8357

    Error_ds_no_attribute_or_value_text: STRING is "The specified directory service attribute or value does not exist."

    Error_ds_no_attribute_or_value_value: INTEGER is 8202

    Error_ds_no_chained_eval_text: STRING is "Chained evaluation is not permitted."

    Error_ds_no_chained_eval_value: INTEGER is 8328

    Error_ds_no_chaining_text: STRING is "Chaining is not permitted."

    Error_ds_no_chaining_value: INTEGER is 8327

    Error_ds_no_checkpoint_with_pdc_text: STRING is "The checkpoint with the PDC could not be taken because there too many modifications being processed currently."

    Error_ds_no_checkpoint_with_pdc_value: INTEGER is 8551

    Error_ds_no_crossref_for_nc_text: STRING is "The cross reference for the specified naming context could not be found."

    Error_ds_no_crossref_for_nc_value: INTEGER is 8363

    Error_ds_no_deleted_name_text: STRING is "Failed to create name for deleted object."

    Error_ds_no_deleted_name_value: INTEGER is 8355

    Error_ds_no_fpo_in_universal_groups_text: STRING is "Foreign security principals cannot be members of universal groups."

    Error_ds_no_fpo_in_universal_groups_value: INTEGER is 8549

    Error_ds_no_more_rids_text: STRING is "The directory service has exhausted the pool of relative identifiers."

    Error_ds_no_more_rids_value: INTEGER is 8209

    Error_ds_no_nest_globalgroup_in_mixeddomain_text: STRING is "You cannot nest global groups in a mixed domain if the group is security-enabled."

    Error_ds_no_nest_globalgroup_in_mixeddomain_value: INTEGER is 8514

    Error_ds_no_nest_localgroup_in_mixeddomain_text: STRING is "You cannot nest local groups in a mixed domain if the group is security-enabled."

    Error_ds_no_nest_localgroup_in_mixeddomain_value: INTEGER is 8515

    Error_ds_no_parent_object_text: STRING is "The operation could not be performed because the object's parent is either uninstantiated or deleted."

    Error_ds_no_parent_object_value: INTEGER is 8329

    Error_ds_no_pkt_privacy_on_connection_text: STRING is "The connection between client and server requires packet privacy or better."

    Error_ds_no_pkt_privacy_on_connection_value: INTEGER is 8533

    Error_ds_no_rdn_defined_in_schema_text: STRING is "An attempt was made to add an object of a class that does not have an RDN defined in the schema."

    Error_ds_no_rdn_defined_in_schema_value: INTEGER is 8306

    Error_ds_no_requested_atts_found_text: STRING is "None of the requested attributes were found on the objects."

    Error_ds_no_requested_atts_found_value: INTEGER is 8308

    Error_ds_no_results_returned_text: STRING is "No results were returned."

    Error_ds_no_results_returned_value: INTEGER is 8257

    Error_ds_no_rids_allocated_text: STRING is "The directory service was unable to allocate a relative identifier."

    Error_ds_no_rids_allocated_value: INTEGER is 8208

    Error_ds_no_such_object_text: STRING is "There is no such object on the server."

    Error_ds_no_such_object_value: INTEGER is 8240

    Error_ds_no_tree_delete_above_nc_text: STRING is "Tree deletions starting at an object which has an NC head as a descendant are not allowed."

    Error_ds_no_tree_delete_above_nc_value: INTEGER is 8501

    Error_ds_non_base_search_text: STRING is "The requested search operation is only supported for base searches."

    Error_ds_non_base_search_value: INTEGER is 8480

    Error_ds_nonexistent_may_have_text: STRING is "Schema update failed: attribute in may-contain does not exist."

    Error_ds_nonexistent_may_have_value: INTEGER is 8387

    Error_ds_nonexistent_must_have_text: STRING is "Schema update failed: attribute in must-contain does not exist."

    Error_ds_nonexistent_must_have_value: INTEGER is 8388

    Error_ds_nonexistent_poss_sup_text: STRING is "Schema update failed: class in poss-superiors does not exist."

    Error_ds_nonexistent_poss_sup_value: INTEGER is 8390

    Error_ds_nonsafe_schema_change_text: STRING is "Adding a new mandatory attribute to an existing class, deleting a mandatory attribute from an existing class, or adding an optional attribute to the special class Top that is not a backlink attribute (directly or through inheritance, for example, by adding or deleting an auxiliary class) is not allowed."

    Error_ds_nonsafe_schema_change_value: INTEGER is 8508

    Error_ds_not_an_object_text: STRING is "The name does not identify an object; the name identifies a phantom."

    Error_ds_not_an_object_value: INTEGER is 8352

    Error_ds_not_authoritive_for_dst_nc_text: STRING is "Destination of a cross-domain move is not authoritative for the destination naming context."

    Error_ds_not_authoritive_for_dst_nc_value: INTEGER is 8487

    Error_ds_not_installed_text: STRING is "An error occurred while installing the directory service. For more information, see the event log."

    Error_ds_not_installed_value: INTEGER is 8200

    Error_ds_not_on_backlink_text: STRING is "The operation cannot be performed on a back link."

    Error_ds_not_on_backlink_value: INTEGER is 8362

    Error_ds_not_supported_text: STRING is "The specified method is not supported."

    Error_ds_not_supported_value: INTEGER is 8256

    Error_ds_notify_filter_too_complex_text: STRING is "Notification filter is too complex."

    Error_ds_notify_filter_too_complex_value: INTEGER is 8377

    Error_ds_obj_class_not_defined_text: STRING is "The specified class is not defined."

    Error_ds_obj_class_not_defined_value: INTEGER is 8371

    Error_ds_obj_class_not_subclass_text: STRING is "The specified class is not a subclass."

    Error_ds_obj_class_not_subclass_value: INTEGER is 8372

    Error_ds_obj_class_violation_text: STRING is "The requested operation did not satisfy one or more constraints associated with the class of the object."

    Error_ds_obj_class_violation_value: INTEGER is 8212

    Error_ds_obj_guid_exists_text: STRING is "A local object with this GUID (dead or alive) already exists."

    Error_ds_obj_guid_exists_value: INTEGER is 8361

    Error_ds_obj_not_found_text: STRING is "Directory object not found."

    Error_ds_obj_not_found_value: INTEGER is 8333

    Error_ds_obj_string_name_exists_text: STRING is "An attempt was made to add an object to the directory with a name that is already in use."

    Error_ds_obj_string_name_exists_value: INTEGER is 8305

    Error_ds_obj_too_large_text: STRING is "The specified object is too large."

    Error_ds_obj_too_large_value: INTEGER is 8312

    Error_ds_object_class_required_text: STRING is "The object class attribute must be specified."

    Error_ds_object_class_required_value: INTEGER is 8315

    Error_ds_object_results_too_large_text: STRING is "The result set is too large."

    Error_ds_object_results_too_large_value: INTEGER is 8248

    Error_ds_operations_error_text: STRING is "An operations error occurred."

    Error_ds_operations_error_value: INTEGER is 8224

    Error_ds_out_of_scope_text: STRING is "The operation is out of scope."

    Error_ds_out_of_scope_value: INTEGER is 8338

    Error_ds_param_error_text: STRING is "One or more parameters are illegal."

    Error_ds_param_error_value: INTEGER is 8255

    Error_ds_parent_is_an_alias_text: STRING is "Having a parent that is an alias is not permitted. Aliases are leaf objects."

    Error_ds_parent_is_an_alias_value: INTEGER is 8330

    Error_ds_pdc_operation_in_progress_text: STRING is "Another operation which requires exclusive access to the PDC FSMO is already in progress."

    Error_ds_pdc_operation_in_progress_value: INTEGER is 8490

    Error_ds_protocol_error_text: STRING is "A protocol error occurred."

    Error_ds_protocol_error_value: INTEGER is 8225

    Error_ds_range_constraint_text: STRING is "A value for the attribute was not in the acceptable range of values."

    Error_ds_range_constraint_value: INTEGER is 8322

    Error_ds_rdn_doesnt_match_schema_text: STRING is "An attempt was made to add an object using an RDN that is not the RDN defined in the schema."

    Error_ds_rdn_doesnt_match_schema_value: INTEGER is 8307

    Error_ds_recalcschema_failed_text: STRING is "Schema update failed in recalculating validation cache."

    Error_ds_recalcschema_failed_value: INTEGER is 8396

    Error_ds_referral_limit_exceeded_text: STRING is "The preset referral limit was exceeded."

    Error_ds_referral_limit_exceeded_value: INTEGER is 8260

    Error_ds_referral_text: STRING is "A referral was returned from the server."

    Error_ds_referral_value: INTEGER is 8235

    Error_ds_refusing_fsmo_roles_text: STRING is "This directory server is shutting down, and cannot take ownership of new floating single-master operation roles."

    Error_ds_refusing_fsmo_roles_value: INTEGER is 8433

    Error_ds_replicator_only_text: STRING is "Only the replicator can perform this function."

    Error_ds_replicator_only_value: INTEGER is 8370

    Error_ds_ridmgr_init_error_text: STRING is "The directory service was unable to initialize the subsystem that allocates relative identifiers."

    Error_ds_ridmgr_init_error_value: INTEGER is 8211

    Error_ds_root_cant_be_subref_text: STRING is "The specified root object cannot be a subref."

    Error_ds_root_cant_be_subref_value: INTEGER is 8326

    Error_ds_root_must_be_nc_text: STRING is "The root object must be the head of a naming context. The root object cannot have an instantiated parent."

    Error_ds_root_must_be_nc_value: INTEGER is 8301

    Error_ds_root_requires_class_top_text: STRING is "A root object requires a class of 'top'."

    Error_ds_root_requires_class_top_value: INTEGER is 8432

    Error_ds_sam_init_failure_text: STRING is "Security Accounts Manager initialization failed because of the following error: %%1.  Error Status: 0x%%2. Click OK to shut down the system and reboot into Directory Services Restore Mode. Check the event log for detailed information."

    Error_ds_sam_init_failure_value: INTEGER is 8504

    Error_ds_sam_need_bootkey_floppy_text: STRING is "Security Account Manager needs to get the boot key from floppy disk."

    Error_ds_sam_need_bootkey_floppy_value: INTEGER is 8530

    Error_ds_sam_need_bootkey_password_text: STRING is "Security Account Manager needs to get the boot password."

    Error_ds_sam_need_bootkey_password_value: INTEGER is 8529

    Error_ds_schema_alloc_failed_text: STRING is "Schema allocation failed. Please check if the machine is running low on memory."

    Error_ds_schema_alloc_failed_value: INTEGER is 8415

    Error_ds_schema_not_loaded_text: STRING is "The schema is not loaded."

    Error_ds_schema_not_loaded_value: INTEGER is 8414

    Error_ds_schema_update_disallowed_text: STRING is "Schema update is not allowed on this DC. Either the registry key is not set or the DC is not the schema FSMO Role Owner."

    Error_ds_schema_update_disallowed_value: INTEGER is 8509

    Error_ds_sec_desc_invalid_text: STRING is "The security descriptor is invalid."

    Error_ds_sec_desc_invalid_value: INTEGER is 8354

    Error_ds_sec_desc_too_short_text: STRING is "The security descriptor is too short."

    Error_ds_sec_desc_too_short_value: INTEGER is 8353

    Error_ds_security_checking_error_text: STRING is "A security checking error has occurred."

    Error_ds_security_checking_error_value: INTEGER is 8413

    Error_ds_security_illegal_modify_text: STRING is "The modification was not permitted for security reasons."

    Error_ds_security_illegal_modify_value: INTEGER is 8423

    Error_ds_semantic_att_test_text: STRING is "Schema update failed: range-lower less than range upper."

    Error_ds_semantic_att_test_value: INTEGER is 8383

    Error_ds_sensitive_group_violation_text: STRING is "Only an administrator can modify the membership list of an administrative group."

    Error_ds_sensitive_group_violation_value: INTEGER is 8505

    Error_ds_server_down_text: STRING is "The server is not operational."

    Error_ds_server_down_value: INTEGER is 8250

    Error_ds_shutting_down_text: STRING is "The operation could not be performed because the directory service is shutting down."

    Error_ds_shutting_down_value: INTEGER is 8364

    Error_ds_single_value_constraint_text: STRING is "Multiple values were specified for an attribute that can have only one value."

    Error_ds_single_value_constraint_value: INTEGER is 8321

    Error_ds_sizelimit_exceeded_text: STRING is "The size limit for this request was exceeded."

    Error_ds_sizelimit_exceeded_value: INTEGER is 8227

    Error_ds_source_auditing_not_enabled_text: STRING is "The operation requires that source domain auditing be enabled."

    Error_ds_source_auditing_not_enabled_value: INTEGER is 8552

    Error_ds_source_domain_in_forest_text: STRING is "The source domain may not be in the same forest as destination."

    Error_ds_source_domain_in_forest_value: INTEGER is 8534

    Error_ds_src_and_dst_nc_identical_text: STRING is "Source and destination for the cross-domain move operation are identical.  Caller should use local move operation instead of cross-domain move operation."

    Error_ds_src_and_dst_nc_identical_value: INTEGER is 8485

    Error_ds_src_and_dst_object_class_mismatch_text: STRING is "The source and destination object must be of the same type."

    Error_ds_src_and_dst_object_class_mismatch_value: INTEGER is 8540

    Error_ds_src_dc_must_be_sp4_or_greater_text: STRING is "For security reasons, the source DC must be Service Pack 4 or greater."

    Error_ds_src_dc_must_be_sp4_or_greater_value: INTEGER is 8559

    Error_ds_src_guid_mismatch_text: STRING is "Source and destination of a cross-domain move do not agree on the identity of the source object.  Either source or destination does not have the latest version of the source object."

    Error_ds_src_guid_mismatch_value: INTEGER is 8488

    Error_ds_src_name_mismatch_text: STRING is "Source and destination of a cross-domain move do not agree on the object's current name.  Either source or destination does not have the latest version of the object."

    Error_ds_src_name_mismatch_value: INTEGER is 8484

    Error_ds_src_obj_not_group_or_user_text: STRING is "The source object must be a group or user."

    Error_ds_src_obj_not_group_or_user_value: INTEGER is 8538

    Error_ds_src_sid_exists_in_forest_text: STRING is "The source object's SID already exists in destination forest."

    Error_ds_src_sid_exists_in_forest_value: INTEGER is 8539

    Error_ds_string_sd_conversion_failed_text: STRING is "The schema cache load failed to convert the string default SD on a class-schema object."

    Error_ds_string_sd_conversion_failed_value: INTEGER is 8522

    Error_ds_strong_auth_required_text: STRING is "A more secure authentication method is required for this server."

    Error_ds_strong_auth_required_value: INTEGER is 8232

    Error_ds_sub_cls_test_fail_text: STRING is "Schema update failed: class in subclassof list does not exist or does not satisfy hierarchy rules."

    Error_ds_sub_cls_test_fail_value: INTEGER is 8391

    Error_ds_subref_must_have_parent_text: STRING is "The parent of a new subref must exist."

    Error_ds_subref_must_have_parent_value: INTEGER is 8356

    Error_ds_subtree_notify_not_nc_head_text: STRING is "Subtree notifications are only supported on NC heads."

    Error_ds_subtree_notify_not_nc_head_value: INTEGER is 8376

    Error_ds_syntax_mismatch_text: STRING is "Schema update failed: syntax mismatch."

    Error_ds_syntax_mismatch_value: INTEGER is 8384

    Error_ds_timelimit_exceeded_text: STRING is "The time limit for this request was exceeded."

    Error_ds_timelimit_exceeded_value: INTEGER is 8226

    Error_ds_tree_delete_not_finished_text: STRING is "The tree deletion is not finished.  The request must be made again to continue deleting the tree."

    Error_ds_tree_delete_not_finished_value: INTEGER is 8397

    Error_ds_unable_to_surrender_roles_text: STRING is "The directory service was unable to transfer ownership of one or more floating single-master operation roles to other servers."

    Error_ds_unable_to_surrender_roles_value: INTEGER is 8435

    Error_ds_unavailable_crit_extension_text: STRING is "The server does not support the requested critical extension."

    Error_ds_unavailable_crit_extension_value: INTEGER is 8236

    Error_ds_unavailable_text: STRING is "The directory service is unavailable."

    Error_ds_unavailable_value: INTEGER is 8207

    Error_ds_unicodepwd_not_in_quotes_text: STRING is "The unicodePwd attribute value must be enclosed in double quotes."

    Error_ds_unicodepwd_not_in_quotes_value: INTEGER is 8556

    Error_ds_universal_cant_have_local_member_text: STRING is "A universal group cannot have a local group as a member."

    Error_ds_universal_cant_have_local_member_value: INTEGER is 8518

    Error_ds_unknown_error_text: STRING is "The directory service encountered an unknown failure."

    Error_ds_unknown_error_value: INTEGER is 8431

    Error_ds_unknown_operation_text: STRING is "The directory service request is invalid."

    Error_ds_unknown_operation_value: INTEGER is 8365

    Error_ds_unwilling_to_perform_text: STRING is "The server is unwilling to process the request."

    Error_ds_unwilling_to_perform_value: INTEGER is 8245

    Error_ds_user_buffer_to_small_text: STRING is "The user buffer is too small."

    Error_ds_user_buffer_to_small_value: INTEGER is 8309

    Error_ds_wrong_linked_att_syntax_text: STRING is "The syntax of the linked attribute being added is incorrect. Forward links can only have syntax 2.5.5.1, 2.5.5.7, and 2.5.5.14, and backlinks can only have syntax 2.5.5.1"

    Error_ds_wrong_linked_att_syntax_value: INTEGER is 8528

    Error_ds_wrong_om_obj_class_text: STRING is "The OM-Object-Class specified is incorrect for an attribute with the specified syntax."

    Error_ds_wrong_om_obj_class_value: INTEGER is 8476

    Error_dup_domainname_text: STRING is "The workgroup or domain name is already in use by another computer on the network."

    Error_dup_domainname_value: INTEGER is 1221

    Error_dup_name_text: STRING is "A duplicate name exists on the network."

    Error_dup_name_value: INTEGER is 52

    Error_duplicate_service_name_text: STRING is "The name is already in use as either a service name or a service display name."

    Error_duplicate_service_name_value: INTEGER is 1078

    Error_duplicate_tag_text: STRING is "The specified tag is already present."

    Error_duplicate_tag_value: INTEGER is 2014

    Error_dynlink_from_invalid_ring_text: STRING is "The operating system cannot run this application program."

    Error_dynlink_from_invalid_ring_value: INTEGER is 196

    Error_ea_access_denied_text: STRING is "Access to the extended attribute was denied."

    Error_ea_access_denied_value: INTEGER is 994

    Error_ea_file_corrupt_text: STRING is "The extended attribute file on the mounted file system is corrupt."

    Error_ea_file_corrupt_value: INTEGER is 276

    Error_ea_list_inconsistent_text: STRING is "The extended attributes are inconsistent."

    Error_ea_list_inconsistent_value: INTEGER is 255

    Error_ea_table_full_text: STRING is "The extended attribute table file is full."

    Error_ea_table_full_value: INTEGER is 277

    Error_eas_didnt_fit_text: STRING is "The extended attributes did not fit in the buffer."

    Error_eas_didnt_fit_value: INTEGER is 275

    Error_eas_not_supported_text: STRING is "The mounted file system does not support extended attributes."

    Error_eas_not_supported_value: INTEGER is 282

    Error_efs_server_not_trusted_text: STRING is "The server is not trusted for remote encryption operation."

    Error_efs_server_not_trusted_value: INTEGER is 6011

    Error_empty_text: STRING is "The library, drive, or media pool is empty."

    Error_empty_value: INTEGER is 4306

    Error_encryption_failed_text: STRING is "The specified file could not be encrypted."

    Error_encryption_failed_value: INTEGER is 6000

    Error_end_of_media_text: STRING is "The physical end of the tape has been reached."

    Error_end_of_media_value: INTEGER is 1100

    Error_envvar_not_found_text: STRING is "The system could not find the environment  option that was entered."

    Error_envvar_not_found_value: INTEGER is 203

    Error_eom_overflow_text: STRING is "Physical end of tape encountered."

    Error_eom_overflow_value: INTEGER is 1129

    Error_eventlog_cant_start_text: STRING is "No event log file could be opened, so the event logging service did not start."

    Error_eventlog_cant_start_value: INTEGER is 1501

    Error_eventlog_file_changed_text: STRING is "The event log file has changed between read operations."

    Error_eventlog_file_changed_value: INTEGER is 1503

    Error_eventlog_file_corrupt_text: STRING is "The event log file is corrupted."

    Error_eventlog_file_corrupt_value: INTEGER is 1500

    Error_exception_in_service_text: STRING is "An exception occurred in the service when handling the control request."

    Error_exception_in_service_value: INTEGER is 1064

    Error_excl_sem_already_owned_text: STRING is "The exclusive semaphore is owned by another process."

    Error_excl_sem_already_owned_value: INTEGER is 101

    Error_exe_machine_type_mismatch_text: STRING is "The image file %%1 is valid, but is for a machine type other than the current machine."

    Error_exe_machine_type_mismatch_value: INTEGER is 216

    Error_exe_marked_invalid_text: STRING is "The operating system cannot run %%1."

    Error_exe_marked_invalid_value: INTEGER is 192

    Error_extended_error_text: STRING is "An extended error has occurred."

    Error_extended_error_value: INTEGER is 1208

    Error_fail_i24_text: STRING is "Fail on INT 24."

    Error_fail_i24_value: INTEGER is 83

    Error_failed_service_controller_connect_text: STRING is "The service process could not connect to the service controller."

    Error_failed_service_controller_connect_value: INTEGER is 1063

    Error_file_corrupt_text: STRING is "The file or directory is corrupted and unreadable."

    Error_file_corrupt_value: INTEGER is 1392

    Error_file_encrypted_text: STRING is "The specified file is encrypted and the user does not have the ability to decrypt it."

    Error_file_encrypted_value: INTEGER is 6002

    Error_file_exists_text: STRING is "The file exists."

    Error_file_exists_value: INTEGER is 80

    Error_file_invalid_text: STRING is "The volume for a file has been externally altered so that the opened file is no longer valid."

    Error_file_invalid_value: INTEGER is 1006

    Error_file_not_encrypted_text: STRING is "The specified file is not encrypted."

    Error_file_not_encrypted_value: INTEGER is 6007

    Error_file_not_found_text: STRING is "The system cannot find the file specified."

    Error_file_not_found_value: INTEGER is 2

    Error_file_offline_text: STRING is "The remote storage service was not able to recall the file."

    Error_file_offline_value: INTEGER is 4350

    Error_file_read_only_text: STRING is "The specified file is read only."

    Error_file_read_only_value: INTEGER is 6009

    Error_filemark_detected_text: STRING is "A tape access reached a filemark."

    Error_filemark_detected_value: INTEGER is 1101

    Error_filename_exced_range_text: STRING is "The filename or extension is too long."

    Error_filename_exced_range_value: INTEGER is 206

    Error_floppy_bad_registers_text: STRING is "The floppy disk controller returned inconsistent results in its registers."

    Error_floppy_bad_registers_value: INTEGER is 1125

    Error_floppy_id_mark_not_found_text: STRING is "No ID address mark was found on the floppy disk."

    Error_floppy_id_mark_not_found_value: INTEGER is 1122

    Error_floppy_unknown_error_text: STRING is "The floppy disk controller reported an error that is not recognized by the floppy disk driver."

    Error_floppy_unknown_error_value: INTEGER is 1124

    Error_floppy_wrong_cylinder_text: STRING is "Mismatch between the floppy disk sector ID field and the floppy disk controller track address."

    Error_floppy_wrong_cylinder_value: INTEGER is 1123

    Error_full_backup_text: STRING is "The backup failed. Check the directory to which you are backing the database."

    Error_full_backup_value: INTEGER is 4004

    Error_fullscreen_mode_text: STRING is "The requested operation cannot be performed in full-screen mode."

    Error_fullscreen_mode_value: INTEGER is 1007

    Error_function_failed_text: STRING is "Function failed during execution."

    Error_function_failed_value: INTEGER is 1627

    Error_function_not_called_text: STRING is "Function could not be executed."

    Error_function_not_called_value: INTEGER is 1626

    Error_gen_failure_text: STRING is "A device attached to the system is not functioning."

    Error_gen_failure_value: INTEGER is 31

    Error_generic_not_mapped_text: STRING is "Generic access types were contained in an access mask which should already be mapped to nongeneric types."

    Error_generic_not_mapped_value: INTEGER is 1360

    Error_global_only_hook_text: STRING is "This hook procedure can only be set globally."

    Error_global_only_hook_value: INTEGER is 1429

    Error_graceful_disconnect_text: STRING is "The network connection was gracefully closed."

    Error_graceful_disconnect_value: INTEGER is 1226

    Error_group_exists_text: STRING is "The specified group already exists."

    Error_group_exists_value: INTEGER is 1318

    Error_group_not_available_text: STRING is "The cluster group is not available for any new requests."

    Error_group_not_available_value: INTEGER is 5012

    Error_group_not_found_text: STRING is "The cluster group could not be found."

    Error_group_not_found_value: INTEGER is 5013

    Error_group_not_online_text: STRING is "The operation could not be completed because the cluster group is not online."

    Error_group_not_online_value: INTEGER is 5014

    Error_handle_disk_full_text: STRING is "The disk is full."

    Error_handle_disk_full_value: INTEGER is 39

    Error_handle_eof_text: STRING is "Reached the end of the file."

    Error_handle_eof_value: INTEGER is 38

    Error_hook_needs_hmod_text: STRING is "Cannot set nonlocal hook without a module handle."

    Error_hook_needs_hmod_value: INTEGER is 1428

    Error_hook_not_installed_text: STRING is "The hook procedure is not installed."

    Error_hook_not_installed_value: INTEGER is 1431

    Error_hook_type_not_allowed_text: STRING is "Hook type not allowed."

    Error_hook_type_not_allowed_value: INTEGER is 1458

    Error_host_node_not_available_text: STRING is "A cluster node is not available for this operation."

    Error_host_node_not_available_value: INTEGER is 5005

    Error_host_node_not_group_owner_text: STRING is "The cluster node is not the owner of the group."

    Error_host_node_not_group_owner_value: INTEGER is 5016

    Error_host_node_not_resource_owner_text: STRING is "The cluster node is not the owner of the resource."

    Error_host_node_not_resource_owner_value: INTEGER is 5015

    Error_host_unreachable_text: STRING is "The network location cannot be reached. For information about network troubleshooting, see Windows Help."

    Error_host_unreachable_value: INTEGER is 1232

    Error_hotkey_already_registered_text: STRING is "Hot key is already registered."

    Error_hotkey_already_registered_value: INTEGER is 1409

    Error_hotkey_not_registered_text: STRING is "Hot key is not registered."

    Error_hotkey_not_registered_value: INTEGER is 1419

    Error_hwnds_have_diff_parent_text: STRING is "All handles to windows in a multiple-window position structure must have the same parent."

    Error_hwnds_have_diff_parent_value: INTEGER is 1441

    Error_icm_not_enabled_text: STRING is "Image Color Management is not enabled."

    Error_icm_not_enabled_value: INTEGER is 2018

    Error_ill_formed_password_text: STRING is "Unable to update the password. The value provided for the new password contains values that are not allowed in passwords."

    Error_ill_formed_password_value: INTEGER is 1324

    Error_illegal_element_address_text: STRING is "The indicated element does not exist."

    Error_illegal_element_address_value: INTEGER is 1162

    Error_inc_backup_text: STRING is "The backup failed. Was a full backup done before?"

    Error_inc_backup_value: INTEGER is 4003

    Error_incorrect_address_text: STRING is "The network address could not be used for the operation requested."

    Error_incorrect_address_value: INTEGER is 1241

    Error_index_absent_text: STRING is "Component qualifier not present."

    Error_index_absent_value: INTEGER is 1611

    Error_indigenous_type_text: STRING is "The media type cannot be removed from this library since at least one drive in the library reports it can support this media type."

    Error_indigenous_type_value: INTEGER is 4338

    Error_infloop_in_reloc_chain_text: STRING is "The operating system cannot run %%1."

    Error_infloop_in_reloc_chain_value: INTEGER is 202

    Error_install_already_running_text: STRING is "Another installation is already in progress.  Complete that installation before proceeding with this install."

    Error_install_already_running_value: INTEGER is 1618

    Error_install_failure_text: STRING is "Fatal error during installation."

    Error_install_failure_value: INTEGER is 1603

    Error_install_language_unsupported_text: STRING is "The language of this installation package is not supported by your system."

    Error_install_language_unsupported_value: INTEGER is 1623

    Error_install_log_failure_text: STRING is "Error opening installation log file. Verify that the specified log file location exists and that you can write to it."

    Error_install_log_failure_value: INTEGER is 1622

    Error_install_notused_text: STRING is "Component not used on this computer."

    Error_install_notused_value: INTEGER is 1634

    Error_install_package_invalid_text: STRING is "This installation package could not be opened.  Contact the application vendor to verify that this is a valid Windows Installer package."

    Error_install_package_invalid_value: INTEGER is 1620

    Error_install_package_open_failed_text: STRING is "This installation package could not be opened.  Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package."

    Error_install_package_open_failed_value: INTEGER is 1619

    Error_install_package_rejected_text: STRING is "This installation is forbidden by system policy.  Contact your system administrator."

    Error_install_package_rejected_value: INTEGER is 1625

    Error_install_package_version_text: STRING is "This installation package cannot be installed by the Windows Installer service.  You must install a Windows service pack that contains a newer version of the Windows Installer service."

    Error_install_package_version_value: INTEGER is 1613

    Error_install_platform_unsupported_text: STRING is "This installation package is not supported by this processor type. Contact your product vendor."

    Error_install_platform_unsupported_value: INTEGER is 1633

    Error_install_remote_disallowed_text: STRING is "Only administrators have permission to add, remove, or configure server software during a Terminal services remote session. If you want to install or configure software on the server, contact your network administrator."

    Error_install_remote_disallowed_value: INTEGER is 1640

    Error_install_service_failure_text: STRING is "The Windows Installer service could not be accessed.  Contact your support personnel to verify that the Windows Installer service is properly registered."

    Error_install_service_failure_value: INTEGER is 1601

    Error_install_source_absent_text: STRING is "The installation source for this product is not available.  Verify that the source exists and that you can access it."

    Error_install_source_absent_value: INTEGER is 1612

    Error_install_suspend_text: STRING is "Installation suspended, incomplete."

    Error_install_suspend_value: INTEGER is 1604

    Error_install_temp_unwritable_text: STRING is "The temp folder is either full or inaccessible.  Verify that the temp folder exists and that you can write to it."

    Error_install_temp_unwritable_value: INTEGER is 1632

    Error_install_transform_failure_text: STRING is "Error applying transforms.  Verify that the specified transform paths are valid."

    Error_install_transform_failure_value: INTEGER is 1624

    Error_install_ui_failure_text: STRING is "There was an error starting the Windows Installer service user interface.  Contact your support personnel."

    Error_install_ui_failure_value: INTEGER is 1621

    Error_install_userexit_text: STRING is "User cancelled installation."

    Error_install_userexit_value: INTEGER is 1602

    Error_insufficient_buffer_text: STRING is "The data area passed to a system call is too small."

    Error_insufficient_buffer_value: INTEGER is 122

    Error_internal_db_corruption_text: STRING is "Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk."

    Error_internal_db_corruption_value: INTEGER is 1358

    Error_internal_db_error_text: STRING is "The local security authority database contains an internal inconsistency."

    Error_internal_db_error_value: INTEGER is 1383

    Error_internal_error_text: STRING is "An internal error occurred."

    Error_internal_error_value: INTEGER is 1359

    Error_invalid_accel_handle_text: STRING is "Invalid accelerator table handle."

    Error_invalid_accel_handle_value: INTEGER is 1403

    Error_invalid_access_text: STRING is "The access code is invalid."

    Error_invalid_access_value: INTEGER is 12

    Error_invalid_account_name_text: STRING is "The name provided is not a properly formed account name."

    Error_invalid_account_name_value: INTEGER is 1315

    Error_invalid_acl_text: STRING is "The access control list (ACL) structure is invalid."

    Error_invalid_acl_value: INTEGER is 1336

    Error_invalid_address_text: STRING is "Attempt to access invalid address."

    Error_invalid_address_value: INTEGER is 487

    Error_invalid_at_interrupt_time_text: STRING is "Cannot request exclusive semaphores at interrupt time."

    Error_invalid_at_interrupt_time_value: INTEGER is 104

    Error_invalid_block_length_text: STRING is "When accessing a new tape of a multivolume partition, the current block size is incorrect."

    Error_invalid_block_length_value: INTEGER is 1106

    Error_invalid_block_text: STRING is "The storage control block address is invalid."

    Error_invalid_block_value: INTEGER is 9

    Error_invalid_category_text: STRING is "The IOCTL call made by the application program is not correct."

    Error_invalid_category_value: INTEGER is 117

    Error_invalid_cleaner_text: STRING is "The media identifier does not represent a valid cleaner."

    Error_invalid_cleaner_value: INTEGER is 4310

    Error_invalid_cmm_text: STRING is "The specified color management module is invalid."

    Error_invalid_cmm_value: INTEGER is 2010

    Error_invalid_colorindex_text: STRING is "The specified named color index is not present in the profile."

    Error_invalid_colorindex_value: INTEGER is 2022

    Error_invalid_colorspace_text: STRING is "The specified color space is invalid."

    Error_invalid_colorspace_value: INTEGER is 2017

    Error_invalid_combobox_message_text: STRING is "Invalid message for a combo box because it does not have an edit control."

    Error_invalid_combobox_message_value: INTEGER is 1422

    Error_invalid_command_line_text: STRING is "Invalid command line argument.  Consult the Windows Installer SDK for detailed command line help."

    Error_invalid_command_line_value: INTEGER is 1639

    Error_invalid_computername_text: STRING is "The format of the specified computer name is invalid."

    Error_invalid_computername_value: INTEGER is 1210

    Error_invalid_cursor_handle_text: STRING is "Invalid cursor handle."

    Error_invalid_cursor_handle_value: INTEGER is 1402

    Error_invalid_data_text: STRING is "The data is invalid."

    Error_invalid_data_value: INTEGER is 13

    Error_invalid_datatype_text: STRING is "The specified datatype is invalid."

    Error_invalid_datatype_value: INTEGER is 1804

    Error_invalid_dll_text: STRING is "One of the library files needed to run this application is damaged."

    Error_invalid_dll_value: INTEGER is 1154

    Error_invalid_domain_role_text: STRING is "This operation is only allowed for the Primary Domain Controller of the domain."

    Error_invalid_domain_role_value: INTEGER is 1354

    Error_invalid_domain_state_text: STRING is "The domain was in the wrong state to perform the security operation."

    Error_invalid_domain_state_value: INTEGER is 1353

    Error_invalid_domainname_text: STRING is "The format of the specified domain name is invalid."

    Error_invalid_domainname_value: INTEGER is 1212

    Error_invalid_drive_object_text: STRING is "The drive identifier does not represent a valid drive."

    Error_invalid_drive_object_value: INTEGER is 4321

    Error_invalid_drive_text: STRING is "The system cannot find the drive specified."

    Error_invalid_drive_value: INTEGER is 15

    Error_invalid_dwp_handle_text: STRING is "Invalid handle to a multiple-window position structure."

    Error_invalid_dwp_handle_value: INTEGER is 1405

    Error_invalid_ea_handle_text: STRING is "The specified extended attribute handle is invalid."

    Error_invalid_ea_handle_value: INTEGER is 278

    Error_invalid_ea_name_text: STRING is "The specified extended attribute name was invalid."

    Error_invalid_ea_name_value: INTEGER is 254

    Error_invalid_edit_height_text: STRING is "Height must be less than 256."

    Error_invalid_edit_height_value: INTEGER is 1424

    Error_invalid_environment_text: STRING is "The environment specified is invalid."

    Error_invalid_environment_value: INTEGER is 1805

    Error_invalid_event_count_text: STRING is "The number of specified semaphore events for DosMuxSemWait is not correct."

    Error_invalid_event_count_value: INTEGER is 151

    Error_invalid_eventname_text: STRING is "The format of the specified event name is invalid."

    Error_invalid_eventname_value: INTEGER is 1211

    Error_invalid_exe_signature_text: STRING is "Cannot run %%1 in Win32 mode."

    Error_invalid_exe_signature_value: INTEGER is 191

    Error_invalid_field_text: STRING is "Record field does not exist."

    Error_invalid_field_value: INTEGER is 1616

    Error_invalid_filter_proc_text: STRING is "Invalid hook procedure."

    Error_invalid_filter_proc_value: INTEGER is 1427

    Error_invalid_flag_number_text: STRING is "The flag passed is not correct."

    Error_invalid_flag_number_value: INTEGER is 186

    Error_invalid_flags_text: STRING is "Invalid flags."

    Error_invalid_flags_value: INTEGER is 1004

    Error_invalid_form_name_text: STRING is "The specified form name is invalid."

    Error_invalid_form_name_value: INTEGER is 1902

    Error_invalid_form_size_text: STRING is "The specified form size is invalid."

    Error_invalid_form_size_value: INTEGER is 1903

    Error_invalid_function_text: STRING is "Incorrect function."

    Error_invalid_function_value: INTEGER is 1

    Error_invalid_group_attributes_text: STRING is "The specified attributes are invalid, or incompatible with the attributes for the group as a whole."

    Error_invalid_group_attributes_value: INTEGER is 1345

    Error_invalid_groupname_text: STRING is "The format of the specified group name is invalid."

    Error_invalid_groupname_value: INTEGER is 1209

    Error_invalid_gw_command_text: STRING is "Invalid GW_* command."

    Error_invalid_gw_command_value: INTEGER is 1443

    Error_invalid_handle_state_text: STRING is "Handle is in an invalid state."

    Error_invalid_handle_state_value: INTEGER is 1609

    Error_invalid_handle_text: STRING is "The handle is invalid."

    Error_invalid_handle_value: INTEGER is 6

    Error_invalid_hook_filter_text: STRING is "Invalid hook procedure type."

    Error_invalid_hook_filter_value: INTEGER is 1426

    Error_invalid_hook_handle_text: STRING is "Invalid hook handle."

    Error_invalid_hook_handle_value: INTEGER is 1404

    Error_invalid_icon_handle_text: STRING is "Invalid icon handle."

    Error_invalid_icon_handle_value: INTEGER is 1414

    Error_invalid_id_authority_text: STRING is "The value provided was an invalid value for an identifier authority."

    Error_invalid_id_authority_value: INTEGER is 1343

    Error_invalid_index_text: STRING is "Invalid index."

    Error_invalid_index_value: INTEGER is 1413

    Error_invalid_keyboard_handle_text: STRING is "Invalid keyboard layout handle."

    Error_invalid_keyboard_handle_value: INTEGER is 1457

    Error_invalid_lb_message_text: STRING is "Invalid message for single-selection list box."

    Error_invalid_lb_message_value: INTEGER is 1432

    Error_invalid_level_text: STRING is "The system call level is not correct."

    Error_invalid_level_value: INTEGER is 124

    Error_invalid_library_text: STRING is "The library identifier does not represent a valid library."

    Error_invalid_library_value: INTEGER is 4301

    Error_invalid_list_format_text: STRING is "The DosMuxSemWait list is not correct."

    Error_invalid_list_format_value: INTEGER is 153

    Error_invalid_logon_hours_text: STRING is "Logon failure: account logon time restriction violation."

    Error_invalid_logon_hours_value: INTEGER is 1328

    Error_invalid_logon_type_text: STRING is "A logon request contained an invalid logon type value."

    Error_invalid_logon_type_value: INTEGER is 1367

    Error_invalid_media_pool_text: STRING is "The media pool identifier does not represent a valid media pool."

    Error_invalid_media_pool_value: INTEGER is 4302

    Error_invalid_media_text: STRING is "The media identifier does not represent a valid medium."

    Error_invalid_media_value: INTEGER is 4300

    Error_invalid_member_text: STRING is "A new member could not be added to a local group because the member has the wrong account type."

    Error_invalid_member_value: INTEGER is 1388

    Error_invalid_menu_handle_text: STRING is "Invalid menu handle."

    Error_invalid_menu_handle_value: INTEGER is 1401

    Error_invalid_message_text: STRING is "The window cannot act on the sent message."

    Error_invalid_message_value: INTEGER is 1002

    Error_invalid_messagedest_text: STRING is "The format of the specified message destination is invalid."

    Error_invalid_messagedest_value: INTEGER is 1218

    Error_invalid_messagename_text: STRING is "The format of the specified message name is invalid."

    Error_invalid_messagename_value: INTEGER is 1217

    Error_invalid_minallocsize_text: STRING is "The operating system cannot run %%1."

    Error_invalid_minallocsize_value: INTEGER is 195

    Error_invalid_moduletype_text: STRING is "The operating system cannot run %%1."

    Error_invalid_moduletype_value: INTEGER is 190

    Error_invalid_monitor_handle_text: STRING is "Invalid monitor handle."

    Error_invalid_monitor_handle_value: INTEGER is 1461

    Error_invalid_msgbox_style_text: STRING is "Invalid message box style."

    Error_invalid_msgbox_style_value: INTEGER is 1438

    Error_invalid_name_text: STRING is "The filename, directory name, or volume label syntax is incorrect."

    Error_invalid_name_value: INTEGER is 123

    Error_invalid_netname_text: STRING is "The format of the specified network name is invalid."

    Error_invalid_netname_value: INTEGER is 1214

    Error_invalid_operation_on_quorum_text: STRING is "This operation cannot be performed on the cluster resource as it the quorum resource. You may not bring the quorum resource offline or modify its possible owners list."

    Error_invalid_operation_on_quorum_value: INTEGER is 5068

    Error_invalid_operation_text: STRING is "The operation identifier is not valid."

    Error_invalid_operation_value: INTEGER is 4317

    Error_invalid_oplock_protocol_text: STRING is "An invalid oplock acknowledgment was received by the system."

    Error_invalid_oplock_protocol_value: INTEGER is 301

    Error_invalid_ordinal_text: STRING is "The operating system cannot run %%1."

    Error_invalid_ordinal_value: INTEGER is 182

    Error_invalid_owner_text: STRING is "This security ID may not be assigned as the owner of this object."

    Error_invalid_owner_value: INTEGER is 1307

    Error_invalid_parameter_text: STRING is "The parameter is incorrect."

    Error_invalid_parameter_value: INTEGER is 87

    Error_invalid_password_text: STRING is "The specified network password is not correct."

    Error_invalid_password_value: INTEGER is 86

    Error_invalid_passwordname_text: STRING is "The format of the specified password is invalid."

    Error_invalid_passwordname_value: INTEGER is 1216

    Error_invalid_pixel_format_text: STRING is "The pixel format is invalid."

    Error_invalid_pixel_format_value: INTEGER is 2000

    Error_invalid_primary_group_text: STRING is "This security ID may not be assigned as the primary group of an object."

    Error_invalid_primary_group_value: INTEGER is 1308

    Error_invalid_print_monitor_text: STRING is "The specified print monitor does not have the required functions."

    Error_invalid_print_monitor_value: INTEGER is 3007

    Error_invalid_printer_command_text: STRING is "The printer command is invalid."

    Error_invalid_printer_command_value: INTEGER is 1803

    Error_invalid_printer_name_text: STRING is "The printer name is invalid."

    Error_invalid_printer_name_value: INTEGER is 1801

    Error_invalid_printer_state_text: STRING is "The state of the printer is invalid."

    Error_invalid_printer_state_value: INTEGER is 1906

    Error_invalid_priority_text: STRING is "The specified priority is invalid."

    Error_invalid_priority_value: INTEGER is 1800

    Error_invalid_profile_text: STRING is "The specified color profile is invalid."

    Error_invalid_profile_value: INTEGER is 2011

    Error_invalid_reparse_data_text: STRING is "The data present in the reparse point buffer is invalid."

    Error_invalid_reparse_data_value: INTEGER is 4392

    Error_invalid_scrollbar_range_text: STRING is "Scroll bar range cannot be greater than MAXLONG."

    Error_invalid_scrollbar_range_value: INTEGER is 1448

    Error_invalid_security_descr_text: STRING is "The security descriptor structure is invalid."

    Error_invalid_security_descr_value: INTEGER is 1338

    Error_invalid_segdpl_text: STRING is "The operating system cannot run %%1."

    Error_invalid_segdpl_value: INTEGER is 198

    Error_invalid_segment_number_text: STRING is "The system detected a segment number that was not correct."

    Error_invalid_segment_number_value: INTEGER is 180

    Error_invalid_separator_file_text: STRING is "The specified separator file is invalid."

    Error_invalid_separator_file_value: INTEGER is 1799

    Error_invalid_server_state_text: STRING is "The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation."

    Error_invalid_server_state_value: INTEGER is 1352

    Error_invalid_service_account_text: STRING is "The account name is invalid or does not exist, or the password is invalid for the account name specified."

    Error_invalid_service_account_value: INTEGER is 1057

    Error_invalid_service_control_text: STRING is "The requested control is not valid for this service."

    Error_invalid_service_control_value: INTEGER is 1052

    Error_invalid_service_lock_text: STRING is "The specified service database lock is invalid."

    Error_invalid_service_lock_value: INTEGER is 1071

    Error_invalid_servicename_text: STRING is "The format of the specified service name is invalid."

    Error_invalid_servicename_value: INTEGER is 1213

    Error_invalid_sharename_text: STRING is "The format of the specified share name is invalid."

    Error_invalid_sharename_value: INTEGER is 1215

    Error_invalid_showwin_command_text: STRING is "Cannot show or remove the window in the way specified."

    Error_invalid_showwin_command_value: INTEGER is 1449

    Error_invalid_sid_text: STRING is "The security ID structure is invalid."

    Error_invalid_sid_value: INTEGER is 1337

    Error_invalid_signal_number_text: STRING is "The signal being posted is not correct."

    Error_invalid_signal_number_value: INTEGER is 209

    Error_invalid_spi_value_text: STRING is "Invalid system-wide (SPI_*) parameter."

    Error_invalid_spi_value_value: INTEGER is 1439

    Error_invalid_stackseg_text: STRING is "The operating system cannot run %%1."

    Error_invalid_stackseg_value: INTEGER is 189

    Error_invalid_starting_codeseg_text: STRING is "The operating system cannot run %%1."

    Error_invalid_starting_codeseg_value: INTEGER is 188

    Error_invalid_state_text: STRING is "The group or resource is not in the correct state to perform the requested operation."

    Error_invalid_state_value: INTEGER is 5023

    Error_invalid_sub_authority_text: STRING is "The subauthority part of a security ID is invalid for this particular use."

    Error_invalid_sub_authority_value: INTEGER is 1335

    Error_invalid_table_text: STRING is "Invalid or unknown table specified."

    Error_invalid_table_value: INTEGER is 1628

    Error_invalid_target_handle_text: STRING is "The target internal file identifier is incorrect."

    Error_invalid_target_handle_value: INTEGER is 114

    Error_invalid_thread_id_text: STRING is "Invalid thread identifier."

    Error_invalid_thread_id_value: INTEGER is 1444

    Error_invalid_time_text: STRING is "The specified time is invalid."

    Error_invalid_time_value: INTEGER is 1901

    Error_invalid_transform_text: STRING is "The specified color transform is invalid."

    Error_invalid_transform_value: INTEGER is 2020

    Error_invalid_user_buffer_text: STRING is "The supplied user buffer is not valid for the requested operation."

    Error_invalid_user_buffer_value: INTEGER is 1784

    Error_invalid_verify_switch_text: STRING is "The verify-on-write switch parameter value is not correct."

    Error_invalid_verify_switch_value: INTEGER is 118

    Error_invalid_window_handle_text: STRING is "Invalid window handle."

    Error_invalid_window_handle_value: INTEGER is 1400

    Error_invalid_window_style_text: STRING is "The window style or class attribute is invalid for this operation."

    Error_invalid_window_style_value: INTEGER is 2002

    Error_invalid_workstation_text: STRING is "Logon failure: user not allowed to log on to this computer."

    Error_invalid_workstation_value: INTEGER is 1329

    Error_io_device_text: STRING is "The request could not be performed because of an I/O device error."

    Error_io_device_value: INTEGER is 1117

    Error_io_incomplete_text: STRING is "Overlapped I/O event is not in a signaled state."

    Error_io_incomplete_value: INTEGER is 996

    Error_io_pending_text: STRING is "Overlapped I/O operation is in progress."

    Error_io_pending_value: INTEGER is 997

    Error_iopl_not_enabled_text: STRING is "The operating system is not presently configured to run this application."

    Error_iopl_not_enabled_value: INTEGER is 197

    Error_irq_busy_text: STRING is "Unable to open a device that was sharing an interrupt request (IRQ) with other devices. At least one other device that uses that IRQ was already opened."

    Error_irq_busy_value: INTEGER is 1119

    Error_is_join_path_text: STRING is "Not enough resources are available to process this command."

    Error_is_join_path_value: INTEGER is 147

    Error_is_join_target_text: STRING is "A JOIN or SUBST command cannot be used for a drive that contains previously joined drives."

    Error_is_join_target_value: INTEGER is 133

    Error_is_joined_text: STRING is "An attempt was made to use a JOIN or SUBST command on a drive that has already been joined."

    Error_is_joined_value: INTEGER is 134

    Error_is_subst_path_text: STRING is "The path specified is being used in a substitute."

    Error_is_subst_path_value: INTEGER is 146

    Error_is_subst_target_text: STRING is "An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous substitute."

    Error_is_subst_target_value: INTEGER is 149

    Error_is_substed_text: STRING is "An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted."

    Error_is_substed_value: INTEGER is 135

    Error_iterated_data_exceeds_64k_text: STRING is "The operating system cannot run %%1."

    Error_iterated_data_exceeds_64k_value: INTEGER is 194

    Error_join_to_join_text: STRING is "The system tried to join a drive to a directory on a joined drive."

    Error_join_to_join_value: INTEGER is 138

    Error_join_to_subst_text: STRING is "The system tried to join a drive to a directory on a substituted drive."

    Error_join_to_subst_value: INTEGER is 140

    Error_journal_delete_in_progress_text: STRING is "The volume change journal is being deleted."

    Error_journal_delete_in_progress_value: INTEGER is 1178

    Error_journal_entry_deleted_text: STRING is "The journal entry has been deleted from the journal."

    Error_journal_entry_deleted_value: INTEGER is 1181

    Error_journal_hook_set_text: STRING is "The journal hook procedure is already installed."

    Error_journal_hook_set_value: INTEGER is 1430

    Error_journal_not_active_text: STRING is "The volume change journal service is not active."

    Error_journal_not_active_value: INTEGER is 1179

    Error_key_deleted_text: STRING is "Illegal operation attempted on a registry key that has been marked for deletion."

    Error_key_deleted_value: INTEGER is 1018

    Error_key_has_children_text: STRING is "Cannot create a symbolic link in a registry key that already has subkeys or values."

    Error_key_has_children_value: INTEGER is 1020

    Error_label_too_long_text: STRING is "The volume label you entered exceeds the label character  limit of the target file system."

    Error_label_too_long_value: INTEGER is 154

    Error_last_admin_text: STRING is "The last remaining administration account cannot be disabled or deleted."

    Error_last_admin_value: INTEGER is 1322

    Error_lb_without_tabstops_text: STRING is "This list box does not support tab stops."

    Error_lb_without_tabstops_value: INTEGER is 1434

    Error_library_full_text: STRING is "Library is full.  No slot is available for use."

    Error_library_full_value: INTEGER is 4322

    Error_library_offline_text: STRING is "The operation cannot be performed on an offline library."

    Error_library_offline_value: INTEGER is 4305

    Error_license_quota_exceeded_text: STRING is "The service being accessed is licensed for a particular number of connections.  No more connections can be made to the service at this time because there are already as many connections as the service can accept."

    Error_license_quota_exceeded_value: INTEGER is 1395

    Error_listbox_id_not_found_text: STRING is "The list box identifier was not found."

    Error_listbox_id_not_found_value: INTEGER is 1416

    Error_lm_cross_encryption_required_text: STRING is "A cross-encrypted password is necessary to change this user password."

    Error_lm_cross_encryption_required_value: INTEGER is 1390

    Error_local_user_session_key_text: STRING is "No encryption key is available. A well-known encryption key was returned."

    Error_local_user_session_key_value: INTEGER is 1303

    Error_lock_failed_text: STRING is "Unable to lock a region of a file."

    Error_lock_failed_value: INTEGER is 167

    Error_lock_violation_text: STRING is "The process cannot access the file because another process has locked a portion of the file."

    Error_lock_violation_value: INTEGER is 33

    Error_locked_text: STRING is "The segment is locked and cannot be reallocated."

    Error_locked_value: INTEGER is 212

    Error_log_file_full_text: STRING is "The event log file is full."

    Error_log_file_full_value: INTEGER is 1502

    Error_login_time_restriction_text: STRING is "Attempting to log in during an unauthorized time of day for this account."

    Error_login_time_restriction_value: INTEGER is 1239

    Error_login_wksta_restriction_text: STRING is "The account is not authorized to log in from this station."

    Error_login_wksta_restriction_value: INTEGER is 1240

    Error_logon_failure_text: STRING is "Logon failure: unknown user name or bad password."

    Error_logon_failure_value: INTEGER is 1326

    Error_logon_not_granted_text: STRING is "Logon failure: the user has not been granted the requested logon type at this computer."

    Error_logon_not_granted_value: INTEGER is 1380

    Error_logon_session_collision_text: STRING is "The logon session ID is already in use."

    Error_logon_session_collision_value: INTEGER is 1366

    Error_logon_session_exists_text: STRING is "Cannot start a new logon session with an ID that is already in use."

    Error_logon_session_exists_value: INTEGER is 1363

    Error_logon_type_not_granted_text: STRING is "Logon failure: the user has not been granted the requested logon type at this computer."

    Error_logon_type_not_granted_value: INTEGER is 1385

    Error_luids_exhausted_text: STRING is "No more local user identifiers (LUIDs) are available."

    Error_luids_exhausted_value: INTEGER is 1334

    Error_magazine_not_present_text: STRING is "The indicated element is part of a magazine that is not present."

    Error_magazine_not_present_value: INTEGER is 1163

    Error_mapped_alignment_text: STRING is "The base address or the file offset specified does not have the proper alignment."

    Error_mapped_alignment_value: INTEGER is 1132

    Error_max_thrds_reached_text: STRING is "No more threads can be created in the system."

    Error_max_thrds_reached_value: INTEGER is 164

    Error_media_changed_text: STRING is "The media in the drive may have changed."

    Error_media_changed_value: INTEGER is 1110

    Error_media_incompatible_text: STRING is "The medium is not compatible with the device or media pool."

    Error_media_incompatible_value: INTEGER is 4315

    Error_media_not_available_text: STRING is "The media is not mounted or ready for use."

    Error_media_not_available_value: INTEGER is 4318

    Error_media_offline_text: STRING is "The medium currently exists in an offline library and must be online to perform this operation."

    Error_media_offline_value: INTEGER is 4304

    Error_media_unavailable_text: STRING is "No media is currently available in this media pool or library."

    Error_media_unavailable_value: INTEGER is 4308

    Error_medium_not_accessible_text: STRING is "The transport cannot access the medium."

    Error_medium_not_accessible_value: INTEGER is 4323

    Error_member_in_alias_text: STRING is "The specified account name is already a member of the local group."

    Error_member_in_alias_value: INTEGER is 1378

    Error_member_in_group_text: STRING is "Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member."

    Error_member_in_group_value: INTEGER is 1320

    Error_member_not_in_alias_text: STRING is "The specified account name is not a member of the local group."

    Error_member_not_in_alias_value: INTEGER is 1377

    Error_member_not_in_group_text: STRING is "The specified user account is not a member of the specified group account."

    Error_member_not_in_group_value: INTEGER is 1321

    Error_members_primary_group_text: STRING is "The user cannot be removed from a group because the group is currently the user's primary group."

    Error_members_primary_group_value: INTEGER is 1374

    Error_menu_item_not_found_text: STRING is "A menu item was not found."

    Error_menu_item_not_found_value: INTEGER is 1456

    Error_message_exceeds_max_size_text: STRING is "The message provided exceeds the maximum size allowed for this parameter."

    Error_message_exceeds_max_size_value: INTEGER is 4336

    Error_message_sync_only_text: STRING is "The message can be used only with synchronous operations."

    Error_message_sync_only_value: INTEGER is 1159

    error_messages: HASH_TABLE [STRING, INTEGER]
            -- Error messages.

    Error_meta_expansion_too_long_text: STRING is "The global filename characters, * or ?, are entered incorrectly or too many global filename characters are specified."

    Error_meta_expansion_too_long_value: INTEGER is 208

    Error_metafile_not_supported_text: STRING is "The requested metafile operation is not supported."

    Error_metafile_not_supported_value: INTEGER is 2003

    Error_mod_not_found_text: STRING is "The specified module could not be found."

    Error_mod_not_found_value: INTEGER is 126

    Error_more_data_text: STRING is "More data is available."

    Error_more_data_value: INTEGER is 234

    Error_more_writes_text: STRING is "A serial I/O operation was completed by another write to the serial port.  (The IOCTL_SERIAL_XOFF_COUNTER reached zero.)"

    Error_more_writes_value: INTEGER is 1120

    Error_mr_mid_not_found_text: STRING is "The system cannot find message text for message number 0x%%1 in the message file for %%2."

    Error_mr_mid_not_found_value: INTEGER is 317

    Error_mutual_auth_failed_text: STRING is "Mutual Authentication failed. The server's password is out of date at the domain controller."

    Error_mutual_auth_failed_value: INTEGER is 1397

    Error_negative_seek_text: STRING is "An attempt was made to move the file pointer before the beginning of the file."

    Error_negative_seek_value: INTEGER is 131

    Error_nesting_not_allowed_text: STRING is "Cannot nest calls to LoadModule."

    Error_nesting_not_allowed_value: INTEGER is 215

    Error_net_write_fault_text: STRING is "A write fault occurred on the network."

    Error_net_write_fault_value: INTEGER is 88

    Error_netlogon_not_started_text: STRING is "An attempt was made to logon, but the network logon service was not started."

    Error_netlogon_not_started_value: INTEGER is 1792

    Error_netname_deleted_text: STRING is "The specified network name is no longer available."

    Error_netname_deleted_value: INTEGER is 64

    Error_network_access_denied_text: STRING is "Network access is denied."

    Error_network_access_denied_value: INTEGER is 65

    Error_network_busy_text: STRING is "The network is busy."

    Error_network_busy_value: INTEGER is 54

    Error_network_not_available_text: STRING is "A cluster network is not available for this operation."

    Error_network_not_available_value: INTEGER is 5035

    Error_network_unreachable_text: STRING is "The network location cannot be reached. For information about network troubleshooting, see Windows Help."

    Error_network_unreachable_value: INTEGER is 1231

    Error_no_association_text: STRING is "No application is associated with the specified file for this operation."

    Error_no_association_value: INTEGER is 1155

    Error_no_browser_servers_found_text: STRING is "The list of servers for this workgroup is not currently available"

    Error_no_browser_servers_found_value: INTEGER is 6118

    Error_no_data_detected_text: STRING is "No more data is on the tape."

    Error_no_data_detected_value: INTEGER is 1104

    Error_no_data_text: STRING is "The pipe is being closed."

    Error_no_data_value: INTEGER is 232

    Error_no_efs_text: STRING is "The required encryption driver is not loaded for this system."

    Error_no_efs_value: INTEGER is 6004

    Error_no_impersonation_token_text: STRING is "An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client."

    Error_no_impersonation_token_value: INTEGER is 1309

    Error_no_inheritance_text: STRING is "Indicates an ACL contains no inheritable components."

    Error_no_inheritance_value: INTEGER is 1391

    Error_no_log_space_text: STRING is "System could not allocate the required space in a registry log."

    Error_no_log_space_value: INTEGER is 1019

    Error_no_logon_servers_text: STRING is "There are currently no logon servers available to service the logon request."

    Error_no_logon_servers_value: INTEGER is 1311

    Error_no_match_text: STRING is "There was no match for the specified key in the index."

    Error_no_match_value: INTEGER is 1169

    Error_no_media_in_drive_text: STRING is "No media in drive."

    Error_no_media_in_drive_value: INTEGER is 1112

    Error_no_more_devices_text: STRING is "No more local devices."

    Error_no_more_devices_value: INTEGER is 1248

    Error_no_more_files_text: STRING is "There are no more files."

    Error_no_more_files_value: INTEGER is 18

    Error_no_more_items_text: STRING is "No more data is available."

    Error_no_more_items_value: INTEGER is 259

    Error_no_more_search_handles_text: STRING is "No more internal file identifiers available."

    Error_no_more_search_handles_value: INTEGER is 113

    Error_no_more_user_handles_text: STRING is "The current process has used all of its system allowance of handles for Window Manager objects."

    Error_no_more_user_handles_value: INTEGER is 1158

    Error_no_net_or_bad_path_text: STRING is "No network provider accepted the given network path."

    Error_no_net_or_bad_path_value: INTEGER is 1203

    Error_no_network_text: STRING is "The network is not present or not started."

    Error_no_network_value: INTEGER is 1222

    Error_no_proc_slots_text: STRING is "The system cannot start another process at this time."

    Error_no_proc_slots_value: INTEGER is 89

    Error_no_promotion_active_text: STRING is "A domain controller promotion is not currently active"

    Error_no_promotion_active_value: INTEGER is 8222

    Error_no_quotas_for_account_text: STRING is "No system quota limits are specifically set for this account."

    Error_no_quotas_for_account_value: INTEGER is 1302

    Error_no_recovery_policy_text: STRING is "There is no valid encryption recovery policy configured for this system."

    Error_no_recovery_policy_value: INTEGER is 6003

    Error_no_recovery_program_text: STRING is "No recovery program has been configured for this service."

    Error_no_recovery_program_value: INTEGER is 1082

    Error_no_scrollbars_text: STRING is "The window does not have scroll bars."

    Error_no_scrollbars_value: INTEGER is 1447

    Error_no_security_on_object_text: STRING is "Unable to perform a security operation on an object that has no associated security."

    Error_no_security_on_object_value: INTEGER is 1350

    Error_no_shutdown_in_progress_text: STRING is "Unable to abort the system shutdown because no shutdown was in progress."

    Error_no_shutdown_in_progress_value: INTEGER is 1116

    Error_no_signal_sent_text: STRING is "No process in the command subtree has a  signal handler."

    Error_no_signal_sent_value: INTEGER is 205

    Error_no_sitename_text: STRING is "No site name is available for this machine."

    Error_no_sitename_value: INTEGER is 1919

    Error_no_spool_space_text: STRING is "Space to store the file waiting to be printed is not available on the server."

    Error_no_spool_space_value: INTEGER is 62

    Error_no_such_alias_text: STRING is "The specified local group does not exist."

    Error_no_such_alias_value: INTEGER is 1376

    Error_no_such_domain_text: STRING is "The specified domain either does not exist or could not be contacted."

    Error_no_such_domain_value: INTEGER is 1355

    Error_no_such_group_text: STRING is "The specified group does not exist."

    Error_no_such_group_value: INTEGER is 1319

    Error_no_such_logon_session_text: STRING is "A specified logon session does not exist. It may already have been terminated."

    Error_no_such_logon_session_value: INTEGER is 1312

    Error_no_such_member_text: STRING is "A member could not be added to or removed from the local group because the member does not exist."

    Error_no_such_member_value: INTEGER is 1387

    Error_no_such_package_text: STRING is "A specified authentication package is unknown."

    Error_no_such_package_value: INTEGER is 1364

    Error_no_such_privilege_text: STRING is "A specified privilege does not exist."

    Error_no_such_privilege_value: INTEGER is 1313

    Error_no_such_site_text: STRING is "The specified site does not exist."

    Error_no_such_site_value: INTEGER is 1249

    Error_no_such_user_text: STRING is "The specified user does not exist."

    Error_no_such_user_value: INTEGER is 1317

    Error_no_supporting_drives_text: STRING is "This offline media cannot be mounted on this system since no enabled drives are present which can be used."

    Error_no_supporting_drives_value: INTEGER is 4339

    Error_no_system_menu_text: STRING is "The window does not have a system menu."

    Error_no_system_menu_value: INTEGER is 1437

    Error_no_system_resources_text: STRING is "Insufficient system resources exist to complete the requested service."

    Error_no_system_resources_value: INTEGER is 1450

    Error_no_token_text: STRING is "An attempt was made to reference a token that does not exist."

    Error_no_token_value: INTEGER is 1008

    Error_no_tracking_service_text: STRING is "The tracking (workstation) service is not running."

    Error_no_tracking_service_value: INTEGER is 1172

    Error_no_trust_lsa_secret_text: STRING is "The workstation does not have a trust secret."

    Error_no_trust_lsa_secret_value: INTEGER is 1786

    Error_no_trust_sam_account_text: STRING is "The security database on the server does not have a computer account for this workstation trust relationship."

    Error_no_trust_sam_account_value: INTEGER is 1787

    Error_no_unicode_translation_text: STRING is "No mapping for the Unicode character exists in the target multi-byte code page."

    Error_no_unicode_translation_value: INTEGER is 1113

    Error_no_user_keys_text: STRING is "There are no EFS keys defined for the user."

    Error_no_user_keys_value: INTEGER is 6006

    Error_no_user_session_key_text: STRING is "There is no user session key for the specified logon session."

    Error_no_user_session_key_value: INTEGER is 1394

    Error_no_volume_id_text: STRING is "The Volume ID could not be found."

    Error_no_volume_id_value: INTEGER is 1173

    Error_no_volume_label_text: STRING is "The disk has no volume label."

    Error_no_volume_label_value: INTEGER is 125

    Error_no_wildcard_characters_text: STRING is "No wildcards were found."

    Error_no_wildcard_characters_value: INTEGER is 1417

    Error_noaccess_text: STRING is "Invalid access to memory location."

    Error_noaccess_value: INTEGER is 998

    Error_node_cant_host_resource_text: STRING is "The cluster resource cannot be brought online. The owner node cannot run this resource."

    Error_node_cant_host_resource_value: INTEGER is 5071

    Error_node_not_available_text: STRING is "A cluster node is not available for this operation."

    Error_node_not_available_value: INTEGER is 5036

    Error_nologon_interdomain_trust_account_text: STRING is "The account used is an interdomain trust account. Use your global user account or local user account to access this server."

    Error_nologon_interdomain_trust_account_value: INTEGER is 1807

    Error_nologon_server_trust_account_text: STRING is "The account used is a server trust account. Use your global user account or local user account to access this server."

    Error_nologon_server_trust_account_value: INTEGER is 1809

    Error_nologon_workstation_trust_account_text: STRING is "The account used is a computer account. Use your global user account or local user account to access this server."

    Error_nologon_workstation_trust_account_value: INTEGER is 1808

    Error_non_mdichild_window_text: STRING is "Cannot process a message from a window that is not a multiple document interface (MDI) window."

    Error_non_mdichild_window_value: INTEGER is 1445

    Error_none_mapped_text: STRING is "No mapping between account names and security IDs was done."

    Error_none_mapped_value: INTEGER is 1332

    Error_nonpaged_system_resources_text: STRING is "Insufficient system resources exist to complete the requested service."

    Error_nonpaged_system_resources_value: INTEGER is 1451

    Error_not_a_reparse_point_text: STRING is "The file or directory is not a reparse point."

    Error_not_a_reparse_point_value: INTEGER is 4390

    Error_not_all_assigned_text: STRING is "Not all privileges referenced are assigned to the caller."

    Error_not_all_assigned_value: INTEGER is 1300

    Error_not_authenticated_text: STRING is "The operation being requested was not performed because the user has not been authenticated."

    Error_not_authenticated_value: INTEGER is 1244

    Error_not_child_window_text: STRING is "The window is not a child window."

    Error_not_child_window_value: INTEGER is 1442

    Error_not_connected_text: STRING is "This network connection does not exist."

    Error_not_connected_value: INTEGER is 2250

    Error_not_container_text: STRING is "Cannot enumerate a noncontainer."

    Error_not_container_value: INTEGER is 1207

    Error_not_dos_disk_text: STRING is "The specified disk or diskette cannot be accessed."

    Error_not_dos_disk_value: INTEGER is 26

    Error_not_empty_text: STRING is "The library, drive, or media pool must be empty to perform this operation."

    Error_not_empty_value: INTEGER is 4307

    Error_not_enough_memory_text: STRING is "Not enough storage is available to process this command."

    Error_not_enough_memory_value: INTEGER is 8

    Error_not_enough_quota_text: STRING is "Not enough quota is available to process this command."

    Error_not_enough_quota_value: INTEGER is 1816

    Error_not_enough_server_memory_text: STRING is "Not enough server storage is available to process this command."

    Error_not_enough_server_memory_value: INTEGER is 1130

    Error_not_export_format_text: STRING is "The specified file is not in the defined EFS export format."

    Error_not_export_format_value: INTEGER is 6008

    Error_not_found_text: STRING is "Element not found."

    Error_not_found_value: INTEGER is 1168

    Error_not_joined_text: STRING is "The system tried to delete the JOIN of a drive that is not joined."

    Error_not_joined_value: INTEGER is 136

    Error_not_locked_text: STRING is "The segment is already unlocked."

    Error_not_locked_value: INTEGER is 158

    Error_not_logged_on_text: STRING is "The operation being requested was not performed because the user has not logged on to the network.  The specified service does not exist."

    Error_not_logged_on_value: INTEGER is 1245

    Error_not_logon_process_text: STRING is "The requested action is restricted for use by logon processes only. The calling process has not registered as a logon process."

    Error_not_logon_process_value: INTEGER is 1362

    Error_not_owner_text: STRING is "Attempt to release mutex not owned by caller."

    Error_not_owner_value: INTEGER is 288

    Error_not_quorum_capable_text: STRING is "The cluster could not make the specified resource a quorum resource because it is not capable of being a quorum resource."

    Error_not_quorum_capable_value: INTEGER is 5021

    Error_not_quorum_class_text: STRING is "The cluster could not make the specified resource a quorum resource because it does not belong to a shared storage class."

    Error_not_quorum_class_value: INTEGER is 5025

    Error_not_ready_text: STRING is "The device is not ready."

    Error_not_ready_value: INTEGER is 21

    Error_not_registry_file_text: STRING is "The system has attempted to load or restore a file into the registry, but the specified file is not in a registry file format."

    Error_not_registry_file_value: INTEGER is 1017

    Error_not_same_device_text: STRING is "The system cannot move the file to a different disk drive."

    Error_not_same_device_value: INTEGER is 17

    Error_not_substed_text: STRING is "The system tried to delete the substitution of a drive that is not substituted."

    Error_not_substed_value: INTEGER is 137

    Error_not_supported_on_sbs_text: STRING is "This operation is not supported on a Microsoft Small Business Server"

    Error_not_supported_on_sbs_value: INTEGER is 1254

    Error_not_supported_text: STRING is "The network request is not supported."

    Error_not_supported_value: INTEGER is 50

    Error_notify_enum_dir_text: STRING is "A notify change request is being completed and the information is not being returned in the caller's buffer. The caller now needs to enumerate the files to find the changes."

    Error_notify_enum_dir_value: INTEGER is 1022

    Error_nt_cross_encryption_required_text: STRING is "A cross-encrypted password is necessary to change a user password."

    Error_nt_cross_encryption_required_value: INTEGER is 1386

    Error_null_lm_password_text: STRING is "The password is too complex to be converted to a LAN Manager password. The LAN Manager password returned is a NULL string."

    Error_null_lm_password_value: INTEGER is 1304

    Error_object_already_exists_text: STRING is "The object already exists."

    Error_object_already_exists_value: INTEGER is 5010

    Error_object_in_list_text: STRING is "The object is already in the list."

    Error_object_in_list_value: INTEGER is 5011

    Error_object_not_found_text: STRING is "The object identifier does not represent a valid object."

    Error_object_not_found_value: INTEGER is 4312

    Error_old_win_version_text: STRING is "The specified program requires a newer version of Windows."

    Error_old_win_version_value: INTEGER is 1150

    Error_only_if_connected_text: STRING is "This operation is supported only when you are connected to the server."

    Error_only_if_connected_value: INTEGER is 1251

    Error_open_failed_text: STRING is "The system cannot open the  device or file specified."

    Error_open_failed_value: INTEGER is 110

    Error_open_files_text: STRING is "This network connection has files open or requests pending."

    Error_open_files_value: INTEGER is 2401

    Error_operation_aborted_text: STRING is "The I/O operation has been aborted because of either a thread exit or an application request."

    Error_operation_aborted_value: INTEGER is 995

    Error_oplock_not_granted_text: STRING is "The oplock request is denied."

    Error_oplock_not_granted_value: INTEGER is 300

    Error_out_of_paper_text: STRING is "The printer is out of paper."

    Error_out_of_paper_value: INTEGER is 28

    Error_out_of_structures_text: STRING is "Storage to process this request is not available."

    Error_out_of_structures_value: INTEGER is 84

    Error_outofmemory_text: STRING is "Not enough storage is available to complete this operation."

    Error_outofmemory_value: INTEGER is 14

    Error_override_nochanges_text: STRING is "The group policy framework should call the extension even if there are no changes."

    Error_override_nochanges_value: INTEGER is 1252

    Error_paged_system_resources_text: STRING is "Insufficient system resources exist to complete the requested service."

    Error_paged_system_resources_value: INTEGER is 1452

    Error_pagefile_quota_text: STRING is "Insufficient quota to complete the requested service."

    Error_pagefile_quota_value: INTEGER is 1454

    Error_partial_copy_text: STRING is "Only part of a ReadProcessMemory or WriteProcessMemory request was completed."

    Error_partial_copy_value: INTEGER is 299

    Error_partition_failure_text: STRING is "Tape could not be partitioned."

    Error_partition_failure_value: INTEGER is 1105

    Error_password_expired_text: STRING is "Logon failure: the specified account password has expired."

    Error_password_expired_value: INTEGER is 1330

    Error_password_must_change_text: STRING is "The user's password must be changed before logging on the first time."

    Error_password_must_change_value: INTEGER is 1907

    Error_password_restriction_text: STRING is "Unable to update the password. The value provided for the new password does not meet the length, complexity, or history requirement of the domain."

    Error_password_restriction_value: INTEGER is 1325

    Error_patch_package_invalid_text: STRING is "This patch package could not be opened.  Contact the application vendor to verify that this is a valid Windows Installer patch package."

    Error_patch_package_invalid_value: INTEGER is 1636

    Error_patch_package_open_failed_text: STRING is "This patch package could not be opened.  Verify that the patch package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer patch package."

    Error_patch_package_open_failed_value: INTEGER is 1635

    Error_patch_package_unsupported_text: STRING is "This patch package cannot be processed by the Windows Installer service.  You must install a Windows service pack that contains a newer version of the Windows Installer service."

    Error_patch_package_unsupported_value: INTEGER is 1637

    Error_patch_target_not_found_text: STRING is "The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch."

    Error_patch_target_not_found_value: INTEGER is 1642

    Error_path_busy_text: STRING is "The path specified cannot be used at this time."

    Error_path_busy_value: INTEGER is 148

    Error_path_not_found_text: STRING is "The system cannot find the path specified."

    Error_path_not_found_value: INTEGER is 3

    Error_pipe_busy_text: STRING is "All pipe instances are busy."

    Error_pipe_busy_value: INTEGER is 231

    Error_pipe_connected_text: STRING is "There is a process on other end of the pipe."

    Error_pipe_connected_value: INTEGER is 535

    Error_pipe_listening_text: STRING is "Waiting for a process to open the other end of the pipe."

    Error_pipe_listening_value: INTEGER is 536

    Error_pipe_not_connected_text: STRING is "No process is on the other end of the pipe."

    Error_pipe_not_connected_value: INTEGER is 233

    Error_point_not_found_text: STRING is "The point passed to GetMouseMovePoints is not in the buffer."

    Error_point_not_found_value: INTEGER is 1171

    Error_policy_object_not_found_text: STRING is "The policy object does not exist."

    Error_policy_object_not_found_value: INTEGER is 8219

    Error_policy_only_in_ds_text: STRING is "The requested policy information is only in the directory service."

    Error_policy_only_in_ds_value: INTEGER is 8220

    Error_popup_already_active_text: STRING is "Popup menu already active."

    Error_popup_already_active_value: INTEGER is 1446

    Error_port_unreachable_text: STRING is "No service is operating at the destination network endpoint on the remote system."

    Error_port_unreachable_value: INTEGER is 1234

    Error_possible_deadlock_text: STRING is "A potential deadlock condition has been detected."

    Error_possible_deadlock_value: INTEGER is 1131

    Error_potential_file_found_text: STRING is "A file was found, but it may not be the correct file."

    Error_potential_file_found_value: INTEGER is 1180

    Error_print_cancelled_text: STRING is "Your file waiting to be printed was deleted."

    Error_print_cancelled_value: INTEGER is 63

    Error_print_monitor_already_installed_text: STRING is "The specified print monitor has already been installed."

    Error_print_monitor_already_installed_value: INTEGER is 3006

    Error_print_monitor_in_use_text: STRING is "The specified print monitor is currently in use."

    Error_print_monitor_in_use_value: INTEGER is 3008

    Error_print_processor_already_installed_text: STRING is "The specified print processor has already been installed."

    Error_print_processor_already_installed_value: INTEGER is 3005

    Error_printer_already_exists_text: STRING is "The printer already exists."

    Error_printer_already_exists_value: INTEGER is 1802

    Error_printer_deleted_text: STRING is "The specified printer has been deleted."

    Error_printer_deleted_value: INTEGER is 1905

    Error_printer_driver_already_installed_text: STRING is "The specified printer driver is already installed."

    Error_printer_driver_already_installed_value: INTEGER is 1795

    Error_printer_driver_in_use_text: STRING is "The specified printer driver is currently in use."

    Error_printer_driver_in_use_value: INTEGER is 3001

    Error_printer_has_jobs_queued_text: STRING is "The requested operation is not allowed when there are jobs queued to the printer."

    Error_printer_has_jobs_queued_value: INTEGER is 3009

    Error_printer_not_found_text: STRING is "No printers were found."

    Error_printer_not_found_value: INTEGER is 3012

    Error_printq_full_text: STRING is "The printer queue is full."

    Error_printq_full_value: INTEGER is 61

    Error_private_dialog_index_text: STRING is "Using private DIALOG window words."

    Error_private_dialog_index_value: INTEGER is 1415

    Error_privilege_not_held_text: STRING is "A required privilege is not held by the client."

    Error_privilege_not_held_value: INTEGER is 1314

    Error_proc_not_found_text: STRING is "The specified procedure could not be found."

    Error_proc_not_found_value: INTEGER is 127

    Error_process_aborted_text: STRING is "The process terminated unexpectedly."

    Error_process_aborted_value: INTEGER is 1067

    Error_product_uninstalled_text: STRING is "Product is uninstalled."

    Error_product_uninstalled_value: INTEGER is 1614

    Error_product_version_text: STRING is "Another version of this product is already installed.  Installation of this version cannot continue.  To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel."

    Error_product_version_value: INTEGER is 1638

    Error_profile_not_associated_with_device_text: STRING is "The specified color profile is not associated with any device."

    Error_profile_not_associated_with_device_value: INTEGER is 2015

    Error_profile_not_found_text: STRING is "The specified color profile was not found."

    Error_profile_not_found_value: INTEGER is 2016

    Error_promotion_active_text: STRING is "A domain controller promotion is currently active."

    Error_promotion_active_value: INTEGER is 8221

    Error_protocol_unreachable_text: STRING is "The network location cannot be reached. For information about network troubleshooting, see Windows Help."

    Error_protocol_unreachable_value: INTEGER is 1233

    Error_quorum_disk_not_found_text: STRING is "The quorum disk could not be located by the cluster service."

    Error_quorum_disk_not_found_value: INTEGER is 5086

    Error_quorum_owner_alive_text: STRING is "The cluster node failed to take control of the quorum resource because the resource is owned by another active node."

    Error_quorum_owner_alive_value: INTEGER is 5034

    Error_quorum_resource_online_failed_text: STRING is "The quorum resource failed to come online."

    Error_quorum_resource_online_failed_value: INTEGER is 5027

    Error_quorum_resource_text: STRING is "The cluster resource could not be deleted or brought offline because it is the quorum resource."

    Error_quorum_resource_value: INTEGER is 5020

    Error_quorumlog_open_failed_text: STRING is "The quorum log could not be created or mounted successfully."

    Error_quorumlog_open_failed_value: INTEGER is 5028

    Error_read_fault_text: STRING is "The system cannot read from the specified device."

    Error_read_fault_value: INTEGER is 30

    Error_rec_non_existent_text: STRING is "The name does not exist in the WINS database."

    Error_rec_non_existent_value: INTEGER is 4005

    Error_redir_paused_text: STRING is "The specified printer or disk device has been paused."

    Error_redir_paused_value: INTEGER is 72

    Error_redirector_has_open_handles_text: STRING is "The redirector is in use and cannot be unloaded."

    Error_redirector_has_open_handles_value: INTEGER is 1794

    Error_registry_corrupt_text: STRING is "The registry is corrupted. The structure of one of the files containing registry data is corrupted, or the system's memory image of the file is corrupted, or the file could not be recovered because the alternate copy or log was absent or corrupted."

    Error_registry_corrupt_value: INTEGER is 1015

    Error_registry_io_failed_text: STRING is "An I/O operation initiated by the registry failed unrecoverably. The registry could not read in, or write out, or flush, one of the files that contain the system's image of the registry."

    Error_registry_io_failed_value: INTEGER is 1016

    Error_registry_recovered_text: STRING is "One of the files in the registry database had to be recovered by use of a log or alternate copy. The recovery was successful."

    Error_registry_recovered_value: INTEGER is 1014

    Error_reloc_chain_xeeds_seglim_text: STRING is "The operating system cannot run %%1."

    Error_reloc_chain_xeeds_seglim_value: INTEGER is 201

    Error_rem_not_list_text: STRING is "The remote computer is not available."

    Error_rem_not_list_value: INTEGER is 51

    Error_remote_session_limit_exceeded_text: STRING is "An attempt was made to establish a session to a network server, but there are already too many sessions established to that server."

    Error_remote_session_limit_exceeded_value: INTEGER is 1220

    Error_remote_storage_media_error_text: STRING is "The remote storage service encountered a media error."

    Error_remote_storage_media_error_value: INTEGER is 4352

    Error_remote_storage_not_active_text: STRING is "The remote storage service is not operational at this time."

    Error_remote_storage_not_active_value: INTEGER is 4351

    Error_reparse_attribute_conflict_text: STRING is "The reparse point attribute cannot be set because it conflicts with an existing attribute."

    Error_reparse_attribute_conflict_value: INTEGER is 4391

    Error_reparse_tag_invalid_text: STRING is "The tag present in the reparse point buffer is invalid."

    Error_reparse_tag_invalid_value: INTEGER is 4393

    Error_reparse_tag_mismatch_text: STRING is "There is a mismatch between the tag specified in the request and the tag present in the reparse point."

    Error_reparse_tag_mismatch_value: INTEGER is 4394

    Error_req_not_accep_text: STRING is "No more connections can be made to this remote computer at this time because there are already as many connections as the computer can accept."

    Error_req_not_accep_value: INTEGER is 71

    Error_request_aborted_text: STRING is "The request was aborted."

    Error_request_aborted_value: INTEGER is 1235

    Error_request_refused_text: STRING is "The operator or administrator has refused the request."

    Error_request_refused_value: INTEGER is 4320

    Error_requires_interactive_windowstation_text: STRING is "This operation requires an interactive window station."

    Error_requires_interactive_windowstation_value: INTEGER is 1459

    Error_resmon_create_failed_text: STRING is "The cluster resource could not be created in the specified resource monitor."

    Error_resmon_create_failed_value: INTEGER is 5017

    Error_resmon_invalid_state_text: STRING is "The resource monitor will not allow the fail operation to be performed while the resource is in its current state. This may happen if the resource is in a pending state."

    Error_resmon_invalid_state_value: INTEGER is 5084

    Error_resmon_online_failed_text: STRING is "The cluster resource could not be brought online by the resource monitor."

    Error_resmon_online_failed_value: INTEGER is 5018

    Error_resource_data_not_found_text: STRING is "The specified image file did not contain a resource section."

    Error_resource_data_not_found_value: INTEGER is 1812

    Error_resource_disabled_text: STRING is "A resource required for this operation is disabled."

    Error_resource_disabled_value: INTEGER is 4309

    Error_resource_failed_text: STRING is "A cluster resource failed."

    Error_resource_failed_value: INTEGER is 5038

    Error_resource_lang_not_found_text: STRING is "The specified resource language ID cannot be found in the image file."

    Error_resource_lang_not_found_value: INTEGER is 1815

    Error_resource_name_not_found_text: STRING is "The specified resource name cannot be found in the image file."

    Error_resource_name_not_found_value: INTEGER is 1814

    Error_resource_not_available_text: STRING is "The cluster resource is not available."

    Error_resource_not_available_value: INTEGER is 5006

    Error_resource_not_found_text: STRING is "The cluster resource could not be found."

    Error_resource_not_found_value: INTEGER is 5007

    Error_resource_not_online_text: STRING is "The cluster resource is not online."

    Error_resource_not_online_value: INTEGER is 5004

    Error_resource_not_present_text: STRING is "The resource required for this operation does not exist."

    Error_resource_not_present_value: INTEGER is 4316

    Error_resource_online_text: STRING is "The operation could not be completed because the cluster resource is online."

    Error_resource_online_value: INTEGER is 5019

    Error_resource_properties_stored_text: STRING is "The properties were stored but not all changes will take effect until the next time the resource is brought online."

    Error_resource_properties_stored_value: INTEGER is 5024

    Error_resource_property_unchangeable_text: STRING is "An attempt to modify a resource property failed because it conflicts with another existing property."

    Error_resource_property_unchangeable_value: INTEGER is 5089

    Error_resource_type_not_found_text: STRING is "The specified resource type cannot be found in the image file."

    Error_resource_type_not_found_value: INTEGER is 1813

    Error_retry_text: STRING is "The operation could not be completed. A retry should be performed."

    Error_retry_value: INTEGER is 1237

    Error_revision_mismatch_text: STRING is "Indicates two revision levels are incompatible."

    Error_revision_mismatch_value: INTEGER is 1306

    Error_ring2_stack_in_use_text: STRING is "The ring 2 stack is in use."

    Error_ring2_stack_in_use_value: INTEGER is 207

    Error_ring2seg_must_be_movable_text: STRING is "The code segment cannot be greater than or equal to 64K."

    Error_ring2seg_must_be_movable_value: INTEGER is 200

    Error_rmode_app_text: STRING is "The specified program was written for an earlier version of Windows."

    Error_rmode_app_value: INTEGER is 1153

    Error_rpl_not_allowed_text: STRING is "Replication with a nonconfigured partner is not allowed."

    Error_rpl_not_allowed_value: INTEGER is 4006

    Error_rxact_commit_failure_text: STRING is "An internal security database corruption has been encountered."

    Error_rxact_commit_failure_value: INTEGER is 1370

    Error_rxact_invalid_state_text: STRING is "The transaction state of a registry subtree is incompatible with the requested operation."

    Error_rxact_invalid_state_value: INTEGER is 1369

    Error_sam_init_failure_text: STRING is "Security Accounts Manager initialization failed because of the following error: %%1.  Error Status: 0x%%2. Click OK to shut down the system and reboot into Safe Mode. Check the event log for detailed information."

    Error_sam_init_failure_value: INTEGER is 8541

    Error_same_drive_text: STRING is "The system cannot join or substitute a drive to or for a directory on the same drive."

    Error_same_drive_value: INTEGER is 143

    Error_screen_already_locked_text: STRING is "Screen already locked."

    Error_screen_already_locked_value: INTEGER is 1440

    Error_secret_too_long_text: STRING is "The length of a secret exceeds the maximum length allowed."

    Error_secret_too_long_value: INTEGER is 1382

    Error_sector_not_found_text: STRING is "The drive cannot find the sector requested."

    Error_sector_not_found_value: INTEGER is 27

    Error_seek_on_device_text: STRING is "The file pointer cannot be set on the specified device or file."

    Error_seek_on_device_value: INTEGER is 132

    Error_seek_text: STRING is "The drive cannot locate a specific area or track on the disk."

    Error_seek_value: INTEGER is 25

    Error_sem_is_set_text: STRING is "The semaphore is set and cannot be closed."

    Error_sem_is_set_value: INTEGER is 102

    Error_sem_not_found_text: STRING is "The specified system semaphore name was not found."

    Error_sem_not_found_value: INTEGER is 187

    Error_sem_owner_died_text: STRING is "The previous ownership of this semaphore has ended."

    Error_sem_owner_died_value: INTEGER is 105

    Error_sem_timeout_text: STRING is "The semaphore timeout period has expired."

    Error_sem_timeout_value: INTEGER is 121

    Error_sem_user_limit_text: STRING is "Insert the diskette for drive %%1."

    Error_sem_user_limit_value: INTEGER is 106

    Error_serial_no_device_text: STRING is "No serial device was successfully initialized. The serial driver will unload."

    Error_serial_no_device_value: INTEGER is 1118

    Error_server_disabled_text: STRING is "The server is currently disabled."

    Error_server_disabled_value: INTEGER is 1341

    Error_server_has_open_handles_text: STRING is "The server is in use and cannot be unloaded."

    Error_server_has_open_handles_value: INTEGER is 1811

    Error_server_not_disabled_text: STRING is "The server is currently enabled."

    Error_server_not_disabled_value: INTEGER is 1342

    Error_service_already_running_text: STRING is "An instance of the service is already running."

    Error_service_already_running_value: INTEGER is 1056

    Error_service_cannot_accept_ctrl_text: STRING is "The service cannot accept control messages at this time."

    Error_service_cannot_accept_ctrl_value: INTEGER is 1061

    Error_service_database_locked_text: STRING is "The service database is locked."

    Error_service_database_locked_value: INTEGER is 1055

    Error_service_dependency_deleted_text: STRING is "The dependency service does not exist or has been marked for deletion."

    Error_service_dependency_deleted_value: INTEGER is 1075

    Error_service_dependency_fail_text: STRING is "The dependency service or group failed to start."

    Error_service_dependency_fail_value: INTEGER is 1068

    Error_service_disabled_text: STRING is "The service cannot be started, either because it is disabled or because it has no enabled devices associated with it."

    Error_service_disabled_value: INTEGER is 1058

    Error_service_does_not_exist_text: STRING is "The specified service does not exist as an installed service."

    Error_service_does_not_exist_value: INTEGER is 1060

    Error_service_exists_text: STRING is "The specified service already exists."

    Error_service_exists_value: INTEGER is 1073

    Error_service_logon_failed_text: STRING is "The service did not start due to a logon failure."

    Error_service_logon_failed_value: INTEGER is 1069

    Error_service_marked_for_delete_text: STRING is "The specified service has been marked for deletion."

    Error_service_marked_for_delete_value: INTEGER is 1072

    Error_service_never_started_text: STRING is "No attempts to start the service have been made since the last boot."

    Error_service_never_started_value: INTEGER is 1077

    Error_service_no_thread_text: STRING is "A thread could not be created for the service."

    Error_service_no_thread_value: INTEGER is 1054

    Error_service_not_active_text: STRING is "The service has not been started."

    Error_service_not_active_value: INTEGER is 1062

    Error_service_not_found_text: STRING is "The specified service does not exist."

    Error_service_not_found_value: INTEGER is 1243

    Error_service_not_in_exe_text: STRING is "The executable program that this service is configured to run in does not implement the service."

    Error_service_not_in_exe_value: INTEGER is 1083

    Error_service_request_timeout_text: STRING is "The service did not respond to the start or control request in a timely fashion."

    Error_service_request_timeout_value: INTEGER is 1053

    Error_service_specific_error_text: STRING is "The service has returned a service-specific error code."

    Error_service_specific_error_value: INTEGER is 1066

    Error_service_start_hang_text: STRING is "After starting, the service hung in a start-pending state."

    Error_service_start_hang_value: INTEGER is 1070

    Error_session_credential_conflict_text: STRING is "The credentials supplied conflict with an existing set of credentials."

    Error_session_credential_conflict_value: INTEGER is 1219

    Error_set_not_found_text: STRING is "The property set specified does not exist on the object."

    Error_set_not_found_value: INTEGER is 1170

    Error_set_power_state_failed_text: STRING is "The system BIOS failed an attempt to change the system power state."

    Error_set_power_state_failed_value: INTEGER is 1141

    Error_set_power_state_vetoed_text: STRING is "An attempt to change the system power state was vetoed by another application or driver."

    Error_set_power_state_vetoed_value: INTEGER is 1140

    Error_setcount_on_bad_lb_text: STRING is "LB_SETCOUNT sent to non-lazy list box."

    Error_setcount_on_bad_lb_value: INTEGER is 1433

    Error_setmark_detected_text: STRING is "A tape access reached the end of a set of files."

    Error_setmark_detected_value: INTEGER is 1103

    Error_shared_policy_text: STRING is "The policy object is shared and can only be modified at the root."

    Error_shared_policy_value: INTEGER is 8218

    Error_sharing_buffer_exceeded_text: STRING is "Too many files opened for sharing."

    Error_sharing_buffer_exceeded_value: INTEGER is 36

    Error_sharing_paused_text: STRING is "The remote server has been paused or is in the process of being started."

    Error_sharing_paused_value: INTEGER is 70

    Error_sharing_violation_text: STRING is "The process cannot access the file because it is being used by another process."

    Error_sharing_violation_value: INTEGER is 32

    Error_shutdown_cluster_text: STRING is "The cluster is being shut down."

    Error_shutdown_cluster_value: INTEGER is 5008

    Error_shutdown_in_progress_text: STRING is "A system shutdown is in progress."

    Error_shutdown_in_progress_value: INTEGER is 1115

    Error_signal_pending_text: STRING is "A signal is already pending."

    Error_signal_pending_value: INTEGER is 162

    Error_signal_refused_text: STRING is "The recipient process has refused the signal."

    Error_signal_refused_value: INTEGER is 156

    Error_single_instance_app_text: STRING is "Cannot start more than one instance of the specified program."

    Error_single_instance_app_value: INTEGER is 1152

    Error_some_not_mapped_text: STRING is "Some mapping between account names and security IDs was not done."

    Error_some_not_mapped_value: INTEGER is 1301

    Error_source_element_empty_text: STRING is "The indicated source element has no media."

    Error_source_element_empty_value: INTEGER is 1160

    Error_special_account_text: STRING is "Cannot perform this operation on built-in accounts."

    Error_special_account_value: INTEGER is 1371

    Error_special_group_text: STRING is "Cannot perform this operation on this built-in special group."

    Error_special_group_value: INTEGER is 1372

    Error_special_user_text: STRING is "Cannot perform this operation on this built-in special user."

    Error_special_user_value: INTEGER is 1373

    Error_spl_no_addjob_text: STRING is "An AddJob call was not issued."

    Error_spl_no_addjob_value: INTEGER is 3004

    Error_spl_no_startdoc_text: STRING is "A StartDocPrinter call was not issued."

    Error_spl_no_startdoc_value: INTEGER is 3003

    Error_spool_file_not_found_text: STRING is "The spool file was not found."

    Error_spool_file_not_found_value: INTEGER is 3002

    Error_stack_overflow_text: STRING is "Recursion too deep; the stack overflowed."

    Error_stack_overflow_value: INTEGER is 1001

    Error_static_init_text: STRING is "The importation from the file failed."

    Error_static_init_value: INTEGER is 4002

    Error_subst_to_join_text: STRING is "The system tried to SUBST a drive to a directory on a joined drive."

    Error_subst_to_join_value: INTEGER is 141

    Error_subst_to_subst_text: STRING is "The system tried to substitute a drive to a directory on a substituted drive."

    Error_subst_to_subst_value: INTEGER is 139

    Error_success_reboot_initiated_text: STRING is "The requested operation completed successfully.  The system will be restarted so the changes can take effect."

    Error_success_reboot_initiated_value: INTEGER is 1641

    Error_success_reboot_required_text: STRING is "The requested operation is successful. Changes will not be effective until the system is rebooted."

    Error_success_reboot_required_value: INTEGER is 3010

    Error_success_restart_required_text: STRING is "The requested operation is successful. Changes will not be effective until the service is restarted."

    Error_success_restart_required_value: INTEGER is 3011

    Error_success_text: STRING is "The operation completed successfully."

    Error_success_value: INTEGER is 0

    Error_swaperror_text: STRING is "Error performing in page operation."

    Error_swaperror_value: INTEGER is 999

    Error_system_trace_text: STRING is "System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed."

    Error_system_trace_value: INTEGER is 150

    Error_tag_not_found_text: STRING is "The specified tag was not found."

    Error_tag_not_found_value: INTEGER is 2012

    Error_tag_not_present_text: STRING is "A required tag is not present."

    Error_tag_not_present_value: INTEGER is 2013

    Error_thread_1_inactive_text: STRING is "The signal handler cannot be set."

    Error_thread_1_inactive_value: INTEGER is 210

    Error_time_skew_text: STRING is "There is a time difference between the client and server."

    Error_time_skew_value: INTEGER is 1398

    Error_timeout_text: STRING is "This operation returned because the timeout period expired."

    Error_timeout_value: INTEGER is 1460

    Error_tlw_with_wschild_text: STRING is "Cannot create a top-level child window."

    Error_tlw_with_wschild_value: INTEGER is 1406

    Error_token_already_in_use_text: STRING is "The token is already in use as a primary token."

    Error_token_already_in_use_value: INTEGER is 1375

    Error_too_many_cmds_text: STRING is "The network BIOS command limit has been reached."

    Error_too_many_cmds_value: INTEGER is 56

    Error_too_many_context_ids_text: STRING is "During a logon attempt, the user's security context accumulated too many security IDs."

    Error_too_many_context_ids_value: INTEGER is 1384

    Error_too_many_links_text: STRING is "An attempt was made to create more links on a file than the file system supports."

    Error_too_many_links_value: INTEGER is 1142

    Error_too_many_luids_requested_text: STRING is "Too many local user identifiers (LUIDs) were requested at one time."

    Error_too_many_luids_requested_value: INTEGER is 1333

    Error_too_many_modules_text: STRING is "Too many dynamic-link modules are attached to this program or dynamic-link module."

    Error_too_many_modules_value: INTEGER is 214

    Error_too_many_muxwaiters_text: STRING is "DosMuxSemWait did not execute; too many semaphores are already set."

    Error_too_many_muxwaiters_value: INTEGER is 152

    Error_too_many_names_text: STRING is "The name limit for the local computer network adapter card was exceeded."

    Error_too_many_names_value: INTEGER is 68

    Error_too_many_open_files_text: STRING is "The system cannot open the file."

    Error_too_many_open_files_value: INTEGER is 4

    Error_too_many_posts_text: STRING is "Too many posts were made to a semaphore."

    Error_too_many_posts_value: INTEGER is 298

    Error_too_many_secrets_text: STRING is "The maximum number of secrets that may be stored in a single system has been exceeded."

    Error_too_many_secrets_value: INTEGER is 1381

    Error_too_many_sem_requests_text: STRING is "The semaphore cannot be set again."

    Error_too_many_sem_requests_value: INTEGER is 103

    Error_too_many_semaphores_text: STRING is "Cannot create another system semaphore."

    Error_too_many_semaphores_value: INTEGER is 100

    Error_too_many_sess_text: STRING is "The network BIOS session limit was exceeded."

    Error_too_many_sess_value: INTEGER is 69

    Error_too_many_sids_text: STRING is "Too many security IDs have been specified."

    Error_too_many_sids_value: INTEGER is 1389

    Error_too_many_tcbs_text: STRING is "Cannot create another thread."

    Error_too_many_tcbs_value: INTEGER is 155

    Error_transform_not_supported_text: STRING is "The requested transformation operation is not supported."

    Error_transform_not_supported_value: INTEGER is 2004

    Error_transport_full_text: STRING is "Cannot use the transport because it is already in use."

    Error_transport_full_value: INTEGER is 4328

    Error_trust_failure_text: STRING is "The network logon failed."

    Error_trust_failure_value: INTEGER is 1790

    Error_trusted_domain_failure_text: STRING is "The trust relationship between the primary domain and the trusted domain failed."

    Error_trusted_domain_failure_value: INTEGER is 1788

    Error_trusted_relationship_failure_text: STRING is "The trust relationship between this workstation and the primary domain failed."

    Error_trusted_relationship_failure_value: INTEGER is 1789

    Error_unable_to_clean_text: STRING is "The drive cannot be cleaned or does not support cleaning."

    Error_unable_to_clean_value: INTEGER is 4311

    Error_unable_to_eject_mounted_media_text: STRING is "Unable to eject the medium because it is in a drive."

    Error_unable_to_eject_mounted_media_value: INTEGER is 4330

    Error_unable_to_inventory_drive_text: STRING is "Unable to retrieve the drive status."

    Error_unable_to_inventory_drive_value: INTEGER is 4325

    Error_unable_to_inventory_slot_text: STRING is "Unable to retrieve the slot status."

    Error_unable_to_inventory_slot_value: INTEGER is 4326

    Error_unable_to_inventory_transport_text: STRING is "Unable to retrieve status about the transport."

    Error_unable_to_inventory_transport_value: INTEGER is 4327

    Error_unable_to_load_medium_text: STRING is "Unable to load the medium into the drive."

    Error_unable_to_load_medium_value: INTEGER is 4324

    Error_unable_to_lock_media_text: STRING is "Unable to lock the media eject mechanism."

    Error_unable_to_lock_media_value: INTEGER is 1108

    Error_unable_to_move_replacement_2_text: STRING is "Unable to move the replacement file to the file to be replaced. The file to be replaced has been renamed using the backup name."

    Error_unable_to_move_replacement_2_value: INTEGER is 1177

    Error_unable_to_move_replacement_text: STRING is "Unable to move the replacement file to the file to be replaced. The file to be replaced has retained its original name."

    Error_unable_to_move_replacement_value: INTEGER is 1176

    Error_unable_to_remove_replaced_text: STRING is "Unable to remove the file to be replaced."

    Error_unable_to_remove_replaced_value: INTEGER is 1175

    Error_unable_to_unload_media_text: STRING is "Unable to unload the media."

    Error_unable_to_unload_media_value: INTEGER is 1109

    Error_unexp_net_err_text: STRING is "An unexpected network error occurred."

    Error_unexp_net_err_value: INTEGER is 59

    Error_unexpected_omid_text: STRING is "Unexpected on-medium identifier."

    Error_unexpected_omid_value: INTEGER is 4334

    Error_unknown_component_text: STRING is "Component ID not registered."

    Error_unknown_component_value: INTEGER is 1607

    Error_unknown_feature_text: STRING is "Feature ID not registered."

    Error_unknown_feature_value: INTEGER is 1606

    Error_unknown_port_text: STRING is "The specified port is unknown."

    Error_unknown_port_value: INTEGER is 1796

    Error_unknown_print_monitor_text: STRING is "The specified print monitor is unknown."

    Error_unknown_print_monitor_value: INTEGER is 3000

    Error_unknown_printer_driver_text: STRING is "The printer driver is unknown."

    Error_unknown_printer_driver_value: INTEGER is 1797

    Error_unknown_printprocessor_text: STRING is "The print processor is unknown."

    Error_unknown_printprocessor_value: INTEGER is 1798

    Error_unknown_product_text: STRING is "This action is only valid for products that are currently installed."

    Error_unknown_product_value: INTEGER is 1605

    Error_unknown_property_text: STRING is "Unknown property."

    Error_unknown_property_value: INTEGER is 1608

    Error_unknown_revision_text: STRING is "The revision level is unknown."

    Error_unknown_revision_value: INTEGER is 1305

    Error_unrecognized_media_text: STRING is "The disk media is not recognized. It may not be formatted."

    Error_unrecognized_media_value: INTEGER is 1785

    Error_unrecognized_volume_text: STRING is "The volume does not contain a recognized file system.  Please make sure that all required file system drivers are loaded and that the volume is not corrupted."

    Error_unrecognized_volume_value: INTEGER is 1005

    Error_unsupported_type_text: STRING is "Data of this type is not supported."

    Error_unsupported_type_value: INTEGER is 1630

    Error_user_exists_text: STRING is "The specified user already exists."

    Error_user_exists_value: INTEGER is 1316

    Error_user_mapped_file_text: STRING is "The requested operation cannot be performed on a file with a user-mapped section open."

    Error_user_mapped_file_value: INTEGER is 1224

    Error_vc_disconnected_text: STRING is "The session was canceled."

    Error_vc_disconnected_value: INTEGER is 240

    Error_volume_contains_sys_files_text: STRING is "The volume contains system or paging files."

    Error_volume_contains_sys_files_value: INTEGER is 4337

    Error_volume_not_sis_enabled_text: STRING is "Single Instance Storage is not available on this volume."

    Error_volume_not_sis_enabled_value: INTEGER is 4500

    Error_wait_no_children_text: STRING is "There are no child processes to wait for."

    Error_wait_no_children_value: INTEGER is 128

    Error_window_not_combobox_text: STRING is "The window is not a combo box."

    Error_window_not_combobox_value: INTEGER is 1423

    Error_window_not_dialog_text: STRING is "The window is not a valid dialog window."

    Error_window_not_dialog_value: INTEGER is 1420

    Error_window_of_other_thread_text: STRING is "Invalid window; it belongs to other thread."

    Error_window_of_other_thread_value: INTEGER is 1408

    Error_wins_internal_text: STRING is "WINS encountered an error while processing the command."

    Error_wins_internal_value: INTEGER is 4000

    Error_wmi_already_disabled_text: STRING is "The WMI data block or event notification has already been disabled."

    Error_wmi_already_disabled_value: INTEGER is 4212

    Error_wmi_already_enabled_text: STRING is "The WMI data block or event notification has already been enabled."

    Error_wmi_already_enabled_value: INTEGER is 4206

    Error_wmi_dp_failed_text: STRING is "The WMI data provider failed to carry out the request."

    Error_wmi_dp_failed_value: INTEGER is 4209

    Error_wmi_dp_not_found_text: STRING is "The WMI data provider could not be located."

    Error_wmi_dp_not_found_value: INTEGER is 4204

    Error_wmi_guid_disconnected_text: STRING is "The WMI data block is no longer available."

    Error_wmi_guid_disconnected_value: INTEGER is 4207

    Error_wmi_guid_not_found_text: STRING is "The GUID passed was not recognized as valid by a WMI data provider."

    Error_wmi_guid_not_found_value: INTEGER is 4200

    Error_wmi_instance_not_found_text: STRING is "The instance name passed was not recognized as valid by a WMI data provider."

    Error_wmi_instance_not_found_value: INTEGER is 4201

    Error_wmi_invalid_mof_text: STRING is "The WMI MOF information is not valid."

    Error_wmi_invalid_mof_value: INTEGER is 4210

    Error_wmi_invalid_reginfo_text: STRING is "The WMI registration information is not valid."

    Error_wmi_invalid_reginfo_value: INTEGER is 4211

    Error_wmi_itemid_not_found_text: STRING is "The data item ID passed was not recognized as valid by a WMI data provider."

    Error_wmi_itemid_not_found_value: INTEGER is 4202

    Error_wmi_read_only_text: STRING is "The WMI data item or data block is read only."

    Error_wmi_read_only_value: INTEGER is 4213

    Error_wmi_server_unavailable_text: STRING is "The WMI data service is not available."

    Error_wmi_server_unavailable_value: INTEGER is 4208

    Error_wmi_set_failure_text: STRING is "The WMI data item or data block could not be changed."

    Error_wmi_set_failure_value: INTEGER is 4214

    Error_wmi_try_again_text: STRING is "The WMI request could not be completed and should be retried."

    Error_wmi_try_again_value: INTEGER is 4203

    Error_wmi_unresolved_instance_ref_text: STRING is "The WMI data provider references an instance set that has not been registered."

    Error_wmi_unresolved_instance_ref_value: INTEGER is 4205

    Error_working_set_quota_text: STRING is "Insufficient quota to complete the requested service."

    Error_working_set_quota_value: INTEGER is 1453

    Error_write_fault_text: STRING is "The system cannot write to the specified device."

    Error_write_fault_value: INTEGER is 29

    Error_write_protect_text: STRING is "The media is write protected."

    Error_write_protect_value: INTEGER is 19

    Error_wrong_disk_text: STRING is "The wrong diskette is in the drive.  Insert %%2 (Volume Serial Number: %%3)  into drive %%1."

    Error_wrong_disk_value: INTEGER is 34

    Error_wrong_efs_text: STRING is "The file was encrypted with a different encryption driver than is currently loaded."

    Error_wrong_efs_value: INTEGER is 6005

    Error_wrong_password_text: STRING is "Unable to update the password. The value provided as the current password is incorrect."

    Error_wrong_password_value: INTEGER is 1323

    Error_wrong_target_name_text: STRING is "Logon Failure: The target account name is incorrect."

    Error_wrong_target_name_value: INTEGER is 1396

    Frs_err_authentication_text: STRING is "The file replication service cannot satisfy the request because authenticated RPC is not available.  The event log may have more information."

    Frs_err_authentication_value: INTEGER is 8008

    Frs_err_child_to_parent_comm_text: STRING is "The file replication service cannot communicate with the file replication service on the domain controller.  The event log may have more information."

    Frs_err_child_to_parent_comm_value: INTEGER is 8011

    Frs_err_insufficient_priv_text: STRING is "The file replication service cannot satisfy the request because the user has insufficient privileges.  The event log may have more information."

    Frs_err_insufficient_priv_value: INTEGER is 8007

    Frs_err_internal_api_text: STRING is "The file replication service API terminated the request.  The event log may have more information."

    Frs_err_internal_api_value: INTEGER is 8004

    Frs_err_internal_text: STRING is "The file replication service terminated the request.  The event log may have more information."

    Frs_err_internal_value: INTEGER is 8005

    Frs_err_invalid_api_sequence_text: STRING is "The file replication service API was called incorrectly."

    Frs_err_invalid_api_sequence_value: INTEGER is 8001

    Frs_err_invalid_service_parameter_text: STRING is "The file replication service detected an invalid parameter."

    Frs_err_invalid_service_parameter_value: INTEGER is 8017

    Frs_err_parent_authentication_text: STRING is "The file replication service cannot satisfy the request because authenticated RPC is not available on the domain controller.  The event log may have more information."

    Frs_err_parent_authentication_value: INTEGER is 8010

    Frs_err_parent_insufficient_priv_text: STRING is "The file replication service cannot satisfy the request because the user has insufficient privileges on the domain controller.  The event log may have more information."

    Frs_err_parent_insufficient_priv_value: INTEGER is 8009

    Frs_err_parent_to_child_comm_text: STRING is "The file replication service on the domain controller cannot communicate with the file replication service on this computer.  The event log may have more information."

    Frs_err_parent_to_child_comm_value: INTEGER is 8012

    Frs_err_service_comm_text: STRING is "The file replication service cannot be contacted.  The event log may have more information."

    Frs_err_service_comm_value: INTEGER is 8006

    Frs_err_starting_service_text: STRING is "The file replication service cannot be started."

    Frs_err_starting_service_value: INTEGER is 8002

    Frs_err_stopping_service_text: STRING is "The file replication service cannot be stopped."

    Frs_err_stopping_service_value: INTEGER is 8003

    Frs_err_sysvol_demote_text: STRING is "The file replication service cannot stop replicating the system volume because of an internal error.  The event log may have more information."

    Frs_err_sysvol_demote_value: INTEGER is 8016

    Frs_err_sysvol_is_busy_text: STRING is "The file replication service cannot process the request. The system volume is busy with a previous request."

    Frs_err_sysvol_is_busy_value: INTEGER is 8015

    Frs_err_sysvol_populate_text: STRING is "The file replication service cannot populate the system volume because of an internal error.  The event log may have more information."

    Frs_err_sysvol_populate_timeout_text: STRING is "The file replication service cannot populate the system volume because of an internal timeout.  The event log may have more information."

    Frs_err_sysvol_populate_timeout_value: INTEGER is 8014

    Frs_err_sysvol_populate_value: INTEGER is 8013

    Or_invalid_oid_text: STRING is "The object specified was not found."

    Or_invalid_oid_value: INTEGER is 1911

    Or_invalid_oxid_text: STRING is "The object exporter specified was not found."

    Or_invalid_oxid_value: INTEGER is 1910

    Or_invalid_set_text: STRING is "The object resolver set specified was not found."

    Or_invalid_set_value: INTEGER is 1912

    Rpc_s_address_error_text: STRING is "An addressing error occurred in the RPC server."

    Rpc_s_address_error_value: INTEGER is 1768

    Rpc_s_already_listening_text: STRING is "The RPC server is already listening."

    Rpc_s_already_listening_value: INTEGER is 1713

    Rpc_s_already_registered_text: STRING is "The object universal unique identifier (UUID) has already been registered."

    Rpc_s_already_registered_value: INTEGER is 1711

    Rpc_s_binding_has_no_auth_text: STRING is "The binding does not contain any authentication information."

    Rpc_s_binding_has_no_auth_value: INTEGER is 1746

    Rpc_s_binding_incomplete_text: STRING is "The binding handle does not contain all required information."

    Rpc_s_binding_incomplete_value: INTEGER is 1819

    Rpc_s_call_cancelled_text: STRING is "The remote procedure call was cancelled."

    Rpc_s_call_cancelled_value: INTEGER is 1818

    Rpc_s_call_failed_dne_text: STRING is "The remote procedure call failed and did not execute."

    Rpc_s_call_failed_dne_value: INTEGER is 1727

    Rpc_s_call_failed_text: STRING is "The remote procedure call failed."

    Rpc_s_call_failed_value: INTEGER is 1726

    Rpc_s_call_in_progress_text: STRING is "A remote procedure call is already in progress for this thread."

    Rpc_s_call_in_progress_value: INTEGER is 1791

    Rpc_s_cannot_support_text: STRING is "The requested operation is not supported."

    Rpc_s_cannot_support_value: INTEGER is 1764

    Rpc_s_cant_create_endpoint_text: STRING is "The endpoint cannot be created."

    Rpc_s_cant_create_endpoint_value: INTEGER is 1720

    Rpc_s_comm_failure_text: STRING is "A communications failure occurred during a remote procedure call."

    Rpc_s_comm_failure_value: INTEGER is 1820

    Rpc_s_duplicate_endpoint_text: STRING is "The endpoint is a duplicate."

    Rpc_s_duplicate_endpoint_value: INTEGER is 1740

    Rpc_s_entry_already_exists_text: STRING is "The entry already exists."

    Rpc_s_entry_already_exists_value: INTEGER is 1760

    Rpc_s_entry_not_found_text: STRING is "The entry is not found."

    Rpc_s_entry_not_found_value: INTEGER is 1761

    Rpc_s_entry_type_mismatch_text: STRING is "The entry is not of the expected type."

    Rpc_s_entry_type_mismatch_value: INTEGER is 1922

    Rpc_s_fp_div_zero_text: STRING is "A floating-point operation at the RPC server caused a division by zero."

    Rpc_s_fp_div_zero_value: INTEGER is 1769

    Rpc_s_fp_overflow_text: STRING is "A floating-point overflow occurred at the RPC server."

    Rpc_s_fp_overflow_value: INTEGER is 1771

    Rpc_s_fp_underflow_text: STRING is "A floating-point underflow occurred at the RPC server."

    Rpc_s_fp_underflow_value: INTEGER is 1770

    Rpc_s_group_member_not_found_text: STRING is "The group member was not found."

    Rpc_s_group_member_not_found_value: INTEGER is 1898

    Rpc_s_grp_elt_not_added_text: STRING is "The group element could not be added."

    Rpc_s_grp_elt_not_added_value: INTEGER is 1928

    Rpc_s_grp_elt_not_removed_text: STRING is "The group element could not be removed."

    Rpc_s_grp_elt_not_removed_value: INTEGER is 1929

    Rpc_s_incomplete_name_text: STRING is "The entry name is incomplete."

    Rpc_s_incomplete_name_value: INTEGER is 1755

    Rpc_s_interface_not_exported_text: STRING is "Interface could not be exported to the specified entry."

    Rpc_s_interface_not_exported_value: INTEGER is 1924

    Rpc_s_interface_not_found_text: STRING is "The interface was not found."

    Rpc_s_interface_not_found_value: INTEGER is 1759

    Rpc_s_internal_error_text: STRING is "An internal error occurred in a remote procedure call (RPC)."

    Rpc_s_internal_error_value: INTEGER is 1766

    Rpc_s_invalid_async_call_text: STRING is "Invalid asynchronous RPC call handle for this operation."

    Rpc_s_invalid_async_call_value: INTEGER is 1915

    Rpc_s_invalid_async_handle_text: STRING is "Invalid asynchronous remote procedure call handle."

    Rpc_s_invalid_async_handle_value: INTEGER is 1914

    Rpc_s_invalid_auth_identity_text: STRING is "The security context is invalid."

    Rpc_s_invalid_auth_identity_value: INTEGER is 1749

    Rpc_s_invalid_binding_text: STRING is "The binding handle is invalid."

    Rpc_s_invalid_binding_value: INTEGER is 1702

    Rpc_s_invalid_bound_text: STRING is "The array bounds are invalid."

    Rpc_s_invalid_bound_value: INTEGER is 1734

    Rpc_s_invalid_endpoint_format_text: STRING is "The endpoint format is invalid."

    Rpc_s_invalid_endpoint_format_value: INTEGER is 1706

    Rpc_s_invalid_naf_id_text: STRING is "The network address family is invalid."

    Rpc_s_invalid_naf_id_value: INTEGER is 1763

    Rpc_s_invalid_name_syntax_text: STRING is "The name syntax is invalid."

    Rpc_s_invalid_name_syntax_value: INTEGER is 1736

    Rpc_s_invalid_net_addr_text: STRING is "The network address is invalid."

    Rpc_s_invalid_net_addr_value: INTEGER is 1707

    Rpc_s_invalid_network_options_text: STRING is "The network options are invalid."

    Rpc_s_invalid_network_options_value: INTEGER is 1724

    Rpc_s_invalid_object_text: STRING is "The object universal unique identifier (UUID) is the nil UUID."

    Rpc_s_invalid_object_value: INTEGER is 1900

    Rpc_s_invalid_rpc_protseq_text: STRING is "The RPC protocol sequence is invalid."

    Rpc_s_invalid_rpc_protseq_value: INTEGER is 1704

    Rpc_s_invalid_string_binding_text: STRING is "The string binding is invalid."

    Rpc_s_invalid_string_binding_value: INTEGER is 1700

    Rpc_s_invalid_string_uuid_text: STRING is "The string universal unique identifier (UUID) is invalid."

    Rpc_s_invalid_string_uuid_value: INTEGER is 1705

    Rpc_s_invalid_tag_text: STRING is "The tag is invalid."

    Rpc_s_invalid_tag_value: INTEGER is 1733

    Rpc_s_invalid_timeout_text: STRING is "The timeout value is invalid."

    Rpc_s_invalid_timeout_value: INTEGER is 1709

    Rpc_s_invalid_vers_option_text: STRING is "The version option is invalid."

    Rpc_s_invalid_vers_option_value: INTEGER is 1756

    Rpc_s_max_calls_too_small_text: STRING is "The maximum number of calls is too small."

    Rpc_s_max_calls_too_small_value: INTEGER is 1742

    Rpc_s_name_service_unavailable_text: STRING is "The name service is unavailable."

    Rpc_s_name_service_unavailable_value: INTEGER is 1762

    Rpc_s_no_bindings_text: STRING is "There are no bindings."

    Rpc_s_no_bindings_value: INTEGER is 1718

    Rpc_s_no_call_active_text: STRING is "There are no remote procedure calls active on this thread."

    Rpc_s_no_call_active_value: INTEGER is 1725

    Rpc_s_no_context_available_text: STRING is "No security context is available to allow impersonation."

    Rpc_s_no_context_available_value: INTEGER is 1765

    Rpc_s_no_endpoint_found_text: STRING is "No endpoint was found."

    Rpc_s_no_endpoint_found_value: INTEGER is 1708

    Rpc_s_no_entry_name_text: STRING is "The binding does not contain an entry name."

    Rpc_s_no_entry_name_value: INTEGER is 1735

    Rpc_s_no_interfaces_text: STRING is "No interfaces have been registered."

    Rpc_s_no_interfaces_value: INTEGER is 1817

    Rpc_s_no_more_bindings_text: STRING is "There are no more bindings."

    Rpc_s_no_more_bindings_value: INTEGER is 1806

    Rpc_s_no_more_members_text: STRING is "There are no more members."

    Rpc_s_no_more_members_value: INTEGER is 1757

    Rpc_s_no_princ_name_text: STRING is "No principal name registered."

    Rpc_s_no_princ_name_value: INTEGER is 1822

    Rpc_s_no_protseqs_registered_text: STRING is "No protocol sequences have been registered."

    Rpc_s_no_protseqs_registered_value: INTEGER is 1714

    Rpc_s_no_protseqs_text: STRING is "There are no protocol sequences."

    Rpc_s_no_protseqs_value: INTEGER is 1719

    Rpc_s_not_all_objs_exported_text: STRING is "Not all object UUIDs could be exported to the specified entry."

    Rpc_s_not_all_objs_exported_value: INTEGER is 1923

    Rpc_s_not_all_objs_unexported_text: STRING is "There is nothing to unexport."

    Rpc_s_not_all_objs_unexported_value: INTEGER is 1758

    Rpc_s_not_cancelled_text: STRING is "Thread is not canceled."

    Rpc_s_not_cancelled_value: INTEGER is 1826

    Rpc_s_not_listening_text: STRING is "The RPC server is not listening."

    Rpc_s_not_listening_value: INTEGER is 1715

    Rpc_s_not_rpc_error_text: STRING is "The error specified is not a valid Windows RPC error code."

    Rpc_s_not_rpc_error_value: INTEGER is 1823

    Rpc_s_nothing_to_export_text: STRING is "No interfaces have been exported."

    Rpc_s_nothing_to_export_value: INTEGER is 1754

    Rpc_s_object_not_found_text: STRING is "The object universal unique identifier (UUID) was not found."

    Rpc_s_object_not_found_value: INTEGER is 1710

    Rpc_s_out_of_resources_text: STRING is "Not enough resources are available to complete this operation."

    Rpc_s_out_of_resources_value: INTEGER is 1721

    Rpc_s_prf_elt_not_added_text: STRING is "The specified profile element could not be added."

    Rpc_s_prf_elt_not_added_value: INTEGER is 1926

    Rpc_s_prf_elt_not_removed_text: STRING is "The specified profile element could not be removed."

    Rpc_s_prf_elt_not_removed_value: INTEGER is 1927

    Rpc_s_procnum_out_of_range_text: STRING is "The procedure number is out of range."

    Rpc_s_procnum_out_of_range_value: INTEGER is 1745

    Rpc_s_profile_not_added_text: STRING is "The specified profile entry could not be added."

    Rpc_s_profile_not_added_value: INTEGER is 1925

    Rpc_s_protocol_error_text: STRING is "A remote procedure call (RPC) protocol error occurred."

    Rpc_s_protocol_error_value: INTEGER is 1728

    Rpc_s_protseq_not_found_text: STRING is "The RPC protocol sequence was not found."

    Rpc_s_protseq_not_found_value: INTEGER is 1744

    Rpc_s_protseq_not_supported_text: STRING is "The RPC protocol sequence is not supported."

    Rpc_s_protseq_not_supported_value: INTEGER is 1703

    Rpc_s_sec_pkg_error_text: STRING is "A security package specific error occurred."

    Rpc_s_sec_pkg_error_value: INTEGER is 1825

    Rpc_s_send_incomplete_text: STRING is "Some data remains to be sent in the request buffer."

    Rpc_s_send_incomplete_value: INTEGER is 1913

    Rpc_s_server_too_busy_text: STRING is "The RPC server is too busy to complete this operation."

    Rpc_s_server_too_busy_value: INTEGER is 1723

    Rpc_s_server_unavailable_text: STRING is "The RPC server is unavailable."

    Rpc_s_server_unavailable_value: INTEGER is 1722

    Rpc_s_string_too_long_text: STRING is "The string is too long."

    Rpc_s_string_too_long_value: INTEGER is 1743

    Rpc_s_type_already_registered_text: STRING is "The type universal unique identifier (UUID) has already been registered."

    Rpc_s_type_already_registered_value: INTEGER is 1712

    Rpc_s_unknown_authn_level_text: STRING is "The authentication level is unknown."

    Rpc_s_unknown_authn_level_value: INTEGER is 1748

    Rpc_s_unknown_authn_service_text: STRING is "The authentication service is unknown."

    Rpc_s_unknown_authn_service_value: INTEGER is 1747

    Rpc_s_unknown_authn_type_text: STRING is "The authentication type is unknown."

    Rpc_s_unknown_authn_type_value: INTEGER is 1741

    Rpc_s_unknown_authz_service_text: STRING is "The authorization service is unknown."

    Rpc_s_unknown_authz_service_value: INTEGER is 1750

    Rpc_s_unknown_if_text: STRING is "The interface is unknown."

    Rpc_s_unknown_if_value: INTEGER is 1717

    Rpc_s_unknown_mgr_type_text: STRING is "The manager type is unknown."

    Rpc_s_unknown_mgr_type_value: INTEGER is 1716

    Rpc_s_unsupported_authn_level_text: STRING is "The requested authentication level is not supported."

    Rpc_s_unsupported_authn_level_value: INTEGER is 1821

    Rpc_s_unsupported_name_syntax_text: STRING is "The name syntax is not supported."

    Rpc_s_unsupported_name_syntax_value: INTEGER is 1737

    Rpc_s_unsupported_trans_syn_text: STRING is "The transfer syntax is not supported by the RPC server."

    Rpc_s_unsupported_trans_syn_value: INTEGER is 1730

    Rpc_s_unsupported_type_text: STRING is "The universal unique identifier (UUID) type is not supported."

    Rpc_s_unsupported_type_value: INTEGER is 1732

    Rpc_s_uuid_local_only_text: STRING is "A UUID that is valid only on this computer has been allocated."

    Rpc_s_uuid_local_only_value: INTEGER is 1824

    Rpc_s_uuid_no_address_text: STRING is "No network address is available to use to construct a universal unique identifier (UUID)."

    Rpc_s_uuid_no_address_value: INTEGER is 1739

    Rpc_s_wrong_kind_of_binding_text: STRING is "The binding handle is not the correct type."

    Rpc_s_wrong_kind_of_binding_value: INTEGER is 1701

    Rpc_s_zero_divide_text: STRING is "The RPC server attempted an integer division by zero."

    Rpc_s_zero_divide_value: INTEGER is 1767

    Rpc_x_bad_stub_data_text: STRING is "The stub received bad data."

    Rpc_x_bad_stub_data_value: INTEGER is 1783

    Rpc_x_byte_count_too_small_text: STRING is "The byte count is too small."

    Rpc_x_byte_count_too_small_value: INTEGER is 1782

    Rpc_x_enum_value_out_of_range_text: STRING is "The enumeration value is out of range."

    Rpc_x_enum_value_out_of_range_value: INTEGER is 1781

    Rpc_x_invalid_es_action_text: STRING is "Invalid operation on the encoding/decoding handle."

    Rpc_x_invalid_es_action_value: INTEGER is 1827

    Rpc_x_invalid_pipe_object_text: STRING is "The RPC pipe object is invalid or corrupted."

    Rpc_x_invalid_pipe_object_value: INTEGER is 1830

    Rpc_x_no_more_entries_text: STRING is "The list of RPC servers available for the binding of auto handles has been exhausted."

    Rpc_x_no_more_entries_value: INTEGER is 1772

    Rpc_x_null_ref_pointer_text: STRING is "A null reference pointer was passed to the stub."

    Rpc_x_null_ref_pointer_value: INTEGER is 1780

    Rpc_x_pipe_closed_text: STRING is "The RPC pipe object has already been closed."

    Rpc_x_pipe_closed_value: INTEGER is 1916

    Rpc_x_pipe_discipline_error_text: STRING is "The RPC call completed before all pipes were processed."

    Rpc_x_pipe_discipline_error_value: INTEGER is 1917

    Rpc_x_pipe_empty_text: STRING is "No more data is available from the RPC pipe."

    Rpc_x_pipe_empty_value: INTEGER is 1918

    Rpc_x_ss_cannot_get_call_handle_text: STRING is "The stub is unable to get the remote procedure call handle."

    Rpc_x_ss_cannot_get_call_handle_value: INTEGER is 1779

    Rpc_x_ss_char_trans_open_fail_text: STRING is "Unable to open the character translation table file."

    Rpc_x_ss_char_trans_open_fail_value: INTEGER is 1773

    Rpc_x_ss_char_trans_short_file_text: STRING is "The file containing the character translation table has fewer than 512 bytes."

    Rpc_x_ss_char_trans_short_file_value: INTEGER is 1774

    Rpc_x_ss_context_damaged_text: STRING is "The context handle changed during a remote procedure call."

    Rpc_x_ss_context_damaged_value: INTEGER is 1777

    Rpc_x_ss_handles_mismatch_text: STRING is "The binding handles passed to a remote procedure call do not match."

    Rpc_x_ss_handles_mismatch_value: INTEGER is 1778

    Rpc_x_ss_in_null_context_text: STRING is "A null context handle was passed from the client to the host during a remote procedure call."

    Rpc_x_ss_in_null_context_value: INTEGER is 1775

    Rpc_x_wrong_es_version_text: STRING is "Incompatible version of the serializing package."

    Rpc_x_wrong_es_version_value: INTEGER is 1828

    Rpc_x_wrong_pipe_order_text: STRING is "An invalid operation was attempted on an RPC pipe object."

    Rpc_x_wrong_pipe_order_value: INTEGER is 1831

    Rpc_x_wrong_pipe_version_text: STRING is "Unsupported RPC pipe version."

    Rpc_x_wrong_pipe_version_value: INTEGER is 1832

    Rpc_x_wrong_stub_version_text: STRING is "Incompatible version of the RPC stub."

    Rpc_x_wrong_stub_version_value: INTEGER is 1829

    Sched_e_service_not_localsystem_text: STRING is "The Task Scheduler service must be configured to run in the System account to function properly.  Individual tasks may be configured to run in other accounts."

    Sched_e_service_not_localsystem_value: INTEGER is 6200

    Wait_timeout_text: STRING is "The wait operation timed out."

    Wait_timeout_value: INTEGER is 258

    Wsa_e_cancelled_text: STRING is "A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled."

    Wsa_e_cancelled_value: INTEGER is 10111

    Wsa_e_no_more_text: STRING is "No more results can be returned by WSALookupServiceNext."

    Wsa_e_no_more_value: INTEGER is 10110

    Wsa_qos_admission_failure_text: STRING is "Error due to lack of resources."

    Wsa_qos_admission_failure_value: INTEGER is 11010

    Wsa_qos_bad_object_text: STRING is "Problem with some part of the filterspec or providerspecific buffer in general."

    Wsa_qos_bad_object_value: INTEGER is 11013

    Wsa_qos_bad_style_text: STRING is "Unknown or conflicting style."

    Wsa_qos_bad_style_value: INTEGER is 11012

    Wsa_qos_efiltercount_text: STRING is "An incorrect number of QOS FILTERSPECs were specified in the FLOWDESCRIPTOR."

    Wsa_qos_efiltercount_value: INTEGER is 11021

    Wsa_qos_efilterstyle_text: STRING is "An invalid QOS filter style was used."

    Wsa_qos_efilterstyle_value: INTEGER is 11019

    Wsa_qos_efiltertype_text: STRING is "An invalid QOS filter type was used."

    Wsa_qos_efiltertype_value: INTEGER is 11020

    Wsa_qos_eflowcount_text: STRING is "An incorrect number of flow descriptors was specified in the QOS structure."

    Wsa_qos_eflowcount_value: INTEGER is 11023

    Wsa_qos_eflowdesc_text: STRING is "An invalid QOS flow descriptor was found in the flow descriptor list."

    Wsa_qos_eflowdesc_value: INTEGER is 11026

    Wsa_qos_eflowspec_text: STRING is "An invalid or inconsistent flowspec was found in the QOS structure."

    Wsa_qos_eflowspec_value: INTEGER is 11017

    Wsa_qos_eobjlength_text: STRING is "An object with an invalid ObjectLength field was specified in the QOS provider-specific buffer."

    Wsa_qos_eobjlength_value: INTEGER is 11022

    Wsa_qos_epolicyobj_text: STRING is "An invalid policy object was found in the QOS provider-specific buffer."

    Wsa_qos_epolicyobj_value: INTEGER is 11025

    Wsa_qos_eprovspecbuf_text: STRING is "Invalid QOS provider-specific buffer."

    Wsa_qos_eprovspecbuf_value: INTEGER is 11018

    Wsa_qos_epsfilterspec_text: STRING is "An invalid FILTERSPEC was found in the QOS provider-specific buffer."

    Wsa_qos_epsfilterspec_value: INTEGER is 11028

    Wsa_qos_epsflowspec_text: STRING is "An invalid or inconsistent flowspec was found in the QOS provider specific buffer."

    Wsa_qos_epsflowspec_value: INTEGER is 11027

    Wsa_qos_esdmodeobj_text: STRING is "An invalid shape discard mode object was found in the QOS provider specific buffer."

    Wsa_qos_esdmodeobj_value: INTEGER is 11029

    Wsa_qos_eservicetype_text: STRING is "An invalid or unrecognized service type was found in the flowspec."

    Wsa_qos_eservicetype_value: INTEGER is 11016

    Wsa_qos_eshaperateobj_text: STRING is "An invalid shaping rate object was found in the QOS provider-specific buffer."

    Wsa_qos_eshaperateobj_value: INTEGER is 11030

    Wsa_qos_eunkownpsobj_text: STRING is "An unrecognized object was found in the QOS provider-specific buffer."

    Wsa_qos_eunkownpsobj_value: INTEGER is 11024

    Wsa_qos_generic_error_text: STRING is "General QOS error."

    Wsa_qos_generic_error_value: INTEGER is 11015

    Wsa_qos_no_receivers_text: STRING is "There are no receivers."

    Wsa_qos_no_receivers_value: INTEGER is 11008

    Wsa_qos_no_senders_text: STRING is "There are no senders."

    Wsa_qos_no_senders_value: INTEGER is 11007

    Wsa_qos_policy_failure_text: STRING is "Rejected for administrative reasons - bad credentials."

    Wsa_qos_policy_failure_value: INTEGER is 11011

    Wsa_qos_receivers_text: STRING is "At least one reserve has arrived."

    Wsa_qos_receivers_value: INTEGER is 11005

    Wsa_qos_request_confirmed_text: STRING is "Reserve has been confirmed."

    Wsa_qos_request_confirmed_value: INTEGER is 11009

    Wsa_qos_reserved_petype_text: STRING is "A reserved policy element was found in the QOS provider-specific buffer."

    Wsa_qos_reserved_petype_value: INTEGER is 11031

    Wsa_qos_senders_text: STRING is "At least one path has arrived."

    Wsa_qos_senders_value: INTEGER is 11006

    Wsa_qos_traffic_ctrl_error_text: STRING is "Problem with some part of the flowspec."

    Wsa_qos_traffic_ctrl_error_value: INTEGER is 11014

    Wsaeacces_text: STRING is "An attempt was made to access a socket in a way forbidden by its access permissions."

    Wsaeacces_value: INTEGER is 10013

    Wsaeaddrinuse_text: STRING is "Only one usage of each socket address (protocol/network address/port)  is normally permitted."

    Wsaeaddrinuse_value: INTEGER is 10048

    Wsaeaddrnotavail_text: STRING is "The requested address is not valid in its context."

    Wsaeaddrnotavail_value: INTEGER is 10049

    Wsaeafnosupport_text: STRING is "An address incompatible with the requested protocol was used."

    Wsaeafnosupport_value: INTEGER is 10047

    Wsaealready_text: STRING is "An operation was attempted on a non-blocking socket that already had an operation in progress."

    Wsaealready_value: INTEGER is 10037

    Wsaebadf_text: STRING is "The file handle supplied is not valid."

    Wsaebadf_value: INTEGER is 10009

    Wsaecancelled_text: STRING is "A call to WSALookupServiceEnd was made while this call was still processing. The call has been canceled."

    Wsaecancelled_value: INTEGER is 10103

    Wsaeconnaborted_text: STRING is "An established connection was aborted by the software in your host machine."

    Wsaeconnaborted_value: INTEGER is 10053

    Wsaeconnrefused_text: STRING is "No connection could be made because the target machine actively refused it."

    Wsaeconnrefused_value: INTEGER is 10061

    Wsaeconnreset_text: STRING is "An existing connection was forcibly closed by the remote host."

    Wsaeconnreset_value: INTEGER is 10054

    Wsaedestaddrreq_text: STRING is "A required address was omitted from an operation on a socket."

    Wsaedestaddrreq_value: INTEGER is 10039

    Wsaediscon_text: STRING is "Returned by WSARecv or WSARecvFrom to indicate the remote party has initiated a graceful shutdown sequence."

    Wsaediscon_value: INTEGER is 10101

    Wsaedquot_text: STRING is "Ran out of disk quota."

    Wsaedquot_value: INTEGER is 10069

    Wsaefault_text: STRING is "The system detected an invalid pointer address in attempting to use a pointer argument in a call."

    Wsaefault_value: INTEGER is 10014

    Wsaehostdown_text: STRING is "A socket operation failed because the destination host was down."

    Wsaehostdown_value: INTEGER is 10064

    Wsaehostunreach_text: STRING is "A socket operation was attempted to an unreachable host."

    Wsaehostunreach_value: INTEGER is 10065

    Wsaeinprogress_text: STRING is "A blocking operation is currently executing."

    Wsaeinprogress_value: INTEGER is 10036

    Wsaeintr_text: STRING is "A blocking operation was interrupted by a call to WSACancelBlockingCall."

    Wsaeintr_value: INTEGER is 10004

    Wsaeinval_text: STRING is "An invalid argument was supplied."

    Wsaeinval_value: INTEGER is 10022

    Wsaeinvalidproctable_text: STRING is "The procedure call table is invalid."

    Wsaeinvalidproctable_value: INTEGER is 10104

    Wsaeinvalidprovider_text: STRING is "The requested service provider is invalid."

    Wsaeinvalidprovider_value: INTEGER is 10105

    Wsaeisconn_text: STRING is "A connect request was made on an already connected socket."

    Wsaeisconn_value: INTEGER is 10056

    Wsaeloop_text: STRING is "Cannot translate name."

    Wsaeloop_value: INTEGER is 10062

    Wsaemfile_text: STRING is "Too many open sockets."

    Wsaemfile_value: INTEGER is 10024

    Wsaemsgsize_text: STRING is "A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram into was smaller than the datagram itself."

    Wsaemsgsize_value: INTEGER is 10040

    Wsaenametoolong_text: STRING is "Name component or name was too long."

    Wsaenametoolong_value: INTEGER is 10063

    Wsaenetdown_text: STRING is "A socket operation encountered a dead network."

    Wsaenetdown_value: INTEGER is 10050

    Wsaenetreset_text: STRING is "The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress."

    Wsaenetreset_value: INTEGER is 10052

    Wsaenetunreach_text: STRING is "A socket operation was attempted to an unreachable network."

    Wsaenetunreach_value: INTEGER is 10051

    Wsaenobufs_text: STRING is "An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full."

    Wsaenobufs_value: INTEGER is 10055

    Wsaenomore_text: STRING is "No more results can be returned by WSALookupServiceNext."

    Wsaenomore_value: INTEGER is 10102

    Wsaenoprotoopt_text: STRING is "An unknown, invalid, or unsupported option or level was specified in a getsockopt or setsockopt call."

    Wsaenoprotoopt_value: INTEGER is 10042

    Wsaenotconn_text: STRING is "A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied."

    Wsaenotconn_value: INTEGER is 10057

    Wsaenotempty_text: STRING is "Cannot remove a directory that is not empty."

    Wsaenotempty_value: INTEGER is 10066

    Wsaenotsock_text: STRING is "An operation was attempted on something that is not a socket."

    Wsaenotsock_value: INTEGER is 10038

    Wsaeopnotsupp_text: STRING is "The attempted operation is not supported for the type of object referenced."

    Wsaeopnotsupp_value: INTEGER is 10045

    Wsaepfnosupport_text: STRING is "The protocol family has not been configured into the system or no implementation for it exists."

    Wsaepfnosupport_value: INTEGER is 10046

    Wsaeproclim_text: STRING is "A Windows Sockets implementation may have a limit on the number of applications that may use it simultaneously."

    Wsaeproclim_value: INTEGER is 10067

    Wsaeprotonosupport_text: STRING is "The requested protocol has not been configured into the system, or no implementation for it exists."

    Wsaeprotonosupport_value: INTEGER is 10043

    Wsaeprototype_text: STRING is "A protocol was specified in the socket function call that does not support the semantics of the socket type requested."

    Wsaeprototype_value: INTEGER is 10041

    Wsaeproviderfailedinit_text: STRING is "The requested service provider could not be loaded or initialized."

    Wsaeproviderfailedinit_value: INTEGER is 10106

    Wsaerefused_text: STRING is "A database query failed because it was actively refused."

    Wsaerefused_value: INTEGER is 10112

    Wsaeremote_text: STRING is "Item is not available locally."

    Wsaeremote_value: INTEGER is 10071

    Wsaeshutdown_text: STRING is "A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call."

    Wsaeshutdown_value: INTEGER is 10058

    Wsaesocktnosupport_text: STRING is "The support for the specified socket type does not exist in this address family."

    Wsaesocktnosupport_value: INTEGER is 10044

    Wsaestale_text: STRING is "File handle reference is no longer available."

    Wsaestale_value: INTEGER is 10070

    Wsaetimedout_text: STRING is "A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond."

    Wsaetimedout_value: INTEGER is 10060

    Wsaetoomanyrefs_text: STRING is "Too many references to some kernel object."

    Wsaetoomanyrefs_value: INTEGER is 10059

    Wsaeusers_text: STRING is "Ran out of quota."

    Wsaeusers_value: INTEGER is 10068

    Wsaewouldblock_text: STRING is "A non-blocking socket operation could not be completed immediately."

    Wsaewouldblock_value: INTEGER is 10035

    Wsahost_not_found_text: STRING is "No such host is known."

    Wsahost_not_found_value: INTEGER is 11001

    Wsano_data_text: STRING is "The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for."

    Wsano_data_value: INTEGER is 11004

    Wsano_recovery_text: STRING is "A non-recoverable error occurred during a database lookup."

    Wsano_recovery_value: INTEGER is 11003

    Wsanotinitialised_text: STRING is "Either the application has not called WSAStartup, or WSAStartup failed."

    Wsanotinitialised_value: INTEGER is 10093

    Wsaservice_not_found_text: STRING is "No such service is known. The service cannot be found in the specified name space."

    Wsaservice_not_found_value: INTEGER is 10108

    Wsasyscallfailure_text: STRING is "A system call that should never fail has failed."

    Wsasyscallfailure_value: INTEGER is 10107

    Wsasysnotready_text: STRING is "WSAStartup cannot function at this time because the underlying system it uses to provide network services is currently unavailable."

    Wsasysnotready_value: INTEGER is 10091

    Wsatry_again_text: STRING is "This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server."

    Wsatry_again_value: INTEGER is 11002

    Wsatype_not_found_text: STRING is "The specified class was not found."

    Wsatype_not_found_value: INTEGER is 10109

    Wsavernotsupported_text: STRING is "The Windows Sockets version requested is not supported."

    Wsavernotsupported_value: INTEGER is 10092

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOWS_ERROR_MESSAGES


WEL_WINDOWS_ROUTINES Chart

class
    WEL_WINDOWS_ROUTINES

General
    cluster: wel.support
    description: "Basic Windows routines."

Ancestors
    WEL_GWL_CONSTANTS
    WEL_MB_CONSTANTS

Queries
    foreground_window: WEL_WINDOW
    is_window (hwnd: POINTER): BOOLEAN
    key_down (virtual_key: INTEGER): BOOLEAN
    key_locked (virtual_key: INTEGER): BOOLEAN
    key_to_string (key_data: INTEGER): STRING
    resource_string_id (an_id: INTEGER): STRING
    system_directory: STRING
    tick_count: INTEGER
    window_of_item (hwnd: POINTER): WEL_WINDOW
    windows_directory: STRING

Commands
    hide_cursor
    message_beep_asterisk
    message_beep_exclamation
    message_beep_hand
    message_beep_ok
    message_beep_question
    output_debug_string (s: STRING)
    set_cursor_position_absolute (x, y: INTEGER)
    show_cursor


WEL_WINDOWS_ROUTINES Flat contracts

indexing
    description: "Basic Windows routines."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:34 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOWS_ROUTINES

feature -- Status report

    foreground_window: WEL_WINDOW
            -- Foreground window (window with focus)

    is_window (hwnd: POINTER): BOOLEAN
            -- Does hwnd point to a valid Window?

    key_down (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key pressed

    key_locked (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key locked

    key_to_string (key_data: INTEGER): STRING
            -- Give the string associated with the key given by
            -- virtual_key.

    system_directory: STRING
            -- Path of the Windows system directory
        ensure
            result_not_void: Result /= void

    tick_count: INTEGER
            -- Number of milliseconds that have
            -- elapsed since Windows was started.
        ensure
            positive_result: Result >= 0

    window_of_item (hwnd: POINTER): WEL_WINDOW
            -- Retrieve Eiffel object associated with hwnd pointer.
        require
            hwnd_not_null: hwnd /= default_pointer
            is_window_pointer: is_window (hwnd)
        ensure
            is_wel_window: Result /= void implies (create {INTERNAL}).type_conforms_to ((create {INTERNAL}).dynamic_type (Result), (create {INTERNAL}).dynamic_type_from_string ("WEL_WINDOW"))

    windows_directory: STRING
            -- Path of the Windows directory
        ensure
            result_not_void: Result /= void

feature -- Basic operations

    hide_cursor
            -- Hide the cursor.

    message_beep_asterisk
            -- Play the system asterisk waveform sound.

    message_beep_exclamation
            -- Play the system exclamation waveform sound.

    message_beep_hand
            -- Play the system hand waveform sound.

    message_beep_ok
            -- Play the system ok waveform sound.

    message_beep_question
            -- Play the system question waveform sound.

    output_debug_string (s: STRING)
            -- Send a string s to the system debugger.
        require
            s_not_void: s /= void

    resource_string_id (an_id: INTEGER): STRING
            -- String identified by an_id in the resource file.
        ensure
            result_not_void: Result /= void

    set_cursor_position_absolute (x, y: INTEGER)
            -- Set the cursor position to x, y.

    show_cursor
            -- Show the cursor.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOWS_ROUTINES


WEL_WINDOWS_VERSION Chart

class
    WEL_WINDOWS_VERSION

General
    cluster: wel.support
    description: "Objects that allow the user to know about Windows versions"
    create: default_create

Ancestors
    ANY

Queries
    Comctl32_version: INTEGER
    Is_windows_2000: BOOLEAN
    Is_windows_95: BOOLEAN
    Is_windows_98: BOOLEAN
    Is_windows_9x: BOOLEAN
    Is_windows_me: BOOLEAN
    Is_windows_nt: BOOLEAN
    Is_windows_nt4: BOOLEAN
    Shell32_version: INTEGER
    Shlwapi_version: INTEGER
    Version_400: INTEGER
    Version_470: INTEGER
    Version_471: INTEGER
    Version_472: INTEGER
    Version_500: INTEGER
    Version_580: INTEGER
    Version_581: INTEGER


WEL_WINDOWS_VERSION Flat contracts

indexing
    description: "Objects that allow the user to know about Windows versions"
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:34 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOWS_VERSION

create

feature -- "Shell and Common controls" Versions

    comctl32_version: INTEGER
            -- Version of Comctl32.dll

    shell32_version: INTEGER
            -- Version of Shell32.dll

    shlwapi_version: INTEGER
            -- Version of Shlwapi.dll

feature -- Version Constants

    version_400: INTEGER
            -- version_400 <=> Microsoft® Windows® 95/Windows NT® 4.0

    version_470: INTEGER
            -- version_470 <=> Microsoft® Internet Explorer 3.x

    version_471: INTEGER
            -- version_471 <=> Microsoft® Internet Explorer 4.0

    version_472: INTEGER
            -- version_472 <=> Microsoft® Internet Explorer 4.01 & Windows® 98

    version_500: INTEGER
            -- version_500 (Shlwapi.dll) <=> Microsoft® Internet Explorer 5
            -- version_500 (Shell32.dll) <=> Microsoft® Windows® 2000

    version_580: INTEGER
            -- version_580 (Comctl32.dll) <=> Microsoft® Internet Explorer 5

    version_581: INTEGER
            -- version_581 (Comctl32.dll)<=> Microsoft® Windows 2000

feature -- Windows Versions

    is_windows_2000: BOOLEAN
        ensure
            windows2000_is_nt: Result implies is_windows_nt

    is_windows_95: BOOLEAN
            -- Is the current program running under Windows 95
            -- (OSR1, OSR2 or OSR2.5)?
        ensure
            windows95_is_9x: Result implies is_windows_9x

    is_windows_98: BOOLEAN
            -- Is the current program running under Windows 98
            -- (1st or 2nd edition)?
        ensure
            windows98_is_9x: Result implies is_windows_9x

    is_windows_9x: BOOLEAN
            -- Is the current program running under Windows 9x
            -- (Windows 95, Windows 98, Windows Me, ...)?

    is_windows_me: BOOLEAN
            -- Is the current program running under Windows Millenium Edition?
        ensure
            windows_me_is_9x: Result implies is_windows_9x

    is_windows_nt: BOOLEAN
            -- Is the current program running under Windows NT
            -- (Windows NT 3.51, Windows NT4, Windows 2000, ...)?

    is_windows_nt4: BOOLEAN
        ensure
            windows_nt4_is_nt: Result implies is_windows_nt

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOWS_VERSION


WEL_WINDOW_MANAGER Chart

class
    WEL_WINDOW_MANAGER

General
    cluster: wel.support
    description: "Window manager which is able to retrieve an Eiffel object from a HWND."

Ancestors
    WEL_WINDOWS_ROUTINES

Queries
    foreground_window: WEL_WINDOW
    is_window (hwnd: POINTER): BOOLEAN
    key_down (virtual_key: INTEGER): BOOLEAN
    key_locked (virtual_key: INTEGER): BOOLEAN
    key_to_string (key_data: INTEGER): STRING
    registered (window: WEL_WINDOW): BOOLEAN
    resource_string_id (an_id: INTEGER): STRING
    system_directory: STRING
    tick_count: INTEGER
    window_of_item (hwnd: POINTER): WEL_WINDOW
    windows_directory: STRING

Commands
    hide_cursor
    message_beep_asterisk
    message_beep_exclamation
    message_beep_hand
    message_beep_ok
    message_beep_question
    output_debug_string (s: STRING)
    register_window (window: WEL_WINDOW)
    set_cursor_position_absolute (x, y: INTEGER)
    show_cursor


WEL_WINDOW_MANAGER Flat contracts

indexing
    description: "Window manager which is able to retrieve an Eiffel object from a HWND."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:33 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WINDOW_MANAGER

feature -- Status report

    foreground_window: WEL_WINDOW
            -- Foreground window (window with focus)
            -- (from WEL_WINDOWS_ROUTINES)

    is_window (hwnd: POINTER): BOOLEAN
            -- Does hwnd point to a valid Window?
            -- (from WEL_WINDOWS_ROUTINES)

    key_down (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key pressed
            -- (from WEL_WINDOWS_ROUTINES)

    key_locked (virtual_key: INTEGER): BOOLEAN
            --Is 'virtual' key locked
            -- (from WEL_WINDOWS_ROUTINES)

    key_to_string (key_data: INTEGER): STRING
            -- Give the string associated with the key given by
            -- virtual_key.
            -- (from WEL_WINDOWS_ROUTINES)

    registered (window: WEL_WINDOW): BOOLEAN
            -- Is window registered?
        require
            window_not_void: window /= void

    system_directory: STRING
            -- Path of the Windows system directory
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

    tick_count: INTEGER
            -- Number of milliseconds that have
            -- elapsed since Windows was started.
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            positive_result: Result >= 0

    window_of_item (hwnd: POINTER): WEL_WINDOW
            -- Retrieve Eiffel object associated with hwnd pointer.
            -- (from WEL_WINDOWS_ROUTINES)
        require -- from WEL_WINDOWS_ROUTINES
            hwnd_not_null: hwnd /= default_pointer
            is_window_pointer: is_window (hwnd)
        ensure -- from WEL_WINDOWS_ROUTINES
            is_wel_window: Result /= void implies (create {INTERNAL}).type_conforms_to ((create {INTERNAL}).dynamic_type (Result), (create {INTERNAL}).dynamic_type_from_string ("WEL_WINDOW"))

    windows_directory: STRING
            -- Path of the Windows directory
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

feature -- Basic operations

    hide_cursor
            -- Hide the cursor.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_asterisk
            -- Play the system asterisk waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_exclamation
            -- Play the system exclamation waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_hand
            -- Play the system hand waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_ok
            -- Play the system ok waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    message_beep_question
            -- Play the system question waveform sound.
            -- (from WEL_WINDOWS_ROUTINES)

    output_debug_string (s: STRING)
            -- Send a string s to the system debugger.
            -- (from WEL_WINDOWS_ROUTINES)
        require -- from WEL_WINDOWS_ROUTINES
            s_not_void: s /= void

    register_window (window: WEL_WINDOW)
            -- Register window in the window manager.
        require
            window_not_void: window /= void
            unregistered: not registered (window)
        ensure
            registered: registered (window)

    resource_string_id (an_id: INTEGER): STRING
            -- String identified by an_id in the resource file.
            -- (from WEL_WINDOWS_ROUTINES)
        ensure -- from WEL_WINDOWS_ROUTINES
            result_not_void: Result /= void

    set_cursor_position_absolute (x, y: INTEGER)
            -- Set the cursor position to x, y.
            -- (from WEL_WINDOWS_ROUTINES)

    show_cursor
            -- Show the cursor.
            -- (from WEL_WINDOWS_ROUTINES)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOW_MANAGER


WEL_WORD_OPERATIONS Chart

class
    WEL_WORD_OPERATIONS

General
    cluster: wel.support
    description: "Word operations (low and high)."

Ancestors
    ANY

Queries
    cwin_hi_word (value: INTEGER): INTEGER
    cwin_lo_word (value: INTEGER): INTEGER
    cwin_make_long (low, high: INTEGER): INTEGER


WEL_WORD_OPERATIONS Flat contracts

indexing
    description: "Word operations (low and high)."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:34 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_WORD_OPERATIONS

feature -- Basic operations

    cwin_hi_word (value: INTEGER): INTEGER
            -- SDK HIWORD

    cwin_lo_word (value: INTEGER): INTEGER
            -- SDK LOWORD

    cwin_make_long (low, high: INTEGER): INTEGER
            -- SDK MAKELONG

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WORD_OPERATIONS


cluster wel.windows

Cluster
    wel.windows

Supercluster
    wel

Classes
    WEL_COMPOSITE_WINDOW
    WEL_CONTROL_WINDOW
    WEL_DIALOG
    WEL_FRAME_WINDOW
    WEL_MAIN_DIALOG
    WEL_MDI_CHILD_WINDOW
    WEL_MDI_CLIENT_WINDOW
    WEL_MDI_FRAME_WINDOW
    WEL_MODAL_DIALOG
    WEL_MODELESS_DIALOG
    WEL_POPUP_WINDOW
    WEL_WINDOW


WEL_COMPOSITE_WINDOW Chart

deferred class
    WEL_COMPOSITE_WINDOW

General
    cluster: wel.windows
    description: "Abstract notions of window which can accept children."

Ancestors
    WEL_GW_CONSTANTS
    WEL_ICON_CONSTANTS
    WEL_WINDOW
    WEL_WM_CTLCOLOR_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_COMPOSITE_WINDOW Flat contracts

indexing
    description: "Abstract notions of window which can accept children."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:34 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_COMPOSITE_WINDOW

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
        require
            exists: exists
            has_menu: has_menu
        ensure
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.

    system_menu: WEL_MENU
            -- Associated system menu
        require
            exists: exists
            has_system_menu: has_system_menu
        ensure
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
        require
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
        require
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
        require
            exists: exists
            scroller_exists: scroller /= void
        ensure
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
        require
            exists: exists
            scroller_exists: scroller /= void
        ensure
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
        require
            exists: exists
            scroller_exists: scroller /= void
        ensure
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
        require
            exists: exists
            scroller_exists: scroller /= void
        ensure
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
        require
            exists: exists
            scroller_exists: scroller /= void
        ensure
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
        require
            exists: exists
            scroller_exists: scroller /= void
        ensure
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
        require
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
        require
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
        require
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
        require
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
        require
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
        require
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
        require
            exists: exists
        ensure
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
        require
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Destroy the window and quit the application
            -- if Current is the application's main window.
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
        require
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
        require
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_COMPOSITE_WINDOW


WEL_CONTROL_WINDOW Chart

class
    WEL_CONTROL_WINDOW

General
    cluster: wel.windows
    description: "Window which can be used to design custom control."
    create: make_with_coordinates, make

Ancestors
    WEL_FRAME_WINDOW

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    Class_cursor: WEL_CURSOR
    Class_icon: WEL_ICON
    Class_menu_name: STRING
    Class_style: INTEGER
    Class_window_procedure: POINTER
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    Default_height: INTEGER
    Default_id: INTEGER
    default_processing: BOOLEAN
    Default_width: INTEGER
    Default_x: INTEGER
    Default_y: INTEGER
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    font: WEL_FONT
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_font: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    Maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    Maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_font (a_font: WEL_FONT)
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_CONTROL_WINDOW Flat contracts

indexing
    description: "Window which can be used to design custom control."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:34 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_CONTROL_WINDOW

create

    make (a_parent: WEL_COMPOSITE_WINDOW; a_name: STRING)
            -- Make the window as a child of a_parent and
            -- a_name as a title.
            -- (from WEL_FRAME_WINDOW)
        require -- from WEL_FRAME_WINDOW
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_FRAME_WINDOW
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)

    make_with_coordinates (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height: INTEGER)
            -- Make a control using a_parent as parent and
            -- a_name as name. a_x, a_y, a_width, and
            -- a_height are used to place and size the control
            -- at the creation.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure
            parent_set: parent = a_parent

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    font: WEL_FONT
            -- Font with which the control is drawing its text.
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_font: BOOLEAN
            -- Does the control use the system font?
        require
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_font (a_font: WEL_FONT)
            -- Set font with a_font.
        require
            exists: exists
            a_font_not_void: a_font /= void
            a_font_exists: a_font.exists
        ensure
            font_set: not has_system_font implies font.item = a_font.item

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Destroy the window and quit the application
            -- if Current is the application's main window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Default creation values

    default_height: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_width.
            -- (from WEL_FRAME_WINDOW)

    default_id: INTEGER
            -- Default window id.
            -- (Zero by default).
            -- (from WEL_FRAME_WINDOW)

    default_width: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_x: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_y, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_y: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Standard window class values

    class_cursor: WEL_CURSOR
            -- Standard arrow cursor used to create the window
            -- class.
            -- Can be redefined to return a user-defined cursor.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_icon: WEL_ICON
            -- Standard application icon used to create the
            -- window class.
            -- Can be redefined to return a user-defined icon.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_menu_name: STRING
            -- Window's menu used to create the window class.
            -- Can be redefined to return a user-defined menu.
            -- (None by default).
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void

    class_style: INTEGER
            -- Standard style used to create the window class.
            -- Can be redefined to return a user-defined style.
            -- (from WEL_FRAME_WINDOW)

    class_window_procedure: POINTER
            -- Standard window procedure
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_null: Result /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_CONTROL_WINDOW


WEL_DIALOG Chart

deferred class
    WEL_DIALOG

General
    cluster: wel.windows
    description: "Dialog box which can be loaded from a resource. Common ancestor to modal and modeless dialog box."

Ancestors
    WEL_COMPOSITE_WINDOW
    WEL_ID_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    ok_pushed: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    result_id: INTEGER
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    activate
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_abort
    on_cancel
    on_ignore
    on_no
    on_ok
    on_retry
    on_yes
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    setup_dialog
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    terminate (a_result: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_DIALOG Flat contracts

indexing
    description: "Dialog box which can be loaded from a resource. Common ancestor to modal and modeless dialog box."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:34 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_DIALOG

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    result_id: INTEGER
            -- Last control id used to close the dialog.
            -- See class WEL_ID_CONSTANTS for the different values.

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ok_pushed: BOOLEAN
            -- Has the OK button been pushed?

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate
            -- Activate the dialog box.
            -- Can be called several times.
        require
            parent_exists: parent /= void implies parent.exists
            not_exists: not exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Terminate the dialog.
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    on_abort
            -- Button Abort has been pressed.
        require
            exists: exists

    on_cancel
            -- Button Cancel has been pressed.
        require
            exists: exists

    on_ignore
            -- Button Ignore has been pressed.
        require
            exists: exists

    on_no
            -- Button No has been pressed.
        require
            exists: exists

    on_ok
            -- Button Ok has been pressed.
        require
            exists: exists

    on_retry
            -- Button Retry has been pressed.
        require
            exists: exists

    on_yes
            -- Button Yes has been pressed.
        require
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    setup_dialog
            -- May be redefined to setup the dialog and its
            -- children.
        require
            exists: exists

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    terminate (a_result: INTEGER)
            -- Terminate the dialog with a_result.
            -- result_id will contain a_result.
        require
            exists: exists
        ensure
            result_id_set: result_id = a_result

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_DIALOG


WEL_FRAME_WINDOW Chart

class
    WEL_FRAME_WINDOW

General
    cluster: wel.windows
    description: "An overlapped window with a frame."
    create: make_top, make_child

Ancestors
    WEL_COLOR_CONSTANTS
    WEL_COMPOSITE_WINDOW
    WEL_CS_CONSTANTS
    WEL_IDC_CONSTANTS
    WEL_IDI_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    Class_background: WEL_BRUSH
    Class_cursor: WEL_CURSOR
    Class_icon: WEL_ICON
    Class_menu_name: STRING
    Class_name: STRING
    Class_style: INTEGER
    Class_window_procedure: POINTER
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    Default_height: INTEGER
    Default_id: INTEGER
    default_processing: BOOLEAN
    Default_style: INTEGER
    Default_width: INTEGER
    Default_x: INTEGER
    Default_y: INTEGER
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_FRAME_WINDOW Flat contracts

indexing
    description: "An overlapped window with a frame."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:34 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_FRAME_WINDOW

create

    make_child (a_parent: WEL_COMPOSITE_WINDOW; a_name: STRING)
            -- Make the window as a child of a_parent and
            -- a_name as a title.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)

    make_top (a_name: STRING)
            -- Make a top window (without parent) with a_name
            -- as a title.
        ensure
            parent_set: parent = void
            exists: exists
            name_set: a_name /= void implies text.is_equal (a_name)

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Destroy the window and quit the application
            -- if Current is the application's main window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Default creation values

    default_height: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_width.

    default_id: INTEGER
            -- Default window id.
            -- (Zero by default).

    default_style: INTEGER
            -- Overlapped window style.
            -- By default, a frame window is not visible
            -- at the creation time. show needs to be called.
            -- This solution avoids a bad visual effect when
            -- the children are created one by one inside
            -- the window.

    default_width: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_height.

    default_x: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_y, default_width and default_height.

    default_y: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_width and default_height.

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Standard window class values

    class_background: WEL_BRUSH
            -- Standard window background color used to create the
            -- window class.
            -- Can be redefined to return a user-defined brush.
        require
            background_brush_not_set: background_brush = void
        ensure
            result_not_void: Result /= void

    class_cursor: WEL_CURSOR
            -- Standard arrow cursor used to create the window
            -- class.
            -- Can be redefined to return a user-defined cursor.
        ensure
            result_not_void: Result /= void
            result_exists: Result.exists

    class_icon: WEL_ICON
            -- Standard application icon used to create the
            -- window class.
            -- Can be redefined to return a user-defined icon.
        ensure
            result_not_void: Result /= void
            result_exists: Result.exists

    class_menu_name: STRING
            -- Window's menu used to create the window class.
            -- Can be redefined to return a user-defined menu.
            -- (None by default).
        ensure
            result_not_void: Result /= void

    class_name: STRING
            -- Window class name used to create the window class.
            -- Can be redefined to return a user-defined class name.
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    class_style: INTEGER
            -- Standard style used to create the window class.
            -- Can be redefined to return a user-defined style.

    class_window_procedure: POINTER
            -- Standard window procedure
        ensure
            result_not_null: Result /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_FRAME_WINDOW


WEL_MAIN_DIALOG Chart

class
    WEL_MAIN_DIALOG

General
    cluster: wel.windows
    description: "Modeless dialog box to use as a application's main window."
    create: make_by_name, make_by_id

Ancestors
    WEL_MODELESS_DIALOG

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    ok_pushed: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    result_id: INTEGER
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    activate
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_abort
    on_cancel
    on_ignore
    on_no
    on_ok
    on_retry
    on_yes
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    setup_dialog
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    terminate (a_result: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_MAIN_DIALOG Flat contracts

indexing
    description: "Modeless dialog box to use as a application's main window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.4 $"

class interface
    WEL_MAIN_DIALOG

create

    make_by_id (an_id: INTEGER)
            -- Initialize a loadable dialog box identified by
            -- an_id.
        ensure
            no_parent: parent = void
            resource_id_set: resource_id = an_id
            dialog_children_not_void: dialog_children /= void

    make_by_name (a_name: STRING)
            -- Initialize a loadable dialog box identified by
            -- a_name.
        require
            name_not_void: a_name /= void
            name_not_empty: not a_name.is_empty
        ensure
            no_parent: parent = void
            resource_name_set: resource_name.is_equal (a_name)
            dialog_children_not_void: dialog_children /= void

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    result_id: INTEGER
            -- Last control id used to close the dialog.
            -- See class WEL_ID_CONSTANTS for the different values.
            -- (from WEL_DIALOG)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ok_pushed: BOOLEAN
            -- Has the OK button been pushed?
            -- (from WEL_DIALOG)

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate
            -- Activate the dialog.
        require -- from WEL_DIALOG
            parent_exists: parent /= void implies parent.exists
            not_exists: not exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Terminate the dialog.
            -- (from WEL_DIALOG)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    on_abort
            -- Button Abort has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_cancel
            -- Button Cancel has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_ignore
            -- Button Ignore has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_no
            -- Button No has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_ok
            -- Button Ok has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_retry
            -- Button Retry has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_yes
            -- Button Yes has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    setup_dialog
            -- May be redefined to setup the dialog and its
            -- children.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    terminate (a_result: INTEGER)
            -- Terminate the dialog with a_result.
            -- result_id will contain a_result.
            -- (from WEL_MODELESS_DIALOG)
        require -- from WEL_DIALOG
            exists: exists
        ensure -- from WEL_DIALOG
            result_id_set: result_id = a_result

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MAIN_DIALOG


WEL_MDI_CHILD_WINDOW Chart

class
    WEL_MDI_CHILD_WINDOW

General
    cluster: wel.windows
    description: "MDI child window to insert into a MDI client window."
    create: make

Ancestors
    WEL_FRAME_WINDOW

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    Class_cursor: WEL_CURSOR
    Class_icon: WEL_ICON
    Class_menu_name: STRING
    Class_style: INTEGER
    Class_window_procedure: POINTER
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    Default_height: INTEGER
    Default_id: INTEGER
    default_processing: BOOLEAN
    Default_style: INTEGER
    Default_width: INTEGER
    Default_x: INTEGER
    Default_y: INTEGER
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_MDI_FRAME_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_MDI_CHILD_WINDOW Flat contracts

indexing
    description: "MDI child window to insert into a MDI client window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MDI_CHILD_WINDOW

create

    make (a_parent: WEL_COMPOSITE_WINDOW; a_name: STRING)
            -- Make the window as a child of a_parent and
            -- a_name as a title.
            -- (from WEL_FRAME_WINDOW)
        require -- from WEL_FRAME_WINDOW
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_FRAME_WINDOW
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_MDI_FRAME_WINDOW
            -- Parent window

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Destroy the window.
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Default creation values

    default_height: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_width.
            -- (from WEL_FRAME_WINDOW)

    default_id: INTEGER
            -- Default window id.
            -- (Zero by default).
            -- (from WEL_FRAME_WINDOW)

    default_style: INTEGER
            -- Overlapped window style.
            -- By default, a frame window is not visible
            -- at the creation time. show needs to be called.
            -- This solution avoids a bad visual effect when
            -- the children are created one by one inside
            -- the window.
            -- (from WEL_FRAME_WINDOW)

    default_width: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_x: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_y, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_y: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Standard window class values

    class_cursor: WEL_CURSOR
            -- Standard arrow cursor used to create the window
            -- class.
            -- Can be redefined to return a user-defined cursor.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_icon: WEL_ICON
            -- Standard application icon used to create the
            -- window class.
            -- Can be redefined to return a user-defined icon.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_menu_name: STRING
            -- Window's menu used to create the window class.
            -- Can be redefined to return a user-defined menu.
            -- (None by default).
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void

    class_style: INTEGER
            -- Standard style used to create the window class.
            -- Can be redefined to return a user-defined style.
            -- (from WEL_FRAME_WINDOW)

    class_window_procedure: POINTER
            -- Standard window procedure
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_null: Result /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MDI_CHILD_WINDOW


WEL_MDI_CLIENT_WINDOW Chart

class
    WEL_MDI_CLIENT_WINDOW

General
    cluster: wel.windows
    description: "MDI client window to insert into a MDI frame window."
    create: make

Ancestors
    WEL_COMPOSITE_WINDOW
    WEL_MDI_TILE_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    active_window: WEL_MDI_CHILD_WINDOW
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_active_window: BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    arrange_icons
    bring_to_top
    cascade_children
    destroy
    destroy_window (child: WEL_MDI_CHILD_WINDOW)
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    tile_children_horizontal
    tile_children_vertical
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_MDI_CLIENT_WINDOW Flat contracts

indexing
    description: "MDI client window to insert into a MDI frame window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MDI_CLIENT_WINDOW

create

    make (a_parent: WEL_COMPOSITE_WINDOW; a_menu: WEL_MENU; first_child: INTEGER)
            -- Make a MDI client window named a_name using
            -- a_menu as the application's Window menu.
            -- first_child specifies the child window identifier
            -- of the first MDI child window created. Windows
            -- increments the identifier for each additionnal
            -- MDI child window the application creates. These
            -- identifiers are used in on_command_control_id when
            -- a child window is chosen from the Window menu; they
            -- should not conflict with any other command
            -- identifiers.
        require
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal ("")

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    active_window: WEL_MDI_CHILD_WINDOW
            -- Currently active window.
        require
            exists: exists
            has_active_window: has_active_window
        ensure
            result_not_void: Result /= void

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_active_window: BOOLEAN
            -- Is a window currently active?
        require
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arrange_icons
            -- Arrange iconized child windows.
        require
            exists: exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    cascade_children
            -- Cascade the child windows.
        require
            exists: exists

    destroy
            -- Destroy the window and quit the application
            -- if Current is the application's main window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    destroy_window (child: WEL_MDI_CHILD_WINDOW)
            -- Destroy the child window child.
        require
            exists: exists
            child_not_void: child /= void
            child_exists: child.exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    tile_children_horizontal
            -- Horizontally tile the child windows.
        require
            exists: exists

    tile_children_vertical
            -- Vertically tile the child windows.
        require
            exists: exists

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MDI_CLIENT_WINDOW


WEL_MDI_FRAME_WINDOW Chart

class
    WEL_MDI_FRAME_WINDOW

General
    cluster: wel.windows
    description: "MDI frame window containing a MDI client window."
    create: make_top

Ancestors
    WEL_FRAME_WINDOW

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    active_window: WEL_MDI_CHILD_WINDOW
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    Class_cursor: WEL_CURSOR
    Class_icon: WEL_ICON
    Class_menu_name: STRING
    Class_style: INTEGER
    Class_window_procedure: POINTER
    client_rect: WEL_RECT
    client_window: WEL_MDI_CLIENT_WINDOW
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    Default_height: INTEGER
    Default_id: INTEGER
    default_processing: BOOLEAN
    Default_style: INTEGER
    Default_width: INTEGER
    Default_x: INTEGER
    Default_y: INTEGER
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_active_window: BOOLEAN
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    arrange_icons
    bring_to_top
    cascade_children
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    tile_children_horizontal
    tile_children_vertical
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_MDI_FRAME_WINDOW Flat contracts

indexing
    description: "MDI frame window containing a MDI client window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MDI_FRAME_WINDOW

create

    make_top (a_name: STRING; a_menu: WEL_MENU; first_child: INTEGER)
            -- Make a MDI frame window named a_name using
            -- a_menu as the application's Window menu.
            -- first_child specifies the child window identifier
            -- of the first MDI child window created. Windows
            -- increments the identifier for each additional
            -- MDI child window the application creates. These
            -- identifiers are used in on_command_control_id when
            -- a child window is chosen from the Window menu; they
            -- should not conflict with any other command
            -- identifiers.
        require
            a_name_not_void: a_name /= void
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure
            parent_set: parent = void
            exists: exists
            name_set: text.is_equal (a_name)
            client_window_not_void: client_window /= void
            client_window_exists: client_window.exists

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    client_window: WEL_MDI_CLIENT_WINDOW
            -- MDI client window which contains child windows

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    active_window: WEL_MDI_CHILD_WINDOW
            -- Window currently active
        require
            exists: exists
            client_window_not_void: client_window /= void
            client_window_exists: client_window.exists
            has_active_window: has_active_window

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_active_window: BOOLEAN
            -- Is a window currently active?
        require
            exists: exists
            client_window_not_void: client_window /= void
            client_window_exists: client_window.exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    arrange_icons
            -- Arrange iconized child windows.
        require
            exists: exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    cascade_children
            -- Cascade the child windows.
        require
            exists: exists

    destroy
            -- Destroy the window and quit the application
            -- if Current is the application's main window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    tile_children_horizontal
            -- Horizontally tile the child windows.
        require
            exists: exists

    tile_children_vertical
            -- Vertically tile the child windows.
        require
            exists: exists

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Default creation values

    default_height: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_width.
            -- (from WEL_FRAME_WINDOW)

    default_id: INTEGER
            -- Default window id.
            -- (Zero by default).
            -- (from WEL_FRAME_WINDOW)

    default_style: INTEGER
            -- Overlapped window style.
            -- By default, a frame window is not visible
            -- at the creation time. show needs to be called.
            -- This solution avoids a bad visual effect when
            -- the children are created one by one inside
            -- the window.
            -- (from WEL_FRAME_WINDOW)

    default_width: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_x: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_y, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_y: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Standard window class values

    class_cursor: WEL_CURSOR
            -- Standard arrow cursor used to create the window
            -- class.
            -- Can be redefined to return a user-defined cursor.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_icon: WEL_ICON
            -- Standard application icon used to create the
            -- window class.
            -- Can be redefined to return a user-defined icon.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_menu_name: STRING
            -- Window's menu used to create the window class.
            -- Can be redefined to return a user-defined menu.
            -- (None by default).
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void

    class_style: INTEGER
            -- Standard style used to create the window class.
            -- Can be redefined to return a user-defined style.
            -- (from WEL_FRAME_WINDOW)

    class_window_procedure: POINTER
            -- Standard window procedure
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_null: Result /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MDI_FRAME_WINDOW


WEL_MODAL_DIALOG Chart

class
    WEL_MODAL_DIALOG

General
    cluster: wel.windows
    description: "Modal dialog box that does not allow the user to switch between the dialog box and other programs."
    create: make_by_name, make_by_id, make_by_template

Ancestors
    WEL_DIALOG

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    ok_pushed: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    result_id: INTEGER
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    activate
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_abort
    on_cancel
    on_ignore
    on_no
    on_ok
    on_retry
    on_yes
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    setup_dialog
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    terminate (a_result: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_MODAL_DIALOG Flat contracts

indexing
    description: "Modal dialog box that does not allow the user to switch between the dialog box and other programs."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MODAL_DIALOG

create

    make_by_id (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Initialize a loadable dialog box identified by
            -- an_id using a_parent as parent.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            parent_exists: a_parent /= void implies a_parent.exists
        ensure -- from WEL_DIALOG
            parent_set: parent = a_parent
            resource_id_set: resource_id = an_id
            dialog_children_not_void: dialog_children /= void

    make_by_name (a_parent: WEL_COMPOSITE_WINDOW; a_name: STRING)
            -- Initialize a loadable dialog box identified by
            -- a_name using a_parent as parent.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            parent_exists: a_parent /= void implies a_parent.exists
            name_not_void: a_name /= void
            name_not_empty: not a_name.is_empty
        ensure -- from WEL_DIALOG
            parent_set: parent = a_parent
            resource_name_set: resource_name.is_equal (a_name)
            dialog_children_not_void: dialog_children /= void

    make_by_template (a_parent: WEL_COMPOSITE_WINDOW; a_template: WEL_DLG_TEMPLATE)
            -- (from WEL_DIALOG)
        ensure -- from WEL_DIALOG
            dialog_children_not_void: dialog_children /= void

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    result_id: INTEGER
            -- Last control id used to close the dialog.
            -- See class WEL_ID_CONSTANTS for the different values.
            -- (from WEL_DIALOG)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ok_pushed: BOOLEAN
            -- Has the OK button been pushed?
            -- (from WEL_DIALOG)

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate
            -- Activate the dialog box.
            -- Can be called several times.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            parent_exists: parent /= void implies parent.exists
            not_exists: not exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Terminate the dialog.
            -- (from WEL_DIALOG)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    on_abort
            -- Button Abort has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_cancel
            -- Button Cancel has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_ignore
            -- Button Ignore has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_no
            -- Button No has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_ok
            -- Button Ok has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_retry
            -- Button Retry has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_yes
            -- Button Yes has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    setup_dialog
            -- May be redefined to setup the dialog and its
            -- children.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    terminate (a_result: INTEGER)
            -- Terminate the dialog with a_result.
            -- result_id will contain a_result.
        require -- from WEL_DIALOG
            exists: exists
        ensure -- from WEL_DIALOG
            result_id_set: result_id = a_result

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MODAL_DIALOG


WEL_MODELESS_DIALOG Chart

class
    WEL_MODELESS_DIALOG

General
    cluster: wel.windows
    description: "Modeless dialog box that allows the user to switch between the dialog box and the application."
    create: make_by_name, make_by_id, make_by_template

Ancestors
    WEL_DIALOG

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    ok_pushed: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    result_id: INTEGER
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    activate
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    on_abort
    on_cancel
    on_ignore
    on_no
    on_ok
    on_retry
    on_yes
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    setup_dialog
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    terminate (a_result: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_MODELESS_DIALOG Flat contracts

indexing
    description: "Modeless dialog box that allows the user to switch between the dialog box and the application."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_MODELESS_DIALOG

create

    make_by_id (a_parent: WEL_WINDOW; an_id: INTEGER)
            -- Initialize a loadable dialog box identified by
            -- an_id using a_parent as parent.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            parent_exists: a_parent /= void implies a_parent.exists
        ensure -- from WEL_DIALOG
            parent_set: parent = a_parent
            resource_id_set: resource_id = an_id
            dialog_children_not_void: dialog_children /= void

    make_by_name (a_parent: WEL_COMPOSITE_WINDOW; a_name: STRING)
            -- Initialize a loadable dialog box identified by
            -- a_name using a_parent as parent.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            parent_exists: a_parent /= void implies a_parent.exists
            name_not_void: a_name /= void
            name_not_empty: not a_name.is_empty
        ensure -- from WEL_DIALOG
            parent_set: parent = a_parent
            resource_name_set: resource_name.is_equal (a_name)
            dialog_children_not_void: dialog_children /= void

    make_by_template (a_parent: WEL_COMPOSITE_WINDOW; a_template: WEL_DLG_TEMPLATE)
            -- (from WEL_DIALOG)
        ensure -- from WEL_DIALOG
            dialog_children_not_void: dialog_children /= void

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    result_id: INTEGER
            -- Last control id used to close the dialog.
            -- See class WEL_ID_CONSTANTS for the different values.
            -- (from WEL_DIALOG)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ok_pushed: BOOLEAN
            -- Has the OK button been pushed?
            -- (from WEL_DIALOG)

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    activate
            -- Activate the dialog box.
            -- Can be called several times.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            parent_exists: parent /= void implies parent.exists
            not_exists: not exists

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Terminate the dialog.
            -- (from WEL_DIALOG)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    on_abort
            -- Button Abort has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_cancel
            -- Button Cancel has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_ignore
            -- Button Ignore has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_no
            -- Button No has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_ok
            -- Button Ok has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_retry
            -- Button Retry has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    on_yes
            -- Button Yes has been pressed.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    setup_dialog
            -- May be redefined to setup the dialog and its
            -- children.
            -- (from WEL_DIALOG)
        require -- from WEL_DIALOG
            exists: exists

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    terminate (a_result: INTEGER)
            -- Terminate the dialog with a_result.
            -- result_id will contain a_result.
        require -- from WEL_DIALOG
            exists: exists
        ensure -- from WEL_DIALOG
            result_id_set: result_id = a_result

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_MODELESS_DIALOG


WEL_POPUP_WINDOW Chart

class
    WEL_POPUP_WINDOW

General
    cluster: wel.windows
    description: "Window which can be moved outside the parent window."
    create: make_top, make_child

Ancestors
    WEL_FRAME_WINDOW

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    children: LIST [WEL_WINDOW]
    Class_background: WEL_BRUSH
    Class_cursor: WEL_CURSOR
    Class_icon: WEL_ICON
    Class_menu_name: STRING
    Class_name: STRING
    Class_style: INTEGER
    Class_window_procedure: POINTER
    client_rect: WEL_RECT
    closeable: BOOLEAN
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    Default_height: INTEGER
    Default_id: INTEGER
    default_processing: BOOLEAN
    Default_width: INTEGER
    Default_x: INTEGER
    Default_y: INTEGER
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_menu: BOOLEAN
    has_return_value: BOOLEAN
    has_system_menu: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    horizontal_position: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_horizontal_position: INTEGER
    maximal_vertical_position: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    menu: WEL_MENU
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_horizontal_position: INTEGER
    minimal_vertical_position: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    scroller: WEL_SCROLLER
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    system_menu: WEL_MENU
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    vertical_position: INTEGER
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    draw_menu
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    horizontal_update (inc, position: INTEGER)
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_absolute (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_horizontal_position (position: INTEGER)
    set_horizontal_range (minimum, maximum: INTEGER)
    set_icon (a_small_icon, a_big_icon: WEL_ICON)
    set_item (an_item: POINTER)
    set_menu (a_menu: WEL_MENU)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_vertical_position (position: INTEGER)
    set_vertical_range (minimum, maximum: INTEGER)
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    unset_menu
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    vertical_update (inc, position: INTEGER)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_POPUP_WINDOW Flat contracts

indexing
    description: "Window which can be moved outside the parent window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_POPUP_WINDOW

create

    make_child (a_parent: WEL_COMPOSITE_WINDOW; a_name: STRING)
            -- Make the window as a child of a_parent and
            -- a_name as a title.
            -- (from WEL_FRAME_WINDOW)
        require -- from WEL_FRAME_WINDOW
            a_parent_not_void: a_parent /= void
            a_parent_exists: a_parent.exists
            a_name_not_void: a_name /= void
        ensure -- from WEL_FRAME_WINDOW
            parent_set: parent = a_parent
            exists: exists
            name_set: text.is_equal (a_name)

    make_top (a_name: STRING)
            -- Make a top window (without parent) with a_name
            -- as a title.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            parent_set: parent = void
            exists: exists
            name_set: a_name /= void implies text.is_equal (a_name)

feature -- Access

    children: LIST [WEL_WINDOW]
            -- Construct a linear representation of children.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.
            -- (from WEL_WINDOW)

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    menu: WEL_MENU
            -- Associated menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window
            -- (from WEL_WINDOW)

    scroller: WEL_SCROLLER
            -- Scroller object for processing scroll messages.
            -- (from WEL_COMPOSITE_WINDOW)

    system_menu: WEL_MENU
            -- Associated system menu
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_system_menu: has_system_menu
        ensure -- from WEL_COMPOSITE_WINDOW
            result_not_void: Result /= void

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    closeable: BOOLEAN
            -- Can the user close the window?
            -- Yes by default.
            -- (from WEL_COMPOSITE_WINDOW)

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?
            -- (from WEL_WINDOW)

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?
            -- (from WEL_WINDOW)

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    has_menu: BOOLEAN
            -- Does the window have a menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_system_menu: BOOLEAN
            -- Does the window have a system menu?
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)
            -- (from WEL_WINDOW)

    height: INTEGER
            -- Window height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    horizontal_position: INTEGER
            -- Current position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position
            result_large_enough: Result >= minimal_horizontal_position

    is_inside: BOOLEAN
            -- Is the current window inside another window?
            -- (from WEL_WINDOW)

    maximal_height: INTEGER
            -- Maximal height allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_height

    maximal_horizontal_position: INTEGER
            -- Maxium position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_horizontal_position

    maximal_vertical_position: INTEGER
            -- Maxium position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_large_enough: Result >= minimal_vertical_position

    maximal_width: INTEGER
            -- Maximal width allowed for the window
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_horizontal_position: INTEGER
            -- Minimum position of the horizontal scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_horizontal_position

    minimal_vertical_position: INTEGER
            -- Minimum position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- (from WEL_COMPOSITE_WINDOW)
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    style: INTEGER
            -- Window style
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    text: STRING
            -- Window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            positive_result: Result >= 0

    vertical_position: INTEGER
            -- Current position of the vertical scroll box
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
        ensure -- from WEL_COMPOSITE_WINDOW
            result_small_enough: Result <= maximal_vertical_position
            result_large_enough: Result >= minimal_vertical_position

    width: INTEGER
            -- Window width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?
            -- (from WEL_WINDOW)

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            enabled: enabled

    enable_commands
            -- Enable commands execution.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
            -- (from WEL_WINDOW)
        ensure -- from WEL_WINDOW
            default_processing_enabled: default_processing

    hide
            -- Hide the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            hidden: not shown

    horizontal_update (inc, position: INTEGER)
            -- Update the window and the horizontal scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    maximize
            -- Maximize the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_capture: has_capture
        ensure -- from WEL_WINDOW
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure -- from WEL_WINDOW
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_focus
            -- Set the focus to Current
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure -- from WEL_WINDOW
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_horizontal_position (position: INTEGER)
            -- Set horizontal_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_horizontal_position
            position_large_enough: position >= minimal_horizontal_position
        ensure -- from WEL_COMPOSITE_WINDOW
            horizontal_position_set: horizontal_position = position

    set_horizontal_range (minimum, maximum: INTEGER)
            -- Set minimal_horizontal_position and
            -- maximal_horizontal_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_horizontal_position_set: minimal_horizontal_position = minimum
            maximal_horizontal_position_set: maximal_horizontal_position = maximum

    set_icon (a_small_icon: WEL_ICON; a_big_icon: WEL_ICON)
            -- Set the small (16x16) and the normal (32x32) icon for this window.
            --
            -- Note: Set a_small_icon to Void to remove the small icon and
            --       a_big_icon to Void to remove the big icon.
            -- (from WEL_COMPOSITE_WINDOW)

    set_menu (a_menu: WEL_MENU)
            -- Set menu with a_menu.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            a_menu_not_void: a_menu /= void
            a_menu_exists: a_menu.exists
        ensure -- from WEL_COMPOSITE_WINDOW
            has_menu: has_menu
            menu_set: menu.item = a_menu.item

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    set_vertical_position (position: INTEGER)
            -- Set vertical_position with position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

    set_vertical_range (minimum, maximum: INTEGER)
            -- Set minimal_vertical_position and
            -- maximal_vertical_position with minimum and
            -- maximum.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            scroller_exists: scroller /= void
            consistent_range: minimum <= maximum
        ensure -- from WEL_COMPOSITE_WINDOW
            minimal_vertical_position_set: minimal_vertical_position = minimum
            maximal_vertical_position_set: maximal_vertical_position = maximum

    show
            -- Show the window
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unset_menu
            -- Unset the current menu associated to the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
        ensure -- from WEL_COMPOSITE_WINDOW
            menu_unset: not has_menu

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.
            -- (from WEL_WINDOW)

    vertical_update (inc, position: INTEGER)
            -- Update the window and the vertical scroll box with
            -- inc and position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            position_small_enough: position <= maximal_vertical_position
            position_large_enough: position >= minimal_vertical_position
        ensure -- from WEL_COMPOSITE_WINDOW
            vertical_position_set: vertical_position = position

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?
            -- (from WEL_WINDOW)

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

feature -- Removal

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    destroy
            -- Destroy the window and quit the application
            -- if Current is the application's main window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
        ensure -- from WEL_WINDOW
            not_exists: not exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    draw_menu
            -- Draw the menu bar associated with the window.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists
            has_menu: has_menu

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    move_absolute (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y absolute position.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_COMPOSITE_WINDOW
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
            -- (from WEL_COMPOSITE_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure -- from WEL_WINDOW
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure -- from WEL_WINDOW
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.
            -- (from WEL_WINDOW)

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate
            -- Validate the entire client area of the window.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
            -- (from WEL_WINDOW)
        require -- from WEL_WINDOW
            exists: exists
            help_file_not_void: help_file /= void

feature -- Default creation values

    default_height: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_width.
            -- (from WEL_FRAME_WINDOW)

    default_id: INTEGER
            -- Default window id.
            -- (Zero by default).
            -- (from WEL_FRAME_WINDOW)

    default_width: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_y and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_x: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_y, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

    default_y: INTEGER
            -- Default position and dimension when the window is
            -- created.
            -- Was declared in WEL_FRAME_WINDOW as synonym of default_x, default_width and default_height.
            -- (from WEL_FRAME_WINDOW)

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.
            -- (from WEL_WINDOW)

feature -- Standard window class values

    class_background: WEL_BRUSH
            -- Standard window background color used to create the
            -- window class.
            -- Can be redefined to return a user-defined brush.
            -- (from WEL_FRAME_WINDOW)
        require -- from WEL_FRAME_WINDOW
            background_brush_not_set: background_brush = void
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void

    class_cursor: WEL_CURSOR
            -- Standard arrow cursor used to create the window
            -- class.
            -- Can be redefined to return a user-defined cursor.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_icon: WEL_ICON
            -- Standard application icon used to create the
            -- window class.
            -- Can be redefined to return a user-defined icon.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void
            result_exists: Result.exists

    class_menu_name: STRING
            -- Window's menu used to create the window class.
            -- Can be redefined to return a user-defined menu.
            -- (None by default).
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_void: Result /= void

    class_name: STRING
            -- Window class name used to create the window class.
            -- Can be redefined to return a user-defined class name.
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_WINDOW
            result_not_void: Result /= void

    class_style: INTEGER
            -- Standard style used to create the window class.
            -- Can be redefined to return a user-defined style.
            -- (from WEL_FRAME_WINDOW)

    class_window_procedure: POINTER
            -- Standard window procedure
            -- (from WEL_FRAME_WINDOW)
        ensure -- from WEL_FRAME_WINDOW
            result_not_null: Result /= default_pointer

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_POPUP_WINDOW


WEL_WINDOW Chart

deferred class
    WEL_WINDOW

General
    cluster: wel.windows
    description: "Abstract notions of a window."

Ancestors
    WEL_ANY
    WEL_BIT_OPERATIONS
    WEL_ESB_CONSTANTS
    WEL_HWND_CONSTANTS
    WEL_ID_CONSTANTS
    WEL_MB_CONSTANTS
    WEL_RETURN_VALUE
    WEL_SB_CONSTANTS
    WEL_SW_CONSTANTS
    WEL_SWP_CONSTANTS
    WEL_SYSTEM_METRICS
    WEL_WA_CONSTANTS
    WEL_WINDOW_MANAGER
    WEL_WM_CONSTANTS
    WEL_WORD_OPERATIONS
    WEL_WS_CONSTANTS

Queries
    absolute_x: INTEGER
    absolute_y: INTEGER
    background_brush: WEL_BRUSH
    captured_window: WEL_WINDOW
    client_rect: WEL_RECT
    command (message: INTEGER): WEL_COMMAND
    command_argument (message: INTEGER): ANY
    command_exists (message: INTEGER): BOOLEAN
    commands: WEL_COMMAND_MANAGER
    commands_enabled: BOOLEAN
    default_processing: BOOLEAN
    enabled: BOOLEAN
    ex_style: INTEGER
    exists: BOOLEAN
    focused_window: WEL_WINDOW
    has_capture: BOOLEAN
    has_focus: BOOLEAN
    has_heavy_capture: BOOLEAN
    has_horizontal_scroll_bar: BOOLEAN
    has_return_value: BOOLEAN
    has_system_window_locked: BOOLEAN
    has_vertical_scroll_bar: BOOLEAN
    heavy_capture_activated: BOOLEAN
    height: INTEGER
    is_inside: BOOLEAN
    item: POINTER
    maximal_height: INTEGER
    maximal_width: INTEGER
    maximized: BOOLEAN
    message_return_value: INTEGER
    minimal_height: INTEGER
    minimal_width: INTEGER
    minimized: BOOLEAN
    parent: WEL_WINDOW
    placement: WEL_WINDOW_PLACEMENT
    shared: BOOLEAN
    shown: BOOLEAN
    style: INTEGER
    text: STRING
    text_length: INTEGER
    to_integer: INTEGER
    valid_hwnd_constant (c: POINTER): BOOLEAN
    width: INTEGER
    window_captured: BOOLEAN
    window_rect: WEL_RECT
    x: INTEGER
    y: INTEGER

Commands
    bring_to_top
    destroy
    disable
    disable_commands
    disable_default_processing
    disable_horizontal_scroll_bar
    disable_vertical_scroll_bar
    dispose
    enable
    enable_commands
    enable_default_processing
    enable_horizontal_scroll_bar
    enable_vertical_scroll_bar
    hide
    hide_horizontal_scroll_bar
    hide_scroll_bars
    hide_vertical_scroll_bar
    insert_after (a_window: WEL_WINDOW)
    invalidate
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
    invalidate_without_background
    kill_timer (timer_id: INTEGER)
    lock_window_update
    maximize
    minimize
    move (a_x, a_y: INTEGER)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
    register_current_window
    release_capture
    release_heavy_capture
    remove_command (message: INTEGER)
    resize (a_width, a_height: INTEGER)
    restore
    scroll (a_x, a_y: INTEGER)
    set_capture
    set_class_icon (new_icon: WEL_ICON)
    set_class_small_icon (new_icon: WEL_ICON)
    set_default_processing (value: BOOLEAN)
    set_ex_style (an_ex_style: INTEGER)
    set_focus
    set_heavy_capture
    set_height (a_height: INTEGER)
    set_item (an_item: POINTER)
    set_message_return_value (value: INTEGER)
    set_parent (a_parent: WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
    set_shared
    set_style (a_style: INTEGER)
    set_text (a_text: STRING)
    set_timer (timer_id, time_out: INTEGER)
    set_unshared
    set_width (a_width: INTEGER)
    set_x (a_x: INTEGER)
    set_y (a_y: INTEGER)
    set_z_order (z_order: POINTER)
    show
    show_horizontal_scroll_bar
    show_scroll_bars
    show_vertical_scroll_bar
    show_with_option (cmd_show: INTEGER)
    unlock_window_update
    update
    update_cached_style (new_ex_style, old_ex_style: INTEGER)
    validate
    validate_rect (rect: WEL_RECT)
    validate_region (region: WEL_REGION)
    win_help (help_file: STRING; a_command, data: INTEGER)


WEL_WINDOW Flat contracts

indexing
    description: "Abstract notions of a window."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:35 $"
    revision: "$Revision: 1.3 $"

deferred class interface
    WEL_WINDOW

feature -- Access

    commands: WEL_COMMAND_MANAGER
            -- Command manager associated to the current window.

    default_processing: BOOLEAN
            -- (from WEL_RETURN_VALUE)

    has_return_value: BOOLEAN
            -- Should the window procedure return a value?
            -- (from WEL_RETURN_VALUE)

    item: POINTER
            -- Generic Windows handle or structure pointer.
            -- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
            -- (from WEL_ANY)

    message_return_value: INTEGER
            -- Return value of the window procedure.
            -- (from WEL_RETURN_VALUE)
        require -- from WEL_RETURN_VALUE
            has_return_value: has_return_value

    parent: WEL_WINDOW
            -- Parent window

feature -- Status report

    absolute_x: INTEGER
            -- Absolute x position
        require
            exists: exists
        ensure
            Result = window_rect.x

    absolute_y: INTEGER
            -- Absolute y position
        require
            exists: exists
        ensure
            Result = window_rect.y

    background_brush: WEL_BRUSH
            -- Current window background color used to refresh the window when
            -- requested by the WM_ERASEBKGND windows message.
            -- By default there is no background
        ensure
            new_object: Result /= void implies Result /= background_brush

    captured_window: WEL_WINDOW
            -- Current window which has been captured.
        require
            exists: exists
            window_captured: window_captured

    client_rect: WEL_RECT
            -- Client rectangle
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    command (message: INTEGER): WEL_COMMAND
            -- Command associated to message
        require
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure
            result_not_void: Result /= void

    command_argument (message: INTEGER): ANY
            -- Command argument associated to message
        require
            positive_message: message >= 0
            command_exists: command_exists (message)

    command_exists (message: INTEGER): BOOLEAN
            -- Does a command associated to message exist?
        require
            positive_message: message >= 0

    commands_enabled: BOOLEAN
            -- Is the commands execution enabled?

    enabled: BOOLEAN
            -- Is the window enabled for mouse and keyboard input?
        require
            exists: exists

    ex_style: INTEGER
            -- Window ex_style
        require
            exists: exists

    exists: BOOLEAN
            -- Does the item exist?
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = (item /= default_pointer)

    focused_window: WEL_WINDOW
            -- Current window which has the focus.
        require
            exists: exists

    has_capture: BOOLEAN
            -- Does this window have the capture?
        require
            exists: exists

    has_focus: BOOLEAN
            -- Does this window have the focus?
        require
            exists: exists

    has_heavy_capture: BOOLEAN
            -- Does this window have the heavy capture?

    has_horizontal_scroll_bar: BOOLEAN
            -- Does this window have a horizontal scroll bar?
        require
            exists: exists

    has_vertical_scroll_bar: BOOLEAN
            -- Does this window have a vertical scroll bar?
        require
            exists: exists

    heavy_capture_activated: BOOLEAN
            -- Is the heavy capture currently running?
            -- (i.e. is there a window in the current program
            -- with has_heavy_capture to True?)

    height: INTEGER
            -- Window height
        require
            exists: exists

    is_inside: BOOLEAN
            -- Is the current window inside another window?

    maximal_height: INTEGER
            -- Maximal height allowed for the window
        ensure
            result_large_enough: Result >= minimal_height

    maximal_width: INTEGER
            -- Maximal width allowed for the window
        ensure
            result_large_enough: Result >= minimal_width

    maximized: BOOLEAN
            -- Is the window maximized?
        require
            exists: exists

    minimal_height: INTEGER
            -- Minimal height allowed for the window
            -- Zero by default.
        ensure
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_height

    minimal_width: INTEGER
            -- Minimal width allowed for the window
            -- Zero by default.
        ensure
            positive_result: Result >= 0
            result_small_enough: Result <= maximal_width

    minimized: BOOLEAN
            -- Is the window minimized?
        require
            exists: exists

    placement: WEL_WINDOW_PLACEMENT
            -- Window placement information
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    shared: BOOLEAN
            -- Is item shared by another object?
            -- If False (by default), item will
            -- be destroyed by destroy_item.
            -- If True, item will not be destroyed.
            -- (from WEL_ANY)

    shown: BOOLEAN
            -- Is the window shown?
        require
            exists: exists

    style: INTEGER
            -- Window style
        require
            exists: exists

    text: STRING
            -- Window text
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    text_length: INTEGER
            -- Text length
        require
            exists: exists
        ensure
            positive_result: Result >= 0

    width: INTEGER
            -- Window width
        require
            exists: exists

    window_captured: BOOLEAN
            -- Has a window been captured?

    window_rect: WEL_RECT
            -- Window rectangle (absolute position)
        require
            exists: exists
        ensure
            result_not_void: Result /= void

    x: INTEGER
            -- Window x position
        require
            exists: exists
        ensure
            parent = void implies Result = absolute_x

    y: INTEGER
            -- Window y position
        require
            exists: exists
        ensure
            parent = void implies Result = absolute_y

feature  -- Status report

    valid_hwnd_constant (c: POINTER): BOOLEAN
            -- Is c a valid hwnd constant?
            -- (from WEL_HWND_CONSTANTS)

feature -- Status setting

    disable
            -- Disable mouse and keyboard input
        require
            exists: exists
        ensure
            disabled: not enabled

    disable_commands
            -- Disable commands execution.
        ensure
            commands_disabled: not commands_enabled

    disable_default_processing
            -- Disable default window processing.
            -- The standard window procedure will not be called for
            -- each messages received by the window and then the
            -- normal behavior will not occur.
        ensure
            default_processing_disabled: not default_processing

    enable
            -- Enable mouse and keyboard input.
        require
            exists: exists
        ensure
            enabled: enabled

    enable_commands
            -- Enable commands execution.
        ensure
            commands_enabled: commands_enabled

    enable_default_processing
            -- Enable default window processing.
            -- The standard window procedure will be called for
            -- each messages received by the window and then the
            -- normal behavior will occur.
        ensure
            default_processing_enabled: default_processing

    hide
            -- Hide the window
        require
            exists: exists
        ensure
            hidden: not shown

    maximize
            -- Maximize the window
        require
            exists: exists
        ensure
            maximized: maximized

    minimize
            -- Minimize the window and display its icon
        require
            exists: exists
        ensure
            minimized: minimized

    release_capture
            -- Release the mouse capture after a call
            -- to set_capture.
        require
            exists: exists
            has_capture: has_capture
        ensure
            not_has_capture: not has_capture

    release_heavy_capture
            -- Release the mouse capture after a call
            -- to set_heavy_capture.
        require
            exists: exists
            has_heavy_capture: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated
        ensure
            heavy_capture_set: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated

    restore
            -- Restore the window to its
            -- original size and position after
            -- minimize or maximize
        require
            exists: exists

    set_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works only for windows in the same thread as your
            -- application.
        require
            exists: exists
            has_not_capture: not has_capture
            has_not_heavy_capture: not has_heavy_capture
        ensure
            has_capture: has_capture

    set_ex_style (an_ex_style: INTEGER)
            -- Set an_ex_style with ex_style.
            --
        require
            exists: exists

    set_focus
            -- Set the focus to Current
        require
            exists: exists

    set_heavy_capture
            -- Set the mouse capture to the Current window.
            -- Once the window has captured the mouse, all
            -- mouse input is directed to this window, regardless
            -- of whether the cursor is over that window. Only
            -- one window can have the mouse capture at a time.
            --
            -- Works for ALL windows.
        require
            exists: exists
            has_not_heavy_capture: not has_heavy_capture
            heavy_capture_deactivated: not heavy_capture_activated
        ensure
            heavy_capture_set: has_heavy_capture
            heavy_capture_activated: heavy_capture_activated

    set_shared
            -- Set shared to True.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            shared: shared

    set_style (a_style: INTEGER)
            -- Set style with a_style.
        require
            exists: exists

    set_unshared
            -- Set shared to False.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            unshared: not shared

    show
            -- Show the window
        require
            exists: exists

    update_cached_style (new_ex_style, old_ex_style: INTEGER)
            -- Update Window cache buffer for Window style.

feature -- Element change

    has_system_window_locked: BOOLEAN
            -- Is there any window locked ?

    lock_window_update
            -- Disables drawing in the current window. A locked window cannot be moved.
            -- Only one window can be locked at a time. To unlock a window locked with
            -- lock_window_update , call 'unlock_window_update'.
        require
            exists: exists
        ensure
            has_system_window_locked

    set_height (a_height: INTEGER)
            -- Set height with a_height
        require
            exists: exists

    set_item (an_item: POINTER)
            -- Set item with an_item
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            item_set: item = an_item

    set_parent (a_parent: WEL_WINDOW)
            -- Change the parent of the current window.
        require
            exists: exists

    set_placement (a_placement: WEL_WINDOW_PLACEMENT)
            -- Set placement with a_placement
        require
            exists: exists
            a_placement_not_void: a_placement /= void

    set_text (a_text: STRING)
            -- Set the window text
        require
            exists: exists
        ensure
            text_set_when_not_void: a_text /= void implies equal (text, a_text)
            text_set_when_void: a_text = void implies text.count = 0

    set_timer (timer_id, time_out: INTEGER)
            -- Set a timer identified by timer_id with a
            -- time_out value (in milliseconds).
            -- See also on_timer, kill_timer.
        require
            exists: exists
            positive_timer_id: timer_id > 0
            positive_time_out: time_out > 0

    set_width (a_width: INTEGER)
            -- Set width with a_width
        require
            exists: exists

    set_x (a_x: INTEGER)
            -- Set x with a_x
        require
            exists: exists

    set_y (a_y: INTEGER)
            -- Set y with a_y
        require
            exists: exists

    unlock_window_update
            -- Unlock a locked window.
        require
            exists: exists

feature -- Removal

    destroy
            -- Destroy the window.
        require
            exists: exists
        ensure
            not_exists: not exists

    dispose
            -- Destroy the inner structure of Current.
            --
            -- This function should be called by the GC when the
            -- object is collected or by the user if Current is
            -- no more usefull.
            -- (from WEL_ANY)

feature -- Conversion

    to_integer: INTEGER
            -- Converts item to an integer.
            -- (from WEL_ANY)
        ensure -- from WEL_ANY
            Result = cwel_pointer_to_integer (item)

feature -- Basic operations

    bring_to_top
            -- Bring this window to the top of the Z order.
            --
            -- Note:
            --  * If the window is a top-level window, it is activated.
            --  * If the window is a child window, the top-level parent window
            --    associated with the child window is activated.
        require
            exists: exists

    disable_horizontal_scroll_bar
            -- Disable the horizontal scroll bar.
        require
            exists: exists

    disable_vertical_scroll_bar
            -- Disable the vertical scroll bar.
        require
            exists: exists

    enable_horizontal_scroll_bar
            -- Enable the horizontal scroll bar.
        require
            exists: exists

    enable_vertical_scroll_bar
            -- Enable the vertical scroll bar.
        require
            exists: exists

    hide_horizontal_scroll_bar
            -- Hide the horizontal scroll bar.
        require
            exists: exists

    hide_scroll_bars
            -- Hide the horizontal and vertical scroll bars.
        require
            exists: exists

    hide_vertical_scroll_bar
            -- Hide the vertical scroll bar.
        require
            exists: exists

    insert_after (a_window: WEL_WINDOW)
            -- Insert the current window after a_window.
        require
            exists: exists
            a_window_not_void: a_window /= void
            a_window_not_current: a_window /= Current
            a_window_exists: a_window.exists

    invalidate
            -- Invalide the entire client area of the window. The
            -- background will be erased before.
        require
            exists: exists

    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN)
            -- Invalidate the area rect and erase
            -- the background if erase_background is True.
        require
            exists: exists
            rect_not_void: rect /= void

    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN)
            -- Invalidate the area region and erase
            -- the background if erase_background is True.
        require
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    invalidate_without_background
            -- Invalidate the entire client area of the window. The
            -- background will not be erased.
        require
            exists: exists

    kill_timer (timer_id: INTEGER)
            -- Kill the timer identified by timer_id.
            -- See also set_timer, on_timer.
        require
            exists: exists
            positive_timer_id: timer_id > 0

    move (a_x, a_y: INTEGER)
            -- Move the window to a_x, a_y.
        require
            exists: exists

    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN)
            -- Move the window to a_x, a_y position and
            -- resize it with a_width, a_height.
        require
            exists: exists

    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY)
            -- Put a_command associated to message.
        require
            a_command_not_void: a_command /= void
            positive_message: message >= 0
        ensure
            command_added: command (message) = a_command and command_argument (message) = argument

    remove_command (message: INTEGER)
            -- Remove the command associated to message.
        require
            positive_message: message >= 0
            command_exists: command_exists (message)
        ensure
            command_removed: not command_exists (message)

    resize (a_width, a_height: INTEGER)
            -- Resize the window with a_width, a_height.
        require
            exists: exists

    scroll (a_x, a_y: INTEGER)
            -- Scroll the contents of the window's client area.
            -- a_x and a_y specify the amount of horizontal
            -- and vertical scrolling.
        require
            exists: exists

    set_class_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.

    set_class_small_icon (new_icon: WEL_ICON)
            -- Replace the current icon for the class which this window
            -- belongs to.
            --
            -- The SetClassLong function replaces the specified 32-bit (long)
            -- value at the specified offset into the extra class memory
            -- or the WNDCLASSEX structure for the class to which the
            -- specified window belongs.

    set_z_order (z_order: POINTER)
            -- Set the z-order of the window.
            -- See class WEL_HWND_CONSTANTS for z_order values.
        require
            exists: exists
            valid_hwnd_constant: valid_hwnd_constant (z_order)

    show_horizontal_scroll_bar
            -- Show the horizontal scroll bar.
        require
            exists: exists

    show_scroll_bars
            -- Show the horizontal and vertical scroll bars.
        require
            exists: exists

    show_vertical_scroll_bar
            -- Show the vertical scroll bar.
        require
            exists: exists

    show_with_option (cmd_show: INTEGER)
            -- Set the window's visibility with cmd_show.
            -- See class WEL_SW_CONSTANTS for cmd_show value.
        require
            exists: exists
            parent_shown: parent /= void implies parent.exists and parent.shown

    update
            -- Update the client area by sending a Wm_paint message.
        require
            exists: exists

    validate
            -- Validate the entire client area of the window.
        require
            exists: exists

    validate_rect (rect: WEL_RECT)
            -- Validate the area rect.
        require
            exists: exists
            rect_not_void: rect /= void

    validate_region (region: WEL_REGION)
            -- Validate the area region.
        require
            exists: exists
            region_not_void: region /= void
            region_exists: region.exists

    win_help (help_file: STRING; a_command, data: INTEGER)
            -- Start the Windows Help program with help_file.
            -- a_command specifies the type of help requested. See
            -- class WEL_HELP_CONSTANTS for a_command values.
            -- 'data' is depandant on 'a_command'.  Check MSDN for more details.
        require
            exists: exists
            help_file_not_void: help_file /= void

feature -- Element Change

    set_default_processing (value: BOOLEAN)
            -- Enable or disable default processing of window messages.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            value_set: default_processing = value

    set_message_return_value (value: INTEGER)
            -- Set the window-procedure-return-value.
            -- (from WEL_RETURN_VALUE)
        ensure -- from WEL_RETURN_VALUE
            has_return_value: has_return_value
            value_set: message_return_value = value

feature -- Registration

    register_current_window
            -- Register Current in window manager.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_WINDOW


WEL Samples

There are a large number of samples provided with the WEL library, each designed to demonstrate different functionality. The samples available are listed below:
  • Tutorial

    Note: If you are new to WEL programming, this is the recommended place to start.

    • Step1
    • Step2
    • Step3
    • Step4
    • Step5
    • Step6
    • Step7
    • Step8
  • Hello
  • Bmpview
  • Brushes
  • Comctrls
  • Commands
  • Controls
  • Ctlcolor
  • Cursors
  • Diskspace
  • Fontenum
  • Fun
  • Header_ctrl
  • List_view
  • Magnify
  • Mdi
  • Menus
  • Minimal
  • Pizza
  • Printer
  • Richedit
  • Splitarea
  • Stddlgs
  • Timer
  • Tree_view
  • Windows
  • Xcell
  • Xy


Bmpview

Bitmap View Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\bmpview\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above, although no child windows will be present. Selecting "Open" from the "File" menu will allow you to browse for a .BMP file to view. Multiple files may be opened and each opens in a new child window. The options on the "Window" menu provide features for positioning the child windows. Selecting "Close" will close the currently selected child window, while selecting "Exit" or closing the window manually will exit the program.

Under the Hood

MAIN_WINDOW inherits WEL_MDI_FRAME_WINDOW and redefines `on_menu_command' to handle the menu selections. CHILD_WINDOW inherits WEL_MDI_CHILD_WINDOW and implements make to load a named bitmap, while on_paint has been redefined to re-draw the bitmap. A WEL_OPEN_FILE_DIALOG is used to select files for viewing.

This sample contains the following classes:

  • BMP_VIEW
  • MAIN_WINDOW
  • CHILD_WINDOW
  • APPLICATION_IDS

See Also
WEL_OPEN_FILE_DIALOG
Mdi sample


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
BMPVIEW_DEMO
CHILD_WINDOW
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\bmpview\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_file_close : INTEGER is 101

Cmd_file_exit : INTEGER is 102

Cmd_file_open : INTEGER is 100

Cmd_window_arrange : INTEGER is 203

Cmd_window_cascade : INTEGER is 202

Cmd_window_tile_horizontal : INTEGER is 201

Cmd_window_tile_vertical : INTEGER is 200

Id_ico_application : INTEGER is 1

Id_ico_child_window : INTEGER is 2

Id_menu_application : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


BMPVIEW_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
BMPVIEW_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class BMPVIEW_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CHILD_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
CHILD_WINDOW

create

make (a_parent: WEL_MDI_FRAME_WINDOW ; a_name: STRING )

feature -- Initialization

make (a_parent: WEL_MDI_FRAME_WINDOW ; a_name: STRING )

feature -- Access

bitmap : WEL_BITMAP
-- Bitmap selected by the user

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_MDI_FRAME_WINDOW
-- Parent window
-- (from WEL_MDI_CHILD_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window.
-- (from WEL_MDI_CHILD_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_MDI_CHILD_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_MDI_CHILD_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_MDI_CHILD_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Paint the bitmap
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class CHILD_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

client_window : WEL_MDI_CLIENT_WINDOW
-- MDI client window which contains child windows
-- (from WEL_MDI_FRAME_WINDOW )

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

active_window : WEL_MDI_CHILD_WINDOW
-- Window currently active
-- (from WEL_MDI_FRAME_WINDOW )
require -- from WEL_MDI_FRAME_WINDOW
exists: exists
client_window_not_void: client_window /= void
client_window_exists: client_window . exists
has_active_window: has_active_window

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_active_window : BOOLEAN
-- Is a window currently active?
-- (from WEL_MDI_FRAME_WINDOW )
require -- from WEL_MDI_FRAME_WINDOW
exists: exists
client_window_not_void: client_window /= void
client_window_exists: client_window . exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

arrange_icons
-- Arrange iconized child windows.
-- (from WEL_MDI_FRAME_WINDOW )
require -- from WEL_MDI_FRAME_WINDOW
exists: exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

cascade_children
-- Cascade the child windows.
-- (from WEL_MDI_FRAME_WINDOW )
require -- from WEL_MDI_FRAME_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

tile_children_horizontal
-- Horizontally tile the child windows.
-- (from WEL_MDI_FRAME_WINDOW )
require -- from WEL_MDI_FRAME_WINDOW
exists: exists

tile_children_vertical
-- Vertically tile the child windows.
-- (from WEL_MDI_FRAME_WINDOW )
require -- from WEL_MDI_FRAME_WINDOW
exists: exists

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Brushes

Brushes Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\brushes\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy images (*.bmp), icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program you will see a window displayed containing three push buttons marked "Brushes", "Rectangles" and "3D". Clicking "Brushes" will open a new window demonsatrating different brushes available. Clicking "Rectangles" will open a new window within which many different shaped and colored rectangles will be drawn. Clicking"3D" will open a new window demonstrating the use of multiple bitmaps for animation.

Under the Hood

Each of the three windows that are opened from the programs MAIN_WINDOW inherit WEL_FRAME_WINDOW and contains code for generating their output. BRUSHES_DEMO redefines idle_action to force a re-draw on the applicable windows.

Note. If enable_idle_action is not called, then idle_action is never executed.

This sample contains the following classes:

  • APPLICATION_IDS
  • BRUSH_DEMO
  • BRUSHES_DEMO
  • DEMO_3D
  • MAIN_WINDOW
  • PROJECTION
  • RECTANGLE_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
BRUSH_DEMO
BRUSHES_DEMO
DEMO_3D
MAIN_WINDOW
PROJECTION
RECTANGLE_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel45\examples\wel\brushes\brushes_demo.rc."

class interface
APPLICATION_IDS

feature -- Access

Id_bmp_ise_logo : INTEGER is 1

Id_ico_application : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


BRUSHES_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
BRUSHES_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

idle_action
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class BRUSHES_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


BRUSH_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
BRUSH_DEMO

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class BRUSH_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


DEMO_3D Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
DEMO_3D

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

ready : BOOLEAN
-- Is the demo ready?

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

go

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DEMO_3D

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

brush_button : WEL_PUSH_BUTTON

brush_demo : BRUSH_DEMO

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

demo3d_button : WEL_PUSH_BUTTON

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

rectangle_button : WEL_PUSH_BUTTON

rectangle_demo : RECTANGLE_DEMO

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

three_d_demo : DEMO_3D

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PROJECTION Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
PROJECTION

feature -- Access

x : INTEGER
-- Was declared in PROJECTION as synonym of y .

xr : REAL
-- Was declared in PROJECTION as synonym of yr and zr .

y : INTEGER
-- Was declared in PROJECTION as synonym of x .

yr : REAL
-- Was declared in PROJECTION as synonym of xr and zr .

zr : REAL
-- Was declared in PROJECTION as synonym of xr and yr .

feature -- Element change

set_x (a_x: INTEGER )
-- Set x with a_x
ensure
x_set: x = a_x

set_xr (a_xr: REAL )
-- Set xr with a_xr
ensure
xr_set: xr = a_xr

set_y (a_y: INTEGER )
-- Set y with a_y
ensure
y_set: y = a_y

set_yr (a_yr: REAL )
-- Set yr with a_yr
ensure
yr_set: yr = a_yr

set_zr (a_zr: REAL )
-- Set zr with a_zr
ensure
zr_set: zr = a_zr

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class PROJECTION

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


RECTANGLE_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
RECTANGLE_DEMO

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class RECTANGLE_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Comctrls

Common Controls Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\comctrls\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy images (*.bmp), icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above. Selecting "Progress bar demonstration" from the "File" menu will update the progress bar to a full state. Leaving the mouse stationary above the track bar, progress bar or tollbar buttons will cause a tooltip control to be displayed.

Under the Hood

There is one WEL_TOOLTIP used for all the controls, but each control adds a new WEL_TOOL_INFO to provide different output for each control. The feature `on_notify' has been redefined to handle the Ttn_needtext notification which is posted by a control, and received by the controls parent, when a control needs to display a tooltip. The feature `on_menu_select' has been redefined to output the text of the selected menu item in the WEL_STATUS_WINDOW located at the bottom of MAIN_WINDOW.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • COMCTRLS_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
COMCTRLS_DEMO
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\comctrls\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Bmp_toolbar : INTEGER is 1

Cmd_bold : INTEGER is 1004

Cmd_exit : INTEGER is 1007

Cmd_italic : INTEGER is 1005

Cmd_progress_bar : INTEGER is 1006

Id_ico_application : INTEGER is 1

Id_main_menu : INTEGER is 1

Str_tooltip : INTEGER is 200

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


COMCTRLS_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
COMCTRLS_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

common_controls_dll : WEL_COMMON_CONTROLS_DLL

init_application
-- Load the common controls dll and the rich edit dll.

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

rich_edit_dll : WEL_RICH_EDIT_DLL

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class COMCTRLS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

background_brush : WEL_BRUSH
-- Dialog boxes background color is the same than
-- button color.
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

char_format : WEL_CHARACTER_FORMAT

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

progress_bar : WEL_PROGRESS_BAR

rich_edit : WEL_RICH_EDIT

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

standard_tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
-- Was declared in MAIN_WINDOW as synonym of tool_bar_bitmap .

static : WEL_STATIC

status_window : WEL_STATUS_WINDOW

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

tool_bar : WEL_TOOL_BAR

tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
-- Was declared in MAIN_WINDOW as synonym of standard_tool_bar_bitmap .

tool_bar_button4 : WEL_TOOL_BAR_BUTTON
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button5 , tool_bar_button6 , tool_bar_button7 and tool_bar_button8 .

tool_bar_button5 : WEL_TOOL_BAR_BUTTON
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button4 , tool_bar_button6 , tool_bar_button7 and tool_bar_button8 .

tool_bar_button6 : WEL_TOOL_BAR_BUTTON
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button4 , tool_bar_button5 , tool_bar_button7 and tool_bar_button8 .

tool_bar_button7 : WEL_TOOL_BAR_BUTTON
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button4 , tool_bar_button5 , tool_bar_button6 and tool_bar_button8 .

tool_bar_button8 : WEL_TOOL_BAR_BUTTON
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button4 , tool_bar_button5 , tool_bar_button6 and tool_bar_button7 .

tool_info1 : WEL_TOOL_INFO
-- Was declared in MAIN_WINDOW as synonym of tool_info2 .

tool_info2 : WEL_TOOL_INFO
-- Was declared in MAIN_WINDOW as synonym of tool_info1 .

tooltip : WEL_TOOLTIP

track_bar : WEL_TRACK_BAR

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Commands

Commands Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\commands\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, you will see a window displayed with a similar appearance to the one illustrated above. Please follow the instructions displayed in the window.

Under the Hood

MAIN_DIALOG inherits WEL_MAIN_DIALOG which provides the feature put_command, used to associate a WEL_COMMAND to a Windows message received by the window. A WEL_COMMAND contains a deferred feature, execute which is executed when the command is fired. SHOW_COMMAND_INFORMATION, SHOW_MOUSE_BUTTON_INFORMATION and SHOW_MOVE_INFORMATION all inherit WEL_COMMAND.

Note: execute has an argument of type ANY which is used to pass any additional information required.

This sample contains the following classes:

  • APPLICATION_IDS
  • COMMANDS_DEMO
  • MAIN_DIALOG
  • SHOW_COMMAND_INFORMATION
  • SHOW_MOUSE_BUTTON_INFORMATION
  • SHOW_MOVE_INFORMATION


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
COMMANDS_DEMO
MAIN_DIALOG
SHOW_COMMAND_INFORMATION
SHOW_MOUSE_BUTTON_INFORMATION
SHOW_MOVE_INFORMATION

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\commands\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Idc_checkbox : INTEGER is 102

Idc_clear_button : INTEGER is 103

Idc_close_button : INTEGER is 1

Idc_listbox : INTEGER is 101

Main_dialog : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


COMMANDS_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
COMMANDS_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_DIALOG
-- Create the application's main dialog
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class COMMANDS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_DIALOG Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_DIALOG

create

make
-- Create the main dialog and the commands.

feature -- Access

check_box : WEL_CHECK_BOX
-- Check box to control the command execution

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

list_box : WEL_SINGLE_SELECTION_LIST_BOX
-- List box which contains the information

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog.
-- (from WEL_MAIN_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists
require else -- from WEL_MAIN_DIALOG
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_control_id_command (control_id: INTEGER )
-- Process the check mark and the button.
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ok
-- Button Ok has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

setup_dialog
-- Enable the commands.
require -- from WEL_DIALOG
exists: exists

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODELESS_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SHOW_COMMAND_INFORMATION Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
SHOW_COMMAND_INFORMATION

feature -- Access

message_information : WEL_MESSAGE_INFORMATION
-- Information associated to the message
-- (from WEL_COMMAND )

feature -- Element change

set_message_information (mi: WEL_MESSAGE_INFORMATION )
-- Set message_information with mi.
-- (from WEL_COMMAND )
ensure -- from WEL_COMMAND
message_information_set: message_information = mi

feature

execute (argument: ANY )
-- Add information about Wm_move message in the
-- list box.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SHOW_COMMAND_INFORMATION

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SHOW_MOUSE_BUTTON_INFORMATION Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
SHOW_MOUSE_BUTTON_INFORMATION

feature -- Access

message_information : WEL_MESSAGE_INFORMATION
-- Information associated to the message
-- (from WEL_COMMAND )

feature -- Element change

set_message_information (mi: WEL_MESSAGE_INFORMATION )
-- Set message_information with mi.
-- (from WEL_COMMAND )
ensure -- from WEL_COMMAND
message_information_set: message_information = mi

feature

execute (argument: ANY )
-- Add information about Wm_lbuttondown message in the
-- list box.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SHOW_MOUSE_BUTTON_INFORMATION

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SHOW_MOVE_INFORMATION Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
SHOW_MOVE_INFORMATION

feature -- Access

message_information : WEL_MESSAGE_INFORMATION
-- Information associated to the message
-- (from WEL_COMMAND )

feature -- Element change

set_message_information (mi: WEL_MESSAGE_INFORMATION )
-- Set message_information with mi.
-- (from WEL_COMMAND )
ensure -- from WEL_COMMAND
message_information_set: message_information = mi

feature

execute (argument: ANY )
-- Add information about Wm_move message in the
-- list box.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SHOW_MOVE_INFORMATION

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Controls

Controls Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\controls\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, an empty window will be displayed. There are numerous menus in the window, each relating to a different type of control. Each menu has "Create" and "Delete" along with a other options specific to each control. By selecting these menu options, controls will be created and modified as demonstrated in the above illustration.

Under the Hood

Each menu is an instance of WEL_MENU and on_menu_command has been redefined in MAIN_WINDOW to perform the appropriate actions.

This sample contains the following classes:

  • APPLICATION_IDS
  • CONTROLS
  • MAIN_WINDOW

See Also
WEL_LIST_VIEW
WEL_COMBO_BOX
WEL_PUSH_BUTTON
WEL_EDIT
WEL_RADIO_BUTTON
WEL_CHECK_BUTTON
WEL_MULTIPLE_LINE_EDIT
WEL_SCROLL_BAR


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
CONTROLS_DEMO
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\controls\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_button_create : INTEGER is 152

Cmd_button_delete : INTEGER is 153

Cmd_button_disable : INTEGER is 150

Cmd_button_enable : INTEGER is 151

Cmd_check_create : INTEGER is 130

Cmd_check_delete : INTEGER is 131

Cmd_check_state : INTEGER is 132

Cmd_combo_box_add_item : INTEGER is 113

Cmd_combo_box_count_item : INTEGER is 112

Cmd_combo_box_create : INTEGER is 110

Cmd_combo_box_current_item : INTEGER is 111

Cmd_combo_box_delete : INTEGER is 114

Cmd_combo_box_hide_list : INTEGER is 116

Cmd_combo_box_show_list : INTEGER is 115

Cmd_edit_clear_text : INTEGER is 173

Cmd_edit_create : INTEGER is 170

Cmd_edit_current_text : INTEGER is 175

Cmd_edit_delete : INTEGER is 171

Cmd_edit_set_text : INTEGER is 174

Cmd_edit_text_length : INTEGER is 172

Cmd_exit : INTEGER is 1000

Cmd_list_box_add_item : INTEGER is 162

Cmd_list_box_count_item : INTEGER is 163

Cmd_list_box_create : INTEGER is 160

Cmd_list_box_current_item : INTEGER is 164

Cmd_list_box_delete : INTEGER is 161

Cmd_mul_add_item : INTEGER is 104

Cmd_mul_count_item : INTEGER is 103

Cmd_mul_count_selected_item : INTEGER is 186

Cmd_mul_create : INTEGER is 101

Cmd_mul_current_item : INTEGER is 102

Cmd_mul_delete : INTEGER is 105

Cmd_multi_edit_clear_text : INTEGER is 183

Cmd_multi_edit_create : INTEGER is 180

Cmd_multi_edit_current_text : INTEGER is 185

Cmd_multi_edit_delete : INTEGER is 181

Cmd_multi_edit_set_text : INTEGER is 184

Cmd_multi_edit_text_length : INTEGER is 182

Cmd_radio_create : INTEGER is 120

Cmd_radio_delete : INTEGER is 121

Cmd_radio_state : INTEGER is 122

Cmd_scroll_bar_create : INTEGER is 143

Cmd_scroll_bar_delete : INTEGER is 142

Cmd_scroll_bar_set_horizontal : INTEGER is 141

Cmd_scroll_bar_set_vertical : INTEGER is 140

Id_acc_application : INTEGER is 1

Id_ico_application : INTEGER is 1

Id_menu_application : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CONTROLS_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
CONTROLS_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

accelerators : WEL_ACCELERATORS
-- Application's accelerators

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class CONTROLS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window

feature -- Access

background_brush : WEL_BRUSH
-- Dialog boxes background color is the same than
-- button color.
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

bcheck1 : WEL_CHECK_BOX
-- Was declared in MAIN_WINDOW as synonym of bcheck2 .

bcheck2 : WEL_CHECK_BOX
-- Was declared in MAIN_WINDOW as synonym of bcheck1 .

button : WEL_PUSH_BUTTON

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

combo_box : WEL_DROP_DOWN_LIST_COMBO_BOX

combo_box_item_num : INTEGER

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

edit : WEL_SINGLE_LINE_EDIT

group1 : WEL_GROUP_BOX
-- Was declared in MAIN_WINDOW as synonym of group2 .

group2 : WEL_GROUP_BOX
-- Was declared in MAIN_WINDOW as synonym of group1 .

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

list_box : WEL_SINGLE_SELECTION_LIST_BOX

list_box_item_num : INTEGER

list_box_mul : WEL_MULTIPLE_SELECTION_LIST_BOX

list_box_mul_item_num : INTEGER

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

multi_edit : WEL_MULTIPLE_LINE_EDIT

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

radio1 : WEL_RADIO_BUTTON
-- Was declared in MAIN_WINDOW as synonym of radio2 .

radio2 : WEL_RADIO_BUTTON
-- Was declared in MAIN_WINDOW as synonym of radio1 .

scroll_bar : WEL_SCROLL_BAR

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

static : WEL_STATIC

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

vertical_scroll_bar : BOOLEAN

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Ctlcolor

Color Control Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\ctlcolor\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, you will see a window displayed as above. Clicking on the "Foreground color" button will display a color dialog which allows you to select a new foreground color for the controls. Clicking on the "Background color" button will display a color dialog which allows you to select a new background color for the controls.

Under the Hood

A WEL_COLOR_CONTROL is used to retrieve the color selection of the user through the feature rgb_result which returns an object of type WEL_COLOR_REF.

This sample contains the following classes:

  • CTLCOLOR_DEMO
  • MAIN_WINDOW
  • MY_BUTTON
  • PRECOMP_MAIN_WINDOW


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
CTLCOLOR_DEMO
MAIN_WINDOW
MY_BUTTON
PRECOMP_MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CTLCOLOR_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
CTLCOLOR_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class CTLCOLOR_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window
-- (from PRECOMP_MAIN_WINDOW )

feature -- Initialization

make
-- Make the main window
-- (from PRECOMP_MAIN_WINDOW )

feature -- Access

bkgnd_ctlcolor : WEL_COLOR_REF
-- Color used for the background of the controls
-- (from PRECOMP_MAIN_WINDOW )

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

Color_activeborder : INTEGER is 10
-- (from WEL_COLOR_CONSTANTS )

Color_activecaption : INTEGER is 2
-- (from WEL_COLOR_CONSTANTS )

Color_appworkspace : INTEGER is 12
-- (from WEL_COLOR_CONSTANTS )

Color_background : INTEGER is 1
-- (from WEL_COLOR_CONSTANTS )

Color_btnface : INTEGER is 15
-- (from WEL_COLOR_CONSTANTS )

Color_btnhighlight : INTEGER is 20
-- (from WEL_COLOR_CONSTANTS )

Color_btnshadow : INTEGER is 16
-- (from WEL_COLOR_CONSTANTS )

Color_btntext : INTEGER is 18
-- (from WEL_COLOR_CONSTANTS )

Color_captiontext : INTEGER is 9
-- (from WEL_COLOR_CONSTANTS )

Color_graytext : INTEGER is 17
-- (from WEL_COLOR_CONSTANTS )

Color_highlight : INTEGER is 13
-- (from WEL_COLOR_CONSTANTS )

Color_highlighttext : INTEGER is 14
-- (from WEL_COLOR_CONSTANTS )

Color_inactiveborder : INTEGER is 11
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaption : INTEGER is 3
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaptiontext : INTEGER is 19
-- (from WEL_COLOR_CONSTANTS )

Color_menu : INTEGER is 4
-- (from WEL_COLOR_CONSTANTS )

Color_menutext : INTEGER is 7
-- (from WEL_COLOR_CONSTANTS )

Color_scrollbar : INTEGER is 0
-- (from WEL_COLOR_CONSTANTS )

Color_window : INTEGER is 5
-- (from WEL_COLOR_CONSTANTS )

Color_windowframe : INTEGER is 6
-- (from WEL_COLOR_CONSTANTS )

Color_windowtext : INTEGER is 8
-- (from WEL_COLOR_CONSTANTS )

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

frgnd_ctlcolor : WEL_COLOR_REF
-- Color used for the foreground of the controls
-- (from PRECOMP_MAIN_WINDOW )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

valid_color_constant (c: INTEGER ): BOOLEAN
-- Is c a valid color constant?
-- (from WEL_COLOR_CONSTANTS )

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_bkgnd_ctlcolor (a_color: WEL_COLOR_REF )
-- Make a_color the new bkgnd_ctlcolor .
-- (from PRECOMP_MAIN_WINDOW )

set_frgnd_ctlcolor (a_color: WEL_COLOR_REF )
-- Make a_color the new frgnd_ctlcolor .
-- (from PRECOMP_MAIN_WINDOW )

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MY_BUTTON Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Objects that ..."
author: ""
date: "$Date: 2001/03/10 01:50:30 $"
revision: "$Revision: 1.1 $"

class interface
MY_BUTTON

create

make (a_parent: WEL_WINDOW ; a_name: STRING ; a_x, a_y, a_width, a_height, an_id, a_type: INTEGER )
-- Create the button.

feature -- Initialization

make (a_parent: WEL_WINDOW ; a_name: STRING ; a_x, a_y, a_width, a_height, an_id, a_type: INTEGER )
-- Create the button.

feature -- Access

Color_activeborder : INTEGER is 10
-- (from WEL_COLOR_CONSTANTS )

Color_activecaption : INTEGER is 2
-- (from WEL_COLOR_CONSTANTS )

Color_appworkspace : INTEGER is 12
-- (from WEL_COLOR_CONSTANTS )

Color_background : INTEGER is 1
-- (from WEL_COLOR_CONSTANTS )

Color_btnface : INTEGER is 15
-- (from WEL_COLOR_CONSTANTS )

Color_btnhighlight : INTEGER is 20
-- (from WEL_COLOR_CONSTANTS )

Color_btnshadow : INTEGER is 16
-- (from WEL_COLOR_CONSTANTS )

Color_btntext : INTEGER is 18
-- (from WEL_COLOR_CONSTANTS )

Color_captiontext : INTEGER is 9
-- (from WEL_COLOR_CONSTANTS )

Color_graytext : INTEGER is 17
-- (from WEL_COLOR_CONSTANTS )

Color_highlight : INTEGER is 13
-- (from WEL_COLOR_CONSTANTS )

Color_highlighttext : INTEGER is 14
-- (from WEL_COLOR_CONSTANTS )

Color_inactiveborder : INTEGER is 11
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaption : INTEGER is 3
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaptiontext : INTEGER is 19
-- (from WEL_COLOR_CONSTANTS )

Color_menu : INTEGER is 4
-- (from WEL_COLOR_CONSTANTS )

Color_menutext : INTEGER is 7
-- (from WEL_COLOR_CONSTANTS )

Color_scrollbar : INTEGER is 0
-- (from WEL_COLOR_CONSTANTS )

Color_window : INTEGER is 5
-- (from WEL_COLOR_CONSTANTS )

Color_windowframe : INTEGER is 6
-- (from WEL_COLOR_CONSTANTS )

Color_windowtext : INTEGER is 8
-- (from WEL_COLOR_CONSTANTS )

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

font : WEL_FONT
-- Font with which the control is drawing its text.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
ensure -- from WEL_CONTROL
result_not_void: Result /= void

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

id : INTEGER
-- Control id
-- (from WEL_CONTROL )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

type : INTEGER
-- The type : foreground or background

window : PRECOMP_MAIN_WINDOW
-- The main_window.

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_system_font : BOOLEAN
-- Does the control use the system font?
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_width : INTEGER
-- Minimal width allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

valid_color_constant (c: INTEGER ): BOOLEAN
-- Is c a valid color constant?
-- (from WEL_COLOR_CONSTANTS )

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_font (a_font: WEL_FONT )
-- Set font with a_font.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
a_font_not_void: a_font /= void
a_font_exists: a_font. exists
ensure -- from WEL_CONTROL
font_set: not has_system_font implies font . item = a_font. item

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

destroy
-- Destroy the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

default_process_notification (notification_code: INTEGER )
-- Process a notification_code which has not been
-- processed by process_notification .
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in the current group in a_parent
-- depending on the value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in `a_parent depending on the
-- value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Color

background_color : WEL_COLOR_REF
-- Background color used for the background of the
-- control
-- Can be redefined by the user
-- (from WEL_BUTTON )
require -- from WEL_COLOR_CONTROL
exists: exists
ensure -- from WEL_COLOR_CONTROL
color_not_void: background_color /= void

foreground_color : WEL_COLOR_REF
-- Foreground color has no effect with SCROLL_BAR.
-- Cannot be Void.
-- (from WEL_BUTTON )
require -- from WEL_COLOR_CONTROL
exists: exists
ensure -- from WEL_COLOR_CONTROL
color_not_void: foreground_color /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MY_BUTTON

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PRECOMP_MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
PRECOMP_MAIN_WINDOW

create

make
-- Make the main window

feature -- Initialization

make
-- Make the main window

feature -- Access

bkgnd_ctlcolor : WEL_COLOR_REF
-- Color used for the background of the controls

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

Color_activeborder : INTEGER is 10
-- (from WEL_COLOR_CONSTANTS )

Color_activecaption : INTEGER is 2
-- (from WEL_COLOR_CONSTANTS )

Color_appworkspace : INTEGER is 12
-- (from WEL_COLOR_CONSTANTS )

Color_background : INTEGER is 1
-- (from WEL_COLOR_CONSTANTS )

Color_btnface : INTEGER is 15
-- (from WEL_COLOR_CONSTANTS )

Color_btnhighlight : INTEGER is 20
-- (from WEL_COLOR_CONSTANTS )

Color_btnshadow : INTEGER is 16
-- (from WEL_COLOR_CONSTANTS )

Color_btntext : INTEGER is 18
-- (from WEL_COLOR_CONSTANTS )

Color_captiontext : INTEGER is 9
-- (from WEL_COLOR_CONSTANTS )

Color_graytext : INTEGER is 17
-- (from WEL_COLOR_CONSTANTS )

Color_highlight : INTEGER is 13
-- (from WEL_COLOR_CONSTANTS )

Color_highlighttext : INTEGER is 14
-- (from WEL_COLOR_CONSTANTS )

Color_inactiveborder : INTEGER is 11
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaption : INTEGER is 3
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaptiontext : INTEGER is 19
-- (from WEL_COLOR_CONSTANTS )

Color_menu : INTEGER is 4
-- (from WEL_COLOR_CONSTANTS )

Color_menutext : INTEGER is 7
-- (from WEL_COLOR_CONSTANTS )

Color_scrollbar : INTEGER is 0
-- (from WEL_COLOR_CONSTANTS )

Color_window : INTEGER is 5
-- (from WEL_COLOR_CONSTANTS )

Color_windowframe : INTEGER is 6
-- (from WEL_COLOR_CONSTANTS )

Color_windowtext : INTEGER is 8
-- (from WEL_COLOR_CONSTANTS )

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

frgnd_ctlcolor : WEL_COLOR_REF
-- Color used for the foreground of the controls

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

valid_color_constant (c: INTEGER ): BOOLEAN
-- Is c a valid color constant?
-- (from WEL_COLOR_CONSTANTS )

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_bkgnd_ctlcolor (a_color: WEL_COLOR_REF )
-- Make a_color the new bkgnd_ctlcolor .

set_frgnd_ctlcolor (a_color: WEL_COLOR_REF )
-- Make a_color the new frgnd_ctlcolor .

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class PRECOMP_MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Cursors

Cursors Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\cursors\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustarated above. Selecting one of the cursor types from the "Cursors" menu will cause the selected cursor to be displayed when the mouse pointer is over the client area of the window.

Under the Hood

The feature `on_menu_command' has been redefined in MAIN_WINDOW to create the appropriate cursor when a menu selection is made, while `on_set_cursor' has been redefined to update the style of the displayed cursor.

This sample contains the following classes:

  • CURSORS_DEMO
  • MAIN_WINDOW
  • APPLICATION_IDS


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
CURSORS_DEMO
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\cursors\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_cursor_arrow : INTEGER is 101

Cmd_cursor_cross : INTEGER is 102

Cmd_cursor_custom : INTEGER is 111

Cmd_cursor_ibeam : INTEGER is 103

Cmd_cursor_sieznesw : INTEGER is 105

Cmd_cursor_size : INTEGER is 104

Cmd_cursor_sizens : INTEGER is 106

Cmd_cursor_sizeswne : INTEGER is 107

Cmd_cursor_sizewe : INTEGER is 108

Cmd_cursor_uparrow : INTEGER is 109

Cmd_cursor_wait : INTEGER is 110

Id_cur_custom : INTEGER is 1

Id_ico_application : INTEGER is 1

Id_menu_application : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CURSORS_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
CURSORS_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class CURSORS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

cursor : WEL_CURSOR
-- Current cursor

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


diskspace

Disc Space Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\diskspace\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

After launching the application, you will see text ouput showing the size and amount of free space available on each of your local drives.

Under the Hood

DISCSPACE_DEMO contains a once feature, diskspace which returns an instance of WEL_DISK_SPACE, used to query the local drives.

This sample contains only one class:

  • DISKSPACE_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
DISKSPACE_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


DISKSPACE_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Example on how to use the class WEL_DISK_SPACE "
author: "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"

class interface
DISKSPACE_DEMO

create

make
-- Main Initialization routine.

feature -- Initialization

disk_space : WEL_DISK_SPACE
-- Object use to query disk space.

make
-- Main Initialization routine.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DISKSPACE_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Fontenum

Font Enumarator Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\fontenum\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustarated above. Selecting one of the available fonts (Listed on the left hand side) will cause a sample text to be displayed in the currently entered font size. Clicking the button marked "Close" will cause the program to end.

Under the Hood

MAIN_DIALOG inherits from WEL_MAIN_DIALOG and also WEL_FONT_ENUMARATOR. MAIN_DIALOG implements action which was deferred from WEL_FONT_ENUMARATOR and executed every an enumeration finds a new font. This new implementation is used to display the available fonts in the WEL_LIST_VIEW

This sample contains the following classes:

  • APPLICATION_IDS
  • FONTENUM_DEMO
  • MAIN_DIALOG


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
FONTENUM_DEMO
MAIN_DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\fontenum\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Idc_close_button : INTEGER is 104

Idc_edit : INTEGER is 102

Idc_edit_size : INTEGER is 103

Idc_font_list_box : INTEGER is 101

Main_dialog : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


FONTENUM_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
FONTENUM_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_DIALOG
-- Create the application's main dialog
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class FONTENUM_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_DIALOG Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_DIALOG

create

make
-- Create the main dialog.

feature -- Access

C_memory : INTEGER is 2
-- Code for the C memory managed
-- by the garbage collector
-- (from MEM_CONST )

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

current_font : WEL_FONT
-- Current font selected

current_size : INTEGER
-- Last size entered by the user

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

edit : WEL_MULTIPLE_LINE_EDIT
-- Edit box

Eiffel_memory : INTEGER is 1
-- Code for the Eiffel memory managed
-- by the garbage collector
-- (from MEM_CONST )

Full_collector : INTEGER is 0
-- Statistics for full collections
-- (from MEM_CONST )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

Incremental_collector : INTEGER is 1
-- Statistics for incremental collections
-- (from MEM_CONST )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

list_box : WEL_SINGLE_SELECTION_LIST_BOX
-- List box which contains the fonts

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

size : WEL_SINGLE_LINE_EDIT
-- Edit box to input the size

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

Total_memory : INTEGER is 0
-- Code for all the memory managed
-- by the garbage collector
-- (from MEM_CONST )

feature -- Measurement

gc_statistics (collector_type: INTEGER ): GC_INFO
-- Garbage collection information for collector_type.
-- (from MEMORY )
require -- from MEMORY
type_ok: collector_type = full_collector or collector_type = incremental_collector

memory_statistics (memory_type: INTEGER ): MEM_INFO
-- Memory usage information for memory_type
-- (from MEMORY )
require -- from MEMORY
type_ok: memory_type = total_memory or memory_type = eiffel_memory or memory_type = c_memory

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

chunk_size : INTEGER
-- Minimal size of a memory chunk. The run-time always
-- allocates a multiple of this size.
-- If the environment variable EIF_MEMORY_CHUNK
-- is defined, it is set to the closest reasonable
-- value from it.
-- (from MEMORY )

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

coalesce_period : INTEGER
-- Period of full coalesce (in number of collections)
-- If the environment variable EIF_FULL_COALESCE_PERIOD
-- is defined, it is set to the closest reasonable
-- value from it.
-- If null, no full coalescing is launched.
-- (from MEMORY )

collecting : BOOLEAN
-- Is garbage collection enabled?
-- (from MEMORY )

collection_period : INTEGER
-- Period of full collection.
-- If the environment variable EIF_FULL_COLLECTION_PERIOD
-- is defined, it is set to the closest reasonable
-- value from it.
-- If null, no full collection is launched.
-- (from MEMORY )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

generation_object_limit : INTEGER
-- Maximum size of object in generational scavenge zone.
-- If the environment variable EIF_GS_LIMIT
-- is defined, it is set to the closest reasonable
-- value from it.
-- (from MEMORY )

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

largest_coalesced_block : INTEGER
-- Size of largest coalesced block since last call to
-- largest_coalesced; 0 if none.
-- (from MEMORY )

max_mem : INTEGER
-- Maximum amount of bytes the run-time can allocate.
-- (from MEMORY )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

memory_threshold : INTEGER
-- Minimum amount of bytes to be allocated before
-- starting an automatic garbage collection.
-- (from MEMORY )

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

referers (an_object: ANY ): ARRAY [ ANY ]
-- Objects that refer to an_object.
-- (from MEMORY )

scavenge_zone_size : INTEGER
-- Size of generational scavenge zone.
-- If the environment variable EIF_MEMORY_SCAVENGE
-- is defined, it is set to the closest reasonable
-- value from it.
-- (from MEMORY )

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

tenure : INTEGER
-- Maximum age of object before being considered
-- as old (old objects are not scanned during
-- partial collection).
-- If the environment variable EIF_TENURE_MAX
-- is defined, it is set to the closest reasonable
-- value from it.
-- (from MEMORY )

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

allocate_compact
-- Enter `memory' mode: will try to compact memory
-- before requesting more from the operating system.
-- (from MEMORY )

allocate_fast
-- Enter `speed' mode: will optimize speed of memory
-- allocation rather than memory usage.
-- (from MEMORY )

allocate_tiny
-- Enter `tiny' mode: will enter `memory' mode
-- after having freed as much memory as possible.
-- (from MEMORY )

collection_off
-- Disable garbage collection.
-- (from MEMORY )

collection_on
-- Enable garbage collection.
-- (from MEMORY )

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

disable_time_accounting
-- Disable GC time accounting (default).
-- (from MEMORY )

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

enable_time_accounting
-- Enable GC time accouting, accessible in gc_statistics .
-- (from MEMORY )

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_coalesce_period (value: INTEGER )
-- Set coalesce_period . Every value collection,
-- the Garbage Collector will coalesce
-- the whole memory.
-- (from MEMORY )
require -- from MEMORY
positive_value: value >= 0

set_collection_period (value: INTEGER )
-- Set collection_period . Every value collection,
-- the Garbage collector will perform a collection
-- on the whole memory (full collection), otherwise
-- a simple partial collection is done.
-- (from MEMORY )
require -- from MEMORY
positive_value: value >= 0

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_max_mem (value: INTEGER )
-- Set the maximum amount of memory the run-time can allocate.
-- (from MEMORY )
require -- from MEMORY
positive_value: value > 0

set_memory_threshold (value: INTEGER )
-- Set a new memory_threshold in bytes. Whenever the memory
-- allocated for Eiffel reaches this value, an automatic
-- collection is performed.
-- (from MEMORY )
require -- from MEMORY
positive_value: value > 0

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

collect
-- Force a partial collection cycle if garbage
-- collection is enabled; do nothing otherwise.
-- (from MEMORY )

free (object: ANY )
-- Free object, by-passing garbage collection.
-- Erratic behavior will result if the object is still
-- referenced.
-- (from MEMORY )

full_coalesce
-- Coalesce the whole memory: merge adjacent free
-- blocks to reduce fragmentation. Useful, when
-- a lot of memory is allocated with garbage collector off.
-- (from MEMORY )

full_collect
-- Force a full collection cycle if garbage
-- collection is enabled; do nothing otherwise.
-- (from MEMORY )

mem_free (addr: POINTER )
-- Free memory of object at addr.
-- (Preferred interface is free .)
-- (from MEMORY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

action (elf: WEL_ENUM_LOG_FONT ; tm: WEL_TEXT_METRIC ; font_type: INTEGER )
-- Called for each font found.
require -- from WEL_FONT_FAMILY_ENUMERATOR
elf_not_void: elf /= void
tm_not_void: tm /= void

activate
-- Activate the dialog.
-- (from WEL_MAIN_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists
require else -- from WEL_MAIN_DIALOG
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

dispose
-- Called when the main dialog is destroyed.

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

finish_action
-- Called after the enumeration.
-- May be redefined to make special operations.
-- (from WEL_FONT_FAMILY_ENUMERATOR )

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

init_action
-- Called before the enumeration.
-- May be redefined to make special operations.
-- (from WEL_FONT_FAMILY_ENUMERATOR )

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- Set the text font with the new font selected
-- by the user.
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_control_id_command (control_id: INTEGER )
-- Destroy application when Close button is pushed.
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ok
-- Button Ok has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

setup_dialog
-- Fill the list box with the fonts.
require -- from WEL_DIALOG
exists: exists

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODELESS_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Fun

Fun Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\fun\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy images (*.bmp), icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above. Clicking the push button marked "Maze" will open a new window and draw a maze within this window. Clicking the push button marked "Artist" will open a new window, and display output dependent on the movement of the mouse pointer within the client area of that window. Clicking the push button marked "Fun" will open a new window which contains a fake error message and a close push button which moves when you try to move the mouse pointer over it.

Under the Hood

Both FUN_DIALOG and ARTIST redefine `on_mouse_move' to track the actions of the mouse pointer and respond accordingly.

This sample contains the following classes:

  • APPLICATION_IDS
  • ARTIST
  • FUN_DEMO
  • FUN_DIALOG
  • MAIN_WINDOW
  • MAZE


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
ARTIST
FUN_DEMO
FUN_DIALOG
MAIN_WINDOW
MAZE

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\fun\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_exit : INTEGER is 1000

Id_bmp_ise_logo : INTEGER is 1

Id_cur_invisible : INTEGER is 1

Id_dialog : INTEGER is 1

Id_ico_application : INTEGER is 1

Id_ico_artist : INTEGER is 2

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


ARTIST Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
ARTIST

create

make (a_parent: WEL_COMPOSITE_WINDOW )

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ARTIST

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


FUN_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
FUN_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class FUN_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


FUN_DIALOG Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
FUN_DIALOG

create

make (a_parent: WEL_COMPOSITE_WINDOW )
-- Make a funny dialog

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

direction_x : INTEGER
-- The step button direction when it goes right or left

direction_y : INTEGER
-- The step button direction when it goes up or down

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

Inc_x : INTEGER is 3
-- Step of deplacement for the button on horizontal axis

Inc_y : INTEGER is 3
-- Step of deplacement for the button on vertical axis

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

Max_move : INTEGER is 200
-- Maximum moves before leaving

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

move_number : INTEGER
-- How many movements until we quit

ok_button : WEL_PUSH_BUTTON

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

Sensibility : INTEGER is 20
-- Minimal distance from the mouse accepted
-- before moving the button

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

time_elapsed : BOOLEAN
-- Does the button must still move?

X_min : INTEGER is 5
-- Minimum x coordinate for the button

Y_min : INTEGER is 130
-- Minimum y coordinate for the button

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog box.
-- Can be called several times.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODAL_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature

movement_x (x_pos, xb: INTEGER ): BOOLEAN
-- Do we still need to move the button
-- on the horizontal axis?

movement_y (y_pos, yb: INTEGER ): BOOLEAN
-- Do we still need to move the button
-- on the vertical axis?

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- The mouse has been moved
require -- from WEL_WINDOW
exists: exists

on_ok
-- The ok button is pressed
require -- from WEL_DIALOG
exists: exists

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class FUN_DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

artist : ARTIST

artist_button : WEL_PUSH_BUTTON
-- Was declared in MAIN_WINDOW as synonym of maze_button and fun_button .

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

fun_button : WEL_PUSH_BUTTON
-- Was declared in MAIN_WINDOW as synonym of maze_button and artist_button .

fun_dialog : FUN_DIALOG

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

maze : MAZE

maze_button : WEL_PUSH_BUTTON
-- Was declared in MAIN_WINDOW as synonym of artist_button and fun_button .

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAZE Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAZE

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAZE

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Header_ctrl

Header Control Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\header_ctrl\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as shown above. By manipulating the header control, you will see notification of the events that occur displayed in the WEL_LIST_VIEW situated below.

Under the Hood

HEADER_CONTROL inherits WEL_HEADER_CONTROL and redefines many of the `on_' notification features to display the output.

This sample contains the following classes:

  • APPLICATION_IDS
  • HEADER_CONTROL
  • HEADER_CONTROL_DEMO
  • MAIN_WINDOW


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
HEADER_CONTROL
HEADER_CTRL_DEMO
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\comctrls\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Id_ico_application : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


HEADER_CONTROL Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "HEADERCONTROL class of the WEL example : Header_Control."
status: "See notice at end of class."
date: ""
revision: ""

class interface
HEADER_CONTROL

create

make (a_parent: WEL_WINDOW ; a_x, a_y, a_width, a_height, an_id: INTEGER )
-- Create the control and some items in it.
require -- from WEL_HEADER_CONTROL
a_parent_not_void: a_parent /= void
ensure -- from WEL_HEADER_CONTROL
exists: exists
parent_set: parent = a_parent
id_set: id = an_id

feature -- Access

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

font : WEL_FONT
-- Font with which the control is drawing its text.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
ensure -- from WEL_CONTROL
result_not_void: Result /= void

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

id : INTEGER
-- Control id
-- (from WEL_CONTROL )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

item_output : WEL_STATIC

mess_output : WEL_SINGLE_SELECTION_LIST_BOX

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

flag_set (flags, mask: INTEGER ): BOOLEAN
-- Is mask set in flags?
-- (from WEL_BIT_OPERATIONS )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_system_font : BOOLEAN
-- Does the control use the system font?
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

item_count : INTEGER
-- Retrieves the number of items that are in the header control
-- (from WEL_HEADER_CONTROL )
require -- from WEL_HEADER_CONTROL
exists: exists
ensure -- from WEL_HEADER_CONTROL
positive_result: Result >= 0

item_info_from_point (a_point: WEL_POINT ): WEL_HD_HIT_TEST_INFO
-- Tests a point to determine which header item, if any, is at the specified point.
-- (from WEL_HEADER_CONTROL )
require -- from WEL_HEADER_CONTROL
exists: exists
a_point_exists: a_point /= void and then a_point. exists

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_width : INTEGER
-- Minimal width allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

valid_index (index: INTEGER ): BOOLEAN
-- (from WEL_HEADER_CONTROL )

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

feature -- Element change

add_mess_output (str: STRING )
-- Add a message to the output.

delete_header_item (index: INTEGER )
-- delete item from header control at index index
-- (from WEL_HEADER_CONTROL )
require -- from WEL_HEADER_CONTROL
exists: exists
valid_index: valid_index (index)
ensure -- from WEL_HEADER_CONTROL
item_count_decreased: item_count = old item_count - 1

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

insert_header_item (hd_item: WEL_HD_ITEM ; insert_after_item_no: INTEGER )
-- Insert an item to the header control after the
-- insert_item_item_no item. If there is no item in the list
-- yet, or you want to insert the new item as the first
-- one, use use 0 for insert_item
-- (from WEL_HEADER_CONTROL )
require -- from WEL_HEADER_CONTROL
exists: exists
hd_item_not_void: hd_item /= void
insert_after_item_no_positive: insert_after_item_no >= 0
ensure -- from WEL_HEADER_CONTROL
item_count_increased: item_count = old item_count + 1

insert_text_header_item (a_label: STRING ; a_width, a_format: INTEGER ; insert_after_item_no: INTEGER )
-- Insert a text item to the header control after the
-- insert_item_item_no item. If there is no item in the list
-- yet, or you want to insert the new item as the first
-- one, use use 0 for insert_item
-- The item will be a_width broad and use 'a_format` as format.
-- For possible formats please look into WEL_HDF_CONSTANTS .
-- (Hdf_string will be set automatically)
-- (from WEL_HEADER_CONTROL )
require -- from WEL_HEADER_CONTROL
exists: exists
label_not_void: a_label /= void
insert_after_item_no_positive: insert_after_item_no >= 0
ensure -- from WEL_HEADER_CONTROL
item_count_increased: item_count = old item_count + 1

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

retrieve_and_set_windows_pos (parent_client_rect: WEL_RECT )
-- Asks the OS for the window position and size,
-- given the parents client area is parent_client_rect
-- (from WEL_HEADER_CONTROL )
require -- from WEL_HEADER_CONTROL
exists: exists
rect_exists: parent_client_rect /= void and then parent_client_rect. exists

set_font (a_font: WEL_FONT )
-- Set font with a_font.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
a_font_not_void: a_font /= void
a_font_exists: a_font. exists
ensure -- from WEL_CONTROL
font_set: not has_system_font implies font . item = a_font. item

set_header_item (index: INTEGER ; hd_item: WEL_HD_ITEM )
-- This windows message sets the attributes of the specified item in a header control.
-- (from WEL_HEADER_CONTROL )
require -- from WEL_HEADER_CONTROL
exists: exists
hd_item_exists: hd_item /= void and then hd_item. exists
valid_index: valid_index (index)

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_item_output (static: WEL_STATIC )
-- Make static the new output.

set_mess_output (list: WEL_SINGLE_SELECTION_LIST_BOX )
-- Make static the new output.

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

destroy
-- Destroy the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

clear_flag (flags, mask: INTEGER ): INTEGER
-- Clear the mask in flags
-- (from WEL_BIT_OPERATIONS )
ensure -- from WEL_BIT_OPERATIONS
flag_unset: not flag_set (Result, mask)

default_process_notification (notification_code: INTEGER )
-- Process a notification_code which has not been
-- processed by process_notification .
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in the current group in a_parent
-- depending on the value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in `a_parent depending on the
-- value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_flag (flags, mask: INTEGER ): INTEGER
-- Set the mask in flags
-- (from WEL_BIT_OPERATIONS )
ensure -- from WEL_BIT_OPERATIONS
flag_set: flag_set (Result, mask)

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Notifications

on_hdn_begin_track (info: WEL_HD_NOTIFY )
-- The user has begun dragging a divider in the control
-- (that is, the user has pressed the left mouse button while
-- the mouse cursor is on a divider in the header control).
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

on_hdn_divider_dbl_click (info: WEL_HD_NOTIFY )
-- The user double-clicked the divider area of the control.
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

on_hdn_end_track (info: WEL_HD_NOTIFY )
-- The user has finished dragging a divider.
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

on_hdn_item_changed (info: WEL_HD_NOTIFY )
-- The attributes of a header item have changed.
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

on_hdn_item_changing (info: WEL_HD_NOTIFY )
-- The attributes of a header item are about to change.
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

on_hdn_item_click (info: WEL_HD_NOTIFY )
-- The user clicked the control.
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

on_hdn_item_dbl_click (info: WEL_HD_NOTIFY )
-- The user double-clicked the control.
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

on_hdn_track (info: WEL_HD_NOTIFY )
-- The user is dragging a divider in the header control.
require -- from WEL_HEADER_CONTROL
exists: exists
info_exists: info /= void and then info. exists

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HEADER_CONTROL

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


HEADER_CTRL_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Application class of the WEL example : Header_Control."
status: "See notice at end of class."

class interface
HEADER_CTRL_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

common_controls_dll : WEL_COMMON_CONTROLS_DLL

init_application
-- Load the common controls dll and the rich edit dll.

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HEADER_CTRL_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Main window class of the WEL example : Header_Control."
status: "See notice at end of class."
date: ""
revision: ""

class interface
MAIN_WINDOW

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

header_control : HEADER_CONTROL

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

label : WEL_STATIC

list : WEL_SINGLE_SELECTION_LIST_BOX

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Hello

Hello World Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\hello\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

After you launch the sample, You should see a window displayed as illustrated above. You will have full control over the window, and the program will quit when you close the window.

Under the Hood

MAIN_WINDOW inherits WEL_FRAME_WINDOW. In this example, we have redefined on_paint as shown below:

on_paint (paint_dc: WEL_PAINT_DC; invalid_rect: WEL_RECT) is
      --Draw a centered text
   is
      paint_dc.draw_centered_text("Hello, World!", client_rect)
   end

Note: If you look at MAIN_WINDOW, you will see that it contains many features. However, nearly all of these are features are inherited from WEL_FRAME_WINDOW.

This sample contains the following classes:

  • HELLO_DEMO
  • MAIN_WINDOW

See Also
Tutorial Step3
Common message hooks


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
HELLO_DEMO
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


HELLO_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
HELLO_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HELLO_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window

feature -- Initialization

make
-- Make the main window

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


list_view

List View Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\list_view\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed containing a pair of WEL_LIST_VIEW. Clicking the button marked "style" will modify the style of the lower list view. If you click the mouse within this lower list view, you will see notification of events appearing in the upper list view.

Under the Hood

LISTVIEW_DEMO redefines `init_application' in order to load the WEL_COMMON_CONTROLS_DLL and the WEL_RICH_EDIT_DLL.

LISTVIEW redefines many of the `on_' features inherited from WEL_LIST_VIEW in order to generate output for the user.

The style of the LISTVIEW_DEMO is changed by calling set_style with the required new style.

This sample contains the following classes:

  • LISTVIEW
  • MAIN_WINDOW
  • LISTVIEW_DEMO
  • APPLICATION_IDS

See Also
WEL_LIST_VIEW


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
LISTVIEW
LISTVIEW_DEMO
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\comctrls\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Id_ico_application : INTEGER is 1

Idi_blue : INTEGER is 403

Idi_green : INTEGER is 402

Idi_magenta : INTEGER is 404

Idi_red : INTEGER is 401

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LISTVIEW_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Application class of the WEL example : List_view."
status: "See notice at end of class."

class interface
LISTVIEW_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

common_controls_dll : WEL_COMMON_CONTROLS_DLL

init_application
-- Load the common controls dll and the rich edit dll.

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

rich_edit_dll : WEL_RICH_EDIT_DLL

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class LISTVIEW_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LISTVIEW Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: " LISTVIEW class of the WEL example : List_view."
status: "See notice at end of class."
date: ""
revision: ""

class interface
LISTVIEW

create

make (a_parent: WEL_WINDOW ; a_x, a_y, a_width, a_height, an_id: INTEGER )
-- Create the tree and some items in it.
require -- from WEL_LIST_VIEW
a_parent_not_void: a_parent /= void
ensure -- from WEL_LIST_VIEW
exists: exists
parent_set: parent = a_parent
id_set: id = an_id

feature -- Access

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

font : WEL_FONT
-- Font with which the control is drawing its text.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
ensure -- from WEL_CONTROL
result_not_void: Result /= void

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

id : INTEGER
-- Control id
-- (from WEL_CONTROL )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

item_output : WEL_STATIC

mess_output : WEL_SINGLE_SELECTION_LIST_BOX

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

column_count : INTEGER
-- Number of columns
-- (from WEL_LIST_VIEW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

count : INTEGER
-- Number of item in the list view
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focus_item : INTEGER
-- Zero-based index of the item that has the focus
-- Return -1 if there is none.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
ensure -- from WEL_LIST_VIEW
result_large_enough: Result >= - 1
result_small_enough: Result < count

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

get_background_color : WEL_COLOR_REF
-- Result is background color used for control.
-- (from WEL_LIST_VIEW )

get_column_width (column: INTEGER ): INTEGER
-- Width of the zero-based index-th item.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: column >= 0
index_small_enough: column < column_count

get_extended_view_style : INTEGER
-- Gets extended styles in list view controls.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
function_supported: comctl32_version >= version_470

get_item (index, subitem: INTEGER ): WEL_LIST_VIEW_ITEM
-- Return a representation of the item at the
-- index position.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < count
subitem_large_enough: subitem >= 0
subitem_small_enough: subitem < column_count

get_item_position (index: INTEGER ): WEL_POINT
-- Retrieves the position of the zero-based index-th item.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < count

get_item_rect (index: INTEGER ): WEL_RECT
-- Retrieves the position of the zero-based index-th item.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index <= count

get_item_state (index, mask: INTEGER ): INTEGER
-- State of the zero-based index-th item. The mask give
-- the state informations to retrieve. See WEL_LVIS_CONSTANTS for
-- the value of the mask.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < count

get_tooltip : WEL_TOOLTIP
-- Result is tooltip associated with Current.
-- (from WEL_LIST_VIEW )

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_system_font : BOOLEAN
-- Does the control use the system font?
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_width : INTEGER
-- Minimal width allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

selected_count : INTEGER
-- Number of selected items in the list view window
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists

selected_item : INTEGER
-- Contains the top most selected index.
-- -1 if no item is selected.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
ensure -- from WEL_LIST_VIEW
result_valid: selected_count > 0 implies Result >= 0

selected_items : ARRAY [ INTEGER ]
-- Contains all the selected index. Only one in
-- case of a single selection list view.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
ensure -- from WEL_LIST_VIEW
result_not_void: Result /= void
result_valid: Result. count = selected_count

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

top_index : INTEGER
-- Index of the first visible item
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists
ensure -- from WEL_LIST_VIEW
result_large_enough: Result >= 0
result_small_enough: Result <= count

visible_count : INTEGER
-- Number of items that will fit in the list view window
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

ensure_visible (an_index: INTEGER )
-- Ensure that column an_index is completely visible in Current.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: an_index >= 0
index_small_enough: an_index < count

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_background_color (a_color: WEL_COLOR_REF )
-- (from WEL_LIST_VIEW )

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_cell_text (isub_item, iitem: INTEGER ; txt: STRING )
-- Set the label of the cell with coordinates isub_item, item
-- with txt.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
isub_item_large_enough: isub_item >= 0
iitem_large_enough: iitem >= 0
isub_item_small_enough: isub_item < column_count
iitem_small_enough: iitem < count

set_column_format (index: INTEGER ; fmt: INTEGER )
-- Set the alignment of the column, cannot be used for
-- the first column that must be left aligned.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index > 0
index_small_enough: index < column_count
good_format: valid_lvcfmt_constant (fmt)

set_column_title (txt: STRING ; index: INTEGER )
-- Make txt the new title of the index-th column.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < column_count

set_column_width (value, index: INTEGER )
-- Make value the new width of the zero-base index-th column.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < column_count

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_extended_view_style (a_new_style: INTEGER )
-- Sets extended styles in list view controls.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
function_supported: comctl32_version >= version_470

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_image_list (an_imagelist: WEL_IMAGE_LIST )
-- Set the current "large" image list to an_imagelist.
-- If an_imagelist is set to Void, it removes
-- the current associated image list (if any).
-- (from WEL_LIST_VIEW )

set_item_count (value: INTEGER )
-- Prepares a list view control for adding a large number
-- of items and make it then faster.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
value_big_enough: value >= 0

set_item_state (index, state: INTEGER )
-- Set state of item at index with state.
-- See class WEL_LVIS_CONSTANTS for possible state values.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < count

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_small_image_list (an_imagelist: WEL_IMAGE_LIST )
-- Set the current "small" image list to an_imagelist.
-- If an_imagelist is set to Void, it removes
-- the current associated image list (if any).
-- (from WEL_LIST_VIEW )

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

update_item (index: INTEGER )
-- Update the list view.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < count

feature -- Element change

add_mess_output (str: STRING )
-- Add a message to the output.

append_column (column: WEL_LIST_VIEW_COLUMN )
-- Append column to the list view.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
ensure -- from WEL_LIST_VIEW
new_column_count: column_count = old column_count + 1

delete_column (index: INTEGER )
-- Remove the zero-based index-th column of the list view.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < column_count
ensure -- from WEL_LIST_VIEW
new_column_count: column_count = old column_count - 1

delete_item (index: INTEGER )
-- Remove the zero-based index-th item of the list view.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index < count
ensure -- from WEL_LIST_VIEW
new_count: count = old count - 1

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

insert_column (column: WEL_LIST_VIEW_COLUMN ; index: INTEGER )
-- Insert column at the zero-based index.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: index >= 0
index_small_enough: index <= column_count
ensure -- from WEL_LIST_VIEW
new_column_count: column_count = old column_count + 1

insert_item (an_item: WEL_LIST_VIEW_ITEM )
-- Insert item in the list-view. The zero-based position of the item is
-- given by the iitem attribute of the item.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: an_item. iitem >= 0
index_small_enough: an_item. iitem <= count
ensure -- from WEL_LIST_VIEW
new_count: count = old count + 1

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

prepend_column (column: WEL_LIST_VIEW_COLUMN )
-- Prepend column to the list view.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
ensure -- from WEL_LIST_VIEW
new_column_count: column_count = old column_count + 1

replace_item (an_item: WEL_LIST_VIEW_ITEM )
-- Set the properties of an_item.
-- The zero-based position of the item is given by the
-- iitem attribute of the item.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
index_large_enough: an_item. iitem >= 0
index_small_enough: an_item. iitem <= count

reset_content
-- Reset the content of the list.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
exists: exists
ensure -- from WEL_LIST_VIEW
new_count: count = 0

set_font (a_font: WEL_FONT )
-- Set font with a_font.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
a_font_not_void: a_font /= void
a_font_exists: a_font. exists
ensure -- from WEL_CONTROL
font_set: not has_system_font implies font . item = a_font. item

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_item_output (static: WEL_STATIC )
-- Make static the new output.

set_mess_output (list: WEL_SINGLE_SELECTION_LIST_BOX )
-- Make static the new output.

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

destroy
-- Destroy the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

default_process_notification (notification_code: INTEGER )
-- Process a notification_code which has not been
-- processed by process_notification .
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in the current group in a_parent
-- depending on the value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in `a_parent depending on the
-- value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- "Shell and Common controls" Versions

comctl32_version : INTEGER
-- Version of Comctl32.dll
-- (from WEL_WINDOWS_VERSION )

shell32_version : INTEGER
-- Version of Shell32.dll
-- (from WEL_WINDOWS_VERSION )

shlwapi_version : INTEGER
-- Version of Shlwapi.dll
-- (from WEL_WINDOWS_VERSION )

feature -- Basic Operations

search (a_search_info: WEL_LIST_VIEW_SEARCH_INFO ; a_starting_index: INTEGER ): INTEGER
-- Search list view item according to a_search_info.
-- Search starts after zero based index a_starting_index.
-- If a_starting_index is -1 then search all items.
-- Result is zero based index of found item or -1 if item was not found.
-- (from WEL_LIST_VIEW )
require -- from WEL_LIST_VIEW
non_void_search_info: a_search_info /= void
valid_search_info: a_search_info. exists
valid_starting_index: a_starting_index >= - 1 and a_starting_index < count

feature -- Changing the style

change_style
-- Change the style of the listview.

current_type : INTEGER
-- Current style of the list.

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

feature -- Notifications

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
require -- from WEL_WINDOW
exists: exists

on_lvn_begindrag (info: WEL_NM_LIST_VIEW )
-- A drag-and-drop operation involving the left mouse
-- button is being initiated.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_beginlabeledit (info: WEL_LIST_VIEW_ITEM )
-- A label editing for an item has started.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_beginrdrag (info: WEL_NM_LIST_VIEW )
-- A drag-and-drop operation involving the right mouse
-- button is being initiated.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_columnclick (info: WEL_NM_LIST_VIEW )
-- A column was tapped.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_deleteallitems (info: WEL_NM_LIST_VIEW )
-- All the items were deleted.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_deleteitem (info: WEL_NM_LIST_VIEW )
-- An item was deleted.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_endlabeledit (info: WEL_LIST_VIEW_ITEM )
-- A label editing for an item has ended.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_getdispinfo (info: WEL_LIST_VIEW_ITEM )
-- It is a request for the parent window to
-- provide information needed to display or
-- sort a list view item.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_insertitem (info: WEL_NM_LIST_VIEW )
-- A new item was inserted.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_itemchanged (info: WEL_NM_LIST_VIEW )
-- An item has changed.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_itemchanging (info: WEL_NM_LIST_VIEW )
-- An item is changing
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_keydown (virtual_key: INTEGER )
-- A key has been pressed.
require -- from WEL_LIST_VIEW
exists: exists

on_lvn_setdispinfo (info: WEL_LIST_VIEW_ITEM )
-- The list must update the information it maintains
-- for an item.
require -- from WEL_LIST_VIEW
exists: exists

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Validation

is_valid_list_view_flag (a_flag: INTEGER ): BOOLEAN
-- Is a_flag a valid list view search flag?
-- (from WEL_LIST_VIEW_CONSTANTS )

valid_lvcfmt_constant (value: INTEGER ): BOOLEAN
-- Is value a valid lvcfmt constant?
-- (from WEL_LIST_VIEW_CONSTANTS )

valid_lvis_constants (value: INTEGER ): BOOLEAN
-- Is value a valid "Item Styles" constant?
-- (from WEL_LIST_VIEW_CONSTANTS )

feature -- Version Constants

version_400 : INTEGER
-- version_400 <=> Microsoft® Windows® 95/Windows NT® 4.0
-- (from WEL_WINDOWS_VERSION )

version_470 : INTEGER
-- version_470 <=> Microsoft® Internet Explorer 3.x
-- (from WEL_WINDOWS_VERSION )

version_471 : INTEGER
-- version_471 <=> Microsoft® Internet Explorer 4.0
-- (from WEL_WINDOWS_VERSION )

version_472 : INTEGER
-- version_472 <=> Microsoft® Internet Explorer 4.01 & Windows® 98
-- (from WEL_WINDOWS_VERSION )

version_500 : INTEGER
-- version_500 (Shlwapi.dll) <=> Microsoft® Internet Explorer 5
-- version_500 (Shell32.dll) <=> Microsoft® Windows® 2000
-- (from WEL_WINDOWS_VERSION )

version_580 : INTEGER
-- version_580 (Comctl32.dll) <=> Microsoft® Internet Explorer 5
-- (from WEL_WINDOWS_VERSION )

version_581 : INTEGER
-- version_581 (Comctl32.dll)<=> Microsoft® Windows 2000
-- (from WEL_WINDOWS_VERSION )

feature -- Windows Versions

is_windows_2000 : BOOLEAN
-- (from WEL_WINDOWS_VERSION )
ensure -- from WEL_WINDOWS_VERSION
windows2000_is_nt: Result implies is_windows_nt

is_windows_95 : BOOLEAN
-- Is the current program running under Windows 95
-- (OSR1, OSR2 or OSR2.5)?
-- (from WEL_WINDOWS_VERSION )
ensure -- from WEL_WINDOWS_VERSION
windows95_is_9x: Result implies is_windows_9x

is_windows_98 : BOOLEAN
-- Is the current program running under Windows 98
-- (1st or 2nd edition)?
-- (from WEL_WINDOWS_VERSION )
ensure -- from WEL_WINDOWS_VERSION
windows98_is_9x: Result implies is_windows_9x

is_windows_9x : BOOLEAN
-- Is the current program running under Windows 9x
-- (Windows 95, Windows 98, Windows Me, ...)?
-- (from WEL_WINDOWS_VERSION )

is_windows_me : BOOLEAN
-- Is the current program running under Windows Millenium Edition?
-- (from WEL_WINDOWS_VERSION )
ensure -- from WEL_WINDOWS_VERSION
windows_me_is_9x: Result implies is_windows_9x

is_windows_nt : BOOLEAN
-- Is the current program running under Windows NT
-- (Windows NT 3.51, Windows NT4, Windows 2000, ...)?
-- (from WEL_WINDOWS_VERSION )

is_windows_nt4 : BOOLEAN
-- (from WEL_WINDOWS_VERSION )
ensure -- from WEL_WINDOWS_VERSION
windows_nt4_is_nt: Result implies is_windows_nt

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class LISTVIEW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Main window class of the WEL example : List_view."
status: "See notice at end of class."
date: ""
revision: ""

class interface
MAIN_WINDOW

create

make

feature -- Access

button : WEL_PUSH_BUTTON

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

label : WEL_STATIC

list : WEL_SINGLE_SELECTION_LIST_BOX

list_view : LISTVIEW

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Magnify

Magnify Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\magnify\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. Selecting "Quick reference..." from the "Help" menu will display the full instructions for using this application.

Under the Hood

In order to be able to control the output of the sample, MAIN_WINDOW redefines many features from WEL_FRAME_WINDOW. The feature draw_zoom_rectangle is used to display the output and on_menu_command handles the notifications sent to the window when a menu_selection has been made.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • MAGNIFY_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAGNIFY_DEMO
MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\magnify\app.rc."

class interface
APPLICATION_IDS

feature -- Access

About_dlg_id : INTEGER is 1

Cmd_about : INTEGER is 101

Cmd_automatic_refresh : INTEGER is 105

Cmd_exit : INTEGER is 107

Cmd_quickref : INTEGER is 106

Cmd_refresh : INTEGER is 104

Cmd_zoom_in : INTEGER is 102

Cmd_zoom_out : INTEGER is 103

Id_ico_application : INTEGER is 1

Id_main_menu : INTEGER is 1

Quickref_dlg_id : INTEGER is 2

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\magnify\app.rc."

Ancestors
ANY

Queries
About_dlg_id : INTEGER
Cmd_about : INTEGER
Cmd_automatic_refresh : INTEGER
Cmd_exit : INTEGER
Cmd_quickref : INTEGER
Cmd_refresh : INTEGER
Cmd_zoom_in : INTEGER
Cmd_zoom_out : INTEGER
Id_ico_application : INTEGER
Id_main_menu : INTEGER
Quickref_dlg_id : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAGNIFY_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAGNIFY_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAGNIFY_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAGNIFY_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
MAGNIFY_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the window.

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

cx_zoomed : INTEGER
-- X coordinate on screen

cy_zoomed : INTEGER
-- Y coordinate on screen

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

palette : WEL_PALETTE
-- Physical palette to grab images on the screen

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

zoom : INTEGER
-- Zoom factor (4 by default)

zoom_point : WEL_POINT
-- Hot spot

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message.
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Draw zoom rectangle and paint window.
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Stop grabbing.
require -- from WEL_WINDOW
exists: exists

on_menu_command (id_menu: INTEGER )
-- Process the command identified by id_menu.
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Repaint window with new region.
require -- from WEL_WINDOW
exists: exists

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Zoom in rectangle on screen.
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_timer (timer_id: INTEGER )
-- Refresh the window.
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

feature -- Status Report

is_refreshing : BOOLEAN
-- Is automatic refreshing on?

is_tracking : BOOLEAN
-- Is mouse moving with left button pressed?

invariant

zoom_in_bounds: min_zoom <= zoom and zoom <= max_zoom
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_PC_CONSTANTS
WEL_RASTER_OPERATIONS_CONSTANTS
WEL_VK_CONSTANTS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
cx_zoomed : INTEGER
cy_zoomed : INTEGER
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
is_refreshing : BOOLEAN
is_tracking : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
Palette : WEL_PALETTE
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER
zoom : INTEGER
zoom_point : WEL_POINT

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_key_down (virtual_key, key_data: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_command (id_menu: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_timer (timer_id: INTEGER )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

Constraints
zoom in bounds

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Mdi

Multiple Document Interface Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\mdi\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above. Selecting "New" from the "File" menu will create a new child window, while selecting "Close" will close the currently selected child window. The options available on the "Window" menu allow positioning of the child windows. Selecting "Exit" from the "File" menu or closing the window manually will exit the program.

Under the Hood

MAIN_WINDOW inherits WEL_MDI_FRAME_WINDOW to provide the multiple document interface behaviour while each child window is of type WEL_MDI_CHILD_WINDOW. When "Close" is selected from the "File" menu, the feature active_window from WEL_MDI_FRAME_WINDOW is used to select the window that must be closed.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • MDI_DEMO

See Also
Bmpview


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAIN_WINDOW
MDI_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\mdi\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_file_close : INTEGER is 101

Cmd_file_exit : INTEGER is 102

Cmd_file_new : INTEGER is 100

Cmd_window_arrange : INTEGER is 203

Cmd_window_cascade : INTEGER is 202

Cmd_window_tile_horizontal : INTEGER is 201

Cmd_window_tile_vertical : INTEGER is 200

Id_ico_application : INTEGER is 1

Id_menu_application : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MDI_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MDI_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MDI_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Menus

Menus Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\menus\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, you will see a window displayed with a similar appearance to the one displayed above. If you right click in the client area of the window, a menu will pop up at the cursor position. The same menu is also accessible from the "File" menu. Selecting any of the menu options will display a notification of which option was selected.

Under the Hood

A WEL_MENU is used for the menu's in this sample. The feature show_track is used to display the menu at the cursor position and a WEL_MSG_BOX is used to display the notification when a menu selection has occured.

This sample contains the following classes:

  • MAIN_WINDOW
  • MENUS_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
MAIN_WINDOW
MENUS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

background_brush : WEL_BRUSH
-- Dialog boxes background color is the same than
-- button color.
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MENUS_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MENUS_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MENUS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Minimal

Minimal Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\minimal\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above. There is no other functionality, but clicking on the close icon (Cross in top right hand corner), will close the window.

Under the Hood

MINIMAL_DEMO inherits WEL_APPLICATION and redefines main_Window in order to display a WEL_FRAME_WINDOW.

This sample contains only one class:

    MINIMAL_DEMO

See Also
tutorial step 1
WEL_FRAME_WINDOW


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
MINIMAL_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MINIMAL_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MINIMAL_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : WEL_FRAME_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MINIMAL_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Pizza

Pizza Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\pizza\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed titled "WEL Pizza" If you select "Order" from the "Pizza" menu, a new window will appear (Illustrated above), which allows you to enter details of a new pizza order. When the order is completed, clicking the "ok" button will display the details of the order that was entered. Selecting "Exit from the "Pizza" menu or closing the original window will exit the program.

Under the Hood

MAIN_WINDOW inherits WEL_FRAME_WINDOW while DIALOG inherits WEL_MODAL_DIALOG. DIALOG demonstrates the use of a selection of common controls to build a custom user interface.

This sample contains the following classes:

  • APPLICATION_IDS
  • DIALOG
  • MAIN_WINDOW
  • PIZZA_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
DIALOG
MAIN_WINDOW
PIZZA_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\pizza\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_exit : INTEGER is 1000

Cmd_order : INTEGER is 101

Id_checkbox_garlic : INTEGER is 105

Id_checkbox_oregano : INTEGER is 104

Id_dialog_pizza : INTEGER is 1

Id_ico_application : INTEGER is 1

Id_ico_forhere : INTEGER is 4

Id_ico_pizza : INTEGER is 2

Id_ico_thick : INTEGER is 5

Id_ico_thin : INTEGER is 6

Id_ico_togo : INTEGER is 3

Id_listbox_items : INTEGER is 110

Id_main_menu : INTEGER is 1

Id_rad_for_here : INTEGER is 101

Id_rad_stuff : INTEGER is 113

Id_rad_thick : INTEGER is 112

Id_rad_thin : INTEGER is 111

Id_rad_to_go : INTEGER is 102

Id_size : INTEGER is 109

Id_static_price : INTEGER is 103

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


DIALOG Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
DIALOG

create

make (a_parent: WEL_COMPOSITE_WINDOW )

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

items_selected : INTEGER

listbox_items : WEL_MULTIPLE_SELECTION_LIST_BOX

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

radio_for_here : WEL_RADIO_BUTTON
-- Was declared in DIALOG as synonym of radio_thin , radio_thick , radio_stuff and radio_to_go .

radio_stuff : WEL_RADIO_BUTTON
-- Was declared in DIALOG as synonym of radio_thin , radio_thick , radio_for_here and radio_to_go .

radio_thick : WEL_RADIO_BUTTON
-- Was declared in DIALOG as synonym of radio_thin , radio_stuff , radio_for_here and radio_to_go .

radio_thin : WEL_RADIO_BUTTON
-- Was declared in DIALOG as synonym of radio_thick , radio_stuff , radio_for_here and radio_to_go .

radio_to_go : WEL_RADIO_BUTTON
-- Was declared in DIALOG as synonym of radio_thin , radio_thick , radio_stuff and radio_for_here .

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

size : WEL_DROP_DOWN_LIST_COMBO_BOX

size_price : INTEGER

static_price : WEL_STATIC

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog box.
-- Can be called several times.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODAL_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature

on_ok
require -- from WEL_DIALOG
exists: exists

text_info : STRING
ensure
result_not_void: Result /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

dialog : DIALOG
-- Pizza dialog

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PIZZA_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
PIZZA_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class PIZZA_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Printer

Printer Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\printer\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above. Selecting "Print" from the "File" menu will open a print dialog which will allow you to specify a printer and additional print information before printing the contents of the window.

Under the Hood

MAIN_WINDOW inherits WEL_FRAME_WINDOW and the feature `on_paint' has been redefined to display the ouptut in the client area. A WEL_PRINT_DIALOG is used to retrieve the print options before the printing occurs through the interface provided by a WEL_PRINTER_DC.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • PRINTER_DEMO

See Also
WEL_PRINT_DIALOG


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAIN_WINDOW
PRINTER_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\printer\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_exit : INTEGER is 1000

Cmd_print : INTEGER is 100

Id_ico_application : INTEGER is 1

Id_main_menu : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PRINTER_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
PRINTER_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class PRINTER_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


richedit

Rich Edit Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\list_view\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy images (*.bmp), icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as shown above. The program is a simple text editor which allows you to load and save files; select fonts and colors; and print files. The operations are accessible through the menu bar and/or the tool bar.

Under the Hood

Both the menu items and the tool bar buttons are handled by on_menu_command which has been redefined in MAIN_WINDOW.

Four of the standard dialogs provided by WEL are used to receive input from the user.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • RICHEDIT_DEMO

See Also
WEL_RICH_EDIT
WEL_PRINT_DIALOG
WEL_SAVE_FILE_DIALOG
WEL_OPEN_FILE_DIALOG
WEL_CHOOSE_COLOR_DIALOG
WEL_CHOOSE_FONT_DIALOG


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAIN_WINDOW
RICHEDIT_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\richedit\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Bmp_toolbar : INTEGER is 1

Cmd_bold : INTEGER is 1007

Cmd_bullet : INTEGER is 1015

Cmd_center : INTEGER is 1013

Cmd_color : INTEGER is 1011

Cmd_exit : INTEGER is 1006

Cmd_font : INTEGER is 1010

Cmd_italic : INTEGER is 1008

Cmd_left : INTEGER is 1012

Cmd_new : INTEGER is 1001

Cmd_open : INTEGER is 1002

Cmd_print : INTEGER is 1005

Cmd_right : INTEGER is 1014

Cmd_save : INTEGER is 1003

Cmd_save_as : INTEGER is 1004

Cmd_underline : INTEGER is 1009

Id_ico_application : INTEGER is 1

Id_main_menu : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

char_format : WEL_CHARACTER_FORMAT
-- Structure to format characters

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

file_name : STRING
-- File name of the active document

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

para_format : WEL_PARAGRAPH_FORMAT
-- Structure to format paragraphs

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

rich_edit : WEL_RICH_EDIT
-- Rich edit control

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

standard_tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
-- Tool bar Bitmaps
-- Was declared in MAIN_WINDOW as synonym of tool_bar_bitmap .

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

tool_bar : WEL_TOOL_BAR
-- Window's tool bar

tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
-- Tool bar Bitmaps
-- Was declared in MAIN_WINDOW as synonym of standard_tool_bar_bitmap .

tool_bar_button1 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button10 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button11 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button12 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button13 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button14 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button15 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button16 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button17 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 and tool_bar_button18 .

tool_bar_button18 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 and tool_bar_button17 .

tool_bar_button2 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button3 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button4 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button5 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button6 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button7 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button7 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button8 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button8 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button9 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

tool_bar_button9 : WEL_TOOL_BAR_BUTTON
-- Tool bar buttons
-- Was declared in MAIN_WINDOW as synonym of tool_bar_button1 , tool_bar_button2 , tool_bar_button3 , tool_bar_button4 , tool_bar_button5 , tool_bar_button6 , tool_bar_button7 , tool_bar_button8 , tool_bar_button10 , tool_bar_button11 , tool_bar_button12 , tool_bar_button13 , tool_bar_button14 , tool_bar_button15 , tool_bar_button16 , tool_bar_button17 and tool_bar_button18 .

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


RICHEDIT_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
RICHEDIT_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

common_controls_dll : WEL_COMMON_CONTROLS_DLL

init_application
-- Load the common controls dll and the rich edit dll.

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

rich_edit_dll : WEL_RICH_EDIT_DLL

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class RICHEDIT_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Splitarea

Split Area Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\splitarea\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

After launching the program, a window will be displayed containing a pair of WEL_RICH_EDIT in a split area. Clicking the mouse on the split area (between the two rich edits) and dragging the mouse, will adjust the split area and its content accordingly.

Under the Hood

There is no split area class provided with WEL, but WEL_SPLIT_AREA was created for this sample to illustrate how new controls can be built when required. Redefining some of the `on_' features inherited from WEL_WINDOW in WEL_SPLIT_AREA shows how the control over the contents of the split area is acheived.

This sample contains the following classes:

  • APPLICATION
  • SPLIT_AREA_DEMO
  • WEL_SPLIT_AREA

See Also
WEL_RICH_EDIT


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION
SPLIT_AREA_DEMO
WEL_SPLIT_AREA

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
APPLICATION

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

common_controls_dll : WEL_COMMON_CONTROLS_DLL

init_application
-- Load the common controls dll and the rich edit dll.

main_window : SPLIT_AREA_DEMO
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

rich_edit_dll : WEL_RICH_EDIT_DLL

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SPLIT_AREA_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Example demonstrating WEL_SPLIT_AREA "
author: "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"
date: "2000/05/04"
revision: "0.99"

class interface
SPLIT_AREA_DEMO

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

rich_edit_left : WEL_RICH_EDIT
-- The left RichEdit control

rich_edit_right : WEL_RICH_EDIT
-- The right RichEdit control

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

split_area : WEL_SPLIT_AREA
-- Our split area !!

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SPLIT_AREA_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


WEL_SPLIT_AREA Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "WEL Horizontal Split area"
author: "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"
date: "2000/05/04"
revision: "0.99"

class interface
WEL_SPLIT_AREA

create

make (a_parent: WEL_WINDOW ; a_name: STRING ; a_x, a_y, a_width, a_height, a_pos: INTEGER )
-- Make a split area with a_pos as splitter position.
require
a_parent_not_void: a_parent /= void
a_parent_exists: a_parent. exists
a_name_not_void: a_name /= void
a_pos_valid: a_pos >= 0
ensure
parent_set: parent = a_parent
exists: exists
name_set: text . is_equal (a_name)

feature -- Access

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

left_control : WEL_WINDOW
-- Control in the left part of the split area.
-- Void if none

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

right_control : WEL_WINDOW
-- Control in the right part of the split area.
-- Void if none

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_width : INTEGER
-- Minimal width allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_left_control (a_control: WEL_WINDOW )
-- Put a_control in the left part of the split area

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_right_control (a_control: WEL_WINDOW )
-- Put a_control in the right part of the split area

set_splitter_position (a_pos: INTEGER )
-- Set the width of the splitter (or also
-- the width of the left part of the split area)
require
valid_position: a_pos >= 0
ensure
position_set: splitter_position = a_pos

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

destroy
-- Destroy the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
ensure
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
ensure
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
ensure
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.

class_window_procedure : POINTER
-- Standard window procedure
ensure
result_not_null: Result /= default_pointer

invariant

valid_splitter_position: splitter_position >= 0 and splitter_position <= width
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class WEL_SPLIT_AREA

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


stddlgs

Stddlgs Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\stddlgs\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will displayed with a menu allowing you to select some of the standard dialogs provided by WEL.

Under the Hood

on_menu_command has been redefined in MAIN_WINDOW to display a different standard dialog when each of the menu items is selected.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • STDDLG_DEMO

See Also
WEL_OPEN_FILE_DIALOG
WEL_CHOOSE_FONT_DIALOG
WEL_CHOOSE_COLOR_DIALOG
WEL_PRINT_DIALOG


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAIN_WINDOW
STDDLG_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\stddlgs\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_choose_color : INTEGER is 103

Cmd_choose_file : INTEGER is 101

Cmd_choose_font : INTEGER is 102

Cmd_exit : INTEGER is 1000

Cmd_print_dialog : INTEGER is 104

Id_ico_application : INTEGER is 1

Id_main_menu : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Create the main window.

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


STDDLG_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
STDDLG_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class STDDLG_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


timer

Timer Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\timer\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustarated above. Clicking on any of the push buttons marked "Start Timer" will start a timer running, and the hatched area immdiately above the push button will change its appearence to reflect the interval of the timer.

Under the Hood

A WEL_WINDOW supports multiple timers, set by set_timer which takes a unique id for each timer. The on_timer feature is called every time a timer interval is reached with an argument corresponding to the id of the timer. Within MAIN_WINDOW, on_timer has been redefined to update the appearence of the hatched areas.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • TIMER


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAIN_WINDOW
TIMER_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\timer\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Id_ico_application : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

blue_brush : WEL_BRUSH
-- Was declared in MAIN_WINDOW as synonym of green_brush , yellow_brush and red_brush .

buttons : ARRAY [ WEL_PUSH_BUTTON ]

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

dc : WEL_CLIENT_DC

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

flash_rects : ARRAY [ WEL_RECT ]

green_brush : WEL_BRUSH
-- Was declared in MAIN_WINDOW as synonym of blue_brush , yellow_brush and red_brush .

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

red_brush : WEL_BRUSH
-- Was declared in MAIN_WINDOW as synonym of blue_brush , green_brush and yellow_brush .

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

yellow_brush : WEL_BRUSH
-- Was declared in MAIN_WINDOW as synonym of blue_brush , green_brush and red_brush .

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature

Button_border : INTEGER is 5

Button_height : INTEGER is 25

class_icon : WEL_ICON
-- Window's title
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

on_control_command (a_control: WEL_CONTROL )
-- Start or stop a timer.
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Paint window.
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_size (size_type, a_width, a_height: INTEGER )
-- Resize buttons and rectangles.
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Flash rectangle corresponding to timer_id.
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
require else
valid_timer: timer_id >= timer1 and timer_id <= timer4

set_buttons_positions (new_x, new_y: INTEGER )
-- Resize buttons.
require
buttons_exist: buttons /= void
positives: new_x >= 0 and new_y >= 0

set_flash_rect_positions (new_x, new_y: INTEGER )
-- Resize rectangles.

Start_timer : STRING is "Start Timer"
-- Push button text to start the timer

Stop_timer : STRING is "Stop Timer"
-- Push button text to stop the timer

Text_height : INTEGER is 8

Timer1 : INTEGER is 1

Timer2 : INTEGER is 2

Timer3 : INTEGER is 3

Timer4 : INTEGER is 4

Timer_interval : INTEGER is 400

Title : STRING is "WEL Timer"
-- Window's title

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TIMER_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TIMER_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TIMER_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Tree_view

Tree View Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\tree_view\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy images (*.bmp), icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above. Selecting or expanding one of the tree items will cause notification to be displayed in the list at the top of the window. Various other notifications are also displayed, such as pressing a key in the tree.

Under the Hood

TREEVIEW inherits WEL_TREE_VIEW and redefines make to initialize items within the tree. A WEL_TREE_VIEW_INSERT_STRUCT is used to insert each WEL_TREE_VIEW_ITEM while a WEL_IMAGE_LIST is used to reference images within the tree.

This sample contains the following classes:

  • TREEVIEW
  • MAIN_WINDOW
  • TREEVIEW_DEMO
  • APPLICATION_IDS

See Also
WEL_TREE_VIEW


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAIN_WINDOW
TREEVIEW
TREEVIEW_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Ressource constants"

class interface
APPLICATION_IDS

feature -- Access

Id_ico_application : INTEGER is 1

Idb_document_normal : INTEGER is 403

Idb_document_selected : INTEGER is 404

Idb_folder_normal : INTEGER is 401

Idb_folder_selected : INTEGER is 402

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Main window class of the WEL example : Tree_view."
status: "See notice at end of class."
date: ""
revision: ""

class interface
MAIN_WINDOW

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

label : WEL_STATIC

list : WEL_SINGLE_SELECTION_LIST_BOX

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

tree_view : TREEVIEW

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TREEVIEW_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Application class of the WEL example : Tree_view."
status: "See notice at end of class."

class interface
TREEVIEW_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

common_controls_dll : WEL_COMMON_CONTROLS_DLL

init_application
-- Load the common controls dll and the rich edit dll.

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

rich_edit_dll : WEL_RICH_EDIT_DLL

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TREEVIEW_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TREEVIEW Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: " TREEVIEW class of the WEL example : Tree_view."
author: "Arnaud PICHERY [ aranud@mail.dotcom.fr ]"
status: "See notice at end of class."
date: "$Date: 2001/03/13 01:01:17 $"
revision: "$Revision: 1.1 $"

class interface
TREEVIEW

create

make (a_parent: WEL_WINDOW ; a_x, a_y, a_width, a_height, an_id: INTEGER )
-- Create the tree and some items in it.
require -- from WEL_TREE_VIEW
a_parent_not_void: a_parent /= void
ensure -- from WEL_TREE_VIEW
exists: exists
parent_set: parent = a_parent
id_set: id = an_id

feature -- Access

Color_activeborder : INTEGER is 10
-- (from WEL_COLOR_CONSTANTS )

Color_activecaption : INTEGER is 2
-- (from WEL_COLOR_CONSTANTS )

Color_appworkspace : INTEGER is 12
-- (from WEL_COLOR_CONSTANTS )

Color_background : INTEGER is 1
-- (from WEL_COLOR_CONSTANTS )

Color_btnface : INTEGER is 15
-- (from WEL_COLOR_CONSTANTS )

Color_btnhighlight : INTEGER is 20
-- (from WEL_COLOR_CONSTANTS )

Color_btnshadow : INTEGER is 16
-- (from WEL_COLOR_CONSTANTS )

Color_btntext : INTEGER is 18
-- (from WEL_COLOR_CONSTANTS )

Color_captiontext : INTEGER is 9
-- (from WEL_COLOR_CONSTANTS )

Color_graytext : INTEGER is 17
-- (from WEL_COLOR_CONSTANTS )

Color_highlight : INTEGER is 13
-- (from WEL_COLOR_CONSTANTS )

Color_highlighttext : INTEGER is 14
-- (from WEL_COLOR_CONSTANTS )

Color_inactiveborder : INTEGER is 11
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaption : INTEGER is 3
-- (from WEL_COLOR_CONSTANTS )

Color_inactivecaptiontext : INTEGER is 19
-- (from WEL_COLOR_CONSTANTS )

Color_menu : INTEGER is 4
-- (from WEL_COLOR_CONSTANTS )

Color_menutext : INTEGER is 7
-- (from WEL_COLOR_CONSTANTS )

Color_scrollbar : INTEGER is 0
-- (from WEL_COLOR_CONSTANTS )

Color_window : INTEGER is 5
-- (from WEL_COLOR_CONSTANTS )

Color_windowframe : INTEGER is 6
-- (from WEL_COLOR_CONSTANTS )

Color_windowtext : INTEGER is 8
-- (from WEL_COLOR_CONSTANTS )

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

font : WEL_FONT
-- Font with which the control is drawing its text.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
ensure -- from WEL_CONTROL
result_not_void: Result /= void

get_parent_item (an_item: WEL_TREE_VIEW_ITEM ): WEL_TREE_VIEW_ITEM
-- Return the parent item of the given item.
-- (from WEL_TREE_VIEW )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

id : INTEGER
-- Control id
-- (from WEL_CONTROL )

Id_ico_application : INTEGER is 1
-- (from APPLICATION_IDS )

Idb_document_normal : INTEGER is 403
-- (from APPLICATION_IDS )

Idb_document_selected : INTEGER is 404
-- (from APPLICATION_IDS )

Idb_folder_normal : INTEGER is 401
-- (from APPLICATION_IDS )

Idb_folder_selected : INTEGER is 402
-- (from APPLICATION_IDS )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

item_output : WEL_STATIC

last_item : POINTER
-- Handle of the last item inserted
-- (from WEL_TREE_VIEW )

mess_output : WEL_SINGLE_SELECTION_LIST_BOX

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

count : INTEGER
-- Number of items in the tree view window
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
ensure -- from WEL_TREE_VIEW
positive_result: Result >= 0

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

get_image_list : WEL_IMAGE_LIST
-- Get the image list associated with this treeview.
-- Returns Void if none.
-- (from WEL_TREE_VIEW )

get_item_rect (an_item: WEL_TREE_VIEW_ITEM ): WEL_RECT
-- (from WEL_TREE_VIEW )

get_tooltip : WEL_TOOLTIP
-- Result is tooltip associated with Current.
-- (from WEL_TREE_VIEW )

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_item (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
-- Does an_item exist in the tree?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
item_not_void: an_item /= void
item_valid: an_item. exists
ensure -- from WEL_TREE_VIEW
mask_unchanged: an_item. mask = old an_item. mask

has_system_font : BOOLEAN
-- Does the control use the system font?
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

indent : INTEGER
-- Amout, in pixels, that child items are indented
-- relative to their parent items.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists

is_bold (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
-- Is an_item bold?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

is_cut (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
-- Is an_item selected as part of a cut and paste
-- operation?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

is_drophilited (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
-- Is an_item selected as a drag ans drop target?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

is_expanded (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
-- Is an_item expanded?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

is_parent (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
-- Is an_item a parent of other items?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

is_selected (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
-- Is an_item selected?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_width : INTEGER
-- Minimal width allowed for the window
-- Zero by default.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

selected : BOOLEAN
-- Is an item selected?
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists

selected_item : WEL_TREE_VIEW_ITEM
-- Return the currently selected item.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
selected: selected
ensure -- from WEL_TREE_VIEW
item_valid: Result. exists

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

valid_color_constant (c: INTEGER ): BOOLEAN
-- Is c a valid color constant?
-- (from WEL_COLOR_CONSTANTS )

visible_count : INTEGER
-- Number of items that will fit into the tree
-- view window
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
ensure -- from WEL_TREE_VIEW
positive_result: Result >= 0

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

collapse_item (an_item: WEL_TREE_VIEW_ITEM )
-- Collapse the given item.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
is_parent (an_item)
valid_item: has_item (an_item)
ensure -- from WEL_TREE_VIEW
item_collapse: not is_expanded (an_item)

deselect_item (an_item: WEL_TREE_VIEW_ITEM )
-- Deselect the given item
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)
ensure -- from WEL_TREE_VIEW
item_deselected: not is_selected (an_item)

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

expand_item (an_item: WEL_TREE_VIEW_ITEM )
-- Expand the given item.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
is_parent: is_parent (an_item)
valid_item: has_item (an_item)
ensure -- from WEL_TREE_VIEW
item_expanded: is_expanded (an_item)

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

select_drop_target (an_item: WEL_TREE_VIEW_ITEM )
-- Redraw the given an_item in the style used to
-- indicate the target of a drag and drop operation.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

select_first_visible (an_item: WEL_TREE_VIEW_ITEM )
-- Scrolls the tree view vertically so that
-- the given an_item is the first visible item.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)

select_item (an_item: WEL_TREE_VIEW_ITEM )
-- Set the selection to the given an_item.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
valid_item: has_item (an_item)
ensure -- from WEL_TREE_VIEW
item_selected: is_selected (an_item)

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_image_list (an_imagelist: WEL_IMAGE_LIST )
-- Set the current image list to an_imagelist.
-- If an_imagelist is set to Void, it removes
-- the current associated image list (if any).
-- (from WEL_TREE_VIEW )

set_indent (an_indent: INTEGER )
-- Set indent with an_indent.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_tooltip (tooltip: WEL_TOOLTIP )
-- (from WEL_TREE_VIEW )

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

feature -- Element change

add_mess_output (str: STRING )
-- Add a message to the output.

delete_item (an_item: WEL_TREE_VIEW_ITEM )
-- Remove an_item from the tree.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
item_not_void: an_item /= void
valid_item: has_item (an_item)
has_items: count > 0

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

insert_item (an_item: WEL_TREE_VIEW_INSERT_STRUCT )
-- Insert an_item in the tree.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
an_item_not_void: an_item /= void
an_item_exists: an_item. exists
ensure -- from WEL_TREE_VIEW
new_count: count = old count + 1

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_font (a_font: WEL_FONT )
-- Set font with a_font.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists
a_font_not_void: a_font /= void
a_font_exists: a_font. exists
ensure -- from WEL_CONTROL
font_set: not has_system_font implies font . item = a_font. item

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_item_output (static: WEL_STATIC )
-- Make static the new output.

set_mess_output (list: WEL_SINGLE_SELECTION_LIST_BOX )
-- Make static the new output.

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_tree_item (an_item: WEL_TREE_VIEW_ITEM )
-- Set some or all of a tree view item's attributes.
-- (from WEL_TREE_VIEW )
require -- from WEL_TREE_VIEW
exists: exists
item_exists: an_item /= void and then an_item. exists
valid_item: has_item (an_item)
has_items: count > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

destroy
-- Destroy the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

default_process_notification (notification_code: INTEGER )
-- Process a notification_code which has not been
-- processed by process_notification .
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
exists: exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in the current group in a_parent
-- depending on the value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
-- Find the previous or following control with the
-- Wm_tabstop style in `a_parent depending on the
-- value of after.
-- (from WEL_CONTROL )
require -- from WEL_CONTROL
valid_parent: a_parent /= void and then a_parent. exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

feature -- Notifications

on_tvn_begindrag (info: WEL_NM_TREE_VIEW )
-- A drag-and-drop operation involving the left mouse
-- button is being initiated.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_beginlabeledit (info: WEL_TREE_VIEW_ITEM )
-- A label editing for an item has started.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_beginrdrag (info: WEL_NM_TREE_VIEW )
-- A drag-and-drop operation involving the right mouse
-- button is being initiated.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_deleteitem (info: WEL_NM_TREE_VIEW )
-- An item has been deleted.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_endlabeledit (info: WEL_TREE_VIEW_ITEM )
-- A label editing for an item has ended.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_getdispinfo (info: WEL_TREE_VIEW_ITEM )
-- The parent window must provide information needed
-- to display or sort an item.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_itemexpanded (info: WEL_NM_TREE_VIEW )
-- a parent item's list of child items has expanded
-- or collapsed.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_itemexpanding (info: WEL_NM_TREE_VIEW )
-- a parent item's list of child items is about to
-- expand or collapse.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_keydown (virtual_key: INTEGER )
-- The user pressed a key and the tree-view control
-- has the input focus.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_selchanged (info: WEL_NM_TREE_VIEW )
-- Selection has changed from one item to another.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_selchanging (info: WEL_NM_TREE_VIEW )
-- Selection is about to change from one item to
-- another.
require -- from WEL_TREE_VIEW
exists: exists

on_tvn_setdispinfo (info: WEL_TREE_VIEW_ITEM )
-- The parent window must update the informations
-- it maintains about an item.
require -- from WEL_TREE_VIEW
exists: exists

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TREEVIEW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Tutorial

WEL Tutorial

WEL is shipped with a tutorial among its sample programs. This tutorial shows you how to develop a simple WEL application and contains eight different samples listed below:
  • Step1 - A Basic WEL Application.
  • Step2 - Responding to an event.
  • Step3 - Displaying output on a WEL_CLIENT_DC.
  • Step4 - A very basic drawing program.
  • Step5 - Using a WEL_MODAL_DIALOG.
  • Step6 - Re-drawing a window by redefining on_paint.
  • Step7 - Adding menus.
  • Step8 - Using a WEL_OPEN_FILE_DIALOG and a WEL_SAVE_FILE_DIALOG.


Step1

Tutorial Step 1

This sample shows you how to set up your first WEL_APPLICATION consisting of a single WEL_FRAME_WINDOW. This is one of the simplest WEL applications you can write, and the output is shown below:

Compiling

Running

After you launch the sample, You should see the window displayed in the screen as illustrated above. You will have full control over the window, and the program will quit when you close the window.

Note: The size and shape of the window may be different on your machine.

Under the Hood

Although this system does nothing except create and display a WEL_FRAME_WINDOW, it shows how to set up your first WEL_APPLICATION.

This sample only contains one class, TUTORIAL_STEP1 which inherits WEL_APPLICATION and redefines main_window

See Also
Inheriting WEL application
Redefining main_window


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
TUTORIAL_STEP1

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP1 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP1

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : WEL_FRAME_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP1

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Step2

Tutorial Step 2

This sample shows you how to respond to an event occurring within your application. It also demonstrates the use of a WEL_MSG_BOX control and a redefinition of closeable from WEL_COMPOSITE_WINDOW.

Compiling

Running

After launching the sample, you should see a WEL_FRAME_WINDOW displayed. If you click the left mouse button in the client area of the window, a WEL_MSG_BOX will appear, notifying you of your click.

Under the Hood

This system is a demonstration of how to connect an event to one of the common message hooks available within WEL. See Common message hooks for more information. In this example, on_left_button_down has been redefined from WEL_WINDOW to display a WEL_MSG_BOX containing notification of the event occuring.

If you look at closeable from MAIN_WINDOW, you will see that it has been redefined to display a WEL_MSG_BOX and the result from this message box is used to generate the return value of closeable. If this Result is True, the window will be closed.

This sample contains the following classes:

  • TUTORIAL_STEP2
  • MAIN_WINDOW

Note:If you follow the link to MAIN_WINDOW you will see that it contains many features, but nearly all of these are inherited from WEL_FRAME_WINDOW.

See Also
Common message hooks


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
MAIN_WINDOW
TUTORIAL_STEP2

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window.

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP2 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP2

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP2

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Step3

Tutorial Step 3

This sample demonstrates the use of a WEL_CLIENT_DC to display output in the MAIN_WINDOW. The ouput is shown below:

Compiling

Running

After launching the sample, you should see a WEL_FRAME_WINDOW displayed . If you click the left mouse button in the client area of the window, the coordinates of the click (Relative to the top left of the client area), will be displayed. Clicking the right mouse button in the client area will clear the window.

Under the Hood

This system is a demonstration of how to gain access to the client area of a window using a WEL_CLIENT_DC. The creation procedure of the DC takes a WEL_WINDOW as an argument, and in this sample, we pass the MAIN_WINDOW. Using this DC, it is a simple step to output the position of the mouse which is provided as arguments to on_left_button_down.

on_right_button_down has also been redefined to call invalidate which clears the client area of the window.

This sample contains the following classes:

  • TUTORIAL_STEP3
  • MAIN_WINDOW

See Also
Common message hooks


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
MAIN_WINDOW
TUTORIAL_STEP3

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window.

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

dc : WEL_CLIENT_DC
-- Device context associated to the current
-- client window

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP3 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP3

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP3

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Step4

Tutorial Step 4

This sample builds on the knowledge learnt in the previous tutorials (1, 2 and 3) and again demonstrates the use of a WEL_CLIENT_DC.

Compiling

Running

After launching the sample, you will see a WEL_FRAME_WINDOW displayed. By holding down the left mouse button, and moving the mouse (Within the client area of the window), you will be able to draw on the client area of the window. Pressing the right mouse button within the window will clear the client area of the window.

Under the Hood

This system is an improvement over tutorial step3 and only uses WEL techniques demonstrated in previous tutorials to allow you to draw on the client DC of the window.

This sample contains the following classes:

  • TUTORIAL_STEP4
  • MAIN_WINDOW


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
MAIN_WINDOW
TUTORIAL_STEP4

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window.

feature -- Access

button_down : BOOLEAN
-- Is the left mouse button down?

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

dc : WEL_CLIENT_DC
-- Device context associated to the current
-- client window

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP4 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP4

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP4

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Step5

Tutorial Step 5

The sample builds on tutorial step 4 and also demonstrates the use of a WEL_MODAL_DIALOG. The output is shown below:

Compiling

Running

After launching the sample, you will see a WEL_FRAME_WINDOW displayed. By holding down the left mouse button, and moving the mouse (Within the client area of the window), you will be able to draw on the client are of the window. If you press the right mouse button, a WEL_MODAL_DIALOG will pop up which allows you to enter the thickness of the line that is drawn.

Under the Hood

This sytem builds on tutorial step 4 by adding a WEL_MODAL_DIALOG. The class LINE_THICKNESS_DIALOG inherits WEL_MODAL_DIALOG and uses a WEL_SINGLE_LINE_EDIT to input the desired line width.

This sample contains the following classes:

  • TUTORIAL_STEP5
  • MAIN_WINDOW
  • LINE_THICKNESS_DIALOG
  • APPLICATION_IDS


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
LINE_THICKNESS_DIALOG
MAIN_WINDOW
TUTORIAL_STEP5

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step5\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Dlg_line_thickness : INTEGER is 1

Idc_edit_width : INTEGER is 101

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LINE_THICKNESS_DIALOG Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
LINE_THICKNESS_DIALOG

create

make (a_parent: WEL_COMPOSITE_WINDOW )
-- Make the dialog box and create edit .

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

edit : WEL_SINGLE_LINE_EDIT
-- Edit control to enter pen width

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

pen_width : INTEGER
-- Pen width entered

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog box.
-- Can be called several times.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODAL_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_mouse_move (keys, x_pos, y_pos: INTEGER )
-- Wm_mousemove message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class LINE_THICKNESS_DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window.

feature -- Access

button_down : BOOLEAN
-- Is the left mouse button down?

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

dc : WEL_CLIENT_DC
-- Device context associated to the current
-- client window

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

line_thickness_dialog : LINE_THICKNESS_DIALOG
-- Dialog box to change line thickness

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

pen : WEL_PEN
-- Pen currently selected in dc

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_pen_width (new_width: INTEGER )
-- Set pen width with new_width.

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_paint message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists
invalid_rect_not_void: invalid_rect /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP5 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP5

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP5

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Step6

Tutorial Step 6

This sample builds on tutorial step 5 by preventing the loss of the drawing when Windows re-draws the client area of the WEL_FRAME_WINDOW. The output is shown below:

Compiling

Running

After launching the sample, you will see a WEL_FRAME_WINDOW displayed. By holding down the left mouse button, and moving the mouse (Within the client area of the window), you will be able to draw on the client are of the window. If you press the right mouse button, a WEL_MODAL_DIALOG will pop up which allows you to enter the thickness of the line that is drawn. If you re-size the window, then the drawing will be re-drawn.

Under the Hood

This system uses a redefined on_paint to re-draw the contents of the window. A LINKED_LIST of LINES is used to store all the lines that have been drawn and during on_paint, this list is traversed in order to re-draw each line.

This sample contains the following classes:

  • TUTORIAL_STEP6
  • MAIN_WINDOW
  • LINE_THICKNESS_DIALOG_CHART
  • APPLICATION_IDS
  • POINT
  • LINE


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
LINE
LINE_THICKNESS_DIALOG
MAIN_WINDOW
POINT
TUTORIAL_STEP6

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step6\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Dlg_line_thickness : INTEGER is 1

Idc_edit_width : INTEGER is 101

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LINE Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
LINE

create

make
-- Create an empty list.
-- (from LINKED_LIST )
ensure -- from LINKED_LIST
is_before: before

feature -- Initialization

make
-- Create an empty list.
-- (from LINKED_LIST )
ensure -- from LINKED_LIST
is_before: before

feature -- Access

cursor : CURSOR
-- Current cursor position
-- (from LINKED_LIST )

first : like item
-- Item at first position
-- (from LINKED_LIST )
require -- from CHAIN
not_empty: not is_empty

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

i_th (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of @.
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

index : INTEGER
-- Index of current position
-- (from LINKED_LIST )

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of i-th occurrence of item identical to v.
-- (Reference or object equality,
-- based on object_comparison .)
-- 0 if none.
-- (from CHAIN )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0

item : POINT
-- Current item
-- (from LINKED_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable

last : like item
-- Item at last position
-- (from LINKED_LIST )
require -- from CHAIN
not_empty: not is_empty

sequential_occurrences (v: POINT ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

width : INTEGER
-- Width of the line

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

count : INTEGER
-- Number of items
-- (from LINKED_LIST )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
Result. count = count

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LINKED_LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LINKED_LIST )

changeable_comparison_criterion : BOOLEAN
-- May object_comparison be changed?
-- (Answer: yes by default.)
-- (from CONTAINER )

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from LINKED_LIST )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from LINKED_LIST )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from LINKED_LIST )
ensure -- from CHAIN
valid_position: Result implies not is_empty

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

off : BOOLEAN
-- Is there no current item?
-- (from LINKED_LIST )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from LINKED_LIST )

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- (from LINKED_LIST )

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )

feature -- Status setting

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

feature -- Cursor movement

back
-- Move to previous item.
-- (from LINKED_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (Go before if empty)
-- (from LINKED_LIST )
ensure then -- from CHAIN
at_last: not is_empty implies islast
ensure then -- from LINKED_LIST
empty_convention: is_empty implies before

forth
-- Move cursor to next position.
-- (from LINKED_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from LINKED_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from LINKED_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions. The cursor
-- may end up off if the offset is too big.
-- (from LINKED_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)
ensure then -- from LINKED_LIST
moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= ( count + 1)) implies index = (old index + i)
before_set: (old index + i) <= 0 implies before
after_set: (old index + i) >= ( count + 1) implies after

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from LINKED_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from LINKED_LIST
empty_convention: is_empty implies after

feature -- Element change

add (x, y: INTEGER )
-- Add a point specified by x and y.

append (s: SEQUENCE [ POINT ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

extend (v: like item )
-- Add v to end.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: has (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1

fill (other: CONTAINER [ POINT ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_off: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_off: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: has (v)
ensure then -- from CHAIN
same_count: count = old count

put_front (v: like item )
-- Add v to beginning.
-- Do not move cursor.
-- (from LINKED_LIST )
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
item_inserted: first = v

put_i_th (v: like item ; i: INTEGER )
-- Put v at i-th position.
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: i_th (k) = v

put_left (v: like item )
-- Add v to the left of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
new_index: index = old index + 1
ensure then -- from LINKED_LIST
previous_exists: previous /= void
item_inserted: previous . item = v

put_right (v: like item )
-- Add v to the right of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
same_index: index = old index
ensure then -- from LINKED_LIST
next_exists: next /= void
item_inserted: not old before implies next . item = v
item_inserted_before: old before implies active . item = v

replace (v: like item )
-- Replace current item by v.
-- (from LINKED_LIST )
require -- from ACTIVE
writable: writable
ensure -- from ACTIVE
item_replaced: item = v

set_width (a_width: INTEGER )
-- Set width with a_width.
require
positive_width: a_width >= 0
ensure
width_set: width = a_width

feature -- Removal

prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item.
-- Move cursor to right neighbor
-- (or after if no right neighbor).
-- (from LINKED_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after

remove_left
-- Remove item to the left of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1

remove_right
-- Remove item to the right of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index

wipe_out
-- Remove all items.
-- (from LINKED_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Transformation

swap (i: INTEGER )
-- Exchange item at i-th position with item
-- at cursor position.
-- (from CHAIN )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Conversion

linear_representation : LINEAR [ POINT ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

duplicate (n: INTEGER ): like Current
-- Copy of sub-chain beginning at current position
-- and having min (n, from_here) items,
-- where from_here is the number of items
-- at or to the right of current position.
-- (from DYNAMIC_CHAIN )
require -- from CHAIN
not_off_unless_after: off implies after
valid_subchain: n >= 0

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ POINT ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ POINT ]]; test: FUNCTION [ ANY , TUPLE [ POINT ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ POINT ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ POINT ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

invariant

positive_width: width >= 0
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from LINKED_LIST
prunable: prunable
empty_constraint: is_empty implies (( first_element = void ) and ( active = void ))
not_void_unless_empty: ( active = void ) implies is_empty
before_constraint: before implies ( active = first_element )
after_constraint: after implies ( active = last_element )
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

end -- class LINE

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window.

feature -- Access

button_down : BOOLEAN
-- Is the left mouse button down?

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

current_line : LINE
-- Line currently drawn by the user

dc : WEL_CLIENT_DC
-- Device context associated to the current
-- client window

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

line_thickness_dialog : LINE_THICKNESS_DIALOG
-- Dialog box to change line thickness

lines : LINKED_LIST [ LINE ]
-- All lines drawn by the user

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

pen : WEL_PEN
-- Pen currently selected in dc

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_pen_width (new_width: INTEGER )
-- Set pen width with new_width.

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_command (menu_id: INTEGER )
-- The menu_id has been choosen from the menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


POINT Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
POINT

create

make (a_x, a_y: INTEGER )
-- Make a point with a_x and a_y.
ensure
x_set: x = a_x
y_set: y = a_y

feature -- Initialization

make (a_x, a_y: INTEGER )
-- Make a point with a_x and a_y.
ensure
x_set: x = a_x
y_set: y = a_y

feature -- Access

x : INTEGER
-- x position

y : INTEGER
-- y position

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class POINT

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP6 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP6

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP6

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Step7

Tutorial Step 7

This sample builds on tutorial step 6, and also demonstrates the use of a WEL_MENU. The output is shown below:

Compiling

Running

After launching the sample, you will see a WEL_FRAME_WINDOW displayed. By holding down the left mouse button, and moving the mouse (Within the client area of the window), you will be able to draw on the client are of the window. Selecting "Line_thickness" from the "Line" menu, will bring up a WEL_MODAL_DIALOG which allows you to change the thickness of the line that is drawn. If you select "Exit" from the "File" menu, you will be prompted if you wish to exit the application. Selecting "New" from the "File" menu will clear the window. The other menu options on the "File" menu do nothing in this example.

Under the Hood

During the creation of MAIN_WINDOW, the menu is assigned to the window and on_menu_command is redefined to allow processing of the menu selctions.

This sample contains the following classes:

  • TUTORIAL_STEP7
  • MAIN_WINDOW
  • LINE_THICKNESS_DIALOG_CHART
  • APPLICATION_IDS
  • POINT
  • LINE


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
LINE
LINE_THICKNESS_DIALOG
MAIN_WINDOW
POINT
TUTORIAL_STEP7

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step7\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_exit : INTEGER is 104

Cmd_line_thickness : INTEGER is 105

Cmd_new : INTEGER is 101

Cmd_open : INTEGER is 102

Cmd_save : INTEGER is 103

Dlg_line_thickness : INTEGER is 1

Idc_edit_width : INTEGER is 101

Main_menu_id : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window.

feature -- Access

button_down : BOOLEAN
-- Is the left mouse button down?

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

current_line : LINE
-- Line currently drawn by the user

dc : WEL_CLIENT_DC
-- Device context associated to the current
-- client window

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

line_thickness_dialog : LINE_THICKNESS_DIALOG
-- Dialog box to change line thickness

lines : LINKED_LIST [ LINE ]
-- All lines drawn by the user

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

pen : WEL_PEN
-- Pen currently selected in dc

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_pen_width (new_width: INTEGER )
-- Set pen width with new_width.

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP7 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP7

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP7

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Step8

Tutorial Step 8

This sample builds on tutorial step 7, and also demonstrates the use of a WEL_OPEN_FIALOG_DIALOG and a WEL_SAVE_FILE_DIALOG. The output is shown below:

Compiling

Running

After launching the sample, you will see a WEL_FRAME_WINDOW displayed. By holding down the left mouse button, and moving the mouse (Within the client area of the window), you will be able to draw on the client are of the window. Selecting "Line_thickness" from the "Line" menu, will display a WEL_MODAL_DIALOG which allows you to change the thickness of the line that is drawn. If you select "Exit" from the "File" menu, you will be prompted if you wish to exit the application. Selecting "New" from the "File" menu will clear the window. Selecting "Save" from the "File" menu will display a WEL_SAVE_FILE_DIALOG which allows you to specify the filename and location of the picture you have drawn. Selecting "Open" from the "File" menu will display a WEL_OPEN_FILE_DIALOG which allows you to specify a previously saved drawing to open.

Under the Hood

The WEL_OPEN_FILE_DIALOG and the WEL_SAVE_FILE_DIALOG are both activated from the redefinition of on_menu_command. A new class, LINES is now used to store the lines drawn by the user and this inherits STORABLE which allows it to be easily stored and retrieved.

This sample contains the following classes:

  • TUTORIAL_STEP6
  • MAIN_WINDOW
  • LINE_THICKNESS_DIALOG_CHART
  • APPLICATION_IDS
  • POINT
  • LINES
  • LINE

See Also
Save file dialog
Open file dialog


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
LINE
LINE_THICKNESS_DIALOG
LINES
MAIN_WINDOW
POINT
TUTORIAL_STEP8

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step8\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_exit : INTEGER is 104

Cmd_line_thickness : INTEGER is 105

Cmd_new : INTEGER is 101

Cmd_open : INTEGER is 102

Cmd_save : INTEGER is 103

Dlg_line_thickness : INTEGER is 1

Idc_edit_width : INTEGER is 101

Main_menu_id : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LINES Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
LINES

create

make
-- Create an empty list.
-- (from LINKED_LIST )
ensure -- from LINKED_LIST
is_before: before

feature -- Initialization

make
-- Create an empty list.
-- (from LINKED_LIST )
ensure -- from LINKED_LIST
is_before: before

feature -- Access

Check_instruction : INTEGER is 7
-- Exception code for violated check
-- (from EXCEP_CONST )

Class_invariant : INTEGER is 6
-- Exception code for violated class invariant
-- (from EXCEP_CONST )

Com_exception : INTEGER is 28
-- Exception code for a COM error.
-- (from EXCEP_CONST )

cursor : CURSOR
-- Current cursor position
-- (from LINKED_LIST )

Developer_exception : INTEGER is 24
-- Exception code for developer exception
-- (from EXCEP_CONST )

External_exception : INTEGER is 18
-- Exception code for operating system error
-- which does not set the errno variable
-- (Unix-specific)
-- (from EXCEP_CONST )

first : like item
-- Item at first position
-- (from LINKED_LIST )
require -- from CHAIN
not_empty: not is_empty

Floating_point_exception : INTEGER is 5
-- Exception code for floating point exception
-- (from EXCEP_CONST )

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

i_th (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of @.
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

Incorrect_inspect_value : INTEGER is 9
-- Exception code for inspect value which is not one
-- of the inspect constants, if there is no Else_part
-- (from EXCEP_CONST )

index : INTEGER
-- Index of current position
-- (from LINKED_LIST )

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of i-th occurrence of item identical to v.
-- (Reference or object equality,
-- based on object_comparison .)
-- 0 if none.
-- (from CHAIN )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0

Io_exception : INTEGER is 21
-- Exception code for I/O error
-- (from EXCEP_CONST )

item : LINE
-- Current item
-- (from LINKED_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable

last : like item
-- Item at last position
-- (from LINKED_LIST )
require -- from CHAIN
not_empty: not is_empty

Loop_invariant : INTEGER is 11
-- Exception code for violated loop invariant
-- (from EXCEP_CONST )

Loop_variant : INTEGER is 10
-- Exception code for non-decreased loop variant
-- (from EXCEP_CONST )

No_more_memory : INTEGER is 2
-- Exception code for failed memory allocation
-- (from EXCEP_CONST )

sequential_occurrences (v: LINE ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

Operating_system_exception : INTEGER is 22
-- Exception code for operating system error
-- which sets the errno variable
-- (Unix-specific)
-- (from EXCEP_CONST )

Postcondition : INTEGER is 4
-- Exception code for violated postcondition
-- (from EXCEP_CONST )

Precondition : INTEGER is 3
-- Exception code for violated precondition
-- (from EXCEP_CONST )

Rescue_exception : INTEGER is 14
-- Exception code for exception in rescue clause
-- (from EXCEP_CONST )

retrieve_by_name (file_name: STRING ): ANY
-- Retrieve object structure, from external
-- representation previously stored in a file
-- called file_name.
-- To access resulting object under correct type,
-- use assignment attempt.
-- Will raise an exception (code Retrieve_exception)
-- if file content is not a stored Eiffel structure.
-- Will return Void if the file does not exist or
-- is not readable.
-- (from STORABLE )
require -- from STORABLE
file_name_exists: file_name /= void
file_name_meaningful: not file_name. is_empty

Retrieve_exception : INTEGER is 23
-- Exception code for retrieval error
-- may be raised by retrieved in IO_MEDIUM .
-- (from EXCEP_CONST )

retrieved (medium: IO_MEDIUM ): ANY
-- Retrieved object structure, from external
-- representation previously stored in medium.
-- To access resulting object under correct type,
-- use assignment attempt.
-- Will raise an exception (code Retrieve_exception)
-- if medium content is not a stored Eiffel structure.
-- (from STORABLE )
require -- from STORABLE
medium_not_void: medium /= void
medium_exists: medium. exists
medium_is_open_read: medium. is_open_read
medium_supports_storable: medium. support_storable
ensure -- from STORABLE
result_exists: Result /= void

Routine_failure : INTEGER is 8
-- Exception code for failed routine
-- (from EXCEP_CONST )

Runtime_io_exception : INTEGER is 27
-- Exception code for I/O error raised by runtime functions
-- such as store/retrieve, file access...
-- (from EXCEP_CONST )

Signal_exception : INTEGER is 12
-- Exception code for operating system signal
-- (from EXCEP_CONST )

Void_assigned_to_expanded : INTEGER is 19
-- Exception code for assignment of void value
-- to expanded entity
-- (from EXCEP_CONST )

Void_call_target : INTEGER is 1
-- Exception code for feature applied to void reference
-- (from EXCEP_CONST )

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

count : INTEGER
-- Number of items
-- (from LINKED_LIST )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
Result. count = count

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LINKED_LIST )

assertion_violation : BOOLEAN
-- Is last exception originally due to a violated
-- assertion or non-decreasing variant?
-- (from EXCEPTIONS )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LINKED_LIST )

changeable_comparison_criterion : BOOLEAN
-- May object_comparison be changed?
-- (Answer: yes by default.)
-- (from CONTAINER )

class_name : STRING
-- Name of the class that includes the recipient
-- of original form of last exception
-- (from EXCEPTIONS )

developer_exception_name : STRING
-- Name of last developer-raised exception
-- (from EXCEPTIONS )
require -- from EXCEPTIONS
applicable: is_developer_exception

exception : INTEGER
-- Code of last exception that occurred
-- (from EXCEPTIONS )

exception_trace : STRING
-- String representation of the exception trace
-- (from EXCEPTIONS )

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from LINKED_LIST )

is_developer_exception : BOOLEAN
-- Is the last exception originally due to
-- a developer exception?
-- (from EXCEPTIONS )

is_developer_exception_of_name (name: STRING ): BOOLEAN
-- Is the last exception originally due to a developer
-- exception of name name?
-- (from EXCEPTIONS )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

is_signal : BOOLEAN
-- Is last exception originally due to an external
-- event (operating system signal)?
-- (from EXCEPTIONS )

is_system_exception : BOOLEAN
-- Is last exception originally due to an
-- external event (operating system error)?
-- (from EXCEPTIONS )

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from LINKED_LIST )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from LINKED_LIST )
ensure -- from CHAIN
valid_position: Result implies not is_empty

meaning (except: INTEGER ): STRING
-- A message in English describing what except is
-- (from EXCEPTIONS )

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

off : BOOLEAN
-- Is there no current item?
-- (from LINKED_LIST )

original_class_name : STRING
-- Name of the class that includes the recipient
-- of original form of last exception
-- (from EXCEPTIONS )

original_exception : INTEGER
-- Original code of last exception that triggered
-- current exception
-- (from EXCEPTIONS )

original_recipient_name : STRING
-- Name of the routine whose execution was
-- interrupted by original form of last exception
-- (from EXCEPTIONS )

original_tag_name : STRING
-- Assertion tag for original form of last
-- assertion violation.
-- (from EXCEPTIONS )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from LINKED_LIST )

recipient_name : STRING
-- Name of the routine whose execution was
-- interrupted by last exception
-- (from EXCEPTIONS )

tag_name : STRING
-- Tag of last violated assertion clause
-- (from EXCEPTIONS )

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- (from LINKED_LIST )

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )

feature -- Status setting

catch (code: INTEGER )
-- Make sure that any exception of code code will be
-- caught. This is the default.
-- (from EXCEPTIONS )

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

die (code: INTEGER )
-- Terminate execution with exit status code,
-- without triggering an exception.
-- (from EXCEPTIONS )

ignore (code: INTEGER )
-- Make sure that any exception of code code will be
-- ignored. This is not the default.
-- (from EXCEPTIONS )

message_on_failure
-- Print an exception history table
-- in case of failure.
-- This is the default.
-- (from EXCEPTIONS )

no_message_on_failure
-- Do not print an exception history table
-- in case of failure.
-- (from EXCEPTIONS )

raise (name: STRING )
-- Raise a developer exception of name name.
-- (from EXCEPTIONS )

feature -- Cursor movement

back
-- Move to previous item.
-- (from LINKED_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (Go before if empty)
-- (from LINKED_LIST )
ensure then -- from CHAIN
at_last: not is_empty implies islast
ensure then -- from LINKED_LIST
empty_convention: is_empty implies before

forth
-- Move cursor to next position.
-- (from LINKED_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from LINKED_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from LINKED_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions. The cursor
-- may end up off if the offset is too big.
-- (from LINKED_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)
ensure then -- from LINKED_LIST
moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= ( count + 1)) implies index = (old index + i)
before_set: (old index + i) <= 0 implies before
after_set: (old index + i) >= ( count + 1) implies after

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from LINKED_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from LINKED_LIST
empty_convention: is_empty implies after

feature -- Element change

append (s: SEQUENCE [ LINE ])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

basic_store (medium: IO_MEDIUM )
-- Produce on medium an external representation of the
-- entire object structure reachable from current object.
-- Retrievable within current system only.
-- (from STORABLE )
require -- from STORABLE
medium_not_void: medium /= void
medium_exists: medium. exists
medium_is_open_write: medium. is_open_write
medium_supports_storable: medium. support_storable

extend (v: like item )
-- Add v to end.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: has (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1

fill (other: CONTAINER [ LINE ])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

general_store (medium: IO_MEDIUM )
-- Produce on medium an external representation of the
-- entire object structure reachable from current object.
-- Retrievable from other systems for same platform
-- (machine architecture).
-- (from STORABLE )
require -- from STORABLE
medium_not_void: medium /= void
medium_exists: medium. exists
medium_is_open_write: medium. is_open_write
medium_supports_storable: medium. support_storable

independent_store (medium: IO_MEDIUM )
-- Produce on medium an external representation of the
-- entire object structure reachable from current object.
-- Retrievable from other systems for the same or other
-- platform (machine architecture).
-- (from STORABLE )
require -- from STORABLE
medium_not_void: medium /= void
medium_exists: medium. exists
medium_is_open_write: medium. is_open_write
medium_supports_storable: medium. support_storable

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_off: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_off: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: has (v)
ensure then -- from CHAIN
same_count: count = old count

put_front (v: like item )
-- Add v to beginning.
-- Do not move cursor.
-- (from LINKED_LIST )
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
item_inserted: first = v

put_i_th (v: like item ; i: INTEGER )
-- Put v at i-th position.
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: i_th (k) = v

put_left (v: like item )
-- Add v to the left of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
new_index: index = old index + 1
ensure then -- from LINKED_LIST
previous_exists: previous /= void
item_inserted: previous . item = v

put_right (v: like item )
-- Add v to the right of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
same_index: index = old index
ensure then -- from LINKED_LIST
next_exists: next /= void
item_inserted: not old before implies next . item = v
item_inserted_before: old before implies active . item = v

replace (v: like item )
-- Replace current item by v.
-- (from LINKED_LIST )
require -- from ACTIVE
writable: writable
ensure -- from ACTIVE
item_replaced: item = v

store_by_name (file_name: STRING )
-- Produce on file called file_name an external
-- representation of the entire object structure
-- reachable from current object.
-- Retrievable from other systems for same platform
-- (machine architecture).
-- (from STORABLE )
require -- from STORABLE
file_name_not_void: file_name /= void
file_name_meaningful: not file_name. is_empty

feature -- Removal

prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item.
-- Move cursor to right neighbor
-- (or after if no right neighbor).
-- (from LINKED_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after

remove_left
-- Remove item to the left of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1

remove_right
-- Remove item to the right of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index

wipe_out
-- Remove all items.
-- (from LINKED_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Transformation

swap (i: INTEGER )
-- Exchange item at i-th position with item
-- at cursor position.
-- (from CHAIN )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Conversion

linear_representation : LINEAR [ LINE ]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

duplicate (n: INTEGER ): like Current
-- Copy of sub-chain beginning at current position
-- and having min (n, from_here) items,
-- where from_here is the number of items
-- at or to the right of current position.
-- (from DYNAMIC_CHAIN )
require -- from CHAIN
not_off_unless_after: off implies after
valid_subchain: n >= 0

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [ LINE ]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [ LINE ]]; test: FUNCTION [ ANY , TUPLE [ LINE ], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [ LINE ], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [ LINE ], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

feature -- Setting

set_discard_pointers (v: BOOLEAN )
-- If v it will discard POINTER values and replace them by
-- the default_pointer pointer. Otherwise it keeps the original value.
-- (from STORABLE )

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from LINKED_LIST
prunable: prunable
empty_constraint: is_empty implies (( first_element = void ) and ( active = void ))
not_void_unless_empty: ( active = void ) implies is_empty
before_constraint: before implies ( active = first_element )
after_constraint: after implies ( active = last_element )
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

end -- class LINES

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window.

feature -- Access

button_down : BOOLEAN
-- Is the left mouse button down?

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

current_line : LINE
-- Line currently drawn by the user

dc : WEL_CLIENT_DC
-- Device context associated to the current
-- client window

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

line_thickness_dialog : LINE_THICKNESS_DIALOG
-- Dialog box to change line thickness

lines : LINES
-- All lines drawn by the user

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

open_dialog : WEL_OPEN_FILE_DIALOG
-- Standard dialog box to open a file

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

pen : WEL_PEN
-- Pen currently selected in dc

save_dialog : WEL_SAVE_FILE_DIALOG
-- Standard dialog box to save a file

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_pen_width (new_width: INTEGER )
-- Set pen width with new_width.

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Messages

notify (control: WEL_CONTROL ; notify_code: INTEGER )
-- A notify_code is received for control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_accelerator_command (accelerator_id: INTEGER )
-- The acelerator_id has been activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_activate
-- Called when window gains activation (alt-tab or mouse click on title bar)
-- (from WEL_WINDOW )

on_char (character_code, key_data: INTEGER )
-- Wm_char message
-- See class WEL_VK_CONSTANTS for character_code value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
-- Wm_ctlcolorstatic, Wm_ctlcoloredit, Wm_ctlcolorlistbox
-- and Wm_ctlcolorscrollbar messages.
-- To change its default colors, the color-control control
-- needs :
-- 1. a background color and a foreground color to be selected
-- in the paint_dc,
-- 2. a backgound brush to be returned to the system.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists
paint_dc_not_void: paint_dc /= void
paint_dc_exists: paint_dc. exists

on_control_command (control: WEL_CONTROL )
-- A command has been received from control.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
control_not_void: control /= void
control_exists: control. exists

on_control_id_command (control_id: INTEGER )
-- A command has been received from control_id.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_desactivate
-- Called when window loses activation.
-- (from WEL_WINDOW )

on_destroy
-- Wm_destroy message.
-- The window is about to be destroyed.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
-- Wm_drawitem message.
-- A owner-draw control identified by control_id has
-- been changed and must be drawn. draw_item contains
-- information about the item to be drawn and the type
-- of drawing required.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
draw_item_not_void: draw_item /= void

on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
-- Wm_erasebkgnd message.
-- May be redefined to paint something on
-- the paint_dc. invalid_rect defines
-- the invalid rectangle of the client area that
-- needs to be repainted.
-- (from WEL_WINDOW )

on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
-- Wm_getminmaxinfo message.
-- The size or position of the window is about to
-- change. An application can change min_max_info to
-- override the window's default maximized size and
-- position, or its default minimum or maximum tracking
-- size.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
min_max_info_not_void: min_max_info /= void

on_hide
-- Wm_showwindow message.
-- The window is being hidden.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_horizontal_scroll (scroll_code, position: INTEGER )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Horizontal scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scroll bar
-- or track bar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_key_down (virtual_key, key_data: INTEGER )
-- Wm_keydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_key_up (virtual_key, key_data: INTEGER )
-- Wm_keyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_kill_focus
-- Wm_killfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_lbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
-- The menu_item from a_menu is currently
-- highlighted by the selection bar. flags
-- indicates the state of a_menu.
-- The selection does not mean that the user has
-- choosen the option, the option is just highlighted.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_middle_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_move (x_pos, y_pos: INTEGER )
-- Wm_move message.
-- This message is sent after a window has been moved.
-- x_pos specifies the x-coordinate of the upper-left
-- corner of the client area of the window.
-- y_pos specifies the y-coordinate of the upper-left
-- corner of the client area of the window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_notify (control_id: INTEGER ; info: WEL_NMHDR )
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
info_not_void: info /= void

on_palette_changed (window: WEL_WINDOW )
-- Wm_palettechanged message.
-- This message is sent after the window with the
-- keyboard focus has realized its logical palette.
-- window identifies the window that caused the
-- system palette to change.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_palette_is_changing (window: WEL_WINDOW )
-- Wm_paletteischanging.
-- Inform that an application is going to realize its
-- logical palette. window identifies the window
-- that is going to realize its logical palette.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_query_new_palette
-- Wm_querrynewpalette message.
-- Inform an application that is about to receive the
-- keyboard focus, giving the application an opportunity
-- to realize its logical palette when it receives the
-- focus. If the window realizes its logical palette,
-- it must return True; otherwise it must return False.
-- (False by default)
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondblclk message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_down (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttondown message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_right_button_up (keys, x_pos, y_pos: INTEGER )
-- Wm_rbuttonup message
-- See class WEL_MK_CONSTANTS for keys value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_cursor (hit_code: INTEGER )
-- Wm_setcursor message.
-- See class WEL_HT_CONSTANTS for valid hit_code values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_set_focus
-- Wm_setfocus message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_show
-- Wm_showwindow message.
-- The window is being shown.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_size (size_type, a_width, a_height: INTEGER )
-- Wm_size message
-- See class WEL_SIZE_CONSTANTS for size_type value
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_char (character_code, key_data: INTEGER )
-- Wm_syschar message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_command (a_command, x_pos, y_pos: INTEGER )
-- Wm_syscommand message.
-- This message is sent when the user selects a command
-- from the system menu or when the user selects the
-- Maximize or Minimize button.
-- See class WEL_SC_CONSTANTS for a_command values.
-- x_pos and y_pos specify the x and y coordinates
-- of the cursor.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_sys_key_down (virtual_key, key_data: INTEGER )
-- Wm_syskeydown message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_sys_key_up (virtual_key, key_data: INTEGER )
-- Wm_syskeyup message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_timer (timer_id: INTEGER )
-- Wm_timer message.
-- A Wm_timer has been received from timer_id
-- See also set_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

on_vertical_scroll (scroll_code, position: INTEGER )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS for
-- scroll_code values. position is the new
-- scrollbox position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
-- Vertical scroll is received with a
-- scroll_code type. See class WEL_SB_CONSTANTS
-- for scroll_code values. position is the new
-- scrollbox position. bar indicates the scrollbar
-- or trackbar control activated.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
bar_not_void: bar /= void
bar_exists: bar. exists

on_window_pos_changed (window_pos: WEL_WINDOW_POS )
-- Wm_windowpschanged message.
-- This message is sent to a window whose size,
-- position, or place in the Z order has changed as a
-- result of a call to move or resize .
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

on_window_pos_changing (window_pos: WEL_WINDOW_POS )
-- Wm_windowposchanging
-- This message is sent to a window whose size,
-- position or place in the Z order is about to change
-- as a result of a call to move , resize .
-- window_pos can be changed to override the default
-- values.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
window_pos_not_void: window_pos /= void

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP8 Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
TUTORIAL_STEP8

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window.
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class TUTORIAL_STEP8

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Unicode

Unicode Sample

Requirements

This sample demonstates Unicode compatibilty. It therefore assumes a fully Unicode compatible operating system and recommends the system has more than one input locale installed. The system used to generate the above screenshot shows the sample running on Windows 2000 with the Korean IME installed. Since Windows 95/98/Me does not provide full built-in support for Unicode please refer to "Compiling WEL for Unicode on Windows 95/98/Me" before attempting to run this example.

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel50\examples\wel\unicode\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy images (*.bmp), icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will be displayed as illustrated above. Selecting the input locale combo box will allow you to switch to a new input locale. To add new input locales to your system do the following:

  • Click on Start -> Settings -> Control Panel -> Regional Options
  • Select the Input Locale tab and click Add.
  • Select the input locale then click OK
  • To test the new input locale restart the Unicode sample.
Selecting an input locale allows entry of the chosen input locale characters into the rich-edit control to right. Clicking the "Apply to Controls" button will update the controls in the pane below to display the same text as the rich-edit control. If the selected input locale is associated with an Input Method Editor (IME), the details for this will be displayed in the "Input Method Editor" group box and IME specific options will be made available from the "IME Options" menu.

Under the Hood

There is one MAIN_WINDOW class used for all the controls. The feature 'init_locale_list' is used to determine the systems available input locales and populate the corresponding "Input Locales" combo box. The features 'change_font' and 'change_control' are used to change the applications font (in case the curently selected font does not correctly display Unicode characters), and to set the 'text' property of all controls to the same as that in the rich-edit box.

This sample contains the following classes:

  • UNICODE_DEMO
  • MAIN_WINDOW
  • DISPLAY_TEXT
  • APPLICATION_IDS


Eiffel Class

Automatic generation produced by ISE Eiffel

Classes
    APPLICATION_IDS

    DISPLAY_TEXT

    MAIN_WINDOW

    UNICODE_DEMO

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


APPLICATION_IDS Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

class
    APPLICATION_IDS

feature -- Access

    Id_imeoptions_conversionmode_eudc_constant: INTEGER is 40007

    Idalphanumeric_constant: INTEGER is 40004

    Id_imeoptions_conversionmode_hanja_constant: INTEGER is 40009

    Idsoftkeyboard_constant: INTEGER is 40005

    Idshapehalf_constant: INTEGER is 40002

    Id_imeoptions_conversionmode_symbol_constant: INTEGER is 40008

    Idmainmenu_constant: INTEGER is 101

    Id_imeoptions_conversionmode_noconversion_constant: INTEGER is 40006

    Idnative_constant: INTEGER is 40003

    Idshapefull_constant: INTEGER is 40001

end -- class APPLICATION_IDS

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Eiffel Class

Automatic generation produced by ISE Eiffel

class
    APPLICATION_IDS

General
    cluster: root_cluster

Ancestors
    ANY

Queries
    Id_imeoptions_conversionmode_eudc_constant: INTEGER
    Id_imeoptions_conversionmode_hanja_constant: INTEGER
    Id_imeoptions_conversionmode_noconversion_constant: INTEGER
    Id_imeoptions_conversionmode_symbol_constant: INTEGER
    Idalphanumeric_constant: INTEGER
    Idmainmenu_constant: INTEGER
    Idnative_constant: INTEGER
    Idshapefull_constant: INTEGER
    Idshapehalf_constant: INTEGER
    Idsoftkeyboard_constant: INTEGER

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


DISPLAY_TEXT Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2002/04/09 23:40:01 $"
    revision: "$Revision: 1.1 $"

class
    DISPLAY_TEXT

inherit
    WEL_STATIC
        redefine
            background_color,
            foreground_color
        end

create
    make

feature

    background_color: WEL_COLOR_REF is
            -- Background color used for the background of the
            -- control
            -- Can be redefined by the user
        do
            create Result.make
        end

    foreground_color: WEL_COLOR_REF is
            -- Foreground color used for the background of the
            -- control
            -- Can be redefined by the user
        do
            create Result.make
        end

end -- class DISPLAY_TEXT

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Eiffel Class

Automatic generation produced by ISE Eiffel

class
    DISPLAY_TEXT

General
    cluster: root_cluster
    description: "Objects that ..."
    create: make

Ancestors
    WEL_STATIC

Queries
    absolute_x: INTEGER -- (from WEL_WINDOW)
    absolute_y: INTEGER -- (from WEL_WINDOW)
    background_brush: WEL_BRUSH -- (from WEL_WINDOW)
    background_color: WEL_COLOR_REF
    captured_window: WEL_WINDOW -- (from WEL_WINDOW)
    client_rect: WEL_RECT -- (from WEL_WINDOW)
    Color_3ddkshadow: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_3dface: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_3dhighlight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_3dhilight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_3dlight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_3dshadow: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_activeborder: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_activecaption: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_appworkspace: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_background: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_btnface: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_btnhighlight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_btnhilight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_btnshadow: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_btntext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_captiontext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_desktop: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_gradientactivecaption: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_gradientinactivecaption: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_graytext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_highlight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_highlighttext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_hotlight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_inactiveborder: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_inactivecaption: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_inactivecaptiontext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_infobk: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_infotext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_menu: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_menubar: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_menuhilight: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_menutext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_scrollbar: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_window: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_windowframe: INTEGER -- (from WEL_COLOR_CONSTANTS)
    Color_windowtext: INTEGER -- (from WEL_COLOR_CONSTANTS)
    command (message: INTEGER): WEL_COMMAND -- (from WEL_WINDOW)
    command_argument (message: INTEGER): ANY -- (from WEL_WINDOW)
    command_exists (message: INTEGER): BOOLEAN -- (from WEL_WINDOW)
    commands: WEL_COMMAND_MANAGER -- (from WEL_WINDOW)
    commands_enabled: BOOLEAN -- (from WEL_WINDOW)
    default_processing: BOOLEAN -- (from WEL_RETURN_VALUE)
    enabled: BOOLEAN -- (from WEL_WINDOW)
    ex_style: INTEGER -- (from WEL_WINDOW)
    exists: BOOLEAN -- (from WEL_ANY)
    focused_window: WEL_WINDOW -- (from WEL_WINDOW)
    font: WEL_FONT -- (from WEL_CONTROL)
    foreground_color: WEL_COLOR_REF
    has_capture: BOOLEAN -- (from WEL_WINDOW)
    has_focus: BOOLEAN -- (from WEL_WINDOW)
    has_heavy_capture: BOOLEAN -- (from WEL_WINDOW)
    has_horizontal_scroll_bar: BOOLEAN -- (from WEL_WINDOW)
    has_return_value: BOOLEAN -- (from WEL_RETURN_VALUE)
    has_system_font: BOOLEAN -- (from WEL_CONTROL)
    has_system_window_locked: BOOLEAN -- (from WEL_WINDOW)
    has_vertical_scroll_bar: BOOLEAN -- (from WEL_WINDOW)
    heavy_capture_activated: BOOLEAN -- (from WEL_WINDOW)
    height: INTEGER -- (from WEL_WINDOW)
    id: INTEGER -- (from WEL_CONTROL)
    is_inside: BOOLEAN -- (from WEL_WINDOW)
    is_window_unicode: BOOLEAN -- (from WEL_WINDOW)
    item: POINTER -- (from WEL_ANY)
    maximal_height: INTEGER -- (from WEL_WINDOW)
    maximal_width: INTEGER -- (from WEL_WINDOW)
    maximized: BOOLEAN -- (from WEL_WINDOW)
    message_return_value: INTEGER -- (from WEL_RETURN_VALUE)
    minimal_height: INTEGER -- (from WEL_WINDOW)
    minimal_width: INTEGER -- (from WEL_WINDOW)
    minimized: BOOLEAN -- (from WEL_WINDOW)
    parent: WEL_WINDOW -- (from WEL_WINDOW)
    placement: WEL_WINDOW_PLACEMENT -- (from WEL_WINDOW)
    shared: BOOLEAN -- (from WEL_ANY)
    shown: BOOLEAN -- (from WEL_WINDOW)
    style: INTEGER -- (from WEL_WINDOW)
    text: STRING -- (from WEL_WINDOW)
    text_length: INTEGER -- (from WEL_WINDOW)
    to_integer: INTEGER -- (from WEL_ANY)
    unicode_format: INTEGER -- (from WEL_CONTROL)
    unicode_structure_format: BOOLEAN -- (from WEL_CONTROL)
    valid_color_constant (c: INTEGER): BOOLEAN -- (from WEL_COLOR_CONSTANTS)
    valid_hwnd_constant (c: POINTER): BOOLEAN -- (from WEL_HWND_CONSTANTS)
    width: INTEGER -- (from WEL_WINDOW)
    window_captured: BOOLEAN -- (from WEL_WINDOW)
    window_rect: WEL_RECT -- (from WEL_WINDOW)
    x: INTEGER -- (from WEL_WINDOW)
    y: INTEGER -- (from WEL_WINDOW)

Commands
    bring_to_top -- (from WEL_WINDOW)
    clear -- (from WEL_STATIC)
    default_process_notification (notification_code: INTEGER) -- (from WEL_CONTROL)
    destroy -- (from WEL_WINDOW)
    disable -- (from WEL_WINDOW)
    disable_commands -- (from WEL_WINDOW)
    disable_default_processing -- (from WEL_WINDOW)
    disable_horizontal_scroll_bar -- (from WEL_WINDOW)
    disable_vertical_scroll_bar -- (from WEL_WINDOW)
    dispose -- (from WEL_ANY)
    enable -- (from WEL_WINDOW)
    enable_commands -- (from WEL_WINDOW)
    enable_default_processing -- (from WEL_WINDOW)
    enable_horizontal_scroll_bar -- (from WEL_WINDOW)
    enable_vertical_scroll_bar -- (from WEL_WINDOW)
    go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN) -- (from WEL_CONTROL)
    go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW; after: BOOLEAN) -- (from WEL_CONTROL)
    hide -- (from WEL_WINDOW)
    hide_horizontal_scroll_bar -- (from WEL_WINDOW)
    hide_scroll_bars -- (from WEL_WINDOW)
    hide_vertical_scroll_bar -- (from WEL_WINDOW)
    insert_after (a_window: WEL_WINDOW) -- (from WEL_WINDOW)
    invalidate -- (from WEL_WINDOW)
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN) -- (from WEL_WINDOW)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN) -- (from WEL_WINDOW)
    invalidate_without_background -- (from WEL_WINDOW)
    kill_timer (timer_id: INTEGER) -- (from WEL_WINDOW)
    lock_window_update -- (from WEL_WINDOW)
    maximize -- (from WEL_WINDOW)
    minimize -- (from WEL_WINDOW)
    move (a_x, a_y: INTEGER) -- (from WEL_WINDOW)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN) -- (from WEL_WINDOW)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY) -- (from WEL_WINDOW)
    register_current_window -- (from WEL_WINDOW)
    release_capture -- (from WEL_WINDOW)
    release_heavy_capture -- (from WEL_WINDOW)
    remove_command (message: INTEGER) -- (from WEL_WINDOW)
    resize (a_width, a_height: INTEGER) -- (from WEL_WINDOW)
    restore -- (from WEL_WINDOW)
    scroll (a_x, a_y: INTEGER) -- (from WEL_WINDOW)
    set_capture -- (from WEL_WINDOW)
    set_class_icon (new_icon: WEL_ICON) -- (from WEL_WINDOW)
    set_class_small_icon (new_icon: WEL_ICON) -- (from WEL_WINDOW)
    set_default_processing (value: BOOLEAN) -- (from WEL_RETURN_VALUE)
    set_ex_style (an_ex_style: INTEGER) -- (from WEL_WINDOW)
    set_focus -- (from WEL_WINDOW)
    set_font (a_font: WEL_FONT) -- (from WEL_CONTROL)
    set_heavy_capture -- (from WEL_WINDOW)
    set_height (a_height: INTEGER) -- (from WEL_WINDOW)
    set_item (an_item: POINTER) -- (from WEL_ANY)
    set_message_return_value (value: INTEGER) -- (from WEL_RETURN_VALUE)
    set_parent (a_parent: WEL_WINDOW) -- (from WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT) -- (from WEL_WINDOW)
    set_shared -- (from WEL_ANY)
    set_style (a_style: INTEGER) -- (from WEL_WINDOW)
    set_text (a_text: STRING) -- (from WEL_WINDOW)
    set_timer (timer_id, time_out: INTEGER) -- (from WEL_WINDOW)
    set_unicode_format -- (from WEL_CONTROL)
    set_unshared -- (from WEL_ANY)
    set_width (a_width: INTEGER) -- (from WEL_WINDOW)
    set_x (a_x: INTEGER) -- (from WEL_WINDOW)
    set_y (a_y: INTEGER) -- (from WEL_WINDOW)
    set_z_order (z_order: POINTER) -- (from WEL_WINDOW)
    show -- (from WEL_WINDOW)
    show_horizontal_scroll_bar -- (from WEL_WINDOW)
    show_scroll_bars -- (from WEL_WINDOW)
    show_vertical_scroll_bar -- (from WEL_WINDOW)
    show_with_option (cmd_show: INTEGER) -- (from WEL_WINDOW)
    unlock_window_update -- (from WEL_WINDOW)
    update -- (from WEL_WINDOW)
    update_cached_style (new_ex_style, old_ex_style: INTEGER) -- (from WEL_WINDOW)
    validate -- (from WEL_WINDOW)
    validate_rect (rect: WEL_RECT) -- (from WEL_WINDOW)
    validate_region (region: WEL_REGION) -- (from WEL_WINDOW)
    win_help (help_file: STRING; a_command, data: INTEGER) -- (from WEL_WINDOW)

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


MAIN_WINDOW Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

class
    MAIN_WINDOW

inherit
    WEL_FRAME_WINDOW
        redefine
            class_background,
            on_menu_command,
            notify
        end

    APPLICATION_IDS
        export
            {NONE} all
        end

    WEL_WINDOWS_ROUTINES
        export
            {NONE} all
        end

    WEL_RICH_EDIT_STYLE_CONSTANTS
        export
            {NONE} all
        end

    WEL_INPUT_METHOD_EDITOR_CONSTANTS
        export
            {NONE} all
        end

create
    make

feature {NONE} -- Initialization

    make is
        do
            make_top (title)
            resize (800, 680)
            set_menu (main_menu)
            create input_locale_text.make (Current, "Input locale", 35, 45, 200, 20, - 1)
            create change_font_text.make (Current, "Font Type", 270, 45, 200, 20, - 1)
            create ime_name_text.make (Current, "Name", 50, 130, 200, 20, - 1)
            create ime_description_text.make (Current, "Description", 50, 170, 200, 20, - 1)
            create ime_property_text.make (Current, "Property", 50, 210, 200, 20, - 1)
            create ime_conversion_text.make (Current, "Conversion Mode", 250, 130, 200, 20, - 1)
            create ime_title_text_info.make (Current, "", 55, 145, 200, 20, - 1)
            create ime_name_text_info.make (Current, "", 55, 145, 200, 20, - 1)
            create ime_description_text_info.make (Current, "", 55, 185, 200, 20, - 1)
            create ime_property_text_info.make (Current, "", 55, 225, 200, 75, - 1)
            create ime_conversion_text_info.make (Current, "", 255, 145, 160, 80, - 1)
            create ime_group_box.make (Current, "Input Method Editor (IME)", 15, 15, 700, 320, - 1)
            create ime_display_group_box.make (Current, "Input Method Editor", 35, 105, 385, 200, - 1)
            create avail_input_locales_combo.make (Current, 35, 65, 200, 250, - 1)
            create font_list.make (Current, 270, 65, 150, 170, - 1)
            create lang_edit.make (Current, "", 450, 65, 220, 200, - 1)
            create configure_ime_button.make (Current, "Configure IME..", 250, 230, 100, 30, - 1)
            create control_button.make (Current, "Apply to all controls", 450, 275, 150, 30, - 1)
            create group_box.make (Current, "Controls", 15, 365, 700, 220, - 1)
            create button.make (Current, "Button", 35, 400, 75, 30, - 1)
            create check_box.make (Current, "Check box", 35, 450, 100, 15, - 1)
            create radio_button.make (Current, "Radio Button", 35, 490, 120, 15, - 1)
            create drop_down_combo_box.make (Current, 35, 530, 150, 50, - 1)
            create single_selection_list_box.make (Current, 225, 400, 180, 80, - 1)
            create multi_selection_list_box.make (Current, 225, 500, 180, 80, - 1)
            create tree_view.make (Current, 435, 400, 150, 155, - 1)
            create imm.make
            init_display
        end

feature -- Access
--IMM

    imm: WEL_INPUT_METHOD_MANAGER

    input_locale: POINTER

    input_locales: ARRAY [POINTER]
            --Font

    log_font: WEL_LOG_FONT

    wel_font: WEL_FONT
            --IME Controls

    lang_edit: WEL_RICH_EDIT

    font_list: WEL_DROP_DOWN_LIST_COMBO_BOX

    avail_input_locales_combo: WEL_DROP_DOWN_LIST_COMBO_BOX

    configure_ime_button: WEL_PUSH_BUTTON

    ime_group_box: WEL_GROUP_BOX

    ime_display_group_box: WEL_GROUP_BOX
            --Wel controls

    button: WEL_PUSH_BUTTON

    control_button: WEL_PUSH_BUTTON

    check_box: WEL_CHECK_BOX

    group_box: WEL_GROUP_BOX

    radio_button: WEL_RADIO_BUTTON

    drop_down_combo_box: WEL_DROP_DOWN_LIST_COMBO_BOX

    single_selection_list_box: WEL_SINGLE_SELECTION_LIST_BOX

    multi_selection_list_box: WEL_MULTIPLE_SELECTION_LIST_BOX

    tree_view: WEL_TREE_VIEW
            --Labels

    input_locale_text: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    change_font_text: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_title_text_info: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_name_text: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_name_text_info: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_description_text: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_description_text_info: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_property_text, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_property_text: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text_info, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_property_text_info: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_conversion_text, ime_conversion_text_info and change_char_format_text.

    ime_conversion_text: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text_info and change_char_format_text.

    ime_conversion_text_info: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text and change_char_format_text.

    change_char_format_text: DISPLAY_TEXT
            -- Was declared in MAIN_WINDOW as synonym of input_locale_text, change_font_text, ime_title_text_info, ime_name_text, ime_name_text_info, ime_description_text, ime_description_text_info, ime_property_text, ime_property_text_info, ime_conversion_text and ime_conversion_text_info.

    main_menu: WEL_MENU is
            -- Windows main menu created from resource
        once
            create Result.make_by_id (idmainmenu_constant)
        end

feature {NONE} -- Implementation

    on_menu_command (menu_id: INTEGER) is
            -- Perform menu command actions
        local
            conv_mode, wel_const: INTEGER
        do
            imm.get_input_context (lang_edit.item)
            imm.input_method_editor.get_conversion_status
            conv_mode := imm.input_method_editor.conversion_mode
            inspect menu_id
            when idsoftkeyboard_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_softkbd;
                if (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_and (wel_const.bit_not))
                else
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_or (wel_const))
                end
            when idshapefull_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_fullshape;
                if not (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_or (wel_const))
                end
            when idshapehalf_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_fullshape;
                if (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_and (wel_const.bit_not))
                end
            when idnative_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_native;
                if not (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_or (wel_const))
                end
            when idalphanumeric_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_native;
                if (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_and (wel_const.bit_not))
                end
            when id_imeoptions_conversionmode_eudc_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_eudc;
                if (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_and (wel_const.bit_not))
                end
            when id_imeoptions_conversionmode_symbol_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_symbol;
                if (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_and (wel_const.bit_not))
                end
            when id_imeoptions_conversionmode_hanja_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_hanjaconvert;
                if (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_and (wel_const.bit_not))
                end
            when id_imeoptions_conversionmode_noconversion_constant then
                wel_const := feature {WEL_IME_CONSTANTS}.ime_cmode_noconversion;
                if (conv_mode.bit_and (wel_const) = wel_const) then
                    imm.input_method_editor.set_conversion_status (conv_mode.bit_and (wel_const.bit_not))
                end
            end
            imm.release_input_context (lang_edit.item)
            refresh
        end

    notify (control: WEL_CONTROL; notify_code: INTEGER) is
        local
            tmp_str: STRING
            cnt: INTEGER
        do
            if control = font_list then
                create log_font.make (14, font_list.selected_string)
                change_font (log_font)
            elseif control = avail_input_locales_combo then
                from
                    cnt := 0
                until
                    cnt = input_locales.count
                loop
                    if avail_input_locales_combo.selected_item = cnt then
                        input_locale := input_locales.item (cnt + 1)
                        cnt := input_locales.count
                    else
                        cnt := cnt + 1
                    end
                end;
                refresh
            elseif control = control_button then
                if lang_edit.text.is_equal ("") then
                    create tmp_str.make_from_string ("")
                else
                    lang_edit.select_all;
                    tmp_str := lang_edit.selected_text
                end;
                change_controls (tmp_str)
            elseif control = configure_ime_button then
                imm.ime_dialog_configure (item)
            end
        end

    class_background: WEL_BRUSH is
            -- Standard window background color used to create the
            -- window class.
            -- Can be redefined to return a user-defined brush.
        require
            background_brush_not_set: background_brush = void
        once
            create Result.make_by_sys_color (color_btnface + 1)
        ensure
            result_not_void: Result /= void
        end

    title: STRING is
            -- Window's title
        do
            create Result.make_from_string ("Unicode Example")
        end

    init_display is
            -- Initialise display
        do
            init_fonts_list
            create log_font.make (14, font_list.selected_string)
            change_font (log_font)
            init_controls
        end

    init_menu is
            -- Initialize the main menu
        do
            if imm.has_ime (imm.input_locale) then
                main_menu.enable_item (id_imeoptions_conversionmode_eudc_constant)
                main_menu.enable_item (idalphanumeric_constant)
                main_menu.enable_item (id_imeoptions_conversionmode_hanja_constant)
                main_menu.enable_item (idsoftkeyboard_constant)
                main_menu.enable_item (idshapehalf_constant)
                main_menu.enable_item (id_imeoptions_conversionmode_symbol_constant)
                main_menu.enable_item (id_imeoptions_conversionmode_noconversion_constant)
                main_menu.enable_item (idnative_constant)
                main_menu.enable_item (idshapefull_constant)
            else
                main_menu.disable_item (id_imeoptions_conversionmode_eudc_constant)
                main_menu.disable_item (idalphanumeric_constant)
                main_menu.disable_item (id_imeoptions_conversionmode_hanja_constant)
                main_menu.disable_item (idsoftkeyboard_constant)
                main_menu.disable_item (idshapehalf_constant)
                main_menu.disable_item (id_imeoptions_conversionmode_symbol_constant)
                main_menu.disable_item (id_imeoptions_conversionmode_noconversion_constant)
                main_menu.disable_item (idnative_constant)
                main_menu.disable_item (idshapefull_constant)
            end
        end

    init_controls is
            -- Initialize controls
        do
            init_menu
            init_locale_list
            init_tree_view
            lang_edit.set_text ("Rich Edit control")
            lang_edit.hide_vertical_scroll_bar
            lang_edit.hide_horizontal_scroll_bar
            drop_down_combo_box.insert_string_at ("Drop down combo", 0)
            drop_down_combo_box.select_item (0)
            single_selection_list_box.insert_string_at ("Single Selection List Box", 0)
            multi_selection_list_box.insert_string_at ("Multiple Selection List Box", 0)
            multi_selection_list_box.insert_string_at ("Multiple Selection List Box", 1)
        end

    init_locale_list is
            -- Add the available input locales to the list
        local
            cnt, langid: INTEGER
            lang_string: STRING
        do
            input_locales := imm.input_locales
            from
                cnt := 1
            until
                cnt = input_locales.count + 1
            loop
                langid := imm.get_language_identifier (input_locales.item (cnt))
                lang_string := identifiers.item (langid)
                if lang_string = void then
                    avail_input_locales_combo.add_string ("Unknown Language")
                else
                    avail_input_locales_combo.add_string (lang_string)
                end
                cnt := cnt + 1
            end
            avail_input_locales_combo.select_item (0)
        end

    init_fonts_list is
            -- Add some font types to the list box
        do
            font_list.add_string ("MS Shell Dlg")
            font_list.add_string ("Arial")
            font_list.add_string ("Georgia")
            font_list.add_string ("Narkisim")
            font_list.add_string ("MS UI Gothic")
            font_list.add_string ("Gulim")
            font_list.add_string ("Bauhaus 93")
            font_list.select_item (0)
        end

    init_tree_view is
            -- Initialise tree view control
        local
            handle, root_h: POINTER
            tree_view_insert_struct1, tree_view_insert_struct2, tree_view_insert_struct3: WEL_TREE_VIEW_INSERT_STRUCT
            tree_view_item1, tree_view_item2, tree_view_item3: WEL_TREE_VIEW_ITEM
        do
            create tree_view_insert_struct1.make
            tree_view_insert_struct1.set_root
            create tree_view_item1.make
            tree_view_item1.set_text ("Tree View Control")
            tree_view_insert_struct1.set_tree_view_item (tree_view_item1)
            tree_view.insert_item (tree_view_insert_struct1)
            root_h := tree_view.last_item
            create tree_view_insert_struct2.make
            tree_view_insert_struct2.set_last
            tree_view_insert_struct2.set_parent (root_h)
            create tree_view_item2.make
            tree_view_item2.set_text ("Subtree 1")
            tree_view_insert_struct2.set_tree_view_item (tree_view_item2)
            tree_view.insert_item (tree_view_insert_struct2)
            handle := tree_view.last_item
            create tree_view_insert_struct3.make
            tree_view_insert_struct3.set_last
            tree_view_insert_struct3.set_parent (handle)
            create tree_view_item3.make
            tree_view_item3.set_text ("Item 1")
            tree_view_insert_struct3.set_tree_view_item (tree_view_item3)
            tree_view.insert_item (tree_view_insert_struct3)
            create tree_view_insert_struct3.make
            tree_view_insert_struct3.set_last
            tree_view_insert_struct3.set_parent (handle)
            create tree_view_item3.make
            tree_view_item3.set_text ("Item 2")
            tree_view_insert_struct3.set_tree_view_item (tree_view_item3)
            tree_view.insert_item (tree_view_insert_struct3)
            tree_view.select_item (tree_view_item1)
        end

    change_controls (str: STRING) is
            -- Change the controls text to that of rich edit
        local
            tvitem: WEL_TREE_VIEW_ITEM
        do
            button.set_text (str)
            check_box.set_text (str)
            radio_button.set_text (str)
            drop_down_combo_box.select_item (0)
            drop_down_combo_box.delete_string (0)
            drop_down_combo_box.insert_string_at (str, 0)
            drop_down_combo_box.select_item (0)
            single_selection_list_box.delete_string (0)
            single_selection_list_box.insert_string_at (str, 0)
            multi_selection_list_box.delete_string (0)
            multi_selection_list_box.insert_string_at (str, 0)
            multi_selection_list_box.delete_string (1)
            multi_selection_list_box.insert_string_at (str, 1)
            tvitem := tree_view.selected_item
            tvitem.set_text (str)
            tree_view.set_tree_item (tvitem)
        end

    change_font (new_font: WEL_LOG_FONT) is
            -- Change the font used by the application controls to 'new_font'
        local
            char_format: WEL_CHARACTER_FORMAT
        do
            create char_format.make
            char_format.set_face_name (font_list.selected_string)
            create wel_font.make_indirect (new_font)
            wel_font.set_indirect (new_font)
            if lang_edit.text_length = 0 then
            else
                lang_edit.select_all
                lang_edit.set_character_format_selection (char_format)
            end
            setup_ime_display
        end

    setup_ime_display is
            -- Initialise the display for the IME display information
        local
            has_ime: BOOLEAN
        do
            has_ime := imm.has_ime (imm.input_locale)
            wel_font.set_indirect (log_font)
            if not (has_ime) then
                ime_name_text.hide
                ime_description_text.hide
                ime_property_text.hide
                ime_conversion_text.hide
                ime_name_text_info.hide
                ime_description_text_info.hide
                ime_property_text_info.hide
                ime_conversion_text_info.hide
                configure_ime_button.hide
                ime_title_text_info.show
                ime_title_text_info.set_font (wel_font)
                ime_title_text_info.set_text ("- " + "No IME loaded")
            else
                ime_title_text_info.hide
                ime_name_text.show
                ime_name_text_info.show
                ime_description_text.show
                ime_description_text_info.show
                ime_property_text.show
                ime_property_text_info.show
                ime_conversion_text.show
                ime_conversion_text_info.show
                configure_ime_button.show
                ime_title_text_info.set_font (wel_font)
                ime_name_text.set_font (wel_font)
                ime_name_text_info.set_font (wel_font)
                ime_description_text.set_font (wel_font)
                ime_description_text_info.set_font (wel_font)
                ime_property_text.set_font (wel_font)
                ime_property_text_info.set_font (wel_font)
                ime_conversion_text.set_font (wel_font)
                ime_conversion_text_info.set_font (wel_font)
                configure_ime_button.set_font (wel_font)
                ime_title_text_info.clear
                ime_name_text_info.set_text ("- " + imm.ime_filename)
                ime_description_text_info.set_text ("- " + imm.ime_description)
                ime_property_text_info.set_text (ime_properties)
                ime_conversion_text_info.set_text (ime_conversion_status)
            end
            button.set_font (wel_font)
            check_box.set_font (wel_font)
            radio_button.set_font (wel_font)
            drop_down_combo_box.set_font (wel_font)
            single_selection_list_box.set_font (wel_font)
            multi_selection_list_box.set_font (wel_font)
            tree_view.set_font (wel_font)
        end

    ime_properties: STRING is
            -- Parse the properties of the current IME into string format
        local
            tmp_prop: INTEGER
            tmp_string: STRING
        do
            create tmp_string.make (0)
            tmp_prop := imm.ime_property (feature {WEL_IME_CONSTANTS}.igp_property)
            if (tmp_prop.bit_and (feature {WEL_IME_CONSTANTS}.ime_prop_unicode) = feature {WEL_IME_CONSTANTS}.ime_prop_unicode) then
                tmp_string.append ("- Unicode IME%N")
            else
                tmp_string.append ("- ANSI IME%N")
            end
            tmp_prop := imm.ime_property (feature {WEL_IME_CONSTANTS}.igp_getimeversion)
            if (tmp_prop.bit_and (feature {WEL_IME_CONSTANTS}.imever_0310) = feature {WEL_IME_CONSTANTS}.imever_0310) then
                tmp_string.append ("- Windows 3.1 IME%N")
            else
                tmp_string.append ("- Windows 9x/Me IME%N")
            end
            tmp_prop := imm.ime_property (feature {WEL_IME_CONSTANTS}.igp_setcompstr)
            if (tmp_prop.bit_and (feature {WEL_IME_CONSTANTS}.scs_cap_compstr) = feature {WEL_IME_CONSTANTS}.scs_cap_compstr) then
                tmp_string.append ("- Can set composition string%N")
            else
                tmp_string.append ("- Cannot set composition string%N")
            end
            tmp_prop := imm.ime_property (feature {WEL_IME_CONSTANTS}.scs_cap_makeread)
            if (tmp_prop.bit_and (feature {WEL_IME_CONSTANTS}.scs_cap_makeread) = feature {WEL_IME_CONSTANTS}.scs_cap_makeread) then
                tmp_string.append ("- Can create reading string%N")
            else
                tmp_string.append ("- Cannot create reading string%N")
            end
            tmp_prop := imm.ime_property (feature {WEL_IME_CONSTANTS}.scs_cap_setreconvertstring)
            if (tmp_prop.bit_and (feature {WEL_IME_CONSTANTS}.scs_cap_setreconvertstring) = feature {WEL_IME_CONSTANTS}.scs_cap_setreconvertstring) then
                tmp_string.append ("- Supports reconversion%N")
            else
                tmp_string.append ("- Does not support reconversion%N")
            end
            create Result.make_from_string (tmp_string)
        end

    ime_conversion_status: STRING is
            -- Parse the properties of the current IME conversion mode into string format
        local
            tmp_string: STRING
            conv_mode, sent_mode: INTEGER
        do
            create tmp_string.make (0)
            imm.get_input_context (lang_edit.item)
            imm.input_method_editor.get_conversion_status
            conv_mode := imm.input_method_editor.conversion_mode
            sent_mode := imm.input_method_editor.sentence_mode
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_eudc) = feature {WEL_IME_CONSTANTS}.ime_cmode_eudc) then
                tmp_string.append ("- EUDC Conversion%N")
                main_menu.check_item (id_imeoptions_conversionmode_eudc_constant)
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_fixed) = feature {WEL_IME_CONSTANTS}.ime_cmode_fixed) then
                tmp_string.append ("- Fixed Conversion%N")
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_fullshape) = feature {WEL_IME_CONSTANTS}.ime_cmode_fullshape) then
                tmp_string.append ("- Full shape mode%N")
                main_menu.check_item (idshapefull_constant)
                main_menu.uncheck_item (idshapehalf_constant)
            else
                tmp_string.append ("- Half shape mode%N")
                main_menu.check_item (idshapehalf_constant)
                main_menu.uncheck_item (idshapefull_constant)
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_hanjaconvert) = feature {WEL_IME_CONSTANTS}.ime_cmode_hanjaconvert) then
                tmp_string.append ("- Hanja convert%N")
                main_menu.check_item (id_imeoptions_conversionmode_hanja_constant)
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_katakana) = feature {WEL_IME_CONSTANTS}.ime_cmode_katakana) then
                tmp_string.append ("- Katakana%N")
            else
                tmp_string.append ("- Hiragana%N")
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_native) = feature {WEL_IME_CONSTANTS}.ime_cmode_native) then
                tmp_string.append ("- Native mode%N")
                main_menu.check_item (idnative_constant)
                main_menu.uncheck_item (idalphanumeric_constant)
            else
                tmp_string.append ("- Alphanumeric Mode%N")
                main_menu.check_item (idalphanumeric_constant)
                main_menu.uncheck_item (idnative_constant)
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_noconversion) = feature {WEL_IME_CONSTANTS}.ime_cmode_noconversion) then
                tmp_string.append ("- No conversion%N")
                main_menu.check_item (id_imeoptions_conversionmode_noconversion_constant)
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_roman) = feature {WEL_IME_CONSTANTS}.ime_cmode_roman) then
                tmp_string.append ("- Roman%N")
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_softkbd) = feature {WEL_IME_CONSTANTS}.ime_cmode_softkbd) then
                tmp_string.append ("- Soft Keyboard%N")
                main_menu.check_item (idsoftkeyboard_constant)
            else
                main_menu.uncheck_item (idsoftkeyboard_constant)
            end
            if (conv_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_cmode_symbol) = feature {WEL_IME_CONSTANTS}.ime_cmode_symbol) then
                tmp_string.append ("- Symbol conversion%N")
                main_menu.check_item (id_imeoptions_conversionmode_symbol_constant)
            end
            if (sent_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_smode_automatic) = feature {WEL_IME_CONSTANTS}.ime_smode_automatic) then
                tmp_string.append ("- Automatic conversion%N")
            end
            if (sent_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_smode_none) = feature {WEL_IME_CONSTANTS}.ime_smode_none) then
                tmp_string.append ("- Using phrase information%N")
            end
            if (sent_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_smode_pluralclause) = feature {WEL_IME_CONSTANTS}.ime_smode_pluralclause) then
                tmp_string.append ("- Using plural clause information%N")
            end
            if (sent_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_smode_singleconvert) = feature {WEL_IME_CONSTANTS}.ime_smode_singleconvert) then
                tmp_string.append ("- Single-character conversion%N")
            end
            if (sent_mode.bit_and (feature {WEL_IME_CONSTANTS}.ime_smode_conversation) = feature {WEL_IME_CONSTANTS}.ime_smode_conversation) then
                tmp_string.append ("- Conversation mode%N")
            end
            imm.release_input_context (lang_edit.item)
            create Result.make_from_string (tmp_string)
        end

    refresh is
            -- Refresh display
        do
            imm.switch_input_locale (input_locale)
            setup_ime_display
            init_menu
        end

end -- class MAIN_WINDOW

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Eiffel Class

Automatic generation produced by ISE Eiffel

class
    MAIN_WINDOW

General
    cluster: root_cluster
    create: make

Ancestors
    APPLICATION_IDS
    WEL_FRAME_WINDOW
    WEL_INPUT_METHOD_EDITOR_CONSTANTS
    WEL_RICH_EDIT_STYLE_CONSTANTS
    WEL_WINDOWS_ROUTINES

Queries
    absolute_x: INTEGER -- (from WEL_WINDOW)
    absolute_y: INTEGER -- (from WEL_WINDOW)
    avail_input_locales_combo: WEL_DROP_DOWN_LIST_COMBO_BOX
    background_brush: WEL_BRUSH -- (from WEL_WINDOW)
    button: WEL_PUSH_BUTTON
    captured_window: WEL_WINDOW -- (from WEL_WINDOW)
    change_char_format_text: DISPLAY_TEXT
    change_font_text: DISPLAY_TEXT
    check_box: WEL_CHECK_BOX
    children: LIST [WEL_WINDOW] -- (from WEL_COMPOSITE_WINDOW)
    Class_cursor: WEL_CURSOR -- (from WEL_FRAME_WINDOW)
    Class_icon: WEL_ICON -- (from WEL_FRAME_WINDOW)
    Class_menu_name: STRING -- (from WEL_FRAME_WINDOW)
    Class_name: STRING -- (from WEL_FRAME_WINDOW)
    Class_style: INTEGER -- (from WEL_FRAME_WINDOW)
    Class_window_procedure: POINTER -- (from WEL_FRAME_WINDOW)
    client_rect: WEL_RECT -- (from WEL_WINDOW)
    closeable: BOOLEAN -- (from WEL_COMPOSITE_WINDOW)
    command (message: INTEGER): WEL_COMMAND -- (from WEL_WINDOW)
    command_argument (message: INTEGER): ANY -- (from WEL_WINDOW)
    command_exists (message: INTEGER): BOOLEAN -- (from WEL_WINDOW)
    commands: WEL_COMMAND_MANAGER -- (from WEL_WINDOW)
    commands_enabled: BOOLEAN -- (from WEL_WINDOW)
    configure_ime_button: WEL_PUSH_BUTTON
    control_button: WEL_PUSH_BUTTON
    Default_height: INTEGER -- (from WEL_FRAME_WINDOW)
    Default_id: INTEGER -- (from WEL_FRAME_WINDOW)
    default_processing: BOOLEAN -- (from WEL_RETURN_VALUE)
    Default_style: INTEGER -- (from WEL_FRAME_WINDOW)
    Default_width: INTEGER -- (from WEL_FRAME_WINDOW)
    Default_x: INTEGER -- (from WEL_FRAME_WINDOW)
    Default_y: INTEGER -- (from WEL_FRAME_WINDOW)
    drop_down_combo_box: WEL_DROP_DOWN_LIST_COMBO_BOX
    enabled: BOOLEAN -- (from WEL_WINDOW)
    ex_style: INTEGER -- (from WEL_WINDOW)
    exists: BOOLEAN -- (from WEL_ANY)
    focused_window: WEL_WINDOW -- (from WEL_WINDOW)
    font_list: WEL_DROP_DOWN_LIST_COMBO_BOX
    group_box: WEL_GROUP_BOX
    has_capture: BOOLEAN -- (from WEL_WINDOW)
    has_focus: BOOLEAN -- (from WEL_WINDOW)
    has_heavy_capture: BOOLEAN -- (from WEL_WINDOW)
    has_horizontal_scroll_bar: BOOLEAN -- (from WEL_WINDOW)
    has_menu: BOOLEAN -- (from WEL_COMPOSITE_WINDOW)
    has_return_value: BOOLEAN -- (from WEL_RETURN_VALUE)
    has_system_menu: BOOLEAN -- (from WEL_COMPOSITE_WINDOW)
    has_system_window_locked: BOOLEAN -- (from WEL_WINDOW)
    has_vertical_scroll_bar: BOOLEAN -- (from WEL_WINDOW)
    heavy_capture_activated: BOOLEAN -- (from WEL_WINDOW)
    height: INTEGER -- (from WEL_WINDOW)
    horizontal_position: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    ime_conversion_text: DISPLAY_TEXT
    ime_conversion_text_info: DISPLAY_TEXT
    ime_description_text: DISPLAY_TEXT
    ime_description_text_info: DISPLAY_TEXT
    ime_display_group_box: WEL_GROUP_BOX
    ime_group_box: WEL_GROUP_BOX
    ime_name_text: DISPLAY_TEXT
    ime_name_text_info: DISPLAY_TEXT
    ime_property_text: DISPLAY_TEXT
    ime_property_text_info: DISPLAY_TEXT
    ime_title_text_info: DISPLAY_TEXT
    imm: WEL_INPUT_METHOD_MANAGER
    input_locale: POINTER
    input_locale_text: DISPLAY_TEXT
    input_locales: ARRAY [POINTER]
    is_inside: BOOLEAN -- (from WEL_WINDOW)
    is_window_unicode: BOOLEAN -- (from WEL_WINDOW)
    item: POINTER -- (from WEL_ANY)
    lang_edit: WEL_RICH_EDIT
    log_font: WEL_LOG_FONT
    Main_menu: WEL_MENU
    maximal_height: INTEGER -- (from WEL_WINDOW)
    maximal_horizontal_position: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    maximal_vertical_position: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    maximal_width: INTEGER -- (from WEL_WINDOW)
    maximized: BOOLEAN -- (from WEL_WINDOW)
    menu: WEL_MENU -- (from WEL_COMPOSITE_WINDOW)
    message_return_value: INTEGER -- (from WEL_RETURN_VALUE)
    minimal_height: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    minimal_horizontal_position: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    minimal_vertical_position: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    minimal_width: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    minimized: BOOLEAN -- (from WEL_WINDOW)
    multi_selection_list_box: WEL_MULTIPLE_SELECTION_LIST_BOX
    parent: WEL_WINDOW -- (from WEL_WINDOW)
    placement: WEL_WINDOW_PLACEMENT -- (from WEL_WINDOW)
    radio_button: WEL_RADIO_BUTTON
    scroller: WEL_SCROLLER -- (from WEL_COMPOSITE_WINDOW)
    shared: BOOLEAN -- (from WEL_ANY)
    shown: BOOLEAN -- (from WEL_WINDOW)
    single_selection_list_box: WEL_SINGLE_SELECTION_LIST_BOX
    style: INTEGER -- (from WEL_WINDOW)
    system_menu: WEL_MENU -- (from WEL_COMPOSITE_WINDOW)
    text: STRING -- (from WEL_WINDOW)
    text_length: INTEGER -- (from WEL_WINDOW)
    to_integer: INTEGER -- (from WEL_ANY)
    tree_view: WEL_TREE_VIEW
    valid_hwnd_constant (c: POINTER): BOOLEAN -- (from WEL_HWND_CONSTANTS)
    vertical_position: INTEGER -- (from WEL_COMPOSITE_WINDOW)
    wel_font: WEL_FONT
    width: INTEGER -- (from WEL_WINDOW)
    window_captured: BOOLEAN -- (from WEL_WINDOW)
    window_rect: WEL_RECT -- (from WEL_WINDOW)
    x: INTEGER -- (from WEL_WINDOW)
    y: INTEGER -- (from WEL_WINDOW)

Commands
    bring_to_top -- (from WEL_WINDOW)
    destroy -- (from WEL_COMPOSITE_WINDOW)
    disable -- (from WEL_WINDOW)
    disable_commands -- (from WEL_WINDOW)
    disable_default_processing -- (from WEL_WINDOW)
    disable_horizontal_scroll_bar -- (from WEL_WINDOW)
    disable_vertical_scroll_bar -- (from WEL_WINDOW)
    dispose -- (from WEL_ANY)
    draw_menu -- (from WEL_COMPOSITE_WINDOW)
    enable -- (from WEL_WINDOW)
    enable_commands -- (from WEL_WINDOW)
    enable_default_processing -- (from WEL_WINDOW)
    enable_horizontal_scroll_bar -- (from WEL_WINDOW)
    enable_vertical_scroll_bar -- (from WEL_WINDOW)
    hide -- (from WEL_WINDOW)
    hide_horizontal_scroll_bar -- (from WEL_WINDOW)
    hide_scroll_bars -- (from WEL_WINDOW)
    hide_vertical_scroll_bar -- (from WEL_WINDOW)
    horizontal_update (inc, position: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    insert_after (a_window: WEL_WINDOW) -- (from WEL_WINDOW)
    invalidate -- (from WEL_WINDOW)
    invalidate_rect (rect: WEL_RECT; erase_background: BOOLEAN) -- (from WEL_WINDOW)
    invalidate_region (region: WEL_REGION; erase_background: BOOLEAN) -- (from WEL_WINDOW)
    invalidate_without_background -- (from WEL_WINDOW)
    kill_timer (timer_id: INTEGER) -- (from WEL_WINDOW)
    lock_window_update -- (from WEL_WINDOW)
    maximize -- (from WEL_WINDOW)
    minimize -- (from WEL_WINDOW)
    move (a_x, a_y: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    move_absolute (a_x, a_y: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    move_and_resize (a_x, a_y, a_width, a_height: INTEGER; repaint: BOOLEAN) -- (from WEL_COMPOSITE_WINDOW)
    put_command (a_command: WEL_COMMAND; message: INTEGER; argument: ANY) -- (from WEL_WINDOW)
    register_current_window -- (from WEL_WINDOW)
    release_capture -- (from WEL_WINDOW)
    release_heavy_capture -- (from WEL_WINDOW)
    remove_command (message: INTEGER) -- (from WEL_WINDOW)
    resize (a_width, a_height: INTEGER) -- (from WEL_WINDOW)
    restore -- (from WEL_WINDOW)
    scroll (a_x, a_y: INTEGER) -- (from WEL_WINDOW)
    set_capture -- (from WEL_WINDOW)
    set_class_icon (new_icon: WEL_ICON) -- (from WEL_WINDOW)
    set_class_small_icon (new_icon: WEL_ICON) -- (from WEL_WINDOW)
    set_default_processing (value: BOOLEAN) -- (from WEL_RETURN_VALUE)
    set_ex_style (an_ex_style: INTEGER) -- (from WEL_WINDOW)
    set_focus -- (from WEL_WINDOW)
    set_heavy_capture -- (from WEL_WINDOW)
    set_height (a_height: INTEGER) -- (from WEL_WINDOW)
    set_horizontal_position (position: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    set_horizontal_range (minimum, maximum: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    set_icon (a_small_icon, a_big_icon: WEL_ICON) -- (from WEL_COMPOSITE_WINDOW)
    set_item (an_item: POINTER) -- (from WEL_ANY)
    set_menu (a_menu: WEL_MENU) -- (from WEL_COMPOSITE_WINDOW)
    set_message_return_value (value: INTEGER) -- (from WEL_RETURN_VALUE)
    set_parent (a_parent: WEL_WINDOW) -- (from WEL_WINDOW)
    set_placement (a_placement: WEL_WINDOW_PLACEMENT) -- (from WEL_WINDOW)
    set_shared -- (from WEL_ANY)
    set_style (a_style: INTEGER) -- (from WEL_WINDOW)
    set_text (a_text: STRING) -- (from WEL_WINDOW)
    set_timer (timer_id, time_out: INTEGER) -- (from WEL_WINDOW)
    set_unshared -- (from WEL_ANY)
    set_vertical_position (position: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    set_vertical_range (minimum, maximum: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    set_width (a_width: INTEGER) -- (from WEL_WINDOW)
    set_x (a_x: INTEGER) -- (from WEL_WINDOW)
    set_y (a_y: INTEGER) -- (from WEL_WINDOW)
    set_z_order (z_order: POINTER) -- (from WEL_WINDOW)
    show -- (from WEL_WINDOW)
    show_horizontal_scroll_bar -- (from WEL_WINDOW)
    show_scroll_bars -- (from WEL_WINDOW)
    show_vertical_scroll_bar -- (from WEL_WINDOW)
    show_with_option (cmd_show: INTEGER) -- (from WEL_WINDOW)
    unlock_window_update -- (from WEL_WINDOW)
    unset_menu -- (from WEL_COMPOSITE_WINDOW)
    update -- (from WEL_WINDOW)
    update_cached_style (new_ex_style, old_ex_style: INTEGER) -- (from WEL_WINDOW)
    validate -- (from WEL_WINDOW)
    validate_rect (rect: WEL_RECT) -- (from WEL_WINDOW)
    validate_region (region: WEL_REGION) -- (from WEL_WINDOW)
    vertical_update (inc, position: INTEGER) -- (from WEL_COMPOSITE_WINDOW)
    win_help (help_file: STRING; a_command, data: INTEGER) -- (from WEL_WINDOW)

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


UNICODE_DEMO Text

Automatic generation produced by ISE Eiffel

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

class
    UNICODE_DEMO

inherit
    WEL_APPLICATION

create
    make

feature

    rich_edit_dll: WEL_RICH_EDIT_DLL

    main_window: MAIN_WINDOW is
            -- Create the application's main window
        once
            create rich_edit_dll.make
            create Result.make
        end

end -- class UNICODE_DEMO

Classes
Clusters
Cluster hierarchy
Chart
Relations
Text
Contracts
Flat contracts
Go to:

-- Generated by ISE Eiffel --
For more details: www.eiffel.com


Eiffel Class

Automatic generation produced by ISE Eiffel

class
    UNICODE_DEMO

General
    cluster: root_cluster
    create: make

Ancestors
    WEL_APPLICATION

Queries
    Accelerators: WEL_ACCELERATORS -- (from WEL_APPLICATION)
    application: WEL_APPLICATION -- (from WEL_APPLICATION_MAIN_WINDOW)
    application_main_window: WEL_COMPOSITE_WINDOW -- (from WEL_APPLICATION_MAIN_WINDOW)
    Default_show_command: INTEGER -- (from WEL_APPLICATION)
    idle_action_enabled: BOOLEAN -- (from WEL_APPLICATION)
    is_application_main_window (window: WEL_COMPOSITE_WINDOW): BOOLEAN -- (from WEL_APPLICATION_MAIN_WINDOW)
    is_dialog (hwnd: POINTER): BOOLEAN -- (from WEL_APPLICATION)
    Main_window: MAIN_WINDOW
    rich_edit_dll: WEL_RICH_EDIT_DLL
    runable: BOOLEAN -- (from WEL_APPLICATION)

Commands
    disable_idle_action -- (from WEL_APPLICATION)
    enable_idle_action -- (from WEL_APPLICATION)
    idle_action -- (from WEL_APPLICATION)
    run -- (from WEL_APPLICATION)

-- Generated by ISE Eiffel --

For more details: www.eiffel.com


windows

Windows Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\windows\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file. If you select another directory than the default one, please copy images (*.bmp), icons (*.ico) and resource files (*.rc) from the default directory (the one containing the Ace file) to the new one.
  • Click OK.

Running

After launching the program, a window will appear with a custom ON_OFF_CONTROL control displayed. Clicking on this control will cause it's state to change. If you select one of the options from the "Windows" menu, that type of window will be displayed.

Under the Hood

The ON_OFF_CONTROL inherits WEL_CONTROL_WINDOW and demonstrates how to build your controls. The classes MODAL and MODELESS inherit WEL_MODAL_DIALOG and WEL_MODELESS_DIALOG respectively.

This sample contains the following classes:

  • APPLICATION_IDS
  • MAIN_WINDOW
  • MODAL
  • MODELESS
  • ON_OFF_CONTROL
  • WINDOWS_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APPLICATION_IDS
MAIN_WINDOW
MODAL
MODELESS
ON_OFF_CONTROL
WINDOWS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\windows\app.rc."

class interface
APPLICATION_IDS

feature -- Access

Cmd_exit : INTEGER is 1000

Cmd_modal_dlg : INTEGER is 101

Cmd_modeless_dlg : INTEGER is 102

Cmd_popup_window_with_parent : INTEGER is 103

Cmd_popup_window_without_parent : INTEGER is 104

Edit_id : INTEGER is 100

Id_ico_application : INTEGER is 1

Id_main_menu : INTEGER is 1

Modal_dlg_id : INTEGER is 1

Modeless_dlg_id : INTEGER is 2

Off_bmp_id : INTEGER is 2

On_bmp_id : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APPLICATION_IDS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

modal : MODAL
-- Modal dialog box

modeless : MODELESS
-- Modeless dialog box

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_background : WEL_BRUSH
-- Standard window background color used to create the
-- window class.
-- Can be redefined to return a user-defined brush.
-- (from WEL_FRAME_WINDOW )
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MODAL Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MODAL

create

make (a_parent: WEL_COMPOSITE_WINDOW )

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

edit : WEL_SINGLE_LINE_EDIT
-- Edit control

edit_text : STRING
-- Text of the edit control

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog box.
-- Can be called several times.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODAL_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MODAL

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MODELESS Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MODELESS

create

make (a_parent: WEL_COMPOSITE_WINDOW )

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

edit : WEL_SINGLE_LINE_EDIT
-- Edit control

edit_text : STRING
-- Text of the edit control

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog box.
-- Can be called several times.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODELESS_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MODELESS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


ON_OFF_CONTROL Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
ON_OFF_CONTROL

create

make (a_parent: WEL_COMPOSITE_WINDOW ; a_x, a_y: INTEGER )
-- Load the bitmaps
require
a_parent_not_void: a_parent /= void
a_parent_exists: a_parent. exists

feature -- Initialization

make (a_parent: WEL_COMPOSITE_WINDOW ; a_x, a_y: INTEGER )
-- Load the bitmaps
require
a_parent_not_void: a_parent /= void
a_parent_exists: a_parent. exists

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

font : WEL_FONT
-- Font with which the control is drawing its text.
-- (from WEL_CONTROL_WINDOW )
require -- from WEL_CONTROL_WINDOW
exists: exists
ensure -- from WEL_CONTROL_WINDOW
result_not_void: Result /= void

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

on : BOOLEAN
-- Is the control turned on?

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_font : BOOLEAN
-- Does the control use the system font?
-- (from WEL_CONTROL_WINDOW )
require -- from WEL_CONTROL_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_CONTROL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_CONTROL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_CONTROL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_CONTROL_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_font (a_font: WEL_FONT )
-- Set font with a_font.
-- (from WEL_CONTROL_WINDOW )
require -- from WEL_CONTROL_WINDOW
exists: exists
a_font_not_void: a_font /= void
a_font_exists: a_font. exists
ensure -- from WEL_CONTROL_WINDOW
font_set: not has_system_font implies font . item = a_font. item

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_CONTROL_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_CONTROL_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class ON_OFF_CONTROL

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


WINDOWS_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
WINDOWS_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class WINDOWS_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Xcell

Xcell Sample

Compiling

Running

After launching the program, a window will be displayed. Selecting "New" from the "Game" menu or pressing F2, will cause a new game to start and the window should take a similar appearance to the above illustration. Selecting "How to play..." from the "Help" menu will display the instructions for playing the game.

Under the Hood

This sample contains the following classes:

  • APP_CONSTANTS
  • CARD
  • COLUMN
  • GAME
  • GAME_CONSTANTS
  • GAME_MANAGER
  • MAIN_WINDOW
  • SELECT_GAME_NUMBER_DIALOG
  • SELECT_NUMBER_OF_CARDS_DIALOG
  • XCELL_DEMO


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
APP_CONSTANTS
CARD
COLUMN [G]
GAME
GAME_CONSTANTS
GAME_MANAGER
MAIN_WINDOW
SELECT_GAME_NUMBER_DIALOG
SELECT_NUMBER_OF_CARDS_DIALOG
XCELL_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APP_CONSTANTS Flat contracts

-- Automatic generation produced by ISE Eiffel --

indexing
description: "Generated by h2e from the file c:\eiffel4\examples\wel\xcell\app.rc."

class interface
APP_CONSTANTS

feature -- Access

About_dialog_id : INTEGER is 3

Background_bitmap_id : INTEGER is 75

Bitmap_10 : INTEGER is 10

Bitmap_11 : INTEGER is 11

Bitmap_12 : INTEGER is 12

Bitmap_13 : INTEGER is 13

Bitmap_14 : INTEGER is 14

Bitmap_15 : INTEGER is 15

Bitmap_16 : INTEGER is 16

Bitmap_17 : INTEGER is 17

Bitmap_18 : INTEGER is 18

Bitmap_19 : INTEGER is 19

Bitmap_20 : INTEGER is 20

Bitmap_21 : INTEGER is 21

Bitmap_22 : INTEGER is 22

Bitmap_23 : INTEGER is 23

Bitmap_24 : INTEGER is 24

Bitmap_25 : INTEGER is 25

Bitmap_26 : INTEGER is 26

Bitmap_27 : INTEGER is 27

Bitmap_28 : INTEGER is 28

Bitmap_29 : INTEGER is 29

Bitmap_30 : INTEGER is 30

Bitmap_31 : INTEGER is 31

Bitmap_32 : INTEGER is 32

Bitmap_33 : INTEGER is 33

Bitmap_34 : INTEGER is 34

Bitmap_35 : INTEGER is 35

Bitmap_36 : INTEGER is 36

Bitmap_37 : INTEGER is 37

Bitmap_38 : INTEGER is 38

Bitmap_39 : INTEGER is 39

Bitmap_4 : INTEGER is 4

Bitmap_40 : INTEGER is 40

Bitmap_41 : INTEGER is 41

Bitmap_42 : INTEGER is 42

Bitmap_43 : INTEGER is 43

Bitmap_44 : INTEGER is 44

Bitmap_45 : INTEGER is 45

Bitmap_46 : INTEGER is 46

Bitmap_47 : INTEGER is 47

Bitmap_48 : INTEGER is 48

Bitmap_49 : INTEGER is 49

Bitmap_5 : INTEGER is 5

Bitmap_50 : INTEGER is 50

Bitmap_51 : INTEGER is 51

Bitmap_52 : INTEGER is 52

Bitmap_53 : INTEGER is 53

Bitmap_54 : INTEGER is 54

Bitmap_55 : INTEGER is 55

Bitmap_6 : INTEGER is 6

Bitmap_60 : INTEGER is 60

Bitmap_61 : INTEGER is 61

Bitmap_62 : INTEGER is 62

Bitmap_63 : INTEGER is 63

Bitmap_7 : INTEGER is 7

Bitmap_8 : INTEGER is 8

Bitmap_9 : INTEGER is 9

Cmd_about : INTEGER is 105

Cmd_exit : INTEGER is 103

Cmd_how_to_play : INTEGER is 108

Cmd_new : INTEGER is 104

Cmd_select_game_number : INTEGER is 107

Cmd_select_number_of_cards : INTEGER is 106

Cmd_start : INTEGER is 101

Cmd_stop : INTEGER is 102

End_bitmap_id : INTEGER is 2

Game_menu_id : INTEGER is 1

How_to_play_dialog : INTEGER is 4

Idc_edit : INTEGER is 101

Select_cards_dlg_id : INTEGER is 1

Select_game_number_dlg_id : INTEGER is 2

Start_bitmap_id : INTEGER is 1

Xcell_bitmap_id : INTEGER is 77

Xcell_icon : INTEGER is 1

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class APP_CONSTANTS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CARD Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
CARD

create

make (number: INTEGER )
-- Make the card identified by number.
require
number_greater_than_card_offset: number > card_offset
number_less_or_equal_maximun: number <= maximum_number_of_cards + card_offset
ensure
card_number_set: card_number = number

feature -- Access

card_image : WEL_BITMAP
-- The image of the card

card_number : INTEGER
-- The number of the card

height : INTEGER
-- The height of the card
ensure
positive_result: Result >= 0

includes_point (x_pos, y_pos: INTEGER ): BOOLEAN
-- Does the point defined by
-- (x_pos, y_pos) is inside the image?

offset_x : INTEGER
-- Offset to the x-position of the mouse when
-- moving a card

offset_y : INTEGER
-- Offset to the y-position off the mouse when
-- moving a card

overlapped_with (a_card: CARD ): BOOLEAN
-- Does 'a_card' overlap my image more than 50% horizontally?
require
a_card_not_void: a_card /= void

set_offset_x (a_x: INTEGER )
-- Set the offset_x to a_x
ensure
offset_x_is_set: offset_x = a_x

set_offset_y (a_y: INTEGER )
-- Set the offset_y to a_y
ensure
offset_y_is_set: offset_y = a_y

set_x (a_x: INTEGER )
-- Set the x_position to a_y
ensure
x_position_set: x_position = a_x

set_y (a_y: INTEGER )
-- Set the y_position to a_y
ensure
y_position_set: y_position = a_y

width : INTEGER
-- The width of the card
ensure
positive_result: Result >= 0

x_position : INTEGER
-- x_position of the card in the client-area

y_position : INTEGER
-- y_position of the card in the client-area

invariant

card_image_not_void: card_image /= void
card_image_exists: card_image . exists
card_number_set: card_number /= 0
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class CARD

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


COLUMN Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
COLUMN [G]

create

make
-- Create an empty list.
-- (from LINKED_LIST )
ensure -- from LINKED_LIST
is_before: before

feature -- Initialization

make
-- Create an empty list.
-- (from LINKED_LIST )
ensure -- from LINKED_LIST
is_before: before

feature -- Access

add (a_item: G)
-- Add 'a_item' to the column,
-- 'a_item' becomes the top
require
no_void_item: a_item /= void
ensure
new_count: count = old count + 1

cursor : CURSOR
-- Current cursor position
-- (from LINKED_LIST )

first : like item
-- Item at first position
-- (from LINKED_LIST )
require -- from CHAIN
not_empty: not is_empty

has (v: like item ): BOOLEAN
-- Does chain include v?
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from CONTAINER
not_found_in_empty: Result implies not is_empty

i_th (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of @.
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

index : INTEGER
-- Index of current position
-- (from LINKED_LIST )

index_of (v: like item ; i: INTEGER ): INTEGER
-- Index of i-th occurrence of item identical to v.
-- (Reference or object equality,
-- based on object_comparison .)
-- 0 if none.
-- (from CHAIN )
require -- from LINEAR
positive_occurrences: i > 0
ensure -- from LINEAR
non_negative_result: Result >= 0

item : G
-- Current item
-- (from LINKED_LIST )
require -- from TRAVERSABLE
not_off: not off
require -- from ACTIVE
readable: readable

last : like item
-- Item at last position
-- (from LINKED_LIST )
require -- from CHAIN
not_empty: not is_empty

sequential_occurrences (v: G): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from LINEAR )
ensure -- from BAG
non_negative_occurrences: Result >= 0

one_from_top : G
-- The item under the top of the column
ensure
result_is_valid: count > 1 implies Result /= void

remove_top
-- Remove the top of the column.
require
not_empty: not empty
ensure
new_count: old count = count + 1

the_top : G
-- The top of the column
require
not_empty: not empty
ensure
same_count: old count = count

infix " @ " (i: INTEGER ): like item
-- Item at i-th position
-- Was declared in CHAIN as synonym of i_th .
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)

feature -- Measurement

count : INTEGER
-- Number of items
-- (from LINKED_LIST )

index_set : INTEGER_INTERVAL
-- Range of acceptable indexes
-- (from CHAIN )
ensure -- from INDEXABLE
not_void: Result /= void
ensure then -- from CHAIN
Result. count = count

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

occurrences (v: like item ): INTEGER
-- Number of times v appears.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from CHAIN )
ensure -- from BAG
non_negative_occurrences: Result >= 0

feature -- Status report

after : BOOLEAN
-- Is there no valid cursor position to the right of cursor?
-- (from LINKED_LIST )

before : BOOLEAN
-- Is there no valid cursor position to the left of cursor?
-- (from LINKED_LIST )

changeable_comparison_criterion : BOOLEAN
-- May object_comparison be changed?
-- (Answer: yes by default.)
-- (from CONTAINER )

exhausted : BOOLEAN
-- Has structure been completely explored?
-- (from LINEAR )
ensure -- from LINEAR
exhausted_when_off: off implies Result

Extendible : BOOLEAN is True
-- May new items be added? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

Full : BOOLEAN is False
-- Is structured filled to capacity? (Answer: no.)
-- (from LINKED_LIST )

is_empty : BOOLEAN
-- Is structure empty?
-- (from FINITE )

isfirst : BOOLEAN
-- Is cursor at first position?
-- (from LINKED_LIST )
ensure -- from CHAIN
valid_position: Result implies not is_empty

islast : BOOLEAN
-- Is cursor at last position?
-- (from LINKED_LIST )
ensure -- from CHAIN
valid_position: Result implies not is_empty

object_comparison : BOOLEAN
-- Must search operations use equal rather than =
-- for comparing references? (Default: no, use =.)
-- (from CONTAINER )

off : BOOLEAN
-- Is there no current item?
-- (from LINKED_LIST )

prunable : BOOLEAN
-- May items be removed? (Answer: yes.)
-- (from DYNAMIC_CHAIN )

readable : BOOLEAN
-- Is there a current item that may be read?
-- (from LINKED_LIST )

valid_cursor (p: CURSOR ): BOOLEAN
-- Can the cursor be moved to position p?
-- (from LINKED_LIST )

valid_cursor_index (i: INTEGER ): BOOLEAN
-- Is i correctly bounded for cursor movement?
-- (from CHAIN )
ensure -- from CHAIN
valid_cursor_index_definition: Result = ((i >= 0) and (i <= count + 1))

valid_index (i: INTEGER ): BOOLEAN
-- Is i within allowable bounds?
-- (from CHAIN )
ensure then -- from INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set . lower ) and (i <= index_set . upper ))
ensure then -- from CHAIN
valid_index_definition: Result = ((i >= 1) and (i <= count ))

writable : BOOLEAN
-- Is there a current item that may be modified?
-- (from SEQUENCE )

feature -- Status setting

compare_objects
-- Ensure that future search operations will use equal
-- rather than = for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
object_comparison

compare_references
-- Ensure that future search operations will use =
-- rather than equal for comparing references.
-- (from CONTAINER )
require -- from CONTAINER
changeable_comparison_criterion
ensure -- from CONTAINER
reference_comparison: not object_comparison

feature -- Cursor movement

back
-- Move to previous item.
-- (from LINKED_LIST )
require -- from BILINEAR
not_before: not before

finish
-- Move cursor to last position.
-- (Go before if empty)
-- (from LINKED_LIST )
ensure then -- from CHAIN
at_last: not is_empty implies islast
ensure then -- from LINKED_LIST
empty_convention: is_empty implies before

forth
-- Move cursor to next position.
-- (from LINKED_LIST )
require -- from LINEAR
not_after: not after
ensure then -- from LIST
moved_forth: index = old index + 1

go_i_th (i: INTEGER )
-- Move cursor to i-th position.
-- (from LINKED_LIST )
require -- from CHAIN
valid_cursor_index: valid_cursor_index (i)
ensure -- from CHAIN
position_expected: index = i

go_to (p: CURSOR )
-- Move cursor to position p.
-- (from LINKED_LIST )
require -- from CURSOR_STRUCTURE
cursor_position_valid: valid_cursor (p)

move (i: INTEGER )
-- Move cursor i positions. The cursor
-- may end up off if the offset is too big.
-- (from LINKED_LIST )
ensure -- from CHAIN
too_far_right: (old index + i > count ) implies exhausted
too_far_left: (old index + i < 1) implies exhausted
expected_index: ( not exhausted ) implies ( index = old index + i)
ensure then -- from LINKED_LIST
moved_if_inbounds: ((old index + i) >= 0 and (old index + i) <= ( count + 1)) implies index = (old index + i)
before_set: (old index + i) <= 0 implies before
after_set: (old index + i) >= ( count + 1) implies after

search (v: like item )
-- Move to first position (at or after current
-- position) where item and v are equal.
-- If structure does not include v ensure that
-- exhausted will be true.
-- (Reference or object equality,
-- based on object_comparison .)
-- (from BILINEAR )
ensure -- from LINEAR
object_found: ( not exhausted and object_comparison ) implies equal (v, item )
item_found: ( not exhausted and not object_comparison ) implies v = item

start
-- Move cursor to first position.
-- (from LINKED_LIST )
ensure then -- from CHAIN
at_first: not is_empty implies isfirst
ensure then -- from LINKED_LIST
empty_convention: is_empty implies after

feature -- Element change

append (s: SEQUENCE [G])
-- Append a copy of s.
-- (from SEQUENCE )
require -- from SEQUENCE
argument_not_void: s /= void
ensure -- from SEQUENCE
new_count: count >= old count

extend (v: like item )
-- Add v to end.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: has (v)
ensure then -- from BAG
one_more_occurrence: occurrences (v) = old ( occurrences (v)) + 1

fill (other: CONTAINER [G])
-- Fill with as many items of other as possible.
-- The representations of other and current structure
-- need not be the same.
-- (from COLLECTION )
require -- from COLLECTION
other_not_void: other /= void
extendible

force (v: like item )
-- Add v to end.
-- (from SEQUENCE )
require -- from SEQUENCE
extendible: extendible
ensure then -- from SEQUENCE
new_count: count = old count + 1
item_inserted: has (v)

merge_left (other: like Current)
-- Merge other into current structure before cursor
-- position. Do not move cursor. Empty other.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_off: not before
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
new_index: index = old index + old other. count
other_is_empty: other. is_empty

merge_right (other: like Current)
-- Merge other into current structure after cursor
-- position. Do not move cursor. Empty other.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_off: not after
other_exists: other /= void
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + old other. count
same_index: index = old index
other_is_empty: other. is_empty

put (v: like item )
-- Replace current item by v.
-- (Synonym for replace )
-- (from CHAIN )
require -- from COLLECTION
extendible: extendible
ensure -- from COLLECTION
item_inserted: has (v)
ensure then -- from CHAIN
same_count: count = old count

put_front (v: like item )
-- Add v to beginning.
-- Do not move cursor.
-- (from LINKED_LIST )
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
item_inserted: first = v

put_i_th (v: like item ; i: INTEGER )
-- Put v at i-th position.
-- (from CHAIN )
require -- from TABLE
valid_key: valid_index (k)
ensure then -- from INDEXABLE
insertion_done: i_th (k) = v

put_left (v: like item )
-- Add v to the left of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
new_index: index = old index + 1
ensure then -- from LINKED_LIST
previous_exists: previous /= void
item_inserted: previous . item = v

put_right (v: like item )
-- Add v to the right of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
extendible: extendible
not_after: not after
ensure -- from DYNAMIC_CHAIN
new_count: count = old count + 1
same_index: index = old index
ensure then -- from LINKED_LIST
next_exists: next /= void
item_inserted: not old before implies next . item = v
item_inserted_before: old before implies active . item = v

replace (v: like item )
-- Replace current item by v.
-- (from LINKED_LIST )
require -- from ACTIVE
writable: writable
ensure -- from ACTIVE
item_replaced: item = v

feature -- Removal

prune (v: like item )
-- Remove first occurrence of v, if any,
-- after cursor position.
-- If found, move cursor to right neighbor;
-- if not, make structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable: prunable

prune_all (v: like item )
-- Remove all occurrences of v.
-- (Reference or object equality,
-- based on object_comparison .)
-- Leave structure exhausted .
-- (from DYNAMIC_CHAIN )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
no_more_occurrences: not has (v)
ensure then -- from DYNAMIC_CHAIN
is_exhausted: exhausted

remove
-- Remove current item.
-- Move cursor to right neighbor
-- (or after if no right neighbor).
-- (from LINKED_LIST )
require -- from ACTIVE
prunable: prunable
writable: writable
ensure then -- from DYNAMIC_LIST
after_when_empty: is_empty implies after

remove_left
-- Remove item to the left of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
left_exists: index > 1
require else -- from DYNAMIC_LIST
not_before: not before
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
new_index: index = old index - 1

remove_right
-- Remove item to the right of cursor position.
-- Do not move cursor.
-- (from LINKED_LIST )
require -- from DYNAMIC_CHAIN
right_exists: index < count
ensure -- from DYNAMIC_CHAIN
new_count: count = old count - 1
same_index: index = old index

wipe_out
-- Remove all items.
-- (from LINKED_LIST )
require -- from COLLECTION
prunable
ensure -- from COLLECTION
wiped_out: is_empty
ensure then -- from DYNAMIC_LIST
is_before: before

feature -- Transformation

swap (i: INTEGER )
-- Exchange item at i-th position with item
-- at cursor position.
-- (from CHAIN )
require -- from CHAIN
not_off: not off
valid_index: valid_index (i)
ensure -- from CHAIN
swapped_to_item: item = old i_th (i)
swapped_from_item: i_th (i) = old item

feature -- Conversion

linear_representation : LINEAR [G]
-- Representation as a linear structure
-- (from LINEAR )

feature -- Duplication

duplicate (n: INTEGER ): like Current
-- Copy of sub-chain beginning at current position
-- and having min (n, from_here) items,
-- where from_here is the number of items
-- at or to the right of current position.
-- (from DYNAMIC_CHAIN )
require -- from CHAIN
not_off_unless_after: off implies after
valid_subchain: n >= 0

feature -- Iteration

do_all (action: PROCEDURE [ ANY , TUPLE [G]])
-- Apply action to every item.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void

do_if (action: PROCEDURE [ ANY , TUPLE [G]]; test: FUNCTION [ ANY , TUPLE [G], BOOLEAN ])
-- Apply action to every item that satisfies test.
-- Semantics not guaranteed if action or test changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- (from LINEAR )
require -- from TRAVERSABLE
action_exists: action /= void
test_exits: test /= void

for_all (test: FUNCTION [ ANY , TUPLE [G], BOOLEAN ]): BOOLEAN
-- Is test true for all items?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

there_exists (test: FUNCTION [ ANY , TUPLE [G], BOOLEAN ]): BOOLEAN
-- Is test true for at least one item?
-- (from LINEAR )
require -- from TRAVERSABLE
test_exits: test /= void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
-- from LINKED_LIST
prunable: prunable
empty_constraint: is_empty implies (( first_element = void ) and ( active = void ))
not_void_unless_empty: ( active = void ) implies is_empty
before_constraint: before implies ( active = first_element )
after_constraint: after implies ( active = last_element )
-- from LIST
before_definition: before = ( index = 0)
after_definition: after = ( index = count + 1)
-- from CHAIN
non_negative_index: index >= 0
index_small_enough: index <= count + 1
off_definition: off = (( index = 0) or ( index = count + 1))
isfirst_definition: isfirst = (( not is_empty ) and ( index = 1))
islast_definition: islast = (( not is_empty ) and ( index = count ))
item_corresponds_to_index: ( not off ) implies ( item = i_th ( index ))
index_set_has_same_count: index_set . count = count
-- from ACTIVE
writable_constraint: writable implies readable
empty_constraint: is_empty implies ( not readable ) and ( not writable )
-- from INDEXABLE
index_set_not_void: index_set /= void
-- from BILINEAR
not_both: not ( after and before )
before_constraint: before implies off
-- from LINEAR
after_constraint: after implies off
-- from TRAVERSABLE
empty_constraint: is_empty implies off
-- from FINITE
empty_definition: is_empty = ( count = 0)
non_negative_count: count >= 0
-- from DYNAMIC_CHAIN
extendible: extendible

end -- class COLUMN

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


GAME_CONSTANTS Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
GAME_CONSTANTS

feature -- Access

Card_offset : INTEGER is 3
-- The offset of a card_number and first_card

Column_offset : INTEGER is 4
-- A column is identified in the movement by its number + 4

First_card : INTEGER is 4
-- The first card number in the game

Home_cell_offset : INTEGER is 12
-- A home_cell is identified in the movement by its number + 12

Maximum_game_number : INTEGER is 65000
-- Maximum game number to play

Maximum_number_of_cards : INTEGER is 52
-- Maximum number of cards to play with

Most_left_x_position : INTEGER is 20
-- Defines the space between the cards
-- and the left border of the window

Most_top_y_position : INTEGER is 10
-- Most top y_position of a card.
-- This position is equal to the y_position
-- of the home_cells and the "xcells"

Number_of_cells : INTEGER is 4
-- Number of cells for each kind of cell

Number_of_columns : INTEGER is 8
-- Number of columns present in the game

Space_between_cards : INTEGER is 28
-- Vertical space between the cards in a column

Space_between_columns : INTEGER is 80
-- Horizontal space between the columns including the card width

Start_of_column_y_position : INTEGER is 130
-- The minimal y_position of a column

White_offset : INTEGER is 40
-- White space surrounding picture at start
-- of the game

Xcell_offset : INTEGER is 0
-- A xcell is identified in the movement by its number + 0

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class GAME_CONSTANTS

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


GAME Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
GAME

create

make (no_cards: INTEGER )
-- Create the columns, cells and the cards
require
maximum_number_of_cards: no_cards < 53
minimum_number_of_cards: no_cards > 0

feature -- Access

card_from_home_cell (cell_number: INTEGER ): INTEGER
-- The card from home_cell cell_number
require
valid_cell_less: cell_number <= number_of_cells
valid_cell_greater: cell_number > 0

card_from_top_of_column (column_number: INTEGER ): INTEGER
-- The card from top of column column_number
require
valid_column_less: column_number <= number_of_columns
valid_column_greater: column_number > 0
not_empty: not ( columns @ column_number). is_empty

card_from_xcell (cell_number: INTEGER ): INTEGER
-- The card from xcell cell_number
require
valid_cell_less: cell_number <= number_of_cells
valid_cell_greater: cell_number > 0

card_in_xcell (a_card: CARD ; a_xcell: INTEGER ): BOOLEAN
-- Is a_card in xcell a_xcell?

Card_offset : INTEGER is 3
-- The offset of a card_number and first_card
-- (from GAME_CONSTANTS )

column_empty (column_number: INTEGER ): BOOLEAN
-- Is the column corresponding to column_number empty?
require
valid_column_less: column_number <= number_of_columns
valid_column_greater: column_number > 0

column_from (column_number: INTEGER ): LINKED_LIST [ INTEGER ]
-- A linear representation of the column
-- corresponding to column_number
require
valid_column_less: column_number <= number_of_columns
valid_column_greater: column_number > 0
ensure
result_not_void: Result /= void

Column_offset : INTEGER is 4
-- A column is identified in the movement by its number + 4
-- (from GAME_CONSTANTS )

columns : ARRAY [ COLUMN [ INTEGER ]]
-- The columns in the game

First_card : INTEGER is 4
-- The first card number in the game
-- (from GAME_CONSTANTS )

home_cell_empty (cell_number: INTEGER ): BOOLEAN
-- Is the home_cell corresponding to cell_number empty?
require
valid_cell_less: cell_number <= number_of_cells
valid_cell_greater: cell_number > 0

Home_cell_offset : INTEGER is 12
-- A home_cell is identified in the movement by its number + 12
-- (from GAME_CONSTANTS )

Maximum_game_number : INTEGER is 65000
-- Maximum game number to play
-- (from GAME_CONSTANTS )

Maximum_number_of_cards : INTEGER is 52
-- Maximum number of cards to play with
-- (from GAME_CONSTANTS )

Most_left_x_position : INTEGER is 20
-- Defines the space between the cards
-- and the left border of the window
-- (from GAME_CONSTANTS )

Most_top_y_position : INTEGER is 10
-- Most top y_position of a card.
-- This position is equal to the y_position
-- of the home_cells and the "xcells"
-- (from GAME_CONSTANTS )

Number_of_cells : INTEGER is 4
-- Number of cells for each kind of cell
-- (from GAME_CONSTANTS )

Number_of_columns : INTEGER is 8
-- Number of columns present in the game
-- (from GAME_CONSTANTS )

one_from_top_in_column (a_column: INTEGER ): INTEGER
-- The card number which is one from the top
-- in the column corresponding to a_column
require
valid_column_less: a_column <= number_of_columns
valid_column_greater: a_column > 0

Space_between_cards : INTEGER is 28
-- Vertical space between the cards in a column
-- (from GAME_CONSTANTS )

Space_between_columns : INTEGER is 80
-- Horizontal space between the columns including the card width
-- (from GAME_CONSTANTS )

Start_of_column_y_position : INTEGER is 130
-- The minimal y_position of a column
-- (from GAME_CONSTANTS )

state_change : INTEGER
-- The change which is to be made if there
-- is a legal_candidate

the_cards : ARRAY [ CARD ]
-- The cards in the game

top_of_column (a_card: CARD ; a_column: INTEGER ): BOOLEAN
-- Is a_card top of column a_column
require
valid_column_less: a_column <= number_of_columns
valid_column_greater: a_column > 0
not_empty: not ( columns @ a_column). is_empty

White_offset : INTEGER is 40
-- White space surrounding picture at start
-- of the game
-- (from GAME_CONSTANTS )

xcell_empty (cell_number: INTEGER ): BOOLEAN
-- Is the xcell corresponding to cell_number empty?
require
valid_cell_less: cell_number <= number_of_cells
valid_cell_greater: cell_number > 0

Xcell_offset : INTEGER is 0
-- A xcell is identified in the movement by its number + 0
-- (from GAME_CONSTANTS )

feature -- Status report

goal_state : BOOLEAN
-- Is the game in the goal_state?

legal_candidate : BOOLEAN
-- Are the current settings for destination
-- and source legal to make a move?

feature -- Element change

change_state
-- Changes the state
require
legal_argument: state_change /= 0 and state_change < 6
legal_candidate: legal_candidate
ensure
did_a_change: state_change = 0

deal_game
-- Deal the game

remove_top_from_column (column_number: INTEGER )
-- Remove the top card number from column column_number

set_go_from (move_from: INTEGER )
-- Set the source of the movement to be made.
ensure
go_from_is_set: go_from = move_from

set_go_to (to: INTEGER )
-- Set the destination of the movement to be made.

shuffle_the_cards (game_number: INTEGER )
-- Shuffle the cards in the game with game_number as seed.
require
game_number_greater_than_zero: game_number > 0

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class GAME

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


GAME_MANAGER Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
GAME_MANAGER

create

make (no_cards: INTEGER )
-- Set the number of cards and create the game.
require
minimum_amount_of_cards: no_cards > 0

feature -- Access

Card_offset : INTEGER is 3
-- The offset of a card_number and first_card
-- (from GAME_CONSTANTS )

cards_in_drawing_order : LINKED_LIST [ INTEGER ]
-- A LINKED_LIST of the card numbers in drawing order,
-- so the cards will overlap correctly when drawn.

Column_offset : INTEGER is 4
-- A column is identified in the movement by its number + 4
-- (from GAME_CONSTANTS )

deal_game
-- Deal the game.

First_card : INTEGER is 4
-- The first card number in the game
-- (from GAME_CONSTANTS )

goal_state_reached : BOOLEAN
-- Is the game in the goal_state?

Home_cell_offset : INTEGER is 12
-- A home_cell is identified in the movement by its number + 12
-- (from GAME_CONSTANTS )

initialize_the_cards
-- Initialize each card in the game, by
-- setting its coordinates.

Maximum_game_number : INTEGER is 65000
-- Maximum game number to play
-- (from GAME_CONSTANTS )

Maximum_number_of_cards : INTEGER is 52
-- Maximum number of cards to play with
-- (from GAME_CONSTANTS )

Most_left_x_position : INTEGER is 20
-- Defines the space between the cards
-- and the left border of the window
-- (from GAME_CONSTANTS )

Most_top_y_position : INTEGER is 10
-- Most top y_position of a card.
-- This position is equal to the y_position
-- of the home_cells and the "xcells"
-- (from GAME_CONSTANTS )

Number_of_cells : INTEGER is 4
-- Number of cells for each kind of cell
-- (from GAME_CONSTANTS )

Number_of_columns : INTEGER is 8
-- Number of columns present in the game
-- (from GAME_CONSTANTS )

reset_destination
-- Resets the destination of the move status
require
destination_is_selected: destination_selected
ensure
no_destination: not destination_selected

reset_move_status
-- Resets the move status
require
source_is_selected: source_selected
destination_is_selected: destination_selected
ensure
no_destination: not destination_selected
no_source: not source_selected

reset_source
-- Resets the source of the move status
require
source_is_selected: source_selected
ensure
no_source: not source_selected

select_destination (x_pos, y_pos: INTEGER )

select_destination_home_cell
-- Select the home_cell corresponding
-- to the kind of the card
require
no_destination: not destination_selected
ensure
destination_is_set: destination /= 0
selected_a_destination: destination_selected

select_empty_column : BOOLEAN
-- Selects an empty column if available
require
no_destination: not destination_selected
ensure
destination_selected_on_result: Result implies destination_selected

select_empty_xcell
-- Selects an empty xcell if available
require
no_destination: not destination_selected

select_source (x_pos, y_pos: INTEGER )

shuffle_the_cards (game_number: INTEGER )
-- Shuffle the cards with game_number
require
game_number_greater_than: game_number > 0
game_number_smaller_equal_than: game_number <= 65000

Space_between_cards : INTEGER is 28
-- Vertical space between the cards in a column
-- (from GAME_CONSTANTS )

Space_between_columns : INTEGER is 80
-- Horizontal space between the columns including the card width
-- (from GAME_CONSTANTS )

Start_of_column_y_position : INTEGER is 130
-- The minimal y_position of a column
-- (from GAME_CONSTANTS )

the_cards : ARRAY [ CARD ]
-- The cards in the game

White_offset : INTEGER is 40
-- White space surrounding picture at start
-- of the game
-- (from GAME_CONSTANTS )

Xcell_offset : INTEGER is 0
-- A xcell is identified in the movement by its number + 0
-- (from GAME_CONSTANTS )

feature -- Status report

active_card : CARD
-- Card that is currently selected

destination : INTEGER
-- The destination of the current movement

destination_selected : BOOLEAN
-- Is the destination selected?

previous_card : CARD
-- If the source is a column, this card will be the
-- card that is one from the top in the source column.
-- If the column has only one card or the source is
-- not a column, this card will be void.

source : INTEGER
-- The source of the current movement

source_is_column : BOOLEAN
-- Is the source a column?

source_selected : BOOLEAN
-- Is the source selected?

feature -- Element change

move_card : BOOLEAN
-- Can the active card be moved from
-- source to destination?
-- Result is True on movement.
require
source_is_valid: source_selected
destination_is_valid: destination_selected

invariant

game_not_void: game /= void
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class GAME_MANAGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Create the main_window, the virtual DC,
-- the backgound DC and set the menu.

feature -- Access

Card_offset : INTEGER is 3
-- The offset of a card_number and first_card
-- (from GAME_CONSTANTS )

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

Column_offset : INTEGER is 4
-- A column is identified in the movement by its number + 4
-- (from GAME_CONSTANTS )

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

First_card : INTEGER is 4
-- The first card number in the game
-- (from GAME_CONSTANTS )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

Home_cell_offset : INTEGER is 12
-- A home_cell is identified in the movement by its number + 12
-- (from GAME_CONSTANTS )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

Maximum_game_number : INTEGER is 65000
-- Maximum game number to play
-- (from GAME_CONSTANTS )

Maximum_number_of_cards : INTEGER is 52
-- Maximum number of cards to play with
-- (from GAME_CONSTANTS )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

Most_left_x_position : INTEGER is 20
-- Defines the space between the cards
-- and the left border of the window
-- (from GAME_CONSTANTS )

Most_top_y_position : INTEGER is 10
-- Most top y_position of a card.
-- This position is equal to the y_position
-- of the home_cells and the "xcells"
-- (from GAME_CONSTANTS )

Number_of_cells : INTEGER is 4
-- Number of cells for each kind of cell
-- (from GAME_CONSTANTS )

Number_of_columns : INTEGER is 8
-- Number of columns present in the game
-- (from GAME_CONSTANTS )

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

Space_between_cards : INTEGER is 28
-- Vertical space between the cards in a column
-- (from GAME_CONSTANTS )

Space_between_columns : INTEGER is 80
-- Horizontal space between the columns including the card width
-- (from GAME_CONSTANTS )

Start_of_column_y_position : INTEGER is 130
-- The minimal y_position of a column
-- (from GAME_CONSTANTS )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

White_offset : INTEGER is 40
-- White space surrounding picture at start
-- of the game
-- (from GAME_CONSTANTS )

Xcell_offset : INTEGER is 0
-- A xcell is identified in the movement by its number + 0
-- (from GAME_CONSTANTS )

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

foreground_window : WEL_WINDOW
-- Foreground window (window with focus)
-- (from WEL_WINDOWS_ROUTINES )

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

key_down (virtual_key: INTEGER ): BOOLEAN
--Is 'virtual' key pressed
-- (from WEL_WINDOWS_ROUTINES )

key_locked (virtual_key: INTEGER ): BOOLEAN
--Is 'virtual' key locked
-- (from WEL_WINDOWS_ROUTINES )

key_to_string (key_data: INTEGER ): STRING
-- Give the string associated with the key given by
-- virtual_key.
-- (from WEL_WINDOWS_ROUTINES )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

system_directory : STRING
-- Path of the Windows system directory
-- (from WEL_WINDOWS_ROUTINES )
ensure -- from WEL_WINDOWS_ROUTINES
result_not_void: Result /= void

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

tick_count : INTEGER
-- Number of milliseconds that have
-- elapsed since Windows was started.
-- (from WEL_WINDOWS_ROUTINES )
ensure -- from WEL_WINDOWS_ROUTINES
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_of_item (hwnd: POINTER ): WEL_WINDOW
-- Retrieve Eiffel object associated with hwnd pointer.
-- (from WEL_WINDOWS_ROUTINES )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

windows_directory : STRING
-- Path of the Windows directory
-- (from WEL_WINDOWS_ROUTINES )
ensure -- from WEL_WINDOWS_ROUTINES
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_cursor
-- Hide the cursor.
-- (from WEL_WINDOWS_ROUTINES )

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

message_beep_asterisk
-- Play the system asterisk waveform sound.
-- (from WEL_WINDOWS_ROUTINES )

message_beep_exclamation
-- Play the system exclamation waveform sound.
-- (from WEL_WINDOWS_ROUTINES )

message_beep_hand
-- Play the system hand waveform sound.
-- (from WEL_WINDOWS_ROUTINES )

message_beep_ok
-- Play the system ok waveform sound.
-- (from WEL_WINDOWS_ROUTINES )

message_beep_question
-- Play the system question waveform sound.
-- (from WEL_WINDOWS_ROUTINES )

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

output_debug_string (s: STRING )
-- Send a string s to the system debugger.
-- (from WEL_WINDOWS_ROUTINES )
require -- from WEL_WINDOWS_ROUTINES
s_not_void: s /= void

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

resource_string_id (an_id: INTEGER ): STRING
-- String identified by an_id in the resource file.
-- (from WEL_WINDOWS_ROUTINES )
ensure -- from WEL_WINDOWS_ROUTINES
result_not_void: Result /= void

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_cursor_position_absolute (x, y: INTEGER )
-- Set the cursor position to x , y .
-- (from WEL_WINDOWS_ROUTINES )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_cursor
-- Show the cursor.
-- (from WEL_WINDOWS_ROUTINES )

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Implementation

about_box : WEL_MODAL_DIALOG
-- Creates the about_box
ensure
result_not_void: Result /= void

active_card : CARD
-- The card which is currently selected or moving.
ensure
result_not_void: Result /= void

class_background : WEL_NULL_BRUSH
-- Transparent window background
require -- from WEL_FRAME_WINDOW
background_brush_not_set: background_brush = void
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_icon : WEL_ICON
-- Creates the class_icon
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

end_bitmap : WEL_BITMAP
-- Creates the end_bitmap
ensure
result_not_void: Result /= void

how_to_play_box : WEL_MODAL_DIALOG
-- Creates the how_to_play_box
ensure
result_not_void: Result /= void

main_menu : WEL_MENU
-- The menu of the game
ensure
menu_not_void: Result /= void

previous_card : CARD
-- The previous card in the columnn of the active card.
-- This is necessary for efficient redrawing.

scr_height : INTEGER
-- The maximum height of the client area.
ensure
positive_height: scr_height /= 0

scr_width : INTEGER
-- The maximum width of the client area
ensure
positive_result: scr_width /= 0

select_game_number_dialog : SELECT_GAME_NUMBER_DIALOG
-- Creates the select_game_number_dialog
ensure
dialog_not_void: Result /= void

select_number_of_cards_dialog : SELECT_NUMBER_OF_CARDS_DIALOG
-- Creates the select_number_of_cards_dialog
ensure
dialog_not_void: Result /= void

start_bitmap : WEL_BITMAP
-- Creates the start_bitmap
ensure
result_not_void: Result /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

background_dc_not_void: exists implies background_dc /= void
background_dc_exists: exists implies background_dc . exists
virtual_dc_not_void: exists implies virtual_dc /= void
virtual_dc_exists: exists implies virtual_dc . exists
-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SELECT_GAME_NUMBER_DIALOG Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
SELECT_GAME_NUMBER_DIALOG

create

make (a_parent: WEL_COMPOSITE_WINDOW )
-- Creates the dialog
require
a_parent_not_void: a_parent /= void

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

game_number : INTEGER
-- Number of cards choosen

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

number_edit : WEL_SINGLE_LINE_EDIT
-- Edit control to input the game number

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

set_game_number (a_game_number: INTEGER )
-- Set the 'game_number' to a_game_number
ensure
game_number_is_set: game_number = a_game_number

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog box.
-- Can be called several times.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODAL_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SELECT_GAME_NUMBER_DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SELECT_NUMBER_OF_CARDS_DIALOG Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
SELECT_NUMBER_OF_CARDS_DIALOG

create

make (a_parent: WEL_COMPOSITE_WINDOW )
-- Create the dialog

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

no_cards : INTEGER
-- Number of cards choosen

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

result_id : INTEGER
-- Last control id used to close the dialog.
-- See class WEL_ID_CONSTANTS for the different values.
-- (from WEL_DIALOG )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ok_pushed : BOOLEAN
-- Has the OK button been pushed?
-- (from WEL_DIALOG )

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

activate
-- Activate the dialog box.
-- Can be called several times.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
parent_exists: parent /= void implies parent . exists
not_exists: not exists

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Terminate the dialog.
-- (from WEL_DIALOG )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

on_abort
-- Button Abort has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_cancel
-- Button Cancel has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_ignore
-- Button Ignore has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_no
-- Button No has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_retry
-- Button Retry has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

on_yes
-- Button Yes has been pressed.
-- (from WEL_DIALOG )
require -- from WEL_DIALOG
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

terminate (a_result: INTEGER )
-- Terminate the dialog with a_result.
-- result_id will contain a_result.
-- (from WEL_MODAL_DIALOG )
require -- from WEL_DIALOG
exists: exists
ensure -- from WEL_DIALOG
result_id_set: result_id = a_result

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class SELECT_NUMBER_OF_CARDS_DIALOG

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


XCELL_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
XCELL_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

accelerators : WEL_ACCELERATORS

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class XCELL_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


xy

XY Sample

Compiling

To compile the example:

  • Launch EiffelStudio.
  • Select Use existing Ace (control file) and click OK.
  • Browse to Eiffel52\examples\wel\xy\.
  • Choose Ace.ace
  • Choose the directory where the project will be compiled, by default the same directory containing the Ace file.
  • Click OK.

Running

After launching the sample, you should see a WEL_FRAME_WINDOW displayed. If you click the left mouse button in the client area of the window, the coordinates of the click (Relative to the top left of the client area), will be displayed. Clicking the WEL_PUSH_BUTTON marked "Clear" will clear the client area of the window.

Under the Hood

A WEL_CLIENT_DC is used to display output in the client area of the window during the execution of on_left_button_down which has been redefined in MAIN_WINDOW.

This sample contains the following classes:

  • XY_DEMO
  • MAIN_WINDOW

See Also
tutorial_step3
WEL_PUSH_BUTTON


cluster root_cluster

-- Automatic generation produced by ISE Eiffel --

Cluster
root_cluster

Classes
MAIN_WINDOW
XY_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
MAIN_WINDOW

create

make
-- Make the main window and a button

feature -- Access

children : LINKED_LIST [ WEL_WINDOW ]
-- Construct a linear representation of the children.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

commands : WEL_COMMAND_MANAGER
-- Command manager associated to the current window.
-- (from WEL_WINDOW )

default_processing : BOOLEAN
-- (from WEL_RETURN_VALUE )

has_return_value : BOOLEAN
-- Should the window procedure return a value?
-- (from WEL_RETURN_VALUE )

item : POINTER
-- Generic Windows handle or structure pointer.
-- Can be a HWND, HICON, RECT *, WNDCLASS *, etc...
-- (from WEL_ANY )

menu : WEL_MENU
-- Associated menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

message_return_value : INTEGER
-- Return value of the window procedure.
-- (from WEL_RETURN_VALUE )
require -- from WEL_RETURN_VALUE
has_return_value: has_return_value

parent : WEL_WINDOW
-- Parent window
-- (from WEL_WINDOW )

scroller : WEL_SCROLLER
-- Scroller object for processing scroll messages.
-- (from WEL_COMPOSITE_WINDOW )

system_menu : WEL_MENU
-- Associated system menu
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_system_menu: has_system_menu
ensure -- from WEL_COMPOSITE_WINDOW
result_not_void: Result /= void

feature -- Status report

absolute_x : INTEGER
-- Absolute x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . x

absolute_y : INTEGER
-- Absolute y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
Result = window_rect . y

background_brush : WEL_BRUSH
-- Current window background color used to refresh the window when
-- requested by the WM_ERASEBKGND windows message.
-- By default there is no background
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
new_object: Result /= void implies Result /= background_brush

captured_window : WEL_WINDOW
-- Current window which has been captured.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
window_captured: window_captured

client_rect : WEL_RECT
-- Client rectangle
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

closeable : BOOLEAN
-- Can the user close the window?
-- Yes by default.
-- (from WEL_COMPOSITE_WINDOW )

command (message: INTEGER ): WEL_COMMAND
-- Command associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
result_not_void: Result /= void

command_argument (message: INTEGER ): ANY
-- Command argument associated to message
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)

command_exists (message: INTEGER ): BOOLEAN
-- Does a command associated to message exist?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0

commands_enabled : BOOLEAN
-- Is the commands execution enabled?
-- (from WEL_WINDOW )

enabled : BOOLEAN
-- Is the window enabled for mouse and keyboard input?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

ex_style : INTEGER
-- Window ex_style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

exists : BOOLEAN
-- Does the item exist?
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = ( item /= default_pointer )

focused_window : WEL_WINDOW
-- Current window which has the focus.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_capture : BOOLEAN
-- Does this window have the capture?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_focus : BOOLEAN
-- Does this window have the focus?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_heavy_capture : BOOLEAN
-- Does this window have the heavy capture?
-- (from WEL_WINDOW )

has_horizontal_scroll_bar : BOOLEAN
-- Does this window have a horizontal scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

has_menu : BOOLEAN
-- Does the window have a menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_system_menu : BOOLEAN
-- Does the window have a system menu?
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

has_vertical_scroll_bar : BOOLEAN
-- Does this window have a vertical scroll bar?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

heavy_capture_activated : BOOLEAN
-- Is the heavy capture currently running?
-- (i.e. is there a window in the current program
-- with has_heavy_capture to True?)
-- (from WEL_WINDOW )

height : INTEGER
-- Window height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

horizontal_position : INTEGER
-- Current position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position
result_large_enough: Result >= minimal_horizontal_position

is_inside : BOOLEAN
-- Is the current window inside another window?
-- (from WEL_WINDOW )

maximal_height : INTEGER
-- Maximal height allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_height

maximal_horizontal_position : INTEGER
-- Maxium position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_horizontal_position

maximal_vertical_position : INTEGER
-- Maxium position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_large_enough: Result >= minimal_vertical_position

maximal_width : INTEGER
-- Maximal width allowed for the window
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
result_large_enough: Result >= minimal_width

maximized : BOOLEAN
-- Is the window maximized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

minimal_height : INTEGER
-- Minimal height allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_height

minimal_horizontal_position : INTEGER
-- Minimum position of the horizontal scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_horizontal_position

minimal_vertical_position : INTEGER
-- Minimum position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position

minimal_width : INTEGER
-- Minimal width allowed for the window
-- (from WEL_COMPOSITE_WINDOW )
ensure -- from WEL_WINDOW
positive_result: Result >= 0
result_small_enough: Result <= maximal_width

minimized : BOOLEAN
-- Is the window minimized?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

placement : WEL_WINDOW_PLACEMENT
-- Window placement information
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

shared : BOOLEAN
-- Is item shared by another object?
-- If False (by default), item will
-- be destroyed by destroy_item .
-- If True, item will not be destroyed.
-- (from WEL_ANY )

shown : BOOLEAN
-- Is the window shown?
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

style : INTEGER
-- Window style
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

text : STRING
-- Window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

text_length : INTEGER
-- Text length
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
positive_result: Result >= 0

vertical_position : INTEGER
-- Current position of the vertical scroll box
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
ensure -- from WEL_COMPOSITE_WINDOW
result_small_enough: Result <= maximal_vertical_position
result_large_enough: Result >= minimal_vertical_position

width : INTEGER
-- Window width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

window_captured : BOOLEAN
-- Has a window been captured?
-- (from WEL_WINDOW )

window_rect : WEL_RECT
-- Window rectangle (absolute position)
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
result_not_void: Result /= void

x : INTEGER
-- Window x position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_x

y : INTEGER
-- Window y position
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
parent = void implies Result = absolute_y

feature -- Status report

valid_hwnd_constant (c: POINTER ): BOOLEAN
-- Is c a valid hwnd constant?
-- (from WEL_HWND_CONSTANTS )

feature -- Status setting

disable
-- Disable mouse and keyboard input
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
disabled: not enabled

disable_commands
-- Disable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_disabled: not commands_enabled

disable_default_processing
-- Disable default window processing.
-- The standard window procedure will not be called for
-- each messages received by the window and then the
-- normal behavior will not occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_disabled: not default_processing

enable
-- Enable mouse and keyboard input.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
enabled: enabled

enable_commands
-- Enable commands execution.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
commands_enabled: commands_enabled

enable_default_processing
-- Enable default window processing.
-- The standard window procedure will be called for
-- each messages received by the window and then the
-- normal behavior will occur.
-- (from WEL_WINDOW )
ensure -- from WEL_WINDOW
default_processing_enabled: default_processing

hide
-- Hide the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
hidden: not shown

horizontal_update (inc, position: INTEGER )
-- Update the window and the horizontal scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

maximize
-- Maximize the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
maximized: maximized

minimize
-- Minimize the window and display its icon
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
minimized: minimized

release_capture
-- Release the mouse capture after a call
-- to set_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_capture: has_capture
ensure -- from WEL_WINDOW
not_has_capture: not has_capture

release_heavy_capture
-- Release the mouse capture after a call
-- to set_heavy_capture .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_heavy_capture: has_heavy_capture
heavy_capture_activated: heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated

restore
-- Restore the window to its
-- original size and position after
-- minimize or maximize
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works only for windows in the same thread as your
-- application.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_capture: not has_capture
has_not_heavy_capture: not has_heavy_capture
ensure -- from WEL_WINDOW
has_capture: has_capture

set_ex_style (an_ex_style: INTEGER )
-- Set an_ex_style with ex_style .
--
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_focus
-- Set the focus to Current
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_heavy_capture
-- Set the mouse capture to the Current window.
-- Once the window has captured the mouse, all
-- mouse input is directed to this window, regardless
-- of whether the cursor is over that window. Only
-- one window can have the mouse capture at a time.
--
-- Works for ALL windows.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
has_not_heavy_capture: not has_heavy_capture
heavy_capture_deactivated: not heavy_capture_activated
ensure -- from WEL_WINDOW
heavy_capture_set: has_heavy_capture
heavy_capture_activated: heavy_capture_activated

set_horizontal_position (position: INTEGER )
-- Set horizontal_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_horizontal_position
position_large_enough: position >= minimal_horizontal_position
ensure -- from WEL_COMPOSITE_WINDOW
horizontal_position_set: horizontal_position = position

set_horizontal_range (minimum, maximum: INTEGER )
-- Set minimal_horizontal_position and
-- maximal_horizontal_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_horizontal_position_set: minimal_horizontal_position = minimum
maximal_horizontal_position_set: maximal_horizontal_position = maximum

set_icon (a_small_icon: WEL_ICON ; a_big_icon: WEL_ICON )
-- Set the small (16x16) and the normal (32x32) icon for this window.
--
-- Note: Set a_small_icon to Void to remove the small icon and
-- a_big_icon to Void to remove the big icon.
-- (from WEL_COMPOSITE_WINDOW )

set_menu (a_menu: WEL_MENU )
-- Set menu with a_menu.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
a_menu_not_void: a_menu /= void
a_menu_exists: a_menu. exists
ensure -- from WEL_COMPOSITE_WINDOW
has_menu: has_menu
menu_set: menu . item = a_menu. item

set_shared
-- Set shared to True.
-- (from WEL_ANY )
ensure -- from WEL_ANY
shared: shared

set_style (a_style: INTEGER )
-- Set style with a_style.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_unshared
-- Set shared to False.
-- (from WEL_ANY )
ensure -- from WEL_ANY
unshared: not shared

set_vertical_position (position: INTEGER )
-- Set vertical_position with position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

set_vertical_range (minimum, maximum: INTEGER )
-- Set minimal_vertical_position and
-- maximal_vertical_position with minimum and
-- maximum.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
scroller_exists: scroller /= void
consistent_range: minimum <= maximum
ensure -- from WEL_COMPOSITE_WINDOW
minimal_vertical_position_set: minimal_vertical_position = minimum
maximal_vertical_position_set: maximal_vertical_position = maximum

show
-- Show the window
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unset_menu
-- Unset the current menu associated to the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
ensure -- from WEL_COMPOSITE_WINDOW
menu_unset: not has_menu

update_cached_style (new_ex_style, old_ex_style: INTEGER )
-- Update Window cache buffer for Window style.
--
-- (from WEL_WINDOW )

vertical_update (inc, position: INTEGER )
-- Update the window and the vertical scroll box with
-- inc and position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
position_small_enough: position <= maximal_vertical_position
position_large_enough: position >= minimal_vertical_position
ensure -- from WEL_COMPOSITE_WINDOW
vertical_position_set: vertical_position = position

feature -- Element change

has_system_window_locked : BOOLEAN
-- Is there any window locked ?
-- (from WEL_WINDOW )

lock_window_update
-- Disables drawing in the current window. A locked window cannot be moved.
-- Only one window can be locked at a time. To unlock a window locked with
-- lock_window_update , call 'unlock_window_update'.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
has_system_window_locked

set_height (a_height: INTEGER )
-- Set height with a_height
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_item (an_item: POINTER )
-- Set item with an_item
-- (from WEL_ANY )
ensure -- from WEL_ANY
item_set: item = an_item

set_parent (a_parent: WEL_WINDOW )
-- Change the parent of the current window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_placement (a_placement: WEL_WINDOW_PLACEMENT )
-- Set placement with a_placement
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_placement_not_void: a_placement /= void

set_text (a_text: STRING )
-- Set the window text
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
text_set_when_not_void: a_text /= void implies equal ( text , a_text)
text_set_when_void: a_text = void implies text . count = 0

set_timer (timer_id, time_out: INTEGER )
-- Set a timer identified by timer_id with a
-- time_out value (in milliseconds).
-- See also on_timer , kill_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0
positive_time_out: time_out > 0

set_width (a_width: INTEGER )
-- Set width with a_width
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_x (a_x: INTEGER )
-- Set x with a_x
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_y (a_y: INTEGER )
-- Set y with a_y
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

unlock_window_update
-- Unlock a locked window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

feature -- Removal

dispose
-- Destroy the inner structure of Current.
--
-- This function should be called by the GC when the
-- object is collected or by the user if Current is
-- no more usefull.
-- (from WEL_ANY )

feature -- Conversion

to_integer : INTEGER
-- Converts item to an integer.
-- (from WEL_ANY )
ensure -- from WEL_ANY
Result = cwel_pointer_to_integer ( item )

feature -- Basic operations

bring_to_top
-- Bring this window to the top of the Z order.
--
-- Note:
-- * If the window is a top-level window, it is activated.
-- * If the window is a child window, the top-level parent window
-- associated with the child window is activated.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

destroy
-- Destroy the window and quit the application
-- if Current is the application's main window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists
ensure -- from WEL_WINDOW
not_exists: not exists

disable_horizontal_scroll_bar
-- Disable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

disable_vertical_scroll_bar
-- Disable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

draw_menu
-- Draw the menu bar associated with the window.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists
has_menu: has_menu

enable_horizontal_scroll_bar
-- Enable the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

enable_vertical_scroll_bar
-- Enable the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_horizontal_scroll_bar
-- Hide the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_scroll_bars
-- Hide the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

hide_vertical_scroll_bar
-- Hide the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

insert_after (a_window: WEL_WINDOW )
-- Insert the current window after a_window.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
a_window_not_void: a_window /= void
a_window_not_current: a_window /= Current
a_window_exists: a_window. exists

invalidate
-- Invalide the entire client area of the window. The
-- background will be erased before.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
-- Invalidate the area rect and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
-- Invalidate the area region and erase
-- the background if erase_background is True.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

invalidate_without_background
-- Invalidate the entire client area of the window. The
-- background will not be erased.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

kill_timer (timer_id: INTEGER )
-- Kill the timer identified by timer_id.
-- See also set_timer , on_timer .
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
positive_timer_id: timer_id > 0

move (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

move_absolute (a_x, a_y: INTEGER )
-- Move the window to a_x, a_y absolute position.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_COMPOSITE_WINDOW
exists: exists

move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
-- Move the window to a_x, a_y position and
-- resize it with a_width, a_height.
-- (from WEL_COMPOSITE_WINDOW )
require -- from WEL_WINDOW
exists: exists

put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
-- Put a_command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
a_command_not_void: a_command /= void
positive_message: message >= 0
ensure -- from WEL_WINDOW
command_added: command (message) = a_command and command_argument (message) = argument

remove_command (message: INTEGER )
-- Remove the command associated to message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
positive_message: message >= 0
command_exists: command_exists (message)
ensure -- from WEL_WINDOW
command_removed: not command_exists (message)

resize (a_width, a_height: INTEGER )
-- Resize the window with a_width, a_height.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

scroll (a_x, a_y: INTEGER )
-- Scroll the contents of the window's client area.
-- a_x and a_y specify the amount of horizontal
-- and vertical scrolling.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

set_class_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_class_small_icon (new_icon: WEL_ICON )
-- Replace the current icon for the class which this window
-- belongs to.
--
-- The SetClassLong function replaces the specified 32-bit (long)
-- value at the specified offset into the extra class memory
-- or the WNDCLASSEX structure for the class to which the
-- specified window belongs.
-- (from WEL_WINDOW )

set_z_order (z_order: POINTER )
-- Set the z-order of the window.
-- See class WEL_HWND_CONSTANTS for z_order values.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
valid_hwnd_constant: valid_hwnd_constant (z_order)

show_horizontal_scroll_bar
-- Show the horizontal scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_scroll_bars
-- Show the horizontal and vertical scroll bars.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_vertical_scroll_bar
-- Show the vertical scroll bar.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

show_with_option (cmd_show: INTEGER )
-- Set the window's visibility with cmd_show.
-- See class WEL_SW_CONSTANTS for cmd_show value.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
parent_shown: parent /= void implies parent . exists and parent . shown

update
-- Update the client area by sending a Wm_paint message.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists

validate_rect (rect: WEL_RECT )
-- Validate the area rect.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
rect_not_void: rect /= void

validate_region (region: WEL_REGION )
-- Validate the area region.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
region_not_void: region /= void
region_exists: region. exists

win_help (help_file: STRING ; a_command, data: INTEGER )
-- Start the Windows Help program with help_file.
-- a_command specifies the type of help requested. See
-- class WEL_HELP_CONSTANTS for a_command values.
-- 'data' is depandant on 'a_command'. Check MSDN for more details.
-- (from WEL_WINDOW )
require -- from WEL_WINDOW
exists: exists
help_file_not_void: help_file /= void

feature -- Default creation values

default_height : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_width .
-- (from WEL_FRAME_WINDOW )

default_id : INTEGER
-- Default window id.
-- (Zero by default).
-- (from WEL_FRAME_WINDOW )

default_style : INTEGER
-- Overlapped window style.
-- By default, a frame window is not visible
-- at the creation time. show needs to be called.
-- This solution avoids a bad visual effect when
-- the children are created one by one inside
-- the window.
-- (from WEL_FRAME_WINDOW )

default_width : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_y and default_height .
-- (from WEL_FRAME_WINDOW )

default_x : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_y , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

default_y : INTEGER
-- Default position and dimension when the window is
-- created.
-- Was declared in WEL_FRAME_WINDOW as synonym of default_x , default_width and default_height .
-- (from WEL_FRAME_WINDOW )

feature -- Element Change

set_default_processing (value: BOOLEAN )
-- Enable or disable default processing of window messages.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
value_set: default_processing = value

set_message_return_value (value: INTEGER )
-- Set the window-procedure-return-value.
-- (from WEL_RETURN_VALUE )
ensure -- from WEL_RETURN_VALUE
has_return_value: has_return_value
value_set: message_return_value = value

feature -- Registration

register_current_window
-- Register Current in window manager.
-- (from WEL_WINDOW )

feature -- Standard window class values

class_cursor : WEL_CURSOR
-- Standard arrow cursor used to create the window
-- class.
-- Can be redefined to return a user-defined cursor.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_icon : WEL_ICON
-- Standard application icon used to create the
-- window class.
-- Can be redefined to return a user-defined icon.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void
result_exists: Result. exists

class_menu_name : STRING
-- Window's menu used to create the window class.
-- Can be redefined to return a user-defined menu.
-- (None by default).
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_void: Result /= void

class_name : STRING
-- Window class name used to create the window class.
-- Can be redefined to return a user-defined class name.
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_WINDOW
result_not_void: Result /= void

class_style : INTEGER
-- Standard style used to create the window class.
-- Can be redefined to return a user-defined style.
-- (from WEL_FRAME_WINDOW )

class_window_procedure : POINTER
-- Standard window procedure
-- (from WEL_FRAME_WINDOW )
ensure -- from WEL_FRAME_WINDOW
result_not_null: Result /= default_pointer

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class MAIN_WINDOW

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


XY_DEMO Flat contracts

-- Automatic generation produced by ISE Eiffel --

class interface
XY_DEMO

create

make
-- Create the application's dispatcher,
-- set the application's main window and run
-- the application.
-- (from WEL_APPLICATION )

feature -- Access

accelerators : WEL_ACCELERATORS
-- Application's accelerators
-- May be redefined (in once) to associate accelerators.
-- (from WEL_APPLICATION )

application : WEL_APPLICATION
-- Current application
-- (from WEL_APPLICATION_MAIN_WINDOW )

application_main_window : WEL_COMPOSITE_WINDOW
-- Application's main window
-- (from WEL_APPLICATION_MAIN_WINDOW )

default_show_command : INTEGER
-- Default command used to show main_window .
-- May be redefined to have a maximized window for
-- instance.
-- See class WEL_SW_CONSTANTS for values.
-- (from WEL_APPLICATION )

feature -- Status report

idle_action_enabled : BOOLEAN
-- Is the idle action enabled?
-- (False by default)
-- (from WEL_APPLICATION )

is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
-- Is window the application's main window?
-- (from WEL_APPLICATION_MAIN_WINDOW )
require -- from WEL_APPLICATION_MAIN_WINDOW
window_not_void: window /= void
ensure -- from WEL_APPLICATION_MAIN_WINDOW
Result = (window = application_main_window )

is_dialog (hwnd: POINTER ): BOOLEAN
-- Is the window corresponding to hwnd a dialog box?
-- We call the function with a dialog box option,
-- if it is indeed a dialog, the result will always
-- be non zero, otherwise it is zero.
-- (from WEL_APPLICATION )

runable : BOOLEAN
-- Can the application be run?
-- (True by default)
-- The user may want to return False if the application
-- can not be executed for any reason.
-- (from WEL_APPLICATION )

feature -- Status setting

disable_idle_action
-- Disable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_disabled: not idle_action_enabled

enable_idle_action
-- Enable the call to idle_action when the message
-- queue is empty.
-- (from WEL_APPLICATION )
ensure -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

feature -- Basic operations

idle_action
-- Called when the message queue is empty.
-- Useful to perform background operations.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
idle_action_enabled: idle_action_enabled

run
-- Create main_window and start the message loop.
-- (from WEL_APPLICATION )
require -- from WEL_APPLICATION
runable: runable
main_window_not_void: application_main_window /= void
parent_main_window_is_void: application_main_window . parent = void

feature

main_window : MAIN_WINDOW
-- Create the application's main window
require -- from WEL_APPLICATION
once_declaration: application_main_window = void
ensure -- from WEL_APPLICATION
result_not_void: Result /= void
parent_main_window_is_void: Result. parent = void

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class XY_DEMO

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Online Eiffel documentation

Congratulations for installing ISE Eiffel 5, featuring EiffelStudio, the full-lifecycle environment for quality software development, based on the most advanced version of object technology and the concepts of Design by Contract™.

ISE Eiffel 5 is available on many platforms and is one of the first development environments to take advantage of the Microsoft .NET framework.

ISE Eiffel 5 comes with extensive online documentation. Please take the time to read up on Eiffel and the EiffelStudio environment to make the best possible use of the environment.

Here is your roadmap to Eiffel documentation.

Release notes

You will find out here what's new in this release.

General documentation

Make sure to read the introductory documentation, which includes:
  • Two presentations of the Eiffel method and language, one short ("an invitation to Eiffel") and the other a detailed tutorial.
  • An in-depth, step-by-step Guided Tour of EiffelStudio. Highly recommended to master the environment's powerful tools for analysis, design, implementation, browsing, incremental compilation (the Melting Ice™ technology), debugging, documentation, HTML generation, metrics, cross-generation of C packages etc.
  • Complementary documents: "Why your next project should use Eiffel" and the "1-minute summary" (to show your boss!).

You will find the introductory documentation here.

Environment documentation

EiffelStudio is the centerpiece of ISE Eiffel 5, your friendly environment for conceptualizing, analyzing, designing, producing, documenting, debugging, exploring, measuring and maintaining systems. You will find EiffelStudio documentation here.

Library documentation

ISE Eiffel is all about reuse. Thousands of reusable components help you develop your applications by standing on the shoulders of previous developers. Here is the documentation on the principal libraries:

  • EiffelBase: ISE's acclaimed open-source library covering the fundamental algorithms and data structures of computing science.
  • EiffelVision 2: the extensive multi-platform graphical library for producing modern GUI applications that will run on Windows as well as Unix, Linux, VMS and other X-based platforms.
  • WEL (Windows Eiffel Library): powerful graphical library for Windows platforms.
  • EiffelCOM: your tool of choice for building and using Microsoft COM components. See also EiffelCOM Wizard.
  • EiffelNet: the client-server library for exchanging object structures across the network, between identical or different machine architectures.
  • EiffelTime: time and date library.
  • EiffelStore: object-relational database interface library.
  • EiffelThreads: multi-threading library.
  • Eiffel2Java: Java interface library.
  • EiffelWeb: Web interface library with support for easy development of CGI scripts in Eiffel.
  • EiffelLex and EiffelParse: lexical analysis and parsing libraries.

Documentation on other tools

See also the documentation on the following tools of ISE Eiffel 5:

  • EiffelCOM Wizard: generates a COM client or server application, taking care of all the details.


Technologies

  • COM
  • .NET
  • CECIL
  • Porting instructions
  • Threads


CECIL

CECIL library

  • Introduction
  • Compiling an Eiffel system for CECIL
  • Using a CECIL archive
  • CECIL interface overview
  • CECIL man pages
  • CECIL examples


Introduction

This document provides an overview of the C-Eiffel Call-In Library (CECIL) as defined in Eiffel: The Language (ETL). The first section adresses how to compile and run a CECIL program, on the Eiffel side and on the C side. The second part contains a more precise description of the Eiffel types, the protection mechanism as well as how to write and use C externals.

CECIL, designed by ISE, is the C library that permits C and C++ applications (as well as applications written in other languages) to take advantage of almost all Eiffel facilities: create Eiffel objects, apply features to them. The basics of CECIL are described in chapter 24 of the reference book on Eiffel, Eiffel: The Language, which covers interfaces between Eiffel and other languages. Important material can also be found in the ISE manual Eiffel: The Environment.

The CECIL documentation, man pages and examples are part of the standard delivery with the ISE Compiler 4.5 and higher.

The present document complements the descriptions of Eiffel: The Language. Note that CECIL has been revised and improved since that book was published, so the explanations below have precedence over those in the book.

This document is intended for both Windows and Unix users. Only a few of the sections, clearly marked, are platform-specific.

To access Eiffel mechanisms from C or other external languages:
  • Compile your Eiffel system so as to generate "Cecilized" code, that is to say code callable from the outside. See Compiling your Eiffel system for CECIL.
  • In writing the external code that will use the facilities of the Eiffel system, use the CECIL functions as specified in chapter 24 of Eiffel: The Language. See also The CECIL interface overview.
  • C-compile and link that code. See Building a C system using CECIL.

For feature by feature specification, please have a look at the man pages.


Compiling an Eiffel system for CECIL

Compiling your Eiffel system for CECIL

It is very simple to "Cecilize" your Eiffel system, that is to say make its features available from the outside through CECIL. You will compile it as you normally would - either freeze it or finalize it. The only supplementary precaution is to protect from the dead-code remover any Eiffel features that are not called from the Eiffel system's root, and might thus be dead-code-removed by the optimization mechanism.

To do this, include the appropriate features and classes in the visible clause of the Ace file, as in

    system
        system_name
    root
        ...
    default
        ...
    cluster
        ...
        your_cluster: "..."
            adapt
                ...
            visible
                CLASS1;
                CLASS2
                    creation
                        "other_make"
                    export
                        "other_make", "feat1", "feat2"
                    end
            end

        ... Other clusters ...

    ...
    end
Here all features of CLASS1 are available to the external software; for CLASS2, only other_make (for creation) and feat1 and feat2 (for normal call) are available. For the full set of visible options, see appendix D of Eiffel: The Language. If you omit the clause export, only the features with no export clause in the Eiffel code, will be available. The creation procedure of a visible class is always available.

Building a CECIL archive

The ISE-EiffelBench 5.0 compiler produces both C code and a "Makefile". The Makefile compiles and links that C code in a subdirectory one level below the EIFGEN directory of a project. For frozen/melted code, the Makefile is located in the W_code subdirectory. For finalized code, it is in the F_code subdirectory.

To produce a CECIL library, you must: open a shell (unix) or the MS-DOS prompt (Windows), go to the subdirectory that contains the Makefile, and then type:

    make cecil (on unix and on windows with Borland)
    nmake cecil (on windows with VC++)

This generates a CECIL archive whose name derived from the name <system name> of the Eiffel system, as follows:

    lib<system name>.a (on unix)
    lib<system name>.lib (on Windows)
For example, the corresponding archive for an Eiffel system called "test", would be called either "libtest.a" (Unix) or libtest.lib (Windows).

Note that through CECIL you can use an Eiffel system compiled in any of the Eiffel compilation modes:

  • Finalized C code.
  • Workbench (melted/frozen) code, usually for development purposes. In this case you must copy the <system name>.melted file ( where <system name> is the name of your system) located in EIFGEN\W_code to the directory where you intend to execute your C application from.

Note: each time you melt the Eiffel system, the <system name>.melted file is updated.

Caution: in the second case (workbench mode), it is not possible to call through the CECIL interface any routine that has been melted in the last compilation; this would raise the run-time exception:
$ applied to melted routine
The solution is simply to refreeze the system.


Using a CECIL archive

Linking the CECIL archive into a program

The CECIL archive already incorporates the Eiffel run-time. To use the functions provided in the CECIL archive, simply write the C programs according to the CECIL specifications of ETL, and then include the CECIL archive in the link line of your C application. This line looks like:

on Unix/linux:

ld -o [name of your CECIL executable] [your C object files and archives]
  lib<system name>.a -lm

Note: On Unix, linking with "-lm" is required since the Eiffel run-time uses the standard math libraries. You may need to link with other libraries (for example, on linux: with "-lbsd", in MT mode with "-lpthread" (posix threads) or "-lthread" (solaris)).

on Windows, with MS VC++:

link [your link flags] -OUT:[name of your cecil executable] [your C
  object files and archives] lib<system name>.lib [other Windows
  libraries]

on Windows with Borland:

ilink32 -ap -c -Tpe main.obj c0w32.obj, [name of your cecil
executable],,EIFGEN\W_code\lib<system name>.lib CW32 IMPORT32 OLE2w32,,

Notes for compiling CECIL C files:
The CECIL library is built automatically, which is unfortunately not the case of the corresponding object files of the cecil program you wrote.
The C flags to use are usually the same as the ones needed during the compilation of the generated C-code plus those which are relevant to your own C-code.

Typically, you will compile with your flags as below (if you are using gcc):

gcc -c -O -I$ISE_EIFFEL/studio/spec/$PLATFORM/include -I<SOME_INCLUDE_PATH> -D<SOME_FLAGS> your_file.c

or , if you are on Windows using MS VC++:

cl -c -nologo -Ox -I$ISE_EIFFEL\studio\spec\windows\include -I<SOME_INCLUDE_PATH> -D<SOME_FLAGS> your_file.c

or, if you are on Windows using Borland:

bcc32 -c -I$ISE_EIFFEL\studio\spec\windows\include -I<SOME_INCLUDE_PATH> -D<SOME_FLAGS> your_file.c

Sample: if you want to use the multithreaded facilities of Eiffel, you should define the EIFFEL MT flags by adding "-DEIF_THREADS" to the command line and follow the instructions of your C compiler and platform to find out which additional flags you may need.

For example: on Solaris you need to add "-DSOLARIS_THREADS -D_REENTRANT".

You can specify a Makefile in your Ace file, so that your C files will be compiled automatically after the Eiffel compilation and before the final linking. Just add at the end of your Ace file in the external clause:

external:
    "$PATH_TO_MAKEFILE/your_makefile";

This makefile will be run from the $/EIFGEN/W_code or $/EIFGEN/F_code directory. You should not give the CECIL executable the same name as your system, because it will be replaced by the Eiffel executable when you run another compilation.

Initializing the Eiffel run-time

Even though the main thread of control resides in the "C side" of the program, the Eiffel run-time must be initialized correctly before it can use CECIL facilities to communicate with the Eiffel world.

In the C file containing the "main" C function, you must add the following line to include the header file "eif_setup.h" provided with this example:

#include "eif_setup.h"  /* Macros EIF_INITIALIZE and EIF_DISPOSE_ALL */
#include "eif_eiffel.h" /* Exported functions of the Eiffel run-time */

Your "main" function must have the three standard arguments of the C "main" function: "argc", "argv" and "envp" and include the following macros that are defined in "eif_setup.h":

int main(int argc, char **argv, char **envp)
    /* Please respect this signature: `argc', `argv' and `envp' are used
     * in EIF_INITIALIZE.
     */
{
        /* declarations of variables */
        /* Initialize the Eiffel run-time. */
    EIF_INITIALIZE(failure)

    /* body of your "main" function */

        /* Reclaim the memory allocated by the Eiffel run-time. */
    EIF_DISPOSE_ALL
}

Notes:
The above mentioned macros must imperatively be in the body of the "main" function for the Eiffel exception handling mechanism to work correctly.

You also need to add the Eiffel run time directory to the list of directories in which the C compiler searches for include files. You can do so by using the "-I" option of your C compiler.

 You can only link one CECIL library into your C applications at a time.

Caution: Even though external object files and archives are correctly specified in the "object" clause of the Ace file, you will need to explicitly link them to your C application.


CECIL interface overview

Eiffel basic types

The EIFFEL include files define types for every EIFFEL types:
  • An Eiffel INTEGER is an EIF_INTEGER,
  • An Eiffel CHARACTER is an EIF_CHARACTER,
  • An Eiffel REAL is an EIF_REAL,
  • An Eiffel DOUBLE is an EIF_DOUBLE,
  • Eiffel references (any Eiffel objects that are not from a basic type) are EIF_REFERENCE (not protected, and can be moved),
  • An Eiffel POINTER is an EIF_POINTER,
  • An Eiffel BOOLEAN is an EIF_BOOLEAN,
  • A Protected Eiffel object is an EIF_OBJECT (does not move, and should be accessed through eif_access.).

Generally, you should use these types when implementing external C functions bound to be used from Eiffel or when you want to manipulate Eiffel objects from the C side. EIF_REFERENCE, EIF_OBJECT, EIF_POINTER all correspond in C to a (char *), but their semantic remains different in Eiffel.

Sample: Calling C external `foo' from Eiffel, which takes a pointer and an eiffel object of type OBJECT as arguments and returns an INTEGER.

    c_foo (ptr: POINTER; obj: OBJECT): INTEGER is
            external
                    "C | %"your_file.h%""
            alias
                    "foo"
            end

    In the C side, The C function `foo' is defined as follow:

                EIF_INTEGER foo (EIF_POINTER
    ptr, EIF_OBJECT obj)
{
/* some code */
}

In some cases, you may not be able to change the signature of a C function you want to use. In this case, you must describe its actual signature in the Eiffel code.

On the C side, foo is already defined as below:

            int foo (void *arg1, char c, FILE
    *file)
{
/* some code */
}
To match the signature, you must declare it in Eiffel as:
    c_foo (arg1: POINTER; c: CHARACTER; file: POINTER): INTEGER is
            external
                   "C (void *, char, FILE *) : int | %""your_file.h%""
            alias
                   "foo"
            end

Not doing this would generally produce warnings during the C compilation, and it could crash with some C compilers.

To perform the conversion, here is the actual Eiffel types mapping to C types:

    POINTER is compatible with any C pointer (char *).
    INTEGER is a long.
    CHARACTER is an unsigned char.
    DOUBLE is a double.
    REAL is a float.
    BOOLEAN is an unsigned char (EIF_TRUE = '\01', EIF_FALSE = '\0') .
These are the current correspondances but they may change.The definition of each Eiffel type is located in $ISE_EIFFEL/bench/spec/$PLATFORM/include/eif_portable.h.

More about EIF_OBJECT, EIF_REFERENCE, and basic expanded types

It is sometimes difficult to tell the difference between an EIF_OBJECT and an EIF_REFERENCE.

An EIF_REFERENCE is an Eiffel reference. It corresponds to an Eiffel object in the Eiffel side. eif_attribute, eif_reference_function, eif_string, eif_wean all return EIF_REFERENCEs. An EIF_REFERENCE can be used "as is" by the Eiffel run-time. eif_attribute, eif_xx_function take EIF_REFERENCEs as arguments, never EIF_OBJECTs. The return value of a C external is to be an EIF_REFERENCE, if it is not a basic expanded type. To protect an EIF_REFERENCE, use eif_protect.

An EIF_OBJECT is a safe and static indirection to an Eiffel reference. As the GC may move an Eiffel reference, this indirection is updated at every collection so that you do not need to know whether an Eiffel reference has moved or not. You must pass through this indirection to access the Eiffel reference (see eif_access). Not doing so is completely unsafe since an Eiffel reference may be obsolete after a collection. eif_create, eif_adopt, and eif_protect returns an EIF_OBJECT. The argument of a C external (on the C side) , which is not a basic expanded type, is also an EIF_OBJECT. The Eiffel run-time temporarily protects the Eiffel objects that are passed to a C external , that is why the signature of a C external has no EIF_REFERENCE in it, but EIF_OBJECT instead. After the C external call, the run-time unprotects the Eiffel object. If you intend to use in the C side an EIF_OBJECT given by a C external afterwards, you must protect it with eif_adopt. To unprotect an EIF_OBJECT , which is not a C external argument, use eif_wean.

The basic expanded types are INTEGER, INTEGER_64, INTEGER_16, INTEGER_8, REAL, DOUBLE, CHARACTER, BOOLEAN, POINTER. They are passed to C externals by values. There is no need to protect instances of these types. When the POINTER is a pointer to an Eiffel object (ex: $my_object), then the direct Eiffel reference is passed to C, with no protection and this reference may move. Use eif_protect to manually protect it. To unprotect it, call eif_wean.

Protecting the Eiffel objects

You can use the CECIL functions directly from a C program as well as from a C external called from Eiffel. If you encounter problems, they may be related to the handling of garbage collection. The programmer who uses CECIL has to be aware that all Eiffel objects can be moved or collected asynchronously by the Garbage Collector (GC).

The cecil library provides the user with numerous macros and functions, which relieve the programmer from these kinds of low-level considerations (most of them are declared in $ISE_EIFFEL/bench/spec/$PLATFORM/include/eif_cecil.h).

Eiffel objects passed in a C external

An Eiffel object which is passed as an argument of a C external is automatically protected: the value passed to C is not a direct Eiffel reference. In fact, it is a temporary indirection pointer, which is only valid until the C external returned. This indirection pointer is to be used to access the direct reference of the Eiffel object with eif_access (eiffel_object) where eiffel_object is the argument (an EIF_OBJECT) of the C external which corresponds to the Eiffel object. Only Eiffel objects passed to C is automatically protected. This excludes basic expanded types, since they cannot be moved.

Accessing the direct reference to an Eiffel object: eif_access

# include "eif_hector.h"

EIF_REFERENCE eif_access (EIF_OBJECT object) /* Macro */

The GC moves the objects every time it runs a collection cycle. A collection cycle can only occur during an Eiffel call. This includes calls to Eiffel routines and calls to CECIL functions (other than eif_access). Thus, it may be unsafe to access a "raw" reference to an Eiffel object, (of type EIF_REFERENCE) "as is", since the latter can be obsolete after each collection. To avoid this, you must access a direct reference through a "protection", which is a safe, non-moving pointer (of type EIF_OBJECT). Call the macro eif_access as follows: eif_access (protection) , where protection is either a value returned by eif_create, eif_adopt or eif_protect, or an Eiffel object which is an argument of a C external.

Use eif_access to pass an Eiffel object to an Eiffel routine or to return the value of a C external. It is also unsafe to pass a direct Eiffel reference (EIF_REFERENCE) to a C function which is not an Eiffel routine. Pass a protected indirection instead (EIF_OBJECT). However, if you still intend to pass a direct reference, be very careful and make sure that you do not perform any Eiffel call after passing the reference to the C function and before reading it.

For example, in the following external:

c_foo (ptr: POINTER; obj: OBJECT): INTEGER is
    external
        "C | %""your_file.h%""
    alias
        "foo"
    end

the Eiffel run-time will protect obj, which can asynchronously move, and give a static and safe indirection to C.

Here is an example of how accessing obj: OBJECT:

EIF_INTEGER foo (EIF_POINTER ptr, EIF_OBJECT obj);
{
        /* Print the Eiffel object `obj', with the feature `print'
         * from GENERAL. (do not forget to put `visible' the class
         * GENERAL in the Ace.ace file.
         */

        EIF_PROCEDURE ep;
        EIF_TYPE_ID tid;

        tid = eif_type_id
  ("GENERAL");
ep = eif_procedure
  ("print", tid);
(ep) (eif_access(obj),eif_access(obj));
}

Note: The first argument of (ep) is the target of the function (the eiffel object to which you want to apply the Eiffel feature (ep)) and the second argument corresponds to the first argument of `print'. Any Eiffel object could have been the 1st argument of (ep) since all of them inherit GENERAL.

Important rules when using eif_access:

  • Never precompute the value returned by eif_access.
    Example:
    Instead of the code above, it would have been dangerous to write:

    EIF_REFERENCE e_ref = eif_access (obj);
    ...
    (ep) (e_ref, e_ref);

    because e_ref is the direct reference to the Eiffel object when calling eif_access(). There is not guarantee that it will still be valid when the call to (ep) is done: meanwhile, e_ref may have been moved by the GC.

  • Never use eif_access with encapsulated eiffel calls:
    (eif_access in not an eiffel call)
    Example:

    (ep) (eif_access (a), eif_string ("Hello world"));
            /* eif_string is a macro returning a direct reference to an Eiffel string,
             * which corresponds to the C string passed as its argument.
             */
     Nothing guarantees that the direct reference returned by `eif_access (a)' will be still valid when executing (ep): it may be obsolete after the Eiffel call eif_string ("Hello world"), which may invoke a collection cycle.

    The correct code is

            EIF_REFERENCE my_string;
/* some code */
my_string = eif_string
    ("Hello world");
(ep) (eif_access (a),
    my_string);

    In this case, you do not need to protect `my_string' since the GC is not likely to be triggered after the call to eif_string and before `my_string' is given as argument in (ep). A collection is triggered only during Eiffel calls. If an Eiffel call had been performed, you would have had to use eif_protect (see paragraph 3.2):

        EIF_REFERENCE my_string;
EIF_OBJECT i_my_string;
/* some code */
my_string =  eif_string ("Hello
    world");
i_my_string = eif_protect (my_string); /* Protect `my_string'.
    */
/* Some eiffel calls */
(ep) (eif_access (a), eif_access (i_my_string));
eif_wean (i_my_string); /* Release protection.
    */

Keeping a reference from C after an external call: eif_adopt

# include "eif_hector.h"

EIF_OBJECT eif_adopt (EIF_OBJECT object)

When passing Eiffel objects to C, you may need to keep a reference to them after the C external is called. Since the Eiffel run-time automatically unprotects the Eiffel objects references passed to a C external after execution, if one of the Eiffel objects is not referenced any longer from Eiffel, then the garbage collector will collect it because it is not aware that you may still need to reference this object from the C side.

Called within a C external, the function eif_adopt creates a user protection for the Eiffel object object passed to C (object is a C external argument). This way, the GC cannot collect the Eiffel reference returned by eif_access(object) when the C external returned. It tells the GC to keep artificially a reference to this Eiffel reference from C. It returns the new indirection pointer (say returned_value) that must be used afterwards to access this direct Eiffel reference with eif_access (return_value). It is important to note that eif_adopt already takes an indirection pointer as unique argument. This is a temporary protection pointer: you can access the direct Eiffel reference with eif_access (object) only within the code of the C external. When the C external returns, eif_access (object) is NULL but eif_access (returned_value) remains valid until you release it with eif_wean.

Example:

In Eiffel:

    c_foo (ptr: POINTER; obj: OBJECT): INTEGER is
        external
            "C | %"your_file.h%""
        alias
            "foo"
        end
    c_display_and_release_obj is
        external
            "C | %"your_file.h%""
        alias
            "display_and_release_obj"
        end

On the C side:

    EIF_OBJECT my_obj;  /* Protection of the object
  of type OBJECT. */
EIF_INTEGER foo (EIF_POINTER ptr, EIF_OBJECT obj)
{
my_obj = eif_adopt (obj); /* Keeping a reference on it for
* for later use.
*/
/* some code */
}
void display_and_release_obj (void)
{
/* Display global object. */
EIF_PROCEDURE ep;
EIF_TYPE_ID tid;
tid = eif_type_id ("OBJECT");
ep = eif_procedure ("print", tid);
(ep) (eif_access(my_obj),eif_access(my_obj)); /* Print global object.*/
eif_wean (my_obj); /* Remove the protection on global object.*/
}

Between the call of `c_foo' and `c_display_obj', the global object (eif_access (my_obj)) may not be referenced from Eiffel any longer. To prevent the GC from collecting it before the call to `c_display_and_release_obj', you must protect it with `eif_adopt' in the C function `foo'.

Other CECIL functions:

Creating Eiffel objects from C: eif_create

# include "eif_cecil.h"

EIF_OBJECT eif_create (EIF_TYPE_ID type_id)

All CECIL calls are not completed using C externals. It is possible to create and manipulate Eiffel objects from a C program and still reap benefits from the garbage collector and design by contract methodology provided by Eiffel (see also How to run a CECIL program). This function does not call any creation procedure.

The CECIL function eif_create takes a type identifier type_id as argument (generally returned by eif_type_id). It returns a static indirection pointer which is to be used afterwards to access the newly created Eiffel object with eif_access (returned_value) where returned_value is the value returned by eif_create . This means that when creating an eiffel object from C, the eiffel object is automatically protected: there is no need to call eif_adopt or eif_protect on it. This function does not call any creation procedure. To do so, you need to explicitly call it with eif_procedure. The garbage collector will not collect the newly created object until you call eif_wean on it.

Example:

Creating an object of type "OBJECT":

#include eif_setup.h" /* for EIF_INITIALIZE and EIF_DISPOSE_ALL */
#include "eif_eiffel.h" /* for other exported routines from the
  Eiffel run-time */
main (int argc,char **argv,char **envp)
{
EIF_TYPE_ID tid;
EIF_OBJECT my_obj;
EIF_INITIALIZE(failure) /* Initialization of Eiffel run-time.
* This is to be done before any CECIL call.
*/

tid = eif_type_id ("OBJECT");
if (tid == EIF_NO_TYPE)
eif_panic ("No type id.");
my_obj = eif_create (tid); /* Create eiffel object, returns an indirection.
  */
/* some code */
eif_wean (my_obj); /* We do not need it any more. */
EIF_DISPOSE_ALL /* Reclaim memory allocated by Eiffel run-time. */
}

Note: `eif_create' does not call any creation procedure. It just allocates memory and initializes an object.

Protecting the objects returned by Eiffel functions.

> # include "eif_hector.h"
EIF_OBJECT eif_protect (EIF_REFERENCE object)

This function is used to tell explicitely the GC that you want to keep a reference to an eiffel object from the C. It returns a static indirection pointer which is to be used afterwards to access the direct Eiffel reference object with eif_access (returned_value) where returned_value is the value returned by eif_protect . With this call, the GC artificially references object, so that it cannot collect it. It is unsafe to access directly (i.e without using eif_access) the Eiffel reference object, which may be obsolete after any collection cycle (the GC moves the objects). Ignore this rule, if you are sure that there is no Eiffel call after you pass the direct Eiffel reference to a C function and before you read it.

To release this articifial reference, call eif_wean (returned_value)

eif_protect is to be called on an EIF_REFERENCE returned by eif_attribute, eif_string, or the returned value of eif_reference_function.

See also eif_adopt, eif_create, eif_wean, eif_access.

Example: Assume that you want to access an attribute `tab' of type ARRAY [INTEGER] in the class OBJECT.

#include eif_setup.h"
#include "eif_eiffel.h"
main (int argc,char **argv,char **envp)
{
EIF_TYPE_ID tid;
EIF_OBJECT my_obj;
EIF_PROCEDURE emake; /* Creation procedure of "OBJECT". */
EIF_REFERENCE tab; /* direct reference to `tab' from "OBJECT". */
EIF_OBJECT i_tab; /* Protected indirection to `tab'. */
EIF_INITIALIZE(failure)
tid = eif_type_id ("OBJECT");
if (tid == EIF_NO_TYPE)
eif_panic ("No type Id.");
my_obj = eif_create (tid);
emake = eif_procedure ("make", tid); /* On the eiffel side: make is
  do ... end.. */
(emake) (eif_access (my_obj)); /* Call `make' on `eif_access(my_obj)'.*/
tab = eif_attribute( eif_access (my_obj), "tab", EIF_REFERENCE,
  NULL);
/* Return the attribute `tab' of type EIF_REFERENCE
* of the object `eif_access (my_obj)'.
*/
i_tab = eif_protect (tab); /* Here, protect `tab'. */
/* some code */
eif_wean (my_obj);
eif_wean (i_tab); /* We do not need it any more. */
EIF_DISPOSE_ALL /* Reclaim memory allocated by Eiffel run-time. */
}

Note: Although you must protect Eiffel references returned by eif_attribute, you do not have to protect attributes of basic types - they are not Eiffel references and not supposed to move.

Getting the type id of an Eiffel type: eif_type_id

# include "eif_gen_conf.h" # include "eif_gen_conf.h"

EIF_TYPE_ID eif_type_id (char *type_string)

Return the type identifier corresponding to the type described in type_string. If the type does not exist, is not visible or an instance of it is not declared in the root class, it returns EIF_NO_TYPE.

COMPATIBILITY:

eif_type_id is equivalent to eif_type_by_name.

Example: type_id of STD_FILES so as to call 'put_string'.

    EIF_PROCEDURE p_put_string;     /* 'put_string' from STD_FILES. */
    EIF_TYPE_ID tid;
    EIF_REFERENCE_FUNCTION fn_io;    /* once function `io' from GENERAL (and STD_FILES by inheritance). */
    EIF_REFERENCE o_io;    /* Eiffel object `io'  returned by once function*/
    EIF_REFERENCE o_str;     /* Eiffel string */
    EIF_OBJECT i_io, i_str;    /* safe indirection pointers to ``io' and Eiffel string. */
    tid = eif_type_id ("STD_FILES");
    if (tid == EIF_NO_TYPE)
        eif_panic ("Type not in system.");
    fn_io = eif_reference_function ("io", tid);
    o_io = (fn_io) (root_obj);    /* `root_obj' is the root object of the CECIL system
                                           * automatically initialized in EIF_INITIALIZED
                                           * if it does not exists */
    i_io = eif_protect (o_io);    /* Protect `io' . */
    o_str = eif_string ("Hello World");    /* Create Eiffel string */
    i_str = eif_protect (o_str);    /* Protect Eiffel string. */
    p_put_string = eif_procedure ("put_string", tid);
    if (p_put_string == (EIF_PROCEDURE) 0) /* No routine found. */
        eif_panic ("put_string not visible"); /* Raised if "visible exception" disabled. */
    (p_put_string) (eif_access (i_io), eif_access (i_str));

eif_type_id is also used for returning the type identifier of generic types but you need to specify the generic parameter, otherwise it returns EIF_NO_TYPE.

Example:

    EIF_PROCEDURE p_make;     /* 'make'
  from ARRAY [INTEGER] . */
EIF_TYPE_ID tid;
tid = eif_type_id ("ARRAY[INTEGER]");
p_make = eif_procedure ("make", tid);

Getting the type id of a generic type : eif_generic_type.

Obsolete: see eif_type_id.

Raising an eiffel panic: eif_panic.

# include "eif_except.h"

void eif_panic(char *msg)

#include "eif_threads.h"

void eif_thr_panic (char *msg)

Raise an Eiffel panic with Eiffel exception trace with message msg . In MT mode, use eif_thr_panic instead.

Releasing an Eiffel indirection pointer: eif_wean

# include "eif_hector.h"

EIF_REFERENCE eif_wean(EIF_OBJECT object)

Tell the GC to remove the artificial reference to the nested Eiffel reference returned by eif_access (object). Then, the GC will be able to collect this nested object, as soon as it is not referenced from Eiffel any longer.

Note: Object must have been previously created with eif_adopt, eif_protect or eif_create.

eif_wean (object) returns an Eiffel reference, which corresponds to eif_access (object). After a call to eif_wean (object), eif_access (object) is NULL, which does not mean that the nested Eiffel object is Void, but that the indirection pointer does not reference it any longer. It is possible to reuse object later on.
Calling eif_wean (external_argument) where external_argument is an Eiffel object given by a C external can cause erratic behaviors. Indeed, external_argument is an indirection pointer, which is automatically deleted after the external call (not the nested Eiffel object), deleting it prematuraly can corrupt the indirection pointers stack.
See also eif_access.

Example: C external returning an Eiffel string.

In Eiffel:

foo : STRING is
    external
       "C | %"a file.h%""
    end

In C:

EIF_REFERENCE foo () {
EIF_REFERENCE str;
EIF_OBJECT i_str;
str = eif_string ("Hello
  world");
i_str = eif_protect(str);
/* Some operations on `i_str' */
return eif_wean (i_str);
  /* Returns direct reference to the Eiffel string.
* No need to keep an extra reference from the C. */
}

Getting the attribute from an Eiffel object: eif_attribute

# include "eif_cecil.h"

EIFFEL_TYPE eif_attribute (EIF_REFERENCE object, char *name, EIFFEL_TYPE, int *status)

Return the attribute of an Eiffel object.

The `eif_attribute' macro returns the attribute of object of name name, which is of type EIFFEL_TYPE.

EIFFEL_TYPE is the type of the Eiffel attribute. It can be: EIF_INTEGER, EIF_POINTER, EIF_CHARACTER, EIF_BOOLEAN, EIF_DOUBLE, EIF_REAL or EIF_REFERENCE.

If status is NULL then no status is set. Otherwise the status of the function is put in *status:
*status = EIF_NO_ATTRIBUTE => no attribute found.
*status = EIF_CECIL_OK => attribute found.
*status = EIF_CECIL_ERROR => an undefined error occurred, object may be invalid.

If the visible exception is enabled, then a visible exception is raised upon failure (EIF_NO_ATTRIBUTE, EIF_CECIL_ERROR).

RETURN VALUE:

    upon failure, it returns (EIFFEL_TYPE) 0, otherwise, the attribute is returned. If the return value is not a basic type, you must protect it with eif_protect

COMPATIBILITY:

    eif_attribute (object, name, type, NULL) is equivalent to eif_field (object, name, type)

Tips: You cannot access a constant attribute, or the result of a function (once or not) with eif_attribute. Use eif_procedure or eif_xx_function instead.

EIF_BOOLEAN attribute_exists (EIF_REFERENCE object, char *name) returns EIF_TRUE or EIF_FALSE depending if the attribute exists or not, is visible or not.

Getting the address of an Eiffel routine

#include "eif_cecil.h"

EIF_PROCEDURE eif_procedure (char *rout_name, EIF_TYPE_ID type_id)
EIF_REFERENCE_FUNCTION eif_reference_function (char *rout_name, EIF_TYPE_ID type_id)
EIF_INTEGER_FUNCTION eif_integer_function (char *rout_name, EIF_TYPE_ID type_id)
EIF_CHARACTER_FUNCTION eif_character_function (char *rout_name, EIF_TYPE_ID type_id)
EIF_REAL_FUNCTION eif_real_function (char *rout_name, EIF_TYPE_ID type_id)
EIF_DOUBLE_FUNCTION eif_double_function (char *rput_name, EIF_TYPE_ID type_id)
EIF_BIT_FUNCTION eif_bit_function (char *rout_name, EIF_TYPE_ID type_id)
EIF_BOOLEAN_FUNCTION eif_boolean_function (char *rout_name, EIF_TYPE_ID type_id)
EIF_POINTER_FUNCTION eif_pointer_function (char *rout_name, EIF_TYPE_ID type_id)

Return the address of the Eiffel routine by giving its name rout_name and the type id type_id of the class, in which it is declared. Returns a NULL pointer or raises a visible exception (if enabled) when there is no corresponding routine with name rout_name or the routine is not visible. The first argument of an Eiffel routine has to be the target of the Eiffel routine.

The Eiffel object returned by an Eiffel function must be protected afterwards with 'eif_protect' (this only applies for functions whose addresses are returned by `eif_reference_function', since the other function types returns basic types, which are not Eiffel objects).

Note: The address returned by these functions must be called between parenthesis.

Caution: Be sure that the Eiffel routine is not a C External. In this case, you should call directly the C external instead of its Eiffel wrapper.

Enabling/Disabling the visible exception

#include "eif_cecil.h"

void eif_enable_visible_exception ()
void eif_disable_visible_exception ()

Respectively, enable and disable the visible exception.
By default, the visible exception is disabled (since v4.5).

Creating an Eiffel string: eif_string

#include "eif_plug.h"

EIF_REFERENCE eif_string (char *string) /* Macro */

Return the direct reference to an Eiffel string by giving the corresponding C string . The result of eif_string does not reference the C string passed as argument: it copies it, before creating the Eiffel string.

Notes: The return value must be protected with eif_protect for later use.

The C string must be manually freed by the user, if it has been dynamically allocated.

COMPATIBILITY:

    eif_string ("ABC") is equivalent to RTMS ("ABC") and eif_make_string ("ABC", strlen ("ABC")).

Getting the return-type of an attribute: eif_attribute_type

#include "eif_cecil.h"

int eif_attribute_type (char *attr_name, EIF_TYPE_ID tid)

#define EIF_REFERENCE_TYPE 1
#define EIF_CHARACTER_TYPE 2
#define EIF_BOOLEAN_TYPE 3
#define EIF_INTEGER_TYPE 4
#define EIF_REAL_TYPE 5
#define EIF_DOUBLE_TYPE 6
#define EIF_EXPANDED_TYPE 7
#define EIF_BIT_TYPE 8
#define EIF_POINTER_TYPE 0
#define EIF_NO_TYPE (-1)

Return the type of the attribute described by its name attr_name and the type identifier tid of the class where it is defined. The return type is an int (see above for correspondances). In case of failure, EIF_NO_TYPE is returned - not such given attribute name, routine name instead of attribute name, or so on.

Example: Get the type of count from STRING

    int i;
i = eif_attribute_type ("count", eif_type_id
  ("STRING");
printf ("type is %d\n");    /*
  Should be EIF_INTEGER_TYPE since it returns an Eiffel Integer */

Tip: *(EIFFEL_TYPE *) eif_attribute_safe (EIF_REFERENCE object, char *name, int type_int, int *status) can be used for debugging or type checking. It returns the attribute reference of name name from the object object of type type_int. status contains the status of the function call: it can be EIF_CECIL_OK, EIF_CECIL_ERROR, EIF_NO_ATTRIBUTE or EIF_WRONG_TYPE (type_int does not match with real type of object).

Getting the class name corresponding to a type id: eif_name

#include "eif_cecil.h"

char *eif_name (EIF_TYPE_ID tid)

Return the corresponding name (C string) of the Eiffel class, given a type identifier type_id. If the type identifier is a generic type identifier, no generic parameter type is given. Return NULL if an invalid type identifier is given.

Example:

printf ("the class name with type id 1 is %s\n", eif_name (1); /* Should print "ANY" on most compiler versions */

COMPATIBILITY:

    eif_name is equivalent to eif_name_by_tid

Getting the type id of an Eiffel object: eif_type, eif_type_by_reference.

#include "eif_cecil.h"

EIF_TYPE_ID eif_type (EIF_OBJECT object)

EIF_TYPE_ID eif_type_by_reference (EIF_REFERENCE reference)

eif_type returns the type identifier, given an indirection pointer to an Eiffel object.

eif_type_by_reference returns the type identifier, given the direct reference to an Eiffel object reference.

COMPATIBILITY:

    eif_type is equivalent to eif_type_by_object. eif_type (object) is equivalent to eif_type_by_reference (eif_access (object)).

Converting a C array into an Eiffel array: eif_make_from_c.

eif_make_from_c(eif_array, c_array, int nelts, int type) /* Macro */ (since 4.5)

eif_array is an EIF_REFERENCE, c_array is a C array of type (type *), nelts is the number of elements in the array.


CECIL samples

CECIL examples

Before trying the examples, please take a moment and look at the description that will explain how to compile the CECIL samples.

Available samples include:

  • C to Eiffel
  • Eiffel to C
  • Basic CECIL sample
  • Threads


CECIL - C to Eiffel

array

This example shows how to create an Eiffel array from an existing C array.

After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix.

Launch the program and you will be prompted for 10 integers that will be inserted in a C array, it will then initialize the Eiffel array and calls display from the MY_ARRAY class.

A typical output will be:

$ ./cecil
Enter 10 integers:
Enter element 1: 1
Enter element 2: 2
Enter element 3: 3
Enter element 4: 4
Enter element 5: 5
Enter element 6: 6
Enter element 7: 7
Enter element 8: 8
Enter element 9: 9
Enter element 10: 10

Display an Eiffel Array:
@1 = 1
@2 = 2
@3 = 3
@4 = 4
@5 = 5
@6 = 6
@7 = 7
@8 = 8
@9 = 9
@10 = 10

string

This example shows how to create an Eiffel string from an existing C string.

After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix.

Launch the program and you will be prompted for a string, it will then initialize the Eiffel string and calls io.put_string from the STD_FILES class.

A typical output will be:

$ ./cecil
Enter a string to convert in Eiffel string:
Hello World!
Now printing the Eiffel string from Eiffel.

Hello World!


CECIL - Eiffel to C

array

This example shows how to create a C array from an existing Eiffel array.

After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix.

Launch the program and you will be prompted for 10 integers that will be inserted in an Eiffel array, it will then initialize the C array and display it.

A typical output will be:

$ ./cecil
This example create n array on the Eiffel side and print it on the C side
Enter 10 integers:
1
2
3
4
5
6
7
8
9
10

Displaying from C
@1 = 1
@2 = 2
@3 = 3
@4 = 4
@5 = 5
@6 = 6
@7 = 7
@8 = 8
@9 = 9
@10 = 10

object

This example shows the Eiffel memory management and all issues when passing an Eiffel object reference to C. In the example, you can edit the file `root_class.e' to modify the example:

--	give_to_c (o1)
    give_to_c_by_pointer ($o1) -- Choose the way you pass it

When you choose the firt possibility (commented by default), give_to_c will use the CECIL API eif_adopt to keep a reference on the Eiffel object.

When you choose the second possibility, give_to_c_by_pointer will use the CECIL API eif_protect to keep a reference on the Eiffel objet.

Until forget_from_c is called from the C side, the object o1 will not be collected since we have protected it through the call to give_to_c or give_to_c_by_pointer.

At the end after the object o1 is collected, we try to perform an operation on it which will fail with a call on void target exception.

A typical output will be:

$ cecil
Creating o1
Object string is o1
Give it to C
Losing reference to initial o1 from Eiffel
Collecting...
Display new o1:
Object string is o2
Display o1 given to C:
Object string is o1
Losing reference from C
Losing reference from Eiffel
Collecting...
An Eiffel object of type OBJECT is collected
Old o1 forgot from both C and Eiffel:
Raise a Void exception..

cecil: system execution failed.
Following is the set of recorded exceptions:

-------------------------------------------------------------------------------
Class / Object Routine Nature of exception Effect
-------------------------------------------------------------------------------
ROOT_CLASS make @26 display:
<30068030> Feature call on void target. Fail
-------------------------------------------------------------------------------
ROOT_CLASS make @26
<30068030> Routine failure. Fail
-------------------------------------------------------------------------------
ROOT_CLASS root's creation
<30068030> Routine failure. Exit
-------------------------------------------------------------------------------
An Eiffel object of type OBJECT is collected

string

This example shows how to create a C string from an existing Eiffel string.

After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix.

Launch the program and you will be prompted for a string from Eiffel and a C string will be created and display.

A typical output will be:

$ cecil
Enter a string to convert into a C string:
Hello World!

Here is the C string:
Hello World!


CECIL - Basic sample

cecil-test

After you have done the appropriate steps to compile the example, you will get a `cecil.exe' on windows, or `cecil' on Unix.

This example performs some basic tests of CECIL from C to Eiffel and Eiffel to C. You can:

  • choose to raise an exception when a routine is not visible
  • create an Eiffel string
  • choose to raise a precondition violation from C.

A typical output will be:

$ cecil
Do you want to enable the visible exception? (y-yes, n-no):n
Disable visible exception

====== In eiffel_call ======
        Eiffel type id = 9
        Eiffel procedure make 0x100546b4
        Eiffel object = 0x30068030
Testing linked_list...
12345
test_linked_list OK
Testing memory...
Give string length (enter a high number for raising an Eiffel exception)
234
Memory OK
Testing if string void ...
Enter a string: (press enter if you want to raise an Eiffel exception)
wefsd
wefsdTesting precondition...By default it is true

====== Done ======

====== In eiffel_call ======
        Eiffel type id = 9
        Eiffel procedure test_linked_list 0x10054ebc
        Eiffel object = 0x30068030
Testing linked_list...
12345
test_linked_list OK

====== Done ======

====== In eiffel_call_1_arg ======
        Eiffel type id = 9
        Eiffel procedure print 0x1004e0a8
        Eiffel object = 0x30068030
        Eiffel object = 0x30068030
Execute the Eiffel code `print (linked_list)' from the C side:
MAIN [0x30068030]
  linked_list: LINKED_LIST [0x30068C40]

====== Done ======

====== In cecil_test ======
        protected indirection of 30068c40 is 300311bc
        Eiffel type id of STRING = 198
        Eiffel type id of LINKED_LIST [STRING] = 224
        Linked List forth: 10222fbc
        Linked list object = 0x30068c40
Do you want to test the visibility of an Eiffel routine? (y-yes, n-no):
n
Do you want raise a precondition violation? (y-yes, n-no):
n

====== Done ======


CECIL - Threads

bank_account

After you have done the appropriate steps to compile the example, you will get a `bank_account.exe' on windows, or `bank_account' on Unix.

This program launches two types of threads:

  • the spenders withdraw some money from a shared bank acccount
  • the savers make some deposits on it.

The Eiffel Threads are launched from C. The synchronization is done from Eiffel. The shared bank account is a C structure, and is updated by the Eiffel Threads using some C externals.

In main.c:
LISTSZ size of bank account history.
DEPOSITORS numbers of savers.
WITHDRAWERS numbers of spenders.

A typical output will be:

$ bank_account
**** Bank account report:
Thread 0x30036350       DEPOSIT 161
Thread 0x30036350       DEPOSIT 614
Thread 0x30036350       DEPOSIT 626
Thread 0x30036350       DEPOSIT 880
Thread 0x30036350       DEPOSIT 601
Thread 0x30036350       DEPOSIT 480
Thread 0x30036350       DEPOSIT 177
Thread 0x30036350       DEPOSIT 451
Thread 0x30036350       DEPOSIT 96
Thread 0x30036350       DEPOSIT 219
*** BALANCE: 5305
Do you want to continue? (y/n)
y
**** Bank account report:
Thread 0x3003fcf0       DEPOSIT 161
Thread 0x3004f088       DEPOSIT 161
Thread 0x300567a0       WITHDRAWAL      161
Thread 0x3005e1f0       WITHDRAWAL      161
Thread 0x30036350       DEPOSIT 531
Thread 0x3003fcf0       DEPOSIT 614
Thread 0x3004f088       DEPOSIT 614
Thread 0x300567a0       WITHDRAWAL      614
Thread 0x30036350       DEPOSIT 409
Thread 0x3003fcf0       DEPOSIT 626
*** BALANCE: 7485
Do you want to continue? (y/n)
y
**** Bank account report:
Thread 0x3004f088       DEPOSIT 626
Thread 0x30036350       DEPOSIT 799
Thread 0x300567a0       WITHDRAWAL      626
Thread 0x3005e1f0       WITHDRAWAL      614
Thread 0x3003fcf0       DEPOSIT 880
Thread 0x30036350       DEPOSIT 860
Thread 0x3004f088       DEPOSIT 880
Thread 0x300567a0       WITHDRAWAL      880
Thread 0x30036350       DEPOSIT 307
Thread 0x3004f088       DEPOSIT 601
*** BALANCE: 10318


CECIL - How to compile the samples?

Compiling the samples

Compiling for Windows

Depending on your C compiler different steps have to be done, but do not forget to do the following before starting the C compiler specific part in a DOS console:

set ISE_EIFFEL=XXX

where XXX is the ISE EiffelStudio installation directory.

With Borland C++:

By default, Borland C++ is not in your path, so you will have to first set your path correctly by typing:

set PATH=%ISE_EIFFEL%\BCC55\bin;%PATH%

If the file `Makefile.win' is present, then you can launch the compilation with:

make -f Makefile.win

Otherwise launch the compilation with:

make -f Makefile.bcb

With Microsoft Visual C++:

By default, the command line tools of Visual C++ should be available from the command line.

If the file `Makefile.win' is present, then you can launch the compilation with:

nmake -f Makefile.win

Otherwise launch the compilation with:

nmake -f Makefile.msc

Compiling for UNIX

Then, make sure that your path to the ISE EiffelStudio executables are properly configured before launching the command below.

To compile and execute from scratch type:

finish_freezing -library


EiffelCOM

The Component Object Model

  • Introduction
  • Generalities
  • Interfaces
  • Coclasses
  • Component Location
  • Access Type
  • Deeper into COM

See Also: EiffelCOM wizard, EiffelCOM library


Introduction

This chapter covers enough information on COM for Eiffel developers to use the EiffelCOM wizard in an effective way. It does not cover all of COM since it would require an entire book but presents the main concepts needed to understand how to build an EiffelCOM system.

Briefly said, the Component Object Model is a Microsoft binary standard that establishes how two binary units can access each other at runtime. Such binary units can run in the same process, in different processes on the same machine, or even on different machines. Components can be implemented in any language as long as the compiler produces COM standard compliant binaries.

The advantages of such an approach include an increased reusability (binary reuse), a better version management (COM standard implies that new component versions are compatible with the older ones) and a built-in runtime environment. The binary reuse aspect of COM added with the source reuse ability of Eiffel offer the developer an ideal platform to increase considerably their productivity.

See Also: EiffelCOM wizard, EiffelCOM library, Generalities, COM Interfaces, Coclasses, Component Location, Access Type, Deeper into COM


Generalities

COM is a binary standard that describes how the component can communicate with the outer-world. The component communicates through well defined interfaces. Each interface is a specification of a group of properties and methods, and it does not contain the implementation of these routines but only their specification (signatures). The actual implementation lies in the coclass. There can be different implementations of a same interface in different coclasses. Finally, each coclass can be instantiated using a class object or class factory. These three notions will be discussed further in the forthcoming paragraphs.

See Also: EiffelCOM wizard, EiffelCOM library, Introduction, COM Interfaces, Coclasses, Component Location, Access Type, Deeper into COM


COM Interfaces

Interfaces

Interfaces are at the heart of any COM component. Interfaces are described in the definition file of a component. They consist of a group of semantically related functions that can be accessed by the clients of the component. Although they are a specification, they also have a physical representation. A client can request a pointer on an interface and access the component functions through that pointer. Interfaces are the only possible way to access functions from a component. They enforce information hiding by providing only the public functions to the client.

Interfaces also define the type of a component. Each interface corresponds to a specific view of the component. It can be compared to polymorphism in the Object Oriented world. Whenever an interface from a component is requested, only the functions defined on that interface are accessible as if the component was polymorphically cast into an object of the type of that interface.

The COM specification requires that any interface provides access to all interfaces on the same component. All the interface should include a specific function called QueryInterface that will provide a pointer on any other interface of the component. Interfaces are identified with a globally unique identifier (GUID) guaranteed to be unique in time and space. Since this function has to be on every interface, it has been abstracted into a specific interface called IUnknown which all other interfaces must inherit from.

The two other functions exposed by IUnknown are AddRef and Release. These functions should be called respectively when a client gets a reference on an interface or when it discards that reference. These two functions define the lifetime of the component: each interface keeps track of clients keeping a reference on them and when no clients have references anymore, the component can be unloaded from memory. You might start to worry thinking that this business of reference counting will imply lots of headaches, memory leaks, etc. and you would be right should you choose a low-level language to implement your components. Fortunately, you will never have to implement or use these functions in Eiffel: all the processing related to IUnknown is provided by the EiffelCOM runtime. Calls to QueryInterface are done "behind the scene" and only when needed. The lifetime of the component is also taken care of by the EiffelCOM runtime.

See Also: EiffelCOM wizard, EiffelCOM library, Introduction, Generalities, Coclasses, Component Location, Access Type, Deeper into COM


Coclass

We have seen that interfaces can be perceived as views of a component. This conceptual representation actually maps the implementation of an EiffelCOM component since the coclass inherits from the interfaces and implements their deferred features. Indeed, interfaces are deferred classes with all features accessible from outside deferred. The coclass is an Eiffel class that inherits from these interfaces and implements all the features. This design is not specific to Eiffel though and can be found in other languages as well. The coclass defines the behavior of the interface functions.

Class Object

We have seen that interfaces are accessed through interface pointers. But how does a client get hold on one of these?

The answer lies in the class object. The name of this module should really be coclass factory since its goal is to spawn instances of the coclass on request. Class objects are accessed by COM whenever a client request a new instance of the associated component. COM loads the class object and asks it to provide the interface pointer requested by the client.

The way a class object is loaded in memory (this process is called activation) depends on the location of the component (See Location. for a description of the possible locations of a component). If the component is an in-process server then the class object is called directly through the functions exported from the DLL. If the component is an out-of-process server then it provides COM with a pointer to the class object. In both cases, once the component is loaded, COM has access to the class object and can call it would a client request a new instance of a component.

Component Creation

The code for the class object is generated by the EiffelCOM wizard so that Eiffel programmers will not have to worry about it.

See Also: EiffelCOM wizard, EiffelCOM library, Introduction, Generalities, COM Interfaces, Component Location, Access Type, Deeper into COM


The Component Location

Types of Components

ActiveX, DirectX, OCX, COM+, ADO+, ASP etc. who never heard of these technologies? They all represent yet another use of the COM standard. This paragraph will focus on categorizing COM components according to their own properties as well as the context in which they are used. The categorization will define how the EiffelCOM wizard should be used to wrap or create a component.
The first criteria that defines the type of component is from where it will be accessed: will the component be loaded in the client process or will the component be a remote server for a distributed application? In the former case, the component is compiled as a Dynamic Link Libraries (DLL) while in the latter case it is a standard executable.

In-process Components

Typical instances of DLL components are found in technologies such as OCX, ActiveX, or ASP. These are small, downloadable binaries that will be loaded and executed in a container. The container acts as a client of the component. The EiffelCOM wizard provides the ability to wrap such components by providing access to its interface to any Eiffel container. It is also possible to create a new In-process component in Eiffel.

One main difference with out-of-process components (other than the nature of the module, DLL versus executable) is the way in-process components are activated. In the case of out-of-process components, the component will specify COM when it is ready to receive calls from client. In the case of an in-process server the call is coming directly from COM: COM first loads the DLL into the client process and then calls the exported function DllGetClassObject to access the component class object. The other three exported functions of an in-process component are DllRegister to register the component in the Windows registry, DllUnregister to unregister the component from the registry and finally DllCanUnloadNow which gets called by COM whenever it tries to unload the component from memory. These four functions must be accessible from outside the DLL for the in-process component to work properly.

Out-of-process Components

These components are standard executable acting as servers that can be accessed locally or over a network. Typically used in a three tier client server architecture, the major difference with in-process servers (other than the module type - executable instead of DLL) is their lifetime. In-process components are typically loaded to achieve a specific task and unloaded just after while out-of-process components are servers supposed to run continuously. The EiffelCOM wizard allows to build clients for such servers in Eiffel. It also provides the ability to create such servers.

See Also: EiffelCOM wizard, EiffelCOM library, Introduction, Generalities, COM Interfaces, Coclasses, Access Type, Deeper into COM


Access Type

Regardless of its location, a COM components can be accessed either directly through interface's virtual table or through OLE Automation.

Automation

Accessing a COM component through Automation means using a well known interface to access to a group of methods and properties. This interface is called IDispatch, and it includes the method invoke that allows to call a method, set or get a property on the Automation server. One advantage of that approach is that the interface has a known virtual table layout. As a result, Windows can include a built-in marshaler for that interface (See Marshaling. for information on what a marshaler is). The supported types (known as Automation types) and their Eiffel equivalents are listed in the following table:
    COM Type | Eiffel equivalent | Description
VARIANT_BOOL | BOOLEAN | Standard boolean
unsigned char | CHARACTER | Standard character
double | DOUBLE | Standard double
float | REAL | 2 bytes real
int | INTEGER | Standard integer
long | INTEGER | Standard integer
short | INTEGER | 2 bytes integer
BSTR | STRING | Standard string
CURRENCY | ECOM_CURRENCY | Currency value
DATE | DATE_TIME | Standard date
SCODE | INTEGER | Return status
Interface IDispatch * | ECOM_INTERFACE | Automation interface
Interface IUnknown * | ECOM_INTERFACE | Generic interface
dispinterface | ECOM_INTERFACE | Automation interface
Coclass Typename | TYPE_NAME | Component main class
SAFEARRAY(TypeName) | ECOM_ARRAY [TypeName] | Array
TypeName* | CELL [TypeName] | Pointer to type
VARIANT | ECOM_VARIANT | Variant value
enum | INTEGER | Enumeration
Decimal | ECOM_DECIMAL | Decimal value
The other advantage is a more dynamic discovery of the methods and properties of a component at runtime. Indeed the IDispatch interface also includes methods to check whether a method or property is available and, in that case, get its identifier. This process is called late binding and allows component to discover at runtime what are other components functionality.

This approach has also a lot of drawbacks: first, late binding is not an efficient way of calling a function on an interface since its identifier must first be requested and then the function called. That's two round trips which can be expensive in a distributed environment. Second, since the marshaler is built-in, it has to know in advance all the possible types that a function can accept to be able to marshal the corresponding data. There are consequently a limitation on the number of types that one can use in signatures of functions on an Automation compatible interface. The set of available types is called Variant and cover most of the standard types. It does not allow however the passing of complex user defined data types. For these reasons Automation is mostly used in scripting environments (where speed is not an important factor) to accomplish simple tasks.

Direct Access

Direct interface access is the preferred way to access remote servers where speed becomes a concern and data types are specific to the application. The first interface pointer on the component is obtained through the class object (see Class Object. ). Other interfaces on the component are obtained by calling the QueryInterface function.

As information on any interface cannot be accessed dynamically, the description of the interfaces must be provided to tools that need to handle the components such as the EiffelCOM wizard. The official way of describing components and interfaces is through IDL. Once an IDL file has been written to describe a component it can be compiled with MIDL to generate both a type library and the code for the marshaller specific to that interface.

EiffelCOM

The idea in EiffelCOM is the way a component is accessed is implementation detail that the user should not have to deal with. Of course he should be able to choose what kind of access he wants to use but this choice should have no impact on the design of the Eiffel system itself. For that reason, the Eiffel code generated by the wizard follows the same architecture independently of the choice made for interface access and marshalling. The difference lies in the runtime where the actual calls to the components are implemented.

See Also: EiffelCOM wizard, EiffelCOM library, Introduction, Generalities, COM Interfaces, Coclasses, Component Location, Deeper into COM


Deeper into COM

The next paragraph gives some details on the COM internals. The understanding of these details are not required to use the EiffelCOM wizard but might help making better decisions when designing new EiffelCOM components.

Apartments

The first interesting subject that requires more in-depth cover is the execution context of a component. Components can be run in the same process as the client but can also run in a separate process even on a different machine.

This superficial description only take into accounts processes. What happens if a component uses multithreading to achieve it tasks? In a case of a remote server, this scenario does not seem too esoteric. The problem is that a server does not (and should not) know in advance what its clients will be. It cannot assume that the client will be able to take advantage of its multithreading capabilities. Conversely a multithreaded client should not rely on the server ability to handle concurrent access.

The solution chosen in the COM specification is to define an additional execution context called an apartment. When COM loads a component it creates the apartment in which the component will run. Multiple instances of a multithreaded component will leave together in the same apartment since asynchronous calls will be handled correctly and there is no need to add any synchronization layer. On the other hand, singlethreaded component will be alone in their apartment and any concurrent calls coming from clients will be first synchronized before entering the apartment. These two behaviors define two different kinds of apartments: Multi Threaded Apartments (MTA) and Single Threaded Apartments (STA).

Apartments

Apartments solve the problem of concurrency by removing the necessity of knowing the multithreaded capability of a component and its clients. Multithreaded clients can always make asynchronous calls and depending on whether the component handles concurrent access or not, they will be forwarded or first synchronized. There can be multiple instances of STA running in one process while there will be at most one MTA.

Marshaling

At this point you might wonder how calls can "cross" the apartments boundaries. Components from a STA can make calls to components running in a MTA and vice versa. These apartments might be running in different processes or even on different machines. The approach chose in the COM specification is using the proxy and stub patterns.

The idea is to trick the client of an interface by providing an interface proxy in its apartment. The proxy include exactly the same function as the interface itself but their implementation will just forward the call to the actual interface. The client has no idea whether the entity it is dealing with is the actual interface or just a proxy. One of the main interest of that approach is that the client implementation is independent from the location of the component.

Last explanation is not totally accurate: the call will not be forwarded to the actual interface but to its stub. The stub is the counterpart of the proxy, it represents the client for the interface. The interface doesn't know either whether it is communicating with the actual client or a stub. Although it is not totally true that the component implementation is independent from the location of the client, the stub pattern still helps keeping code identical for the implementation of the interface themselves. The implementation of a component will still be different whether it is an in-process or out-of-process component since it will have to be a DLL in one case and a executable in the other. The design of the interfaces might also differ since out-of-process servers will tend to avoid too many round trips.

Cross Apartment Calls

There is one proxy/stub pair per interface. The proxy or the stub is loaded dynamically only when needed. This proxy/stub pair constitute the marshaller. The reason for having a single name for two different things come from how MIDL generates its code. MIDL will produce files for one DLL in which both the proxy and the stub will be included. This DLL is the marshaller.

Summary

This brief introduction to the Component Object Model should be enough to get started with the EiffelCOM wizard. It specifies the main characteristics that define the type of a component and that need to be given to the wizard along with the definition file.

See Also: EiffelCOM wizard, EiffelCOM library, Introduction, Generalities, COM Interfaces, Coclasses, Component Location, Access Type


.NET

  • Installation instructions
  • Building a .NET application
  • Eiffel for .NET language description
  • Samples


.NET Installation instructions

Installation instructions

Before installing the .NET components for Eiffel for .NET you need to install either the .NET Framework, the .NET Framework SDK or Visual Studio .NET. If you do not have any of those installed, the installation program will prompt you with a warning because no .NET features support will be installed.


Building a .NET application

Eiffel for .NET has some specific functionality meant to leverage necessary aspects of the .NET Framework.

For that reason, the project settings for Eiffel for .NET introduces new options in the .NET tab of the project settings. These options include:

  • Specifying whether the generated assembly should be an EXE or a DLL.
  • Choosing between generating verifiable or non verifiable IL code. Non verifiable IL code executes faster but requires high trust settings.

The Eiffel for .NET compiler generates a single assembly whose name is the name of the system as given in the project settings.


The Eiffel for .NET Language

  • Introduction
  • Using Eiffel on .NET
  • Summary of the Eiffel Language
  • Difference between Eiffel and Eiffel for .NET
  • Known issues with Eiffel for .NET compiler


Introduction

Introduction to Eiffel for .NET

This section focuses on defining Eiffel for .NET. The key requirement for Eiffel for .NET is the exclusive use of the common language runtime with a minimum Eiffel-specific runtime. The second requirement is to generate IL code that is CLS compliant, meaning that other CLS compliant languages/compilers/tools will be able to reuse .NET components written in Eiffel for .NET. The last requirement is to generate verifiable IL code.

Because not all Eiffel functionalities are present in .NET, the task of the Eiffel compiler is made more complicated since it has to emulate those mechanisms instead of reusing what .NET provides. For example the common language runtime of .NET does not support:

  • multiple inheritance
  • genericity
  • covariance
  • agents

We will see:

  • what is Eiffel on .NET
  • which Eiffel mechanisms have been implemented and which haven't.


Conventions

  • Introduction
  • Terminology
  • Conventions and Name Handling
  • Type Organization
  • Constructors and Creation Procedures
  • Similar Types Occurring in Both Libraries
  • Eiffel Language Reserved Keywords


Eiffel for .NET Conventions

In this section, you'll find information about how the conventions that are normally used in Eiffel programming are affected by working in the presence of .NET.

Also, you'll find out how .NET types sometimes look a little different in the presence of Eiffel.

Because there are differences in the underlying object models upon which .NET and Eiffel have been designed, before .NET types can be made available to Eiffel developers, the assemblies in which they reside must be processed by a utility called the Eiffel Metadata Consumer. Fortunately, this all happens behind the scenes for you. You need only be aware that when you are looking at .NET types from within ENViSioN, you're seeing them through Eiffel-tinted lenses.

This is really the same thing that happens with other .NET languages with Visual Studio .NET support. For example, if you look at a constructor in a .NET type using the "ildasm" utility, the constructor will be named .ctor. But, if you're in C# and look at the same constructor in the Visual Studio .NET Object Browser, the constructor will have the same name as the type ... it's a C# convention. Likewise, the same constructor viewed in Visual Basic .NET will have the name New ... that's the Visual Basic .NET convention. So, when you use ENViSioN, you see things as presented using Eiffel Conventions.

Consider what happens when you look at .NET types using ENViSioN. When you look, for example at the type System.EventArgs, you will see it represented as an Eiffel class called EVENT_ARGS. The members of the .NET type will show up as features of the Eiffel class. Of course, you can also see the corresponding .NET names as they exist in the assembly metadata.

The documents in this section tell you what you need to know in order to use .NET types in Eiffel, and vice versa.

Eiffel for .NET Conventions Documentation

  • Terminology
  • Conventions and Name Handling
  • Type Organization
  • Constructors and Creation Procedures
  • Similar Types Occurring in Both Libraries
  • Eiffel Language Reserved Keywords


Eiffel for .NET Terminology

Eiffel Terminology

Eiffel Terminology Defined for C# and VB.NET Programmers

Eiffel programmers feel that it is important to have a set of precise terms with which to communicate about our method of software development. Like everything else in Eiffel, the use of certain terms is not accidental. They were chosen carefully to impart particular meaning. Many of the Terms that Eiffel programmers use are different from those used by developers using other object-oriented languages. But that does not mean that their meanings will be foreign to you. If you have some understanding of object-oriented technology, you will find that in many cases the Eiffel terms describe concepts with which you were already familiar, just under different names, and possibly with slightly different meanings.

The intention of this glossary is to give you a list of these terms with extended definitions that will relate the Eiffel terms to language with which you may be more familiar. Also, you will find an occasional term which comes from other programming cultures but is not used in Eiffel.

Term | Definition
Ancestors | The set of Classes from which a particular Class Inherits, including the Class itself. Somewhat analogous to Bases and Interfaces in C# and VB.NET (see Proper Ancestors).
Argument | An object which is passed to a routine. Called a Parameter in C# and VB.NET.
Assertion | A declaritive expression that evaluates to true or false. Assertions in Eiffel are of different types and are used primarily for expressing software specification to potential Reuse Consumers and ensuring that executing software complies with specification. Any violation of an assertion causes an exception, and is generally indicative of a defect in the software system.
Attribute | A Feature which represents storage used in every instance of a class. Used like a Field member in C#.
Class | Software text which is the static definition of a Type (or the pattern for a Type in the case of a Generic Class). Used in very nearly the same way as in C#. In C# Classes are used for reference types and Structures for value types. In Eiffel, Classes are used for both, but see Expanded Class.
Class Invariant | An Assertion on a Class which defines the valid or stable state for objects which are instances of the Class. All instances of the Class must comply with the Class Invariant at any time that they are accessible to Clients.
Client | A Class whose role is that of Client in a Client/Supplier Relationship with another Class.
Client/Supplier Relationship | One of the two Relationships that can exist between Classes. Client/Supplier is characterized by a situation in which one Class, called the Client, has or uses, instances of the other Class, called the Supplier. For example, if class "X" declares an entity "y" of type STRING, then Class X becomes a Client to Class STRING as a result. At the same time, Class STRING becomes a Supplier to class X.
Cluster | A group of classes (or recursively, clusters) which share some criteria which justifies their being grouped together. Classes are usually clustered together because they model similar entities or have similar functionality. For example, in the Eiffel Base Library, there is a cluster called "structures" which contains clusters for data structures. One cluster is "list" which contains classes like LINKED_LIST and TWO_WAY_LIST. Another "structures" cluster is "dispensers" which contains classes like "ARRAYED_STACK" and "PRIORITY_QUEUE". When .NET assemblies are made available to Eiffel programmers, each assembly is viewed as a cluster.
Command | A Class Feature which can change the state of the instance to which it is applied, and does not return a result. It is the Reuse Consumer's view of a Procedure.
Contract | Like a contract between human parties, a software Contract is a formal agreement between software components, Classes in the case of Eiffel. The contract is written in the Assertions of a Supplier Class and specifies in precise terms those conditions with which potential Clients may interact with the Supplier. The contract for a particular Class is composed of the contracts for each Exported Routine of the Class as well as the Class Invariant.
Creation Procedure | A Procedure which can be used to initialize and instance of a Class. Similar to a Constructor in C# or VB.NET, but slightly different. A Creation Procedure can be applied when an object is being created, but can also be applied later to reinitialize an existing object (such is not the case with Constructors). Also, Creation Procedures are responsible for ensuring that newly created objects comply with their Class Invariants.
Deferred Class | A class which has at least one Deferred Feature. The term "Deferred" is used in the Eiffel culture like the term "Abstract" in .NET. Like an abstract class in C# or VB.NET, it is not possible to make direct runtime instances of a Deferred Class.
Deferred Feature | A Class Feature which has not implementation. Like a virtual method in C#. Can apply to Commands or Queries.
Descendants | The set of all Classes which Inherit from a particular Class, including the Class itself. Somewhat analogous to subclasses in C# and VB.NET (see Proper Descendants).
Design by Contract | A method of developing software in which a System is composed of a set of interacting Classes which cooperate based upon precisely defined Contracts.
Direct Instance | A runtime Object of some type, based directly on the definition from a specific Effective Class. See Instance for more information. Usually used in conjunction with the class name, e.g. "an instance of class POLYGON".
Effective Class | A Class which has no Deferred Features. Only if a Class is Effective can it have direct runtime instances. Effective classes are called Concrete Classes in some programming cultures.
Eiffel Metadata Consumer | Applicable to Eiffel for .NET only, this is a mechanism that works behind the scenes to make Types from .NET assemblies available to Eiffel programmers. The Metadata Consumer reconciles the differences between the naming conventions of Eiffel and .NET by providing an Eiffel compliant view of the Types in .NET assemblies.
Expanded Class | Like a value type in C#, but with some restrictions. .NET value types are viewed to Eiffel programmers as Expanded Classes. For reference types, an object field holds a reference to a runtime object (or is Void). For value types, the object field holds the fields of the runtime object. A Type based on an Expanded Class is an Expanded Type.
Exported Feature | A Feature which is available to Client Classes. Analogous to "public" in C# and VB.NET. However, Exporting in Eiffel has fine granularity. It is possible to make certain Features available to Clients of all types or only to Clients which conform to certain named Classes (vs Public, Protected, Private)
Feature | Any of a Class's Attributes or Routines. Used similarly to the term Member as in C#. In Eiffel class features can be only Attributes or Routines.
Feature Application | The process of using the Class Features on instances of the Class. The model for Feature Application is "x.f(a,...)" where "x" is an entity which will be attached to some object at runtime, "f" is some Feature of the Class on which x is based, and "a,..." is an optional list of arguments which may be appropriate for some Routines. Feature "f" is "applied" to the object attached to "x". Feature Application may involve calling Routines, or may only involve returning the value of an Attribute from memory. Feature application is sometimes called "feature call".
Function | A Routine that returns a result. In C# function results can be typed as "void", meaning that there is no result returned. Eiffel functions cannot be typed "void" (see Procedure). All Functions must specify a result type. Of course, if the result type is a reference type, there could be cases in which the reference resulting from some specific call might be Void.
Generic Class | A Class which is written using parameters to represent other Classes or Types to enhance its reusability. For example, the Class LINKED_LIST [G] is a generic class in which "G" represents some other Class. So, LINKED_LIST is written independent of the items an instance of the list will hold. We cannot declare a LINKED_LIST without specifiying a Class to substitute for "G". If we want a list of cats we can declare one by using the Type: LINKED_LIST [CAT]. Generic Classes are not currently implemented in .NET, so there's no corresponding concept in C#.
Inheritance | One of the two Relationships that can exist between Classes. If Class B inherits from Class A, then every feature in Class A is potentially available to instances of Class B. Also, when ever an instance of Class A is required, an instance of Class B will suffice. Inheritance is used in Eiffel much the same as in C#. The Eiffel model allows full, controlled multiple inheritance, though. Eiffel Classes may inherit from multiple Concrete Classes and name clashes are handled through a process called Feature Adaptation.
Heir | The adjacent Proper Descendants of a Class. If class C inherits from class B and class B inherits from class A, then class A's Proper Descendants include B and C, but A's Heirs only include B.
Instance | A runtime Object of some type, based on the definition from a Class. Usually used in conjunction with the class name, e.g. "an instance of class POLYGON". In contrast with Direct Instance, an Instance of class POLYGON is a Direct Instance of POLYGON or any Proper Descendant of POLYGON such, perhaps, as RECTANGLE. So it its possible to have Objects which are Instances of Deferred Classes, but it is impossible to have Objects which are Direct Instances of Deferred Classes.
Interface | Not supported as such in Eiffel. Used in C# and VB.NET, Interfaces provide sets of specific Class Features which must be effected by any Concrete Class that "implements" the Interface. There is no concept of Interface in Eiffel that is separate from the concept of Class. So, Interfaces from .NET appear to Eiffel programmers to be completely Deferred (abstract) Classes.
Manifest String | A quoted string used in source code, for example the "Hello World!" in: my_string := "Hello World!" This is often called a "literal" string in other languages. In Eiffel, the quoted string "Hello World!" above is, by virtue of its presence, an instance of the Eiffel STRING class. In Eiffel there are manifest constants of other types as well, like numbers coded explicitly in software text, and the keywords True and False as the manifest booleans.
Module | A syntactical grouping of software text. Source code is divided into Modules in order to help organize it in some meaningful way or to achieve some goal.
Object | An instance of a Class during system execution. As such, Objects only exist at runtime.
Overloading | Not supported in Eiffel. Overloading is the ability to have more than one Feature with the same name, varying only by the Types of its Arguments. Overloading is supported by the underlying object model in .NET. As a result many classes in .NET assemblies have overloaded methods. The Eiffel Metadata Consumer disambiguates the overloaded names so that by the time you see them in the Eiffel context they appear no longer to be overloaded.
Parent | The adjacent Proper Ancestors of a Class. If class C inherits from class B and class B inherits from class A, then class C's Proper Ancestors include A and B, but C's Parents only include B.
Postcondition | An assertion coded on a Routine which defines the conditions will be true upon successful completion of the Routine. It is the responsibility of the Routine to ensure that the Postcondition holds after the Routine executes.
Precondition | An assertion coded on a Routine which defines the conditions under which the Routine can complete successfully. It is the responsibility of the Client to ensure that the Precondition holds before attempting to call the Routine.
Procedure | A Routine that does not return a result. Much like a "void" function in C#.
Proper Ancestors | The set of all Classes from which a particular Class Inherits, excluding the Class itself.
Proper Descendants | The set of all Classes which Inherit from a particular Class, excluding the Class itself.
Query | A Class Feature which returns information from the instance to which it is applied. Queries are the Reuse Consumer's view of Attributes and Functions.
Reference Type | A type whose instances are accessed via a reference. For reference types, an object field holds a reference to a runtime object (or is Void). This is in contrast to value types, in which case, the object field holds the fields of the runtime object. In Eiffel, reference types are based on reference classes, i.e., any class which is not an Expanded Class.
Relationship | An association between two classes. There are only two types of Relationships that can exist between classes: Client/Supplier and Inheritance.
Reuse Consumer | The role a software engineer assumes when in the process of making use of Classes or Types already in existence. As a reuse consumer, the engineer is interested primarily in the specification of those Classes or Types being used, rather than their implementation.
Reuse Producer | The role a software engineer assumes when in the process or creating a new Class. In this role the engineer attempts to produce a product which will be reusable by him or herself and other engineers in the future. In the Eiffel culture, whenever a software engineer creates a class, it is as a Reuse Producer, and with the thought that each new class has the potential to become reusable.
Root Class | For any System, the Class which will be instantiated to start the system. Specified by project settings.
Root Procedure | A Creation Procedure of the Root Class of a System which will be applied to an initial instance of the Root Class at System startup. Similar to Main() in C# and VB.NET, but with the important difference that the fact that a particular Creation Procedure is the Root Procedure for a System is not define in the Class itself as with Main(). Rather, it is specified outside the Class in project settings. This helps Reuse Producers keep Classes more autonomous and therefore potentially more reusable.
Routine | A computational Class Feature which is either a Function or Procedure. Routines are the executable parts of a Class. Routines are similar to Methods in C#.
Software Specification | A statement of how a software element is to be used and what it will do when executed. Ideally, this is stated in terms that do not betray how the software does what it does. In Eiffel, specification is included in the code, rather than a separate document. For a routine, it consists of its call signature and its contract. For a class, it consists of the signatures and contracts for all public features.
Supplier | A Class whose role is that of Supplier in a Client/Supplier Relationship with another Class.
System | A set of Classes related by the two Relationships which can be compiled to produce an executable.
Type | The description of a set of Objects equipped with certain Features.


Eiffel Class and Feature Names

Certain naming conventions are respected by Eiffel programmers. Although Eiffel is not case-sensitive, convention dictates the use of upper and lower case in particular situations. When you program in ENViSioN!, you create new Eiffel classes, but you also use types from .NET assemblies. These .NET types are presented to you in a view that is consistent with Eiffel conventions.

Eiffel Class Names

Convention dictates that Eiffel class names are always all upper case characters with words separated by the underscore ("_") character. Eiffel classes are not quailified by "namespace" as in some other languages. This means that Eiffel class names must be unique with in a system. It also means that any types from existing .NET assemblies will have their names mapped to conventional Eiffel class names in order to be used by Eiffel classes in ENViSioN!

Here are some class names and their descriptions from the Eiffel Base Library. These class names comply with the Eiffel class naming convention.

STRING

Sequences of characters, accessible through integer indices in a contiguous range.

RANDOM

Pseudo-random number sequence, linear congruential method.

ARRAYED_LIST

Lists implemented by resizable arrays.

LINKED_QUEUE

Unbounded queues implemented as linked lists.

Now here are some type names from the .NET mscorlib as they appear as conventional Eiffel class names (i.e., in the form in which they become available to Eiffel for .NET programmers), followed by their full .NET type and their Summary from the .NET library. names.

SYSTEM_STRING

System.String

Represents an immutable series of characters.

SYSTEM_RANDOM

System.Random

Represents a pseudo-random number generator, a device that produces a sequence of numbers that meet certain statistical requirements for randomness.

ARRAY_LIST

System.Collections.ArrayList

Implements the System.Collections.IListinterface using an array whose size is dynamically increased as required.

SYSTEM_QUEUE

System.Collections.Queue

Represents a first-in, first-out collection of objects.

In summary, Eiffel class names and type names from .NET assemblies made available to Eiffel programmers will be all upper case, with words separated by the underscore character.

Eiffel Names for .NET Types

How Eiffel compliant names are derived from .NET type names is fairly simple in most cases. The "simple" class name, that is, the word following the rightmost dot in the full class name, is converted to an Eiffel compliant name by making it upper case and separating in embedded words by underscore. In the example above, System.Collection.ArrayList becomes ARRAY_LIST.

The other cases in the example are not quite so simple. If the basic derivation produces a name which conflicts with a class name in the Eiffel Base Library, then it will be disambiguated. The simple derivation of System.String would be STRING, but this would conflict with Eiffel's STRING class, so System.String becomes available to Eiffel for .NET programmers as SYSTEM_STRING.

Sometimes it is better to disambiguate an entire assembly rather than handling individual exceptions to the simple derivation. This is done by specifying a common prefix for all types in the assembly. For example, ENViSioN! uses a prefix of "DATA_" for all classes in the .NET assembly System.Data. As a result, the type System.Data.Constraint is available in Eiffel as class DATA_CONSTRAINT.

You'll see a little more about namespaces, assemblies, and Eiffel clusters in Type Organization.

Similar Types from Both Libraries

You may have noticed a similarity in the names and descriptions from the Eiffel Base Library and those from the .NET "mscorlib" library. This is not by accident. The Eiffel class STRING is a different class from the .NET type System.String, which Eiffel programmers see represented as Eiffel class SYSTEM_STRING. There is more on this subject in Similar Types Occurring in Both Libraries.

Eiffel Feature Names

By convention, feature names in Eiffel use all lower case characters, and like class names, words are separated by underscore. Also as with class names, the names of members from .NET assemblies will be represented in a form that complies with the Eiffel convention.

Let's look at some simple examples. First some feature names from the Eiffel Base Library.

to_upper

From class STRING: Converts to upper case.

item_double

From class RANDOM: The current random number as a double between 0 and 1

Now check out these member names from the .NET "mscorlib" type library. These have been made available to Eiffel for .NET programmers in the Eiffel convention. Following the Eiffel name, you see their .NET member name and type name.

to_upper

Member ToUpper from type System.String

Returns a new System.String with the same content as the target, except all upper case.

next_double

Member NextDouble from type System.Random

A double-precision floating point number greater than or equal to 0.0, and less than 1.0.

So, Eiffel feature names, and the names of .NET members made available to Eiffel for .NET programmers, are all lower case with words separated by underscores.

Overloaded .NET Member Names

The .NET object model allows overloading of function names. This means that a .NET type can support multiple functions with the same name, that vary only by the types of the arguments they accept. For example, the .NET type System.Text.StringBuilder supports nineteen overloaded versions of the Append function. Here are a couple of examples, in their .NET forms:

.NET function signature: Append(System.String)

Member of type System.Text.StringBuilder

Appends a copy of the specified string to the end of this instance.

.NET function signature: Append(System.Char)

Member of type System.Text.StringBuilder

Appends the string representation of a specified Unicode character to the end of this instance.

The Eiffel language does not allow overloaded routine names. That means that you cannot code multiple routines with the same name in a single class. That in itself is not a problem. But it also means that to work in the .NET environment, where overloading is allowed some compromise has to be made. So, what happens is this: if you are programming in Eiffel for .NET and you are using types from a .NET assembly, those types will be presented to you as if they are Eiffel classes. We have already seen that the type and feature names will be shown in the Eiffel naming convention. With overloaded feature names, the presentation will use name augmentation to disambiguate the overloaded versions. What you see is a distinct feature name for each overloaded version. The basic feature name is augmented by adding the types of its respective arguments, separated by underscore.

Let's look again at the two Append functions from System.Text.StringBuilder.

.NET function signature: Append(System.String)

Known to Eiffel as: append_string (value: SYSTEM_STRING)

Member of type System.Text.StringBuilder, known to Eiffel as STRING_BUILDER

Appends a copy of the specified string to the end of this instance.

.NET function signature: Append(System.Char)

Known to Eiffel as: append_character (value: CHARACTER)

Member of type System.Text.StringBuilder, known to Eiffel as STRING_BUILDER

Appends the string representation of a specified Unicode character to the end of this instance.

The overloading story does not end quite yet. The .NET object model allows the overloading of constructors. This issue will be discussed in the section Constructors and Creation Procedures.

.NET Properties as Eiffel Features

Properties in .NET provide:

  • the opportunity to strengthen encapsulation, because values cannot be receive assignment without executing the property's "set" code
  • uniform access queries, because properties are queries, but unlike previous C-style OO languages in which properties did not exist, if a property is used in programming a client class, the programmer does not need to know whether the data provided by the property was done so from memory or through computation. This leaves the producer of the class with the property the latitude to change the implementation without breaking existing clients.

In Eiffel, the same goals are fulfilled, but a little differently. Simple attributes are well-encapsulated, because the Eiffel language does not allow direct assignment to them from outside the control of their class. So any assignment of the form x.f := y is not valid in Eiffel. To allow client to set values of the attribute f, the producer of the class of which x is an instance would have built a command (a "set_" procedure) to do so. Then the code in a client to set f would look like this: x.set_f (y).

Uniform access is achieved in Eiffel through the way in which clients see features which are queries. The code "print (x.count)" applies the query count to the object attached to x and prints the result. You cannot tell by looking at this code whether count is an attribute or a function, that is, whether the count is returned from memory or through computation. In fact, it could be either, but that is a matter for its producer to deal with. As reuse consumers,the implementation of count is not important to us ... but the fact that the producer can change the implementation without causing our code to need modification is very important to us.

Because Eiffel does not support properties directly, the properties of types which Eiffel for .NET programmers use from .NET assemblies have to be mapped to Eiffel features.

In order to ask for the property's current value (technically, receiving the result of the property's get routine), a query feature is generated for the property. The query will be named the Eiffel name of the property.

As noted above, setting the value of a property cannot be done in Eiffel as it is done in C# and VB.NET because Eiffel disallows assignments of the form x.f := y. So, for each writable property, an Eiffel command feature is available to set the value of the property. The name for this command will be set_ followed by the Eiffel name for the property.

As a result, the code for using a .NET property looks very much like the code to use an Eiffel attribute. In the following code fragment, an instance of the type System.Windows.Forms.Form which is available in Eiffel for .NET as WINFORMS_FORM is used by an Eiffel client. System.Windows.Forms.Form has a property Text which is of type System.String. Here the Text property is being set using the set_text feature, and then being recalled by using the query text.

local
    my_window: WINFORMS_FORM
    my_string: SYSTEM_STRING
do
    create my_window.make
    my_window.set_text (my_window_title)      -- Set Text property
    my_string := my_window.text               -- Query Text property
        .
        .
end

Static Features in .NET

In the .NET object model it is possible for certain members of a type to be "static". When these members are used, they are used without an instance of the class as a target. In essence, they are called on the class itself.

In Eiffel for .NET, these static members will made available with feature names derived using the same conventions as ordinary features, but applying them will be a bit different.

There is not a concept analogous to static members in Eiffel. The model for object-oriented computation in Eiffel specifies that whenever feature application takes place, there must be an object, i.e. an instance of some class, that serves as a target.

In order to use .NET types that include static members, a special syntax has been added into Eiffel for .NET. The following example uses this syntax to call a static function:

local
    my_window: WINFORMS_FORM
do
    create my_window.make
    my_window.set_text (my_window_title)
        .
        .
    feature {WINFORMS_APPLICATION}.run_form (my_window)
end

The type System.Windows.Forms.Application is used here. It is available to Eiffel under the name WINFORMS_APPLICATION. The static member being used is Run, in particular the overloaded version of Run which takes an argument of type System.Windows.Forms.Form. That version is available in Eiffel under the name run_form.

The important thing to see here is that when you need to apply a static member, you introduce the call with the keyword feature. Then enclose the type name in braces and apply the feature as if it were targeted to an object. This is fairly close to the way that the call would be made in C#, where the feature name would be applied to the type name, versus a target object:

{
    Form my_window;
    my_window = new Form();
    my_window.Text = "Hello World!";
       .
       .
    Application.Run(my_window);           // This is C#
}


Type Organization

Class and Type Organization in Eiffel for .NET

In any comprehensive object-oriented system, the act of programming results in creation of new data types . There must be a way of organizing these types and/or their static representation as classes. This section tells you how classes are organized in Eiffel and in .NET, and how these organization methods are used together.

Eiffel Clusters

Eiffel classes are grouped in clusters. These clusters of classes ordinarily share some commonality of functionality or purpose. In other words, the classes in a particular cluster may provide the same sorts of capabilities or relate to a single software model. In the Eiffel Base Library there is a cluster called list which contains classes which implement different types of lists, for example, ARRAYED_LIST, LINKED_LIST, SORTED_TWO_WAY_LIST, TWO_WAY_CIRCULAR. At an abstract level all these classes are related to the software model of the notion of "list".

The cluster list is actually a subcluster of the cluster structures which contains clusters other than list related to data structures other than lists. Eiffel convention dictates that a cluster should either contain classes or subclusters, but not both.

So clusters serve both to categorize and locate classes. So, class LINKED_LIST can be described as a basic library class implementing a data structure, more particularly a list. As such, it can be found in the Base Library, in cluster structures in subcluster list.

.NET Namespaces and Assemblies

In .NET, types (the language independent, compiled form of classes) are stored in "assemblies". So, we locate a type we want to use by referencing the assembly in which it resides.

As .NET programmers, we think of types as being categorized by namespace. For example, we view the type System.Windows.Forms.TextBox as the TextBox type in the context of the windows forms namespace (System.Windows.Forms). Particularly, this is in contrast to type System.Web.UI.TextBox which is a TextBox for web forms. As it relates to making .NET types usable by Eiffel, the important thing to understand is that the real .NET type name is the fully qualified type name, including the namespace. Namespaces are simply a bit of "syntactic sugar" that keeps us from having to repeat the entire type name every time we use it in source code.

.NET Assemblies Available to Eiffel

When types from .NET assemblies are made available to Eiffel programmers, each assembly is mapped to a cluster. So all the types in an assembly appear as if they were Eiffel classes in a cluster which corresponds to the .NET assembly.

To summarize, as you learned in Naming Conventions and Name Handling, unambiguous Eiffel-style names are made available for the .NET types in an assembly. The assembly is represented to Eiffel for .NET programmers as a cluster of classes. The process of name derivation is based upon a portion of the .NET type name, possibly augmented with a prefix to ensure uniqueness.

Assemblies Built with Eiffel

The object model for which Eiffel was designed differs in some ways from the .NET object model. Importantly, Eiffel supports the facilties of full, controllable multiple inheritance, and genericity, among other things, that the inherent .NET object model does not. That does not mean that these things cannot work in .NET. Indeed they can, and they make Eiffel for .NET very powerful. But, they do make things look a little different.

When you compile Eiffel for .NET, the result is a .NET assembly; either an executable system, or a library of potentially reusable data types. Because the object model for Eiffel is different from that of .NET, the assembly resulting from a compile is different in some ways.

First an assembly built using Eiffel for .NET will likely contain lots of types and interfaces. This is because as you use a class from the Eiffel libaries, say class STRING, all the classes upon which STRING depends (STRING's suppliers and ancestors) must also be included in the assembly. That's because the Eiffel libraries, unlike the Microsoft .NET libraries like mscorlib and System.Data, are not distributed as shared type libraries.

Another thing you may notice is that each Eiffel class you produce is represented by three entities in the assembly ... two classes and an interface. So, if you produce a class called GUARD_DOG, then in the assembly you'd see an interface called GuardDog, a class called Impl.GuardDog, and a class called Create.GuardDog. Again, this is done for reasons that concern the differences in the object models between Eiffel and .NET.

The GuardDog interface is what you use when you declare an entity or variable of that type. The objects attached to that entity at runtime will be of the type Impl.GuardDog. You create an instance of Impl.GuardDog and attach it to an entity of type GuardDog by calling a routine in the factory class Create.GuardDog. The factory routines will almost always have names that begin with the word "Make", and represent the creation routines of Eiffel the classes. So in the case of using an instance of GuardDog from a C# class, the code would like this:

            {
GuardDog aGuardDog = Create.GuardDog.Make(); //Create an
            instance
aGuardDog.RollOver();
            // Apply a feature
}

This object creation model accounts for some of the differences between constructors in .NET and creation procedures in Eiffel. These differences will be discussed in more detail in Constructors and Creation Procedures.

Another advantage is that it provides a syntax that is similar to that used to create objects in Eiffel. An Eiffel for .NET client to the class GUARD_DOG might use the following code to create and use an instance.

local
    a_guard_dog: GUARD_DOG   -- Declare an entity of the type
do
    create a_guard_dog.make  -- Create and instance and attach to entity
    a_guard_dog.roll_over    -- Apply a feature
end

You may have noticed in these examples that even though the type GuardDog was compiled from an Eiffel class, when the C# client uses GuardDog, it uses what would be considered the .NET naming convention for the type GuardDog (vs. GUARD_DOG) and the method name RollOver (vs roll_over). What happens here is that when assemblies are produced from Eiffel classes, by default .NET naming standards are used in the assembly.


Constructors and Creation Procedures

This section deals with what happens when objects, that is runtime instances of types, get created and initialized. When a new instance is created, there is an opportunity to initialize the state of the instance. This is done with a constructor in .NET, and with a creation procedure in Eiffel.

Eiffel Creation Procedures

Eiffel creation procedures are features of a class which can be used to initialize instances. Classes can have more than one creation procedure available. However, each creation procedure must ensure that the class invariant holds when the procedure completes execution. In other words, the creation procedure is there to initialize a newly created instance, and the class invariant guarantees that a newly initialized instance is actually valid.

There is nothing special about creation procedures themselves, they are just ordinary procedures (although by convention their names usually begin with the word "make"). What makes them creation procedures is the fact that their names are listed as creation procedures in the class text.

In Eiffel, a creation procedure can be applied to an instance at any time (not just at object creation). This is done sometimes to reinitialize existing instances.

Constructors in .NET

Like creation procedures in Eiffel, .NET constructors are used to initialize new instances of types. Constructors manifest themselves differently depending upon which .NET language you use. In C#, constructors always appear as a method having the same name as the class on which they are implemented. In Visual Basic .NET, they always appear as a Sub with the name New. Once compiled into an assembly, the metadata labels constructors as .ctor.

Constructors can have multiple versions by overloading. That is, each version would have a different set of argument types.

Constructors can only be applied when a new instance is created.

Constructors as Eiffel Creation Procedures

When types from .NET assemblies are made available to Eiffel systems, the constructors are presented as creation procedures. Just as constructors show up in the C# and VB.NET environments with names appropriate to those languages, so it is with Eiffel for .NET. Always, constructors will have feature names which begin with the word "make", the convention for creation procedure naming in Eiffel.

If there is only one version of the constructor, that version will be mapped to a single feature named make. However, if there are overloaded versions of the constructor, then these versions given names starting with "make_with_" and then followed with the argument names from the assembly metadata separated with the conjunction "_and_". Let's look at an example.

The .NET type System.Drawing.Size has an overloaded constructor with two versions. In the System.Drawing assembly metadata, these two constructor versions look like this:

void .ctor(int32 width, int32 height)
void .ctor(System.Drawing.Point pt)

So the argument names for the first version are width and height. For the second version there is only one argument named pt. The constructor versions as presented to Eiffel programmers as creation procedures look like this:

make_from_width_and_height (width: INTEGER; height: INTEGER)
make_from_pt (pt: DRAWING_POINT)

Presenting the names in this format handles the conflicts of overloading and provides reasonably intuitive names that comply with Eiffel naming conventions.

Eiffel Creation Procedures as Constructors?

Eiffel creation procedures do not map to constructors when Eiffel classes are compiled into assemblies. Rather, they are actually manifested as functions on a factory class in the namespace Create in the assembly. These functions return an initialized instance. In the section Type Organization there is more information about the organization of the types in assemblies built with Eiffel for .NET, along with an example of using types from such an assembly.


Similar Types Occurring in Both Libraries

Whose String is it anyway?

Over the last 15 years or so, the Eiffel class libraries have been a source for reusable software components for developers.

The Eiffel Base library contains classes for commonly used objects like different kinds of numbers, strings, files, and data structures.

But there are also libaries of Eiffel classes for sophisticated purposes like lexical analysis and parsing, data access, and graphical user interface development.

Likewise .NET is delivered with assemblies containing thousands of powerful types with similar purposes.

Working in Both Worlds

When we build software that has access to both the rich Eiffel libraries and the many useful .NET types, we inevitably run into types from both worlds that have similar names and purposes, but are still different types with different semantics.

The Case of Strings

The example of these similar types which will almost certainly get in your face is the string types. You may remember that we looked briefly at the case of the string types in Naming Conventions and Name Handling.

The Eiffel Base Library contains class STRING; the .NET assembly contains type System.String, which Eiffel for .NET users see as SYSTEM_STRING. At an abstract level both of these model sequences of characters. But they are not the same type. In fact, they are different in some important ways. For example, instances of System.String are immutable. So you cannot append to an instance of System.String. If you want to build a string by appending, you should use an instance of System.Text.StringBuilder to do the appending, then extract the instance of System.String from it. With STRING it is permissible to append, so you don't need a helper like the System.Text.StringBuilder type.

So the two types are similar at an abstract level, but different semantically. There are reasonable arguments for the design of each.

Many types in the delivered assemblies have properties which are strings or methods which return or take strings as arguments. In all these cases, the strings in question are instances of System.String.

Many classes in the delivered Eiffel libraries have features involving strings, that is attributes which are strings or routines which return or take strings as arguments. In all these cases, the strings are instances of STRING (except for those designed for .NET compliance).

In C# and VB.NET, if you specify a quoted string like "Hello World!" in your code, that string will conform to type System.String. If you do the same in Eiffel, then "Hello World!" will be an instance of STRING. In Eiffel terminology, "Hello World!" appearing in source code is a manifest string.

What all this means to you is that you cannot use an instance of System.String when an instance of STRING is called for, and vice versa. Three out of four of the executable lines in the following code sample are invalid:

local
    my_string: STRING
    my_system_string: SYSTEM_STRING
do
    my_system_string := "Hello World!"           -- Invalid
    my_string := "Hello World!"                  -- Valid
    my_string := my_system_string                -- Invalid
    my_system_string := my_string                -- Invalid
        .
        .
end

To handle this issue, the Eiffel for .NET class STRING has two features which can be used when a string of the other type is needed.

The first of these features is a query to_cil which returns an object of type System.String which has a sequence of characters equivalent to that of the STRING to which to_cil is applied. The to_cil can be applied to manifest strings by enclosing the manifest string in parentheses.

The other feature is a creation procedure named make_from_cil which takes as an argument an instance of System.String and initializes its target STRING with a sequence of characters equivalent to that of the argument.

In the following sample, we use these features of STRING to make all the lines from the previous sample valid.

local
    my_string: STRING
    my_system_string: SYSTEM_STRING
do
    my_system_string := ("Hello World!").to_cil     -- Valid
    my_string := "Hello World!"                     -- Valid
    my_string.make_from_cil (my_system_string)      -- Valid
    my_system_string := my_string.to_cil            -- Valid
        .
        .
end

Note: As shown in the above example, it is necessary to apply to_cil to a manifest string if you are assigning it to a System.String or passing it as an argument where a System.String is called for.

This is expected to change in a future release. It should be come unnecesary to apply to_cil to manifest strings. Instead, whether a STRING or System.String is needed will be determined by the context in which the manifest string is being used, and the proper type of object will be generated.

Other Similar Types

There are many other cases of types available from the .NET assemblies which have similar purpose and semantics to those found in the Eiffel libraries. Fortunately, there is none that you will have to deal with as often as strings.


Eiffel Reserved Keywords

There are 56 language keywords in Eiffel which cannot be used as developer defined identifiers in Eiffel class code.

Eiffel Reserved Keywords

    agent | alias | all | and | as | assign | check
class | convert | create | Current | debug | deferred | do
else | elseif | end | ensure | expanded | export | external
False | feature | from | frozen | if | implies | indexing
infix | inherit | inspect | invariant | is | like | local
loop | not | obsolete | old | once | or | prefix
Precursor | pure | redefine | reference | rename | require | rescue
Result | retry | separate | then | True | TUPLE | undefine


Eiffel for .NET

The Eiffel for .NET Language

  • Introduction
  • Eiffel Classes
  • Adding Class Features
  • Inheritance
  • Genericity
  • Design by Contract
  • Exception Mechanism
  • Event Programming with Agents
  • Using Referenced Assemblies


The Eiffel for .NET Language

These pages contain documentation that describes the Eiffel programming language.

Eiffel is considered both a development methodology and a programming language.

Eiffel the methodology is a recipe for constructing quality software which is based on a small number of powerful concepts. Eiffel the programming language is a notation which is designed to support the methodology.

Eiffel for .NET is the Eiffel programming language made available in the .NET environment. Eiffel for .NET components can use and inherit from components in .NET assemblies that were produced using other .NET languages. And, programmers using other .NET languages can use and inherit from components in assemblies produced using Eiffel for .NET.

Eiffel for .NET Conventions Documentation

In Eiffel, as in other languages, certain conventions have evolved which constitute "the way things are done". Conventions provide consistency and therefore predictabliltiy and readability of software text.

When working in the .NET components, particularly when using components from .NET assemblies delivered from Microsoft or produced by other parties, the conventions of Eiffel are maintained in the view of these components. The first section, titled Conventions, provides you with an understanding of Eiffel terminology, conventions , and how they work with .NET.

The remaining sections of this section are a reference for the Eiffel for .NET language. It is not a complete reference, though. Rather, it is intended to help you with the tasks that Eiffel programmers commonly encounter.

  • Eiffel Classes
  • Adding Class Features
  • Inheritance
  • Genericity
  • Design by Contract
  • Exception Mechanism
  • Event Programming with Agents
  • Using Referenced Assemblies


Eiffel Classes

The unit of software reuse in Eiffel is the class.

The unit of modularity in Eiffel is the class.

The unit of type modeling in Eiffel is the class.

All Eiffel code must exist within the context of a class.

In Eiffel, application systems, or simply systems, are created by assembling a set of related classes. The classes in a system will be related only by one or both of the two allowable relationships in object-oriented design.

Having read the above, you should be convinced that the concept of class is important and far-reaching. The fact that we have precise rules about classes simplifies life a lot. The only kind of module in Eiffel is a class. Each class exists in one source file (which contains only that class), and contains the code necessary to provide a static definition of a data type. Every runtime entity, i.e. every object, must be an instance of a class. Because we can depend upon these things in Eiffel, we have consistency and predictabililty in the inherently complex world of software development.

Let's take a look at how classes are structured.

Structure of a Class

The code that makes up an Eiffel class is divided into the following parts:

  • Indexing
  • Class header
  • Formal generics
  • Obsolete
  • Inheritance
  • Creators
  • Features
  • Invariant

All of the above, except Class header, are optional. So the simplest Eiffel class you could build would look like this:

class
       SIMPLE
end

Okay, so class SIMPLE is only interesting in its simplicity. Let's look at a more useful example:

indexing
    description: “Objects that model lists”
    revision: “$Revision: 1.1.2.1 $”

class
    OLD_FASHIONED_LIST [G]

obsolete "This class is obsolete, use LINKED_LIST [G] instead"

inherit
    DYNAMIC_LIST [G]

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
        do
            before := True
        ensure is_before: before
        end

feature -- Access

    item: G is
            -- Current item
        do
            Result := active.item
        end

    first: like item is
            -- Item at first position
        do
            Result := first_element.item
        end
                (other features omitted)

invariant
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)

Here is a class that, although somewhat contrived, utilizes all of the required and optional parts of the class. Let's look at each part individually.

Indexing

indexing
    description: “Objects that model lists”
    revision: “$Revision: 1.1.2.1 $”

The indexing part of a class is there to allow you as a producer to record information of your choice which will help you or other reuse consumers at some later time to locate understand the class. This important in Eiffel because we try to treat every class as if someday it will become reusable.

Information in indexing does not change the semantics of the class.

The indexing in the class above is typical. It is introduced with the language keyword indexing, and contains two index clauses, each of which is comprised of an index and a single index value. You can code index clauses with indexes that you devise yourself, so there is nothing inherently special about "description" and "revision" as used above. But, these indexes could be special to tools which analyze libraries of classes use them. Although these clauses have only one index value each, it is permissible to put more, separated by commas.

Class Header

class
    OLD_FASHIONED_LIST [G]

The class header is introduced by the keyword "class", which in turn can be preceded by one of three keywords which mark the class as deferred, expanded, or external. In our example, the class has none of these markings, so it is an effective class whose instances are access by reference.

The keyword class is followed by the class name, in this case "OLD_FASHIONED_LIST".

Of the three keywords for header marks, the one which you will encounter most often is deferred. A class is deferred if it contains one or more features that are deferred, that is, features which have been specified in the class but for which no implementation has been provided. Proper descendants of a deferred class will provide implementations for its deferred features.

Formal Generics

class
    OLD_FASHIONED_LIST [G]

In this example the class name is followed by the specification of one formal generic parameter "G". The presence of one or more formal generic parameters will designate a class as a generic class. The formal generic parameter is a place holder for a class name which will be provided by reuse consumers. For example if we wrote a class which was a client to OLD_FASHIONED_LIST we would substitute the class name for the type of objects that we would want to build an OLD_FASHIONED_LIST of. We might make this declaration:

    my_list_of_cats: OLD_FASHION_LIST [CAT]

The entity my_list_of_cats could then be attached at runtime to an OLD_FASHIONED_LIST of objects of type CAT. So the class CAT becomes an actual generic parameter and substitutes for G in the declaration.

Of course formal generic parameters cannot be the same name as a class name in the same universe. If multiple formal generic parameters are used, they are separated by commas.

You will learn more about generic classes in the section titled Genericity.

Obsolete

obsolete "This class is obsolete, use LINKED_LIST [G] instead"

OLD_FASHION_LISTs are obsolete ... and the class is marked as such by include the line above. The manifest string contains an explanation, instructions, and/or recommended alternatives. Compilers and other language tools can deliver this message to potential reuse consumers. As with indexing, obsolete has no effect on the semantics of the class.

Obsolete is rarely used because of the nature of certain elements of the Eiffel methodology. For example, if implementations are well-hidden behind implementation-independent specifications, then those implementations may be changed to adapt the class to changing execution environments in such a way that clients are unaffected.

Inheritance

inherit
    DYNAMIC_LIST [G]

One of the two possible relationships between classes, inheritance is also a powerful software reuse mechanism. In this example class OLD_FASHIONED_LIST declares itself to be a proper descendant of class DYNAMIC_LIST.

There will be more in the section called . For now though, be aware of two important implications of this declaration:

  • Every feature of DYNAMIC_LIST is available to OLD_FASHIONED_LIST and potentially available to its clients.
  • Whenever an instance of DYNAMIC_LIST is called for, then an instance of OLD_FASHIONED_LIST will suffice.

Creators

create
    make

The creators part of a class declares a procedure as being a creation procedure. In this case the procedure in question is the one named make. By convention, creation procedure names begin with the word "make".

Let's take a quick look at object creation. Consider this declaration:

    my_list_of_cats: OLD_FASHION_LIST [CAT]

Here the entity my_list_of_cats can be attached to an object of type OLD_FASHION_LIST [CAT] at runtime. The process of converting my_list_of_cats from holding a void reference to holding a reference to a object modeling a list of cats, starts when a creation instruction is executed. The creation instruction creates the instance and may apply a creation procedure to initialize the instance. A creation instruction for the declaration above would look like this:

            create my_list_of_cats.make

The create keyword is used to introduce a creation instruction. This instruction causes the following four things to happen:

  • A shell of a new instance of OLD_FASHION_LIST [CAT] is created in memory with a memory field for every attribute
  • Each field is initialized with standard default values
    • False for type BOOLEAN
    • Null character for type CHARACTER
    • The appropriate form of zero for number types
    • Void for reference types
  • Attach the new instance to the entity my_list_of_cats
  • Apply the creation procedure make

Once these steps complete successfully, my_list_of_cats will be attached to a valid instance (i.e., an instance in which the class invariant is true) of OLD_FASHIONED_LIST [CAT].

Features

feature -- Initialization

    make is
            -- Create an empty list.
        do
            before := True
        ensure is_before: before
        end

feature -- Access

    item: G is
            -- Current item
        do
            Result := active.item
        end

    first: like item is
            -- Item at first position
        do
            Result := first_element.item
        end

The features part of a class is the area in which we feel that most of the "programming" is done. It is here that we define those things that instances of a class have and can do. We will learn more about features in the next section Adding Class Features.

Until then let's just take a quick look at how features fit into a class. Notice that in our example the features part is introduced by the keyword "feature". In fact there are two occurrences of feature in this example, each followed by a comment.

You may declare multiple feature statements. This helps you group features in a manner that makes sense. Here we see the first group contains those features which are listed as creation procedures in the creators part of the class. The second group of features labeled "Access" contains a set of queries available to clients of the class.

Although the words "Initialization" and "Access" are actually in comments after the feature keyword, some language processing tools apply some significance to these, for example, ordering the groups in "pretty-printed" views of a class. Also, some tools allow you to build templates for creating new classes which have feature clauses already in place for predetermined groups.

Tip: There is not a technical requirement governing the grouping or ordering of features in a class. It is the option of the producer of a class to group and order the features in some fashion that has some meaning. Many years of Eiffel development experience are reflected in the classes in the Eiffel Base Library. This is a good place to look for examples of well constructed classes.

Invariant

invariant
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)

Here's the last word in a class definition ... both literally and figuratively. The invariant part, introduced not surprisingly by the keyword "invariant", is that portion of the class in which we can state what it means for an object to be a valid instance of this class.

We will learn more about class invariants in the section titled Design by Contract and Assertions.


Adding Class Features

The features of a class make it useful. They are the things that objects which are instances of the class have and can do.

It is during the process of adding class features that we relate a class we are producing to other classes via the client/supplier relationship.

It is when we add features to a class that we can build the executable code that makes things happen.

Categorizing Features

In Eiffel, we have several ways of thinking abstractly about features and categorizing them. As you saw in Eiffel Classes the feature clause gives us a way to group features in the software text. We have ways to group features more generally, too. Here are some.

Source

You remember the example class from Eiffel Classes: indexing
    description: “Objects that model lists”
    revision: “$Revision: 1.1.2.1 $”

class
    OLD_FASHIONED_LIST [G]

obsolete "This class is obsolete, use LINKED_LIST [G] instead"

inherit
    DYNAMIC_LIST [G]

create
    make

feature -- Initialization

    make is
            -- Create an empty list.
        do
            before := True
        ensure is_before: before
        end

feature -- Access

    item: G is
            -- Current item
        do
            Result := active.item
        end

    first: like item is
            -- Item at first position
        do
            Result := first_element.item
        end
                (other features omitted)

invariant
    before_constraint: before implies (active = first_element)
    after_constraint: after implies (active = last_element)
end

The example shows three of the features (make, item, and first) coded directly in the class. These features (and the ones omitted from the example in the interest of brevity) may not be the only features of the class OLD_FASHIONED_LIST. In fact we can just about guarantee that there are other features of this class. Remember the inheritance part of the class:

inherit
    DYNAMIC_LIST [G]

This means that every feature in DYNAMIC_LIST will be a feature of OLD_FASHIONED_LIST. So one way we can think of features is by their source.

  • Immediate features are those that are introduced by a class itself.
  • Inherited features are those that come to the class from its proper ancestors.

We will see more about this in Inheritance.

Implementation Type

Whenever we are building a class in Eiffel, we are potential reuse producers. As such, we can categorize the features of a class based on the three types of feature implementation:

  • Attribute
  • Function
  • Procedure

Attributes are those features which occupy storage in an instance. When you code an attribute in a class that you are producing, that class becomes a client to the class of the attribute. This is the most common way to establish a client/supplier relationship between the classses. Client/supplier is one of the two relationships that can exist between classes.

Functions and procedures are the computation features, that is they are features that involve executable code. Functions and procedures together are themselves categorized as routines.

Also, from the producer standpoint we may view features as whether they work from memory or through computation:

  • Memory
    • Attribute
  • Computation
    • Function
    • Procedure

This view can be valuable when a producer is considering performance issues. For example, if there is some class function called count, a producer might investigate whether it is better to leave count as a function, computing it each time the feature is applied, or to change it to an attribute and compute it less often.

Usage

A times we find it appropriate to categorize features by how we use them. Specifically, as:

  • Query
    • Attribute
    • Function
  • Command
    • Procedure

Queries are features that, when applied to an instance, provide a value in response. Commands instruct an intance to take some action, but do not return a value. Seeing features as either queries or commands is of primary interest to reuse consumers. But as producers there are important reasons for ensuring that when we implement a feature, we implement it as a query or as a command, but not both. We will see more about this in Design by Contract and Assertions.

General Syntax of Features

More Sample Features

Here is another example class. Again this class contrived, so it does not do anyhing worthwhile except show you what different types of features look like. This class has an attribute and a constant attribute, and functions and procedures both with and without arguments.

class
    SOME_CLASS

create
    make,
    make_with_arguments

feature -- Initialization

    make is
            -- Creation procedure
        do
            an_attribute := 5
        end

    make_with_arguments (hour: INTEGER; minute: INTEGER; second: INTEGER) is
            -- Another creation procedure
        do
            an_attribute := second + (minute * 60) + (hour * 3600)
        end

feature -- Access

    an_attribute: INTEGER
            -- An attribute of type INTEGER

    another_attribute: INTEGER is 46
            -- A constant attribute

    a_function: STRING is
            -- A function without arguments
        do
            Result := an_attribute.out
        end

    another_function (an_int: INTEGER): INTEGER is
            -- A function with arguments
        do
            Result := an_attribute + an_int
        end

feature -- Basic Operations

    a_procedure is
            -- A procedure with no arguments
        do
            an_attribute := an_attribute + 5
        end

    another_procedure (an_int: INTEGER; another_int: INTEGER) is
            -- A procedure with arguments
        do
            an_attribute := an_attribute + an_int + another_int
        end

end -- Class SOME_CLASS

Feature Declaration

When you write a feature in a class, you typically will include some of the following:

  • The feature's name

    Note: In Eiffel every feature of a class must have a name that is unique within that class.

  • The feature's type (in the case of an attribute or a function)
  • The feature's formal argument list (in the case of a function or procedure that has arguments)
  • The actual value of the feature (in the case of a constant attribute)
  • The implementation code (in the case of a function or procedure)

Let's dissect one feature and identify its parts:

    another_function (an_int: INTEGER): INTEGER is
            -- A function with arguments
        do
            Result := an_attribute + an_int
        end

In this feature:

  • "another_function" is the feature's name.
  • "(an_int: INTEGER)" is the argument list.
    • "an_int" is the name of the first argument
    • "INTEGER" is the type "an_int"
  • "INTEGER" (after the argument list) is the feature's type.
  • "do " introduces the implementation code.
  • "Result := an_attribute + an_int" is an instruction.
    Note: This feature is a function. As a consequence the computation uses the keyword "Result" as an entity name for the value to be returned by the function
  • "end" ends the feature declaration

General Structure of Routines

As you can imagine, the possibilities for coding routines are more complex than those for coding attributes. Routines always contain the keyword "is" after the first part of the feature declaration. The part after the "is" is called the routine part.

The routine part is made up of the following sections:

  • Header Comment
  • Obsolete
  • Precondition
  • Local Declarations
  • Routine Body
  • Postcondition
  • Rescue

All of the sections except the Routine Body are optional.

Here is another feature, a routine, which has all of these except obsolete and rescue.

insert_text_header_item (a_label: STRING;
        a_width, a_format: INTEGER; insert_after_item_no: INTEGER) is
            -- Insert a text item to the header control
            --     after the `insert_item_item_no' item.
    require
        exists: exists
        label_not_void: a_label /= Void
        insert_after_item_no_positive: insert_after_item_no >= 0
    local
        hd_item: WEL_HD_ITEM
    do
        create hd_item.make
        hd_item.set_text (a_label)
        hd_item.set_width (a_width)
        hd_item.set_format (a_format)
        insert_header_item (hd_item, insert_after_item_no)
    ensure
        item_count_increased: item_count = old item_count + 1
end

Using this example, let's identify and discuss the different sections.

Header Comment

            -- Insert a text item to the header control
            --     after the `insert_item_item_no' item.

Although the feature's header comment is optional, most Eiffel programmers and their technical managers feel that it should never be omitted. Header comments are included by some language processing tools in specialized views of classes. Header comments are almost always short, usually no more than a few lines. Header comments serve to provide a natural language description of what the feature will do (in the case of features that are commands) or what information it provides (in the case of queries ).

Obsolete

The feature insert_text_header_item is not obsolete ... but if it were it would include an obsolete clause. This works much like the obsolete part for classes that we saw in Eiffel Classes: the keyword "obsolete" followed by a manifest string which bears a message to potential reuse consumers:

Precondition

    require
        exists: exists
        label_not_void: a_label /= Void
        insert_after_item_no_positive: insert_after_item_no >= 0

The precondition part of a feature is introduced by the keyword "require". It contains a set of assertions which define the state necessary for the correct execution of a routine. We will see more about assertions in Design by Contract and Assertions.

Local Declarations

    local
        hd_item: WEL_HD_ITEM

This part contains the declarations for any "local entities" used by the feature. Sometimes the computation accomplished in a feature requires the use of entities which are only temporary. It would not be appropriate to make these attributes of the class. So, instead we can use local entities, which have scope only within the feature in which they are declared. In the example, hd_item is available as type WEL_HD_ITEM during the computation of feature insert_text_header_item.

Note: A local entity name must not be the same as any feature of the class in which its feature occurs or the same as any argument name of the feature in which it occurs.

Routine Body

    do
        create hd_item.make
        hd_item.set_text (a_label)
        hd_item.set_width (a_width)
        hd_item.set_format (a_format)
        insert_header_item (hd_item, insert_after_item_no)

This is the routine body for a fairly typical effective, internal routine. It contains the instructions that get the job done for the feature. You may notice that experienced Eiffel programmers rarely write routine bodies that are more than a few lines long. The reason for this is more that just intuitive. This phenomenon will be explained in the section Design by Contract and Assertions .

There are other forms that a routine body can take. Here are some examples of some others:

External Routines

cwin_tooltips_class: POINTER is
    external
        "C [macro ] : EIF_POINTER"
    alias
        "TOOLTIPS_CLASS"
end

The routine body above is for an "external" routine. External routines are used to represent within Eiffel classes, routines that are written in other languages.

Tip: Because of the high degree of language interaction provided by Microsoft .NET, it is not necessary in Eiffel for .NET to use externals to use software components from .NET assemblies. Instead, these components are presented to the Eiffel programmer as if they were Eiffel classes. Read more about this in Conventions.

Once Routines

    once
        Result := some_computation

This is the routine body of a "once" routine, specifically a "once function". A once routine is introduced by the keyword "once" rather than do. It contains an computational body that executes only the first time it is called. Upon subsequent calls it has no effect.

Once procedures are useful for doing things that for some reason should not be done multiple times.

If the once routine is a function (as the example above), it computes the resulting object on the first call, then on subsequent calls, it returns the object it originally created without executing the computation. Once functions facilitate shared objects which helps us in avoiding globals. A class containing a once function can be inherited by many other classes. The first object to apply the once function causes the resulting object to be created and initialized. Subsequent applications by any other object accesses the originally created instance.

Deferred Routines

    deferred

The body for a deferred routine is simply the keyword "deferred". Below is the deferred routine body in the context of an entire feature.

set_position (new_position: INTEGER) is
            -- Set `position' with `new_position'
    require
        exists: exists
        valid_minimum: new_position >= minimum
        valid_maximum: new_position <= maximum
    deferred
    ensure
        position_set: position = new_position
end

As we learned in Eiffel Classes a deferred routine has specification, but no implementation. We will investigate deferred classes and features further in Inheritance.

Postcondition

    ensure
        item_count_increased: item_count = old item_count + 1

The postcondition part of a routine is introduced by the keyword "ensure". The postcondition is a group of assertions which describe the state that must be satisfied upon the successful completion of the routine. We will see more about assertions in Design by Contract and Assertions.

Rescue

Our example feature does not have an explicitly coded rescue part. The rescue, introduced by the keyword "rescue", provides a routine with a chance to do additional processing in the case that it incurs an exeption during normal processing. We will learn about the rescue clause in the section Exception Mechanism . Until then, you can see what a rescue part looks like in the feature below.

bind is
            -- Bind socket to local address in `address'.
    require
        socket_exists: exists
        valid_local_address: address /= Void
    local
        ext: ANY
        retried: BOOLEAN
    do
        if not retried then
            ext := address.socket_address
            c_bind (descriptor, $ext, address.count)
            is_open_read := True
        end
    rescue
        if not assertion_violation then
            is_open_read := False
            retried := True
            retry
        end
end

Making Features Available to Clients

Remember that when we build classes in Eiffel, we keep in mind the possibility that these classes may eventually become valued, reusable software components. As a result we have a responsibility to make sure that our classes allow clients to use them in a safe and productive fashion. We make available those features that it is appropriate for clients to use, and we hide the rest. In Eiffel we say that a feature that is available to clients is "exported".

Control of the export of features inherited from ancestors is done by using the "export" keyword. Export of inherited features will be discussed in Inheritance.

Control of the export of immediate features (those features introduced in the text of a class) is done with the "feature" clause. We have encountered the feature clause already:

feature -- Access

    an_attribute: INTEGER
            -- An attribute of type INTEGER
    another_attribute: INTEGER is 46
            -- A constant attribute

    a_function: STRING is
            -- A function without arguments
        do
            Result := an_attribute.out

        end

    another_function (an_int: INTEGER): INTEGER is
            -- A function with arguments
        do
            Result := an_attribute + an_int

        end

feature -- Basic Operations

    a_procedure is
            -- A procedure with no arguments
        do
            an_attribute := an_attribute + 5
        end

    another_procedure (an_int: INTEGER; another_int: INTEGER) is
            -- A procedure with arguments
        do
            an_attribute := an_attribute + an_int + another_int
        end

A feature clause like the ones in the example above means that all the features that follow, until the next feature clause are exported to clients based on any class. Techically, this

feature -- Basic Operations

is equivalent to

feature {ANY} -- Basic Operations

which means that the following features are available to clients which conform to class ANY. And in Eiffel, ANY is the class from which all other classes inherit. As a consequence all classes conform to ANY.

Inside the braces is a list of classes which are eligible as clients.

feature {STRING_HANDLER} -- Implementation

Features following this example from class STRING will be available to client class STRING_HANDLER and all its proper descendants.

As stated above, you can put a list of class names in the braces:

feature {CLASS_A, CLASS_B, CLASS_C} -- Semi-private features

Often features which are solely for implementation should not be seen or used by clients of any type. You can ensure this by exporting to class NONE, the class from which no other class can inherit:

feature {NONE} -- Implementation

Eiffel Instructions and Control Structures

When you begin to write routines in Eiffel, you will need to understand how to write instructions. Fortunately, the set of instruction types you can code is fairly small. Here we will look the most common of these. You will see some more in other topics.

Creation

        create hd_item.make

We discussed creation procedures and the process of bringing new objects into being in Eiffel Classes. A creation instruction starts with the keyword "create". It creates a new object, initialize its fields, may apply a creation procedure, and attaches the object to an entity.

Procedure Call

        hd_item.set_text (a_label)

The application of a feature to an object constitutes an instruction if the feature is a procedure.

Assignment

In Eiffel, assignment syntax is simple. But depending upon the types involved, what actually happens may need some explanation. Assume here that is_open_read is an attribute declared as type BOOLEAN:

        is_open_read := False

In this instruction, an attribute of type BOOLEAN named is_open_read is being assigned the value of the manifest boolean "False". The attribute is_open_read is based on an expanded class BOOLEAN, so that means that the value for False is held in the field for is_open_read. This is in contrast to what happens with reference types.

        my_string := some_other_string

In this assignment, we will assume that both entities are type STRING. Because STRING is a reference type, the field for my_string will hold either a reference to an instance of STRING, or it will be Void. When the assignment above executes, then whatever was in the field for my_string is replaced with a reference to the same object that some_other_string refers to.

In summary, for objects based on expanded classes, assignment means assignment of value. For objects based on reference classes, assignment means assignment of reference.

Conformance

There is an important rule about assignment in Eiffel. The rule exists to ensure type safety. Consider the following assignment which we would read as "x receives y" or "x gets y".

        x := y

then the rule says that this assignment is valid only if the type of y conforms to the type of x.

The rule is clear enough ... if you know what "conform" means. In the presence of mechanisms like expanded types, inheritance, and genericity, a precise definition of conformance is lengthy.

But we can get by for a while with much less. For now let us be satisfied with this:

Consider the classes in the declarations for x and y.

You might be tempted to say that to achieve "conformance", the classes would have to be the same. And for the case in which the declarations for x and y are expanded classes, you'd be correct. They conform only if they are the same class.

But for reference types, that constraint is unnecessarily restrictive. So, for reference types, the class of y conforms to that x if it is the same class or a proper descendant of that class. This facilitates a powerful idea known as polymorphic attachment that we will see more closely in the section on Inheritance.

Conditional

            if l_c.is_digit then
                l_state := 2
            elseif l_c = '-' or l_c = '+' then
                l_state := 1
            else
                l_state := 3
            end

Conditionals in Eiffel use at a minimum the keywords "if", "then",and "end". Optionally, they may use the keywords "elseif" and "else".

Loop

            from
                i := lower
            until
                i > upper
            loop
                if item (i) /= Void and then v.is_equal (item (i)) then
                    Result := Result + 1
                end
                i := i + 1
            end

There is only one structure for loops in Eiffel. In its typical form it uses the four keywords "from", "until", "loop", and "end". The instructions following the from keyword do any initialization necessary for the loop. After until is a boolean expression which is the exit condition. The loop body after loop is a list of instructions that are executed for every iteration. As you can imagine, something in the loop body should most likely cause the exit condition eventually to become true.


Inheritance

Inheritance, along with client/supplier, are the two relationships that can exist between classes.

Inheritance lets us mirror in software the types of abstractions that are common in many problem domains, i.e., the more general to the more specialized.

Inheritance also gives a way us to combine these abstractions.

Inheritance allows us to make extensions and adaptations to existing software, while at the same time, leaving the original software unaltered.

The Eiffel Inheritance Model

If class B inherits from class A, then:

  • Every feature of A is also a feature of B
  • In any case in which an instance of A is called for, then an instance of B will suffice.

Flexibility and adaptability are key qualities of the Eiffel inheritance model. On an informal level, this means that, except as prevented by certain constraints, a class can inherit from a set of classes containing just about any other classes.

Eiffel classes can be effective or deferred. If a class is effective, then it is completely implemented. As a result, it is possible to create and use direct instances of an effective class at runtime.

If a class is deferred, then it is not completely implemented. A class is deferred if it contains at least one deferred feature. So, it is possible for you to mark a feature (and by consequence also its class) as deferred when you code it. This means that the specification for this class dictates that such a feature exists, but there is no implementation for the feature included in the class. As a result, there can be no direct instances of deferred classes at runtime. However, a class that inherits from a deferred class can implement, or effect, the deferred features. This results in an effective descendant to the deferred class. And it is possible to create direct instances of this effective descendant. Such instances would also be instances (albeit not direct instances) of the original deferred class.

What this means to us as software producers, is that in any development effort, we have available a great number of classes which can serve as potential starting points. That is, classes that we could make parents to the classes we produce. And, those classes do not have to chosen from a strict dichotomy of classes which are either completely abstract or completely implemented. Inheritance from classes that are deferred but have some implemented features is both possible and encouraged. It reuses existing software and it reduces the opportunity for error.

Consider the deferred class COMPARABLE from the Eiffel Base Library. A portion of COMPARABLE is shown below:

deferred class
    COMPARABLE

feature -- Comparison

    infix "<" (other: like Current): BOOLEAN is
            -- Is current object less than `other'?
        deferred
    end

    infix "<=" (other: like Current): BOOLEAN is
            -- Is current object less than or equal to `other'?
        do
            Result := not (other < Current)
        end

    infix ">" (other: like Current): BOOLEAN is
            -- Is current object greater than `other'?
        do
            Result := other < Current
        end

    infix ">=" (other: like Current): BOOLEAN is
            -- Is current object greater than or equal to `other'?
        do
            Result := not (Current < other)
        end

    is_equal (other: like Current): BOOLEAN is
            -- Is `other' attached to an object of the same type
            -- as current object and identical to it?
        do
            Result := (not (Current < other) and not (other < Current))
        end

If you are producing a class that you wish to support basic comparison operators, like "<" and ">", you can have that class inherit from COMPARABLE, which has features which correspond to those operators. The text for COMPARABLE contains eight features. Seven of these are effective and one is deferred.

So through inheritance from COMPARABLE, your class, let's call it WHATZIT, would now have these features available. But how would the features of COMPARABLE know what it means to compare WHATZITs?

Of course, it would have no way of knowing, so you must show it. And you do that by writing the implementation for "<", the one deferred feature that WHATZIT inherits from the COMPARABLE class.

When you look closely at the effective features of COMPARABLE, you see that their implementations are ultimately based on "<". If we were not able to inherit from multiple partially implemented classes, then we would be forced to implement many more features, a process which invites error, or, in the case of comparison, to move to a less appealing model.

The Inheritance Part of Classes in Eiffel

Because the inheritance model has such flexibility, it must also have adaptability. A consequence of inheriting from multiple classes is that it would be possible to inherit multiple features with the same name ... and you remember from Adding Class Features that a class is not allowed to have more than one feature with the same name. A process called feature adaptation allows us to resolve these issues in an heir. Feature adaptation is also done for reasons other than resolving name clashes as well.

Feature adaptation is an enabling capability, but it is also one that takes some study to understand fully.

We will look at the types of feature adaptation that will serve most useful to you as you begin to produce Eiffel software.

In Eiffel Classes you saw where the inheritance part fits into the class structure. Shown below is a portion of class LINKED_QUEUE from the Eiffel libraries. LINKED_QUEUE is an effective class which implements the abstract notion of a QUEUE (a deferred class) with an implementation based on the services provided by LINKED_LIST (an effective class).

class
    LINKED_QUEUE [G]
inherit
     QUEUE [G]
        undefine
            is_empty,
            copy,
            is_equal
        redefine
            linear_representation,
            prune_all,
            extend
        select
            item,
            put
        end
    LINKED_LIST [G]
        rename
           item as ll_item,
            remove as ll_remove,
            make as ll_make,
            remove_left as remove,
            put as ll_put
        export
            {NONE}
                all
            {ANY}
                writable,
                extendible,
                wipe_out,
                readable
        undefine
            fill,
            append,
            prune,
            readable,
            writable,
            prune_all,
            extend,
            force,
            is_inserted
        redefine
            duplicate,
            linear_representation
        select
            remove
        end

Okay ... now calm down ... please. This is an example from a very highly-evolved and sophisticated library which is replete with software reuse. LINKED_QUEUE has two parents and uses considerable feature adaptation. In fact, it uses every feature adaptation option available. The benefit is obvious, though. LINKED_QUEUE class has only seven features actually coded. In total there are only 26 lines of instructions!

In practice you can use inheritance, even multiple inheritance, to do some quite productive programming in Eiffel without having to write anything that looks like the inheritance part of LINKED_QUEUE above.

Regardless, let's break LINKED_QUEUE's inheritance part into chunks and take a look at some of them.

Rename

class
    LINKED_QUEUE [G]
inherit
    LINKED_LIST [G]

        rename
            item as ll_item,
            remove as ll_remove,
            make as ll_make,
            remove_left as remove,
            put as ll_put

As you might have already guessed, the rename part, introduced oddly enough by the keyword "rename", is used to rename features.

Specifically, it is used when an heir wants to use a feature from a parent, but wants to use it under a different name than that by which the parent knows it. So in the example, the feature known as item in LINKED_LIST is perfectly usable in LINKED_QUEUE, but must be applied as ll_item.

This is common when your class inherits two different features with the same name from two different parents and you want to be able to use them both. Because you can only have one feature with a given name, then rename one of the features.

New Exports

class
    LINKED_QUEUE [G]
inherit
    LINKED_LIST [G]

        export
            {NONE}
                all
            {ANY}
                writable,
                extendible,
                wipe_out,
                readable

The new exports part is introduced by the keyword "export". This section allows you to change the export status of inherited features. Remember from Adding Class Features that features become available (or not) to clients by their export status. Export status of immediate features is controlled in the feature clause. But here we are dealing with inherited features, so we control their status in the export part of the class's inheritance section. Any feature not mentioned will have the same export status as it did in the parent class.

In this example, the keyword "all" is used first to say that all features inherited form LINKED_LIST are unavailable to any clients (export to class NONE). This is typical for a class like LINKED_QUEUE in which the features important to the client come from the deferred parent, in this case QUEUE, and the class LINKED_LIST is used only for implementation. But, it seems that also in this case, the producer felt differently about the features writable, extendible, wipe_out, and readable, and decided the allow clients of ANY type to utilize these features inherited from LINKED_LIST.

Undefine

class
    LINKED_QUEUE [G]
inherit
    LINKED_LIST [G]

        undefine
            is_empty,
            copy,
            is_equal

Next, undefine ... it's probably not what you think. You might assume that undefine is a way to banish forever any inherited features that you just do not want to deal with. But what happens to features whose names are listed in an undefine clause is that they become deferred features in the heir.

Undefine is useful if you inherit two different features of the same name from different parents, a situation you cannot live with. If you like one and you don't like the other, then you can undefine the one you don't like. The the only version you get is the one you like.

Another way you might use undefine is in the case in which you actually want a feature to be deferred in an heir that was effective in a parent.

Redefine

class
    LINKED_QUEUE [G]
inherit
    LINKED_LIST [G]

        redefine
            linear_representation,
            prune_all,
            extend

The redefine part lists the names of effective features for which the producer of the heir class would like to provide implementations that replace the inherited implementations.

So, in this example the implementation for linear_representation, for example, that LINKED_QUEUE would have inherited from QUEUE will not be used. Instead LINKED_QUEUE implements its own version of linear_representation.

Note: When a class implements a version of an inherited feature which was deferred in its parent, this is known as "effecting" the feature. Because features being effected are getting their first implementation, it is not necessary to list their names in the redefine part, or anywhere else in the inheritance part of the heir.

Select

class
    LINKED_QUEUE [G]
inherit
    LINKED_LIST [G]

           select
            remove

The select part is used only under special circumstances. The case in which select is required involves a situation called "repeated" inheritance. Repeated inheritance occurs when an heir inherits more than once from the same ancestor. Usually this means it has two or more parents who have a common proper ancestor (but it can occur directly). The features from the common ancestor are inherited by each of the parents and passed on to the heir. The rules and effects of repeated inheritance occupy an entire chapter in the official Eiffel language reference and will not be reproduced here. Just understand at this point that it is sometimes necessary to use select to provide the dynamic binding system with an unambiguous choice of features in the presence of polymorphic attachment.

You should note also that repeated inheritance can and does occur often without causing any problem at all. In fact it happens in every case of multiple inheritance, due to the fact that all classes inherit from class ANY and receive its features as a result. The reason it is not a problem is that in the case that any feature makes it from the original common ancestor along multiple paths to the heir with its name and implementation still intact, it will arrive as only one feature heir. This is called sharing and nothing special needs to be done to make it happen.

Polymorphism

It is time now to see another way in which inheritance helps build more extendible software.

Assume that we have to build classes that model different types of polygons. We would do this by building a class for polygon which would model a garden-variety polygon, a multi-sided closed figure. But when we consider that there are specialized types of polygons, like triangles and rectangles, we realize that to support these specializations, we need classes for them as well. And this is an obvious opportunity for inheritance. All triangles and rectangles are polygons. So, we start with class POLYGON and its proper descendants TRIANGLE and RECTANGLE.

So we can make declarations like:

        my_polygon: POLYGON
        your_polygon: POLYGON
        my_triangle: TRIANGLE
        my_rectangle: RECTANGLE
        another_rectangle: RECTANGLE

Assume these declarations are in force for all the examples this section on polymorphism.

We saw in Adding Class Features that we can say that one class conforms to another if it is the same class or one of its proper descendants. Therefore POLYGON conforms to POLYGON. Also, TRIANGLE and RECTANGLE conform to POLYGON. But, importantly, POLYGON does not conform to TRIANGLE or RECTANGLE. This makes sense intuitively, because we know all rectangles and triangles are polygons ... and we also know that not all polygons are rectangles.

Polymorphic Attachment

These facts affect how assignments can work. Using the declarations above:

        my_polygon := your_polygon              -- Is valid
        your_polygon := my_polygon              -- Is valid
        my_polygon := my_rectangle              -- Is valid
         my_polygon := my_triangle               -- Is valid

but

        my_rectangle := my_polygon              -- Is not valid
        my_triangle := my_polygon               -- Is not valid

and of course

        my_rectangle := my_triangle             -- Is not valid

Consider now the assignment below which is valid.

        my_polygon := my_rectangle

After an assignment like this executes the entity my_polygon will be holding at runtime a reference to an instance of a type which is not a direct instance of its declared type POLYGON. But conformance ensures us that, although it may not be a direct instance, it will indeed by an instance. (all rectangles are polygons).

Depending upon how many different types of polygons get modeled in classes, the entity "my_polygon" could be attached objects of may different types ... it could take on many forms. This in fact is the basis for the term "polymorphism"; having many forms. So we speak of "polymorphic attachment" as the process by which at runtime entities can hold references to objects which are not of the entity's declared type ... but they are of conforming types.

Now let's see how we get some value from this.

Dynamic Binding

Suppose that one of the features of POLYGON is a query perimeter which returns an instance's perimeter. The producer of POLYGON may have implemented perimeter as a function that computes the perimeter by adding up the lengths of all the sides. This approach is guaranteed to work for all polygons, and we can apply the perimeter feature to any polygon. Let's print some perimeters:

        print (my_polygon.perimeter)
        print (my_triangle.perimeter)
        print (my_rectangle.perimeter)

TRIANGLE and RECTANGLE might have properties, expressed as queries, which as a part of their specialization, distinguish them from run-of-the-mill polygons. Two features of rectangles are width and height the lengths of the sides.

Armed with these RECTANGLE-specific features, the producer of RECTANGLE may say, "Now I no longer have to depend upon that crude implementation of perimeter that is inherited from POLYGON. I can build an efficient RECTANGLE-specific implementation of perimeter, based on the knowledge that for all RECTANGLEs perimeter = 2*(width+height)"

To implement this specialized version of perimeter, the producer of RECTANGLE must add the feature to the class, but also must list its name in the "redefine" part of the RECTANGLE's inheritance clause.

class RECTANGLE
inherit
        POLYGON
            redefine
                perimeter
            end
     .
     .
feature
    perimeter: REAL is
            -- Sum of lengths of all sides
         do
            Result := 2 * (width + height)
        end

You would expect then, that this version of perimeter would be executed in the following context:

        print (my_rectangle.perimeter)

But what makes this interesting is that even in the context below

        my_polygon := my_rectangle
        print (my_polygon.perimeter)

in which perimeter is being applied to a entity declared as POLYGON, the specialized version of perimeter from RECTANGLE is being used. It would be impossible to ensure at compile time which version of perimeter is most appropriate. So it must be done at runtime. This ability to choose the best version of a feature to apply, just at the moment it needs to be applied, is called "dynamic binding".

Static typing tells us at compile time that it is safe to apply perimeter to my_polygon No matter which of the types of polygons is attached to my_polygon, there will be a perimeter feature that will work.

Dynamic binding tells us that when we apply perimeter, we know that the most appropriate version of the feature will get applied at runtime.

Assignment Attempt

Now let's add another situation. Consider the code below:

        my_polygon := my_rectangle
        print (my_polygon.perimeter)
        print (my_polygon.width)                -- Is invalid

We could apply perimeter to my_polygon and everything is fine ... we even get RECTANGLE's specialized version of the feature. But it is invalid for us to try to apply width to my_polygon even though we feel (with rather strong conviction) that at this point in execution, my_polygon will be attached to an object of type RECTANGLE, and we know that width is a valid query on RECTANGLEs.

The reason follows. When we declared my_polygon as type POLYGON, we made a deal that says that the only features that can be applied to my_polygon are the features of POLYGON. Remember that static typing guarantees us at compile time that at runtime there will be at least one version of the feature available that can be applied.

        print (my_polygon.width)                -- Is invalid

But in the case above, the guarantee cannot be made. my_polygon is declared with class POLYGON which has no width feature, despite the fact that some of its proper descendants might.

Does this mean that we can never do RECTANGLE things with this instance again, once we have attached it to my_polygon?

No. There is a language facility called the "assignment attempt" which will come to our rescue. The assignment attempt will allow us safely to attach our instance back to an entity typed as RECTANGLE. After doing so, we are free use RECTANGLE features.

        my_polygon := my_rectangle
        print (my_polygon.perimeter)
        another_rectangle ?= my_polygon
        print (another_rectangle.width)

The assignment attempt uses the syntax "?=", versus the ":=" of assignment.

This is significant ... as is the name assignment attempt. The reason is that it is possible in some context that my_polygon will be attached to something other than a rectangle when we do this:

        another_rectangle ?= my_polygon

If it were true that my_polygon were attached to an instance of say TRIANGLE when the assignment attempt above was executed, then another_rectangle would be left as a Void reference. As a consequence, it is prudent to check to see if the attachment has actually been made before trying to apply features. Applying a feature to a Void reference will cause an exception. Almost always, assignment attempt will be used in the following manner:

        my_polygon := my_rectangle
        print (my_polygon.perimeter)
        another_rectangle ?= my_polygon
        if another_rectangle /= Void then    -- Make sure assignment happened
            print (another_rectangle.width)

        end


Genericity

We got a very short introduction to generic classes when we were looking at the formal generic part of class structure in Eiffel Classes. That discussion left to the imagination the motivation and benefits for creating generic classes.

You will see that most of the generic classes model containers for multiple items and at least one of their formal generic parameters represents the type of items that are to be stored in the container. Some generic classes, like LINKABLE, care for only one instance of the type represented by their formal generic parameter.

Motivation

Imagine that a software producer is planning to build a class which would represent a list of things. Some one might ask "What kinds of things?" To which the producer would reply, "Just things. I want my list to be usable for all kinds of things."

Using the idea of polymorphic attachment that we learned in Inheritance, the producer could build such a class. It might have a query item which would return the thing from the list to which a cursor currently points. It might have a command put which would enter some new thing into the list.

What would be the type of item? And what would be the type of the argument to put?

If the producer wants the class to handle all kinds of things, then the answer must be class ANY, the class from which all others inherit.

class
    LIST_OF_THINGS
       .
       .

feature   -- Access

    item: ANY
            -- The thing currently pointed to by cursor

       .

feature   -- Element change

    put (new_item: ANY)
            -- Add `new_item' at the end of the list
       .
       .

This will work, but has some definite disadvantages. Suppose you choose to use this class to maintain a list of cats in one of your classes. You might make this declaration:

    my_cats: LIST_OF_THINGS
            -- A list of my cats

Then you could add individual instances to the list:

    fluffy, twinkie: CAT
       .
       .
        my_cats.put (fluffy)
        my_cats.put (twinkie)

One problem with this type of list is that the type system will not help you keep from doing something pathological like:

    fluffy, twinkie: CAT
    thor: PSYCHOTIC_HYDROPHOBIC_CAT_HATING_DOG
       .
       .
        my_cats.put (fluffy)
        my_cats.put (twinkie)
        my_cats.put (thor)

Another problem is that to do any CAT things with an item in the list, you must reattach it to a CAT entity. The following is invalid.

        my_cats.item.purr                     -- Is invalid

This is because "item" is type ANY and although it may be currently attached to an instance of CAT, the static typing system cannot guarantee that. So you must use assignment attempt as we saw in the polymorphism example in Inheritance.

    some_cat: CAT
        .
        .
        some_cat ?= my_cats.item
        if some_cat /= Void then
            some_cat.purr
        end

You can see that this type of list has its drawbacks. Of course you could build a LIST_OF_CATS class in which item and the argument for put would be of type CAT. This would let you purr a cat without pulling it out of the list, and it would also prevent you from accidently letting old Thor in with the cats. But, every time you needed a list to hold a different type of object, you have to write a new class.

Indeed, this is how things are done in environements without facilities genericity.

What we would like to have is a way to produce the text of the list class once. Then only when we make declarations do we add the additional information about the particular types we want allowed in the list.

Basic Genericity

In Eiffel this is accomplished through generic classes. Generic classes are written relative not to a specific class but to a kind of phony class name called a formal generic parameter. With genericity, the LIST_OF_THINGS class might become a class called LIST which is a list of items of type G. In class LIST we would declare item as type G, as well as the argument to put.

class
    LIST [G]
        .
        .
feature   -- Access
    item: G
            -- The item currently pointed to by cursor
       .
feature   -- Element change
    put (new_item: G)
            -- Add `new_item' at the end of the list
       .
       .

We could declare feature my_cats as a LIST of items of type CAT. By doing so we are providing CAT as an "actual generic parameter" in the declaration. Then we are free to treat the features of LIST as if the class name CAT had been substituted for every occurrence of the formal generic parameter G.

    my_cats: LIST [CAT]
            -- A list of my cats
    fluffy, twinkie: CAT
       .
       .
        my_cats.put (fluffy)
        my_cats.put (twinkie)
       .
        my_cats.item.purr          -- Valid now

The following would no longer be valid:

    my_cats: LIST [CAT]
            -- A list of my cats

    thor: PSYCHOTIC_HYDROPHOBIC_CAT_HATING_DOG

       .
       .

        my_cats.put (thor)         -- Is invalid

Constrained Genericity

The generic class LIST illustrated above is perfectly useful for making typed lists of any type of object. The features of the LIST will not attempt to use the objects in the list in any way. Sometimes though, it is important for a class to be guaranteed more about the nature of the types that can be substituted for its formal generic parameter.

Take for example the case of a class called SORTED_LIST. A SORTED_LIST is a list, of course, but it is special in that it acts upon the elements that it holds to keep them in order.

A SORTED_LIST needs to be able to order its elements. So, it must be able to apply queries to those elements to determine which should sort high than which. The elements themselves must respond to ordering operations.

If SORTED_LIST were defined like we did LIST

class
    SORTED_LIST [G]

there would be no guarantee that ordering operations, like "<" and ">" could be applied to all types that could be listed. An Eiffel facility called "constrained genericity" will solve this problem for us. In the case of SORTED_LIST, we would add to the formal generic part as follows.

class
    SORTED_LIST [G -> COMPARABLE]

You may remember from Inheritance that if we make instances of a class comparable with each other, then we make the class inherit from COMPARABLE and effect the feature "<".

Here, constrained genericity does two things for us.

  • First, it states that any candidate for substitution for G must conform to class COMPARABLE. Typically this means it must inherit from COMPARABLE.

  • Second, it allows, within the features of SORTED_LIST, the features of COMPARABLE to be applied to any item which has a type of G.


Design by Contract and Assertions

Motivation: Concerning Correctness

When you produce an element of software, how do you know that what you produced is correct?

This is a difficult question for anyone to answer. Informally speaking, correct software is software that does what it is supposed to do. That is what makes answering the question so tricky. Before you can have any idea whether the software is correct, you must be able to express what it is supposed to do ... and that proves to be quite difficult itself.

In conventional software engineering, a document called a software specification is written in order to describe what it is that a piece of software is supposed to do. Writers of software specifications tend to pursue one of two approaches: the informal or the formal.

Informal specifications attempt to describe software behavior in the natural languages with which humans communicate on a daily basis. There are problems with this approach. Natural language is not precise. Informal specifications are subject to interpretation and affected by the ambiguities, noise, and contradiction inherent in natural language.

In order to avoid these problems, proponents of formal methods of specification turn to the most precise language they know: mathematics. It may be no exaggeration that the study of formal methods has produced more PhD's in Computer Science than it has well-specified software systems. Still the idea that the precision of mathematics can be brought to bear on the problem of specifying software is quite appealing. But, problems lurk here as well. Formal specifications are difficult and time-consuming to construct and verify against themselves, and most software engineers do not have a working knowledge of the mathematics required to work with formal specifications.

There is one more significant problem with both of these approaches. Even if you have a very precise specification, expressed in elegant text and graphics, and placed carefully in an expensive ring binder, how do you know that the software product actually reflects that specification and vice versa? If either is changed, the other must be as well. This is the document synchronization problem.

Design by Contract to the Rescue

Design by Contract (DbC) begins as an implementation of some of the ideas from formal methods and matures into a powerful way of thinking about software. And it does it in a way that is easy for programmers and managers to understand. DbC also puts the software specification into the software document itself which makes it checkable at runtime and eliminates the document synchronization problem.

Model for Software Correctness

Design by Contract is built around a model for software correctness that is really pretty simple.

Suppose there is software routine called s. If we were going to test s, we would probably devise some test inputs or test values to be in place when s starts and then observe what things look like after s completes. If they look the way we think they should then that leads us to believe that S is working correctly for those test inputs.

We can generalize and formalize that process a bit, taking it back from testing an into design. If indeed we know what it means for s to be correct, then we should be able to make a statement of any conditions that must be true prior to executing s. That is, we will state the conditions required for it to be possible for s to run correctly. We call this statement of preconditions for success s's precondition.

Likewise we should be able to make a statement of the conditions that will be true always if s works correctly. This we call s's postcondition.

As an example, suppose s accepted an argument of type REAL and returned another REAL which was the square root of the argument. The precondition for s would be that the argument could not be less that zero, as there is no real square root for negative numbers. s's postcondition would be that the result multiplied by itself would yield the value of the original argument (give or take a little to allow for floating point error).

Assertions in Eiffel

Each Eiffel feature which is a routine, i.e. a function or procedure, can support one assertion for a precondition and one for a postcondition. We saw where precondition and postcondition fit into the structure of the routine in Adding Class Features . An assertion is expressed as one or more assertion clauses which are logically and-ed together to produce the assertion. Assertions clauses are boolean expressions that evaluate to true or false.

Let's look at another example. Assume you need to produce a class to model a time of day. Each instance of TIME_OF_DAY would hold some particular time of day accurate to the second between 00:00:00 and 23:59:59 inclusive.

As a producer, you would be faced with a decision concerning how to maintain the time internally in each instance. For the purpose of our example, let us consider two alternatives:

  1. Keep three instance of INTEGER. One each for hour, minute, and second.
  2. Keep one instance of INTEGER representing the time of day as the number of seconds since 00:00:00.

This would be an implementation issue for the producer, because it would not affect the services that TIME_OF_DAY could offer clients. If we have a query called minute the first alternative allows us simply to provide the value from storage. Whereas the second alternative will likely cause us to compute minute each time it is requested. But the service looks and works the same for the client in either alternative.

For now let us assume that we are using the first design alternative. In that case we would code class features for hour, minute, and second.

feature -- Access

    hour: INTEGER
            -- Hour expressed as 24-hour value

    minute: INTEGER
            -- Minutes past the hour

    second: INTEGER
            -- Seconds past the minute

Below is the code for a procedure set_second which receives an argument of type INTEGER and sets the value of the second feature to the argurment.

    set_second (s: INTEGER) is
            -- Set the second from `s'
        do
            second := s
        end

The routine is simple enough, but there is a problem with it. Suppose a client calls set_second with an argument whose value is invalid, say 3574. Our routine would just stuff this value into second and we would end up with an instance of TIME_OF_DAY which is invalid. In the days before Design by Contract, as soon as we recognized that this problem exists, we would go into "defensive programming" mode and code some "if" statements inside the routine to validate the argument, before acting.

Consider though what we can do with Design by Contract. We will add a precondition assertion to set_second that expresses the need for valid arguments.

    set_second (s: INTEGER) is
            -- Set the second from `s'
        require
             valid_argument_for_second: 0 <= s and s <= 59
        do
            second := s
        end

The precondition is introduced by the keyword "require". The text "valid_argument_for_second" is the label for the assertion clause. The boolean expression "0 <= s and s <= 59" says that a good value for s will be between 0 and 59 inclusive.

Remember that the precondition specifies those things that must be true if set_second has a chance of working correctly. As such, upon execution, the body of this routine will never be executed if an attempt is made to call it in a state that does not meet its precondition. Instead, the caller will incur a precondition violation exception. We will investigate more about what exceptions mean further in Exception Mechanism.

So, what about a postcondition? We noted earlier that a postcondition should make a statement of what will be true in the case that the routine does its work correctly. For set_second this means that after it finishes, the query second should have the same value as the argument that was received from the caller. Below is the feature with the postcondition added.

    set_second (s: INTEGER) is
            -- Set the second from `s'
        require
             valid_argument_for_second: 0 <= s and s <= 59
        do
            second := s
        ensure
            second_set: second = s
        end

The postcondition is introduced by the keyword "ensure". Here the expression "second = s" makes certain that the routine did actually do the necessary work to ensure that the value of second matches the value of the argument received.

As you look at the postcondition, you may be tempted to think that the one-line body of the routine is so simple as to make the postconditon unnecessary. To answer this concern we need to look again for a moment at software specification.

Specification of a Routine

If we remove the instructions from a routine and leave its signature, header comment and assertions, we have a specification for the routine.

    set_second (s: INTEGER) is
            -- Set the second from `s'
        require
             valid_argument_for_second: 0 <= s and s <= 59
        ensure
            second_set: second = s
        end

This specification of set_second tells us what is required of reuse consumers if they wish to use set_second and what set_second promises to do for them. Importantly, it does that without revealing how it does it does what it does.

So, this specification view, officially called the contract view, is how consumers of class TIME_OF_DAY would view the feature.

If this is the specification, then haven't we put the cart before the horse? The answer is yes. We have done so to illustrate the problems that assertion-based specification can help solve.

Instead of starting with a routine and adding a specification, we really want to start in accepted software engineering fashion with specification first, and then add implementation. Therefore, the specification you see above would exist before the implementation.

Now back to the concern over whether the postcondition is redundant for this simple one-line routine. Obviously, if this specification exists first, then the postcondition must be there, and it would be silly to remove it later. But, more importantly, suppose that when the producer of the class decided on an implementation, he or she chose the second design alternative we mentioned above. This would mean that the internal state of an instance of TIME_OF_DAY would be only one INTEGER with the number of seconds since midnight. That would mean that the query second would probably be a function that computed seconds from that one INTEGER instead of an attribute.

What would change in the specification of set_second? Nothing. The implementation for the routine would be more complex, but what it does, setting the second in an instance of TIME_OF_DAY, would stay the same.

In summary, the precondition and postcondition ensure for use that the routine will only execute if called in a state in which the precondition is true, and then will either complete in a state in which the postcondition is true, or cause a postcondition violation exception.

The Contract for a Routine

Having assertions on its routines forms a contract between the TIME_OF_DAY class and all potential reuse consumers. The contract is much like a contract in business, with obligations and benefits for both parties.

  • The client's benefits are outlined in the postcondition.
  • The client's obligations come from the precondition.
  • The supplier's obligations are in the postcondition.
  • The supplier's benefits come from the precondition.

We can see the specifics of these by using set_second as an example.

  • The client gets the desired value for seconds set in the instance.
  • The client must provide an argument that is valid for seconds.
  • The supplier must update the instance successfully.
  • The supplier need not risk disaster attempting to process in an invalid state nor waste time validating the argument received from the client.

Valid State for Instances

Assertions on TIME_OF_DAY's routines gives us specification for each routine and guarantees that if the specification of a routine gets violated at runtime we will be served immediately with an exception. This will go a long way toward preventing invalid instances from going unnoticed in a running system and fouling up lots of other stuff.

What will help even more is something called a class invariant. Using the class invariant we are able to state what it means for an instance of a class to be valid, or as it is sometimes put, in a stable state.

The class invariant is an assertion like precondition and postcondition, but there is only one per class. Check Eiffel Classes to see how the class invariant fits into the class structure.

How would we code the class invariant for TIME_OF_DAY? An instance would be valid if its hour were between 0 and 23 inclusive, minute were between 0 and 59 inclusive, and its second were between 0 and 59 inclusive. We can code the invariant as shown below.

    invariant

        hour_valid: 0 <= hour and hour <= 23
        minute_valid: 0 <= minute and minute <= 59
        second_valid: 0 <= second and second <= 59

The name invariant implies that the assertion can never be false ... and that's true up to a point. It's really more like, "it must be true at times when it really counts".

At runtime the invariant must be true for an instance at anytime that the instance is available to clients. In general, this means that the invariant must be true before and after the execution of every exported routine.

As with the assertions on routines, if ever the invariant is not true when it should be, then a class invariant violation occurs.

Remember in the example above, that the features hour, minute, and second are queries, but they could be either attributes or functions.

The Contract for a Class

Earlier we saw the contract for a routine. Now we can define the contract for a class as the aggregation of the contracts for all its exported features, plus its class invariant.

In Design by Contract we design based on these contracts. They are the specifications for the modules in our system. We work in a reuse-oriented world. Whenever we produce a class, we produce it with a comprehensive contract which serves as its specification. We build each class with the thought that it may eventually become reusable.

When we are in our reuse consumer role, using existing classes, we tend not to look at the implementations for the classes we use. Instead we look at their contract views. It is there that we find the obligations and benefits of using each class.

Contracts and Debugging

We saw earlier that having contracts in the code tends to expose bugs at an early stage of development. It is possible selectively to turn off and on the runtime checking of assertions by changing project settings. Checking assertions does involve processing. More about turn off assertion checking in a moment.

Having contracts on a class gives another advantage when the contract gets broken. The contract tells us whose fault it is. Whenever there is a violation of a precondition, postcondition, or class invariant then the software is out of specification. This situation is called a defect, or bug.

Whose fault is it? If a precondition was violated, then a client class attempted to call a routine in a supplier, but made the call in a state that did not satisfy the supplier's precondition. Therefore the bug is in the client.

If a postcondition was violated, then a client made a call in a state that did satisfy the supplier's precondition, but the supplier was unable to complete the work as agreed. Therefore the fault lies with the supplier.

If a class invariant was violated, then the instance has been placed in an invalid state during the execution of a routine, and left that way when the processing completed. This caused the invariant violation. As with the postcondition violation, because the problem occurred while executing routines in the supplier, preconditions must have been met. The supplier then is to blame.

Based on this knowledge, we can say that it is most practical first to turn off runtime checking of postconditions and invariants as we gain confidence in a class. Meaning of course, that we feel confident that any calls that meet preconditions will be properly processed. Then our only worry is that some deranged client will, with total disregard for our carefully crafted preconditions, make calls to our routines from invalid states. So, maybe we will leave precondition checking turned on for a while.

Contracts and Inheritance

In the section titled Inheritance you saw that it was possible through inheritance to produce a new class that has all the features of an existing one. This is a very powerful notion, and could be dangerous. What would keep descendants from redefining inherited features with semantics that were totally different from those intended by the producer of the original class? Nothing if it were not for the contract.

Simply speaking assertions on a parent class, preconditions, postconditions, and class invariants, all are inherited by the class's proper descendants.

For class invariants, if any new invariants are coded in an heir, they will be added to those inherited from the parent, using a non-strict version of logical "and" (We will define non-strict booleans in Writing Assertions below).

That is simple enough. And the situation is also simple for effective routines inherited and left unchanged ... the contracts stand as written.

From our example above you may have gotten the idea that contracts are really useful only for effective routines. Such is not the case. In fact, specifying a contract on a deferred routine is really a powerful notion. It says not only that effective descendants must provide an implementation for this routine, but also that there is a contract that must be satisfied. Effecting or redefining a routine in a descendant class will not make the contract go away. Here is an feature from the Base Library deferred class ACTIVE which models data structures with a current item, and is an ancestor to many effective container type classes.

feature -- Element change

    replace (v: G) is
            -- Replace current item by `v'.
        require
            writable: writable
        deferred
        ensure
            item_replaced: item = v
        end

Feature replace carries the semantics necessary for replacing an item in an ACTIVE. It does not, however provide an implementation. All implementers must produce versions of replace that satisfy the contract specified here.

It actually is possible to alter a feature assertion in an effected or redefined version(technically its a replacement of the original version):

  • The precondition can only become weaker than in the inherited contract.
  • The postcondition can only become stronger than in the inherited contract.

These rules are imposed as a consequence of the effect of effected or redefined routines on polymorphism and dynamic binding. But, you can understand them from an intuitive viewpoint, if you reconsider the business contract analogy. Suppose a contractor makes a deal with a client to do certain work (represented by the postcondition). Part of the deal might be that the client agrees to have a site ready by a certain date (represented by the precondition). The contractor represents the parent class in the analogy. Now suppose the contractor brings in a subcontractor (representing the heir class) to do a portion of the work. The subcontractor cannot force the client to change the date that the site is to be ready to an earlier date (no strengthing of the precondition). The deal with the client was made by the contractor and so no new or stronger requirements can be imposed by the subcontractor. Likewise the subcontractor must provide at least as much work as was bargained for by the contractor, but may promise to provide more if appropriate (strengthing of postcondition is allowed.)

In Writing Assertions below you will see the syntax for weaking preconditions and strengthening postconditions.

Unfinished Business

In the section Adding Class Features, we promised to explain two issues during this discussion of Design by Contract.

Short Routines

One of these is the tendency of mature Eiffel programmers to write routines that are quite short. It should be clear by now that we wish to build a contract on each routine. The contract describes the semantics of the routine in a declarative fashion. In other words, it tells what the routine does, without giving an indication of how it does it.

Try to imagine giving a declarative description of a routine that was 50 lines long. Hardly possible. So decomposition of complex computations into chunks small enough to describe with assertions is what gets done.

Command/Query Separation

In Adding Class Features, we saw that we can categorize features as either queries or commands. A query will ask a question or make an observation about an instance. A command will tell the instance to take some action which may result in changing the instances internal state.

We said that when program routines, that those routines should either be commands or queries but not both. Importantly, asking a question about an instance should not change the instance. Likewise, taking an action that changes the state of an instance should not return a result.

Here's the rationale. In a routines postcondition we use boolean expressions to ensure that the routine has done its job properly. Likewise, class invariants, which define the valid state for instances, are written as boolean expressions. In both cases we may use the features of the class which are queries to ask about an instances current state.

If a query that we use in an assertion were to change the state of the instance, then the result we received would be invalid as soon as we received it.

Therein lies the primary reasoning behind command/query separation. You cannot reason about the integrity of an object if the act of asking a question changes the object.

Writing Assertions

You have seen fairly typical assertions written in the examples above. Study the classes in the libraries to see some excellent working examples. There are a couple of things that need to be covered.

Non-Strict Booleans

One is that, as you can probably imagine, it is not a good thing to cause an exception during the process of checking an assertion. One of the most common ways to cause such an exception is to apply a feature to a Void reference.

The way to avoid this is to use the non-strict booleans "and then" and "or else". These forms of "and" and "or" do not force the checking of all conditions. As soon as a determination can be made, they stop checking. It is typical to see "and then" used to avoid applying a feature to a void reference in preconditons. Below is a creation procedure that uses a non-strict boolean in its precondition.

    make (a_nm: STRING; a_offset: INTEGER) is
            -- Initalize with name `a_nm' and utcoffset `a_offset'
        require
            name_not_empty: a_nm /= Void and then not a_nm.is_empty
            offset_valid: a_offset >= -12 and a_offset <= 12
        do
            name := clone (a_nm)
            utcoffset := a_offset
        ensure
            name_initialized: name.is_equal (a_nm)
            utcoffset_initialized: utcoffset = a_offset
        end

Replacing Inherited Feature Assertions

To replace a precondition on a feature you are effecting or redefining, you use the "require else" keywords to introduce new conditions. These conditions will be logically "or-ed" with the original precondition to form an new one.

Likewise use "and then" to add conditions to a postcondition. The added conditions will be "and-ed" to the original.

Below is an example of weakening a precondition. The first feature shown is from class DYNAMIC_CHAIN in the Base Library.

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require
            left_exists: index > 1
        deferred
        ensure
            new_count: count = old count - 1
            new_index: index = old index - 1
       end

The next feature is from DYNAMIC_LIST, a proper descendant of DYNAMIC_CHAIN. DYNAMIC_LIST weakens the precondition it inherited from DYNAMIC_CHAIN. Originally in DYNAMIC_CHAIN, "index > 1" was required for remove_left. In DYNAMIC_LIST either "index > 1" or "not before" (or both) will suffice.

    remove_left is
            -- Remove item to the left of cursor position.
            -- Do not move cursor.
        require else
            not_before: not before
        deferred
        end

Not Writing Assertions

Let's close this discussion of Design by Contract with one more interesting and point to make about assertions. The precondition and postcondition parts of a routine are optional, as you may remember from Adding Class Features. Suppose you write a routine and do not code either precondition or postcondition. You might be tempted to think that you have simply written a routine that has no contract. But, that would not be the case.

The contract exists, even though you do not code it explicitly. If it were written out, it would look as follows.

    my_routine is
            -- My descriptive header comment
        require
            True
        ensure
            True
       end

What does this mean? It means that you have selected the weakest possible precondition and postcondition for your routine. Of course, this may be perfectly valid under some circumstances.

Just understand that if your routine could speak, it would be telling you, "I can always work successfully without any particular guarantees from you at all. On the other hand, I won't promise you any particular results when I get done."


Exception Mechanism

Motivation: Concerning Robustness

The notion of software correctness that we saw in Design by Contract and Assertions is half of the formula for software reliability. Correctness covers what the software is supposed to do, that is, its specification.

Of course, there is always a potential for things to go out of the bounds of the specification. This happens, for example if a client makes a call to a routine from a state in which the routine's precondition is not true.

How well software responds to situations which outside specification is called robustness. Together correctness and robustness define software reliability.

Consequences of Contracts

In the presence of Design by Contract, what happens to running software boils down to a simple rule:

A routine call can complete in one of only two ways:

  1. The routine fulfills its contract.
  2. The routine fails to fulfill its contract.

As a follow-on, we can add that:

  • Any routine that fails to fulfill its contract must cause an exception in its caller.

Reacting to Exceptions

Again, because of Design by Contract, we can state the following rule for dealing with exceptions:

A routine that incurs an exeception can react in one of only two ways:

  1. It can return the instance to a stable state and retry the entire routine with the same or a different strategy.
  2. It can fail, causing an exception in its caller.

There is an Eiffel mechanism called the rescue clause which facilitates the first alternative.

The Rescue Clause

The rescue clause is part of the routine structure we saw in Adding Class Features. The rescue clause is a sequence of instructions introduced by the keyword "rescue". At the point that an exception occurs, the processing of the normal instructions in the routine body will cease, and the instructions in the rescue clause will be executed instead.

If the instructions in the rescue clause can set things up so that it might prove fruitful to attempt to retry the routine, it can do so by issuing a retry instruction. When the retry instruction is executed, the routine is restarted from its beginning, although local entities are not re-initialized. You will see why in the example below.

If the rescue clause exits without issuing a retry instruction, then the routine fails.

It should be noted that rescue clauses and retry instructions are not something that are used commonly. Out of the approximately 2000 class in the delivered Eiffel libraries, there are only 16 occurrences. Many of these are oriented toward network and database operations for which some reasonable recovery might be possible.

    transmit: (p: PACKET)
            -- Transmit packet `p'
        require
                packet_not_void: p /= Void
        local
            current_retries: INTEGER
            r: RANDOM_NUMBER_GENERATOR
        do
            line.send (p)
        rescue
            if current_retries < max_retries then
                r.next
                wait_millisecs (r.value_between (20, 500))
                current_retries := current_retries + 1
                retry
            end
        end

In the example above, rescue is used to recover from a situation in which an exception occurs in trying to send a packet. When the exception occurs the rescue clause will, if the maximum number of retries has not been reached, wait for some random length of time. Then, after having updated the number of retries, it will issue the retry instruction. If the maximum number of retries is reached, the rescue clause will exit without executing the retry, constituting a failure.


Event Programming with Agents

In Eiffel there is a facility referred to as agents.

The implementation of agents is an advanced topic, but you do not have to understand the details of the implementation of agents to put agents to work for you. That is what you will learn in this section.

Objects that Represent Operations

Object technology is based on the idea that when we model real world objects, we model them based on the things that they have and what they can do ... their properties and their operations. The operations in Eiffel are the routines, i.e., the functions and procedures, of classes. Operations are not objects.

Having said that, it is sometimes desirable for us to model operations. We do this in the same fashion that we model other concepts: statically as classes, and as objects at runtime.

An object that represents an operation is called an agent.

If we can have a runtime object that represents an operation, then we can place the object in the structure of another object, where at some later time, a client can cause the associated operation to execute.

This is a very desirable model for event driven processing, like graphical user interfaces. The operations that are executed when a user take some action like clicking on a button, could be represented by agents. When the user interface element is initialized, agents that represent the action routines are stored within the interface element. Then at the time that an event, say a button click, occurs, the agents for that event are retrieved and their associated operations are executed.

Another area in which agents are commonly used is in traversing data structures. Many of the data structure classes in the Base Library include routines which take agents as there arguments. For example, the feature do_all takes an agent which represents some procedure and will apply the procedure to every item in the structure.

Classes to Model Operations

We know that there are two types of routines in Eiffel, functions and procedures.

Not surprisingly, the implementation of agents relies on three classes in the Base Library. Class ROUTINE, and its heirs FUNCTION and PROCEDURE.

When you use an agent from a client routine, you will be building an instance of either FUNCTION or ROUTINE. This happens implicitly as you will see.

Using Agents

Below is an instruction which passes an agent as an argument to a procedure.

        button.select_actions.extend (agent gauge.step_forward)

In this example, the producer wants to add the action of stepping the gauge forward in the event that a button is clicked. The keyword "agent" is used to indicate that at runtime an object of type PROCEDURE should be created which represents applying the feature step_forward to the object attached to gauge. It is the object of type PROCEDURE that is passed as the argument.

It is important to understand that step_forward does not get applied at the point that the instruction above is executed. Rather the procedure object that represents step_forward is given to the button to hold in reserve. Then at the point that the button click event takes place, the button will go through its list of select_actions executing their associated routines. Only then does step_forward get applied to gauge.

Agents with Arguments

In this example, the routine "step_forward" on which the agent is based takes no arguments. If you drilled down into the workings of this example you would find that class that implements the feature extend is class EV_NOTIFY_ACTION_SEQUENCE. You would also see that the signature for the feature extend is as essentially as follows.

        extend (v: PROCEDURE [ANY, TUPLE])

We don't have to know too much about the workings of agents to see that "extend" takes an argument v which is of type PROCEDURE. It turns out that the actual generic parameter TUPLE represents the set of "open" arguments. In this case, extend is expecting an agent which has no open arguments.

Open and Closed Arguments

It is this business of open and closed arguments which really makes agents remarkable. To get a feel for it, let's simplify the example some. Instead of considering an agent passed as an argument let's look at it as a simple assignment within a class.

Suppose a class has a feature declared as shown below.

        my_procedure: PROCEDURE [ANY, TUPLE]

Then what can be assigned to my_procedure?. An agent, of course. Say the class has procedures as follows.

    no_argument_procedure is
            -- A procedure with no arguments
        do
            print ("No argument here!%N%N")
        end

    two_argument_procedure (an_int: INTEGER; another_int: INTEGER) is
            -- A procedure with two arguments
        do
            print ("My arguments are: " + an_int.out + " and " + another_int.out + "%N")
        end

Then the following assignment is valid.

        my_procedure := agent no_argument_procedure

What this means is that the agent created and associated with the procedure no_argument_procedure must conform to the type PROCEDURE [ANY, TUPLE]. The feature my_procedure (which is of type PROCEDURE) can be attached at runtime to an agent representing a procedure with no open arguments, which indeed is what no_argument_procedure is.

Now let's turn our attention to the other procedure two_argument_procedure. You might think that because it takes two arguments, that you would not be able to build an agent from it which could be assigned to the attribute my_procedure. But you can do it by closing the two arguments at the time that the agent is created, as in the following.

        my_procedure := agent two_argument_procedure (1, 2)    -- Is Valid

What happens here is that values are fixed for those arguments at the time that the agent, an object of type PROCEDURE [ANY, TUPLE] is created.

So this is the wonderful thing about agents. A routine which will be represented as an agent does not have to be an exact fit for the expected signature. By closing some arguments at agent creation, you have effectively produced a new and conforming routine.

The advantange of this is that you can sometimes avoid building specialized routines for the sole purpose of having a routine which conforms to the agent signature.

To leave an argument open, you hold its place with a question mark. If you intend for all arguments to be open, then you may make them all question marks, or leave off the arguments entirely.

        my_procedure := agent two_argument_procedure (?, 2)    -- Argument 1 left open
        my_procedure := agent two_argument_procedure (?, ?)    -- Both arguments left open
        my_procedure := agent two_argument_procedure           -- Both arguments left open

If an argument is open, then it means that a value is not provided for that argument at the time that the agent is created. The implication is that the value must be provided at some time prior to the time that the agent's associated routine gets executed. A precondition to executing a routine associated with an agent is that the agent has a valid set of arguments (called operands within the ROUTINE classes) for the call. If you were to leave one or both of the arguments to two_argument_procedure open as in the examples above, the assignment would still work due to the rules governing TUPLE conformance. But, at runtime unless the other arguments had been provided, the "valid operands" precondition would be violated.

Let's see an example in which we leave a target open. Suppose we have a class that has a feature coded as below

        my_strings: LINKED_LIST [STRING]

and some code to put some strings in my_strings:

            create my_things.make
            my_strings.extend ("Hello")
            my_strings.extend ("World!")

Our class also has a feature called print_on_new_line which we created to print a string preceded by a new line character.

        print_on_new_line (s: STRING) is
            -- Print `s' preceded by a new line
        do
            print ("%N" + s)
        end

Now suppose we want to print the values of all the strings in my_strings each on a separate line by invoking print_on_new_line. Traditionally, we would do it by traversing the LINKED_LIST and printing each item. Like this:

            from
                my_list.start
            until
                my_list.exhausted
            loop
                print_on_new_line (my_list.item)
                my_list.forth
            end

The availability of agents gives us new options. LINKED_LIST has a feature do_all which comes to it from its ancestor LINEAR. The do_all feature's signature looks like this:

        do_all (action: PROCEDURE [ANY, TUPLE [G]])

As an argument do_all takes an agent based on a procedure with one open argument which is the same type as the list items (in this class, G is the formal generic parameter representing the type of the items being stored). Then it traverses the list executing the routine associated with that agent and providing the current list item to satisfy the open argument.

Instead of coding the loop shown above, we can code this instruction:

             my_list.do_all (agent print_on_new_line (?))

we leave the argument to print open, and do_all will provide it as a reference to the current list item as it traverses the list.

Targets for Agents' Routines

In Eiffel every routine must be applied against a target object. In our model for computation, x.f (a, ...), x is the target of the application of feature f. In the case of an agent, the agent must account for objects for each of the arguments and an object for the target of the routine.

Let's identify the targets in the examples shown. First:

        button.select_actions.extend (agent gauge.step_forward)

Here the target is the object attached to the entity "gauge" which is (although you cannot determine it from this line taken out of context) an object of type EV_GAUGE.

How about this:

        my_procedure := agent two_argument_procedure (1, 2)

Here, since there was no qualification, then the target is the current instance. Same with this:

        my_list.do_all (agent print_on_new_line (?))

Again, consider the fact that the agent must account for objects for each of the arguments to a routine, and an object for the target. So, in the examples we've seen so far, the target is close, that is provided at the time of the creation of the agent.

But we can actually leave the target open as well. Now we cannot use the question mark notation to do that, because if we did, there would be no way to know of which class the routine is a feature. So instead, we mark an open target with the class name in braces.

Suppose in our list of strings example, we wanted to print the strings, then convert them to lower case, then print them again. Remember that "do_all" has one open argument, which will be provided as the current list item during the traversal.

            my_list.do_all (agent print_on_new_line (?))
            my_list.do_all (agent {STRING}.to_lower)
            my_list.do_all (agent print_on_new_line (?))

In between printing the list two times, we provide do_all with an agent that representing the STRING class's feature to_lower which will convert each string in the list to lower case. Notice that to_lower does not take an argument of type STRING as print_on_new_line did. Rather it gets applied to an instance of STRING, so it is targeted to a string. So we leave its target open and do_all provides the current list item as the target.

Agents for Functions

So far all the agents that we have coded have created instances of PROCEDURE. But functions are routines and can be represented as agents as well. The difference is that functions have a return value.

Let's extend the string example by using an agent that represents a function. Suppose we wanted to print only those strings which contain a particular character, say the exclamation point.

Here again we'll use a feature of the LINKED_LIST class. There is a feature called do_if which takes two agents as arguments. One is an action procedure like the argument that do_all takes, and the other is a function which returns a boolean and used as a test. As each list item is current, the test is applied first. If the result is true, then the action is applied with the current item.

    my_list.do_if (agent print_on_new_line(?), agent {STRING}.has('!'))

The agent for the action is the same as we used earlier. We've added an agent for the test. It represents applying the has feature of the STRING class. Here the target is left open, because we want each of the strings in the list to be the target of has.


Using Referenced Assemblies

Eiffel for .NET is a first class citizen in the Microsoft .NET programming world. This means that if you are programming in Eiffel for .NET, say with ENViSioN!, you have full access to the thousands of software components in the .NET type libraries. But, that's not all. You also have full access to the thousands of components in the traditional Eiffel class libraries. And even that's not all. You have the ability to build software components which comply with .NET standards, so that they can be used by programmers using any other .NET language. Still not all. When you use Eiffel, you can choose to build software that will run under Microsoft .NET, but will be portable to other popular operating systems as well.

Being an Eiffel for .NET programmer obviously put you in a very powerful position. How do you take advantage of it?

To use .NET software components from Eiffel for .NET requires you to have some understanding of both .NET and Eiffel and how their respective object models differ. If you have read the rest of the help topics in this section then you have a pretty good idea of what the Eiffel method and language are all about.

When you begin to build software in Eiffel for .NET, you will likely find a need to reuse types from the .NET libraries. These libraries are called assemblies. When you reference a assembly using Eiffel for .NET, the types in the assembly become available to you in a form that makes them look like so many Eiffel classes. The names for types and members will conform to Eiffel conventions. The same thing happens when you are programming against assemblies in Visual Basic .NET or Visual C# .NET.

The section called Conventions covers the details the Eiffel conventions and how the .NET types are made available to Eiffel for .NET programmers.


Eiffel for .NET Limitations

Differences between Eiffel, Eiffel for .NET and .NET

Differences between Eiffel and Eiffel for .NET

Limitation of Eiffel for .NET in version 5.2

Most of the Eiffel mechanisms are supported in 5.2. All missing features listed below are planned for addition in future releases:

  • No creation of Eiffel expanded class support
  • Partial implementation of generic conformance (same as what was supported up to and including ISE Eiffel 4.2).

Eiffel for .NET supports:

  • Multiple Inheritance
  • Design By Contract
  • Exception handling
  • Genericity
  • Covariance
  • Compilation of any existing Eiffel libraries as long as it does not include C externals that call into the ISE C runtime

Added to Eiffel and Eiffel for .NET

The following syntax can be used to declare .NET custom attributes on Eiffel entities (features and classes):

empty: BOOLEAN is
    indexing
        description: "Is Current empty?"
        attribute: create {SYSTEM_OBSOLETEATTRIBUTE}.make_obsoleteattribute_1 ("Use `is_empty' instead") end
    obsolete
        "Use is_empty instead"
    do
        Result := is_empty
    end

The previous example shows the declaration of the obsolete feature empty . The custom attribute defined by SYSTEM_OBSOLETEATTRIBUTE is used to ensure that any consumer of the resulting assembly will see the feature as being obsolete. The custom attribute is defined in the indexing clause attribute. The definition consists of a creation expression that creates the custom attribute with the right parameters.

Differences between Eiffel for .NET and .NET

Covariance

The CLR (Common Language Runtime) does not support covariance due to the type safety issue that full covariance implies (known as polymorphic CATCALLS in Eiffel). Although very rare, CATCALLS are not suitable to .NET where safety is one of the primary goals.

Eiffel for .NET implements a safe variant of covariance that will always perform a check on the types to avoid a CATCALL. So when a CATCALL is going to be performed a `Invalid Cast Exception' will be raised by the CLR instead of an unexpected behavior as it is currently done in Eiffel.

Another advantage of Eiffel for .NET's implementation of covariance is that it can be easily understood by CLS compliant consumer tools. These tools will actually benefit from the Eiffel for .NET covariance.

Genericity

The CLR does not support generics at all, so that the following Eiffel for .NET classes:

  • LIST [ANY]
  • LIST [INTEGER]

will actually be generated as:

  • LIST_ANY
  • LIST_Int32

Meaning that if one wants to reuse an Eiffel generic class from another language than Eiffel for .NET, one has to use either LIST_ANY or LIST_Int32.

Enum types

Eiffel for .NET supports .NET enum types implicitly. From the point of view of Eiffel, they are just considered as expanded classes. The only difference is in the code generation. Eiffel for .NET cannot declare new enum types yet.

ByRef

Eiffel does not have the notion of `byref' argument passing. At the moment, Eiffel for .NET cannot call nor can it redefine a feature that has a byref argument.


Known issues

Known issues with the Eiffel for .NET compiler

Eiffel issues

  • Check here first for the Difference between Eiffel and Eiffel for .NET.
  • The root creation routine of the root class must not take any arguments. You can access the command line given to the application via the class ARGUMENTS.


Samples

Dotnet samples

In this chapter you will find a series of examples that will permit to you to understand the bases of programming with Dotnet.

However, you should be familiar with Object-Oriented programming model.

Console sample

  • Calculator

Threads Samples

  • Pools
  • Timers

ADO.NET sample

  • ADO.NET

Windows Form samples

The following samples are classified from the easiest to the most complex one. So, some notions are introduced in the few first samples and will not be explained again in the complex samples!

  • Hello world form
  • Message box
  • Calendar and dates
  • Progress bar
  • Adding Menu to a Form
  • Writing MDI Applications
  • Tree view
  • Calculator
  • Text (gdi plus)


ADO .NET Samples

  • Ado


Dotnet examples

ADO.NET example

This sample consist in a command line showing how to interact with a database.

The DataReader object is somewhat synonymous with a read-only/forward-only cursor over data. The DataReader API supports flat as well as hierarchical data. A DataReader object is returned after executing a command against a database. The format of the returned DataReader object is different from a recordset. For example, you might use the DataReader to show the results of a search list in a web page.

Compiling

Running

After you launch the sample, the following output appears:

Customer ID    Company Name
ALFKI    Alfreds Futterkiste
ANATR    Ana Trujillo Emparedados y helados
ANTON    Antonio Moreno Taquer¡a
AROUT    Around the Horn
BERGS    Berglunds snabbk”p
BLAUS    Blauer See Delikatessen
BLONP    Blondesddsl pŠre et fils
BOLID    B¢lido Comidas preparadas
BONAP    Bon app'
BOTTM    Bottom-Dollar Markets
BSBEV    B's Beverages
CACTU    Cactus Comidas para llevar
CENTC    Centro comercial Moctezuma
CHOPS    Chop-suey Chinese
COMMI    Com‚rcio Mineiro
CONSH    Consolidated Holdings
DRACD    Drachenblut Delikatessen
DUMON    Du monde entier
EASTC    Eastern Connection
...	...	...
WILMK    Wilman Kala
WOLZA    Wolski  Zajazd

When the display is finished, the application wait for you to pressed the return key to finish the application.

Under the Hood

This application shows how to interact with a database. First the connection to the database is open (create my_sql_connection.make_from_connection_string (my_database)), then a request to the database is made (create my_sql_command.make_from_cmd_text_and_connection (my_command, my_sql_connection)). Finally, the result of the request is displayed.

This sample contains the following class:

  • SQL_DATA_READER
  • SQL_CONNECTION
  • SQL_COMMAND

Notes

This sample is translated from the example located in the QuickStart\howto\samples\adoplus subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Console Samples

  • Calculator


Calculator

The Calculator Sample

This sample consists of a command line reverse Polish notation (RPN) calculator.

Note: A RPN calculator works slightly differently from standard calculators. It consists of a stack of numbers. Operations are applied to the two numbers on top of the stack. The result is then put on top of the stack so that it can be used in the next operation. This sample refers to the top of the stack as Accumulator.

Compiling

Running

After you launch the sample, the following text appears in a console:

*********************************
Calculator in reverse Polish form
*********************************
Allowable operations are:
        '/': Divide top two numbers on the stack.
        '0': Empty the stack.
        'a': Enter operand onto stack.
        '?': Help.
        '*': Multiply top two numbers on the stack.
        '+': Add top two numbers on the stack
        'q': Quit.
        '-': Subtract top two numbers on the stack.
Enter a number, followed by :

Enter the first number to be put onto the stack, for example 3.

Note: Failing to enter a number at this stage will cause the sample to stop. This sample was designed to showcase the use of EiffelBase data structures and is not protected against unexpected entries.

You may then add another number on the stack by entering the character a:

*********************************
Calculator in reverse Polish form
*********************************
Allowable operations are:
        '/': Divide top two numbers on the stack.
        '0': Empty the stack.
        'a': Enter operand onto stack.
        '?': Help.
        '*': Multiply top two numbers on the stack.
        '+': Add top two numbers on the stack
        'q': Quit.
        '-': Subtract top two numbers on the stack.
Enter a number, followed by : 3

Accumulator = 3

Next operation? a
Enter a number, followed by :

Enter a second number, for example 2. You can then apply any operation to the two operands such as minus:

...
Next operation? a
Enter a number, followed by : 2

Accumulator = 2

Next operation? -

Accumulator = 1

Next operation?

You may use the operation 0 to clear the stack at any time. You may use q to quit the program.

Tip: You can use the command ? to display the list of available operations.

Under the Hood

This sample shows how to leverage EiffelBase data structures in a simple Eiffel system. The root class CALCULATOR first instantiates all state objects, each corresponding to one possible operation. The state classes all inherit from STATE. They are:

  • PLUS: Add stack's two top numbers.
  • MINUS: Substract stack's two top numbers.
  • MULTIPLY: Multiply stack's two top numbers.
  • DIVIDE: Divide stack's two top numbers.
  • EMPTY: Empty stack.
  • HELP: Prints available commands.
  • QUESTION: Get number from user.
  • QUIT: Close application.
Each of these classes implement the feature do_one_state from STATE which performs the operation associated with the state. The initial state is QUESTION which asks for the initial number to put in the accumulator. Following states depend on the user input.
Every descendant of STATE implement the feature operation which performs the corresponding stack transformation.


Threads Samples

  • Pools
  • Timers


Pools

Pools example

This sample demonstrates use of the THREAD_POOL (ThreadPool) class. The sample queues up an asynchronous method call that is executed by a thread from the thread pool managed by the Common Language Runtime. The method "does some work" and then sets an event indicating that the work has finished. The main thread waits on the event and then exits.

Compiling

Running

After you launch the sample, the following output appears:

Main thread: Queuing an asynchronous operation.
Main thread: Performing other operations.
WorkItem thread: Performing asynchronous operation
Main thread: Waiting for asynchronous operation to complete.

When the display is finished, the application wait for you to pressed the return key to finished the application.

Under the Hood

This application shows how to use the thread THREAD_POOL. An asynchronous thread is launched (feature {THREAD_POOL}.queue_user_work_item_wait_callback_object (create {WAIT_CALLBACK}.make (Current, $my_async_operation), l_async_operation_done)) and is associated to the local variable l_async_operation_done. Both threads perform simultaneously some operations. The main thread wait for the asynchronous thread to complete his own operations (l_async_operation_done.wait_one) to close the application.

This sample contains the following class:

  • THREAD_POOL
  • WAIT_CALLBACK
  • AUTO_RESET_EVENT

Notes

This sample is translated from the example located in the Samples\Technologies\Threading\Pools subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Timers

Timers example

This sample consist in a command line demonstrating the use of the TIMER (Timer) class to generate a periodic callback to a method. The sample creates a TIMER object and passes to it a delegate object. When the TIMER fires, the delegate is invoked, and a static method is called asynchronously by a worker thread in the thread pool.

Compiling

Running

After you launch the sample, the following output appears:

Checking for status updates every two seconds
     <Hit Enter to terminate the sample>
Checking Status.
Checking Status.
Checking Status.
Checking Status.
Checking Status.
...

When the display is finished, the application wait for you to pressed the return key to finished the application.

Under the Hood

This application shows how to use the thread TIMER. The timer is launched (create my_timer.make_with_callback (create {TIMER_CALLBACK}.make (Current, $check_status), Void, 0, 2000)) and call the feature check_status that displays the message "Checking Status." every two seconds.

This sample contains the following class:

  • TIMER
  • TIMER_CALLBACK

Notes

This sample is translated from the example located in the Samples\Technologies\Threading\Timers subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Winform Samples

The following examples are classified from the easiest to the most complex one. So, some notions are introduced in the few first examples and will not be explained again in the complex examples!

Getting started

  • Hello world form
  • Message box
  • Adding Menu to a Form
  • Writing MDI Applications

Building applications

  • Calculator
  • Text (gdi plus)


Calculator

Calculator application sample

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. This is a really simple calculator that can take only two operands. So you should enter the first operand, then enter an operator, then the second operand. Click the "Calculate" button to generate the result.

Under the Hood

The application uses two local external assemblies, math.dll and parserutils.dll.

paserutils parses the command line entered, and checks if it is of the form operand1 operator operand2. math.dll calculates the actual result of the command line.

For the parserutils.dll, we have been obliged to introduce the prefix "parser_" to avoid conflicts between name classes.

This sample contains the following class:

  • FORM
  • BUTTON
  • TEXT_FIELD
  • LABEL

Notes

This sample is translated from the example located in the Tutorials\resourcesandlocalization\worldcalc subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Hello world sample

Date time picker sample

Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. On the left side of the main window a date is displayed in a COMBO_BOX. Clicking on this COMBO_BOX and a CALENDAR control will appear showing the same date than in the COMBO_BOX. On the the right side of the main window are the commands to control the format of the displayed date and the style of the CALENDAR control.

Clicking on the "Change font" button and a change font dialog box will appear.

Clicking on the "Change color" button and a dialog box will appear that will permit you to customize the color appearance of the calendar thought a color dialog box.

Under the Hood

This application uses several different controls, but tend to show how to parameter the CALENDAR control using the FONT_DIALOG and COLOR_DIALOG.

When one of the buttons "Change font" or "Change color" is pressed, an event is launched and open the corresponding dialog box.

When the entry in the COMBO_BOX format change, an event is launched and modify the format of the displayed date.

This sample contains the following class:

  • CALENDAR
  • COMBO_BOX
  • BUTTON
  • LABEL
  • GROUP_BOX
  • CHECK_BOX

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\controlReference\dateTimePicker subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


GDI plus - text

Text sample

Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above.

Under the Hood

This sample show how to draw some text in a window, using different brushes, different fonts, different style and different colors.

This sample contains the following class:

  • FORM

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\gdiplus subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


MDI

MDI (Multiple Document Interface) sample

Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. The main window contains a menu with three entries (File, Format and Window). This menu can merge with its child windows (Document).

In the "File" entry, you can add a child window (Document), display the active child window, and exit the program.

You can change the format of the text displayed in the child windows using the entry "Format" in the menu.

You can chose the organization (cascade, title horizontal or title vertical) of the child windows using the entry "Window" in the menu.

Under the Hood

This application demonstrates how to create a multiple document interface. More information regarding the use of a MDI, is available here.

This sample contains the following class:

  • FORM

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\MDI subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


MDI Details

Using Multiple Document Interface Applications

Multiple Document Interface (MDI) applications have a single, primary window (the parent window) that contains a set of windows within its client region (child windows). Each child window is a form that is constrained to appear only within the parent. Children typically share the menu bar, tool bar, and other parts of the parent's interface. Secondary windows like dialog boxes are not constrained to the parent window's client region.

Creating an MDI Application

You can create an MDI application by following these steps:

  1. Create a Form (MainForm) that represents the MDI parent window and set its IsMdiContainer property to true. The following code demonstrates how to set this property.
    set_is_mdi_container (True)
  2. Create child forms and set the MdiParent property of each form to reference the parent form. The following code demonstrates setting the MDI parent for an instance of a child form.
    doc.set_mdi_parent (Current)

If you have different types of data to display, you can have multiple types of child forms. To display a child form, create an instance of the child form and call its Show method.

Standard MDI Menus

Typically, an MDI application has a Windows menu that allows the user to arrange the open child windows through tiling or cascading. The Windows menu also allows you to navigate to any of the open child windows. To create a Windows menu, add the menu items for tiling and cascading to a Windows menu in your parent form and set the MdiList property to true for the top-level Windows menu. The following code demonstrates how to create a Windows menu in an MDI application.

mi_window: WINFORMS_MENU_ITEM
mi_window := main_menu.get_menu_items.add (("&Window").to_cil)
dummy := mi_window.get_menu_items.add_string_event_handler (("&Cascade").to_cil, create {EVENT_HANDLER}.make (Current, $window_cascade_clicked))
dummy := mi_window.get_menu_items.add_string_event_handler (("Tile &Horizontal").to_cil, create {EVENT_HANDLER}.make (Current, $window_tile_h_clicked))
dummy := mi_window.get_menu_items.add_string_event_handler (("Tile &Vertical").to_cil, create {EVENT_HANDLER}.make (Current, $window_tile_v_clicked))
mi_window.set_mdi_list (True) -- Adds the MDI Window List to the bottom of the menu

Child Window Activation

If you want your parent form to be notified when a child window is activated by the user, you can register an event-handling method for the MdiChildActivate event. You can determine which child window is active by using the ActiveMdiChild property of the Form class. For example, the following code updates a StatusBar control on the parent form with the name of the child window.

....

add_mdi_child_activate (create {EVENT_HANDLER}.make (Current, $mdi_child_activated))

....
mdi_child_activated (sender: SYSTEM_OBJECT; e: EVENT_ARGS) is

    do

         status_bar.set_text (active_mdi_child.get_text)
    end
....


Menus

Menus sample

Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. The main window contains a main menu with two entries (File and Format).

The main window also has a blue LABEL that contains a context menu, that is the clone of "Format" in the main menu. Right click on the LABEL and a context menu will appear.

Under the Hood

This application shows how to create a main menu and how to associate a context menu to a control (here to a LABEL). More information regarding the use of menus, is available here.

This sample contains the following class:

  • FORM
  • CONTEXT_MENU
  • MAIN_MENU
  • MENU_ITEM
  • EVENT_HANDLER
  • LABEL

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\menus subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Menu Details

Using Menus

Windows Forms supports menus and context menus. Main menus are displayed on a menu bar that is located immediately below the title bar of a form. The menu bar contains top-level menu items that are used to group related submenu items. For example, by clicking a File top-level menu item, you can display menu items that are related to file operations. Menu items typically appear as commands for your application (such as New and Open), but they can also appear as separator bars and submenu items. You can display a check mark next to a menu item to display the state of a command or a the state of a feature in your application. In Windows Forms, main menus are represented by the MainMenu control.

Context menus can be displayed for a specific control or area of your form. They are typically accessed by clicking the right mouse button. In Windows Forms, context menus are represented by the ContextMenu control.

ContextMenu and MainMenu derive from Menu. They share many properties, methods, and events.

Adding a MainMenu to a Form

The following code demonstrates how to add a MainMenu to a form.

main_menu: WINFORMS_MAIN_MENU
    create main_menu.make
    set_menu (main_menu)

Adding a Context Menu to a Control

The following code demonstrates how to create a ContextMenu and assign it to a control.

label_1: WINFORMS_LABEL
label_1_context_menu: WINFORMS_CONTeXT_MENU
    create label_1.make
    create label_1_context_menu.make
    label_1.set_context_menu (label_1_context_menu)

Adding Menu Items

In the following example, a File menu item is added to the MainMenu.
            The File menu item contains submenu items called Open and Exit.

mi_file: WINFORMS_MAIN_MENU

mi_file := main_menu.get_menu_items.add (("&File").to_cil)
dummy := mi_file.get_menu_items.add_menu_item (create {WINFORMS_MENU_ITEM}.make_from_text (("&Open...").to_cil))
dummy := mi_file.get_menu_items.add (("-").to_cil) -- Gives us a seperator
dummy := mi_file.get_menu_items.add_menu_item (create {WINFORMS_MENU_ITEM}.make_from_text(("E&xit").to_cil)

The following code demonstrates how to handle the Click event for both
            the Open and Exit menu items
            created in the previous code example.

mi_file := main_menu.get_menu_items.add (("&File").to_cil)
dummy := mi_file.get_menu_items.add_menu_item (create {WINFORMS_MENU_ITEM}.make_from_text_and_on_click_and_shortcut
    (("&Open...").to_cil, create {EVENT_HANDLER}.make (Current, $FileOpen_Clicked), feature {WINFORMS_SHORTCUT}.ctrl_O))
dummy := mi_file.get_menu_items.add (("-").to_cil) -- Gives us a seperator
dummy := mi_file.get_menu_items.add_menu_item (create {WINFORMS_MENU_ITEM}.make_from_text_and_on_click_and_shortcut
    (("E&xit").to_cil, create {EVENT_HANDLER}.make (Current, $FileExit_Clicked), feature {WINFORMS_SHORTCUT}.ctrl_X))

The following example demonstrates how to define shortcut keys for the menu
            items
            created in the previous example.

mi_file := main_menu.get_menu_items.add (("&File").to_cil)
dummy := mi_file.get_menu_items.add_menu_item (create {WINFORMS_MENU_ITEM}.make_from_text_and_on_click_and_shortcut
    (("&Open...").to_cil, create {EVENT_HANDLER}.make (Current, $FileOpen_Clicked), feature {WINFORMS_SHORTCUT}.ctrl_O))
dummy := mi_file.get_menu_items.add (("-").to_cil) -- Gives us a seperator
dummy := mi_file.get_menu_items.add_menu_item (create {WINFORMS_MENU_ITEM}.make_from_text_and_on_click_and_shortcut
    (("E&xit").to_cil, create {EVENT_HANDLER}.make (Current, $FileExit_Clicked), feature {WINFORMS_SHORTCUT}.ctrl_X))

Adding Submenus

The following example demonstrates how to
            create
            submenus.

mi_format: WINFORMS_MAIN_MENU

-- Add Format Menu
mi_format := main_menu.get_menu_items.add (("F&ormat").to_cil)

-- Font Face sub-menu
create mmi_sans_serif.make_from_text_and_on_click ((("").to_cil).concat_string_string (("&1. ").to_cil,
    sans_serif_font_family.get_name), create {EVENT_HANDLER}.make (Current, $FormatFont_Clicked))
mmi_sans_serif.set_checked (True)
mmi_sans_serif.set_default_item (True)
create mmi_serif.make_from_text_and_on_click ((("").to_cil).concat_string_string(("&2. ").to_cil,
    serif_font_family.get_name), create {EVENT_HANDLER}.make (Current, $FormatFont_Clicked))
create mmi_mono_space.make_from_text_and_on_click ((("").to_cil).concat_string_string(("&3. ").to_cil,
    mono_space_font_family.get_name), create {EVENT_HANDLER}.make (Current, $FormatFont_Clicked))

create l_array_menu_item.make (3)
l_array_menu_item.put (0, mmi_sans_serif)
l_array_menu_item.put (1, mmi_serif)
l_array_menu_item.put (2, mmi_mono_space)
dummy := mi_format.get_menu_items.add_string_menu_item_array (("Font &Face").to_cil, l_array_menu_item)

Adding Default Menu Items

The following example demonstrates how to specify a default menu item.

mmi_sans_serif: WINFORMS_MAIN_MENU

create mmi_sans_serif.make_from_text_and_on_click ((("").to_cil).concat_string_string (("&1. ").to_cil,
         sans_serif_font_family.get_name), create {EVENT_HANDLER}.make (Current, $format_font_clicked))
mmi_sans_serif.set_checked (True)

Adding Check Marks to Menu Items

The following example demonstrates how to display a check mark next to a menu
            item. The code also demonstrates how to track which item is checked.

mi_medium: WINFORMS_MAIN_MENU

create mi_medium.make_from_text_and_on_click (("&Medium").to_cil, create {EVENT_HANDLER}.make (Current, $format_size_clicked))
mi_medium.set_checked (True)

Cloning Menus

In many cases, the context menu for a control is a subset of the main menu. You
            cannot add the same menu items to multiple menus, but you can clone a menu item
            or set of menu items. The following code demonstrates how to clone the Format
            menu
            created previously and add it to the context menu
            of a Label.

dummy := label_1_context_menu.get_menu_items.add_menu_item (mi_format.clone_menu)


Simple Hello world form sample

Message box sample

Hello world form Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above.

Click on the BUTTON "Click Me!" and a message box will appear with the text that you have entered in the TEXT_FIELD.

Under the Hood

The application shows how to use the very useful MESSAGE_BOX control.

An event (EVENT_HANDLER) is associated to a control (here to the BUTTON). So the line

my_button.add_click (create {EVENT_HANDLER}.make (Current, $on_my_button_clicked ))
associates a click to my_button to the feature on_my_button_clicked. So every time the BUTTON my_button is clicked, the feature on_my_button_clicked is executed.

The feature my_button_clicked displays a MESSAGE_BOX (feature {WINFORMS_MESSAGE_BOX}.show (msg)) with the text contained in TEXT_FIELD (msg := my_text_field.text).

This sample contains the following class:

  • FORM
  • BUTTON
  • TEXT_FIELD
  • EVENT_HANDLER

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\accessible subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Progress bar sample

Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. On the left of the form you have the PROGRESS_BAR control, and on the right you have some controls to configure the PROGRESS_BAR.

Under the Hood

The application shows how to configure a PROGRESS_BAR.

The feature on_load is redefined and launch a thread (THREAD_START) that simulates the progression of a process.

This sample contains the following class:

  • PROGRESS_BAR
  • GROUP_BOX
  • TRACK_BAR
  • COMBO_BOX
  • LABEL
  • THREAD_START

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\controlReference\ProgressBar subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Simple Hello world form sample

Simple hello world sample

Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. This is the simplest windows form we can display. We have just set the title with "Hello World".

Under the Hood

The application shows how to display a Windows Form under the windows environment. The application inherits the FORM class, and just set the title with "Hello world" with the inherited feature set_title.

set_title (("Hello world").to_cil)

The application is launch in a PROCESS with this command line:

feature {WINFORMS_APPLICATION}.run_form (Current).

This sample contains the following class:

  • FORM
  • WINFORMS_APPLICATION

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\simplehelloworld subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Tree view

Tree view sample

Hello world form

Compiling

Running

After launching the application, you will see a window displayed with a similar appearance to the one above. On the left of the form you have the TREE_VIEW control, and on the right you have some controls to configure the TREE_VIEW.

Under the Hood

The application shows how to use a TREE_VIEW and what are all its different configurations.

This sample contains the following class:

  • TREE_VIEW
  • GROUP_BOX
  • CHECK_BOX
  • COMBO_BOX
  • LABEL

Notes

This sample is translated from the example located in the QuickStart\winforms\samples\ControlReference\TreeView subdirectory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET.


Porting Instructions

Porting from one platform to another

  • Porting from traditional Windows to UNIX and vice-versa.


Porting an Eiffel application from UNIX to Windows or vice-versa

Requirements

Before starting your project, you must first decide if you want your program to run either single or multi-platform. If you decide to go multi-platform make sure you use platform independent Eiffel libraries or C/C++ code. ISE Eiffel provides the following multi-platform libraries:

  • Eiffel2Java (on platform that supports JNI)
  • EiffelBase
  • EiffelLex/EiffelParse
  • EiffelNet (except UNIX specific classes)
  • EiffelPreferences
  • EiffelStore
  • EiffelThread
  • EiffelTime
  • EiffelVision2
  • EiffelWeb
  • EiffelWizards

Configuring your project

For porting between different UNIX systems, you simply need one configuration file as the C/C++ externals should be the same. If this is not the case, as with UNIX and Windows, you will need a different configuration file for each platform where there is a difference.

The usual scenario is to port from UNIX to Windows or vice versa. In this case, the only difference in the configuration file is that of the external clause. An example of this is demonstrated with the following external specification of a Vision2 project first for UNIX:

external
    include_path:
        "\$(ISE_EIFFEL)/library/vision2/implementation/gtk/Clib `gtk-config --cflags`",
        "\$(ISE_EIFFEL)/C_library/libpng",
        "\$(ISE_EIFFEL)/C_library/zlib",
        "\$(ISE_EIFFEL)/library/vision2/spec/include"

    object:
        "$(ISE_EIFFEL)/library/vision2/spec/$(ISE_PLATFORM)/lib/gtk_eiffel.o",
        "$(ISE_EIFFEL)/library/vision2/spec/$(ISE_PLATFORM)/lib/load_pixmap.o `gtk-config --libs`",
        "$(ISE_EIFFEL)/library/vision2/spec/$(ISE_PLATFORM)/lib/libpng.a",
        "$(ISE_EIFFEL)/library/vision2/spec/$(ISE_PLATFORM)/lib/libz.a",
        "-L/usr/X11R6/lib/ -lXtst"
and then for Windows:
external

    include_path:
        "$(ISE_EIFFEL)\library\wel\spec\windows\include",
        "$(ISE_EIFFEL)\library\vision2\spec\include",
        "$(ISE_EIFFEL)\C_library\zlib"

    object:
        "$(ISE_EIFFEL)\library\wel\spec\$(ISE_C_COMPILER)\lib\wel.lib",
        "$(ISE_EIFFEL)\library\vision2\spec\$(ISE_C_COMPILER)\lib\vision2.lib",
        "$(ISE_EIFFEL)\library\vision2\spec\$(ISE_C_COMPILER)\lib\zlib.lib",
        "$(ISE_EIFFEL)\library\vision2\spec\$(ISE_C_COMPILER)\lib\libpng.lib"

Note the `\` in front of the include path for UNIX. This is required to compile correctly on some UNIX platforms.

It is important to also note that some multi-platform libraries such as EiffelVision2 do not include the same clusters for both UNIX and Windows. As with externals, clusters need to be specified depending on the target platform.

UNIX systems

When compiling for many UNIX system, you should finalize without launching the C compilation. At the end, the EIFGEN/F_code directory is built. This is the portable C code that you can take from one platform to another. We recommend you to create an archive of the F_code for backup.

To compile on a given platform, you have to make sure that you have a complete ISE Eiffel delivery for the target platform and that your PATH environment variable contains $ISE_EIFFEL/studio/spec/$ISE_PLATFORM/bin. You then have to check that all C externals that you are using have been compiled for this platform.

You can then launch the `finish_freezing' script that will automatically recompile the C generated code and generate a new executable for the given platform.

Between UNIX and Windows

As shown above you will need to have two different configuration files to port your Windows application to UNIX. You can then use the UNIX configuration file to re-finalize your project (without C compilation) and then you have ANSI compliant C code that may be compiled on a UNIX platform using the above instructions.

To compile your UNIX application on Windows simply follow the same instructions as above using a Windows configuration file instead. When the ANSI C code is generated, run finish_freezing.exe in the F_code directory on the target Windows platform and your system will be compiled.


Threads

Multithreaded applications

  • Introduction
  • Compilation of multithreaded systems
  • Once features in multithreaded mode
  • Changes between 4.5 and 5.0
  • Thread library overview
  • Multithread FAQ


Introduction to EiffelThread

Introduction

Information about usage of threads in ISE Eiffel is contained in the EiffelThread library documentation. In this section we will only see what is required to enable threading at the level of the compiler options and how to create special type of onces: global once versus once per thread.

Users of the EiffelThread library in version 4.5 and older should read "changes between 4.5 and 5.0" to get the info they need to migrate their code to the new implementation of threads in Eiffel.

If you encounter problems, have a look at the FAQ list.


Compilation of multithreaded systems

Settings

  • Add the option multithreaded by clicking on the advanced tab of the project setting window.
  • Do not use a non-multithreaded precompiled library. The corresponding multithreaded libraries of base and WEL should be located in $ISE_EIFFEL/precomp/spec/$PLATFORM/ with the mt prefix.
  • You must include the thread cluster (located at "$ISE_EIFFEL/library/thread") in the clusters your project is including. This setting can be done in the clusters tab of the project settings window.
  • When using external C libraries, be sure that they are MT-safe: on the platforms where the Eiffel Threads are available. For example Wel and Net multithreaded libraries can be recognized by the `mt' prefix.

Compilation

Just launch the compilation: the ISE compiler will generate and link the multithreaded executable.

External C files

The C files that you link with a multithreaded Eiffel application must be compiled in multithreaded mode. In addition, you should follow some basic guidelines, which you can find in any documentation on threads. Here are the main requirements:

  • Check what you are importing is safe: you cannot arbitrarily enter non-threaded code in a multithreaded program. Check your include files and libraries you use for the linking to decide if they can be used in multithreaded mode.
  • If you are using CECIL in multithreaded mode, you must compile your C files with the same defined symbols as those used to compile the generated C-code in multithreaded mode.
  • Threaded code can safely refer to unsafe code ONLY from the initial thread.

Note: if you use the libraries Net and MEL in multithreaded mode, you should use libmtnet.a and libmtmel.a. When using MEL, you have to be aware that Motif 1.2 is not threaded-safe (i.e not reentrant). Motif 2.x is threaded-safe.

Thread Safe Eiffel libraries

Most ISE Eiffel libraries are not thread safe. This means that even though you can use them in a multithreaded environment, you will need to add the necessary protection to ensure that objects are accessed only by one thread at a time.

Most of the issues is related to the use of EiffelBase containers which have been designed at a time where threads where not present. In the future we will certainly provide a version of EiffelBase which will be designed to be thread safe, in the meantime, you have to use basic protection mechanism such a mutexes to guarantee a safe execution of your programs.

Here is a summary of what you need to include in your project settings when using our libraries:

- EiffelBase: not thread safe, no externals required

- WEL: partly thread safe regarding creation of graphical objects that belongs to two different threads, but since it relies on EiffelBase, be aware of what has been said. Other libraries have the same dependency on EiffelBase and this warning will not be repeated. Change the library wel.lib by mtwel.lib

- MEL: you have to be aware that Motif 1.2 is not thread safe and that Motif 2.x is. Therefore you can use MEL in a multithreaded program only if you have Motif 2.x. In this case, you need to include libmtmel.a instead of libmel.a

- EiffelNet: thread safe with above limitation on EiffelBase. Change the library net.lib by mtnet.lib on Windows. For unix based systems, change libnet.a by libmtnet.a

- COM: not thread safe. Change com.lib and com_runtime.lib into mtcom.lib and mtcom_runtime.lib.


Once features in multithreaded mode

Manipulating Once features in multithreaded mode

Eiffel introduced the powerful mechanism of once routines. A once routine has a body that will be executed only once, at the first call. Subsequent calls will have no further effect and, in the case of a function, will return the same result as the first. This provides a simple way of sharing objects in an object-oriented context.

For multithreaded applications, the appropriate semantics is that once routines must be called once per thread (rather than once per process). This is the semantics supported by EiffelThread.

Then the once feature is not initialized once per process but once per thread. Your once feature will be called again in any new thread execution.

Once per Process/Thread

Current once features in Eiffel are once per thread. This means that when a once feature is called in a thread, the Eiffel run-time will check whether it has been already computed in this thread. If not, the once feature will be initialized and computed. This seems to be a relevant way of managing once features in multithreaded mode: most of the time, a once called in a thread is not likely to share its result.

However, in some case, we need to share once features.

Moreover, an Eiffel programmer should be able to have an alternative between a once per thread or per process implementation.

Using Once per process/thread features in EIFFEL

Here is what you will do to implement a once per process feature:

    class
        TEST_ONCE_PER_PROCESS

    feature

        object_per_thread: OBJECT is
                -- Once per thread.
            once
                create Result.make
            end

        object_per_process: OBJECT is
                -- New 'object' (once per process)
                -- that could be shared between threads
                -- without reinitializing it.
            indexing
                once_status: global
            once
                create Result.make
            end

    end -- class TEST_ONCE_PER_PROCESS

You can do the same with once procedures.


Breaking changes between 4.5 and 5.0

Changes between 4.5 and 5.0

Users of EiffelThread in 4.5 will notice a few changes that we made to make their life easier.

Object sharing

Indeed one aspect of EiffelThread in 4.5 that was not easy to implement was object sharing between threads. Most of the difficulty came from our special implementation of the ISE GC (Garbage Collector) where each thread had its own GC.

A consequence was that an object in thread A referencing an object in thread B needed to let the GC of B that it had a reference to an object that belongs to him. This was done by using the PROXY class and instead of referencing the object directly you were referencing the PROXY object. Another limitation of this approach was that the referred object could not hold reference to other objects, it could only hold values of basic expanded types (also previously called flat objects)

Now, there is a global GC and therefore you do not need to use the PROXY class anymore and you can reference any kind of objects. The PROXY class is still available for backward compatibility, but it is now obsolete and its implementation has been reduced to a bare minimum.

The class OBJECT_CONTROL has been removed altogether and the class OBJECT_OWNER is now obsolete as well.

Global onces

In 4.5, you would have to use a special tricky way to create once per process feature by using an existing once per thread feature and an external C feature that we were providing to achieve a once per process behavior.

In 5.0, this has been simplified and you can now specify at the level of the source code if it will be a once per process or once per thread. Click here for more details on how this is done.


Unicode

  • Getting Started


Compiling WEL for Unicode - Windows 95/98/Me

 Eiffel Home Page Eiffel Home Page

Compiling WEL for Unicode - Windows 95/98/Me
Introduction

This documentation is provided for those wishing to compile their application for Windows 95/98/Me with full Unicode support. Windows 95/98/Me uses code pages (ANSI) while Windows NT/2000/XP uses Unicode. To provide Unicode support for your Windows 95/98/Me Microsoft have developed a translation layer, the Microsoft Layer for Unicode (MSLU), which provides a complete set of unicode APIs.

Compiling WEL for Unicode - Windows 95/98/Me
Introduction

The following step-by-step tutorial details how to get Unicode support for WEL application using WIndows 95/98/Me.

    1 Download Microsoft Layer for Unicode

    Download the Microsoft Layer for Unicode here This contains the unicows.dll. The other file needed to get MSLU working, unicows.lib, can be found in the Microsoft Platform SDK.

    2 Compiling Your Application (Without MSLU)

    Compile your application as normal.

    3 Add MSLU Support

    Copy the unicows.dll and unicows.lib files into your project directory. Note that the Microsoft Layer for Unicode does not automatically load from the $(WINDOWS) or $(WINSYS) directories so do not put the files there.

    4 Change the Linker Options

    Once MSLU support has been added you must modify the linker file generated by Eiffel:

    + Go to your application's 'EIFGEN\W_code' directory and open the file called 'SystemName.lnk, where 'SystemName' is the name of your system as specified in the .ace file, in your favourite text editor.

    + Add the following at the start of the file:

    /nodefaultlib:kernel32.lib /nodefaultlib:advapi32.lib /nodefaultlib:user32.lib
    /nodefaultlib:gdi32.lib /nodefaultlib:shell32.lib /nodefaultlib:comdlg32.lib
    /nodefaultlib:version.lib /nodefaultlib:mpr.lib /nodefaultlib:winmm.lib
    /nodefaultlib:winspool.lib /nodefaultlib:vfw32.lib /nodefaultlib:secur32.lib
    /nodefaultlib:oleacc.lib /nodefaultlib:oledlg.lib

    + Then add:

    unicows.lib

    + Now, replace the line that looks like this:

    USER32.lib WSOCK32.lib ADVAPI32.lib GDI32.lib SHELL32.lib
    COMDLG32.lib UUID.lib OLE32.lib OLEAUT32.lib COMCTL32.lib
    MPR.LIB IMM32.LIB

    + With this:

    KERNEL32.lib ADVAPI32.lib USER32.lib GDI32.lib SHELL32.lib
    COMDLG32.lib VERSION.lib MPR.LIB WINMM.lib WINSPOOL.lib
    VFW32.lib OLEACC.lib OLEDLG.lib WSOCK32.lib UUID.lib OLE32.lib
    OLEAUT32.lib COMCTL32.lib

    A sample linker file can be seen here with each step mark for your conveniance.

    5 Relink (With MSLU Support)

    Now you must relink your application so that it knows to use the libraries you just changed in the linker file. To do this run 'link SystemName.lnk', where 'SystemName' is the name of your system as specified in the .ace file, from your 'EIFGEN\W_code' directory. Note that if you recompile the application C code a new linker file will be generated and the modified version will be overwritten.


Sample Linker File

(Step 1)

/nodefaultlib:kernel32.lib /nodefaultlib:advapi32.lib /nodefaultlib:user32.lib
/nodefaultlib:gdi32.lib /nodefaultlib:shell32.lib /nodefaultlib:comdlg32.lib
/nodefaultlib:version.lib /nodefaultlib:mpr.lib /nodefaultlib:winmm.lib
/nodefaultlib:winspool.lib /nodefaultlib:vfw32.lib /nodefaultlib:secur32.lib
/nodefaultlib:oleacc.lib /nodefaultlib:oledlg.lib

(Step 2)

UNICOWS.lib -SUBSYSTEM:WINDOWS -OUT:unicode_demo.exe e1\emain.obj
C:\Eiffel52\studio\spec\windows\lib\msc\wkbench.lib
C:\Eiffel52\library\wel\spec\msc\lib\wel.lib

(Step 3)

KERNEL32.lib ADVAPI32.lib USER32.lib GDI32.lib SHELL32.lib COMDLG32.lib
VERSION.lib MPR.LIB WINMM.lib WINSPOOL.lib VFW32.lib OLEACC.lib OLEDLG.lib
WSOCK32.lib UUID.lib OLE32.lib OLEAUT32.lib COMCTL32.lib unicode_demo.res
C1\Cobj1.lib C2\Cobj2.lib C3\Cobj3.lib C4\Cobj4.lib C5\Cobj5.lib C6\Cobj6.lib
C7\Cobj7.lib C8\Cobj8.lib C9\Cobj9.lib C10\Cobj10.lib C11\Cobj11.lib
C12\Cobj12.lib C13\Cobj13.lib C14\Cobj14.lib C15\Cobj15.lib C16\Cobj16.lib
E1\Eobj1.lib


Tools

  • EiffelBuild
  • EiffelStudio
  • Wizards


EiffelBuild

Type: Tool
Platform: Any
Version: 5.1
Availability: Student and Enterprise versions.

See:

  • Introduction
  • How To's
  • Reference


EiffelBuild How To's

  • Starting a project
  • Create an object
  • Delete an object
  • Save a project
  • Reparent an object


Starting a project

  • Creating a new project
  • Retrieving a project from a Build project file


Creating a new project

When a project is not open in Build, there are only two menu options available. 'File' and 'Help'. To create a new project, select 'file', 'New project' as illustrated below:

This will bring up a directory dialog from which you can select the directory in which you wish to create the new Build project.

Selecting a directory that does not already contain a Build project will create a new project in that directory and the Build tools will become available for development of the newly created project. If a directory was selected that already contains a Build project, the following dialog will be displayed:

Selecting 'Ok' will create a new project, overwriting the existing project, and the Build tools will become available for development of the newly created project.

Selecting 'Cancel' will return you to the directory selection dialog, from which you can select the directory in which you wish to create the new Build project.

See Also
Retrieving a project from a Build project file


Retrieving a project from a Build project file

When a project is not open in Build, there are only two menus available, 'File' and 'Help'. To retrieve an existing project, select 'file', 'Open Project

A directory dialog will be displayed from which you can select the Build project file that you wish to retrieve. All build project files are named 'build_project.bpr' and are qualified by the directory in which they reside.

See Also
Creating a new project


Create an object

An EiffelBuild object is a representation of a Vision2 component and its properties.

To create a new instance of an object, pick a type from the type selector and drop onto an existing object (Accessible from the layout constructor or builder window). You will only be able to complete the drop if the targetted object will accept a new object of the transported type.

Note: Once an object has been created, it will always be contained in a parent object until deleted.

See Also
Type selector
Reparent an object
Delete an object


Delete an object

To remove an object from your EiffelBuild system, pick the object you wish to delete, and drop it on [image] in the main toolbar.

Note: Only user defined objects may be deleted. The EV_TITLED_WINDOW may not be deleted.

See Also
History
Type selector


Save a project

To save the project that is currently open, select Save from the File menu or click on [image] in the main toolbar.

Alternatively, you may use the keyboard shortcut - Ctrl+S

Note: If no changes have been made to the system, the save command will be disabled.

See Also
Key shortcuts


Reparent an Object

To reparent an object, you need to pick the object and drop it on the object you wish it to be parented in. The object will be removed from its current parent, and inserted in the new parent at the next available position.

When an object is inserted into a parent, it is always added at the next available position. If you wish to place an object at a paticular position within a parent, you must hold down the Shift key, and drop on an object already contained in parent, Your object will then be inserted in the parent, in the position preceeding the child object that you dropped on.

You can access objects from both the builder window and layout constructor.

For more information about an objects capacity and permitted children, see the EiffelVision2 documentation

See Also
Create an object
Delete an object
Builder window
Layout constructor


EiffelBuild Reference

  • EiffelBuild Introduction
  • EiffelBuild Notation
  • General interface description
  • Layout constructor
  • Type selector
  • Object editor
  • Layout window
  • Builder window
  • Component selector
  • Component viewer
  • History
  • Project settings
  • Code generation


EiffelBuild Introduction

EiffelBuild is the new graphical builder by Interactive Software Engineering which allows you to simply and quickly develop a Vision2 GUI.


EiffelBuild Notation

This page contains descriptions of terms found within the EiffelBuild documentation.

Object

An EiffelBuild object is a representation of a Vision2 component and its properties. When developing with EiffelBuild, you manipulate objects to build the desired interface.

Each object type has a different set of properties that may be manipulated, and these correspond directly to the properties available within the EiffelVision2 type. There is property which is specific to an EiffelBuild object, Name which is used for your identification purposes and as the attribute name in the generated code.

For more information on manipulating objects within EiffelBuild, see:

  • How to create an object
  • How to reparent an object.
  • Object editor for details on modifying object properties.

Within EiffelBuild, there may be multiple views of a single object displayed simultaneously. Any modifications to an object will immediately update all views. Both the layout constructor and the builder window provide views of the objects within your project, and in these, the objects may be manipulated. The display window also provides a view of the objects in your system, except the objects cannot be manipulated from this view. It can be thought of as a preview of the project you are developing.

Component

EiffelBuild components are templates representing user defined object structures. From a component, you can quickly build a matching structure of objects. Components are available in EiffelBuild so that you do not repeatedly create the same structures over and over again while developing your projects.

You specify a new component by creating it from an existing object structure. See component_selector for more detailed instructions on the use of components.

To view an existing component, use the component_viewer.

It is not possible to modify a component once created, except to delete it.

Pick and Drop

The pick and drop mechanism is one of ISE's exclusive technologies and is provided by EiffelVision2. In EiffelBuild, it allows you to easily send data from a component of the interface to another.

You can Pick a reference to a development object, such as an object or component with a single click of the right mouse button. Then as you start moving the mouse around - not pressing any of its buttons - a pebble tracks the cursor position, and a line continuously connects the pebble to the object's original position.

You may terminate this situation in either of two ways:

  • If the pebble you are dragging is the regular cursor, you can right-click again to confirm the pick-and-drop and so effectively send the dragged development object to the targeted component. This is known as Dropping.

    Right-clicking when the pebble is the no cursor, will only stop the pick-and-drop because the component you are hovering with the mouse does not accept your development object.

  • If, for any reason, you change your mind, you can cancel the pick-and-drop by left-clicking anywhere or by pressing the Escape key.


General interface description

  • EiffelBuild window overview
  • Main toolbars
  • Key shortcuts


EiffelBuild window overview

Window layout

The use of EiffelBuild is based around one main window which remains throughout the execution. The appearence of the main window is as follows:

The window contains several different tools, highlighted below:

  • The type selector - Situated at the top left of the window, this tool contains all the available vision2 types available for interface construction.
  • The component_selector - Situated at the bottom left of the window, below the type selector, this tool contains all the user defined components.
  • The layout constructor tool - Situated in the middle of the window, this tool displays a graphical representation of the interface that is currently being built.
  • The docked object editor - Situated to the right hand side of the window, this object editor automatically targets itself to the selected object in the layout constructor.

See Also
Main toolbar
Layout constructor
Type selector
Object editor
Component_selector


Main toolbar

At the top of the EiffelBuild development window, one toolbar is displayed by default, as shown below:

The complete list of the icons in the toolbar is displayed below.

Icon | Command
 | Delete object/component.
 | Save current project.
 | New object editor
 | Undo last action.
 | Display full history.
 | Redo last undone action.
 | Generate code.
 | Display project settings.
 | Show/hide builder window.
 | Show/hide display window.
 | Show/hide component_viewer.

Note: It is not possible to customize the toolbar.


Key shortcuts

Many operations in EiffelBuild do not require the use of the mouse. The same effect can be achieved through the keyboard only.

This page gathers all the keyboard shortcuts available in the environment.

Key shortcut reference

Key shortcut | action
- file shortcuts -
Ctrl+O | Open project.
Ctrl+N | New Project.
Ctrl+S | Save project
- code generation shortcuts -
Ctrl+G | Generate code from project.

Note: These shortcuts are not always available and are dependent on the state of EiffelBuild. For example, Ctrl+S does nothing if there is no modified project open.

See Also
General interface description


Layout Constructor

The layout constructor provides a view of the objects you have defined in your system, in which the objects may be manipulated.

Each item in the tree represents one object. The screenshot above represents the following EiffelVision2 interface definition - An EV_TITLED_WINDOW containing one child, of type EV_VERTICAL_BOX. Within the vertical box there is an EV_HORIZONTAL_BOX and an EV_LIST. The list is empty, but the horizontal box contains three different objects of type EV_BUTTON.

The information displayed, only shows you the structure of the objects, and although it gives you an indication of the final appearence of the interface you are building, you cannot see the details of the interface. i.e. color, sizes, tooltips etc.

All objects displayed in here are pickable, so can be easily manipulated, e.g. deleted or reparented.

Note: If the object in the tree has the Name property set, then the text corresponds to the name, otherwise, the text is the type of the object.

If you have just started a new project, then the layout constructor will only contain one tree item, TITLED_WINDOW.

Expanding/Collapsing

To Expand all of the items displayed in the layout constructor, select Expand layout tree from the View menu.

Similarly, if you wish to collapse all of the items in the layout constructor, select Collapse layout tree from the View menu.

See Also
Builder window
Object editor
Layout window


Type Selector

The type selector contains all the available Vision2 types supported by EiffelBuild. These are the basic building blocks for your system.

The types are organized into three groups - Primitives, Containers and Items. All types that may be used in EiffelBuild have a text in uppercase, corresponding to their type in EiffelVision2. For example, looking at the screenshot above, the BUTTON item represents an EV_BUTTON, and the COMBO_BOX item represents EV_COMBO_BOX.

Note: The types available in the type selector are fixed, and cannot be modified. Almost all EiffelVision2 components are available.

Creating a new object

Objects are the building blocks used in EiffelBuild to construct your interface. To create a new object for use in your system, pick the type corresponding to the type of object you wish to create, and drop onto an object representation. If an object is full, or does not allow other objects of the new type to be contained, then you will not be able to drop on it.

For example, if you have just started a new project, pick HORIZONTAL_BOX from the type selector, and drop it on the EV_TITLED_WINDOW object displayed in the layout constructor. This will build you a new object of type EV_HORIZONTAL_BOX, parented in the window. If you then pick a BUTTON from the type selector, you will not be able to drop it on the EV_TITLED_WINDOW, as a window may only contain one child and is therefore currently full. You may however, drop on the EV_HORIZONTAL_BOX object you had just created, as the box is empty, and has space for multiple children. Doing so, will create a new object of type EV_BUTTON, parented in the box.

This shows how simple it is to Build new objects in EiffelBuild, you just need access to the parent object to drop the selected type into.

Note: To understand the types accepted, and the capacity of objects, you should consult the EiffelVision2 library reference.

Changing the type of an existing object

Why would you want to change the type of an existing object, when you could just delete it and create a new object?

Imagine you have spent some time constructing a complicated interface. You have an EV_VERTICAL_BOX with children many levels deep. You realise that you wanted the EV_VERTICAL_BOX to be of type EV_HORIZONTAL_BOX. If you delete the object, all children contained will also be deleted, which in this case, is not what you want. Changing the type of the object does actually delete the object internally, but will automatically re-parent all of its children into the new object.

To perform a type change, pick the object that you wish to change, and drop it on an item in the type selector representing the desired new type. All existing children of the old object will be automatically re-parented in the new object.

The following rules govern if the type of an existing object may be changed to a new type:

  • The parent of the existing object must accept children of type corresponding to the new type.
  • The new type must be able to accept all of the existing objects children.

See Also
Layout constructor


Object editor

An object editor is a tool which allows you to edit the properties of a selected object. Common properties include minimum width and height, color, text etc.

An object editor can only reference one object at once, and when not empty, it is considered to be "targeted" to the object whose properties it references.

The screenshot above shows a floating object editor. The docked object editor is almost identical except that it is located within the EiffelBuild main window.

Docked object editor

The docked object editor is displayed to the right hand side of the EifflBuild main window. This editor is always displayed and is permanently linked to the layout constructor. This means that whenever the selected object changes in the layout constructor, the docked object editor becomes targeted to this object.

Floating object editors

These object editors appear in their own window, and you may open as many of these as you wish.

To open a new floating object editor, drop an object on [image], displayed in the main toolbar and also in each existing object editor. The new object editor will then be targeted to the object that was dropped.

Note: If the object targetted to floating object editor is deleted, then the editor will be destroyed. This helps stop the screen becoming cluttered with empty editors.

As a shortcut to a complete pick and drop transport, you may hold down the Ctrl key while starting the pick, which will immediately open a new floating object editor targeted to the object you clicked.

General use

When an object editor is targeted to an object, you will see that controls are available within the editor to customize that object. Although every different type of object will have different sets of properties that may be modified, the manipulation of these properties is as standardized as possible. Below are some general rules that apply:

  • String properties inputed via a text field are updated within the object every time a key is pressed
  • Integer properties inputed via a text field are only updated within the object when return is pressed, or the input box looses the focus.
  • Almost without exception, a push button which controls a property, will open up a dialog, allowing the property to be edited. Examples are colors, pixmaps and events.
  • If when you attempt to modify a property, it returns back to its original value, it means that the value you attempted to enter was invalid. For example, looking at the screen show above, if you enter -50 into the minimum_height text field and press return, it will revert back to 23. This is because the minimum_height of an EV_BUTTON may not be set to less than 0. To find allowable values for properties of an object, consult the EiffelVision2 documentation.

All properties that may be manipulated in an object editor correspond directly to a property of the EiffelVision2 control that is represented by the object (Displayed in an object editor as type). There is one exception to that rule though, and that is the Name field which is specific to EiffelBuild. This field is used for your identification of the object and as the attribute name in the generated code. For example, when EiffelBuild generates code corresponding to the object targeted in the editor shown above, it would declare the vision2 component as - button1: EV_BUTTON

Note: You may have as many object editors targeted to the same object as you wish. Whenever a change is made to the object through one of the editors, all other editors targeted to that object are synchronized.

Advanced property manipulation

Although many of the properties of objects are relatively simple, and can be manipulated with STRING or INTEGER values, there are others that require more complicated control mechanisms. The following object properties have more complicated interfaces warranting further explanation:

  • Merging radio button groups of EV_CONTAINER
  • Positioning children of EV_TABLE
  • Positioning children of EV_FIXED

Event connection

As well as being able to manipulate the standard properties of an object, facilities are provided for connecting to the events of an object. Looking at the object editor screenshot above, you will see that there is a button marked Select events which is also available in all targetted editors.

Note: The button will be marked Modify events when one or more events are already selected for the current object.

Clicking this button will cause the following dialog to be displayed:

Looking at the screenshot above, you will see that this dialog contains all the action_sequences available for the EV_BUTTON to which the object editor is targetted.

If you check a button connected with one of the action sequences, you will be then able to enter the name of a feature that you wish to connect to the action sequence. The screenshot above shows the user has connected a feature named `button_pressed' to the `select_actions'. When code is generated, this will cause EiffelBuild to generate an empty feature named `button_pressed' already connected to the `select_actions' of the button.

Note: You will only be allowed to enter valid and unique Eiffel feature names. If a name is invalid, it will be highlighted in red, and a dialog will warn you when you attempt to close the dialog.

See Also
Create an object
Delete an object


Merging radio button groups

If the current object editor contains an EV_CONTAINER object, then the following control will be available:

With this control, you can merge two or more instances of EV_CONTAINER together, so that any EV_RADIO_BUTTON contained are grouped.

Merging

To create a new merge, pick an object of type EV_CONTAINER, and drop it anywhere on the control. This will merge the radio button group of the EV_CONTAINER referenced in the object editor, to the transported one. Each merge, will show up as a new item in the control.

Note: Container objects may only be grouped once, and as such, you will not be permitted to add an object that is already contained in the list.

Unmerging

To unmerge a container object from a group, pick the representation of that object from the list, and drop on [image]. This will unmerge the object from the current group of containers.

Locating group member

To locate the object referenced by a list item in the control, left click the item that you wish to locate. This will display the representation of the associated object within the layout constructor, and the associated icon will be animated for a short period of time.


Positioning table children

If the current object in the object editor is of type EV_TABLE, [image] will be contained in the object editor. Click this button, to display the following window:

Each of the children are displayed on a grid representing the table cells that each occupies (by default 1x1). To manipulate a child of the table, click the left mouse button inside the desired child, and it will be highlighted in red. You may the manipulate the selected child in the following ways:

  • Moving - Press and hold the left mouse button within the selected child, and move the mouse.
  • Resizing - Move the mouse over the border of the child, until the cursor changes to a rezise cursor, then press and hold the left mouse button to re-size the child.

Note: Each child, may only occupy a unique set of cells within the table, and if you attempt to move or re-size a child to an invalid position, it will be displayed in grey.

When you have finished manipulating the children of the table, click [image] to close the dialog.


Positioning fixed children

If the current object in the object editor is of type EV_FIXED, [image] will be contained in the object editor. Click this button, to display the following window:

  • Moving - Press and hold the left mouse button within the selected child, and move the mouse.
  • Resizing - Move the mouse over the border of the child, until the cursor changes to a rezise cursor, then press and hold the left mouse button to re-size the child.

Note: As placing a child in an EV_FIXED does not modify the size of the child, it is possible that some children have a size of 0x0 pixels, and hence do not show up in the diagram. In this case, there will be the following displayed in the status bar "Widget is 0x0 pixels, click HERE to enlarge". If you subsequently click on the status bar, then the widget will be enlarged to a more useful size.

Grid Properties

The grid properties are displayed in the bottom right hand side of the window. You may modify the following attributes:

  • Snap to grid - Select this option if you wish all widget coordinates to be snapped to the grid displayed in the window.
  • Visible - If selected, then the grid is visible.
  • Grid size - The spacing between grid elements in pixels.

When you have finished manipulating the children of the table, click [image] to close the dialog.


Display Window

The Display window provides a view of the objects in your system, but unlike the layout constructor and builder window, the objects cannot be manipulated.

This window may either be shown or hidden (default). To change between these two states, click [image] on the main toolbar, or select Show/Hide display window from the View menu.

This view is provided so that you can really see what your project will look like when it has been generated and is running as a stand alone EiffelVision2 system.

All properties that have been set on the objects in your project are set in the EiffelVision2 control matching its type.

See also:
Builder window
Layout constructor


Builder Window

The Builder window provides a view of the objects in your system, in which the objects may be manipulated.

This window may either be shown or hidden (default). To change between these two states, click [image] on the main toolbar, or select Show/Hide builder window from the View menu.

The content of this window is a representation of the objects you have defined in your project. Each object is represented by the EiffelVision2 control matching its type. For example, an object representing an EV_BUTTON will be displayed in here using an EV_BUTTON. As this view provides direct access to the objects (Pick any of the controls in this window), it enables you to build your interface within a view which provides rich visual feedback.

Because this window is just a view of the objects, it will be always synchronized with the layout constructor. This means you can reparent objects, using the pick and drop transport method, seamlessly between the two views.

Visual Differences

Although the builder window attempts to show you the interface you are developing, it is not a completely accurate representation (Unlike the display window). The main difference is that all objects representing descendents of EV_CONTAINER are parented in a frame. This was implemented so that you would be able to easily manipulate the containers.

Imagine that this was not the case, and each container object was just represented by an EiffelVision2 object matching its type. Because these containers have no visible screen space when filled with children, manipulation of them would have been difficult, and the functionality of this view would be compromised.

In the screenshot above, you can see that there are two objects representing containers in your project, an EV_VERTICAL_BOX, and an EV_HORIZONTAL_BOX (Excluding the EV_TITLED_WINDOW object represented by this window).

The properties of the objects in you system are always reflected in this window, with a few exceptions:

  • 'user_can_resize', 'maximum_width', 'maximum_height' and 'title_string' are not reflected in this window.
  • 'minimum_width' and `minimum_height' are not reflected in any of the controls representing objects within this window.

See also:
Display window
Layout constructor


Component Selector

The component selector allows you to build and retrieve user defined components for use in your project.

Creating a component

To define a new component, pick the object that you wish to create the component from, and then drop it anywhere in the component selector. The following dialog will appear:

Modify the suggested name as desired, and then click OK to create the new component. If you click Cancel, the component will not be created.

The component that has been created will contain enough information to allow a copy to be built of the existing object. This includes all the children of the original object (to any depth) and the properties (width, height, color etc)of all objects within the structure. The only properties of the objects that will not be set inside a component are the user defined names, and any events connected to the objects.

Using a component

To create a new set of objects from a component, pick the component, and drop onto an object representation. If an object is full, or does not allow other objects of the new type to be contained, then you will not be able to drop on it.

If the pick and drop completed successfully, then you should have a new set of objects matching the structure of the component.

Deleting a component

To remove a component from your EiffelBuild system, pick it, and then drop it on [image] in the main toolbar.

Note: The deletion of a component can not be undone.

Viewing a component

To view an existing component, use the component_viewer.

See also:
Component_viewer
Builder window
Layout constructor


Component viewer

The Component viewer allows you to view the structure of a component without having to create new objects from the component.

This tool is displayed in a seperate window, and may either be shown or hidden (default). To change between these two states, click [image] on the main toolbar, or select Show/Hide component viewer from the View menu.

Targeting a component

To target a component into the tool, pick the component from the component_viewer, and drop on the [image] displayed in the tool bar of the component viewer (See screenshot above). Any existing component displayed will simply be removed.

Alternatively, you can hold down the Ctrl key while starting a pick on a component in the component_selector. This will automatically target the component to the component viewer. If the viewer is currently hidden, it will also make it visible.

View types

Looking at the screenshot above, you can see that the [image] button is depressed, meaning the component viewer is in display view mode. Clicking on [image] will put the component viewer into build mode view. These modes are mutually exclusive and are described below:

  • Builder view - This view is similar to the view used by the display window. i.e. the EiffelVision2 controls are displayed exactly as is defined in the component.
  • Display view - This view is similar to the view used by the builder window. i.e. all EiffelVision2 containers are represented by frames so they are immediately visible. This makes the actual structure represented by the component completely visible.

Note: The type of the "root_object" within the component is displayed in the toolbar of the component viewer.

See also:
Builder window
Layout constructor


History

EiffelBuild has an limitless undo/redo mechanism built in. However, this mechanism only applies to the structure of the objects you are developing in your project.

For example, every time you create, reparent or delete an object in your project, this will be recorded in the history. If you modify properties of an object (Using an object editor), these modifications will not be recorded in the history.

Undo

To undo a change, click [image] on the main toolbar You can repeatedly undo, until you get to the beginning of the history, at which point, this button will be disabled.

Redo

To redo a change (only applicable after one ore more undo's), click [image] on the main toolbar. You can repeatedly redo, until the history becomes current again, and at which point, this button will be disabled.

History window

The screenshot above shows the appearence of the history window.

This visibility of the window may be toggled by clicking [image] on the main toolbar. You may also select History from the View menu to show the history window, and click the Close button to close the window manually.

Looking at the screenshot above, you will see that the the last action in the history list is selected. This is always the case while working, until you start undoing your changes. To go back three steps, so that (in this case), there is just the one BUTTON added to the HORIZONTAL_BOX, you could click the undo button on the main toolbar three times, or you can simply select the second item in this list. both have the same effect. You can also redo by selecting an item below the currently selection in the history list (Only possible after an undo).

If you execute an action which will be added to the history while the history is not at the final position, all history events after this current position will be removed, and the history will be up to date again.

Note: If you use the history list to move through many recorded actions at once, there may be a slight delay dependent on the systems complexity and steps moved.

See also:
Builder window
Layout constructor


Project settings window

This is where global settings regarding your project are going to be made. In here you can specify:

  • The type of project you wish to generate
  • The system name
  • Class names
  • Code generation options

The project window can be raised by clicking [image] on the main toolbar, or by selecting Settings... from the Project menu.

The window is organized as three tabs:

  1. General
  2. Build
  3. Generation

All options are enabled and saved into the project settings file, 'project_settings.xml' as soon as the window is closed.

See Also
Code generation


General Tab

This contains only one field, 'project location', which may not be modified. This displays the location of the build project you are developing, and it is this location into which the files will be generated.

See Also
Code generation
Project settings window
Build tab
Generation tab


Build Tab

This tab contains information about the type of project you wish to build, and associated information.

Here is the appearence of the Build tab when 'build type' is selected as 'Project':

If 'build'_type' is selected as 'Class', then the tab will have the following appearance:

The options available in this tab are as as follows:

  • Build type

    • Select 'Project' if you wish to generate a complete project including an ace file, and an application class, which will launch the GUI you are developing.

    Select `Class' if you wish to generate a single class that represents the GUI you are developing. This option is useful if you wish to incorporate your current project into an exising Vision2 system.

  • Always rebuild ace

    • This option causes the ace file to be completely re-generated every time you generate your project. If you do not wish the ace file to be re-generated, then disable this option. This check box is only available if 'build type' is set to 'project'.

  • Project name

    • This entry will be added to the generated ace file as the SYSTEM attribute. The executable built from compiling this ace file will have this name. This option is only available if you have specified 'build_type' as 'Project'.

  • Application class name

    • This entry will be the class name for the generated vision2 application which will launch your GUI. This option is only available if you have specified 'build_type' as 'Project'.

  • Window class name

    • This entry will be the class name for the generated vision2 class that you are developing.

See Also
Code generation
Project settings window
General tab
Generation tab


Generation Tab

This tab contains information about the available code generation options.

Here is the appearence of the Generation tab with default settings for a Build project:

The options available in this tab are as follows:

  • Attribute declarations grouped

    • Should different objects of same type be declared individually, or grouped?

    button1: EV_BUTTON
    button2: EV_BUTTON
    button3: EV_BUTTON
    or
    button1, button2, button3: EV_BUTTON

  • Attributes declared as locals

    • Should attribute declarations be local to initialization feature, or attributes of the class?

  • Generate debugging information

    • If selected, then for every feature connected to an event, code will be generated which outputs to the console, the name of the feature, and the values of all arguments.

  • Client of EV_TITLED_WINDOW

    • If selected, then the generated window will be a client of EV_TITLED_WINDOW, otherwise it will be a direct descendent.

See Also
Code generation
Project settings window
General tab
Build tab


Code Generation

To generate Eiffel code representing your system, select Generate code from the Project menu or click [image] on the main toolbar.

The length of time taken to generate your code will be dependent on the speed of the system you are running, and the size of your interface, but typically takes a couple of seconds. A progress bar will be displayed during the generation of your system.

The code will be generated according to the options you selected in the project_settings (the general tab displays the location of all generated files.)

Project build type

If build type is selected as Project in the project_settings, then the following files will be generated:

  • A class named as window class name setting + '_IMP' representing the implementation of your window.
  • A class named as window class name setting representing the interface of your window.
  • A class named as application class name setting which is an EV_APPLICATION which will launch your window class.
  • An ace file "build_ace.ace" which will contain all the necessary information to compile your system.

Below is a BON diagram of the generated system using default names:

As the files generated enable you to compile a new EiffelVision2 system, it is recommended that you use this option only when starting a new Vision2 system.

Note:To compile the generated system, start EiffelStudio, select open existing ace from the initial dialog displayed and specify the newly generated ace.

Class build type

If build_type is selected as Class in the project_settings, then the following files will be generated:

  • A class named as window class name setting + '_IMP' representing the implementation of your window.
  • A class named as window class name setting representing the interface of your window.

Below is a BON diagram of the generated system using default names:

As the files generated are only sufficient for inclusion in an existing system, it is recommended that you use this option only when adding to an existing EiffelVision2 system.

Modifying code after generation

The choice to generate an interface and an implementation class for the window was to enable modification of the interface using EiffelBuild, once you had hand edited code. The rule is that the implementation window class will be re-generated every time, but the interface will not. It follows from this that you should not add hand written code to the implementation of the window, as any changes you make will be lost when re-generation takes place.

Using this mechanism, you can generate your initial system using EiffelBuild, and implement any event features that have been generated (in the interface) by EiffelBuild. If you then decide that you wish to modify the look and the feel of the interface, you can return to EiffelBuild, make the necessary adjustments and then re-generate the system.

Note: When returning to EiffelBuild to modify the interface, if you delete or rename controls, then it is quite possible that you will break your existing code. Care should be taken with all changes of this type.

Looking at a generated system, you will see that the events connected to your controls are defined as deferred in the implementation and actually implemented in the interface class. This means that if you return to EiffelBuild with a previously generated system, and add a new event to a control, then you will have to implement the definition in the interface class yourself (as the class interface class is not re-generated).

See also:
Project settings


EiffelStudio

Type: Tool
Platform: Any
Version: 5.0
Availability: Basic Package

See:

  • Introduction
  • Guided Tour
  • How To's
  • Reference


EiffelStudio How To's

  • Starting a project
  • Browsing
  • Editing a project
  • Compiling
  • Running and debugging
  • Designing a project
  • Analysing a project
  • Generating documentation
  • Customizing


Starting a project

  • Creating a new project
  • Retrieving a project from an Ace file
  • Opening a compiled project


Creating a new project

The first thing to do to start Eiffeling is to create a project. Most commands are disabled when no project is created.

When opening EiffelStudio, by default a dialog is popped up that proposes to create or open a project:

Under Create a new project, several options are offered, which depend on the package of EiffelStudio you have and on the platform you are on.

  • Basic application is the most basic new project that can be generated. It only includes the base library and by default only creates the frame of the project. This is the ideal choice to start a textual (console) application, or to discover Eiffel. Indeed, the project is very light and includes only things that are essential in any project. It is available on all platforms.

  • .NET application has by default all essential components to start a project targetting the Microsoft .NET platform. Of course, it is only available on Windows, and only if you have chosen to install the .NET support during the installation.

  • Vision2 application creates a new project that includes the EiffelVision2 library. This is the perfect choice to start a platform-independent graphic application, or even any graphic application, since EiffelVision2 is easier to use than platform-specific libraries. This option is available on all platforms and all packages.

  • WEL application generates a project using the Windows Eiffel Library (WEL). This option is recommended for projects needing advanced Windows features, or Windows applications that are time-critical, since the graphic functionality provided by WEL is more efficient than the one provided by Vision2, which on the other hand provides a platform-independent abstract interface. This wizard is only available on Windows.

All those options are also available in the File/New project... menu. This pops up a dialog with all the options to generate a new project:

Tip: If you checked the "Don't show this dialog at startup" checkbox in the start-up dialog but want to get it back, you can use the Preferences dialog to reset the default value.

See Also
Retrieving a project from an Ace file
Opening a compiled project


Retrieving a project from an Ace file

If you have already designed a project and want to retrieve it, or if you want to open a project created by someone else (such as the examples of the libraries which are shipped with EiffelStudio), you should select Open existing Ace (control file). It is located in the startup dialog:

and in the new project dialog:

Tip: If the project you want to retrieve is already compiled, you should select Open compiled project instead. This will avoid having to recompile the project.

A dialog is then popped up that prompts for the ace file and the project location:

Indicate the Ace file (*.ace) that contains information concerning the project you want to retrieve, and choose the directory where this project should be compiled.

See Also
Creating a new project
Opening a compiled project


Opening a compiled project

Whenever a project has been compiled successfully, files are created in the project directory. These files include the .epr file and the EIFGEN directory. They contain all the information produced by the compiler. After exiting EiffelStudio, it is possible to open again a project that has been compiled by indicating the location of the .epr file to the system.

To do this:

  • In the startup dialog, select Open compiled project. If the .epr file you want to open is not in the list, click Browse and indicate the location of the .epr file.

  • Or, click the File/Open Project... menu and indicate the location of the .epr file.

See Also
Creating a new project
Retrieving a project from an Ace file


Browsing

  • Searching
  • Viewing information about a component
  • Opening a new window


Searching

  • Looking for a cluster.
  • Looking for a class.
  • Looking for a feature.
  • Looking for an expression.


Looking for a cluster

If you know the name of a cluster but not where it is located in the system, there are two ways to find this out:
  • You can try to find it in the cluster tool by expanding the cluster tree.
  • In a window where the context tool is independent from the editor, you can type the name of the cluster in context tool address bar. You may use wildcards ("*" or "?") if you know only a part of the name. You can then locate the cluster in the system by picking the cluster stone in the address bar and dropping it on the view icon [image] of the cluster tool.


Looking for a class

There are two simple ways to find a class if you know its name or a part of it :
  • You may use the cluster tool. This tool presents the entire universe of your project. By developing the cluster tree, you will be able to find what you are looking for. This method is quick if you already have an idea of where the class is in the universe.
  • Using address bars will be quicker if you do not have this information or if the size of your project is important. If you type the name of the searched class (you can use wildcards, i.e. "*" and "?") in the main address bar - and then select the right class in the displayed list if there are several possibilities - the editor will be centered on the class you are looking for. The information about the class location will be displayed in the title bar of the window. If you need more complete information about the class location, you can pick the name of the class in the editor and drop it on the view icon [image] of the cluster tool. This tool will then show where the class is in the universe.


Looking for a feature

There are many ways to find a feature in a class. In particular :
  • You can use the feature tool and search the tree by expanding feature clauses. This tool, however, displays only the features that are defined or redefined in the current class text. If you do not know if the feature is inherited or not, you may therefore not find what you are looking for with this method.
  • You can also use the class tab in the context tool. It will allow you to see all the attributes or routines, or all the public features for instance. If you do not know if the feature you seek is an attributes or a function and if it is public, this may not be the right method either.
  • If you know the name or a part of the name of the feature you are looking for, the easier and faster way will probably be to use the address bar. If you type this name in the feature field of the bar (using "*" and "?" wildcards if you want to), the editor will be centered on the right class if necessary (i.e. if the feature is inherited) and scroll to the position of the text of the feature.


Looking for an expression in a text

To find a word or an expression in a text, you can use the search tool. If it is not displayed, you can make it appear by clicking on its icon [image] in the tool bar. This tool will allow you to search a word or an expression with wildcards ("?" or "*") and to replace it if you want to. It can be case sensitive and look for isolated words.

Note: The search tool will look for the wanted word in the editor or in the context tool, depending on which one has the focus.

Tip: There are several accelerators that will make it even easier to perform a search. They are detailed in the editor help.


Viewing information about a component

  • Centering tools on a component.
  • Viewing information about a cluster.
  • Viewing information about a class.
  • Viewing information about a feature.


Centering tools on a component

There are three kind of tools directly available in a default development tool : browsing tools on the left, the editor on the upper right and context tools on the lower right. No browsing tool, except the feature tool, displays information about a particular component. On the contrary, the editor and context tools display information about a given cluster, class or feature : they are centered on this component. There are several ways to center the editor on an element:
  • use the address bar on the top of the editor. It allows you to set which class (and even which feature in the class) you want the editor to display. You may use wildcards ("?" or "*") as you type the names of these components.
  • use pick and drop. Pick a cluster, class or feature stone anywhere in EiffelStudio and drop it in the editor. It will center it on the component automatically.
  • find it in the cluster, feature or favorites tool and click it.
The context tool can be independent from the editor. If it is not, both the editor and the context tool will be centered on the same component. If it is, there is a second address bar, in the context tool title bar. You may then center the context tool on a component by using the three methods described for the editor. You can also center the context tool on the same component as the editor ( the context tool remaining independent): Just click [image] or select Send to the context tool in the View menu.
To make the context tool independent if it is not, click [image] or select Isolate context tool in the View menu. To do the opposite, click the same icon or select Merge context tool in the View menu.


Viewing information about a cluster

To view information about a cluster, you have to center the context tool on this component. Then the metric tool will provide a complete set of measures that you will able to compute.

See Also
Looking for a cluster
Analysing a project


Viewing information about a class

Once you centered the editor on a class, you have access to its basic text. If the class is compiled, the feature tool shows the list of the features that are defined or redefined in this text. You can also view clickable, flat, flat contract and contract views of the class in the editor. The class tab in the context tool can display more information. If the context tool is independent, center it on the wanted class and select this tab. You can then see information about the features (routines, attributes, exported features, etc...) of the class, its ancestors and descendants or its clients and suppliers.
The metric tool provides another kind of data. It allows you to compute a complete set of measures on your class.

See Also
Looking for a class


Viewing information about a feature

Once you centered the editor on a feature, you have access to its text. The feature tab in the context tool can display more information. To have access to it, you have first to center the context tool on the wanted class and select the feature tab. You can then consult the different views of the text of the feature (basic text or flat) and other information such as its callers or its descendant versions.
The metric tool provides another kind of data. It enables you to compute some measures on your feature.

See Also
Looking for a feature


Opening new windows

There are several ways to open a new window. First, you can use the pick and drop shortcut. Then, you can use new window menu items and the corresponding icons. There are three such commands:
  • Clicking on New window in the File menu or on [image] make an new window appear. In this window, the editor and the context tool will be visible.
  • Clicking on New editor window in the File menu or on [image] does the same as the previous command but the context tool is minimized in the new window.
  • Clicking on New context window in the File menu or on [image] make this time a new window with a minimized editor appear.
Note: Icons mentioned above are droppable: instead of simply clicking on them, you can drop a stone on them. The tools in the new window will then be centered on the corresponding component.


Editing a project

  • Adding a cluster
  • Adding a class
  • Adding a feature
  • Removing a cluster
  • Removing a class
  • Removing a feature
  • Moving a class
  • Renaming a class
  • Changing project parameters


Adding a cluster

It is possible to create new clusters from EiffelStudio. A dialog window has been designed to help you do so.

There are three ways to make this window appear. You can:

  • Click [image] in the standard toolbar.
  • Click [image] in the Cluster tool.
  • Select New cluster in the Tools menu.
Using this dialog, you can either create a subcluster of an existing cluster or a top-level cluster.

If you decide to create a top-level cluster, you should give it a name and a path (if the selected path does not exist, it will be created). You can also choose its basic properties, such as whether it should be a library cluster and/or a recursive one (being a library cluster implies being recursive).

If you want to create a subcluster, give it a name and select its parent in the list of available clusters (read-only clusters are not displayed). Giving it a path is not required. If you do not set a path for a new subcluster, it will be located by default in a subdirectory of its parent cluster, named after the subcluster name. This is the recommended way of creating a subcluster (since its path in the Ace file will be automatically relative to the parent), but it is not compulsory.

To import an existing cluster, you can also go to the Clusters tab in the Project Settings dialog and click Add. Although this solution may be slightly more tedious, it gives access to more options.

See Also
Removing a cluster


Adding a class

A dialog window is dedicated to the creation of new classes.

A list of all the clusters of the system lets you to choose in which one the new class will be inserted. The name of the new class and the name of the corresponding file can be set thank to two text fields above the list. It is also possible to define whether the class should be deferred or expanded, what its creation feature is (if any), what its parents are and whether the default feature clauses should be generated.

Tip: You can change the class text that is generated by default by editing the following files: $ISE_EIFFEL\studio\help\defaults\$ISE_PLATFORM\full.cls (with default feature clauses) and ...\empty.cls (without default feature clauses).

To make the window appear, you can:
  • Click [image] in the standard toolbar.
  • Select New class in the Tools menu.
  • Type the name of the new class in the class field of the main address bar or the context tool address bar. The current cluster will then be preselected.
  • Use the diagram tool: Pick the icon [image] and drop it on the diagram in the right cluster. This will make the dialog window appear with the chosen cluster selected.
See Also
Removing a class


Adding a feature

  • Inroduction
  • Opening the new feature dialog
  • Creating a procedure
  • Creating a function
  • Creating an attribute


Introduction

To add a feature to a class, you can directly edit its text of course. EiffelStudio offers you other ways to do so. A dialog window has been designed to help you to add features. Once you make it appear, the new feature dialog allows you to choose what kind of feature you want to create and to set most of its characteristics. The process of creating the new feature is different if it is a procedure, a function or an attribute.


Opening the new feature dialog

To make the new feature window appear, you can:
  • Click [image] in the standard toolbar.
  • Select New feature in the Tools menu.
  • Use the diagram tool: First, select create new client-supplier links by clicking on [image]. Then, pick the class to which you want to add the new feature. Lastly, drop the pebble on the class that corresponds to the type returned by the new feature.

    • This last method does not allow you to create procedures.
The first thing to do when the dialog is displayed is to choose the kind of feature you want to create. The rest of the process depends on what you selected : procedure, function or attribute.


Adding a procedure

Once the new feature dialog is displayed and procedure selected in feature type, follow the following steps:
  1. Choose a feature clause
  2. Type a name
  3. Select formal parameters
  4. Type a header comment
  5. Enter precondition, local variable, body and postcondition


Adding a function

Once the new feature dialog is displayed and function selected in feature type, follow the following steps:
  1. Choose a feature clause
  2. Type a name
  3. Select formal parameters
  4. Select the type
  5. Type a header comment
  6. Enter precondition, local variable, body and postcondition


Adding an attribute

Once the new feature dialog is displayed and attribute selected in feature type, follow the following steps:
  1. Choose a feature clause
  2. Type a name
  3. Select the type
  4. Type a header comment
  5. Select a class invariant
  6. Select to create a set-procedure


Removing a cluster

To remove clusters, you can:
  • Center the editor on the component, and click [image] in the standard toolbar or select Remove current item in the Tools menu.
  • Drop a pebble of this component on [image] in the standard toolbar or in the Diagram tool toolbar.
  • Use the cluster tab in the project configuration window.
See Also

Adding a cluster


Removing a class

To remove a class, you can:
  • Center the editor on the component, and click [image] in the standard toolbar or select Remove current item in the Tools menu.
  • Drop a pebble of this component on [image] in the standard toolbar or in the Diagram tool toolbar.
Caution: Removing a class from the system implies the deletion of the corresponding file on disk.
Caution: Picking a feature and dropping it on the delete icon, or calling Remove current item as the editor is centered on a feature, will not remove the feature but the class to which it belongs.

See Also
Adding a class


Removing a feature

To remove a feature, you may of course delete the corresponding lines in the class text. You can also use the Diagram tool if it is an attribute or a function. To do so, make sure that supplier links are shown in the diagram (if [image] is not pressed, click it). Pick the link that correspond to the feature you want to remove and drop the pebble on [image].

See Also
Adding a feature


Moving a class

To move a class from a cluster to another one, you have to use the Diagram tool. First, center the tool on the cluster that contains the class you want to move. Then, if the destination cluster is not shown on the diagram, pick it in the cluster tool and drop it in the diagram. Once both clusters are displayed, you just have to drag the class to its destination.

See Also
Find where a class is.
Find where a cluster is.


Renaming a class

Renaming a class can sometimes be tedious. It is necessary to update clients and ancestors of the renamed class, and they may be numerous. EiffelStudio offers a simpler way to remedy this problem.

The solution is provided by the Diagram tool: to rename a class, center the context tool on it and display the diagram. Then pick the class (from anywhere in EiffelStudio) and drop the pebble on [image]. A dialog window will then appear. It will allow you to set the new name. It will also propose three options : Change name locally, Global search/replace of name in compiled classes and Global search/replace of name in entire universe. The first option is equivalent to modifying manually the class name in its text. The second option will rename the class and update its clients and ancestors. The third option will do the same as the second and will also update classes that are in the universe but not in the system.
Changes are actually made when you press OK.


Changing project parameters

A tool has been designed to help you to modify the settings of your project. To make the Project configuration tool appear, there are two possibilities:
  • Click [image] in the standard toolbar.
  • Select Project settings... in the Project menu.
This tool will allow you, for instance, to add or remove clusters, set the assertion level or activate debug clauses.

For more complete information, please refer to the Project configuration tool help.


Compiling

  • Generating executables
  • Generating libraries
  • Changing the assertion level
  • Enabling the profiler
  • Using libraries
  • Tuning a program
  • Using threads


Generating executables

There are several ways to compile an executable with EiffelStudio.

Compilation modes include the following: melting, freezing and finalizing. To learn more about the compilation semantics in EiffelStudio, see the compiler reference.

There is a command for all compilation modes in the Project menu, under the entries Melt, Freeze and Finalize. There is also a Quick compile command, that only melts the classes that have been edited in EiffelStudio since the last compilation. You may want to use it as long as no classes are edited outside EiffelStudio.

These commands are also available in the Project toolbar [image], [image], [image], [image] .

To solve the errors that occur during the Eiffel compilation, use the compilation error wizard. For errors occurring during the C compilation, check that the installation is not corrupted (all environment variables should be set, especially ISE_C_COMPILER and ISE_PLATFORM), and refer to your C compiler documentation for more information.

See Also
Command line options
Compiler reference


Generating libraries

There are two main types of libraries in Eiffel: precompiled Eiffel libraries and C libraries. Both kinds of libraries can be created via EiffelStudio. The former can only be used in Eiffel projects, C libraries can be used either in Eiffel programs, or in standard C programs.

To generate an Eiffel precompiled library:

  • Select the Precompilation Wizard in the Tools menu and follow the instructions,

or

  • Launch a new EiffelStudio session,
  • Select Open existing Ace, [image].
  • Click Next,
  • Select the Ace file of the library you want to precompile,
  • Give a location where to put the precompiled library,
  • Uncheck the Compile the generated project check box in the next dialog:

  • Click OK
  • Choose Precompile in the Project menu.

To generate a dynamically linked C library using Eiffel code:

  • Generate a definition file for this library, via the Dynamic library Builder,
  • Open the Project Settings dialog,
  • In the Advanced tab, check Shared library definition,
  • Enter the name of the definition you created in the first step (including the path if necessary),
  • Compile the current project.

The generated C library should be located in the EIFGEN|W_code directory in the directory of your project.

To generate a C library from a C compiler, please refer to the documentation of your C compiler.

See Also
Using libraries
CECIL library: calling Eiffel routines from C programs
Command line options


Setting the assertion level

To modify the assertion level in a generated binary (executable or library),

  • Open the System Settings dialog.
  • In the General tab, select the assertions you want to check (among require, ensure, check, loop and class invariant).
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

See Also
Assertions in Eiffel


Enabling the profiler

To profile an executable, the profiler must first be enabled. To enable the profiler:

  • Open the System Settings dialog.
  • In the debug/profile tab, check the Profiling checkbox.
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

See Also
Profiler reference


Using libraries

There are two kinds of libraries in Eiffel: precompiled Eiffel libraries and C libraries.

To use an Eiffel precompiled library:

  • Open the System Settings dialog.
  • In the General tab, enter the location of the precompiled library you want to use in the Precompiled Library field.
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

Note: You can only use one precompiled library at a time in a project. To use more than one, you should precompile all the libraries you want to use together in a single precompiled library.

To use a C library:

  • Open the System Settings dialog.
  • In the Externals tab, in the Include path field, type the paths of the header files needed to use the library (pressing the Add button for each).
  • In the Object file field, type the object files needed to use the library (pressing the Add button for each). These files can be either library files (.lib, .a, etc) or object files (.obj, .o, etc)
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

See Also
Creating libraries
Adding classes and clusters from Eiffel libraries without precompiling the library
Making C calls in Eiffel


Tuning a program

The best way to speed up a program is of course to improve the algorithms and data structures you are using. Spotting the functions that slow down the execution and improving can change a lot in a program. Profiling can be used for this.

Try to keep the number of classes and objects in your system as low as possible to ensure maximum efficiency. This should never hinder the design of the system, though.

You can also use the functionality provided by the MEMORY class to tweak the garbage collector behavior according to your needs. However, be careful with this, since providing erroneous parameters might lead to memory leaks, huge memory consumption, or on the contrary a dramatic slow down of the application. If you are not entirely sure what a parameter is for, avoid changing it. The default values should fit for most standard applications.

On top of that, EiffelStudio provides powerful optimizations, some being done automatically, others being configurable. To obtain a maximum efficiency, it is recommended to Finalize your program from scratch and without using precompiled libraries.

In the System Settings dialog advanced tab, try experimenting the Inlining option, and setting the maximum size of features that should be inlined. Only Eiffel features are inlined by this option, to see how to inline the C functions you may be using in your program, please refer to your C compiler documentation.

In the System Settings advanced tab, enabling the Dead code removal will help produce smaller executables.

Removing the Execution Trace will optimize the executable in size and speed, but in case of crash no information will be available.

You can also enable the Array optimization option to slightly speed up array access.

All these options are located in the System Settings dialog, under the Advanced tab. They are only effective during finalizations.

See Also
Profiler reference


Using threads

Eiffel supports multithreaded programs. The thread library provides ways to handle threads safely inside an Eiffel program. Make sure you add it to your project if you want to use threads.

To create a multithreaded program or library:

  • Open the System Settings dialog.
  • In the Advanced tab, check the multithreaded runtime option.
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

Caution: Make sure the external and precompiled libraries you use have also been compiled with support for threads.

See Also
Creating libraries
Adding classes and clusters from Eiffel libraries without precompiling the library


Running and debugging

  • Running an application
  • Interrupting an application
  • Exploring an application dynamic state
  • Using breakpoints
  • Handling exceptions
  • Using debug clauses
  • Setting command line arguments
  • Profiling


Running an application

There are several ways to launch an application. Not all are available depending on the way you compiled your system.

Melted and frozen executables can be debugged. Several methods can be used to launch such an executable:

  • The default Run command [image] . It launches the executable located in the EIFGEN|W_code directory under the project directory. The execution stops whenever a breakpoint is encountered.
  • The Run without breakpoints command [image] . It has the same behavior except that the execution won't stop when a breakpoint is met.
  • The step commands, which execute only a small part of the program at a time:
    • The step into command [image] , which tries to enter the feature that is about to be called.
    • The step by step command [image] , which executes one execution line.
    • The step out command [image] , which launches the application and stops it as soon as the application exits the feature it is stopped in.

Tip: All the above commands can be accessed either in the Project toolbar or in the Debug menu.
They can be used either to launch the program or to resume its execution after it has been paused.

  • It is also possible to select Run to breakpoint in a breakpoint context menu to have the application be launched and executed until it reaches the selected execution line.

Finalized executables can also be run, but they are not debuggable and cannot be interrupted. To run a finalized executable, use the Run finalized command [image] , located in the Project menu and the Project toolbar.

See Also
Compiling an executable
Using breakpoints
 Interrupting an application


Interrupting an application

There are two ways a debugged application can be interrupted: its execution can be paused, or it can be killed.

Two methods can be used to pause a debugged application:

  • The Stop command [image] , located in both the debug menu and the project toolbar.
  • Breakpoints, which make it easy to stop the application at a precise point.

To kill a debugged application, use the Kill command [image] , located in both the debug menu and the project toolbar.

See Also
Running a program
Using breakpoints


Exploring an application dynamic state

To view the dynamic state of a debugged application, just stop it at the point where you want to see its context. The debugger tools will automatically be popped up then, yielding the call stack of the application, as well as the state of the objects located in the object tree, which include at least the object corresponding to the level of the call stack where the call stack cursor [image] is.

To see at which point the features in the call stack have stopped, just click the feature on which you want this information in the call stack. Doing this will change the cursor position in the call stack and display the flat view of the feature in the context tool.

To follow an object state between pauses of the application, pick and drop it into the object tree, which will make it stay in it.

You can also query features dynamically by using the evaluation tool, which can be very useful to have glimpses of the C memory of the system, for instance.

See Also
Pausing an application
Call stack tool
Object tool
Evaluation tool


Using breakpoints

To change the status of one breakpoint, it is possible to use the breakpoints menu, which changes the state of a single breakpoint at a time.

To change the status of several breakpoints at the same time, the easiest way is to use the breakpoints-related commands, which have actions at feature-scope, class-scope and system-scope.

See Also
Running an application
Interrupting an application
Breakpoints reference


Handling exceptions

It is possible to raise and catch exceptions in Eiffel. Catching exceptions is done by using the rescue keyword. The EXCEPTIONS class provides helper features to analyze the caught exception and handle it.

The EXCEPTIONS class also provides ways to raise exception, via its feature `raise'.

When an exception is raised while the application is being debugged, the application stops immediately and the debugger displays the context in which the exception occurred, whether or not the exception is rescued.

See Also:
Reference of exceptions


Using debug clauses

Eiffel provides ways to add debug code to features to help during their debugging. You may think of it as the well-known C construct:

#ifdef MY_DEBUG_FLAG
/* Debug code is here */
#endif

The corresponding construct in Eiffel is provided by the debug keyword. It is possible to wrap code inside a debug clause like this:

debug ("MY_DEBUG_FLAG")
    -- Debug code is here.
end

It is then possible to enable or disable debug clauses globally.

To modify the debug clauses status:

  • Open the System Settings dialog.
  • In the Debug/Profile tab, the enable debug check box affects the system globally.
  • The list under it gives the possibility to enable or disable each debug clause separately, through a context menu that appears when right-clicking on them.
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

Tip: Debug clauses make it easy to remove all debug messages when finalizing a system.


Setting the command line arguments

To debug a program that uses command line parameters, it is possible to have the debugger call the generated program with certain command line arguments automatically.

To change the command line arguments used when debugging:

  • Open the System Settings dialog.
  • In the Debug/Profile tab, type the command line arguments you want to use when debugging in the Program arguments entry.
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

Note: All command line arguments are automatically saved, which makes it easy to switch between different command lines.
To remove a command line definitely, click the delete [image] button on the right of the Program arguments entry.

Tip: To get the command line arguments in a program, it is possible to either define the root feature as taking an array of STRING objects, or to use the ARGUMENTS class, which provides a lot of functionality linked with command line arguments.


Profiling

The profiler is a tool that gives dynamic execution time information. It is very useful to detect which parts of a program need to be optimized most.

To use the profiler, the first thing to do is to enable it.

To enable the profiler:

  • Open the System Settings dialog.
  • In the Debug/Profile tab, check the Profiling check box.
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

By default the profiler will profile the entire program. However it is possible to enable or disable the profiler on certain clusters only. To do this:

  • Open the System Settings dialog.
  • In the Cluters tab, check the Profile check box in the clusters where you want the profiler to be enabled.
  • Click Apply or OK.
  • You must recompile your project for the changes to take effect.

It is also possible to dynamically start and stop the profiler in a program. To do this:

  • Create an object of type PROFILING_SETTING.
  • Call `start_profiling' on this object to start the profiler.
  • Call `stop_profiling' on this object to stop the profiler.

Tip: To profile only part of a program, turn off the profiler at the very beginning of the program, turn it on just before the part of the code that should be profiled, and turn it back off after this section. Typically, it results in the following code:

In the root feature:

local
    ps: PROFILING_SETTING
        -- Other local variables if necessary.
do
    create ps
    ps.stop_profiling
        -- Real program execution.
    ps.start_profiling
end

And in the feature(s) that needs to be profiled:

local
    ps: PROFILING_SETTING
        -- Other local variables if necessary.
do
    create ps
    ps.start_profiling
        -- What needs to be profiled.
    ps.stop_profiling
end

Note: Even if the profiler should only work in certain sections of code, the Profiling check box of the System Settings dialog must be checked or the profile option must be set in certain clusters.

Once the profiler has been enabled and the program has been recompiled, it is necessary to launch the program.

Tip: It is possible to profile debuggable (frozen/melted) executables as well as finalized ones. It is more interesting to profile finalized executables, though, since the execution speed is more representative of what will be obtained by your end users.

When the program exits, a file named 'profinfo' should be generated next to it.

All that's left to do is launch the Profiler wizard and follow the instructions.

See Also
Generating executables
Running a program
Tuning a program


Designing a project

  • Switching to the diagram tool
  • Undoing and redoing
  • Altering the system
  • Managing links
  • Modifying the display
  • Managing views
  • Exporting a diagram to PNG image file


Switching to the diagram tool

  • In order to switch from coding to designing, click the Diagram tab in the Context tool. Open the context tool by checking menu item View | Explorer Bar | Context.

Tip: to make sure all your changes are in the diagram, perform a compilation.


Undoing and redoing

Almost all actions in the diagram tool are undoable. Every action that can be undone, can also be redone. For advanced undoing, open the history tool.

Tip: undo actions cannot be undone. Use redo to undo an undo action.

  • To undo the last action, click Undo last action.
  • To redo the last action, click Redo last action.
  • To undo all actions up until a specific action:
    1. Click the History tool button.
    2. The History tool dialog appears with a list of all undoable actions. By clicking on one of the actions, the diagram returns to the state it was in just after you performed this action.

Note: when an action is performed that cannot be undone, the history tool is emptied.


Altering the system

  • Creating a new class
  • Creating a new feature
  • Changing class names and formal generics
  • Deleting items


Creating a new class

  • To create a new class pick from the Create a new class button. Then drop on the diagram where you want to place the class bubble. A dialog now appears where you can enter a name and specify the cluster.
Creating a new class using the address bar


Creating a new feature

To create a new feature just add a new client link in the diagram.

See Also
Creating a new feature


Changing class names and formal generics

  1. Start pick-and-drop on the class bubble of which you want to change the name or formal generics.
  2. Drop it in the Change class name and generics hole.
  3. The Class header dialog appears. You can enter a new name and/or formal generics.
  4. If you changed the name, choose between these options:
    • Change name locally: the name will be changed in the class declaration only. Any references to this one are now invalid.
    • Global search/replace of name in compiled classes: like the option above, but every reference to the class in compiled classes are also replaced with the new name.
    • Global search/replace of name in entire universe: like the option above, but references are replaced even in classes that are not in the system.
  5. Click OK.


Deleting items

  • Pick-and-drop the item you want to remove in the Delete hole. For links, the associated Eiffel code will be removed from the class text. Clusters and classes will be deleted from disk!

Caution: an action that deletes one or more files or directories cannot be undone!

Tip: turn on Automatic backups. EiffelStudio will make a copy of each class file every time a compilation is done.

Removing items from the view only


Managing links

  • Creating inheritance links
  • Creating client/supplier links
  • Creating aggregate client/supplier links
  • Using the link tool


Creating inheritance links

  1. Select the button Create new inheritance links.
  2. Start pick-and-drop on the class where the parent should be added.
  3. Drop on the desired parent class.

Note: this action will automatically add the parent in the class text, but no inheritance clause is added.

See Also
Creating client/supplier links


Creating client/supplier links

  1. Select the button Create new client/supplier links.
  2. Start pick-and-drop on the class where the feature should be added.
  3. Drop on the desired supplier class.
  4. The Create feature dialog appears. See Creating an attribute or Creating a function using the feature wizard for more information.
Creating aggregate client/supplier links
Creating inheritance links
Feature wizard


Creating aggregate client/supplier links

  1. Select the button Create new aggregate client/supplier links.
  2. Start pick-and-drop on the class where the feature should be added.
  3. Drop on the desired supplier class.
  4. The Create feature dialog appears. See Creating an attribute or Creating a function using the feature wizard for more information.
Creating client/supplier links
Creating inheritance links
Feature wizard


Using the link tool

If you do not want straight arrows, you can insert handles on them. It is recommended that you use the link tool to do this, because it inserts the handles so that the angles in the line are exactly 90 degrees.

  1. To apply straight angles to a link, drop it in the Put handles on a link hole.
  2. The Link tool appears. Select the type of angle(s) you want for the link.

    The combinations of handles you can apply to your link are:
    • Put handle left
    • Put handle right
    • Put two handles left
    • Put two handles right
    • Put three handles left
    • Put three handles right
    • Remove handles
  3. Click Apply to see a preview the new layout of the link.
  4. Click OK when you are satisfied with the result, pressing Cancel will put the link back the way it was.


Modifying the display

  • Showing or hiding links and labels
  • Changing system exploration depth
  • Removing items from a view
  • Changing colors of classes
  • Zooming a diagram
  • Retrieving all classes into a cluster
  • Iconifying and restoring a cluster


Showing or hiding links and labels

  • To toggle visibility of all client links, click Show/hide client-supplier links.
  • To toggle visibility of all inheritance links, click Show/hide inheritance links.
  • To toggle visibility of all client link labels, click Show/hide client-supplier links.


Changing system exploration depth

  • If you want to change the context of the current cluster or class in the diagram, click the Select depth of relations button.
    The Context dialog appears. The layout depends on whether the current context is one of a class or cluster.
    • Context is a class:
    • Context is a cluster:


Removing items from a view

  • To remove an class, cluster, or link from the current view, use pick-and-drop to drop it in the Remove figure hole.

Note: if you want to remove the item from the system, use the Delete hole.


Changing colors of classes

  1. Start pick-and-drop on the class bubble you want to change the color of.
  2. Drop it in the Change color hole.
  3. A color selection dialog appears. Select the color you want and click OK.


Zooming a diagram

  • To enlarge the diagram, click Zoom in.
  • To shrink the diagram, click Zoom out.


Retrieving all classes into a cluster

  • If you have a cluster in your view that is incomplete and you want to show all classes in it, drop the cluster into the Include all classes of cluster hole.


Iconifying and restoring a cluster

  • If you do not want to hide the cluster, only its contents, iconify it by double clicking on the cluster label. Double clicking it again returns the cluster to its normal state.

Tip: if the entire cluster is of no relevance to your diagram, hide it from the view altogether.


Managing views

  • Adding a view
  • Deleting a view


Adding a view

  1. To add a view of the current class or cluster, select the view you want to duplicate to the new one using the View combobox.
  2. Enter the name of the new view in the View combo box.
  3. Press enter. The view is now created.


Deleting a view

  1. To delete a view, select the view you want to remove using the View combobox.
  2. Click the Delete current view button.
  3. If you choose to confirm, the view has been deleted, and the "DEFAULT" view is selected.

Note: you cannot delete the view "DEFAULT".


Exporting a diagram to PNG image file

  • To save the current diagram to an image file, click Export diagram to PNG.
    A dialog will pop up where you can specify a location for the generated file.


How to analyze a project

  • Introduction
  • Computing a measure
  • Handling new metrics
  • Handling archives


How to analyze a project

The metric tab in the context tool allows project analyzing. Built on a suitable metric theory, this tool provides a set of elementary metrics that can be evaluated to test projects design and implementation.

The metric tool provides the following interface to evaluate measures, save them or delete some of them when no longer needed.

See section:

  • Computing a measure

This tool also allows users to define their own metrics. Indeed, users may have specific requirements and the set of metrics provided by default could be insufficient. See section:

  • Handling new metrics

Eventually, it is also possible to evaluate metrics for a different project than the currently loaded, and to compare systems one to another. See section:

  • Handling archives


Computing a measure

  • Introduction
  • Calculating a measure
  • Saving a measure
  • Deleting measures
  • Detailing a measure
  • Updating measures


Computing a measure

The metric interface allows users to analyze their projects. It provides a set of metrics that could be evaluated over various scopes to obtain quantitative information about systems.

Thanks to the metric interface, users can evaluate metrics over different scopes, get some detailed information when possible, save the pertinent measures, delete the useless ones, and update the values of previously recorded metrics.

To achieve any kind of operation on measures, you need at least one of the following fields or buttons:

  • Calculating a measure
  • Saving a measure
  • Deleting measures
  • Detailing a measure
  • Updating measures


Evaluating a measure

To evaluate a metric over a scope:

  1. Select the object you want to evaluate the metric on (a feature, a class or a cluster. System is compulsory the running one).
  2. Select the scope type from the scope combo box (you can either choose the scope type of the previously selected object or a greater scope type in the sense of the following order relation: feature < class < cluster < system < archive).

    Note: If you choose "Archive" as scope type, a dialog will ask for opening an archive file to compute the metric over. Select then an archive file.
  3. Select a metric from the metric menu.

  4. Click the calculate [image] button.

The measure is displayed in the provided text field below commands, see red rectangle in the following example:

In some cases, you can get more information about the evaluated metric. See detailing a measure.

Note: - Scope type list is either shrunk or extended regarding selected object (only greater scope types appear).
- All metrics are not available for any scope type.

Caution: When calculated, a measure is not saved yet!

See Also
Saving a measure, detailing a measure.


Saving a measure

To save the result of evaluation of a metric over a scope:

  1. Evaluate a metric over a scope.
  2. You can enter a name in the name field, otherwise, the metric tool generates automatically a name for the saved measure.
  3. Click the add [image] button. (link to buttons).

The result is added to the multi column list, with a [image] icon, meaning that the measure is related to the last compilation of the project.

If you are saving measures for the first time, a file will be automatically generated to store measures. It is located in the "Metrics" subfolder of current project. Otherwise, this file is updated.

A dialog reminds you of the path of the file in which measures are stored.

Note: After recompiling the project, all [image] icons are changed to [image] to inform that measures could have changed since project has been recompiled. You can update your measures.

See Also
Calculating measures, updating measures, deleting measures, detailing measures.


Deleting measures

To delete a set of measures, you must have saved some of them previously. Recorded measures are displayed in the multi column list. Here is an example of a non-empty multi column list:

  1. Select a row (or a set of rows using SHIFT or CTRL keys) from the multi column list.
  2. Click on the delete [image] button. Selected row (s) will disappear from both multi column list and from the recording file located in the "Metrics" subfolder of the current project.

Caution: Delete operation is not undoable!

See Also
Calculating measures, saving measures.


Viewing measure details

It is possible to have some details when evaluating a metric.

  1. Evaluate a metric over a scope.
  2. If the details [image] button becomes sensitive, click it to display details.
  3. If not, sorry, no details are available for this measure.
  4. To come back to the main interface click again on details [image] .

Here is an example of the details obtained after a measure calculation:

See Also
Calculating measures, saving measures.


Updating recorded measures

After recompilation, some of the saved measures are no longer accurate. They are pointed by the icon [image] in the multi column list. It is possible to update the previously saved measures.

To update a result (or a set of result):

  1. Select a row or a set of rows (using SHIFT or CTRL keys) from multi column list.
  2. Right click on the multi column list.
  3. Choose from the pop up menu to update either selected rows or all rows.

Updated rows will be pointed by a green tick [image]. New measures will also be updated in the file located in the "Metrics" subdirectory of current project.

See Also
calculating measures, saving measures, deleting measures.


Handling new metrics

  • Introduction
  • Defining new metrics
  • Managing new metrics


Handling new metrics

The metric tool ("Metric" tab of the context tool) provides by default a set of metrics that can be used to make some measurements over various scopes in order to evaluate a project. These metrics are available in the metric menu of the metric tool.

This set of metrics is certainly not complete, users may probably want to define other metrics regarding their own needs. And then, since needs are different and in order to avoid an explosion in the number of basic metrics, we agreed on implementing only elementary metrics that could not be evaluated if not implemented in the tool.

Users can then define their own metrics. The metric tool provides an interface to define new metrics. click on [image] in the metric tool to display the following dialog:

However, to avoid defining unmeaning metrics, it is not possible to define any kind of metrics. the tool allows linear, ratio and logical combination of the available metrics. See section:

  • Defining new metrics

Further operation on new metrics are available, such as reordering these new metrics, deleting some of them, editing them to check (and possibly change) their definition, eventually, import import a set of metrics defined in a given file.

To achieve one of these operations, click on [image] in the metric tool to display the following interface:

For further information on the use of this interface, please, see section:

  • Managing new metrics


Defining new metrics

  • Introduction
  • Derived metrics
  • Linear metrics
  • Ratio metrics
  • Scope comparison metrics


Defining new metrics

The metric interface provides by default a set of basic metrics. However, user may want to define other metrics, such as linear sums or different ratios, or combining some criteria... This is possible thanks to the [image] button of the context tool. An interface, "New metric" dialog, allows then the creation of four different kinds of metrics:

  • Derived metrics
  • Linear metrics
  • Ratio metrics
  • Scope comparison metrics

New metrics are increasingly added to the metric menu, and are available for calculation.

See Also
calculating a measure, managing new metrics


Defining derived metrics.

To define a derived metric, you must have already clicked on [image] of the "Metric" tab in the context tool. Select then the "Derived" tab of the "New metric" dialog:

  1. Enter a name in the "New metric name" field.

  2. Select a raw metric. Regarding the selected metric, you will get one of the following panel in the "Criteria" frame:

  3. Choose your criteria by selecting one button from each line.
  4. When you are evaluating this metric on a scope, all criteria could be met, or just some or none of them. If you want the currently defined metric to count scopes that have all the criteria select "All of the following are met", and if you want it to count scopes that have a t least one of the defined criteria, select "At least one of the following is met.
  5. If you want to save the metric definition without exiting the interface, click on "Save", otherwise, click on "OK" to save and exit.
  6. If you want to define another derived metric, click on [image] to reset

Note: Unit is adjusted in the "Unit" field regarding the selected raw metric

See Also
Managing new metrics


Defining linear metrics

To define a linear metric, you must have already clicked on [image] of the "Metric" tab in the context tool. Select then the "Linear" tab of the "New metric" dialog:

  1. Enter a name in the "New metric name" field.

  2. Define a single term by entering a coefficient in the "Coefficient" field and choosing a metric from the "Metric" combo box. The unit field and the formula field will be automatically filled regarding the selected metric.

  3. Click on [image] to validate the defined term. It will be displayed in the "Linear sum" field.

  4. To add other terms, repeat operation 2. and 3. as many times as needed.

  5. To remove the last entered term, click on [image]. To remove a term, click on the same button as many times as needed, then re-enter missing terms.

  6. If you want to save the metric definition without exiting the interface, click on "Save", otherwise, click on "OK" to save and exit.

  7. If you want to define another linear metric, click on [image] to reset.

Note: After you have selected the first term of the linear sum, you can only add terms containing metrics of the same unit.

See Also
Managing new metrics


Defining ratio metrics

To define a ratio metric, you must have already clicked on [image] of the "Metric" tab in the context tool. Select then the "Metric Ratio" tab of the "New metric" dialog:

  1. Enter a name in the "New metric name" field.
  2. Select a metric for numerator in the "Metric" combo box of the "Numerator" frame to change the numerator in the "Ratio" field.
  3. Select a metric for denominator in the "Metric" combo box of the "Denominator" frame to change the denominator in the "Ratio" field.
  4. If you want to change again either numerator or denominator repeat operations 2. or 3. as many times as needed.
  5. If you want to display measures, when evaluating this metric, in a percentage style, select "Display as percentage".
  6. If you want to save the metric definition without exiting the interface, click on "Save", otherwise, click on "OK" to save and exit.
  7. If you want to define another ratio metric, click on [image] to reset.

Note: - The formula field below each metric combo box gives the selected metric's definition.
- The ratio field is filled in by default, you have just to change numerator and denominator as needed.

See Also
Managing new metrics


Defining scope comparison metric

To define a scope comparison metric, you must have already clicked on [image] of the "Metric" tab in the context tool. Select then the "Scope Ratio" tab of the "New metric" dialog:

  1. Enter a name in the "New metric name" field.
  2. Select a metric from the "Metric" combo box.
  3. Select a scope for numerator in the "Scope" combo box of the "Numerator" frame to change the numerator in the "Ratio" field
  4. Select a scope for denominator in the "Scope" combo box of the "Denominator" frame to change the denominator in the "Ratio" field.
  5. If you want to change again either metric, numerator or denominator repeat operations 2., 3. or 4.as many times as needed.
  6. If you want to display measures, when evaluating this metric, in a percentage style, select "Display as percentage".
  7. If you want to save the metric definition without exiting the interface, click on "Save", otherwise, click on "OK" to save and exit.
  8. If you want to define another scope comparison metric, click on [image] to reset.

Note: - The formula field below the metric combo box gives the selected metric's definition.
- The ratio field is filled in by default, you have just to change metric, numerator and denominator as needed.

See Also
Managing new metrics


Managing new metrics

  • Introduction
  • Reordering new metrics
  • Deleting new metrics
  • Editing new metrics
  • Importing new metrics.


Managing new metrics

After having defined some new metrics, it is possible to reorder them, to delete the useless ones, or to edit them. It is also possible to import a set of metrics defined in another file.

In order to achieve any of the preceding operations, click on [image]. The following dialog will help you for:

  • Reordering new metrics
  • Deleting new metrics
  • Editing new metrics
  • Importing new metrics.


Handling archives

  • Introduction
  • Creating an archive
  • Updating an existing archive
  • Comparing to an archive
  • Evaluating a metric over an archive


Handling archives

The archive file for a system contains all the values of measures resulting from evaluating all metrics over the "system" scope when evaluation is possible. It also contains the definitions of non elementary metrics (the one user has defined or imported) in order to be sure of what is being measured.

The archive files are entitled to achieve comparisons between systems. And then, user can compare systems to evaluate their own projects.

When clicking on [image] in the metric tool, the following interface will help you in:

  • Creating an archive
  • Updating an existing archive
  • Comparing to an archive

An archive can also be considered as a scope even if it is not a sub-element of the loaded system users are working on. Indeed, an archive contains measures, for another system than the current one, previously calculated and registered that could be retrieved. Consequently, evaluating a metric over an archive is nothing but retrieving the corresponding recorded measure.

  • evaluating a metric over an archive


Creating an archive

Users may want to archive the result of the system they are working on. To create an archive, you must have already clicked on [image] in the "Metric" tab of the context tool.

  1. In the "Create/replace archive" frame, click on "Browse".
  2. Select a folder and enter the name of the archive you are about to create. (Do not forget the ".xml" location!)

All the available metrics (except for scope comparison ones, since) are then evaluated over the system scope. Measures are saved in the specified file.

Note: A warning dialog will inform you in case an error occurs (the created file already exists, or you can not create a file in current location).

See Also
Updating an archive, comparing to an archive, evaluating a metric over an archive.


Updating an archive

After recompiling a project, measures are liable to have changed, and then, the archive created for this file -if any- is probably out of date. To update an archive, you mist have already clicked on [image] in the "Metric" tab of the context tool.

  1. In the "Update archive" frame, click on "Browse".
  2. Select the archive file of the current system.

See Also
Creating an archive, comparing to an archive, evaluating a metric over an archive.


Comparing to an archive

The main goal of archives is comparing archives one to another. In order to compare your project to an archived file, you must have clicked on [image] in the "metric" tab of the context tool.

The goal is to load the archive of a (preferably different) project, to compare the archived measures to the system's. You can either select a file that is located on your machine or a remote one, using a URL address.

  1. In the "Set reference archive" frame, select the comparison mode. Comparison can be displayed in one of the following mode:
    - Ratio of current measures to the archived one.
    - Ratio of the difference between current and archived measures to current measures.
    - Value of the archived measures.

If you want to access a remote archive:

  1. Enter the URL address in the " Current archive" field. Address must include either a http or a ftp protocol.
  2. Press the carriage return (enter) key.

If you already have the archive file on your machine:

  1. Click on "Browse".
  2. Select the archive file you want your system to be compared to.

In both cases, exit the main interface (on clicking "OK") to make your comparison effective. Comparison results are displayed in the last column of the multi column list in the "Metric" tab of the context tool, regarding the comparison mode you have previously chosen.

Note: "Current measures" are the result of evaluating available metrics over the current system scope, when possible.

See Also
Creating an archive, updating an archive, evaluating a metric over an archive.


Evaluating a metric over an archive.

In the metric tool, evaluating a metric over an archive is not different from evaluating it over another and more classical scope (see calculating a measure for further details). The only difference is that you have to precise an archive file for that calculation.

See Also
Calculating a measure


Generating documentation

  • Generating multi-format documentation
  • Generating XMI


Generating multi-format documentation

EiffelStudio can generate documentation for a system using many different formats.

The Documentation Wizard, which helps you to get the documentation you want, is available in the Project menu, under the entry Generate Documentation.

The first page of the Documentation Wizard lets you choose between the available formats for the documentation:

Tip: The nicest output is produced by the html-stylesheet format.

Now the wizard asks you to select the clusters you want to produce documentation for:

In the next page you can specify indexing items on which HTML metatags will be based:

Note: This page is only available for HTML documentation.

You can then pick the formats you need among those available. For example, you might need a file containing the Cluster hierarchy of your system or, for each class, a file containing the Contracts of that class. At this point you can also decide to generate BON diagrams for the clusters selected in the previous page.

If you have checked Cluster diagrams in the previous page, you will now be able to choose a view for each diagram that is going to be generated. You have the choice between an automatically arranged view and all of the views you may have manually arranged with the Diagram Tool.

Note: Cluster diagrams are only available for HTML documentation.

Here comes the last page ; you can choose the directory where the documentation is going to be generated:

See Also
Generating XMI documentation


Generating XMI documentation

EiffelStudio can generate an XMI description of a system ; XMI (XML Metadata Interchange) format is the new industry standard way to describe and exchange object-oriented systems, further information can be found here.

Note: Rational Rose needs this add-on to be able to import XMI.

The XMI Export wizard is available in the Project menu, under the entry Export XMI.

The first page of the wizard lets you select the clusters you want to produce documentation for:

On the second and last page, you can choose the directory where the XML file is going to be generated:

See Also
Generating multi-format documentation


Customizing EiffelStudio

  • Setting the editor behavior
  • Changing texts display
  • Customizing toolbars
  • Making the context tool independent from the editor
  • Changing the default history size
  • Choosing classes to be ignored in bon diagrams
  • Customizing class text views
  • Configuring an external editor


Setting the editor behavior

Some of the editor properties are customizable. Automatic completion, for instance, can be partially or totally disabled, and inserted strings can be defined by the user. Some accelerators are customizable too. For more information, please refer to the editor preferences reference.

See Also
Text colors and font customization.


Changing texts display

By modifying EiffelStudio preferences, you can change the font and the colors used to display texts in the editor. For more information, refer to EiffelStudio graphical preferences reference.

See Also
It is possible to choose the order of feature clauses in the views of class texts: See Customizing formatted output


Customizing toolbars

There may be up to 26 buttons in the standard toolbar and up to 17 in the project toolbar. All those buttons are not shown by default though. Only 16 icons are displayed in the default standard toolbar for instance.

It is possible to choose which button are shown and in which order they appear in the toolbars. To do so, use toolbar customization windows. they appear when you choose Customize standard toolbar... or Customize project toolbar... in the toolbars sub-menu of the View menu or in the contextual menu of the toolbars (which is displayed when you right-click in the empty space on the right of the toolbars).

See Also
The toolbars and their buttons.
Toolbars customization windows.


Making the context tool independent from the editor

By default, the editor and the context tool are centered on the same cluster, class or feature. It is possible to make the context tool independent from the editor. It has then its own address bar and can display information on a totally different component than the one on which the editor is centered.

To do so, click on or select Isolate context tool in the View menu. To go back to the previous configuration, click on the same icon again or select Merge context tool in the View menu.

You can also modify the preferences so that next time a window is opened, its context tool will be automatically indenpendent: open the preferences window by choosing Preferences... in the Tools menu. Select then the "context tool" sub-category in the "Tools" of the preferences tree. Lastly click on "Share addresses between the editor and the context tool" and set it to False.
Click on save and exit to complete the change.

See Also
Preference window description.
Preferences reference.


Changing the default history size

By default, there may not be more than 10 items in the history of a development window. It means that combo boxes in the address bar will let you choose between at most 10 possibilities. You can change this number.

To do so, use the preference window: select Preferences in the Tools menu. Then in the preferences tree, select the "Browsing tools" sub-category in the "Tools" category. On the right part of the window, a list of preferences will appear, including "number of items displayed in the history combo boxes". Click on this item and enter the new value.

Click on save and exit to complete the change.

See Also
Preference window description.
Preferences reference.


Choosing classes to be ignored in BON diagrams

Every class in your system inherits from ANY. INTEGER, like other classes that represent basic types, is very often a supplier of the classes the user wrote. It may therefore not be interesting to display classes such as ANY or INTEGER in BON diagrams.

EiffelStudio allows you to customize a list of classes that it has to ignore when it creates diagrams. This list is stored in the preferences. To modify it, first open the preferences window by choosing Preferences... in the Tools menu. Select then the "context tool" sub-category of the "Tools" category in the preferences tree. On the right, you will then see a table of preferences, which includes "Show ALL classes in the diagram" and "Names of classes that should not appear in generated diagrams". If "Show ALL classes in the diagram" is not False, click on it and set it to False. Then click on "Names of classes that should not appear in generated diagrams" and edit the list. Class names must be separated by semicolons.

After modifying the list, click on save and exit to complete the change.

See Also
Preference window description.
Preferences reference.


Customizing class text views

It is possible in EiffelStudio to customize some properties of class text views (other than basic texts) displayed in the editor or class and feature tabs of the context tool. Besides graphical appearance, you may modify:
  • the order of feature clauses.
  • the type of callers and suppliers displayed in the corresponding views.
  • the views that are selected by default.
  • the indexing clauses that should not be displayed.
These properties are set in the preferences. You can modify them in the preferences window. To open this window, select Preferences... in the Tool menu. Then select the "Context tool" sub-category of the "Tools" category in the preferences tree. Click then on a preference on the right to modify its value.

Click on save and exit to complete the changes.

See Also
Preference window description.
Preferences reference.


Configuring an external editor

By clicking on , or by dropping a pebble on it, you can launch an external editor. By default, this editor is VI on Unix and Notepad on Windows. You can tell EiffelStudio to launch another editor by editing the preferences.

To do so, first open the preferences window by choosing Preferences... in the Tools menu. Select then the "Global preferences" category in the preferences tree. Click on "Command used to launch an external editor" and modify the command line so that it calls yout favorite editor. You can use keywords that represent the filename ($target) and the line number ($line) as is explained in the preferences reference.

After modifying the command line, click on save and exit to complete the change.

See Also
Preference window description.
Preferences reference.


EiffelStudio Reference

  • EiffelStudio Introduction
  • What's new in EiffelStudio 5.2
  • General interface description
  • Browsing tools
  • EiffelStudio Editor
  • Project settings
  • Compiler
  • EiffelStudio Debugger
  • Diagram tool
  • Metric tool
  • Wizards and dialogs
  • Formatted information about compiled classes and features
  • Preferences
  • Command line


EiffelStudio Introduction

EiffelStudio is the new Eiffel compiler by Interactive Software Engineering. It includes not only a command line compiler, but also a powerful IDE with several unique features, such as an integrated reverse engineering tool and a quantitative code analyzer.

To get started, follow the provided guided tour.

To see the new features and improvements over previous versions of the ISE Eiffel environment, have a look at the What's new section.

An quick overview of the new graphical interface is available here.


EiffelStudio release notes

Release notes

  • ISE Eiffel 5.2
  • ISE Eiffel 5.1
  • ISE Eiffel 5.0


Release notes of EiffelStudio 5.0

What was new in EiffelStudio 5.0

Graphical environment

  • New Look and feel.
  • New way of starting EiffelStudio and simplified the process of compiling an existing project.
  • New editor with:
    • smart syntax highlighting
    • feature completion (by pressing Ctrl+Space after an identifier).
    • syntax completion of major control statement (if, from, is,...) and of symbols such as `{', `[', `(', `"',...
    • smart autoindenting
    • block indent and exdent.
    • infinite level of Undo/Redo
  • When edition a class text which has been successfully compiled, the class will be fully `pick-and-dropable'.
  • Faster rendering for Clickable, Flat, Contract (previously known as Short) and Flat Contract views.
  • System tool has been replaced by a `project settings' window. The underlying mechanism of the Ace file is kept, but all changes are done through a nice GUI making it simpler for beginners to create their first Ace file.
  • Toolbars are now customizable
  • EiffelCase has been merged within EiffelStudio to provide a true reverse engineering using the BON notation.

Compiler

The compiler has been improved in many ways and some functionality have been added. Check it out.

Debugger

  • New debugger functionalities:
    • one can step-in, step-out, step-by-step when they want to.
    • one can put a breakpoint on the fly (Windows Only)
    • one can see all local variables and arguments.
    • one can set breakpoints in all kind of assertion clauses except in invariants.
  • Debugging is faster.

Documentation

  • New documentation generation (limited now to HTML) which is completely clickable as if within EiffelStudio. It also includes an EiffelCase-like documentation generation.
  • Generation of XMI which can be used in tools such as Rational Rose.

Libraries

EiffelBase:

  • No more GENERAL class as proposed by the NICE comittee. It has been replaced by ANY which does not inherit any more from PLATFORM.
  • Adaptation of the ARRAY class to the ELKS 2000 standard.
  • This implies a change in our CONTAINER class where we renamed `empty' into `is_empty' and made `empty' obsolete. If you were inheriting from CONTAINER and redefining `empty', make sure to update your code so that you redefine `is_empty' instead. That way your polymorphic calls will still work as expected without having to change all call to `empty' into calls to `is_empty'.
  • New implementation of `is_equal' on LIST which will now check that two lists are identical if their items are identical.
  • New implementation of `copy' on LIST.
  • New implementation of an iterative `is_equal' on TREE which will now check that two trees are identical if their items are identical.
  • New implementation of an iterative `copy' on TREE, which recursively copies the tree.
  • New ROUTINE classes which perform better type checking on argument passing.
  • Introduction of binary operations on INTEGER types: `&', `|', `bit_xor', `bit_not', `bit_shift', `|>>', `|<<' and bit_text.
  • Removed `infix "^"' from NUMERIC. It does not break any inheritance, but break clients that were using this operator on an entity declared of type NUMERIC. This is due to the different return type of this operator depending the NUMERIC type you are handling.
  • Changed the signature of `pruned' in BINARY_SEARCH_TREE to take an extra argument. This was necessary to fix a problem that caused the `parent' attributes to become inconsistent under certain conditions when calling `pruned'.
  • Reimplemented the features `disjoint' and `symdif' of SUBSET. These features caused problems under certain conditions and were also quite inefficient. The new implementation of these features uses the strategy pattern to choose among different versions of these calculations depending on the properties of the elements contained in the set.
  • All features on SUBSET that take another subset as an argument (e.g. `intersect') now accept any other subset type as an argument, independent of its underlying implementation, and not only subsets of type `like Current'.
  • Many smaller bugfixes for bugs that were reported by our customers or that have been discovered during our development and testing.

WEL:

Modified classes relative to the use of registry keys to be written only using Eiffel and externals to Win32 API (no more C intermediates). In the process `close_key' and `delete_key' are now commands and not queries. To find out if it their call was successful, you can query `last_call_successful'.


Release notes of EiffelStudio 5.1

What was new in EiffelStudio 5.1

Graphical environment

  • Numerous improvements in usability and bug fixes.
  • Richer class and cluster creation dialogs.
  • Class name completion in the editor (by pressing Shift+Ctrl+Space half-way through the class name).
  • Editor now supports drag-and-drop of the selection.
  • When debugging a project from EiffelStudio, the current directory will be your project directory. It is a change from previous version where:
    • on Windows, it used to be launched in the EIFGEN\W_code of your project directory
    • on Unix, it used to be launched from the same directory where `estudio' (or `ebench') was launched.
  • EiffelStudio GUI now also available on Unix platforms and Windows 9x/Me

Compiler and .NET

  • Click here for more details on compiler improvements and full Eiffel support on .NET

Libraries

EiffelBase

  • It is now forbidden to create a BIT_REF or a BIT X object using its creation procedure (before it was accepted but did not work)
  • Added make_temporary_name in FILE_NAME
  • Made to_c obsolete from class INTEGER_INTERVAL
  • Changed semantic of split from class STRING
  • Fixed a bug in clear_all from HASH_TABLE that kept a reference to the last found item. Now it does not keep the reference after a call to clear_all.

Vision2

  • Support for Vision2 applications on GTK platforms.
  • Some changes in the Vision2 library have been made, check here on how to update your code.

Click here to check out what was new in Eiffel 5.0


Release notes of EiffelStudio 5.2

What's new in EiffelStudio 5.2

Graphical environment

  • Added a status bar, which gives a lot of information, such as the state of the compilation or the name of the current project.
  • Clicking feature clauses in the feature tree now centers the editor on the selected feature clause.
  • More specific icons in the feature and cluster trees, so that identifying deferred classes and the nature of features is now straightforward.
  • Up to 10 external commands can now be defined and called from the Tools menu.
  • The new Quick compile command lets you recompile only the classes that have been edited in EiffelStudio, skipping the sometimes tedious degree 6, that looks for modified classes.
  • Control picking now has a configurable effect.
  • More improvements in usability and bug fixes.

Compiler

  • Click here for more details on compiler improvements and full Eiffel support on .NET

Debugger

  • Right-clicking on one of the run buttons will popup a dialog enabling you to choose the command line argument (it is a shortcut for `Project Settings'->Debug tab).
  • Expressions can now be dynamically evaluated in the debugger. (info)
  • Conditional breakpoints. (info)
  • Classes can now define debug_output a feature inherited from DEBUG_OUTPUT, whose string result is automatically displayed in the debugger for all objects of that type. (info)
  • Possible stack overflows can now be detected in the debugger before they occur. (info)

Libraries

EiffelBase

  • Improved speed of search operations in ARRAYED_LIST and HASH_TABLE.
  • Reduced number of exported features in TUPLE.
  • Updated INTERNAL and TUPLE to accept INTEGER_XX based queries/commands.
  • STRING changes:
    • Fixed is_integer to return False for strings of the form "(-|+)[a-zA-Z]+[0-9]*)"
    • Improved speed of to_lower and to_upper.
    • Updated for ELKS 2001 conformance:
      • Changed signature of out and replace_substring to use STRING instead of `like Current'.
      • Added keep_tail, keep_head, remove_tail, remove_head and make head and tail obsolete.
      • Added string, same_string, has_substring, fill_with, insert_string, insert_character, as_lower, as_upper.
      • Modified make_from_string so that no sharing of internal string is done.
      • Made remake, replace_character and insert obsolete.

EiffelThread

  • Fixed crashes when using join or terminated from THREAD_CONTROL.

EiffelTime

  • Rewritten so that no additional C libraries is needed. Therefore you have to update your project configuration files to reflect this change, i.e. removing the include directory and the object file of the old EiffelTime library.

EiffelVision2

  • Click here to see list of update and modification to EiffelVision2.

WEL

  • Changed type of non-exported feature internal_data of WEL_WINDOW from INTEGER to POINTER.
  • Fixed a GDI memory leak when creating/releasing instances of descendant of WEL_CONTROL.

Click here to check out what was new in Eiffel 5.1

Click here to check out what was new in Eiffel 5.0


General interface description

  • General interface mechanisms
  • EiffelStudio window overview
  • Main toolbars
  • Key shortcuts


EiffelStudio interface mechanisms

  • Pick-and-drop
  • Pick-and-drop shortcut
  • Toolbars customization


Pick-and-drop mechanism

Pick-and-drop is one of ISE's exclusive technologies and is provided by EiffelVision2. In EiffelStudio it allows you to easily send data from a component of the interface to another.

You can pick every reference to a development object (like a class, a feature or an execution object) with a single click on the right mouse button. Then as you start moving the mouse around - not pressing any of its buttons - a pebble tracks the cursor position, and a line continuously connects the pebble to the object's original position. The pebble's shape indicates the type of the development object that you picked (oval disk for a class, cross for a feature, folder for a cluster...).

You may terminate this situation in either of two ways:

  • If the pebble you are dragging is not crossed, you can right-click again to confirm the pick-and-drop and so effectively send the dragged development object to the targeted component. For a class, a droppable pebble looks like this:

    Right-clicking when the pebble is crossed will only stop the pick-and-drop because the component you are hovering with the mouse does not accept your development object. For a class, a not droppable pebble looks like this:

  • If, for any reason, you change your mind, you can cancel the pick-and-drop by left-clicking anywhere or by pressing the Escape key.

See Also
Pick-and-drop shortcut


Pick-and-drop shortcut

In the editor and the context tool, pressing the control key while right-clicking on a development object opens a new development window which is centered on the clicked object.

Tip: The effect of control-picking is now configurable in the preferences.

See Also
Pick-and-drop mechanism


Toolbar customization

It is possible to choose which icons appear in the standard toolbar and in the project toolbar. To customize the standard toolbar, select Customize standard toolbar... in the Toolbars sub-menu of the View menu. To customize the project toolbar, select Customize project toolbar... in the same sub-menu.

In both cases, a toolbar customization window will appear. Two lists of icons are displayed in the window. The list on the right shows the icons that are in the toolbar. The list on the left gathers the icons that are currently not in the toolbar and that may be added. It also contains a separator that may be used to organize icons.

To add an icon or a separator to the toolbar, select it in the left list and click on the Add -> button. It will then be inserted in the right list after the selected item.
To remove an icon, click on it in the right list and click on <- Remove.

The order of the icons in the right list is the same as in the toolbar. If you want to move an icon in the list, select it and use Up and Down buttons. Up will move it to the top, i.e. to the left of the toolbar. Down will move it in the opposite direction.

Tip: You can also pick-and-drop icons to organize them.

Lastly, some icons can be displayed with an explanatory text. A menu at the bottom of the window will allow you to choose if the text should be displayed. The tables below present the list of these icons for both toolbars and what they look like with and without text.

Once you made the changes you wanted, validate them by clicking on OK. You can also go back to the initial toolbar layout by clicking on Cancel.

Icon without text | Icon with text

Standard toolbar icons with text.

Icon without text | Icon with text

Project toolbar icons with text.

See Also
Toolbars Reference


EiffelStudio window overview

Window layout

Unlike its predecessor EiffelBench, in EiffelStudio all windows have the same components. However, components to be displayed are chosen by the user. Moreover, windows have two modes: the edition mode and the debug mode. Basically, a standard window looks like this:

As you can see, it is divided in several parts: a top section, a left panel, a right panel and a status bar.

The top part is rather not surprising. It first contains a menu bar, which adapts itself to the context of the current project. It also contains two toolbars (the main toolbar and the project toolbar). Between the toolbars is located the main address bar.

The left panel contains various tools that help the navigation in the system.

The right panel contains two major tools: the editor and the context tool.

The status bar supplies various information:

  • Its first field gives punctual information concerning a recent operation (such as loading a project, syntax errors in a class text, etc.).
  • The second field contains the name of the current project, which can come quite handy if you work on several projects simultaneously.
  • The next field contains the current line and column in the main editor of the window (lines and columns start at position 1).
  • The last three fields contain icons representing the state of the project, according to several points of view.
    • The first icon indicates whether some class files have been edited since the last compilation. This makes it easy to know whether you have changes to take into account ( [image] or [image] ) and whether you should recompile.
    • The second icon gives the compilation state of the project. It may indicate either that the last compilation was successful [image], or that it failed [image] or that the project is being compiled [image].
    • The last icon gives the state of the debugger. It may indicate that the application is running [image], paused [image] or dead (no icon).

In debug mode, a window looks like this:

In debug mode, the same tools are present, but there are three extra tools. Two are located in the left panel, which display respectively the call stack and the dynamic value of expressions. The other is in the right panel and can be use to view the state of objects while debugging.

Layout configuration

Tool configuration

All tools have similar controls to give their display options. It is possible to minimize, restore and maximize all tools by using the proper button in their top right-hand corner. Most tools can also be closed. These tools have a close button in the corner.

  • The minimize button
  • The maximize button
  • The restore button
  • The close button

Note: No more than three tools can be displayed at the same time in the left panel. Trying to add more will automatically minimize one of the displayed tools, in order to make room for the new tool.

Tools that can be closed have a corresponding entry in the View/Explorer Bar menu. They also have a corresponding button in the main toolbar.

The only tools that cannot be closed are the editor, and when in debug mode the debug tools.

Toolbar configuration

Both main toolbars can be customized. This allows to select buttons that should be displayed in the toolbars, as well as whether an explanatory text should be displayed next to icons.

Context tool

The context tool, located in the right panel, is a major part of EiffelStudio. It itself contains several tabs that each correspond to some powerful functionality.

  • The Output tab is where general information and error messages are displayed
  • The Diagram tab uses the BON notation to analyze and design a project
  • The Class tab gives advanced information concerning a class
  • The Feature tab gives advanced information concerning a feature
  • The Metrics tab provides quantitative information concerning a system or some of its components

By default, the context tool is unlinked from the rest of the window, which means all left tools refer to the object that is in the editor and the main toolbar, while the context tool (and the debug tools if they are present) displays information concerning a different object. It is possible to link the context tool, so that the whole development window displays information relative to the same development object.

See Also
EiffelStudio Guided Tour
Browsing tools
Toolbar customization
Editor reference
Formatted information about compiled classes and features
Diagram reference
Metrics reference


Main toolbars

At the top of a development window, two toolbars are displayed by default. They are separated by the address bar, which contains class and feature fields and buttons to select the current view. The standard toolbar is above the address bar, the project bar below it:

You can hide toolbars (or the address bar) by unselecting them in the Toolbars sub-menu of the View menu or in the context menu that you can get by right-clicking in the empty space on the right of the bars. If you want them to be displayed again, just select them in the Toolbars sub-menu of the View menu.

In the standard toolbar, you will find buttons to manage tools and windows or that are related to the editor. The complete list of the icons you might see in the standard toolbar is presented in the table below.

Icon | Command
 | Display a new window.
 | Display a new window where the editor is maximized.
 | Display a new window where the context tool is maximized.
 | Display the open file dialog window.
 | Display the dialog to create a new cluster.
 | Display the dialog to create a new class.
 | Display the dialog to create a new feature.
 | Delete the class or cluster that is selected in the editor. It also accepts dropped development objects.
 | Save current file.
 | Launch the external editor.
 | Undo last action in the editor.
 | Redo last undone action in the editor.
 | Remove the selected text in the currently focused text area and put it in the clipboard (i.e. Cut).
 | Copy the selected text in the currently focused text area into the clipboard (i.e. Copy).
 | Insert the clipboard in the editor (i.e. Paste).
 | Show / Hide the cluster tool.
 | Show / Hide the feature tool.
 | Show / Hide the search tool.
 | Show / Hide the context tool.
 | Show / Hide the favorites tool.
 | Show / Hide the windows tool.
 | Center the context tool on the same component as the editor.
 | (Un)link the editor and the context tool.
 | Raise all windows
 | Minimize all windows.
 | Print current editor content.

Standard toolbar icons.

The project toolbars gathers the buttons for commands related to compilation, debugging and running. The following table present all the icons you may find in this toolbar.

Icon | Command
 | Open the Assembly manager (Windows only)
 | Display the project configuration tool.
 | Show information about the system in the context tool.
 | Compile current project.
 | Recompile the classes that have been edited in EiffelStudio since the last compilation.
 | Freeze current project.
 | Finalize current project.
 | Enable all breakpoints.
 | Disable all breakpoints.
 | Remove all breakpoints.
 | Display information about the breakpoints in the context tool.
 | Execute the application one line at a time.
 | Step into a routine.
 | Step out of a routine.
 | Run application without stopping at breakpoints.
 | Run application and stop at breakpoints.
 | Run finalized executable.
 | Pause the application at the current point.
 | Kill the debugged application.

Project toolbar icons.

Note: For both toolbars, it is possible to choose which buttons are displayed and which ones are not. See the Toolbars customization page for more information.


Key shortcuts

Many operations in EiffelStudio do not require the use of the mouse. The same effect can be achieved through the keyboard only.

This page gathers all the keyboard shortcuts available in the environment. They are sorted in several categories, depending on their domain of application.

Editor shortcuts

Key shortcut | Purpose
- clipboard shortcuts -
Ctrl+C | Copy : Copy selected text into the clipboard.
Ctrl+Ins | Equivalent to Ctrl+C.
Ctrl+X | Cut: Copy selected text into the clipboard and remove it.
Shift+Del | Equivalent to Ctrl+X.
Ctrl+V | Paste: Insert clipboard content into the text.
Shift+Ins | Equivalent to Ctrl+V.
- undo/redo shortcuts -
Ctrl+Z | Undo last action.
Ctrl+Y | Redo last undone action.
- search shortcuts -
Ctrl+F | Display the Search tool and give the focus to the "Search for..." text field. This shortcut may be customized.
Ctrl+H | Display the Search tool and give the focus to the "Replace with..." text field. This shortcut may be customized.
F3 | Search the next occurrence of currently selected text or, if there is no selection, of the last searched expression. This shortcut may be customized.
Shift+F3 | Search the previous occurrence the last searched expression. This shortcut may be customized.
- shortcuts to modify selected text -
Tab | Indent selection (only if several lines are selected).
Shift+Tab | Unindent the selected lines or the current line if there is no selection.
Ctrl+K | Comment the selected lines or the current line if there is no selection.
Ctrl+Shift+K | Uncomment the selected lines or the current line if there is no selection. A line is uncommented only if '--' is at its beginning.
Ctrl+I | Embed selection (or the current line if there is no selection) in an "if...then...end" structure.
Ctrl+D | Embed selection (or the current line if there is no selection) in an "debug...end" structure.
- other shortcuts -
Ctrl+A | Select the entire text.
Ctrl+Space | Auto-complete current word. This shortcut may be customized.

Note: These shortcuts are not available everywhere. All operations that do not imply changes in the text are available both in the editor and in the class and feature tabs of the context tool. Other operations are available only in the editor.

Compiler

Key shortcut | Purpose
F7 | Melt the system. This is the standard way to compile a debuggable system.
Shift+F7 | Melt classes that have been edited in EiffelStudio since the last compilation. This is the recommended way to compile a debuggable system as long as classes are not modified outside EiffelStudio.
Ctrl+F7 | Freeze the system. This melts the system and recompile the generated C code.
Ctrl+Shift+F7 | Finalize the system. This generates an optimized executable which is not debuggable.

Debugger

Key shortcut | Purpose
F5 | Run. This is the standard way to run a system and debug it.
Ctrl+F5 | Run without breakpoints. Same as run except that breakpoints are ignored.
Shift+F5 | Kill the debugged application
Ctrl+Shift+F5 | Pause the debugged application.
F11 | Step into.
F10 | Step by step.
Shift+F11 | Step out.

Miscellaneous

Key shortcut | Purpose
- File shortcuts -
Ctrl+S | Save the file currently edited in the editor.
Ctrl+O | Open a class file.
Ctrl+N | Open a new window.
- Editor views shortcuts -
Ctrl+Shift+T | Display the text view in the editor.
Ctrl+Shift+C | Display the clickable view in the editor.
Ctrl+Shift+F | Display the flat view in the editor.
Ctrl+Shift+O | Display the contract view in the editor.
Ctrl+Shift+I | Display the flat contract view in the editor.


Browsing tools

  • Introduction
  • Address bars
  • Cluster tool
  • Feature tool
  • Favorites tool
  • Windows tool
  • Search tool


Introduction

The browsing tools are the address bars as well as all the tools that are in the left panel of development windows in normal mode. They help find an item in the system, such as a class, a cluster, a feature, some text, ... They include the address bars, the cluster tool, the feature tool, the favorites tool, the windows tool and the search tool.

See Also:
General window overview


Address bars

  • Introduction
  • Main address bar
  • Context tool address bar
  • Switch between address sharing modes


Introduction

All development windows are composed of two major components, each of which can be centered on a given "address" (either a cluster, a class or a feature). One is the editor, with which go all the peripheral tools (including the cluster tool and the feature tool). The other is the context tool, which contains for example the class and feature tabs, the diagram tool and the metric tool.

It is possible to either link both components so that they share the same address (allowing to immediately have extended information on the class that is being edited), or to unlink them (allowing to have extended information on any class while editing a class).

When both are linked, only the main address bar appears, whereas when they are unlinked, the context tool address bar is also displayed, since it might point to a different location than the main address bar.

The toggle data mode command allows you to switch between both modes.

See Also
Change the default data sharing


Main address bar

The main address bar is located in the top part of windows, between the two main toolbars (when they are displayed).

It has several components:

  • History back and forth arrows [image] and
  • Fields where the current class or feature name is displayed
  • View icons to change the view displayed in the editor [image], [image], [image], [image] and

It is possible to type a class or feature name to center the editor on it. Typing a class name that does not exist in the set of known classes pops up a dialog to create a class of that name.

Tip: Wildcards (* and ?) are available in these fields.

Tip: The history is also accessible in the View/Go to menu.


Context tool address bar

The address bar of the context tool has a different look from the main address bar, but provides the same functionality.

It also contains history arrows, and by clicking on the cluster, class or feature name, a window is popped up that contains fields similar to the ones of the main address bar, except that a cluster can also be entered, since the diagram tool and the metrics also work with clusters:

Tip: Labels in this address bar are pickable, to send the address to other tools easily.

Note: The context tool only has an address bar if it is unlinked from the editor.

See Also
 Unlinking the context tool


Change data share mode

Located in the View menu, named either Link context tool or Unlink context tool, this command allows you to switch between the two possible addressing modes. It is also accessible through the main toolbar ( [image] ).

Note: This command only applies to the development window where it is invoked, and this setting is not automatically saved when exiting EiffelStudio.

See Also
Change the default data sharing


Cluster tool

  • Introduction
  • System tree representation
  • New cluster command
  • New class command
  • Locate command


Introduction

The cluster tool ( [image] ) is one of the tools located on the left of development windows.

It gives a tree representation of all clusters and classes of the project. The toolbar contains a new cluster command, a new class command, and the locate command.


System tree representation

The cluster tool is mainly composed of a tree representation of the system.

Here is the meaning of the symbols of the cluster tree:

  • are clusters
  • are compiled classes
  • are deferred compiled classes
  • are classes outside the system
  • Classes and clusters that are part of a library are shown with a brighter icon than normal (they cannot be modified)

Recursive clusters (i.e. clusters that have a `all' or `library' tag in the Ace) have a short name in the tree, but the full name is available as a tooltip.

Left-clicking on any item will send it to the editor. It is also possible to pick items to send them to various components of the development window.

Dropping a class in this tree representation moves it to a different cluster (either the cluster it is dropped on or the cluster containing the class it is dropped on, according to where it is dropped). This is only possible if the dropped class is not in a library cluster, if its source file is readable and writable, and if the destination cluster is not a library or precompiled cluster itself.


New cluster command

The new cluster command ( [image] ) located in the cluster tool toolbar creates a cluster in the same fashion as the main new cluster command. The only difference is that when using the cluster tool command, the new cluster is by default located in the cluster selected in the cluster tree (or the selected class's parent cluster, if a class is selected).

A dialog is then popped up in which it is possible to select the name of the new cluster and the cluster in which the new cluster should be inserted. Only clusters that are not libraries are displayed in the list.

Enabling the recursive option makes the compiler search not only the cluster directory but also all its sub-directories for classes.
The library option optimizes compilations, since the classes inside a library cluster are compiled only once. However, if you modify the classes inside a library cluster, the modifications will not be taken into account in your project. Besides, you cannot add or remove classes in a library cluster, so use this option with care: if you intend to create new classes inside this cluster later in your design, do not select the library option. You should use this option only if the new cluster is given an existing directory, which already contains classes that you will not modify.

Tip: You don't have to enter a path for the new cluster if you choose to create a sub-cluster: the new cluster directory will be a sub-directory of the directory of the parent cluster, and its name will be the name of the newly created cluster.


New class command

The new class command ( [image] ) located in the cluster tool toolbar creates a class in the same fashion as the main new class command. The only difference is that when using the cluster tool command, the new class is by default located in the cluster selected in the cluster tree (or the parent cluster of the selected class, if a class is selected).

A dialog is then popped up in which it is possible to select the name of the new class, the name of the file it should be created in (by default ".e" is appended to the name of the new class to generate the file name), and the cluster in which the new class should be inserted. Only clusters that are not libraries are displayed in the list, since library clusters cannot be modified.


Locate command

The locate command ( [image] ), located in the cluster tool, provides an easy way to find a class or a cluster in the cluster tree.

Clicking it automatically expands the clusters containing the edited class or cluster and selects it.

Dropping a class or a cluster on it expands the clusters containing the searched item and selects it.


Feature tool

  • Introduction
  • Tree representation
  • New feature command


Introduction

The feature tool ( [image] ) gives a summary of all written-in features of the currently edited class. They are listed in a tree representation, where the nodes are the feature clauses, and the leaves are the features.

In the tool mini-toolbar, a new feature command is available, which adds a new feature in the edited class.


Feature tree

The feature tree gives a summary of all the features of the currently edited class. They are in the same order as they are in the class file, and they are grouped by their feature clause.

The icon relative to the feature clause indicates the export status of the features inside it:

  • means features are exported to all classes
  • means features are exported to some classes
  • means features are not exported

The icon on the features indicates the nature of the feature:

  • for attributes
  • for once and constant features
  • for deferred features
  • for external features
  • for normal Eiffel routines

Clicking a feature or a feature clause in the tree centers the editor on it. Key navigation is also available. All features can be picked, to drop them into any component of the interface that accepts features.


New feature command

The new feature command [image] located in the feature tool acts like the main new feature command. Clicking it pops up the same dialog, making it possible to add a new feature in the currently edited class.

This command is only available when the class currently in the editor is compiled, can be modified, and has a file on the disk (this may not be the case if the class is precompiled).


Favorites tool

  • Introduction
  • Tree representation
  • Menu representation
  • Organize Favorites dialog


Introduction

The favorites tool ( [image] ) gives a quick access to often used classes. These may be either classes of a library or classes that are often being modified. They are project-wide, which means they are shared by all development windows working on the same project.

The favorites tool mainly consists in a left-panel tool, giving a tree representation of the favorite classes, and in the favorites menu.


Favorites tree

The favorites tree gives a graphical representation of the favorite classes of the system, as opposed to the favorites menu.

In this tree, the folders are user-definable through the Organize Favorites dialog. They have no other goal than ordering the favorites. In particular, they are entirely independent from the clusters of the system.

Clicking a class in the favorites tree edits it. Keyboard navigation is also available. Favorite classes are pickable too, so that it is possible to send them to all interface components that accept classes.


Favorites menu

The favorites menu is composed of two parts.

First, there are three commands:

  • The Add to Favorites command, that adds the currently edited class to the root of the favorites tree.
  • The Show/Hide Favorites command, that shows or hides the favorites tree.
  • The Organize Favorites command, that displays the Organize Favorites dialog.

After the separator, the favorites are displayed in a menu representation. Clicking on any of these menu items will send the selected favorite class to the editor.


Organize Favorites dialog

  • Introduction
  • New Favorite Class command
  • Create Folder command
  • Move to Folder command
  • Remove command


Introduction

The organize favorites dialog provides a way of sorting the favorites.

The left part of this dialog is composed of a tree representation of the favorites identical to the one in the favorites tool.

With it, it is possible to add classes and folders to the favorites or remove some, and also to spread the favorite classes among the favorite folders.

Caution: Since the favorites are project-wide, any modifications made in this dialog are reported in all development windows.


New favorite class command

Located in the Organize Favorites dialog, this command [image] provides a way of adding a class to the favorites. When clicked, a new dialog is popped up, that allows to select a class among the clusters of the system:

Clicking on a class name sets its name in the top text field, whereas double-clicking it automatically selects it and closes the dialog box. It is also possible to directly type the name of the wanted class in the top text field to select it.

The selected class goes to the root of the favorite tree. It is then possible to move it to a different favorite folder.

See Also
Favorite tool
Favorite menu


Create favorite folder command

This command [image] is accessible in the Organize favorites dialog. When clicked, a dialog is popped up that prompts for a name for the new folder:

After typing the name of the new folder, pressing OK adds it to the root of the favorites.


Move to Folder command

The Move to Folder command [image], located in the Organize Favorites dialog, makes it possible to move favorite items (classes and folders) to specific folders. It is enabled only when an item is selected in the left-hand tree in this dialog. The selected item is the item that should be moved, the source. You can select a different source item by clicking it in the tree, or by using the keyboard.

When pressed, a dialog is popped up, that prompts for the favorite folder the selected item should be moved to.

Select the destination folder by expanding the tree and by clicking it. The top tree item, named Favorites, represents the root of the favorites.

Pressing OK moves the source item to the destination folder. Pressing Cancel discards the dialog box and does not move the source item.

Tip: You can also move items around by picking them in the favorites tree and dropping them where you want.

See Also
Favorites tree


Remove favorite command

The Remove favorite command [image] discards a favorite item from the favorites. It is enabled whenever an item is selected in the left-hand tree of the Organize favorites dialog.

Pressing it removes the selected item from the favorites.


Windows tool

  • Introduction
  • Window list
  • Window menu
  • Window related commands


Introduction

The windows tool ( [image] ) gives a list of opened development windows.

Its main component is the Window list.

It is also linked to the Window menu.


Window list

The window list is the main part of the window tool.

It displays all opened development windows. Left-clicking a development window in the list raises it so that it becomes the top-level window. Right-clicking one pops up a context menu:

The four first commands, Close, Minimize, Maximize and Raise, are relative to the clicked development window. The last command, New window, creates a new development window.


Window menu

The window menu is divided into two parts. The first one is composed of the window-related commands. The second one is the list of all opened development windows. Clicking any of these raises the selected development window, so that it becomes the top-level window.


Window related commands

A few commands give the possibility to manage the development windows globally. They are located both in the Window menu and in the main toolbar.

  • New window: this command ( [image] ) creates a new empty development window. Note that it is also possible to drop a class or a feature on it to create a development window that is immediately centered on the dropped item.
  • Minimize all: this command ( [image] ) iconifies all development windows.
  • Raise all: this command ( [image] ) raises all minimized development windows.
  • Raise unsaved windows: this command raises all the development windows that have not been saved. It may be combined with the Minimize all command to find easily which development windows need to be saved.


Search tool

Description and usage

EiffelStudio includes a search tool which allows you to look for a word or a pattern in the editor, the class tool, the feature tool or the output tool, and to replace it by another word if you want. It is located in the left part of the development window, like the cluster tool or the favorites for instance.

To make it appear, if it is not displayed, click on the search icon [image] or choose the Search entry in the Edit menu. The search panel is divided in three parts (see Fig. 1).

Fig. 1: Search panel

In the top part, you will find a combo box and a check box. The title of this text field is "Search for": it will be used to enter the pattern you want to look for. The button is labeled "Replace with". If you click on it, another text field will appear. If you click again, the second text field will be hidden. This text field will be used to enter the word which you want the editor to use to replace found patterns.
In the middle part of the search panel, you will find search options. They are described below.
The bottom part contains two buttons: "Search" and "Replace". Click on the first one to launch the search for the pattern entered in the "Search for" field. The "Replace" button will be active only if the "Replace with" field is displayed. Press this button if you want to replace the last found pattern by the contents of the "Replace with" text field.

Options

The options are located in the middle of the search panel. There are five buttons, each of them corresponding to an option:

  • Match case: If this option is selected, the search will be case-sensitive, which means that if you search for "example", the tool will highlight "example" but not "EXAMPLE" or "Example", as there are no capital letters in the searched pattern.

  • Whole word: If this option is selected, the tool will look for isolated words. A word is isolated if it is surrounded by spaces or if it is at the beginning or the end of a line.

  • Use wildcards: If this option is not selected, the tool will look for the exact sequence of letters you entered in the "Search for" field. If it is selected, you will be able to use '*' and '?' wildcards. '?' in the searched pattern is equivalent to any character. For instance, "sample" and "simple" will be highlighted if you look for "s?mple".
    '*' is equivalent to any sequence of characters, including no characters at all. It means that if you search for "exam*ple", every piece of text beginning with "exam" and finishing with "ple" will be highlighted. Use it in combination with "Whole word" to search for words beginning with "exam" and finishing with "ple".

  • Replace all: If it is selected when you press the "Replace" button, every occurrence of the searched pattern will be replaced with the content of the "Replace with" field. It is possible to activate this option only if the "Replace with" field is displayed.

  • Search backwards: If this option is selected, the tool will highlight the previous occurrence of the searched pattern instead of the next occurrence when you press the "Search" button.

Note: If the search tool hits one end of the text, it will automatically continue from the other end.

See Also
There are keyboard shortcuts and menu entries to launch searches without using the search tool directly. They are described the editor section of this help.


EiffelStudio Editor

  • Introduction
  • Cursor moves
  • Selection
  • Clipboard functionality
  • History functionality
  • Search functionality
  • Automatic completion
  • Operations on text blocks
  • Commands in the Edit menu
  • Customization


EiffelStudio Editor Introduction

EiffelStudio includes an editor which allows you to read and modify the text of Eiffel classes.

It offers usual clipboard, history and search facilities. More advanced, class text specific functionality is also available. Its description can be found in "Auto-complete" and "Operations on text blocks" sections.


Cursor moves

There are two ways to position the cursor in EiffelStudio editor : you can use either the mouse or the keyboard.

If you choose to use the mouse, just click in the text where you want the cursor to be moved. If the text is not entirely visible, you can use the scroll bar at the bottom and on the left of the edition zone to display the part you are interested in.

The keys that you may use to move the cursor in EiffelStudio editor are "Home", "End", "Page up", "Page Down" and the four arrows. Pressing "Home" will make the cursor go to the beginning of the line. Pressing "End" will move the cursor to the end of the line. You can use "Page Up" to move the cursor one page closer to the beginning of the text. Pressing "Page down" will position the cursor one page further.
Left and Right arrows can be used to move respectively to the character on the left or on the right of current position. Up and Down arrows allow you to move the cursor to the previous and next lines.

Tip: By maintaining "Ctrl" pressed as you use Left and Right arrows, you will move the cursor to the next or previous word instead of the next or previous character.


Selection

In EiffelStudio editor, you can select text by using either the mouse or the keyboard.

To select a text zone with the keyboard, move the cursor to one end of the zone. Then press "Shift" and maintain the key pressed until you moved the cursor to the other end of the zone. The selected zone will appear in reverse video. If you want to select the entire text, press "Ctrl" and "A".

Tip: You can combine "Ctrl" and "Shift" when using Left and Right arrows to select text word by word

If you choose to use the mouse, first position the cursor to one end of the text zone you want to select, and click there without releasing the mouse button. Then move the mouse pointer to the other end of the zone and release the button. The selected text is shown in reverse video. If the other end of the zone is not visible, move the mouse pointer out of the edition area as you select text in the direction where the end is. EiffelStudio Editor will start scrolling automatically and will stop as soon as the mouse pointer enters the edition area again.

There are other ways of using the mouse to select text in EiffelStudio editor:

  • You can select a word by double-clicking on it. If you do not release the mouse button after the second click, then you will be able to select a text zone but the bound of the zone will move one word at a time.
  • If you triple click in the edition area, then the pointed line will be selected. If you do not release the mouse button after the third click, you will be able to select text line by line.
  • A quadruple click will select the entire text (this is an option that you can modify in the preferences dialog).


Clipboard functionality

EiffelStudio editor provides common clipboard functionality, i.e. Cut, Copy and Paste commands.

  • To copy text to the clipboard, select it in the editor first. Then, you may either press the key combination "Ctrl+C" (or "Shift+Ins"), click on the copy icon [image] or choose Copy in the Edit menu.

  • To cut text, i.e. copy it to the clipboard and delete it, select it and then either press "Ctrl+X" (or "Shift+Del"), click on the cut icon [image] or choose Cut in the Edit menu.

  • To paste text from the clipboard, either press "Ctrl+V" (or "Ctrl+Ins"), click on the paste icon [image] or choose Paste in the Edit menu.


History functionality

EiffelStudio editor provides an history functionality, i.e. Undo and Redo commands.

  • To undo last change, press the key combination "Ctrl+Z", click on the undo icon [image] or choose Undo in the Edit menu. If you repeat this operation, the editor will undo the last change and so on until there are no more changes to undo.

  • To redo last undone change, press the key combination "Ctrl+Y", click on the redo icon [image] or choose Redo in the Edit menu. If you repeat this operation, the editor will redo the last undone change and so on until there are no undone changes left.


Search functionality

EiffelStudio editor provides a search functionality. To search an expression in the edited text, you can either use the Search tool or use a set of keyboard accelerators available directly from the editor. From the editor, you can:

  • Search the next occurrence of the last searched pattern.
    To do so, press "F3". You can change this key binding in the preferences. If you press "F3" as some text is selected, the editor will highlight the next occurrence of this text, if any. You can change this behavior in the preferences.

  • Search the previous occurrence of the last searched pattern.
    To do so, press "Shift+F3". You can change this key binding in the preferences too.

See Also
Search tool


Automatic completion

  • Introduction
  • Syntax auto-complete
  • Feature call auto-complete


Introduction

EiffelStudio editor includes new features which were designed to help write Eiffel code. Automatic completion is one of those. This feature is available in two contexts:

  • when the user types some expression defined in the Eiffel language.
  • when the user enters a feature call.

As, regarding automatic completion, expectations vary from one individual to another, this feature is highly customizable and can be disabled.


Syntax autocomplete

Syntax auto-complete in EiffelStudio editor is twofold :

  • The editor can close brackets ("(", "{" and "{") and quotes (""", "'" and "`") automatically. This feature is disabled by default. It can be activated in the editor preferences.

  • The editor can complete syntactic structures or part of them. The auto-complete is triggered when "Enter" or "Space" keys are pressed after a reserved word included in the following list:
    class | ensure | invariant | require else
    check | ensure then | is | rescue
    create | export | local | select
    creation | external | loop | then
    debug | feature | obsolete | undefine
    deferred | from | once | until
    do | if | precursor | variant
    else | indexing | redefine | when
    elseif | inherit | rename
    end | inspect | require

    The way these key words are completed is fully customizable.

See Also
To see how the editor completes by default and how it can be changed, please read the following pages:
Syntax auto-complete preferences


Feature call autocomplete

EiffelStudio editor now offers the possibility to complete feature calls automatically. This means that when the user types "an_identifier.an_incomplete_feature_name" and then triggers the auto-complete, the editor will propose a list of possible feature names correct in this situation.
To be more precise, a window will pop up and display the list of features that can be called on an_identifier and that match an_incomplete_feature_name. The user can accept the suggested name, choose another name (in the list or not), or simply cancel the auto-complete.

To trigger the autocomplete, press the key combination "Ctrl+Space" or click on Complete word in the Advanced sub-menu of the Edit menu. If automatic completion is possible, there are two cases : if only one name matches, this name will be inserted in the editor. If there are no matching names or several ones a window will appear. This window will contain a text field and a list. The text field will be filled with the beginning of the feature name that was entered. The first item in the list, if any, will be selected.
To complete your code with the selected item, press "Enter" or "Ctrl+Space".
To choose another item, use keyboard Up and Down arrows or the mouse. You can also modify the content of the text field. The list will be updated automatically. To validate your choice, press "Enter" or "Ctrl+Space". If there is no selected item, the content of the text field will be inserted.
To cancel the auto-complete, press "Esc" at any time.

Tips:

  • If the selected feature is a query, you can call the auto-complete again right after the previous completion. There is no need to type a dot.
  • You can call the auto-complete without an identifier. The auto-complete window will then show the features of the current class.
  • The keyboard shortcut for automatic completion can be changed in the editor preferences.
  • Typing a non-alphanumeric character in the completion window automatically closes it. You can therefore type '.', ' ' or '(' to close the completion window and start typing the next token straight away.

Notes:

  • Only identifiers that were already defined when the class was compiled for the last time can be completed, except for local entity names that can always be completed.
  • Only compiled features will appear in the auto-complete window.
  • By default, features from class ANY will be ignored by the auto-complete window. This can be changed in the editor preferences.


Operations on text blocks

  • Introduction
  • Comment and uncomment lines
  • Indent and unindent selection
  • Embed lines in "if then...end" or in "debug...end"


Introduction

Editing the text of classes sometimes implies highly repetitive tasks, such as commenting or indenting several lines at the same time.

The new commands of the editor of EiffelStudio should allow the user to perform these tasks faster and more easily. In addition to text block commenting and indenting , EiffelStudio editor makes it possible with one click to embed several lines of code in "if ... then ... end" or "debug ... end" structures.


Comment and uncomment lines

EiffelStudio editor offers the possibility to comment or uncomment several lines at a time.

  • The "Comment" command corresponds to the Comment entry in the Advanced submenu of the Edit Menu. It may be called by using the keyboard shortcut "Ctrl+K" too. Its action is to insert two dashes in front of each selected line.

  • The "Uncomment" command corresponds to the Uncomment entry in the Advanced submenu of the Edit Menu. It may be called by using the keyboard shortcut "Ctrl+Shift+K" too. Its action is to remove the two dashes in front of each selected line if there are such characters.

Note: If there is no selection, these commands will be applied to the current line.


Indent and unindent selection

EiffelStudio editor offers the possibility to indent or unindent selected lines.

  • The "Indent" command corresponds to the Indent selection entry in the Advanced submenu of the Edit Menu. It may be called by using the keyboard shortcut "Tab" too. Its action is to insert a tabulation in front of each selected line.

  • The "Unindent" command corresponds to the Unindent selection entry in the Advanced submenu of the Edit Menu. It may be called by using the keyboard shortcut "Shift+Tab" too. Its action is to remove the tabulation in front of each selected line if there is such a character.

Note: If there is no selection, you may still use the unindent shortcut "Shift+Tab". The command will be applied to the current line.


Embed lines in "if then...end" or in "debug...end"

EiffelStudio editor offers the possibility to embed several lines in "if then...end" or in "debug...end" structures.

  • The first command corresponds to the Embed in if entry in the Advanced submenu of the Edit Menu. It may be called by using the keyboard shortcut "Ctrl+I" too. Its action is to insert a line with "if then" before the selected lines and a line with "end" after those lines. The lines will be indented and the cursor positioned between "if" and "then".

  • The second command corresponds to the Embed in debug entry in the Advanced submenu of the Edit Menu. It may be called by using the keyboard shortcut "Ctrl+D" too. Its action is to insert a line with "debug" before the selected lines and a line with "end" after those lines. The lines will be indented and the cursor positioned after "debug" and "then".

Note: If there is no selection, these commands will be applied to the current line.


Edit menu commands

In the Edit menu, the following commands are available:

  • Undo: undo last change.
  • Redo: redo last undone change.
  • Cut: Cut selected text.
  • Copy: Copy selected text.
  • Paste: Paste text from the clipboard.
  • Select All: Select the entire text.
  • Find: Show and go to the search panel.
  • Replace: Show and go to the search panel with replace option activated.
  • Search:
    • Find next: Find the next occurrence of the last searched expression.
    • Find previous: Find the previous occurrence of the last searched expression.
    • Find selection: Find the next occurrence of the selected text.
  • Advanced
    • Indent selection
    • Unindent selection
    • Comment
    • Uncomment
    • Embed in if...
    • Embed in debug...
    • Complete word
  • Preferences


Editor customization

Many of the editor features, the automatic completion in particular, can be customized in the preferences.
Please refer to the editor section of the preferences help for more details.


Project settings window

This is where global settings regarding your project are going to be made. In here you can specify:

  • the clusters that contain your classes
  • which assertion level you want to check
  • which debug clauses will be activated
  • the command line arguments and the current working directory when you debug your application
  • which C externals your project needs
  • the compiler options concerning optimization
  • advanced options such as multithreading

The window is organized in six tabs:

  1. General
  2. Debug/Profile
  3. Clusters
  4. .NET
  5. .NET assemblies
  6. Externals
  7. Advanced

The .NET tabs is only enabled on the Windows platform.

Most of the changes that can be made here are taken into account when you next recompile your project. Instead of automatically performing the compilation each time you click Ok or Apply we decided to save the modifications and let the user decide when to recompile. At the moment, only the specification of the command line arguments and of the current working directory for debugging do not require a recompilation of your system.


General Tab

This is where you can configure the most general aspects of your system. For example you can set the name of your application, the default level of assertion checking, the type of code generated by the Eiffel compiler (normal C code generation/compilation, or .NET code generation) and if you are using a precompiled library or not.

Here is what you will see when opening for the first time in a session the project settings window when using the ace file of the calculator example located at $ISE_EIFFEL|examples|base|calculator:

As you can see, you can specify the application name which will also be the executable name. With the root class along with the creation procedure name entries you can select which feature is going to be the root of your execution, in this case the make feature of class CALCULATOR is selected.

You can also choose the default level of assertions. This applies to all Eiffel classes located in clusters specified in clusters tab. To override this default on a cluster by cluster basis, you need to go to the clusters tab. Contrary to ISE Eiffel 4.5, levels are independent, meaning that one can check the invariants without checking the preconditions.

Once your project is compiled, here is what your general tab looks like:

You will notice that some options cannot be changed any longer. They are disabled on purpose. If you want to change these options again you will need to recompile your project from scratch. To do this, close all EiffelStudio sessions relative to the project (including the EiffelStudio session you are working in), open a new EiffelStudio and select Open existing Ace in the start-up dialog. Select the Ace file of the current project and follow the steps.


Debug/Profile Tab

Here is what the debug tab looks like when you have not yet compiled the system you just created. It comprises two tabs, the first and default tab for debugging options and the second for program execution options.

Debug options

By default all debug clauses are turned off.

The first step to enable them is to select the `Enable debug' check box. Then right-click on the debug clauses you want to enable/disable and a contextual menu will appear to let you do so.

Tip: You can select several debug clauses at a time by using the Ctrl and Shift keys.

Before you compile for the first time your project with an Ace file that has been automatically created, you won't see any debug clauses. They will be automatically added by the compiler at the end of your first compilation. When this is done, you can enable/disable each one of them.

Program Execution

You can specify the location from where your program will run. By default the location is `your_project_path/EIFGEN/W_code'. Use this option when your application relies on the use of resource files located at a different location.

You can also specify one or more command line arguments. The first step is to enable them by selecting the 'Enable arguments' check box. If this box is not checked the system will run without any arguments. Selecting it will enable the arguments notebook which provides two type of arguments, 'Program Arguments' and 'My Arguments'. Program Arguments are those that reside in the project Ace file and are therefore system-wide. My Arguments are user specific and are stored in a separate file from the Ace. Below is the debug tab with the arguments tab selected.

To add a new argument select the desired tab, type the arguments into the Current Argument text box and then click 'Add'. To select an argument simply click the argument as it appears in the list or select it from the drop-down combo box. Once selected the argument can be set by clicking 'Apply' or 'OK', or it can be removed by clicking 'Remove'. To edit an existing argument double-click the corresponding argument in the list box. This will display an editable text field whereby the argument can be edited. The same execution options are also accessible from any of the program debugging and launching toolbar buttons in the main EiffelStudio development window. To display them right-click on any of these buttons, or for more information click here.

Miscellaneous options

  • line number generation when selected will generate in either .NET generation or C generation some extra information that will enable a .NET debugger or a C debugger to step through the Eiffel code rather than MSIL code or C code.
  • call tracing when selected will, in C generation mode only, display on the console all the features that are called during the system execution.
  • profiling when selected will, in C generation mode, turn on the Eiffel profiler during the application execution. The results can be seen at the end of the execution in the profiler window.

Note: The profiler is only available in the Enterprise edition of EiffelStudio.


Clusters Tab

This is where you specify the directories where to look for classes when compiling your system. A cluster has a name and a path associated with it. Each cluster name in the system must be unique and only one cluster can reference a path, i.e. two clusters with different names cannot refer to the same path.

Here is how the clusters tab looks like for the calculator example:

In this tab, you will have on the left hand side of the window a tree representation of the clusters list. The tree representation lets you see the cluster hierarchy of the system. On the right hand side you can specify the cluster properties.

Cluster properties

The name of the cluster is what you will see displayed in the Cluster Tree. The path name will be used by the compiler to find the classes it needs to complete the compilation of your system. The 'Namespace' field is applicable to .NET compiled systems and indicates the namespace of the currently selected cluster.

You can also specify if the cluster is an "override" one. There can be only one override cluster. Each time you select one to be the override cluster, the previous override cluster if any will lose this property.

To make it easy to find classes you can specify either the `library' or `all' option. They will both have the same effect when looking for classes, i.e. the compiler will look at all Eiffel classes located in the specified directory and its subdirectories. The difference between these two options is that when you select `library', the classes will not be editable from the EiffelStudio environment.

The idea is that you should use `library' when reusing a library made by someone else over which you have no control. For example, EiffelBase is a such a library. You should use `all' for the libraries you are working on.

Cluster options

This is where you can override some options that have been set for your system in either the General tab or the Debug Tab.

You can choose to specify for the currently selected cluster:

  • a different assertion level
  • to enable or disable the trace
  • to enable or disable the profiler

If you choose to override all options, here is how it will look like:

Visible Classes

When you need to compile a project that will be used for a CECIL or an EiffelCOM application you need to mark some classes as visible. You can do it using the visible classes tab:

To add a class, simply enter its name and click on Add. This will only work for classes that are in the selected cluster. If you put an invalid class name an error will be raised during the compilation of your system.

If you made an error simply select the class from the list, modify it in the `Entry' field and then click on Apply. The correct name will now appear in the list.

To remove a class from the list, simply select it and click on Remove.

Exclude/Include

The exclude part is there to exclude certain directories or file names during the class lookup performed by the compiler. This option is especially useful in cunjunction with the 'all' or 'library' options on clusters. For example, if you are using CVS as a source control, you will notice that a CVS directory is created in each one of your directories. So adding CVS in the exclude list will speed up the compiler since it won't have to look inside the CVS directories.

The include part is useful when you have some Eiffel classes that do not follow the standard Eiffel file name pattern, i.e. "class_name.e". To make sure the compiler finds those classes, you have to include the file name of every Eiffel class that does not follow the standard naming pattern for Eiffel file names.


.NET Tab

This tab is only available when you have the .NET generation enabled. Here is what you will see if you have .NET generation enabled.

.NET application information

In this part you will be able to enter the information regarding the assembly such as:

  • Namespace name
  • Version
  • Compatibility
  • Culture
  • Company
  • Product
  • Trademark
  • Copyright

You can also specify a cryptographic key for your application so that the compiled assembly can be added to the Global Assembly Cache (GAC). Alternatively, if you wish to create a new cryptographic key for your assembly then the 'Generate' key will automatically generate one.

Options

  • verifiable: in the .NET world, verifiability is important. This is the only way to ensure that an application is not going to crash or to crash your system by accessing not authorized memory locations. Due to some semantic differences between Eiffel and .NET, our code generation is not always verifiable for performance reasons. If you want your code to be verifiable, you need to select this option. The compiler will then generate a code that will be slightly slower.
  • generate DLL: instead of generating an EXE it will generate a DLL.

Class and feature naming

The standard naming conventions for .NET and Eiffel are different. To accommodate this difference Eiffel Studio provides a number of options to the developer, allowing for consistent naming of classes and features within and between .NET systems. To illustrate this we shall consider a system using the EiffelBase library and focus on the CURSOR class. The base cluster is included in the project settings Cluster tab as shown below, where $ISE_EIFFEL is the environment variable pointing to the location of Eiffel on your hard disk.

The CURSOR class is located at '$ISE_EIFFEL\library\base\structures\cursors'.

  • Follow .NET naming guidelines: this option determines whether the generated .NET code uses the Eiffel or .NET naming convention. Using Ildasm, the IL disassemble tool provided with the .NET Framework, we can see the difference between them. The Eiffel naming convention uses uppercase characters for all classes whereas the .NET nomenclature uses the Camel Case style. Note that this option is only available in a non-compiled system. Once the system has been compiled the naming standard is thus fixed for the project.

  • Use cluster names and Use full cluster names: These options dictate how a class is known to the system. In our CURSOR example there are 4 main scenarios. For a quick overview of all scenarios refer to the table at the bottom of the page. If neither box is selected we just have 'CURSOR' or 'Cursor' (depending on whether the .NET naming guidelines are used), as seen above. If 'Use cluster names' is checked then the cluster name is pre-pended to the class name, so 'CURSOR' now becomes 'base.CURSOR'.

If 'Use full cluster names' is selected then the full cluster name is pre-pended to the class name, so it thus becomes 'base.structures.cursors.CURSOR'.

The final scenario is where a namespace has been defined for the cluster in the Clusters tab of the Project Settings. In this situation the namespace overrides the name of the cluster. In the example below the namespace name 'MyBaseNameSpace' is used so the resulting name is 'MyBaseNameSpace.structures.cursors.CURSOR'.

Naming Scenarios

This table shows how the class name generation is affected by the naming options using the CURSOR class found in '$ISE_EIFFEL\library\base\structures\cursors' as an example.

Use .NET naming guidelines | Use cluster names | Use full cluster names | Namespace Name | Generated Name
no | no | no | (empty) | CURSOR
yes | no | no | (empty) | Cursor
no | yes | no | (empty) | base.CURSOR
yes | yes | no | (empty) | Base.Cursor
no | no | yes | (empty) | structures.cursors.CURSOR
yes | no | yes | (empty) | Structures.Cursors.Cursor
no | yes | yes | (empty) | base.structures.cursors.CURSOR
yes | yes | yes | (empty) | Base.Structures.Cursors.CURSOR
no | no | no | MyNameSpace | MyNameSpace.Cursor
yes | no | no | MyNameSpace | MyNameSpace.CURSOR
no | yes | no | MyNameSpace | MyNameSpace.Cursor
yes | yes | no | MyNameSpace | MyNameSpace.CURSOR
no | no | yes | MyNameSpace | MyNameSpace.structures.cursors.Cursor
yes | no | yes | MyNameSpace | MyNameSpace.structures.cursors.CURSOR
no | yes | yes | MyNameSpace | MyNameSpace.structures.cursors.CURSOR
yes | yes | yes | MyNameSpace | MyNameSpace.Structures.Cursors.Cursor


.NET Assembly Tab

This tab is only available when you have the .NET generation enabled. Here is what you will see if you have .NET generation enabled.

GAC Assembly References

In this list you can view all the assemblies which are part of your system and are also in the Global Assembly Cache (GAC). Name, version, culture and public key information about the assemblies are provided, as well as the Eiffel specific information detailing the cluster name and/or class prefix text associated with the assembly.

Local Assembly References

In this list you can view all the local assemblies which are part of your system. Cluster name, class prefix text, and the assembly full path is provided.

Adding GAC References

To reference a GAC assembly in your .NET application click the 'Add' button underneath the GAC Assembly Reference list. This will present you with a dialog containing a full list of GAC assemblies on your system. To add an assembly just double-click on it, or click on the 'Add' button. When you are done, click 'Close'.

Editing Assemblies

To edit the name of the Eiffel cluster or prefix text associated with a particular assembly simply double-click on the existing text (or where the text would be if it is empty). A text box will appear allowing you to edit the assembly name. Here is an example of editing a cluster name for an assembly.


Externals Tab

This tab is only active when standard C generation is selected in the General Tab. Even when it is selected, you will find that most Eiffel projects do not include C external libraries and therefore the tab is not filled. In the case of the calculator example, here is what you will get:

This tab needs to be filled when compiling projects that use some C libraries. In the case of the ISE Eiffel libraries, here is a non-exhaustive list that needs some entries in this tab:

  • Eiffel2Java
  • EiffelNet
  • EiffelStore
  • EiffelVision2
  • WEL
  • MEL

Include path

This is where you can enter the location of the directories where the C compiler will look for the header files that are required. The header files which the C compiler will look for are the ones that appear in an encapsulation of a C external in an Eiffel class. Click here to have more information about C/C++ externals specification.

Object file

When you use an external C/C++ library what you have is header files and library files. We have seen how to include the header files, in this part you can select the inclusion of the library files.

An example

Here is what you will need to have if you are creating a project that is using WEL:


Advanced Tab

Here you can select the most advanced options of your project. Here is how it looks like for the calculator example:

Global setting

As you might have notice, the project settings is a simple facade to the Ace file. Every modification that is done in this window is saved in the Ace file of your project. Since it is just a facade, it does not provide all the available options in the Ace file, but just the most common.

If you want to edit the current settings, simply click on the Edit button. It will edit your Ace file in the external editor you have selected in the preferences. The project settings window will automatically vanish, to make sure there will not conflicts between its contents and the modified Ace file.

If you decide to change your Ace file, simply click on the `Load from...' button, a standard open file selection dialog will popup and you can choose a new Ace file. If the Ace file is invalid, a warning dialog will appear and the Ace file change will not be taken into account. If the Ace file is valid, the project settings tab will be updated with the new values extracted from the Ace file.

If you want to redo your Ace file, you can click on the Reset button. This will clear all settings to their default values and delete the list of included clusters. No warning is displayed so make sure you know all the consequences of doing so.

Standard options

For a project using the standard C compilation generation, here is what you can select:

  • console application: has no effect on Unix systems. It lets Windows users choose between creating a console application or a GUI application (in which case a console will be created if needed, instead of using the console the program was launched from).
  • Enforce VAPE validity constraint: lets you disable type checking for VAPE errors in preconditions, which correspond to insufficiently exported features used in preconditions (ETL 2nd edition page 122).
  • Dynamic runtime: makes the generated executable use a shared library version of the runtime on both Windows (DLL) and Unix platforms (.so) that supports shared libraries.

Note: On Windows, the dynamic run-time is available only if you compile with the Microsoft Visual compiler.

  • Multithreaded runtime: generates a multithreaded application. This option cannot be changed during the development of your project and has to be set correctly at the first compilation of your system.
  • Address expression: lets you pass `$(s.to_c)' to a feature instead of declaring `a' of type ANY, and then assigning `s.to_c' to `a' and passing `$a'. Turn this option on only if you have advanced knowledge of the garbage collector insides, since using this syntax illegally can lead to bugs very hard to trace.
  • Shared library definition: lets you specify a `file_name.def' as the file where the Eiffel compiler will look when it tries to generate the exported functions of the shared library you are developing. To have more information concerning definition files, see the Dynamic library builder reference.

For a dotnet system, only the first two are available, and thus you get:

Finalization options

This is only active for project using the standard C compilation generation. Here is what you can select:

  • array optimization: enables array optimization which increases performance of array computation in loops. It is enabled only if arrays are used as local variables or arguments of an Eiffel feature.
  • dead code removal: avoids generating the C code for Eiffel routines that are not called in your code, and thus reduces the size of the generated application.
  • exception trace: makes it possible to see a complete exception trace when your finalized application is crashing. Because it is adding some code to remember where the application was during the crash it can slow down the performance of your application by a factor of 5% to 30% depending of your platform.
  • inlining: enables inlining on Eiffel features that can be inlined, i.e. whose size is less or equal to the specified size in the combo box. The size value given in parameter corresponds to the number of instructions as the Eiffel compiler sees them (for example a := b.f corresponds to 2 instructions for the Eiffel compiler). The ISE Eiffel inlining is very powerful since it can inline a function in all your Eiffel code, without scope limitation as in C or C++ compilers.


Compiler

  • Introduction
  • Melting Ice Technology
  • Supported C compilers
  • Lace syntax
  • Differences between ETL 2nd printing and ISE implementation
  • External features
  • Dynamic library generation
  • Command line compiler


Compiler

EiffelStudio naturally includes a powerful Eiffel compiler, which is at the core of the IDE. It supports the entire Eiffel language as defined in the third edition of Eiffel: The Language.

This compiler uses the melting ice technology (TM), which accounts for lightning-fast incremental recompilations, ideal during the development cycle. It also provides finalization, which yields a high level of optimization that should be used for released programs.

This reference describes some advanced functionality of the ISE compiler, such as making external calls from Eiffel.

You can find more advanced technologies relative to the ISE Eiffel compiler and environment in the technologies part of the documentation.

See also:
General overview of the Eiffel language


Command line

  • Introduction
  • Command line options
  • Batch compilation
  • Command line interactive mode


Introduction

It is possible to compile from outside of the graphical environment, by using the command ec. The form of compilation's results are the same in both cases. You may therefore alternate between the two techniques. ec will enable you to melt or freeze a project and therefore to use batch compilation. It will also enable you to produce such information about a class as its Flat and Flat Contract views.
The -loop option makes it possible to start ec just once and then repeatedly request any of the available operations.


Command line options

You may start ec through a command of the following form:

ec option ... [class_name] [feature_name]

class_name, if present, must be the name of a class of the system to which ec is applied. This system is identified by its Ace file; by default this is the file called Ace.ace in the working directory, but you can select any other one through the -ace file_name option. Similarly, the default project directory is the working directory, but you can select another through the project -directory_name option. feature_name, if present, must be the final name of a feature of the class called class_name.
The table below lists the available options, the arguments they require, and their effect.

OPTION | ARGUMENTS | EFFECT
- operation options -
-freeze | none | Freeze system.
-finalize | none | Produce a finalized system. See below.
-precompile | none | Precompile a system, treating it as a library.
- browsing operations -
-ancestors | class_name | Print the ancestors of the class.
-aversions | class_name, feature_name | Print the ancestor versions of the feature.
-callers | class_name, feature_name | Print all the routines that call the feature.
-clients | class_name | Print the clients of the class
-descendants | class_name | Print the descendants of the class.
-dversions | class_name, feature_name | Print all the versions of the feature in the descendant versions of the class.
-flat | class_name | Print the flat view of the class.
-flatshort | class_name | Print the Flat Contract view (previously called flat-short form) of the class.
-implementers | class_name, feature_name | Print all the classes that declare or redeclare the feature.
-short | class_name | Print the Contract view (previously called short form) of the class.
-suppliers | class_name, feature_name | Print all the suppliers of the class.
- others options -
-ace | file_name | Use the file as Ace.
-batch | none | Launch the compilation without user request.
-file | file_name | Save the output to the file.
-filter | filter_file_name | Print text as processed by the filter.
-help | none | Print the help.
-keep | none | Keep assertions in final mode. Useful with -finalize only
-loop | none | Enter interactive mode. See below.
-project | file_name | Use the file as project file.
-project_path | directory_name | Use this directory as compilation directory.
-stop | none | Stop on errors.
-version | none | Print compiler version number.

command line compiler options

Note: In the third column, to print means to produce the requested information on the default output of the ec command.

Finalization

To produce a finalized system, you may use the command ec -finalize. The effect is the same as when you press the Finalize button in the graphical environment, except for two differences:
First, all assertion checking will by default be turned off in the resulting finalized system. In the graphical environment, an interactive panel asks you whether you want to keep or discard assertions. Command ec, however, was designed to be callable automatically from shell scripts or programs, and for that reason never asks for interactive user input (except under the loop option). To retain the assertion checking options specified in the Ace file, use the option -keep in connection with -finalize (the order of the two options is arbitrary).
Second, at the end of the Eiffel part of the compilation you are presented with the message:

System recompiled.
You must now run "finish_freezing" in:
    your_project_path|EIFGEN|F_code

with | replaced by \ if your platform is Windows, / if it is Unix. To execute the C compilation and linking part of the finalization, change directory to your_project_path|EIFGEN|F_code as indicated and execute finish_freezing.

See Also
batch_compilation.


Batch compilation

In order to launch a compilation without user intervention you need to specify the `-batch' switch in the ec command line, otherwise the Eiffel compilation will be blocked. We will present below a typical example of batch processing on both Unix and Windows platforms where we want to compile a project in both frozen and finalized mode, then to launch the C compilations. At the same time we want to save the output of ec and the C compilations.

Unix

In a file called `launch_ec' you can have the following:

#!/bin/sh

output_file="/output_path/OUTPUT"

cd /your_project_path

#LaunchEiffel compilation
ec -batch -ace Ace.ace -finalize 2> $output_file

#Launch C compilation for frozen code

cd EIFGEN/W_code finish_freezing > $output_file
#Launch C compilation for finalized code

cd EIFGEN/F_code finish_freezing > $output_file

It will go the directory where your project is located and compile your Eiffel code using the `Ace.ace' file located in your project directory and compile automatically the C code. All outputs will be stored in the file `/output_path/OUTPUT'.

Note: All output from ec are going to the error output, so do not forget to redirect the error output when you want to see the result.

Windows

In a file called `launched_ec.bat' you can have the following:

#Launch Eiffel compilation
ec -batch -ace Ace.ace -finalize > c:\output_path\OUTPUT

#Launch C compilation for frozen code
cd EIFGEN\W_code finish_freezing > c:\output_path\OUTPUT

#Launch C compilation for finalized code
cd EIFGEN\F_code
finish_freezing > c:\output_path\OUTPUT

It will go the directory where your project is located and compile your Eiffel code using the `Ace.ace' file located in your project directory and compile automatically the C code. All outputs will be stored in the file `c:\output_path/OUTPUT'.

See Also
command line compiler options.


Command line interactive mode

  • Introduction
  • The Compile (and Run) menu
  • The Class menu
  • The Feature menu
  • The System menu
  • The Profile menu
  • The documentation menu


Introduction

If you need to use ec to execute a number of successive operations on a system, you do not need to restart the command each time; instead you may use the -loop option, which will interactively prompt you for successive operations.

If you launch ec with this option, you will get the interactive version's Main Menu:

==== ISE EiffelStudio - Interactive Batch Version (v5.0.32) ====
    (C) Class : class formats and information.
    (I) Compile : compile or run the system.
    (F) Feature : feature formats and information.
    (S) System : Ace and cluster details.
    (P) Profile : information about a profiled run.
    (D) Documentation: create documents from the system.
    (H) Help : show list of commands.
    (Q) Quit : terminate session.
    (Y) Yank : yank (save) output of last command to a file.
Command =>

The revision number in the first line, v5.0.32 above, may be different in your case to indicate that you have a more recent delivery. In this menu, and in all subsequent ones, the commands appear in two groups.
  • commands in the first group are specific to each menu
  • commands in the second group H (Help) to repeat the list of choices, Y (Yank) to save the output of the last command to a file that you will be prompted to name, and Q (Quit) to quit appear in all menus, and will be complemented in the Item Menus below by the M (Main) command which returns to the main menu.
By typing one of the letters shown in the Main Menu's first group, you can go to one of the Item Menus: Class, Compile, Feature,System, Profile and Documentation. Compile enables you to compile a system and execute the result; the next three enable you to obtain information about your project. Profile will enable you to exploit profiling information. Finally, Documentation will enable you to generate HTML documentation about your project.


Compile (and run) menu

The Compile command (i or I) in the main menu yields the following item menu:

    (A) Arguments    : set the arguments.
    (C) F-compile    : (re)compile the C code generated by finalize.
    (Z) Finalize     : finalize the system (discard assertions by default).
    (F) Freeze       : freeze the system.
    (L) Melt         : melt the system.
    (K) Quick melt   : quick melt the system.
    (R) Run          : execute the system.
    (W) W-compile    : (re)compile the C code generated by freeze.

    (H) Help         : show list of commands.
    (M) Main         : go back to main menu.
    (Q) Quit         : terminate session.
    (Y) Yank         : yank (save) output of last command to a file.

The most common compiling option is L (Melt): recompile the system, melting recent changes. The other compilation possibilities are F (Freeze) and Z (Finalize). After a Freeze you will need to C-compile the result using the W (W-compile) command; similarly, you can C-compile the result of a Finalize using C (F-compile).
With any of these three compilation modes you will be prompted for the name of an Ace file unless you have called the command with the -ace option along with -loop. You may either select an existing Ace file or use a template, in which case you will be able to edit the template before proceeding, using the platform's default editor (such as vi on Unix and Notepad on Windows).

Caution: You cannot select a different project from within ec loop; also, you cannot select a different Ace file from within the command, although you may of course change the contents of the Ace (for example by using an editor in an other window).

The R option (Run) runs the application. You will be prompted for the arguments if the application needs any.


Class menu

The Class command (c or C) in the main menu will only work if the system has been successfully compiled, and will give you information based on the result of the last successful compilation. It produces the following menu:

    (B) Attributes   : show the attributes of a class.
    (C) Clients      : show the clients of a class.
    (E) Deferred     : show the deferred features of a class.
    (D) Descendants  : show the descendants of a class.
    (V) Edit         : edit the text of a class.
    (P) Exported     : show the exported features of a class.
    (X) Externals    : show the external features of a class.
    (F) Flat         : show the flat form of a class.
    (I) Flatshort    : show the flat-short form of a class.
    (O) Once         : show the once & constant features of a class.
    (R) Routines     : show the routines of a class.
    (S) Short        : show the short form of a class.
    (U) Suppliers    : show the suppliers of a class.
    (T) Text         : show the text of a class.

    (H) Help         : show list of commands.
    (M) Main         : go back to main menu.
    (Q) Quit         : terminate session.
    (Y) Yank         : yank (save) output of last command to a file.

Each command will prompt you for the name of a class; you can also include the class name after the command, separated by a space, as in A linked_list to obtain the ancestors of class LINKED_LIST.


Feature menu

The Feature Menu enables you to find properties of a feature:

    (A) Ancestors    : show the ancestor versions of a feature.
    (C) Callers      : show the callers of a feature.
    (D) Descendants  : show the descendant versions of a feature.
    (F) Flat         : show the flat form of a feature.
    (O) Homonyms     : shown the homonyms of a feature.
    (I) Implementers : show the classes implementing a feature.
    (T) Text         : show the text of a feature.

    (H) Help         : show list of commands.
    (M) Main         : go back to main menu.
    (Q) Quit         : terminate session.
    (Y) Yank         : yank (save) output of last command to a file.

Each command will prompt you for the name of a class and the name of a feature in that class; you can specify these names (or just the class name) after the command. The Ancestor versions and Descendant versions of a feature are all the versions that appeared in ancestors and descendants. Callers gives you the list of classes which contain calls to the feature; Implementers, the list of classes where the feature is redeclared.


System menu

The System Menu gives general information about the system:

    (A) Ace          : show the Ace file.
    (L) Classes      : show the classes in alphabetic order.
    (S) Cluster hierarchy: display the cluster hierarchy of the system.
    (C) Clusters     : show the system's classes, cluster by cluster.
    (V) Edit         : edit the Ace file.
    (I) Indexing     : show indexing clauses of classes.
    (O) Modifications: show classes modified since last compilation.
    (T) Statistics   : show system statistics.

    (H) Help         : show list of commands.
    (M) Main         : go back to main menu.
    (Q) Quit         : terminate session.
    (Y) Yank         : yank (save) output of last command to a file.

The A (Ace) command shows the Ace file; the E (Edit) command enables you to edit the Ace; the C (Clusters) command is useful to display the entire list of classes, cluster by cluster.


Profile menu

An execution of an instrumented system will generate a file that contains profiling information. This file (named profinfo) is located in the same directory as your compiled system. You must process it through a profile converter to produce the Execution Profile.
The profile menu will enable you to produce the Execution profile and to extract information from it.

The menu (obtained by selecting (P) Profile in the main menu) looks like this:

    (S) Switches : show the output switches.
    (U) Query : manipulate subqueries.
    (I) Input : specify input file (filename or last_output).
    (L) Language : specify language (eiffel, c, cycles)
    (R) Run : run the query.
    (G) Generate : generate profile information for latest run.
    (E) Defaults : reset all values to their defaults.

    (H) Help : show list of commands.
    (M) Main : go back to main menu.
    (Q) Quit : terminate session.
    (Y) Yank : yank (save) output of last command to a file.

Switches submenu

The (S) Switches submenu enables you to set global options. It leads you to the following set of choices:
    (N) Calls : disable output of number of calls to a feature [enabled].
    (F) Feature name : disable output of feature names [enabled].
    (T) Total : enable output of time spent in both the function and its descendants [disabled].
    (S) Self : enable output of time spent in a function itself [disabled].
    (D) Descendants : enable output of time spent in descendants of a function [disabled].
    (P) Percentage : enable output of percentage of time spent in a feature [disabled].

    (H) Help : show list of commands.
    (M) Main : go back to main menu.
    (U) Parent menu : go back to parent menu.
    (Q) Quit : terminate session.
    (Y) Yank : yank (save) output of last command to a file.

Each one of these commands switches on or off the corresponding column output. The default is set on for the first two, off for the others. To enable or disable a column, type the name with a toggle effect.

Query submenu

The (U) Query submenu enables you to define a set of queries. The result will be a Total Query; by default it is the boolean and all the queries you have entered individually, but you may deactivate some of these and choose other boolean operators.
    (A) Add : add a subquery.
    (I) Inactivate : inactivate subquery.
    (R) Reactivate : reactivate subquery.
    (C) Operator : change the boolean operator.
    (S) Show : show the list of queries.

    (H) Help : show list of commands.
    (M) Main : go back to main menu.
    (U) Parent menu : go back to parent menu.
    (Q) Quit : terminate session.
    (Y) Yank : yank (save) output of last command to a file.

To get useful information, you should add the appropriate queries through (A) Add. Each individual query has the following form: attribute operator value, where attribute is one of:

  • feature name
  • calls
  • total
  • self
  • descendants
  • percentage
operator is one of: <, >, <=, >=, =, /=, in

and value is one of:

  • An integer (for calls)
  • A string (for featurename). The string may contain wild card characters:\x11?, standing for arbitrary characters, and *, standing for arbitrary substrings.
  • A real value (for other attributes)
  • An interval, of the form a-b for two values a and b.
  • max
  • min
  • avg
The (S) Show command will display the current queries, each with an associated number. The output includes the total query, explained next.

To inactivate a query, use (I) Inactivate. You will be prompted for a query index, which you may retrieve from (S) Show. This is useful if you make a change about a query, or want to set it aside for future use.

To reactivate a query, use (R) Reactivate. Again you will have to provide a query index.

The Total Query resulting from a succession of (A) Add commands, possibly with some (I) Inactivate and (R) Reactivate commands, is a boolean query resulting by default from adding all the currently active queries. For example after the following set of commands (note that command a outputs help lines, which have been skipped here):

    Command => a
        --> Subquery: featurename = put*

    Command => a
        --> Subquery: calls = 3
        -- Here we change our mind and deactivate the second query
        -- to replace it by calls = 3:

    Command => s
        [1] featurename = put* is active
        [2] calls = 3 is active
        The total active query:
            featurename = put* and
            calls > 5

    Command => i
        --> Subquery index: 2

    Command => a
        --> Subquery: calls > 5

The (S) Show command will show the following result:
    Command => s
        All subqueries:
            [1] featurename = put* is active
            [2] calls = 3 is active
            [3] calls > 5 is active

        The total active query:
            featurename = put* and
            calls > 5

To change the boolean operator to 'or' rather than 'and', use the (C) Operator command. It will prompt you for the index of the operator and the new value:

    Command => c
        --> Operator index followed by operator ('and' or 'or'): 1 or

    Command => s
        All subqueries:
            [1] featurename = put* is active
            [2] calls = 3 is active

        The total active query:
            featurename = put* or
            calls > 5

Input command

The (I) Input command serves to load Execution Profiles. It is initially set to *.pfi meaning that it will load all files with extension pfi. By calling the command repeatedly with new arguments, you are able to load more Execution Profiles. If you use the command without any argument, and the set of input files contained just one file, then the queries will use the last generated output. This avoids explicitly loading a file.

Language command

The (L) Language command enables you to specify the languages to which profiling should be applied. You can specify Eiffel only, C only, or both. If you specify only one language, the query results will not contain any information about routines written in the other language.

The default is Eiffel only. To switch to both Eiffel and C, use Command => l eiffel and c

To return to just Eiffel, simply type l.

Run Command

To run the current total query, use (R) Run.

Generate command

To run the profile converter under the command-line interface, use the (G) Generate command. This will generate an Execution Profile, stored in a file with the extension .pfi.

When running the Generate command with no arguments, you will be prompted for the following information:

· Name of file to be converted (default: profinfo).
· Compilation mode: workbench or finalized (default: workbench).
· Name of profiler tool (default: eiffel).

You can also type in the arguments directly without waiting to be prompted, as in command => g profinfo freeze eiffel

See Also
The graphical interface includes a profiler wizard which enables you to view profiling information very easily.


Documentation menu

The Documentation Menu enables you to generate documentation about the classes of your system:

    (I) Documentation (Flat/Short): Generate flat/short form of all classes in system.
    (S) Documentation (Short): Generate short form of all classes in system.
    (F) Documentation (Flat): Generate flat form of all classes in system.
    (T) Documentation (Text): Generate text form of all classes in system.

    (H) Help         : show list of commands.
    (M) Main         : go back to main menu.
    (Q) Quit         : terminate session.
    (Y) Yank         : yank (save) output of last command to a file.

The four documentation commands will trigger the creation of html files corresponding to requested information. These files will then be located in the Documentation subdirectory of your project directory.


External features

  • Introduction
  • C externals
  • C++ externals
  • Java externals


Introduction

With ISE EiffelStudio you can encapsulate features written in C, C++ and Java. This makes it possible to use powerful libraries written in other languages while still benefiting from the use of Eiffel for the frame of the program.

See also:
The CECIL library: exporting Eiffel to C
C shared libraries generation


C externals

General consideration

As ISE's technology relies heavily on the use of a C/C++ ANSI compiler, you have to be sure to always put the correct signature of an external C/C++ routine. If it was not the case, the C compilation of your system could fail. Most of the time a C compiler is more comprehensive than a C++ compiler and most type errors won't cause you any harm, but C++ compilers are not as lax as C compilers and they will mostly generate errors.

The section concerning Macros and Structs are also available for C++, i.e. if the macro or the struct is defined in a C++ header file.

C routines

You can encapsulate routines that are defined in a C header file. We will take some examples and will show you how to write wrappers in Eiffel.

If in a header file called `my_header.h', you have the following declaration:

        /* Routine with no parameter */
    extern void no_param(void);

        /* Routine with one parameter */
    extern void one_param(int j);

        /* Routine returning a value with no parameter */
    extern size_t no_param_return(void);

        /* Routine returning a value with one parameter */
    extern size_t one_param_return(FILE *f);

Here is the corresponding Eiffel code:

    c_no_param is
            -- Encapsulation of a C routine with no parameter.
        external
            "C | %"my_header.h%""
        alias
            "no_param"
        end

    c_one_param (i: INTEGER) is
            -- Encapsulation of a C routine with one parameter.
        external
            "C (int) | %"my_header.h%""
        alias
            "one_param"
        end

    c_no_param_return: INTEGER is
            -- Encapsulation of a C routine with no parameter
            -- returning an INTEGER
        external
            "C (): EIF_INTEGER| %"my_header.h%""
        alias
            "no_param_return"
        end

    c_one_param_return (p: POINTER): INTEGER is
            -- Encapsulation of a C routine with one parameter
            -- returning an INTEGER
        external
            "C (FILE *): EIF_INTEGER| %"my_header.h%""
        alias
            "one_param_return"
        end

Macros

If in a header file called `my_header.h', you have the following declaration:

        /* Predefined constants */
    #define ID_MENU				128
    #define ID_MENU_CHARACTER	'c'

        /* Access the `i'-th element of `a' where `a'
         * is an array of EIF_INTEGER */
    #define i_th(a,i)				((a) + (i)*sizeof(EIF_INTEGER))

Then, the corresponding Eiffel code will look like:

    menu_id: INTEGER is
            -- `ID_MENU' C encapsulation.
        external
            "C [macro %"my_header.h%"] : EIF_INTEGER"
        alias
            "ID_MENU"
        end

    menu_id_character: CHARACTER is
            -- `ID_MENU_CHARACTER' C encapsulation.
        external
            "C [macro %"my_header.h%"] : EIF_CHARACTER"
        alias
            "ID_MENU_CHARACTER"
        end

    i_th (p: POINTER; i: INTEGER): INTEGER is
            -- Access the `i'-th element of `p', array of C EIF_INTEGER.
        external
            "C [macro %"my_header.h%"] (EIF_INTEGER *, EIF_INTEGER): EIF_INTEGER"
        alias
            "i_th"
        end

Structs

The struct encapsulation enables you to wrap C/C++ structures easily without having to write any additional code in a C header file as it was the case until ISE introduced this new keyword in the external specification with ISE EiffelBench 4.5. With the struct encapsulation you can set and retrieve the value of a certain field of a struct.

If in a header file called `my_header.h', you have the following declaration of the `Point' structure whose `x' and `y' fields we want to access and set:

        /* Definition of `Point' */
    typdef struct point {
        int x;
        int y;
    } Point;

Then, the corresponding Eiffel code will look like:

    x (p: POINTER): INTEGER is
            -- Access field x of struct pointed by `p'.
        external
            "C [struct %"my_header.h%"] (Point): EIF_INTEGER"
        alias
            "x"
        end

    y (p: POINTER): INTEGER is
            -- Access field y of struct pointed by `p'.
        external
            "C [struct %"my_header.h%"] (Point): EIF_INTEGER"
        alias
            "y"
        end

    set_x (p: POINTER; v: INTEGER) is
            -- Set field x of struct pointed by `p'.
        external
            "C [struct %"my_header.h%"] (Point, int)"
        alias
            "x"
        end

    set_y (p: POINTER: v: INTEGER) is
            -- Set field y of struct pointed by `p' with `v'.
        external
            "C [struct %"my_header.h%"] (Point, int)"
        alias
            "y"
        end

Windows externals

DLLs

With ISE EiffelStudio you now have two different ways to call C routines exported in a DLL. Why two, because Windows provides two ways to call a C routine in a DLL:

  • _cdecl: referred to as the standard way
  • __stdcall referred to as the Pascal way

Therefore if you want to call an external routine defined in a DLL supposed to be called using the `_cdecl' method, you have to use the `dll32' sub-language option. For `__stdcall' you need to use the `dllwin32' sub-language option. Here is an example:

    my_cdecl_routine (a: INTEGER): POINTER is
            -- Encapsulation of a dll function with the `_cdecl' call mechanism.
        external
            "C [dll32 %"my_dll.dll%"] (int): EIF_POINTER"
        end

    my_stdcall_routine (a: INTEGER): POINTER is
            -- Encapsulation of a dll function with the `_stdcall' call mechanism.
        external
            "C [dllwin32 %"my_dll.dll%"] (int): EIF_POINTER"
        end

Caution: Using wrongly dll32 instead of dllwin32 and reciprocally will conduce to a crash of your system since the C call stack will be corrupted. For more information please read your C compiler documentation.

Windows API

As described in the previous section concerning routines exported in a DLL, the Windows API is using the `__stdcall' convention. As a consequence, you cannot use the standard external mechanism to wrap them because it is using the `_cdecl' convention. However, you can easily wrap those function by using the `macro' sub-language.

Here is an example that has been taken from WEL, the Windows Eiffel Library, to encapsulate the Windows `SendMessage' function:

Windows defined SendMessage as:
    LRESULT SendMessage(
        HWND hWnd,      // handle to destination window
        UINT Msg,       // message
        WPARAM wParam,  // first message parameter
        LPARAM lParam   // second message parameter
    );
In WEL, the encapsulation is written as:
    cwin_send_message (hwnd: POINTER; msg, wparam, param: INTEGER) is
            -- SDK SendMessage (without the result)
        external
            "C [macro %"wel.h%"] (HWND, UINT, WPARAM, LPARAM)"
        alias
            "SendMessage"
        end

See also:
C++ externals


C++ externals

Introduction

Before making C++ calls in EiffelStudio, you may want to learn the basics of making C calls, since these basics are not repeated here but they might be useful for C++ users as well and are necessary to fully benefit from this document.

The C++ interface and Legacy++ are part of all versions of ISE Eiffel starting with version 4.1.

Overview

Eiffel software must interact with software written in other languages. In this document you will learn about how to incorporate C++ classes in your Eiffel software.

The C++/Eiffel interface offers the following mechanisms:

  • You can create instances of C++ classes from Eiffel, using the C++ "constructor" of your choice.
  • You can apply to these objects all the corresponding operations from the C++ class: executing functions ("methods"), accessing data members, executing destructors.
  • You can use the Legacy++ tool to produce an Eiffel "wrapper class" encapsulating all the features of a C++ class, so that the result will look to the rest of the Eiffel software as if it had been written in Eiffel.

The discussion concentrates on using C++ software from Eiffel. In the other direction, you can use the Cecil library (C-Eiffel Call-In Library) described in chapter 24 of Eiffel: The Language with important complements in the Cecil manual and at ftp://ftp.eiffel.com.

Syntax specification

In the following specification, the syntax for External and External_name is retained unchanged from Eiffel: The Language, where Language_name is defined simply as Manifest_string; the rest covers the additional facilities.

    External == external Language_name [External_name]

    Language_name ==
            '"'
            Basic_language_name
            [Special_external_declaration]
            [Signature]
            [Include_files]
                    '"'

    Basic_language_name == "C" | "C++"

    Special_external_declaration == "[" Special_feature "]"

    Special_feature == Special_C_feature | Special_C++_feature

    Special_C_feature == ... See appendix E of Eiffel: The Language...

    Special_C++_feature ==
            Member_function_call|
            Static_function_call |
            Object_creation |
            Object_deletion |
            Data_member_access |

    Member_function_call == C++_Class

    C++_Class == Class_name File_name

    Class_name == Identifier

    Static_function_call == static C++_Class

    Object_creation == new C++_Class

    Object_deletion == delete C++_Class

    Data_member_access == data_member C++_Class

                -- The remaining elements are repeated
                -- from the C interface specification (page 291 in Eiffel: The Environment).

    File_name ==  User_file_name | System_file_name

    User_file_name == '%"' Manifest string '%"'

    System_file_name == "<" Manifest_string ">"

    Signature ==  "(" Type_list ")" [Result_type]

    Type_list ==  {Type "," ...}

    Result_type ==  ":" Type

    Include_files ==  "|" File_list

    File_list ==  {File_name "," ...}

    External_name ==  alias Manifest_string

As with the C extensions of the previous appendix, the syntax description conventions are those of Eiffel: The Language. == means "is defined as". The vertical bar | separates alternative choices, such as the three possibilities for Special_feature. The brackets [...] enclose optional components; for example a Language_name is made of required quotes, a required Basic_language_name and three further components, any or all of which may be absent. The notation {Element Separator ...} means: 0 or more occurrences ("specimens") of Element separated, if more than one, by Separator.

Several of the symbols of the syntax notation, such as the brackets or the vertical bar, also appear in the language; to avoid any confusion they are given in double quotes. For example the specification for Include_files begins with "|" to indicate that an Include_files part starts with a vertical bar. Single quotes may be used instead of double quotes when one of the quoted characters is itself a double quote; for example '%"' appearing in the production for User_file_name denotes the percent character followed by the double quote character. Special words such as static in bold italics stand for themselves, unquoted.

Available possibilities

Processing C++ features

A Special_C++_feature, if present, indicates one of the following, all illustrated by examples in the next sections:

  • If the special feature's declaration simply starts with a C++ class name, followed by the associated file name, it indicates that the Eiffel feature will call a C++ member function (also known as a "method") from that class. The name of the member function is by default the same as the name of the Eiffel feature; as usual, you can specify a different name through the alias clause of the external declaration.
  • If the declaration starts with static, it indicates a call to a C++ static function.
  • If the declaration starts with new, it indicates a call to one of the constructors in the C++ class, which will create a new instance of that class and apply to it the corresponding constructor function.
  • If the declaration starts with delete, it indicates a call to a destructor from the C++ class. In this case the Eiffel class may inherit MEMORY and redefine the dispose procedure to execute the destructor operations whenever the Eiffel objects are garbage-collected.
  • If the declaration starts with data_member, it indicates access to a data member (attribute in Eiffel terminology) from the C++ class.

The rest of the possible components are the same as in the C interface: Signature to specify types for arguments and results; possible Include file.

Extra argument

For a non-static C++ member function or destructor, the corresponding Eiffel feature should include an extra argument of type POINTER, at the first position. This argument represents the C++ object to which the function will be applied.

For example, a C++ function

    void add(int new_int);

should have the Eiffel counterpart

    cpp_add (obj: POINTER; new_int: INTEGER) is
        -- Encapsulation of member function add.
    external
        "C++ [IntArray %"intarray.h%"] (IntArray *, int)"
    end
This scheme, however, is often inconvenient because it forces the Eiffel side to work on objects in a non-object-oriented way. (The object-oriented way treats the current object, within a class, as implicit.) A better approach, used by Legacy++, is to make a feature such as cpp_add secret, and to export a feature whose signature corresponds to that of the original C++ function, with no extra object argument; that feature will use a secret attribute object_ptr to access the object. In the example this will give the feature
    add (new_int: INTEGER) is
        -- Encapsulation of member function add.
    do
        cpp_add (object_ptr, new_int)
    end

where object_ptr is a secret attribute of type POINTER, initialized by the creation procedures of the class. To the Eiffel developer, add looks like a normal object-oriented feature, which takes only the expected argument. Further examples appear below. This technique only works of course when the C++ object is implicit in the context of the Eiffel class.

There is no need for an extra argument in the case of static member functions, constructors and data members.

Wrapping C++ classes: Legacy++

Before taking a look at examples of the various facilities mentioned, it is useful to consider the tool that will help you, in many cases, avoid worrying about their details.

The role of Legacy++

Often you will want to provide an Eiffel encapsulation of all the facilities -- member functions, static functions, constructors, destructors, data members -- of a C++ class. This means producing an Eiffel class that will provide an Eiffel feature for each one of these C++ facilities, using external declarations based on the mechanisms listed in the preceding section.

Rather than writing these external declarations and the class structure manually, you can use the Legacy++ tool to produce the Eiffel class automatically from the C++ class.

Calling Legacy++

Legacy++ is called with an argument denoting a .h file that must contain C++ code: one or more classes and structure declarations. It will translate these declarations into Eiffel wrapper classes. Legacy++ is only available on Windows. It is located in the $ISE_EIFFEL\bench\spec\windows\bin directory, under the name h2e.exe. By default the installation program creates an entry for it in the Start menu.

The following options are available:

  • -E: apply the C preprocessor to the file, so that it will process #include, #define, #ifdef and other preprocessor directives. This is in fact the default, so that you do not need to specify -E explicitly (see next option).
  • -NE: do not apply the C preprocessor to the file.
  • -p directories: use directories as include path.
  • -c compiler: use compiler as the C++ compiler.
  • -g: treat the C++ code as being intended for the GNU C++ compiler.

Result of applying Legacy++

Running Legacy++ on a C++ file will produce the corresponding Eiffel classes. Legacy++ processes not only C++ classes but also C++ "structs"; in both cases it will generate an Eiffel class.

Legacy++ knows about default specifiers: public for structs, private for classes.

Legacy++ will generate Eiffel features for member functions (static or not).

It will also handle any constructors and destructors given in the C++ code, yielding the corresponding Eiffel creation procedures. If there is no explicit constructor, it will produce a creation procedure with no arguments and an empty body.

For any non-static member function or destructor, Legacy++ will generate a secret feature with an extra argument representing the object, as explained in the preceding section in this page. It will also produce a public feature with the same number of arguments as the C++ function, relying on a call to the secret feature, as illustrated for add and cpp_add above.

The char* type is translated into STRING. Pointer types, as well as reference types corresponding to classes and types that Legacy++ has processed, will be translated into POINTER. Other types will yield the type UNRESOLVED_TYPE.

Legacy++ limitations

It is up to you to supply Eiffel equivalents of all the needed types. If Legacy++ encounters the name of a C++ class or type that is does not know -- i.e. it is neither a predefined type nor a previously translated class -- it will use the Eiffel type name UNRESOLVED_TYPE. If you do not change that type in the generated class, the Eiffel compiler will produce an error (unknown class) at degree 5.

Legacy++ does not handle inline function declarations.

Legacy++ makes no effort to understand the C++ inheritance structure.

More generally, given the differences in the semantic models of C++ and Eiffel, Legacy++ can only perform the basic Eiffel wrapping of a C++ class, rather than a full translation. You should always inspect the result and be prepared to adapt it manually.

Legacy++'s contribution is to take care of the bulk of the work, in particular the tedious and repetitive parts. The final details are left to the Eiffel software developer.

Legacy++ is only supported on the windows platform.

Example

Consider the following C++ class, which has an example of every kind of facility that one may wish to access from the Eiffel side:

    class IntArray
            {
            public:
                IntArray(int size);
                ~IntArray();
                void output();
                void add(int new_int);
                static char * type();

            protected:
                int *_integers;
            };

Here is the result of applying Legacy++ to that class, which will serve as an illustration of both the C++ interface mechanisms and Legacy++:

indexing
    description: "Eiffel encapsulation of C++ class IntArray";

    date: "$Date: 2002/07/20 01:48:54 $";
    revision: "$Revision: 1.5 $"

class
    INTARRAY

inherit
    MEMORY
        redefine
            dispose
        end

creation
    make

feature -- Initialization
    make (size: INTEGER) is
            -- Create Eiffel and C++ objects.
        do
            object_ptr := cpp_new (size)
        end

feature -- Removal
    dispose is
            -- Delete C++ object.
        do
            cpp_delete (object_ptr)
        end

feature
    output is
            -- Call C++ counterpart.
        do
            cpp_output (object_ptr)
        end

    add (new_int: INTEGER) is
            -- Call C++ counterpart.
        do
            cpp_add (object_ptr, new_int)
        end

feature {INTARRAY}
    underscore_integers: POINTER is
            -- Value of corresponding C++ data member.
        do
            Result := underscore_integers (object_ptr)
        end

feature {NONE} -- Externals
    cpp_new (size: INTEGER): POINTER is
            -- Call single constructor of C++ class.
        external
            "C++ [new IntArray %"INTARRAY.H%"] (EIF_INTEGER)"
        end

    cpp_delete (cpp_obj: POINTER) is
            -- Call C++ destructor on C++ object.
        external
            "C++ [delete IntArray %"INTARRAY.H%"] ()"
        end

    cpp_output (cpp_obj: POINTER) is
            -- Call C++ member function.
        external
            "C++ [IntArray %"INTARRAY.H%"] ()"
        alias
            "output"
        end

    cpp_add (cpp_obj: POINTER; new_int: INTEGER) is
            -- Call C++ member function.
        external
            "C++ [IntArray %"INTARRAY.H%"] (EIF_INTEGER)"
        alias
            "add"
        end

    cpp_underscore_integers (cpp_obj: POINTER): POINTER is
            -- Value of C++ data member
        external
            "C++ [data_member IntArray %"INTARRAY.H%"]: EIF_POINTER"
        alias
            "_integers"
        end

feature {NONE} -- Implementation
    object_ptr: POINTER

end -- class INTARRAY


Java externals

Introduction

The Java interface allows you to call Java routines or attributes from your Eiffel code. It uses the Java Native Interface (JNI) provided by the Java Development Kit (JDK) 1.1.4. You can get more information about the JNI at:

http://java.sun.com/products/jdk/1.1/docs/guide/jni/index.html

Requirements

  • JDK 1.1.4 correctly set (download it at http://java.sun.com/products/jdk/1.1/index.html).
  • The Java classes you want to use must be in the environment variable CLASSPATH.

Limitations

  • In this version, you can only use one JNI environment.
  • Only one thread can interact with the Java Virtual Machine (JVM).
  • It is not possible to call Eiffel features from Java programs.
  • The Eiffel side cannot deal with 'long' integer (64 bits).
  • The Eiffel feature `destroy_vm' of `JAVA_VM' calls a C function of the Java Native Interface that is not fully implemented in jdk 1.1.4. This function, called DestroyJavaVM, always returns -1 in jdk 1.1.4. For further information, go on the JNI pages at the address above.

Interface classes

JNI_ENVIRONMENT

Holds information about JNI environment. Potentially many JNI environments can coexist, but this was never tested. This class provides the facilities to interact with the JVM:

  • creation of instances of Java Classes
  • exception mechanism
  • destruction of the JVM

SHARED_JNI_ENVIRONMENT

Shared JNI environment. Since one JNI is needed per thread we limit Eiffel to having one thread that deals with Java. The class that calls Java routines or attributes must inherit from this class.

JAVA_VM

This class is used to initially load the JVM into the running program. This is the Eiffel representation of the JVM.

JAVA_CLASS

Access to Java classes. Static methods and attributes are accessed via this class. This is the Eiffel representation of a Java class.

JAVA_OBJECT

This class gives Eiffel access to Java objects. You can use it directly or inherit it to create a more convenient Eiffel class that makes the Java object look like an Eiffel object.

Note: to access the static fields or routines of a Java class, you have to use the features of a JAVA_CLASS instance.

JAVA_EXTERNALS

JNI external declarations. Don't use this class directly.

JAVA_***_ARRAY

Access to Java array of "***". "***" can be all the usual types of Java (byte, short, int, float, double, char, boolean) or object if it is an array of Java objects (a String is considered to be an object).

JAVA_ARGS

Class representing the arguments that can be passed to a Java method. See below for the signature of the methods.

JAVA_OBJECT_TABLE

This class provides a mapping between Java and Eiffel objects.

Mapping the Eiffel classes and the Java types:

The following table describes the mapping of Java primitive types and classes to Eiffel classes.

Java type/class | Eiffel class
boolean | BOOLEAN
char, byte | CHARACTER
short, int, long | INTEGER
float | REAL
double | DOUBLE
String | STRING
void | Void

The interface does the mapping automatically. For example, if you call a Java method that returns a 'float', by using float_method you will get a 'REAL'.

The signature of Java methods and attributes:

When you want to call a Java method or access a field, you need to specify its signature. The Eiffel to Java interface follows the JNI specifications. The table below summarizes the encoding for the Java type signatures:

Signature | Java Type
Z | boolean
B | byte
C | char
S | short
I | int
J | long
F | float
D | double
V | void
[type | type []

The signature for a Java class has the following form:

Lfully-qualified-class ;

For example, class String: Ljava/lang/String;

The signature for a method has the following form:

( arguments-types ) returned-types

For example, the signature of a method that takes as arguments an integer and a string and return void is:

(ILjava/lang/String;)V

An example

            ## the Java Class ##
class test {
    test () {}
    public int my_integer;
    public static in my_static_integer;
    public void my_method (int arg_int, String arg_string) {
        ...
    }
    ...
}

            ## the Eiffel Side ##
class
    EIFFEL_TO_JAVA

inherit
    SHARED_JNI_ENVIRONMENT

creation
    make

feature -- Creation

    make is
        local
            class_test: JAVA_CLASS
            instance_of_class_test: JAVA_OBJECT
            fid: POINTER
            value: INTEGER
            j_args: JAVA_ARGS
        do
            --| Creation of the Java object

            class_test := jni.find_class ("test")
            create instance_of_class_test.create_instance (class_test, "()V", Void)

            --| Access to a public attribute

            fid := instance_of_class_test.field_id ("my_integer", "I")
                -- 'fid' contains the id of the field 'my_integer'

            value := instance_of_class_test.integer_attribute (fid)
                -- 'value' contains the value of the field referenced
                -- by 'fid'
            ...

            --| Access to a static attribute using directly the JAVA_CLASS

            fid := class_test.field_id ("my_static_integer", "I")
            value := class_test.integer_attribute (fid)
            ...

            --| Access to a static attribute using the attribute 'jclass'

            fid := instance_of_class_test.jclass.field_id ("my_static_integer", "I")
            value := instance_of_class_test.jclass.integer_attribute (fid)
            ...

            --| Access to the method 'my_method'
            fid := instance_of_class_test.method_id ("my_method", "(ILjava/lang/String;)V")
                -- Get the id of 'my_method'

            create j_args.make(2)
            j_args.push_int (2)
            j_args.push_string("String test")
                -- Create the set of arguments for 'my_method'

            instance_of_class_test.void_method (fid, j_args)
                -- Call to the void method referenced by 'fid'
            ...

        end -- make

end -- class EIFFEL_TO_JAVA


Dynamic library generation

  • Introduction
  • Dynamic library builder
  • Definition file
  • Generated files


Introduction

The ISE Eiffel compiler offers now the possibility to generate a dynamic shared library based on the system.

Thanks to this dynamic library, it is possible to call Eiffel features from a C program, by using the real names of the features.

In other words, the user can generate a DLL (*.dll) using features of the system on windows, and a shared library (*.so) on Unix.

For that, the user has first to describe what he wants to export in his dynamic library. This is done via a definition file (*.def), which specifies what features should be exported. A wizard helps build the definition file, which makes this step very intuitive. The second step is to select the definition file in the project settings to take this definition file into account. This done, the next compilation of the system will yield C files that can be used to create the shared library.


Dynamic library builder

In order to facilitate the creation of C dynamic libraries using EiffelStudio, a wizard helps generate the definition files used to define the contents of the shared library. If for some reason you need to override the wizard, the syntactic rules of the definition files are available, but they are not necessary to know to make a standard use of the dynamic library generation in EiffelStudio.

The wizard is accessible in the Tools/Dynamic library builder menu.

The dynamic library window that appears when selecting this menu is mainly composed of a list which contains all features that should be exported. This list is course empty at first.

Note: The layout of this wizard is slightly different on Windows and on Unix systems, because the index and calling convention fields never appear on Unix systems.

To add a new feature to the definition file, you can either:

  • Pick the feature from any place in EiffelStudio and drop it into the list. If several creation procedures exists in the container class, a dialog is popped up to give the choice between all possible creation procedures.
  • Or, use the Add command [image] in the Edit/Add menu. This pops up a dialog where it is possible to enter manually all parameters for the exported feature.

Other commands of the Edit menu allow you to remove [image] exported features or to modify their export parameters [image].

It is also possible to check the validity of the definition file. This command [image] performs both a global check, to ensure that for example two features do not have the same name or same index in the library, and also local checks, that check for each feature that the parameters are valid.

Other commands, located in the File menu, give standard file operations, such as opening [image] a definition file, creating a new definition file [image], or saving the current definition file [image].

Tip: Although the wizard can handle several files during the same EiffelStudio session, remember that only one file can be used in the project settings to effectively generate a shared library.


Definition file

The syntax is pretty simple when you understand what you need to export a feature: you need the name of the feature, the name of the concerned class, and the name of a creation procedure. What is optional is to specify an alias, an index and a calling convention. The index and calling convention are mainly used to create a DLL for windows, and the alias to export the feature under a different name.

Syntax

    Export_feature | Class_name [Creation_part] ":" Feature [Optional_part]
Creation_part | "(" feature_name ")"
Optional_part | [Index_part] [Alias_part]
Index_part | "@" integer
Alias_part | "Alias" alias_name
Call_type_part | "call_type" call_type_name

Example

    ROOT_CLASS (make): foo @ 4 Alias my_foo call_type __stdcall

Constraint

    • on the class:
        The class cannot be deferred or generic.
    • on the feature:
        It could be any feature except an attribute, an external feature or a deferred feature.
    • on the creation procedure:
        It must have zero argument, and no return type.
    • on the alias name:
        It must be a valid name for a C function.
    • on the index:
        It must be strictly positive.
    • on the call type:
        It must be a valid call type for the targeted platform (useful for Windows only). For Visual C++, the valid calling conventions are __stdcall, __cdecl and __fastcall.

    For each feature the required fields are the class, the creation procedure, and of course the feature itself.

    • If the feature is a creation procedure then do not specify any creation, it will use the feature as creation. For example ROOT_CLASS: make.
    • If the class has no creation procedure, do not specify any creation. default_create will be automatically used.

    A definition file

      -- EXPORTED FEATURE(s) OF THE SHARED LIBRARY
-- SYSTEM : demo

-- CLASS [BAR]
BAR (make_b) : get_string
BAR (make_a) : print_bar

-- CLASS [ROOT_CLASS]
ROOT_CLASS : make
ROOT_CLASS (make) : foo
ROOT_CLASS (make) : test_bar
      -
-Name of the Eiffel system
-
-Class BAR
-here get_string uses make_b as creation
-here print_bar uses make_a as creation
-
-
-here the feature is also a creation
-
-


Generated files

Basically, once the Eiffel definition file is created, the compiler will generate a set of files and will compile them to generate the Dynamic library into the EIFGEN/W_code or EIFGEN/F_code directory.

Note: To generate and compile these files, you have to indicate the definition file that should be used in the advanced tab of the project settings of your system. This way EiffelStudio will know which one to use. If you do not specify any definition file, nothing will be generated.

The set of files is composed of:

    • EIFGEN/W_code/system.def (or F_code)
    • EIFGEN/W_code/edynlib.c (or F_code)
    • $(ISE_EIFFEL)/studio/spec/$(ISE_PLATFORM)/templates/egc_dynlib.template
      this file will be copied during the compilation into the EIFGEN/W_code/E1 directory as egc_dynlib.c
    • $(ISE_EIFFEL)/studio/spec/$(ISE_PLATFORM)/include/egc_dynlib.h
    • and the Makefile

The system.def is only used on windows, it is the definition file used to generate a DLL when linking.

    LIBRARY demo.dll
DESCRIPTION DEMO.DLL

EXPORTS

;System
    init_rt
    reclaim_rt

; CLASS [BAR]
    get_string
    print_bar

; CLASS [ROOT_CLASS]
    make
    foo
    test_bar

    - Information about the DLL
- ...
-
- The following are EXPORTed functions.
-
- This part concerns the RunTime.
-	initialize the RT.
-	reclaim the Eiffel object.
-
- The exported for the CLASS BAR
-	get_string
-	print_bar
-
- The exported for the CLASS BAR
-	make
-	foo
-	test_bar

The edynlib.c file is the "interface" between the Eiffel system, and the C code, basically it contains the declaration and the implementation of the function used to directly call the eiffel feature with its real name.

The egc_dynlib.c and egc_dynlib.h files are used for operations performed by the RunTime.


Compiler information

  • Melting ice technology
  • Supported C compilers
  • Lace syntax


Melting Ice Technology

EiffelStudio relies on Melting Ice Technology, the proprietary compilation mechanism of ISE Eiffel, which offers three forms of compilation:

  • melting for making a few changes. The fastest of the mechanisms, typically taking a few seconds after small changes. Melting time is proportional to the size of the changed parts and affected classes, while the time needed to freeze or finalize is partly proportional to the size of the whole system. As long as you do not include new external C/C++ code, a C/C++ compiler is not required. However, execution speed is not optimal. The generated executable is debuggable.
  • freezing generates C code from the active system, and then compiles it into machine code; you must have a C/C++ compiler installed. You need to use this option if you add new agents or external C/C++ calls. Unless you add external code, you can re-freeze every couple of days. The rest of the time, you can melt your software to receive immediate feedback. The speed is still slower than when finalizing, but the generated executable is still debuggable.
  • finalizing delivers a production version (intermediate or final) of your software. It can be used to measure its performance in operational conditions. Finalization performs extensive time and space optimizations that enable Eiffel to match the efficiency of C/C++; it also creates a stand-alone C package that you can use for cross-platform development. Because of all the optimizations involved, finalizing takes the most time, and the generated executable is not debuggable.

Melting and freezing generate an executable in the EIFGEN|W_code subdirectory of the project directory. The executable is composed of a standard executable file named after the system, and of a <system name>.melted file, which is called the Eiffel update file. Although it is recommended to finalize the system when running it from outside EiffelStudio (since the performance is better), it is possible to launch a melted/frozen executable. However, the Eiffel update file is necessary, the executable alone will not run.

Basically, the Eiffel update file incorporates the changes that have been made to the system since it was last frozen. Therefore, it is very small when the system has just been frozen, and progressively becomes bigger each time the system is melted. On the contrary, the executable is only modified when the system is frozen, never when it is melted.

The contents of the Eiffel update file are in a byte code representation which is dynamically interpreted at run-time.


Supported C compilers

Unix/Linux Users:

ISE EiffelStudio supports `gcc' on most platforms and the native `cc' compiler if it is an ANSI C compiler.

Microsoft Visual C++ Users

ISE EiffelStudio supports only version 6.0 of the Microsoft Visual C++ environment. You can still use older versions of the Microsoft C++ environment (version 4.1, 4.2 or 5.0) as long as you have the latest Platform SDK from Microsoft, but this won't be supported by ISE.

Make sure that the Microsoft tools are correctly setup to run from the MS-DOS prompt:

  • On Windows NT or 2000, the installation of VC++ should do it automatically.
  • On Windows 95/98/Me, you need to copy the content of the file `vcvars32.bat' from the `bin' directory of the VC installation into your autoexec.bat file and to reboot your machine so that changes take effect.

By default the installation program will set in the registry keys the ISE_C_COMPILER key to `msc'.

Borland C++ Users:

ISE EiffelStudio only supports version 5.5.1 of Borland C++ that is included in the installation of ISE EiffelStudio. We do not support any other versions. Check with ISE for the availability of newer version of the Borland C++ compiler.

By default the installation program will set in the registry keys the ISE_C_COMPILER key to `bcb'.

Changing your C compiler on Windows

You can do it in two different ways. The first one is using the registry keys of the Windows™ operating system, the second one modifies the environment variables.

When modifying the registry keys, simply create a `compiler.reg' file with the following content:

REGEDIT4

[HKEY_LOCAL_MACHINE\Software\ISE\Eiffel52]

[HKEY_LOCAL_MACHINE\Software\ISE\Eiffel52\ec]
"ISE_C_COMPILER"="C_COMPILER"

[HKEY_LOCAL_MACHINE\Software\ISE\Eiffel52\finish_freezing]
"ISE_C_COMPILER"="C_COMPILER"

[HKEY_LOCAL_MACHINE\Software\ISE\Eiffel52\wizard]
"ISE_C_COMPILER"="C_COMPILER"

Where you can replace "C_COMPILER" by either:

  • msc for Microsoft Visual C++
  • bcb for Borland C++

Then execute the file and everything will be ready to use your new C compiler.

When modifying the environment variables, simply defines ISE_C_COMPILER to be either:

  • msc for Microsoft Visual C++
  • bcb for Borland C++


Lace syntax

Introduction

Ace files are central control files for Eiffel projects. They mainly describe the compilation options of the project, its clusters and the external references to C files necessary to compile the system successfully.

From EiffelStudio 5.0 on, modifying Ace files manually is not necessary any more. The project settings dialog takes care of everything graphically. If for some reason you need to modify manually Ace files, the syntax is described beneath.

Overview

Here is a standard Ace file:

system
    sample

root
    ROOT_CLASS: "make"

default
    address_expression (no)
    array_optimization (no)
    assertion (all)
    check_vape (yes)
    console_application (no)
    collect (yes)
    dead_code_removal (yes)
    debug (no)
    debug ("DEBUG_TAG")
    document (".")
    dynamic_runtime (no)
    exception_trace (no)
    inlining (yes)
    inlining_size ("4")
    line_generation (no)
    multithreaded (no)
    override_cluster("your_override_cluster")
    profile (no)
    shared_library_definition ("file_name.def")
    precompiled ("$ISE_EIFFEL\precomp\spec\$ISE_PLATFORM\base");

cluster
    root_cluster: "c:\temp";

        -- EiffelBase
    all base:	"$ISE_EIFFEL\library\base"
        exclude
            "desc";"table_eiffel3"
        end

    thread:	"$ISE_EIFFEL\library\thread"

external
    include_path:
        "$(ISE_EIFFEL)\library\wel\spec\windows\include"
    object:
        "$(ISE_EIFFEL)\library\wel\spec\$(ISE_C_COMPILER)\lib\wel.lib"
end

The first part, introduced by the keyword system, gives the name of the system.

The part starting with root names the root class and the feature that starts the execution of the system.

Afterwards comes the list of the clusters of the system, introduced by cluster.

The last part, after external, describes the files needed by the C compilation. They include header files needed by the external features of the system, and the library files.

Ace files always finish with the end keyword, like Eiffel classes.

The commenting conventions for Ace files are similar to the ones of classes: comments are introduced by -- and include the end of the line.

Default options

We will describe each option as they are presented in the Ace file above, in the option section, in alphabetical order. The default value for each option is shown in bold.

  • address_expression (yes | no): enables you to pass `$(s.to_c)' to a feature instead of declaring `a' of type ANY, and then assigning `s.to_c' to `a' and passing `$a'. Turn this option on only if you have advanced knowledge of the garbage collector insides, since using this syntax illegally can lead to bugs very hard to trace.
  • array_optimization (yes | no): enables array optimization which increases performance of array computation in loops. It is enabled only if arrays are used as local variables or arguments of an Eiffel feature.
  • assertion (no | require | ensure | invariant | loop | check | all): sets the assertion level of an Eiffel system. Contrary to previous versions of the Eiffel language, levels do not include the previous level, thus specifying `loop' will no longer check for preconditions, postconditions, class invariants, loop variants and loop invariants. With the new syntax, you are free to decide which assertions are to be tested independently from the others. Thus, it is now possible to check preconditions and checks by writing
    assertion (require)
    assertion (check)
    in the Ace file, without having invariants and postconditions checked.
    The all specification includes all checks.
  • check_vape (yes | no): enables you to disable type checking for VAPE errors in preconditions, which correspond to unsufficiently exported features used in preconditions (ETL 2nd edition page 122).
  • console_application (yes | no): has no effects on Unix and it was made for Windows users. It enables Windows users to choose between creating a console application or a GUI application (in which case a console will be created if needed, instead of using the console the program was launched from).
  • collect (yes | no): not applicable. One has to use the MEMORY class to activate or stop the garbage collector.
  • dead_code_removal (yes | no): it is a finalization option only. It enables you to not generate the C code for Eiffel routines that are not called in your code, and thus reducing the size of the generated application.
  • debug (yes | no | "DEBUG_TAG"): enables you to activate or disable the code written inside `debug' statement in your Eiffel code. If you marked your code with tagged `debug' statement and if you specify a tag in the Ace file, only this kind of `debug' statement will be executed. You can put several lines of `debug' in the Ace file to enable several kinds of `debug' statements.
  • document ("path"): specifies in which directory the documentation generated by EiffelStudio should be put (when using the Project/Generate documentation... menu). If no directory is specified, the documentation will be generated at the same level as your EIFGEN directory in a directory called `Documentation'.
  • dynamic_runtime (yes | no): enables the use of a shared library version of the runtime on both Windows (DLL) and Unix platforms (.so) that supports shared libraries.
  • exception_trace (yes | no): it is a finalization option only. It enables you to see a complete exception trace when your finalized application is crashing. Because it is adding some code to remember where the application was during the crash it can slow down the performance of your application by a factor of 5% to 30% depending of your platform.
  • inlining (yes | no): it is a finalization option only. It enables to inline functions that can be inlined (see `inlining_size' below). The ISE Eiffel inlining is very powerful since it can inline a function in all your Eiffel code, without scope limitation as in C or C++ compilers.
  • inlining_size ("value"): it is a finalization option only, used in conjunction with the inlining option. It enables to specify the size under which the compiler may inline a function. The value given in parameter corresponds to the number of instructions as the Eiffel compiler sees them (for example a := b.f corresponds to 2 instructions for the Eiffel compiler).
  • line_generation (yes | no): enables the generation of C pragmas `#line x' in the C generated code. This option is mostly used by embedded Eiffel developers who could not run the ISE EiffelStudio environment on their target platform.
  • multithreaded (yes | no): enables the generation of a multithreaded application. This option cannot be changed during the development of your project and has to be set correctly at the first compilation of your system.
  • override_cluster (cluster_name): enables you to specify a certain `cluster_name' as override cluster. As a result, all classes in `cluster_name' will override the classes with the same names located in other clusters. Very useful when used in conjunction with configuration management tools.
  • profile (yes | no): enables the Eiffel profiling (to know more about Eiffel profiling click here).
  • shared_library_definition ("file_name.def"): enables you to specify `file_name.def' as file where the Eiffel compiler will look when trying to generate the exported function of the shared library you are developing. To have more information concerning definition files, see the Dynamic library builder reference.
  • precompiled ("precompiled_library_path"): enables you to specify a precompiled library. Most examples given in the ISE EiffelStudio delivery are using a precompiled library. It makes the development of small application incredibly fast.

External options

  • include_path: enables you to specify the path to the header files you are using in external clauses of your Eiffel based source code.
  • object: enables you to link your application with specified object files.

See also:
External features

Keywords

adapt | all | assertion | c | check | cluster
colon | comma | creation | debug | default | end
ensure | exclude | executable | export | external | generate
identifier | ignore | include | include_path | invariant | loop
make | no | object | optimize | option | precompiled
rename | require | root | system | trace | use
visible | yes |  |  |  |

Introduced with ISE EiffelBench 4.5 the keyword `all' can appear before the name of a cluster. This new keyword is now used in most Ace files given with your distribution. One example can be found above and it is reproduced below with some explanations:

    -- EiffelBase
all base: "$ISE_EIFFEL\library\base"
    exclude
        "table_eiffel3"
    end

The meaning of `all' is to take into account all Eiffel files located below the directory pointed by the `base' cluster. In addition, the example above uses `exclude' to make sure that the directory called `table_eiffel3' and its descendants won't be traversed. This is very useful when you have two clusters which are used through a switch in your Ace file.


EiffelStudio Debugger

  • Introduction
  • Execution commands
  • Breakpoint management
  • Call stack information
  • Object state information
  • Dynamic evaluation of expressions
  • Stack overflow prevention


Introduction

A debugger is a tool that allows you to run an application and view its state at any moment. This includes having information concerning the current call stack and the state of objects of the system, ie the values of their attributes. This kind of information can be used to spot objects that have invalid states, to see the consequences of the execution of a feature over an object state, and so on.

The features of the EiffelStudio debugger include:

  • Stopping the application in frozen features as well as in melted features
  • Stepping into features, executing them one line at a time, or stepping out of them
  • Setting breakpoints on-the-fly, while the execution is running

And from 5.2 onwards, the following functionality is also available:

  • Dynamic evaluation of expressions
  • Conditional breakpoints
  • Stack overflow prevention
  • Classes can implement the debug_output interface and have their objects display a string in the debugger


Execution commands

  • Introduction
  • Run and debug
  • Run with arguments
  • Run regardless of breakpoints
  • Run a finalized executable
  • Step into a feature
  • Execute an instruction line
  • Step out of a feature
  • Pause the execution
  • Kill the debugged application


Introduction

While working on a project, you may want to launch it to see if it behaves as expected, and if not to find out where the problem is located.

There are several ways to launch the application you are working on from EiffelStudio:

  • Run a finalized executable, where no debug is possible.
  • Launch an application and enable its debugging
    • Launch and stop as soon as the application encounters a breakpoint
    • Launch and do not stop when encountering breakpoints
  • Execute one step in the application
    • Enter a feature
    • Execute one line
    • Exit a feature

Once the application is launched in debug mode, you can stop it at any time to see its current state or you can kill it completely.

All these commands are accessible either through the debug menu, or through the project toolbar.

Note: Debugging a .NET compiled system within Eiffel Studio is not currently possible. Consequently for a system compiled using .NET the debugging toolbar buttons will not be enabled. Only the 'Launch' and 'Launch and stop at breakpoints' are available.

See Also
Compiling a project


Run and stop at breakpoints

This command launches an application compiled in WorkBench mode. The application will stop as soon as a breakpoint is encountered, or when an exception occurs.

It is accessible through the project toolbar ( [image] ) or through the debug menu.

See Also
Execution commands
Compiling in Workbench mode


Run with arguments

Running with arguments

While working on a project, you may want to launch it with one or more arguments.

There are two ways to specify arguments for a program from EiffelStudio:

  • From the Debug tab in the Project Settings window.
  • By right-clicking any of the buttons on the debugging toolbar and using the argument dialog.

Using the Argument Dialog

By right-clicking any of the debugging buttons in the debugging toolbar the following argument dialog will be displayed.

The dialog allows you to change the current working directory of the system, and to specify arguments to be passed to the system at execution time. New Program arguments may be added to the system and current ones can be removed or edited.

There are two tabs provided, Project Arguments and My Arguments. Project Arguments denotes all arguments in the system Ace file. Any changes performed in this tab will thus affect the contents of the Ace file. My Arguments denotes arguments for the current compilation. Since these arguments are compilation specific they are stored in a separate file and do not affect the system Ace file in any way. The main advantage of using this distinction is that it allows developers to specify their own custom arguments without affecting the Ace file. If the Ace file is shared between a number of developers then it need not be affected. Hence the argument dialog gives both project-level and user-level argument control.

To add a new argument simply type the argument in the Current Argument text area and click the Add button.

To remove an existing argument select the argument you wish to remove in either the drop-down list box or in the list and click Remove.

To edit an argument select the argument you wish to edit in the list and double-click it. This will display an editable text field in-place of the argument. Once done editing just click outside the list box. The picture below shows in-place editing of an argument.

Once the appropriate argument is selected then the system can be run with this argument using the Run or Run & Close button. The latter runs the system and also closes the argument dialog. To run without any arguments uncheck the Enable Arguments check box.


Run without breakpoints

This command launches an application compiled in Workbench mode. The application will not stop when a breakpoint is encountered. However, it stops when an exception occurs.

It is accessible through the project toolbar ( [image] ) or through the debug menu.

See Also
Execution commands
Compiling in Workbench mode


Run a finalized executable

As opposed to other execution commands, this command launches an application compiled in finalized mode. This has the same effect as running the application in the EIFGEN/F_code directory from a console prompt.

No debugging is possible with this command, but it lets you test the real speed of your program without any overhead.

It is accessible through the project toolbar ( [image] ) or through the project menu.

See Also
Execution commands
Compiling in finalized mode


Step into a feature

If no application was already running, this command launches an application compiled in WorkBench mode and stops at its first line.

If an application was stopped, it attempts to enter the feature located on the execution line where the application is stopped. If this feature is an attribute, or another non debuggable feature, it simply executes the current execution line and stops at the next one.

It is accessible through the project toolbar ( [image] ) or through the debug menu.

See Also
Execution commands
Compiling in Workbench mode


Execute one line at a time

If no application was already running, this command launches an application compiled in WorkBench mode and stops at its first line.

If an application was stopped, it attempts to execute the instruction located on the execution line where the application is stopped. If this execution line does not contain an instruction, the execution stops at the next execution line.

It is accessible through the project toolbar ( [image] ) or through the debug menu.

See Also
Execution commands

Compiling in Workbench mode


Step out of a feature

If no application was already running, this command launches an application compiled in WorkBench mode and stops at its first line.

If an application was stopped, it attempts to exit the feature where the application is stopped.

It is accessible through the project toolbar ( [image] ) or through the debug menu.

See Also
Execution commands
Compiling in Workbench mode


Pause an application

This command stops the execution of a running debugged application.

This gives access to dynamic information concerning the application, such as the current call stack and the state of objects in the system.

It is accessible through the project toolbar ( [image] ) or through the debug menu.

See Also
Execution commands


Kill a debugged application

This command kills the debugged application, if any. This stops the debugging session.

It is accessible through the project toolbar ( [image] ) or through the debug menu.

See Also
Execution commands


Breakpoints

  • Introduction
  • Breakpoint menu
  • Breakpoint commands
  • Breakpoint information command
  • Conditional breakpoints


Introduction

Breakpoints are entities that stop a debugged application. Breakpoints can be put at the beginning of each execution line, so that it is possible to see the context in which the line is executed before executing it.

In EiffelStudio, breakpoints are represented as circles in the left margin of flat views (both feature flat view and class flat view). Breakpoints can be in three different states: enabled ( [image] ), disabled ( [image] ), or not set ( [image] ). Only enabled breakpoints will stop the application when they are encountered. By default, breakpoints are not set. Disabled breakpoints are useful to temporarily discard a breakpoint, while keeping the possibility to put it back quickly. Enabled and disabled breakpoints can have an associated an associated condition. They are then shown as [image] and [image].

Left-clicking on a breakpoint in a flat view changes the state of the breakpoint: it switches from not set to enabled, from enabled to not set, and from disabled to enabled. Removing a conditional breakpoint discards its condition.

The breakpoint menu lets you change the state of one breakpoint, whereas the breakpoint commands let you change the state of several breakpoints at a time. The breakpoint information command shows the state of all set breakpoints.

Note: Breakpoints cannot be set in all features. In particular, breakpoints cannot be set in external features or attributes.
However, breakpoints can now be set in assertions (require and ensure).

Tip: Under Windows, breakpoints can be set on-the-fly while the application is running.


Breakpoint menu

In all flat views (feature flat view and class flat view), a margin is displayed on the left of the editor. Breakpoints are there symbolized as circles, of a different appearance depending on their state: enabled ( [image] ), disabled ( [image] ) or not set ( [image] ). A small question mark in the circle ( [image], [image] )indicates conditional breakpoints.

Right-clicking on any breakpoint pops up a context menu:

Clicking one of the three first entries of the context menu changes the state of the breakpoint that was right-clicked. The last entry (Run to breakpoint) launches the debugged application so that it will stop as soon as the selected breakpoint is encountered, as if the breakpoint had been enabled.

See Also
Breakpoints commands
Breakpoint information command


Breakpoint commands

Located in the debug menu and the project toolbar, these three commands allow to change the state of set breakpoints in the system.

Enable breakpoints ( [image] ), disable breakpoints ( [image] ) and remove breakpoints ( [image] ) have all global and local actions. Left-clicking on them has a global action: all set breakpoints of the system will be respectively enabled, disabled, or discarded. However, it is also possible to drop a feature or a class onto them, in which case only set breakpoints of the feature/class will be affected.

Note that these commands work only on set breakpoints (that is, enabled or disabled breakpoints). Therefore, discarded breakpoints cannot be set again thanks to these commands.


Breakpoint information command

The breakpoint information command, located in the debug menu and in the project toolbar ( [image] ), displays the list of all set breakpoints in the system (enabled or disabled).

See Also
Breakpoints commands
Breakpoint information command


Breakpoint menu

Conditional breakpoints

A condition breakpoint is a breakpoint in which debugger will stop if a certain condition is met. To set a conditional breakpoint use the breakpoint menu and choose `Set conditional breakpoint':

Once done a dialog pops up where you can enter a condition:

The condition is a Boolean expression that follows the same rule as the expression you can enter in the expression evaluation tool.

See Also
Breakpoint menu
Breakpoints commands
Breakpoint information command
Expression evaluation tool


Call stack tool

  • Introduction
  • Call stack tool
  • Information about the current stack level
  • Supported exceptions
  • Save call stack command


Introduction

The call stack is the list of features that have been entered and not exited since the program started. It is a stack since before a feature exits, all the features it calls must exit too. The last entered feature is the top of the stack whereas the program root feature is its bottom.

There is one level in the call stack, apart from the top, that has a special status and corresponds to a special call stack element. It is the level to which all debugging tools refer. It is user-definable, so that it is possible to move along the call stack and have information about any level, by setting each level as the current call stack level in its turn.

To keep trace of a call stack (for example in order to indicate to other people where a problem occurred), it is possible to save the call stack to a text file.

Information concerning the call stack is spread over several graphical components:

  • Information concerning the call stack in its globality is displayed in the call stack tool.
  • Information concerning the current call stack element is displayed in the feature tab and the locals view.


Call stack tool

The call stack tool gives information about the current call stack of a debugged application.

It is mainly composed of a list representing the call stack elements, where the entry feature of the program is at the bottom and the top of the call stack is at the top. The current call stack element, to which the other debug tools refer, is represented by a green arrow. Clicking on a call stack element, or picking it and dropping it onto either the call stack list or the locals view defines it as being the current call stack element. For each feature in the call stack, its name, its dynamic class and its static class are displayed. An asterisk next to the name of a feature means the feature is melted, as opposed to frozen. The dynamic class is the type of the object upon which the feature is called, whereas the static class is the class in which the feature was written.

On top of this list, a line gives the state of the debugged application, and another one describes the exception that caused the application to stop, if any. For more information concerning exceptions, see the supported exceptions.

In the toolbar, the button gives the possibility to save the call stack to a text file. The [image] button makes it possible to choose which call stack depth should be displayed in the list (the default is to display the 100 top stack elements, but it is configurable with the same button).


Information relative to a stack element

In addition to the call stack tool that provides information concerning the call stack in its globality, some other debug tools give information concerning the current call stack element.

In debug mode, the context tool is automatically switched to the feature tab in flat view, and displays the feature which corresponds to the current call stack element. In the left margin, a yellow arrow ( [image] ) marks the execution line where the program is currently stopped, whereas a green arrow ( [image] ) indicates the execution line that was attained in the feature in the current call stack element. Therefore, if a feature is recursive, and appears several times in the call stack, changing the current call stack element may cause green arrows to be displayed at different places in the same feature (if the different calls did not reach the same execution point). On the other hand, the yellow arrow can only appear at one place as long as the application is not started again.

The left part of the object tool gives valuable information concerning parameters that were passed to the feature corresponding to the current call stack, the current value of the local variables, and, if it is a function, the current value of its result.


Supported exceptions

Here is a list of exceptions that may appear in the call stack tool. When they are raised, a tag may be there to give more information, if necessary. All these exceptions are declared in EXCEPT_CONST.

Feature call on Void target: An attempt was made to call a feature on an object that is Void. The tag indicates the name of the feature of the feature that could not be called. For instance if the code line is a.b.c and the tag is "c" then a.b was Void.

No more memory: A memory allocation failed.

Precondition violated: One of the conditions necessary prior to entering a feature is not verified. This may indicate either that the precondition is too strong, or that the call is invalid. The tag should give the name of the violated precondition, if any.

Postcondition violated: One of the conditions checked when a feature exits is not verified. This may indicate either that the postcondition is too strong, or that the feature did not behave correctly. The tag should give the name of the violated postcondition, if any.

Class invariant violated: One of the conditions that checks the validity of objects is not verified. This may indicate that an object was left in an invalid state after a method call. The tag should give the name of the violated invariant, if any.

Assertion violated: An assertion was not verified. The tag should give the name of the violated assertion, if any.

Non-decreasing loop variant: A loop variant does not vary. This may lead to stack overflows or erroneous results.

Loop invariant violated: A condition that should be checked when executing a loop is not verified. The tag should give the name of the violated invariant.

Floating point exception (signal SIGFPE): An error occured while processing floating point numbers. This may be for example a FPU overflow, a division by zero, or an invalid operation.

Unmatched inspect value: An inspect clause couldn't find the value it was passed among the `when' clauses. If any value may be passed to the `when' clause, adding an `else' clause will solve this problem.

I/O error: An error occurred while accessing a stream. Examples of this are a missing file, or insufficient rights.

Retrieval error: A file could not be retrieved. This may be caused by an invalid header, or more generally by a corrupted data file.

Developer exception: Developer exceptions can be raised by calling {EXCEPTIONS}.raise. They can indicate any kind of internal error.

Operating system signal: The program received a signal from the operating system.

Exception in rescue clause: An exception occurred within a rescue clause.

Void assigned to expanded: An attempt was made to assign a Void value to an expanded object.

Run-time I/O error: Exception raised by the run-time when encountering a I/O error internally.

External event: On Unix, this happens when an operating system error occurs and does not set the `errno' variable.

Operatig system error: On Unix, this happens when an operating system error occurs and sets the `errno' variable.

COM error: Raised when EiffelCOM encounters an error.


Save call stack

It is now possible to save the current call stack to a text file. This may be useful to indicate to other people of a team where an error occurred. After the button is clicked, a dialog is popped up that prompts for a place where to save the call stack (if the selected file already exists, it is overwritten).


Object tool

  • Introduction
  • Local view
  • Object view
  • Attribute symbols
  • Debug output
  • Set slice size command
  • Remove object command


Introduction

The object tool is a debugging tool that displays extended dynamic information concerning one or several objects while debugging an application. This information includes the value of all their attributes, as well as the values of the once functions that have already been called.

It is mainly composed of two trees, the local view and the object view. In the toolbar are located two commands that facilitate browsing the trees: the remove object command [image] and the set slice size command [image]. The third command [image] can give an expanded display of the string relative to an object, by dropping the object onto the button. Use it if an object has a very long string representation or a string representation that contains carriage returns, for example.


Local view

The first tree in the object tool gives information about the current stack element. Namely, it provides the current value of the parameters that were passed to the corresponding feature, the value of the local variables, as well as the value of the Result, if this feature is a function.

All objects can be expanded to see the value of their attributes. They are also pickable, so that it is possible to drop them onto the object view or an editor. It is also possible to use the set slice size command with SPECIAL objects.


Object view

The second tree in the object tool gives information about objects. By default, the first object in the object view is the object corresponding to the current stack element. However, it is possible to drop any object onto the object view to manage it. Whereas the object corresponding to the current stack element may change each time the application is stopped, objects that were manually added to the object view are kept. They are only discarded when the application exits, or when the remove object command is used.

All objects can be expanded to see the value of their attributes. They are also pickable, so that it is possible to drop them onto an editor, to inspect the class the object belongs to. It is also possible to use the set slice size command with SPECIAL objects.


Attribute symbols

In both trees of the object tool, objects are displayed. Two categories are made for each objects: its attributes (grouped under the `attributes' folder [image] ) and its once routines (grouped under the `once routines' folder [image] ).

All follow the following symbol scheme to describe the kind of each item:

  • An attribute of a basic type, such as INTEGER, DOUBLE,...
  • An attribute that is a reference to an object
  • A Void reference
  • An object that is expanded


Debug output

In both trees of the object tool, objects are displayed. For virtually all objects, it is possible to display a user-definable string value next to the object address.

To do so, inherit from the class DEBUG_OUTPUT in the classes that should let their objects display a string value, and implement the `debug_output' feature. At run-time, the debugger will automatically query the result of this feature on all objects that define it and display it in the object tool and the evaluation tool.

Sample: The NUMERIC class inherits from the DEBUG_OUTPUT one so that it is possible to see the value of *_REF objects without expanding them.

Tip: If an object has a long string output or an output with carriage returns, for instance, pick-and-drop it to the expanded display command [image] in the object tool.


Set slice size command

Located in the object tool toolbar, this command [image] changes the display size of special objects (ie objects whose class is SPECIAL). Since special objects may contain thousands of attributes, only the 50 first are displayed by default. If left-clicked, a dialog is popped up that sets the exploration indices of special objects that will be loaded in the future.

This dialog changes the settings for future special objects:

If a special object is dropped onto this command, the special object that is dropped is shrunk or extended in the tree according to the new exploration indices it is given in the dialog box. The dropped object may be any object, top-level or not.

This dialog changes the settings for a single special object:


Remove object command

Located in the object tool toolbar, this command [image] discards an object from the object view. All top-level objects can be removed, except the first one, which is the object relative to the current call stack element.

Left-clicking on this button removes the selected object from the object view, if possible. It is also possible to drop an object onto the button to remove the object.


Expression evaluation

  • Introduction
  • Evaluation tool
  • New expression dialog


Introduction

The expression evaluation tool makes it possible to evaluate expressions while the application is stopped. A typical use for it is if you would like to know the result an external feature would return. Since you do not have access to the C memory of the application, doing this is impossible. You may also want to know the result of an Eiffel feature whose body is too complex for you to evaluate.

In these cases (and any other that suits you), you should use the dynamic expression evaluation. Simply define the expression and its result will be immediately available in the list of expressions.

Caution: During the evaluation of an expression, all features that are necessary to obtain the result are called. Therefore, you should avoid calling queries that have side-effects, since doing so may alter the program execution. The Eiffel methodology recommends not to define side-effects queries anyway.


Evaluation tool

The expression evaluation tool's main part is the list of expressions that should be evaluated.

Its first column gives the context in which the expression is evaluated. Its second column gives the expression itself, as it was entered by the user. The last column gives the result of the expression.

Tip: If the expression returns a non-Void object, then the corresponding row in the list is pickable, and can be dropped for example in the object tool to inspect its state.

On top of the list, three buttons can be found.

  • pops up the expression definition dialog, and can be used to define new expressions.
  • edits a currently selected expression (it is not possible to change the context of an expression, only the expression itself).
    The associated key shortcut is F2.
  • removes the selected expressions from the list.
    The associated key shortcut is Del.

Tip: Dropping an object onto this list lets you define quickly an expression whose context is the dropped object. This avoids having to type object addresses manually.


New expression dialog

Adding new expressions to the list of expressions that should be dynamically evaluated is performed via a dialog.

The first part in the dialog makes it possible to select the context of the expression. The default context is the context of the currently selected call stack element. This context gives access to the locals, the arguments, the result and the englobing object features. The object context, that requires a valid object address, gives access to the features of the selected object. The last context, the class-related context, gives access to the once and constants features of that class. It requires a valid class name.

The second part prompts for the expression itself. This field supports arguments, dot calls and operators (to a certain extent), but does not support creation expressions, agents or static calls (as in "feature {MY_CLASS}.my_feature"). Genericity is partially supported. Despite these limitations, we believe the expression evaluation tool should provide you with a lot of useful functionality.


Stack overflow prevention

Accessible via the Debug/Overflow prevention... menu, this command makes it possible to detect stack overflows before they occur. Selecting it pops up a dialog that lets you decide at which call stack depth a warning should be issued.

By default a warning is issued when the debugged program reaches a stack depth of 1,000 elements.

Note: Once an application has stopped at the selected level, it will not stop again until its stack depth goes below the critical stack depth again.


Diagram tool

  • Introduction
  • Notation
  • Diagram toolbar
  • Views
  • Contexts
  • Code generation


Introduction

The Diagram Tool of EiffelStudio is your graphical interface to system structures. You can use it both to examine systems already built or under development, and to build these systems graphically. EiffelStudio supports complete seamlessness and reversibility between the Diagram Tool's graphical view and the text view of other EiffelStudio tools: whenever you make a change or addition with the graphical tool, EiffelStudio will update the text; and when you change the text, EiffelStudio will update the Diagram Tool's representation on the next compilation.

Use the diagram tool to design new Eiffel systems, or create BON (Business Object Notation) diagrams of existing ones. BON is a simple, clear, self-explanatory notation that you will learn in a few minutes just by looking at some examples. The Diagram Tool provides you with lots of features to manage different views of an Eiffel system, or parts of it.


Notation

The diagram tool uses the BON (Business Object Notation) to represent Eiffel systems. This article will give a summary of all components of an eiffelstudio diagram. For detailed information on BON, please read Seamless Object-Oriented Software Architecture by Kim Waldén and Jean-Marc Nerson, Prentice Hall 1994.

Class

An object class is represented by an ellipse (sometimes referred to as bubble). It contains the class name and formal generics of the Eiffel class it represents. Second, it displays information about properties of a class. These properties are:

  • Deferred: class is declared as deferred.

  • Effective: class is not deferred and has at least one deferred parent, or redefines one ore more features.

  • Persistent: class inherits STORABLE or has indexing tag persistent.

  • Interfaced: class has one ore more external features.

  • Reused: class resides in a precompiled library or in a library cluster.

  • Root class: class has the program's entry point.

See also: Changing class names and formal generics

Cluster

A cluster is a collection of classes and subclusters. It is represented by a stippled, rounded rectangle. The cluster name is in a similar rectangle, by default located at the top of the cluster just outside of it. A cluster can be iconified, which means it is minimized to take up as less space as possible.

See also: Iconifying a cluster

Inheritance links

Inheritance between classes is represented by a red arrow from a class to its parent. Typically, inheritance links point upwards.

See also: Creating inheritance links

Client/supplier links

Client relationships between classes are represented by a blue arrow with a double line from the client to the supplier. Typically, these links point to the right. A special kind of relationship is the aggregate client/supplier link. Aggregate means that the supplier is an integral part of the client. In the class text, it corresponds to expanded features. In the diagram, an aggregate link has a little line along the back side of the arrow.

See also: Creating client/supplier links


Diagram toolbar

The customizable toolbar of the diagram tool can contain these buttons:

  • Target to cluster or class
    Drop a class or a cluster on this icon to build the corresponding diagram.
  • Target to enclosing cluster
    Recenters the diagram on the parent cluster.
  • Create a new class
    Pick from this button and drop on the diagram to add a new class.
  • Create new inheritance links
    Selecting this button allows you to create inheritance links by picking from one class and dropping on the other.
  • Create new client-supplier links
    Selecting this button allows you to create client-supplier links by picking from one class and dropping on the other.
  • Create new aggregate client-supplier links
    Selecting this button allows you to create aggregate client-supplier links by picking from one class and dropping on the other.
  • Delete
    Drop items in this hole to remove them from the system.
  • Undo last action
    Click to undo the last action.
  • History tool
    Click to open the History tool.
  • Redo last action
    Click to redo the last undone action.
  • Remove figure
    Drop figures in this hole that you want to remove from the view only.
  • Change color
    Drop class bubbles in this hole to change their color.
  • Change class name and generics
    Drop class bubbles in this hole if you want to change a name and/or formal generics.
  • Put handles on a link
    Click on this button to toggle right angles on all links in the view. Drop a link on it to bring up the link tool for that link.
  • Select depth of relations
    Click to bring up the Select depth dialog.
  • Include all classes of cluster
    Drop a cluster in this hole to show all classes of the cluster in this view.
  • Zoom in
    Enlarge the diagram.
  • Zoom out
    Shrink the diagram.
  • Show/hide client-supplier links
    Toggle visibility of all client-supplier links in the view.
  • Show/hide inheritance links
    Toggle visibility of all inheritance links in the view.
  • Show/hide labels
    Toggle visibility of all client link labels in the view.
  • Delete current view
    Click to remove the current view from the list of views for current class or cluster.
  • Export diagram to PNG
    Click to generate a .PNG file from current view.


Views

Every class or cluster has one or more view. Every view shows the context of a class or cluster, a subset of the Eiffel system. For example, for a certain cluster, you can show only the hierarchy of the classes in it, but you could have a second view that shows only a couple of classes in it, but with all relations between them.

The view combobox, as seen in the image above, can be used to add a view or switch to a previously added one. Every class and cluster has a view "DEFAULT" that is generated automatically. If you create a new view and move for example a class around in it, the "DEFAULT" view is unaffected.

The case tool provides you with the following possibilities to manipulate views:

  • Adding a view
  • Deleting a view
  • Showing or hiding client/supplier links
  • Showing or hiding inheritance links
  • Showing or hiding link labels
  • Removing items from a view
  • Changing colors of objects
  • Using the link tool
  • Changing system exploration depth of objects
  • Retrieving all classes into a cluster
  • Minimizing a cluster
  • Restoring a cluster from minimized state


Contexts

A diagram in the diagram tool is always the context of a certain class or cluster. Context means the direct relations up to a certain depth.

For clusters, the relations are:

  • subclusters
  • superclusters
The image below shows the cluster base.event with the relation depth for superclusters 1 and subclusters zero.

The relations for classes are:

  • ancestors
  • descendants
  • clients
  • suppliers
This is an example of the class LIST, with ancestor depth 2, descendant depth 2 and both client and supplier depth zero.


Code generation

All actions taken in the diagram tool that modify a part of the system are immediately reflected in the Eiffel system. Following is a summary of these actions.

  • When you create a new class, this is the generated empty class:
    indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/10/30 02:45:21 $"
    revision: "$Revision: 1.2 $"

class
    CLASS_NAME

end -- class CLASS_NAME
  • When you delete a class, the class file is removed from the disk.
  • When you add a parent to a class, the parent is inserted in the existing inheritance clause, without any additional (undefine/select/etc.) clauses to solve possible conflicts.
    indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/10/30 02:45:21 $"
    revision: "$Revision: 1.2 $"

class
    CLASS_NAME

inherit
    NEW_PARENT

end -- class CLASS_NAME
  • When removing an inheritance link, the entire parent clause is removed, i.e. including any redefine/undefine/etc. until the matching end.
  • When creating a client link, a function or attribute is generated by the feature wizard. When creating a function, this code is generated:
    indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/10/30 02:45:21 $"
    revision: "$Revision: 1.2 $"

class
    CLASS_NAME

feature -- Access

    f: TYPE is
            -- Client from CLASS_NAME to TYPE.
        do
        end

end -- class CLASS_NAME
  • If you choose to create an attribute for the client link, and optionally specify to generate a set-procedure and an invariant, the following code will be pasted into the class text:
    indexing
    description: "Objects that ..."
    author: ""
    date: "$Date: 2001/10/30 02:45:21 $"
    revision: "$Revision: 1.2 $"

class
    CLASS_NAME

feature -- Access

    f: TYPE
            -- Client from CLASS_NAME to TYPE.

feature -- Element change

    set_f (a_f: TYPE) is
            -- Assign `a_f' to `f'.
        require
            a_f_not_void: a_f /= Void
        do
            f := a_f
        ensure
            f_assigned: f = a_f
        end

invariant
    f_not_void: f /= Void

end -- class CLASS_NAME
  • When removing a client link, only the matching function or attribute is removed. Any additionally generated set-feature or invariant is not removed.
  • When removing a cluster, the associated directory is not erased, but the reference to the cluster is removed from the Ace file. At this time, it is not possible to create a cluster using the diagram tool, only to remove one.


Metric tool

  • Introduction
  • Requirements
  • Definitions
  • User interface basics
  • Metric toolbar


Introduction

One of the innovations of the new ISE Eiffel 5 environment is a set of metric facilities enabling developers and managers to obtain quantitative information about software systems and the process of producing them.

  • Find out basic quantitative properties of a system, such as the number of classes, the number of features, how many times the system has been compiled and many others.

  • Define new properties as mathematical combinations of the basic ones, and compute the resulting values, to get the answers to such questions as what percentage of my system’s routines have precondition clauses? or what is the average number of features, lines, or invariant clauses per class?

  • Vary the scope of such measurements, so that the measured result may cover a single feature, a class, a cluster, an entire system or an archive of another system to make comparisons with other projects.

  • Compare the result of the same metric over several of these scopes, to see for example how a project differs from those on record, or whether some parts of a project depart from the norms applied in others.

The environment will support such measurements through a simple graphical interface, closely integrated with the rest of the Eiffel Explorer. Users of the environment can start applying these facilities to their systems without learning any theory.

Metrics, however, are notoriously subject to abuse; we must be wary of the temptation to revere numbers just because they are numbers (lies, damn lies and metrics). This note presents a simple approach to software metrics designed to establish a clear and sound basis, so that we know what we are measuring, why we are measuring it, and how much value we may attach to the results.

  • Requirements
  • Definitions
  • User interface basics


Requirements

All engineering disciplines other than software rely on quantitative approaches to design their products, organize the production process, and assess the results. Software engineering too can benefit from measuring relevant properties of its products and processes.

Measurements are not an end in themselves; they must be related to broader goals of software engineering:

Purpose of software measurements:
The purpose of software measurements is to provide quantitative assessments or predictions of properties of software products and processes

For any numerical measure that we propose we must have precise information on four properties: coverage, trustworthiness, relevance, theory.

Desirable features of software measurements:
Any quantitative report on software products or processes should satisfy the following properties:
- Coverage: include a definition of what is being measured, sufficient to enable repetition of the measurements.
- Trustworthiness: include an estimate of how much the results can be believed, in particular of their precision (expected variations in case of repetition).
- Relevance: specify interesting properties of software products or processes on which the measurement may provide insight.
- Theory: include arguments backing the statement of relevance.


Definitions

  • Introduction
  • Attributes, metrics and measures
  • Units
  • Metric frame work, metric theory
  • Elementary and composite metrics
  • Raw metrics and selection criteria
  • Predefined raw metrics and selection criteria
  • Scopes, scope types
  • Basic scope type
  • Measurement archive


Definitions

The metric tool needs a consistent metric theory to rely on. Indeed, metrics are notoriously subject to abuse and we must be really accurate when defining metrics and related notions.

This section introduces a set of definitions essential to handle the metric tool.

  • Attributes, metrics and measures
  • Units
  • Metric frame work theory
  • Elementary and composite metrics
  • Raw metrics and selection criteria
  • Predefined raw metrics and predefined selection criteria
  • Scopes and scope types
  • Basic scope type
  • Measurement archive


Attributes, metrics and measures

The most general notion is “attribute”:

Attribute: An attribute is a property, qualitative or quantitative, of software products or processes.

We may distinguish between the product and process cases:

Product attribute, process attribute: A product attribute is an attribute that characterizes a software product or set of products. A process attribute is an attribute that characterizes a software-related process, such as development, maintenance, documentation, management, or multiple instances of such a process.

Examples of attributes include reliability (a product attribute, non-quantitative) and total project cost (process, quantitative).

A metric is simply a quantitative attribute:

Metric: A metric is an attribute whose values are numbers (integers or reals), expressed relative to a certain unit specified as part of the metric definition.

Examples of metrics include the number of source lines of a program (product) and the total cost of a project (process).

The metric tool provides by default a set of metrics, they are available in the following metric menu:

Attributes other than metrics will be called “qualitative”:

Qualitative attribute: A qualitative attribute is an attribute other than a metric.

An example of qualitative attribute is the reliability of a software product.

The “process” vs. “product” distinction carries over to metrics:

Product metric, process metric: A metric is a product metric if it is a product attribute, a process metric if it is a process attribute.

“Relevance”, as defined in the previous section, suggests that the purpose of metrics is to help us gain information about attributes that are of direct interest to us. Often these will be qualitative; for example we may want to estimate the reliability of our software. Metrics provide us with numerical values that can serve to assess or predict such attributes.

Applying a metric will give us measures:

Measure: A measure is the value of a metric for a certain process or product.


Units

Metrics will be expressed in units, such as LINE (numbers of source lines) or FEATURE (number of features). Metrics units appear in a provided text field in the metric tool:

Unit rule: The definition of any metric must specify an associated unit.

Different metrics may be marked with the same unit; for example metrics such as number of non-comment lines and number of comment lines may both be marked with the unit LINE.

Whenever we need to express ratios of one measurement to another, as in computing the average number of features per class by dividing the number of features by the number of classes, we will use a specific unit, RATIO:

“Ratio” unit: The name RATIO denotes a predefined unit, whose values are arbitrary real numbers, expressed either as numbers or in percentage style (as in 35.3%).

As a result of this choice, we will consider every division to yield a result of unit, RATIO.

The following predefined units are available in the metric tool:

Unit | Quantities measured | Kind
CLASS | Number of classes or types | Product
CLUSTER | Number of clusters (groups of classes) | Product
COMPILATION | Number of compilations | Process
CONTRACT_CLAUSE | Number of assertion clauses | Product
LOCAL | Number of entities local to a routine (local variables, formal arguments) | Product
FEATURE | Number of features | Product
LINE | Number of source lines | Product
RATIO | Results of divisions | Product

The units listed here are minimal in the sense that it is not possible to add the properties measured by any two of them; for example it makes no sense to add a number of features to a number of classes.

In the future, it might be desirable to include more specific units, such as “features per class”, and an associated calculus of units (as in the physical sciences, where multiplying a quantity expressed in g /cm by one in cm yields a result in g). This has not appeared necessary for the typical uses of division envisioned in this note, answering such questions as “What percentage of routines have a header comment?” and all expressed as simply as RATIO.


Metric framework and theory

You will want to rely not on a single metric but on a combination of metrics:

Metric framework: A metric framework is a set of definitions of metrics.

Any metric work should be backed by a theory:

Metric theory: A metric theory is a combination of:
- A metric framework
- A set of definitions of attributes (qualitative or quantitative)
- A mapping from the framework to the set of attributes, representing the hypothesis that each metric is a good predictor of the associated attribute

This note does not introduce a metric theory, but defines a metric framework by introducing a number of metrics.

See Also
Attributes, metrics and measures


Elementary and composite metrics

Some of our metrics will be elementary and some composite. An elementary metric is measured directly from the product or project record:

Elementary metric:
 - An elementary product metric is a product metric whose values (integers) indicate the number of occurrences of a certain pattern in a product.
- An elementary process metric is a process metric whose values reflect measurements drawn directly from project records.

An example of elementary product metric is the number of source lines. An example of elementary process metric is the number of incremental compilations of a system.

Elementary metrics are provided by default by the metric tool. There is no means to remove them or to define new ones since they are not expressed as a combination of other metrics.

From these elementary metrics we may define composite ones:

Composite metric: A composite metric is a metric whose values are defined by a mathematical formula involving other metrics (elementary, or previously defined composite metrics).

A later section will introduce a number of operations for defining composite metrics out of elementary ones.

Again we may distinguish between product and process:

Composite product metric, composite process metric:
- A composite product metric is a composite metric defined entirely in terms of product metrics.
- A composite process metric is a composite metric whose definition involves one or more process metrics.

By convention, this definition treats as process metric a composite metric involving both product and process components.

The classification introduced for metrics extends to measures, so that we may talk about an elementary product measure, a composite process measure and so on.

The metric menu of the metric tool separates elementary and composite metrics:

All metrics (elementary and composite) are not always sensitive. Their sensitiveness also depends on scopes

See Also
Metrics, scopes


Raw metrics and selection criteria

Elementary metrics measure patterns whose occurrences (in a product or process) can be counted. We need to decompose this notion further to avoid an explosion of the number of elementary metrics. For example the features of a class can be classified along several lines:

  • Some are attributes (object fields), others are routines (algorithms).

  • Some are inherited from a parent, others immediate (defined in the class).

  • Some are exported, others secret

and so on. Many combinations of these properties may be worth counting on their own: you may ask for the number of secret attributes, of exported inherited features and so on. But if we define all of these metrics independently, we will soon have too many elementary metrics, while still failing to satisfy user needs if we have omitted a particular combination.

To avoid this we must identify a subset of elementary metrics as raw metrics: metrics whose results are counted directly. “Number of features in a class” is a raw metric. From a raw metric, we may then derive other elementary metrics by applying selection criteria such as “Is this feature an attribute?” or “Is this feature exported?” Here are the definitions:

Raw metric, selection criterion, derived metric:
An elementary metric is either raw or derived. A selection criterion for a raw metric is a property, with a fixed set of possible values (two or more), characterizing the patterns or events being counted by the metric.
A derived metric is an elementary metric defined from a raw metric by counting only the patterns satisfying a certain combination of its selection criteria.

The metric menu of the metric tool classifies raw and derived metric:

A set of raw metrics and selection criteria is provided by default by the metric tool, see predefined raw metrics and selection criteria

To define a derived metric, we start from a raw metric, for example “number of features”, and combine some of the associated selection criteria. The combination may be:

  • An “or”: for example, count all the features that are attributes or exported (or both).

  • An “and”: count all the features that are both attributes and exported.

Our metric framework does not provide more general Boolean combinations, although they would be easy to add if necessary. Here is the interface provided to define derived metrics:

A selection criterion may have more than two possible values. Most, as in these examples, have just two: a feature is either an attribute or a routine; it is either exported or secret.

The definition states that every derived metric is derived from a certain raw metric. This provides only two levels of elementary metrics, raw and derived; you may not, from an existing derived metric, derive new ones, since you may only associate selection criteria with raw metrics.

As a general guideline, we will try to keep the selection criteria for a given raw metric independent. For example, to distinguish the classes that inherit a given class we will use the following selection criteria:

  • Heirs: count the number of direct heirs of a class.

  • Indirect_heirs: count the number of indirect heirs.

  • Self: count only the class itself.

Other interesting notions are “proper descendant”, covering direct and indirect heirs, and “descendant”, covering proper descendants and descendants. We do not introduce these as separate criteria, since this would result in a non-independent set of criteria: every proper descendant is a descendant, every heir (direct or indirect) is a proper descendant.

Instead we limit ourselves to the three criteria listed above. If you need a finer decomposition, it is easy, with the techniques discussed below, to define Proper_descendants and Descendants as composite metrics expressed in terms of the elementary metrics Heirs, Indirect_heirs and Self.

This criterion independence principle is not absolute, however, and in some cases we may find it clearer to define a new criterion even though its value is entirely determined by certain values of another. For example one criterion on features determines whether it is an attribute or a routine, another whether it is deferred or effective. An attribute is always effective, so the two criteria are not independent. Even though we could remove the dependency by using a single criterion with three values (attribute, effective routine, deferred routine), it is more convenient to keep two criteria. Of course the underlying counting mechanisms must make sure never to count an element twice even in an “or” query, as when a user asks for the number of features that are attributes or effective.

A metric is either elementary or composite. An elementary metric is either a raw metric, such as “number of features”, or a derived metric obtained from slicing a raw metric by selection criteria. Composite metrics are obtained from existing metrics (elementary, or previously defined composite metrics) by applying some mathematical formula. The three kinds of composite metrics shown on the figure will be explained shortly.

See Also
Elementary metrics, defining derived metrics


Predefined raw metrics

The environment should make it possible, for any project, to apply the elementary metrics in the following table, each with an associated unit and a one-identifier name. Each of the major divisions of the table starts with a raw metric, for example Classes, and, when appropriate, continues with selection criteria that yield derived metrics based on that raw metric, for example Deferred_classes.

The last column specifies the “basic scope types” of the metric; this notion, discussed in more detail in a later section, denotes the set of scope types on which the metric will need to get its information directly from the software product (rather than being simply computed by adding the corresponding values on a scope’s constituents).

Basic Count | Criterion | What to count | Unit | Basic scope types
Classes |  | Classes of a cluster or system | CLASS | Cluster
 | Deferred | Deferred classes (not completely implemented, as opposed to "effective", completely implemented).
 | Invariant equipped | Classes having an invariant
 | Obsolete | Classes marked as superseded by newer alternatives
Clusters |  | Clusters of a system or sub-clusters of a cluster | CLUSTER | Cluster
Compilations |  | Compilations since start of project | COMPILATION | System
Dependents |  | Classes on which a class depends, directly or indirectly | CLASS | Class
 | Clients | Direct clients
 | Heirs | Direct heirs in inheritance structure
 | Parents | Direct parents in inheritance structure
 | Suppliers | Direct suppliers
 | Indirect clients | Indirect clients
 | Indirect heirs | Indirect heirs in inheritance structure
 | Indirect parents | Indirect parents in inheritance structure
 | Indirect suppliers | Indirect suppliers
 | Self | The class itself (value always 1)
All features |  | Inherited and immediate features of a class | FEATURE | Class
 | Attributes | Attributes (features represented by fields in instances of the class, as opposed to routines, represented by algorithms)
 | Deferred | Deferred routines (not implemented, as opposed to effective features, which are implemented)
 | Exported | Features available to all clients
 | Functions | Value-returning routines
 | Postcondition equipped | Routines having a postcondition
 | Precondition equipped | Routines having a precondition
 | Queries | Value-returning features, including both attributes and functions (routines returning a result, as opposed to procedures)
 | Inherited | Features obtained from a parent (possibly in a different form)
Immediate features |  | Immediate features of a class | FEATURE | Class
 | Attributes | Attributes (features represented by fields in instances of the class, as opposed to routines, represented by algorithms)
 | Deferred | Deferred routines (not implemented, as opposed to effective features, which are implemented)
 | Exported | Features available to all clients
 | Functions | Value-returning routines
 | Postcondition equipped | Routines having a postcondition
 | Precondition equipped | Routines having a precondition
 | Queries | Value-returning features, including both attributes and functions (routines returning a result, as opposed to procedures)
All feature assertions |  | Clauses in routine's assertion, whether inherited or not | CONTRACT CLAUSE | Feature
 | Postcondition clauses | Clauses in postcondition
 | Precondition clauses | Clauses in precondition
Immediate feature assertions |  | Clauses in routine's assertion, not inherited | CONTRACT CLAUSE | Feature
 | Postcondition clauses | Clauses in postcondition
 | Precondition clauses | Clauses in precondition
Formal generics |  | Formal generic parameters of a class | CLASS | Class
 | Constrained | Formal parameters constrained by a type other than ANY
All formals |  | Formal argument of a routine whether inherited or not | LOCAL | Feature
Immediate formals |  | Formal argument of a routine. | LOCAL | Feature
Invariant clauses |  | Clauses in invariant | CONTRACT CLAUSE | Class
Lines |  | Source lines | LINE | Feature, Class
All locals |  | Local entities of feature whether inherited or not (excluding Result) | LOCAL | Feature
Immediate locals |  | Local entities of feature (excluding Result) | LOCAL | Feature

A few comments on specific entries:

  • The list of criteria for Features does not include Routines because a routine is a feature that is not an attribute; to obtain the number of routines, just count features that do not satisfy the Attributes criterion.

  • The selection criteria Attributes and Deferred for Features are, a noted earlier, not independent, since attributes may not be deferred.

  • Another case of dependency: a procedure is never part of Queries but always a “command”. Queries, however, include both Attributes and Functions.

  • Two more cases of dependency: Redeclared and Renamed can only be satisfied for features that are inherited. A feature that is not inherited, but introduced fresh in the enclosing class, is called immediate.

  • The Redeclared attribute has three values: a feature is redefined it was effective in the parent, or it was deferred in the parent and the new class keeps it deferred with a different signature or contract; it is effected if it was deferred and the class makes it effective; or it may be neither of these.

All metrics listed are product metrics with one exception: Compilations, the only process metric, counting the number of compilations of the project (in ISE Eiffel 5, this is based on ISE’s Melting Ice technology). There is room for more process metrics, such as cost estimates; this requires standard formats letting project managers enter the appropriate information, a point that future versions of the metrics policy described here may develop further.

There is also room for elementary product metrics other than those in the preceding table. In fact, every syntactic construct is a candidate for an elementary metric that simply counts the number of its occurrences; but we should limit ourselves to those that we judge interesting. The metrics literature also suggests elementary metrics assessing complexity of the control structure through properties of the control graph (McCabe), or routine coherence through such properties as the number of attributes accessed by a routine; we should only add them if we can find convincing arguments for their theoretical soundness.


Scopes and scope types

Every metric has a scope:

Scope of a metric:
The scope of a metric is defined as follows:
• For a raw product metric, the type of product over which the metric is counted, such as: a feature, a class, a cluster, a system, an archive built for a given system to make it possible to compare systems.
• For a raw process metric, the type of process on which the metric is measured, such as analysis, documentation, entire project etc.
• For a derived metric (recursively), the scope of the raw metric from which it is derived.
• For a composite metric (recursively), the largest of the scopes of all its constituent metrics, where cluster is “larger than” class and so on.

This notion also applies to measures:

Scope of a measure:
The scope of a measure is defined as follows:
• For an elementary measure (the application of an elementary metric, raw or derived), the set of products or processes to which the associated metric has been applied to yield the measure.
• For a composite measure, the union of (recursively) the scopes of its constituent measures.

For both metrics and measures, the notion of scope will help us compare our quantitative assessments to some already on record. For example you may compare the value of a certain metric, such as number of invariant clauses in each class, with the values that have been archived for your project, for a reference project such as the EiffelBase library, for the previous projects of your company, or for a global set of previous projects maintained at some central location. You may also, with appropriate permissions, update such a shared archive with the values from your own measurements.

In the environment, the notion of scope will be handled in a simple way.

There will be a set of predefined scopes, corresponding to software units: feature, class, cluster, system. Any scope beyond the system level will be defined by “measurement archives”, as explained next.

For product scopes, we will also rely on the notion of scope type:

Scope type:
Every product scope has a scope type, denoting the type of software unit of which it is an instance, for example Class for a class.

The metric tool provides a combo box listing all scope types. It is shrunk or extended depending on the selected scope object:

Unlike the other tables, which list their entries alphabetically, the above list shows scope types in order of size. This list indeed defines an order relation between scope types, which follows from the containment relation of the corresponding software units: every class contains features; every cluster contains classes; and so on.


Basic scope type

We need a clarification regarding the connection between metrics and scopes. This is a technical point and you can start using the tools without understanding it.

The reason for this notion, “basic scope types of a metric”, is that some metrics are additive in a simple way across the constituents of a scope, but others are not. “Constituents” of a scope are the sub scopes according to the order relation defined earlier between scopes: systems for an archive, clusters for a system, classes for a clusters, and features for a class.

To see the need for defining basic scope types, take as an example the elementary metric Lines, denoting the number of source lines in a certain scope. Then:

• The metric is additive at the cluster level, in the sense that the number of source lines of a cluster is the sum of the corresponding numbers for its constituent classes.

• The metric is similarly additive at the level of systems (add Lines over constituent clusters) and archives (add Lines over constituent systems).

• The metric is, however, not additive at the class level, since the number of source lines of a class isn’t just the sum of numbers of source lines of its features; we must also count the lines of Indexing clauses, Invariant clauses and other elements of a class that are not in a feature.

We will say that the scope types Feature and Class are the basic scope types of the metric Lines. This means the definition of the metric must, in specifying how to compute a measure for that metric over a particular scope, include three different algorithms, as follows.

How to compute a measure:
The following algorithm determines how to obtain a measure by applying a metric to a scope:
1 • If the scope's type is one of the basic scope types of the metric, Feature or Class in the example, the metric's specification must include a predefined mechanism to compute the measure.
That mechanism will directly access properties of the software —through the development environment (as in ISE Eiffel), or by directly analyzing the source code.
2 • If the scope's type is smaller than all basic scope types of the metric —referring to the order relation between scopes: Feature less than Class, Class less than Cluster and so on — the measure will always be zero. This cannot happen with the Lines metric, since the smallest of all scope types, Feature, is one of its basic scope types. But if requested to apply the metric Parents (number of parents) to a feature, we should return zero, since the Class is the only basic scope type for this metric and Feature is smaller than Class. The reason for this is obvious: we are asked to compute the “number of parents” for a feature, but the smallest unit for which this metric is defined is Class, so the only appropriate answer is zero. (This rule is important in connection with the next case.)
3 • Otherwise (the scope's type is not one of the basic scope types of the metric, but bigger than the smallest one), the measure is the sum of the measures obtained, recursively, by applying the metric to all of the scope constituents. For example to compute Lines — the number of lines — over a cluster is simply to compute it for each of its constituent classes and add the results. This rule is recursive: to compute Lines over a system, we add the results of applying the rule to each one of its constituent clusters.

To apply this definition, we need to know how to determine the basic scope types of any metric. Here is the rule:

Basic scope types of a metric :
Every metric has a set of basic scope types, defined as follows:
1 • The basic scope types of an elementary metric are part of the metric's definition; they appear in the table of elementary metrics.
2 • The basic scope types of a composite metric include (recursively) the basic scope types of all its constituent metrics.

To understand case B, which defines the set of basic scope types of a composite metric as the union of those of its constituents, we need to refer to all clauses 2 and 3 of the preceding rules. Assume that you want to define a composite metric “Number of contracts” as :

Precondition_clauses + Postcondition_clauses + Invariant_clauses

This is a legitimate combination since all the constituent metrics have the same unit, CONTRACT_CLAUSE, and indeed represent quantities (numbers of contract clauses) that it is meaningful to compare or add.

Case B of the definition of “Basic scopes of a metric” tells us that the basic scopes of the metric include both Feature, the basic scope type of the metrics Precondition_clauses and Postcondition_clauses, and Class, the basic scope type of the metric Invariant_clauses. This is what we want since the metric is meaningful for a feature (where it will only count precondition and postcondition clauses) and a class (where it will count all three kinds).

Assume we want to compute this quantity for a certain feature:

  • The definition of the metric tells us that we must compute the number of precondition, postcondition and assertion clauses for the class, and add the results.

  • For the Precondition_clauses and Postcondition_clauses, the only basic scope type is Feature, which is our scope of interest, so clause 1 of the rule on “How to compute a measure” tells us that we must count the precondition and postcondition clauses for all the features of the class.

  • For the Invariant_clauses metric, our scope of interest, Feature, is smaller than the only basic type scope of the metric, Class, so clause 2 of the rule tells us to ignore this metric by returning a zero. Without this clause, we would be faced with a logical contradiction.

If, however, we want to apply the metric to a certain class:

  • For the Precondition_clauses and Postcondition_clauses, since the only basic scope type of these metrics is Feature and our scope is bigger, clause 3 of the rule tells us to count precondition and postcondition clauses for all of the features of the class, and add the results.

  • For Invariant_clauses, clause 1 applies: we count the number of invariant clauses for the class, and add it to the previous result.

As this example indicates, we need rules to make the definition and application of metrics consistent. This enables the environment to provide users with a set of metrics which they can trust —even if they are not aware of the detail of the rules.


Measurement archive

If you want to perform measurements on a system that you are building, the scopes of interest are the first four listed: Feature, Class, Cluster and System. Information on either of these scopes will be provided by the development environment (as with ISE Eiffel 5); alternatively, you could get it simply by parsing the source of your system. But what if you also need quantitative data on other systems, if only for purposes of seeing how your results compare to the quantitative properties of other people’s work?

It would be impractical in this case to require tools that have access to as much information on external systems as on your own. All we really need is a record of previous measurements on these systems. This explains the fifth scope type, Archive: beyond the scope of the current system, all we require to define a scope is a measurement archive, or just “archive” for short. This is simply a file (or part of a file) that retains, in a suitable format (XML-based), the results of measurements made earlier on one system. The file can be local or accessible as a URL on the Internet.

The ability to use a measurement archive as a scope means that:

  • A project may set up a measurement archive as the record of its measures.

  • A department or company may set up a measurement archive for all projects on which it keeps metric information.

  • The provider of the development environment, such as ISE, may publish a set of measurement archives giving metric information for reference projects, such as the EiffelBase library (designed in part as a showcase of Eiffel technology). ISE indeed intends to include a metrics directory, with a set of measurement archives for reference tools and libraries, in forthcoming releases of ISE Eiffel and at http://eiffel.com .

The metric tool provides an easy way to create, update or compare archives. By clicking on [image] , the following dialog pops up:

The metric tool automatically creates a sub folder named "Metrics" in the current location of the loaded project. It is recommended, but not compulsory, to save created archives in that folder, since it has been provided for metric needs.

We hope that once the facilities described here are available users will adopt the practice of publishing measurement archives; it’s a way of providing quantitative reference information, useful to everyone, without revealing anything critical about the actual contents of the software. (For further protection one may envision an independent group that anonymizes the data after verifying the authenticity of the source.)


User interface basics

  • User interface basics
  • Measuring
  • EiffelStudio how to's
  • Archives


User interface basics

ISE Eiffel 5 environment includes a Metric tool based on the previously defined metric theory. This tool provides many facilities like computing measures over a project, including smaller scopes, defining new metrics according to users' needs and handling archives to compare projects

  • Measuring
  • Defining composite metrics
  • Archives


Measuring

Now that we have defined all basic notions such as metrics. metric hierarchy and scopes, let us see how the metric tool can help in evaluating a project.

Many commands are provided in the tool to compute measures and handle them. Indeed, it is possible to calculate metrics, save measures in order to retrieve them later on, request details for a given measure when available and eventually delete a set of measures.

To perform a measure, you simply choose a metric and a scope, and request the computation, by clicking the "calculate" button. This operation allows to evaluate the selected metric over the selected scope. The measure is displayed in the provided text field, but it is not saved yet.

To multi-column list displays the recorded measures. To save a measure, click on the "Add & save" button. The last calculated measure appears in the multi-column list and is saved in a file automatically generated by the interface. The file is located in the Metric subfolder of the current project location.

For "big" scopes (in the sense of the total ordering previously defined) details are sometimes available concerning the evaluated metric, and then the "detail" button is sensitive. It displays measures resulting from applying the requested metric over all smaller scopes.

It is possible to remove some measures after having saved them thanks to the "delete" button. Measures will be removed both from the multi-column list and from the file they were saved in.

After having recompiled a project, the recorded measures may no longer be accurate. The icon [image] replaces [image] to inform users that measures have been calculated before the last recompilation, and therefore may be obsolete. Updating measures is possible by right clicking on the multi-column list and choosing an item from the context menu. Measures will be updated both in the multi-column list and in the file they were saved in.

See Also
Computing a measure


Defining composite metrics

  • Introduction
  • Linear combination
  • Ratio
  • Scope comparison
  • Metric management


Defining, loading, managing new metrics

Users should have the ability to define a new derived or composite metric by applying some of the selection criteria or composition operators to one or more existing metrics.

They should also have the ability to save all current metric definitions to a file, producing a metric definition record. This should not be confused with a measurement archive, which records the results of measures resulting from applying certain metrics to certain projects.

Although the concepts are distinct, ISE Eiffel lets you store a measurement archive and the corresponding metric definition record into a single file, so that when you access the archived measures you have an unambiguous definition of the metrics that served to produce them.

The environment must also provide a way of adding a set of metrics read from a metric definition record, available from a local file, to the current metric definitions. As a result, users will be able to benefit from each other’s metric definitions and improve them over time.

  • Linear metrics
  • Ratio metrics
  • Scope comparison metrics
  • Metric management


Linear combinations of metrics

Notation: å ki. mi (where the i are real values)

Applicability: all the mi are metrics with the same unit u other than RATIO

Semantics: weighted sum

Resulting unit: u

The metric tool provides a command for defining linear metrics. Button [image] pops-up the following dialog. Select the linear tab to obtain:

and to define any linear metrics.

See Also
Defining linear metrics


Ratio metrics

Notation: a / b

Applicability: a and b are metrics, not necessarily with the same unit, but neither of them RATIO.

Semantics: division

Resulting unit: RATIO

Note that the presence of both linear combinations and ratios make it possible to define any metric of the form

å ki.mi / å li.ni

in terms of elementary metrics mi, ni. If necessary, the interface can provide a shortcut to define such a formula in one step, without first defining the numerator and denominator as linear combinations.

The metric tool provides a command for defining linear metrics. Button [image] pops-up the following dialog. Select the metric ratio tab to obtain:

and to define any ratio metrics.

See Also
Defining ratio metrics


Scope comparison for metrics

Notation: a1 // a2

Applicability: a1 and a2 are the same metric except for a possibly different scope.

Semantics: division

Resulting unit: RATIO

Note that since a scope may be a measurement archive, the presence of scope comparisons in our battery of metrics makes it possible to compare current measures to those of a reference archive, for example the previous measurements of a company. The result of a scope comparison doesn’t have to be expressed as a raw number or percentage; other possibilities include a percentage variation, such as –25% to mean that the value for a1 is 25% less than the value for a2.

The metric tool provides a command for defining linear metrics. Button [image] pops-up the following dialog. Select the scope ratio tab to obtain:

and to define any scope comparison metrics.

See Also
Defining scope comparison metrics


Metric management

The user interface provides tools for handling metrics, that is reordering, editing, deleting or importing a set of metrics just by clicking on button [image] in the metric tool. And then, users can either handle their own defined metrics or import a set of metric definitions from a metric definition record, found in another file than their own one.

See Also
Managing metrics


Archives

Icon [image] in the metric tool is provided to handle archives. This operation is really specific. It allows comparison between system scopes.

Indeed, it is actually easy to compare smaller scopes (such as features, classes and clusters) one to another among the same project. But this is different for systems since one project contains one and only one system. That is why archives have been created, to store measures for a given system when it is loaded and retrieve them later on when another system is being loaded.

The metric tool allows two kinds of facilities concerning archives:

  • Creation and update for the loaded system
  • Comparison to another system whose measures have been archived

By clicking on [image] , the following dialog pops-up:

Which allows archive creation update and comparison. for more details see section: handling archives

The metric tool creates automatically a sub folder named "Metrics" in the current location of the loaded project. It is advised, but not compulsory, to save created archives in that folder, since it has been provided for metric needs.


Metric toolbar

The toolbar of the metric tools contains the following fields:

  • name: to enter a name when saving a measure.
  • scope: a combo box to select a scope type.
  • metric: a menu containing all available metrics.
  • unit: displays the selected metric's unit.

And the following buttons:

  • calculate: evaluate a metric over a scope.
  • add: add a measure to the multi-column list and save it.
  • delete: delete a set of measures from the multi-column list.
  • management: reorder, delete or edit metrics.
  • new metric: create a new composite metric.
  • show details: show details of a measure.
  • hide details: hide details of a measure.
  • archive: create, update or compare archive files.


Wizards and dialogs

  • Profiler Wizard
  • Dialogs


Profiler Wizard

  • Introduction
  • Profiler wizard guided tour
  • Profiler how to's
  • Profiler reference


Introduction

The profiler wizard lets you analyze the result of a profiling session. It helps you optimize your system by pointing out the features where your system spends most of its time.

Before using the profiler wizard you must have generated a Run-time information record. A Run-time information record is generated by a profiler when a program is executed under its control. Most of the time, the Run-time information record is generated by the profiler integrated into EiffelStudio. See How to profile a system for more information about how to generate a Run-time information record with the integrated profiler.

Note: You can also use a Run-time information record generated by an external profiler such as GNU's gprof, Pure Atricia's Quantify, Visual C++ profiler, etc.

The diagram below summarizes the execution steps of the profiler wizard.

See Also
How to profile a system

Note: The profiler wizard, as well as the profiler, is only available in the Enterprise edition of ISE Eiffel.


Profiler wizard guided tour

  1. First step: Select which version of your system you ran using the profiler: Workbench or Finalized.
  2. Second step (only appears when an Execution Profile has already been generated for this system): Select an existing Execution Profile or choose to generate a new Execution Profile from a Run-time information record.
  3. Third step (only appears when generating a new Execution Profile): Generate a new Execution Profile from a Run-time information record.
  4. Final step: Select the information you need and formulate your query.
  5. Profile query window

See Also
How the Profiler wizard works
How to profile a system


Profiler how to's

  • How to set up a Profiler Configuration File


How to set up a Profiler Configuration File

Once executing an instrumented system has generated the proper file, you must have a profile converter process it in order to produce the Execution Profile. The need for the converter comes from the various formats that profilers use to record run-time information during an execution; a simple Profiler Configuration File enables you to describe the format used by any particular profiler.

The Profiler Configuration File is a file found in the directory $ISE_EIFFEL/studio/profiler where $ISE_EIFFEL is the location of the Eiffel installation. The name of the Profiler Configuration File in that directory is eiffel for internal profiling and, for external profiling, the name of the profiler tool as specified in the profiler option. EiffelStudio comes with 3 preconfigured external profilers:

  • gprof: GNU's gprof
  • win32_ms: Visual C++ 5.0 or 6.0
  • profiler.info: Pure Atria's Quantify

The Profiler Configuration File describes the structure of the file generated by the profiler. To create a new Profiler Configuration File for another profiler, just create a new file in the directory $ISE_EIFFEL/studio/profiler and fill it in.

Here is a complete example showing the various options that may be specified:

number_of_columns: 7
    -- Number of columns in the file.

index_column: 1
    -- Column where the index is stored.

function_time_column: 3
    -- Column where the time spent in the function is stored.

descendent_time_column: 4
    -- Column where the time spent in the descendents of a function is stored.

number_of_calls_column: 5
    -- Column where the number of calls to a function is stored.

function_name_column: 6
    -- Column where the name of the function is stored.

percentage_column: 2
    -- Column where the percentage of time spent in the function is stored.

second_percentage_column: 0
    -- Column where the second percentage of time spent in the function is stored.

generates_leading_underscore: no
    -- Says whether the profiler generates leading underscores (yes) or not (no).

As in Eiffel and Lace, -- introduces a comment, which has no effect on the specification. If one of the xxx_column options has a value of 0, this means that the files generated by the given profiler contain no such column. The order of the options is not significant.

See Also
Select a Run-time information record to generate the Execution Profile
How to profile a system


Profiler wizard reference

  • Select the Compilation mode
  • Reuse or Generate an Execution Profile
  • Select a Run-time information record to generate the Execution Profile
  • Select the information you need and formulate your query
  • Profile query window


Select the Compilation mode

The first screen of the wizard lets you specify the mode in which the profiled system was compiled.

If you have run a finalized system under the control of the profiler then select Finalized mode and click Next. On the contrary if you have executed the system in Workbench mode then select Workbench mode and click Next.

Clicking Next will lead you to the Second state or to the Third state depending on whether an Execution Profile has already been generated for this compilation mode or not. If no Execution Profile has been generated so far (which happens the first time you execute this wizard for a specified project in a given compilation mode) you will go to the Third state, otherwise you will go to the Second state.

See Also
How the Profiler wizard works
How to profile a system


Reuse or Generate an Execution Profile

The second screen of the wizard lets you reuse a previously generated Execution Profile or generate a new Execution Profile from a Run-time information record.

The profiler wizard has detected that one or more Execution Profiles have already been generated for this system in this compilation mode. If you have executed your system after the generation of the existing profile, select Generate a profile from Run-time information record to create a new Execution Profile for the newly produced Run-time information record.

Note: If you choose Generate a profile from Run-time information record the generated Execution Profile will be written into <project_directory>/EIFGEN/W_CODE/profinfo.pfi if you have selected Workbench mode in the first step, or <project_directory>/EIFGEN/F_CODE/profinfo.pfi if you have selected Finalized mode. If a file with the same name already exists its content will be destroyed and replaced.

However, if you have not executed your system since the generation of the last Execution Profile, there is no need to generate a new Execution Profile. If you are in the latter case, select Use existing profile and choose the last Execution Profile you have generated.

Tip: If you want to archive different Execution Profiles (to compare them for example), rename the profinfo.pfi file into a new name but keep the .pfi extension. The profiler wizard detects existing Execution Profiles by checking the file extensions.

Clicking Next will lead you to the Third state if you have selected Generate a profile from Run-time information record. On the other hand if you have selected Use existing profile you will go to the Final state.

See Also
How the Profiler wizard works
How to profile a system


Select a Run-time information record to generate the Execution Profile

The third screen of the wizard lets you generate an Execution Profile from a Run-time information record. You should provide the Run-time information record produced by the profiler in the text field labeled Run-time information record. If the file provided by default is not the desired one change it by clicking on the Browse button or by directly entering it in the text field.

Then, in the combo box labeled Profiler used to produce the above record, select the profiler that has been used to produce the Run-time information record you have entered. If the profiler used to execute the system does not appear in the combo box, you have to add it. See How to set up a Profiler Configuration File for more details on how to do so.

Note: The Run-time information record has to be located in the EIFGEN\W_code directory of your project.

Clicking Next will lead you to the Final state if the provided Run-time information record is valid. If the Run-time information record is not valid or is not located in the EIFGEN\W_code directory of the project, you will go to the Run-time Information Record Error state as shown below.

See Also
How the Profiler wizard works
How to profile a system
How to set up a Profiler Configuration File


Select the information you need and formulate your query

The final screen of the wizard lets you select the information you want to be displayed in the profile query window.

Select the information you need

Check or uncheck any of the check buttons in Output switches to select the columns you want to be displayed. Each switch turns on or off the corresponding column output. You should toggle columns on or off depending on what you would like to see in the result of the computation. Here are the explanations of each switch:

  • Feature name: Display the name of the current feature.
  • Number of calls: Display the number of times the current feature was called during the instrumented execution.
  • Function time: Display the time spent in the current feature (not counting the time spent in features called by the current feature).
  • Descendant time: Display the time spent in all features called during the execution of the current feature.
  • Total time: Display the total time spent in the feature. This value is equal to Function time + Descendant time.
  • Percentage: Display the percentage of time spent in the current feature. This value is equal to Total time / Execution time.

Check or uncheck any of the check buttons in the Language type to select the type of features you want to be displayed. If you select only one language, the query result will not contain any information about routines written in the other language. The default is Eiffel only.

  • Eiffel features: Display the features written in Eiffel.
  • C functions: Display the functions written in C.
  • Recursive functions: Display recursive functions.

Formulate your query

When running a query, you are able to type a complete query. After pressing the Next button, a new window will be displayed to show the result of the query. The total query can be either a single one or a set of sub-queries separated by one of the two operators 'or' or 'and'.

Each sub-query must have the following syntax 'attribute operator value' where:

  • 'attribute' is one of:
    • featurename
    • calls
    • total
    • self
    • descendants
    • percentage
  • 'operator' is one of: <, >, <=, >=, =, /=, in
  • 'value' is one of:
    • An integer (for calls)
    • A string (for featurename). The string may contain wild card characters: ?, standing for arbitrary characters, and *, standing for arbitrary sub-strings.
    • A real value (for other attributes)
    • An interval, of the form a-b for two values a and b.
    • max
    • min
    • avg

Clicking Next will open the Profile query window and display the results of the formulated query.

See Also
How the Profiler wizard works
How to profile a system


Profile query window

The profile query window displays the results of the query you have formulated in the Final state of the Profiler wizard. It also lets you change the subqueries of the current query.

To add a new subquery to the current query, fill in the text field labeled Define new subquery (type in calls < 20 for example) and click the And or Or button. To display the results of the new query click on the Update button.

To remove an existing subquery, select it in the Active query list and click on the Inactivate > button.

To activate an existing subquery, select it in the Inactive query list and click on the < Activate button.

To change the operator affecting an existing subquery, select it in either the Active query or the Inactive query list and click on the Or or And button.

Click on the Save button to save the currently displayed results in a text file.

Tip: To visualize the result in Microsoft Excel or any other spreadsheet, select the entire text (except the first three lines where the Execution Profile file is specified), copy it and then paste it into Excel.

See Also
How the Profiler wizard works
How to profile a system


Dialogs

  • New feature dialog
  • Error descriptor
  • External commands editor


New feature dialog

  • Introduction
  • Overview
  • Procedure layout
  • Function layout
  • Attribute layout
  • Feature properties modification


Introduction

The new feature dialog window lets you create simple Eiffel features using the coding standards described in Object-Oriented Software Construction, Second Edition. It takes away the drag of writing set-procedures for attributes and finding the right feature clause in your class text. The feature wizard can be invoked whenever you have a class open in a development window. It is also used by the diagram tool when creating a client-supplier link.

Use it when...

  • You want to be introduced to the style rules for Eiffel code as described in Object-Oriented Software Construction, Second Edition, chapter 26.5 (page 891).
  • You want to create an attribute and you also want an invariant and/or a set-procedure generated for it.
  • You want to add a feature in a feature clause that is not in your class yet, and you do not remember the feature clause order, or you want to add it in a feature clause that is in your class, but you cannot find it.

Do not use it when...

  • You want to edit an existing feature. This is not possible, you can only create new features with it.
  • You want to write a more advanced feature. With the feature wizard, you can enter only a single line of code.
See Also

New feature dialog overview


New feature dialog overview

There are two parts in the window. The upper part allows you to choose what type of feature you want to create, a procedure, a function or an attribute.

The rest of the window is used to set the characteristics of the new feature. Information you will be asked depends on the type you chose. For more information, click on one of the links below :

  • New procedure layout
  • New function layout
  • New Attribute layout


New procedure layout

When clicking Procedure, the window changes to the procedure layout. It has the following components:

  • Feature clause selection
  • Feature name field
  • Argument list
  • Header comment field
  • Precondition field
  • Local variable field
  • Selection for: normal, once, deferred or external routine
  • Postcondition field

Example

class
    PRODUCT

feature {PERSON} -- Element change

    place_order (person: PERSON; quantity: INTEGER) is
            -- Mail `quantity' to `person'.
        require
            person /= Void and quantity > 0
        do
            person.mail_order (Current, quantity)
        ensure
            person.has_ordered (Current)
        end

end -- class PRODUCT


New function layout

When clicking Function, the dialog changes to the function layout. It has the following components:

  • Feature clause selection
  • Feature name field
  • Argument list
  • Type selection
  • Header comment field
  • Precondition field
  • Local variable field
  • Selection for: normal, once, deferred or external routine
  • Postcondition field

Example

class
    PRODUCT

feature -- Status report

    order_price (quantity: INTEGER): DOUBLE is
            -- Total price when ordering `quantity'.
        require
            quantity_non_negative: quantity >= 0
        do
            Result := quantity * price
        ensure
            correct: Result = quantity * price
        end

end -- class PRODUCT


New attribute layout

When clicking Attribute, the window changes to the attribute layout. It has the following components:

  • Feature clause selection
  • Feature name field
  • Type selection
  • Header comment field
  • Invariant field
  • Set-procedure checkbox

Example

class
    PRODUCT

feature {NONE} -- Access

    price: DOUBLE
            -- Cost in dollars.

feature -- Element change

    set_price (a_price: DOUBLE) is
            -- Assign `a_price' to `price'.
        require
            a_price_non_negative: a_price >= 0.0
        do
            price := a_price
        ensure
            price_assigned: price = a_price
        end

invariant
    price_non_negative: price >= 0.0

end -- class PRODUCT


New feature dialog

  • Feature clauses
  • Name field
  • Argument list
  • Header comment
  • Precondition
  • Local variable
  • Feature body
  • Postcondition
  • Type selection
  • Invariant
  • Set-procedure


Feature clauses

The feature you create will be inserted in the feature clause you specified. If the feature clause was not already in your class, or not in the right place, EiffelStudio adds the feature clause to the class text based on the feature clause order specified in the preferences. By default, this is the order used by the ISE libraries, such as EiffelBase.

Export status

The export status is the class the feature is accessible for. Usually, this is ANY for public features, or NONE for implementation features, but you can specify any class here.

Note: in the class text, you can export a feature to more than one class but (for simplicity) not with this dialog.

Feature clause names

For feature clause names it is recommended that you pick one from the standard ones, but it is also possible to create a new one. If you have introduced a special feature clause name in your project, add it to the feature clause order list in the preferences and it will also appear in this dialog.

Generated code

The code that is inserted in your class as a result of the selections made for the feature clause, is of the form:
feature{EXPORT}-- Clause name
except if you specified ANY as export status, which is similar to having no export status.
feature-- Clause name
For example, if you specified a the "Initialization" feature clause name, and specified NONE as export status, you get:
feature{NONE}-- Initialization


Name field

The feature name field is a textbox that lets you enter a name for the feature. For help on how to choose the right name for a feature, see: Object-Oriented Software Construction, Second Edition, paragraph 26.2.

Warning: EiffelStudio performs no validation on the name you choose. For example if you type a space in it, it will generate the code, and detect a syntax error only when compiling.


Argument list

For functions and procedures, you can build a formal argument list. You can do this by clicking on the New argument button as many times as you need arguments.

Note: even though this dialog always shows parentheses, they are not generated if the list is empty (Eiffel's command-query separation (CQS) principle).

Note: if you add arguments to a routine, it is not possible anymore to select routine type once.

For every attribute you selected, enter a name in the textbox and a type using the type selection.

The code that is generated:

set_name (s: STRING) is
    do
    end


Header comment

In the header comment field you can type a description of the feature. For style guidelines in writing a header comment, see: Object-Oriented Software Construction, Second Edition, paragraph 26.4. The description should be informative, clear and terse.

For example, suppose you have an attribute count. You can enter the following header comment:

When clicking OK this code is generated:
    count: INTEGER
            -- Number of students in course.


Precondition

Enter a precondition in the require field. A precondition clause will be added to the feature:

...
require
    n >= 0
...


Local variable

Enter a local variable in the local field. A local variable clause will be added to the feature:

...
local
    n: INTEGER
...


Feature body

What goes into the feature body field is dependent on what kind of feature you wish to generate.

  • do: this is the normal procedure type. Enter in the field below do a body for your feature.
    do_something is
    do
        a := b
    end
  • once: this is the type for a routine that is executed once per execution. As a once routine cannot have arguments, it is disabled when you added one or more arguments.
    init is
    once
        load
    end
  • deferred: this creates a routine of deferred type. The local and body fields grey out as they serve no use anymore.
    do_something is
    deferred
    end
  • external: this creates an Eiffel wrap routine around a routine written in another language. Use the body field to enter a string containing the necessary information about the routine using the external syntax.
    do_something is
    external
        "C | %"location.h%""
    end


Postcondition

Enter a postcondition in the ensure field. A postcondition clause will be added to the feature:

...
ensure
    n = count
end


Type selection

Whenever you need to give a type of something in the dialog, the type selection component is used. The type selection lets you type any class name or you can pick one from the list.

When you select a class that is in the system and has formal generic parameters, the type selection component lets you specify an actual generic parameter in another type selection.

Note: the window might grow in size because of the added component.

Since the actual generic type selection is also a type selection, you can select another class with generic parameters and nest them as deep as you need.

You can also select the type TUPLE, which is a special class that can have zero or more generic parameters. When you select it, it has no parameters, but you can add one by clicking on the Add parameter button. Click it as often as the number of generic parameters that you need.

Warning: if you need a very complex type, it is better not to use the dialog, as the window might grow bigger than your screen. After you completed the feature, edit it manually in the class text.

The code generated for the selected type is quite straightforward, an example:

new_feature: FUNCTION [ANY, TUPLE [INTEGER], BOOLEAN]


Invariant field

When creating an attribute, you can optionally enter or select an invariant for that feature. That invariant will be added to the end of the existing invariant clause. If the invariant clause did not exist before, it is now created.

If the attribute is of a reference type, you may select the invariant that the attribute may never be void. If it is of a basic expanded type, some other standard options may be chosen. For example, for INTEGER you may select that it should always be positive.

The example above will generate the code:

invariant
    count_positive: count > 0


Set-procedure

When creating an attribute, it is common that you will also need a set-procedure for it. For example, for attribute property you need a procedure set_property to set it. This feature takes one argument of the same type as property or is anchored to it. The only thing you have to do with the feature wizard is check the button Generate set procedure.

The feature that is generated in addition to the attribute itself is placed in feature clause Element change and is exported to all classes. If you have selected or entered an invariant, the precondition will protect this invariant. Example of a generated set-procedure:

feature -- Element change

    set_button (a_button: EV_BUTTON) is
            -- Assign `a_button' to `button'.
        require
            a_button_not_void: a_button /= Void
        do
            button := a_button
        ensure
            button_assigned: button = a_button
        end


Error descriptor

  • Error wizard


Error wizard

More often than wanted, Eiffel compilations are not successful. The good point is that when an error is detected by the compiler, it will not be a problem at run-time. The bad point is that you have to fix compilation errors before being able to launch and debug your system.

When an error occurs during an Eiffel compilation in EiffelStudio, the Output tab of the context tool displays a description of the error and its location, which looks more or less like this:

In this case, the compiler tries to explain that the identifier "sessiond" is not a known identifier in the context where it was typed. This is a common error that mainly occurs when making typos in the code. Assuming the message does not make sense to you (which may happen in more complex cases), you can query more information about the encounted error.

To do this:

  • Pick the code of the error, in this case VEEN.
  • Drop it either in the editor or on the error help button [image].
  • A dialog is then popped up that describes extended information concerning this error type:


External commands

  • External commands editor


External commands editor dialog

External commands editor

From EiffelStudio, you can define up to 10 external commands. Those commands will have their output redirected in the output pane of the context tool. You can execute them through the Tools menu. A typical usage is to use those external commands to integrate with your source control management solution (e.g. CVS, Visual Source Safe,...)

To define your own command, select "External commands..." in the Tools menu. Then the following dialog will appear:

With this dialog you can:

  • add new commands
  • edit existing commands
  • delete existing commands

To add your first command, simply click on the "Add..." button and the following command editor will appear:

In this dialog you can give a name to the command, this name will be displayed in the Tools menu. The index is the position among the external commands of the command in the Tools menu. The command line is the command you want to execute. In order to execute correctly, the application you will execute needs to be in your PATH environment variable or if it is not you must provide an absolute path to the external command.

In addition to the external command name, you can pass as many options as you want plus the following three that will be translated before calling the external command:

  • $class_name: this will be replaced by the name in lower case of the targeted class in editor
  • $file_name: this will be replaced by the path to the targeted class in editor
  • $directory_name: this will be replaced by the directory location of the targeted class in editor


Formatted information about compiled classes and features

  • Introduction
  • Class views
  • Feature views


Introduction

Different kinds of information about classes and features can be seen in EiffelStudio depending on the developer's needs. These are called Views and can be divided into two categories:
  • Class views
  • Feature views


Class views

  • Introduction
  • Basic text view
  • Clickable view
  • Flat view
  • Contract view
  • Flat Contract view
  • Ancestors
  • Descendants
  • Clients
  • Suppliers
  • Attributes
  • Routines
  • Deferred features
  • Once routines and constants
  • External features
  • Exported features


Introduction

Class views are all available through the Class tab of the context tool, and for some of them directly with the editor.
These views (with their associated icon) are:

  • Basic text view
  • Clickable view
  • Flat view
  • Contract view
  • Flat Contract view
  • Ancestors
  • Descendants
  • Clients
  • Suppliers
  • Attributes
  • Routines
  • Deferred features
  • Once routines and constants
  • External features
  • Exported features


Basic text view

Basic text view [image] is the only editable view; this is why it is only available through the editor.

This is also the view selected by default when the editor is opened for the first time.

In this view, most of the development objects are clickable, except for special cases like assertions, anchored types, identifiers within a comment line... for which the clickable view might be needed.

Note: The generated text is not editable, but it is compilable. This view is not available to .NET classes which are imported through by means of an assembly. This is because the assembly .exe or .dll exposes only the interface methods and therefore is no implementation to display. Such classes may be viewed, in a clickable format using the Contract View or Interface View.

See Also
Editor


Clickable view

The clickable view [image] allows to pick every class or feature name in the class text and is available either through the editor or through the Class tab of the context tool.

Note: This view is not available to .NET classes which are imported through by means of an assembly. This is because the assembly .exe or .dll exposes only the interface methods and therefore is no implementation to display. Such classes may be viewed, in a clickable format using the Contract View or Interface View.


Flat view

The flat view [image] displays all the features for the current class, i.e. including both written-in and inherited features ; it is available either through the editor or through the Class tab of the context tool. This is also the only view where breakpoints are displayed.

Caution: For classes with many ancestors, computation of the flat view may require a few seconds.

Note: This view is not available to .NET classes which are imported through by means of an assembly. This is because the assembly .exe or .dll exposes only the interface methods and therefore is no implementation to display. Such classes may be viewed, in a clickable format using the Contract View or Interface View.

See Also
Flat Contract view


Contract view

The contract view [image] displays the contracts of all written-in features of the current class. It is available either through the editor or through the Class tab of the context tool.

See Also
Flat contract view


Flat Contract view

The Flat Contract view [image] displays the contracts of all written-in and inherited features of the current class. It is available either through the editor or through the Class tab of the context tool.

Caution: For classes with many ancestors, computation of the Flat Contract view may require a few seconds.

See Also
Flat view
Contract view


Ancestors

The ancestors view [image] displays all the classes from which the current class inherits, directly or not, using a tree-like indented layout.
It is available through the Class tab of the context tool.

See Also
Descendants


Descendants

The descendants view [image] displays all the classes which inherit from the current class, directly or not, using a tree-like indented layout.
It is available through the Class tab of the context tool.

See Also
Ancestors


Clients

The clients view [image] displays all the classes which are using features of the current class, and thus rely on its interface.
It is available through the Class tab of the context tool.

See Also
Suppliers
Feature callers


Suppliers

The suppliers view [image] displays all the classes from which the current class is calling features.
It is available through the Class tab of the context tool.

See Also
Clients


Attributes

The attributes view [image] displays all the attributes of the current class, including inherited attributes.
It is available through the Class tab of the context tool.

See Also
Routines


Routines

The routines view [image] displays all the routine signatures of the current class, including inherited routines.
It is available through the Class tab of the context tool.

See Also
Attributes


Deferred features

The deferred view [image] displays all the deferred features of the current class.
It is available through the Class tab of the context tool.


Once routines and constants

The once view [image] displays all the routines declared as once and the constant attributes in the current class (or in its ancestors.).
It is available through the Class tab of the context tool.


External features

The external view [image] displays all the external features of the current class.
It is available through the Class tab of the context tool.


Exported features

The exported view [image] displays all the features of the current class that all other classes may call.
It is available through the Class tab of the context tool.


Feature views

  • Introduction
  • Basic text view
  • Flat view
  • Callers
  • Implementers
  • Ancestor versions
  • Descendant versions
  • Homonyms


Introduction

Feature views are all available through the Feature tab of the context tool.
These views (and their associated icon) are:

  • Basic text view
  • Flat view
  • Callers
  • Implementers
  • Ancestor versions
  • Descendant versions
  • Homonyms


Basic text view

Basic text view [image] displays the text of the current feature as it is written in the englobing class.
It does not allow to work with breakpoints ; in order to do this the flat view has to be used.

Note: This view is not available to .NET features which are imported through by means of an assembly. This is because the assembly .exe or .dll exposes only the interface methods and therefore is no feature implementation to display. The feature interface may be viewed, in a clickable format using the Flat View.

See Also
Class basic text view


Flat view

The flat view [image] displays the feature body as it is seen at run-time (according to ancestor versions, if any). This is why it is possible to add or remove breakpoints in this view.

See Also
Class flat view


Callers

The callers view [image] display all the features which are calling the current feature. It is possible to choose in the preferences if callers of the descendants should be displayed too (they are by default).

See Also
Class clients view


Implementers

The implementers view [image] displays all the different versions of the current feature by exploring the ancestor versions and the descendant versions, and selecting among those the ones which are not inherited.

See Also
Ancestor versions
Descendant versions


Ancestor versions

The ancestor view [image] displays all the features which the current feature is redefining.

See Also
Descendant versions


Descendant versions

The descendant view [image] displays all the features that redefine the current feature.

See Also
Ancestor versions


Homonyms

The homonyms view [image] displays all the features in the system which have the same name as the current feature.

Caution: This operation may take a long time if the system has a lot of classes.

See Also
Implementers


Preferences

  • Introduction
  • Preferences dialog window
  • Preferences reference


Introduction

Many of EiffelStudio properties may be customized. A tool has been designed to help you set your preferences.
In this section, you will find a description of this tool. You will also find an explanation of the different properties that may be modified by using it.


Preference window overview

The preferences dialog window is divided into two parts (plus a button bar at the bottom).

The left part is used to display a tree that shows preference categories. A description of the contents of this tree, i.e. the different categories of preferences and preferences themselves, is available here.

The right part shows the preferences attached to the currently selected tree node. They appear in a table that has two columns. The first one contains the description of the preference, the second one contains its value. To modify this value, select the preference by clicking on it. A floating widget appears on top of the preference value to let you change it.

The floating widget depends on the type of the preference that is modified. There are four kinds of preferences:

  • Boolean preferences : their possible values are "True" and "False". A combo box will allow you to choose between both.
  • Color preferences : Their value is represented by three integers, which are the RGB code of the color. You do not have to use RGB codes though. When you select such a preference, the current color and two buttons are displayed. If you press the first button, a color selection window will appear. For some background colors, you have the possibility to click the "Auto" button. EiffelStudio will then set the current color to the default background color.
  • Font preferences : A font selection window will appear as you press the button with label "change".
  • Other preferences : They will be modified by typing their value directly.
If there is no message stating you need to restart EiffelStudio, changes will be taken into account immediately.

Tip: Sub-categories and their contents are not displayed in the right area. To see the preferences that belong to a sub-category, you have to select it in the left part of the window.

Caution: You can restore preferences default values by clicking on the "Restore Default" button. ALL preferences will be reset.


Preferences reference

  • Introduction
  • Global preferences
  • Tools
  • Graphical Elements


Introduction

There are a lot of properties of EiffelStudio that may be changed by the user. This section will present them, following the classification that can be found in the preferences window. If you open this window, you will see that properties are distributed in three categories :
  • Global preferences : This category contains non graphical preferences that are not specific to a tool in EiffelStudio.
  • Tools : This category gathers preferences associated to a particular tool in EiffelStudio.
  • Graphical elements : In this category, you will find the customizable properties of the graphical interface.


Global preferences

This categories gathers non graphical preferences that are not related to a tool in particular. These preferences are :

Label in the preferences window | Complete Description
Text files format. | This boolean preference sets whether .e files will be saved in DOS or UNIX format. If it is set to "True", files will be saved in DOS format, i.e. line separator will be made of a line feed and a carriage return. Otherwise, UNIX format will used, i.e. there will not be carriage returns.
Command used to launch an external editor. | You may open a class in an external editor by dropping the corresponding pebble on the external editor icon. This preference sets which command line will be used to launch the external editor. The parameter "$target" will be replaced in the command with the file name corresponding to the class, "$line" with the line number if this information is relevant, with 1 otherwise.
Use external command to print ? | This sets whether you want to specify which command line will be used to print texts.
Command invoked to print a text. | This is the command used to print a text if the previous preference, "Use external command to print?", is true. The parameter will replace "$printer" with the printer name on GTK platforms, and "$target" with the name of the file given to the external program (see next preference).
Send a postscript file to this command? | If it is set to False, the command line above will be called on a basic text file containing what you want to print. Otherwise, the file will be a postscript file with a formatting close to the one on the screen.
Number of projects kept in the recent projects list | This integral preference defines the maximum number of entries that should be displayed in the File/Recent projects menu.
Internet browser (GTK platforms only) | This sets the command line that should be used to open an internet browser on a given HTML page. If present, "$url" will be replaced with the URL of the HTML page. This is used to display help files.

See Also
Other Preferences


Tools

  • Introduction
  • Browsing tools
  • Context tools
  • Editor


Introduction

This section of the help deals with preferences related to a tool in particular.
These preferences are distributed in three categories :
  • Browsing tools preferences : They set some properties of the tools of the explorer bar (i.e. the left part of EiffelStudio development windows)
  • Context tools preferences : They will be used to change properties of some of the context tools.
  • Editor preferences : They will allow you to customize some features of the editor, automatic completion in particular.
See Also
Other Preferences


Browsing tools

This sub-category gathers the preferences related to the tools in the left part of EiffelStudio development window. There are four of them :
Label in the preferences window | Complete description
Maximum number of items in history combo boxes | This sets the maximum number of items that will be displayed in the history combo boxes in the address bars. The default value is 10.
Allow class name completion in the address combo boxes | This boolean preference enables or disables the completion of names in the combo boxes in the address bars. The default value is True.
Show only one tool. | If this is True, only one of the browsing tools (i.e. Features, Clusters, Search, Windows and Favorites tools) will be displayed at a time. If it is False up to three tools can be shown simultaneously. The default value is False.
Automatically expand the feature tree | If this is True, the feature tree, which contains feature names sorted by feature clauses, will be expanded so that you can see all the features immediately. If it is False, you will only see the feature clauses at first and have to expand them to reach feature names. The default value is True.
See Also
Preferences for other tools


Context tools

This sub-categories gathers the preferences related to context tools.

There are ten of them :
Label in the preferences window | Complete description
Link the context tool with other tools by default? | This boolean preference sets whether, by default, the editor and the context tools display information about the same element (Class, Feature or Cluster). The default value is True.
Show ALL classes in the diagram? | You can choose not to display some classes in the Diagram Tool. If you set this property to False, you will be given the opportunity to define the list of excluded classes (see below). The default value is False.
Names of classes that should not appear in generated diagrams. | This is the list of classes that will be ignored in the Diagram tool if the previous preferences is set to False. By default, this list includes : INTEGER, BOOLEAN, STRING, CHARACTER, REAL and DOUBLE.
Order used to sort feature clauses in class views. | This sets the order of appearance of feature clauses in class texts when it is displayed in any view but the basic text one (i.e. Clickable, Flat, Contract or Interface views).
Show all callers in `callers' view. | When the Feature Tool is centered on a feature, you can see its callers by requesting the `callers' view. If this property is set to True, this view will include callers of descendant versions of the feature. Otherwise, it will only display callers of the current version. The default value is True.
Show syntactical suppliers (as opposed to actual suppliers) in the `suppliers' view. | There are two types of suppliers for a given class. On one hand, there are the syntactical suppliers, i.e. the ones the name of which appear in the class text. On the other hand, there are the actual suppliers, i.e. the ones features of which are used in the class. This preference allows you to choose what type you want to be displayed when you select the `suppliers' view in the class tool. If it is True, syntactical suppliers will be shown. The default value is False.
Indexing items that need not be included in class views. | This is a list of items in the indexing clause that will be hidden in Clickable, Flat, Contract and Flat Contract views of classes. By default, it includes "revision", "date" and "status".
Class view that is selected by default. | This is the index of the view that be used by default in the Class tool. To find the index associated with a view, refer to the table below. The default value is 5 (which corresponds to the ancestors view).
Feature view that is selected by default. | This is the index of the view that be used by default in the Feature tool. To find the index associated with a view, refer to the table below. The default value is 2 (which corresponds to the flat view).
Receiver of control-right-click. | This defines the behavior of Control-picking items. The possible values are editor, context, new_editor, new_context, new_window and external. The default is new_window, which creates a new window centered on the picked object. Editor and context send the object to the current editor or context tool. New_editor and new_context create a new editor or context window and set the object in it. External sends the object to the external editor.

Class views indices
Index | Class view
1 | Clickable view
2 | Flat view
3 | Contract view
4 | Interface view
5 | Ancestors
6 | Descendants
7 | Clients
8 | Suppliers
9 | Attributes
10 | Routines
11 | Deferred features
12 | Once routines and constants
13 | External features
14 | Exported features

Feature views indices
Index | Feature view
1 | Basic text view
2 | Flat view
3 | Callers
4 | Implementers
5 | Ancestor versions
6 | Descendants versions
7 | Homonyms

See Also
Preferences for other tools


Editor preferences

  • Introduction
  • General preferences
  • User-definable keyboard shortcuts
  • Automatic completion preferences


Introduction

Some of the features of the EiffelStudio editor can be customized. This section of the documentation contains the necessary explanations to use the editor preferences.
In addition to a description of general preferences for the editor, you will find a document about user-definable keyboard shortcuts and a subsection for automatic completion preferences.


General Editor Preferences

The "Editor" folder contains a few options:

  • Automatic update when the file has not been modified: This value is used when the text displayed in EiffelStudio editor has been modified by an external editor since it was opened. If it is True, the content of EiffelStudio editor will be automatically updated if no change was performed in this editor. If it is False, the users will always be asked if the current text should be updated or not.

  • Underscore '_' is a word separator: If it is set to True, when moving or selecting word by word, underscores will be considered as spaces. If it is set to False, two groups of letters linked by an underscore will be considered as one word.

  • Quadruple click selects all: If this is set to True, a quadruple click in the editor will select the entire text. If it is set to False, if the user clicks three times or more in a row, the current line will be selected.

  • Use tabulations for automatic indentation: If this is set to True, tabulations will be used during keyword automatic completion and text block indentation. If it is set to False, tabulations will be replaced by as many spaces as defined in "Graphical Element" preference folder by "Tabulation size"


Keyboard shortcuts preferences

Some of the keyboard shortcuts used in the editor can be customized. A subfolder of the "Keyboard Shortcuts" folder in the editor preferences corresponds to each of these customizable shortcuts. There are four values to set to define a shortcut: which key must be pressed and whether Ctrl, Alt or Shift have to be pressed at the same time. You will find a combination of all in each shortcut subfolder. The customizable shortcuts are:

  • Autocomplete: Shortcut to trigger the feature call automatic completion. The default key combination is "Ctrl+Space".

  • Class name autocomplete: Shortcut to trigger the class name automatic completion. The default key combination is "Ctrl+Shift+Space".

  • Search selection: Shortcut to launch a search of the currently selected item. If there is no selected item, the editor will look for the next occurrence of the last searched pattern. The default key combination for this command is "F3".

  • Search again: Shortcut to move to the next occurrence of the searched pattern. If the shortcut is the same as for Search Selection, the effect of the command will be to search for the next occurrence of the currently searched pattern unless something else is selected in the editor. In that case, the editor will look for the next occurrence of the selected text. The default key combination for this command is "F3".

  • Search backwards: Shortcut to move to the previous occurrence of the searched pattern. The default key combination for this command is "Shift+F3".

  • Show search panel: Shortcut to make the search panel appear if it is not displayed and to give the focus to the "Search for" field. The default key combination for this command is "Ctrl+F".

  • Show search and replace panel: Shortcut to make the search panel with the "Replace with" field appear if it is not displayed. The focus will be given to the "Search for" field. The default key combination for this command is "Ctrl+H".

Caution:
You should not use combinations made of only "Alt" and another key as they are reserved for menu shortcuts.

Tips:
On the other hand, you may use combinations made of only a key to create very fast shortcuts, for example with the function keys.
To know what string corresponds to a given key, you can look up in the EV_KEY_CONSTANTS of EiffelVision2. The `key_strings' table links keys with a string representation.

There are three other categories in the shortcut preferences. These can be used to automatically insert a user-defined string in the editor. If you find yourself typing some strings very often, these preferences can be handy.


Automatic completion preferences

  • Introduction
  • General preferences
  • Syntax completion preferences


Introduction

Most of the automatic completion preferences are related to syntax completion. They will allow you to specify the way your code is completed as you type keywords.
There are two parts in this section: general preferences regarding automatic completion and keyword completion redefinition.


General automatic completion preferences

You will find the following preferences in the "Automatic completion" subfolder of the "Editor" preferences folder :

  • Brackets and parentheses are closed automatically: If this is set to True, a closing bracket will be automatically inserted when you type an opening one. It means that ')', '}' or ']' will be added when you write '(', '{' or '['. If it is set to False, this feature is disabled. The default value is False.

  • Quotes are closed automatically: If this is set to True, '"', ''' or ''' will be respectively added when you type '"', ''' or '`'. If it is set to False, this feature is disabled. The default value is False.

  • Enable syntax autocomplete: If this is set to True, automatic syntax completion will be triggered when you type a keyword. If not, keywords will be handled the same way as other words. The default value is True.

  • Any features appear in the feature call complete window: If this is set to True, the features of class ANY will appear in the list of the feature call completion window. Otherwise, they will be hidden. The default value is False.


Syntax automatic completion preferences

  • Introduction
  • Keywords automatic completion preferences
  • Keyword completion customization
  • Default values for keyword completion preferences


Introduction

EiffelStudio editor can detect many keywords and trigger an automatic syntax completion.
This section of the documentation contains a description of what can be customized. You will also find an explanation of the syntax to be used in completion preferences, and their default values.


Keywords automatic completion preferences

Description

Keywords completion preferences can be found in the subdirectories of "Automatic completion" (located in "Tools" -> "Editor"). Keywords are located in subdirectories as described below :

  • Class structure keywords:
    • class
    • creation
    • feature
    • indexing
    • inherit
  • Feature structure keywords
    • is
    • require
    • require else
    • local
    • do
    • deferred
    • external
    • rescue
    • ensure
    • ensure then
  • Control structures keywords
    • if
    • then
    • elseif
    • else
    • inspect
    • when
    • from
    • variant
    • until
    • loop
    • debug
    • check
  • Inherit clauses keywords
    • rename
    • redefine
    • undefine
    • select
    • export
  • Other keywords
    • Precursor
    • create
    • obsolete
    • invariant
    • end

Usage

A directory is associated with each keyword. These directories contains six items which you may modify to customize the automatic completion of the keyword:

  • Autocomplete <keyword>: If this is set to True, the automatic completion will be triggered when you type the keyword in the editor. If it is set to False, the keyword will be processed as a normal word.

  • Use default autocomplete: If this is set to True, the next preferences will be ignored and the default completion scheme will be used. Otherwise, the automatic completion will use the user-defined strings described below.

  • Customized autocomplete (Return after keyword was typed): This string defines what will be inserted as you press Return just after typing the keyword if you chose not to use the default value (see Use default autocomplete above).

  • Customized autocomplete (Space after keyword was typed): This string defines what will be inserted as you press Space just after typing the keyword if you chose not to use the default value (see Use default autocomplete above).

  • Customized autocomplete (Return, other cases): This string defines what will be inserted as you press Return after a keyword which had been previously typed. It is effective only if you chose not to use the default value (see Use default autocomplete above).

  • Customized autocomplete (Space, other cases): This string defines what will be inserted as you press Space after a keyword which had been previously typed. It is effective only if you chose not to use the default value (see Use default autocomplete above).

The syntax used in the four last item is described in Keyword completion customization. Default values are accessible in Keyword completion default values.


Keyword completion customization

This document describes the syntax used to customize keyword automatic completion.
Four strings are used to define the completion of a keyword. The rules are the same for all of them:

  • These strings will be inserted right after the keyword. The key that triggers the automatic completion will not be taken into account, i.e. no space or "new line" character will be inserted even though you press Return or Space. The strings should therefore begin with a space or a "new line" character (see below for "new line").

  • Two reserved words will allow you to position the cursor and to indent the text properly. Insert the word $cursor$ in the string where you want the cursor to be moved once the completion is finished. Insert the word $indent$ where you want to copy as many blank spaces as there were on the line where the keyword was typed.

  • Three special characters are available:

    • %N represents the new line character.
    • %T represents the tabulation
    • %B represents the back space

Examples :

  1. You want the lines of code :

    if
    next_line_of_code

    to become:

    if <cursor here> then
    <one more tabulation>
    end
    next_line_of_code

    as you press Space just after typing if. You should define the "Customized autocomplete (Space after keyword was typed)" string for if as :

    " $cursor$ then%N$indent$%T%N$indent$end"

    First, EiffelStudio editor has to insert a blank space after if. The string begins therefore by a blank space.
    Then, $cursor$ tells EiffelStudio to move the cursor to this position after the completion.
    then is inserted after the cursor position.
    %N indicates that you want to insert a new line after then.
    $indent$%T means that this line is filled with as many blank spaces as there are before if plus a tabulation.
    Another line is inserted with %N.
    Then $indent$end means that end will be inserted in this new line with the same indentation as if.

  2. You want the lines of code :

    end
    next_line_of_code

    to become:

    end

    next_line_of_code

    as you press Return just after typing end. You should define the "Customized autocomplete (Return after keyword was typed)" string for end as :

    "%B%B%B%Bend%N$indent$%B$cursor$"

    The four %B will remove end plus one character before end (the tabulation character).
    end will be inserted at this new position.
    %N indicates that you want to insert a new line.
    $indent$%B$cursor$ means that the cursor will be moved to the end of the line where one less blank space than before the original end will have been inserted.

Note: EiffelStudio editor can insert spaces instead of tabulation when you use special character %T. This is set in another section of the preferences.

See Also
Keyword completion customization
Default values for keyword completion preferences


Default values for keyword completion preferences

This document contains the description of default completion for recognized keywords. The syntax used is the one used to redefine keyword completion in the preferences.
Four tables list default values for each of the four preferences attached to each keyword.

  1. Default value for "Customized autocomplete (Space after keyword was typed)"
    Keyword | Value
    indexing | " $cursor$"
    class | " $cursor$"
    inherit | " $cursor$"
    creation | " $cursor$"
    feature | " $cursor$"
    is | " $cursor$"
    require | " $cursor$"
    require else | " $cursor$"
    local | " $cursor$"
    do | " $cursor$ end"
    once | " $cursor$ end"
    deferred | " end$cursor$"
    external | " "$cursor$" end"
    rescue | " $cursor$"
    ensure | " $cursor$"
    ensure then | " $cursor$"
    if | " $cursor$ then%N$indent$%T%N$indent$end"
    then | " $cursor$"
    elseif | " $cursor$ then%N$indent$%T"
    else | " $cursor$"
    inspect | " $cursor$%N$indent$when then%N$indent$%T%N$indent$else%N$indent$%T%N$indent$end"
    when | " $cursor$ then%N$indent$%T"
    from | " $cursor$%N$indent$until%N$indent$loop%N$indent$end"
    variant | " $cursor$"
    until | " $cursor$"
    loop | " $cursor$"
    debug | " $cursor$ end"
    check | " $cursor$ end"
    rename | " $cursor$"
    redefine | " $cursor$"
    undefine | " $cursor$"
    select | " $cursor$"
    export | " $cursor$"
    Precursor | " {$cursor$}"
    create | " $cursor$"
    obsolete | " "$cursor$""
    invariant | " $cursor$"
    end | " $cursor$"

  2. Default value for "Customized autocomplete (Return after keyword was typed)"
    Keyword | Return
    indexing | "%N$indent$%T$cursor$"
    class | "%N$indent$%T$cursor$"
    inherit | "%N$indent$%T$cursor$"
    creation | "%N$indent$%T$cursor$"
    feature | "%N$indent$%T$cursor$"
    is | "%N$indent$%T%T-- $cursor$"
    require | "%N$indent$%T$cursor$"
    require else | "%N$indent$%T$cursor$"
    local | "%N$indent$%T$cursor$"
    do | "%N$indent$%T$cursor$%N$indent$end"
    once | "%N$indent$%T$cursor$%N$indent$end"
    deferred | "%N$indent$end$cursor$"
    external | "%N$indent$%T"$cursor$"%N$indent$end"
    rescue | "%N$indent$%T$cursor$"
    ensure | "%N$indent$%T$cursor$"
    ensure then | "%N$indent$%T$cursor$"
    if | "%N$indent$%T$cursor$%N$indent$then%N$indent$%T%N$indent$end"
    then | "%N$indent$%T$cursor$"
    elseif | "%N$indent$%T$cursor$%N$indent$then%N$indent$%T"
    else | "%N$indent$%T$cursor$"
    inspect | "%N$indent$%T$cursor$%N$indent$when then%N$indent$%T%N$indent$else%N$indent$%T%N$indent$end"
    when | "%N$indent$%T$cursor$%N$indent$then%N$indent$%T"
    from | "%N$indent$%T$cursor$%N$indent$until%N$indent$%T%N$indent$loop%N$indent$%T%N$indent$end"
    variant | "%N$indent$%T$cursor$"
    until | "%N$indent$%T$cursor$"
    loop | "%N$indent$%T$cursor$"
    debug | "%N$indent$%T$cursor$%N$indent$end"
    check | "%N$indent$%T$cursor$%N$indent$end"
    rename | "%N$indent$%T$cursor$"
    redefine | "%N$indent$%T$cursor$"
    undefine | "%N$indent$%T$cursor$"
    select | "%N$indent$%T$cursor$"
    export | "%N$indent$%T$cursor$"
    Precursor | "%N$indent$%T$cursor$"
    create | "%N$indent$%T$cursor$"
    obsolete | "%N$indent$%T"$cursor$""
    invariant | "%N$indent$%T$cursor$"
    end | "%N$indent$$cursor$"

  3. Default value for "Customized autocomplete (Space, other cases)"
    Keyword | Space
    indexing | " $cursor$"
    class | " $cursor$"
    inherit | " $cursor$"
    creation | " $cursor$"
    feature | " $cursor$"
    is | " $cursor$"
    require | " $cursor$"
    require else | " $cursor$"
    local | " $cursor$"
    do | " $cursor$"
    once | " $cursor$"
    deferred | " $cursor$"
    external | " $cursor$"
    rescue | " $cursor$"
    ensure | " $cursor$"
    ensure then | " $cursor$"
    if | " $cursor$"
    then | " $cursor$"
    elseif | " $cursor$"
    else | " $cursor$"
    inspect | " $cursor$"
    when | " $cursor$"
    from | " $cursor$"
    variant | " $cursor$"
    until | " $cursor$"
    loop | " $cursor$"
    debug | " $cursor$"
    check | " $cursor$"
    rename | " $cursor$"
    redefine | " $cursor$"
    undefine | " $cursor$"
    select | " $cursor$"
    export | " $cursor$"
    Precursor | " $cursor$"
    create | " $cursor$"
    obsolete | " $cursor$"
    invariant | " $cursor$"
    end | " $cursor$"

  4. Default value for "Customized autocomplete (Return, other cases)"
    Keyword | Return
    indexing | "%N$indent$$cursor$"
    class | "%N$indent$$cursor$"
    inherit | "%N$indent$$cursor$"
    creation | "%N$indent$$cursor$"
    feature | "%N$indent$$cursor$"
    is | "%N$indent$$cursor$"
    require | "%N$indent$$cursor$"
    require else | "%N$indent$$cursor$"
    local | "%N$indent$$cursor$"
    do | "%N$indent$$cursor$"
    once | "%N$indent$$cursor$"
    deferred | "%N$indent$$cursor$"
    external | "%N$indent$$cursor$"
    rescue | "%N$indent$$cursor$"
    ensure | "%N$indent$$cursor$"
    ensure then | "%N$indent$$cursor$"
    if | "%N$indent$$cursor$"
    then | "%N$indent$$cursor$"
    elseif | "%N$indent$$cursor$"
    else | "%N$indent$$cursor$"
    inspect | "%N$indent$$cursor$"
    when | "%N$indent$$cursor$"
    from | "%N$indent$$cursor$"
    variant | "%N$indent$$cursor$"
    until | "%N$indent$$cursor$"
    loop | "%N$indent$$cursor$"
    debug | "%N$indent$$cursor$"
    check | "%N$indent$$cursor$"
    rename | "%N$indent$$cursor$"
    redefine | "%N$indent$$cursor$"
    undefine | "%N$indent$$cursor$"
    select | "%N$indent$$cursor$"
    export | "%N$indent$$cursor$"
    Precursor | "%N$indent$$cursor$"
    create | "%N$indent$$cursor$"
    obsolete | "%N$indent$$cursor$"
    invariant | "%N$indent$$cursor$"
    end | "%N$indent$$cursor$"

See Also
Keywords automatic completion preferences
Keyword completion customization


Graphical elements

  • Introduction
  • Texts display preferences
  • Discardable dialog windows


Introduction

This section of the documentation describes preferences that belong to the "Graphical elements" category. This group contains two kinds of properties, some related to the way texts are displayed in EiffelStudio, others that define which dialog windows should not be displayed. You can also decide to use animated icons in the status bars whenever possible (that is, during compilations and executions).


Texts display preferences

You may customize texts display in EiffelStudio by modifying preferences in the "Graphical elements" category and in its "Colors" sub-category.

"Graphical elements" contains the following properties in relation with texts:

  • The font used in EiffelStudio editors ("All-purpose editor font"). You can change this by using a font selection window.
  • The font used for Eiffel keywords in EiffelStudio editors ("Keyword editor font"). You can change this by using a font selection window.
  • The tabulation size : This integer set to how many blank spaces a tabulation will be equivalent on screen. The default value is 4.

Note: The last property ("Use animated icons") decides whether animated icons should be used in status bars when they are available.

The "Color" sub-category gathers color preferences. By modifying them, you will be able to choose in which color the different elements detected by the syntactical analyzer (such as keywords, numbers, comments,...) will be displayed. Changes will be made via a color selection window.


Discardable dialogs

Some dialogs in EiffelStudio include a check box labeled "Do not show me again". If you select it, the dialog will not be shown the next time the same situation occurs. The "dialogs" sub-category of "Graphical elements" in the preferences lists the state of those discardable dialogs: a boolean preference is associated with each of them. The window will be shown if and only if the corresponding preference is set to True.


Wizards

  • EiffelCOM Wizard


EiffelCOM Wizard

Type: Wizard
Platform: Windows
Version: 5.0
Availability: Full Package

See:

  • Introduction
  • Guided Tour
  • Reference

See Also: The Component Object Model, EiffelCOM library


EiffelCOM Wizard Introduction

Introduction

The COM standard allows software components written in different languages to communicate with each other. Unfortunately, building COM compliant applications requires the development of large amount of code only dedicated to support the technology. The EiffelCOM wizard was designed to free programmers from writing the plumbing code.

The EiffelCOM wizard is a powerful tool that enables the fast development of COM components in Eiffel and access COM components from Eiffel systems. It consists of a series of dialogs, which ask about the component’s characteristics. The wizard needs the data to produce an Eiffel system skeleton, the code to access or create a component, and the component-specific runtime libraries.

The wizard allows Eiffel developers with little COM knowledge to develop and reuse COM components. The design of the generated code follows the Eiffel standards and is familiar experienced Eiffel users. The only prerequisite to use the EiffelCOM wizard is an understanding of the Interface Definition Language. IDL describes a component. Standard compilers can generate Type Libraries from IDL files. Tools that need information on a given component, such as the EiffelCOM wizard, Visual Basic, etc. analyze Type Libraries. The IDL syntax is very close to C and easy to learn.

The wizard generates code from a Type Library and additional information given by the user. The generated code consists of Eiffel classes, C/C++ files, and library files. The wizard automatically produces library files from generated C and C++ code. You do not need to modify generated C/C++ code to build your EiffelCOM system.

Code Generation Process

The wizard automatically compiles the generated C and Eiffel code. To produce a Type Library corresponding to a given IDL file the wizard uses MIDL, the MICROSOFT IDL compiler. You may also provide the wizard with a Type Library directly. For the rest of the manual a COM Definition File will refer to the input file given to the wizard (either an IDL file or a Type Library). If you want to start from an existing Eiffel system, the wizard accepts an Eiffel class and generates an IDL file from it and then proceeds as above.

See Also: Guided Tour, EiffelCOM wizard reference


EiffelCOM Wizard Guided Tour

Guided Tour

This chapter explains how to use the EiffelCOM wizard to create COM components and to access existing components.

See:

  • Creating a new COM component.
  • Creating a new component from an Eiffel Project.
  • Accessing a COM component.

See Also: Introduction, EiffelCOM wizard reference


Creating a new COM component

The first tutorial describes creating a COM component from a COM definition file that is either an IDL file or a Type Library. The tutorial focuses on creating an in-process (DLL) component, called StringManipulator. The component exposes one interface IString that includes the functions ReplaceSubstring and PruneAll corresponding respectively to the features replace_substring and prune_all of the EiffelBase STRING and the property String that represents the manipulated string. The property can be set or read. Other languages will be able to access these features.

Step by step instructions

  1. Launch the EiffelCOM Wizard (from the Start menu, open Programs then EiffelXX and click EiffelCOM Wizard)
  2. Choose Create a new project from a COM definition.
  3. Click Next
  4. Choose Server code for a new component
  5. Click Next
  6. Click the top Browse button and open the file $ISE_EIFFEL\examples\com\wizard\string_manipulator\string_manipulator.idl where $ISE_EIFFEL represents the path to your EIFFEL50 directory.
  7. Click the bottom Browse button and select the directory where you want to create the project (later referenced as destination folder). Choose $ISE_EIFFEL\examples\com\wizard\string_manipulator\generated where $ISE_EIFFEL represents the path to your EIFFEL50 directory. If you work on a Windows9x machine, please choose a directory with a shorter path, for example c:\string_manipulator because Windows9x are unable to handle long path names.
  8. Click Next
  9. Choose Automation
  10. Click Next
  11. Click Finish
  12. Wait until the wizard is done.

First look at the generated code

At the end of the processing the wizard automatically launches EiffelStudio with the generated project to help you navigate created Eiffel classes. You might want to look at the file generated.txt in the destination folder, which contains a list of files generated by the wizard. The file string_manipulator.log holds summary of the processing and error and warning messages.

The deferred class STRING_MANIPULATOR_COCLASS represents component functionality. It inherits from ISTRING_INTERFACE that corresponds to the IString interface. It has one descendant STRING_MANIPULATOR_COCLASS_IMP that implements the deferred features. The default implementation is empty.

implementing the component

To do something more interesting than merely return an error to a client edit the implementation of the STRING_MANIPULATOR_COCLASS_IMP class. The wizard would not overwrite this class in future executions. There is an implementation of the class in $ISE_EIFFEL\examples\com\wizard\string_manipulator\server\. Copy this file over to $ISE_EIFFEL\examples\com\wizard\string_manipulator\generated\server\component and freeze the project. Voila!, you have your first EiffelCOM component up and running.

Tips:

To develop an EiffelCOM component you need to set the registry entry MELT_PATH because the system is not launched from the directory containing the byte code (by default EIFGEN\W_code). The EiffelCOM component client launches the server from its current location and causes the server to crash if the MELT_PATH key does not setup properly. To put this value in your registry, create a key under HKEY_CURRENT_USER\SOFTWARE\ISE\Eiffel51 with the same name as the name of your project (e.g. string_manipulator) and add the string value named MELT_PATH containing the path to the byte code (.melted file). You will find an example of such entry in the file melted_path.reg in $ISE_EIFFEL\wizard\config. Edit this file as needed (replace string_manipulator with the name of your system and change the path to point on the correct location using `\\' as directory separator) and then double click on it to enter the information into the registry.

To test the component, you need to register it first. Register an in-process component via the regsvr32 utility using the following syntax: regsvr32 system_name.dll where system_name is the name of the dll (e.g. string_manipulator). Register an out-of-process component using the following syntax: system_name.exe -Regserver where system_name is the name of the component executable file.

To complete this tutorial you need to register the component with the following command (run from a dos console): regsvr32 string_manipulator.dll and to enter the information in $ISE_EIFFEL\wizard\config\melted_path.reg. You have to change the content of this file if you have not installed Eiffel under C:\ and/or have used a different destination directory.

See Also: Creating a new component from an Eiffel Project, Accessing a COM component.


Creating a new component from an Eiffel project

The second tutorial describes creating a COM component from an Eiffel system. The tutorial example String is almost identical to StringManipulator of the previous tutorial. In the StringManipulator example the wizard starts from IDL file and builds an Eiffel System; in contrast, the String example takes an Eiffel system and generates an IDL file and the required plumbing code to make the Eiffel project accessible to COM runtime. You do not need to modify any Eiffel or C code.

Step by step instructions

  1. Create a new Eiffel project in the directory $ISE_EIFFEL\examples\com\wizard\e2idl\eproject where $ISE_EIFFEL represents the path to your EIFFEL50 directory.
  2. Select Ace file from the same directory and compile.
  3. Launch the EiffelCOM Wizard (from the Start menu, open Programs then EiffelXX and click EiffelCOM Wizard)
  4. Choose Create a new project from an existing Eiffel project.
  5. Click Next
  6. Click Next again
  7. Click the top Browse button and open the file $ISE_EIFFEL\examples\com\wizard\e2idl\eproject\string.epr where $ISE_EIFFEL represents the path to your EIFFEL50 directory.
  8. Click the second Browse button and open the file $ISE_EIFFEL\examples\com\wizard\e2idl\ eproject\Ace.ace where $ISE_EIFFEL represents the path to your EIFFEL50 directory.
  9. In the third entry field enter string_manipulator.
  10. In the forth entry field enter root_cluster.
  11. Click Next.
  12. Click the Browse button and select the directory where you want to create the project (the destination folder). Choose $ISE_EIFFEL\examples\com\wizard\e2idl\generated where $ISE_EIFFEL represents the path to your EIFFEL50 directory. If you work on a Windows 9x machine, please choose a directory with a shorter path, for example c:\e2idl.
  13. Click Next
  14. Choose Automation
  15. Click Next
  16. Click Finish
  17. Wait until the wizard is done.

First look at the generated code

The only generated Eiffel class is COM_<Name_of_system>_REGISTRATION. You do not need to modify or implement any classes. The wizard produces a ready-to-use component.

Tip: In most Eiffel systems functionality is spread out throughout the system. No single class exposes the full functionality of the system and can serve as a Facade to the outside world. Running the wizard on any such class would not be practical. Before starting the wizard write an Eiffel class that acts as a Facade and forwards client calls to the appropriate sybsystems. Enter the Facade class name into "Enter Eiffel class name" field of the third dialog (Eiffel Project File Dialog). The wizard generates an IDL file from this class.

See Also: Creating a new COM component, Accessing a COM component.


Accessing a COM component

The third tutorial describes how to access a COM component and build reusable library.

Step by step instructions

  1. Launch the wizard
  2. Choose Create a new project from a COM definition and click Next
  3. Click Next again
  4. Click the top Browse button and open the file $ISE_EIFFEL\examples\com\wizard\string_manipulator\string_manipulator.idl where $ISE_EIFFEL represents the path to your EIFFEL50 directory. You could also choose to open the type library (.tlb) that was generated by the wizard when Creating a new COM component. in the destination folder of that first project.
  5. Click the bottom Browse button and select the directory where you want to create the project (later referenced as destination folder). Choose $ISE_EIFFEL\examples\com\wizard\string_manipulator\client\generated where $ISE_EIFFEL represents the path to your EIFFEL50 directory.
  6. Click Next
  7. Click Finish
  8. Wait until the wizard is done.

First look at the generated code

At the and of the generation the wizard precompiles the generated code and open EiffelStudio on the precompilation project. Note: a precompilation project is read-only, you need to start another EiffelStudio to reuse the generated classes. The interesting classes are all related to the coclass proxy STRING_MANIPULATOR_PROXY. The proxy is the Eiffel class that gives access to the component. Each feature on the proxy calls the corresponding interface function on the component. You can use the EiffelStudio opened by the wizard to browse through the generated classes and study the class hierarchy.

Implementing a client

To implement a client of the StringManipulator component open a new EiffelStudio. Create the project in $ISE_EIFFEL\examples\com\wizard\string_manipulator\client using the ace file found in that directory. Freeze and run the project. You are now accessing the previously built component and calling functions on its interfaces!. The class MY_STRING_MANIPULATOR inherits from the generated STRING_MANIPULATOR_PROXY and redefines the feature replace_substring_user_precondition. The generated interfaces include contracts for each exposed function. You can redefine the user_precondition features to implement your own preconditions.

Contracts

Contracts can be broken directly on the proxy in which case you will get a standard contract violation or in the server. If contracts are broken on the server then the exception will be forwarded by the EiffelCOM runtime to the client. The feature replace_substring_user_precondition in MY_STRING_MANIPULATOR includes the following commented line:

-- Result := True

Un-comment this line by removing the preceding ` -- ' and comment out the rest of the feature. Now the contract of the replace_substring feature is wrong and erroneous calls can be made. Quick melt the changes and run the client. Enter some invalid numbers in the fields used to call this feature. After you click Replace you will see an error message box warning you that a precondition was violated on the server side. This is how you can use contracts `over the wire'. The preconditions was violated in the server, this exception was caught by the EiffelCOM runtime and sent back to the client.

See Also: Creating a new COM component, Creating a new component from an Eiffel Project.


EiffelCOM Wizard Reference

Version: 5.0

Availability: Basic Package.

This chapter details the wizard and code generation. The wizard has seven different dialogs. The third dialog is different depending on whether the wizard have started from an Eiffel system, an IDL file, or a Type Library. Once the dialogs have been completed, the wizard generates a Type Library if needed, then analyzes the Type Library, and generates the code.

See:

  • Introduction Dialog and Main Window
  • Generated Code Type Dialog
  • Definition File Dialog
  • Eiffel Project File Dialog
  • Destination Folder Dialog
  • IDL Marshaling Definition Dialog
  • Type Library Marshaling Definition Dialog
  • Final Dialog
  • COM Definition File Processing
  • Eiffel Project Processing
  • Generated Files
  • Class Hierarchy
  • Accessing a Component
  • Building a Component

See Also: Introduction, Guided Tour


Introduction Dialog and Main Window

The EiffelCOM wizard can be launched from the Windows start menu:

Start->Programs->EiffelXX->EiffelCOM Wizard

where EiffelXX corresponds to your Eiffel installation (e.g. Eiffel50). The following window will be displayed:

EiffelCOM Wizard Main Window and Introduction Dialog

The introduction dialog lets you choose between opening an existing project or creating a new one either from a COM definition or from an Eiffel project. Creating a new project will open the Generated Code Type Dialog. Opening an existing project will display an Open File Dialog from which you can select a previously saved EiffelCOM project.

The four buttons at the bottom of the dialog Back, Next, Cancel and Help are common to all dialogs displayed throughout the execution of the wizard. Next validates all the values entered in the current dialog and activates the next one. Back discards all the values entered in current dialog and displays the previous one. Cancel exits the dialog and discards all the values entered. Finally, Help brings up this manual.

EiffelCOM Wizard Main Window

The main window includes a toolbar and a menu. The first three buttons on the toolbar correspond to the first three entries in the File menu: New, Open and Save. New resets all the information previously entered in the wizard. Open brings up an Open File Dialog that can be used to retrieve a previously saved EiffelCOM project. Save is used to save the current project. A project is defined by all the values entered in the wizard. A project can be saved only after the wizard has been run. The file extension for an EiffelCOM project is ewz.

The second menu, Build, includes the entries Launch Wizard and Generate (no wizard) corresponding respectively to the last two toolbar buttons. The former activates the Generated Code Type Dialog. while the later launches the generation with the current settings and bypasses the dialogs. This last button can be used only when a project has been loaded or when the wizard has been run once.

The third menu, Help, includes Help and About EiffelCOM. Help brings up this manual. About EiffelCOM brings About EiffelCOM Dialog that gives the version number.

About EiffelCOM Dialog

Note: Before you launch the wizard make sure you have a COM definition file or an Eiffel project ready for processing.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Generated Code Type Dialog

The first dialog asks whether you want to access or to build a component. If you want to access an existing component then the generated code will be for a client. If you choose to build a new one, the generated code will be for a COM server. Choose the server or client check box to specify which kind of project you want to work on. You may specify both in the case where both the component and its client(s) will be written in Eiffel.

Generated Code Type Dialog

EiffelCOM supports the following component executable types:

In-Process: These components are Dynamic Link Libraries (DLLs) that will be loaded into the client process. The server runs in the same process as the client.

Out-of-process: These components are executable files that can be accessed through the network. Clients and servers run in different processes and may even run on different machines.

In-process components are Active-X like components; they are usually smaller than local or remote components and used by bigger application (often through a high level language). Local components run on the same machine as a client. Remote components run on different machine and can act as middleware in a three-tier client server architecture. Choose the kind of component you want to access or create.

If you do not want to compile the generated code automatically, check the checkboxes at the bottom of the dialog.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Definition File Dialog

This dialog asks for the location of a COM definition file for the project. A COM definition file is either an IDL file or a Type Library. An IDL file is usually provided when building a new component since all the sources are available. However, when it comes to accessing an existing component, the sources might not be available. A Type Library is often embedded into the component and includes enough information for the wizard to generate the code.

Definition File Dialog

The wizard accepts the following type extensions: idl, tlb, ocx, olb, dll, and exe.

Definition File Dialog, file extensions

The destination folder is the directory where the wizard saves generated files. The directory should be empty. If the wizard were to overwrite an existing file it would first back it up and emit a warning message. If any of the entered values are not correct when the Next button is pressed the wizard displays a warning message.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Eiffel Project File Dialog

The Eiffel project file Dialog asks for the location of an Eiffel project file (*.epr), the Ace file of the project, the name of the Eiffel class that will be converted into an IDL file, and the cluster name to which the Eiffel class belongs.

Eiffel Project File Dialog

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Destination Folder Dialog

The Destination Folder Dialog asks for the destination folder path where the wizard can safe generated files.

Destination Folder Dialog

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


IDL Marshalling Definition Dialog

This dialog is displayed only for a server project and if the chosen definition file is an IDL file. It is used to specify how marshalling will work for the component. The first choice that has to be made is whether the component will be accessed through Automation (using IDispatch) or through the interface's virtual table (for additional information on Automation versus virtual table access, please consult COM).

IDL Marshalling Definition Dialog

If you choose Automation, then the Universal marshaler will be used (for additional information on Marshalling please see the chapter COM). If you specify Virtual Table access, then you have the choice between using the Windows Universal marshaler and the marshaler generated from the definition file. Since this dialog is displayed only when the definition file is an IDL file, choosing Standard Marshalling will force the wizard to compile the marshaler from the code generated with the MIDL compiler. Standard marshalling should be used whenever some interface functions make use of non-Automation compatible types.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Type Library Marshalling Definition Dialog

The Type Library Definition Dialog is displayed only for a server project when the definition file is a Type Library. You have to choose between Automation and Virtual Table access and between Universal and Standard marshaling.

Type Library Marshalling Definition Dialog

Because the definition file is a Type Library, the wizard cannot compile the Standard marshaler without additional information. This is the reason for having an extra text field for the path to the marshaler (also known as Proxy/Stub pair or just Proxy/Stub). The Proxy/Stub is a Dynamic Link Library that is used to marshal the data on the wire for a given component.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Final Dialog

The last dialog offers a choice of different output levels. By default, the wizard will display errors, warnings and generic information. You can choose not to see warnings and/or extra information.

Final Dialog

This dialog also asks whether you wish to continue even though an error occurred while compiling a file.

The Finish button closes the dialog and starts the processing. You can save the project after the wizard finishes.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


COM Definition File Processing

Six phases are involved in the COM definition file processing:

IDL Compilation: If the definition file is an IDL file, the wizard compiles the IDL file into a Type Library and if Standard Marshalling have been chosen, produces the marshaler from the generated C files.

Type Library Parsing: The wizard analyzes the type library and transforms the information it needs to generate the code into internal representation.

Code Generation: The wizard generates both the Eiffel and C/C++ code from the information gathered during the previous step.

C/C++ Compilation: The wizard compiles the generated C and C++ code into object files and libraries that will be linked with the Eiffel system.

Eiffel Compilation: For a client project the wizard compiles the generated Eiffel code into a precompiled library that can be reused from other projects. For a server project the wizard compiles the generated Eiffel code into a standard project with the registration class as root class. If the location is In-process then the project corresponds to a DLL whereas if the location of the server is out-of-process then the project corresponds to a standard executable.

Finally, the wizard launches EiffelStudio and automatically opens the generated Eiffel system.

During processing, the name and progress of each phase is displayed.

Wizard Progress Dialog

While processing the wizard displays information in real time in the main window if this option was chosen in the Final Dialog. Displayed information includes output of calls to external compilers (C, Eiffel and IDL) and description of the current analyzed or generated Type Library item.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Eiffel Project Processing

Eiffel project processing has an additional phase: IDL file generation. During the phase the wizard translates an Eiffel class into an IDL file. Preferably, you should write a special class to serve as a Facade to your system. After IDL generation the wizard proceeds as above.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Generated Files

The wizard generates code into the specified destination folder. The file hierarchy is the following:

Generated Files Hierarchy

The root folder has two files and four subclusters.

The file generated.txt includes a list of all the files generated by the wizard.

The file component.log contains a summary of the processing done by the wizard. The name of the file is the name of the definition file appended with log (so Figure 10 presumes that the definition file was e.g. component.idl)

The folder idl contains the generated IDL file.

The folders Client and Server include the files generated respectively for reusing a component or creating a new component. Each consists of three subdirectories: Include comprises header files needed to compile the Eiffel code, CLib contains the generated C and C++ code as well as the library files. Component holds Eiffel code that wraps or defines the component. The Component subfolder of Server also includes the registration class. This Eiffel class contains the code needed to activate the component; it depends whether the component is in-process or out-of-process. You do not need to read or edit the C and C++ code included in CLib because the wizard automatically compiles it. It is given for information only and can be deleted (you need to keep the library file though). The Client and Server folders also have an Ace file used to compile the generated Eiffel code. In the case of a client, the generated code is precompiled whereas in the case of a server it is compiled in a normal system with the registration class being the root class of the system. In the case of an in-process server the Eiffel system is compiled into a DLL whereas in the case of an out-of-process server, it is compiled in a standard executable.

The Common folder comprises code that is used for both the server and the client parts. The Include and CLib directories contain respectively the header files and the C and C++ code. The C and C++ sources are not needed and can be deleted, only the library file needs to be kept for the Eiffel system to compile. The Interfaces subdirectory include Eiffel classes corresponding to the component interfaces and the Structures subdirectory includes Eiffel classes wrapping data structures specified in the definition file.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Class Hierarchy

The generated Eiffel code reflects the architecture of the component described in the definition file. Each interface corresponds to a deferred Eiffel class that includes one deferred feature per interface function. The deferred features are implemented in the heir inheriting from all interfaces. This central class will be referred to as Eiffel coclass in the rest of this document.

EiffelCOM System Basic Architecture

In a client application the Eiffel coclass inherits from the class ECOM_QUERIABLE, which is part of the EiffelCOM library. This class includes the feature make_from_other to initialize the component from another instance of ECOM_INTERFACE.

EiffelCOM System Basic Architecture

In a server application the Eiffel coclass inherits from the class ECOM_STUB, which is part of the EiffelCOM library. This class includes the feature create_item to initialize the component for COM.

The Interface_proxy folder includes Eiffel classes wrapping interfaces that are sent to or received by the component. Such interfaces will be referred to as client implemented interfaces in the rest of the document. These classes inherit from both the deferred interface class and ECOM_QUERIABLE.

Client Implemented Interfaces

The Interface_stub folder includes Eiffel classes implementing interfaces that are sent by the component. Such interfaces will be referred to as server implemented interfaces in the rest of the document. These classes inherit from both the deferred interface class and ECOM_STUB.

Server Implemented Interfaces

For both Eiffel coclass and Implemented interfaces, the INTERFACE class contains no implementation; it only defines the signatures of the functions that are part of the interface. The actual implementation lies in the heir of that class.

How you should use the generated classes in your system depends on whether you want to access an existing component (client) or build a new component in Eiffel (server).

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Accessing a COM Component

The wizard generates all the necessary code to access the existing component. The plumbing is already done, so instantiating an Eiffel coclass actually initializes COM internals.

Using the Generated Code

To access the component, you need to call features of the coclass. The data types of function arguments are either Eiffel types defined in Eiffel data structure libraries (EiffelBase), standard COM data types defined in the EiffelCOM library, or component COM data types specified in the definition file. For example, from the following IDL line

HRESULT InterfaceFunction ([in] int a, [out, retval] MyStruct * b)

The wizard generates the following feature in the Eiffel coclass:

interface_function (a: INTEGER): MY_STRUCT_RECORD

where MY_STRUCT_RECORD is a generated Eiffel class wrapping MyStruct.

Here is a more difficult example:

HRESULT a_function ([in] IsomeInterface * p_interface)

The wizard generates the following Eiffel feature:

a_function (p_interface: ISOME_INTERFACE_INTERFACE)

where ISOME_INTERFACE_INTERFACE is a generated deferred class. Where can you obtain an instance of the class? First, you may receive from other function. Second, you can create an implemented server interface ISOME_INTERFACE_IMPL_STUB. In the later case you should provide your own implementation.

Contracts

The wizard cannot generate fully specified contracts. Indeed, the tool has no domain specific knowledge and can only generate contracts that are domain independent. Such contracts, although useful, are not enough to describe entirely the behavior of the component. Generated contracts include void Eiffel objects as well as C pointer validity (for wrappers) checking. There might be other conditions to allow calls to an Eiffel coclass feature. Invariants and postconditions can be enforced in an heir of the generated Eiffel coclass. Preconditions, however, cannot be strengthened. A workaround provided by the wizard is to generate a precondition function for each feature in the interface. The default implementation of these functions always returns True. They should be redefined to implement the correct behavior:

interface_function (a: INTEGER): MY_STRUCT is
-- Example of a generated Eiffel coclass feature
require
interface_function_user_precondition: interface_function_user_precondition
do
...
ensure
non_void_my_struct: Result /= Void
end

So the complete class hierarchy for an Eiffel client coclass is the following:

EiffelCOM Client System

Another advantage of the previous hierarchy is that it adds incrementality to the EiffelCOM system. Indeed, should the definition file be modified and the wizard run once more against it, your code would not be changed. Only the generated Eiffel coclass would be, and it would suffice to adapt your heir accordingly.

Exceptions

COM standard requires that any interface function returns a status value (known as a HRESULT). This corresponds to side effect features which the Eiffel methodology tends to avoid. The workaround used in EiffelCOM systems is to map these return values into Eiffel exceptions. If the server returns an error code, the EiffelCOM runtime raises an Eiffel exception that your code should catch.

EiffelCOM Client System Exception Raising

As a result, any feature in the coclass client making calls to the user defined Eiffel coclass should include a rescue clause. The processing done in this clause might depend on the nature of the exception. All the standard COM exceptions can be found in the library class ECOM_EXCEPTION_CODES, which is inherited from by ECOM_EXCEPTION. The later also inherits from the kernel class EXCEPTIONS and can consequently be used by the coclass client to catch the exceptions.

The following code snippet illustrates how a client can process exceptions raised in the Eiffel coclass:

indexing
description: "Eiffel coclass client example"

class
COCLASS_CLIENT

inherit
ECOM_EXCEPTION
export
{NONE} all
end

create
make

feature {NONE} -- Initialization

make is
-- Initialize Eiffel coclass.
do
create coclass.make
end

feature -- Basic Operations

coclass_feature_client is
-- Example of a coclass feature caller
local
retried: BOOLEAN
coclass: EIFFEL_COCLASS_PROXY
do
create coclass.make
if not retried then
coclass.coclass_feature -- Actual call
end
rescue
if hresult = E_notimpl then
-- Process non implemented function error.
retried := True
retry
elseif hresult = E_invalidarg then
-- Process invalid argument error.
retried := True
retry
else
-- Forward exception to caller.
end
end

end -- class COCLASS_CLIENT

Summary

There are a few rules to follow when building an Eiffel coclass client, but they are straightforward and do not add any constraints. First, inherit from the generated Eiffel coclass to implement the preconditions. Second, any feature call to the Eiffel coclass should include a rescue clause.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


Building a COM Component

The EiffelCOM wizard enables the development of COM components in Eiffel. To build a COM component you can start either from an IDL file or from an Eiffel project. In the later case the wizard generates an IDL file for you.

Choosing an Eiffel Class

If you start building a COM component from an Eiffel system, you need to give an Eiffel class to the wizard. The wizard translates the Flat-Short form of the class into an IDL file, which is a formal specification of the COM component. Clients of the component are able to access only features specified in the IDL file. You need to supply the wizard with a Facade class that provides clients with a higher-level, single interface (do not confuse with COM interface) to the facilities of a system.

The Facade class should satisfy the following requirements:

  • It should have a creation routine "make" without arguments. The wizard does not enforce the rule, but breaking it causes a runtime error.
  • Features of the class may only have arguments and return values of the following types: CHARACTER, INTEGER, REAL, DOUBLE, BOOLEAN, INTEGER_REF, BOOLEAN_REF, REAL_REF, CHARACTER_REF, DOUBLE_REF, STRING, DATE_TIME, ECOM_CURRENCY, ECOM_DECIMAL, ECOM_INTERFACE, and CELL and ECOM_ARRAY of above types. Features with arguments or return values of other types are excluded from the generated IDL file and are not accessible to the COM runtime.
  • Feature names should not be C++ keywords or names of standard library functions such as min, max, etc. The wizard is able to handle this correctly and to create a COM component; however, other languages may not be able to access it.
  • The class must belong to a compiled Eiffel project.

In most Eiffel systems functionality is spread out throughout many classes. A system may not contain a class that can render all services of the system and can serve as a Facade to the outside world. If you cannot find such a class you should write one.

Using the Generated Code

If you start from an Eiffel project, the wizard produces a ready-to-use component, and you do not need to modify or to implement any generated code.

If you start from a COM definition file, you are able to design a more flexible component that has more than one interface and/or coclass and user defined types, but you have to implement features of the generated coclass. The generated Eiffel coclass features are empty. You should redefine them in heir to implement the intended behavior. Unlike client generated code, the server generated code will differ whether you have chosen to implement an in-process or an out-of-process component. The difference lies in the component activation code in the class ECOM_<Name_of_system>_REGISTRATION. If the component is in-process then this class includes the four functions that need to be exported from an in-process COM component (DllRegisterServer, DllUnregisterServer, DllGetClassObject, and DllCanUnloadNow). If the component is out-of-process then the registration class includes a feature initializing the component and its graphical user interface.

The architecture of generated code for the server is similar to the one for the client: the generated Eiffel coclass should be inherited from and the contract features redefined. The default feature implementation of the generated Eiffel coclass is empty. Features should be redefined to implement the intended behavior. These features will be called by the EiffelCOM runtime whenever a client accesses an interface.

The architecture remains the same as when accessing a component: the generated Eiffel coclass should be inherited from and the contract features redefined. The default implementation for features from the generated Eiffel coclass are empty. They should also be redefined to implement the intended behavior. These features will be called by the EiffelCOM runtime whenever a client access an interface.

Note: For this first release, the name of the user defined coclass has to be <Name_of_generated_coclass>_IMP. So if the generated coclass name is MY_COCLASS then the user defined coclass name must be MY_COCLASS_IMP.

Component's GUI

In the case of an out-of-process server, you might want to add a Graphical User Interface to your component. There are two different scenarios in which the component can be activated: either its user launched it explicitly (e.g. by double clicking the executable icon) or it was launched by the COM runtime to satisfy a client request. The GUI should appear only in the former case, when the user has explicitly launched the application. The generated registration class for an out-of-process server includes the feature:

main_window: WEL_FRAME_WINDOW

This feature is a once function that can be redefined in a child class to return the class corresponding to the component window. This window is displayed only if COM does not start the component. When COM loads an out-of-process component, it appends the option "-embedding" to the executable. The generated registration class looks for this option and if it is part of the process argument list then it sets the default window appearance to hidden.

As a summary, when building a server from a COM definition you need to implement classes that inherit from coclasses and implement interface functions. The names of the children classes should be the names of the parent classes appended with _IMP. You will also have to inherit from the registration class in the case of an out-of-process component to provide the class that implements the component GUI.

Exceptions

The COM provides error status to the client by returning an HRESULT from the interface function. Such behavior is not acceptable in Eiffel and is replaced with exceptions. In the case of accessing an existing component, EiffelCOM runtime will raise exceptions with error code 24 (developer exception) and your code should catch them. When creating a component it will be your code that will raise exceptions and the EiffelCOM runtime that will catch them. Here is what the Eiffel code for a server should look like:

indexing
description: "Eiffel coclass server example"
class
ECOM_SERVER_COCLASS_IMP

inherit
ECOM_SERVER_COCLASS -- Generated by the wizard
ECOM_EXCEPTION
export
{NONE} all
end

feature -- Basic Operations
coclass_feature (an_argument: ARGUMENT_TYPE) is
-- Example of a coclass feature
do
if not is_valid (an_argument) then
trigger (E_invalidargument)
else
-- Normal processing
end
end

feature {NONE} -- Implspanentation
is_valid (an_argument: ARGUMENT_TYPE): BOOLEAN is
-- Is an_argument a valid argument?
do
-- Test of validity of an_argument
end
end -- class ECOM_SERVER_COCLASS_IMP

This class inherits from the generated Eiffel coclass and from ECOM_EXCEPTION. It redefines the feature coclass_feature from the generated coclass. This feature is part of the interface functions that can be called by clients of the component. Its implementation uses the feature trigger from ECOM_EXCEPTION to raise exceptions in case the feature cannot be executed normally (invalid argument e.g.). The EiffelCOM runtime catches the exception and maps it into an HRESULT that is sent back to the client.

Summary

Implementing EiffelCOM components consists in inheriting from the generated Eiffel coclasses and implementing their features. The only specific rules to follow relate to the redefinition of precondition features and the use of exceptions to return error status to the client. In the case of an out-of-process server, the registration class should be inherited from and the feature corresponding to the component window redefined to return the correct class.

See Also:
Introduction Dialog and Main Window, Generated Code Type Dialog, Definition File Dialog, Eiffel Project File Dialog, Destination Folder Dialog, IDL Marshaling Definition Dialog, Type Library Marshaling Definition Dialog, Final Dialog, COM Definition File Processing, Eiffel Project Processing, Generated Files, Class Hierarchy, Accessing a Component, Building a Component


DECLARATOR Flat contracts

indexing
    warning: "[
        If you are precompiling a subset of EiffelBase, it is
        preferable NOT to remove this class from the subset.
        If you remove it you may see unnecessary recompilations
        after changes.
    ]"
    description: "[
        Class used to ensure proper precompilation of EiffelBase.
        Not to be used otherwise."
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/21 04:25:32 $"
    revision: "$Revision: 1.4 $"

class interface
    DECLARATOR

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class DECLARATOR


STRING_HANDLER Flat contracts

indexing
    description: "Objects that can access `set_count' from STRING"
    date: "$Date: 2001/11/12 17:57:42 $"
    revision: "$Revision: 1.3 $"

class interface
    STRING_HANDLER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class STRING_HANDLER


ARRAYED_LIST_CURSOR Flat contracts

indexing
    description: "Cursors for arrayed lists"
    status: "See notice at end of class"
    names: fixed_list_cursor, cursor
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    ARRAYED_LIST_CURSOR

create

    make (current_index: INTEGER)
            -- Create a cursor and set it up on current_index.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class ARRAYED_LIST_CURSOR


CIRCULAR_CURSOR Flat contracts

indexing
    description: "Cursors for circular lists"
    status: "See notice at end of class"
    names: circular_cursor, cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    CIRCULAR_CURSOR

create

    make (curs: like cursor; int: BOOLEAN; start: INTEGER)
            -- Create a cursor and set it up on active_element.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CIRCULAR_CURSOR


COMPACT_TREE_CURSOR Flat contracts

indexing
    description: "Cursors for compact trees"
    status: "See notice at end of class"
    names: compact_tree_cursor, cursor
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    COMPACT_TREE_CURSOR

create

    make (i: INTEGER; aft, bef, bel, abv: BOOLEAN)
            -- Create a cursor and set it up on i.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class COMPACT_TREE_CURSOR


CURSOR Flat contracts

indexing
    description: "Cursors for remembering positions in arbitrary data structures"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    CURSOR

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class CURSOR


HASH_TABLE_CURSOR Flat contracts

indexing
    description: "Cursors for hash table traversal"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    HASH_TABLE_CURSOR

create

    make (pos: INTEGER)
            -- Create a new cursor.
        ensure
            position_set: position = pos

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class HASH_TABLE_CURSOR


LINKED_LIST_CURSOR Flat contracts

indexing
    description: "Cursors for linked lists"
    status: "See notice at end of class"
    names: linked_list_cursor, cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_LIST_CURSOR [G]

create

    make (active_element: like active; aft, bef: BOOLEAN)
            -- Create a cursor and set it up on active_element.

invariant

    not_both: not (before and after),
    no_active_not_on: active = void implies (before or after)
        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_LIST_CURSOR


LINKED_TREE_CURSOR Flat contracts

indexing
    description: "Cursors for linked trees"
    status: "See notice at end of class"
    names: linked_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    LINKED_TREE_CURSOR [G]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class LINKED_TREE_CURSOR


MULTAR_LIST_CURSOR Flat contracts

indexing
    description: "Cursors for multi-array trees"
    status: "See notice at end of class"
    names: cursor
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    MULTAR_LIST_CURSOR [G]

create

    make (active_element: like active; current_active_index, current_index: INTEGER)
            -- Create a cursor and set it up on active_element.

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MULTAR_LIST_CURSOR


RECURSIVE_TREE_CURSOR Flat contracts

indexing
    description: "Cursors for recursive trees"
    status: "See notice at end of class"
    names: recursive_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    RECURSIVE_TREE_CURSOR [G]

create

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class RECURSIVE_TREE_CURSOR


TWO_WAY_TREE_CURSOR Flat contracts

indexing
    description: "Cursors for two-way cursor trees"
    status: "See notice at end of class"
    names: two_way_tree_cursor, cursor
    contents: generic
    date: "$Date: 2001/11/12 17:57:43 $"
    revision: "$Revision: 1.3 $"

class interface
    TWO_WAY_TREE_CURSOR [G]

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class TWO_WAY_TREE_CURSOR


MATH_CONST Flat contracts

indexing
    description: "[
        Basic mathematical constants.
        This class may be used as ancestor by classes needing its facilities.
    ]"
    status: "See notice at end of class"
    date: "$Date: 2001/11/12 17:57:47 $"
    revision: "$Revision: 1.3 $"

class interface
    MATH_CONST

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

indexing
    library: "[
            EiffelBase: Library of reusable components for Eiffel.
    ]"
    status: "[
            Copyright 1986-2001 Interactive Software Engineering (ISE).
            For ISE customers the original versions are an ISE product
            covered by the ISE Eiffel license and support agreements.
    ]"
    license: "[
            EiffelBase may now be used by anyone as FREE SOFTWARE to
            develop any product, public-domain or commercial, without
            payment to ISE, under the terms of the ISE Free Eiffel Library
            License (IFELL) at http://eiffel.com/products/../base/reference/license.html.
    ]"
    source: "[
            Interactive Software Engineering Inc.
            ISE Building
            360 Storke Road, Goleta, CA 93117 USA
            Telephone 805-685-1006, Fax 805-685-6869
            Electronic mail <info@eiffel.com>
            Customer support http://support.eiffel.com
    ]"
    info: "[
            For latest info see award-winning pages: http://eiffel.com
    ]"

end -- class MATH_CONST


ECOM_FLAGS Flat contracts

indexing
    description: "Generic flags class."
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:50 $"
    revision: "$Revision: 1.3 $"

class interface
    ECOM_FLAGS

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class ECOM_FLAGS


HRESULT_FORMATTER Flat contracts

indexing
    description: "HRESULT_FORMATTER"
    status: "See notice at end of class"
    date: "$Date: 2001/11/13 00:01:51 $"
    revision: "$Revision: 1.2 $"

class interface
    HRESULT_FORMATTER

create
invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class HRESULT_FORMATTER


TRANSFER_COMMAND_CONSTANTS Flat contracts

indexing
    description: "Constants for server commands"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:00 $"
    revision: "$Revision: 1.2 $"

class interface
    TRANSFER_COMMAND_CONSTANTS

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class TRANSFER_COMMAND_CONSTANTS


HANDLE_SPEC_IMPL Flat contracts

 indexing
description: "Handle to actual database"
date: "$Date: 2001/06/14 00:28:19 $"
revision: "$Revision: 1.1 $"

class interface
HANDLE_SPEC_IMPL

create

make (obj: DATABASE )
-- Set database in use to obj.

feature -- Access

object : DATABASE
-- Database in use.

feature -- Basic operations

change_object (obj: DATABASE )
-- Set database in use to obj.

feature -- Creation

make (obj: DATABASE )
-- Set database in use to obj.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HANDLE_SPEC_IMPL


DB_CONSTANT Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_CONSTANT

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_CONSTANT


DB_STATUS_USE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
DB_STATUS_USE

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class DB_STATUS_USE


GENERAL_APPL Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

deferred class interface
GENERAL_APPL

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class GENERAL_APPL


HANDLE_USE Flat contracts

 indexing
status: "See notice at end of class"
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"
product: eiffelstore
database: all_bases

class interface
HANDLE_USE

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class HANDLE_USE


NUMERIC_NULL_VALUE Flat contracts

 indexing
description: "Object that defines the numeric value that codes a databaseNULL value."
date: "$Date: 2001/06/14 00:28:23 $"
revision: "$Revision: 1.1 $"

class interface
NUMERIC_NULL_VALUE

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class NUMERIC_NULL_VALUE


FIND_SEPARATOR_FACILITY Flat contracts

indexing
    description: "Facility to find seperators in date or time strings"
    status: "See note at end of class"
    date: "$Date: 2001/11/12 17:58:01 $"
    revision: "$Revision: 1.2 $"

class interface
    FIND_SEPARATOR_FACILITY

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class FIND_SEPARATOR_FACILITY


EV_MENU_SEPARATOR Flat contracts

indexing
    description: "Horizontal scored line separator for use in EV_MENU."
    status: "See notice at end of class."
    keywords: "menu, item, separator"
    date: "$Date: 2001/07/14 01:02:21 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_MENU_SEPARATOR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called
        -- from EV_TEXTABLE
    text_not_void_implies_text_not_empty: is_usable and text /= void implies text.count > 0

end -- class EV_MENU_SEPARATOR


EV_TOOL_BAR_SEPARATOR Flat contracts

indexing
    description: "Scored line separator for use in EV_TOOL_BAR."
    status: "See notice at end of class."
    keywords: "separator, tool, bar, line, devide"
    date: "$Date: 2001/07/14 01:02:22 $"
    revision: "$Revision: 1.2 $"

class interface
    EV_TOOL_BAR_SEPARATOR

create

    frozen default_create
            -- Standard creation procedure.
            -- (from EV_ANY)
        ensure then -- from EV_ANY
            is_coupled: implementation /= void
            is_initialized: is_initialized
            default_create_called_set: default_create_called
            is_in_default_state: is_in_default_state

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)
        -- from EV_PICK_AND_DROPABLE
    user_interface_modes_mutually_exclusive: mode_is_pick_and_drop.to_integer + mode_is_drag_and_drop.to_integer + mode_is_target_menu.to_integer = 1
        -- from EV_ANY
    is_initialized: is_initialized
    is_coupled: implementation /= void and then implementation.interface = Current
    default_create_called: default_create_called

end -- class EV_TOOL_BAR_SEPARATOR


EV_DYNAMIC_LIST_CURSOR Flat contracts

indexing
    description: "Cursor for Eiffel Vision dynamic lists."
    status: "See notice at end of class"
    keywords: "container, list, cursor"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

class interface
    EV_DYNAMIC_LIST_CURSOR [G]

create

    make (current_item: G; before_state, after_state: BOOLEAN)
            -- Create a cursor pointing to current_item.
            -- When current_item Void, must be before or after.
        require
            item_void_equals_before_or_after: (current_item = void) = (before_state or after_state)
        ensure
            item_assigned: item = current_item
            after_assigned: after = after_state
            before_assigned: before = before_state

    make_with_item (an_item: G)
            -- Create a cursor pointing to an_item.
        require
            an_item_not_void: an_item /= void
        ensure
            item_assigned: item = an_item
            not_after: not after
            not_before: not before

invariant

    item_void_equals_before_or_after: (item = void) = (before or after)
        -- from ANY
    reflexive_equality: standard_is_equal (Current),
    reflexive_conformance: conforms_to (Current)

end -- class EV_DYNAMIC_LIST_CURSOR


EV_HELP_CONTEXT Flat contracts

indexing
    description: "Objects that are sent to the help engine when help is requested."
    status: "See notice at end of class."
    keywords: "help"
    date: "$Date: 2001/07/12 18:30:37 $"
    revision: "$Revision: 1.1 $"

deferred class interface
    EV_HELP_CONTEXT

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class EV_HELP_CONTEXT


WIDGET_CONTROL Flat contracts

 indexing
description: "Controls used to manipulate objects of type EV_WIDGET "
date: "$Date: 2001/07/12 22:19:25 $"
revision: "$Revision: 1.2 $"

class interface
WIDGET_CONTROL

create

make (box: EV_BOX ; widget: EV_WIDGET ; an_output_device: EV_TEXT )
-- Set up controls for widget. In this case, there are no controls,
-- but we must link the widget events to widget.

invariant

-- from ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end -- class WIDGET_CONTROL


WEL_OBJECT_ID_MANAGER Flat contracts

indexing
    description: "Ancestor for every class using a 'Object vs Id' conversion in WEL."
    status: "See notice at end of class."
    date: "$Date: 2001/11/12 17:58:31 $"
    revision: "$Revision: 1.3 $"

class interface
    WEL_OBJECT_ID_MANAGER

invariant

        -- from ANY
    reflexive_equality: standard_is_equal (Current)
    reflexive_conformance: conforms_to (Current)

end -- class WEL_OBJECT_ID_MANAGER


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\bmpview\app.rc."

Ancestors
ANY

Queries
Cmd_file_close : INTEGER
Cmd_file_exit : INTEGER
Cmd_file_open : INTEGER
Cmd_window_arrange : INTEGER
Cmd_window_cascade : INTEGER
Cmd_window_tile_horizontal : INTEGER
Cmd_window_tile_vertical : INTEGER
Id_ico_application : INTEGER
Id_ico_child_window : INTEGER
Id_menu_application : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


BMPVIEW_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
BMPVIEW_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CHILD_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
CHILD_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_DIB_COLORS_CONSTANTS
WEL_MDI_CHILD_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
bitmap : WEL_BITMAP
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_MDI_FRAME_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
make (a_parent: WEL_MDI_FRAME_WINDOW ; a_name: STRING )
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_MDI_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
active_window : WEL_MDI_CHILD_WINDOW
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
client_window : WEL_MDI_CLIENT_WINDOW
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_active_window : BOOLEAN
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
arrange_icons
bring_to_top
cascade_children
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
tile_children_horizontal
tile_children_vertical
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel45\examples\wel\brushes\brushes_demo.rc."

Ancestors
ANY

Queries
Id_bmp_ise_logo : INTEGER
Id_ico_application : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


BRUSH_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
BRUSH_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW
WEL_HS_CONSTANTS
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


BRUSHES_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
BRUSHES_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


DEMO_3D Chart

-- Automatic generation produced by ISE Eiffel --

class
DEMO_3D

General
cluster: root_cluster
create: make

Ancestors
DOUBLE_MATH
WEL_FRAME_WINDOW
WEL_PC_CONSTANTS
WEL_PS_CONSTANTS
WEL_RASTER_OPERATIONS_CONSTANTS
WEL_STANDARD_PENS
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
ready : BOOLEAN
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
go
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
brush_button : WEL_PUSH_BUTTON
brush_demo : BRUSH_DEMO
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
demo3d_button : WEL_PUSH_BUTTON
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
rectangle_button : WEL_PUSH_BUTTON
rectangle_demo : RECTANGLE_DEMO
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
three_d_demo : DEMO_3D
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PROJECTION Chart

-- Automatic generation produced by ISE Eiffel --

class
PROJECTION

General
cluster: root_cluster

Ancestors
ANY

Queries
x : INTEGER
xr : REAL
y : INTEGER
yr : REAL
zr : REAL

Commands
set_x (a_x: INTEGER )
set_xr (a_xr: REAL )
set_y (a_y: INTEGER )
set_yr (a_yr: REAL )
set_zr (a_zr: REAL )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


RECTANGLE_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
RECTANGLE_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\comctrls\app.rc."

Ancestors
ANY

Queries
Bmp_toolbar : INTEGER
Cmd_bold : INTEGER
Cmd_exit : INTEGER
Cmd_italic : INTEGER
Cmd_progress_bar : INTEGER
Id_ico_application : INTEGER
Id_main_menu : INTEGER
Str_tooltip : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


COMCTRLS_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
COMCTRLS_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
common_controls_dll : WEL_COMMON_CONTROLS_DLL
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
rich_edit_dll : WEL_RICH_EDIT_DLL
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
init_application
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_IDB_CONSTANTS
WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS
WEL_TTF_CONSTANTS
WEL_TTN_CONSTANTS
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
char_format : WEL_CHARACTER_FORMAT
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
progress_bar : WEL_PROGRESS_BAR
rich_edit : WEL_RICH_EDIT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
standard_tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
static : WEL_STATIC
status_window : WEL_STATUS_WINDOW
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
tool_bar : WEL_TOOL_BAR
tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
tool_bar_button4 : WEL_TOOL_BAR_BUTTON
tool_bar_button5 : WEL_TOOL_BAR_BUTTON
tool_bar_button6 : WEL_TOOL_BAR_BUTTON
tool_bar_button7 : WEL_TOOL_BAR_BUTTON
tool_bar_button8 : WEL_TOOL_BAR_BUTTON
tool_info1 : WEL_TOOL_INFO
tool_info2 : WEL_TOOL_INFO
tooltip : WEL_TOOLTIP
track_bar : WEL_TRACK_BAR
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\commands\app.rc."

Ancestors
ANY

Queries
Idc_checkbox : INTEGER
Idc_clear_button : INTEGER
Idc_close_button : INTEGER
Idc_listbox : INTEGER
Main_dialog : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


COMMANDS_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
COMMANDS_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_DIALOG
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_DIALOG Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_DIALOG

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_MAIN_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
check_box : WEL_CHECK_BOX
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
list_box : WEL_SINGLE_SELECTION_LIST_BOX
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
result_id : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_abort
on_cancel
on_control_id_command (control_id: INTEGER )
on_ignore
on_no
on_ok
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
setup_dialog
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SHOW_COMMAND_INFORMATION Chart

-- Automatic generation produced by ISE Eiffel --

class
SHOW_COMMAND_INFORMATION

General
cluster: root_cluster

Ancestors
WEL_COMMAND

Queries
message_information : WEL_MESSAGE_INFORMATION

Commands
execute (argument: ANY )
set_message_information (mi: WEL_MESSAGE_INFORMATION )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SHOW_MOUSE_BUTTON_INFORMATION Chart

-- Automatic generation produced by ISE Eiffel --

class
SHOW_MOUSE_BUTTON_INFORMATION

General
cluster: root_cluster

Ancestors
WEL_COMMAND

Queries
message_information : WEL_MESSAGE_INFORMATION

Commands
execute (argument: ANY )
set_message_information (mi: WEL_MESSAGE_INFORMATION )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SHOW_MOVE_INFORMATION Chart

-- Automatic generation produced by ISE Eiffel --

class
SHOW_MOVE_INFORMATION

General
cluster: root_cluster

Ancestors
WEL_COMMAND

Queries
message_information : WEL_MESSAGE_INFORMATION

Commands
execute (argument: ANY )
set_message_information (mi: WEL_MESSAGE_INFORMATION )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\controls\app.rc."

Ancestors
ANY

Queries
Cmd_button_create : INTEGER
Cmd_button_delete : INTEGER
Cmd_button_disable : INTEGER
Cmd_button_enable : INTEGER
Cmd_check_create : INTEGER
Cmd_check_delete : INTEGER
Cmd_check_state : INTEGER
Cmd_combo_box_add_item : INTEGER
Cmd_combo_box_count_item : INTEGER
Cmd_combo_box_create : INTEGER
Cmd_combo_box_current_item : INTEGER
Cmd_combo_box_delete : INTEGER
Cmd_combo_box_hide_list : INTEGER
Cmd_combo_box_show_list : INTEGER
Cmd_edit_clear_text : INTEGER
Cmd_edit_create : INTEGER
Cmd_edit_current_text : INTEGER
Cmd_edit_delete : INTEGER
Cmd_edit_set_text : INTEGER
Cmd_edit_text_length : INTEGER
Cmd_exit : INTEGER
Cmd_list_box_add_item : INTEGER
Cmd_list_box_count_item : INTEGER
Cmd_list_box_create : INTEGER
Cmd_list_box_current_item : INTEGER
Cmd_list_box_delete : INTEGER
Cmd_mul_add_item : INTEGER
Cmd_mul_count_item : INTEGER
Cmd_mul_count_selected_item : INTEGER
Cmd_mul_create : INTEGER
Cmd_mul_current_item : INTEGER
Cmd_mul_delete : INTEGER
Cmd_multi_edit_clear_text : INTEGER
Cmd_multi_edit_create : INTEGER
Cmd_multi_edit_current_text : INTEGER
Cmd_multi_edit_delete : INTEGER
Cmd_multi_edit_set_text : INTEGER
Cmd_multi_edit_text_length : INTEGER
Cmd_radio_create : INTEGER
Cmd_radio_delete : INTEGER
Cmd_radio_state : INTEGER
Cmd_scroll_bar_create : INTEGER
Cmd_scroll_bar_delete : INTEGER
Cmd_scroll_bar_set_horizontal : INTEGER
Cmd_scroll_bar_set_vertical : INTEGER
Id_acc_application : INTEGER
Id_ico_application : INTEGER
Id_menu_application : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CONTROLS_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
CONTROLS_DEMO

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_SB_CONSTANTS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
bcheck1 : WEL_CHECK_BOX
bcheck2 : WEL_CHECK_BOX
button : WEL_PUSH_BUTTON
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
combo_box : WEL_DROP_DOWN_LIST_COMBO_BOX
combo_box_item_num : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
edit : WEL_SINGLE_LINE_EDIT
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
group1 : WEL_GROUP_BOX
group2 : WEL_GROUP_BOX
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
list_box : WEL_SINGLE_SELECTION_LIST_BOX
list_box_item_num : INTEGER
list_box_mul : WEL_MULTIPLE_SELECTION_LIST_BOX
list_box_mul_item_num : INTEGER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
multi_edit : WEL_MULTIPLE_LINE_EDIT
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
radio1 : WEL_RADIO_BUTTON
radio2 : WEL_RADIO_BUTTON
scroll_bar : WEL_SCROLL_BAR
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
static : WEL_STATIC
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
vertical_scroll_bar : BOOLEAN
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CTLCOLOR_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
CTLCOLOR_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
PRECOMP_MAIN_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
bkgnd_ctlcolor : WEL_COLOR_REF
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
Color_activeborder : INTEGER
Color_activecaption : INTEGER
Color_appworkspace : INTEGER
Color_background : INTEGER
Color_btnface : INTEGER
Color_btnhighlight : INTEGER
Color_btnshadow : INTEGER
Color_btntext : INTEGER
Color_captiontext : INTEGER
Color_graytext : INTEGER
Color_highlight : INTEGER
Color_highlighttext : INTEGER
Color_inactiveborder : INTEGER
Color_inactivecaption : INTEGER
Color_inactivecaptiontext : INTEGER
Color_menu : INTEGER
Color_menutext : INTEGER
Color_scrollbar : INTEGER
Color_window : INTEGER
Color_windowframe : INTEGER
Color_windowtext : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
frgnd_ctlcolor : WEL_COLOR_REF
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_color_constant (c: INTEGER ): BOOLEAN
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
make
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_bkgnd_ctlcolor (a_color: WEL_COLOR_REF )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_frgnd_ctlcolor (a_color: WEL_COLOR_REF )
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MY_BUTTON Chart

-- Automatic generation produced by ISE Eiffel --

class
MY_BUTTON

General
cluster: root_cluster
description: "Objects that ..."
create: make

Ancestors
WEL_PUSH_BUTTON

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
background_color : WEL_COLOR_REF
captured_window : WEL_WINDOW
client_rect : WEL_RECT
Color_activeborder : INTEGER
Color_activecaption : INTEGER
Color_appworkspace : INTEGER
Color_background : INTEGER
Color_btnface : INTEGER
Color_btnhighlight : INTEGER
Color_btnshadow : INTEGER
Color_btntext : INTEGER
Color_captiontext : INTEGER
Color_graytext : INTEGER
Color_highlight : INTEGER
Color_highlighttext : INTEGER
Color_inactiveborder : INTEGER
Color_inactivecaption : INTEGER
Color_inactivecaptiontext : INTEGER
Color_menu : INTEGER
Color_menutext : INTEGER
Color_scrollbar : INTEGER
Color_window : INTEGER
Color_windowframe : INTEGER
Color_windowtext : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
font : WEL_FONT
foreground_color : WEL_COLOR_REF
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_return_value : BOOLEAN
has_system_font : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
id : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
message_return_value : INTEGER
minimal_height : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
text : STRING
text_length : INTEGER
to_integer : INTEGER
type : INTEGER
valid_color_constant (c: INTEGER ): BOOLEAN
valid_hwnd_constant (c: POINTER ): BOOLEAN
width : INTEGER
window : PRECOMP_MAIN_WINDOW
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
default_process_notification (notification_code: INTEGER )
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
make (a_parent: WEL_WINDOW ; a_name: STRING ; a_x, a_y, a_width, a_height, an_id, a_type: INTEGER )
maximize
minimize
move (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_font (a_font: WEL_FONT )
set_heavy_capture
set_height (a_height: INTEGER )
set_item (an_item: POINTER )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PRECOMP_MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
PRECOMP_MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_COLOR_CONSTANTS
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
bkgnd_ctlcolor : WEL_COLOR_REF
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
Color_activeborder : INTEGER
Color_activecaption : INTEGER
Color_appworkspace : INTEGER
Color_background : INTEGER
Color_btnface : INTEGER
Color_btnhighlight : INTEGER
Color_btnshadow : INTEGER
Color_btntext : INTEGER
Color_captiontext : INTEGER
Color_graytext : INTEGER
Color_highlight : INTEGER
Color_highlighttext : INTEGER
Color_inactiveborder : INTEGER
Color_inactivecaption : INTEGER
Color_inactivecaptiontext : INTEGER
Color_menu : INTEGER
Color_menutext : INTEGER
Color_scrollbar : INTEGER
Color_window : INTEGER
Color_windowframe : INTEGER
Color_windowtext : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
frgnd_ctlcolor : WEL_COLOR_REF
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_color_constant (c: INTEGER ): BOOLEAN
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
make
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_bkgnd_ctlcolor (a_color: WEL_COLOR_REF )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_frgnd_ctlcolor (a_color: WEL_COLOR_REF )
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\cursors\app.rc."

Ancestors
ANY

Queries
Cmd_cursor_arrow : INTEGER
Cmd_cursor_cross : INTEGER
Cmd_cursor_custom : INTEGER
Cmd_cursor_ibeam : INTEGER
Cmd_cursor_sieznesw : INTEGER
Cmd_cursor_size : INTEGER
Cmd_cursor_sizens : INTEGER
Cmd_cursor_sizeswne : INTEGER
Cmd_cursor_sizewe : INTEGER
Cmd_cursor_uparrow : INTEGER
Cmd_cursor_wait : INTEGER
Id_cur_custom : INTEGER
Id_ico_application : INTEGER
Id_menu_application : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CURSORS_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
CURSORS_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_HT_CONSTANTS
WEL_IDC_CONSTANTS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
cursor : WEL_CURSOR
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


DISKSPACE_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
DISKSPACE_DEMO

General
cluster: root_cluster
description: "Example on how to use the class WEL_DISK_SPACE "
create: make

Ancestors
ANY

Queries
Disk_space : WEL_DISK_SPACE

Commands
make

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\fontenum\app.rc."

Ancestors
ANY

Queries
Idc_close_button : INTEGER
Idc_edit : INTEGER
Idc_edit_size : INTEGER
Idc_font_list_box : INTEGER
Main_dialog : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


FONTENUM_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
FONTENUM_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_DIALOG
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_DIALOG Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_DIALOG

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FONT_FAMILY_ENUMERATOR
WEL_LBN_CONSTANTS
WEL_MAIN_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
C_memory : INTEGER
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
chunk_size : INTEGER
client_rect : WEL_RECT
closeable : BOOLEAN
coalesce_period : INTEGER
collecting : BOOLEAN
collection_period : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
current_font : WEL_FONT
current_size : INTEGER
default_processing : BOOLEAN
edit : WEL_MULTIPLE_LINE_EDIT
Eiffel_memory : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
Full_collector : INTEGER
gc_statistics (collector_type: INTEGER ): GC_INFO
generation_object_limit : INTEGER
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
Incremental_collector : INTEGER
is_inside : BOOLEAN
item : POINTER
largest_coalesced_block : INTEGER
list_box : WEL_SINGLE_SELECTION_LIST_BOX
max_mem : INTEGER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
memory_statistics (memory_type: INTEGER ): MEM_INFO
memory_threshold : INTEGER
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
referers (an_object: ANY ): ARRAY [ ANY ]
result_id : INTEGER
scavenge_zone_size : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
size : WEL_SINGLE_LINE_EDIT
style : INTEGER
system_menu : WEL_MENU
tenure : INTEGER
text : STRING
text_length : INTEGER
to_integer : INTEGER
Total_memory : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
action (elf: WEL_ENUM_LOG_FONT ; tm: WEL_TEXT_METRIC ; font_type: INTEGER )
activate
allocate_compact
allocate_fast
allocate_tiny
bring_to_top
collect
collection_off
collection_on
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_time_accounting
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_time_accounting
enable_vertical_scroll_bar
finish_action
free (object: ANY )
full_coalesce
full_collect
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
init_action
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
mem_free (addr: POINTER )
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_abort
on_cancel
on_control_id_command (control_id: INTEGER )
on_ignore
on_no
on_ok
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_coalesce_period (value: INTEGER )
set_collection_period (value: INTEGER )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_max_mem (value: INTEGER )
set_memory_threshold (value: INTEGER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
setup_dialog
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\fun\app.rc."

Ancestors
ANY

Queries
Cmd_exit : INTEGER
Id_bmp_ise_logo : INTEGER
Id_cur_invisible : INTEGER
Id_dialog : INTEGER
Id_ico_application : INTEGER
Id_ico_artist : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


ARTIST Chart

-- Automatic generation produced by ISE Eiffel --

class
ARTIST

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_menu_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


FUN_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
FUN_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


FUN_DIALOG Chart

-- Automatic generation produced by ISE Eiffel --

class
FUN_DIALOG

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_MODAL_DIALOG
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
direction_x : INTEGER
direction_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
Inc_x : INTEGER
Inc_y : INTEGER
is_inside : BOOLEAN
item : POINTER
Max_move : INTEGER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
move_number : INTEGER
movement_x (x_pos, xb: INTEGER ): BOOLEAN
movement_y (y_pos, yb: INTEGER ): BOOLEAN
ok_button : WEL_PUSH_BUTTON
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
result_id : INTEGER
scroller : WEL_SCROLLER
Sensibility : INTEGER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
time_elapsed : BOOLEAN
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
X_min : INTEGER
y : INTEGER
Y_min : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_abort
on_cancel
on_ignore
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_no
on_ok
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
artist : ARTIST
artist_button : WEL_PUSH_BUTTON
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
fun_button : WEL_PUSH_BUTTON
fun_dialog : FUN_DIALOG
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
maze : MAZE
maze_button : WEL_PUSH_BUTTON
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAZE Chart

-- Automatic generation produced by ISE Eiffel --

class
MAZE

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW
WEL_STANDARD_PENS
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


HELLO_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
HELLO_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
make
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\comctrls\app.rc."

Ancestors
ANY

Queries
Id_ico_application : INTEGER
Idi_blue : INTEGER
Idi_green : INTEGER
Idi_magenta : INTEGER
Idi_red : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LISTVIEW Chart

-- Automatic generation produced by ISE Eiffel --

class
LISTVIEW

General
cluster: root_cluster
description: " LISTVIEW class of the WEL example : List_view."
create: make

Ancestors
APPLICATION_IDS
WEL_COLOR_CONSTANTS
WEL_ILC_CONSTANTS
WEL_LIST_VIEW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
client_rect : WEL_RECT
column_count : INTEGER
Comctl32_version : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
count : INTEGER
current_type : INTEGER
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focus_item : INTEGER
focused_window : WEL_WINDOW
font : WEL_FONT
get_background_color : WEL_COLOR_REF
get_column_width (column: INTEGER ): INTEGER
get_extended_view_style : INTEGER
get_item (index, subitem: INTEGER ): WEL_LIST_VIEW_ITEM
get_item_position (index: INTEGER ): WEL_POINT
get_item_rect (index: INTEGER ): WEL_RECT
get_item_state (index, mask: INTEGER ): INTEGER
get_tooltip : WEL_TOOLTIP
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_return_value : BOOLEAN
has_system_font : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
id : INTEGER
is_inside : BOOLEAN
is_valid_list_view_flag (a_flag: INTEGER ): BOOLEAN
Is_windows_2000 : BOOLEAN
Is_windows_95 : BOOLEAN
Is_windows_98 : BOOLEAN
Is_windows_9x : BOOLEAN
Is_windows_me : BOOLEAN
Is_windows_nt : BOOLEAN
Is_windows_nt4 : BOOLEAN
item : POINTER
item_output : WEL_STATIC
maximal_height : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
mess_output : WEL_SINGLE_SELECTION_LIST_BOX
message_return_value : INTEGER
minimal_height : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
search (a_search_info: WEL_LIST_VIEW_SEARCH_INFO ; a_starting_index: INTEGER ): INTEGER
selected_count : INTEGER
selected_item : INTEGER
selected_items : ARRAY [ INTEGER ]
shared : BOOLEAN
Shell32_version : INTEGER
Shlwapi_version : INTEGER
shown : BOOLEAN
style : INTEGER
text : STRING
text_length : INTEGER
to_integer : INTEGER
top_index : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
valid_lvcfmt_constant (value: INTEGER ): BOOLEAN
valid_lvis_constants (value: INTEGER ): BOOLEAN
Version_400 : INTEGER
Version_470 : INTEGER
Version_471 : INTEGER
Version_472 : INTEGER
Version_500 : INTEGER
Version_580 : INTEGER
Version_581 : INTEGER
visible_count : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
add_mess_output (str: STRING )
append_column (column: WEL_LIST_VIEW_COLUMN )
bring_to_top
change_style
default_process_notification (notification_code: INTEGER )
delete_column (index: INTEGER )
delete_item (index: INTEGER )
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
ensure_visible (an_index: INTEGER )
go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
insert_after (a_window: WEL_WINDOW )
insert_column (column: WEL_LIST_VIEW_COLUMN ; index: INTEGER )
insert_item (an_item: WEL_LIST_VIEW_ITEM )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_activate
on_char (character_code, key_data: INTEGER )
on_desactivate
on_destroy
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_hide
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_lvn_begindrag (info: WEL_NM_LIST_VIEW )
on_lvn_beginlabeledit (info: WEL_LIST_VIEW_ITEM )
on_lvn_beginrdrag (info: WEL_NM_LIST_VIEW )
on_lvn_columnclick (info: WEL_NM_LIST_VIEW )
on_lvn_deleteallitems (info: WEL_NM_LIST_VIEW )
on_lvn_deleteitem (info: WEL_NM_LIST_VIEW )
on_lvn_endlabeledit (info: WEL_LIST_VIEW_ITEM )
on_lvn_getdispinfo (info: WEL_LIST_VIEW_ITEM )
on_lvn_insertitem (info: WEL_NM_LIST_VIEW )
on_lvn_itemchanged (info: WEL_NM_LIST_VIEW )
on_lvn_itemchanging (info: WEL_NM_LIST_VIEW )
on_lvn_keydown (virtual_key: INTEGER )
on_lvn_setdispinfo (info: WEL_LIST_VIEW_ITEM )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
prepend_column (column: WEL_LIST_VIEW_COLUMN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
replace_item (an_item: WEL_LIST_VIEW_ITEM )
reset_content
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_background_color (a_color: WEL_COLOR_REF )
set_capture
set_cell_text (isub_item, iitem: INTEGER ; txt: STRING )
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_column_format (index, fmt: INTEGER )
set_column_title (txt: STRING ; index: INTEGER )
set_column_width (value, index: INTEGER )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_extended_view_style (a_new_style: INTEGER )
set_focus
set_font (a_font: WEL_FONT )
set_heavy_capture
set_height (a_height: INTEGER )
set_image_list (an_imagelist: WEL_IMAGE_LIST )
set_item (an_item: POINTER )
set_item_count (value: INTEGER )
set_item_output (static: WEL_STATIC )
set_item_state (index, state: INTEGER )
set_mess_output (list: WEL_SINGLE_SELECTION_LIST_BOX )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_small_image_list (an_imagelist: WEL_IMAGE_LIST )
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
update_item (index: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LISTVIEW_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
LISTVIEW_DEMO

General
cluster: root_cluster
description: "Application class of the WEL example : List_view."
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
common_controls_dll : WEL_COMMON_CONTROLS_DLL
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
rich_edit_dll : WEL_RICH_EDIT_DLL
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
init_application
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
description: "Main window class of the WEL example : List_view."
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
button : WEL_PUSH_BUTTON
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
label : WEL_STATIC
list : WEL_SINGLE_SELECTION_LIST_BOX
list_view : LISTVIEW
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\mdi\app.rc."

Ancestors
ANY

Queries
Cmd_file_close : INTEGER
Cmd_file_exit : INTEGER
Cmd_file_new : INTEGER
Cmd_window_arrange : INTEGER
Cmd_window_cascade : INTEGER
Cmd_window_tile_horizontal : INTEGER
Cmd_window_tile_vertical : INTEGER
Id_ico_application : INTEGER
Id_menu_application : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MDI_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
MDI_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
Background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MENUS_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
MENUS_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MINIMAL_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
MINIMAL_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : WEL_FRAME_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\pizza\app.rc."

Ancestors
ANY

Queries
Cmd_exit : INTEGER
Cmd_order : INTEGER
Id_checkbox_garlic : INTEGER
Id_checkbox_oregano : INTEGER
Id_dialog_pizza : INTEGER
Id_ico_application : INTEGER
Id_ico_forhere : INTEGER
Id_ico_pizza : INTEGER
Id_ico_thick : INTEGER
Id_ico_thin : INTEGER
Id_ico_togo : INTEGER
Id_listbox_items : INTEGER
Id_main_menu : INTEGER
Id_rad_for_here : INTEGER
Id_rad_stuff : INTEGER
Id_rad_thick : INTEGER
Id_rad_thin : INTEGER
Id_rad_to_go : INTEGER
Id_size : INTEGER
Id_static_price : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


DIALOG Chart

-- Automatic generation produced by ISE Eiffel --

class
DIALOG

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_MODAL_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
items_selected : INTEGER
listbox_items : WEL_MULTIPLE_SELECTION_LIST_BOX
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
radio_for_here : WEL_RADIO_BUTTON
radio_stuff : WEL_RADIO_BUTTON
radio_thick : WEL_RADIO_BUTTON
radio_thin : WEL_RADIO_BUTTON
radio_to_go : WEL_RADIO_BUTTON
result_id : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
size : WEL_DROP_DOWN_LIST_COMBO_BOX
size_price : INTEGER
static_price : WEL_STATIC
style : INTEGER
system_menu : WEL_MENU
text : STRING
Text_info : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_abort
on_cancel
on_ignore
on_no
on_ok
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
dialog : DIALOG
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PIZZA_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
PIZZA_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\printer\app.rc."

Ancestors
ANY

Queries
Cmd_exit : INTEGER
Cmd_print : INTEGER
Id_ico_application : INTEGER
Id_main_menu : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


PRINTER_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
PRINTER_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\richedit\app.rc."

Ancestors
ANY

Queries
Bmp_toolbar : INTEGER
Cmd_bold : INTEGER
Cmd_bullet : INTEGER
Cmd_center : INTEGER
Cmd_color : INTEGER
Cmd_exit : INTEGER
Cmd_font : INTEGER
Cmd_italic : INTEGER
Cmd_left : INTEGER
Cmd_new : INTEGER
Cmd_open : INTEGER
Cmd_print : INTEGER
Cmd_right : INTEGER
Cmd_save : INTEGER
Cmd_save_as : INTEGER
Cmd_underline : INTEGER
Id_ico_application : INTEGER
Id_main_menu : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_CF_CONSTANTS
WEL_FRAME_WINDOW
WEL_IDB_CONSTANTS
WEL_STANDARD_TOOL_BAR_BITMAP_CONSTANTS
WEL_TTN_CONSTANTS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
char_format : WEL_CHARACTER_FORMAT
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
file_name : STRING
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
para_format : WEL_PARAGRAPH_FORMAT
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
rich_edit : WEL_RICH_EDIT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
standard_tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
tool_bar : WEL_TOOL_BAR
tool_bar_bitmap : WEL_TOOL_BAR_BITMAP
tool_bar_button1 : WEL_TOOL_BAR_BUTTON
tool_bar_button10 : WEL_TOOL_BAR_BUTTON
tool_bar_button11 : WEL_TOOL_BAR_BUTTON
tool_bar_button12 : WEL_TOOL_BAR_BUTTON
tool_bar_button13 : WEL_TOOL_BAR_BUTTON
tool_bar_button14 : WEL_TOOL_BAR_BUTTON
tool_bar_button15 : WEL_TOOL_BAR_BUTTON
tool_bar_button16 : WEL_TOOL_BAR_BUTTON
tool_bar_button17 : WEL_TOOL_BAR_BUTTON
tool_bar_button18 : WEL_TOOL_BAR_BUTTON
tool_bar_button2 : WEL_TOOL_BAR_BUTTON
tool_bar_button3 : WEL_TOOL_BAR_BUTTON
tool_bar_button4 : WEL_TOOL_BAR_BUTTON
tool_bar_button5 : WEL_TOOL_BAR_BUTTON
tool_bar_button6 : WEL_TOOL_BAR_BUTTON
tool_bar_button7 : WEL_TOOL_BAR_BUTTON
tool_bar_button8 : WEL_TOOL_BAR_BUTTON
tool_bar_button9 : WEL_TOOL_BAR_BUTTON
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


RICHEDIT_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
RICHEDIT_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
common_controls_dll : WEL_COMMON_CONTROLS_DLL
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
rich_edit_dll : WEL_RICH_EDIT_DLL
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
init_application
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
common_controls_dll : WEL_COMMON_CONTROLS_DLL
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : SPLIT_AREA_DEMO
rich_edit_dll : WEL_RICH_EDIT_DLL
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
init_application
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SPLIT_AREA_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
SPLIT_AREA_DEMO

General
cluster: root_cluster
description: "Example demonstrating WEL_SPLIT_AREA "
create: make

Ancestors
WEL_FRAME_WINDOW
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
rich_edit_left : WEL_RICH_EDIT
rich_edit_right : WEL_RICH_EDIT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
split_area : WEL_SPLIT_AREA
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


WEL_SPLIT_AREA Chart

-- Automatic generation produced by ISE Eiffel --

class
WEL_SPLIT_AREA

General
cluster: root_cluster
description: "WEL Horizontal Split area"
create: make

Ancestors
WEL_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_return_value : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
is_inside : BOOLEAN
item : POINTER
left_control : WEL_WINDOW
maximal_height : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
message_return_value : INTEGER
minimal_height : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
right_control : WEL_WINDOW
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_activate
on_char (character_code, key_data: INTEGER )
on_desactivate
on_destroy
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_hide
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_sys_char (character_code, key_data: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_item (an_item: POINTER )
set_left_control (a_control: WEL_WINDOW )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_right_control (a_control: WEL_WINDOW )
set_shared
set_splitter_position (a_pos: INTEGER )
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
win_help (help_file: STRING ; a_command, data: INTEGER )

Constraints
valid splitter position

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\stddlgs\app.rc."

Ancestors
ANY

Queries
Cmd_choose_color : INTEGER
Cmd_choose_file : INTEGER
Cmd_choose_font : INTEGER
Cmd_exit : INTEGER
Cmd_print_dialog : INTEGER
Id_ico_application : INTEGER
Id_main_menu : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


STDDLG_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
STDDLG_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\timer\app.rc."

Ancestors
ANY

Queries
Id_ico_application : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_HS_CONSTANTS
WEL_ROP2_CONSTANTS
WEL_SIZE_CONSTANTS
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
blue_brush : WEL_BRUSH
Button_border : INTEGER
Button_height : INTEGER
buttons : ARRAY [ WEL_PUSH_BUTTON ]
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
dc : WEL_CLIENT_DC
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
flash_rects : ARRAY [ WEL_RECT ]
focused_window : WEL_WINDOW
green_brush : WEL_BRUSH
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
red_brush : WEL_BRUSH
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
Start_timer : STRING
Stop_timer : STRING
style : INTEGER
system_menu : WEL_MENU
text : STRING
Text_height : INTEGER
text_length : INTEGER
Timer1 : INTEGER
Timer2 : INTEGER
Timer3 : INTEGER
Timer4 : INTEGER
Timer_interval : INTEGER
Title : STRING
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER
yellow_brush : WEL_BRUSH

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_control_command (a_control: WEL_CONTROL )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_size (size_type, a_width, a_height: INTEGER )
on_timer (timer_id: INTEGER )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_buttons_positions (new_x, new_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_flash_rect_positions (new_x, new_y: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TIMER_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
TIMER_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Ressource constants"

Ancestors
ANY

Queries
Id_ico_application : INTEGER
Idb_document_normal : INTEGER
Idb_document_selected : INTEGER
Idb_folder_normal : INTEGER
Idb_folder_selected : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
description: "Main window class of the WEL example : Tree_view."
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_WINDOWS_ROUTINES

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
label : WEL_STATIC
list : WEL_SINGLE_SELECTION_LIST_BOX
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
tree_view : TREEVIEW
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TREEVIEW Chart

-- Automatic generation produced by ISE Eiffel --

class
TREEVIEW

General
cluster: root_cluster
description: " TREEVIEW class of the WEL example : Tree_view."
create: make

Ancestors
APPLICATION_IDS
WEL_COLOR_CONSTANTS
WEL_TREE_VIEW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
client_rect : WEL_RECT
Color_activeborder : INTEGER
Color_activecaption : INTEGER
Color_appworkspace : INTEGER
Color_background : INTEGER
Color_btnface : INTEGER
Color_btnhighlight : INTEGER
Color_btnshadow : INTEGER
Color_btntext : INTEGER
Color_captiontext : INTEGER
Color_graytext : INTEGER
Color_highlight : INTEGER
Color_highlighttext : INTEGER
Color_inactiveborder : INTEGER
Color_inactivecaption : INTEGER
Color_inactivecaptiontext : INTEGER
Color_menu : INTEGER
Color_menutext : INTEGER
Color_scrollbar : INTEGER
Color_window : INTEGER
Color_windowframe : INTEGER
Color_windowtext : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
count : INTEGER
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
font : WEL_FONT
get_image_list : WEL_IMAGE_LIST
get_item_rect (an_item: WEL_TREE_VIEW_ITEM ): WEL_RECT
get_parent_item (an_item: WEL_TREE_VIEW_ITEM ): WEL_TREE_VIEW_ITEM
get_tooltip : WEL_TOOLTIP
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_item (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
has_return_value : BOOLEAN
has_system_font : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
id : INTEGER
Id_ico_application : INTEGER
Idb_document_normal : INTEGER
Idb_document_selected : INTEGER
Idb_folder_normal : INTEGER
Idb_folder_selected : INTEGER
indent : INTEGER
is_bold (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
is_cut (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
is_drophilited (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
is_expanded (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
is_inside : BOOLEAN
is_parent (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
is_selected (an_item: WEL_TREE_VIEW_ITEM ): BOOLEAN
item : POINTER
item_output : WEL_STATIC
last_item : POINTER
maximal_height : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
mess_output : WEL_SINGLE_SELECTION_LIST_BOX
message_return_value : INTEGER
minimal_height : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
selected : BOOLEAN
selected_item : WEL_TREE_VIEW_ITEM
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_color_constant (c: INTEGER ): BOOLEAN
valid_hwnd_constant (c: POINTER ): BOOLEAN
visible_count : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
add_mess_output (str: STRING )
bring_to_top
collapse_item (an_item: WEL_TREE_VIEW_ITEM )
default_process_notification (notification_code: INTEGER )
delete_item (an_item: WEL_TREE_VIEW_ITEM )
deselect_item (an_item: WEL_TREE_VIEW_ITEM )
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
expand_item (an_item: WEL_TREE_VIEW_ITEM )
go_to_next_group_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
go_to_next_tab_item (a_parent: WEL_COMPOSITE_WINDOW ; after: BOOLEAN )
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
insert_after (a_window: WEL_WINDOW )
insert_item (an_item: WEL_TREE_VIEW_INSERT_STRUCT )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_activate
on_char (character_code, key_data: INTEGER )
on_desactivate
on_destroy
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_hide
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_tvn_begindrag (info: WEL_NM_TREE_VIEW )
on_tvn_beginlabeledit (info: WEL_TREE_VIEW_ITEM )
on_tvn_beginrdrag (info: WEL_NM_TREE_VIEW )
on_tvn_deleteitem (info: WEL_NM_TREE_VIEW )
on_tvn_endlabeledit (info: WEL_TREE_VIEW_ITEM )
on_tvn_getdispinfo (info: WEL_TREE_VIEW_ITEM )
on_tvn_itemexpanded (info: WEL_NM_TREE_VIEW )
on_tvn_itemexpanding (info: WEL_NM_TREE_VIEW )
on_tvn_keydown (virtual_key: INTEGER )
on_tvn_selchanged (info: WEL_NM_TREE_VIEW )
on_tvn_selchanging (info: WEL_NM_TREE_VIEW )
on_tvn_setdispinfo (info: WEL_TREE_VIEW_ITEM )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
select_drop_target (an_item: WEL_TREE_VIEW_ITEM )
select_first_visible (an_item: WEL_TREE_VIEW_ITEM )
select_item (an_item: WEL_TREE_VIEW_ITEM )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_font (a_font: WEL_FONT )
set_heavy_capture
set_height (a_height: INTEGER )
set_image_list (an_imagelist: WEL_IMAGE_LIST )
set_indent (an_indent: INTEGER )
set_item (an_item: POINTER )
set_item_output (static: WEL_STATIC )
set_mess_output (list: WEL_SINGLE_SELECTION_LIST_BOX )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_tooltip (tooltip: WEL_TOOLTIP )
set_tree_item (an_item: WEL_TREE_VIEW_ITEM )
set_unshared
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TREEVIEW_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
TREEVIEW_DEMO

General
cluster: root_cluster
description: "Application class of the WEL example : Tree_view."
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
common_controls_dll : WEL_COMMON_CONTROLS_DLL
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
rich_edit_dll : WEL_RICH_EDIT_DLL
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
init_application
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP1 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP1

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : WEL_FRAME_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP2 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP2

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
dc : WEL_CLIENT_DC
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP3 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP3

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
button_down : BOOLEAN
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
dc : WEL_CLIENT_DC
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP4 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP4

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step5\app.rc."

Ancestors
ANY

Queries
Dlg_line_thickness : INTEGER
Idc_edit_width : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LINE_THICKNESS_DIALOG Chart

-- Automatic generation produced by ISE Eiffel --

class
LINE_THICKNESS_DIALOG

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_MODAL_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
edit : WEL_SINGLE_LINE_EDIT
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
ok_pushed : BOOLEAN
parent : WEL_WINDOW
pen_width : INTEGER
placement : WEL_WINDOW_PLACEMENT
result_id : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_abort
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_cancel
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_ignore
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_left_button_down (keys, x_pos, y_pos: INTEGER )
on_left_button_up (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_mouse_move (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_no
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_retry
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
button_down : BOOLEAN
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
dc : WEL_CLIENT_DC
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
line_thickness_dialog : LINE_THICKNESS_DIALOG
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
pen : WEL_PEN
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_paint (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_pen_width (new_width: INTEGER )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP5 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP5

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step6\app.rc."

Ancestors
ANY

Queries
Dlg_line_thickness : INTEGER
Idc_edit_width : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LINE Chart

-- Automatic generation produced by ISE Eiffel --

class
LINE

General
cluster: root_cluster
create: make

Ancestors
LINKED_LIST [G]

Queries
infix " @ " (i: INTEGER ): [like item ] POINT
after : BOOLEAN
before : BOOLEAN
changeable_comparison_criterion : BOOLEAN
count : INTEGER
cursor : CURSOR
duplicate (n: INTEGER ): [like Current] LINE
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] POINT
for_all (test: FUNCTION [ ANY , TUPLE [ POINT ], BOOLEAN ]): BOOLEAN
Full : BOOLEAN
has (v: [like item ] POINT ): BOOLEAN
i_th (i: INTEGER ): [like item ] POINT
index : INTEGER
index_of (v: [like item ] POINT ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : POINT
last : [like item ] POINT
linear_representation : LINEAR [ POINT ]
object_comparison : BOOLEAN
occurrences (v: [like item ] POINT ): INTEGER
off : BOOLEAN
prunable : BOOLEAN
readable : BOOLEAN
sequential_occurrences (v: POINT ): INTEGER
there_exists (test: FUNCTION [ ANY , TUPLE [ POINT ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
width : INTEGER
writable : BOOLEAN

Commands
add (x, y: INTEGER )
append (s: SEQUENCE [ POINT ])
back
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [ POINT ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ POINT ]]; test: FUNCTION [ ANY , TUPLE [ POINT ], BOOLEAN ])
extend (v: [like item ] POINT )
fill (other: CONTAINER [ POINT ])
finish
force (v: [like item ] POINT )
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
make
merge_left (other: [like Current] LINE )
merge_right (other: [like Current] LINE )
move (i: INTEGER )
prune (v: [like item ] POINT )
prune_all (v: [like item ] POINT )
put (v: [like item ] POINT )
put_front (v: [like item ] POINT )
put_i_th (v: [like item ] POINT ; i: INTEGER )
put_left (v: [like item ] POINT )
put_right (v: [like item ] POINT )
remove
remove_left
remove_right
replace (v: [like item ] POINT )
search (v: [like item ] POINT )
set_width (a_width: INTEGER )
start
swap (i: INTEGER )
wipe_out

Constraints
positive width

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
button_down : BOOLEAN
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
current_line : LINE
dc : WEL_CLIENT_DC
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
line_thickness_dialog : LINE_THICKNESS_DIALOG
lines : LINKED_LIST [ LINE ]
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
pen : WEL_PEN
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_menu_command (menu_id: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_pen_width (new_width: INTEGER )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


POINT Chart

-- Automatic generation produced by ISE Eiffel --

class
POINT

General
cluster: root_cluster
create: make

Ancestors
ANY

Queries
x : INTEGER
y : INTEGER

Commands
make (a_x, a_y: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP6 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP6

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step7\app.rc."

Ancestors
ANY

Queries
Cmd_exit : INTEGER
Cmd_line_thickness : INTEGER
Cmd_new : INTEGER
Cmd_open : INTEGER
Cmd_save : INTEGER
Dlg_line_thickness : INTEGER
Idc_edit_width : INTEGER
Main_menu_id : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
button_down : BOOLEAN
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
current_line : LINE
dc : WEL_CLIENT_DC
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
line_thickness_dialog : LINE_THICKNESS_DIALOG
lines : LINKED_LIST [ LINE ]
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
pen : WEL_PEN
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_pen_width (new_width: INTEGER )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP7 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP7

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\tutorial\step8\app.rc."

Ancestors
ANY

Queries
Cmd_exit : INTEGER
Cmd_line_thickness : INTEGER
Cmd_new : INTEGER
Cmd_open : INTEGER
Cmd_save : INTEGER
Dlg_line_thickness : INTEGER
Idc_edit_width : INTEGER
Main_menu_id : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


LINES Chart

-- Automatic generation produced by ISE Eiffel --

class
LINES

General
cluster: root_cluster
create: make

Ancestors
LINKED_LIST [G]
STORABLE

Queries
infix " @ " (i: INTEGER ): [like item ] LINE
after : BOOLEAN
assertion_violation : BOOLEAN
before : BOOLEAN
changeable_comparison_criterion : BOOLEAN
Check_instruction : INTEGER
Class_invariant : INTEGER
class_name : STRING
Com_exception : INTEGER
count : INTEGER
cursor : CURSOR
Developer_exception : INTEGER
developer_exception_name : STRING
duplicate (n: INTEGER ): [like Current] LINES
exception : INTEGER
exception_trace : STRING
exhausted : BOOLEAN
Extendible : BOOLEAN
External_exception : INTEGER
first : [like item ] LINE
Floating_point_exception : INTEGER
for_all (test: FUNCTION [ ANY , TUPLE [ LINE ], BOOLEAN ]): BOOLEAN
Full : BOOLEAN
has (v: [like item ] LINE ): BOOLEAN
i_th (i: INTEGER ): [like item ] LINE
Incorrect_inspect_value : INTEGER
index : INTEGER
index_of (v: [like item ] LINE ; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
Io_exception : INTEGER
is_developer_exception : BOOLEAN
is_developer_exception_of_name (name: STRING ): BOOLEAN
is_empty : BOOLEAN
is_signal : BOOLEAN
is_system_exception : BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : LINE
last : [like item ] LINE
linear_representation : LINEAR [ LINE ]
Loop_invariant : INTEGER
Loop_variant : INTEGER
meaning (except: INTEGER ): STRING
No_more_memory : INTEGER
object_comparison : BOOLEAN
occurrences (v: [like item ] LINE ): INTEGER
off : BOOLEAN
Operating_system_exception : INTEGER
original_class_name : STRING
original_exception : INTEGER
original_recipient_name : STRING
original_tag_name : STRING
Postcondition : INTEGER
Precondition : INTEGER
prunable : BOOLEAN
readable : BOOLEAN
recipient_name : STRING
Rescue_exception : INTEGER
retrieve_by_name (file_name: STRING ): ANY
Retrieve_exception : INTEGER
retrieved (medium: IO_MEDIUM ): ANY
Routine_failure : INTEGER
Runtime_io_exception : INTEGER
sequential_occurrences (v: LINE ): INTEGER
Signal_exception : INTEGER
tag_name : STRING
there_exists (test: FUNCTION [ ANY , TUPLE [ LINE ], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
Void_assigned_to_expanded : INTEGER
Void_call_target : INTEGER
writable : BOOLEAN

Commands
append (s: SEQUENCE [ LINE ])
back
basic_store (medium: IO_MEDIUM )
catch (code: INTEGER )
compare_objects
compare_references
die (code: INTEGER )
do_all (action: PROCEDURE [ ANY , TUPLE [ LINE ]])
do_if (action: PROCEDURE [ ANY , TUPLE [ LINE ]]; test: FUNCTION [ ANY , TUPLE [ LINE ], BOOLEAN ])
extend (v: [like item ] LINE )
fill (other: CONTAINER [ LINE ])
finish
force (v: [like item ] LINE )
forth
general_store (medium: IO_MEDIUM )
go_i_th (i: INTEGER )
go_to (p: CURSOR )
ignore (code: INTEGER )
independent_store (medium: IO_MEDIUM )
make
merge_left (other: [like Current] LINES )
merge_right (other: [like Current] LINES )
message_on_failure
move (i: INTEGER )
no_message_on_failure
prune (v: [like item ] LINE )
prune_all (v: [like item ] LINE )
put (v: [like item ] LINE )
put_front (v: [like item ] LINE )
put_i_th (v: [like item ] LINE ; i: INTEGER )
put_left (v: [like item ] LINE )
put_right (v: [like item ] LINE )
raise (name: STRING )
remove
remove_left
remove_right
replace (v: [like item ] LINE )
search (v: [like item ] LINE )
set_discard_pointers (v: BOOLEAN )
start
store_by_name (file_name: STRING )
swap (i: INTEGER )
wipe_out

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW
WEL_OFN_CONSTANTS
WEL_STANDARD_COLORS

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
button_down : BOOLEAN
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
current_line : LINE
dc : WEL_CLIENT_DC
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
line_thickness_dialog : LINE_THICKNESS_DIALOG
lines : LINES
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
open_dialog : WEL_OPEN_FILE_DIALOG
parent : WEL_WINDOW
pen : WEL_PEN
placement : WEL_WINDOW_PLACEMENT
save_dialog : WEL_SAVE_FILE_DIALOG
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
notify (control: WEL_CONTROL ; notify_code: INTEGER )
on_accelerator_command (accelerator_id: INTEGER )
on_activate
on_char (character_code, key_data: INTEGER )
on_color_control (control: WEL_COLOR_CONTROL ; paint_dc: WEL_PAINT_DC )
on_control_command (control: WEL_CONTROL )
on_control_id_command (control_id: INTEGER )
on_desactivate
on_destroy
on_draw_item (control_id: INTEGER ; draw_item: WEL_DRAW_ITEM_STRUCT )
on_erase_background (paint_dc: WEL_PAINT_DC ; invalid_rect: WEL_RECT )
on_get_min_max_info (min_max_info: WEL_MIN_MAX_INFO )
on_hide
on_horizontal_scroll (scroll_code, position: INTEGER )
on_horizontal_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_key_down (virtual_key, key_data: INTEGER )
on_key_up (virtual_key, key_data: INTEGER )
on_kill_focus
on_left_button_double_click (keys, x_pos, y_pos: INTEGER )
on_menu_select (menu_item, flags: INTEGER ; a_menu: WEL_MENU )
on_middle_button_double_click (keys, x_pos, y_pos: INTEGER )
on_middle_button_down (keys, x_pos, y_pos: INTEGER )
on_middle_button_up (keys, x_pos, y_pos: INTEGER )
on_move (x_pos, y_pos: INTEGER )
on_notify (control_id: INTEGER ; info: WEL_NMHDR )
on_palette_changed (window: WEL_WINDOW )
on_palette_is_changing (window: WEL_WINDOW )
on_query_new_palette
on_right_button_double_click (keys, x_pos, y_pos: INTEGER )
on_right_button_down (keys, x_pos, y_pos: INTEGER )
on_right_button_up (keys, x_pos, y_pos: INTEGER )
on_set_cursor (hit_code: INTEGER )
on_set_focus
on_show
on_size (size_type, a_width, a_height: INTEGER )
on_sys_char (character_code, key_data: INTEGER )
on_sys_command (a_command, x_pos, y_pos: INTEGER )
on_sys_key_down (virtual_key, key_data: INTEGER )
on_sys_key_up (virtual_key, key_data: INTEGER )
on_timer (timer_id: INTEGER )
on_vertical_scroll (scroll_code, position: INTEGER )
on_vertical_scroll_control (scroll_code, position: INTEGER ; bar: WEL_BAR )
on_window_pos_changed (window_pos: WEL_WINDOW_POS )
on_window_pos_changing (window_pos: WEL_WINDOW_POS )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_pen_width (new_width: INTEGER )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


TUTORIAL_STEP8 Chart

-- Automatic generation produced by ISE Eiffel --

class
TUTORIAL_STEP8

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APPLICATION_IDS Chart

-- Automatic generation produced by ISE Eiffel --

class
APPLICATION_IDS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\windows\app.rc."

Ancestors
ANY

Queries
Cmd_exit : INTEGER
Cmd_modal_dlg : INTEGER
Cmd_modeless_dlg : INTEGER
Cmd_popup_window_with_parent : INTEGER
Cmd_popup_window_without_parent : INTEGER
Edit_id : INTEGER
Id_ico_application : INTEGER
Id_main_menu : INTEGER
Modal_dlg_id : INTEGER
Modeless_dlg_id : INTEGER
Off_bmp_id : INTEGER
On_bmp_id : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_BRUSH
Class_cursor : WEL_CURSOR
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
modal : MODAL
modeless : MODELESS
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MODAL Chart

-- Automatic generation produced by ISE Eiffel --

class
MODAL

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_MODAL_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
edit : WEL_SINGLE_LINE_EDIT
edit_text : STRING
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
result_id : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_abort
on_cancel
on_ignore
on_no
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MODELESS Chart

-- Automatic generation produced by ISE Eiffel --

class
MODELESS

General
cluster: root_cluster
create: make

Ancestors
APPLICATION_IDS
WEL_MODELESS_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
edit : WEL_SINGLE_LINE_EDIT
edit_text : STRING
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
result_id : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_abort
on_cancel
on_ignore
on_no
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


WINDOWS_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
WINDOWS_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


APP_CONSTANTS Chart

-- Automatic generation produced by ISE Eiffel --

class
APP_CONSTANTS

General
cluster: root_cluster
description: "Generated by h2e from the file c:\eiffel4\examples\wel\xcell\app.rc."

Ancestors
ANY

Queries
About_dialog_id : INTEGER
Background_bitmap_id : INTEGER
Bitmap_10 : INTEGER
Bitmap_11 : INTEGER
Bitmap_12 : INTEGER
Bitmap_13 : INTEGER
Bitmap_14 : INTEGER
Bitmap_15 : INTEGER
Bitmap_16 : INTEGER
Bitmap_17 : INTEGER
Bitmap_18 : INTEGER
Bitmap_19 : INTEGER
Bitmap_20 : INTEGER
Bitmap_21 : INTEGER
Bitmap_22 : INTEGER
Bitmap_23 : INTEGER
Bitmap_24 : INTEGER
Bitmap_25 : INTEGER
Bitmap_26 : INTEGER
Bitmap_27 : INTEGER
Bitmap_28 : INTEGER
Bitmap_29 : INTEGER
Bitmap_30 : INTEGER
Bitmap_31 : INTEGER
Bitmap_32 : INTEGER
Bitmap_33 : INTEGER
Bitmap_34 : INTEGER
Bitmap_35 : INTEGER
Bitmap_36 : INTEGER
Bitmap_37 : INTEGER
Bitmap_38 : INTEGER
Bitmap_39 : INTEGER
Bitmap_4 : INTEGER
Bitmap_40 : INTEGER
Bitmap_41 : INTEGER
Bitmap_42 : INTEGER
Bitmap_43 : INTEGER
Bitmap_44 : INTEGER
Bitmap_45 : INTEGER
Bitmap_46 : INTEGER
Bitmap_47 : INTEGER
Bitmap_48 : INTEGER
Bitmap_49 : INTEGER
Bitmap_5 : INTEGER
Bitmap_50 : INTEGER
Bitmap_51 : INTEGER
Bitmap_52 : INTEGER
Bitmap_53 : INTEGER
Bitmap_54 : INTEGER
Bitmap_55 : INTEGER
Bitmap_6 : INTEGER
Bitmap_60 : INTEGER
Bitmap_61 : INTEGER
Bitmap_62 : INTEGER
Bitmap_63 : INTEGER
Bitmap_7 : INTEGER
Bitmap_8 : INTEGER
Bitmap_9 : INTEGER
Cmd_about : INTEGER
Cmd_exit : INTEGER
Cmd_how_to_play : INTEGER
Cmd_new : INTEGER
Cmd_select_game_number : INTEGER
Cmd_select_number_of_cards : INTEGER
Cmd_start : INTEGER
Cmd_stop : INTEGER
End_bitmap_id : INTEGER
Game_menu_id : INTEGER
How_to_play_dialog : INTEGER
Idc_edit : INTEGER
Select_cards_dlg_id : INTEGER
Select_game_number_dlg_id : INTEGER
Start_bitmap_id : INTEGER
Xcell_bitmap_id : INTEGER
Xcell_icon : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


CARD Chart

-- Automatic generation produced by ISE Eiffel --

class
CARD

General
cluster: root_cluster
create: make

Ancestors
APP_CONSTANTS
BASIC_ROUTINES
GAME_CONSTANTS

Queries
card_image : WEL_BITMAP
card_number : INTEGER
height : INTEGER
includes_point (x_pos, y_pos: INTEGER ): BOOLEAN
offset_x : INTEGER
offset_y : INTEGER
overlapped_with (a_card: CARD ): BOOLEAN
width : INTEGER
x_position : INTEGER
y_position : INTEGER

Commands
set_offset_x (a_x: INTEGER )
set_offset_y (a_y: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )

Constraints
card image not void
card image exists
card number set

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


COLUMN Chart

-- Automatic generation produced by ISE Eiffel --

class
COLUMN [G]

General
cluster: root_cluster
create: make

Ancestors
LINKED_LIST [G]

Queries
infix " @ " (i: INTEGER ): [like item ] G
after : BOOLEAN
before : BOOLEAN
changeable_comparison_criterion : BOOLEAN
count : INTEGER
cursor : CURSOR
duplicate (n: INTEGER ): [like Current] COLUMN [G]
exhausted : BOOLEAN
Extendible : BOOLEAN
first : [like item ] G
for_all (test: FUNCTION [ ANY , TUPLE [G], BOOLEAN ]): BOOLEAN
Full : BOOLEAN
has (v: [like item ] G): BOOLEAN
i_th (i: INTEGER ): [like item ] G
index : INTEGER
index_of (v: [like item ] G; i: INTEGER ): INTEGER
index_set : INTEGER_INTERVAL
is_empty : BOOLEAN
isfirst : BOOLEAN
islast : BOOLEAN
item : G
last : [like item ] G
linear_representation : LINEAR [G]
object_comparison : BOOLEAN
occurrences (v: [like item ] G): INTEGER
off : BOOLEAN
one_from_top : G
prunable : BOOLEAN
readable : BOOLEAN
sequential_occurrences (v: G): INTEGER
the_top : G
there_exists (test: FUNCTION [ ANY , TUPLE [G], BOOLEAN ]): BOOLEAN
valid_cursor (p: CURSOR ): BOOLEAN
valid_cursor_index (i: INTEGER ): BOOLEAN
valid_index (i: INTEGER ): BOOLEAN
writable : BOOLEAN

Commands
add (a_item: G)
append (s: SEQUENCE [G])
back
compare_objects
compare_references
do_all (action: PROCEDURE [ ANY , TUPLE [G]])
do_if (action: PROCEDURE [ ANY , TUPLE [G]]; test: FUNCTION [ ANY , TUPLE [G], BOOLEAN ])
extend (v: [like item ] G)
fill (other: CONTAINER [G])
finish
force (v: [like item ] G)
forth
go_i_th (i: INTEGER )
go_to (p: CURSOR )
make
merge_left (other: [like Current] COLUMN [G])
merge_right (other: [like Current] COLUMN [G])
move (i: INTEGER )
prune (v: [like item ] G)
prune_all (v: [like item ] G)
put (v: [like item ] G)
put_front (v: [like item ] G)
put_i_th (v: [like item ] G; i: INTEGER )
put_left (v: [like item ] G)
put_right (v: [like item ] G)
remove
remove_left
remove_right
remove_top
replace (v: [like item ] G)
search (v: [like item ] G)
start
swap (i: INTEGER )
wipe_out

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


GAME Chart

-- Automatic generation produced by ISE Eiffel --

class
GAME

General
cluster: root_cluster
create: make

Ancestors
GAME_CONSTANTS

Queries
card_from_home_cell (cell_number: INTEGER ): INTEGER
card_from_top_of_column (column_number: INTEGER ): INTEGER
card_from_xcell (cell_number: INTEGER ): INTEGER
card_in_xcell (a_card: CARD ; a_xcell: INTEGER ): BOOLEAN
Card_offset : INTEGER
column_empty (column_number: INTEGER ): BOOLEAN
column_from (column_number: INTEGER ): LINKED_LIST [ INTEGER ]
Column_offset : INTEGER
columns : ARRAY [ COLUMN [ INTEGER ]]
First_card : INTEGER
goal_state : BOOLEAN
home_cell_empty (cell_number: INTEGER ): BOOLEAN
Home_cell_offset : INTEGER
legal_candidate : BOOLEAN
Maximum_game_number : INTEGER
Maximum_number_of_cards : INTEGER
Most_left_x_position : INTEGER
Most_top_y_position : INTEGER
Number_of_cells : INTEGER
Number_of_columns : INTEGER
one_from_top_in_column (a_column: INTEGER ): INTEGER
Space_between_cards : INTEGER
Space_between_columns : INTEGER
Start_of_column_y_position : INTEGER
state_change : INTEGER
the_cards : ARRAY [ CARD ]
top_of_column (a_card: CARD ; a_column: INTEGER ): BOOLEAN
White_offset : INTEGER
xcell_empty (cell_number: INTEGER ): BOOLEAN
Xcell_offset : INTEGER

Commands
change_state
deal_game
remove_top_from_column (column_number: INTEGER )
set_go_from (move_from: INTEGER )
set_go_to (to: INTEGER )
shuffle_the_cards (game_number: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


GAME_CONSTANTS Chart

-- Automatic generation produced by ISE Eiffel --

class
GAME_CONSTANTS

General
cluster: root_cluster

Ancestors
ANY

Queries
Card_offset : INTEGER
Column_offset : INTEGER
First_card : INTEGER
Home_cell_offset : INTEGER
Maximum_game_number : INTEGER
Maximum_number_of_cards : INTEGER
Most_left_x_position : INTEGER
Most_top_y_position : INTEGER
Number_of_cells : INTEGER
Number_of_columns : INTEGER
Space_between_cards : INTEGER
Space_between_columns : INTEGER
Start_of_column_y_position : INTEGER
White_offset : INTEGER
Xcell_offset : INTEGER

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


GAME_MANAGER Chart

-- Automatic generation produced by ISE Eiffel --

class
GAME_MANAGER

General
cluster: root_cluster
create: make

Ancestors
GAME_CONSTANTS

Queries
active_card : CARD
Card_offset : INTEGER
cards_in_drawing_order : LINKED_LIST [ INTEGER ]
Column_offset : INTEGER
destination : INTEGER
destination_selected : BOOLEAN
First_card : INTEGER
goal_state_reached : BOOLEAN
Home_cell_offset : INTEGER
Maximum_game_number : INTEGER
Maximum_number_of_cards : INTEGER
Most_left_x_position : INTEGER
Most_top_y_position : INTEGER
move_card : BOOLEAN
Number_of_cells : INTEGER
Number_of_columns : INTEGER
previous_card : CARD
select_empty_column : BOOLEAN
source : INTEGER
source_is_column : BOOLEAN
source_selected : BOOLEAN
Space_between_cards : INTEGER
Space_between_columns : INTEGER
Start_of_column_y_position : INTEGER
the_cards : ARRAY [ CARD ]
White_offset : INTEGER
Xcell_offset : INTEGER

Commands
deal_game
initialize_the_cards
reset_destination
reset_move_status
reset_source
select_destination (x_pos, y_pos: INTEGER )
select_destination_home_cell
select_empty_xcell
select_source (x_pos, y_pos: INTEGER )
shuffle_the_cards (game_number: INTEGER )

Constraints
game not void

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
APP_CONSTANTS
GAME_CONSTANTS
WEL_BIT_OPERATIONS
WEL_FRAME_WINDOW
WEL_ID_CONSTANTS
WEL_IDC_CONSTANTS
WEL_MK_CONSTANTS
WEL_RASTER_OPERATIONS_CONSTANTS
WEL_SYSTEM_METRICS
WEL_WINDOWS_ROUTINES

Queries
About_box : WEL_MODAL_DIALOG
absolute_x : INTEGER
absolute_y : INTEGER
active_card : CARD
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
Card_offset : INTEGER
children : LINKED_LIST [ WEL_WINDOW ]
Class_background : WEL_NULL_BRUSH
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
Column_offset : INTEGER
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
End_bitmap : WEL_BITMAP
ex_style : INTEGER
exists : BOOLEAN
First_card : INTEGER
focused_window : WEL_WINDOW
foreground_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
Home_cell_offset : INTEGER
horizontal_position : INTEGER
How_to_play_box : WEL_MODAL_DIALOG
is_inside : BOOLEAN
item : POINTER
key_down (virtual_key: INTEGER ): BOOLEAN
key_locked (virtual_key: INTEGER ): BOOLEAN
key_to_string (key_data: INTEGER ): STRING
Main_menu : WEL_MENU
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
Maximum_game_number : INTEGER
Maximum_number_of_cards : INTEGER
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
Most_left_x_position : INTEGER
Most_top_y_position : INTEGER
Number_of_cells : INTEGER
Number_of_columns : INTEGER
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
previous_card : CARD
resource_string_id (an_id: INTEGER ): STRING
Scr_height : INTEGER
Scr_width : INTEGER
scroller : WEL_SCROLLER
Select_game_number_dialog : SELECT_GAME_NUMBER_DIALOG
Select_number_of_cards_dialog : SELECT_NUMBER_OF_CARDS_DIALOG
shared : BOOLEAN
shown : BOOLEAN
Space_between_cards : INTEGER
Space_between_columns : INTEGER
Start_bitmap : WEL_BITMAP
Start_of_column_y_position : INTEGER
style : INTEGER
system_directory : STRING
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
tick_count : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
White_offset : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_of_item (hwnd: POINTER ): WEL_WINDOW
window_rect : WEL_RECT
windows_directory : STRING
x : INTEGER
Xcell_offset : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_cursor
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
message_beep_asterisk
message_beep_exclamation
message_beep_hand
message_beep_ok
message_beep_question
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
output_debug_string (s: STRING )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_cursor_position_absolute (x, y: INTEGER )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_cursor
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

Constraints
background dc not void
background dc exists
virtual dc not void
virtual dc exists

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SELECT_GAME_NUMBER_DIALOG Chart

-- Automatic generation produced by ISE Eiffel --

class
SELECT_GAME_NUMBER_DIALOG

General
cluster: root_cluster
create: make

Ancestors
APP_CONSTANTS
WEL_MODAL_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
game_number : INTEGER
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
number_edit : WEL_SINGLE_LINE_EDIT
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
result_id : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_abort
on_cancel
on_ignore
on_no
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_game_number (a_game_number: INTEGER )
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


SELECT_NUMBER_OF_CARDS_DIALOG Chart

-- Automatic generation produced by ISE Eiffel --

class
SELECT_NUMBER_OF_CARDS_DIALOG

General
cluster: root_cluster
create: make

Ancestors
APP_CONSTANTS
WEL_MODAL_DIALOG

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
default_processing : BOOLEAN
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
no_cards : INTEGER
ok_pushed : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
result_id : INTEGER
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
activate
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
on_abort
on_cancel
on_ignore
on_no
on_retry
on_yes
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
terminate (a_result: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


XCELL_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
XCELL_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


MAIN_WINDOW Chart

-- Automatic generation produced by ISE Eiffel --

class
MAIN_WINDOW

General
cluster: root_cluster
create: make

Ancestors
WEL_FRAME_WINDOW

Queries
absolute_x : INTEGER
absolute_y : INTEGER
background_brush : WEL_BRUSH
captured_window : WEL_WINDOW
children : LINKED_LIST [ WEL_WINDOW ]
Class_cursor : WEL_CURSOR
Class_icon : WEL_ICON
Class_menu_name : STRING
Class_name : STRING
Class_style : INTEGER
Class_window_procedure : POINTER
client_rect : WEL_RECT
closeable : BOOLEAN
command (message: INTEGER ): WEL_COMMAND
command_argument (message: INTEGER ): ANY
command_exists (message: INTEGER ): BOOLEAN
commands : WEL_COMMAND_MANAGER
commands_enabled : BOOLEAN
Default_height : INTEGER
Default_id : INTEGER
default_processing : BOOLEAN
Default_style : INTEGER
Default_width : INTEGER
Default_x : INTEGER
Default_y : INTEGER
enabled : BOOLEAN
ex_style : INTEGER
exists : BOOLEAN
focused_window : WEL_WINDOW
has_capture : BOOLEAN
has_focus : BOOLEAN
has_heavy_capture : BOOLEAN
has_horizontal_scroll_bar : BOOLEAN
has_menu : BOOLEAN
has_return_value : BOOLEAN
has_system_menu : BOOLEAN
has_system_window_locked : BOOLEAN
has_vertical_scroll_bar : BOOLEAN
heavy_capture_activated : BOOLEAN
height : INTEGER
horizontal_position : INTEGER
is_inside : BOOLEAN
item : POINTER
maximal_height : INTEGER
maximal_horizontal_position : INTEGER
maximal_vertical_position : INTEGER
maximal_width : INTEGER
maximized : BOOLEAN
menu : WEL_MENU
message_return_value : INTEGER
minimal_height : INTEGER
minimal_horizontal_position : INTEGER
minimal_vertical_position : INTEGER
minimal_width : INTEGER
minimized : BOOLEAN
parent : WEL_WINDOW
placement : WEL_WINDOW_PLACEMENT
scroller : WEL_SCROLLER
shared : BOOLEAN
shown : BOOLEAN
style : INTEGER
system_menu : WEL_MENU
text : STRING
text_length : INTEGER
to_integer : INTEGER
valid_hwnd_constant (c: POINTER ): BOOLEAN
vertical_position : INTEGER
width : INTEGER
window_captured : BOOLEAN
window_rect : WEL_RECT
x : INTEGER
y : INTEGER

Commands
bring_to_top
destroy
disable
disable_commands
disable_default_processing
disable_horizontal_scroll_bar
disable_vertical_scroll_bar
dispose
draw_menu
enable
enable_commands
enable_default_processing
enable_horizontal_scroll_bar
enable_vertical_scroll_bar
hide
hide_horizontal_scroll_bar
hide_scroll_bars
hide_vertical_scroll_bar
horizontal_update (inc, position: INTEGER )
insert_after (a_window: WEL_WINDOW )
invalidate
invalidate_rect (rect: WEL_RECT ; erase_background: BOOLEAN )
invalidate_region (region: WEL_REGION ; erase_background: BOOLEAN )
invalidate_without_background
kill_timer (timer_id: INTEGER )
lock_window_update
maximize
minimize
move (a_x, a_y: INTEGER )
move_absolute (a_x, a_y: INTEGER )
move_and_resize (a_x, a_y, a_width, a_height: INTEGER ; repaint: BOOLEAN )
put_command (a_command: WEL_COMMAND ; message: INTEGER ; argument: ANY )
register_current_window
release_capture
release_heavy_capture
remove_command (message: INTEGER )
resize (a_width, a_height: INTEGER )
restore
scroll (a_x, a_y: INTEGER )
set_capture
set_class_icon (new_icon: WEL_ICON )
set_class_small_icon (new_icon: WEL_ICON )
set_default_processing (value: BOOLEAN )
set_ex_style (an_ex_style: INTEGER )
set_focus
set_heavy_capture
set_height (a_height: INTEGER )
set_horizontal_position (position: INTEGER )
set_horizontal_range (minimum, maximum: INTEGER )
set_icon (a_small_icon, a_big_icon: WEL_ICON )
set_item (an_item: POINTER )
set_menu (a_menu: WEL_MENU )
set_message_return_value (value: INTEGER )
set_parent (a_parent: WEL_WINDOW )
set_placement (a_placement: WEL_WINDOW_PLACEMENT )
set_shared
set_style (a_style: INTEGER )
set_text (a_text: STRING )
set_timer (timer_id, time_out: INTEGER )
set_unshared
set_vertical_position (position: INTEGER )
set_vertical_range (minimum, maximum: INTEGER )
set_width (a_width: INTEGER )
set_x (a_x: INTEGER )
set_y (a_y: INTEGER )
set_z_order (z_order: POINTER )
show
show_horizontal_scroll_bar
show_scroll_bars
show_vertical_scroll_bar
show_with_option (cmd_show: INTEGER )
unlock_window_update
unset_menu
update
update_cached_style (new_ex_style, old_ex_style: INTEGER )
validate_rect (rect: WEL_RECT )
validate_region (region: WEL_REGION )
vertical_update (inc, position: INTEGER )
win_help (help_file: STRING ; a_command, data: INTEGER )

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


XY_DEMO Chart

-- Automatic generation produced by ISE Eiffel --

class
XY_DEMO

General
cluster: root_cluster
create: make

Ancestors
WEL_APPLICATION

Queries
Accelerators : WEL_ACCELERATORS
application : WEL_APPLICATION
application_main_window : WEL_COMPOSITE_WINDOW
Default_show_command : INTEGER
idle_action_enabled : BOOLEAN
is_application_main_window (window: WEL_COMPOSITE_WINDOW ): BOOLEAN
is_dialog (hwnd: POINTER ): BOOLEAN
Main_window : MAIN_WINDOW
runable : BOOLEAN

Commands
disable_idle_action
enable_idle_action
idle_action
run

-- Generated by ISE Eiffel --

-- For more details: www.eiffel.com --


Reference for `attribute_exists'

attribute_exists - Does attribute exist or is visible?

SYNOPSYS

#include "eif_cecil.h"

EIF_BOOLEAN attribute_exists (EIF_REFERENCE object, char * name);

DESCRIPTION

The attribute_exists() macro returns EIF_TRUE or EIF_FALSE when the attribute of name name exists in the Eiffel object (reference) ref.

RETURN VALUE

EIF_TRUE or EIF_FALSE.

CONFORMANCE

ISE Eiffel 4.5 and later.

SEE ALSO

eif_attribute (1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_adopt'

eif_adopt - adopt an Eiffel object.

SYNOPSYS

#include "eif_hector.h"

EIF_OBJECT eif_adopt (EIF_OBJECT obj);

DESCRIPTION

The eif_adopt() function adopts obj. By adopting it, the user prevents obj from being unprotected automatically by the Eiffel run-time. The run-time protects automatically the Eiffel objects passed to a C external before entering in it and unprotects them after exiting the C external. To keep this protection later on, you must call eif_adopt().

RETURN VALUE

The eif_adopt() function returns an EIF_OBJECT. This return value can be used later on to access the nested protected Eiffel reference with eif_access().

CONFORMANCE

ISE Eiffel 4.1 and later.

SEE ALSO

eif_access (1),eif_protect (1),eif_wean (1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_attribute'.

eif_attribute - return the attribute of an Eiffel object.

SYNOPSYS

#include "eif_cecil.h"

EIFFEL_TYPE eif_attribute (EIF_REFERENCE object, char * name, EIFFEL_TYPE, int * status);

DESCRIPTION

The eif_attribute() macro returns the attribute of name name, which is of type EIFFEL_TYPE.

EIFFEL_TYPE is the type of the Eiffel attribute. It can be: EIF_INTEGER, EIF_CHARACTER, EIF_BOOLEAN, EIF_DOUBLE, EIF_REAL, or EIF_REFERENCE.

If status is NULL then no status is set. Otherwise the status of the call is put into *status. Its value is one of the following:

EIF_NO_ATTRIBUTE
No attribute was found
EIF_CECIL_OK
Attribute was found.
EIF_CECIL_ERROR
An undefined error occurred, object may not be valid.

If the visible exception is enabled, then a visible exception is raised upon failure (EIF_NO_ATTRIBUTE, EIF_CECIL_ERROR).

RETURN VALUE

Upon failure, it returns (EIFFEL_TYPE) 0, otherwise the attribute is returned.

NOTES

If the return value is an EIF_REFERENCE, you must protect it with eif_protect().
You cannot access a constant attribute, or the result of a once function with eif_attribute().

CONFORMANCE

ISE Eiffel 4.5 and later.

COMPATIBILITY

eif_attribute ( object, name, type, NULL)
is equivalent to:
eif_field ( object, name, type)
which is deprecated.

SEE ALSO

eif_protect(1) , attribute_exists(1) , eif_procedure(1) , eif_reference_function(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_attribute_type'

eif_attribute_type - return the type of an Eiffel attribute.

SYNOPSYS

#include "eif_cecil.h"

int eif_attribute_type (char * attr, EIF_TYPE_ID tid);

DESCRIPTION

The eif_attribute_type() function returns the type of the attribute attr, from the Eiffel type, which type identifier is tid.

RETURN VALUE

Upon failure, it returns EIF_NO_TYPE. Otherwise, the return value can be one of the following: EIF_INTEGER_TYPE, EIF_CHARACTER_TYPE, EIF_BOOLEAN_TYPE, EIF_DOUBLE_TYPE, EIF_REAL_TYPE, EIF_REFERENCE_TYPE, EIF_EXPANDED_TYPE, EIF_BIT_TYPE.

CONFORMANCE

ISE Eiffel 4.5 and later.

SEE ALSO

eif_protect(1) , attribute_exists(1) , eif_procedure(1) , eif_reference_function(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_bit_function'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails (function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for eif_boolean_function'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails (function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_character_function'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails (function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_disable_visible_exception'

eif_enable_visible_exception, eif_disable_visible_exception - enable and disable visible exception .

SYNOPSYS

#include "eif_cecil.h"
void eif_enable_visible_exception ();

void eif_disable_visible_exception ();

DESCRIPTION

The eif_enable_visble_exception() routine enables the visible exception, while eif_disable_visible_exception() disables it. These routines can be used for debugging purpose. A visible exception is raised when the user tries to access to an Eiffel attribute or a Eiffel routine address which is not visible.

The visible exception is disabled by default.

CONFORMANCE

ISE Eiffel 4.5 and later.

COMPATIBILTY

On ISE Eiffel 4.3 and 4.4, the visible exception is enabled by default.

SEE ALSO

eif_attribute(1) , eif_procedure(1), eif_reference_function(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_double_function'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails (function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_enable_visible_exception'

eif_enable_visible_exception, eif_disable_visible_exception - enable and disable visible exception .

SYNOPSYS

#include "eif_cecil.h"
void eif_enable_visible_exception ();

void eif_disable_visible_exception ();

DESCRIPTION

The eif_enable_visble_exception() routine enables the visible exception, while eif_disable_visible_exception() disables it. These routines can be used for debugging purpose. A visible exception is raised when the user tries to access to an Eiffel attribute or a Eiffel routine address which is not visible.

The visible exception is disabled by default.

CONFORMANCE

ISE Eiffel 4.5 and later.

COMPATIBILITY

On ISE Eiffel 4.3 and 4.4, the visible exception is enabled by default.

SEE ALSO

eif_attribute(1) , eif_procedure(1), eif_reference_function(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_integer_function'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails (function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_name'

eif_name - return the class name for a type identifier.

SYNOPSYS

#include "eif_cecil.h"

char *eif_name (EIF_TYPE_ID tid);

DESCRIPTION

The eif_name() function returns the name of the class corresponding to tid.

RETURN VALUE

A statically allocated C string which is the name of the class. If tid is invalid, it returns NULL.

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_name() is equivalent to eif_name_by_tid().

SEE ALSO

eif_type(1) , eif_type_by_reference(1), eif_type_id(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_name_by_tid'

eif_name_by_tid - return the class name for a type identifier.

SYNOPSYS

#include "eif_cecil.h"

char *eif_name_by_tid (EIF_TYPE_ID tid);

DESCRIPTION

The eif_name_by_tid() function returns the name of the class corresponding to tid.

RETURN VALUE

A statically allocated C string which is the name of the class. If tid is invalid, it returns NULL.

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_name() is equivalent to eif_name_by_tid().

SEE ALSO

eif_type(1) , eif_type_by_reference(1), eif_type_id(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_pointer_function.html'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails (function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_procedure'

eif_procedure - return the address of an Eiffel procedure.

SYNOPSYS

#include "eif_cecil.h"

EIF_PROCEDURE eif_procedure (char * name, int * tid);

DESCRIPTION

The eif_procedure() function returns the address of the Eiffel procedure of name name from the class, which type identifier is tid.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails ( the procedure does not exist or is not visible). Otherwise, the address of the procedure is returned.

NOTES

The Eiffel procedure cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine obtained with eif_procedure() when calling it with real arguments.

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_procedure() is equivalent to eif_proc(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_reference_function(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_protect'

eif_protect - protect an Eiffel reference

SYNOPSYS

#include "eif_hector.h"

EIF_OBJECT eif_protect (EIF_REFERENCE ref);

DESCRIPTION

The eif_protect() function protects the Eiffel reference ref from the GC. It keeps a reference on it so that the Garbage Collector does not collect it if it is not referenced from Eiffel any longer.

RETURN VALUE

The eif_protect() function returns an EIF_OBJECT. This EIF_OBJECT can be used later on to access ref with eif_access ().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILTY

It is equivalent to henter(), which is deprecated.

SEE ALSO

eif_access(1), eif_protect(1) , eif_wean(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_real_function'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails (function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_reference_function'

eif_reference_function, eif_integer_function, eif_real_function, eif_double_function, eif_character_function, eif_boolean_function, eif_pointer_function, eif_bit_function
- return the address of an Eiffel function.

SYNOPSYS

#include "eif_cecil.h"

EIF_REFERENCE_FUNCTION eif_reference_function (char * name, int * tid);

EIF_INTEGER_FUNCTION eif_integer_function (char * name, int * tid);

EIF_CHARACTER_FUNCTION eif_character_function (char * name, int * tid);

EIF_REAL_FUNCTION eif_real_function (char * name, int * tid);

EIF_DOUBLE_FUNCTION eif_double_function (char * name, int * tid);

EIF_BOOLEAN_FUNCTION eif_boolean_function (char * name, int * tid);

EIF_POINTER_FUNCTION eif_pointer_function (char * name, int * tid);

EIF_BIT_FUNCTION eif_bit_function (char * name, int * tid);

DESCRIPTION

These functions return the address of the Eiffel function of name name from the class, which type identifier is tid.
Use eif_reference_function for an Eiffel function returning an Eiffel reference.
Use eif_integer_function for an Eiffel function returning an Eiffel integer.
Use eif_character_function for an Eiffel function returning an Eiffel character.
Use eif_real_function for an Eiffel function returning an Eiffel real.
Use eif_double_function for an Eiffel function returning an Eiffel double.
Use eif_boolean_function for an Eiffel function returning an Eiffel boolean.
Use eif_pointer_function for an Eiffel function returning an Eiffel pointer.
Use eif_bit_function for an Eiffel function returning an Eiffel bit.

If the visible exception is enabled, it raises an visible exception upon failure.

RETURN VALUE

It returns NULL when it fails ( the function does not exist or is not visible). Otherwise, the address of the function is returned.

NOTES

The Eiffel function cannot be a C external. In this case, you must directly call the C routine.
The return value is an address: to use it as a routine, you must call it with arguments or at least with ().
No argument type checking is done. You may cast the address of an Eiffel routine, obtained with these functions, when calling it with real arguments.
If the function returns an Eiffel reference, you must protect it with eif_protect().

CONFORMANCE

ISE Eiffel 4.4 and later.

COMPATIBILITY

eif_reference_function() is equivalent to eif_fn_ref(), which is deprecated.
eif_integer_function() is equivalent to eif_fn_int(), which is deprecated.
eif_real_function() is equivalent to eif_fn_float(), which is deprecated.
eif_double_function() is equivalent to eif_fn_double(), which is deprecated.
eif_character_function() is equivalent to eif_fn_char(), which is deprecated.
eif_bit_function() is equivalent to eif_fn_bit(), which is deprecated.
eif_boolean_function() is equivalent to eif_fn_bool(), which is deprecated.
eif_pointer_function() is equivalent to eif_fn_pointer(), which is deprecated.

SEE ALSO

eif_type_id(1), eif_protect(1), eif_procedure(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_string'

eif_string - build an Eiffel string from a C string.

SYNOPSYS

#include "eif_plug.h"

EIF_REFERENCE eif_string (char * string);

DESCRIPTION

The eif_string() macro returns the corresponding Eiffel string corresponding to the C string string.

The return value does not reference string.

NOTES

This function return an Eiffel reference, which must be protected with eif_protect().

CONFORMANCE

ISE Eiffel 4.5 and later.

COMPATIBILITY

eif_string() is equivalent to RTMS(), which is deprecated.

SEE ALSO

eif_protect(1) , eif_create(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_type'

eif_type - return the type identifier of an Eiffel object.

SYNOPSYS

#include "eif_cecil.h"

EIF_TYPE_ID eif_type (EIF_OBJECT object);

DESCRIPTION

The eif_type() function returns the type identifier corresponding to object.

RETURN VALUE

Type identifier of object. The behavior is unknown if object is not a valid Eiffel object.

CONFORMANCE

ISE Eiffel 4.3 and later.

COMPATIBILITY

eif_type() is equivalent to eif_type_by_reference (eif_access (object)).

SEE ALSO

eif_type_by_reference(1) , eif_type_id(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_type_by_name'

eif_type_by_name - return the type identifier.

SYNOPSYS

#include "eif_gen_conf.h"

EIF_TYPE_ID eif_type_by_name (char * type);

DESCRIPTION

The eif_type_by_name() function returns the type identifier corresponding to type, which is the name of the type.

RETURN VALUE

The eif_type_by_name() function returns the type
EIF_NO_TYPE
type does not match any type in the system. Check the name of the type, or include the class for this type in your system.

NOTES

An error cannot be caught by a visible exception.
The type is not necessary visible.

CONFORMANCE

ISE Eiffel 4.3 and later.

COMPATIBILITY

eif_type_by_name() is equivalent to eif_type_id().

SEE ALSO

eif_reference_function(1) , eif_procedure(1) , eif_type(1), eif_name(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_type_by_reference'

eif_type_by_reference - return the type identifier of an Eiffel reference.

SYNOPSYS

#include "eif_cecil.h"

EIF_TYPE_ID eif_type_by_reference (EIF_REFERENCE reference);

DESCRIPTION

The eif_type_by_reference() function returns the type identifier corresponding to reference.

RETURN VALUE

Type identifier of reference. The behavior is unknown if reference is not a valid Eiffel reference.

CONFORMANCE

ISE Eiffel 4.5 and later.

SEE ALSO

eif_type(1) , eif_name(1), eif_type_id(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_type_id'

eif_type_id - return the type identifier.

SYNOPSYS

#include "eif_gen_conf.h"

EIF_TYPE_ID eif_type_id (char * type);

DESCRIPTION

The eif_type_id() function returns the type identifier corresponding to type, which is the name of the type.

RETURN VALUE

The eif_type_id() function returns the type
EIF_NO_TYPE
type does not match any type in the system. Check the name of the type, or include the class for this type in your system.

NOTES

An error cannot be caught by a visible exception.
The type is not necessary visible.

CONFORMANCE

ISE Eiffel 4.3 and later.

COMPATIBILITY

eif_type_id() is equivalent to eif_type_by_name(). With Eiffel 4.2 and earlier, use eif_generic_type() for generic types.

SEE ALSO

eif_reference_function(1) , eif_procedure(1) , eif_type(1), eif_name(1).

Markup created by unroff 1.0, November 15, 1999.


Reference for `eif_wean'

eif_wean - release an Eiffel reference's protection.

SYNOPSYS

#include "eif_hector.h"

EIF_REFERENCE eif_wean (EIF_OBJECT obj);

DESCRIPTION

The eif_wean() function releases the protection of the Eiffel reference, which is protected by the Eiffel object obj.

RETURN VALUE

It returns the Eiffel reference previously protected by obj.

CONFORMANCE

ISE Eiffel 4.1 and later.

SEE ALSO

eif_access(1) , eif_adopt(1), eif_protect(1).

Markup created by unroff 1.0, November 15, 1999.


CECIL Reference

 Index of CECIL features
  • RTMS()
  • attribute_exists()
  • eif_adopt()
  • eif_attribute()
  • eif_attribute_type()
  • eif_bit_function()
  • eif_boolean_function()
  • eif_character_function()
  • eif_disable_visible_exception()
  • eif_double_function()
  • eif_enable_visible_exception()
  • eif_integer_function()
  • eif_name()
  • eif_name_by_tid()
  • eif_pointer_function()
  • eif_procedure()
  • eif_protect()
  • eif_real_function()
  • eif_reference_function()
  • eif_string()
  • eif_type()
  • eif_type_by_name()
  • eif_type_by_reference()
  • eif_type_id()
  • eif_wean()


Example procedure topic

Reordering new metrics

To reorder new metrics, you must have already clicked on [image] in the "Metric" tab of the context tool.

You can then either use the "Up" and "Down" buttons, or use the pick and drop facility.

1) The "Up" and "Down" buttons

  1. Select a metric ("Up" and "down" are not sensitive when nothing is selected, neither if if the selected metric is respectively the first or the last one)
  2. To move up the metric, click on "Up", if sensitive, as many times as needed.
  3. To move down the metric, click on "Down", if sensitive, as many times as needed.
  4. Click on "Save" to validate your changes.
  5. Click on "Exit" to hide the dialog.

2) The pick and drop facility

  1. Select a metric by right clicking.
  2. Drop the selected metric on another one to insert it.

See Also
Pick and drop, deleting new metrics, editing new metrics, importing new metrics.


Example procedure topic

Deleting new metrics

To delete a useless metric, you must have already clicked on [image] in the "Metric" tab of the context tool.

  1. Select a metric
  2. Click on the "Delete" button.
  3. Click on "Save" to make deletion effective.
  4. Click on "Exit" to hide the interface.

Caution: After you have saved, metric is definitely lost. If you have clicked on "delete" by mistake, do not save changes!

See Also
reordering new metrics, editing new metrics, importing new metrics.


Example procedure topic

Editing new metrics

To edit a metric, you must have already clicked on [image] in the "Metric" tab of the context tool.

  1. Select a metric
  2. Click on the "Edit" button or double click on the metric.
    The interface previously used to define new metrics will pop up, filled regarding the selected metric's definition. For e.g. editing the selected metric above leads to:

  3. If you make some changes, "Save" will be sensitive so that you can register your modifications.
  4. You can also define other new metrics if wished
  5. Click on "OK" to save your changes if any and exit. Click on "Cancel" to exit editing.
  6. If you have introduced some changes, you have to save again on the main interface.
  7. Click on "Exit" to hide the interface.

See Also
reordering new metrics, deleting new metrics, importing new metrics.


Example procedure topic

Importing new metrics

To import a set of metrics from a file, you must have already clicked on [image] in the "Metric" tab of the context tool.

  1. Click on the "Import..." button.
  2. A dialog allows you to select a file containing a set of metrics.
  3. After you have opened a file containing metrics, the following interface will pop up to help you making your selection:

    - On selecting a metric, its definition formula appears in the field "Formula of the selected metric", its unit appears in the "Unit of the selected metric" field..
    - To import metrics from the selected file to the current system, you can either click on "Add->", or pick and drop the selected metric from the "New metrics" list to the "Current metrics" one
    - To remove a metric you have mistakenly imported, you can either click on "<-Remove", or pick and drop the selected metric from the "Current metrics" list to the "New metrics" one.
    - You can also reorder metrics using the pick and drop facility inside each list.
  4. Click on "OK" to validate importation.
  5. If you have introduced some changes, you have to save again on the main interface.
  6. Click on "Exit" to hide the interface.

See Also:
Pick and drop, reordering new metrics, deleting new metrics, editing new metrics.


Differences between ETL 2nd printing and ISE implementation

Added classes

  • new basic classes have been added: INTEGER_8, INTEGER_16, INTEGER_64 and WIDE_CHARACTER. INTEGER is now specified as having a 32 bits representation
  • new TUPLE, ROUTINE, PROCEDURE and FUNCTION classes required by the agent mechanism.

Added keywords

  • Precursor
  • agent: new keyword used by the Agent mechanism.
  • create: Instead of using the famous exclamation mark to create an instance of a class, you can use the keyword `create'. Below you will find a correspondence table between the old and the new syntaxes. The old syntax is still valid, but at some points ISE will remove it from its implementation:
    Old syntax | New syntax
    !! a | create a
    !! a.make | create a.make
    !B! a | create {B} a
    !B! a.make | create {B} a.make

Added semantics

  • Generic creation
  • Expression creation: you can now create an object within an expression. For example, you want to create an object and pass it as an argument to a function. Whereas you had to create a local variable, create the object and pass it to the function, you now simply need to pass to the function the creation expression. Here is a small example:
    Old method New method
    local
    a: STRING
do
    !! a.make (10)
    f (a)
end

    do
    f (create {STRING}.make (10))
end
    This is also very useful since it can improve the power of assertions.
  • Mutually recursive constraints: one can now write class A [H, G->H] or class B [H -> C, G -> ARRAY [H]]. As a result, the declaration A [D, E] is valid only if E is a descendant of D. Similarly, the declaration B [E, ARRAY [D]] is not valid, if E is a descendant of D.
  • Tuples
  • Agents
  • Feature access:
        local
        value: INTEGER
    do
        value := feature {MY_CLASS}.value
    end

    The previous call is valid, if and only if:
    • value is a feature representing a constant of a basic type (INTEGER, DOUBLE or CHARACTER)
    • value is a C/C++/DLL external feature
    • value is an IL static external feature

Added external support

Look at the page for C and C++ with the introduction of `struct' and C++ external features encapsulation.


Major changes between ISE Eiffel 4.5 and ISE Eiffel 5.0:

  • Assertions checking
  • EiffelThread
  • Miscellaneous


Assertions checking configuration changes

One of the major differences between 4.5 and 5.0 is how to specify the assertion checking in the ace file or in the project settings window. In 4.5, assertions of a certain type where checked if their level was below the requested level. Here is what the level hierarchy looked like:

  1. require
  2. ensure
  3. loop
  4. check
  5. invariant
  6. all

Meaning that you could not just check one type of assertions. With 5.0 this is now possible and we changed the presentation to follow the cost to evaluate a given type of assertions, the first one being usually the less expensive:

  1. check
  2. require
  3. ensure
  4. loop
  5. invariant
  6. all

The default assertion level has changed too. Not specifying any assertion level used to be equivalent to selecting the 'require' level. This is not the case any more in 5.0.


Compiler differences from 4.5 to 5.0

What's new

  • Implementation of new external syntax.
  • Implementation of verbatim strings.
  • Implementation of agents.
  • Implementation of agent creations on `Result' and `Current' object.
  • Improved incrementality of the C compilation: fewer directories will have their C files changed after a freeze.
  • New MSIL generation.
  • Introduction of 4 new basic classes: INTEGER_8, INTEGER_16, INTEGER_64, WIDE_CHARACTER.
  • Changed the storable mechanism so that we do not store POINTER objects with their value, instead we store a NULL value. As a consequence it is safe to store on disk objects that have references to C objects. Upon retrieval those references will be equal to `default_pointer'. This is now the default behavior, if someone wants to have the previous behavior, simply call `set_keep_pointer_value' from STORABLE.

Improvements

  • New run-time speed improvement (between 30 to 100% faster than the 4.5 release).
  • Compiler that is much faster (between 200 and 300% faster than 4.5).
  • Compiler now detects unused local variables (at freeze/finalize time only)

Bug fixes

  • Compiler now fixes incrementality issues with frozen/melted code.
  • Degree 4/Degree 3 crash on *_SERVER when doing an incremental recompilation has been fixed.
  • Fixed crash when using creation expression that includes a feature call.
  • Fixed creation of an ARRAY of BIT type.
  • CHARACTER has been extended to support the extended ASCII which means that the following expressions are now True instead of being False as it was in our previous version:
    • '%/127/' < '%/128/'
    • '%/127/' < '%/128/'
  • When using `independent_store', in case of retrieval error due to a name change in one of the class attributes we will display the original attribute name that was used to make the storable file. This will help when managing many storable files.


Major changes between ISE Eiffel 5.0 and ISE Eiffel 5.1:

What's new

  • .NET generation now includes:
    • Support for multiple inheritance.
    • Support for generics.
    • Partial implementation of generic conformance (same as what was supported up to and including ISE Eiffel 4.2).
    • Support for tuples and agents.
    • Support for any existing Eiffel code that does not use C externals.
    • Partial support for compiling Eiffel libraries using C externals (e.g. WEL)

    And the following limitations:

    • Eiffel classes cannot inherit from non-Eiffel .NET classes (but they can be clients).
    • The compiler performances are rather poor now (both in terms of memory usage and speed)

    Those limitations should disappear with 5.2 which will be our official release that fully supports .NET

  • Support for INTEGER_64 constants. Now a manifest integer value that is written in decimal or hexadecimal format that can't fit into an INTEGER_32 will be automatically promoted to an INTEGER_64 constant value.
  • New feature access syntax for accessing constants, C/C++ externals and IL static externals. Check out more here.

Improvements

  • Compiler that is about 20% faster than 5.0.

Bug fixes

  • Fixed VAPE errors that were not previously reported. Now VAPE errors are checked against arguments of a feature used in a precondition and are also checked for a qualified call.
  • Fixed a conformance bug that made a manifest array not conform to ANY.
  • Fixed a generic conformance bug where an assignment attempt would change the behavior of the execution.
  • Fixed a wrongly reported error by the compiler in the following case:

    In a system that has a generic class CLIENT with constraint `G -> SUPPLIER create make end', where the creation procedure of SUPPLIER is exported to {CLIENT}. If another class has an attribute `x: CLIENT [SUPPLIER]' the compiler reports a VTCG error, though it should accept the classes.

  • Fixed a crash when one of the following command lines was used in a directory with no existing project that contains a file named "Ace":
    ec -flat      -all
ec -short     -all
ec -flatshort -all
ec -flat      -all_and_parents
ec -short     -all_and_parents
ec -flatshort -all_and_parents
  • Fixed a bug in output display between standard output and error output. Doing the following:
    io.put_string ("foo%N")
io.error.put_string ("bar%N")

    you get the following output when simply launched from the command line:

    foo
bar

    however if you do:

    my_program >& RESULT

    to redirect both standard and error outputs to RESULT you get in the RESULT file this incorrect content:

    bar
foo
  • Fixed a non reported VTEC or VTCG error when an invalid type used as actual generic parameters in an explicit type in a creation instruction.


Major changes between ISE Eiffel 5.1 and ISE Eiffel 5.2:

What's new

  • .NET generation now includes support for the following language features:
    • Support for multiple inheritance.
    • Support for generics.
    • Partial implementation of generic conformance
    • Support for tuples and agents.
    • Support for any existing Eiffel code that does not use C externals.
    • Support for compiling Eiffel libraries using C externals that are not related to the ISE C runtime.

    And the following limitations:

    • Eiffel classes cannot inherit from non-Eiffel .NET classes (but they can be clients).
    • No support for `expanded' keyword.
  • .NET generation now supports assembly signing in enterprise edition.
  • .NET generation now supports precompiled libraries.
  • Supports for manifest integer constants of different sizes, i.e. you can now assign for example the value `8' to a location of type INTEGER_8, INTEGER_16, INTEGER or INTEGER_64, however you can only assign the value `254' to a location of type INTEGER_16, INTEGER or INTEGER_64.

Improvements

  • Compiler that is about 20% faster than 5.1.
  • Runtime is about 10-20% faster than 5.1

Changes

  • One cannot create an instance of a basic expanded class (BOOLEAN, CHARACTER, INTEGER_8, INTEGER_16, INTEGER, INTEGER_64, POINTER, REAL, DOUBLE), you will now get a VGCC(6) error. Instead directly assign to it, or create an instance of its corresponding _REF class.

Bug fixes

  • Fixed memory corruption issue when trying to access an INTEGER_64 value.
  • Fixed a problem with manifest INTEGER_64 constants whose values were incorrectly interpreted.
  • Fixed VAPE errors that were not previously reported in 5.1. Now VAPE errors are checked against call to infix and prefix features.